File: Mathlib/CategoryTheory/Sigma/Basic.lean

full_name: CategoryTheory.Sigma.SigmaHom
code: /-- The type of morphisms of a disjoint union of categories: for `X : C i` and `Y : C j`, a morphism
`(i, X) ⟶ (j, Y)` if `i = j` is just a morphism `X ⟶ Y`, and if `i ≠ j` there are no such morphisms.
-/
inductive SigmaHom : (Σi, C i) → (Σi, C i) → Type max w₁ v₁ u₁
  | mk : ∀ {i : I} {X Y : C i}, (X ⟶ Y) → SigmaHom ⟨i, X⟩ ⟨i, Y⟩
goal: (i : I) × C i → (i : I) × C i → Type (max w₁ v₁ u₁)

full_name: CategoryTheory.Sigma.SigmaHom.mk
code: /-- The type of morphisms of a disjoint union of categories: for `X : C i` and `Y : C j`, a morphism
`(i, X) ⟶ (j, Y)` if `i = j` is just a morphism `X ⟶ Y`, and if `i ≠ j` there are no such morphisms.
-/
inductive SigmaHom : (Σi, C i) → (Σi, C i) → Type max w₁ v₁ u₁
  | mk : ∀ {i : I} {X Y : C i}, (X ⟶ Y) → SigmaHom ⟨i, X⟩ ⟨i, Y⟩
goal: (X ⟶ Y) → CategoryTheory.Sigma.SigmaHom ⟨i, X⟩ ⟨i, Y⟩

full_name: CategoryTheory.Sigma.SigmaHom.id
code: /-- The identity morphism on an object. -/
def id : ∀ X : Σi, C i, SigmaHom X X
  
goal: CategoryTheory.Sigma.SigmaHom X X

full_name: CategoryTheory.Sigma.SigmaHom.instInhabited
code: instance (X : Σi, C i) : Inhabited (SigmaHom X X) 
goal: Inhabited (CategoryTheory.Sigma.SigmaHom X X)

full_name: CategoryTheory.Sigma.SigmaHom.comp
code: /-- Composition of sigma homomorphisms. -/
def comp : ∀ {X Y Z : Σi, C i}, SigmaHom X Y → SigmaHom Y Z → SigmaHom X Z
  
goal: CategoryTheory.Sigma.SigmaHom X Y → CategoryTheory.Sigma.SigmaHom Y Z → CategoryTheory.Sigma.SigmaHom X Z

full_name: CategoryTheory.Sigma.SigmaHom.instCategoryStructSigma
code: instance : CategoryStruct (Σi, C i) 
goal: CategoryTheory.CategoryStruct.{max (max u₁ w₁) v₁, max u₁ w₁} ((i : I) × C i)

full_name: CategoryTheory.Sigma.SigmaHom.comp_def
code: @[simp]
lemma comp_def (i : I) (X Y Z : C i) (f : X ⟶ Y) (g : Y ⟶ Z) : comp (mk f) (mk g) = mk (f ≫ g) 
goal: (CategoryTheory.Sigma.SigmaHom.mk f).comp (CategoryTheory.Sigma.SigmaHom.mk g) =
  CategoryTheory.Sigma.SigmaHom.mk (CategoryTheory.CategoryStruct.comp f g)

full_name: CategoryTheory.Sigma.SigmaHom.assoc
code: lemma assoc : ∀ {X Y Z W : Σi, C i} (f : X ⟶ Y) (g : Y ⟶ Z) (h : Z ⟶ W), (f ≫ g) ≫ h = f ≫ g ≫ h
  
goal: CategoryTheory.CategoryStruct.comp (CategoryTheory.CategoryStruct.comp f g) h =
  CategoryTheory.CategoryStruct.comp f (CategoryTheory.CategoryStruct.comp g h)

full_name: CategoryTheory.Sigma.SigmaHom.id_comp
code: lemma id_comp : ∀ {X Y : Σi, C i} (f : X ⟶ Y), 𝟙 X ≫ f = f
  
goal: CategoryTheory.CategoryStruct.comp (CategoryTheory.CategoryStruct.id X) f = f

full_name: CategoryTheory.Sigma.SigmaHom.comp_id
code: lemma comp_id : ∀ {X Y : Σi, C i} (f : X ⟶ Y), f ≫ 𝟙 Y = f
  
goal: CategoryTheory.CategoryStruct.comp f (CategoryTheory.CategoryStruct.id Y) = f

full_name: CategoryTheory.Sigma.sigma
code: instance sigma : Category (Σi, C i) 
goal: CategoryTheory.Category.{max (max u₁ v₁) w₁, max u₁ w₁} ((i : I) × C i)

