feat(Logics/Modal): semantics for the modal metalogic, compatible with constructive modal theories#662
Conversation
…PR description with line-number links Phase 1: Removed ~157 scratch-work inline comments from 14 Modal/ proof files Phase 2: Revised PR description with exact line-number table for all 15 strong soundness/completeness results Phase 3: Updated GitHub PR leanprover#662 body Session: sess_1781890976_cc3df6
e01881d to
f46056b
Compare
…anprover#662 Session: sess_1781894063_86b06e
…leanup - Added 17 docstrings to Basic.lean, Cube.lean, DerivationTree.lean - Removed @[simp] from k_strong_completeness_iff for consistency - Fixed "satifies" typo in Basic.lean - Removed 4 S5 backward-compatibility aliases from DerivationTree.lean - Removed 2 dead ModalSetDerivable lemmas from Completeness.lean - Removed HasHilbertTree instance from DeductionTheorem.lean - Removed dead t_canonical_refl, t_truth_lemma from T/Completeness.lean - Removed dead tb_canonical_refl, tb_canonical_symm, tb_truth_lemma from TB/Completeness.lean - Removed 14 dead _soundness_derivable wrappers (kept K's, used by ConservativeExtension) - Removed unused _h_T parameter from canonical_eucl; updated S5/Completeness.lean caller - Removed 2 redundant imports from K/Completeness.lean and T/Completeness.lean - Normalized blank lines in 11 Completeness files - Updated pr-description.md line numbers and pushed to GitHub PR leanprover#662 Session: sess_1781895004_06f0c7 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…cription updated Cleaned stale module docstring references left after dead code removal phase: - Removed _soundness_derivable references from 14 Soundness module docblocks - Updated T/Completeness and TB/Completeness module docs to list actual results - Updated Metalogic/Completeness module doc (removed deleted lemma names) - Corrected T and TB line numbers in pr-description.md (shifted by +4 lines) - Pushed updated PR description to GitHub PR leanprover#662 Session: sess_1781894063_86b06e Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ositional-v2 Rebuild PR leanprover#662 as a single clean commit stacked on rebased leanprover#648 (feat/propositional-v2), containing only the six genuine modal files (placeholder message; finalized message pending Phase 5 user approval, D5). - Basic.lean: box-primitive Proposition {atom, bot, imp, box}, diamond derived as neg(box(neg _)) (classical), ModalConnectives instance. - Cube.lean, Denotation.lean: adapted to the imp/box primitive set. - LogicalEquivalence.lean: task-472 parametric Proposition.Equiv S (transplanted from main 9c5cbd08), replacing the stale standalone LogicallyEquivalent def carried by the old leanprover#662 tip. - Connectives.lean: self-owned PropositionalConnectives/ModalConnectives typeclass hierarchy (Option A, task 469); leanprover#607 decoupling deferred. - Cslib.lean: add Connectives module registration. - CslibTests/GrindLint.lean: add four #grind_lint skip entries for new Modal @[scoped grind] lemmas that trigger run-away grind instantiation (neg_denotation, Satisfies.and_iff_and, Satisfies.iff_iff_iff, Satisfies.or_iff_or) -- same sanctioned escape hatch already used by the analogous Cslib.Logic.HML module (HML.Satisfies.diamond, etc.). references.bib required no changes (Avigad2022 already present, inherited from leanprover#648's rebased bib). Session: sess_1783038723_6ac05b
8506bf1 to
b0d085e
Compare
b0d085e to
8d7a061
Compare
…anprover#662 on leanprover#607 Rework PR leanprover#662's modal-logic contribution to stack cleanly on PR leanprover#607 (fmontesi/connectives), whose head already provides the consolidated HasBox/HasDiamond/... operator typeclasses in Cslib/Foundations/Logic/Operators.lean. On this base, Proposition was {atom, not, and, diamond} with box derived as ¬◇¬φ. This commit adds box as a fifth primitive constructor so both modalities are primitive, and turns the interdefinability law into a derived theorem. - Basic.lean: add `| box (φ : Proposition Atom)` to the Proposition inductive; add the matching `Satisfies` clause `∀ w', m.r w w' → Satisfies m w' φ`; point HasBox at the new constructor; reduce `Satisfies.box_iff_forall` to `Iff.rfl`; prove `Satisfies.dual : ◇φ ↔ ¬□¬φ` as a genuine classical theorem from the two now-independent primitive semantic clauses (was previously definitional); add companion `Satisfies.box_iff_not_diamond_not`. - Denotation.lean: add the box denotation clause `{w | ∀ w', m.r w w' → w' ∈ φ.denotation m}`. - LogicalEquivalence.lean: add the `box` `Proposition.Context` constructor, its `fill` clause, and the matching `Congruence` induction case. No duplicate Connectives.lean exists on this branch (leanprover#607's Operators.lean is already the sole source of these typeclasses), so no deletion was needed there. Net diff vs ddc2c9b (the leanprover#607 head this branch is built on): 3 files changed, +39/-17 (net +22 LOC). Zero sorry, zero new axioms. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015tcPjCXNeSAzBxWeFYsZM5
8d7a061 to
70b7ec4
Compare
Refactor the modal `Proposition` from the 4-primitive `{atom, not, and,
diamond}` design (with `or`/`impl`/`box` derived) to a 7-primitive native
design `{atom, bot, imp, and, or, box, diamond}`, with negation and verum
derived via the Łukasiewicz convention (`¬φ := φ → ⊥`, `⊤ := ⊥ → ⊥`).
Keeping `box` and `diamond` as independent native constructors (rather than
`◇φ := ¬□¬φ`) means the same datatype carries unchanged into intuitionistic
and constructive modal logics, where `□`/`◇` are not interdefinable
(Simpson 1994), and gives one decomposition rule per connective for the
semantic/tableau layer. Classically the duality `◇φ ↔ ¬□¬φ` is recovered as
a proved semantic theorem (`Satisfies.dual`) rather than a definition.
All existing declarations are preserved with identical names and signatures,
including the T/B/4/5/D frame-correspondence theorems, the Modal Cube, the
denotational semantics, and logical-equivalence congruence. The per-connective
`Satisfies` characterisation lemmas now hold by `Iff.rfl`. Sorry-free; axioms
limited to propext/Classical.choice/Quot.sound.
Adds the Simpson 1994 reference to references.bib.
AI disclosure: this refactor was drafted with the assistance of an AI coding
agent (Claude); all proofs were verified by `lake build`/`lake lint` and the
full CSLib CI, and reviewed before submission.
70b7ec4 to
2482583
Compare
|
I've retitled this to reflect what it's really aiming at. The 7-primitive The reason both On the primitive constructors themselves, this mirrors #607, which is where the native |
Contributes a foundational semantic layer for the modal metalogic, designed to be compatible with the intuitionistic and constructive modal systems (IK, CK). This is the substantive ambition of the PR; the native
Propositiondatatype it is built on is the enabling foundation.The semantic layer
Built on a native 7-primitive
Proposition:(negation and verum stay derived via the Łukasiewicz convention
¬φ := φ → ⊥,⊤ := ⊥ → ⊥, mirroringCslib.Logic.PL.Proposition's nativeand/or), it provides:Satisfies— the satisfaction relation, defined natively over all 7 constructors.Denotation.leanextended to every constructor, withsatisfies_mem_denotation,not_denotation, andtheoryEq_denotation_eq.◇φ ↔ ¬□¬φ— recovered as a proved semantic theorem (Satisfies.dual, via excluded middle) rather than baked in as a definition.Iff.rfl, since every connective is structural (no Łukasiewicz-bridge lemmas).Why both
boxanddiamondprimitive?Classically
◇φ := ¬□¬φsuffices, but in IK/CK□and◇are not interdefinable ([Simpson 1994]). Keeping both native means the same datatype carries unchanged into those systems, and the semantic/tableau layer gets one clean decomposition rule per connective. Classically nothing is lost — the duality is recovered as the theorem above.Relationship to #607 (rebase plan)
The native primitive-constructor design —
{atom, bot, imp, and, or, box, diamond}withbox/diamondboth primitive — is the subject of #607, where the operator layer is being standardised. This PR is intended to be rebased onto #607 once it lands, so that the primitive constructors come from #607 and this PR carries only the semantic layer on top.Until then it is based on
mainand self-contained, so it builds and can be reviewed independently. Coordination on the native primitive set is ongoing on #607 and the CSLib > Modal Logic Zulip thread.Changes (5 files, +145 / −40 against
main; the base will move to #607 on rebase)Cslib/Logics/Modal/Basic.lean— 7-primitiveProposition; nativeSatisfies; derivedneg/top/iff; per-connective characterisation lemmas (nowIff.rfl);Satisfies.dualas a semantic theorem. All existing theorems preserved — including the T/B/4/5/D frame-correspondence results and their converses.Cslib/Logics/Modal/Denotation.lean— denotation extended to all 7 constructors;satisfies_mem_denotation,not_denotation,theoryEq_denotation_eqpreserved.Cslib/Logics/Modal/Cube.lean— unchanged except an import; the Modal Cube (K…S5) and its validities carry over.Cslib/Logics/Modal/LogicalEquivalence.lean— one-holeContextnot→negformer; congruence/LogicalEquivalenceinstances preserved.references.bib— adds the Simpson 1994 reference.Notation (
¬ ∧ ∨ → □ ◇ ↔) and every theorem name are preserved. Two derived definitions are renamed to match the native constructors —Proposition.not→Proposition.negandProposition.impl→Proposition.imp— andbox/ormove from derived definitions to native constructors under the same names (Proposition.Context.notis likewise renamed toneg). Sorry-free; axioms limited topropext/Classical.choice/Quot.sound. Fulllake build,checkInitImports,lake lint,lint-style,lake test, andshakepass.AI Disclosure
This work was drafted with the assistance of an AI coding agent (Claude, Anthropic) under the contributor's direction. All proofs were machine-checked by
lake build/lake lintand the full CSLib CI, and reviewed before submission. Design decisions and review are the contributor's.