Orthologic: syntax, proof system, and algebraic completeness #
[UPSTREAM] candidate.
Orthologic ([HM24] §3.1, after Goldblatt) is the logic of
ortholattices: φ ⊢ ψ is the consequence relation holding in every
OrthocomplementedLattice. This file gives the syntax, Goldblatt's proof system
(Definition 3.12), and — via mathlib's Antisymmetrization (documented as the
free Preorder → PartialOrder functor) — the Lindenbaum–Tarski algebra
witnessing algebraic completeness (Theorem 3.13): the least orthologic is
sound and complete with respect to the class of all ortholattices.
Main definitions #
Formula— orthologic formulas (⊤, variables,¬,∧;∨De Morgan-defined).Derivable(⊢) — the least orthologic (Goldblatt's ten rules).LindenbaumTarski— formulas modulo interderivability (anOrthocomplementedLattice).eval, soundness, completeness.
Implementation notes #
The Lindenbaum–Tarski algebra is Antisymmetrization (Formula Var) (· ≤ ·) for
the provability preorder; mathlib documents Antisymmetrization as the free
functor Preord → PartOrd, so the quotient and its PartialOrder come for free.
This file adds the OrthocomplementedLattice structure and completeness.
Syntax #
Orthologic formulas over a variable type Var. Disjunction is De Morgan-defined
(Formula.or), matching the ortholattice signature.
- top {Var : Type u_1} : Formula Var
- var {Var : Type u_1} (p : Var) : Formula Var
- neg {Var : Type u_1} (φ : Formula Var) : Formula Var
- and {Var : Type u_1} (φ ψ : Formula Var) : Formula Var
Instances For
Falsum ⊥ := ¬⊤.
Equations
Instances For
The proof system #
The least orthologic ([HM24] Definition 3.12, after
Goldblatt): Derivable φ ψ (written φ ⊢ ψ) is generated by ten rules —
⊤-introduction, reflexivity, the two ∧-projections, double-negation
introduction and elimination, non-contradiction (φ ∧ ¬φ ⊢ ψ), cut,
∧-introduction, and contraposition.
- top_intro {Var : Type u_1} (φ : Formula Var) : Derivable φ Formula.top
- refl {Var : Type u_1} (φ : Formula Var) : Derivable φ φ
- and_le_left {Var : Type u_1} (φ ψ : Formula Var) : Derivable (φ.and ψ) φ
- and_le_right {Var : Type u_1} (φ ψ : Formula Var) : Derivable (φ.and ψ) ψ
- le_negNeg {Var : Type u_1} (φ : Formula Var) : Derivable φ φ.neg.neg
- negNeg_le {Var : Type u_1} (φ : Formula Var) : Derivable φ.neg.neg φ
- contradiction {Var : Type u_1} (φ ψ : Formula Var) : Derivable (φ.and φ.neg) ψ
- trans {Var : Type u_1} {φ ψ χ : Formula Var} : Derivable φ ψ → Derivable ψ χ → Derivable φ χ
- le_and {Var : Type u_1} {φ ψ χ : Formula Var} : Derivable φ ψ → Derivable φ χ → Derivable φ (ψ.and χ)
- neg_le_neg {Var : Type u_1} {φ ψ : Formula Var} : Derivable φ ψ → Derivable ψ.neg φ.neg
Instances For
The least orthologic ([HM24] Definition 3.12, after
Goldblatt): Derivable φ ψ (written φ ⊢ ψ) is generated by ten rules —
⊤-introduction, reflexivity, the two ∧-projections, double-negation
introduction and elimination, non-contradiction (φ ∧ ¬φ ⊢ ψ), cut,
∧-introduction, and contraposition.
Equations
- Orthologic.«term_⊢_» = Lean.ParserDescr.trailingNode `Orthologic.«term_⊢_» 50 51 (Lean.ParserDescr.binary `andthen (Lean.ParserDescr.symbol " ⊢ ") (Lean.ParserDescr.cat `term 51))
Instances For
The provability preorder and the Lindenbaum–Tarski algebra #
Provability is a preorder (reflexivity + cut).
Equations
- Orthologic.instPreorder = { le := Orthologic.Derivable, le_refl := ⋯, le_trans := ⋯, lt_iff_le_not_ge := ⋯ }
The Lindenbaum–Tarski algebra: formulas modulo interderivability. As the
Antisymmetrization of the provability preorder it is automatically a
PartialOrder; the OrthocomplementedLattice structure is added below.
Equations
- Orthologic.LindenbaumTarski Var = Antisymmetrization (Orthologic.Formula Var) fun (x1 x2 : Orthologic.Formula Var) => x1 ≤ x2
Instances For
Evaluation and soundness #
Evaluate a formula in an ortholattice under a valuation v : Var → L.
Equations
- Orthologic.Formula.eval v Orthologic.Formula.top = ⊤
- Orthologic.Formula.eval v (Orthologic.Formula.var p) = v p
- Orthologic.Formula.eval v φ.neg = (Orthologic.Formula.eval v φ)ᶜ
- Orthologic.Formula.eval v (φ.and ψ) = Orthologic.Formula.eval v φ ⊓ Orthologic.Formula.eval v ψ
Instances For
Soundness: a derivable consequence holds in every ortholattice under every valuation ([HM24] Theorem 3.13, soundness half).
Provability lemmas for the lattice structure #
These are the ortholattice axioms at the level of formulas; the quotient
instance below lifts them through Antisymmetrization.
The Lindenbaum–Tarski algebra is an ortholattice #
Equations
- Orthologic.LindenbaumTarski.instMin = { min := Quotient.map₂ Orthologic.Formula.and ⋯ }
Equations
- Orthologic.LindenbaumTarski.instMax = { max := Quotient.map₂ Orthologic.Formula.or ⋯ }
Equations
- Orthologic.LindenbaumTarski.instCompl = { compl := Quotient.map Orthologic.Formula.neg ⋯ }
Equations
- Orthologic.LindenbaumTarski.instTop = { top := toAntisymmetrization (fun (x1 x2 : Orthologic.Formula Var) => x1 ≤ x2) Orthologic.Formula.top }
Equations
- Orthologic.LindenbaumTarski.instBot = { bot := toAntisymmetrization (fun (x1 x2 : Orthologic.Formula Var) => x1 ≤ x2) Orthologic.Formula.bot }
Equations
- One or more equations did not get rendered due to their size.
Equations
- Orthologic.LindenbaumTarski.instBoundedOrder = { toTop := Orthologic.LindenbaumTarski.instTop, le_top := ⋯, toBot := Orthologic.LindenbaumTarski.instBot, bot_le := ⋯ }
The Lindenbaum–Tarski algebra of orthologic is an orthocomplemented lattice.
Equations
- One or more equations did not get rendered due to their size.
Completeness #
The canonical valuation into the Lindenbaum–Tarski algebra: p ↦ ⟦p⟧.
Equations
- Orthologic.Formula.canonicalVal p = toAntisymmetrization (fun (x1 x2 : Orthologic.Formula Var) => x1 ≤ x2) (Orthologic.Formula.var p)
Instances For
Evaluating under the canonical valuation returns the formula's own class.
Completeness ([HM24] Theorem 3.13): if φ ⊨ ψ holds in
every ortholattice under every valuation, then φ ⊢ ψ. Proved by evaluating in
the Lindenbaum–Tarski algebra under the canonical valuation. (Testing
ortholattices at Var's universe suffices — the L–T algebra is the worst case.)
Algebraic completeness of orthologic ([HM24]
Theorem 3.13): φ ⊢ ψ iff the inequality holds in every ortholattice.