# Documentation

Mathlib.CategoryTheory.Limits.Types

# Limits in the category of types. #

We show that the category of types has all (co)limits, by providing the usual concrete models.

We also give a characterisation of filtered colimits in Type, via colimit.ι F i xi = colimit.ι F j xj ↔ ∃ k (f : i ⟶ k) (g : j ⟶ k), F.map f xi = F.map g xj.

Finally, we prove the category of types has categorical images, and that these agree with the range of a function.

We now provide two distinct implementations in the category of types.

The first, in the CategoryTheory.Limits.Types.UnivLE namespace, assumes UnivLE.{v, u} and constructs v-small limits in Type u.

The second, in the CategoryTheory.Limits.Types.TypeMax namespace constructs limits for functors F : J ⥤ TypeMax.{v, u}, for J : Type v. This construction is slightly nicer, as the limit is definitionally just F.sections, rather than Shrink F.sections, which makes an arbitrary choice of u-small representative.

Hopefully we might be able to entirely remove the TypeMax constructions, but for now they are useful glue for the later parts of the library.

@[simp]
theorem CategoryTheory.Limits.Types.UnivLE.limitCone_π_app {J : Type v} (F : ) (j : J) (u : (().obj ()).obj j) :
J.app inst✝ (Type u) CategoryTheory.types (().obj ()) F j u = ↑(().symm u) j
noncomputable def CategoryTheory.Limits.Types.UnivLE.limitCone {J : Type v} (F : ) :

(internal implementation) the limit cone of a functor, implemented as flat sections of a pi type

