algebra.category.Module.adjunctionsMathlib.Algebra.Category.ModuleCat.Adjunctions

This file has been ported!

Changes since the initial port

The following section lists changes to this file in mathlib3 and mathlib4 that occured after the initial port. Most recent changes are shown first. Hovering over a commit will show all commits associated with the same mathlib3 commit.

Changes in mathlib3

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(last sync)

Changes in mathlib3port

mathlib3
mathlib3port
Diff
@@ -3,7 +3,7 @@ Copyright (c) 2021 Scott Morrison. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Scott Morrison, Johan Commelin
 -/
-import Algebra.Category.Module.Monoidal.Basic
+import Algebra.Category.ModuleCat.Monoidal.Basic
 import CategoryTheory.Monoidal.Functorial
 import CategoryTheory.Monoidal.Types.Basic
 import LinearAlgebra.DirectSum.Finsupp
Diff
@@ -254,7 +254,7 @@ attribute [local reducible] CategoryTheory.categoryFree
 
 instance : Preadditive (Free R C)
     where
-  homGroup X Y := Finsupp.addCommGroup
+  homGroup X Y := Finsupp.instAddCommGroup
   add_comp X Y Z f f' g := by
     dsimp
     rw [Finsupp.sum_add_index'] <;> · simp [add_mul]
Diff
@@ -3,11 +3,11 @@ Copyright (c) 2021 Scott Morrison. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Scott Morrison, Johan Commelin
 -/
-import Mathbin.Algebra.Category.Module.Monoidal.Basic
-import Mathbin.CategoryTheory.Monoidal.Functorial
-import Mathbin.CategoryTheory.Monoidal.Types.Basic
-import Mathbin.LinearAlgebra.DirectSum.Finsupp
-import Mathbin.CategoryTheory.Linear.LinearFunctor
+import Algebra.Category.Module.Monoidal.Basic
+import CategoryTheory.Monoidal.Functorial
+import CategoryTheory.Monoidal.Types.Basic
+import LinearAlgebra.DirectSum.Finsupp
+import CategoryTheory.Linear.LinearFunctor
 
 #align_import algebra.category.Module.adjunctions from "leanprover-community/mathlib"@"61b5e2755ccb464b68d05a9acf891ae04992d09d"
 
Diff
@@ -2,11 +2,6 @@
 Copyright (c) 2021 Scott Morrison. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Scott Morrison, Johan Commelin
-
-! This file was ported from Lean 3 source module algebra.category.Module.adjunctions
-! leanprover-community/mathlib commit 61b5e2755ccb464b68d05a9acf891ae04992d09d
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathbin.Algebra.Category.Module.Monoidal.Basic
 import Mathbin.CategoryTheory.Monoidal.Functorial
@@ -14,6 +9,8 @@ import Mathbin.CategoryTheory.Monoidal.Types.Basic
 import Mathbin.LinearAlgebra.DirectSum.Finsupp
 import Mathbin.CategoryTheory.Linear.LinearFunctor
 
+#align_import algebra.category.Module.adjunctions from "leanprover-community/mathlib"@"61b5e2755ccb464b68d05a9acf891ae04992d09d"
+
 /-!
 > THIS FILE IS SYNCHRONIZED WITH MATHLIB4.
 > Any changes to this file require a corresponding PR to mathlib4.
Diff
@@ -72,7 +72,7 @@ instance : IsRightAdjoint (forget (ModuleCat.{u} R)) :=
 
 end
 
-namespace Free
+namespace free
 
 variable [CommRing R]
 
@@ -180,7 +180,7 @@ instance : LaxMonoidal.{u} (free R).obj
 instance : IsIso (LaxMonoidal.ε (free R).obj) :=
   ⟨⟨Finsupp.lapply PUnit.unit, ⟨by ext; simp, by ext ⟨⟩ ⟨⟩; simp⟩⟩⟩
 
-end Free
+end free
 
 variable [CommRing R]
 
Diff
@@ -108,7 +108,7 @@ theorem μ_natural {X Y X' Y' : Type u} (f : X ⟶ Y) (g : X' ⟶ Y') :
     ((free R).map f ⊗ (free R).map g) ≫ (μ R Y Y').Hom = (μ R X X').Hom ≫ (free R).map (f ⊗ g) :=
   by
   intros
-  ext (x x'⟨y, y'⟩)
+  ext x x' ⟨y, y'⟩
   dsimp [μ]
   simp_rw [Finsupp.mapDomain_single, finsuppTensorFinsupp'_single_tmul_single, mul_one,
     Finsupp.mapDomain_single, CategoryTheory.tensor_apply]
@@ -178,7 +178,7 @@ instance : LaxMonoidal.{u} (free R).obj
   associativity' := associativity R
 
 instance : IsIso (LaxMonoidal.ε (free R).obj) :=
-  ⟨⟨Finsupp.lapply PUnit.unit, ⟨by ext; simp, by ext (⟨⟩⟨⟩); simp⟩⟩⟩
+  ⟨⟨Finsupp.lapply PUnit.unit, ⟨by ext; simp, by ext ⟨⟩ ⟨⟩; simp⟩⟩⟩
 
 end Free
 
@@ -264,7 +264,7 @@ instance : Preadditive (Free R C)
   comp_add X Y Z f g g' := by
     dsimp
     rw [← Finsupp.sum_add]
-    congr; ext (r h)
+    congr; ext r h
     rw [Finsupp.sum_add_index'] <;> · simp [mul_add]
 
 instance : Linear R (Free R C)
@@ -276,7 +276,7 @@ instance : Linear R (Free R C)
   comp_smul' X Y Z f r g := by
     dsimp
     simp_rw [Finsupp.smul_sum]
-    congr; ext (h s)
+    congr; ext h s
     rw [Finsupp.sum_smul_index] <;> simp [Finsupp.smul_sum, mul_left_comm]
 
 #print CategoryTheory.Free.single_comp_single /-
Diff
@@ -78,25 +78,32 @@ variable [CommRing R]
 
 attribute [local ext] TensorProduct.ext
 
+#print ModuleCat.Free.ε /-
 /-- (Implementation detail) The unitor for `free R`. -/
 def ε : 𝟙_ (ModuleCat.{u} R) ⟶ (free R).obj (𝟙_ (Type u)) :=
   Finsupp.lsingle PUnit.unit
 #align Module.free.ε ModuleCat.Free.ε
+-/
 
+#print ModuleCat.Free.ε_apply /-
 @[simp]
 theorem ε_apply (r : R) : ε R r = Finsupp.single PUnit.unit r :=
   rfl
 #align Module.free.ε_apply ModuleCat.Free.ε_apply
+-/
 
 /- ./././Mathport/Syntax/Translate/Expr.lean:177:8: unsupported: ambiguous notation -/
 /- ./././Mathport/Syntax/Translate/Expr.lean:177:8: unsupported: ambiguous notation -/
+#print ModuleCat.Free.μ /-
 /-- (Implementation detail) The tensorator for `free R`. -/
 def μ (α β : Type u) : (free R).obj α ⊗ (free R).obj β ≅ (free R).obj (α ⊗ β) :=
   (finsuppTensorFinsupp' R α β).toModuleIso
 #align Module.free.μ ModuleCat.Free.μ
+-/
 
 /- ./././Mathport/Syntax/Translate/Expr.lean:177:8: unsupported: ambiguous notation -/
 /- ./././Mathport/Syntax/Translate/Expr.lean:177:8: unsupported: ambiguous notation -/
+#print ModuleCat.Free.μ_natural /-
 theorem μ_natural {X Y X' Y' : Type u} (f : X ⟶ Y) (g : X' ⟶ Y') :
     ((free R).map f ⊗ (free R).map g) ≫ (μ R Y Y').Hom = (μ R X X').Hom ≫ (free R).map (f ⊗ g) :=
   by
@@ -106,8 +113,10 @@ theorem μ_natural {X Y X' Y' : Type u} (f : X ⟶ Y) (g : X' ⟶ Y') :
   simp_rw [Finsupp.mapDomain_single, finsuppTensorFinsupp'_single_tmul_single, mul_one,
     Finsupp.mapDomain_single, CategoryTheory.tensor_apply]
 #align Module.free.μ_natural ModuleCat.Free.μ_natural
+-/
 
 /- ./././Mathport/Syntax/Translate/Expr.lean:177:8: unsupported: ambiguous notation -/
+#print ModuleCat.Free.left_unitality /-
 theorem left_unitality (X : Type u) :
     (λ_ ((free R).obj X)).Hom =
       (ε R ⊗ 𝟙 ((free R).obj X)) ≫ (μ R (𝟙_ (Type u)) X).Hom ≫ map (free R).obj (λ_ X).Hom :=
@@ -119,8 +128,10 @@ theorem left_unitality (X : Type u) :
     ModuleCat.MonoidalCategory.leftUnitor_hom_apply, Finsupp.smul_single', mul_one,
     Finsupp.mapDomain_single, CategoryTheory.leftUnitor_hom_apply]
 #align Module.free.left_unitality ModuleCat.Free.left_unitality
+-/
 
 /- ./././Mathport/Syntax/Translate/Expr.lean:177:8: unsupported: ambiguous notation -/
+#print ModuleCat.Free.right_unitality /-
 theorem right_unitality (X : Type u) :
     (ρ_ ((free R).obj X)).Hom =
       (𝟙 ((free R).obj X) ⊗ ε R) ≫ (μ R X (𝟙_ (Type u))).Hom ≫ map (free R).obj (ρ_ X).Hom :=
@@ -132,11 +143,13 @@ theorem right_unitality (X : Type u) :
     ModuleCat.MonoidalCategory.rightUnitor_hom_apply, Finsupp.smul_single', mul_one,
     Finsupp.mapDomain_single, CategoryTheory.rightUnitor_hom_apply]
 #align Module.free.right_unitality ModuleCat.Free.right_unitality
+-/
 
 /- ./././Mathport/Syntax/Translate/Expr.lean:177:8: unsupported: ambiguous notation -/
 /- ./././Mathport/Syntax/Translate/Expr.lean:177:8: unsupported: ambiguous notation -/
 /- ./././Mathport/Syntax/Translate/Expr.lean:177:8: unsupported: ambiguous notation -/
 /- ./././Mathport/Syntax/Translate/Expr.lean:177:8: unsupported: ambiguous notation -/
+#print ModuleCat.Free.associativity /-
 theorem associativity (X Y Z : Type u) :
     ((μ R X Y).Hom ⊗ 𝟙 ((free R).obj Z)) ≫ (μ R (X ⊗ Y) Z).Hom ≫ map (free R).obj (α_ X Y Z).Hom =
       (α_ ((free R).obj X) ((free R).obj Y) ((free R).obj Z)).Hom ≫
@@ -148,6 +161,7 @@ theorem associativity (X Y Z : Type u) :
   simp_rw [finsuppTensorFinsupp'_single_tmul_single, Finsupp.mapDomain_single, mul_one,
     CategoryTheory.associator_hom_apply]
 #align Module.free.associativity ModuleCat.Free.associativity
+-/
 
 -- In fact, it's strong monoidal, but we don't yet have a typeclass for that.
 /-- The free R-module functor is lax monoidal. -/
@@ -265,9 +279,11 @@ instance : Linear R (Free R C)
     congr; ext (h s)
     rw [Finsupp.sum_smul_index] <;> simp [Finsupp.smul_sum, mul_left_comm]
 
+#print CategoryTheory.Free.single_comp_single /-
 theorem single_comp_single {X Y Z : C} (f : X ⟶ Y) (g : Y ⟶ Z) (r s : R) :
     (single f r ≫ single g s : Free.of R X ⟶ Free.of R Z) = single (f ≫ g) (r * s) := by dsimp; simp
 #align category_theory.Free.single_comp_single CategoryTheory.Free.single_comp_single
+-/
 
 end
 
@@ -325,22 +341,28 @@ def lift (F : C ⥤ D) : Free R C ⥤ D where
 #align category_theory.Free.lift CategoryTheory.Free.lift
 -/
 
+#print CategoryTheory.Free.lift_map_single /-
 @[simp]
 theorem lift_map_single (F : C ⥤ D) {X Y : C} (f : X ⟶ Y) (r : R) :
     (lift R F).map (single f r) = r • F.map f := by simp
 #align category_theory.Free.lift_map_single CategoryTheory.Free.lift_map_single
+-/
 
+#print CategoryTheory.Free.lift_additive /-
 instance lift_additive (F : C ⥤ D) : (lift R F).Additive
     where map_add' X Y f g := by
     dsimp
     rw [Finsupp.sum_add_index'] <;> simp [add_smul]
 #align category_theory.Free.lift_additive CategoryTheory.Free.lift_additive
+-/
 
+#print CategoryTheory.Free.lift_linear /-
 instance lift_linear (F : C ⥤ D) : (lift R F).Linear R
     where map_smul' X Y f r := by
     dsimp
     rw [Finsupp.sum_smul_index] <;> simp [Finsupp.smul_sum, mul_smul]
 #align category_theory.Free.lift_linear CategoryTheory.Free.lift_linear
+-/
 
 #print CategoryTheory.Free.embeddingLiftIso /-
 /-- The embedding into the `R`-linear completion, followed by the lift,
@@ -351,6 +373,7 @@ def embeddingLiftIso (F : C ⥤ D) : embedding R C ⋙ lift R F ≅ F :=
 #align category_theory.Free.embedding_lift_iso CategoryTheory.Free.embeddingLiftIso
 -/
 
+#print CategoryTheory.Free.ext /-
 /-- Two `R`-linear functors out of the `R`-linear completion are isomorphic iff their
 compositions with the embedding functor are isomorphic.
 -/
@@ -373,7 +396,9 @@ def ext {F G : Free R C ⥤ D} [F.Additive] [F.Linear R] [G.Additive] [G.Linear
         -- Why are these not picked up automatically when we rewrite?
         infer_instance)
 #align category_theory.Free.ext CategoryTheory.Free.ext
+-/
 
+#print CategoryTheory.Free.liftUnique /-
 /-- `Free.lift` is unique amongst `R`-linear functors `Free R C ⥤ D`
 which compose with `embedding ℤ C` to give the original functor.
 -/
@@ -381,6 +406,7 @@ def liftUnique (F : C ⥤ D) (L : Free R C ⥤ D) [L.Additive] [L.Linear R]
     (α : embedding R C ⋙ L ≅ F) : L ≅ lift R F :=
   ext R (α.trans (embeddingLiftIso R F).symm)
 #align category_theory.Free.lift_unique CategoryTheory.Free.liftUnique
+-/
 
 end Free
 
Diff
@@ -49,8 +49,8 @@ def free : Type u ⥤ ModuleCat R
     where
   obj X := ModuleCat.of R (X →₀ R)
   map X Y f := Finsupp.lmapDomain _ _ f
-  map_id' := by intros ; exact Finsupp.lmapDomain_id _ _
-  map_comp' := by intros ; exact Finsupp.lmapDomain_comp _ _ _ _
+  map_id' := by intros; exact Finsupp.lmapDomain_id _ _
+  map_comp' := by intros; exact Finsupp.lmapDomain_comp _ _ _ _
 #align Module.free ModuleCat.free
 -/
 
@@ -250,7 +250,7 @@ instance : Preadditive (Free R C)
   comp_add X Y Z f g g' := by
     dsimp
     rw [← Finsupp.sum_add]
-    congr ; ext (r h)
+    congr; ext (r h)
     rw [Finsupp.sum_add_index'] <;> · simp [mul_add]
 
 instance : Linear R (Free R C)
@@ -262,7 +262,7 @@ instance : Linear R (Free R C)
   comp_smul' X Y Z f r g := by
     dsimp
     simp_rw [Finsupp.smul_sum]
-    congr ; ext (h s)
+    congr; ext (h s)
     rw [Finsupp.sum_smul_index] <;> simp [Finsupp.smul_sum, mul_left_comm]
 
 theorem single_comp_single {X Y Z : C} (f : X ⟶ Y) (g : Y ⟶ Z) (r s : R) :
@@ -304,10 +304,10 @@ def lift (F : C ⥤ D) : Free R C ⥤ D where
       rw [add_comp]
       rw [Finsupp.sum_add_index', Finsupp.sum_add_index']
       · simp only [w₁, w₂, add_comp]
-      · intros ; rw [zero_smul]
-      · intros ; simp only [add_smul]
-      · intros ; rw [zero_smul]
-      · intros ; simp only [add_smul]
+      · intros; rw [zero_smul]
+      · intros; simp only [add_smul]
+      · intros; rw [zero_smul]
+      · intros; simp only [add_smul]
     · intro f' r
       apply Finsupp.induction_linear g
       · simp only [limits.comp_zero, sum_zero_index]
@@ -315,10 +315,10 @@ def lift (F : C ⥤ D) : Free R C ⥤ D where
         rw [comp_add]
         rw [Finsupp.sum_add_index', Finsupp.sum_add_index']
         · simp only [w₁, w₂, comp_add]
-        · intros ; rw [zero_smul]
-        · intros ; simp only [add_smul]
-        · intros ; rw [zero_smul]
-        · intros ; simp only [add_smul]
+        · intros; rw [zero_smul]
+        · intros; simp only [add_smul]
+        · intros; rw [zero_smul]
+        · intros; simp only [add_smul]
       · intro g' s
         erw [single_comp_single]
         simp [mul_comm r s, mul_smul]
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Scott Morrison, Johan Commelin
 
 ! This file was ported from Lean 3 source module algebra.category.Module.adjunctions
-! leanprover-community/mathlib commit 95a87616d63b3cb49d3fe678d416fbe9c4217bf4
+! leanprover-community/mathlib commit 61b5e2755ccb464b68d05a9acf891ae04992d09d
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -15,6 +15,9 @@ import Mathbin.LinearAlgebra.DirectSum.Finsupp
 import Mathbin.CategoryTheory.Linear.LinearFunctor
 
 /-!
+> THIS FILE IS SYNCHRONIZED WITH MATHLIB4.
+> Any changes to this file require a corresponding PR to mathlib4.
+
 The functor of forming finitely supported functions on a type with values in a `[ring R]`
 is the left adjoint of
 the forgetful functor from `R`-modules to types.
@@ -37,6 +40,7 @@ section
 
 variable [Ring R]
 
+#print ModuleCat.free /-
 /-- The free functor `Type u ⥤ Module R` sending a type `X` to the
 free `R`-module with generators `x : X`, implemented as the type `X →₀ R`.
 -/
@@ -48,7 +52,9 @@ def free : Type u ⥤ ModuleCat R
   map_id' := by intros ; exact Finsupp.lmapDomain_id _ _
   map_comp' := by intros ; exact Finsupp.lmapDomain_comp _ _ _ _
 #align Module.free ModuleCat.free
+-/
 
+#print ModuleCat.adj /-
 /-- The free-forgetful adjunction for R-modules.
 -/
 def adj : free R ⊣ forget (ModuleCat.{u} R) :=
@@ -59,6 +65,7 @@ def adj : free R ⊣ forget (ModuleCat.{u} R) :=
           LinearMap.ext_ring
             (Finsupp.sum_mapDomain_index_addMonoidHom fun y => (smulAddHom R M).flip (g y)).symm }
 #align Module.adj ModuleCat.adj
+-/
 
 instance : IsRightAdjoint (forget (ModuleCat.{u} R)) :=
   ⟨_, adj R⟩
@@ -74,19 +81,19 @@ attribute [local ext] TensorProduct.ext
 /-- (Implementation detail) The unitor for `free R`. -/
 def ε : 𝟙_ (ModuleCat.{u} R) ⟶ (free R).obj (𝟙_ (Type u)) :=
   Finsupp.lsingle PUnit.unit
-#align Module.free.ε ModuleCat.free.ε
+#align Module.free.ε ModuleCat.Free.ε
 
 @[simp]
 theorem ε_apply (r : R) : ε R r = Finsupp.single PUnit.unit r :=
   rfl
-#align Module.free.ε_apply ModuleCat.free.ε_apply
+#align Module.free.ε_apply ModuleCat.Free.ε_apply
 
 /- ./././Mathport/Syntax/Translate/Expr.lean:177:8: unsupported: ambiguous notation -/
 /- ./././Mathport/Syntax/Translate/Expr.lean:177:8: unsupported: ambiguous notation -/
 /-- (Implementation detail) The tensorator for `free R`. -/
 def μ (α β : Type u) : (free R).obj α ⊗ (free R).obj β ≅ (free R).obj (α ⊗ β) :=
   (finsuppTensorFinsupp' R α β).toModuleIso
-#align Module.free.μ ModuleCat.free.μ
+#align Module.free.μ ModuleCat.Free.μ
 
 /- ./././Mathport/Syntax/Translate/Expr.lean:177:8: unsupported: ambiguous notation -/
 /- ./././Mathport/Syntax/Translate/Expr.lean:177:8: unsupported: ambiguous notation -/
@@ -98,7 +105,7 @@ theorem μ_natural {X Y X' Y' : Type u} (f : X ⟶ Y) (g : X' ⟶ Y') :
   dsimp [μ]
   simp_rw [Finsupp.mapDomain_single, finsuppTensorFinsupp'_single_tmul_single, mul_one,
     Finsupp.mapDomain_single, CategoryTheory.tensor_apply]
-#align Module.free.μ_natural ModuleCat.free.μ_natural
+#align Module.free.μ_natural ModuleCat.Free.μ_natural
 
 /- ./././Mathport/Syntax/Translate/Expr.lean:177:8: unsupported: ambiguous notation -/
 theorem left_unitality (X : Type u) :
@@ -111,7 +118,7 @@ theorem left_unitality (X : Type u) :
   simp_rw [finsuppTensorFinsupp'_single_tmul_single,
     ModuleCat.MonoidalCategory.leftUnitor_hom_apply, Finsupp.smul_single', mul_one,
     Finsupp.mapDomain_single, CategoryTheory.leftUnitor_hom_apply]
-#align Module.free.left_unitality ModuleCat.free.left_unitality
+#align Module.free.left_unitality ModuleCat.Free.left_unitality
 
 /- ./././Mathport/Syntax/Translate/Expr.lean:177:8: unsupported: ambiguous notation -/
 theorem right_unitality (X : Type u) :
@@ -124,7 +131,7 @@ theorem right_unitality (X : Type u) :
   simp_rw [finsuppTensorFinsupp'_single_tmul_single,
     ModuleCat.MonoidalCategory.rightUnitor_hom_apply, Finsupp.smul_single', mul_one,
     Finsupp.mapDomain_single, CategoryTheory.rightUnitor_hom_apply]
-#align Module.free.right_unitality ModuleCat.free.right_unitality
+#align Module.free.right_unitality ModuleCat.Free.right_unitality
 
 /- ./././Mathport/Syntax/Translate/Expr.lean:177:8: unsupported: ambiguous notation -/
 /- ./././Mathport/Syntax/Translate/Expr.lean:177:8: unsupported: ambiguous notation -/
@@ -140,7 +147,7 @@ theorem associativity (X Y Z : Type u) :
   dsimp [μ]
   simp_rw [finsuppTensorFinsupp'_single_tmul_single, Finsupp.mapDomain_single, mul_one,
     CategoryTheory.associator_hom_apply]
-#align Module.free.associativity ModuleCat.free.associativity
+#align Module.free.associativity ModuleCat.Free.associativity
 
 -- In fact, it's strong monoidal, but we don't yet have a typeclass for that.
 /-- The free R-module functor is lax monoidal. -/
@@ -163,6 +170,7 @@ end Free
 
 variable [CommRing R]
 
+#print ModuleCat.monoidalFree /-
 /-- The free functor `Type u ⥤ Module R`, as a monoidal functor. -/
 def monoidalFree : MonoidalFunctor (Type u) (ModuleCat.{u} R) :=
   {
@@ -171,6 +179,7 @@ def monoidalFree : MonoidalFunctor (Type u) (ModuleCat.{u} R) :=
     ε_isIso := by dsimp; infer_instance
     μ_isIso := fun X Y => by dsimp; infer_instance }
 #align Module.monoidal_free ModuleCat.monoidalFree
+-/
 
 /- ./././Mathport/Syntax/Translate/Expr.lean:177:8: unsupported: ambiguous notation -/
 example (X Y : Type u) : (free R).obj (X × Y) ≅ (free R).obj X ⊗ (free R).obj Y :=
@@ -182,6 +191,7 @@ namespace CategoryTheory
 
 universe v u
 
+#print CategoryTheory.Free /-
 /-- `Free R C` is a type synonym for `C`, which, given `[comm_ring R]` and `[category C]`,
 we will equip with a category structure where the morphisms are formal `R`-linear combinations
 of the morphisms in `C`.
@@ -190,7 +200,9 @@ of the morphisms in `C`.
 def Free (R : Type _) (C : Type u) :=
   C
 #align category_theory.Free CategoryTheory.Free
+-/
 
+#print CategoryTheory.Free.of /-
 /-- Consider an object of `C` as an object of the `R`-linear completion.
 
 It may be preferable to use `(Free.embedding R C).obj X` instead;
@@ -199,11 +211,13 @@ this functor can also be used to lift morphisms.
 def Free.of (R : Type _) {C : Type u} (X : C) : Free R C :=
   X
 #align category_theory.Free.of CategoryTheory.Free.of
+-/
 
 variable (R : Type _) [CommRing R] (C : Type u) [Category.{v} C]
 
 open Finsupp
 
+#print CategoryTheory.categoryFree /-
 -- Conceptually, it would be nice to construct this via "transport of enrichment",
 -- using the fact that `Module.free R : Type ⥤ Module R` and `Module.forget` are both lax monoidal.
 -- This still seems difficult, so we just do it by hand.
@@ -219,6 +233,7 @@ instance categoryFree : Category (Free R C)
       forall_true_iff, forall₃_true_iff, add_mul, mul_add, category.assoc, mul_assoc,
       MulZeroClass.zero_mul, MulZeroClass.mul_zero, sum_zero, sum_add]
 #align category_theory.category_Free CategoryTheory.categoryFree
+-/
 
 namespace Free
 
@@ -258,6 +273,7 @@ end
 
 attribute [local simp] single_comp_single
 
+#print CategoryTheory.Free.embedding /-
 /-- A category embeds into its `R`-linear completion.
 -/
 @[simps]
@@ -267,11 +283,13 @@ def embedding : C ⥤ Free R C where
   map_id' X := rfl
   map_comp' X Y Z f g := by simp
 #align category_theory.Free.embedding CategoryTheory.Free.embedding
+-/
 
 variable (R) {C} {D : Type u} [Category.{v} D] [Preadditive D] [Linear R D]
 
 open Preadditive Linear
 
+#print CategoryTheory.Free.lift /-
 /-- A functor to an `R`-linear category lifts to a functor from its `R`-linear completion.
 -/
 @[simps]
@@ -305,6 +323,7 @@ def lift (F : C ⥤ D) : Free R C ⥤ D where
         erw [single_comp_single]
         simp [mul_comm r s, mul_smul]
 #align category_theory.Free.lift CategoryTheory.Free.lift
+-/
 
 @[simp]
 theorem lift_map_single (F : C ⥤ D) {X Y : C} (f : X ⟶ Y) (r : R) :
@@ -323,12 +342,14 @@ instance lift_linear (F : C ⥤ D) : (lift R F).Linear R
     rw [Finsupp.sum_smul_index] <;> simp [Finsupp.smul_sum, mul_smul]
 #align category_theory.Free.lift_linear CategoryTheory.Free.lift_linear
 
+#print CategoryTheory.Free.embeddingLiftIso /-
 /-- The embedding into the `R`-linear completion, followed by the lift,
 is isomorphic to the original functor.
 -/
 def embeddingLiftIso (F : C ⥤ D) : embedding R C ⋙ lift R F ≅ F :=
   NatIso.ofComponents (fun X => Iso.refl _) (by tidy)
 #align category_theory.Free.embedding_lift_iso CategoryTheory.Free.embeddingLiftIso
+-/
 
 /-- Two `R`-linear functors out of the `R`-linear completion are isomorphic iff their
 compositions with the embedding functor are isomorphic.
Diff
@@ -29,7 +29,7 @@ namespace ModuleCat
 
 universe u
 
-open Classical
+open scoped Classical
 
 variable (R : Type u)
 
Diff
@@ -45,12 +45,8 @@ def free : Type u ⥤ ModuleCat R
     where
   obj X := ModuleCat.of R (X →₀ R)
   map X Y f := Finsupp.lmapDomain _ _ f
-  map_id' := by
-    intros
-    exact Finsupp.lmapDomain_id _ _
-  map_comp' := by
-    intros
-    exact Finsupp.lmapDomain_comp _ _ _ _
+  map_id' := by intros ; exact Finsupp.lmapDomain_id _ _
+  map_comp' := by intros ; exact Finsupp.lmapDomain_comp _ _ _ _
 #align Module.free ModuleCat.free
 
 /-- The free-forgetful adjunction for R-modules.
@@ -161,12 +157,7 @@ instance : LaxMonoidal.{u} (free R).obj
   associativity' := associativity R
 
 instance : IsIso (LaxMonoidal.ε (free R).obj) :=
-  ⟨⟨Finsupp.lapply PUnit.unit,
-      ⟨by
-        ext
-        simp, by
-        ext (⟨⟩⟨⟩)
-        simp⟩⟩⟩
+  ⟨⟨Finsupp.lapply PUnit.unit, ⟨by ext; simp, by ext (⟨⟩⟨⟩); simp⟩⟩⟩
 
 end Free
 
@@ -177,12 +168,8 @@ def monoidalFree : MonoidalFunctor (Type u) (ModuleCat.{u} R) :=
   {
     LaxMonoidalFunctor.of
       (free R).obj with
-    ε_isIso := by
-      dsimp
-      infer_instance
-    μ_isIso := fun X Y => by
-      dsimp
-      infer_instance }
+    ε_isIso := by dsimp; infer_instance
+    μ_isIso := fun X Y => by dsimp; infer_instance }
 #align Module.monoidal_free ModuleCat.monoidalFree
 
 /- ./././Mathport/Syntax/Translate/Expr.lean:177:8: unsupported: ambiguous notation -/
@@ -264,10 +251,7 @@ instance : Linear R (Free R C)
     rw [Finsupp.sum_smul_index] <;> simp [Finsupp.smul_sum, mul_left_comm]
 
 theorem single_comp_single {X Y Z : C} (f : X ⟶ Y) (g : Y ⟶ Z) (r s : R) :
-    (single f r ≫ single g s : Free.of R X ⟶ Free.of R Z) = single (f ≫ g) (r * s) :=
-  by
-  dsimp
-  simp
+    (single f r ≫ single g s : Free.of R X ⟶ Free.of R Z) = single (f ≫ g) (r * s) := by dsimp; simp
 #align category_theory.Free.single_comp_single CategoryTheory.Free.single_comp_single
 
 end
@@ -294,9 +278,7 @@ open Preadditive Linear
 def lift (F : C ⥤ D) : Free R C ⥤ D where
   obj X := F.obj X
   map X Y f := f.Sum fun f' r => r • F.map f'
-  map_id' := by
-    dsimp [CategoryTheory.categoryFree]
-    simp
+  map_id' := by dsimp [CategoryTheory.categoryFree]; simp
   map_comp' X Y Z f g := by
     apply Finsupp.induction_linear f
     · simp only [limits.zero_comp, sum_zero_index]
@@ -304,14 +286,10 @@ def lift (F : C ⥤ D) : Free R C ⥤ D where
       rw [add_comp]
       rw [Finsupp.sum_add_index', Finsupp.sum_add_index']
       · simp only [w₁, w₂, add_comp]
-      · intros
-        rw [zero_smul]
-      · intros
-        simp only [add_smul]
-      · intros
-        rw [zero_smul]
-      · intros
-        simp only [add_smul]
+      · intros ; rw [zero_smul]
+      · intros ; simp only [add_smul]
+      · intros ; rw [zero_smul]
+      · intros ; simp only [add_smul]
     · intro f' r
       apply Finsupp.induction_linear g
       · simp only [limits.comp_zero, sum_zero_index]
@@ -319,14 +297,10 @@ def lift (F : C ⥤ D) : Free R C ⥤ D where
         rw [comp_add]
         rw [Finsupp.sum_add_index', Finsupp.sum_add_index']
         · simp only [w₁, w₂, comp_add]
-        · intros
-          rw [zero_smul]
-        · intros
-          simp only [add_smul]
-        · intros
-          rw [zero_smul]
-        · intros
-          simp only [add_smul]
+        · intros ; rw [zero_smul]
+        · intros ; simp only [add_smul]
+        · intros ; rw [zero_smul]
+        · intros ; simp only [add_smul]
       · intro g' s
         erw [single_comp_single]
         simp [mul_comm r s, mul_smul]
Diff
@@ -113,7 +113,7 @@ theorem left_unitality (X : Type u) :
   ext
   dsimp [ε, μ]
   simp_rw [finsuppTensorFinsupp'_single_tmul_single,
-    ModuleCat.monoidalCategory.leftUnitor_hom_apply, Finsupp.smul_single', mul_one,
+    ModuleCat.MonoidalCategory.leftUnitor_hom_apply, Finsupp.smul_single', mul_one,
     Finsupp.mapDomain_single, CategoryTheory.leftUnitor_hom_apply]
 #align Module.free.left_unitality ModuleCat.free.left_unitality
 
@@ -126,7 +126,7 @@ theorem right_unitality (X : Type u) :
   ext
   dsimp [ε, μ]
   simp_rw [finsuppTensorFinsupp'_single_tmul_single,
-    ModuleCat.monoidalCategory.rightUnitor_hom_apply, Finsupp.smul_single', mul_one,
+    ModuleCat.MonoidalCategory.rightUnitor_hom_apply, Finsupp.smul_single', mul_one,
     Finsupp.mapDomain_single, CategoryTheory.rightUnitor_hom_apply]
 #align Module.free.right_unitality ModuleCat.free.right_unitality
 
Diff
@@ -4,13 +4,13 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Scott Morrison, Johan Commelin
 
 ! This file was ported from Lean 3 source module algebra.category.Module.adjunctions
-! leanprover-community/mathlib commit 6e492fdbed778ea815798a5a0c6cb83df8486265
+! leanprover-community/mathlib commit 95a87616d63b3cb49d3fe678d416fbe9c4217bf4
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
-import Mathbin.Algebra.Category.Module.Monoidal
+import Mathbin.Algebra.Category.Module.Monoidal.Basic
 import Mathbin.CategoryTheory.Monoidal.Functorial
-import Mathbin.CategoryTheory.Monoidal.Types
+import Mathbin.CategoryTheory.Monoidal.Types.Basic
 import Mathbin.LinearAlgebra.DirectSum.Finsupp
 import Mathbin.CategoryTheory.Linear.LinearFunctor
 
Diff
@@ -343,11 +343,11 @@ instance lift_additive (F : C ⥤ D) : (lift R F).Additive
     rw [Finsupp.sum_add_index'] <;> simp [add_smul]
 #align category_theory.Free.lift_additive CategoryTheory.Free.lift_additive
 
-instance liftLinear (F : C ⥤ D) : (lift R F).Linear R
+instance lift_linear (F : C ⥤ D) : (lift R F).Linear R
     where map_smul' X Y f r := by
     dsimp
     rw [Finsupp.sum_smul_index] <;> simp [Finsupp.smul_sum, mul_smul]
-#align category_theory.Free.lift_linear CategoryTheory.Free.liftLinear
+#align category_theory.Free.lift_linear CategoryTheory.Free.lift_linear
 
 /-- The embedding into the `R`-linear completion, followed by the lift,
 is isomorphic to the original functor.
Diff
@@ -229,8 +229,8 @@ instance categoryFree : Category (Free R C)
     dsimp
     -- This imitates the proof of associativity for `monoid_algebra`.
     simp only [sum_sum_index, sum_single_index, single_zero, single_add, eq_self_iff_true,
-      forall_true_iff, forall₃_true_iff, add_mul, mul_add, category.assoc, mul_assoc, zero_mul,
-      mul_zero, sum_zero, sum_add]
+      forall_true_iff, forall₃_true_iff, add_mul, mul_add, category.assoc, mul_assoc,
+      MulZeroClass.zero_mul, MulZeroClass.mul_zero, sum_zero, sum_add]
 #align category_theory.category_Free CategoryTheory.categoryFree
 
 namespace Free
Diff
@@ -242,10 +242,10 @@ attribute [local reducible] CategoryTheory.categoryFree
 instance : Preadditive (Free R C)
     where
   homGroup X Y := Finsupp.addCommGroup
-  add_comp' X Y Z f f' g := by
+  add_comp X Y Z f f' g := by
     dsimp
     rw [Finsupp.sum_add_index'] <;> · simp [add_mul]
-  comp_add' X Y Z f g g' := by
+  comp_add X Y Z f g g' := by
     dsimp
     rw [← Finsupp.sum_add]
     congr ; ext (r h)

Changes in mathlib4

mathlib3
mathlib4
chore: classify porting notes referring to missing linters (#12098)

Reference the newly created issues #12094 and #12096, as well as the pre-existing #5171. Change all references to #10927 to #5171. Some of these changes were not labelled as "porting note"; change this for good measure.

Diff
@@ -238,7 +238,7 @@ universe v u
 we will equip with a category structure where the morphisms are formal `R`-linear combinations
 of the morphisms in `C`.
 -/
--- Porting note: Removed has_nonempty_instance nolint
+-- Porting note(#5171): Removed has_nonempty_instance nolint; linter not ported yet
 @[nolint unusedArguments]
 def Free (_ : Type*) (C : Type u) :=
   C
chore: remove unused tactics (#11351)

I removed some of the tactics that were not used and are hopefully uncontroversial arising from the linter at #11308.

As the commit messages should convey, the removed tactics are, essentially,

push_cast
norm_cast
congr
norm_num
dsimp
funext
intro
infer_instance
Diff
@@ -88,7 +88,6 @@ def μ (α β : Type u) : (free R).obj α ⊗ (free R).obj β ≅ (free R).obj (
 
 theorem μ_natural {X Y X' Y' : Type u} (f : X ⟶ Y) (g : X' ⟶ Y') :
     ((free R).map f ⊗ (free R).map g) ≫ (μ R Y Y').hom = (μ R X X').hom ≫ (free R).map (f ⊗ g) := by
-  intros
   -- Porting note (#11041): broken ext
   apply TensorProduct.ext
   apply Finsupp.lhom_ext'
@@ -113,7 +112,6 @@ theorem μ_natural {X Y X' Y' : Type u} (f : X ⟶ Y) (g : X' ⟶ Y') :
 theorem left_unitality (X : Type u) :
     (λ_ ((free R).obj X)).hom =
       (ε R ⊗ 𝟙 ((free R).obj X)) ≫ (μ R (𝟙_ (Type u)) X).hom ≫ map (free R).obj (λ_ X).hom := by
-  intros
   -- Porting note (#11041): broken ext
   apply TensorProduct.ext
   apply LinearMap.ext_ring
@@ -134,7 +132,6 @@ theorem left_unitality (X : Type u) :
 theorem right_unitality (X : Type u) :
     (ρ_ ((free R).obj X)).hom =
       (𝟙 ((free R).obj X) ⊗ ε R) ≫ (μ R X (𝟙_ (Type u))).hom ≫ map (free R).obj (ρ_ X).hom := by
-  intros
   -- Porting note (#11041): broken ext
   apply TensorProduct.ext
   apply Finsupp.lhom_ext'
@@ -156,7 +153,6 @@ theorem associativity (X Y Z : Type u) :
     ((μ R X Y).hom ⊗ 𝟙 ((free R).obj Z)) ≫ (μ R (X ⊗ Y) Z).hom ≫ map (free R).obj (α_ X Y Z).hom =
       (α_ ((free R).obj X) ((free R).obj Y) ((free R).obj Z)).hom ≫
         (𝟙 ((free R).obj X) ⊗ (μ R Y Z).hom) ≫ (μ R X (Y ⊗ Z)).hom := by
-  intros
   -- Porting note (#11041): broken ext
   apply TensorProduct.ext
   apply TensorProduct.ext
chore: scope open Classical (#11199)

We remove all but one open Classicals, instead preferring to use open scoped Classical. The only real side-effect this led to is moving a couple declarations to use Exists.choose instead of Classical.choose.

The first few commits are explicitly labelled regex replaces for ease of review.

Diff
@@ -27,7 +27,7 @@ namespace ModuleCat
 
 universe u
 
-open Classical
+open scoped Classical
 
 variable (R : Type u)
 
chore: move Mathlib to v4.7.0-rc1 (#11162)

This is a very large PR, but it has been reviewed piecemeal already in PRs to the bump/v4.7.0 branch as we update to intermediate nightlies.

Co-authored-by: Scott Morrison <scott.morrison@gmail.com> Co-authored-by: Kyle Miller <kmill31415@gmail.com> Co-authored-by: damiano <adomani@gmail.com>

Diff
@@ -126,7 +126,7 @@ theorem left_unitality (X : Type u) :
   let q : X →₀ R := ((λ_ (of R (X →₀ R))).hom) (1 ⊗ₜ[R] Finsupp.single x 1)
   change q x' = Finsupp.mapDomain (λ_ X).hom (finsuppTensorFinsupp' R (𝟙_ (Type u)) X
     (Finsupp.single PUnit.unit 1 ⊗ₜ[R] Finsupp.single x 1)) x'
-  simp_rw [finsuppTensorFinsupp'_single_tmul_single,
+  simp_rw [q, finsuppTensorFinsupp'_single_tmul_single,
     ModuleCat.MonoidalCategory.leftUnitor_hom_apply, mul_one,
     Finsupp.mapDomain_single, CategoryTheory.leftUnitor_hom_apply, one_smul]
 #align Module.free.left_unitality ModuleCat.Free.left_unitality
@@ -147,7 +147,7 @@ theorem right_unitality (X : Type u) :
   let q : X →₀ R := ((ρ_ (of R (X →₀ R))).hom) (Finsupp.single x 1 ⊗ₜ[R] 1)
   change q x' = Finsupp.mapDomain (ρ_ X).hom (finsuppTensorFinsupp' R X (𝟙_ (Type u))
     (Finsupp.single x 1 ⊗ₜ[R] Finsupp.single PUnit.unit 1)) x'
-  simp_rw [finsuppTensorFinsupp'_single_tmul_single,
+  simp_rw [q, finsuppTensorFinsupp'_single_tmul_single,
     ModuleCat.MonoidalCategory.rightUnitor_hom_apply, mul_one,
     Finsupp.mapDomain_single, CategoryTheory.rightUnitor_hom_apply, one_smul]
 #align Module.free.right_unitality ModuleCat.Free.right_unitality
chore(Data/Finsupp/Defs): rename instances (#10976)

This adds the inst prefix that is expected in Lean 4.

Performed using the F2 shortcut (renaming foo to Finsupp.instFoo, then deleting the redundant Finsupp)

All the changes to downstream files are fallout, no names have been changed there.

Diff
@@ -285,7 +285,7 @@ section
 -- accordingly
 
 instance : Preadditive (Free R C) where
-  homGroup X Y := Finsupp.addCommGroup
+  homGroup X Y := Finsupp.instAddCommGroup
   add_comp X Y Z f f' g := by
     dsimp [CategoryTheory.categoryFree]
     rw [Finsupp.sum_add_index'] <;> · simp [add_mul]
chore: classify broken ext porting notes (#11042)

Classifies by adding issue number #11041 to porting notes claiming:

broken ext

Diff
@@ -89,7 +89,7 @@ def μ (α β : Type u) : (free R).obj α ⊗ (free R).obj β ≅ (free R).obj (
 theorem μ_natural {X Y X' Y' : Type u} (f : X ⟶ Y) (g : X' ⟶ Y') :
     ((free R).map f ⊗ (free R).map g) ≫ (μ R Y Y').hom = (μ R X X').hom ≫ (free R).map (f ⊗ g) := by
   intros
-  -- Porting note: broken ext
+  -- Porting note (#11041): broken ext
   apply TensorProduct.ext
   apply Finsupp.lhom_ext'
   intro x
@@ -114,7 +114,7 @@ theorem left_unitality (X : Type u) :
     (λ_ ((free R).obj X)).hom =
       (ε R ⊗ 𝟙 ((free R).obj X)) ≫ (μ R (𝟙_ (Type u)) X).hom ≫ map (free R).obj (λ_ X).hom := by
   intros
-  -- Porting note: broken ext
+  -- Porting note (#11041): broken ext
   apply TensorProduct.ext
   apply LinearMap.ext_ring
   apply Finsupp.lhom_ext'
@@ -135,7 +135,7 @@ theorem right_unitality (X : Type u) :
     (ρ_ ((free R).obj X)).hom =
       (𝟙 ((free R).obj X) ⊗ ε R) ≫ (μ R X (𝟙_ (Type u))).hom ≫ map (free R).obj (ρ_ X).hom := by
   intros
-  -- Porting note: broken ext
+  -- Porting note (#11041): broken ext
   apply TensorProduct.ext
   apply Finsupp.lhom_ext'
   intro x
@@ -157,7 +157,7 @@ theorem associativity (X Y Z : Type u) :
       (α_ ((free R).obj X) ((free R).obj Y) ((free R).obj Z)).hom ≫
         (𝟙 ((free R).obj X) ⊗ (μ R Y Z).hom) ≫ (μ R X (Y ⊗ Z)).hom := by
   intros
-  -- Porting note: broken ext
+  -- Porting note (#11041): broken ext
   apply TensorProduct.ext
   apply TensorProduct.ext
   apply Finsupp.lhom_ext'
@@ -198,13 +198,13 @@ instance : LaxMonoidal.{u} (free R).obj := .ofTensorHom
 
 instance : IsIso (@LaxMonoidal.ε _ _ _ _ _ _ (free R).obj _ _) := by
   refine' ⟨⟨Finsupp.lapply PUnit.unit, ⟨_, _⟩⟩⟩
-  · -- Porting note: broken ext
+  · -- Porting note (#11041): broken ext
     apply LinearMap.ext_ring
     -- Porting note (#10959): simp used to be able to close this goal
     dsimp
     erw [ModuleCat.comp_def, LinearMap.comp_apply, ε_apply, Finsupp.lapply_apply,
       Finsupp.single_eq_same, id_apply]
-  · -- Porting note: broken ext
+  · -- Porting note (#11041): broken ext
     apply Finsupp.lhom_ext'
     intro ⟨⟩
     apply LinearMap.ext_ring
chore: classify simp cannot prove porting notes (#10960)

Classifies by adding issue number #10959 porting notes claiming anything semantically equivalent to:

  • "simp cannot prove this"
  • "simp used to be able to close this goal"
  • "simp can't handle this"
  • "simp used to work here"
Diff
@@ -200,7 +200,7 @@ instance : IsIso (@LaxMonoidal.ε _ _ _ _ _ _ (free R).obj _ _) := by
   refine' ⟨⟨Finsupp.lapply PUnit.unit, ⟨_, _⟩⟩⟩
   · -- Porting note: broken ext
     apply LinearMap.ext_ring
-    -- Porting note: simp used to be able to close this goal
+    -- Porting note (#10959): simp used to be able to close this goal
     dsimp
     erw [ModuleCat.comp_def, LinearMap.comp_apply, ε_apply, Finsupp.lapply_apply,
       Finsupp.single_eq_same, id_apply]
@@ -210,7 +210,7 @@ instance : IsIso (@LaxMonoidal.ε _ _ _ _ _ _ (free R).obj _ _) := by
     apply LinearMap.ext_ring
     apply Finsupp.ext
     intro ⟨⟩
-    -- Porting note: simp used to be able to close this goal
+    -- Porting note (#10959): simp used to be able to close this goal
     dsimp
     erw [ModuleCat.comp_def, LinearMap.comp_apply, ε_apply, Finsupp.lapply_apply,
       Finsupp.single_eq_same]
@@ -323,7 +323,7 @@ def embedding : C ⥤ Free R C where
   map {X Y} f := Finsupp.single f 1
   map_id X := rfl
   map_comp {X Y Z} f g := by
-    -- Porting note: simp used to be able to close this goal
+    -- Porting note (#10959): simp used to be able to close this goal
     dsimp only []
     rw [single_comp_single, one_mul]
 #align category_theory.Free.embedding CategoryTheory.Free.embedding
@@ -341,7 +341,7 @@ def lift (F : C ⥤ D) : Free R C ⥤ D where
   map_id := by dsimp [CategoryTheory.categoryFree]; simp
   map_comp {X Y Z} f g := by
     apply Finsupp.induction_linear f
-    · -- Porting note: simp used to be able to close this goal
+    · -- Porting note (#10959): simp used to be able to close this goal
       dsimp
       rw [Limits.zero_comp, sum_zero_index, Limits.zero_comp]
     · intro f₁ f₂ w₁ w₂
@@ -355,7 +355,7 @@ def lift (F : C ⥤ D) : Free R C ⥤ D where
       · intros; simp only [add_smul]
     · intro f' r
       apply Finsupp.induction_linear g
-      · -- Porting note: simp used to be able to close this goal
+      · -- Porting note (#10959): simp used to be able to close this goal
         dsimp
         rw [Limits.comp_zero, sum_zero_index, Limits.comp_zero]
       · intro f₁ f₂ w₁ w₂
@@ -405,7 +405,7 @@ def ext {F G : Free R C ⥤ D} [F.Additive] [F.Linear R] [G.Additive] [G.Linear
     (by
       intro X Y f
       apply Finsupp.induction_linear f
-      · -- Porting note: simp used to be able to close this goal
+      · -- Porting note (#10959): simp used to be able to close this goal
         rw [Functor.map_zero, Limits.zero_comp, Functor.map_zero, Limits.comp_zero]
       · intro f₁ f₂ w₁ w₂
         -- Porting note: Using rw instead of simp
chore: classify used to be dsimp porting notes (#10935)

Classifies by adding issue number (#10934) to porting notes claiming anything semantically equivalent to:

  • "used to be dsimp"
  • "was dsimp"
Diff
@@ -99,7 +99,7 @@ theorem μ_natural {X Y X' Y' : Type u} (f : X ⟶ Y) (g : X' ⟶ Y') :
   apply LinearMap.ext_ring
   apply Finsupp.ext
   intro ⟨y, y'⟩
-  -- Porting note: used to be dsimp [μ]
+  -- Porting note (#10934): used to be dsimp [μ]
   change (finsuppTensorFinsupp' R Y Y')
     (Finsupp.mapDomain f (Finsupp.single x 1) ⊗ₜ[R] Finsupp.mapDomain g (Finsupp.single x' 1)) _
     = (Finsupp.mapDomain (f ⊗ g) (finsuppTensorFinsupp' R X X'
@@ -122,7 +122,7 @@ theorem left_unitality (X : Type u) :
   apply LinearMap.ext_ring
   apply Finsupp.ext
   intro x'
-  -- Porting note: used to be dsimp [ε, μ]
+  -- Porting note (#10934): used to be dsimp [ε, μ]
   let q : X →₀ R := ((λ_ (of R (X →₀ R))).hom) (1 ⊗ₜ[R] Finsupp.single x 1)
   change q x' = Finsupp.mapDomain (λ_ X).hom (finsuppTensorFinsupp' R (𝟙_ (Type u)) X
     (Finsupp.single PUnit.unit 1 ⊗ₜ[R] Finsupp.single x 1)) x'
@@ -143,7 +143,7 @@ theorem right_unitality (X : Type u) :
   apply LinearMap.ext_ring
   apply Finsupp.ext
   intro x'
-  -- Porting note: used to be dsimp [ε, μ]
+  -- Porting note (#10934): used to be dsimp [ε, μ]
   let q : X →₀ R := ((ρ_ (of R (X →₀ R))).hom) (Finsupp.single x 1 ⊗ₜ[R] 1)
   change q x' = Finsupp.mapDomain (ρ_ X).hom (finsuppTensorFinsupp' R X (𝟙_ (Type u))
     (Finsupp.single x 1 ⊗ₜ[R] Finsupp.single PUnit.unit 1)) x'
@@ -171,7 +171,7 @@ theorem associativity (X Y Z : Type u) :
   apply LinearMap.ext_ring
   apply Finsupp.ext
   intro a
-  -- Porting note: used to be dsimp [μ]
+  -- Porting note (#10934): used to be dsimp [μ]
   change Finsupp.mapDomain (α_ X Y Z).hom (finsuppTensorFinsupp' R (X ⊗ Y) Z
     (finsuppTensorFinsupp' R X Y
     (Finsupp.single x 1 ⊗ₜ[R] Finsupp.single y 1) ⊗ₜ[R] Finsupp.single z 1)) a =
@@ -224,7 +224,7 @@ variable [CommRing R]
 /-- The free functor `Type u ⥤ ModuleCat R`, as a monoidal functor. -/
 def monoidalFree : MonoidalFunctor (Type u) (ModuleCat.{u} R) :=
   { LaxMonoidalFunctor.of (free R).obj with
-    -- Porting note: used to be dsimp
+    -- Porting note (#10934): used to be dsimp
     ε_isIso := (by infer_instance : IsIso (@LaxMonoidal.ε _ _ _ _ _ _ (free R).obj _ _))
     μ_isIso := fun X Y => by dsimp; infer_instance }
 #align Module.monoidal_free ModuleCat.monoidalFree
refactor(CategoryTheory/Monoidal): split the naturality condition of monoidal functors (#9988)

Extracted from #6307. We replace μ_natural with μ_natural_left and μ_natural_right since we prefer to use the whiskerings to the tensor of morphisms in the refactor #6307.

Diff
@@ -186,15 +186,15 @@ theorem associativity (X Y Z : Type u) :
 -- In fact, it's strong monoidal, but we don't yet have a typeclass for that.
 /-- The free R-module functor is lax monoidal. -/
 @[simps]
-instance : LaxMonoidal.{u} (free R).obj where
+instance : LaxMonoidal.{u} (free R).obj := .ofTensorHom
   -- Send `R` to `PUnit →₀ R`
-  ε := ε R
+  (ε := ε R)
   -- Send `(α →₀ R) ⊗ (β →₀ R)` to `α × β →₀ R`
-  μ X Y := (μ R X Y).hom
-  μ_natural {_} {_} {_} {_} f g := μ_natural R f g
-  left_unitality := left_unitality R
-  right_unitality := right_unitality R
-  associativity := associativity R
+  (μ := fun X Y => (μ R X Y).hom)
+  (μ_natural := fun {_} {_} {_} {_} f g ↦ μ_natural R f g)
+  (left_unitality := left_unitality R)
+  (right_unitality := right_unitality R)
+  (associativity := associativity R)
 
 instance : IsIso (@LaxMonoidal.ε _ _ _ _ _ _ (free R).obj _ _) := by
   refine' ⟨⟨Finsupp.lapply PUnit.unit, ⟨_, _⟩⟩⟩
Revert "chore: revert #7703 (#7710)"

This reverts commit f3695eb2.

Diff
@@ -75,7 +75,8 @@ def ε : 𝟙_ (ModuleCat.{u} R) ⟶ (free R).obj (𝟙_ (Type u)) :=
   Finsupp.lsingle PUnit.unit
 #align Module.free.ε ModuleCat.Free.ε
 
-@[simp]
+-- This lemma has always been bad, but lean4#2644 made `simp` start noticing
+@[simp, nolint simpNF]
 theorem ε_apply (r : R) : ε R r = Finsupp.single PUnit.unit r :=
   rfl
 #align Module.free.ε_apply ModuleCat.Free.ε_apply
@@ -103,8 +104,10 @@ theorem μ_natural {X Y X' Y' : Type u} (f : X ⟶ Y) (g : X' ⟶ Y') :
     (Finsupp.mapDomain f (Finsupp.single x 1) ⊗ₜ[R] Finsupp.mapDomain g (Finsupp.single x' 1)) _
     = (Finsupp.mapDomain (f ⊗ g) (finsuppTensorFinsupp' R X X'
     (Finsupp.single x 1 ⊗ₜ[R] Finsupp.single x' 1))) _
+
+  -- extra `rfl` after leanprover/lean4#2466
   simp_rw [Finsupp.mapDomain_single, finsuppTensorFinsupp'_single_tmul_single, mul_one,
-    Finsupp.mapDomain_single, CategoryTheory.tensor_apply]
+    Finsupp.mapDomain_single, CategoryTheory.tensor_apply]; rfl
 #align Module.free.μ_natural ModuleCat.Free.μ_natural
 
 theorem left_unitality (X : Type u) :
@@ -175,8 +178,9 @@ theorem associativity (X Y Z : Type u) :
     finsuppTensorFinsupp' R X (Y ⊗ Z)
     (Finsupp.single x 1 ⊗ₜ[R]
       finsuppTensorFinsupp' R Y Z (Finsupp.single y 1 ⊗ₜ[R] Finsupp.single z 1)) a
+  -- extra `rfl` after leanprover/lean4#2466
   simp_rw [finsuppTensorFinsupp'_single_tmul_single, Finsupp.mapDomain_single, mul_one,
-    CategoryTheory.associator_hom_apply]
+    CategoryTheory.associator_hom_apply]; rfl
 #align Module.free.associativity ModuleCat.Free.associativity
 
 -- In fact, it's strong monoidal, but we don't yet have a typeclass for that.
@@ -422,5 +426,4 @@ def liftUnique (F : C ⥤ D) (L : Free R C ⥤ D) [L.Additive] [L.Linear R]
 #align category_theory.Free.lift_unique CategoryTheory.Free.liftUnique
 
 end Free
-
 end CategoryTheory
chore: revert #7703 (#7710)

This reverts commit 26eb2b0a.

Diff
@@ -75,8 +75,7 @@ def ε : 𝟙_ (ModuleCat.{u} R) ⟶ (free R).obj (𝟙_ (Type u)) :=
   Finsupp.lsingle PUnit.unit
 #align Module.free.ε ModuleCat.Free.ε
 
--- This lemma has always been bad, but lean4#2644 made `simp` start noticing
-@[simp, nolint simpNF]
+@[simp]
 theorem ε_apply (r : R) : ε R r = Finsupp.single PUnit.unit r :=
   rfl
 #align Module.free.ε_apply ModuleCat.Free.ε_apply
@@ -104,10 +103,8 @@ theorem μ_natural {X Y X' Y' : Type u} (f : X ⟶ Y) (g : X' ⟶ Y') :
     (Finsupp.mapDomain f (Finsupp.single x 1) ⊗ₜ[R] Finsupp.mapDomain g (Finsupp.single x' 1)) _
     = (Finsupp.mapDomain (f ⊗ g) (finsuppTensorFinsupp' R X X'
     (Finsupp.single x 1 ⊗ₜ[R] Finsupp.single x' 1))) _
-
-  -- extra `rfl` after leanprover/lean4#2466
   simp_rw [Finsupp.mapDomain_single, finsuppTensorFinsupp'_single_tmul_single, mul_one,
-    Finsupp.mapDomain_single, CategoryTheory.tensor_apply]; rfl
+    Finsupp.mapDomain_single, CategoryTheory.tensor_apply]
 #align Module.free.μ_natural ModuleCat.Free.μ_natural
 
 theorem left_unitality (X : Type u) :
@@ -178,9 +175,8 @@ theorem associativity (X Y Z : Type u) :
     finsuppTensorFinsupp' R X (Y ⊗ Z)
     (Finsupp.single x 1 ⊗ₜ[R]
       finsuppTensorFinsupp' R Y Z (Finsupp.single y 1 ⊗ₜ[R] Finsupp.single z 1)) a
-  -- extra `rfl` after leanprover/lean4#2466
   simp_rw [finsuppTensorFinsupp'_single_tmul_single, Finsupp.mapDomain_single, mul_one,
-    CategoryTheory.associator_hom_apply]; rfl
+    CategoryTheory.associator_hom_apply]
 #align Module.free.associativity ModuleCat.Free.associativity
 
 -- In fact, it's strong monoidal, but we don't yet have a typeclass for that.
@@ -426,4 +422,5 @@ def liftUnique (F : C ⥤ D) (L : Free R C ⥤ D) [L.Additive] [L.Linear R]
 #align category_theory.Free.lift_unique CategoryTheory.Free.liftUnique
 
 end Free
+
 end CategoryTheory
chore: bump toolchain to v4.2.0-rc2 (#7703)

This includes all the changes from #7606.

Co-authored-by: Scott Morrison <scott.morrison@gmail.com>

Diff
@@ -75,7 +75,8 @@ def ε : 𝟙_ (ModuleCat.{u} R) ⟶ (free R).obj (𝟙_ (Type u)) :=
   Finsupp.lsingle PUnit.unit
 #align Module.free.ε ModuleCat.Free.ε
 
-@[simp]
+-- This lemma has always been bad, but lean4#2644 made `simp` start noticing
+@[simp, nolint simpNF]
 theorem ε_apply (r : R) : ε R r = Finsupp.single PUnit.unit r :=
   rfl
 #align Module.free.ε_apply ModuleCat.Free.ε_apply
@@ -103,8 +104,10 @@ theorem μ_natural {X Y X' Y' : Type u} (f : X ⟶ Y) (g : X' ⟶ Y') :
     (Finsupp.mapDomain f (Finsupp.single x 1) ⊗ₜ[R] Finsupp.mapDomain g (Finsupp.single x' 1)) _
     = (Finsupp.mapDomain (f ⊗ g) (finsuppTensorFinsupp' R X X'
     (Finsupp.single x 1 ⊗ₜ[R] Finsupp.single x' 1))) _
+
+  -- extra `rfl` after leanprover/lean4#2466
   simp_rw [Finsupp.mapDomain_single, finsuppTensorFinsupp'_single_tmul_single, mul_one,
-    Finsupp.mapDomain_single, CategoryTheory.tensor_apply]
+    Finsupp.mapDomain_single, CategoryTheory.tensor_apply]; rfl
 #align Module.free.μ_natural ModuleCat.Free.μ_natural
 
 theorem left_unitality (X : Type u) :
@@ -175,8 +178,9 @@ theorem associativity (X Y Z : Type u) :
     finsuppTensorFinsupp' R X (Y ⊗ Z)
     (Finsupp.single x 1 ⊗ₜ[R]
       finsuppTensorFinsupp' R Y Z (Finsupp.single y 1 ⊗ₜ[R] Finsupp.single z 1)) a
+  -- extra `rfl` after leanprover/lean4#2466
   simp_rw [finsuppTensorFinsupp'_single_tmul_single, Finsupp.mapDomain_single, mul_one,
-    CategoryTheory.associator_hom_apply]
+    CategoryTheory.associator_hom_apply]; rfl
 #align Module.free.associativity ModuleCat.Free.associativity
 
 -- In fact, it's strong monoidal, but we don't yet have a typeclass for that.
@@ -422,5 +426,4 @@ def liftUnique (F : C ⥤ D) (L : Free R C ⥤ D) [L.Additive] [L.Linear R]
 #align category_theory.Free.lift_unique CategoryTheory.Free.liftUnique
 
 end Free
-
 end CategoryTheory
chore: drop MulZeroClass. in mul_zero/zero_mul (#6682)

Search&replace MulZeroClass.mul_zero -> mul_zero, MulZeroClass.zero_mul -> zero_mul.

These were introduced by Mathport, as the full name of mul_zero is actually MulZeroClass.mul_zero (it's exported with the short name).

Diff
@@ -270,7 +270,7 @@ instance categoryFree : Category (Free R C) where
     -- This imitates the proof of associativity for `MonoidAlgebra`.
     simp only [sum_sum_index, sum_single_index, single_zero, single_add, eq_self_iff_true,
       forall_true_iff, forall₃_true_iff, add_mul, mul_add, Category.assoc, mul_assoc,
-      MulZeroClass.zero_mul, MulZeroClass.mul_zero, sum_zero, sum_add]
+      zero_mul, mul_zero, sum_zero, sum_add]
 #align category_theory.category_Free CategoryTheory.categoryFree
 
 namespace Free
chore: remove unused simps (#6632)

Co-authored-by: Eric Wieser <wieser.eric@gmail.com>

Diff
@@ -124,7 +124,7 @@ theorem left_unitality (X : Type u) :
   change q x' = Finsupp.mapDomain (λ_ X).hom (finsuppTensorFinsupp' R (𝟙_ (Type u)) X
     (Finsupp.single PUnit.unit 1 ⊗ₜ[R] Finsupp.single x 1)) x'
   simp_rw [finsuppTensorFinsupp'_single_tmul_single,
-    ModuleCat.MonoidalCategory.leftUnitor_hom_apply, Finsupp.smul_single', mul_one,
+    ModuleCat.MonoidalCategory.leftUnitor_hom_apply, mul_one,
     Finsupp.mapDomain_single, CategoryTheory.leftUnitor_hom_apply, one_smul]
 #align Module.free.left_unitality ModuleCat.Free.left_unitality
 
@@ -145,7 +145,7 @@ theorem right_unitality (X : Type u) :
   change q x' = Finsupp.mapDomain (ρ_ X).hom (finsuppTensorFinsupp' R X (𝟙_ (Type u))
     (Finsupp.single x 1 ⊗ₜ[R] Finsupp.single PUnit.unit 1)) x'
   simp_rw [finsuppTensorFinsupp'_single_tmul_single,
-    ModuleCat.MonoidalCategory.rightUnitor_hom_apply, Finsupp.smul_single', mul_one,
+    ModuleCat.MonoidalCategory.rightUnitor_hom_apply, mul_one,
     Finsupp.mapDomain_single, CategoryTheory.rightUnitor_hom_apply, one_smul]
 #align Module.free.right_unitality ModuleCat.Free.right_unitality
 
chore: banish Type _ and Sort _ (#6499)

We remove all possible occurences of Type _ and Sort _ in favor of Type* and Sort*.

This has nice performance benefits.

Diff
@@ -240,7 +240,7 @@ of the morphisms in `C`.
 -/
 -- Porting note: Removed has_nonempty_instance nolint
 @[nolint unusedArguments]
-def Free (_ : Type _) (C : Type u) :=
+def Free (_ : Type*) (C : Type u) :=
   C
 #align category_theory.Free CategoryTheory.Free
 
@@ -249,11 +249,11 @@ def Free (_ : Type _) (C : Type u) :=
 It may be preferable to use `(Free.embedding R C).obj X` instead;
 this functor can also be used to lift morphisms.
 -/
-def Free.of (R : Type _) {C : Type u} (X : C) : Free R C :=
+def Free.of (R : Type*) {C : Type u} (X : C) : Free R C :=
   X
 #align category_theory.Free.of CategoryTheory.Free.of
 
-variable (R : Type _) [CommRing R] (C : Type u) [Category.{v} C]
+variable (R : Type*) [CommRing R] (C : Type u) [Category.{v} C]
 
 open Finsupp
 
chore: script to replace headers with #align_import statements (#5979)

Open in Gitpod

Co-authored-by: Eric Wieser <wieser.eric@gmail.com> Co-authored-by: Scott Morrison <scott.morrison@gmail.com>

Diff
@@ -2,11 +2,6 @@
 Copyright (c) 2021 Scott Morrison. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Scott Morrison, Johan Commelin
-
-! This file was ported from Lean 3 source module algebra.category.Module.adjunctions
-! leanprover-community/mathlib commit 95a87616d63b3cb49d3fe678d416fbe9c4217bf4
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathlib.Algebra.Category.ModuleCat.Monoidal.Basic
 import Mathlib.CategoryTheory.Monoidal.Functorial
@@ -14,6 +9,8 @@ import Mathlib.CategoryTheory.Monoidal.Types.Basic
 import Mathlib.LinearAlgebra.DirectSum.Finsupp
 import Mathlib.CategoryTheory.Linear.LinearFunctor
 
+#align_import algebra.category.Module.adjunctions from "leanprover-community/mathlib"@"95a87616d63b3cb49d3fe678d416fbe9c4217bf4"
+
 /-!
 The functor of forming finitely supported functions on a type with values in a `[Ring R]`
 is the left adjoint of
chore: remove occurrences of semicolon after space (#5713)

This is the second half of the changes originally in #5699, removing all occurrences of ; after a space and implementing a linter rule to enforce it.

In most cases this 2-character substring has a space after it, so the following command was run first:

find . -type f -name "*.lean" -exec sed -i -E 's/ ; /; /g' {} \;

The remaining cases were few enough in number that they were done manually.

Diff
@@ -45,8 +45,8 @@ free `R`-module with generators `x : X`, implemented as the type `X →₀ R`.
 def free : Type u ⥤ ModuleCat R where
   obj X := ModuleCat.of R (X →₀ R)
   map {X Y} f := Finsupp.lmapDomain _ _ f
-  map_id := by intros ; exact Finsupp.lmapDomain_id _ _
-  map_comp := by intros ; exact Finsupp.lmapDomain_comp _ _ _ _
+  map_id := by intros; exact Finsupp.lmapDomain_id _ _
+  map_comp := by intros; exact Finsupp.lmapDomain_comp _ _ _ _
 #align Module.free ModuleCat.free
 
 /-- The free-forgetful adjunction for R-modules.
@@ -348,10 +348,10 @@ def lift (F : C ⥤ D) : Free R C ⥤ D where
       dsimp at *
       rw [Finsupp.sum_add_index', Finsupp.sum_add_index']
       · simp only [w₁, w₂, add_comp]
-      · intros ; rw [zero_smul]
-      · intros ; simp only [add_smul]
-      · intros ; rw [zero_smul]
-      · intros ; simp only [add_smul]
+      · intros; rw [zero_smul]
+      · intros; simp only [add_smul]
+      · intros; rw [zero_smul]
+      · intros; simp only [add_smul]
     · intro f' r
       apply Finsupp.induction_linear g
       · -- Porting note: simp used to be able to close this goal
@@ -362,10 +362,10 @@ def lift (F : C ⥤ D) : Free R C ⥤ D where
         dsimp at *
         rw [Finsupp.sum_add_index', Finsupp.sum_add_index']
         · simp only [w₁, w₂, comp_add]
-        · intros ; rw [zero_smul]
-        · intros ; simp only [add_smul]
-        · intros ; rw [zero_smul]
-        · intros ; simp only [add_smul]
+        · intros; rw [zero_smul]
+        · intros; simp only [add_smul]
+        · intros; rw [zero_smul]
+        · intros; simp only [add_smul]
       · intro g' s
         rw [single_comp_single _ _ f' g' r s]
         simp [mul_comm r s, mul_smul]
chore: remove superfluous parentheses in calls to ext (#5258)

Co-authored-by: Xavier Roblot <46200072+xroblot@users.noreply.github.com> Co-authored-by: Joël Riou <joel.riou@universite-paris-saclay.fr> Co-authored-by: Riccardo Brasca <riccardo.brasca@gmail.com> Co-authored-by: Yury G. Kudryashov <urkud@urkud.name> Co-authored-by: Scott Morrison <scott.morrison@anu.edu.au> Co-authored-by: Scott Morrison <scott.morrison@gmail.com> Co-authored-by: Jeremy Tan Jie Rui <reddeloostw@gmail.com> Co-authored-by: Pol'tta / Miyahara Kō <pol_tta@outlook.jp> Co-authored-by: Jason Yuen <jason_yuen2007@hotmail.com> Co-authored-by: Mario Carneiro <di.gama@gmail.com> Co-authored-by: Jireh Loreaux <loreaujy@gmail.com> Co-authored-by: Ruben Van de Velde <65514131+Ruben-VandeVelde@users.noreply.github.com> Co-authored-by: Kyle Miller <kmill31415@gmail.com> Co-authored-by: Heather Macbeth <25316162+hrmacbeth@users.noreply.github.com> Co-authored-by: Jujian Zhang <jujian.zhang1998@outlook.com> Co-authored-by: Yaël Dillies <yael.dillies@gmail.com>

Diff
@@ -291,7 +291,7 @@ instance : Preadditive (Free R C) where
   comp_add X Y Z f g g' := by
     dsimp [CategoryTheory.categoryFree]
     rw [← Finsupp.sum_add]
-    congr ; ext (r h)
+    congr; ext r h
     rw [Finsupp.sum_add_index'] <;> · simp [mul_add]
 
 instance : Linear R (Free R C) where
@@ -302,7 +302,7 @@ instance : Linear R (Free R C) where
   comp_smul X Y Z f r g := by
     dsimp [CategoryTheory.categoryFree]
     simp_rw [Finsupp.smul_sum]
-    congr ; ext (h s)
+    congr; ext h s
     rw [Finsupp.sum_smul_index] <;> simp [Finsupp.smul_sum, mul_left_comm]
 
 theorem single_comp_single {X Y Z : C} (f : X ⟶ Y) (g : Y ⟶ Z) (r s : R) :
chore: review of automation in category theory (#4793)

Clean up of automation in the category theory library. Leaving out unnecessary proof steps, or fields done by aesop_cat, and making more use of available autoparameters.

Co-authored-by: Scott Morrison <scott.morrison@anu.edu.au>

Diff
@@ -391,7 +391,7 @@ instance lift_linear (F : C ⥤ D) : (lift R F).Linear R where
 is isomorphic to the original functor.
 -/
 def embeddingLiftIso (F : C ⥤ D) : embedding R C ⋙ lift R F ≅ F :=
-  NatIso.ofComponents (fun X => Iso.refl _) (by aesop_cat)
+  NatIso.ofComponents fun X => Iso.refl _
 #align category_theory.Free.embedding_lift_iso CategoryTheory.Free.embeddingLiftIso
 
 /-- Two `R`-linear functors out of the `R`-linear completion are isomorphic iff their
feat: port CategoryTheory.Bicategory.CoherenceTactic (#4610)

Co-authored-by: Scott Morrison <scott.morrison@gmail.com> Co-authored-by: Scott Morrison <scott.morrison@anu.edu.au>

Diff
@@ -67,6 +67,8 @@ end
 
 namespace Free
 
+open MonoidalCategory
+
 variable [CommRing R]
 
 attribute [local ext] TensorProduct.ext
@@ -214,6 +216,8 @@ instance : IsIso (@LaxMonoidal.ε _ _ _ _ _ _ (free R).obj _ _) := by
 
 end Free
 
+open MonoidalCategory
+
 variable [CommRing R]
 
 /-- The free functor `Type u ⥤ ModuleCat R`, as a monoidal functor. -/
feat: port Algebra.Category.ModuleCat.Adjunctions (#4457)

Dependencies 8 + 548

549 files ported (98.6%)
214900 lines ported (98.6%)
Show graph

The unported dependencies are