Documentation

Provenance.Semirings.How

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 #

@[implicit_reducible]
Equations
@[implicit_reducible]
Equations
  • One or more equations did not get rendered due to their size.
@[implicit_reducible]
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.)

@[implicit_reducible]

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.
@[implicit_reducible]
Equations
theorem How.universal {X : Type} (K : Type) [CommSemiring K] (ν : XK) :
∃ (h : MvPolynomial X →+* K), ∀ (i : X), h (MvPolynomial.X i) = ν i

The How[X] semiring is universal among commutative semirings. This was observed in Green, Karnouvarakis, Tannen, Provenance Semirings, Proposition 4.2.

theorem How.not_universal_m {X : Type} [DecidableEq X] [Inhabited X] :
∃ (ν : X), ¬∃ (h : SemiringWithMonusHom (MvPolynomial X ) ), ∀ (i : X), (fun (x : MvPolynomial X ) => h.toRingHom x) (MvPolynomial.X i) = ν i

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.

theorem How.no_hom_from_BoolFunc {X Y : Type} [Inhabited Y] :
∃ (ν : YMvPolynomial X ), ¬∃ (φ : BoolFunc Y →+* MvPolynomial X ), ∀ (i : Y), φ (BoolFunc.var i) = ν i

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.