Skip to content

Commit cea57e0

Browse files
committed
feat(CategoryTheory/Adjunction): typeToCat is left adjoint to Cat.objects (#15375)
The embedding of `Type` into `Cat`, which views a set as a discrete category, is left adjoint to the functor `Cat.objects : Cat -> Set` mapping a category to its set of objects
1 parent b1409cd commit cea57e0

File tree

2 files changed

+55
-0
lines changed

2 files changed

+55
-0
lines changed

Mathlib.lean

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1375,6 +1375,7 @@ import Mathlib.CategoryTheory.CatCommSq
13751375
import Mathlib.CategoryTheory.Category.Basic
13761376
import Mathlib.CategoryTheory.Category.Bipointed
13771377
import Mathlib.CategoryTheory.Category.Cat
1378+
import Mathlib.CategoryTheory.Category.Cat.Adjunction
13781379
import Mathlib.CategoryTheory.Category.Cat.Limit
13791380
import Mathlib.CategoryTheory.Category.Factorisation
13801381
import Mathlib.CategoryTheory.Category.GaloisConnection
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
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

Comments
 (0)