Subobjects #
THIS FILE IS SYNCHRONIZED WITH MATHLIB4. Any changes to this file require a corresponding PR to mathlib4.
We define subobject X
as the quotient (by isomorphisms) of
mono_over X := {f : over X // mono f.hom}
.
Here mono_over 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 [has_pullbacks C] (f : X ⟶ Y) : subobject Y ⥤ subobject X
def map (f : X ⟶ Y) [mono f] : subobject X ⥤ subobject Y
def «exists» [has_images 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 formono_over
.
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 of_le
/of_le_mk
/of_mk_le
/of_mk_le_mk
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
category_theory.subobject.factor_thru
: an API describing factorization of morphisms through subobjects.category_theory.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 Scott 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 category_theory.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 mono_over 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 mono_over X
.
Since mono_over X
is a thin category, we use thin_skeleton
to take the quotient.
Essentially all the structure defined above on mono_over 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
.
Instances for category_theory.subobject
- category_theory.subobject.partial_order
- category_theory.subobject.category
- category_theory.subobject.has_coe
- category_theory.small_subobject
- category_theory.subobject.order_top
- category_theory.subobject.inhabited
- category_theory.subobject.order_bot
- category_theory.subobject.semilattice_inf
- category_theory.subobject.semilattice_sup
- category_theory.subobject.bounded_order
- category_theory.subobject.lattice
- category_theory.subobject.complete_semilattice_Inf
- category_theory.subobject.complete_semilattice_Sup
- category_theory.subobject.complete_lattice
- category_theory.subobject.nontrivial
- category_theory.subobject.is_simple_order
Convenience constructor for a subobject.
Declare a function on subobjects of X
by specifying a function on monomorphisms with
codomain X
.
Equations
- category_theory.subobject.lift F h = λ (P : category_theory.subobject X), quotient.lift_on' P (λ (m : category_theory.mono_over X), F m.arrow) _
The category of subobjects is equivalent to the mono_over
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 mono_over X
for each subobject X
.
Starting with A : mono_over X
, we can take its equivalence class in subobject X
then pick an arbitrary representative using representative.obj
.
This is isomorphic (in mono_over 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
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
.
The morphism in C
from the arbitrarily chosen underlying object to the ambient object.
Instances for category_theory.subobject.arrow
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.of_le Y h = category_theory.subobject.underlying.map h.hom
Instances for category_theory.subobject.of_le
An inequality of subobjects is witnessed by some morphism between the corresponding objects.
Equations
- X.of_le_mk f h = X.of_le (category_theory.subobject.mk f) h ≫ (category_theory.subobject.underlying_iso f).hom
Instances for category_theory.subobject.of_le_mk
An inequality of subobjects is witnessed by some morphism between the corresponding objects.
Equations
Instances for category_theory.subobject.of_mk_le
An inequality of subobjects is witnessed by some morphism between the corresponding objects.
Equations
Instances for category_theory.subobject.of_mk_le_mk
An equality of subobjects gives an isomorphism of the corresponding objects.
(One could use underlying.map_iso (eq_to_iso h))
here, but this is more readable.)
Equations
- X.iso_of_eq Y h = {hom := X.of_le Y _, inv := Y.of_le X _, hom_inv_id' := _, inv_hom_id' := _}
An equality of subobjects gives an isomorphism of the corresponding objects.
Equations
- X.iso_of_eq_mk f h = {hom := X.of_le_mk f _, inv := category_theory.subobject.of_mk_le f X _, hom_inv_id' := _, inv_hom_id' := _}
An equality of subobjects gives an isomorphism of the corresponding objects.
Equations
- category_theory.subobject.iso_of_mk_eq f X h = {hom := category_theory.subobject.of_mk_le f X _, inv := X.of_le_mk f _, hom_inv_id' := _, inv_hom_id' := _}
An equality of subobjects gives an isomorphism of the corresponding objects.
Equations
- category_theory.subobject.iso_of_mk_eq_mk f g h = {hom := category_theory.subobject.of_mk_le_mk f g _, inv := category_theory.subobject.of_mk_le_mk g f _, hom_inv_id' := _, inv_hom_id' := _}
Any functor mono_over X ⥤ mono_over Y
descends to a functor
subobject X ⥤ subobject Y
, because mono_over 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 mono_over A
and mono_over B
gives an adjunction
between subobject A
and subobject B
.
An equivalence between mono_over A
and mono_over B
gives an equivalence
between subobject A
and subobject B
.
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 category_theory.subobject.pullback
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
- category_theory.subobject.map_iso_to_order_iso e = {to_equiv := {to_fun := (category_theory.subobject.map e.hom).obj, inv_fun := (category_theory.subobject.map e.inv).obj, left_inv := _, right_inv := _}, map_rel_iff' := _}
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 $\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 exists_pullback_adj
)
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
.