Skip to content

feat(Logics/Modal): semantics for the modal metalogic, compatible with constructive modal theories#662

Draft
benbrastmckie wants to merge 1 commit into
leanprover:mainfrom
benbrastmckie:feat/modal-formula-primitives
Draft

feat(Logics/Modal): semantics for the modal metalogic, compatible with constructive modal theories#662
benbrastmckie wants to merge 1 commit into
leanprover:mainfrom
benbrastmckie:feat/modal-formula-primitives

Conversation

@benbrastmckie

@benbrastmckie benbrastmckie commented Jun 19, 2026

Copy link
Copy Markdown

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 Proposition datatype it is built on is the enabling foundation.

The semantic layer

Built on a native 7-primitive Proposition:

Proposition {atom, bot, imp, and, or, box, diamond}

(negation and verum stay derived via the Łukasiewicz convention ¬φ := φ → ⊥, ⊤ := ⊥ → ⊥, mirroring Cslib.Logic.PL.Proposition's native and/or), it provides:

  • Satisfies — the satisfaction relation, defined natively over all 7 constructors.
  • Denotational semanticsDenotation.lean extended to every constructor, with satisfies_mem_denotation, not_denotation, and theoryEq_denotation_eq.
  • The duality theorem ◇φ ↔ ¬□¬φ — recovered as a proved semantic theorem (Satisfies.dual, via excluded middle) rather than baked in as a definition.
  • One decomposition lemma per connective — now Iff.rfl, since every connective is structural (no Łukasiewicz-bridge lemmas).
  • K-axiom validity, and the T/B/4/5/D frame-correspondence results and their converses, all preserved.

Why both box and diamond primitive?

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} with box/diamond both 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 main and 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-primitive Proposition; native Satisfies; derived neg/top/iff; per-connective characterisation lemmas (now Iff.rfl); Satisfies.dual as 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_eq preserved.
  • 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-hole Context notneg former; congruence/LogicalEquivalence instances 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.notProposition.neg and Proposition.implProposition.imp — and box/or move from derived definitions to native constructors under the same names (Proposition.Context.not is likewise renamed to neg). Sorry-free; axioms limited to propext / Classical.choice / Quot.sound. Full lake build, checkInitImports, lake lint, lint-style, lake test, and shake pass.

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 lint and the full CSLib CI, and reviewed before submission. Design decisions and review are the contributor's.

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
@benbrastmckie
benbrastmckie force-pushed the feat/modal-formula-primitives branch from e01881d to f46056b Compare June 19, 2026 19:46
@benbrastmckie
benbrastmckie marked this pull request as ready for review June 19, 2026 19:46
benbrastmckie added a commit to benbrastmckie/cslib that referenced this pull request Jun 21, 2026
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 9c5cbd0), 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
@benbrastmckie
benbrastmckie force-pushed the feat/modal-formula-primitives branch 2 times, most recently from 8506bf1 to b0d085e Compare July 3, 2026 06:16
@benbrastmckie
benbrastmckie force-pushed the feat/modal-formula-primitives branch from b0d085e to 8d7a061 Compare July 12, 2026 02:57
benbrastmckie added a commit to benbrastmckie/cslib that referenced this pull request Jul 12, 2026
…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
@benbrastmckie
benbrastmckie force-pushed the feat/modal-formula-primitives branch from 8d7a061 to 70b7ec4 Compare July 12, 2026 20:13
@benbrastmckie
benbrastmckie changed the base branch from main to fmontesi/connectives July 12, 2026 20:13
@benbrastmckie benbrastmckie changed the title feat(Logics/Modal): refactor formula primitives to {atom, bot, imp, box} feat(Logics/Modal): make box primitive alongside diamond (stacked on #607) Jul 12, 2026
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.
@benbrastmckie
benbrastmckie force-pushed the feat/modal-formula-primitives branch from 70b7ec4 to 2482583 Compare July 14, 2026 04:05
@benbrastmckie
benbrastmckie requested a review from kim-em as a code owner July 14, 2026 04:05
@benbrastmckie benbrastmckie changed the title feat(Logics/Modal): make box primitive alongside diamond (stacked on #607) feat(Logics/Modal): make Proposition a native 7-primitive type Jul 14, 2026
@benbrastmckie
benbrastmckie changed the base branch from fmontesi/connectives to main July 14, 2026 04:06
@benbrastmckie benbrastmckie changed the title feat(Logics/Modal): make Proposition a native 7-primitive type feat(Logics/Modal): semantics for the modal metalogic, compatible with constructive modal theories Jul 14, 2026
@benbrastmckie

Copy link
Copy Markdown
Author

I've retitled this to reflect what it's really aiming at. The 7-primitive Proposition refactor is the enabling foundation, but the substantive contribution is the semantic layer for the modal metalogic: the Satisfies relation, the denotational semantics, the duality ◇φ ↔ ¬□¬φ recovered as a proved semantic theorem (Satisfies.dual, via excluded middle rather than by definition), one decomposition lemma per connective, and K-axiom validity.

The reason both and are native primitives here — rather than defining ◇φ := ¬□¬φ — is that this is what keeps the layer compatible with the intuitionistic and constructive modal systems (IK, CK), where the two are genuinely not interdefinable ([Simpson 1994]). That's the metalogic I want to build on top of this. Classically nothing is lost: the duality comes back as the theorem above.

On the primitive constructors themselves, this mirrors #607, which is where the native {atom, bot, imp, and, or, box, diamond} operator design is being worked out. Coordination on standardising that primitive set is ongoing on #607 and the CSLib > Modal Logic Zulip thread; this PR builds the semantics on that basis.

@benbrastmckie
benbrastmckie marked this pull request as draft July 14, 2026 05:33
benbrastmckie added a commit to benbrastmckie/cslib that referenced this pull request Jul 18, 2026
Tasks created from the review sweep of cslib PRs leanprover#648, leanprover#607, leanprover#662 and the
Propositional/Modal Logic Zulip threads.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
benbrastmckie added a commit to benbrastmckie/cslib that referenced this pull request Jul 18, 2026
471: small PR leanprover#662 fixes committed on feat/modal-formula-primitives (3ff6d02d).
473: conservativity theorem verified already present sorry-free on main.
Also refreshed amended commit hashes in 467/470 summaries.

Session: sess_1783010083_1cc953

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
benbrastmckie added a commit to benbrastmckie/cslib that referenced this pull request Jul 18, 2026
Restore model-class-parametric Proposition.Equiv S + LogicalEquivalence
framework integration in Cslib/Logics/Modal/LogicalEquivalence.lean
(Option A hybrid over PR leanprover#662 primitives); remove standalone
LogicallyEquivalent. CI green, zero-debt.

Session: sess_1783025648_3ec6e0

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
benbrastmckie added a commit to benbrastmckie/cslib that referenced this pull request Jul 18, 2026
Comprehensive task to finalize PR leanprover#662: rebase on upstream, stack on leanprover#648
(drop divergent propositional files), fold in task-472 fix, resolve
Connectives (469), slim for reviewability per @fmontesi Zulip feedback,
correct PR body, prepare Zulip response. Deps: 468, 469, 472.

Session: sess_1783022251_1a3cf2

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
benbrastmckie added a commit to benbrastmckie/cslib that referenced this pull request Jul 18, 2026
…#662 on leanprover#648

Rebased feat/propositional-v2 onto upstream/main (verified green by
full CI); built feat/modal-formula-primitives-v2 as a single clean
commit (8506bf1) stacked on the rebased base, containing only the six
genuine modal-contribution files plus a companion grind-lint fix; full
CI green on both branches; R1-R4 risk checks pass. Drafted PR leanprover#662 body
and Zulip reply as local review artifacts. Phases 5-6 (force-push,
retarget, PR body edit, Zulip post) remain as intentional
user-approval gates -- nothing pushed.

Session: sess_1783038723_6ac05b
benbrastmckie added a commit to benbrastmckie/cslib that referenced this pull request Jul 18, 2026
…ack-on-648 PR body

- feat/propositional-v2 (leanprover#648) force-pushed -> 9376b73 (rebased on upstream/main)
- feat/modal-formula-primitives (leanprover#662) force-pushed -> 8506bf1 (single squashed commit, stacked on leanprover#648)
- PR leanprover#662 body revised: base retarget to fork branch not possible on GitHub;
  stack enforced by merge order (merge leanprover#648 first), body now states this accurately

Session: sess_1783038723_6ac05b
benbrastmckie added a commit to benbrastmckie/cslib that referenced this pull request Jul 18, 2026
Session: sess_1783038723_6ac05b
benbrastmckie added a commit to benbrastmckie/cslib that referenced this pull request Jul 18, 2026
benbrastmckie added a commit to benbrastmckie/cslib that referenced this pull request Jul 18, 2026
leanprover#662 rebuilt as single commit on upstream/main (b0d085e), CI green, force-pushed;
PR now parallels leanprover#649 (base=main, 8 files, 1 commit). Descriptive body posted.
references.bib on the PR branch gains Avigad2022 + ChagrovZakharyaschev1997.

Session: sess_1783038723_6ac05b
benbrastmckie added a commit to benbrastmckie/cslib that referenced this pull request Jul 18, 2026
Research how to divide overlapping PRs leanprover#607/leanprover#648/leanprover#649/leanprover#662, review leanprover#607 to
help it land, and base leanprover#662 on leanprover#607's operator layer. Depends on 475.

Session: sess_1783038723_6ac05b
benbrastmckie added a commit to benbrastmckie/cslib that referenced this pull request Jul 18, 2026
…tor complete, CI blocked by pre-existing leanprover#607 defect

Phases 1-4 and 6 of the PR-662-stacks-on-PR-607 plan are complete on a
new local branch task-477-pr662-stack-607 (based on pr607, worktree
/home/benjamin/Projects/cslib-task-477-pr662-stack-607): box added as
a fifth primitive Proposition constructor alongside diamond, net +49
LOC, zero sorry, zero new axioms, scoped lake build/lint-style green.
Phase 5's whole-library CI gate is blocked by a pre-existing,
out-of-scope defect in PR leanprover#607's own HML/LogicalEquivalence.lean
(confirmed via git-stash isolation, unrelated to Modal/leanprover#662). Status
set to partial pending either an upstream leanprover#607 fix or a follow-up task
to migrate HML/LogicalEquivalence.lean to the new HasLogicalEquivalence
API.

Session: sess_1783880050_660057
benbrastmckie added a commit to benbrastmckie/cslib that referenced this pull request Jul 18, 2026
Modal refactor complete on branch task-477-pr662-stack-607 (+49 LOC,
zero sorry). Phase 5 whole-library CI blocked by pre-existing external
defect in PR leanprover#607's HML/LogicalEquivalence.lean (not a leanprover#662 defect).

Session: sess_1783880050_660057
benbrastmckie added a commit to benbrastmckie/cslib that referenced this pull request Jul 18, 2026
Verified against upstream: all three user PRs (leanprover#648/leanprover#662/leanprover#649) are
already rebased onto latest upstream/main (056cf93, leanprover#708), 0 behind,
and CI-green. leanprover#485's HML fix is redundant with fmontesi's live leanprover#607
commit 77ce0c7.

Session: sess_1783880050_660057
benbrastmckie added a commit to benbrastmckie/cslib that referenced this pull request Jul 18, 2026
…ed on leanprover#607

- leanprover#662 force-pushed: box primitive alongside diamond, base -> fmontesi/connectives,
  clean 3-file/+22 LOC diff on live leanprover#607, full build+test green.
- leanprover#648/leanprover#649 kept independent on main (propositional-type design deferred to
  Zulip coordination: primitive-bot vs bot-via-atom).
- Zulip draft revised to accurate final state + raises the propositional-type question.

Session: sess_1783880050_660057
benbrastmckie added a commit to benbrastmckie/cslib that referenced this pull request Jul 18, 2026
benbrastmckie added a commit to benbrastmckie/cslib that referenced this pull request Jul 18, 2026
…acking to leanprover#607 direction

Abandon 468/469/475 (superseded by leanprover#607 pivot in task 477), close 476
(coordination delivered), refine 486 (make leanprover#648-independence + leanprover#607
Operators typeclass-port explicit). leanprover#662 stacks on leanprover#607; leanprover#648 stays
independent pending propositional-basis decision.

Session: sess_1783891789_95c9f3
benbrastmckie added a commit to benbrastmckie/cslib that referenced this pull request Jul 18, 2026
All 4 phases of the modal-cube completion plan COMPLETED on the
task-486-pr662-modal-package worktree branch (off the live PR leanprover#662
head, origin/feat/modal-formula-primitives=70b7ec4d): Cube.lean
Validity wrappers (B/4/5/D), new Canonicity section (T/B/4/5/D
frame determination), references.bib ChagrovZakharyaschev1997 entry.
Zero sorry, zero new axioms. Module-scoped and full-library CI both
green (contrary to the plan's anticipated HML-defect blocker, which
did not reproduce on this base). Single clean commit 4ebdba5 on the
worktree branch, not pushed; no PR action taken.

Session: sess_1783891828_7982f5_impl
benbrastmckie added a commit to benbrastmckie/cslib that referenced this pull request Jul 18, 2026
…on on leanprover#607

Option A delivered on worktree branch task-486-pr662-modal-package
(commit 4ebdba54, off live PR head 70b7ec4): Cube.lean +69 (b/four/
five/d validity + canonicity section), references.bib +11. Zero sorry/
axioms; full lake build 2759/2759 + test 8790/8790 green. Not pushed.

Research corrected the brief premise (leanprover#607 already ships the semantic
cube); scope narrowed to the non-duplicative completion work.

Session: sess_1783891828_7982f5
benbrastmckie added a commit to benbrastmckie/cslib that referenced this pull request Jul 18, 2026
Refactor leanprover#662 modal Proposition to {atom,bot,imp,and,or,box,diamond}
(bot+imp+and+or primitive, not derived) to match the fork metalogic's
primitive-bot/imp basis and leanprover#648's propositional core. Follow-up from
leanprover#486; user-directed.

Session: sess_1783891828_7982f5
benbrastmckie added a commit to benbrastmckie/cslib that referenced this pull request Jul 18, 2026
…-primitive

Modal Proposition -> {atom,bot,imp,and,or,box,diamond} (7 primitive,
not derived) on worktree task-487-pr662-bot-primitive (69db6de4).
Cube.lean unchanged; +72/-52, 4 files; zero sorry/axioms; full lake
build+test green. Metalogic-ready base for the soundness slice.

Session: sess_1783903472_6dffde
benbrastmckie added a commit to benbrastmckie/cslib that referenced this pull request Jul 18, 2026
Capstone iffs unifying cube validity + canonicity for T/B/4/5/D, on
branch task-487-pr662-bot-primitive. Plus updated leanprover#662 PR body.

Session: sess_1783903472_6dffde
benbrastmckie added a commit to benbrastmckie/cslib that referenced this pull request Jul 18, 2026
…#662 PR body

5 correspondence iffs (T/B/4/5/D) on branch task-487-pr662-bot-primitive
(b041c6f7); Cube.lean +55; zero sorry/axioms; build+test green. Updated
leanprover#662 PR body drafted. Final leanprover#662 diff vs leanprover#607: +233/-56, 6 files.

Session: sess_1783903472_6dffde
benbrastmckie added a commit to benbrastmckie/cslib that referenced this pull request Jul 18, 2026
…disclosure + cube-ownership note)

Standards vet (report 02): Lean code clean; 3 PR-framing fixes. Applied
AI Tools Used section (CONTRIBUTING.md AI policy) + @fmontesi cube-
ownership acknowledgment to pr-662-body.md. Attribution (Authors headers)
left for user decision.

Session: sess_1783903472_6dffde
benbrastmckie added a commit to benbrastmckie/cslib that referenced this pull request Jul 18, 2026
Restructure 480 (monolithic intuitionistic) -> intuitionistic_modal_
framework; add 490 birelational semantics, 491 minimal-prop base,
492 IK, 493 CK, 494 int-extensions (IT/IS4/IS5), 495 minimal-K,
496 minimal-extensions. Revise 484 to span minimal/intuitionistic/
classical hierarchy. Deps wired to leanprover#662 base (487) + leanprover#648.

Session: sess_1783903472_6dffde
benbrastmckie added a commit to benbrastmckie/cslib that referenced this pull request Jul 18, 2026
…r slice, CI verification

Verified live PR leanprover#662/leanprover#607 state (both MERGEABLE, CI green); confirmed the native-primitive
slice (Basic.lean 63-283+430-441, Denotation.lean 24-90) is sorry-free on this branch.
Discovered lines 285-428 (T/B/4/5/D frame axioms) are load-bearing for Cube.lean and 8
Metalogic Soundness files on this branch, so the slice was assembled as extraction artifacts
under specs/498_.../artifacts/pr-662-slice/ rather than editing the live shared Basic.lean in
place. Ran the full CSLib CI pipeline (cache, scoped+full build, checkInitImports, lint,
lint-style, test, mk_all, shake) plus lean_verify axiom checks on Satisfies.dual/.k and
satisfies_mem_denotation: sorry_count 0, zero new axioms, all standard classical only.

Session: sess_1783965646_4b3ee1
benbrastmckie added a commit to benbrastmckie/cslib that referenced this pull request Jul 18, 2026
…e (native primitives)

Squash-commit of the ~386 LOC foundational semantic layer slice for PR leanprover#662, built on the
native 7-primitive Proposition {atom, bot, imp, and, or, box, diamond}: Satisfies/denotation,
duality theorem (Satisfies.dual), per-connective decomposition (Iff.rfl), K-axiom validity
(Satisfies.k), denotation bridge (satisfies_mem_denotation), and valid/logic. Extracted
faithfully from Cslib/Logics/Modal/Basic.lean (lines 63-283, 430-441) and
Cslib/Logics/Modal/Denotation.lean (lines 24-90) on task-441-native-refactor, EXCLUDING the
T/B/4/5/D frame-correspondence axioms (Basic.lean 285-428; deferred to a later "systems" PR).
sorry-free; axioms limited to propext/Classical.choice/Quot.sound (standard classical only,
used by Satisfies.dual and satisfies_mem_denotation via excluded middle).

Committed as extraction artifacts under specs/498_.../artifacts/pr-662-slice/ rather than
directly to Cslib/Logics/Modal/ -- see Phase 1/2 plan notes: the live Basic.lean's frame-axiom
lines are load-bearing for Cube.lean and 8 Metalogic Soundness files on this shared
task-441-native-refactor branch, so this squash-commit is prepared content for the actual
leanprover#662 head branch (feat/modal-formula-primitives), not a direct edit of the live library files.

GATED: push/re-stack of the real leanprover#662 branch is deferred until PR leanprover#607 adopts the native
primitive set (fmontesi back 23 July); this commit is LOCAL only, not pushed. Fallback if
leanprover#607 declines: restore backup/662-pre-rework-jul13 (the pre-rework trivial box-alongside-
diamond delta) or convert to a standalone non-stacked contribution.

## AI Tools Used

This commit was prepared with the assistance of Claude Code (Anthropic). The AI tool was used
for extracting and verifying the foundational-semantic-layer slice from the task-441 native
modal refactor, running CI verification commands, and drafting this commit message. All Lean
code was authored by the task-441 development (Benjamin Brast-McKie et al.) and verified to
compile cleanly (sorry-free, standard classical axioms only) on this branch.

Session: sess_1783965646_4b3ee1
benbrastmckie added a commit to benbrastmckie/cslib that referenced this pull request Jul 18, 2026
…se zulip-coordination draft

Phase 5: wrote specs/498_.../artifacts/pr-607-recommendation.md, a DRAFT comment-only
recommendation that leanprover#607 adopt the native modal primitive set {atom, bot, imp, and, or, box,
diamond}, with a three-point justification (per-connective Iff.rfl decomposition, IK/CK reuse,
duality as theorem), typeclass instances entailed, naming-reconciliation flags (HasDia vs
HasDiamond; HasBot absent in Operators.lean), and a proof-theoretic-weight reassurance. Carries
a DRAFT + comment-only + user-approval + never-push-to-fmontesi/connectives banner. Not posted.

Phase 6: revised specs/476_.../artifacts/zulip-coordination.md to replace the superseded
box-alongside-diamond framing (~40-line delta) with the native-primitives recommendation to
leanprover#607 plus a description of leanprover#662 as a substantial ~386-line foundational semantic-layer slice.
Preserved the accuracy-discipline preamble and both open items (leanprover#648 propositional-base
decision, imp/impl naming for task 497); added the HasDia/HasDiamond naming divergence to the
same follow-up. DRAFT banner intact; not posted.

Session: sess_1783965646_4b3ee1
benbrastmckie added a commit to benbrastmckie/cslib that referenced this pull request Jul 18, 2026
Execution summary, final .return-meta.json, and orchestrator handoff for task 498. All 6
plan phases COMPLETED: verified live PR leanprover#607/leanprover#662 state, assembled the foundational semantic
layer slice as extraction artifacts, ran the full CSLib CI pipeline (sorry_count 0, zero new
axioms, standard classical axioms only), squash-committed the slice locally, prepared the
comment-only leanprover#607 recommendation draft, and revised the zulip-coordination draft. No push
performed anywhere; both drafts carry DRAFT + explicit-user-approval banners.

Session: sess_1783965646_4b3ee1
benbrastmckie added a commit to benbrastmckie/cslib that referenced this pull request Jul 18, 2026
Reworked PR leanprover#662 into a self-contained ~300 LOC native-primitive
foundational semantic layer slice of the task-441 modal metalogic.
Full CI green, zero-debt (0 sorries, 0 new axioms). Local squash-commit
created (not pushed); push/re-stack gated on leanprover#607 adopting native
primitives. leanprover#607 recommendation and revised task-476 zulip-coordination
prepared as DRAFTs (not posted, await user approval).

Cycles: 3/5 (research -> plan -> implement)
Session: sess_1783963625_6aa0c8
benbrastmckie added a commit to benbrastmckie/cslib that referenced this pull request Jul 18, 2026
…er#662 slice Basic.lean

Documentation-only edits to the staged pr-662-slice/Basic.lean artifact:
scrub internal task-tracker numbers ("task 441"/"task 340") from published
docstrings, trim dangling forward cross-references to the proof-system and
Bimodal-embedding layers (not part of this slice), add the missing
[ChagrovZakharyaschev1997] References entry, and apply the optional
Lukasiewicz -> Lukasiewicz diacritic. No definitions or proofs changed.

Session: sess_499_direct
benbrastmckie added a commit to benbrastmckie/cslib that referenced this pull request Jul 18, 2026
Docstring-only edit on task-441-native-refactor: drop internal
task-tracker references ("task 441", "task 340") from four docstrings in
Cslib/Logics/Modal/Basic.lean, matching the identical scrub applied to the
staged PR leanprover#662 slice artifact so re-extraction does not reintroduce them.
Proof-system/Bimodal cross-references left intact (valid on this branch).
No definitions or proofs changed; full CSLib CI pipeline verified green.

Session: sess_499_direct
benbrastmckie added a commit to benbrastmckie/cslib that referenced this pull request Jul 18, 2026
…eanprover#662 slice)

Phase 5 (copyright-holder decision, no-auto-change) and Phase 6 (CI
verification + documentation-only diff audit) complete. Full CSLib CI
pipeline verified green on the live task-441-native-refactor branch
(lake build, checkInitImports, lake lint, lint-style, lake test, lake
shake); both edited files (slice artifact + live Basic.lean) confirmed
comment/docstring-only via git diff. Plan checklist and phase markers
updated to [COMPLETED]; implementation summary records the outstanding
Fabrizio-Montesi maintainer-confirmation item (copyright-holder line,
left unchanged). No push performed, per instruction.

Session: sess_499_direct
benbrastmckie added a commit to benbrastmckie/cslib that referenced this pull request Jul 18, 2026
Documentation-only CONTRIBUTING.md compliance fixes for PR leanprover#662 modal slice.
Status -> completed; linked plan + summary artifacts.
Phase 5 (copyright-holder) deferred pending maintainer confirmation.

Session: sess_1783982014_f7ba1f

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
benbrastmckie added a commit to benbrastmckie/cslib that referenced this pull request Jul 18, 2026
benbrastmckie added a commit to benbrastmckie/cslib that referenced this pull request Jul 18, 2026
…itive reconstruction, pushed)

Rebuilt PR leanprover#662 as single squashed commit on main with 7 native primitives,
force-pushed to fork head with user approval; PR retargeted to main.
Branch cleanup/preservation deferred per user.

Session: sess_1784002055_orch500
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.

1 participant