refactor: Proposition type to bot/imp primitives#635
Conversation
Refactor the modal `Proposition` inductive to the `{atom, bot, imp, box}`
primitive basis: falsum and implication as the primitive propositional
connectives, box as the primitive modality. Negation, conjunction,
disjunction, verum, possibility, and biconditional become derived connectives
via the `Cslib.Foundations.Logic.Connectives` interface introduced in leanprover#635;
`Proposition` is registered as a `ModalConnectives` instance.
- Replace `not`/`and`/`diamond` constructors with `bot`/`imp`/`box`; derived
connectives are `abbrev`s, enabling definitional unfolding.
- Rewrite `Satisfies` on the new primitives and add explicit characterisation
lemmas (`neg_iff`, `diamond_iff`, `and_iff`, `or_iff`, `iff_iff_iff`).
- Replace all `grind`-based axiom-validity proofs (K, dual, T, B, 4, 5, D and
their frame-correspondence converses) with explicit term-mode proofs.
- Update `Denotation.lean` for the new primitives with explicit proofs.
- Rework `LogicalEquivalence.lean`: a one-hole `Proposition.Context` and a
direct `LogicallyEquivalent`/`congruence`, in place of instantiating the
shared `LogicalEquivalence` typeclass (rationale in the file's Design Notes).
- Add `#grind_lint skip` entries for the derived-connective characterisations
whose `@[scoped grind =]` annotations have long instantiation chains.
Stacked on leanprover#635 (propositional primitives); review/merge that first.
Refactor the propositional `Proposition` to `{atom, bot, imp}` primitives, with
negation, conjunction, disjunction, and verum as derived `abbrev`s. `{imp, bot}`
is functionally complete for classical logic, so the other connectives are
definable rather than postulated: this keeps the inductive minimal (fewer cases
in every recursion and induction) and lets the derived connectives unfold
definitionally, so reasoning about them needs no separate axioms or bridging
lemmas.
- Add `Cslib/Foundations/Logic/Connectives.lean`: the connective typeclass
hierarchy (`HasBot`, `HasImp`, `HasBox`, `HasUntil`, `HasSince`; bundled
`PropositionalConnectives`/`ModalConnectives`/`TemporalConnectives`/
`BimodalConnectives`; and `ImpBotDerived` for the derived-connective defaults).
- Replace `and`/`or`/`impl` constructors with `bot`/`imp` in
`Propositional/Defs.lean`; update `complexity`, `atoms`, and `subst`.
- Cut the natural-deduction rules from 10 to 5; the derived-connective rules
become derivable rather than primitive.
- Add bibliography entries (Church, Gentzen, Heyting, Chagrov & Zakharyaschev,
Prawitz, Troelstra & van Dalen).
a8e27b7 to
3ab8023
Compare
Refactor the modal `Proposition` inductive to the `{atom, bot, imp, box}`
primitive basis: falsum and implication as the primitive propositional
connectives, box as the primitive modality. Negation, conjunction,
disjunction, verum, possibility, and biconditional become derived connectives
via the `Cslib.Foundations.Logic.Connectives` interface introduced in leanprover#635;
`Proposition` is registered as a `ModalConnectives` instance.
- Replace `not`/`and`/`diamond` constructors with `bot`/`imp`/`box`; derived
connectives are `abbrev`s, enabling definitional unfolding.
- Rewrite `Satisfies` on the new primitives and add explicit characterisation
lemmas (`neg_iff`, `diamond_iff`, `and_iff`, `or_iff`, `iff_iff_iff`).
- Replace all `grind`-based axiom-validity proofs (K, dual, T, B, 4, 5, D and
their frame-correspondence converses) with explicit term-mode proofs.
- Update `Denotation.lean` for the new primitives with explicit proofs.
- Rework `LogicalEquivalence.lean`: a one-hole `Proposition.Context` and a
direct `LogicallyEquivalent`/`congruence`, in place of instantiating the
shared `LogicalEquivalence` typeclass (rationale in the file's Design Notes).
- Add `#grind_lint skip` entries for the derived-connective characterisations
whose `@[scoped grind =]` annotations have long instantiation chains.
Stacked on leanprover#635 (propositional primitives); review/merge that first.
Refactor the modal `Proposition` inductive to the `{atom, bot, imp, box}`
primitive basis: falsum and implication as the primitive propositional
connectives, box as the primitive modality. Negation, conjunction,
disjunction, verum, possibility, and biconditional become derived connectives
via the `Cslib.Foundations.Logic.Connectives` interface introduced in leanprover#635;
`Proposition` is registered as a `ModalConnectives` instance.
- Replace `not`/`and`/`diamond` constructors with `bot`/`imp`/`box`; derived
connectives are `abbrev`s, enabling definitional unfolding.
- Rewrite `Satisfies` on the new primitives and add explicit characterisation
lemmas (`neg_iff`, `diamond_iff`, `and_iff`, `or_iff`, `iff_iff_iff`).
- Replace all `grind`-based axiom-validity proofs (K, dual, T, B, 4, 5, D and
their frame-correspondence converses) with explicit term-mode proofs.
- Update `Denotation.lean` for the new primitives with explicit proofs.
- Rework `LogicalEquivalence.lean`: a one-hole `Proposition.Context` and a
direct `LogicallyEquivalent`/`congruence`, in place of instantiating the
shared `LogicalEquivalence` typeclass (rationale in the file's Design Notes).
- Add `#grind_lint skip` entries for the derived-connective characterisations
whose `@[scoped grind =]` annotations have long instantiation chains.
Stacked on leanprover#635 (propositional primitives); review/merge that first.
Refactor the modal `Proposition` inductive to the `{atom, bot, imp, box}`
primitive basis: falsum and implication as the primitive propositional
connectives, box as the primitive modality. Negation, conjunction,
disjunction, verum, possibility, and biconditional become derived connectives
via the `Cslib.Foundations.Logic.Connectives` interface introduced in leanprover#635;
`Proposition` is registered as a `ModalConnectives` instance.
- Replace `not`/`and`/`diamond` constructors with `bot`/`imp`/`box`; derived
connectives are `abbrev`s, enabling definitional unfolding.
- Rewrite `Satisfies` on the new primitives and add explicit characterisation
lemmas (`neg_iff`, `diamond_iff`, `and_iff`, `or_iff`, `iff_iff_iff`).
- Replace all `grind`-based axiom-validity proofs (K, dual, T, B, 4, 5, D and
their frame-correspondence converses) with explicit term-mode proofs.
- Update `Denotation.lean` for the new primitives with explicit proofs.
- Rework `LogicalEquivalence.lean`: a one-hole `Proposition.Context` and a
direct `LogicallyEquivalent`/`congruence`, in place of instantiating the
shared `LogicalEquivalence` typeclass (rationale in the file's Design Notes).
- Add `#grind_lint skip` entries for the derived-connective characterisations
whose `@[scoped grind =]` annotations have long instantiation chains.
Stacked on leanprover#635 (propositional primitives); review/merge that first.
| /-- A type has a falsum (bottom) connective. -/ | ||
| class HasBot (F : Type*) where | ||
| /-- The falsum/bottom connective. -/ | ||
| bot : F | ||
|
|
||
| /-- A type has an implication connective. -/ | ||
| class HasImp (F : Type*) where | ||
| /-- The implication connective. -/ | ||
| imp : F → F → F |
There was a problem hiding this comment.
Here you could co-opt mathlib's Bot and HImp classes
|
First, are you aware of this PR: #607 ? Second, and more seriously, can all logical connectives be reduced to implication and falsum in intuitionistic propositional logic? I don't think Regarding natural deduction, so far as I can tell, the presentations in Prawitz and Troelstra & can Dalen do not do this kind of reduction at all. (I have Troelstra & van Dalen's book and I'm looking at it. At least part of Prawitz's book can be browsed here: https://www.google.com/books/edition/Natural_Deduction/sJj3DQAAQBAJ?hl=en) |
|
Also, you wrote:
Attached below is the Gentzen paper you cited: I don't read German. But, judging from the formulas I can read, it seems to me that Gentzen was not using the implication+falsum basis you are proposing. |
|
I can't find the original text of the Heyting (1930) paper you cited. But the following discussion in "The development of intuitionistic logic" in Stanford Encyclopedia of Philosophy: |
|
That's helpful. I think it may be best to close this and I'll think through the set up again. |
Quality audit of 42 files in Propositional/ and Foundations/Logic/. Three teammates: architecture/imports, proof quality/naming, references/rigor. Literature references independently verified against PR leanprover#635 lesson. Session: sess_1781384225_4617ac Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Quality audit of 42 files in Propositional/ and Foundations/Logic/. Three teammates: architecture/imports, proof quality/naming, references/rigor. Literature references independently verified against PR leanprover#635 lesson. Session: sess_1781384225_4617ac Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

Summary
Refactors the propositional
Propositioninductive type to use{atom, bot, imp}as itsprimitive constructors. Negation (
neg), verum (top), conjunction (and), and disjunction(
or) become derived connectives defined asabbrevs. This replaces the previousand/or/implprimitives.Why falsum and implication as the primitives
The choice is justified on its own merits, not merely as a historical convention:
{imp, bot}is functionally complete for classicalpropositional logic. Every other connective is therefore definable from these two, so it can be
a derived
abbrevinstead of a constructor with its own meaning.over formulas — every function (
complexity,atoms,subst, satisfaction, …) and every proofby induction is correspondingly shorter.
¬,∧,∨,↔areabbrevs, theyunfold to
imp/botbyrfl. Reasoning about them reduces to reasoning about the twoprimitives with no bridging lemmas and no risk of a derived connective drifting from its intended
meaning.
theorem) and
botgives negation as· → botplus ex falso. The natural-deduction calculus overthis basis needs only 5 primitive rules instead of 10; the conjunction/disjunction rules become
derivable rather than postulated, so there is less to state and keep mutually consistent.
This basis is also the standard one in the literature (Heyting 1930; Gentzen 1935; Church 1956;
Chagrov & Zakharyaschev 1997) — see
references.biband theConnectives.leanheader — but thereasons above are why it is adopted here.
Context
This is Sub-PR 1.1.1 extracted from the larger PR #633, isolating the foundational
Propositionrefactor as a self-contained, independently reviewable change. The Modal layer (#637) is stacked on
top of it.
Zulip topic: https://leanprover.zulipchat.com/#narrow/channel/513188-CSLib/topic/Propositional.20Logic/with/602336739
File-by-file change summary
Cslib.lean
public import Cslib.Foundations.Logic.Connectives(alphabetical position).Cslib/Foundations/Logic/Connectives.lean (new)
HasBot,HasImp,HasBox,HasUntil,HasSince.PropositionalConnectives,ModalConnectives,TemporalConnectives,BimodalConnectives.ImpBotDerived, givingneg/top/or/andfrombot/imp. It isintentionally uninstantiated (concrete formula types use directly-computing
abbrevs); it isretained as a specification artifact and for future polymorphic proof-system abstractions.
Cslib/Foundations/Logic/InferenceSystem.lean
public import Cslib.Init→import Cslib.Init) and a module docstring.Cslib/Logics/Propositional/Defs.lean
and/or/implconstructors withbot/imp; definesneg/top/and/orasderived
abbrevs; registers the relevantHas*/PropositionalConnectivesinstances.Proposition.complexity,Proposition.atoms, andProposition.substfor the newconstructors.
Cslib/Logics/Propositional/NaturalDeduction/Basic.lean
introduction/elimination, ex falso); conjunction/disjunction rules become derivable.
references.bib
Church1956,Gentzen1935,Heyting1930,ChagrovZakharyaschev1997,Prawitz1965,TroelstraVanDalen1988.AI Disclosure
This PR was prepared with the assistance of Claude Code (Anthropic), used for drafting/extracting
files from a development branch, running CI verification commands, and drafting this description.
All Lean code was written by the author (Benjamin Brast-McKie) and verified to
compile on the PR branch.