Documentation

Mathlib.CategoryTheory.ConcreteCategory.Basic

Concrete categories #

A concrete category is a category C with a fixed faithful functor forget : C ⥤ Type*. We define concrete categories using class ConcreteCategory. In particular, we impose no restrictions on the carrier type C, so Type is a concrete category with the identity forgetful functor.

Each concrete category C comes with a canonical faithful functor forget C : C ⥤ Type*. 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'.

Two classes helping construct concrete categories in the two most common cases are provided in the files BundledHom and UnbundledHom, see their documentation for details.

References #

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

class CategoryTheory.ConcreteCategory (C : Type u) [CategoryTheory.Category.{v, u} C] :
Type (max (max u v) (w + 1))

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.
Instances
    @[reducible]

    The forgetful functor from a concrete category to Type u.

    Equations
    Instances For

      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
      
      Equations
      Instances For
        @[reducible]
        Equations
        • CategoryTheory.ConcreteCategory.instFunLike = { coe := fun (f : X Y) => (CategoryTheory.forget C).map f, coe_injective' := }
        Instances For
          theorem CategoryTheory.ConcreteCategory.hom_ext {C : Type u} [CategoryTheory.Category.{v, u} C] [CategoryTheory.ConcreteCategory C] {X : C} {Y : C} (f : X Y) (g : X Y) (w : ∀ (x : (CategoryTheory.forget C).obj X), f x = g x) :
          f = g

          In any concrete category, we can test equality of morphisms by pointwise evaluations.

          theorem CategoryTheory.congr_hom {C : Type u} [CategoryTheory.Category.{v, u} C] [CategoryTheory.ConcreteCategory C] {X : C} {Y : C} {f : X Y} {g : X Y} (h : f = g) (x : (CategoryTheory.forget C).obj X) :
          f x = g x

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

          theorem CategoryTheory.coe_comp {C : Type u} [CategoryTheory.Category.{v, u} C] [CategoryTheory.ConcreteCategory C] {X : C} {Y : C} {Z : C} (f : X Y) (g : Y Z) :
          @[simp]
          theorem CategoryTheory.comp_apply {C : Type u} [CategoryTheory.Category.{v, u} C] [CategoryTheory.ConcreteCategory C] {X : C} {Y : C} {Z : C} (f : X Y) (g : Y Z) (x : (CategoryTheory.forget C).obj X) :
          theorem CategoryTheory.ConcreteCategory.congr_hom {C : Type u} [CategoryTheory.Category.{v, u} C] [CategoryTheory.ConcreteCategory C] {X : C} {Y : C} {f : X Y} {g : X Y} (h : f = g) (x : (CategoryTheory.forget C).obj X) :
          f x = g x
          theorem CategoryTheory.ConcreteCategory.congr_arg {C : Type u} [CategoryTheory.Category.{v, u} C] [CategoryTheory.ConcreteCategory C] {X : C} {Y : C} (f : X Y) {x : (CategoryTheory.forget C).obj X} {x' : (CategoryTheory.forget C).obj X} (h : x = x') :
          f x = f x'

          In any concrete category, injective morphisms are monomorphisms.

          In any concrete category, surjective morphisms are epimorphisms.

          If the forgetful functor of a concrete category reflects isomorphisms, being an isomorphism is equivalent to being bijective.

          @[simp]

          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.

          Instances
            @[reducible]

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

            Equations
            Instances For
              def CategoryTheory.HasForget₂.mk' {C : Type u} {D : Type u'} [CategoryTheory.Category.{v, u} C] [CategoryTheory.ConcreteCategory C] [CategoryTheory.Category.{v', u'} D] [CategoryTheory.ConcreteCategory D] (obj : CD) (h_obj : ∀ (X : C), (CategoryTheory.forget D).obj (obj X) = (CategoryTheory.forget C).obj X) (map : {X Y : C} → (X Y)(obj X obj Y)) (h_map : ∀ {X Y : C} {f : X Y}, HEq ((CategoryTheory.forget D).map (map f)) ((CategoryTheory.forget C).map f)) :

              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.

              Equations
              • One or more equations did not get rendered due to their size.
              Instances For

                Every forgetful functor factors through the identity functor. This is not a global instance as it is prone to creating type class resolution loops.

                Equations
                Instances For