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:
MaxMin α = MinMax (OrderDual α)– the dual semiring withmaxfor addition andminfor multiplicationTVL– three-valued logic{⊥, unknown, ⊤}, an instance ofMaxMin
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 #
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
Dependency graph
Equations
- instCoeMinMax = { coe := MinMax.val }
Dependency graph
Dependency graph
Dependency graph
Dependency graph
Equations
- One or more equations did not get rendered due to their size.
Dependency graph
Equations
- instZeroMinMax = { zero := ⊤ }
Dependency graph
Dependency graph
Equations
- instOneMinMax = { one := ⊥ }
Dependency graph
Dependency graph
Dependency graph
Equations
- One or more equations did not get rendered due to their size.
Dependency graph
MinMax α is a commutative m-semiring for any bounded linear order α.
Equations
- One or more equations did not get rendered due to their size.
Dependency graph
On MinMax α the identity is an admissible δ, so it is the one used
(ProvSQL's MinMax::delta); delta_absorb is the lattice law
a ⊔ (a ⊓ b) = a.
Dependency graph
Equations
- instCommSemiringWithMonusMinMax = { toSemiringWithMonus := instSemiringWithMonusMinMax, mul_comm := ⋯ }
Dependency graph
Dependency graph
Dependency graph
Dependency graph
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.
Dependency graph
Instances For
Dependency graph
Equations
- instCommSemiringMaxMin = { toSemiring := instSemiringWithMonusMinMax.toSemiring, mul_comm := ⋯ }
Dependency graph
Equations
- One or more equations did not get rendered due to their size.
Dependency graph
Equations
- instCommSemiringWithMonusMaxMin = { toSemiringWithMonus := instSemiringWithMonusMaxMin, mul_comm := ⋯ }
Dependency graph
Dependency graph
Three-valued logic {⊥, unknown, ⊤}, used as an instance of MaxMin.
Instances For
Dependency graph
Dependency graph
Equations
- instReprTVL = { reprPrec := instReprTVL.repr }
Dependency graph
Equations
- instReprTVL.repr TVL.bot prec✝ = Repr.addAppParen (Std.Format.nest (if prec✝ ≥ 1024 then 1 else 2) (Std.Format.text "TVL.bot")).group prec✝
- instReprTVL.repr TVL.unknown prec✝ = Repr.addAppParen (Std.Format.nest (if prec✝ ≥ 1024 then 1 else 2) (Std.Format.text "TVL.unknown")).group prec✝
- instReprTVL.repr TVL.top prec✝ = Repr.addAppParen (Std.Format.nest (if prec✝ ≥ 1024 then 1 else 2) (Std.Format.text "TVL.top")).group prec✝
Instances For
Dependency graph
Equations
- instOrdTVL = { compare := instOrdTVL.ord }
Dependency graph
Equations
- instOrdTVL.ord x✝ y✝ = compare x✝.ctorIdx y✝.ctorIdx
Instances For
Dependency graph
Dependency graph
Equations
- One or more equations did not get rendered due to their size.
Dependency graph
Equations
- instOrderBotTVL = { bot := TVL.bot, bot_le := instOrderBotTVL._proof_1 }
Dependency graph
Equations
- instOrderTopTVL = { top := TVL.top, le_top := instOrderTopTVL._proof_1 }
Dependency graph
Equations
Dependency graph
Equations
Dependency graph
Dependency graph
Dependency graph
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.
Dependency graph
Dependency graph
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.