Documentation

Provenance.Semirings.Viterbi

Viterbi m-semiring #

This file defines the Viterbi semiring over non-negative reals in [0,1]. Addition is max, multiplication is the usual product, zero is 0, and one is 1.

The Viterbi semiring is absorptive and idempotent, and satisfies left-distributivity of multiplication over monus.

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

References #

Viterbi semiring (max-times) over probabilities in [0,1].

Equations
Instances For
    Dependency graph
    @[instance_reducible]
    Equations
    Dependency graph
    theorem Viterbi.ext {a b : Viterbi} (h : a = b) :
    a = b
    Dependency graph
    theorem Viterbi.ext_iff {a b : Viterbi} :
    a = b a = b
    Dependency graph
    @[simp]
    theorem Viterbi.coe_mk (p : NNReal) (hp : p 1) :
    p, hp = p
    Dependency graph
    @[instance_reducible]
    Equations
    Dependency graph
    @[instance_reducible]
    Equations
    Dependency graph
    @[instance_reducible]
    Equations
    Dependency graph
    @[instance_reducible]
    Equations
    Dependency graph
    @[simp]
    theorem Viterbi.zero_def :
    0 = 0
    Dependency graph
    @[simp]
    theorem Viterbi.one_def :
    1 = 1
    Dependency graph
    @[simp]
    theorem Viterbi.add_def (a b : Viterbi) :
    ↑(a + b) = max a b
    Dependency graph
    @[simp]
    theorem Viterbi.mul_def (a b : Viterbi) :
    ↑(a * b) = a * b
    Dependency graph
    @[instance_reducible]
    Equations
    • One or more equations did not get rendered due to their size.
    Dependency graph
    theorem Viterbi.viterbi_order_le (a b : Viterbi) :
    a b a + b = b
    Dependency graph
    @[instance_reducible]
    Equations
    • One or more equations did not get rendered due to their size.
    Dependency graph
    @[simp]
    theorem Viterbi.le_def (a b : Viterbi) :
    a b a b
    Dependency graph
    @[instance_reducible]
    noncomputable instance Viterbi.instSub :
    Equations
    Dependency graph
    Dependency graph
    Dependency graph
    Dependency graph
    Dependency graph
    Dependency graph

    Viterbi has characteristic 0 in the CharP sense: it is idempotent and nontrivial.

    Dependency graph
    @[instance_reducible]

    Viterbi is a commutative m-semiring. The natural order is the usual order on [0,1], and the monus is a if a > b, 0 if a ≤ b.

    Equations
    • One or more equations did not get rendered due to their size.
    Dependency graph
    Dependency graph
    theorem Viterbi.not_mul_idempotent :
    ¬∀ (a : Viterbi), a * a = a

    Viterbi multiplication is not idempotent: (1/2) * (1/2) = 1/4 ≠ 1/2.

    Dependency graph

    On Viterbi the identity is not an admissible δ, even though the semiring is absorptive (Viterbi.absorptive): what delta_absorb asks of δ := id is the lattice law a ⊗ (a ⊕ b) = a, which at a = b = 1/2 reads 1/2 ⊗ 1/2 = 1/4 ≠ 1/2. This is why the instance takes the support indicator (ProvSQL's Viterbi::delta).

    Dependency graph
    theorem Viterbi.no_hom_from_BoolFunc {Y : Type} [Inhabited Y] :
    ∃ (ν : YViterbi), ¬∃ (φ : BoolFunc Y →+* Viterbi), ∀ (i : Y), φ (BoolFunc.var i) = ν i

    There is no semiring homomorphism from BoolFunc Y to Viterbi sending the variables to arbitrary values: Viterbi multiplication (ordinary product on [0,1]) is not idempotent, contradicting var i * var i = var i in BoolFunc Y.

    Dependency graph
    Dependency graph