# mathlibdocumentation

category_theory.closed.cartesian

# Cartesian closed categories

Given a category with finite products, the cartesian monoidal structure is provided by the local instance monoidal_of_has_finite_products.

We define exponentiable objects to be closed objects with respect to this monoidal structure, i.e. (X × -) is a left adjoint.

We say a category is cartesian closed if every object is exponentiable (equivalently, that the category equipped with the cartesian monoidal structure is closed monoidal).

Show that exponential forms a difunctor and define the exponential comparison morphisms.

## TODO

Some of the results here are true more generally for closed objects and for closed monoidal categories, and these could be generalised.

def category_theory.exponentiable {C : Type u} (X : C) :
Type (max u v)

An object X is exponentiable if (X × -) is a left adjoint. We define this as being closed in the cartesian monoidal structure.

def category_theory.binary_product_exponentiable {C : Type u} {X Y : C}  :

If X and Y are exponentiable then X ⨯ Y is. This isn't an instance because it's not usually how we want to construct exponentials, we'll usually prove all objects are exponential uniformly.

Equations

The terminal object is always exponentiable. This isn't an instance because most of the time we'll prove cartesian closed for all objects at once, rather than just for this one.

Equations
def category_theory.cartesian_closed (C : Type u)  :
Type (max u v)

A category C is cartesian closed if it has finite products and every object is exponentiable. We define this as monoidal_closed with respect to the cartesian monoidal structure.

Instances
def category_theory.exp {C : Type u} (A : C)  :
C C

This is (-)^A.

Equations

The adjunction between A ⨯ - and (-)^A.

Equations
def category_theory.ev {C : Type u} (A : C)  :

The evaluation natural transformation.

Equations
def category_theory.coev {C : Type u} (A : C)  :

The coevaluation natural transformation.

Equations
@[simp]
theorem category_theory.exp_adjunction_counit {C : Type u} (A : C)  :

@[simp]
theorem category_theory.exp_adjunction_unit {C : Type u} (A : C)  :

@[simp]
theorem category_theory.ev_naturality_assoc {C : Type u} (A : C) {X Y : C} (f : X Y) {X' : C} (f' : (𝟭 C).obj Y X') :
.map f) Y f' = X f f'

@[simp]
theorem category_theory.ev_naturality {C : Type u} (A : C) {X Y : C} (f : X Y) :
.map f) Y = X f

@[simp]
theorem category_theory.coev_naturality_assoc {C : Type u} (A : C) {X Y : C} (f : X Y) {X' : C} (f' : X') :
f Y f' = X f) f'

@[simp]
theorem category_theory.coev_naturality {C : Type u} (A : C) {X Y : C} (f : X Y) :
f Y = X f)

@[simp]
theorem category_theory.ev_coev_assoc {C : Type u} (A B : C) {X' : C} (f' : (𝟭 C).obj X') :
.app B) (A B) f' = f'

@[simp]
theorem category_theory.ev_coev {C : Type u} (A B : C)  :
.app B) (A B) = 𝟙 (A B)

@[simp]
theorem category_theory.coev_ev_assoc {C : Type u} (A B : C) {X' : C} (f' : ((𝟭 C).obj B) X') :
.obj B) .app B) f' = f'

@[simp]
theorem category_theory.coev_ev {C : Type u} (A B : C)  :
.obj B) .app B) = 𝟙 .obj B)

@[instance]

Equations
def category_theory.cartesian_closed.curry {C : Type u} {A X Y : C}  :
(A Y X)(Y X)

Currying in a cartesian closed category.

Equations
def category_theory.cartesian_closed.uncurry {C : Type u} {A X Y : C}  :
(Y X)(A Y X)

Uncurrying in a cartesian closed category.

Equations
theorem category_theory.curry_natural_left_assoc {C : Type u} {A X X' Y : C} (f : X X') (g : A X' Y) {X'_1 : C} (f' : Y X'_1) :

