|
| 1 | +/- |
| 2 | +Copyright (c) 2024 Nicolas Rolland. All rights reserved. |
| 3 | +Released under Apache 2.0 license as described in the file LICENSE. |
| 4 | +Authors: Nicolas Rolland |
| 5 | +-/ |
| 6 | +import Mathlib.CategoryTheory.Category.Cat |
| 7 | +import Mathlib.CategoryTheory.Adjunction.Basic |
| 8 | +/-! |
| 9 | +# Adjunctions related to Cat, the category of categories |
| 10 | +
|
| 11 | +The embedding `typeToCat: Type ⥤ Cat`, mapping a type to the corresponding discrete category, is |
| 12 | +left adjoint to the functor `Cat.objects`, which maps a category to its set of objects. |
| 13 | +
|
| 14 | +
|
| 15 | +
|
| 16 | +## Notes |
| 17 | +All this could be made with 2-functors |
| 18 | +
|
| 19 | +## TODO |
| 20 | +
|
| 21 | +Define the left adjoint `Cat.connectedComponents`, which map |
| 22 | +a category to its set of connected components. |
| 23 | +
|
| 24 | +-/ |
| 25 | + |
| 26 | +universe u |
| 27 | +namespace CategoryTheory.Cat |
| 28 | + |
| 29 | +variable (X : Type u) (C : Cat) |
| 30 | + |
| 31 | +private def typeToCatObjectsAdjHomEquiv : (typeToCat.obj X ⟶ C) ≃ (X ⟶ Cat.objects.obj C) where |
| 32 | + toFun f x := f.obj ⟨x⟩ |
| 33 | + invFun := Discrete.functor |
| 34 | + left_inv F := Functor.ext (fun _ ↦ rfl) (fun ⟨_⟩ ⟨_⟩ f => by |
| 35 | + obtain rfl := Discrete.eq_of_hom f |
| 36 | + simp) |
| 37 | + right_inv _ := rfl |
| 38 | + |
| 39 | +private def typeToCatObjectsAdjCounitApp : (Cat.objects ⋙ typeToCat).obj C ⥤ C where |
| 40 | + obj := Discrete.as |
| 41 | + map := eqToHom ∘ Discrete.eq_of_hom |
| 42 | + |
| 43 | +/-- `typeToCat : Type ⥤ Cat` is left adjoint to `Cat.objects : Cat ⥤ Type` -/ |
| 44 | +def typeToCatObjectsAdj : typeToCat ⊣ Cat.objects where |
| 45 | + homEquiv := typeToCatObjectsAdjHomEquiv |
| 46 | + unit := { app:= fun _ ↦ Discrete.mk } |
| 47 | + counit := { |
| 48 | + app := typeToCatObjectsAdjCounitApp |
| 49 | + naturality := fun _ _ _ ↦ Functor.hext (fun _ ↦ rfl) |
| 50 | + (by intro ⟨_⟩ ⟨_⟩ f |
| 51 | + obtain rfl := Discrete.eq_of_hom f |
| 52 | + aesop_cat ) } |
| 53 | + |
| 54 | +end CategoryTheory.Cat |
0 commit comments