definition theorem proof example

Given an Adjunction with hom-set isomorphism :

  • setting and applying to (the Yoneda trick) gives the unit , a Natural Transformation ;
  • setting and applying to gives the counit , a natural transformation .

They satisfy the triangle identities (zig-zag identities), using horizontal composition/whiskering:

i.e. and are identities. Conversely, natural transformations satisfying the triangle identities determine the adjunction: has mate , and has mate (DaoFP Exercise 10.5.2). ” can be used to insert anywhere an identity would work; to eliminate .”

Sources: DaoFP §10.5 (“Unit and Counit of an Adjunction”, “Triangle identities”, “The unit and counit of the currying adjunction”), Exercises 10.5.1–10.5.4; 7 Sketches Proposition 1.107 (preorder version: and ), Exercise 1.119; Kittenlab Lecture 7 (, ).

Examples

adjunctionunitcounit
the pair of injections (DaoFP Exercise 10.5.1)
the pair of projections
, unit = curry id (the curried pair constructor), counit = uncurry id — function application
free forgetful monoid, singleton list: evaluate a list of monoid elements (DaoFP Exercise 10.9.1)
Galois Connection
the colimit cocone / the map into the limit of a constant diagramthe universal cocone map / the limit cone

In string diagrams (DaoFP §15.1) the unit is a cup and the counit a cap, and the triangle identities say a zig-zag string straightens out. The unit and counit are the universal arrows of the adjunction (DaoFP §10.6). The composite with and is a Monad; with and a Comonad. In a preorder, is a Closure Operator.

#check CategoryTheory.Adjunction.unit          -- 𝟭 C ⟶ F ⋙ G
#check CategoryTheory.Adjunction.counit        -- G ⋙ F ⟶ 𝟭 D
#check CategoryTheory.Adjunction.left_triangle_components
#check CategoryTheory.Adjunction.right_triangle_components
#check CategoryTheory.Adjunction.mkOfUnitCounit
-- DaoFP §10.5: unit and counit of currying
unit :: e -> (a -> (e, a))
unit = curry id
 
counit :: (a -> b, a) -> b
counit = uncurry id          -- function application
 
-- triangle identity tests (DaoFP Exercise 10.5.3/10.5.4)
-- triangle (L (2, 'a')) == L (2, 'a');   let R f = triangle' (R (+1)) in f 3 == 4