theorem category_theory.curry_natural_left {C : Type u} {A X X' Y : C} (f : X X') (g : A X' Y) :

theorem category_theory.curry_natural_right_assoc {C : Type u} {A X Y Y' : C} (f : A X Y) (g : Y Y') {X' : C} (f' : Y' X') :
=

theorem category_theory.curry_natural_right {C : Type u} {A X Y Y' : C} (f : A X Y) (g : Y Y') :

theorem category_theory.uncurry_natural_right_assoc {C : Type u} {A X Y Y' : C} (f : X Y) (g : Y Y') {X' : C} (f' : Y' X') :

theorem category_theory.uncurry_natural_right {C : Type u} {A X Y Y' : C} (f : X Y) (g : Y Y') :

theorem category_theory.uncurry_natural_left {C : Type u} {A X X' Y : C} (f : X X') (g : X' Y) :

theorem category_theory.uncurry_natural_left_assoc {C : Type u} {A X X' Y : C} (f : X X') (g : X' Y) {X'_1 : C} (f' : Y X'_1) :

@[simp]
theorem category_theory.uncurry_curry {C : Type u} {A X Y : C} (f : A X Y) :

@[simp]
theorem category_theory.curry_uncurry {C : Type u} {A X Y : C} (f : X Y) :

theorem category_theory.curry_eq_iff {C : Type u} {A X Y : C} (f : A Y X) (g : Y X) :

theorem category_theory.eq_curry_iff {C : Type u} {A X Y : C} (f : A Y X) (g : Y X) :

theorem category_theory.uncurry_eq {C : Type u} {A X Y : C} (g : Y X) :

theorem category_theory.curry_eq {C : Type u} {A X Y : C} (g : A Y X) :

theorem category_theory.uncurry_id_eq_ev {C : Type u} (A X : C)  :

def category_theory.exp_terminal_iso_self {C : Type u} {X : C}  :
.obj X X

Show that the exponential of the terminal object is isomorphic to itself, i.e. X^1 ≅ X.

The typeclass argument is explicit: any instance can be used.

Equations
• category_theory.exp_terminal_iso_self = X (λ (Y : C) (f : Y .obj X), (λ (Y : C) (f : Y X), category_theory.exp_terminal_iso_self._proof_5 category_theory.exp_terminal_iso_self._proof_6 category_theory.exp_terminal_iso_self._proof_7
def category_theory.internalize_hom {C : Type u} {A Y : C} (f : A Y) :

The internal element which points at the given morphism.

Equations
def category_theory.pre {C : Type u} {A B : C} (f : B A)  :

Pre-compose an internal hom with an external hom.

Equations
theorem category_theory.prod_map_pre_app_comp_ev {C : Type u} {A B : C} (f : B A) (X : C) :
.app X) X = (𝟙 .obj X)) X

theorem category_theory.uncurry_pre {C : Type u} {A B : C} (f : B A) (X : C) :

theorem category_theory.coev_app_comp_pre_app {C : Type u} {A B X : C} (f : B A)  :
X (A X) = X (𝟙 X))

@[simp]
theorem category_theory.pre_id {C : Type u} (A : C)  :

@[simp]
theorem category_theory.pre_map {C : Type u} {A₁ A₂ A₃ : C} (f : A₁ A₂) (g : A₂ A₃) :

def category_theory.internal_hom {C : Type u}  :

The internal hom functor given by the cartesian closed structure.

Equations
def category_theory.zero_mul {C : Type u} {A : C} {I : C}  :
A I I

If an initial object I exists in a CCC, then A ⨯ I ≅ I.

Equations
@[simp]
theorem category_theory.zero_mul_inv {C : Type u} {A : C} {I : C}  :
= t.to (A I)

@[simp]
theorem category_theory.zero_mul_hom {C : Type u} {A : C} {I : C}  :

def category_theory.mul_zero {C : Type u} {A : C} {I : C}  :
I A I

If an initial object 0 exists in a CCC, then 0 ⨯ A ≅ 0.

Equations
def category_theory.pow_zero {C : Type u} (B : C) {I : C}  :
B ⊤_C

If an initial object 0 exists in a CCC then 0^B ≅ 1 for any B.

Equations
def category_theory.prod_coprod_distrib {C : Type u} (X Y Z : C) :
Z X ⨿ (Z Y) Z (X ⨿ Y)

In a CCC with binary coproducts, the distribution morphism is an isomorphism.

Equations
def category_theory.strict_initial {C : Type u} {A : C} {I : C} (f : A I) :

If an initial object I exists in a CCC then it is a strict initial object, i.e. any morphism to I is an iso. This actually shows a slightly stronger version: any morphism to an initial object from an exponentiable object is an isomorphism.

Equations
@[instance]
def category_theory.to_initial_is_iso {C : Type u} {A : C} (f : A ⊥_C) :

Equations
theorem category_theory.initial_mono {C : Type u} {I : C} (B : C)  :

If an initial object 0 exists in a CCC then every morphism from it is monic.

@[instance]

def category_theory.cartesian_closed_of_equiv {C : Type u} {D : Type u₂} (e : C D)  :

Transport the property of being cartesian closed across an equivalence of categories.

Note we didn't require any coherence between the choice of finite products here, since we transport along the prod_comparison isomorphism.

Equations