@@ -21,6 +21,19 @@ Given a category with such an instance, we also provide the associated
21
21
symmetric monoidal structure so that one can write `X ⊗ Y` for the explicit
22
22
binary product and `𝟙_ C` for the explicit terminal object.
23
23
24
+ ## Implementation notes
25
+
26
+ For cartesian monoidal categories, the oplax-monoidal/monoidal/braided structure of a functor `F`
27
+ preserving finite products is uniquely determined. See the `ofChosenFiniteProducts` declarations.
28
+
29
+ We however develop the theory for any `F.OplaxMonoidal`/`F.Monoidal`/`F.Braided` instance instead of
30
+ requiring it to be the `ofChosenFiniteProducts` one. This is to avoid diamonds: Consider
31
+ eg `𝟭 C` and `F ⋙ G`.
32
+
33
+ In applications requiring a finite preserving functor to be oplax-monoidal/monoidal/braided,
34
+ avoid `attribute [local instance] ofChosenFiniteProducts` but instead turn on the corresponding
35
+ `ofChosenFiniteProducts` declaration for that functor only.
36
+
24
37
# Projects
25
38
26
39
- Construct an instance of chosen finite products in the category of affine scheme, using
@@ -31,7 +44,7 @@ binary product and `𝟙_ C` for the explicit terminal object.
31
44
32
45
namespace CategoryTheory
33
46
34
- universe v v₁ v₂ u u₁ u₂
47
+ universe v v₁ v₂ v₃ u u₁ u₂ u₃
35
48
36
49
/--
37
50
An instance of `ChosenFiniteProducts C` bundles an explicit choice of a binary
@@ -237,6 +250,9 @@ lemma lift_lift_associator_inv {X Y Z W : C} (f : X ⟶ Y) (g : X ⟶ Z) (h : X
237
250
lift f (lift g h) ≫ (α_ Y Z W).inv = lift (lift f g) h := by
238
251
aesop_cat
239
252
253
+ lemma leftUnitor_hom (X : C) : (λ_ X).hom = snd _ _ := rfl
254
+ lemma rightUnitor_hom (X : C) : (ρ_ X).hom = fst _ _ := rfl
255
+
240
256
@[reassoc (attr := simp)]
241
257
lemma leftUnitor_inv_fst (X : C) :
242
258
(λ_ X).inv ≫ fst _ _ = toUnit _ := toUnit_unique _ _
@@ -253,6 +269,14 @@ lemma rightUnitor_inv_fst (X : C) :
253
269
lemma rightUnitor_inv_snd (X : C) :
254
270
(ρ_ X).inv ≫ snd _ _ = toUnit _ := toUnit_unique _ _
255
271
272
+ @[reassoc]
273
+ lemma whiskerLeft_toUnit_comp_rightUnitor_hom (X Y : C) : X ◁ toUnit Y ≫ (ρ_ X).hom = fst X Y := by
274
+ rw [← cancel_mono (ρ_ X).inv]; aesop
275
+
276
+ @[reassoc]
277
+ lemma whiskerRight_toUnit_comp_leftUnitor_hom (X Y : C) : toUnit X ▷ Y ≫ (λ_ Y).hom = snd X Y := by
278
+ rw [← cancel_mono (λ_ Y).inv]; aesop
279
+
256
280
@[reassoc (attr := simp)]
257
281
lemma lift_leftUnitor_hom {X Y : C} (f : X ⟶ 𝟙_ C) (g : X ⟶ Y) :
258
282
lift f g ≫ (λ_ Y).hom = g := by
@@ -620,20 +644,47 @@ end ChosenFiniteProducts
620
644
621
645
open MonoidalCategory ChosenFiniteProducts
622
646
623
- namespace Functor
647
+ variable
648
+ {C : Type u₁} [Category.{v₁} C] [ChosenFiniteProducts C]
649
+ {D : Type u₂} [Category.{v₂} D] [ChosenFiniteProducts D]
650
+ {E : Type u₃} [Category.{v₃} E] [ChosenFiniteProducts E]
651
+ (F : C ⥤ D) (G : D ⥤ E) {X Y Z : C}
652
+
653
+ open Functor.LaxMonoidal Functor.OplaxMonoidal
654
+ open Limits (PreservesFiniteProducts)
655
+
656
+ namespace Functor.OplaxMonoidal
657
+ variable [F.OplaxMonoidal]
658
+
659
+ lemma η_of_chosenFiniteProducts : η F = terminalComparison F := toUnit_unique ..
660
+
661
+ lemma δ_of_chosenFiniteProducts (X Y : C) : δ F X Y = prodComparison F X Y := by
662
+ ext
663
+ · have eq₁ := δ_natural_right F X (toUnit Y) =≫ fst _ _
664
+ have eq₂ := OplaxMonoidal.right_unitality_hom F X
665
+ rw [Category.assoc, Category.assoc, whiskerLeft_fst] at eq₁
666
+ rw [rightUnitor_hom, whiskerLeft_fst] at eq₂
667
+ rw [eq₁, eq₂, prodComparison_fst, ← F.map_comp, rightUnitor_hom, whiskerLeft_fst]
668
+ · have eq₁ := δ_natural_left F (toUnit X) Y =≫ snd _ _
669
+ have eq₂ := OplaxMonoidal.left_unitality_hom F Y
670
+ rw [Category.assoc, Category.assoc, whiskerRight_snd] at eq₁
671
+ rw [leftUnitor_hom, whiskerRight_snd] at eq₂
672
+ rw [eq₁, eq₂, prodComparison_snd, ← F.map_comp, leftUnitor_hom, whiskerRight_snd]
624
673
625
- variable {C : Type u} [Category.{v} C] [ChosenFiniteProducts C]
626
- {D : Type u₁} [Category.{v₁} D] [ChosenFiniteProducts D] (F : C ⥤ D)
674
+ variable [PreservesFiniteProducts F]
675
+
676
+ instance : IsIso (η F) :=
677
+ η_of_chosenFiniteProducts F ▸ terminalComparison_isIso_of_preservesLimits F
627
678
628
- open Functor.OplaxMonoidal
679
+ instance (X Y : C) : IsIso (δ F X Y) :=
680
+ δ_of_chosenFiniteProducts F X Y ▸ isIso_prodComparison_of_preservesLimit_pair F X Y
629
681
630
- /- The definitions `oplaxMonoidalOfChosenFiniteProducts` and
631
- `monoidalOfChosenFiniteProducts` are not made instances because it would
632
- create a diamond for the (oplax) monoidal structure on a composition
633
- `F ⋙ G` of functors between categories with chosen finite products. -/
682
+ omit [F.OplaxMonoidal] in
683
+ /-- Any functor between cartesian-monoidal categories is oplax monoidal.
634
684
635
- /-- Any functor between categories with chosen finite products induces an oplax monoial functor. -/
636
- def oplaxMonoidalOfChosenFiniteProducts : F.OplaxMonoidal where
685
+ This is not made an instance because it would create a diamond for the oplax monoidal structure on
686
+ the identity and composition of functors. -/
687
+ def ofChosenFiniteProducts : F.OplaxMonoidal where
637
688
η' := terminalComparison F
638
689
δ' X Y := prodComparison F X Y
639
690
δ'_natural_left f X' := by simpa using (prodComparison_natural F f (𝟙 X')).symm
@@ -653,124 +704,121 @@ def oplaxMonoidalOfChosenFiniteProducts : F.OplaxMonoidal where
653
704
prodComparison_fst, ← F.map_comp, F.map_id]
654
705
· exact toUnit_unique _ _
655
706
707
+ omit [F.OplaxMonoidal] in
708
+ /-- Any functor between cartesian-monoidal categories is oplax monoidal in a unique way. -/
709
+ instance : Subsingleton F.OplaxMonoidal where
710
+ allEq a b := by
711
+ ext1
712
+ · exact toUnit_unique _ _
713
+ · ext1; ext1; rw [← δ, ← δ, δ_of_chosenFiniteProducts, δ_of_chosenFiniteProducts]
656
714
657
- attribute [local instance] oplaxMonoidalOfChosenFiniteProducts
658
-
659
- lemma η_of_chosenFiniteProducts : η F = terminalComparison F := rfl
660
-
661
- lemma δ_of_chosenFiniteProducts (X Y : C) : δ F X Y = prodComparison F X Y := rfl
662
-
663
- open Limits
664
-
665
- variable [PreservesFiniteProducts F]
666
-
667
- instance : IsIso (η F) :=
668
- terminalComparison_isIso_of_preservesLimits F
669
-
670
- instance (A B : C) : IsIso (δ F A B) :=
671
- isIso_prodComparison_of_preservesLimit_pair F A B
672
-
673
- /-- If `F : C ⥤ D` is a functor between categories with chosen finite products
674
- that preserves finite products, then it is a monoidal functor. -/
675
- noncomputable def monoidalOfChosenFiniteProducts : F.Monoidal :=
676
- Functor.Monoidal.ofOplaxMonoidal F
677
-
678
- end Functor
679
-
680
- namespace Functor.Monoidal
715
+ end OplaxMonoidal
681
716
682
- variable {C : Type u} [Category.{v} C] [ChosenFiniteProducts C]
683
- {D : Type u₁} [Category.{v₁} D ] [ChosenFiniteProducts D] (F : C ⥤ D)
717
+ namespace Monoidal
718
+ variable [F.Monoidal ] [G.Monoidal]
684
719
685
- section
720
+ @[reassoc (attr := simp)]
721
+ lemma toUnit_ε (X : C) : toUnit (F.obj X) ≫ ε F = F.map (toUnit X) := by
722
+ rw [← cancel_mono (εIso F).inv]; exact toUnit_unique ..
686
723
687
- attribute [local instance] oplaxMonoidalOfChosenFiniteProducts
724
+ @[reassoc (attr := simp)]
725
+ lemma δ_fst (X Y : C) : δ F X Y ≫ fst _ _ = F.map (fst _ _) := by
726
+ rw [← whiskerLeft_toUnit_comp_rightUnitor_hom, ← whiskerLeft_toUnit_comp_rightUnitor_hom,
727
+ LaxMonoidal.right_unitality, ← MonoidalCategory.whiskerLeft_comp_assoc, toUnit_ε,
728
+ LaxMonoidal.μ_natural_right_assoc, δ_μ_assoc, map_comp]
688
729
689
730
@[reassoc (attr := simp)]
690
- lemma δ_fst (X Y : C) : OplaxMonoidal.δ F X Y ≫ fst _ _ = F.map (fst _ _) := by
691
- simp [δ_of_chosenFiniteProducts]
731
+ lemma δ_snd (X Y : C) : δ F X Y ≫ snd _ _ = F.map (snd _ _) := by
732
+ rw [← whiskerRight_toUnit_comp_leftUnitor_hom, ← whiskerRight_toUnit_comp_leftUnitor_hom,
733
+ LaxMonoidal.left_unitality, ← MonoidalCategory.comp_whiskerRight_assoc, toUnit_ε,
734
+ LaxMonoidal.μ_natural_left_assoc, δ_μ_assoc, map_comp]
692
735
693
736
@[reassoc (attr := simp)]
694
- lemma δ _snd (X Y : C ) : OplaxMonoidal.δ F X Y ≫ snd _ _ = F.map (snd _ _ ) := by
695
- simp [δ_of_chosenFiniteProducts ]
737
+ lemma lift_δ (f : X ⟶ Y) (g : X ⟶ Z ) : F.map (lift f g) ≫ δ F _ _ = lift ( F.map f) (F.map g ) := by
738
+ ext <;> simp [← map_comp ]
696
739
697
740
@[reassoc (attr := simp)]
698
- lemma lift_δ {X Y Z : C} (f : X ⟶ Y) (g : X ⟶ Z) :
699
- F.map (lift f g) ≫ OplaxMonoidal.δ F _ _ = lift (F.map f) (F.map g) := by
700
- apply hom_ext <;> simp [← F.map_comp]
741
+ lemma lift_μ (f : X ⟶ Y) (g : X ⟶ Z) : lift (F.map f) (F.map g) ≫ μ F _ _ = F.map (lift f g) :=
742
+ (cancel_mono (μIso _ _ _).inv).1 (by simp)
701
743
702
- end
744
+ @[reassoc (attr := simp)]
745
+ lemma μ_fst (X Y : C) : μ F X Y ≫ F.map (fst X Y) = fst (F.obj X) (F.obj Y) :=
746
+ (cancel_epi (μIso _ _ _).inv).1 (by simp)
703
747
704
- section
748
+ @[reassoc (attr := simp)]
749
+ lemma μ_snd (X Y : C) : μ F X Y ≫ F.map (snd X Y) = snd (F.obj X) (F.obj Y) :=
750
+ (cancel_epi (μIso _ _ _).inv).1 (by simp)
705
751
706
- open Limits
752
+ attribute [-instance] Functor.LaxMonoidal.comp Functor.Monoidal.instComp in
753
+ @[reassoc]
754
+ lemma μ_comp [(F ⋙ G).Monoidal] (X Y : C) : μ (F ⋙ G) X Y = μ G _ _ ≫ G.map (μ F X Y) := by
755
+ rw [← cancel_mono (μIso _ _ _).inv]; ext <;> simp [← Functor.comp_obj, ← Functor.map_comp]
707
756
708
757
variable [PreservesFiniteProducts F]
709
758
710
- attribute [local instance] monoidalOfChosenFiniteProducts
711
-
712
- open Functor.Monoidal Functor.LaxMonoidal
713
-
714
759
lemma ε_of_chosenFiniteProducts : ε F = (preservesTerminalIso F).inv := by
715
- change (εIso F).symm.inv = _; congr; ext; simp; rfl
760
+ change (εIso F).symm.inv = _; congr; ext; simpa using η_of_chosenFiniteProducts F
716
761
717
762
lemma μ_of_chosenFiniteProducts (X Y : C) : μ F X Y = (prodComparisonIso F X Y).inv := by
718
- change (μIso F X Y).symm.inv = _; congr; ext : 1 ; rfl
763
+ change (μIso F X Y).symm.inv = _; congr; ext : 1 ; simpa using δ_of_chosenFiniteProducts F X Y
719
764
720
- @[reassoc (attr := simp)]
721
- lemma toUnit_ε {X : C} : toUnit (F.obj X) ≫ LaxMonoidal.ε F = F.map (toUnit X) :=
722
- (cancel_mono (εIso _).inv). 1 (toUnit_unique _ _)
765
+ attribute [local instance] OplaxMonoidal.ofChosenFiniteProducts in
766
+ omit [F.Monoidal] in
767
+ /-- A finite-product-preserving functor between cartesian monoidal categories is monoidal.
723
768
724
- @[reassoc (attr := simp)]
725
- lemma lift_μ {X Y Z : C} (f : X ⟶ Y) (g : X ⟶ Z) :
726
- lift (F.map f) (F.map g) ≫ μ F _ _ = F.map (lift f g) :=
727
- (cancel_mono (μIso _ _ _).inv).1 (by simp)
769
+ This is not made an instance because it would create a diamond for the monoidal structure on
770
+ the identity and composition of functors. -/
771
+ noncomputable def ofChosenFiniteProducts : F.Monoidal := .ofOplaxMonoidal F
728
772
729
- @[reassoc (attr := simp)]
730
- lemma μ_fst (X Y : C) : μ F X Y ≫ F.map (fst X Y) = fst (F.obj X) (F.obj Y) :=
731
- (cancel_epi (μIso _ _ _).inv).1 (by simp)
773
+ instance : Subsingleton F.Monoidal := (toOplaxMonoidal_injective F).subsingleton
732
774
733
- @[reassoc (attr := simp)]
734
- lemma μ_snd (X Y : C) : μ F X Y ≫ F.map (snd X Y) = snd (F.obj X) (F.obj Y) :=
735
- (cancel_epi (μIso _ _ _).inv).1 (by simp)
775
+ end Monoidal
736
776
737
- section
777
+ namespace Monoidal
738
778
739
- variable {F} {E : Type u₂} [Category.{v₂} E] [ChosenFiniteProducts E] {G : D ⥤ E}
740
- [PreservesFiniteProducts G]
779
+ instance [F.Monoidal] : PreservesFiniteProducts F :=
780
+ have (A B) : IsIso (prodComparison F A B) := δ_of_chosenFiniteProducts F A B ▸ inferInstance
781
+ have : IsIso (terminalComparison F) := η_of_chosenFiniteProducts F ▸ inferInstance
782
+ have := preservesLimitsOfShape_discrete_walkingPair_of_isIso_prodComparison F
783
+ have := preservesLimit_empty_of_isIso_terminalComparison F
784
+ have := Limits.preservesLimitsOfShape_pempty_of_preservesTerminal F
785
+ .of_preserves_binary_and_terminal _
741
786
742
- attribute [-instance] Functor.LaxMonoidal.comp Functor.Monoidal.instComp in
743
- @[reassoc]
744
- lemma μ _comp (X Y : C) :
745
- LaxMonoidal.μ (F ⋙ G) X Y = LaxMonoidal.μ G _ _ ≫ G.map (LaxMonoidal.μ F X Y) := by
746
- apply (cancel_mono (μIso _ _ _).inv). 1
747
- apply ChosenFiniteProducts.hom_ext <;> simp [← Functor.comp_obj, ← Functor.map_comp]
787
+ /--
788
+ A functor between cartesian monoidal categories is monoidal iff it preserves finite products.
789
+ -/
790
+ lemma nonempty_monoidal_iff_preservesFiniteProducts :
791
+ Nonempty F.Monoidal ↔ PreservesFiniteProducts F :=
792
+ ⟨ fun ⟨_⟩ ↦ inferInstance, fun _ ↦ ⟨ofChosenFiniteProducts F⟩⟩
748
793
749
- end
794
+ end Monoidal
750
795
751
- end
796
+ namespace Braided
797
+ variable [PreservesFiniteProducts F]
752
798
753
- end Functor.Monoidal
799
+ attribute [local instance] Monoidal.ofChosenFiniteProducts in
800
+ /-- A finite-product-preserving functor between cartesian monoidal categories is braided.
754
801
755
- namespace Functor
802
+ This is not made an instance because it would create a diamond for the braided structure on
803
+ the identity and composition of functors. -/
804
+ noncomputable def ofChosenFiniteProducts : F.Braided where
805
+ braided X Y := by rw [← cancel_mono (Monoidal.μIso _ _ _).inv]; ext <;> simp [← F.map_comp]
756
806
757
- open Limits
807
+ instance : Subsingleton F.Braided := (Braided.toMonoidal_injective F).subsingleton
758
808
759
- variable {C : Type u} [Category.{v} C] [ChosenFiniteProducts C]
760
- {D : Type u₁} [Category.{v₁} D] [ChosenFiniteProducts D] (F : C ⥤ D) [PreservesFiniteProducts F]
809
+ end Braided
810
+
811
+ @[deprecated (since := "2025-04-24")]
812
+ alias oplaxMonoidalOfChosenFiniteProducts := OplaxMonoidal.ofChosenFiniteProducts
761
813
762
- attribute [local instance] monoidalOfChosenFiniteProducts
814
+ @[deprecated (since := "2025-04-24")]
815
+ alias monoidalOfChosenFiniteProducts := Monoidal.ofChosenFiniteProducts
763
816
764
- /-- A finite-product-preserving functor between categories with chosen finite products is
765
- braided. -/
766
- noncomputable def braidedOfChosenFiniteProducts : F.Braided :=
767
- { monoidalOfChosenFiniteProducts F with
768
- braided X Y := by
769
- rw [← cancel_mono (Monoidal.μIso _ _ _).inv]
770
- apply ChosenFiniteProducts.hom_ext <;> simp [← Functor.map_comp] }
817
+ @[deprecated (since := "2025-04-24")]
818
+ alias braidedOfChosenFiniteProducts := Braided.ofChosenFiniteProducts
771
819
772
820
namespace EssImageSubcategory
773
- variable [F.Full] [F.Faithful] {T X Y Z : F.EssImageSubcategory}
821
+ variable [F.Full] [F.Faithful] [PreservesFiniteProducts F] {T X Y Z : F.EssImageSubcategory}
774
822
775
823
@[simps!]
776
824
noncomputable instance instChosenFiniteProducts : ChosenFiniteProducts F.EssImageSubcategory :=
@@ -797,13 +845,9 @@ lemma toUnit_def (X : F.EssImageSubcategory) : toUnit X = toUnit X.obj := toUnit
797
845
end Functor.EssImageSubcategory
798
846
799
847
namespace NatTrans
848
+ variable (F G : C ⥤ D) [F.Monoidal] [G.Monoidal]
800
849
801
- variable {C : Type u} [Category.{v} C] [ChosenFiniteProducts C]
802
- {D : Type u₁} [Category.{v₁} D] [ChosenFiniteProducts D] (F G : C ⥤ D)
803
- [Limits.PreservesFiniteProducts F] [Limits.PreservesFiniteProducts G]
804
-
805
- attribute [local instance] Functor.monoidalOfChosenFiniteProducts in
806
- instance monoidal_of_preservesFiniteProducts (α : F ⟶ G) : NatTrans.IsMonoidal α where
850
+ instance isMonoidal_of_chosenFiniteProducts (α : F ⟶ G) : IsMonoidal α where
807
851
unit := (cancel_mono (Functor.Monoidal.εIso _).inv).1 (toUnit_unique _ _)
808
852
tensor {X Y} := by
809
853
rw [← cancel_mono (Functor.Monoidal.μIso _ _ _).inv]
0 commit comments