Repository navigation
feat(ModalLogic+Congruence): modal reasoning for Lean - #799
Conversation
thomaskwaring
left a comment
There was a problem hiding this comment.
preliminary review here, but overall i like this
one question (which i was thinking about as relates to the earlier axiom L PR) is whether we can state IsAxiom as an inference system, where the judgement is r ⊨ φ for "this the proposition is valid at every world for every valuation" — logically it is the same but it avoids introducing a new definition and might down-the-track mesh better with our infrastructure. what do you think?
Co-authored-by: Thomas Krishna Waring <51426330+thomaskwaring@users.noreply.github.com>
Co-authored-by: Thomas Krishna Waring <51426330+thomaskwaring@users.noreply.github.com>
Co-authored-by: Thomas Krishna Waring <51426330+thomaskwaring@users.noreply.github.com>
Co-authored-by: Thomas Krishna Waring <51426330+thomaskwaring@users.noreply.github.com>
Co-authored-by: Thomas Krishna Waring <51426330+thomaskwaring@users.noreply.github.com>
Co-authored-by: Thomas Krishna Waring <51426330+thomaskwaring@users.noreply.github.com>
Co-authored-by: Thomas Krishna Waring <51426330+thomaskwaring@users.noreply.github.com>
Like this? I think it's a good idea, might even go in the class for modal-like logics later on. I've tried it and the proofs don't work out of the box though, there's some plumbing that becomes necessary compared to the current EDIT: I've figured it out. :) Now in the PR, let me know what you think. |
thomaskwaring
left a comment
There was a problem hiding this comment.
i like the new Axiom design i think! this review is mostly some further golfing / simplifying of proofs, plus a few natural extensions to Modal.Lean.SMul
Co-authored-by: Thomas Krishna Waring <51426330+thomaskwaring@users.noreply.github.com>
Co-authored-by: Thomas Krishna Waring <51426330+thomaskwaring@users.noreply.github.com>
Co-authored-by: Thomas Krishna Waring <51426330+thomaskwaring@users.noreply.github.com>
Co-authored-by: Thomas Krishna Waring <51426330+thomaskwaring@users.noreply.github.com>
Co-authored-by: Thomas Krishna Waring <51426330+thomaskwaring@users.noreply.github.com>
Co-authored-by: Thomas Krishna Waring <51426330+thomaskwaring@users.noreply.github.com>
Co-authored-by: Thomas Krishna Waring <51426330+thomaskwaring@users.noreply.github.com>
Co-authored-by: Thomas Krishna Waring <51426330+thomaskwaring@users.noreply.github.com>
Co-authored-by: Thomas Krishna Waring <51426330+thomaskwaring@users.noreply.github.com>
Co-authored-by: Thomas Krishna Waring <51426330+thomaskwaring@users.noreply.github.com>
Co-authored-by: Thomas Krishna Waring <51426330+thomaskwaring@users.noreply.github.com>
Co-authored-by: Thomas Krishna Waring <51426330+thomaskwaring@users.noreply.github.com>
Co-authored-by: Thomas Krishna Waring <51426330+thomaskwaring@users.noreply.github.com>
|
All caught up @thomaskwaring. :) |
thomaskwaring
left a comment
There was a problem hiding this comment.
thanks for looking at those grind annotations, to my understanding it's working how we'd hope now (not unfolding definitions, etc).
i'm happy with this now, i'd appreciate one more pair of eyes on it to be sure, but i'll approve in the meantime. also, am i right in assuming this supercedes #788 ?
Yes, it does! I'll close the other one. |
Co-authored-by: Thomas Krishna Waring <51426330+thomaskwaring@users.noreply.github.com>
Co-authored-by: Thomas Krishna Waring <51426330+thomaskwaring@users.noreply.github.com>
Co-authored-by: Thomas Krishna Waring <51426330+thomaskwaring@users.noreply.github.com>
Co-authored-by: Thomas Krishna Waring <51426330+thomaskwaring@users.noreply.github.com>
Co-authored-by: Thomas Krishna Waring <51426330+thomaskwaring@users.noreply.github.com>
Co-authored-by: Thomas Krishna Waring <51426330+thomaskwaring@users.noreply.github.com>
Co-authored-by: Thomas Krishna Waring <51426330+thomaskwaring@users.noreply.github.com>
Co-authored-by: Thomas Krishna Waring <51426330+thomaskwaring@users.noreply.github.com>
Co-authored-by: Thomas Krishna Waring <51426330+thomaskwaring@users.noreply.github.com>
chenson2018
left a comment
There was a problem hiding this comment.
I reviewed very lightly. I'm suspicious of how much abbrev appears, but otherwise I trust Thomas's judgement.
|
@chenson2018 glad to hear it :) i can't comment much on |
|
Let's leave it as is for now, I think this can be refactored later. |
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
Congruenceand some definitions forRelation.Specifically, the PR:
Propas 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.Ideals. 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.Ideal.radical_infandIdeal.radical_idemfrom 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:
Congruence.ranabbrevso that typeclass resolution works in proofs).Preservesproperty for relations.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 #788