Repository navigation
Conversation
Collaborator
Author
|
Superceded by #799, which is reviewed. |
lengyijun
pushed a commit
to awesome-lambda-calculus/cslib
that referenced
this pull request
Aug 20, 2026
This PR develops a concept of modal reasoning for Lean theorems, powered by the laws of modal logic. This development led to some polishing for `Congruence` and some definitions for `Relation`. Specifically, the PR: - Introduces the first development where CSLib's modal logic is instantiated with Lean's `Prop` as the type of atomic propositions. We use this to construct models out of Lean predicates and containers and show some general properties in terms of logical equivalence. - Introduces a construction that, given any scalar multiplication operator, builds an accessibility relation. If the operator is an action of some kind (as defined in mathlib), this accessibility relation has interesting properties (like transitivity or diamond) that are relevant for modal reasoning. - Develops an example of how this framework can be used to prove mathematical theorems. In particular, we apply the new construction to obtain an accessibility relation on `Ideal`s. In this interpretation, membership of radicals of ideals is characterised by the diamond connective in modal logic. This allows for applying modal logic to proving properties about radicals. - As examples, we show that `Ideal.radical_inf` and `Ideal.radical_idem` from mathlib can be proven by applying modal logical equivalence. This put the ergonomics and expressive power of our infrastructure for modal logic, logical equivalence, relations, and congruence to the test. This PR also: - Polishes a bit the ergonomics of LawfulCongruence (e.g., by making `Congruence.r` an `abbrev` so that typeclass resolution works in proofs). - Adds a `Preserves` property for relations. - Defines and proves soundness and completeness of modal axioms for relations with the diamond property. - Refactors a bit LogicalEquivalence for modal logic so that it is more fundamental (based on a single model instead of a set of models, and then derives the latter on the first). The last point not only helps with proofs, but also aligns logical equivalence with how it is handled in HML. This means that we can start working on a shared abstraction for this kind of logics, which would then derive the natural notion of logical equivalence for free. Depends on leanprover#788 --------- Co-authored-by: Thomas Krishna Waring <51426330+thomaskwaring@users.noreply.github.com>
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 proves the validity of Axiom L (Löb's theorem for modal logic) under the expected conditions (transitivity and converse well-foundedness). I've also refactored axiom statements to use an abbreviation (IsAxiom), since I started finding the previous way of doing it with manual quantifications cumbersome and error-prone.