Existence of limits and colimits #
THIS FILE IS SYNCHRONIZED WITH MATHLIB4. Any changes to this file require a corresponding PR to mathlib4.
In category_theory.limits.is_limit
we defined is_limit c
,
the data showing that a cone c
is a limit cone.
The two main structures defined in this file are:
limit_cone F
, which consists of a choice of cone forF
and the fact it is a limit cone, andhas_limit F
, asserting the mere existence of some limit cone forF
.
has_limit
is a propositional typeclass
(it's important that it is a proposition merely asserting the existence of a limit,
as otherwise we would have non-defeq problems from incompatible instances).
While has_limit
only asserts the existence of a limit cone,
we happily use the axiom of choice in mathlib,
so there are convenience functions all depending on has_limit F
:
limit F : C
, producing some limit object (of course all such are isomorphic)limit.π F j : limit F ⟶ F.obj j
, the morphisms out of the limit,limit.lift F c : c.X ⟶ limit F
, the universal morphism from any otherc : cone F
, etc.
Key to using the has_limit
interface is that there is an @[ext]
lemma stating that
to check f = g
, for f g : Z ⟶ limit F
, it suffices to check f ≫ limit.π F j = g ≫ limit.π F j
for every j
.
This, combined with @[simp]
lemmas, makes it possible to prove many easy facts about limits using
automation (e.g. tidy
).
There are abbreviations has_limits_of_shape J C
and has_limits C
asserting the existence of classes of limits.
Later more are introduced, for finite limits, special shapes of limits, etc.
Ideally, many results about limits should be stated first in terms of is_limit
,
and then a result in terms of has_limit
derived from this.
At this point, however, this is far from uniformly achieved in mathlib ---
often statements are only written in terms of has_limit
.
Implementation #
At present we simply say everything twice, in order to handle both limits and colimits.
It would be highly desirable to have some automation support,
e.g. a @[dualize]
attribute that behaves similarly to @[to_additive]
.
References #
- cone : category_theory.limits.cone F
- is_limit : category_theory.limits.is_limit self.cone
limit_cone F
contains a cone over F
together with the information that it is a limit.
Instances for category_theory.limits.limit_cone
- category_theory.limits.limit_cone.has_sizeof_inst
- exists_limit : nonempty (category_theory.limits.limit_cone F)
has_limit F
represents the mere existence of a limit for F
.
Instances of this typeclass
- category_theory.limits.has_limit_of_has_limits_of_shape
- category_theory.limits.has_product_unique
- category_theory.limits.has_kernels.has_limit
- category_theory.limits.has_product_of_has_biproduct
- category_theory.limits.has_limit_equivalence_comp
- category_theory.limits.obj.has_limit
- category_theory.limits.has_pullback_of_comp_mono
- category_theory.limits.has_pullback_of_right_factors_mono
- category_theory.limits.has_pullback_of_left_factors_mono
- category_theory.limits.has_kernel_pair_of_mono
- category_theory.limits.has_equalizer_of_self
- category_theory.limits.has_equalizer_comp_mono
- category_theory.limits.has_kernel_comp_mono
- category_theory.limits.has_kernel_iso_comp
- category_theory.limits.biproduct.π.has_kernel
- category_theory.limits.biproduct.to_subtype.has_kernel
- category_theory.limits.has_binary_biproduct.has_limit_pair
- category_theory.limits.biprod.fst.has_kernel
- category_theory.limits.biprod.snd.has_kernel
Use the axiom of choice to extract explicit limit_cone F
from has_limit F
.
- has_limit : (∀ (F : J ⥤ C), category_theory.limits.has_limit F) . "apply_instance"
C
has limits of shape J
if there exists a limit for every functor F : J ⥤ C
.
Instances of this typeclass
- category_theory.limits.has_zero_object.has_terminal
- category_theory.limits.has_limits_of_shape_of_has_limits
- category_theory.limits.has_pullbacks_of_has_wide_pullbacks
- category_theory.limits.has_limits_of_shape_of_has_finite_limits
- category_theory.limits.has_binary_products_of_has_binary_biproducts
- category_theory.limits.has_terminal_op_of_has_initial
- category_theory.limits.has_limits_of_shape_wide_pullback_shape
- category_theory.limits.has_limits_of_shape_discrete
- has_limits_of_shape : (∀ (J : Type ?) [𝒥 : category_theory.category J], category_theory.limits.has_limits_of_shape J C) . "apply_instance"
C
has all limits of size v₁ u₁
(has_limits_of_size.{v₁ u₁} C
)
if it has limits of every shape J : Type u₁
with [category.{v₁} J]
.
Instances of this typeclass
C
has all (small) limits if it has limits of every shape that is as big as its hom-sets.
An arbitrary choice of limit cone for a functor.
Equations
An arbitrary choice of limit object of a functor.
Equations
The projection from the limit object to a value of the functor.
Equations
Instances for category_theory.limits.limit.π
- category_theory.limits.is_iso_π_initial
- category_theory.limits.is_iso_π_terminal
- category_theory.limits.pullback.fst_of_mono
- category_theory.limits.pullback.snd_of_mono
- category_theory.limits.pullback_snd_iso_of_left_iso
- category_theory.limits.pullback_snd_iso_of_right_factors_mono
- category_theory.limits.pullback_snd_iso_of_right_iso
- category_theory.limits.pullback_snd_iso_of_left_factors_mono
- category_theory.limits.fst_iso_of_mono_eq
- category_theory.limits.snd_iso_of_mono_eq
- category_theory.limits.equalizer.ι_mono
- category_theory.limits.equalizer.ι_of_self
- category_theory.limits.is_split_epi_pi_π
- category_theory.limits.is_split_epi_prod_fst
- category_theory.limits.is_split_epi_prod_snd
- category_theory.limits.kernel.ι_zero_is_iso
- category_theory.limits.kernel.of_cokernel_of_epi
Evidence that the arbitrary choice of cone provied by limit.cone F
is a limit cone.
The morphism from the cone point of any other cone to the limit object.
Equations
Functoriality of limits.
Usually this morphism should be accessed through lim.map
,
but may be needed separately when you have specified limits for the source and target functors,
but not necessarily for all functors of shape J
.
Equations
Instances for category_theory.limits.lim_map
The cone morphism from any cone to the arbitrary choice of limit cone.
Given any other limit cone for F
, the chosen limit F
is isomorphic to the cone point.
The isomorphism (in Type
) between
morphisms from a specified object W
to the limit object,
and cones with cone point W
.
Equations
The isomorphism (in Type
) between
morphisms from a specified object W
to the limit object,
and an explicit componentwise description of cones with cone point W
.
Equations
If a functor F
has a limit, so does any naturally isomorphic functor.
If a functor G
has the same collection of cones as a functor F
which has a limit, then G
also has a limit.
The limits of F : J ⥤ C
and G : J ⥤ C
are isomorphic,
if the functors are naturally isomorphic.
The limits of F : J ⥤ C
and G : K ⥤ C
are isomorphic,
if there is an equivalence e : J ≌ K
making the triangle commute up to natural isomorphism.
The canonical morphism from the limit of F
to the limit of E ⋙ F
.
- If we have particular limit cones available for
E ⋙ F
and forF
, we obtain a formula forlimit.pre F E
.
The canonical morphism from G
applied to the limit of F
to the limit of F ⋙ G
.
Equations
If a E ⋙ F
has a limit, and E
is an equivalence, we can construct a limit of F
.
limit F
is functorial in F
, when C
has all limits of shape J
.
Equations
- category_theory.limits.lim = {obj := λ (F : J ⥤ C), category_theory.limits.limit F, map := λ (F G : J ⥤ C) (α : F ⟶ G), category_theory.limits.lim_map α, map_id' := _, map_comp' := _}
Instances for category_theory.limits.lim
The isomorphism between
morphisms from W
to the cone point of the limit cone for F
and cones over F
with cone point W
is natural in F
.
Equations
- category_theory.limits.lim_yoneda = category_theory.nat_iso.of_components (λ (F : J ⥤ C), category_theory.nat_iso.of_components (λ (W : Cᵒᵖ), category_theory.limits.limit.hom_iso F (opposite.unop W)) _) category_theory.limits.lim_yoneda._proof_2
The constant functor and limit functor are adjoint to each other
Equations
- category_theory.limits.const_lim_adj = {hom_equiv := λ (c : C) (g : J ⥤ C), {to_fun := λ (f : (category_theory.functor.const J).obj c ⟶ g), category_theory.limits.limit.lift g {X := c, π := f}, inv_fun := λ (f : c ⟶ category_theory.limits.lim.obj g), {app := λ (j : J), f ≫ category_theory.limits.limit.π g j, naturality' := _}, left_inv := _, right_inv := _}, unit := {app := λ (c : C), category_theory.limits.limit.lift ((category_theory.functor.const J).obj ((λ (X : C), X) c)) {X := (λ (X : C), X) c, π := 𝟙 ((category_theory.functor.const J).obj ((λ (X : C), X) c))}, naturality' := _}, counit := {app := λ (g : J ⥤ C), {app := category_theory.limits.limit.π g _, naturality' := _}, naturality' := _}, hom_equiv_unit' := _, hom_equiv_counit' := _}
Equations
We can transport limits of shape J
along an equivalence J ≌ J'
.
has_limits_of_size_shrink.{v u} C
tries to obtain has_limits_of_size.{v u} C
from some other has_limits_of_size C
.
- cocone : category_theory.limits.cocone F
- is_colimit : category_theory.limits.is_colimit self.cocone
colimit_cocone F
contains a cocone over F
together with the information that it is a
colimit.
Instances for category_theory.limits.colimit_cocone
- category_theory.limits.colimit_cocone.has_sizeof_inst
- exists_colimit : nonempty (category_theory.limits.colimit_cocone F)
has_colimit F
represents the mere existence of a colimit for F
.
Instances of this typeclass
- category_theory.limits.has_colimit_of_has_colimits_of_shape
- category_theory.limits.has_coproduct_unique
- category_theory.limits.has_cokernels.has_colimit
- category_theory.limits.has_coproduct_of_has_biproduct
- category_theory.limits.has_colimit_equivalence_comp
- category_theory.limits.obj.has_colimit
- category_theory.limits.has_pushout_of_epi_comp
- category_theory.limits.has_pushout_of_right_factors_epi
- category_theory.limits.has_pushout_of_left_factors_epi
- category_theory.limits.has_cokernel_pair_of_epi
- category_theory.limits.has_coequalizer_of_self
- category_theory.limits.has_cokernel_comp_iso
- category_theory.limits.has_cokernel_epi_comp
- category_theory.limits.biproduct.ι.has_cokernel
- category_theory.limits.biproduct.from_subtype.has_cokernel
- category_theory.limits.has_binary_biproduct.has_colimit_pair
- category_theory.limits.biprod.inl.has_cokernel
- category_theory.limits.biprod.inr.has_cokernel
Use the axiom of choice to extract explicit colimit_cocone F
from has_colimit F
.
- has_colimit : (∀ (F : J ⥤ C), category_theory.limits.has_colimit F) . "apply_instance"
C
has colimits of shape J
if there exists a colimit for every functor F : J ⥤ C
.
Instances of this typeclass
- category_theory.limits.has_zero_object.has_initial
- category_theory.limits.has_colimits_of_shape_of_has_colimits_of_size
- category_theory.limits.has_colimits_of_shape_of_has_finite_colimits
- category_theory.limits.has_binary_coproducts_of_has_binary_biproducts
- category_theory.limits.has_initial_op_of_has_terminal
- category_theory.limits.has_colimits_of_shape_wide_pushout_shape
- category_theory.limits.has_colimits_of_shape_discrete
- has_colimits_of_shape : (∀ (J : Type ?) [𝒥 : category_theory.category J], category_theory.limits.has_colimits_of_shape J C) . "apply_instance"
C
has all colimits of size v₁ u₁
(has_colimits_of_size.{v₁ u₁} C
)
if it has colimits of every shape J : Type u₁
with [category.{v₁} J]
.
Instances of this typeclass
C
has all (small) colimits if it has colimits of every shape that is as big as its hom-sets.
An arbitrary choice of colimit cocone of a functor.
An arbitrary choice of colimit object of a functor.
Equations
The coprojection from a value of the functor to the colimit object.
Equations
Instances for category_theory.limits.colimit.ι
- category_theory.limits.is_iso_ι_terminal
- category_theory.limits.is_iso_ι_initial
- category_theory.limits.pushout.inl_of_epi
- category_theory.limits.pushout.inr_of_epi
- category_theory.limits.pushout_inr_iso_of_left_iso
- category_theory.limits.pushout_inr_iso_of_right_factors_epi
- category_theory.limits.pushout_inl_iso_of_right_iso
- category_theory.limits.pushout_inl_iso_of_left_factors_epi
- category_theory.limits.inl_iso_of_epi_eq
- category_theory.limits.inr_iso_of_epi_eq
- category_theory.limits.coequalizer.π_epi
- category_theory.limits.coequalizer.π_of_self
- category_theory.limits.is_split_mono_sigma_ι
- category_theory.limits.is_split_mono_coprod_inl
- category_theory.limits.is_split_mono_coprod_inr
- category_theory.limits.cokernel.π_zero_is_iso
- category_theory.limits.cokernel.of_kernel_of_mono
Evidence that the arbitrary choice of cocone is a colimit cocone.
The morphism from the colimit object to the cone point of any other cocone.
Equations
Instances for category_theory.limits.colimit.desc
We have lots of lemmas describing how to simplify colimit.ι F j ≫ _
,
and combined with colimit.ext
we rely on these lemmas for many calculations.
However, since category.assoc
is a @[simp]
lemma, often expressions are
right associated, and it's hard to apply these lemmas about colimit.ι
.
We thus use reassoc
to define additional @[simp]
lemmas, with an arbitrary extra morphism.
(see tactic/reassoc_axiom.lean
)
Functoriality of colimits.
Usually this morphism should be accessed through colim.map
,
but may be needed separately when you have specified colimits for the source and target functors,
but not necessarily for all functors of shape J
.
Equations
Instances for category_theory.limits.colim_map
The cocone morphism from the arbitrary choice of colimit cocone to any cocone.
Given any other colimit cocone for F
, the chosen colimit F
is isomorphic to the cocone point.
The isomorphism (in Type
) between
morphisms from the colimit object to a specified object W
,
and cocones with cone point W
.
Equations
The isomorphism (in Type
) between
morphisms from the colimit object to a specified object W
,
and an explicit componentwise description of cocones with cone point W
.
Equations
If F
has a colimit, so does any naturally isomorphic functor.
If a functor G
has the same collection of cocones as a functor F
which has a colimit, then G
also has a colimit.
The colimits of F : J ⥤ C
and G : J ⥤ C
are isomorphic,
if the functors are naturally isomorphic.
The colimits of F : J ⥤ C
and G : K ⥤ C
are isomorphic,
if there is an equivalence e : J ≌ K
making the triangle commute up to natural isomorphism.
The canonical morphism from the colimit of E ⋙ F
to the colimit of F
.
- If we have particular colimit cocones available for
E ⋙ F
and forF
, we obtain a formula forcolimit.pre F E
.
The canonical morphism from G
applied to the colimit of F ⋙ G
to G
applied to the colimit of F
.
Equations
If a E ⋙ F
has a colimit, and E
is an equivalence, we can construct a colimit of F
.
colimit F
is functorial in F
, when C
has all colimits of shape J
.
Equations
- category_theory.limits.colim = {obj := λ (F : J ⥤ C), category_theory.limits.colimit F, map := λ (F G : J ⥤ C) (α : F ⟶ G), category_theory.limits.colim_map α, map_id' := _, map_comp' := _}
Instances for category_theory.limits.colim
The isomorphism between
morphisms from the cone point of the colimit cocone for F
to W
and cocones over F
with cone point W
is natural in F
.
Equations
- category_theory.limits.colim_coyoneda = category_theory.nat_iso.of_components (λ (F : (J ⥤ C)ᵒᵖ), category_theory.nat_iso.of_components (category_theory.limits.colimit.hom_iso (opposite.unop F)) _) category_theory.limits.colim_coyoneda._proof_3
The colimit functor and constant functor are adjoint to each other
Equations
- category_theory.limits.colim_const_adj = {hom_equiv := λ (f : J ⥤ C) (c : C), {to_fun := λ (g : category_theory.limits.colim.obj f ⟶ c), {app := λ (_x : J), category_theory.limits.colimit.ι f _x ≫ g, naturality' := _}, inv_fun := λ (g : f ⟶ (category_theory.functor.const J).obj c), category_theory.limits.colimit.desc f {X := c, ι := g}, left_inv := _, right_inv := _}, unit := {app := λ (g : J ⥤ C), {app := category_theory.limits.colimit.ι ((𝟭 (J ⥤ C)).obj g) _, naturality' := _}, naturality' := _}, counit := {app := λ (c : C), category_theory.limits.colimit.desc ((category_theory.functor.const J).obj c) {X := c, ι := 𝟙 ((category_theory.functor.const J).obj c)}, naturality' := _}, hom_equiv_unit' := _, hom_equiv_counit' := _}
Equations
We can transport colimits of shape J
along an equivalence J ≌ J'
.
has_colimits_of_size_shrink.{v u} C
tries to obtain has_colimits_of_size.{v u} C
from some other has_colimits_of_size C
.
If t : cone F
is a limit cone, then t.op : cocone F.op
is a colimit cocone.
If t : cocone F
is a colimit cocone, then t.op : cone F.op
is a limit cone.
If t : cone F.op
is a limit cone, then t.unop : cocone F
is a colimit cocone.
If t : cocone F.op
is a colimit cocone, then t.unop : cone F.
is a limit cone.
t : cone F
is a limit cone if and only is t.op : cocone F.op
is a colimit cocone.
t : cocone F
is a colimit cocone if and only is t.op : cone F.op
is a limit cone.