definition example theorem proof
A unital commutative quantale is a symmetric monoidal closed preorder that has all joins: exists for every . The empty join is denoted (the bottom element). In 7 Sketches “quantale” always means unital commutative quantale. The word is a portmanteau of quantum locale.
Sources: 7 Sketches §2.5.2, Definition 2.90, Example 2.91, Remark 2.95, 2.97, Propositions 2.96, 2.98, Exercises 2.92–2.94; §2.6; [Ros90].
Examples
| quantale | |||||
|---|---|---|---|---|---|
| OR | |||||
| Cost | (usual order) | — “beware!” | |||
| (with added) | (for ) | ||||
| for a monoid ; binary relations on a set under composition | pointwise product / relational composition | / identity relation | two residuals — noncommutative (§2.6) |
In every has a join, its infimum in the usual order: , , (Example 2.91, 7S Exercise 2.92).
Theory
Proposition 2.96. A Preorder has all joins iff it has all meets. Proof. By duality it suffices to show joins give meets. For let and . Then for all (each is , so is their join), and any lower bound of lies in , hence . So a quantale has all meets too.
Proposition 2.98. A symmetric monoidal preorder with all joins is closed (hence a quantale) iff distributes over joins, ; then (Adjoint Functor Theorem for Preorders).
Remark 2.95 (the navigator). A quantale personifies a navigator: given routes and they compose a route (the monoidal product), and they search over way-points (the join). This is exactly what Matrix Multiplication in a Quantale does: , which computes the -category presented by a Weighted Graph. Generalized Hausdorff Distance also needs a quantale.
Noncommutative quantales (relations under composition, power sets of monoids) have applications to concurrency, process semantics and automata [AV93].
Docs: Vignette: monoidal preorders & SMCs
# a finite quantale given by elements, leq, otimes, munit; joins computed from leq
struct FiniteQuantale{T}
elems::Vector{T}; leq::Function; otimes::Function; munit::T
end
join(Q::FiniteQuantale, A) = first(p for p in Q.elems if all(Q.leq(a, p) for a in A) && all(Q.leq(p, q) for q in Q.elems if all(Q.leq(a, q) for a in A)))
hom(Q::FiniteQuantale, v, w) = join(Q, [a for a in Q.elems if Q.leq(Q.otimes(a, v), w)])
is_quantale(Q) = all(Q.leq(Q.otimes(a, v), w) == Q.leq(a, hom(Q, v, w)) for a in Q.elems, v in Q.elems, w in Q.elems)
Bool_ = FiniteQuantale([false, true], (a,b) -> a <= b, (a,b) -> a && b, true)
is_quantale(Bool_) # true-- Mathlib: `IsQuantale` (Mathlib/Algebra/Order/Quantale.lean): a complete lattice with a
-- semigroup structure distributing over sSup; unital commutative version with CommMonoid
#check IsQuantale
#check IsQuantale.leftResiduation -- the hom-element x ⇨ₗ y
-- ENNReal (= Cost^op with the usual order) is a complete linear order whose + distributes over ⨆:
#check @ENNReal.add_iSupclass Closed v => Quantale v where
joinAll :: [v] -> v -- must exist for every (finite, here) list; joinAll [] = bottom
instance Quantale All where joinAll = foldr (\(All a) (All b) -> All (a || b)) (All False)
instance Quantale Cost where
joinAll [] = Inf
joinAll xs = foldr1 minC xs
where minC (Fin a) (Fin b) = Fin (min a b); minC Inf b = b; minC a Inf = a