Documentation

Mathlib.CategoryTheory.Subobject.Basic

Subobjects #

We define Subobject X as the quotient (by isomorphisms) of MonoOver X := {f : Over X // Mono f.hom}.

Here MonoOver X is a thin category (a pair of objects has at most one morphism between them), so we can think of it as a preorder. However as it is not skeletal, it is not a partial order.

There is a coercion from Subobject X back to the ambient category C (using choice to pick a representative), and for P : Subobject X, P.arrow : (P : C) ⟶ X is the inclusion morphism.

We provide

The subobjects of X form a preorder making them into a category. We have X ≤ Y if and only if X.arrow factors through Y.arrow: see ofLE/ofLEMk/ofMkLE/ofMkLEMk and le_of_comm. Similarly, to show that two subobjects are equal, we can supply an isomorphism between the underlying objects that commutes with the arrows (eq_of_comm).

See also

Notes #

This development originally appeared in Bhavik Mehta's "Topos theory for Lean" repository, and was ported to mathlib by Kim Morrison.

Implementation note #

Currently we describe pullback, map, etc., as functors. It may be better to just say that they are monotone functions, and even avoid using categorical language entirely when describing Subobject X. (It's worth keeping this in mind in future use; it should be a relatively easy change here if it looks preferable.)

Relation to pseudoelements #

There is a separate development of pseudoelements in CategoryTheory.Abelian.Pseudoelements, as a quotient (but not by isomorphism) of Over X.

When a morphism f has an image, the image represents the same pseudoelement. In a category with images Pseudoelements X could be constructed as a quotient of MonoOver X. In fact, in an abelian category (I'm not sure in what generality beyond that), Pseudoelements X agrees with Subobject X, but we haven't developed this in mathlib yet.

We now construct the subobject lattice for X : C, as the quotient by isomorphisms of MonoOver X.

Since MonoOver X is a thin category, we use ThinSkeleton to take the quotient.

Essentially all the structure defined above on MonoOver X descends to Subobject X, with morphisms becoming inequalities, and isomorphisms becoming equations.

def CategoryTheory.Subobject {C : Type u₁} [CategoryTheory.Category.{v₁, u₁} C] (X : C) :
Type (max u₁ v₁)

The category of subobjects of X : C, defined as isomorphism classes of monomorphisms into X.

Equations
Instances For
    theorem CategoryTheory.Comma.ext {A : Type u₁} {inst✝ : CategoryTheory.Category.{v₁, u₁} A} {B : Type u₂} {inst✝¹ : CategoryTheory.Category.{v₂, u₂} B} {T : Type u₃} {inst✝² : CategoryTheory.Category.{v₃, u₃} T} {L : CategoryTheory.Functor A T} {R : CategoryTheory.Functor B T} {x y : CategoryTheory.Comma L R} (left : x.left = y.left) (right : x.right = y.right) (hom : HEq x.hom y.hom) :
    x = y
    def CategoryTheory.Subobject.lift {C : Type u₁} [CategoryTheory.Category.{v₁, u₁} C] {α : Sort u_1} {X : C} (F : A : C⦄ → (f : A X) → [inst : CategoryTheory.Mono f] → α) (h : ∀ ⦃A B : C⦄ (f : A X) (g : B X) [inst : CategoryTheory.Mono f] [inst_1 : CategoryTheory.Mono g] (i : A B), CategoryTheory.CategoryStruct.comp i.hom g = fF f = F g) :

    Declare a function on subobjects of X by specifying a function on monomorphisms with codomain X.

    Equations
    Instances For
      @[simp]
      theorem CategoryTheory.Subobject.lift_mk {C : Type u₁} [CategoryTheory.Category.{v₁, u₁} C] {α : Sort u_1} {X : C} (F : A : C⦄ → (f : A X) → [inst : CategoryTheory.Mono f] → α) {h : ∀ ⦃A B : C⦄ (f : A X) (g : B X) [inst : CategoryTheory.Mono f] [inst_1 : CategoryTheory.Mono g] (i : A B), CategoryTheory.CategoryStruct.comp i.hom g = fF f = F g} {A : C} (f : A X) [CategoryTheory.Mono f] :

      The category of subobjects is equivalent to the MonoOver category. It is more convenient to use the former due to the partial order instance, but oftentimes it is easier to define structures on the latter.

      Equations
      Instances For

        Use choice to pick a representative MonoOver X for each Subobject X.

        Equations
        Instances For
          noncomputable def CategoryTheory.Subobject.representativeIso {C : Type u₁} [CategoryTheory.Category.{v₁, u₁} C] {X : C} (A : CategoryTheory.MonoOver X) :
          CategoryTheory.Subobject.representative.obj ((CategoryTheory.toThinSkeleton (CategoryTheory.MonoOver X)).obj A) A

          Starting with A : MonoOver X, we can take its equivalence class in Subobject X then pick an arbitrary representative using representative.obj. This is isomorphic (in MonoOver X) to the original A.

          Equations
          Instances For

            Use choice to pick a representative underlying object in C for any Subobject X.

            Prefer to use the coercion P : C rather than explicitly writing underlying.obj P.

            Equations
            Instances For
              Equations
              • CategoryTheory.Subobject.instCoeOut = { coe := fun (Y : CategoryTheory.Subobject X) => CategoryTheory.Subobject.underlying.obj Y }
              noncomputable def CategoryTheory.Subobject.underlyingIso {C : Type u₁} [CategoryTheory.Category.{v₁, u₁} C] {X Y : C} (f : X Y) [CategoryTheory.Mono f] :
              CategoryTheory.Subobject.underlying.obj (CategoryTheory.Subobject.mk f) X

              If we construct a Subobject Y from an explicit f : X ⟶ Y with [Mono f], then pick an arbitrary choice of underlying object (Subobject.mk f : C) back in C, it is isomorphic (in C) to the original X.

              Equations
              • One or more equations did not get rendered due to their size.
              Instances For
                noncomputable def CategoryTheory.Subobject.arrow {C : Type u₁} [CategoryTheory.Category.{v₁, u₁} C] {X : C} (Y : CategoryTheory.Subobject X) :
                CategoryTheory.Subobject.underlying.obj Y X

                The morphism in C from the arbitrarily chosen underlying object to the ambient object.

                Equations
                • Y.arrow = (CategoryTheory.Subobject.representative.obj Y).obj.hom
                Instances For
                  @[simp]
                  theorem CategoryTheory.Subobject.representative_coe {C : Type u₁} [CategoryTheory.Category.{v₁, u₁} C] {X : C} (Y : CategoryTheory.Subobject X) :
                  (CategoryTheory.Subobject.representative.obj Y).obj.left = CategoryTheory.Subobject.underlying.obj Y
                  @[simp]
                  theorem CategoryTheory.Subobject.representative_arrow {C : Type u₁} [CategoryTheory.Category.{v₁, u₁} C] {X : C} (Y : CategoryTheory.Subobject X) :
                  (CategoryTheory.Subobject.representative.obj Y).arrow = Y.arrow
                  @[simp]
                  theorem CategoryTheory.Subobject.underlying_arrow {C : Type u₁} [CategoryTheory.Category.{v₁, u₁} C] {X : C} {Y Z : CategoryTheory.Subobject X} (f : Y Z) :
                  CategoryTheory.CategoryStruct.comp (CategoryTheory.Subobject.underlying.map f) Z.arrow = Y.arrow
                  @[simp]
                  theorem CategoryTheory.Subobject.underlying_arrow_assoc {C : Type u₁} [CategoryTheory.Category.{v₁, u₁} C] {X : C} {Y Z : CategoryTheory.Subobject X} (f : Y Z) {Z✝ : C} (h : X Z✝) :
                  CategoryTheory.CategoryStruct.comp (CategoryTheory.Subobject.underlying.map f) (CategoryTheory.CategoryStruct.comp Z.arrow h) = CategoryTheory.CategoryStruct.comp Y.arrow h
                  theorem CategoryTheory.Subobject.eq_of_comp_arrow_eq {C : Type u₁} [CategoryTheory.Category.{v₁, u₁} C] {X Y : C} {P : CategoryTheory.Subobject Y} {f g : X CategoryTheory.Subobject.underlying.obj P} (h : CategoryTheory.CategoryStruct.comp f P.arrow = CategoryTheory.CategoryStruct.comp g P.arrow) :
                  f = g

                  Two morphisms into a subobject are equal exactly if the morphisms into the ambient object are equal

                  theorem CategoryTheory.Subobject.le_of_comm {C : Type u₁} [CategoryTheory.Category.{v₁, u₁} C] {B : C} {X Y : CategoryTheory.Subobject B} (f : CategoryTheory.Subobject.underlying.obj X CategoryTheory.Subobject.underlying.obj Y) (w : CategoryTheory.CategoryStruct.comp f Y.arrow = X.arrow) :
                  X Y
                  theorem CategoryTheory.Subobject.le_mk_of_comm {C : Type u₁} [CategoryTheory.Category.{v₁, u₁} C] {B A : C} {X : CategoryTheory.Subobject B} {f : A B} [CategoryTheory.Mono f] (g : CategoryTheory.Subobject.underlying.obj X A) (w : CategoryTheory.CategoryStruct.comp g f = X.arrow) :
                  theorem CategoryTheory.Subobject.mk_le_of_comm {C : Type u₁} [CategoryTheory.Category.{v₁, u₁} C] {B A : C} {X : CategoryTheory.Subobject B} {f : A B} [CategoryTheory.Mono f] (g : A CategoryTheory.Subobject.underlying.obj X) (w : CategoryTheory.CategoryStruct.comp g X.arrow = f) :
                  theorem CategoryTheory.Subobject.eq_of_comm {C : Type u₁} [CategoryTheory.Category.{v₁, u₁} C] {B : C} {X Y : CategoryTheory.Subobject B} (f : CategoryTheory.Subobject.underlying.obj X CategoryTheory.Subobject.underlying.obj Y) (w : CategoryTheory.CategoryStruct.comp f.hom Y.arrow = X.arrow) :
                  X = Y

                  To show that two subobjects are equal, it suffices to exhibit an isomorphism commuting with the arrows.

                  theorem CategoryTheory.Subobject.eq_mk_of_comm {C : Type u₁} [CategoryTheory.Category.{v₁, u₁} C] {B A : C} {X : CategoryTheory.Subobject B} (f : A B) [CategoryTheory.Mono f] (i : CategoryTheory.Subobject.underlying.obj X A) (w : CategoryTheory.CategoryStruct.comp i.hom f = X.arrow) :

                  To show that two subobjects are equal, it suffices to exhibit an isomorphism commuting with the arrows.

                  theorem CategoryTheory.Subobject.mk_eq_of_comm {C : Type u₁} [CategoryTheory.Category.{v₁, u₁} C] {B A : C} {X : CategoryTheory.Subobject B} (f : A B) [CategoryTheory.Mono f] (i : A CategoryTheory.Subobject.underlying.obj X) (w : CategoryTheory.CategoryStruct.comp i.hom X.arrow = f) :

                  To show that two subobjects are equal, it suffices to exhibit an isomorphism commuting with the arrows.

                  To show that two subobjects are equal, it suffices to exhibit an isomorphism commuting with the arrows.

                  def CategoryTheory.Subobject.ofLE {C : Type u₁} [CategoryTheory.Category.{v₁, u₁} C] {B : C} (X Y : CategoryTheory.Subobject B) (h : X Y) :
                  CategoryTheory.Subobject.underlying.obj X CategoryTheory.Subobject.underlying.obj Y

                  An inequality of subobjects is witnessed by some morphism between the corresponding objects.

                  Equations
                  • X.ofLE Y h = CategoryTheory.Subobject.underlying.map h.hom
                  Instances For
                    Equations
                    • =
                    def CategoryTheory.Subobject.ofLEMk {C : Type u₁} [CategoryTheory.Category.{v₁, u₁} C] {B A : C} (X : CategoryTheory.Subobject B) (f : A B) [CategoryTheory.Mono f] (h : X CategoryTheory.Subobject.mk f) :
                    CategoryTheory.Subobject.underlying.obj X A

                    An inequality of subobjects is witnessed by some morphism between the corresponding objects.

                    Equations
                    Instances For
                      def CategoryTheory.Subobject.ofMkLE {C : Type u₁} [CategoryTheory.Category.{v₁, u₁} C] {B A : C} (f : A B) [CategoryTheory.Mono f] (X : CategoryTheory.Subobject B) (h : CategoryTheory.Subobject.mk f X) :
                      A CategoryTheory.Subobject.underlying.obj X

                      An inequality of subobjects is witnessed by some morphism between the corresponding objects.

                      Equations
                      Instances For

                        An inequality of subobjects is witnessed by some morphism between the corresponding objects.

                        Equations
                        • One or more equations did not get rendered due to their size.
                        Instances For
                          @[simp]
                          theorem CategoryTheory.Subobject.ofLE_comp_ofLE {C : Type u₁} [CategoryTheory.Category.{v₁, u₁} C] {B : C} (X Y Z : CategoryTheory.Subobject B) (h₁ : X Y) (h₂ : Y Z) :
                          CategoryTheory.CategoryStruct.comp (X.ofLE Y h₁) (Y.ofLE Z h₂) = X.ofLE Z
                          @[simp]
                          theorem CategoryTheory.Subobject.ofLE_comp_ofLE_assoc {C : Type u₁} [CategoryTheory.Category.{v₁, u₁} C] {B : C} (X Y Z : CategoryTheory.Subobject B) (h₁ : X Y) (h₂ : Y Z) {Z✝ : C} (h : CategoryTheory.Subobject.underlying.obj Z Z✝) :
                          @[simp]
                          theorem CategoryTheory.Subobject.ofLE_comp_ofLEMk {C : Type u₁} [CategoryTheory.Category.{v₁, u₁} C] {B A : C} (X Y : CategoryTheory.Subobject B) (f : A B) [CategoryTheory.Mono f] (h₁ : X Y) (h₂ : Y CategoryTheory.Subobject.mk f) :
                          CategoryTheory.CategoryStruct.comp (X.ofLE Y h₁) (Y.ofLEMk f h₂) = X.ofLEMk f
                          @[simp]
                          theorem CategoryTheory.Subobject.ofLE_refl {C : Type u₁} [CategoryTheory.Category.{v₁, u₁} C] {B : C} (X : CategoryTheory.Subobject B) :
                          X.ofLE X = CategoryTheory.CategoryStruct.id (CategoryTheory.Subobject.underlying.obj X)
                          def CategoryTheory.Subobject.isoOfEq {C : Type u₁} [CategoryTheory.Category.{v₁, u₁} C] {B : C} (X Y : CategoryTheory.Subobject B) (h : X = Y) :
                          CategoryTheory.Subobject.underlying.obj X CategoryTheory.Subobject.underlying.obj Y

                          An equality of subobjects gives an isomorphism of the corresponding objects. (One could use underlying.mapIso (eqToIso h)) here, but this is more readable.)

                          Equations
                          • X.isoOfEq Y h = { hom := X.ofLE Y , inv := Y.ofLE X , hom_inv_id := , inv_hom_id := }
                          Instances For
                            @[simp]
                            theorem CategoryTheory.Subobject.isoOfEq_hom {C : Type u₁} [CategoryTheory.Category.{v₁, u₁} C] {B : C} (X Y : CategoryTheory.Subobject B) (h : X = Y) :
                            (X.isoOfEq Y h).hom = X.ofLE Y
                            @[simp]
                            theorem CategoryTheory.Subobject.isoOfEq_inv {C : Type u₁} [CategoryTheory.Category.{v₁, u₁} C] {B : C} (X Y : CategoryTheory.Subobject B) (h : X = Y) :
                            (X.isoOfEq Y h).inv = Y.ofLE X
                            def CategoryTheory.Subobject.isoOfEqMk {C : Type u₁} [CategoryTheory.Category.{v₁, u₁} C] {B A : C} (X : CategoryTheory.Subobject B) (f : A B) [CategoryTheory.Mono f] (h : X = CategoryTheory.Subobject.mk f) :
                            CategoryTheory.Subobject.underlying.obj X A

                            An equality of subobjects gives an isomorphism of the corresponding objects.

                            Equations
                            Instances For
                              @[simp]
                              theorem CategoryTheory.Subobject.isoOfEqMk_hom {C : Type u₁} [CategoryTheory.Category.{v₁, u₁} C] {B A : C} (X : CategoryTheory.Subobject B) (f : A B) [CategoryTheory.Mono f] (h : X = CategoryTheory.Subobject.mk f) :
                              (X.isoOfEqMk f h).hom = X.ofLEMk f
                              def CategoryTheory.Subobject.isoOfMkEq {C : Type u₁} [CategoryTheory.Category.{v₁, u₁} C] {B A : C} (f : A B) [CategoryTheory.Mono f] (X : CategoryTheory.Subobject B) (h : CategoryTheory.Subobject.mk f = X) :
                              A CategoryTheory.Subobject.underlying.obj X

                              An equality of subobjects gives an isomorphism of the corresponding objects.

                              Equations
                              Instances For

                                An equality of subobjects gives an isomorphism of the corresponding objects.

                                Equations
                                Instances For

                                  Isomorphic functors become equal when lowered to Subobject. (It's not as evil as usual to talk about equality between functors because the categories are thin and skeletal.)

                                  An equivalence between MonoOver A and MonoOver B gives an equivalence between Subobject A and Subobject B.

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

                                    When C has pullbacks, a morphism f : X ⟶ Y induces a functor Subobject Y ⥤ Subobject X, by pulling back a monomorphism along f.

                                    Equations
                                    Instances For

                                      We can map subobjects of X to subobjects of Y by post-composition with a monomorphism f : X ⟶ Y.

                                      Equations
                                      Instances For

                                        In fact, there's a type level bijection between the subobjects of isomorphic objects, which preserves the order.

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

                                          The functor from subobjects of X to subobjects of Y given by sending the subobject S to its "image" under f, usually denoted $\exists_f$. For instance, when C is the category of types, viewing Subobject X as Set X this is just Set.image f.

                                          This functor is left adjoint to the pullback f functor (shown in existsPullbackAdj) provided both are defined, and generalises the map f functor, again provided it is defined.

                                          Equations
                                          Instances For