Skip to content

feat(ModalLogic/LambdaCalculus): modal grind set and proof of type safety for simply typed lambda calculus - #840

Merged
chenson2018 merged 9 commits into
mainfrom
fmontesi/modal-lambda
Aug 30, 2026
Merged

feat(ModalLogic/LambdaCalculus): modal grind set and proof of type safety for simply typed lambda calculus#840
chenson2018 merged 9 commits into
mainfrom
fmontesi/modal-lambda

Conversation

@fmontesi

Copy link
Copy Markdown
Collaborator

This PR:

  • Introduces a modal grind set for simple modal reasoning. The set does not unfold the meaning of the modal connectives on purpose: it's supposed to be used for quick modal proof search.
  • Shows how to use CSLib's modal logic to reason about the PL adage 'safety = progress + preservation'. Once progress and preservation are lifted from existing results into modal propositions, safety follows. The PR also shows how to extract the 'pure' type safety Lean statement.
  • Adds a few general properties about relations that were convenient in this development.
  • Removes some duplication by aligning uses of 'flip' in Relation and 'Terminating' in modal logic (instead of WellFounded on flip, now it just uses Terminating).

Comment thread Cslib/Foundations/Relation/Defs.lean Outdated
Comment thread Cslib/Foundations/Relation/Normal.lean Outdated
Comment thread Cslib/Logics/Modal/Attr.lean Outdated
Comment thread Cslib/Logics/Modal/Basic.lean
Comment thread Cslib/Logics/Modal/Basic.lean
Comment thread CslibTests/Modal/Stlc.lean
@fmontesi

Copy link
Copy Markdown
Collaborator Author

All done, @chenson2018, let me know if you'd like to discuss further.

@chenson2018

Copy link
Copy Markdown
Collaborator

For the build issue, you need to add a new exception to scripts/CheckInitImports.lean.

@fmontesi

Copy link
Copy Markdown
Collaborator Author

For the build issue, you need to add a new exception to scripts/CheckInitImports.lean.

Thanks for the pointer!

@fmontesi
fmontesi requested a review from kim-em as a code owner August 30, 2026 07:07
@fmontesi

Copy link
Copy Markdown
Collaborator Author

@chenson2018 all done, thanks for the comments.

@chenson2018 chenson2018 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I cleaned up some changes that were still left over from usage of flip, otherwise this looks good. Thanks!

@chenson2018
chenson2018 enabled auto-merge August 30, 2026 09:58
@chenson2018
chenson2018 added this pull request to the merge queue Aug 30, 2026
Merged via the queue into main with commit 492d030 Aug 30, 2026
2 checks passed
@fmontesi

Copy link
Copy Markdown
Collaborator Author

Thank you very much.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants