File: Mathlib/CategoryTheory/ConcreteCategory/Basic.lean

full_name: CategoryTheory.ConcreteCategory
code: /-- A concrete category is a category `C` with a fixed faithful functor `Forget : C ⥤ Type`.

Note that `ConcreteCategory` potentially depends on three independent universe levels,
* the universe level `w` appearing in `Forget : C ⥤ Type w`
* the universe level `v` of the morphisms (i.e. we have a `Category.{v} C`)
* the universe level `u` of the objects (i.e `C : Type u`)
They are specified that order, to avoid unnecessary universe annotations.
-/
class ConcreteCategory (C : Type u) [Category.{v} C] where
  /-- We have a functor to Type -/
  protected forget : C ⥤ Type w
  /-- That functor is faithful -/
  [forget_faithful : forget.Faithful]
goal: Type (max (max u v) (w + 1))

full_name: CategoryTheory.ConcreteCategory.forget
code: /-- A concrete category is a category `C` with a fixed faithful functor `Forget : C ⥤ Type`.

Note that `ConcreteCategory` potentially depends on three independent universe levels,
* the universe level `w` appearing in `Forget : C ⥤ Type w`
* the universe level `v` of the morphisms (i.e. we have a `Category.{v} C`)
* the universe level `u` of the objects (i.e `C : Type u`)
They are specified that order, to avoid unnecessary universe annotations.
-/
class ConcreteCategory (C : Type u) [Category.{v} C] where
  /-- We have a functor to Type -/
  protected forget : C ⥤ Type w
  /-- That functor is faithful -/
  [forget_faithful : forget.Faithful]
goal: CategoryTheory.Functor C (Type w)

full_name: CategoryTheory.ConcreteCategory.forget_faithful
code: /-- A concrete category is a category `C` with a fixed faithful functor `Forget : C ⥤ Type`.

Note that `ConcreteCategory` potentially depends on three independent universe levels,
* the universe level `w` appearing in `Forget : C ⥤ Type w`
* the universe level `v` of the morphisms (i.e. we have a `Category.{v} C`)
* the universe level `u` of the objects (i.e `C : Type u`)
They are specified that order, to avoid unnecessary universe annotations.
-/
class ConcreteCategory (C : Type u) [Category.{v} C] where
  /-- We have a functor to Type -/
  protected forget : C ⥤ Type w
  /-- That functor is faithful -/
  [forget_faithful : forget.Faithful]
goal: CategoryTheory.ConcreteCategory.forget.Faithful

full_name: CategoryTheory.forget
code: /-- The forgetful functor from a concrete category to `Type u`. -/
abbrev forget (C : Type u) [Category.{v} C] [ConcreteCategory.{w} C] : C ⥤ Type w 
goal: CategoryTheory.Functor C (Type w)

full_name: CategoryTheory.ConcreteCategory.types
code: @[instance] abbrev ConcreteCategory.types : ConcreteCategory.{u, u, u+1} (Type u) 
goal: CategoryTheory.ConcreteCategory (Type u)

full_name: CategoryTheory.ConcreteCategory.hasCoeToSort
code: /-- Provide a coercion to `Type u` for a concrete category. This is not marked as an instance
as it could potentially apply to every type, and so is too expensive in typeclass search.

You can use it on particular examples as:
```
instance : HasCoeToSort X := ConcreteCategory.hasCoeToSort X
```
-/
def ConcreteCategory.hasCoeToSort (C : Type u) [Category.{v} C] [ConcreteCategory.{w} C] :
    CoeSort C (Type w) 
goal: CoeSort C (Type w)

full_name: CategoryTheory.ConcreteCategory.instFunLike
code: /-- In any concrete category, `(forget C).map` is injective. -/
abbrev ConcreteCategory.instFunLike {X Y : C} : FunLike (X ⟶ Y) X Y 
goal: FunLike (X ⟶ Y) ((CategoryTheory.forget C).obj X) ((CategoryTheory.forget C).obj Y)

full_name: CategoryTheory.ConcreteCategory.hom_ext
code: /-- In any concrete category, we can test equality of morphisms by pointwise evaluations. -/
@[ext low] -- Porting note: lowered priority
theorem ConcreteCategory.hom_ext {X Y : C} (f g : X ⟶ Y) (w : ∀ x : X, f x = g x) : f = g 
goal: f = g

full_name: CategoryTheory.forget_map_eq_coe
code: theorem forget_map_eq_coe {X Y : C} (f : X ⟶ Y) : (forget C).map f = f 
goal: (CategoryTheory.forget C).map f = ⇑f

full_name: CategoryTheory.congr_hom
code: /-- Analogue of `congr_fun h x`,
when `h : f = g` is an equality between morphisms in a concrete category.
-/
theorem congr_hom {X Y : C} {f g : X ⟶ Y} (h : f = g) (x : X) : f x = g x 
goal: f x = g x

full_name: CategoryTheory.coe_id
code: theorem coe_id {X : C} : (𝟙 X : X → X) = id 
goal: ⇑(CategoryTheory.CategoryStruct.id X) = id

