File: Mathlib/CategoryTheory/Functor/Basic.lean

full_name: CategoryTheory.Functor.map_comp
code: /-- `Functor C D` represents a functor between categories `C` and `D`.

To apply a functor `F` to an object use `F.obj X`, and to a morphism use `F.map f`.

The axiom `map_id` expresses preservation of identities, and
`map_comp` expresses functoriality.

See <https://stacks.math.columbia.edu/tag/001B>.
-/
structure Functor (C : Type u₁) [Category.{v₁} C] (D : Type u₂) [Category.{v₂} D]
    extends Prefunctor C D : Type max v₁ v₂ u₁ u₂ where
  /-- A functor preserves identity morphisms. -/
  map_id : ∀ X : C, map (𝟙 X) = 𝟙 (obj X) := by aesop_cat
  /-- A functor preserves composition. -/
  map_comp : ∀ {X Y Z : C} (f : X ⟶ Y) (g : Y ⟶ Z), map (f ≫ g) = map f ≫ map g := by aesop_cat
goal: self.map (CategoryTheory.CategoryStruct.comp f g) = CategoryTheory.CategoryStruct.comp (self.map f) (self.map g)

full_name: CategoryTheory.Functor
code: /-- `Functor C D` represents a functor between categories `C` and `D`.

To apply a functor `F` to an object use `F.obj X`, and to a morphism use `F.map f`.

The axiom `map_id` expresses preservation of identities, and
`map_comp` expresses functoriality.

See <https://stacks.math.columbia.edu/tag/001B>.
-/
structure Functor (C : Type u₁) [Category.{v₁} C] (D : Type u₂) [Category.{v₂} D]
    extends Prefunctor C D : Type max v₁ v₂ u₁ u₂ where
  /-- A functor preserves identity morphisms. -/
  map_id : ∀ X : C, map (𝟙 X) = 𝟙 (obj X) := by aesop_cat
  /-- A functor preserves composition. -/
  map_comp : ∀ {X Y Z : C} (f : X ⟶ Y) (g : Y ⟶ Z), map (f ≫ g) = map f ≫ map g := by aesop_cat
goal: Type (max v₁ v₂ u₁ u₂)

full_name: CategoryTheory.Functor.map_id
code: /-- `Functor C D` represents a functor between categories `C` and `D`.

To apply a functor `F` to an object use `F.obj X`, and to a morphism use `F.map f`.

The axiom `map_id` expresses preservation of identities, and
`map_comp` expresses functoriality.

See <https://stacks.math.columbia.edu/tag/001B>.
-/
structure Functor (C : Type u₁) [Category.{v₁} C] (D : Type u₂) [Category.{v₂} D]
    extends Prefunctor C D : Type max v₁ v₂ u₁ u₂ where
  /-- A functor preserves identity morphisms. -/
  map_id : ∀ X : C, map (𝟙 X) = 𝟙 (obj X) := by aesop_cat
  /-- A functor preserves composition. -/
  map_comp : ∀ {X Y Z : C} (f : X ⟶ Y) (g : Y ⟶ Z), map (f ≫ g) = map f ≫ map g := by aesop_cat
goal: self.map (CategoryTheory.CategoryStruct.id X) = CategoryTheory.CategoryStruct.id (self.obj X)

full_name: CategoryTheory._aux_Mathlib_CategoryTheory_Functor_Basic___unexpand_CategoryTheory_Functor_1
code: /-- Notation for a functor between categories. -/
-- A functor is basically a function, so give ⥤ a similar precedence to → (25).
-- For example, `C × D ⥤ E` should parse as `(C × D) ⥤ E` not `C × (D ⥤ E)`.
scoped [CategoryTheory] infixr:26 " ⥤ " => Functor
goal: Lean.PrettyPrinter.Unexpander

full_name: CategoryTheory.«_aux_Mathlib_CategoryTheory_Functor_Basic___macroRules_CategoryTheory_term_⥤__1»
code: /-- Notation for a functor between categories. -/
-- A functor is basically a function, so give ⥤ a similar precedence to → (25).
-- For example, `C × D ⥤ E` should parse as `(C × D) ⥤ E` not `C × (D ⥤ E)`.
scoped [CategoryTheory] infixr:26 " ⥤ " => Functor
goal: Lean.Macro

full_name: CategoryTheory.Functor.map_comp_assoc
code: lemma Functor.map_comp_assoc {C : Type u₁} [Category C] {D : Type u₂} [Category D] (F : C ⥤ D)
    {X Y Z : C} (f : X ⟶ Y) (g : Y ⟶ Z) {W : D} (h : F.obj Z ⟶ W) :
    (F.map (f ≫ g)) ≫ h = F.map f ≫ F.map g ≫ h 
