How-provenance m-semiring ℕ[X] #
This file shows that the polynomial semiring MvPolynomial X ℕ (multivariate
polynomials with natural-number coefficients over a set X of variables) is a
commutative m-semiring, sometimes called the How provenance semiring.
It is the universal commutative semiring for provenance Green, Karnouvarakis & Tannen, Provenance Semirings, Proposition 4.2, but is not the universal m-semiring Geerts & Poggi, On database query languages for K-relations, Example 10.
ℕ[X] is neither idempotent nor absorptive. It also does not satisfy
left-distributivity of multiplication over monus, contradicting a claim in
Amsterdamer, Deutch & Tannen, On the limitations of provenance for queries with
differences, Table on p. 4.
References #
Equations
- instLEMvPolynomialNat_provenance = { le := fun (a b : MvPolynomial X ℕ) => ∀ (m : X →₀ ℕ), MvPolynomial.coeff m a ≤ MvPolynomial.coeff m b }
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.
ℕ[X] inherits CharZero from ℕ: the constant embedding C : ℕ → MvPolynomial X ℕ
is injective, and (n : MvPolynomial X ℕ) = C n. (Equivalent to
Mathlib.RingTheory.MvPolynomial.Basic.instCharZero, inlined here to avoid the heavy
transitive imports of that file.)
Marked as noncomputable only because the proof that MvPolynomial is a
CommutativeSemiring is done in a non-computable way in Mathlib. We
could redefine MvPolynomial to provide computable proofs.
The δ operator matches ProvSQL's How::delta: the support indicator
(0 ↦ 0, any non-zero polynomial ↦ 1).
Equations
- One or more equations did not get rendered due to their size.
Equations
- instCommSemiringWithMonusMvPolynomialNat = { toSemiringWithMonus := instSemiringWithMonusMvPolynomialNat, mul_comm := ⋯ }
The How[X] semiring is universal among commutative semirings. This was observed in Green, Karnouvarakis, Tannen, Provenance Semirings, Proposition 4.2.
The How[X] semiring is not universal among commutative m-semirings, as long as there is at least one variable in X (if there is none, the notion of universality is trivial). This was shown in Geerts & Poggi, On database query languages for K-relations, Example 10.
In How[X], as long as X is non-empty, times is not distributive over monus. Note that this contradicts Amsterdamer, Deutch & Tannen, On the limitations of provenance for queries with differences, table page 4, which claims this semiring satisfies axiom A13.
ℕ[X] has characteristic 0 in the CharP sense, inherited from CharZero via
CharP.ofCharZero.
There is no semiring homomorphism from BoolFunc Y to ℕ[X] sending the
variables to arbitrary values: ℕ[X] is not absorptive, which contradicts
var i + 1 = 1 in BoolFunc Y.