# Documentation

Mathlib.CategoryTheory.WithTerminal

# WithInitial and WithTerminal#

Given a category C, this file constructs two objects:

1. WithTerminal C, the category built from C by formally adjoining a terminal object.
2. WithInitial C, the category built from C by formally adjoining an initial object.

The terminal resp. initial object is WithTerminal.star resp. WithInitial.star, and the proofs that these are terminal resp. initial are in WithTerminal.star_terminal and WithInitial.star_initial.

The inclusion from C intro WithTerminal C resp. WithInitial C is denoted WithTerminal.incl resp. WithInitial.incl.

The relevant constructions needed for the universal properties of these constructions are:

1. lift, which lifts F : C ⥤ D to a functor from WithTerminal C resp. WithInitial C in the case where an object Z : D is provided satisfying some additional conditions.
2. inclLift shows that the composition of lift with incl is isomorphic to the functor which was lifted.
3. liftUnique provides the uniqueness property of lift.

In addition to this, we provide WithTerminal.map and WithInitial.map providing the functoriality of these constructions with respect to functors on the base categories.

• of: {C : Type u} →
• star: {C : Type u} →

Formally adjoin a terminal object to a category.

Instances For
inductive CategoryTheory.WithInitial (C : Type u) :
• of: {C : Type u} →
• star: {C : Type u} →

Formally adjoin an initial object to a category.

Instances For

Morphisms for WithTerminal C.

Instances For

Identity morphisms for WithTerminal C.

Instances For
def CategoryTheory.WithTerminal.comp {C : Type u} {X : } {Y : } {Z : } :

Composition of morphisms for WithTerminal C.

Instances For
def CategoryTheory.WithTerminal.down {C : Type u} {X : C} {Y : C} :
X Y

Helper function for typechecking.

Instances For
@[simp]
@[simp]
theorem CategoryTheory.WithTerminal.false_of_from_star {C : Type u} {X : C} (f : CategoryTheory.WithTerminal.star ) :

The inclusion from C into WithTerminal C.

Instances For
def CategoryTheory.WithTerminal.map {C : Type u} {D : Type u_1} [] (F : ) :

Map WithTerminal with respect to a functor F : C ⥤ D.

Instances For

WithTerminal.star is terminal.

Instances For
@[simp]
theorem CategoryTheory.WithTerminal.lift_obj {C : Type u} {D : Type u_1} [] {Z : D} (F : ) (M : (x : C) → F.obj x Z) (hM : ∀ (x y : C) (f : x y), CategoryTheory.CategoryStruct.comp (F.map f) (M y) = M x) (X : ) :
().obj X = match X with | => F.obj x | CategoryTheory.WithTerminal.star => Z
@[simp]
theorem CategoryTheory.WithTerminal.lift_map {C : Type u} {D : Type u_1} [] {Z : D} (F : ) (M : (x : C) → F.obj x Z) (hM : ∀ (x y : C) (f : x y), CategoryTheory.CategoryStruct.comp (F.map f) (M y) = M x) {X : } {Y : } (f : X Y) :
().map f = match X, Y, f with | , , f => F.map () | , CategoryTheory.WithTerminal.star, x_1 => M x | CategoryTheory.WithTerminal.star, CategoryTheory.WithTerminal.star, x =>
def CategoryTheory.WithTerminal.lift {C : Type u} {D : Type u_1} [] {Z : D} (F : ) (M : (x : C) → F.obj x Z) (hM : ∀ (x y : C) (f : x y), CategoryTheory.CategoryStruct.comp (F.map f) (M y) = M x) :

Lift a functor F : C ⥤ D to WithTerminal C ⥤ D.

Instances For
@[simp]
theorem CategoryTheory.WithTerminal.inclLift_hom_app {C : Type u} {D : Type u_1} [] {Z : D} (F : ) (M : (x : C) → F.obj x Z) (hM : ∀ (x y : C) (f : x y), CategoryTheory.CategoryStruct.comp (F.map f) (M y) = M x) (X : C) :
().hom.app X = CategoryTheory.CategoryStruct.id (match CategoryTheory.WithTerminal.incl.obj X with | => F.obj x | CategoryTheory.WithTerminal.star => Z)
@[simp]
theorem CategoryTheory.WithTerminal.inclLift_inv_app {C : Type u} {D : Type u_1} [] {Z : D} (F : ) (M : (x : C) → F.obj x Z) (hM : ∀ (x y : C) (f : x y), CategoryTheory.CategoryStruct.comp (F.map f) (M y) = M x) (X : C) :
().inv.app X = CategoryTheory.CategoryStruct.id (F.obj X)
def CategoryTheory.WithTerminal.inclLift {C : Type u} {D : Type u_1} [] {Z : D} (F : ) (M : (x : C) → F.obj x Z) (hM : ∀ (x y : C) (f : x y), CategoryTheory.CategoryStruct.comp (F.map f) (M y) = M x) :
CategoryTheory.Functor.comp CategoryTheory.WithTerminal.incl () F

The isomorphism between incl ⋙ lift F _ _ with F.

Instances For
@[simp]
theorem CategoryTheory.WithTerminal.liftStar_inv {C : Type u} {D : Type u_1} [] {Z : D} (F : ) (M : (x : C) → F.obj x Z) (hM : ∀ (x y : C) (f : x y), CategoryTheory.CategoryStruct.comp (F.map f) (M y) = M x) :
@[simp]
theorem CategoryTheory.WithTerminal.liftStar_hom {C : Type u} {D : Type u_1} [] {Z : D} (F : ) (M : (x : C) → F.obj x Z) (hM : ∀ (x y : C) (f : x y), CategoryTheory.CategoryStruct.comp (F.map f) (M y) = M x) :
def CategoryTheory.WithTerminal.liftStar {C : Type u} {D : Type u_1} [] {Z : D} (F : ) (M : (x : C) → F.obj x Z) (hM : ∀ (x y : C) (f : x y), CategoryTheory.CategoryStruct.comp (F.map f) (M y) = M x) :
().obj CategoryTheory.WithTerminal.star Z

The isomorphism between (lift F _ _).obj WithTerminal.star with Z.

Instances For
theorem CategoryTheory.WithTerminal.lift_map_liftStar {C : Type u} {D : Type u_1} [] {Z : D} (F : ) (M : (x : C) → F.obj x Z) (hM : ∀ (x y : C) (f : x y), CategoryTheory.CategoryStruct.comp (F.map f) (M y) = M x) (x : C) :
CategoryTheory.CategoryStruct.comp (().map (CategoryTheory.Limits.IsTerminal.from CategoryTheory.WithTerminal.starTerminal (CategoryTheory.WithTerminal.incl.obj x))) ().hom = CategoryTheory.CategoryStruct.comp (().hom.app x) (M x)
def CategoryTheory.WithTerminal.liftUnique {C : Type u} {D : Type u_1} [] {Z : D} (F : ) (M : (x : C) → F.obj x Z) (hM : ∀ (x y : C) (f : x y), CategoryTheory.CategoryStruct.comp (F.map f) (M y) = M x) (h : CategoryTheory.Functor.comp CategoryTheory.WithTerminal.incl G F) (hG : G.obj CategoryTheory.WithTerminal.star Z) (hh : ∀ (x : C), CategoryTheory.CategoryStruct.comp (G.map (CategoryTheory.Limits.IsTerminal.from CategoryTheory.WithTerminal.starTerminal (CategoryTheory.WithTerminal.incl.obj x))) hG.hom = CategoryTheory.CategoryStruct.comp (h.hom.app x) (M x)) :

The uniqueness of lift.

Instances For
@[simp]
theorem CategoryTheory.WithTerminal.liftToTerminal_obj {C : Type u} {D : Type u_1} [] {Z : D} (F : ) (hZ : ) (X : ) :
().obj X = match X with | => F.obj x | CategoryTheory.WithTerminal.star => Z
@[simp]
theorem CategoryTheory.WithTerminal.liftToTerminal_map {C : Type u} {D : Type u_1} [] {Z : D} (F : ) (hZ : ) {X : } {Y : } (f : X Y) :
().map f = match X, Y, f with | , , f => F.map () | , CategoryTheory.WithTerminal.star, x_1 => CategoryTheory.Limits.IsTerminal.from hZ (F.obj x) | CategoryTheory.WithTerminal.star, CategoryTheory.WithTerminal.star, x =>
def CategoryTheory.WithTerminal.liftToTerminal {C : Type u} {D : Type u_1} [] {Z : D} (F : ) (hZ : ) :

