Documentation

Provenance.Semirings.Which

Which-provenance m-semiring (lineage) #

This file defines the Which (or lineage) provenance semiring Which α. Elements are either a finite set wset s representing the witnesses or wbot (bottom). Addition takes the union of witness sets, and multiplication does likewise.

Which α is idempotent. It is absorptive if and only if α is empty. It does not satisfy left-distributivity of multiplication over monus when α is nonempty.

The lineage semiring is discussed in Green & Tannen, The Semiring Framework for Database Provenance.

References #

inductive Which (α : Type) :
Instances For
    @[implicit_reducible]
    instance instZeroWhich {α : Type} :
    Zero (Which α)
    Equations
    @[implicit_reducible]
    instance instAddWhich {α : Type} [DecidableEq α] :
    Add (Which α)
    Equations
    • One or more equations did not get rendered due to their size.
    @[implicit_reducible]
    instance instMulWhich {α : Type} [DecidableEq α] :
    Mul (Which α)
    Equations
    • One or more equations did not get rendered due to their size.
    @[implicit_reducible]
    instance instOneWhich {α : Type} :
    One (Which α)
    Equations
    @[implicit_reducible]
    instance instSubWhich {α : Type} [DecidableEq α] :
    Sub (Which α)
    Equations
    • One or more equations did not get rendered due to their size.
    @[implicit_reducible]
    instance instLEWhich {α : Type} :
    LE (Which α)
    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.
    @[implicit_reducible]
    Equations
    @[implicit_reducible]
    Equations
    • One or more equations did not get rendered due to their size.
    @[implicit_reducible]
    Equations
    theorem Which.not_absorptive {α : Type} [DecidableEq α] (h : ∃ (x : α), ) :

    Which[X] is not absorptive as long as there is at least one variable

    theorem Which.absorptive {α : Type} [DecidableEq α] (h : IsEmpty α) :

    Which[∅] is absorptive

    instance Which.instCharPZero {α : Type} [DecidableEq α] :
    CharP (Which α) 0

    Which α has characteristic 0 in the CharP sense: it is idempotent and nontrivial (wbotwset), so every positive natural-number cast equals 1.

    In Which[X], as long as X is non-empty, times is not distributive over monus.

    theorem Which.no_hom_from_BoolFunc {α : Type} [DecidableEq α] {Y : Type} [Inhabited Y] [Inhabited α] :
    ∃ (ν : YWhich α), ¬∃ (φ : BoolFunc Y →+* Which α), ∀ (i : Y), φ (BoolFunc.var i) = ν i

    There is no semiring homomorphism from BoolFunc Y to Which α (with α inhabited) sending the variables to arbitrary values: Which α is not absorptive (Which.not_absorptive), which contradicts var i + 1 = 1 in BoolFunc Y.