feat(ModalLogic+Congruence): modal reasoning for Lean #799
All Vouch review confidence checks passed
Residual risk 0.16 = Change Risk (0.40) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.40 · 279 lines diff across 3 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.337
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #799"
general
weight: 0.35
fmontesi
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