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
def pullback [HasPullbacks C] (f : X ⟶ Y) : Subobject Y ⥤ Subobject X
def map (f : X ⟶ Y) [Mono f] : Subobject X ⥤ Subobject Y
def «exists_» [HasImages C] (f : X ⟶ Y) : Subobject X ⥤ Subobject Y
and prove their basic properties and relationships. These are all easy consequences of the earlier development of the corresponding functors forMonoOver
.
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
CategoryTheory.Subobject.factorThru
: an API describing factorization of morphisms through subobjects.CategoryTheory.Subobject.lattice
: the lattice structures on subobjects.
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.
The category of subobjects of X : C
, defined as isomorphism classes of monomorphisms into X
.
Equations
Convenience constructor for a subobject.
Declare a function on subobjects of X
by specifying a function on monomorphisms with
codomain X
.
Equations
- CategoryTheory.Subobject.lift F h P = Quotient.liftOn' P (fun (m : CategoryTheory.MonoOver X) => F m.arrow) ⋯
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.
Use choice to pick a representative MonoOver X
for each Subobject X
.
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
.
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
- CategoryTheory.Subobject.instCoeOut = { coe := fun (Y : CategoryTheory.Subobject X) => CategoryTheory.Subobject.underlying.obj Y }
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.
The morphism in C
from the arbitrarily chosen underlying object to the ambient object.
Two morphisms into a subobject are equal exactly if the morphisms into the ambient object are equal
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.
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.
An inequality of subobjects is witnessed by some morphism between the corresponding objects.
Equations
- X.ofLE Y h = CategoryTheory.Subobject.underlying.map h.hom
An inequality of subobjects is witnessed by some morphism between the corresponding objects.
Equations
An inequality of subobjects is witnessed by some morphism between the corresponding objects.
Equations
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.
An equality of subobjects gives an isomorphism of the corresponding objects.
(One could use underlying.mapIso (eqToIso h))
here, but this is more readable.)
An equality of subobjects gives an isomorphism of the corresponding objects.
Equations
- X.isoOfEqMk f h = { hom := X.ofLEMk f ⋯, inv := CategoryTheory.Subobject.ofMkLE f X ⋯, hom_inv_id := ⋯, inv_hom_id := ⋯ }
An equality of subobjects gives an isomorphism of the corresponding objects.
Equations
- CategoryTheory.Subobject.isoOfMkEq f X h = { hom := CategoryTheory.Subobject.ofMkLE f X ⋯, inv := X.ofLEMk f ⋯, hom_inv_id := ⋯, inv_hom_id := ⋯ }
An equality of subobjects gives an isomorphism of the corresponding objects.
Equations
- CategoryTheory.Subobject.isoOfMkEqMk f g h = { hom := CategoryTheory.Subobject.ofMkLEMk f g ⋯, inv := CategoryTheory.Subobject.ofMkLEMk g f ⋯, hom_inv_id := ⋯, inv_hom_id := ⋯ }
Any functor MonoOver X ⥤ MonoOver Y
descends to a functor
Subobject X ⥤ Subobject Y
, because MonoOver Y
is thin.
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.)
A ternary version of Subobject.lower
.
An adjunction between MonoOver A
and MonoOver B
gives an adjunction
between Subobject A
and Subobject B
.
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.
When C
has pullbacks, a morphism f : X ⟶ Y
induces a functor Subobject Y ⥤ Subobject X
,
by pulling back a monomorphism along f
.
We can map subobjects of X
to subobjects of Y
by post-composition with a monomorphism f : X ⟶ Y
.
Isomorphic objects have equivalent subobject lattices.
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.
map f : Subobject X ⥤ Subobject Y
is
the left adjoint of pullback f : Subobject Y ⥤ Subobject X
.
The functor from subobjects of X
to subobjects of Y
given by
sending the subobject S
to its "image" under f
, usually denoted 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.
When f : X ⟶ Y
is a monomorphism, exists f
agrees with map f
.
exists f : Subobject X ⥤ Subobject Y
is
left adjoint to pullback f : Subobject Y ⥤ Subobject X
.