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 #
AnnotatedRelation.support,AnnotatedDatabase.support– the true-annotated tuple slots of a𝔹-annotated relation / databaseBool.constHom– the constant embedding𝔹 → 𝔹[X]as an m-semiring homomorphism
Main results #
Query.evaluateAnnotated_support– support adequacy over𝔹, for the full non-aggregation fragmentQuery.evaluateAnnotated_support_hom– transfer along any m-semiring homomorphismK → 𝔹
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
- r.support = Multiset.map Prod.fst (Multiset.filter (fun (p : AnnotatedTuple T Bool n) => p.2 = true) r)
Instances For
The constant embedding 𝔹 → 𝔹[X] as an m-semiring homomorphism (the
same homomorphism exhibited by Bool.homomorphism_from_BoolFunc, as a
usable definition).
Equations
Instances For
The random world of the constant embedding of a 𝔹-annotated relation
is its support, under any valuation.
Database-level version of randomWorld_constHom.
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.