Let be a Symmetric Monoidal Preorder. A -category consists of
(i) a set of objects; (ii) for every two objects , an element , the hom-object (“hom” is short for homomorphism, an important jargon word; “mapping object” would be more descriptive),
such that
(a) for every object (identity), and (b) for all (composition).
is the base of enrichment; is enriched in . A -category with a finite set of objects can be displayed as a square matrix of hom-objects. The definition makes sense without symmetry, but symmetry is needed e.g. for products.
Sources: 7 Sketches §2.3 (Definition 2.46, Examples 2.47, 2.54, Theorem 2.49, Definition 2.53), §2.4, §4.4.4 (Definition 4.44: enrichment in a symmetric monoidal category), Remark 2.89; DaoFP Chapter 20; Kittenlab (implicitly: -categories).
Examples
| base | -category | hom-object |
|---|---|---|
| Preorder (Preorders are Bool-Categories) | is ? | |
| Cost | Lawvere Metric Space | distance |
| points with a no/maybe/yes answer to “can I get from to ?“ | 7S Exercise 2.61 | |
| modes of transport that get you from to | 7S Exercise 2.62 | |
| weight limits on routes | 7S Exercise 2.63 | |
| ordinary (locally small) Category | the hom-set | |
| a (strict) 2-Category | the hom-category (DaoFP §20.1) | |
| any closed | itself (self-enrichment, Remark 2.89) |
Example 2.47. The preorder (with incomparable) as a -category has matrix with iff : e.g. , .
Enrichment in a monoidal category (DaoFP Ch. 20, 7 Sketches §4.4.4)
Replace the preorder by a Symmetric Monoidal Category . A -category has hom-objects , composition morphisms and identity morphisms in , making the associativity pentagon (using ) and unit triangles (using , ) commute — all diagrams in , “so we still fall back on set theory, but at a different level”. Ordinary categories are enriched in , with composition “defined in bulk” as a function between hom-sets and identity as . The two inequalities (a), (b) above are exactly this data when is thin.
DaoFP’s motivations: category theory “reluctantly draws upon set theory” through hom-sets; enrichment replaces structureless hom-sets by objects whose richness lives in the morphisms of (“having fewer morphisms often means having more structure”). “Enrichment doesn’t always mean adding more stuff” — enriching in the walking arrow impoverishes to preorders. Every -category has an underlying ordinary category whose hom-sets are the global elements (DaoFP Exercise 20.1.2). Any monoidal closed category is self-enriched via internal homs , with composition built from the evaluation counit and identity from ; this is why a Haskell Functor (whose fmap :: (a -> b) -> (f a -> f b) acts on internal homs) is really an Enriched Functor, and why every Haskell functor is strong.
Constructions
Change of Base along a Monoidal Monotone Map / monoidal functor; -functors; -natural transformations; the opposite , dagger and skeletal -categories (7S Exercise 2.73); products ; -profunctors (Chapter 4); presentation by -weighted graphs computed by Matrix Multiplication in a Quantale when is a Quantale; generalized Hausdorff Distance; and in DaoFP, enriched Yoneda Lemma, weighted limits, enriched ends and Kan extensions. The authoritative reference is Kelly [Kel05].
Docs: Vignette: monoidal preorders & SMCs
Builds on: Bool (Monoidal Preorder) (BoolPre), Preorder (Preorder) — run those notes’ Julia code first.
# a V-category with finitely many objects as a matrix of hom-objects over a monoidal preorder V
struct VCategory{T, V<:Preorder{T}}
base::V
objects::Vector{Symbol}
hom::Matrix{T} # hom[i, j] = X(objects[i], objects[j])
end
function is_vcategory(X::VCategory)
V, n = X.base, length(X.objects)
ident = all(leq(V, munit(V), X.hom[i, i]) for i in 1:n)
comp = all(leq(V, otimes(V, X.hom[i, j], X.hom[j, k]), X.hom[i, k]) for i in 1:n, j in 1:n, k in 1:n)
ident && comp
end
# Example 2.47 as a Bool-category
X = VCategory(BoolPre(), [:p, :q, :r, :s, :t], Bool[
1 1 1 1 1;
0 1 0 1 1;
0 0 1 1 1;
0 0 0 1 1;
0 0 0 0 1])
is_vcategory(X) # true-- Mathlib: categories enriched in a monoidal category V
#check CategoryTheory.EnrichedCategory
-- class EnrichedCategory (V) [MonoidalCategory V] (C : Type) where
-- Hom : C → C → V
-- id (X) : 𝟙_ V ⟶ Hom X X
-- comp (X Y Z) : Hom X Y ⊗ Hom Y Z ⟶ Hom X Z
-- + assoc, id_comp, comp_id
#check CategoryTheory.EnrichedCategory.Hom
-- self-enrichment of a monoidal closed category:
#check CategoryTheory.MonoidalClosed-- a V-category on a finite object set, V a monoidal preorder, given by a hom table
data VCat v o = VCat { objects :: [o], hom :: o -> o -> v }
isVCat :: (MonoidalPreorder v, Eq o) => VCat v o -> Bool
isVCat (VCat os h) =
and [ leq mempty (h x x) | x <- os ] &&
and [ leq (h x y <> h y z) (h x z) | x <- os, y <- os, z <- os ]
-- Haskell's own categories are enriched in Hask: the internal hom is (->)
class EnrichedFunctorHask f where
fmapE :: (a -> b) -> (f a -> f b) -- acts on hom-*objects*, i.e. this is Functor