Three-valued truth #
Three-valued truth adds a value between falsity and truth. Mathlib's SignType represents it, with
-1, 0 and 1 for false, undefined and true: the order's meet and join are Kleene's strong
conjunction and disjunction, negation is his negation, and multiplication is the biconditional, so
SignType is a Kleene algebra that is not Boolean. The other three-valued conjunctions and
disjunctions differ from Kleene's only in when a compound is undefined.
Main definitions #
Trivalent.Designation: the K3 and LP standards, each named by its least designated value.SignType.ofProp: the two-valued fragment.SignType.meetWith,SignType.joinWith: the conjunction and disjunction undefined exactly where a given condition fails.SignType.meetWeak,SignType.meetMiddle,SignType.meetBelnapand their joins: the Weak Kleene, Middle Kleene and Belnap connectives.SignType.condAssert: conditional assertion at a designation standard, de Finetti's conditional at K3 and Cooper's at LP.SignType.supervaluation: the value of a predicate over a finite family of valuations.Trivalent.Connectives: an interpretation of the binary connectives by truth tables, with the Strong, Weak and Middle Kleene, Cooper and de Finetti instances.
Main results #
SignType.eq_of_eq_zero_iff_of_eq_one_iff: a value is fixed by whether it is0and whether it is1.Trivalent.Designation.dual_threshold_le_neg_iff: negation exchanges the K3 and LP standards.SignType.meetWeak_eq_meetWithand companions: each connective ismeetWithorjoinWithat its definedness condition.SignType.neg_condAssert,SignType.condAssert_condAssert: conditional assertion commutes with negation and satisfies Import-Export.
Implementation notes #
Operations that are expressions in the order and arithmetic get no definition: Strong Kleene
conjunction, disjunction and negation are ⊓, ⊔ and -, exclusive disjunction is -(a * b),
Bochvar's assertion operator is ofProp (a = 1), Beaver's presupposition operator is a ⊔ 0,
designation at a standard d is d.threshold ≤ a, and a Boolean b has value ofProp b. The
complement of the Kleene algebra is -. Every other connective keeps a
pattern-matched definition, so that rfl and decide evaluate it.
References #
Kleene's negation #
Two values agree once they agree on being 0 and on being 1.
Negation sends a meet to the join of the negations.
Negation sends a join to the meet of the negations.
Negation is the complement of the Kleene algebra.
Equations
- SignType.instInvolutiveCompl = { compl := Neg.neg, compl_compl := SignType.instInvolutiveCompl._proof_1, compl_le_compl := ⋯ }
SignType is [Kal58]'s three-element Kleene algebra.
SignType is not Boolean, since 0 meets its complement above ⊥.
The two-valued fragment #
The value of a decidable proposition is 1 or -1.
Equations
- SignType.ofProp P = if P then 1 else -1
Instances For
A two-valued proposition is non-false exactly when it holds.
A defined value is the value of its own truth.
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, and a value v is designated at d
when d.threshold ≤ v. K3, Strong Kleene logic, designates
{1} and preserves truth; LP, [Pri79]'s Logic of Paradox, designates {0, 1} and preserves
non-falsity. The two standards give dual logics over one algebra ([CERvR12]), and every
law of designation is a law of the order.
A designation standard, identified by its least designated value (threshold).
- k3 : Designation
- lp : Designation
Instances For
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.instReprDesignation = { reprPrec := Trivalent.instReprDesignation.repr }
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 least designated value of a standard.
Equations
Instances For
The K3/LP duality as an involution on standards.
Equations
Instances For
Negation swaps the designation standards, fixing 0 and exchanging the complements of the
two principal filters.
The standards agree on the two-valued fragment.
Definedness conditions #
The binary conjunctions share one truth rule, false when either operand is and true otherwise,
and differ only in where they are undefined. Strong Kleene conjunction is defined whenever the
operands settle the value, Weak Kleene's demands both operands defined, Belnap's demands one, and
Middle Kleene's is defined when the left operand is and either settles the value or the right
operand is defined too. meetWith makes the conjunction a function of that condition.
The conjunction undefined unless D holds, and otherwise false exactly when an operand is.
Equations
- SignType.meetWith D a b = if D then if a = -1 ∨ b = -1 then -1 else 1 else 0
Instances For
The disjunction undefined unless D holds, the dual of meetWith.
Equations
- SignType.joinWith D a b = -SignType.meetWith D (-a) (-b)
Instances For
Strong Kleene conjunction is meetWith defined whenever the operands settle the value.
Strong Kleene disjunction, dually.
Weak Kleene #
In the Weak Kleene connectives 0 is absorbing, so a compound is undefined as soon as an operand
is. This is [Boc38]'s internal logic, which reads the third value as nonsense, and
[Kle52]'s weak tables.
In Weak Kleene disjunction 0 is absorbing, so both operands must be defined.
Equations
Instances For
Weak Kleene conjunction is meetWith demanding both operands defined.
Weak Kleene disjunction, dually.
The Weak Kleene conjunction is undefined iff a conjunct is.
The Weak Kleene conjunction is true iff both conjuncts are.
The Weak Kleene conjunction is false iff a conjunct is false and the other is defined.
The Weak Kleene disjunction is undefined iff a disjunct is.
The Weak Kleene disjunction is false iff both disjuncts are.
The Weak Kleene disjunction is true iff both disjuncts are defined and one is true.
Negation passes through a Weak Kleene conjunction whose first conjunct is never false.
Assertion and presupposition #
The assertion operator 𝒜 of [Boc38] sends 0 to -1, closing a value to a bivalent one,
and is ofProp (a = 1). The presupposition operator ∂ of [Bea92] sends -1 to 0, keeping
only truth, and is a ⊔ 0. [BK01] build presupposition projection from the two.
Middle Kleene #
The Middle Kleene connectives of [Pet79] read their operands from left to right. An undefined first operand absorbs, and a defined one proceeds by Strong Kleene, the three-valued counterpart of Karttunen's filtering ([BK01]).
In Middle Kleene conjunction a left undefined operand absorbs and a defined one proceeds by
Strong Kleene, so meetMiddle (-1) 0 = -1 but meetMiddle 0 (-1) = 0.
Equations
- SignType.zero.meetMiddle x✝ = 0
- x✝¹.meetMiddle x✝ = min x✝¹ x✝
Instances For
In Middle Kleene disjunction a left undefined operand absorbs and a defined one proceeds by Strong Kleene, so a defined first disjunct can settle the result when the second is undefined.
Equations
- SignType.zero.joinMiddle x✝ = 0
- x✝¹.joinMiddle x✝ = max x✝¹ x✝
Instances For
Middle Kleene conjunction is meetWith at the asymmetric condition that the left operand is
defined and either settles the value or the right operand is defined too.
Middle Kleene disjunction, dually.
Middle Kleene conjunction is not commutative.
Middle Kleene disjunction is not commutative.
When the left operand is defined, Middle Kleene conjunction is Strong Kleene's.
When the left operand is defined, Middle Kleene disjunction is Strong Kleene's.
-1 is a left zero for Middle Kleene conjunction, against Weak Kleene's
meetWeak (-1) 0 = 0.
Middle Kleene conjunction reads its right argument only when its left one is true.
Middle Kleene disjunction reads its right argument only when its left one is false.
Middle Kleene conjunction is undefined iff its left operand is, or the left operand is true and the right one undefined, the first conjunct filtering the second's presupposition.
Middle Kleene disjunction is undefined iff its left operand is, or the left operand is false and the right one undefined.
Belnap's connectives #
The connectives of [Bel70]'s conditional assertion skip undefined operands: a compound is
assertive iff at least one operand is, and asserts the combination of the assertive operands only,
so 0 is the identity. Strong Kleene's let 0 through unless an operand settles the value, and
Weak Kleene's always do.
Belnap conjunction skips undefined operands, with 0 as identity ([Bel70], (8)).
Equations
- SignType.zero.meetBelnap x✝ = x✝
- x✝.meetBelnap SignType.zero = x✝
- x✝¹.meetBelnap x✝ = min x✝¹ x✝
Instances For
Belnap disjunction skips undefined operands, with 0 as identity ([Bel70], (9)).
Equations
- SignType.zero.joinBelnap x✝ = x✝
- x✝.joinBelnap SignType.zero = x✝
- x✝¹.joinBelnap x✝ = max x✝¹ x✝
Instances For
Belnap conjunction is meetWith demanding one operand defined.
Belnap disjunction, dually.
On defined operands Belnap conjunction is Strong Kleene's.
Belnap conjunction is undefined iff both conjuncts are.
Belnap disjunction is undefined iff both disjuncts are.
On defined operands Belnap disjunction is Strong Kleene's.
Belnap conjunction is non-false exactly when both conjuncts are.
Conditional assertion #
A conditional assertion asserts its consequent where its antecedent holds and is void elsewhere ([Bel70]). Over a trivalent antecedent a designation standard decides what a void antecedent does: at K3 only a true antecedent passes the consequent on, the conditional of [dF36], and at LP a void antecedent does too, the conditional of [Coo68]. At either standard the conditional commutes with negation and imports and exports a conjunction.
The conditional assertion of b on a at the standard d is b where a is designated and
0 elsewhere.
Equations
- SignType.condAssert d a b = if d.threshold ≤ a then b else 0
Instances For
De Finetti's conditional groups a void antecedent with a false one.
Cooper's conditional groups a void antecedent with a true one.
On a two-valued antecedent the standards agree: the consequent where the antecedent holds and void elsewhere.
Antecedents designated alike give the same conditional.
Negation commutes with the conditional.
Import-Export: a conditional on a of a conditional on b is the conditional on the
Strong Kleene conjunction a ⊓ b, which is designated exactly when both conjuncts are.
Conditional assertion distributes over Belnap conjunction.
Conditional assertion distributes over Belnap disjunction.
Supervaluation #
The value of a predicate over a finite family of classical valuations ([vF66]). The
empty family is vacuously both all-true and all-false, and supervaluation resolves it to 1.
The supervaluation of P over the family s is 1 when P holds at every member, -1
when it fails at every member of a nonempty s, and 0 otherwise.
Equations
- SignType.supervaluation s P = if ∀ a ∈ s, P a then 1 else if ∃ a ∈ s, P a then 0 else -1
Instances For
Over a single valuation the supervaluation is classical truth.
The supervaluation depends only on the predicate's values on the family.
Supervaluating over the image of a family is supervaluating the composite over the family.
Over a nonempty family a constant predicate supervaluates to its classical value.
Over a nonempty family, negating the predicate negates the supervaluation, swapping truth and falsity and fixing the gap.
Truth-table interpretations #
The trivalent logics of the literature share Kleene's negation and differ in the truth tables of
their binary connectives, which Connectives collects. With a designation standard they make a
logical matrix.
An interpretation of the binary connectives by trivalent truth tables; negation is always Kleene's.
- conj : SignType → SignType → SignType
The conjunction.
- disj : SignType → SignType → SignType
The disjunction.
- cond : SignType → SignType → SignType
The conditional.
Instances For
The strong tables of [Kle52], with the material conditional ¬a ∨ b.
Equations
- Trivalent.Connectives.strongKleene = { conj := fun (x1 x2 : SignType) => min x1 x2, disj := fun (x1 x2 : SignType) => max x1 x2, cond := fun (a b : SignType) => max (-a) b }
Instances For
The weak tables of [Kle52], the internal logic of [Boc38].
Equations
- Trivalent.Connectives.weakKleene = { conj := SignType.meetWeak, disj := SignType.joinWeak, cond := fun (a b : SignType) => (-a).joinWeak b }
Instances For
The Middle Kleene tables of [Pet79], which read their operands from left to right.
Equations
- Trivalent.Connectives.middleKleene = { conj := SignType.meetMiddle, disj := SignType.joinMiddle, cond := fun (a b : SignType) => (-a).joinMiddle b }
Instances For
The tables of [Coo68] take Belnap's conjunction and disjunction, which skip a void operand, and the conditional that asserts its consequent on a non-false antecedent.
Equations
- Trivalent.Connectives.cooper = { conj := SignType.meetBelnap, disj := SignType.joinBelnap, cond := SignType.condAssert Trivalent.Designation.lp }
Instances For
The conditional of [dF36], which asserts its consequent on a true antecedent, with the strong Kleene conjunction and disjunction.
Equations
- Trivalent.Connectives.deFinetti = { conj := fun (x1 x2 : SignType) => min x1 x2, disj := fun (x1 x2 : SignType) => max x1 x2, cond := SignType.condAssert Trivalent.Designation.k3 }