Three-valued truth #
Trivalent is the three-element bounded chain false < indet < true: the value space of
strong Kleene logic ([Kle52]), the bilattice literature's THREE ([Fit94]),
and the consistent fragment of Belnap's FOUR. Strong Kleene conjunction and disjunction
are the chain's ⊓/⊔; the carrier is logic-neutral, hosting the rival trivalent
connective families — Weak Kleene ([Boc37]), Middle Kleene ([Pet79]), Belnap
conditional assertion ([Bel70]) — and the partiality operators ∂ and 𝒜 of
[BK01].
The upstreamable algebra is the Order.KleeneAlgebra class (Core/Order/DeMorganAlgebra/Defs.lean),
of which Trivalent is the canonical non-Boolean instance. The dedicated carrier with
truth-named constructors is this library's ergonomic choice; the name follows the
Boolean precedent — an adjective nominalized as its truth-value type — with the
Trivalent namespace hosting the whole trivalent development (this file's algebra,
Core/ModelTheory/Trivalent.lean's formulas).
Main definitions #
Trivalent— three-valued truth (.true,.false,.indet), aLinearOrderandBoundedOrder. Trivalent propositionsW → Trivalentlive inCore/Logic/Trivalent/Prop3.lean.Trivalent.neg— Strong Kleene negation: involutive (neg_neg), antitone (neg_antitone), De Morgan (neg_inf/neg_sup), satisfying the Kleene law (inf_neg_le_sup_neg) — soTrivalentis anOrder.KleeneAlgebra, the canonical non-Boolean instance (inf_compl_indet_ne_bot).Trivalent.meetWeak/joinWeak,meetMiddle/joinMiddle,meetBelnap/joinBelnap,xor— the rival connective families.Trivalent.presuppose,Trivalent.metaAssert— the ∂ and 𝒜 operators of [BK01].Trivalent.ofBool,Trivalent.ofBoolHom—Boolembeds as a bounded lattice homomorphism.
Main results #
Trivalent.orderIsoSignType— the truth order's mathlib carrier isSignType(-1 < 0 < 1), the iso commuting with negation. The knowledge order and the Kleene bilattice live inCore/Logic/Trivalent/Bilattice.lean.
References #
Equations
- instReprTrivalent = { reprPrec := instReprTrivalent.repr }
Equations
- instReprTrivalent.repr Trivalent.true prec✝ = Repr.addAppParen (Std.Format.nest (if prec✝ ≥ 1024 then 1 else 2) (Std.Format.text "Trivalent.true")).group prec✝
- instReprTrivalent.repr Trivalent.false prec✝ = Repr.addAppParen (Std.Format.nest (if prec✝ ≥ 1024 then 1 else 2) (Std.Format.text "Trivalent.false")).group prec✝
- instReprTrivalent.repr Trivalent.indet prec✝ = Repr.addAppParen (Std.Format.nest (if prec✝ ≥ 1024 then 1 else 2) (Std.Format.text "Trivalent.indet")).group prec✝
Instances For
Equations
- instDecidableEqTrivalent x✝ y✝ = if h : x✝.ctorIdx = y✝.ctorIdx then isTrue ⋯ else isFalse ⋯
Equations
- instInhabitedTrivalent = { default := instInhabitedTrivalent.default }
Equations
- instFintypeTrivalent = { elems := { val := ↑Trivalent.enumList, nodup := Trivalent.enumList_nodup }, complete := instFintypeTrivalent._proof_1 }
The truth order #
Equations
- Trivalent.instLE = { le := Trivalent.LE }
Equations
- One or more equations did not get rendered due to their size.
Equations
- One or more equations did not get rendered due to their size.
Equations
- Trivalent.instBoundedOrder = { top := Trivalent.true, le_top := ⋯, bot := Trivalent.false, bot_le := ⋯ }
Strong Kleene negation #
Strong Kleene meet/join on a chain ARE min/max = ⊓/⊔; use the mathlib
operations directly. Negation is the remaining primitive.
Strong Kleene negation is antitone (order-reversing).
Equations
- Trivalent.instCompl = { compl := Trivalent.neg }
Trivalent is the canonical non-Boolean Kleene algebra (Order.KleeneAlgebra): a
distributive chain with neg as the involutive antitone complement, failing
complementation (inf_compl_indet_ne_bot). The ᶜ instance gives access to the class
API (Core/Order/DeMorganAlgebra/Defs.lean); neg remains the simp-normal form.
Equations
- One or more equations did not get rendered due to their size.
Trivalent is not complemented — indet witnesses the gap between Kleene and Boolean
(so Trivalent is no OrthocomplementedLattice either).
Constructor-literal simp lemmas #
Inherited from BoundedOrder + Lattice + LinearOrder, restated with the
constructor literals (⊤ = .true, ⊥ = .false) that goals actually mention.
Designated values #
Matrix semantics fixes an upward-closed set of designated values; on a chain every such
set is principal, so a designation standard is just a threshold. K3 (strong Kleene)
designates {.true} and preserves truth; LP (Priest's Logic of Paradox) designates
{.indet, .true} and preserves non-falsity ([CERvR12]). Same algebra, dual
logics — and every designation law is an order law.
A designation standard, identified by its least designated value (threshold).
- k3 : Designation
- lp : Designation
Instances For
Equations
- Trivalent.instReprDesignation = { reprPrec := Trivalent.instReprDesignation.repr }
Equations
- Trivalent.instReprDesignation.repr Trivalent.Designation.k3 prec✝ = Repr.addAppParen (Std.Format.nest (if prec✝ ≥ 1024 then 1 else 2) (Std.Format.text "Trivalent.Designation.k3")).group prec✝
- Trivalent.instReprDesignation.repr Trivalent.Designation.lp prec✝ = Repr.addAppParen (Std.Format.nest (if prec✝ ≥ 1024 then 1 else 2) (Std.Format.text "Trivalent.Designation.lp")).group prec✝
Instances For
Equations
- Trivalent.instDecidableEqDesignation x✝ y✝ = if h : x✝.ctorIdx = y✝.ctorIdx then isTrue ⋯ else isFalse ⋯
Equations
Equations
- Trivalent.instFintypeDesignation = { elems := { val := ↑Trivalent.Designation.enumList, nodup := Trivalent.Designation.enumList_nodup }, complete := Trivalent.instFintypeDesignation._proof_1 }
The threshold (least designated value) of a standard.
Equations
Instances For
The K3/LP duality as an involution on standards.
Equations
Instances For
v is designated at d iff it clears the threshold — the designated set is the
principal filter above d.threshold.
Equations
- Trivalent.designated d v = (d.threshold ≤ v)
Instances For
Equations
K3-designation is truth.
LP-designation is non-falsity.
K3/LP duality via negation: negation swaps the standards (the antitone involution
neg fixes indet, exchanging the two principal filters' complements).
Designation distributes over ⊓: the designated set is a filter (le_inf_iff).
Designation distributes over ⊔: thresholds are prime on a chain (le_sup_iff).
K3 is the stronger standard: its threshold dominates LP's.
Conversion from Bool #
The two-valued fragment: Bool.true ↦ .true, Bool.false ↦ .false.
Equations
- Trivalent.ofBool true = Trivalent.true
- Trivalent.ofBool false = Trivalent.false
Instances For
Equations
- Trivalent.instCoeBool = { coe := Trivalent.ofBool }
A value is defined when it is not indet.
Equations
- Trivalent.true.isDefined = True
- Trivalent.false.isDefined = True
- Trivalent.indet.isDefined = False
Instances For
Equations
- One or more equations did not get rendered due to their size.
Project to Bool, sending indet to false.
Equations
- Trivalent.true.toBoolOrFalse = true
- Trivalent.false.toBoolOrFalse = false
- Trivalent.indet.toBoolOrFalse = false
Instances For
Trivalent.ofBool preserves ⊓/&&.
Trivalent.ofBool preserves ⊔/||.
The designation standards agree on the two-valued fragment.
Trivalent.ofBool as a bounded lattice homomorphism, onto the {⊥, ⊤} sublattice
of Trivalent — so consumers can appeal to the general LatticeHom API.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Exclusive disjunction #
XOR decomposes as (a ∨ b) ∧ ¬(a ∧ b) under Strong Kleene.
The truth order as SignType #
Mathlib's carrier for a three-element chain with an involutive order-reversing
negation fixing the midpoint is SignType (-1 < 0 < 1).
The truth-order carrier iso: false ↔ -1, indet ↔ 0, true ↔ 1, with Kleene
negation corresponding to SignType negation (orderIsoSignType_neg). The
knowledge-order counterpart is equivFlatBool.
Equations
- One or more equations did not get rendered due to their size.
Instances For
SignType multiplication transports to the Strong Kleene biconditional, so
Trivalent.xor is its negation.
Weak Kleene and the Beaver-Krahmer operators #
The Weak Kleene "internal" connectives originate with [Boc37] (Russian
original; English translation by Bergmann 1981) and are discussed by [Kle52]:
indet propagates unconditionally, matching Bochvar's "nonsense" reading of
paradox-prone statements. metaAssert and presuppose are the 𝒜 and ∂ operators
of [BK01] §2.
Weak Kleene disjunction: indet is absorbing (both operands must be defined).
Equations
Instances For
Weak Kleene conjunction: indet is absorbing.
Equations
Instances For
Meta-assertion: the 𝒜 (assertion) operator of [BK01] §2, closing a trivalent value to bivalent by treating undefinedness as falsity.
Equations
Instances For
Meta-assertion always produces a defined value.
Meta-assertion is idempotent.
Meta-assertion preserves defined values.
Presupposition: the ∂ operator of [BK01] §2, the companion of
metaAssert — asserts a true value, undefined otherwise (T ↦ T, F ↦ #, # ↦ #).
Equations
Instances For
Meta-asserting a presupposed value falsifies undefinedness: 𝒜 ∘ ∂ sends
exactly .true to .true.
Middle Kleene #
The asymmetric left-to-right connectives of [Pet79], the trivalent face of Karttunen filtering ([BK01], [Spe25]): an undefined first operand absorbs; a defined one proceeds by Strong Kleene.
Middle Kleene conjunction: left-undefined absorbs, left-defined proceeds by
Strong Kleene. Asymmetric — meetMiddle .false .indet = .false but
meetMiddle .indet .false = .indet ([Pet79]).
Equations
- Trivalent.indet.meetMiddle x✝ = Trivalent.indet
- x✝¹.meetMiddle x✝ = min x✝¹ x✝
Instances For
Middle Kleene disjunction: left-undefined absorbs, left-defined proceeds by Strong Kleene — a defined first disjunct can settle the result even when the second is undefined, the left-to-right filtering pattern ([Pet79]).
Equations
- Trivalent.indet.joinMiddle x✝ = Trivalent.indet
- x✝¹.joinMiddle x✝ = max x✝¹ x✝
Instances For
Middle Kleene conjunction is not commutative.
Middle Kleene disjunction is not commutative.
When the left operand is defined, Middle Kleene conjunction equals Strong Kleene.
When the left operand is defined, Middle Kleene disjunction equals Strong Kleene.
Left-undefined absorbs Middle Kleene conjunction.
Left-undefined absorbs Middle Kleene disjunction.
true is a left identity for Middle Kleene conjunction.
false is a left identity for Middle Kleene disjunction.
Middle Kleene conjunction agrees with Bool on defined inputs.
Middle Kleene disjunction agrees with Bool on defined inputs.
Belnap conditional assertion #
[Bel70]'s connectives skip undefined operands: a compound is assertive iff at
least one operand is, and asserts the combination of the assertive operands only —
indet is the identity element. Contrast Strong Kleene (indet propagates unless
dominated) and Weak Kleene (indet always propagates).
Belnap conjunction: undefined operands are skipped; indet is the identity
([Bel70], (8)).
Equations
- Trivalent.indet.meetBelnap x✝ = x✝
- x✝.meetBelnap Trivalent.indet = x✝
- x✝¹.meetBelnap x✝ = min x✝¹ x✝
Instances For
Belnap disjunction: undefined operands are skipped; indet is the identity
([Bel70], (9)).
Equations
- Trivalent.indet.joinBelnap x✝ = x✝
- x✝.joinBelnap Trivalent.indet = x✝
- x✝¹.joinBelnap x✝ = max x✝¹ x✝
Instances For
indet is a left identity for Belnap conjunction.
indet is a right identity for Belnap conjunction.
Belnap conjunction is commutative.
indet is a left identity for Belnap disjunction.
indet is a right identity for Belnap disjunction.
Belnap disjunction is commutative.
Belnap conjunction agrees with Bool on defined inputs.
Belnap disjunction agrees with Bool on defined inputs.
Projection behaviour #
How truth values aggregate through an operator: conjunctive (universal-like, all must succeed) or disjunctive (existential-like, one must succeed).
- conjunctive : ProjectionType
- disjunctive : ProjectionType
Instances For
Equations
- Trivalent.instReprProjectionType = { reprPrec := Trivalent.instReprProjectionType.repr }
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- Trivalent.instDecidableEqProjectionType x✝ y✝ = if h : x✝.ctorIdx = y✝.ctorIdx then isTrue ⋯ else isFalse ⋯