-
Notifications
You must be signed in to change notification settings - Fork 191
feat(ModalLogic/LambdaCalculus): modal grind set and proof of type safety for simply typed lambda calculus #840
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
22252af
modal proof of progress for Stlc
fmontesi d266ce0
merge main
fmontesi c327c8f
mk_all
fmontesi 260a5dc
docs
fmontesi e3fc6ce
review comments
fmontesi 1243fa7
review comments
fmontesi 48cee44
ticks!
fmontesi cb3d371
flip remnants
chenson2018 68a5edf
restore one more proof
chenson2018 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| /- | ||
| Copyright (c) 2026 Fabrizio Montesi and Thomas Waring. All rights reserved. | ||
| Released under Apache 2.0 license as described in the file LICENSE. | ||
| Authors: Fabrizio Montesi | ||
| -/ | ||
|
|
||
| module | ||
|
|
||
| public import Cslib.Foundations.Relation.Defs | ||
| public import Mathlib.Logic.Function.Defs | ||
|
|
||
| /-! # Relations: preservation of properties -/ | ||
|
|
||
| @[expose] public section | ||
|
|
||
| namespace Relation | ||
|
|
||
| open scoped Function | ||
|
|
||
| /-- A predicate preserved by a relation is also preserved by its reflexive closure. -/ | ||
| @[simp, scoped grind =] | ||
| theorem preserves_reflGen_iff : Preserves (ReflGen r) P ↔ Preserves r P := by grind [Preserves] | ||
|
|
||
| /-- A predicate preserved by a relation is also preserved by its transitive closure. -/ | ||
| @[simp, scoped grind =] | ||
| theorem preserves_transGen_iff : Preserves (TransGen r) P ↔ Preserves r P := by | ||
| constructor <;> intro h | ||
| · grind [Preserves] | ||
| · intro _ _ hxy | ||
| induction hxy <;> grind [Preserves] | ||
|
|
||
| /-- A predicate is preserved by a relation iff it is preserves by its reflexive and transitive | ||
| closure. -/ | ||
| @[simp, scoped grind =] | ||
| theorem preserves_reflTransGen_iff : Preserves (ReflTransGen r) P ↔ Preserves r P := by | ||
| constructor <;> intro h | ||
| · intro _ _ hab | ||
| exact h (ReflTransGen.single hab) | ||
| · change ReflTransGen r ≤ ((· ≤ ·) on P) | ||
| exact reflTransGen_le_of_le h | ||
|
|
||
| end Relation |
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| /- | ||
| Copyright (c) 2026 Fabrizio Montesi. All rights reserved. | ||
| Released under Apache 2.0 license as described in the file LICENSE. | ||
| Authors: Fabrizio Montesi | ||
| -/ | ||
|
|
||
| module | ||
|
|
||
| public import Lean.Meta.Tactic.Grind.RegisterCommand | ||
|
|
||
| /-! # CSLib grind sets | ||
|
|
||
| This module registers custom grind sets in CSLib. | ||
| -/ | ||
|
|
||
| @[expose] public section | ||
|
|
||
| namespace Cslib.Logic.Modal | ||
|
|
||
| /-- | ||
| The `modal` grind set is designed to quickly resolve goals that can be derived from modal reasoning | ||
| without unfolding the underlying Lean semantics of satisfaction for modalities. Use this in | ||
| combination with modal axioms for more powerful proof search. -/ | ||
| register_grind_attr modal | ||
|
|
||
| end Cslib.Logic.Modal |
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.