adjunctions and monads
play

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


  1. String Diagrams in Logic & Computer Science [ four ] Adjunctions and monads Paul-André Melliès IT University of Copenhagen April 2011

  2. Adjunctions 2

  3. 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 , B A −→ A RB One says that L is left adjoint to R , noted L ⊣ R . The 2-dimensional version of isomorphism 3

  4. � � � � The naturality of the bijection φ Natural in A and B means that the family of bijections φ A , B transforms every com- mutative diagram g � B LA Lh A h B � B ′ LA ′ f into a commutative diagram φ A , B ( g ) � RB A h A Rh B � RB ′ A ′ φ A ′ , B ′ ( f ) 4

  5. � � Example: the free vector space L Set ⊥ Vect R where : the category of sets and functions A = Set : the category of vector spaces on a field k B = Vect : the « forgetful » functor R V �→ U ( V ) : the « free vector space » functor L X �→ kX � � � λ x ∈ k null almost everywhere. kX λ x x : = | x ∈ X 5

  6. � � Illustration: the tensor algebra L Alg Vect ⊥ R where : the category of vector spaces A = Vect : the category of algebras and homomorphisms, B = Alg : the « forgetful » functor A �→ U ( A ) . R : the « free algebra » functor V �→ TV . L � V ⊗ n TV : = n ∈ N 6

  7. 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 ]] = 0 Example: the vector space of vector fields on a smooth manifold. 7

  8. � � Illustration: the enveloping algebra of a Lie algebra L Alg Lie ⊥ R where : the category of Lie algebras, A = Lie : the category of algebras, B = Alg : equips A with the canonical Lie bracket [ a , b ] = ab − ba , R : « enveloping algebra » functor g �→ U ( g ) . L U ( g ) : = T g / I ( g ) where I ( g ) is the ideal generated by ab − ba − [ a , b ] . 8

  9. � � Illustration: the free category L Graph ⊥ Cat R where : the category of graphs, A = Graph : the category of categories and functors, B = Cat : the « forgetful » functor R : the « free category » functor L 9

  10. � � Illustration : the terminal object L C ⊥ ✶ R where : any category equipped with a terminal object 1 , A = C : the singleton category, B = ✶ : the functor whose image is the terminal object 1 , R : the canonical (and unique) functor L 10

  11. � � � � � � � Adjunction in the 2-category Cat A bijection φ between the natural transformations A A [ A ] [ A ] φ A , B �−→ ✶ ✶ ⇓ L ⇓ R [ B ] [ B ] B B Here, a morphism X −→ Y in the category C is seen as a natural transformation [ X ] −→ [ Y ] . [ X ] � C ✶ ⇓ [ Y ] 11

  12. � � � � � � � Adjunction in the 2-category Cat A bijection φ between the natural transformations A A A A φ A , B �−→ ✶ ✶ ⇓ ⇓ L R B B B B Here, a morphism X −→ Y in the category C seen as a natural transformation [ X ] −→ [ Y ] . X � C ✶ ⇓ Y 12

  13. � � � � � � � � � � � � 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 ′ A ′ A A A A ⇓ α ⇓ α φ A ′ , B ′ �−→ ✶ ✶ ⇓ θ ✶ ✶ ⇓ ζ L R ⇓ β ⇓ β B B B B B ′ B ′ 13

  14. � � � � � � 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 A A A φ A , B �−→ C C ⇓ L ⇓ R B B B B 14

  15. � � � � � � � � � � � � 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 ′ A ′ A A A A ⇓ α ⇓ α φ A ′ , B ′ �−→ D C D C ⇓ θ ⇓ ζ L R ⇓ β ⇓ β B B B B B ′ B ′ 15

  16. � � � � � Algebraic presentation of the adjunction An adjonction is a quadruple ( L , R , η, ε ) where L and R are functors A −→ B B −→ A L : R : and η and ε are natural transformations: · · : Id A −→ RL : LR −→ Id B η ε such that the composite are the identities: (of L and R respectively). η R L η � RLR R ε � R � LRL ε F � L R L The situation is depicted as follows: Id A ⇓ η A B A B L R L ⇓ ε Id B 16

  17. � � � � � � 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 A A ψ A , B �−→ ⇓ θ C ⇓ ζ C L R B B B B natural in A and B . 17

  18. 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 ⊗ η id A � A ⊗ B ⊗ A ε ⊗ A � A � A = A A et η ⊗ B id B � B ⊗ A ⊗ B B ⊗ ε � B � B = B B A is left dual to B in C iff A is left adjoint to B in the suspension Σ C . 18

  19. The 2-dimensional presentation of adjunctions The unit and counit of the adjunction L ⊣ R are depicted as η : Id −→ R ◦ L ε : L ◦ R −→ Id R L η ε L R 19

  20. The 2-dimensional presentation of adjunctions L R ε ε L R L R = = η η L R An adjunction is a polychrome version of a dual pair 20

  21. Monads 21

  22. 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 η : Id A ⇒ s : A −→ A satisfying the associativity and unit laws. 22

  23. Every adjunction defines a monad (by a graphical argument) 23

  24. � � � � � 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 µ A TA T 2 A TA � � � � � � � � � � � η A � � h � � � � � � � � � h � Th � � � � � � � � � � � � � � � � � A � A � A TA id h A T -module is usually called a T -algebra in the literature 24

  25. � � Homomorphisms of T -modules A homomorphism of T -module f : ( A , h A ) −→ ( B , h B ) is a morphism f : A −→ B between the underlying objects making the diagram T f � TB TA h A h B � B A f commute. 25

  26. Free T -modules The free T -module generated by an object A is defined as ( TA : TTA −→ TA ) , µ A Given any T -module ( B , h B : TB −→ B ) there exists a bijection between the homomorphisms ( TA , µ A ) −→ ( B , h B ) and the morphisms TA B −→ in the underlying category. 26

  27. � � The Eilenberg-Moore adjunction This induces an adjunction L C T − Mod ⊥ R whose associated monad is precisely the monad T . : the « free » functor L A �→ ( TA , µ A ) : the « forgetful » functor R ( A , h A ) �→ A 27

  28. � � � � 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 −→ TA η A The composite of f : A � B and g : B � C is defined as TTC � � � � Tg � � � � � µ C � � � � � � � � � � � � � � � � � g ◦ K f : = TB TC � � � � � � � � � � f g � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � A B � 28

  29. � � � � � � � � � Exercise Show that composition is associative. Hint: consider the diagram T 3 D T 2 h � � � � � T µ � � � � � � � � � � T 2 C T 2 D Tg � � � � Th � � � � µ � µ � � � � � � � � � � � � � � � � � � � � � � TB TC TD f � � � g � � � � � � h � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � A B C D in the category C , and check that the two morphisms A −→ TD coincide. 29

  30. � � The Kleisli adjunction This induces an adjunction L C T − FreeMod ⊥ R whose associated monad is precisely the monad T . : the « free » functor L A �→ A : the « forgetful » functor R A �→ TA 30

Recommend


More recommend