The Mathlib Handbook

The volumes of the handbook are not written yet. This site shows the map of Mathlib that they will follow, at Mathlib 4472534b60.

The areas / V24. Category theory

Mathlib.CategoryTheory.ConcreteCategory.Forget

20 declarations. Mathlib docs · Source

Forgetful functors

A concrete category is a category C where the objects and morphisms correspond with types and (bundled) functions between these types, see the file Mathlib.CategoryTheory.ConcreteCategory.Basic

Each concrete category C comes with a canonical faithful functor forget C : C ⥤ Type*. We impose no restrictions on the category C, so Type has the identity forgetful functor.

We say that a concrete category C admits a forgetful functor to a concrete category D, if it has a functor forget₂ C D : C ⥤ D such that (forget₂ C D) ⋙ (forget D) = forget C, see class HasForget₂. Due to Faithful.div_comp, it suffices to verify that forget₂.obj and forget₂.map agree with the equality above; then forget₂ will satisfy the functor laws automatically, see HasForget₂.mk'.

We say that a concrete category C admits a forgetful functor to a concrete category D, if it has a functor forget₂ C D : C ⥤ D such that (forget₂ C D) ⋙ (forget D) = forget C, see class HasForget₂. Due to Faithful.div_comp, it suffices to verify that forget₂.obj and forget₂.map agree with the equality above; then forget₂ will satisfy the functor laws automatically, see HasForget₂.mk'.

References

See [Ahrens and Lumsdaine, Displayed Categories][ahrens2017] for related work.

def CategoryTheory.HasForget₂.ctorIdx E1 #

{C : Type u_1} →
  {inst : CategoryTheory.Category.{v_1, u_1} C} →
    {FC : outParam (C → C → Type u_2)} →
      {CC : outParam (C → Type w)} →
        {inst_1 : outParam ((X Y : C) → FunLike (FC X Y) (CC X) (CC Y))} →
          {inst_2 : CategoryTheory.ConcreteCategory C FC} →
            {D : Type u_3} →
              {inst_3 : CategoryTheory.Category.{v_2, u_3} D} →
                {FD : outParam (D → D → Type u_4)} →
                  {CD : outParam (D → Type w)} →
                    {inst_4 : outParam ((X Y : D) → FunLike (FD X Y) (CD X) (CD Y))} →
                      {inst_5 : CategoryTheory.ConcreteCategory D FD} → CategoryTheory.HasForget₂ C D → ℕ

abbrev CategoryTheory.forget E1 #

(C : Type u_1) →
  [inst : CategoryTheory.Category.{v_1, u_1} C] →
    {FC : outParam (C → C → Type u_2)} →
      {CC : outParam (C → Type w)} →
        [inst_1 : outParam ((X Y : C) → FunLike (FC X Y) (CC X) (CC Y))] →
          [CategoryTheory.ConcreteCategory C FC] → CategoryTheory.Functor C (Type w)

The forgetful functor from a concrete category to the category of types.

instance CategoryTheory.instFaithfulForget E0 #

∀ (C : Type u_1) [inst : CategoryTheory.Category.{v_1, u_1} C] {FC : outParam (C → C → Type u_2)}
  {CC : outParam (C → Type w)} [inst_1 : outParam ((X Y : C) → FunLike (FC X Y) (CC X) (CC Y))]
  [inst_2 : CategoryTheory.ConcreteCategory C FC], (CategoryTheory.forget C).Faithful

theorem CategoryTheory.ConcreteCategory.forget_map_eq_ofHom E0 #

∀ {C : Type u_1} [inst : CategoryTheory.Category.{v_1, u_1} C] {FC : outParam (C → C → Type u_2)}
  {CC : outParam (C → Type w)} [inst_1 : outParam ((X Y : C) → FunLike (FC X Y) (CC X) (CC Y))]
  [inst_2 : CategoryTheory.ConcreteCategory C FC] {X Y : C} (f : X ⟶ Y),
  (CategoryTheory.forget C).map f = TypeCat.ofHom ⇑(CategoryTheory.ConcreteCategory.hom f)