Instances For
theorem CategoryTheory.Limits.Types.UnivLE.limitCone_pt_ext {J : Type v} (F : ) {x : } {y : } (w : ().symm x = ().symm y) :
x = y
@[simp]
theorem CategoryTheory.Limits.Types.UnivLE.limitConeIsLimit_lift {J : Type v} (F : ) (s : ) (v : s.pt) :
= ↑() { val := fun j => J.app inst✝ (Type u) CategoryTheory.types (().obj s.pt) F s j v, property := (_ : ∀ {j j' : J} (f : j j'), CategoryTheory.CategoryStruct.comp (Type u) CategoryTheory.Category.toCategoryStruct ((().obj s.pt).obj j) (F.obj j) (F.obj j') (s.app j) (F.map f) v = J.app inst✝ (Type u) CategoryTheory.types (().obj s.pt) F s j' v) }

(internal implementation) the fact that the proposed limit cone is the limit

Instances For
@[simp]
@[simp]
theorem CategoryTheory.Limits.Types.limitCone_π_app {J : Type v} (F : ) (j : J) (u : ().obj j) :
J.app inst✝ TypeMax CategoryTheory.types () F j u = u j
noncomputable def CategoryTheory.Limits.Types.limitCone {J : Type v} (F : ) :

(internal implementation) the limit cone of a functor, implemented as flat sections of a pi type

Instances For
@[simp]
theorem CategoryTheory.Limits.Types.limitConeIsLimit_lift_coe {J : Type v} (F : ) (s : ) (v : s.pt) (j : J) :
↑() j = J.app inst✝ TypeMax CategoryTheory.types (().obj s.pt) F s j v
noncomputable def CategoryTheory.Limits.Types.limitConeIsLimit {J : Type v} (F : ) :

(internal implementation) the fact that the proposed limit cone is the limit

Instances For

The results in this section have a UnivLE.{v, u} hypothesis, but as they only use the constructions from the CategoryTheory.Limits.Types.UnivLE namespace in their definitions (rather than their statements), we leave them in the main CategoryTheory.Limits.Types namespace.

noncomputable def CategoryTheory.Limits.Types.isLimitEquivSections {J : Type v} {F : } {c : } :
c.pt

The equivalence between a limiting cone of F in Type u and the "concrete" definition as the sections of F.

Instances For
@[simp]
theorem CategoryTheory.Limits.Types.isLimitEquivSections_apply {J : Type v} {F : } {c : } (j : J) (x : c.pt) :
= J.app inst✝ (Type u) CategoryTheory.types (().obj c.pt) F c j x
@[simp]
theorem CategoryTheory.Limits.Types.isLimitEquivSections_symm_apply {J : Type v} {F : } {c : } (x : ) (j : J) :
J.app inst✝ (Type u) CategoryTheory.types (().obj c.pt) F c j () = x j

The category of types has all limits.

More specifically, when UnivLE.{v, u}, the category Type u has all v-small limits.

noncomputable def CategoryTheory.Limits.Types.limitEquivSections {J : Type v} (F : ) :

The equivalence between the abstract limit of F in TypeMax.{v, u} and the "concrete" definition as the sections of F.

Instances For
@[simp]
theorem CategoryTheory.Limits.Types.limitEquivSections_apply {J : Type v} (F : ) (x : ) (j : J) :
=
noncomputable def CategoryTheory.Limits.Types.Limit.mk {J : Type v} (F : ) (x : (j : J) → F.obj j) (h : ∀ (j j' : J) (f : j j'), J.map CategoryTheory.CategoryStruct.toQuiver (Type u) CategoryTheory.CategoryStruct.toQuiver F.toPrefunctor j j' f (x j) = x j') :

Construct a term of limit F : Type u from a family of terms x : Π j, F.obj j which are "coherent": ∀ (j j') (f : j ⟶ j'), F.map f (x j) = x j'.

Instances For
@[simp]
theorem CategoryTheory.Limits.Types.Limit.π_mk {J : Type v} (F : ) (x : (j : J) → F.obj j) (h : ∀ (j j' : J) (f : j j'), J.map CategoryTheory.CategoryStruct.toQuiver (Type u) CategoryTheory.CategoryStruct.toQuiver F.toPrefunctor j j' f (x j) = x j') (j : J) :
= x j
theorem CategoryTheory.Limits.Types.limit_ext {J : Type v} (F : ) (x : ) (y : ) (w : ∀ (j : J), = ) :
x = y
theorem CategoryTheory.Limits.Types.limit_ext' {J : Type v} (F : ) (x : ) (y : ) (w : ∀ (j : J), = ) :
x = y
theorem CategoryTheory.Limits.Types.limit_ext_iff {J : Type v} (F : ) (x : ) (y : ) :
x = y ∀ (j : J), =
theorem CategoryTheory.Limits.Types.limit_ext_iff' {J : Type v} (F : ) (x : ) (y : ) :
x = y ∀ (j : J), =
theorem CategoryTheory.Limits.Types.Limit.w_apply {J : Type v} {F : } {j : J} {j' : J} {x : } (f : j j') :
J.map CategoryTheory.CategoryStruct.toQuiver (Type u) CategoryTheory.CategoryStruct.toQuiver F.toPrefunctor j j' f () = CategoryTheory.Limits.limit.π J inst✝ (Type u) CategoryTheory.types F j' x
theorem CategoryTheory.Limits.Types.Limit.lift_π_apply {J : Type v} (F : ) (s : ) (j : J) (x : s.pt) :
CategoryTheory.Limits.limit.π J inst✝ (Type u) CategoryTheory.types F j () = J.app inst✝ (Type u) CategoryTheory.types (().obj s.pt) F s j x
theorem CategoryTheory.Limits.Types.Limit.map_π_apply {J : Type v} {F : } {G : } (α : F G) (j : J) (x : ) :
= J.app inst✝ (Type u) CategoryTheory.types F G α j ()
@[simp]
theorem CategoryTheory.Limits.Types.Limit.w_apply' {J : Type v} {F : } {j : J} {j' : J} {x : } (f : j j') :
J.map CategoryTheory.CategoryStruct.toQuiver (Type v) CategoryTheory.CategoryStruct.toQuiver F.toPrefunctor j j' f () = CategoryTheory.Limits.limit.π J inst✝ (Type v) CategoryTheory.types F j' x
@[simp]
theorem CategoryTheory.Limits.Types.Limit.lift_π_apply' {J : Type v} (F : ) (s : ) (j : J) (x : s.pt) :
CategoryTheory.Limits.limit.π J inst✝ (Type v) CategoryTheory.types F j () = J.app inst✝ (Type v) CategoryTheory.types (().obj s.pt) F s j x
@[simp]
theorem CategoryTheory.Limits.Types.Limit.map_π_apply' {J : Type v} {F : } {G : } (α : F G) (j : J) (x : ) :
= J.app inst✝ (Type v) CategoryTheory.types F G α j ()

In this section we verify that instances are available as expected.

def CategoryTheory.Limits.Types.Quot.Rel {J : Type v} (F : ) :
(j : J) × F.obj j(j : J) × F.obj jProp

The relation defining the quotient type which implements the colimit of a functor F : J ⥤ Type u. See CategoryTheory.Limits.Types.Quot.

Instances For

A quotient type implementing the colimit of a functor F : J ⥤ Type u, as pairs ⟨j, x⟩ where x : F.obj j, modulo the equivalence relation generated by ⟨j, x⟩ ~ ⟨j', x'⟩ whenever there is a morphism f : j ⟶ j' so F.map f x = x'.

Instances For

(internal implementation) the colimit cocone of a functor, implemented as a quotient of a sigma type

Instances For

(internal implementation) the fact that the proposed colimit cocone is the colimit

Instances For

The category of types has all colimits.

noncomputable def CategoryTheory.Limits.Types.colimitEquivQuot {J : Type v} (F : ) :

The equivalence between the abstract colimit of F in Type u and the "concrete" definition as a quotient.

Instances For
@[simp]
theorem CategoryTheory.Limits.Types.colimitEquivQuot_symm_apply {J : Type v} (F : ) (j : J) (x : F.obj j) :
(Quot.mk () { fst := j, snd := x }) =
@[simp]
theorem CategoryTheory.Limits.Types.colimitEquivQuot_apply {J : Type v} (F : ) (j : J) (x : F.obj j) :
↑() () = Quot.mk () { fst := j, snd := x }
theorem CategoryTheory.Limits.Types.Colimit.w_apply {J : Type v} {F : } {j : J} {j' : J} {x : F.obj j} (f : j j') :
CategoryTheory.Limits.colimit.ι J inst✝ TypeMax CategoryTheory.types F j' (J.map CategoryTheory.CategoryStruct.toQuiver TypeMax CategoryTheory.CategoryStruct.toQuiver F.toPrefunctor j j' f x) =
theorem CategoryTheory.Limits.Types.Colimit.ι_desc_apply {J : Type v} (F : ) (s : ) (j : J) (x : F.obj j) :
CategoryTheory.Limits.colimit.desc J inst✝ TypeMax CategoryTheory.types F s () = J.app inst✝ TypeMax CategoryTheory.types F (().obj s.pt) s j x
theorem CategoryTheory.Limits.Types.Colimit.ι_map_apply {J : Type v} {F : } {G : } (α : F G) (j : J) (x : F.obj j) :
CategoryTheory.Limits.colim.map α () = CategoryTheory.Limits.colimit.ι J inst✝ TypeMax CategoryTheory.types G j (J.app inst✝ TypeMax CategoryTheory.types F G α j x)
@[simp]
theorem CategoryTheory.Limits.Types.Colimit.w_apply' {J : Type v} {F : } {j : J} {j' : J} {x : F.obj j} (f : j j') :
CategoryTheory.Limits.colimit.ι J inst✝ (Type v) CategoryTheory.types F j' (J.map CategoryTheory.CategoryStruct.toQuiver (Type v) CategoryTheory.CategoryStruct.toQuiver F.toPrefunctor j j' f x) =
@[simp]
theorem CategoryTheory.Limits.Types.Colimit.ι_desc_apply' {J : Type v} (F : ) (s : ) (j : J) (x : F.obj j) :
CategoryTheory.Limits.colimit.desc J inst✝ (Type v) CategoryTheory.types F s () = J.app inst✝ (Type v) CategoryTheory.types F (().obj s.pt) s j x
@[simp]
theorem CategoryTheory.Limits.Types.Colimit.ι_map_apply' {J : Type v} {F : } {G : } (α : F G) (j : J) (x : F.obj j) :
CategoryTheory.Limits.colim.map α () = CategoryTheory.Limits.colimit.ι J inst✝ (Type v) CategoryTheory.types G j (J.app inst✝ (Type v) CategoryTheory.types F G α j x)
theorem CategoryTheory.Limits.Types.colimit_sound {J : Type v} {F : } {j : J} {j' : J} {x : F.obj j} {x' : F.obj j'} (f : j j') (w : J.map CategoryTheory.CategoryStruct.toQuiver TypeMax CategoryTheory.CategoryStruct.toQuiver F.toPrefunctor j j' f x = x') :
=
theorem CategoryTheory.Limits.Types.colimit_sound' {J : Type v} {F : } {j : J} {j' : J} {x : F.obj j} {x' : F.obj j'} {j'' : J} (f : j j'') (f' : j' j'') (w : J.map CategoryTheory.CategoryStruct.toQuiver TypeMax CategoryTheory.CategoryStruct.toQuiver F.toPrefunctor j j'' f x = J.map CategoryTheory.CategoryStruct.toQuiver TypeMax CategoryTheory.CategoryStruct.toQuiver F.toPrefunctor j' j'' f' x') :
=
theorem CategoryTheory.Limits.Types.colimit_eq {J : Type v} {F : } {j : J} {j' : J} {x : F.obj j} {x' : F.obj j'} (w : = ) :
EqvGen () { fst := j, snd := x } { fst := j', snd := x' }
theorem CategoryTheory.Limits.Types.jointly_surjective {J : Type v} (F : ) {t : } (x : t.pt) :
j y, J.app inst✝ TypeMax CategoryTheory.types F (().obj t.pt) t j y = x
theorem CategoryTheory.Limits.Types.jointly_surjective' {J : Type v} {F : } :
j y, = x

A variant of jointly_surjective for x : colimit F.

def CategoryTheory.Limits.Types.FilteredColimit.Rel {J : Type v} (F : ) (x : (j : J) × F.obj j) (y : (j : J) × F.obj j) :

An alternative relation on Σ j, F.obj j, which generates the same equivalence relation as we use to define the colimit in Type above, but that is more convenient when working with filtered colimits.

Elements in F.obj j and F.obj j' are equivalent if there is some k : J to the right where their images are equal.

Instances For
theorem CategoryTheory.Limits.Types.FilteredColimit.rel_of_quot_rel {J : Type v} (F : ) (x : (j : J) × F.obj j) (y : (j : J) × F.obj j) :
theorem CategoryTheory.Limits.Types.FilteredColimit.eqvGen_quot_rel_of_rel {J : Type v} (F : ) (x : (j : J) × F.obj j) (y : (j : J) × F.obj j) :
noncomputable def CategoryTheory.Limits.Types.FilteredColimit.isColimitOf {J : Type v} (F : ) (t : ) (hsurj : ∀ (x : t.pt), i xi, x = J.app inst✝ TypeMax CategoryTheory.types F (().obj t.pt) t i xi) (hinj : ∀ (i j : J) (xi : F.obj i) (xj : F.obj j), J.app inst✝ TypeMax CategoryTheory.types F (().obj t.pt) t i xi = J.app inst✝ TypeMax CategoryTheory.types F (().obj t.pt) t j xjk f g, J.map CategoryTheory.CategoryStruct.toQuiver TypeMax CategoryTheory.CategoryStruct.toQuiver F.toPrefunctor i k f xi = J.map CategoryTheory.CategoryStruct.toQuiver TypeMax CategoryTheory.CategoryStruct.toQuiver F.toPrefunctor j k g xj) :

Recognizing filtered colimits of types.

Instances For
theorem CategoryTheory.Limits.Types.FilteredColimit.colimit_eq_iff_aux {J : Type v} (F : ) {i : J} {j : J} {xi : F.obj i} {xj : F.obj j} :
J.app inst✝ TypeMax CategoryTheory.types F () i xi = J.app inst✝ TypeMax CategoryTheory.types F () j xj CategoryTheory.Limits.Types.FilteredColimit.Rel F { fst := i, snd := xi } { fst := j, snd := xj }
theorem CategoryTheory.Limits.Types.FilteredColimit.isColimit_eq_iff {J : Type v} (F : ) {t : } (ht : ) {i : J} {j : J} {xi : F.obj i} {xj : F.obj j} :
J.app inst✝ TypeMax CategoryTheory.types F (().obj t.pt) t i xi = J.app inst✝ TypeMax CategoryTheory.types F (().obj t.pt) t j xj k f g, J.map CategoryTheory.CategoryStruct.toQuiver TypeMax CategoryTheory.CategoryStruct.toQuiver F.toPrefunctor i k f xi = J.map CategoryTheory.CategoryStruct.toQuiver TypeMax CategoryTheory.CategoryStruct.toQuiver F.toPrefunctor j k g xj
theorem CategoryTheory.Limits.Types.FilteredColimit.colimit_eq_iff {J : Type v} (F : ) {i : J} {j : J} {xi : F.obj i} {xj : F.obj j} :
= k f g, J.map CategoryTheory.CategoryStruct.toQuiver TypeMax CategoryTheory.CategoryStruct.toQuiver F.toPrefunctor i k f xi = J.map CategoryTheory.CategoryStruct.toQuiver TypeMax CategoryTheory.CategoryStruct.toQuiver F.toPrefunctor j k g xj
def CategoryTheory.Limits.Types.Image {α : Type u} {β : Type u} (f : α β) :

the image of a morphism in Type is just Set.range f

Instances For
instance CategoryTheory.Limits.Types.instInhabitedImage {α : Type u} {β : Type u} (f : α β) [] :
def CategoryTheory.Limits.Types.Image.ι {α : Type u} {β : Type u} (f : α β) :

the inclusion of Image f into the target

Instances For
noncomputable def CategoryTheory.Limits.Types.Image.lift {α : Type u} {β : Type u} {f : α β} :

the universal property for the image factorisation

Instances For
theorem CategoryTheory.Limits.Types.Image.lift_fac {α : Type u} {β : Type u} {f : α β} :
def CategoryTheory.Limits.Types.monoFactorisation {α : Type u} {β : Type u} (f : α β) :

the factorisation of any morphism in Type through a mono.

Instances For
noncomputable def CategoryTheory.Limits.Types.isImage {α : Type u} {β : Type u} (f : α β) :

the factorisation through a mono has the universal property of the image.

Instances For
instance CategoryTheory.Limits.Types.instHasImageTypeTypes {α : Type u} {β : Type u} (f : α β) :