full_name: CategoryTheory.Sigma.incl
code: /-- The inclusion functor into the disjoint union of categories. -/
@[simps map]
def incl (i : I) : C i ⥤ Σi, C i 
goal: CategoryTheory.Functor (C i) ((i : I) × C i)

full_name: CategoryTheory.Sigma.incl_map
code: /-- The inclusion functor into the disjoint union of categories. -/
@[simps map]
def incl (i : I) : C i ⥤ Σi, C i 
goal: ∀ {X Y : C i} (a : X ⟶ Y), (CategoryTheory.Sigma.incl i).map a = CategoryTheory.Sigma.SigmaHom.mk a

full_name: CategoryTheory.Sigma.incl_obj
code: @[simp]
lemma incl_obj {i : I} (X : C i) : (incl i).obj X = ⟨i, X⟩ 
goal: (CategoryTheory.Sigma.incl i).obj X = ⟨i, X⟩

full_name: CategoryTheory.Sigma.instFullSigmaIncl
code: instance (i : I) : Functor.Full (incl i : C i ⥤ Σi, C i) 
goal: (CategoryTheory.Sigma.incl i).Full

full_name: CategoryTheory.Sigma.instFaithfulSigmaIncl
code: instance (i : I) : Functor.Faithful (incl i : C i ⥤ Σi, C i) 
goal: (CategoryTheory.Sigma.incl i).Faithful

full_name: CategoryTheory.Sigma.natTrans
code: /--
To build a natural transformation over the sigma category, it suffices to specify it restricted to
each subcategory.
-/
def natTrans {F G : (Σi, C i) ⥤ D} (h : ∀ i : I, incl i ⋙ F ⟶ incl i ⋙ G) : F ⟶ G 
goal: F ⟶ G

full_name: CategoryTheory.Sigma.natTrans_app
code: @[simp]
lemma natTrans_app {F G : (Σi, C i) ⥤ D} (h : ∀ i : I, incl i ⋙ F ⟶ incl i ⋙ G) (i : I)
    (X : C i) : (natTrans h).app ⟨i, X⟩ = (h i).app X 
goal: (CategoryTheory.Sigma.natTrans h).app ⟨i, X⟩ = (h i).app X

full_name: CategoryTheory.Sigma.descMap
code: /-- (Implementation). An auxiliary definition to build the functor `desc`. -/
def descMap : ∀ X Y : Σi, C i, (X ⟶ Y) → ((F X.1).obj X.2 ⟶ (F Y.1).obj Y.2)
  
goal: (X ⟶ Y) → ((F X.fst).obj X.snd ⟶ (F Y.fst).obj Y.snd)

full_name: CategoryTheory.Sigma.desc_obj
code: /-- Given a collection of functors `F i : C i ⥤ D`, we can produce a functor `(Σ i, C i) ⥤ D`.

The produced functor `desc F` satisfies: `incl i ⋙ desc F ≅ F i`, i.e. restricted to just the
subcategory `C i`, `desc F` agrees with `F i`, and it is unique (up to natural isomorphism) with
this property.

This witnesses that the sigma-type is the coproduct in Cat.
-/
@[simps obj]
def desc : (Σi, C i) ⥤ D 
goal: (CategoryTheory.Sigma.desc F).obj X = (F X.fst).obj X.snd

full_name: CategoryTheory.Sigma.desc
code: /-- Given a collection of functors `F i : C i ⥤ D`, we can produce a functor `(Σ i, C i) ⥤ D`.

The produced functor `desc F` satisfies: `incl i ⋙ desc F ≅ F i`, i.e. restricted to just the
subcategory `C i`, `desc F` agrees with `F i`, and it is unique (up to natural isomorphism) with
this property.

This witnesses that the sigma-type is the coproduct in Cat.
-/
@[simps obj]
def desc : (Σi, C i) ⥤ D 
goal: CategoryTheory.Functor ((i : I) × C i) D

full_name: CategoryTheory.Sigma.desc_map_mk
code: @[simp]
lemma desc_map_mk {i : I} (X Y : C i) (f : X ⟶ Y) : (desc F).map (SigmaHom.mk f) = (F i).map f 
goal: (CategoryTheory.Sigma.desc F).map (CategoryTheory.Sigma.SigmaHom.mk f) = (F i).map f

full_name: CategoryTheory.Sigma.inclDesc
code: /-- This shows that when `desc F` is restricted to just the subcategory `C i`, `desc F` agrees with
`F i`.
-/
def inclDesc (i : I) : incl i ⋙ desc F ≅ F i 
goal: (CategoryTheory.Sigma.incl i).comp (CategoryTheory.Sigma.desc F) ≅ F i

full_name: CategoryTheory.Sigma.inclDesc_hom_app
code: @[simp]
lemma inclDesc_hom_app (i : I) (X : C i) : (inclDesc F i).hom.app X = 𝟙 ((F i).obj X) 
goal: (CategoryTheory.Sigma.inclDesc F i).hom.app X = CategoryTheory.CategoryStruct.id ((F i).obj X)

