Documentation

Mathlib.CategoryTheory.Elements

The category of elements #

This file defines the category of elements, also known as (a special case of) the Grothendieck construction.

Given a functor F : C ⥤ Type, an object of F.Elements is a pair (X : C, x : F.obj X). A morphism (X, x) ⟶ (Y, y) is a morphism f : X ⟶ Y in C, so F.map f takes x to y.

Implementation notes #

This construction is equivalent to a special case of a comma construction, so this is mostly just a more convenient API. We prove the equivalence in CategoryTheory.CategoryOfElements.structuredArrowEquivalence.

References #

Tags #

category of elements, Grothendieck construction, comma category

The type of objects for the category of elements of a functor F : C ⥤ Type is a pair (X : C, x : F.obj X).

Equations
    Instances For
      @[reducible, inline]
      abbrev CategoryTheory.Functor.elementsMk {C : Type u} [Category.{v, u} C] (F : Functor C (Type w)) (X : C) (x : F.obj X) :

      Constructor for the type F.Elements when F is a functor to types.

      Equations
        Instances For
          theorem CategoryTheory.Functor.Elements.ext {C : Type u} [Category.{v, u} C] {F : Functor C (Type w)} (x y : F.Elements) (h₁ : x.fst = y.fst) (h₂ : F.map (eqToHom h₁) x.snd = y.snd) :
          x = y

          The category structure on F.Elements, for F : C ⥤ Type. A morphism (X, x) ⟶ (Y, y) is a morphism f : X ⟶ Y in C, so F.map f takes x to y.

          Equations

            Natural transformations are mapped to functors between category of elements

            Equations
              Instances For
                @[simp]
                theorem CategoryTheory.NatTrans.mapElements_obj {C : Type u} [Category.{v, u} C] {F G : Functor C (Type w)} (φ : F G) (x✝ : F.Elements) :
                (mapElements φ).obj x✝ = match x✝ with | X, x => X, φ.app X x
                @[simp]
                theorem CategoryTheory.NatTrans.mapElements_map_coe {C : Type u} [Category.{v, u} C] {F G : Functor C (Type w)} (φ : F G) {p q : F.Elements} (x✝ : p q) :
                ((mapElements φ).map x✝) = x✝

                The functor mapping functors C ⥤ Type w to their category of elements

                Equations
                  Instances For
                    def CategoryTheory.CategoryOfElements.homMk {C : Type u} [Category.{v, u} C] {F : Functor C (Type w)} (x y : F.Elements) (f : x.fst y.fst) (hf : F.map f x.snd = y.snd) :
                    x y

                    Constructor for morphisms in the category of elements of a functor to types.

                    Equations
                      Instances For
                        @[simp]
                        theorem CategoryTheory.CategoryOfElements.homMk_coe {C : Type u} [Category.{v, u} C] {F : Functor C (Type w)} (x y : F.Elements) (f : x.fst y.fst) (hf : F.map f x.snd = y.snd) :
                        (homMk x y f hf) = f
                        theorem CategoryTheory.CategoryOfElements.ext {C : Type u} [Category.{v, u} C] (F : Functor C (Type w)) {x y : F.Elements} (f g : x y) (w : f = g) :
                        f = g
                        theorem CategoryTheory.CategoryOfElements.ext_iff {C : Type u} [Category.{v, u} C] {F : Functor C (Type w)} {x y : F.Elements} {f g : x y} :
                        f = g f = g
                        @[simp]
                        theorem CategoryTheory.CategoryOfElements.comp_val {C : Type u} [Category.{v, u} C] {F : Functor C (Type w)} {p q r : F.Elements} {f : p q} {g : q r} :
                        @[simp]
                        theorem CategoryTheory.CategoryOfElements.map_snd {C : Type u} [Category.{v, u} C] {F : Functor C (Type w)} {p q : F.Elements} (f : p q) :
                        F.map (↑f) p.snd = q.snd
                        def CategoryTheory.CategoryOfElements.isoMk {C : Type u} [Category.{v, u} C] {F : Functor C (Type w)} (x y : F.Elements) (e : x.fst y.fst) (he : F.map e.hom x.snd = y.snd) :
                        x y

                        Constructor for isomorphisms in the category of elements of a functor to types.

                        Equations
                          Instances For
                            @[simp]
                            theorem CategoryTheory.CategoryOfElements.isoMk_hom {C : Type u} [Category.{v, u} C] {F : Functor C (Type w)} (x y : F.Elements) (e : x.fst y.fst) (he : F.map e.hom x.snd = y.snd) :
                            (isoMk x y e he).hom = homMk x y e.hom he
                            @[simp]
                            theorem CategoryTheory.CategoryOfElements.isoMk_inv {C : Type u} [Category.{v, u} C] {F : Functor C (Type w)} (x y : F.Elements) (e : x.fst y.fst) (he : F.map e.hom x.snd = y.snd) :
                            (isoMk x y e he).inv = homMk y x e.inv

                            The functor out of the category of elements which forgets the element.

                            Equations
                              Instances For
                                @[simp]
                                theorem CategoryTheory.CategoryOfElements.π_map {C : Type u} [Category.{v, u} C] (F : Functor C (Type w)) {X✝ Y✝ : F.Elements} (f : X✝ Y✝) :
                                (π F).map f = f
                                @[simp]
                                def CategoryTheory.CategoryOfElements.map {C : Type u} [Category.{v, u} C] {F₁ F₂ : Functor C (Type w)} (α : F₁ F₂) :

                                A natural transformation between functors induces a functor between the categories of elements.

                                Equations
                                  Instances For
                                    @[simp]
                                    theorem CategoryTheory.CategoryOfElements.map_map_coe {C : Type u} [Category.{v, u} C] {F₁ F₂ : Functor C (Type w)} (α : F₁ F₂) {t₁ t₂ : F₁.Elements} (k : t₁ t₂) :
                                    ((map α).map k) = k
                                    @[simp]
                                    theorem CategoryTheory.CategoryOfElements.map_obj_fst {C : Type u} [Category.{v, u} C] {F₁ F₂ : Functor C (Type w)} (α : F₁ F₂) (t : F₁.Elements) :
                                    ((map α).obj t).fst = t.fst
                                    @[simp]
                                    theorem CategoryTheory.CategoryOfElements.map_obj_snd {C : Type u} [Category.{v, u} C] {F₁ F₂ : Functor C (Type w)} (α : F₁ F₂) (t : F₁.Elements) :
                                    ((map α).obj t).snd = α.app t.fst t.snd
                                    @[simp]
                                    theorem CategoryTheory.CategoryOfElements.map_π {C : Type u} [Category.{v, u} C] {F₁ F₂ : Functor C (Type w)} (α : F₁ F₂) :
                                    (map α).comp (π F₂) = π F₁

                                    The forward direction of the equivalence F.Elements ≅ (*, F).

                                    Equations
                                      Instances For
                                        @[simp]
                                        theorem CategoryTheory.CategoryOfElements.toStructuredArrow_obj {C : Type u} [Category.{v, u} C] (F : Functor C (Type w)) (X : F.Elements) :
                                        (toStructuredArrow F).obj X = { left := { as := PUnit.unit }, right := X.fst, hom := fun (x : (Functor.fromPUnit PUnit.{w + 1}).obj { as := PUnit.unit }) => X.snd }

                                        The reverse direction of the equivalence F.Elements ≅ (*, F).

                                        Equations
                                          Instances For

                                            The equivalence between the category of elements F.Elements and the comma category (*, F).

                                            Equations
                                              Instances For

                                                The forward direction of the equivalence F.Elementsᵒᵖ ≅ (yoneda, F), given by CategoryTheory.yonedaEquiv.

                                                Equations
                                                  Instances For

                                                    The reverse direction of the equivalence F.Elementsᵒᵖ ≅ (yoneda, F), given by CategoryTheory.yonedaEquiv.

                                                    Equations
                                                      Instances For

                                                        The equivalence F.Elementsᵒᵖ ≅ (yoneda, F) given by yoneda lemma.

                                                        Equations
                                                          Instances For

                                                            The equivalence (-.Elements)ᵒᵖ ≅ (yoneda, -) of is actually a natural isomorphism of functors.

                                                            The equivalence F.elementsᵒᵖ ≌ (yoneda, F) is compatible with the forgetful functors.

                                                            Equations
                                                              Instances For

                                                                The equivalence F.elementsᵒᵖ ≌ (yoneda, F) is compatible with the forgetful functors.

                                                                Equations
                                                                  Instances For

                                                                    The initial object in the category of elements for a representable functor. In isInitial it is shown that this is initial.

                                                                    Equations
                                                                      Instances For

                                                                        Show that Elements.initial A is initial in the category of elements for the yoneda functor.

                                                                        Equations
                                                                          Instances For