full_name: CategoryTheory.coe_comp
code: theorem coe_comp {X Y Z : C} (f : X ⟶ Y) (g : Y ⟶ Z) : (f ≫ g : X → Z) = g ∘ f 
goal: ⇑(CategoryTheory.CategoryStruct.comp f g) = ⇑g ∘ ⇑f

full_name: CategoryTheory.id_apply
code: @[simp] theorem id_apply {X : C} (x : X) : (𝟙 X : X → X) x = x 
goal: (CategoryTheory.CategoryStruct.id X) x = x

full_name: CategoryTheory.comp_apply
code: @[simp] theorem comp_apply {X Y Z : C} (f : X ⟶ Y) (g : Y ⟶ Z) (x : X) : (f ≫ g) x = g (f x) 
goal: (CategoryTheory.CategoryStruct.comp f g) x = g (f x)

full_name: CategoryTheory.comp_apply'
code: theorem comp_apply' {X Y Z : C} (f : X ⟶ Y) (g : Y ⟶ Z) (x : X) :
    (forget C).map (f ≫ g) x = (forget C).map g ((forget C).map f x) 
goal: (CategoryTheory.forget C).map (CategoryTheory.CategoryStruct.comp f g) x =
  (CategoryTheory.forget C).map g ((CategoryTheory.forget C).map f x)

full_name: CategoryTheory.ConcreteCategory.congr_hom
code: theorem ConcreteCategory.congr_hom {X Y : C} {f g : X ⟶ Y} (h : f = g) (x : X) : f x = g x 
goal: f x = g x

full_name: CategoryTheory.ConcreteCategory.congr_arg
code: theorem ConcreteCategory.congr_arg {X Y : C} (f : X ⟶ Y) {x x' : X} (h : x = x') : f x = f x' 
goal: f x = f x'

full_name: CategoryTheory.ConcreteCategory.hasCoeToFun_Type
code: @[simp]
theorem ConcreteCategory.hasCoeToFun_Type {X Y : Type u} (f : X ⟶ Y) : CoeFun.coe f = f 
goal: CoeFun.coe f = f

