Skip to content

Commit

Permalink
feat(category_theory/closed): currying rfl lemmas (#6754)
Browse files Browse the repository at this point in the history
Add `rfl` lemmas for currying
  • Loading branch information
b-mehta committed Mar 20, 2021
1 parent b0150a5 commit 56e5aa7
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/category_theory/closed/cartesian.lean
Expand Up @@ -92,11 +92,11 @@ closed.is_adj.adj

/-- The evaluation natural transformation. -/
def ev : exp A ⋙ prod.functor.obj A ⟶ 𝟭 C :=
closed.is_adj.adj.counit
(exp.adjunction A).counit

/-- The coevaluation natural transformation. -/
def coev : 𝟭 C ⟶ prod.functor.obj A ⋙ exp A :=
closed.is_adj.adj.unit
(exp.adjunction A).unit

@[simp] lemma exp_adjunction_counit : (exp.adjunction A).counit = ev A := rfl
@[simp] lemma exp_adjunction_unit : (exp.adjunction A).unit = coev A := rfl
Expand Down Expand Up @@ -135,10 +135,15 @@ variables [has_finite_products C] [exponentiable A]

/-- Currying in a cartesian closed category. -/
def curry : (A ⨯ Y ⟶ X) → (Y ⟶ A ⟹ X) :=
(closed.is_adj.adj.hom_equiv _ _).to_fun
(exp.adjunction A).hom_equiv _ _
/-- Uncurrying in a cartesian closed category. -/
def uncurry : (Y ⟶ A ⟹ X) → (A ⨯ Y ⟶ X) :=
(closed.is_adj.adj.hom_equiv _ _).inv_fun
((exp.adjunction A).hom_equiv _ _).symm

@[simp] lemma hom_equiv_apply_eq (f : A ⨯ Y ⟶ X) :
(exp.adjunction A).hom_equiv _ _ f = curry f := rfl
@[simp] lemma hom_equiv_symm_apply_eq (f : Y ⟶ A ⟹ X) :
((exp.adjunction A).hom_equiv _ _).symm f = uncurry f := rfl

end cartesian_closed

Expand Down

0 comments on commit 56e5aa7

Please sign in to comment.