Documentation

Provenance.SupportAdequacy

Support adequacy over 𝔹 and transfer along monus homomorphisms #

Provenance.QueryAdequacy shows that on the data parts, adequacy of the annotated semantics with the plain semantics stops at the positive fragment. This file gives the equality that does extend to the full non-aggregation fragment (difference and duplicate elimination included): over the Boolean m-semiring 𝔹, the support of the annotated evaluation – the multiset of true-annotated tuple slots – is exactly the plain evaluation of the support of the database (Query.evaluateAnnotated_support).

The result is derived, rather than re-proved, from the possible-worlds commutation theorem randomWorld_evaluateAnnotated of Provenance.Probability, instantiated at the variable-free Boolean-function semiring BoolFunc Empty ≃ 𝔹 via the constant embedding Bool.constHom.

It then transfers along any m-semiring homomorphism h : K → 𝔹 (Query.evaluateAnnotated_support_hom), by the hom-commutation theorem Query.evaluateAnnotated_hom: every annotation domain that admits a monus-preserving support map into 𝔹 inherits the adequacy equality. BoolFunc X admits one per valuation (Bool.homomorphism_to_BoolFunc), which recovers the possible-worlds reading; admits none (Nat.no_monusHom_to_Bool in Provenance.Semirings.Nat) – its support map n ↦ (n ≠ 0) is a ring homomorphism but does not preserve monus, which is the algebraic reason why -adequacy is restricted to the positive fragment (the theorem of Benzaken, Cohen-Boulakia, Contejean, Keller & Zucchini, A Coq formalization of data provenance).

Main definitions #

Main results #

References #

Boolean support of a 𝔹-annotated relation: the multiset of data parts of the true-annotated tuple slots. The return type is a bare Multiset (Tuple T n) so that Multiset lemmas apply without an extra unfolding step.

Equations
Instances For

    Boolean support of a 𝔹-annotated database, relation by relation.

    Equations
    Instances For
      @[reducible]

      The constant embedding 𝔹 → 𝔹[X] as an m-semiring homomorphism (the same homomorphism exhibited by Bool.homomorphism_from_BoolFunc, as a usable definition).

      Equations
      • Bool.constHom X = { toFun := fun (b : Bool) (x : XBool) => b, map_one' := , map_mul' := , map_zero' := , map_add' := , map_sub := , map_delta := }
      Instances For
        theorem randomWorld_constHom {T : Type} {n : } {X : Type} (v : XBool) (r : AnnotatedRelation T Bool n) :

        The random world of the constant embedding of a 𝔹-annotated relation is its support, under any valuation.

        Support adequacy over 𝔹. For any non-aggregation query q – the full fragment, difference and duplicate elimination included – the support of the 𝔹-annotated evaluation equals the plain evaluation of the support of the database. This is the equality that replaces the (positive-fragment only) -adequacy of Benzaken, Cohen-Boulakia, Contejean, Keller & Zucchini once difference enters the language.

        Transfer of support adequacy along monus homomorphisms. Any m-semiring homomorphism h : K → 𝔹 turns the annotated evaluation over K into a plain evaluation on the h-support of the database. BoolFunc X admits one such homomorphism per valuation (Bool.homomorphism_to_BoolFunc), recovering the possible-worlds semantics; admits none (Nat.no_monusHom_to_Bool), which is why -adequacy stops at the positive fragment.