# Cartesian closed categories #

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

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.

@[reducible, inline]
abbrev CategoryTheory.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.

Equations
Instances For
@[reducible, inline]
abbrev CategoryTheory.Exponentiable.mk {C : Type u} (X : C) (exp : ) (adj : ) :

Constructor for Exponentiable X which takes as an input an adjunction MonoidalCategory.tensorLeft X ⊣ exp for some functor exp : C ⥤ C.

Equations
Instances For
def CategoryTheory.binaryProductExponentiable {C : Type u} {X : C} {Y : C} (hX : ) (hY : ) :

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
Instances For

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
• CategoryTheory.terminalExponentiable = CategoryTheory.unitClosed
Instances For
@[reducible, inline]
abbrev CategoryTheory.CartesianClosed (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.

Equations
Instances For
def CategoryTheory.CartesianClosed.mk (C : Type u) (exp : (X : C) → ) :

Constructor for CartesianClosed C.

Equations
• = { closed := fun (X : C) => exp X }
Instances For
@[reducible, inline]
abbrev CategoryTheory.exp {C : Type u} (A : C) :

This is (-)^A.

Equations
Instances For
@[reducible, inline]
abbrev CategoryTheory.exp.adjunction {C : Type u} (A : C) :
CategoryTheory.Limits.prod.functor.obj A

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

Equations
Instances For
@[reducible, inline]
abbrev CategoryTheory.exp.ev {C : Type u} (A : C) :
.comp (CategoryTheory.Limits.prod.functor.obj A)

The evaluation natural transformation.

Equations
Instances For
@[reducible, inline]
abbrev CategoryTheory.exp.coev {C : Type u} (A : C) :
(CategoryTheory.Limits.prod.functor.obj A).comp

The coevaluation natural transformation.

Equations
Instances For

Morphisms obtained using an exponentiable object.

Equations
Instances For

Delaborator for Prefunctor.obj

Equations
• One or more equations did not get rendered due to their size.
Instances For

Morphisms from an exponentiable object.

Equations
• One or more equations did not get rendered due to their size.
Instances For
theorem CategoryTheory.exp.ev_coev_assoc {C : Type u} (A : C) (B : C) {Z : C} (h : A B Z) :
= h
@[simp]
theorem CategoryTheory.exp.ev_coev {C : Type u} (A : C) (B : C) :
theorem CategoryTheory.exp.coev_ev_assoc {C : Type u} (A : C) (B : C) {Z : C} (h : AB Z) :
theorem CategoryTheory.exp.coev_ev {C : Type u} (A : C) (B : C) :
CategoryTheory.CategoryStruct.comp (.app (AB)) (.map (.app B)) =
instance CategoryTheory.instPreservesColimitsObjFunctorFunctor {C : Type u} (A : C) :
CategoryTheory.Limits.PreservesColimits (CategoryTheory.Limits.prod.functor.obj A)
Equations
def CategoryTheory.CartesianClosed.curry {C : Type u} {A : C} {X : C} {Y : C} :
(A Y X)(Y AX)

Currying in a cartesian closed category.

Equations
• CategoryTheory.CartesianClosed.curry = (.homEquiv Y X)
Instances For
def CategoryTheory.CartesianClosed.uncurry {C : Type u} {A : C} {X : C} {Y : C} :
(Y AX)(A Y X)

Uncurrying in a cartesian closed category.

Equations
• CategoryTheory.CartesianClosed.uncurry = (.homEquiv Y X).symm
Instances For
@[simp]
theorem CategoryTheory.CartesianClosed.homEquiv_apply_eq {C : Type u} {A : C} {X : C} {Y : C} (f : A Y X) :
(.homEquiv Y X) f =
@[simp]
theorem CategoryTheory.CartesianClosed.homEquiv_symm_apply_eq {C : Type u} {A : C} {X : C} {Y : C} (f : Y AX) :
(.homEquiv Y X).symm f =
theorem CategoryTheory.CartesianClosed.curry_natural_left_assoc {C : Type u} {A : C} {X : C} {X' : C} {Y : C} (f : X X') (g : A X' Y) {Z : C} (h : AY Z) :
theorem CategoryTheory.CartesianClosed.curry_natural_left {C : Type u} {A : C} {X : C} {X' : C} {Y : C} (f : X X') (g : A X' Y) :
theorem CategoryTheory.CartesianClosed.curry_natural_right_assoc {C : Type u} {A : C} {X : C} {Y : C} {Y' : C} (f : A X Y) (g : Y Y') {Z : C} (h : AY' Z) :
theorem CategoryTheory.CartesianClosed.curry_natural_right {C : Type u} {A : C} {X : C} {Y : C} {Y' : C} (f : A X Y) (g : Y Y') :
theorem CategoryTheory.CartesianClosed.uncurry_natural_right_assoc {C : Type u} {A : C} {X : C} {Y : C} {Y' : C} (f : X AY) (g : Y Y') {Z : C} (h : Y' Z) :
theorem CategoryTheory.CartesianClosed.uncurry_natural_right {C : Type u} {A : C} {X : C} {Y : C} {Y' : C} (f : X AY) (g : Y Y') :
theorem CategoryTheory.CartesianClosed.uncurry_natural_left_assoc {C : Type u} {A : C} {X : C} {X' : C} {Y : C} (f : X X') (g : X' AY) {Z : C} (h : Y Z) :
theorem CategoryTheory.CartesianClosed.uncurry_natural_left {C : Type u} {A : C} {X : C} {X' : C} {Y : C} (f : X X') (g : X' AY) :
@[simp]
theorem CategoryTheory.CartesianClosed.uncurry_curry {C : Type u} {A : C} {X : C} {Y : C} (f : A X Y) :
@[simp]
theorem CategoryTheory.CartesianClosed.curry_uncurry {C : Type u} {A : C} {X : C} {Y : C} (f : X AY) :
theorem CategoryTheory.CartesianClosed.curry_eq_iff {C : Type u} {A : C} {X : C} {Y : C} (f : A Y X) (g : Y AX) :
theorem CategoryTheory.CartesianClosed.eq_curry_iff {C : Type u} {A : C} {X : C} {Y : C} (f : A Y X) (g : Y AX) :
theorem CategoryTheory.CartesianClosed.uncurry_eq {C : Type u} {A : C} {X : C} {Y : C} (g : Y AX) :
theorem CategoryTheory.CartesianClosed.curry_eq {C : Type u} {A : C} {X : C} {Y : C} (g : A Y X) :
theorem CategoryTheory.CartesianClosed.curry_injective {C : Type u} {A : C} {X : C} {Y : C} :
Function.Injective CategoryTheory.CartesianClosed.curry
theorem CategoryTheory.CartesianClosed.uncurry_injective {C : Type u} {A : C} {X : C} {Y : C} :
Function.Injective CategoryTheory.CartesianClosed.uncurry
def CategoryTheory.expTerminalIsoSelf {C : Type u} {X : C} :
(⊤_ C)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
• One or more equations did not get rendered due to their size.
Instances For
def CategoryTheory.internalizeHom {C : Type u} {A : C} {Y : C} (f : A Y) :
⊤_ C AY

The internal element which points at the given morphism.

Equations
Instances For
def CategoryTheory.pre {C : Type u} {A : C} {B : C} (f : B A) :

Pre-compose an internal hom with an external hom.

Equations
• = (CategoryTheory.Limits.prod.functor.map f)
Instances For
theorem CategoryTheory.prod_map_pre_app_comp_ev {C : Type u} {A : C} {B : C} (f : B A) (X : C) :
=
theorem CategoryTheory.uncurry_pre {C : Type u} {A : C} {B : C} (f : B A) (X : C) :
=
theorem CategoryTheory.coev_app_comp_pre_app {C : Type u} {A : C} {B : C} {X : C} (f : B A) :
@[simp]
@[simp]
theorem CategoryTheory.pre_map {C : Type u} {A₁ : C} {A₂ : C} {A₃ : C} (f : A₁ A₂) (g : A₂ A₃) :

The internal hom functor given by the cartesian closed structure.

Equations
Instances For
@[simp]
theorem CategoryTheory.zeroMul_hom {C : Type u} {A : C} {I : C} :
.hom = CategoryTheory.Limits.prod.snd
@[simp]
theorem CategoryTheory.zeroMul_inv {C : Type u} {A : C} {I : C} :
.inv = t.to (A I)
def CategoryTheory.zeroMul {C : Type u} {A : C} {I : C} :
A I I

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

Equations
• = { hom := CategoryTheory.Limits.prod.snd, inv := t.to (A I), hom_inv_id := , inv_hom_id := }
Instances For
def CategoryTheory.mulZero {C : Type u} {A : C} {I : C} :
I A I

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

Equations
Instances For
def CategoryTheory.powZero {C : Type u} (B : C) {I : C} :
IB ⊤_ C

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

Equations
• One or more equations did not get rendered due to their size.
Instances For
def CategoryTheory.prodCoprodDistrib {C : Type u} (X : C) (Y : C) (Z : C) :
(Z X) ⨿ Z Y Z X ⨿ Y

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

Equations
• One or more equations did not get rendered due to their size.
Instances For
theorem CategoryTheory.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.

instance CategoryTheory.to_initial_isIso {C : Type u} {A : C} (f : A ⊥_ C) :
Equations
• =
theorem CategoryTheory.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.

Equations
• =

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 prodComparison isomorphism.

Equations
Instances For