Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(AlgebraicTopology): the monoidal category structure on simplicia…
…l sets (#11396) If a category `C` has chosen finite products, then the functor category `J ⥤ C` also. In particular, the category of simplicial sets is endowed with the monoidal category given by the explicit terminal object and binary products. Simplifications lemmas have also been added in the context of categories with chosen finite products. For terminal objects in such categories, the terminal object is given as a limit cone of `Functor.empty.{0} C` rather than `Functor.empty.{v} C` so as to be consistent with the limits API for terminal objects. Co-authored-by: Jack McKoen <mckoen@ualberta.ca>
- Loading branch information
Showing
6 changed files
with
315 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
/- | ||
Copyright (c) 2024 Joël Riou. All rights reserved. | ||
Released under Apache 2.0 license as described in the file LICENSE. | ||
Authors: Joël Riou, Jack McKoen | ||
-/ | ||
import Mathlib.AlgebraicTopology.SimplicialSet | ||
import Mathlib.CategoryTheory.ChosenFiniteProducts.FunctorCategory | ||
import Mathlib.CategoryTheory.Monoidal.Types.Basic | ||
|
||
/-! | ||
# The monoidal category structure on simplicial sets | ||
This file defines an instance of chosen finite products | ||
for the category `SSet`. It follows from the fact | ||
the `SSet` if a category of functors to the category | ||
of types and that the category of types have chosen | ||
finite products. As a result, we obtain a monoidal | ||
category structure on `SSet`. | ||
-/ | ||
|
||
universe u | ||
|
||
open Simplicial CategoryTheory MonoidalCategory | ||
|
||
namespace SSet | ||
|
||
noncomputable instance : ChosenFiniteProducts SSet.{u} := | ||
(inferInstance : ChosenFiniteProducts (SimplexCategoryᵒᵖ ⥤ Type u)) | ||
|
||
@[simp] | ||
lemma leftUnitor_hom_app_apply (K : SSet.{u}) {Δ : SimplexCategoryᵒᵖ} (x : (𝟙_ _ ⊗ K).obj Δ) : | ||
(λ_ K).hom.app Δ x = x.2 := rfl | ||
|
||
@[simp] | ||
lemma leftUnitor_inv_app_apply (K : SSet.{u}) {Δ : SimplexCategoryᵒᵖ} (x : K.obj Δ) : | ||
(λ_ K).inv.app Δ x = ⟨PUnit.unit, x⟩ := rfl | ||
|
||
@[simp] | ||
lemma rightUnitor_hom_app_apply (K : SSet.{u}) {Δ : SimplexCategoryᵒᵖ} (x : (K ⊗ 𝟙_ _).obj Δ) : | ||
(ρ_ K).hom.app Δ x = x.1 := rfl | ||
|
||
@[simp] | ||
lemma rightUnitor_inv_app_apply (K : SSet.{u}) {Δ : SimplexCategoryᵒᵖ} (x : K.obj Δ) : | ||
(ρ_ K).inv.app Δ x = ⟨x, PUnit.unit⟩ := rfl | ||
|
||
@[simp] | ||
lemma tensorHom_app_apply {K K' L L' : SSet.{u}} (f : K ⟶ K') (g : L ⟶ L') | ||
{Δ : SimplexCategoryᵒᵖ} (x : (K ⊗ L).obj Δ) : | ||
(f ⊗ g).app Δ x = ⟨f.app Δ x.1, g.app Δ x.2⟩ := rfl | ||
|
||
@[simp] | ||
lemma whiskerLeft_app_apply (K : SSet.{u}) {L L' : SSet.{u}} (g : L ⟶ L') | ||
{Δ : SimplexCategoryᵒᵖ} (x : (K ⊗ L).obj Δ) : | ||
(K ◁ g).app Δ x = ⟨x.1, g.app Δ x.2⟩ := rfl | ||
|
||
@[simp] | ||
lemma whiskerRight_app_apply {K K' : SSet.{u}} (f : K ⟶ K') (L : SSet.{u}) | ||
{Δ : SimplexCategoryᵒᵖ} (x : (K ⊗ L).obj Δ) : | ||
(f ▷ L).app Δ x = ⟨f.app Δ x.1, x.2⟩ := rfl | ||
|
||
@[simp] | ||
lemma associator_hom_app_apply (K L M : SSet.{u}) {Δ : SimplexCategoryᵒᵖ} | ||
(x : ((K ⊗ L) ⊗ M).obj Δ) : | ||
(α_ K L M).hom.app Δ x = ⟨x.1.1, x.1.2, x.2⟩ := rfl | ||
|
||
@[simp] | ||
lemma associator_inv_app_apply (K L M : SSet.{u}) {Δ : SimplexCategoryᵒᵖ} | ||
(x : (K ⊗ L ⊗ M).obj Δ) : | ||
(α_ K L M).inv.app Δ x = ⟨⟨x.1, x.2.1⟩, x.2.2⟩ := rfl | ||
|
||
/-- The bijection `(𝟙_ SSet ⟶ K) ≃ K _[0]`. -/ | ||
def unitHomEquiv (K : SSet.{u}) : (𝟙_ _ ⟶ K) ≃ K _[0] where | ||
toFun φ := φ.app _ PUnit.unit | ||
invFun x := | ||
{ app := fun Δ _ => K.map (SimplexCategory.const Δ.unop [0] 0).op x | ||
naturality := fun Δ Δ' f => by | ||
ext ⟨⟩ | ||
dsimp | ||
rw [← FunctorToTypes.map_comp_apply] | ||
rfl } | ||
left_inv φ := by | ||
ext Δ ⟨⟩ | ||
dsimp | ||
rw [← FunctorToTypes.naturality] | ||
rfl | ||
right_inv x := by simp | ||
|
||
end SSet |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
158 changes: 158 additions & 0 deletions
158
Mathlib/CategoryTheory/ChosenFiniteProducts/FunctorCategory.lean
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,158 @@ | ||
/- | ||
Copyright (c) 2024 Joël Riou. All rights reserved. | ||
Released under Apache 2.0 license as described in the file LICENSE. | ||
Authors: Joël Riou | ||
-/ | ||
import Mathlib.CategoryTheory.ChosenFiniteProducts | ||
import Mathlib.CategoryTheory.Limits.FunctorCategory | ||
|
||
/-! | ||
# Functor categories have chosen finite products | ||
If `C` is a category with chosen finite products, then so is `J ⥤ C`. | ||
-/ | ||
|
||
namespace CategoryTheory | ||
|
||
open Limits MonoidalCategory Category | ||
|
||
variable (J C : Type*) [Category J] [Category C] [ChosenFiniteProducts C] | ||
|
||
namespace Functor | ||
|
||
/-- The chosen terminal object in `J ⥤ C`. -/ | ||
abbrev chosenTerminal : J ⥤ C := ((Functor.const J).obj (𝟙_ C)) | ||
|
||
/-- The chosen terminal object in `J ⥤ C` is terminal. -/ | ||
def chosenTerminalIsTerminal : IsTerminal (chosenTerminal J C) := | ||
evaluationJointlyReflectsLimits _ | ||
(fun _ => isLimitChangeEmptyCone _ ChosenFiniteProducts.terminal.2 _ (Iso.refl _)) | ||
|
||
section | ||
|
||
variable {J C} | ||
variable (F₁ F₂ : J ⥤ C) | ||
|
||
/-- The chosen binary product on `J ⥤ C`. -/ | ||
@[simps] | ||
def chosenProd : J ⥤ C where | ||
obj j := F₁.obj j ⊗ F₂.obj j | ||
map φ := F₁.map φ ⊗ F₂.map φ | ||
|
||
namespace chosenProd | ||
|
||
/-- The first projection `chosenProd F₁ F₂ ⟶ F₁`. -/ | ||
@[simps] | ||
def fst : chosenProd F₁ F₂ ⟶ F₁ where | ||
app _ := ChosenFiniteProducts.fst _ _ | ||
|
||
/-- The second projection `chosenProd F₁ F₂ ⟶ F₂`. -/ | ||
@[simps] | ||
def snd : chosenProd F₁ F₂ ⟶ F₂ where | ||
app j := ChosenFiniteProducts.snd _ _ | ||
|
||
/-- `Functor.chosenProd F₁ F₂` is a binary product of `F₁` and `F₂`. -/ | ||
noncomputable def isLimit : IsLimit (BinaryFan.mk (fst F₁ F₂) (snd F₁ F₂)) := | ||
evaluationJointlyReflectsLimits _ (fun j => | ||
(IsLimit.postcomposeHomEquiv (mapPairIso (by exact Iso.refl _) (by exact Iso.refl _)) _).1 | ||
(IsLimit.ofIsoLimit (ChosenFiniteProducts.product (X := F₁.obj j) (Y := F₂.obj j)).2 | ||
(Cones.ext (Iso.refl _) (by rintro ⟨_|_⟩; all_goals aesop_cat)))) | ||
|
||
end chosenProd | ||
|
||
end | ||
|
||
noncomputable instance chosenFiniteProducts : | ||
ChosenFiniteProducts (J ⥤ C) where | ||
terminal := ⟨_, chosenTerminalIsTerminal J C⟩ | ||
product F₁ F₂ := ⟨_, chosenProd.isLimit F₁ F₂⟩ | ||
|
||
namespace Monoidal | ||
|
||
open ChosenFiniteProducts | ||
|
||
variable {J C} | ||
|
||
@[simp] | ||
lemma leftUnitor_hom_app (F : J ⥤ C) (j : J) : | ||
(λ_ F).hom.app j = (λ_ (F.obj j)).hom := rfl | ||
|
||
@[simp] | ||
lemma leftUnitor_inv_app (F : J ⥤ C) (j : J) : | ||
(λ_ F).inv.app j = (λ_ (F.obj j)).inv := by | ||
rw [← cancel_mono ((λ_ (F.obj j)).hom), Iso.inv_hom_id, ← leftUnitor_hom_app, | ||
Iso.inv_hom_id_app] | ||
|
||
@[simp] | ||
lemma rightUnitor_hom_app (F : J ⥤ C) (j : J) : | ||
(ρ_ F).hom.app j = (ρ_ (F.obj j)).hom := rfl | ||
|
||
@[simp] | ||
lemma rightUnitor_inv_app (F : J ⥤ C) (j : J) : | ||
(ρ_ F).inv.app j = (ρ_ (F.obj j)).inv := by | ||
rw [← cancel_mono ((ρ_ (F.obj j)).hom), Iso.inv_hom_id, ← rightUnitor_hom_app, | ||
Iso.inv_hom_id_app] | ||
|
||
@[reassoc (attr := simp)] | ||
lemma tensorHom_app_fst {F₁ F₁' F₂ F₂' : J ⥤ C} (f : F₁ ⟶ F₁') (g : F₂ ⟶ F₂') (j : J) : | ||
(f ⊗ g).app j ≫ fst _ _ = fst _ _ ≫ f.app j := by | ||
change (f ⊗ g).app j ≫ (fst F₁' F₂').app j = _ | ||
rw [← NatTrans.comp_app, tensorHom_fst, NatTrans.comp_app] | ||
rfl | ||
|
||
@[reassoc (attr := simp)] | ||
lemma tensorHom_app_snd {F₁ F₁' F₂ F₂' : J ⥤ C} (f : F₁ ⟶ F₁') (g : F₂ ⟶ F₂') (j : J) : | ||
(f ⊗ g).app j ≫ snd _ _ = snd _ _ ≫ g.app j := by | ||
change (f ⊗ g).app j ≫ (snd F₁' F₂').app j = _ | ||
rw [← NatTrans.comp_app, tensorHom_snd, NatTrans.comp_app] | ||
rfl | ||
|
||
@[reassoc (attr := simp)] | ||
lemma whiskerLeft_app_fst (F₁ : J ⥤ C) {F₂ F₂' : J ⥤ C} (g : F₂ ⟶ F₂') (j : J) : | ||
(F₁ ◁ g).app j ≫ fst _ _ = fst _ _ := | ||
(tensorHom_app_fst (𝟙 F₁) g j).trans (by simp) | ||
|
||
@[reassoc (attr := simp)] | ||
lemma whiskerLeft_app_snd (F₁ : J ⥤ C) {F₂ F₂' : J ⥤ C} (g : F₂ ⟶ F₂') (j : J) : | ||
(F₁ ◁ g).app j ≫ snd _ _ = snd _ _ ≫ g.app j := | ||
(tensorHom_app_snd (𝟙 F₁) g j) | ||
|
||
@[reassoc (attr := simp)] | ||
lemma whiskerRight_app_fst {F₁ F₁' : J ⥤ C} (f : F₁ ⟶ F₁') (F₂ : J ⥤ C) (j : J) : | ||
(f ▷ F₂).app j ≫ fst _ _ = fst _ _ ≫ f.app j := | ||
(tensorHom_app_fst f (𝟙 F₂) j) | ||
|
||
@[reassoc (attr := simp)] | ||
lemma whiskerRight_app_snd {F₁ F₁' : J ⥤ C} (f : F₁ ⟶ F₁') (F₂ : J ⥤ C) (j : J) : | ||
(f ▷ F₂).app j ≫ snd _ _ = snd _ _ := | ||
(tensorHom_app_snd f (𝟙 F₂) j).trans (by simp) | ||
|
||
@[simp] | ||
lemma associator_hom_app (F₁ F₂ F₃ : J ⥤ C) (j : J) : | ||
(α_ F₁ F₂ F₃).hom.app j = (α_ _ _ _).hom := by | ||
apply hom_ext | ||
· change _ ≫ (fst F₁ (F₂ ⊗ F₃)).app j = _ | ||
rw [← NatTrans.comp_app, associator_hom_fst] | ||
erw [associator_hom_fst] | ||
rfl | ||
· apply hom_ext | ||
· change (_ ≫ (snd F₁ (F₂ ⊗ F₃)).app j) ≫ (fst F₂ F₃).app j = _ | ||
rw [← NatTrans.comp_app, ← NatTrans.comp_app, assoc, associator_hom_snd_fst, assoc] | ||
erw [associator_hom_snd_fst] | ||
rfl | ||
· change (_ ≫ (snd F₁ (F₂ ⊗ F₃)).app j) ≫ (snd F₂ F₃).app j = _ | ||
rw [← NatTrans.comp_app, ← NatTrans.comp_app, assoc, associator_hom_snd_snd, assoc] | ||
erw [associator_hom_snd_snd] | ||
rfl | ||
|
||
@[simp] | ||
lemma associator_inv_app (F₁ F₂ F₃ : J ⥤ C) (j : J) : | ||
(α_ F₁ F₂ F₃).inv.app j = (α_ _ _ _).inv := by | ||
rw [← cancel_mono ((α_ _ _ _).hom), Iso.inv_hom_id, ← associator_hom_app, Iso.inv_hom_id_app] | ||
|
||
end Monoidal | ||
|
||
end Functor | ||
|
||
end CategoryTheory |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters