feat(Logics/Modal): refactor formula primitives to {atom, bot, imp, box}#662
Open
benbrastmckie wants to merge 1 commit into
Open
feat(Logics/Modal): refactor formula primitives to {atom, bot, imp, box}#662benbrastmckie wants to merge 1 commit into
benbrastmckie wants to merge 1 commit into
Conversation
benbrastmckie
added a commit
to benbrastmckie/cslib
that referenced
this pull request
Jun 19, 2026
…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
benbrastmckie
added a commit
to benbrastmckie/cslib
that referenced
this pull request
Jun 21, 2026
…anprover#662 Session: sess_1781894063_86b06e
benbrastmckie
added a commit
to benbrastmckie/cslib
that referenced
this pull request
Jun 21, 2026
…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>
benbrastmckie
added a commit
to benbrastmckie/cslib
that referenced
this pull request
Jun 21, 2026
…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>
benbrastmckie
added a commit
to benbrastmckie/cslib
that referenced
this pull request
Jul 3, 2026
…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
f46056b to
8506bf1
Compare
Modal formula type with primitives {atom, bot, imp, box}; diamond derived
as ¬□¬. Adds self-owned Foundations/Logic/Connectives (HasBox/ModalConnectives),
K/T/B/4/5/D validity + canonicity (Basic, Cube), model-class-parametric
Proposition.Equiv S integrated with the shared LogicalEquivalence framework
(LogicalEquivalence, Denotation). Adds Avigad2022 and ChagrovZakharyaschev1997
references for the cited sources.
8506bf1 to
b0d085e
Compare
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Refactors the modal formula type to the primitive set
{atom, bot, imp, box}and builds out the modal cube and logical equivalence over it.The original PR mixed this with propositional-logic changes and was large to review. Per reviewer feedback it is now slimmed to the modal layer only — a single commit touching the files below — and builds independently on
main.Files Changed
Cslib/Logics/Modal/Basic.lean(modified)Modal.Propositionuses{atom, bot, imp, box}as primitives; negation, conjunction, disjunction and diamond are derived (◇φ := ¬□¬φ). Box is kept primitive so necessitation and the K axiom stay pure rules on a single operator. Proves each of K/T/B/4/5/D valid under its frame condition, with canonicity (the condition is also necessary) for T/B/4/5/D. Diamond's derivation is classical-only; a primitiveHasDiafor intuitionistic/minimal modal logic is noted as future work.Cslib/Logics/Modal/Cube.lean(modified)Assembles the fifteen named logics of the modal cube (K, T, B, 4, 5, D, D4, D5, D45, DB, TB, KB5, S4, S5, K45) as axiom-set unions over the relevant model classes, and proves the standard cube inclusions.
Cslib/Logics/Modal/LogicalEquivalence.lean(modified)Defines
Proposition.Equiv S, parametric in the model classS, so equivalence can be stated relative to any modal-cube class (T/B/4/5/S4/S5, …) rather than only the class of all models. Proved to be an equivalence relation and a congruence over one-hole contexts, and registered into the sharedCslib.Foundations.Logic.LogicalEquivalenceframework.Cslib/Logics/Modal/Denotation.lean(modified)Semantics/denotation for the new primitive set.
Cslib/Foundations/Logic/Connectives.lean(new file)A small operator-typeclass hierarchy —
HasBot,HasImp,HasAnd,HasOr,HasBox, bundled intoPropositionalConnectivesandModalConnectives. This follows the one-class-per-operator direction of #607, but is self-owned here rather than depending on #607, which is not yet merged and does not currently carryHasBot/the bundled classes. Folding this onto #607's hierarchy once it lands is left to a follow-up.references.bib(modified)Adds
Avigad2022andChagrovZakharyaschev1997for the sources cited in the modal files.Cslib.lean,CslibTests/GrindLint.lean(modified)Module registration for the above, plus
#grind_lint skipentries for the four new@[scoped grind]modal lemmas (the same mechanism already used byCslib.Logic.HML).AI Disclosure
Claude (Anthropic) assisted with the rebase, file selection, and CI verification. The Lean proofs are by the contributors listed in the file headers; AI use was limited to mechanical git work and drafting this description.