full_name: CategoryTheory.Sigma.inclDesc_inv_app
code: @[simp]
lemma inclDesc_inv_app (i : I) (X : C i) : (inclDesc F i).inv.app X = 𝟙 ((F i).obj X) 
goal: (CategoryTheory.Sigma.inclDesc F i).inv.app X = CategoryTheory.CategoryStruct.id ((F i).obj X)

full_name: CategoryTheory.Sigma.descUniq
code: /-- If `q` when restricted to each subcategory `C i` agrees with `F i`, then `q` is isomorphic to
`desc F`.
-/
def descUniq (q : (Σi, C i) ⥤ D) (h : ∀ i, incl i ⋙ q ≅ F i) : q ≅ desc F 
goal: q ≅ CategoryTheory.Sigma.desc F

full_name: CategoryTheory.Sigma.descUniq_hom_app
code: @[simp]
lemma descUniq_hom_app (q : (Σi, C i) ⥤ D) (h : ∀ i, incl i ⋙ q ≅ F i) (i : I) (X : C i) :
    (descUniq F q h).hom.app ⟨i, X⟩ = (h i).hom.app X 
goal: (CategoryTheory.Sigma.descUniq F q h).hom.app ⟨i, X⟩ = (h i).hom.app X

full_name: CategoryTheory.Sigma.descUniq_inv_app
code: @[simp]
lemma descUniq_inv_app (q : (Σi, C i) ⥤ D) (h : ∀ i, incl i ⋙ q ≅ F i) (i : I) (X : C i) :
    (descUniq F q h).inv.app ⟨i, X⟩ = (h i).inv.app X 
goal: (CategoryTheory.Sigma.descUniq F q h).inv.app ⟨i, X⟩ = (h i).inv.app X

full_name: CategoryTheory.Sigma.natIso_inv
code: /--
If `q₁` and `q₂` when restricted to each subcategory `C i` agree, then `q₁` and `q₂` are isomorphic.
-/
@[simps]
def natIso {q₁ q₂ : (Σi, C i) ⥤ D} (h : ∀ i, incl i ⋙ q₁ ≅ incl i ⋙ q₂) : q₁ ≅ q₂ 
goal: (CategoryTheory.Sigma.natIso h).inv = CategoryTheory.Sigma.natTrans fun i => (h i).inv

full_name: CategoryTheory.Sigma.natIso_hom
code: /--
If `q₁` and `q₂` when restricted to each subcategory `C i` agree, then `q₁` and `q₂` are isomorphic.
-/
@[simps]
def natIso {q₁ q₂ : (Σi, C i) ⥤ D} (h : ∀ i, incl i ⋙ q₁ ≅ incl i ⋙ q₂) : q₁ ≅ q₂ 
goal: (CategoryTheory.Sigma.natIso h).hom = CategoryTheory.Sigma.natTrans fun i => (h i).hom

full_name: CategoryTheory.Sigma.natIso
code: /--
If `q₁` and `q₂` when restricted to each subcategory `C i` agree, then `q₁` and `q₂` are isomorphic.
-/
@[simps]
def natIso {q₁ q₂ : (Σi, C i) ⥤ D} (h : ∀ i, incl i ⋙ q₁ ≅ incl i ⋙ q₂) : q₁ ≅ q₂ 
goal: q₁ ≅ q₂

full_name: CategoryTheory.Sigma.map
code: /-- A function `J → I` induces a functor `Σ j, C (g j) ⥤ Σ i, C i`. -/
def map : (Σj : J, C (g j)) ⥤ Σi : I, C i 
goal: CategoryTheory.Functor ((j : J) × C (g j)) ((i : I) × C i)

full_name: CategoryTheory.Sigma.map_obj
code: @[simp]
lemma map_obj (j : J) (X : C (g j)) : (Sigma.map C g).obj ⟨j, X⟩ = ⟨g j, X⟩ 
goal: (CategoryTheory.Sigma.map C g).obj ⟨j, X⟩ = ⟨g j, X⟩

full_name: CategoryTheory.Sigma.map_map
code: @[simp]
lemma map_map {j : J} {X Y : C (g j)} (f : X ⟶ Y) :
    (Sigma.map C g).map (SigmaHom.mk f) = SigmaHom.mk f 
goal: (CategoryTheory.Sigma.map C g).map (CategoryTheory.Sigma.SigmaHom.mk f) = CategoryTheory.Sigma.SigmaHom.mk f

