Boolean-function m-semiring Bool[X] #
This file defines the semiring BoolFunc X of Boolean functions over a set X of
Boolean variables. Concretely, BoolFunc X = (X → Bool) → Bool: elements are functions
from Boolean assignments to Booleans, with pointwise operations.
Addition is pointwise ||, multiplication is pointwise &&, and the natural order
is f ≤ g ↔ ∀ a, f a → g a (pointwise implication).
BoolFunc X is absorptive, idempotent, and left-distributive.
This semiring is used in Green, Karvounarakis & Tannen, Provenance Semirings and surveyed in Senellart, Provenance and Probabilities in Relational Databases.
References #
The i-th variable of BoolFunc X: the Boolean function that returns the
value of an assignment at i.
Equations
- BoolFunc.var i ν = ν i
Instances For
Equations
- One or more equations did not get rendered due to their size.
BoolFunc X is a commutative m-semiring with pointwise || as addition,
pointwise && as multiplication, and pointwise implication as natural order.
Equations
- One or more equations did not get rendered due to their size.
Equations
- instCommSemiringWithMonusBoolFunc = { toSemiringWithMonus := instSemiringWithMonusBoolFunc, mul_comm := ⋯ }
Universal property obstructions #
The variable functions BoolFunc.var i satisfy two algebraic identities in
BoolFunc X that constrain the target of any semiring homomorphism:
1 + var i = 1(BoolFunc.absorptive)var i * var i = var i(multiplicative idempotence)
If the target K is not absorptive (there exists a : K with
1 + a ≠ 1), assigning that a to any variable makes a semiring
homomorphism BoolFunc X →+* K impossible. Similarly if K's multiplication
is not idempotent.
BoolFunc.var i * BoolFunc.var i = BoolFunc.var i.
If the target K is not absorptive, there is no semiring homomorphism
from BoolFunc X (with X inhabited) sending the variables to arbitrary
values. Picking ν constant equal to a witness a of 1 + a ≠ 1 blocks
any homomorphism: var i + 1 = 1 in BoolFunc X, so 1 + a = 1 is forced
in K.
If the target K does not have idempotent multiplication, there is no
semiring homomorphism from BoolFunc X (with X inhabited) sending the
variables to arbitrary values. Picking ν constant equal to a witness a
of a * a ≠ a blocks any homomorphism, since var i * var i = var i in
BoolFunc X.
For any assignment ν : X → BoolFunc Y, the substitution map
f ↦ (τ ↦ f (fun i => ν i τ)) is an m-semiring homomorphism
BoolFunc X → BoolFunc Y sending each variable BoolFunc.var i to ν i.
This realizes BoolFunc X as a “free” object: variables can be sent to
arbitrary Boolean functions.