# Documentation

Mathlib.CategoryTheory.Closed.Cartesian

# 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.

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

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.

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.

Instances For
@[inline, reducible]
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.

Instances For

Constructor for CartesianClosed C.

Instances For
@[inline, reducible]
abbrev CategoryTheory.exp {C : Type u} (A : C) :

This is (-)^A.

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

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

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

The evaluation natural transformation.

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

The coevaluation natural transformation.

Instances For
Instances For
Instances For
theorem CategoryTheory.exp.ev_coev_assoc {C : Type u} (A : C) (B : C) {Z : C} (h : ().obj (A B) Z) :
@[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 : A().obj B Z) :
CategoryTheory.CategoryStruct.comp (().app (AB)) (CategoryTheory.CategoryStruct.comp (().map (().app B)) h) = h
@[simp]
theorem CategoryTheory.exp.coev_ev {C : Type u} (A : C) (B : C) :
CategoryTheory.CategoryStruct.comp (().app (AB)) (().map (().app B)) =
def CategoryTheory.CartesianClosed.curry {C : Type u} {A : C} {X : C} {Y : C} :
(A Y X) → (Y AX)

Currying in a cartesian closed category.

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.

Instances For
@[simp]
theorem CategoryTheory.CartesianClosed.homEquiv_apply_eq {C : Type u} {A : C} {X : C} {Y : C} (f : A Y X) :
@[simp]
theorem CategoryTheory.CartesianClosed.homEquiv_symm_apply_eq {C : Type u} {A : C} {X : C} {Y : C} (f : Y AX) :
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) :
= CategoryTheory.CategoryStruct.comp (().app Y) (().map g)
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.

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.

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

Pre-compose an internal hom with an external hom.

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.

Instances For
@[simp]
theorem CategoryTheory.zeroMul_inv {C : Type u} {A : C} {I : C} :
().inv =
@[simp]
theorem CategoryTheory.zeroMul_hom {C : Type u} {A : C} {I : C} :
().hom = CategoryTheory.Limits.prod.snd
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.

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.

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.

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.

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) :
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.

def CategoryTheory.cartesianClosedOfEquiv {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 prodComparison isomorphism.

Instances For