full_name: CategoryTheory.HasForget₂
code: /-- `HasForget₂ C D`, where `C` and `D` are both concrete categories, provides a functor
`forget₂ C D : C ⥤ D` and a proof that `forget₂ ⋙ (forget D) = forget C`.
-/
class HasForget₂ (C : Type u) (D : Type u') [Category.{v} C] [ConcreteCategory.{w} C]
  [Category.{v'} D] [ConcreteCategory.{w} D] where
  /-- A functor from `C` to `D` -/
  forget₂ : C ⥤ D
  /-- It covers the `ConcreteCategory.forget` for `C` and `D` -/
  forget_comp : forget₂ ⋙ forget D = forget C := by aesop
goal: Type (max (max (max u u') v) v')

full_name: CategoryTheory.HasForget₂.forget_comp
code: /-- `HasForget₂ C D`, where `C` and `D` are both concrete categories, provides a functor
`forget₂ C D : C ⥤ D` and a proof that `forget₂ ⋙ (forget D) = forget C`.
-/
class HasForget₂ (C : Type u) (D : Type u') [Category.{v} C] [ConcreteCategory.{w} C]
  [Category.{v'} D] [ConcreteCategory.{w} D] where
  /-- A functor from `C` to `D` -/
  forget₂ : C ⥤ D
  /-- It covers the `ConcreteCategory.forget` for `C` and `D` -/
  forget_comp : forget₂ ⋙ forget D = forget C := by aesop
goal: CategoryTheory.HasForget₂.forget₂.comp (CategoryTheory.forget D) = CategoryTheory.forget C

full_name: CategoryTheory.HasForget₂.forget₂
code: /-- `HasForget₂ C D`, where `C` and `D` are both concrete categories, provides a functor
`forget₂ C D : C ⥤ D` and a proof that `forget₂ ⋙ (forget D) = forget C`.
-/
class HasForget₂ (C : Type u) (D : Type u') [Category.{v} C] [ConcreteCategory.{w} C]
  [Category.{v'} D] [ConcreteCategory.{w} D] where
  /-- A functor from `C` to `D` -/
  forget₂ : C ⥤ D
  /-- It covers the `ConcreteCategory.forget` for `C` and `D` -/
  forget_comp : forget₂ ⋙ forget D = forget C := by aesop
goal: CategoryTheory.Functor C D

full_name: CategoryTheory.forget₂
code: /-- The forgetful functor `C ⥤ D` between concrete categories for which we have an instance
`HasForget₂ C`. -/
abbrev forget₂ (C : Type u) (D : Type u') [Category.{v} C] [ConcreteCategory.{w} C]
    [Category.{v'} D] [ConcreteCategory.{w} D] [HasForget₂ C D] : C ⥤ D 
goal: CategoryTheory.Functor C D

full_name: CategoryTheory.forget₂_comp_apply
code: lemma forget₂_comp_apply {C : Type u} {D : Type u'} [Category.{v} C] [ConcreteCategory.{w} C]
    [Category.{v'} D] [ConcreteCategory.{w} D] [HasForget₂ C D] {X Y Z : C}
    (f : X ⟶ Y) (g : Y ⟶ Z) (x : (forget₂ C D).obj X) :
    ((forget₂ C D).map (f ≫ g) x) =
      (forget₂ C D).map g ((forget₂ C D).map f x) 
goal: ((CategoryTheory.forget₂ C D).map (CategoryTheory.CategoryStruct.comp f g)) x =
  ((CategoryTheory.forget₂ C D).map g) (((CategoryTheory.forget₂ C D).map f) x)

full_name: CategoryTheory.forget₂_faithful
code: instance forget₂_faithful (C : Type u) (D : Type u') [Category.{v} C] [ConcreteCategory.{w} C]
    [Category.{v'} D] [ConcreteCategory.{w} D] [HasForget₂ C D] : (forget₂ C D).Faithful 
goal: (CategoryTheory.forget₂ C D).Faithful

full_name: CategoryTheory.InducedCategory.concreteCategory
code: instance InducedCategory.concreteCategory {C : Type u} {D : Type u'}
    [Category.{v'} D] [ConcreteCategory.{w} D] (f : C → D) :
      ConcreteCategory (InducedCategory D f) 
goal: CategoryTheory.ConcreteCategory (CategoryTheory.InducedCategory D f)

full_name: CategoryTheory.InducedCategory.hasForget₂
code: instance InducedCategory.hasForget₂ {C : Type u} {D : Type u'} [Category.{v} D]
    [ConcreteCategory.{w} D] (f : C → D) : HasForget₂ (InducedCategory D f) D 
goal: CategoryTheory.HasForget₂ (CategoryTheory.InducedCategory D f) D

full_name: CategoryTheory.FullSubcategory.concreteCategory
code: instance FullSubcategory.concreteCategory {C : Type u} [Category.{v} C] [ConcreteCategory.{w} C]
    (Z : C → Prop) : ConcreteCategory (FullSubcategory Z) 
goal: CategoryTheory.ConcreteCategory (CategoryTheory.FullSubcategory Z)

full_name: CategoryTheory.FullSubcategory.hasForget₂
code: instance FullSubcategory.hasForget₂ {C : Type u} [Category.{v} C] [ConcreteCategory.{w} C]
    (Z : C → Prop) : HasForget₂ (FullSubcategory Z) C 
goal: CategoryTheory.HasForget₂ (CategoryTheory.FullSubcategory Z) C

full_name: CategoryTheory.HasForget₂.mk'
code: /-- In order to construct a “partially forgetting” functor, we do not need to verify functor laws;
it suffices to ensure that compositions agree with `forget₂ C D ⋙ forget D = forget C`.
-/
def HasForget₂.mk' {C : Type u} {D : Type u'} [Category.{v} C] [ConcreteCategory.{w} C]
    [Category.{v'} D] [ConcreteCategory.{w} D]
    (obj : C → D) (h_obj : ∀ X, (forget D).obj (obj X) = (forget C).obj X)
    (map : ∀ {X Y}, (X ⟶ Y) → (obj X ⟶ obj Y))
    (h_map : ∀ {X Y} {f : X ⟶ Y}, HEq ((forget D).map (map f)) ((forget C).map f)) :
    HasForget₂ C D 
goal: CategoryTheory.HasForget₂ C D

full_name: CategoryTheory.HasForget₂.trans
code: /-- Composition of `HasForget₂` instances. -/
@[reducible]
def HasForget₂.trans (C : Type u) [Category.{v} C] [ConcreteCategory.{w} C]
    (D : Type u') [Category.{v'} D] [ConcreteCategory.{w} D]
    (E : Type u'') [Category.{v''} E] [ConcreteCategory.{w} E]
    [HasForget₂ C D] [HasForget₂ D E] : HasForget₂ C E 
goal: CategoryTheory.HasForget₂ C E

full_name: CategoryTheory.hasForgetToType
code: /-- Every forgetful functor factors through the identity functor. This is not a global instance as
    it is prone to creating type class resolution loops. -/
def hasForgetToType (C : Type u) [Category.{v} C] [ConcreteCategory.{w} C] :
    HasForget₂ C (Type w) 
goal: CategoryTheory.HasForget₂ C (Type w)

full_name: CategoryTheory.NatTrans.naturality_apply
code: @[simp]
lemma NatTrans.naturality_apply {C D : Type*} [Category C] [Category D] [ConcreteCategory D]
    {F G : C ⥤ D} (φ : F ⟶ G) {X Y : C} (f : X ⟶ Y) (x : F.obj X) :
    φ.app Y (F.map f x) = G.map f (φ.app X x) 
goal: (φ.app Y) ((F.map f) x) = (G.map f) ((φ.app X) x)