theorem CategoryTheory.forget_obj E1 #

∀ {C : Type u_1} [inst : CategoryTheory.Category.{v_1, u_1} C] {FC : outParam (C → C → Type u_2)}
  {CC : outParam (C → Type w)} [inst_1 : outParam ((X Y : C) → FunLike (FC X Y) (CC X) (CC Y))]
  [inst_2 : CategoryTheory.ConcreteCategory C FC] (X : C), (CategoryTheory.forget C).obj X = CategoryTheory.ToType X

theorem CategoryTheory.congr_fun E1 #

∀ {C : Type u_1} [inst : CategoryTheory.Category.{v_1, u_1} C] {FC : outParam (C → C → Type u_2)}
  {CC : outParam (C → Type w)} [inst_1 : outParam ((X Y : C) → FunLike (FC X Y) (CC X) (CC Y))]
  [inst_2 : CategoryTheory.ConcreteCategory C FC] {X Y : C} {f g : X ⟶ Y},
  f = g →
    ∀ (x : CategoryTheory.ToType X),
      (CategoryTheory.ConcreteCategory.hom f) x = (CategoryTheory.ConcreteCategory.hom g) x

Analogue of congr_fun h x, when h : f = g is an equality between morphisms in a concrete category.

theorem CategoryTheory.congr_arg E1 #

