Skip to content

Commit

Permalink
chore(category_theory/closed): move one thing to monoidal closed and …
Browse files Browse the repository at this point in the history
…fix naming (#3090)

Move one of the CCC defs to MCC as an example, and make the naming consistent.
  • Loading branch information
b-mehta committed Jun 17, 2020
1 parent a19dca6 commit e40de30
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 10 deletions.
17 changes: 7 additions & 10 deletions src/category_theory/closed/cartesian.lean
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,9 @@ 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.
-/
def terminal_exponentiable {C : Type u} [category.{v} C] [has_finite_products.{v} C] : exponentiable ⊤_C :=
{ is_adj :=
{ right := 𝟭 C,
adj := adjunction.mk_of_hom_equiv
{ hom_equiv := λ X _, have unitor : _, from prod.left_unitor X,
⟨λ a, unitor.inv ≫ a, λ a, unitor.hom ≫ a, by tidy, by tidy⟩ } } }
def terminal_exponentiable {C : Type u} [category.{v} C] [has_finite_products.{v} C] :
exponentiable ⊤_C :=
unit_closed

/--
A category `C` is cartesian closed if it has finite products and every object is exponentiable.
Expand Down Expand Up @@ -99,7 +96,7 @@ def coev : 𝟭 C ⟶ prod_functor.obj A ⋙ exp A :=
closed.is_adj.adj.unit

notation A ` ⟹ `:20 B:20 := (exp A).obj B
notation A ` ^^ `:30 B:30 := (exp A).obj B
notation B ` ^^ `:30 A:30 := (exp A).obj B

@[simp, reassoc] lemma ev_coev : limits.prod.map (𝟙 A) ((coev A).app B) ≫ (ev A).app (A ⨯ B) = 𝟙 (A ⨯ B) :=
adjunction.left_triangle_components (exp.adjunction A)
Expand All @@ -112,7 +109,7 @@ end exp
variables {A}

-- Wrap these in a namespace so we don't clash with the core versions.
namespace is_cartesian_closed
namespace cartesian_closed

variables [has_finite_products.{v} C] [exponentiable A]

Expand All @@ -123,9 +120,9 @@ def curry : (A ⨯ Y ⟶ X) → (Y ⟶ A ⟹ X) :=
def uncurry : (Y ⟶ A ⟹ X) → (A ⨯ Y ⟶ X) :=
(closed.is_adj.adj.hom_equiv _ _).inv_fun

end is_cartesian_closed
end cartesian_closed

open is_cartesian_closed
open cartesian_closed

variables [has_finite_products.{v} C] [exponentiable A]

Expand Down
17 changes: 17 additions & 0 deletions src/category_theory/closed/monoidal.lean
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,21 @@ class monoidal_closed (C : Type u) [category.{v} C] [monoidal_category.{v} C] :=

attribute [instance, priority 100] monoidal_closed.closed

/--
The unit object is always closed.
This isn't an instance because most of the time we'll prove closedness for all objects at once,
rather than just for this one.
-/
def unit_closed {C : Type u} [category.{v} C] [monoidal_category.{v} C] : closed (𝟙_ C) :=
{ is_adj :=
{ right := 𝟭 C,
adj := adjunction.mk_of_hom_equiv
{ hom_equiv := λ X _,
{ to_fun := λ a, (left_unitor X).inv ≫ a,
inv_fun := λ a, (left_unitor X).hom ≫ a,
left_inv := by tidy,
right_inv := by tidy },
hom_equiv_naturality_left_symm' := λ X' X Y f g,
by { dsimp, rw left_unitor_naturality_assoc } } } }

end category_theory
3 changes: 3 additions & 0 deletions src/category_theory/monoidal/category.lean
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,11 @@ attribute [simp] monoidal_category.tensor_id
restate_axiom monoidal_category.tensor_comp'
attribute [simp] monoidal_category.tensor_comp
restate_axiom monoidal_category.associator_naturality'
attribute [reassoc] monoidal_category.associator_naturality
restate_axiom monoidal_category.left_unitor_naturality'
attribute [reassoc] monoidal_category.left_unitor_naturality
restate_axiom monoidal_category.right_unitor_naturality'
attribute [reassoc] monoidal_category.right_unitor_naturality
restate_axiom monoidal_category.pentagon'
restate_axiom monoidal_category.triangle'
attribute [simp] monoidal_category.triangle
Expand Down

0 comments on commit e40de30

Please sign in to comment.