Documentation

Cslib.Logics.Kleene.Basic

Truth values of Kleene's strong three-valued logic #

The truth values of Kleene's strong three-valued logic (K3) [Kle52], as an algebra: a bounded linear order false < unknown < true, the truth order, with a complement. Meet ⊓, join ⊔ and complement ᶜ are Kleene's conjunction, disjunction and negation.

These are also the truth values of SQL [Cod79], where a comparison involving NULL evaluates to unknown, and AND, OR and NOT are the meet, join and complement defined here.

In the information order ⊑, unknown lies below both definite values, which are incomparable. Every operation is monotone in it, and ⊓, ⊔ and ᶜ are the greatest monotone extensions of &&, || and !. Under ⊑, Kleene.Value is the flat domain on Bool, so these results could be subsumed under a general development of domain theory.

Main definitions #

Main results #

References #

A truth value of Kleene's strong three-valued logic.

Instances For
    @[instance_reducible]
    Equations
    Equations
    • One or more equations did not get rendered due to their size.
    Instances For
      @[instance_reducible]
      Equations
      • One or more equations did not get rendered due to their size.

      The truth order #

      @[instance_reducible]
      Equations
      @[instance_reducible]
      Equations
      • One or more equations did not get rendered due to their size.
      @[instance_reducible]
      Equations
      • One or more equations did not get rendered due to their size.

      Meet and join #

      Complement #

      @[instance_reducible]

      The complement swaps true and false and fixes unknown.

      Equations
      • One or more equations did not get rendered due to their size.

      The complement reverses the truth order.

      The embedding of Bool #

      The information order #

      The information order: unknown lies below every value, and the definite values are incomparable. It is distinct from the truth order ≤.

      Equations
      Instances For

        The information order: unknown lies below every value, and the definite values are incomparable. It is distinct from the truth order ≤.

        Equations
        • One or more equations did not get rendered due to their size.
        Instances For
          @[instance_reducible]
          Equations
          @[simp]

          unknown is the least informative value.

          @[simp]

          Definite values are maximal in the information order.

          Monotonicity in the information order #

          theorem Cslib.Logic.Kleene.Value.InfoLE.inf {a a' b b' : Value} (ha : a.InfoLE a') (hb : b.InfoLE b') :
          (min a b).InfoLE (min a' b')
          theorem Cslib.Logic.Kleene.Value.InfoLE.sup {a a' b b' : Value} (ha : a.InfoLE a') (hb : b.InfoLE b') :
          (max a b).InfoLE (max a' b')

          Greatest monotone extensions #

          theorem Cslib.Logic.Kleene.Value.infoLE_compl_of_extends {f : Value → Value} (mono : ∀ {a a' : Value}, a.InfoLE a' → (f a).InfoLE (f a')) (ext : ∀ (x : Bool), f (ofBool x) = ofBool !x) (a : Value) :
          (f a).InfoLE aᶜ

          The complement is the greatest extension of Boolean negation that is monotone in the information order.

          theorem Cslib.Logic.Kleene.Value.eq_compl_of_extends {f : Value → Value} (mono : ∀ {a a' : Value}, a.InfoLE a' → (f a).InfoLE (f a')) (ext : ∀ (x : Bool), f (ofBool x) = ofBool !x) (a : Value) :
          f a = aᶜ

          The complement is the only extension of Boolean negation that is monotone in the information order.

          theorem Cslib.Logic.Kleene.Value.infoLE_inf_of_extends {f : Value → Value → Value} (mono : ∀ {a a' b b' : Value}, a.InfoLE a' → b.InfoLE b' → (f a b).InfoLE (f a' b')) (ext : ∀ (x y : Bool), f (ofBool x) (ofBool y) = ofBool (x && y)) (a b : Value) :
          (f a b).InfoLE (min a b)

          The meet is the greatest extension of Boolean conjunction that is monotone in the information order.

          theorem Cslib.Logic.Kleene.Value.infoLE_sup_of_extends {f : Value → Value → Value} (mono : ∀ {a a' b b' : Value}, a.InfoLE a' → b.InfoLE b' → (f a b).InfoLE (f a' b')) (ext : ∀ (x y : Bool), f (ofBool x) (ofBool y) = ofBool (x || y)) (a b : Value) :
          (f a b).InfoLE (max a b)

          The join is the greatest extension of Boolean disjunction that is monotone in the information order.

          The equivalence with Option Bool #

          Kleene.Value is Option Bool: the definite values as some, unknown as none.

          Equations
          • One or more equations did not get rendered due to their size.
          Instances For
            @[simp]

            The information order, read through toOption.