goal: CategoryTheory.CategoryStruct.comp (F.map (CategoryTheory.CategoryStruct.comp f g)) h =
  CategoryTheory.CategoryStruct.comp (F.map f) (CategoryTheory.CategoryStruct.comp (F.map g) h)

full_name: CategoryTheory.Functor.id
code: /-- `𝟭 C` is the identity functor on a category `C`. -/
protected def id : C ⥤ C 
goal: CategoryTheory.Functor C C

full_name: CategoryTheory.«_aux_Mathlib_CategoryTheory_Functor_Basic___macroRules_CategoryTheory_term𝟭_1»
code: /-- Notation for the identity functor on a category. -/
scoped [CategoryTheory] notation "𝟭" => Functor.id
goal: Lean.Macro

full_name: CategoryTheory._aux_Mathlib_CategoryTheory_Functor_Basic___unexpand_CategoryTheory_Functor_id_1
code: /-- Notation for the identity functor on a category. -/
scoped [CategoryTheory] notation "𝟭" => Functor.id
goal: Lean.PrettyPrinter.Unexpander

full_name: CategoryTheory.Functor.instInhabited
code: instance : Inhabited (C ⥤ C) 
goal: Inhabited (CategoryTheory.Functor C C)

full_name: CategoryTheory.Functor.id_obj
code: @[simp]
theorem id_obj (X : C) : (𝟭 C).obj X = X 
goal: (CategoryTheory.Functor.id C).obj X = X

full_name: CategoryTheory.Functor.id_map
code: @[simp]
theorem id_map {X Y : C} (f : X ⟶ Y) : (𝟭 C).map f = f 
goal: (CategoryTheory.Functor.id C).map f = f

full_name: CategoryTheory.Functor.comp
code: /-- `F ⋙ G` is the composition of a functor `F` and a functor `G` (`F` first, then `G`).
-/
@[simps obj]
def comp (F : C ⥤ D) (G : D ⥤ E) : C ⥤ E 
goal: CategoryTheory.Functor C E

full_name: CategoryTheory.Functor.comp_obj
code: /-- `F ⋙ G` is the composition of a functor `F` and a functor `G` (`F` first, then `G`).
-/
@[simps obj]
def comp (F : C ⥤ D) (G : D ⥤ E) : C ⥤ E 
goal: (F.comp G).obj X = G.obj (F.obj X)

full_name: CategoryTheory._aux_Mathlib_CategoryTheory_Functor_Basic___unexpand_CategoryTheory_Functor_comp_1
code: /-- Notation for composition of functors. -/
scoped [CategoryTheory] infixr:80 " ⋙ " => Functor.comp
goal: Lean.PrettyPrinter.Unexpander

full_name: CategoryTheory.«_aux_Mathlib_CategoryTheory_Functor_Basic___macroRules_CategoryTheory_term_⋙__1»
code: /-- Notation for composition of functors. -/
scoped [CategoryTheory] infixr:80 " ⋙ " => Functor.comp
goal: Lean.Macro

full_name: CategoryTheory.Functor.comp_map
code: @[simp]
theorem comp_map (F : C ⥤ D) (G : D ⥤ E) {X Y : C} (f : X ⟶ Y) :
    (F ⋙ G).map f = G.map (F.map f) 
goal: (F.comp G).map f = G.map (F.map f)

full_name: CategoryTheory.Functor.comp_id
code: protected theorem comp_id (F : C ⥤ D) : F ⋙ 𝟭 D = F 
goal: F.comp (CategoryTheory.Functor.id D) = F

full_name: CategoryTheory.Functor.id_comp
code: protected theorem id_comp (F : C ⥤ D) : 𝟭 C ⋙ F = F 
goal: (CategoryTheory.Functor.id C).comp F = F

full_name: CategoryTheory.Functor.map_dite
code: @[simp]
theorem map_dite (F : C ⥤ D) {X Y : C} {P : Prop} [Decidable P]
    (f : P → (X ⟶ Y)) (g : ¬P → (X ⟶ Y)) :
    F.map (if h : P then f h else g h) = if h : P then F.map (f h) else F.map (g h) 
goal: F.map (if h : P then f h else g h) = if h : P then F.map (f h) else F.map (g h)

full_name: CategoryTheory.Functor.toPrefunctor_comp
code: @[simp]
theorem toPrefunctor_comp (F : C ⥤ D) (G : D ⥤ E) :
    F.toPrefunctor.comp G.toPrefunctor = (F ⋙ G).toPrefunctor 
goal: F.toPrefunctor ⋙q G.toPrefunctor = (F.comp G).toPrefunctor