Documentation

Provenance.Semirings.MinMax

Min-max semiring #

This file defines the min-max semiring MinMax α over a bounded linear order α, where addition is min and multiplication is max. The natural order is the reverse of the order on α (so is the additive identity and the multiplicative identity). This semiring models security levels or (dually) the fuzzy semiring.

Also defined:

MinMax α is absorptive and idempotent. The dual MaxMin TVL does not satisfy left-distributivity of multiplication over monus.

The security/access control semiring is discussed in Green & Tannen, The Semiring Framework for Database Provenance.

References #

structure MinMax (α : Type) :

The min-max semiring over a bounded linear order: addition is min, multiplication is max, zero is and one is . The natural order is the reverse of α's order.

  • val : α
Instances For
    theorem MinMax.ext_iff {α : Type} {x y : MinMax α} :
    x = y x.val = y.val
    theorem MinMax.ext {α : Type} {x y : MinMax α} (val : x.val = y.val) :
    x = y
    @[implicit_reducible]
    instance instCoeMinMax {α : Type} :
    Coe (MinMax α) α
    Equations
    @[implicit_reducible]
    instance instTopMinMax {α : Type} [LinearOrder α] [OrderTop α] :
    Top (MinMax α)
    Equations
    @[implicit_reducible]
    instance instBotMinMax {α : Type} [LinearOrder α] [OrderBot α] :
    Bot (MinMax α)
    Equations
    @[implicit_reducible]
    instance instLEMinMax {α : Type} [LinearOrder α] :
    LE (MinMax α)
    Equations
    @[implicit_reducible]
    Equations
    • One or more equations did not get rendered due to their size.
    @[implicit_reducible]
    instance instZeroMinMax {α : Type} [LinearOrder α] [OrderTop α] :
    Equations
    @[implicit_reducible]
    instance instAddMinMax {α : Type} [LinearOrder α] :
    Add (MinMax α)
    Equations
    @[implicit_reducible]
    instance instOneMinMax {α : Type} [LinearOrder α] [OrderBot α] :
    One (MinMax α)
    Equations
    @[implicit_reducible]
    instance instMulMinMax {α : Type} [LinearOrder α] :
    Mul (MinMax α)
    Equations
    @[implicit_reducible]
    instance instSubMinMax {α : Type} [LinearOrder α] [OrderTop α] :
    Sub (MinMax α)
    Equations
    @[implicit_reducible]
    Equations
    • One or more equations did not get rendered due to their size.
    @[implicit_reducible]

    MinMax α is a commutative m-semiring for any bounded linear order α.

    Equations
    • One or more equations did not get rendered due to their size.
    @[implicit_reducible]
    Equations
    instance MinMax.instCharPZero {α : Type} [LinearOrder α] [OrderBot α] [OrderTop α] [Nontrivial α] :
    CharP (MinMax α) 0

    MinMax α has characteristic 0 in the CharP sense whenever α is nontrivial: it is idempotent, and (0 : MinMax α) = ⟨⊤⟩ differs from (1 : MinMax α) = ⟨⊥⟩ since ⊥ ≠ ⊤ in a nontrivial bounded order.

    @[reducible, inline]
    abbrev MaxMin (α : Type) :
    Equations
    Instances For
      @[implicit_reducible]
      Equations
      @[implicit_reducible]
      Equations
      • One or more equations did not get rendered due to their size.
      @[implicit_reducible]
      Equations
      inductive TVL :

      Three-valued logic {⊥, unknown, ⊤}, used as an instance of MaxMin.

      Instances For
        @[implicit_reducible]
        Equations
        @[implicit_reducible]
        instance instReprTVL :
        Equations
        Equations
        Instances For
          Equations
          Instances For
            @[implicit_reducible]
            instance instOrdTVL :
            Equations
            @[implicit_reducible]
            instance instLETVL :
            Equations
            @[implicit_reducible]
            Equations
            • One or more equations did not get rendered due to their size.
            @[implicit_reducible]
            Equations
            @[implicit_reducible]
            Equations
            instance MaxMin.instCharPZero {α : Type} [LinearOrder α] [OrderBot α] [OrderTop α] [Nontrivial α] :
            CharP (MaxMin α) 0

            MaxMin α has characteristic 0 in the CharP sense whenever α is nontrivial: this lifts the general MinMax instance to the dual order through MaxMin α = MinMax (OrderDual α). In particular it applies to MaxMin TVL since TVL is nontrivial.

            theorem TVL.no_hom_from_BoolFunc {Y : Type} [Inhabited Y] :
            (ν : YMaxMin TVL), ¬ (φ : BoolFunc Y →+* MaxMin TVL), ∀ (i : Y), φ (BoolFunc.var i) = ν i

            There is no semiring homomorphism from BoolFunc Y to MaxMin TVL sending the variables to arbitrary values. The semiring MaxMin TVL is absorptive and has both idempotent addition and idempotent multiplication, so the simple obstructions don't apply: the failure is more subtle.

            The argument uses only that a semiring homomorphism preserves + and * (monus is irrelevant here, even though one of the elements we exhibit happens to be written using BoolFunc's monus). In BoolFunc Y, the element c := 1 - var i satisfies two purely additive/multiplicative identities: var i + c = 1 and var i * c = 0. Applying any semiring homomorphism φ and writing y := φ c (an arbitrary element of the target), this forces φ (var i) + y = 1 and φ (var i) * y = 0. Setting φ (var i) = ⟨unknown⟩ in MaxMin TVL: the first equation reduces to max(unknown, y.val) = top, forcing y.val = top; the second reduces to min(unknown, y.val) = bot, forcing y.val = bot. The two are incompatible.

            The same obstruction extends to MinMax α whenever α has at least three distinct order values.