Adjunctions and monads Paul-Andr Mellis IT University of Copenhagen - - PowerPoint PPT Presentation
Adjunctions and monads Paul-Andr Mellis IT University of Copenhagen - - PowerPoint PPT Presentation
String Diagrams in Logic & Computer Science [ four ] Adjunctions and monads Paul-Andr Mellis IT University of Copenhagen April 2011 Adjunctions 2 Adjonction An adjunction is a triple ( L , R , ) where L and R are two functors L
Adjunctions
2
Adjonction
An adjunction is a triple (L, R, φ) where L and R are two functors L : A −→ B R : B −→ A and φ is a family of bijections, for every pair of objects A in A and B in B, φA,B : B(LA, B) A(A, RB) natural in A et B. One also writes LA −→B B A −→A RB φA,B One says that L is left adjoint to R, noted L ⊣ R. The 2-dimensional version of isomorphism
3
The naturality of the bijection φ
Natural in A and B means that the family of bijections φA,B transforms every com- mutative diagram LA
g
B
hB
- LA′
LhA
- f
B′
into a commutative diagram A
φA,B(g)
RB
RhB
- A′
hA
- φA′,B′( f)
RB′
4
Example: the free vector space
Set
L
- ⊥
Vect
R
- where
A = Set
: the category of sets and functions
B = Vect
: the category of vector spaces on a field k R : the « forgetful » functor V → U(V) L : the « free vector space » functor X → kX kX :=
- x∈X
λx x | λx ∈ k null almost everywhere.
- 5
Illustration: the tensor algebra
Vect
L
- ⊥
Alg
R
- where
A = Vect
: the category of vector spaces
B = Alg
: the category of algebras and homomorphisms, R : the « forgetful » functor A → U(A). L : the « free algebra » functor V → TV. TV :=
- n∈N
V⊗n
6
Definition of a Lie algebra
Vector space g equipped with a Lie bracket Anti-symmetry: [x, y] = −[y, x] Jacobi identity: [x, [y, z]] + [y, [z, x]] + [z, [x, y]] = Example: the vector space of vector fields on a smooth manifold.
7
Illustration: the enveloping algebra of a Lie algebra
Lie
L
- ⊥
Alg
R
- where
A = Lie
: the category of Lie algebras,
B = Alg
: the category of algebras, R : equips A with the canonical Lie bracket [a, b] = ab − ba, L : « enveloping algebra » functor g → U(g). U(g) := Tg / I(g) where I(g) is the ideal generated by ab − ba − [a, b].
8
Illustration: the free category
Graph
L
- ⊥
Cat
R
- where
A = Graph
: the category of graphs,
B = Cat
: the category of categories and functors, R : the « forgetful » functor L : the « free category » functor
9
Illustration : the terminal object
C
L
- ⊥
✶
R
- where
A = C
: any category equipped with a terminal object 1,
B = ✶
: the singleton category, R : the functor whose image is the terminal object 1, L : the canonical (and unique) functor
10
Adjunction in the 2-category Cat
A bijection φ between the natural transformations
A
L
- ✶
[A]
- [B]
- ⇓
B
φA,B
−→
A ✶
[A]
- [B]
- ⇓
B
R
- Here, a morphism X −→ Y in the category C
is seen as a natural transformation [X] −→ [Y].
✶
[Y]
- ⇓
[X]
C
11
Adjunction in the 2-category Cat
A bijection φ between the natural transformations
A
L
- ✶
A
- B
- ⇓
B
φA,B
−→
A ✶
A
- B
- ⇓
B
R
- Here, a morphism X −→ Y in the category C
seen as a natural transformation [X] −→ [Y].
✶
Y
- ⇓
X
C
12
A 2-dimensional naturality condition
One reformulates the naturality condition in that way: The bijection φ is natural with respect to the natural transformations α and β.
A
L
- ✶
A′
- B′
- ⇓α
⇓β
✶
A
- B
- ⇓θ
B
φA′,B′
−→
A ✶
A′
- B′
- ⇓α
⇓β
✶
A
- B
- ⇓ζ
B
R
- 13
Adjunction in the 2-category Cat
This point of view leads to a more satisfactory definition of adjunction: A bijection φ between the natural transformations
A
L
- C
A
- B
- ⇓
B
φA,B
−→
A C
A
- B
- ⇓
B
R
- 14
Adjunction in the 2-category Cat
One reformulates the naturality condition as follows: The bijection φ is natural with respect to the natural transformations α et β.
A
L
- D
A′
- B′
- ⇓α
⇓β
C
A
- B
- ⇓θ
B
φA′,B′
−→
A D
A′
- B′
- ⇓α
⇓β
C
A
- B
- ⇓ζ
B
R
- 15
Algebraic presentation of the adjunction
An adjonction is a quadruple (L, R, η, ε) where L and R are functors L :
A −→ B
R :
B −→ A
and η and ε are natural transformations: η : IdA
·
−→ RL ε : LR
·
−→ IdB such that the composite are the identities: (of L and R respectively). R
ηR
RLR
Rε
R
L
Lη
LRL
εF
L
The situation is depicted as follows:
A
L
- IdA
- B
R
- IdB
- ⇓η
A
L
- ⇓ε
B
16
Dual definition (but equivalent) of adjunction
By duality, an adjunction is given by a family of bijections ψ between the sets of 2-cells
A
A
- L
- C
⇓θ
B
B
- ψA,B
−→
A
A
- C
⇓ζ
B
B
- R
- natural in A and B.
17
Illustration: duality in a monoidal category
Let (C, ⊗, e) denote a monoidal category. An object A is left dual to an object B when there exists two morphisms η : e −→ B ⊗ A ε : A ⊗ B −→ e such that A
A⊗η
A ⊗ B ⊗ A
ε⊗A
A
= A
idA
A
et B
η⊗B
B ⊗ A ⊗ B
B⊗ε
B
= B
idB
B
A is left dual to B in C iff A is left adjoint to B in the suspension Σ C.
18
The 2-dimensional presentation of adjunctions
The unit and counit of the adjunction L ⊣ R are depicted as η : Id −→ R ◦ L L R η ε : L ◦ R −→ Id R L ε
19
The 2-dimensional presentation of adjunctions
ε η L L
=
L L
η ε R R
=
R R
An adjunction is a polychrome version of a dual pair
20
Monads
21
Monads
A monad s on a 0-cell A is a 1-cell s : A −→ A equipped with a multiplication µ : s ◦ s ⇒ s : A −→ A and a unit η : IdA ⇒ s : A −→ A satisfying the associativity and unit laws.
22
Every adjunction defines a monad
(by a graphical argument)
23
T-modules
A T-module of the monad (T, µ, η) is a pair ( A , h ) consisting of an object A and a morphism h : TA −→ A making the two diagrams below commute TA
h
- A
ηA
- id
A
T2A
µA
- Th
- TA
h
- TA
h
A
A T-module is usually called a T-algebra in the literature
24
Homomorphisms of T-modules
A homomorphism of T-module f : (A, hA) −→ (B, hB) is a morphism f : A −→ B between the underlying objects making the diagram TA
hA
- T f
TB
hB
- A
f
B
commute.
25
Free T-modules
The free T-module generated by an object A is defined as ( TA , µA : TTA −→ TA ) Given any T-module ( B , hB : TB −→ B ) there exists a bijection between the homomorphisms ( TA , µA ) −→ ( B , hB ) and the morphisms TA −→ B in the underlying category.
26
The Eilenberg-Moore adjunction
This induces an adjunction
C
L
- ⊥
R
- T−Mod
whose associated monad is precisely the monad T. L : the « free » functor A → (TA, µA) R : the « forgetful » functor (A, hA) → A
27
The category of free T-modules
The Kleisli category T−FreeMod associated to a monad (T, µ, η) – its objects are the objects the underlying category C – its morphisms A B the morphisms A −→ TB in the category C The identity morphism A A is defined as ηA : A −→ TA The composite of f : A B and g : B C is defined as g ◦K f := TTC
µC
- TB
Tg
- TC
A
f
- B
g
- 28
Exercise
Show that composition is associative. Hint: consider the diagram T3D
Tµ
- T2C
T2h
- µ
- T2D
µ
- TB
Tg
- TC
Th
- TD
A
f
- B
g
- C
h
- D
in the category C, and check that the two morphisms A −→ TD coincide.
29
The Kleisli adjunction
This induces an adjunction
C
L
- ⊥
R
- T−FreeMod
whose associated monad is precisely the monad T. L : the « free » functor A → A R : the « forgetful » functor A → TA
30
Representation principle
Every monad (in the 2-categorical sense) t : A −→ A induces a monad (in the categorical sense) B(X, t) : B(X, A) −→ B(X, A) defined by post-composition X
f
A
→ X
f
A t A
for every 0-cell X of the underlying 2-category B.
31
Eilenberg-Moore object
When the 2-dimensional functor X → B(X, t)−Mod : B op(1) −→ Cat is 2-representable by an object At of the 2-category B. In other words, there exists an isomorphism of categories φX,A : B(X, t)−Mod
- B ( X , At )
which is 2-natural in the object X.
32
What 2-naturality means here
For every 1-cell X
f
- Y
the diagram B(Y , t)−Mod
φY
,A
- B(f,t)−Mod
- B(Y
, At)
B(f,At)
- B(X, t)−Mod
φX,A
B(X, At)
commutes.
33
What 2-naturality means here
For every 2-cell X
f
- g
- ⇓θ
Y the natural transformations coincide: B(Y , t)−Mod
φY
,A
- B( f,t)−Mod
- B(g,t)−Mod
- ⇒
B(Y , At)
B(g,At)
- B(X, t)−Mod
φX,A
B(X, At)
B(Y , t)−Mod
φY
,A
- B(f,t)−Mod
- B(Y
, At)
B( f,At)
- ⇒
B(g,At)
- B(X, t)−Mod
φX,A
B(X, At)
34
Strong monads
35
Tensorial strength
A left strength tA,B : A ⊗ TB −→ T(A ⊗ B)
- n a monad T on a monoidal category
( C , ⊗ , 1 ) is a natural family making the diagrams below commute.
36
Tensorial strength
A ⊗ B ⊗ TC
A⊗tB,C
- tA⊗B,C
T(A ⊗ B ⊗ C)
A ⊗ T(B ⊗ C)
tA,B⊗C
- 1 ⊗ TA
t
- λ
TA
T(1 ⊗ A)
Tλ
- 37
Tensorial strength
A ⊗ TTB
t
- A⊗µ
- T(A ⊗ TB)
Tt
TT(A ⊗ B)
µ
- A ⊗ TB
t
T(A ⊗ B)
A ⊗ B
id
- A⊗η
- A ⊗ B
η
- A ⊗ TB
t
T(A ⊗ B)
38
Three illustrations
The continuation monad in any dialogue category T : A → ¬ ¬ A = (A ⊸ ⊥) ⊸ ⊥ The state monad in the category Set T : A → S ⇒ ( S × A ) The exception monad in the category Set T : A → A + E The general theory of computational monads
39
Interpretation of a pair of computations
One chooses an order of evaluation for the pair: P, Q The order is typically left-to-right, interpreted by the morphism TA × TB −→ T(A × TB) −→ TT(A × B)
µ
−→ T(A × B).
40
Strong monads
The enriched approach
41
Enriched categories
An E-category C is given by — a class of objects, — an E-space C (A, B) for every pair of objects (A, B) — a composition morphism
- :
C (B, C) ⊗ C (A, B)
−→
C (A, C)
— an identity morphism idA : I −→
C (A, A)
for all objects A, B, C. By convention, we call E-spaces the objects of the monoidal category (E, ⊗, I).
42
Enriched categories
We require moreover that: 1— the composition law ◦ is associative. This means that the diagram
C (C, D) ⊗ C (B, C) ⊗ C (A, B)
- ⊗ C (A,B)
- C (C,D) ⊗◦
- C (B, D) ⊗ C (A, B)
- C (C, D) ⊗ C (A, C)
- ❉ (A, D)
commutes for all objects A, B, C, D.
43
Enriched categories
2— that the morphism id is neutral for composition. This means that the two diagrams
C (A, B)
- C (A, B)
C (A, B) ⊗ I
C (A,B) ⊗idA
C (A, B) × C (A, A)
- C (A, B)
- C (A, B)
I ⊗ C (A, B)
idB ⊗C (A,B)
C (B, B) × C (A, B)
- commute for all objects A, B.
44
Enriched functors
An E-functor F :
C
−→
D
between E-categories is defined as – a function from the objects of C to the objects of D, – a morphism FA,B :
C(A, B)
−→
D(FA, FB)
for every pair of objects A, B in the E-category C,
45
Enriched functors
...making the diagrams below commute:
C(B, C) ⊗ C(A, B)
FB,C ⊗ FA,B
- D(FB, FC) ⊗ D(FA, FB)
- C(A, C)
FA,C
D(FA, FC)
I
idA
- idFA
- C(A, A)
FA,A
D(FA, FA)
46
Enriched natural transformations
An E-natural transformation
C
F
- G
D
⇓ θ
between E-functors is given a family of morphisms FA −→ GA making the diagram
C(A, B)
FA,B
- GA,B
- D(FA, FB)
D(FA,θB)
- D(GA, GB)
D(θA,GB)
D(FA, GB)
commutes for all objects A, B.
47
The 2-category of enriched categories
The 2-category E − Cat has –
E-categories as objects
–
E-functors as morphisms
–
E-natural transformations as 2-dimensional cells.
The set of 2-cells generally defines an E-space.
48
Strong monads as enriched monads
Suppose that the category E is symmetric monoidal closed. A well-known correspondence tells that: a strong monad T in the category E ⇐⇒ a monad on the object E in the 2-category E−Cat
49
Tensored E-categories
A E-enriched category C is E-tensored when the functor B →
C(A, B)
:
C
−→
E
admits a left adjoint (in the enriched sense) X → X • A :
E
−→
C
for every object A of the E-enriched category C. This means that
E(X, C(A, B))
- C(X • A, B)
50
Tensored E-categories
Moreover, the tensor structure is equipped with
- 1. an isomorphism
I • A
- A
which is E-natural in A.
- 2. an isomorphism
(X ⊗ Y) • A
- X • (Y • A)
which is E-natural in X, Y and E. Here, we need to suppose that E is symmetric closed.
51
Tensorial strength
A left strength on a functor F :
C
−→ D between tensored E-categories is a family of morphisms tX,A : X • FA −→ F(X • A) natural in A...
52
Tensorial strength
...making the two diagrams commute: (X ⊗ Y) • FA
X•tY
,A
- tX⊗Y
,A
F((X ⊗ Y) • A)
X • F(Y • A)
tX,Y•A
- I • FA
t
- λ
FA
F(I • A)
Tλ
- 53
Strong natural transformation
A strong natural transformation
C
( F , σ )
- ( G , τ )
D
⇓ θ
is a family of morphisms θA : F A −→ G A natural in A...
54
Strong natural transformations
...making the diagram X • F(A)
σX,A
- X• θA
- F(X • A)
θX•A
- X • G(A)
τX,A
G(X • A)
commute for all objects A.
55
A correspondence between strengths and enrichments
The 2-category with –
E-tensored E-categories as objects
– strong functors as morphisms – strong natural transformations as 2-dimensional cells is isomorphic to E−Cat restricted to its E-tensored E-categories. See Kruna Segrt’s PhD manuscript for a proof
56
Strong monads
The lax bimodule approach
57
Lax T-module
Suppose given a 2-dimensional monad T in a 2-category B. A lax T-module is defined as a pair ( A , h ) consisting of an object A and a morphism h : TA −→ A together with a pair of 2-dimensional cells A
ηA
- id
A
⇓ TA
h
- TA
h
- T2A
Th
- µA
- ⇓
A TA
h
- 58
Lax T-module
These 2-dimensional cells are required to make the diagrams below commute:
Th µ Tµ TA TA T 2A T 2A A T 3A h Th T 2h h µ Tµ
=
TA TA Th µ h T 2A T 2A A T 3A h Th T 2h h µ Tµ
59
Lax T-module
Th µ η TA TA TA TA A TA h id id h id id
=
TA TA h h id
TA A Th η h A T 2A A TA id id h h µ η
=
T 2A µ h A TA id η
60
A general phenomenon of adjunctions
Given a 2-monad T and an adjunction
A
L
- ⊥
B
R
- every lax T-module
TB
b
−→ B induces a lax T-module TA TL −→ TB
b
−→ B
R
−→ A
61
A general phenomenon of adjunctions
In particular, every adjunction with a monoidal category B
A
L
- ⊥
B
R
- induces a lax action of B on the category A
B × A
B×L
−→
B × B
⊗B
−→
B
R
−→
A
62
The monadic strength as a lax bimodule
The strength A ⊗ TB
σ
−→ T(A ⊗ B) may be seen as a lax notion of bimodule: A ⊲ ( B ⊳ ∗) −→ A ⊲ (B ⊳ ∗) where B ⊳ ∗ := TB.
63
Short bibliography of the course
On adjunctions in 2-categories:
Ross Street The formal theory of monads Journal of Pure and Applied Algebra 2 (1972) 149-168. Categorical semantics of linear logic. Survey published in « Interactive models of computation and program behaviour ». Pierre-Louis Curien, Hugo Herbelin, Jean-Louis Krivine, Paul-André Melliès. Panoramas et Synthèses 27, Société Mathématique de France, 2009.
On enriched categories:
Max Kelly Basic Concepts of Enriched Category Theory Lecture Notes in Mathematics 64, Cambridge University Press, 1982. Available online as a « Theory and Applications of Categories » reprint.
64