diff --git a/Mathlib/CategoryTheory/Core.lean b/Mathlib/CategoryTheory/Core.lean index e8f24370c47faf..aecbf5341d661b 100644 --- a/Mathlib/CategoryTheory/Core.lean +++ b/Mathlib/CategoryTheory/Core.lean @@ -112,6 +112,30 @@ def coreId : (šŸ­ C).core ≅ šŸ­ (Core C) := Iso.refl _ def coreComp {E : Type uā‚ƒ} [Category.{vā‚ƒ} E] (F : C ℤ D) (G : D ℤ E) : (F ā‹™ G).core ≅ F.core ā‹™ G.core := Iso.refl _ +/-- The natural isomorphism +``` + F.core + Core C ℤ Core D + includion C ‖ ‖ inclusion D + V V + C ℤ D + F +``` +thought of as pseudonaturality of `inclusion`, +when viewing `Core` as a pseudofunctor. +`Core` is in fact a strict 2-functor, +and this isomorphism is an equality of functors under the hood, +and thus can be promoted to a naturality condition between 1-functors. +-/ +@[simps!] +def coreCompInclusionIso (F : C ℤ D) : + F.core ā‹™ Core.inclusion D ≅ Core.inclusion C ā‹™ F := + Iso.refl _ + +lemma core_comp_inclusion (F : C ℤ D) : + F.core ā‹™ Core.inclusion D = Core.inclusion C ā‹™ F := + Functor.ext_of_iso (coreCompInclusionIso F) (by cat_disch) + end Functor namespace Iso @@ -160,6 +184,44 @@ lemma coreAssociator {E : Type uā‚ƒ} [Category.{vā‚ƒ} E] {E' : Type uā‚„} [Categ end Iso +namespace Core + +variable {G : Type uā‚‚} [Groupoid.{vā‚‚} G] + +/-- The functor `functorToCore (F ā‹™ H)` factors through `functortoCore H`. -/ +def functorToCoreCompLeftIso {G' : Type uā‚ƒ} [Groupoid.{vā‚ƒ} G'] (H : G ℤ C) (F : G' ℤ G) : + functorToCore (F ā‹™ H) ≅ F ā‹™ functorToCore H := + NatIso.ofComponents (fun _ ↦ Iso.refl _) + +lemma functorToCore_comp_left {G' : Type uā‚ƒ} [Groupoid.{vā‚ƒ} G'] (H : G ℤ C) (F : G' ℤ G) : + functorToCore (F ā‹™ H) = F ā‹™ functorToCore H := + Functor.ext_of_iso (functorToCoreCompLeftIso H F) (by cat_disch) + +/-- The functor `functorToCore (H ā‹™ F)` factors through `functorToCore H`. -/ +def functorToCoreCompRightIso {C' : Type uā‚„} [Category.{vā‚„} C'] (H : G ℤ C) (F : C ℤ C') : + functorToCore (H ā‹™ F) ≅ functorToCore H ā‹™ F.core := + Iso.refl _ + +lemma functorToCore_comp_right {C' : Type uā‚„} [Category.{vā‚„} C'] (H : G ℤ C) (F : C ℤ C') : + functorToCore (H ā‹™ F) = functorToCore H ā‹™ F.core := + Functor.ext_of_iso (functorToCoreCompRightIso H F) (by cat_disch) + +/-- The functor `functorToCore (šŸ­ G)` is a section of `inclusion G`. -/ +def inclusionCompFunctorToCoreIso : inclusion G ā‹™ functorToCore (šŸ­ G) ≅ šŸ­ (Core G) := + NatIso.ofComponents (fun _ ↦ Iso.refl _) + +theorem inclusion_comp_functorToCore : inclusion G ā‹™ functorToCore (šŸ­ G) = šŸ­ (Core G) := + Functor.ext_of_iso inclusionCompFunctorToCoreIso (by cat_disch) + +/-- The functor `functorToCore (inclusion C)` is isomorphic to the identity on `Core C`. -/ +def functorToCoreInclusionIso : functorToCore (inclusion C) ≅ šŸ­ (Core C) := + Iso.refl _ + +theorem functorToCore_inclusion : functorToCore (inclusion C) = šŸ­ (Core C) := + Functor.ext_of_iso functorToCoreInclusionIso (by cat_disch) + +end Core + variable (D : Type uā‚‚) [Category.{vā‚‚} D] namespace Equivalence