Lean4
/-- The Grothendieck construction applied to a functor to `Type`
(thought of as a functor to `Cat` by realising a type as a discrete category)
is the same as the 'category of elements' construction.
-/
@[simps!]
def grothendieckTypeToCat : Grothendieck (G ⋙ typeToCat) ≌ G.Elements
where
functor := grothendieckTypeToCatFunctor G
inverse := grothendieckTypeToCatInverse G
unitIso :=
NatIso.ofComponents
(fun X => by
rcases X with ⟨_, ⟨⟩⟩
exact Iso.refl _)
(by
rintro ⟨_, ⟨⟩⟩ ⟨_, ⟨⟩⟩ ⟨base, ⟨⟨f⟩⟩⟩
dsimp at *
simp
rfl)
counitIso :=
NatIso.ofComponents
(fun X => by
cases X
exact Iso.refl _)
(by
rintro ⟨⟩ ⟨⟩ ⟨f, e⟩
dsimp at *
simp
rfl)
functor_unitIso_comp := by
rintro ⟨_, ⟨⟩⟩
simp
rfl