∀ {C : Type u_1} [inst : CategoryTheory.Category.{v_1, u_1} C] {FC : outParam (C → C → Type u_2)}
  {CC : outParam (C → Type w)} [inst_1 : outParam ((X Y : C) → FunLike (FC X Y) (CC X) (CC Y))]
  [inst_2 : CategoryTheory.ConcreteCategory C FC] {X Y : C} (f : X ⟶ Y) {x x' : CategoryTheory.ToType X},
  x = x' → (CategoryTheory.ConcreteCategory.hom f) x = (CategoryTheory.ConcreteCategory.hom f) x'

Analogue of congr_arg f h, when h : x = x' is an equality between elements of objects in a concrete category.

class CategoryTheory.HasForget₂ E1 #

(C : Type u_1) →
  [inst : CategoryTheory.Category.{v_1, u_1} C] →
    {FC : outParam (C → C → Type u_2)} →
      {CC : outParam (C → Type w)} →
        [inst_1 : outParam ((X Y : C) → FunLike (FC X Y) (CC X) (CC Y))] →
          [CategoryTheory.ConcreteCategory C FC] →
            (D : Type u_3) →
              [inst : CategoryTheory.Category.{v_2, u_3} D] →
                {FD : outParam (D → D → Type u_4)} →
                  {CD : outParam (D → Type w)} →
                    [inst_2 : outParam ((X Y : D) → FunLike (FD X Y) (CD X) (CD Y))] →
                      [CategoryTheory.ConcreteCategory D FD] → Type (max (max (max u_1 u_3) v_1) v_2)

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.

ctor CategoryTheory.HasForget₂.mk E0 #

{C : Type u_1} →
  [inst : CategoryTheory.Category.{v_1, u_1} C] →
    {FC : outParam (C → C → Type u_2)} →
      {CC : outParam (C → Type w)} →
        [inst_1 : outParam ((X Y : C) → FunLike (FC X Y) (CC X) (CC Y))] →
          [inst_2 : CategoryTheory.ConcreteCategory C FC] →
            {D : Type u_3} →
              [inst_3 : CategoryTheory.Category.{v_2, u_3} D] →
                {FD : outParam (D → D → Type u_4)} →
                  {CD : outParam (D → Type w)} →
                    [inst_4 : outParam ((X Y : D) → FunLike (FD X Y) (CD X) (CD Y))] →
                      [inst_5 : CategoryTheory.ConcreteCategory D FD] →
                        (forget₂ : CategoryTheory.Functor C D) →
                          autoParam (forget₂.comp (CategoryTheory.forget D) = CategoryTheory.forget C)
                              CategoryTheory.HasForget₂.forget_comp._autoParam →
                            CategoryTheory.HasForget₂ C D

abbrev CategoryTheory.HasForget₂.forget₂ E1 #

{C : Type u_1} →
  {inst : CategoryTheory.Category.{v_1, u_1} C} →
    {FC : outParam (C → C → Type u_2)} →
      {CC : outParam (C → Type w)} →
        {inst_1 : outParam ((X Y : C) → FunLike (FC X Y) (CC X) (CC Y))} →
          {inst_2 : CategoryTheory.ConcreteCategory C FC} →
            {D : Type u_3} →
              {inst_3 : CategoryTheory.Category.{v_2, u_3} D} →
                {FD : outParam (D → D → Type u_4)} →
                  {CD : outParam (D → Type w)} →
                    {inst_4 : outParam ((X Y : D) → FunLike (FD X Y) (CD X) (CD Y))} →
                      {inst_5 : CategoryTheory.ConcreteCategory D FD} →
                        [self : CategoryTheory.HasForget₂ C D] → CategoryTheory.Functor C D

A functor from C to D

theorem CategoryTheory.HasForget₂.forget_comp E1 #

∀ {C : Type u_1} {inst : CategoryTheory.Category.{v_1, u_1} C} {FC : outParam (C → C → Type u_2)}
  {CC : outParam (C → Type w)} {inst_1 : outParam ((X Y : C) → FunLike (FC X Y) (CC X) (CC Y))}
  {inst_2 : CategoryTheory.ConcreteCategory C FC} {D : Type u_3} {inst_3 : CategoryTheory.Category.{v_2, u_3} D}
  {FD : outParam (D → D → Type u_4)} {CD : outParam (D → Type w)}
  {inst_4 : outParam ((X Y : D) → FunLike (FD X Y) (CD X) (CD Y))} {inst_5 : CategoryTheory.ConcreteCategory D FD}
  [self : CategoryTheory.HasForget₂ C D],
  CategoryTheory.HasForget₂.forget₂.comp (CategoryTheory.forget D) = CategoryTheory.forget C

It covers the forget for C and D

abbrev CategoryTheory.forget₂ E1 #

(C : Type u_1) →
  [inst : CategoryTheory.Category.{v_1, u_1} C] →
    {FC : outParam (C → C → Type u_2)} →
      {CC : outParam (C → Type w)} →
        [inst_1 : outParam ((X Y : C) → FunLike (FC X Y) (CC X) (CC Y))] →
          [inst_2 : CategoryTheory.ConcreteCategory C FC] →
            (D : Type u_3) →
              [inst_3 : CategoryTheory.Category.{v_2, u_3} D] →
                {FD : outParam (D → D → Type u_4)} →
                  {CD : outParam (D → Type w)} →
                    [inst_4 : outParam ((X Y : D) → FunLike (FD X Y) (CD X) (CD Y))] →
                      [inst_5 : CategoryTheory.ConcreteCategory D FD] →
                        [CategoryTheory.HasForget₂ C D] → CategoryTheory.Functor C D

The forgetful functor C ⥤ D between concrete categories for which we have an instance HasForget₂ C.

theorem CategoryTheory.forget₂_comp_apply E0 #

∀ {C : Type u_1} [inst : CategoryTheory.Category.{v_1, u_1} C] {FC : outParam (C → C → Type u_2)}
  {CC : outParam (C → Type w)} [inst_1 : outParam ((X Y : C) → FunLike (FC X Y) (CC X) (CC Y))]
  [inst_2 : CategoryTheory.ConcreteCategory C FC] {D : Type u_3} [inst_3 : CategoryTheory.Category.{v_2, u_3} D]
  {FD : outParam (D → D → Type u_4)} {CD : outParam (D → Type w)}
  [inst_4 : outParam ((X Y : D) → FunLike (FD X Y) (CD X) (CD Y))] [inst_5 : CategoryTheory.ConcreteCategory D FD]
  [inst_6 : CategoryTheory.HasForget₂ C D] {X Y Z : C} (f : X ⟶ Y) (g : Y ⟶ Z)
  (x : CategoryTheory.ToType ((CategoryTheory.forget₂ C D).obj X)),
  (CategoryTheory.ConcreteCategory.hom ((CategoryTheory.forget₂ C D).map (CategoryTheory.CategoryStruct.comp f g))) x =
    (CategoryTheory.ConcreteCategory.hom ((CategoryTheory.forget₂ C D).map g))
      ((CategoryTheory.ConcreteCategory.hom ((CategoryTheory.forget₂ C D).map f)) x)

instance CategoryTheory.forget₂_faithful E0 #

∀ {C : Type u_1} [inst : CategoryTheory.Category.{v_1, u_1} C] {FC : outParam (C → C → Type u_2)}
  {CC : outParam (C → Type w)} [inst_1 : outParam ((X Y : C) → FunLike (FC X Y) (CC X) (CC Y))]
  [inst_2 : CategoryTheory.ConcreteCategory C FC] {D : Type u_3} [inst_3 : CategoryTheory.Category.{v_2, u_3} D]
  {FD : outParam (D → D → Type u_4)} {CD : outParam (D → Type w)}
  [inst_4 : outParam ((X Y : D) → FunLike (FD X Y) (CD X) (CD Y))] [inst_5 : CategoryTheory.ConcreteCategory D FD]
  [inst_6 : CategoryTheory.HasForget₂ C D], (CategoryTheory.forget₂ C D).Faithful

instance CategoryTheory.InducedCategory.hasForget₂ E0 #

{C : Type u_1} →
  {D : Type u_3} →
    [inst : CategoryTheory.Category.{v_2, u_3} D] →
      {FD : outParam (D → D → Type u_4)} →
        {CD : outParam (D → Type w)} →
          [inst_1 : outParam ((X Y : D) → FunLike (FD X Y) (CD X) (CD Y))] →
            [inst_2 : CategoryTheory.ConcreteCategory D FD] →
              (f : C → D) → CategoryTheory.HasForget₂ (CategoryTheory.InducedCategory D f) D

instance CategoryTheory.ObjectProperty.FullSubcategory.hasForget₂ E0 #

{C : Type u_1} →
  [inst : CategoryTheory.Category.{v_1, u_1} C] →
    {FC : outParam (C → C → Type u_2)} →
      {CC : outParam (C → Type w)} →
        [inst_1 : outParam ((X Y : C) → FunLike (FC X Y) (CC X) (CC Y))] →
          [inst_2 : CategoryTheory.ConcreteCategory C FC] →
            (P : CategoryTheory.ObjectProperty C) → CategoryTheory.HasForget₂ P.FullSubcategory C

def CategoryTheory.HasForget₂.mk' E1 #

{C : Type u_1} →
  [inst : CategoryTheory.Category.{v_1, u_1} C] →
    {FC : outParam (C → C → Type u_2)} →
      {CC : outParam (C → Type w)} →
        [inst_1 : outParam ((X Y : C) → FunLike (FC X Y) (CC X) (CC Y))] →
          [inst_2 : CategoryTheory.ConcreteCategory C FC] →
            {D : Type u_3} →
              [inst_3 : CategoryTheory.Category.{v_2, u_3} D] →
                {FD : outParam (D → D → Type u_4)} →
                  {CD : outParam (D → Type w)} →
                    [inst_4 : outParam ((X Y : D) → FunLike (FD X Y) (CD X) (CD Y))] →
                      [inst_5 : CategoryTheory.ConcreteCategory D FD] →
                        (obj : C → D) →
                          (∀ (X : C), (CategoryTheory.forget D).obj (obj X) = (CategoryTheory.forget C).obj X) →
                            (map : {X Y : C} → (X ⟶ Y) → (obj X ⟶ obj Y)) →
                              (∀ {X Y : C} {f : X ⟶ Y},
                                  (CategoryTheory.forget D).map (map f) ≍ (CategoryTheory.forget C).map f) →
                                CategoryTheory.HasForget₂ C D

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 CategoryTheory.HasForget₂.trans E1 #

(C : Type u_1) →
  [inst : CategoryTheory.Category.{v_1, u_1} C] →
    {FC : outParam (C → C → Type u_2)} →
      {CC : outParam (C → Type w)} →
        [inst_1 : outParam ((X Y : C) → FunLike (FC X Y) (CC X) (CC Y))] →
          [inst_2 : CategoryTheory.ConcreteCategory C FC] →
            (D : Type u_3) →
              [inst_3 : CategoryTheory.Category.{v_2, u_3} D] →
                {FD : outParam (D → D → Type u_4)} →
                  {CD : outParam (D → Type w)} →
                    [inst_4 : outParam ((X Y : D) → FunLike (FD X Y) (CD X) (CD Y))] →
                      [inst_5 : CategoryTheory.ConcreteCategory D FD] →
                        (E : Type u_5) →
                          [inst_6 : CategoryTheory.Category.{v_3, u_5} E] →
                            {FE : outParam (E → E → Type u_6)} →
                              {CE : outParam (E → Type w)} →
                                [inst_7 : outParam ((X Y : E) → FunLike (FE X Y) (CE X) (CE Y))] →
                                  [inst_8 : CategoryTheory.ConcreteCategory E FE] →
                                    [CategoryTheory.HasForget₂ C D] →
                                      [CategoryTheory.HasForget₂ D E] → CategoryTheory.HasForget₂ C E

Composition of HasForget₂ instances.

theorem CategoryTheory.ConcreteCategory.forget₂_comp_apply E0 #

∀ {C : Type u_1} [inst : CategoryTheory.Category.{v_1, u_1} C] {FC : outParam (C → C → Type u_2)}
  {CC : outParam (C → Type w)} [inst_1 : outParam ((X Y : C) → FunLike (FC X Y) (CC X) (CC Y))]
  [inst_2 : CategoryTheory.ConcreteCategory C FC] {D : Type u_3} [inst_3 : CategoryTheory.Category.{v_2, u_3} D]
  {FD : outParam (D → D → Type u_4)} {CD : outParam (D → Type w)}
  [inst_4 : outParam ((X Y : D) → FunLike (FD X Y) (CD X) (CD Y))] [inst_5 : CategoryTheory.ConcreteCategory D FD]
  [inst_6 : CategoryTheory.HasForget₂ C D] {X Y Z : C} (f : X ⟶ Y) (g : Y ⟶ Z)
  (x : CategoryTheory.ToType ((CategoryTheory.forget₂ C D).obj X)),
  (CategoryTheory.ConcreteCategory.hom ((CategoryTheory.forget₂ C D).map (CategoryTheory.CategoryStruct.comp f g))) x =
    (CategoryTheory.ConcreteCategory.hom ((CategoryTheory.forget₂ C D).map g))
      ((CategoryTheory.ConcreteCategory.hom ((CategoryTheory.forget₂ C D).map f)) x)

instance CategoryTheory.hom_isIso E0 #

∀ {C : Type u_1} [inst : CategoryTheory.Category.{v_1, u_1} C] {FC : outParam (C → C → Type u_2)}
  {CC : outParam (C → Type w)} [inst_1 : outParam ((X Y : C) → FunLike (FC X Y) (CC X) (CC Y))]
  [inst_2 : CategoryTheory.ConcreteCategory C FC] {X Y : C} (f : X ⟶ Y) [CategoryTheory.IsIso f],
  CategoryTheory.IsIso (TypeCat.ofHom ⇑(CategoryTheory.ConcreteCategory.hom f))