full_name: CategoryTheory.Sigma.inclCompMap_inv_app
code: /-- The functor `Sigma.map C g` restricted to the subcategory `C j` acts as the inclusion of `g j`.
-/
@[simps!]
def inclCompMap (j : J) : incl j ⋙ map C g ≅ incl (g j) 
goal: (CategoryTheory.Sigma.inclCompMap C g j).inv.app X = CategoryTheory.CategoryStruct.id ⟨g j, X⟩

full_name: CategoryTheory.Sigma.inclCompMap_hom_app
code: /-- The functor `Sigma.map C g` restricted to the subcategory `C j` acts as the inclusion of `g j`.
-/
@[simps!]
def inclCompMap (j : J) : incl j ⋙ map C g ≅ incl (g j) 
goal: (CategoryTheory.Sigma.inclCompMap C g j).hom.app X = CategoryTheory.CategoryStruct.id ⟨g j, X⟩

full_name: CategoryTheory.Sigma.inclCompMap
code: /-- The functor `Sigma.map C g` restricted to the subcategory `C j` acts as the inclusion of `g j`.
-/
@[simps!]
def inclCompMap (j : J) : incl j ⋙ map C g ≅ incl (g j) 
goal: (CategoryTheory.Sigma.incl j).comp (CategoryTheory.Sigma.map C g) ≅ CategoryTheory.Sigma.incl (g j)

full_name: CategoryTheory.Sigma.mapId
code: /-- The functor `Sigma.map` applied to the identity function is just the identity functor. -/
@[simps!]
def mapId : map C (id : I → I) ≅ 𝟭 (Σi, C i) 
goal: CategoryTheory.Sigma.map C id ≅ CategoryTheory.Functor.id ((i : I) × C i)

full_name: CategoryTheory.Sigma.mapId_hom_app
code: /-- The functor `Sigma.map` applied to the identity function is just the identity functor. -/
@[simps!]
def mapId : map C (id : I → I) ≅ 𝟭 (Σi, C i) 
goal: ∀ (x : (i : I) × (fun i => C (id i)) i),
  (CategoryTheory.Sigma.mapId I C).hom.app x = CategoryTheory.CategoryStruct.id ⟨x.fst, x.snd⟩

full_name: CategoryTheory.Sigma.mapId_inv_app
code: /-- The functor `Sigma.map` applied to the identity function is just the identity functor. -/
@[simps!]
def mapId : map C (id : I → I) ≅ 𝟭 (Σi, C i) 
goal: ∀ (x : (i : I) × (fun i => C (id i)) i),
  (CategoryTheory.Sigma.mapId I C).inv.app x = CategoryTheory.CategoryStruct.id ⟨x.fst, x.snd⟩

full_name: CategoryTheory.Sigma.mapComp
code: /-- The functor `Sigma.map` applied to a composition is a composition of functors. -/
@[simps!]
def mapComp (f : K → J) (g : J → I) : map (fun x ↦ C (g x)) f ⋙ (map C g : _) ≅ map C (g ∘ f) 
goal: (CategoryTheory.Sigma.map (fun x => C (g x)) f).comp (CategoryTheory.Sigma.map C g) ≅ CategoryTheory.Sigma.map C (g ∘ f)

full_name: CategoryTheory.Sigma.mapComp_hom_app
code: /-- The functor `Sigma.map` applied to a composition is a composition of functors. -/
@[simps!]
def mapComp (f : K → J) (g : J → I) : map (fun x ↦ C (g x)) f ⋙ (map C g : _) ≅ map C (g ∘ f) 
goal: (CategoryTheory.Sigma.mapComp C f g).hom.app X = CategoryTheory.CategoryStruct.id ⟨g (f X.fst), X.snd⟩

full_name: CategoryTheory.Sigma.mapComp_inv_app
code: /-- The functor `Sigma.map` applied to a composition is a composition of functors. -/
@[simps!]
def mapComp (f : K → J) (g : J → I) : map (fun x ↦ C (g x)) f ⋙ (map C g : _) ≅ map C (g ∘ f) 
goal: (CategoryTheory.Sigma.mapComp C f g).inv.app X = CategoryTheory.CategoryStruct.id ⟨g (f X.fst), X.snd⟩

full_name: CategoryTheory.Sigma.Functor.sigma
code: /-- Assemble an `I`-indexed family of functors into a functor between the sigma types.
-/
def sigma (F : ∀ i, C i ⥤ D i) : (Σi, C i) ⥤ Σi, D i 
goal: CategoryTheory.Functor ((i : I) × C i) ((i : I) × D i)

full_name: CategoryTheory.Sigma.natTrans.sigma
code: /-- Assemble an `I`-indexed family of natural transformations into a single natural transformation.
-/
def sigma (α : ∀ i, F i ⟶ G i) : Functor.sigma F ⟶ Functor.sigma G 
goal: CategoryTheory.Sigma.Functor.sigma F ⟶ CategoryTheory.Sigma.Functor.sigma G