feat(Logic): General Modal Logic - #863
Open
fmontesi wants to merge 10 commits into
Open
Conversation
Shreyas4991
reviewed
Sep 4, 2026
Shreyas4991
left a comment
Contributor
There was a problem hiding this comment.
It seems the unary poly functor stuff is useful even beyond modal logic and could be factored into a separate PR. This would shorten this PR.
| public import Cslib.Init | ||
| public import Mathlib.Data.PFunctor.Univariate.Basic | ||
|
|
||
| /-! # Additional basic theory on polynomial functors -/ |
Contributor
There was a problem hiding this comment.
This PR seems a bit large. Maybe this API for PFunctors could be a separate PR. It seems fairly straightforward merge.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds general modal logic (
Modal/Basic.lean), formalising the approach in the reference textbook 'Modal Logic' by Blackburn et al. based on similarity types (operator signatures). The formalisation is actually a bit more general: operator signatures are formalised using polynomial functors (PFunctor), so the argument positions of different operators can be of different types, and there are no assumptions on finiteness of operator arities.Basic modal logic, unary modal logics, dynamic modal logics, and HML are all recovered as special cases that impose assumptions on the operator signature. This allows for reusing proof infrastructure across all modal logics. All tests have been accordingly refactored to check that reuse works as intended and that abstractions do not leak too aggressively across specialisations of general modal logic.