A variant of lift with Z a terminal object.

Instances For
@[simp]
theorem CategoryTheory.WithTerminal.inclLiftToTerminal_inv_app {C : Type u} {D : Type u_1} [] {Z : D} (F : ) (hZ : ) (X : C) :
@[simp]
theorem CategoryTheory.WithTerminal.inclLiftToTerminal_hom_app {C : Type u} {D : Type u_1} [] {Z : D} (F : ) (hZ : ) (X : C) :
.app X = CategoryTheory.CategoryStruct.id (match CategoryTheory.WithTerminal.incl.obj X with | => F.obj x | CategoryTheory.WithTerminal.star => Z)
def CategoryTheory.WithTerminal.inclLiftToTerminal {C : Type u} {D : Type u_1} [] {Z : D} (F : ) (hZ : ) :
CategoryTheory.Functor.comp CategoryTheory.WithTerminal.incl () F

A variant of incl_lift with Z a terminal object.

Instances For
@[simp]
theorem CategoryTheory.WithTerminal.liftToTerminalUnique_hom_app {C : Type u} {D : Type u_1} [] {Z : D} (F : ) (hZ : ) (h : CategoryTheory.Functor.comp CategoryTheory.WithTerminal.incl G F) (hG : G.obj CategoryTheory.WithTerminal.star Z) (X : ) :
().hom.app X = (match X with | => h.app x | CategoryTheory.WithTerminal.star => hG).hom
@[simp]
theorem CategoryTheory.WithTerminal.liftToTerminalUnique_inv_app {C : Type u} {D : Type u_1} [] {Z : D} (F : ) (hZ : ) (h : CategoryTheory.Functor.comp CategoryTheory.WithTerminal.incl G F) (hG : G.obj CategoryTheory.WithTerminal.star Z) (X : ) :
().inv.app X = (match X with | => h.app x | CategoryTheory.WithTerminal.star => hG).inv
def CategoryTheory.WithTerminal.liftToTerminalUnique {C : Type u} {D : Type u_1} [] {Z : D} (F : ) (hZ : ) (h : CategoryTheory.Functor.comp CategoryTheory.WithTerminal.incl G F) (hG : G.obj CategoryTheory.WithTerminal.star Z) :

A variant of lift_unique with Z a terminal object.

Instances For
def CategoryTheory.WithTerminal.homFrom {C : Type u} (X : C) :
CategoryTheory.WithTerminal.incl.obj X CategoryTheory.WithTerminal.star

Constructs a morphism to star from of X.

Instances For
instance CategoryTheory.WithTerminal.isIso_of_from_star {C : Type u} {X : } (f : CategoryTheory.WithTerminal.star X) :

Morphisms for WithInitial C.

Instances For
def CategoryTheory.WithInitial.id {C : Type u} (X : ) :

Identity morphisms for WithInitial C.

Instances For
def CategoryTheory.WithInitial.comp {C : Type u} {X : } {Y : } {Z : } :

Composition of morphisms for WithInitial C.

Instances For
def CategoryTheory.WithInitial.down {C : Type u} {X : C} {Y : C} :
X Y

Helper function for typechecking.

Instances For
@[simp]
@[simp]
theorem CategoryTheory.WithInitial.down_comp {C : Type u} {X : C} {Y : C} {Z : C} :
theorem CategoryTheory.WithInitial.false_of_to_star {C : Type u} {X : C} (f : CategoryTheory.WithInitial.star) :

The inclusion of C into WithInitial C.

Instances For
def CategoryTheory.WithInitial.map {C : Type u} {D : Type u_1} [] (F : ) :

Map WithInitial with respect to a functor F : C ⥤ D.

Instances For

WithInitial.star is initial.

Instances For
@[simp]
theorem CategoryTheory.WithInitial.lift_map {C : Type u} {D : Type u_1} [] {Z : D} (F : ) (M : (x : C) → Z F.obj x) (hM : ∀ (x y : C) (f : x y), CategoryTheory.CategoryStruct.comp (M x) (F.map f) = M y) {X : } {Y : } (f : X Y) :
().map f = match X, Y, f with | , , f => F.map () | CategoryTheory.WithInitial.star, , x_1 => M x | CategoryTheory.WithInitial.star, CategoryTheory.WithInitial.star, x => CategoryTheory.CategoryStruct.id ((fun X => match X with | => F.obj x | CategoryTheory.WithInitial.star => Z) CategoryTheory.WithInitial.star)
@[simp]
theorem CategoryTheory.WithInitial.lift_obj {C : Type u} {D : Type u_1} [] {Z : D} (F : ) (M : (x : C) → Z F.obj x) (hM : ∀ (x y : C) (f : x y), CategoryTheory.CategoryStruct.comp (M x) (F.map f) = M y) (X : ) :
().obj X = match X with | => F.obj x | CategoryTheory.WithInitial.star => Z
def CategoryTheory.WithInitial.lift {C : Type u} {D : Type u_1} [] {Z : D} (F : ) (M : (x : C) → Z F.obj x) (hM : ∀ (x y : C) (f : x y), CategoryTheory.CategoryStruct.comp (M x) (F.map f) = M y) :

Lift a functor F : C ⥤ D to WithInitial C ⥤ D.

Instances For
@[simp]
theorem CategoryTheory.WithInitial.inclLift_inv_app {C : Type u} {D : Type u_1} [] {Z : D} (F : ) (M : (x : C) → Z F.obj x) (hM : ∀ (x y : C) (f : x y), CategoryTheory.CategoryStruct.comp (M x) (F.map f) = M y) (X : C) :
().inv.app X = CategoryTheory.CategoryStruct.id (F.obj X)
@[simp]
theorem CategoryTheory.WithInitial.inclLift_hom_app {C : Type u} {D : Type u_1} [] {Z : D} (F : ) (M : (x : C) → Z F.obj x) (hM : ∀ (x y : C) (f : x y), CategoryTheory.CategoryStruct.comp (M x) (F.map f) = M y) (X : C) :
().hom.app X = CategoryTheory.CategoryStruct.id (match CategoryTheory.WithInitial.incl.obj X with | => F.obj x | CategoryTheory.WithInitial.star => Z)
def CategoryTheory.WithInitial.inclLift {C : Type u} {D : Type u_1} [] {Z : D} (F : ) (M : (x : C) → Z F.obj x) (hM : ∀ (x y : C) (f : x y), CategoryTheory.CategoryStruct.comp (M x) (F.map f) = M y) :
CategoryTheory.Functor.comp CategoryTheory.WithInitial.incl () F

The isomorphism between incl ⋙ lift F _ _ with F.

Instances For
@[simp]
theorem CategoryTheory.WithInitial.liftStar_inv {C : Type u} {D : Type u_1} [] {Z : D} (F : ) (M : (x : C) → Z F.obj x) (hM : ∀ (x y : C) (f : x y), CategoryTheory.CategoryStruct.comp (M x) (F.map f) = M y) :
@[simp]
theorem CategoryTheory.WithInitial.liftStar_hom {C : Type u} {D : Type u_1} [] {Z : D} (F : ) (M : (x : C) → Z F.obj x) (hM : ∀ (x y : C) (f : x y), CategoryTheory.CategoryStruct.comp (M x) (F.map f) = M y) :
def CategoryTheory.WithInitial.liftStar {C : Type u} {D : Type u_1} [] {Z : D} (F : ) (M : (x : C) → Z F.obj x) (hM : ∀ (x y : C) (f : x y), CategoryTheory.CategoryStruct.comp (M x) (F.map f) = M y) :
().obj CategoryTheory.WithInitial.star Z

The isomorphism between (lift F _ _).obj WithInitial.star with Z.

Instances For
theorem CategoryTheory.WithInitial.liftStar_lift_map {C : Type u} {D : Type u_1} [] {Z : D} (F : ) (M : (x : C) → Z F.obj x) (hM : ∀ (x y : C) (f : x y), CategoryTheory.CategoryStruct.comp (M x) (F.map f) = M y) (x : C) :
CategoryTheory.CategoryStruct.comp ().hom (().map (CategoryTheory.Limits.IsInitial.to CategoryTheory.WithInitial.starInitial (CategoryTheory.WithInitial.incl.obj x))) = CategoryTheory.CategoryStruct.comp (M x) (().hom.app x)
def CategoryTheory.WithInitial.liftUnique {C : Type u} {D : Type u_1} [] {Z : D} (F : ) (M : (x : C) → Z F.obj x) (hM : ∀ (x y : C) (f : x y), CategoryTheory.CategoryStruct.comp (M x) (F.map f) = M y) (G : ) (h : CategoryTheory.Functor.comp CategoryTheory.WithInitial.incl G F) (hG : G.obj CategoryTheory.WithInitial.star Z) (hh : ∀ (x : C), CategoryTheory.CategoryStruct.comp hG.symm.hom (G.map (CategoryTheory.Limits.IsInitial.to CategoryTheory.WithInitial.starInitial (CategoryTheory.WithInitial.incl.obj x))) = CategoryTheory.CategoryStruct.comp (M x) (h.symm.hom.app x)) :
G

The uniqueness of lift.

Instances For
@[simp]
theorem CategoryTheory.WithInitial.liftToInitial_obj {C : Type u} {D : Type u_1} [] {Z : D} (F : ) (hZ : ) (X : ) :
().obj X = match X with | => F.obj x | CategoryTheory.WithInitial.star => Z
@[simp]
theorem CategoryTheory.WithInitial.liftToInitial_map {C : Type u} {D : Type u_1} [] {Z : D} (F : ) (hZ : ) {X : } {Y : } (f : X Y) :
().map f = match X, Y, f with | , , f => F.map () | CategoryTheory.WithInitial.star, , x_1 => CategoryTheory.Limits.IsInitial.to hZ (F.obj x) | CategoryTheory.WithInitial.star, CategoryTheory.WithInitial.star, x =>
def CategoryTheory.WithInitial.liftToInitial {C : Type u} {D : Type u_1} [] {Z : D} (F : ) (hZ : ) :

A variant of lift with Z an initial object.

Instances For
@[simp]
theorem CategoryTheory.WithInitial.inclLiftToInitial_inv_app {C : Type u} {D : Type u_1} [] {Z : D} (F : ) (hZ : ) (X : C) :
().inv.app X = CategoryTheory.CategoryStruct.id (F.obj X)
@[simp]
theorem CategoryTheory.WithInitial.inclLiftToInitial_hom_app {C : Type u} {D : Type u_1} [] {Z : D} (F : ) (hZ : ) (X : C) :
().hom.app X = CategoryTheory.CategoryStruct.id (match CategoryTheory.WithInitial.incl.obj X with | => F.obj x | CategoryTheory.WithInitial.star => Z)
def CategoryTheory.WithInitial.inclLiftToInitial {C : Type u} {D : Type u_1} [] {Z : D} (F : ) (hZ : ) :
CategoryTheory.Functor.comp CategoryTheory.WithInitial.incl () F

A variant of incl_lift with Z an initial object.

Instances For
@[simp]
theorem CategoryTheory.WithInitial.liftToInitialUnique_hom_app {C : Type u} {D : Type u_1} [] {Z : D} (F : ) (hZ : ) (G : ) (h : CategoryTheory.Functor.comp CategoryTheory.WithInitial.incl G F) (hG : G.obj CategoryTheory.WithInitial.star Z) (X : ) :
().hom.app X = (match X with | => h.app x | CategoryTheory.WithInitial.star => hG).hom
@[simp]
theorem CategoryTheory.WithInitial.liftToInitialUnique_inv_app {C : Type u} {D : Type u_1} [] {Z : D} (F : ) (hZ : ) (G : ) (h : CategoryTheory.Functor.comp CategoryTheory.WithInitial.incl G F) (hG : G.obj CategoryTheory.WithInitial.star Z) (X : ) :
().inv.app X = (match X with | => h.app x | CategoryTheory.WithInitial.star => hG).inv
def CategoryTheory.WithInitial.liftToInitialUnique {C : Type u} {D : Type u_1} [] {Z : D} (F : ) (hZ : ) (G : ) (h : CategoryTheory.Functor.comp CategoryTheory.WithInitial.incl G F) (hG : G.obj CategoryTheory.WithInitial.star Z) :

A variant of lift_unique with Z an initial object.

Instances For
def CategoryTheory.WithInitial.homTo {C : Type u} (X : C) :
CategoryTheory.WithInitial.star CategoryTheory.WithInitial.incl.obj X

Constructs a morphism from star to of X.

Instances For
instance CategoryTheory.WithInitial.isIso_of_to_star {C : Type u} {X : } (f : X CategoryTheory.WithInitial.star) :