Documentation

Provenance.Semirings.Bool

Boolean m-semiring #

This file shows that Bool (with || as addition and && as multiplication) is a commutative m-semiring. It is the simplest m-semiring and serves as the target of the natural homomorphism from BoolFunc X.

The semiring is absorptive (true || a = true), idempotent, and satisfies left-distributivity of multiplication over monus.

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

The Boolean semiring (Bool, ||, &&) is an m-semiring. The natural order is the usual Boolean order (false ≤ true), and the monus is a && !b. The δ operator matches ProvSQL's Boolean::delta: it is the identity.

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

Bool has characteristic 0 in the CharP sense: it is idempotent and nontrivial (true ≠ false), so every positive natural-number cast equals 1 = true. It is not CharZero since the cast ℕ → Bool is not injective.

Injective m-semiring homomorphism from Bool to Bool[X]

theorem Bool.homomorphism_to_BoolFunc {X : Type} (ν : XBool) :
(h : SemiringWithMonusHom (BoolFunc X) Bool), ∀ (i : X), (fun (x : BoolFunc X) => h.toRingHom x) (BoolFunc.var i) = ν i

For any assignment ν : X → Bool of Boolean variables to Booleans, the evaluation map f ↦ f ν is an m-semiring homomorphism BoolFunc X → Bool sending each variable BoolFunc.var i to ν i.