representation_theory.RepMathlib.RepresentationTheory.Rep

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)

(last sync)

Changes in mathlib3port

mathlib3
mathlib3port
Diff
@@ -4,11 +4,11 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Scott Morrison
 -/
 import RepresentationTheory.Basic
-import RepresentationTheory.Action
-import Algebra.Category.Module.Abelian
-import Algebra.Category.Module.Colimits
-import Algebra.Category.Module.Monoidal.Closed
-import Algebra.Category.Module.Adjunctions
+import RepresentationTheory.Action.Basic
+import Algebra.Category.ModuleCat.Abelian
+import Algebra.Category.ModuleCat.Colimits
+import Algebra.Category.ModuleCat.Monoidal.Closed
+import Algebra.Category.ModuleCat.Adjunctions
 import CategoryTheory.Closed.FunctorCategory
 
 #align_import representation_theory.Rep from "leanprover-community/mathlib"@"1b089e3bdc3ce6b39cd472543474a0a137128c6c"
Diff
@@ -37,7 +37,7 @@ open CategoryTheory
 
 open CategoryTheory.Limits
 
-/- ./././Mathport/Syntax/Translate/Command.lean:339:31: unsupported: @[derive] abbrev -/
+/- ./././Mathport/Syntax/Translate/Command.lean:342:31: unsupported: @[derive] abbrev -/
 #print Rep /-
 /-- The category of `k`-linear representations of a monoid `G`. -/
 abbrev Rep (k G : Type u) [Ring k] [Monoid G] :=
Diff
@@ -37,7 +37,7 @@ open CategoryTheory
 
 open CategoryTheory.Limits
 
-/- ./././Mathport/Syntax/Translate/Command.lean:329:31: unsupported: @[derive] abbrev -/
+/- ./././Mathport/Syntax/Translate/Command.lean:339:31: unsupported: @[derive] abbrev -/
 #print Rep /-
 /-- The category of `k`-linear representations of a monoid `G`. -/
 abbrev Rep (k G : Type u) [Ring k] [Monoid G] :=
Diff
@@ -379,7 +379,7 @@ protected def ihom (A : Rep k G) : Rep k G ⥤ Rep k G
       comm' := fun g =>
         LinearMap.ext fun x =>
           LinearMap.ext fun y => show f.hom (X.ρ g _) = _ by simpa only [hom_comm_apply] }
-  map_id' B := by ext <;> rfl
+  map_id'' B := by ext <;> rfl
   map_comp' B C D f g := by ext <;> rfl
 #align Rep.ihom Rep.ihom
 -/
Diff
@@ -3,13 +3,13 @@ Copyright (c) 2020 Scott Morrison. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Scott Morrison
 -/
-import Mathbin.RepresentationTheory.Basic
-import Mathbin.RepresentationTheory.Action
-import Mathbin.Algebra.Category.Module.Abelian
-import Mathbin.Algebra.Category.Module.Colimits
-import Mathbin.Algebra.Category.Module.Monoidal.Closed
-import Mathbin.Algebra.Category.Module.Adjunctions
-import Mathbin.CategoryTheory.Closed.FunctorCategory
+import RepresentationTheory.Basic
+import RepresentationTheory.Action
+import Algebra.Category.Module.Abelian
+import Algebra.Category.Module.Colimits
+import Algebra.Category.Module.Monoidal.Closed
+import Algebra.Category.Module.Adjunctions
+import CategoryTheory.Closed.FunctorCategory
 
 #align_import representation_theory.Rep from "leanprover-community/mathlib"@"1b089e3bdc3ce6b39cd472543474a0a137128c6c"
 
@@ -37,7 +37,7 @@ open CategoryTheory
 
 open CategoryTheory.Limits
 
-/- ./././Mathport/Syntax/Translate/Command.lean:328:31: unsupported: @[derive] abbrev -/
+/- ./././Mathport/Syntax/Translate/Command.lean:329:31: unsupported: @[derive] abbrev -/
 #print Rep /-
 /-- The category of `k`-linear representations of a monoid `G`. -/
 abbrev Rep (k G : Type u) [Ring k] [Monoid G] :=
Diff
@@ -2,11 +2,6 @@
 Copyright (c) 2020 Scott Morrison. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Scott Morrison
-
-! This file was ported from Lean 3 source module representation_theory.Rep
-! leanprover-community/mathlib commit 1b089e3bdc3ce6b39cd472543474a0a137128c6c
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathbin.RepresentationTheory.Basic
 import Mathbin.RepresentationTheory.Action
@@ -16,6 +11,8 @@ import Mathbin.Algebra.Category.Module.Monoidal.Closed
 import Mathbin.Algebra.Category.Module.Adjunctions
 import Mathbin.CategoryTheory.Closed.FunctorCategory
 
+#align_import representation_theory.Rep from "leanprover-community/mathlib"@"1b089e3bdc3ce6b39cd472543474a0a137128c6c"
+
 /-!
 # `Rep k G` is the category of `k`-linear representations of `G`.
 
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Scott Morrison
 
 ! This file was ported from Lean 3 source module representation_theory.Rep
-! leanprover-community/mathlib commit cec81510e48e579bde6acd8568c06a87af045b63
+! leanprover-community/mathlib commit 1b089e3bdc3ce6b39cd472543474a0a137128c6c
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -19,6 +19,9 @@ import Mathbin.CategoryTheory.Closed.FunctorCategory
 /-!
 # `Rep k G` is the category of `k`-linear representations of `G`.
 
+> THIS FILE IS SYNCHRONIZED WITH MATHLIB4.
+> Any changes to this file require a corresponding PR to mathlib4.
+
 If `V : Rep k G`, there is a coercion that allows you to treat `V` as a type,
 and this type comes equipped with a `module k V` instance.
 Also `V.ρ` gives the homomorphism `G →* (V →ₗ[k] V)`.
Diff
@@ -38,10 +38,12 @@ open CategoryTheory
 open CategoryTheory.Limits
 
 /- ./././Mathport/Syntax/Translate/Command.lean:328:31: unsupported: @[derive] abbrev -/
+#print Rep /-
 /-- The category of `k`-linear representations of a monoid `G`. -/
 abbrev Rep (k G : Type u) [Ring k] [Monoid G] :=
   Action (ModuleCat.{u} k) (MonCat.of G)
 #align Rep Rep
+-/
 
 instance (k G : Type u) [CommRing k] [Monoid G] : Linear k (Rep k G) := by infer_instance
 
@@ -62,129 +64,168 @@ instance (V : Rep k G) : AddCommGroup V := by
 instance (V : Rep k G) : Module k V := by change Module k ((forget₂ (Rep k G) (ModuleCat k)).obj V);
   infer_instance
 
+#print Rep.ρ /-
 /-- Specialize the existing `Action.ρ`, changing the type to `representation k G V`.
 -/
 def ρ (V : Rep k G) : Representation k G V :=
   V.ρ
 #align Rep.ρ Rep.ρ
+-/
 
+#print Rep.of /-
 /-- Lift an unbundled representation to `Rep`. -/
 def of {V : Type u} [AddCommGroup V] [Module k V] (ρ : G →* V →ₗ[k] V) : Rep k G :=
   ⟨ModuleCat.of k V, ρ⟩
 #align Rep.of Rep.of
+-/
 
+#print Rep.coe_of /-
 @[simp]
 theorem coe_of {V : Type u} [AddCommGroup V] [Module k V] (ρ : G →* V →ₗ[k] V) :
     (of ρ : Type u) = V :=
   rfl
 #align Rep.coe_of Rep.coe_of
+-/
 
+#print Rep.of_ρ /-
 @[simp]
 theorem of_ρ {V : Type u} [AddCommGroup V] [Module k V] (ρ : G →* V →ₗ[k] V) : (of ρ).ρ = ρ :=
   rfl
 #align Rep.of_ρ Rep.of_ρ
+-/
 
+#print Rep.Action_ρ_eq_ρ /-
 theorem Action_ρ_eq_ρ {A : Rep k G} : Action.ρ A = A.ρ :=
   rfl
 #align Rep.Action_ρ_eq_ρ Rep.Action_ρ_eq_ρ
+-/
 
+#print Rep.of_ρ_apply /-
 /-- Allows us to apply lemmas about the underlying `ρ`, which would take an element `g : G` rather
 than `g : Mon.of G` as an argument. -/
 theorem of_ρ_apply {V : Type u} [AddCommGroup V] [Module k V] (ρ : Representation k G V)
     (g : MonCat.of G) : (Rep.of ρ).ρ g = ρ (g : G) :=
   rfl
 #align Rep.of_ρ_apply Rep.of_ρ_apply
+-/
 
+#print Rep.ρ_inv_self_apply /-
 @[simp]
 theorem ρ_inv_self_apply {G : Type u} [Group G] (A : Rep k G) (g : G) (x : A) :
     A.ρ g⁻¹ (A.ρ g x) = x :=
   show (A.ρ g⁻¹ * A.ρ g) x = x by rw [← map_mul, inv_mul_self, map_one, LinearMap.one_apply]
 #align Rep.ρ_inv_self_apply Rep.ρ_inv_self_apply
+-/
 
+#print Rep.ρ_self_inv_apply /-
 @[simp]
 theorem ρ_self_inv_apply {G : Type u} [Group G] {A : Rep k G} (g : G) (x : A) :
     A.ρ g (A.ρ g⁻¹ x) = x :=
   show (A.ρ g * A.ρ g⁻¹) x = x by rw [← map_mul, mul_inv_self, map_one, LinearMap.one_apply]
 #align Rep.ρ_self_inv_apply Rep.ρ_self_inv_apply
+-/
 
+#print Rep.hom_comm_apply /-
 theorem hom_comm_apply {A B : Rep k G} (f : A ⟶ B) (g : G) (x : A) :
     f.hom (A.ρ g x) = B.ρ g (f.hom x) :=
   LinearMap.ext_iff.1 (f.comm g) x
 #align Rep.hom_comm_apply Rep.hom_comm_apply
+-/
 
 variable (k G)
 
+#print Rep.trivial /-
 /-- The trivial `k`-linear `G`-representation on a `k`-module `V.` -/
 def trivial (V : Type u) [AddCommGroup V] [Module k V] : Rep k G :=
   Rep.of (@Representation.trivial k G V _ _ _ _)
 #align Rep.trivial Rep.trivial
+-/
 
 variable {k G}
 
+#print Rep.trivial_def /-
 theorem trivial_def {V : Type u} [AddCommGroup V] [Module k V] (g : G) (v : V) :
     (trivial k G V).ρ g v = v :=
   rfl
 #align Rep.trivial_def Rep.trivial_def
+-/
 
 -- Verify that limits are calculated correctly.
 noncomputable example : PreservesLimits (forget₂ (Rep k G) (ModuleCat.{u} k)) := by infer_instance
 
 noncomputable example : PreservesColimits (forget₂ (Rep k G) (ModuleCat.{u} k)) := by infer_instance
 
+#print Rep.MonoidalCategory.braiding_hom_apply /-
 @[simp]
 theorem MonoidalCategory.braiding_hom_apply {A B : Rep k G} (x : A) (y : B) :
     Action.Hom.hom (β_ A B).hom (TensorProduct.tmul k x y) = TensorProduct.tmul k y x :=
   rfl
 #align Rep.monoidal_category.braiding_hom_apply Rep.MonoidalCategory.braiding_hom_apply
+-/
 
+#print Rep.MonoidalCategory.braiding_inv_apply /-
 @[simp]
 theorem MonoidalCategory.braiding_inv_apply {A B : Rep k G} (x : A) (y : B) :
     Action.Hom.hom (β_ A B).inv (TensorProduct.tmul k y x) = TensorProduct.tmul k x y :=
   rfl
 #align Rep.monoidal_category.braiding_inv_apply Rep.MonoidalCategory.braiding_inv_apply
+-/
 
 section Linearization
 
 variable (k G)
 
+#print Rep.linearization /-
 /-- The monoidal functor sending a type `H` with a `G`-action to the induced `k`-linear
 `G`-representation on `k[H].` -/
 noncomputable def linearization : MonoidalFunctor (Action (Type u) (MonCat.of G)) (Rep k G) :=
   (ModuleCat.monoidalFree k).mapAction (MonCat.of G)
 #align Rep.linearization Rep.linearization
+-/
 
 variable {k G}
 
+#print Rep.linearization_obj_ρ /-
 @[simp]
 theorem linearization_obj_ρ (X : Action (Type u) (MonCat.of G)) (g : G) (x : X.V →₀ k) :
     ((linearization k G).obj X).ρ g x = Finsupp.lmapDomain k k (X.ρ g) x :=
   rfl
 #align Rep.linearization_obj_ρ Rep.linearization_obj_ρ
+-/
 
+#print Rep.linearization_of /-
 @[simp]
 theorem linearization_of (X : Action (Type u) (MonCat.of G)) (g : G) (x : X.V) :
     ((linearization k G).obj X).ρ g (Finsupp.single x (1 : k)) = Finsupp.single (X.ρ g x) (1 : k) :=
   by rw [linearization_obj_ρ, Finsupp.lmapDomain_apply, Finsupp.mapDomain_single]
 #align Rep.linearization_of Rep.linearization_of
+-/
 
 variable {X Y : Action (Type u) (MonCat.of G)} (f : X ⟶ Y)
 
+#print Rep.linearization_map_hom /-
 @[simp]
 theorem linearization_map_hom : ((linearization k G).map f).hom = Finsupp.lmapDomain k k f.hom :=
   rfl
 #align Rep.linearization_map_hom Rep.linearization_map_hom
+-/
 
+#print Rep.linearization_map_hom_single /-
 theorem linearization_map_hom_single (x : X.V) (r : k) :
     ((linearization k G).map f).hom (Finsupp.single x r) = Finsupp.single (f.hom x) r := by
   rw [linearization_map_hom, Finsupp.lmapDomain_apply, Finsupp.mapDomain_single]
 #align Rep.linearization_map_hom_single Rep.linearization_map_hom_single
+-/
 
+#print Rep.linearization_μ_hom /-
 @[simp]
 theorem linearization_μ_hom (X Y : Action (Type u) (MonCat.of G)) :
     ((linearization k G).μ X Y).hom = (finsuppTensorFinsupp' k X.V Y.V).toLinearMap :=
   rfl
 #align Rep.linearization_μ_hom Rep.linearization_μ_hom
+-/
 
+#print Rep.linearization_μ_inv_hom /-
 @[simp]
 theorem linearization_μ_inv_hom (X Y : Action (Type u) (MonCat.of G)) :
     (inv ((linearization k G).μ X Y)).hom = (finsuppTensorFinsupp' k X.V Y.V).symm.toLinearMap :=
@@ -193,12 +234,16 @@ theorem linearization_μ_inv_hom (X Y : Action (Type u) (MonCat.of G)) :
   apply is_iso.inv_eq_of_hom_inv_id _
   exact LinearMap.ext fun x => LinearEquiv.symm_apply_apply _ _
 #align Rep.linearization_μ_inv_hom Rep.linearization_μ_inv_hom
+-/
 
+#print Rep.linearization_ε_hom /-
 @[simp]
 theorem linearization_ε_hom : (linearization k G).ε.hom = Finsupp.lsingle PUnit.unit :=
   rfl
 #align Rep.linearization_ε_hom Rep.linearization_ε_hom
+-/
 
+#print Rep.linearization_ε_inv_hom_apply /-
 @[simp]
 theorem linearization_ε_inv_hom_apply (r : k) :
     (inv (linearization k G).ε).hom (Finsupp.single PUnit.unit r) = r :=
@@ -207,9 +252,11 @@ theorem linearization_ε_inv_hom_apply (r : k) :
   rw [← Finsupp.lsingle_apply PUnit.unit r]
   apply is_iso.hom_inv_id_apply _ _
 #align Rep.linearization_ε_inv_hom_apply Rep.linearization_ε_inv_hom_apply
+-/
 
 variable (k G)
 
+#print Rep.linearizationTrivialIso /-
 /-- The linearization of a type `X` on which `G` acts trivially is the trivial `G`-representation
 on `k[X]`. -/
 @[simps]
@@ -217,34 +264,44 @@ noncomputable def linearizationTrivialIso (X : Type u) :
     (linearization k G).obj (Action.mk X 1) ≅ trivial k G (X →₀ k) :=
   Action.mkIso (Iso.refl _) fun g => by ext1; ext1; exact linearization_of _ _ _
 #align Rep.linearization_trivial_iso Rep.linearizationTrivialIso
+-/
 
 variable (k G)
 
+#print Rep.ofMulAction /-
 /-- Given a `G`-action on `H`, this is `k[H]` bundled with the natural representation
 `G →* End(k[H])` as a term of type `Rep k G`. -/
 noncomputable abbrev ofMulAction (H : Type u) [MulAction G H] : Rep k G :=
   of <| Representation.ofMulAction k G H
 #align Rep.of_mul_action Rep.ofMulAction
+-/
 
+#print Rep.leftRegular /-
 /-- The `k`-linear `G`-representation on `k[G]`, induced by left multiplication. -/
 noncomputable def leftRegular : Rep k G :=
   ofMulAction k G G
 #align Rep.left_regular Rep.leftRegular
+-/
 
+#print Rep.diagonal /-
 /-- The `k`-linear `G`-representation on `k[Gⁿ]`, induced by left multiplication. -/
 noncomputable def diagonal (n : ℕ) : Rep k G :=
   ofMulAction k G (Fin n → G)
 #align Rep.diagonal Rep.diagonal
+-/
 
+#print Rep.linearizationOfMulActionIso /-
 /-- The linearization of a type `H` with a `G`-action is definitionally isomorphic to the
 `k`-linear `G`-representation on `k[H]` induced by the `G`-action on `H`. -/
 noncomputable def linearizationOfMulActionIso (H : Type u) [MulAction G H] :
     (linearization k G).obj (Action.ofMulAction G H) ≅ ofMulAction k G H :=
   Iso.refl _
 #align Rep.linearization_of_mul_action_iso Rep.linearizationOfMulActionIso
+-/
 
 variable {k G}
 
+#print Rep.leftRegularHom /-
 /-- Given an element `x : A`, there is a natural morphism of representations `k[G] ⟶ A` sending
 `g ↦ A.ρ(g)(x).` -/
 @[simps]
@@ -257,13 +314,17 @@ noncomputable def leftRegularHom (A : Rep k G) (x : A) : Rep.ofMulAction k G G 
       Action_ρ_eq_ρ, of_ρ_apply, Representation.ofMulAction_single, Finsupp.sum_single_index,
       zero_smul, one_smul, smul_eq_mul, A.ρ.map_mul]
 #align Rep.left_regular_hom Rep.leftRegularHom
+-/
 
+#print Rep.leftRegularHom_apply /-
 theorem leftRegularHom_apply {A : Rep k G} (x : A) :
     (leftRegularHom A x).hom (Finsupp.single 1 1) = x := by
   simpa only [left_regular_hom_hom, Finsupp.lift_apply, Finsupp.sum_single_index, one_smul,
     A.ρ.map_one, zero_smul]
 #align Rep.left_regular_hom_apply Rep.leftRegularHom_apply
+-/
 
+#print Rep.leftRegularHomEquiv /-
 /-- Given a `k`-linear `G`-representation `A`, there is a `k`-linear isomorphism between
 representation morphisms `Hom(k[G], A)` and `A`. -/
 @[simps]
@@ -285,12 +346,15 @@ noncomputable def leftRegularHomEquiv (A : Rep k G) : (Rep.ofMulAction k G G ⟶
       Representation.ofMulAction_single x (1 : G) (1 : k), smul_eq_mul, mul_one]
   right_inv x := leftRegularHom_apply x
 #align Rep.left_regular_hom_equiv Rep.leftRegularHomEquiv
+-/
 
+#print Rep.leftRegularHomEquiv_symm_single /-
 theorem leftRegularHomEquiv_symm_single {A : Rep k G} (x : A) (g : G) :
     ((leftRegularHomEquiv A).symm x).hom (Finsupp.single g 1) = A.ρ g x := by
   simp only [left_regular_hom_equiv_symm_apply, left_regular_hom_hom, Finsupp.lift_apply,
     Finsupp.sum_single_index, zero_smul, one_smul]
 #align Rep.left_regular_hom_equiv_symm_single Rep.leftRegularHomEquiv_symm_single
+-/
 
 end Linearization
 
@@ -302,6 +366,7 @@ open Action
 
 variable [Group G] (A B C : Rep k G)
 
+#print Rep.ihom /-
 /-- Given a `k`-linear `G`-representation `(A, ρ₁)`, this is the 'internal Hom' functor sending
 `(B, ρ₂)` to the representation `Homₖ(A, B)` that maps `g : G` and `f : A →ₗ[k] B` to
 `(ρ₂ g) ∘ₗ f ∘ₗ (ρ₁ g⁻¹)`. -/
@@ -317,14 +382,18 @@ protected def ihom (A : Rep k G) : Rep k G ⥤ Rep k G
   map_id' B := by ext <;> rfl
   map_comp' B C D f g := by ext <;> rfl
 #align Rep.ihom Rep.ihom
+-/
 
+#print Rep.ihom_obj_ρ_apply /-
 @[simp]
 protected theorem ihom_obj_ρ_apply {A B : Rep k G} (g : G) (x : A →ₗ[k] B) :
     ((Rep.ihom A).obj B).ρ g x = B.ρ g ∘ₗ x ∘ₗ A.ρ g⁻¹ :=
   rfl
 #align Rep.ihom_obj_ρ_apply Rep.ihom_obj_ρ_apply
+-/
 
 /- ./././Mathport/Syntax/Translate/Expr.lean:177:8: unsupported: ambiguous notation -/
+#print Rep.homEquiv /-
 /-- Given a `k`-linear `G`-representation `A`, this is the Hom-set bijection in the adjunction
 `A ⊗ - ⊣ ihom(A, -)`. It sends `f : A ⊗ B ⟶ C` to a `Rep k G` morphism defined by currying the
 `k`-linear map underlying `f`, giving a map `A →ₗ[k] B →ₗ[k] C`, then flipping the arguments. -/
@@ -351,6 +420,7 @@ protected def homEquiv (A B C : Rep k G) : (A ⊗ B ⟶ C) ≃ (B ⟶ (Rep.ihom
   left_inv f := Action.Hom.ext _ _ (TensorProduct.ext' fun x y => rfl)
   right_inv f := by ext <;> rfl
 #align Rep.hom_equiv Rep.homEquiv
+-/
 
 instance : MonoidalClosed (Rep k G)
     where closed' A :=
@@ -363,30 +433,39 @@ instance : MonoidalClosed (Rep k G)
                 homEquiv_naturality_left_symm := fun X Y Z f g => by ext <;> rfl
                 homEquiv_naturality_right := fun X Y Z f g => by ext <;> rfl } } }
 
+#print Rep.ihom_obj_ρ_def /-
 @[simp]
 theorem ihom_obj_ρ_def (A B : Rep k G) : ((ihom A).obj B).ρ = ((Rep.ihom A).obj B).ρ :=
   rfl
 #align Rep.ihom_obj_ρ_def Rep.ihom_obj_ρ_def
+-/
 
+#print Rep.homEquiv_def /-
 @[simp]
 theorem homEquiv_def (A B C : Rep k G) : (ihom.adjunction A).homEquiv B C = Rep.homEquiv A B C :=
   rfl
 #align Rep.hom_equiv_def Rep.homEquiv_def
+-/
 
+#print Rep.ihom_ev_app_hom /-
 @[simp]
 theorem ihom_ev_app_hom (A B : Rep k G) :
     Action.Hom.hom ((ihom.ev A).app B) = TensorProduct.uncurry _ _ _ _ LinearMap.id.flip := by
   ext <;> rfl
 #align Rep.ihom_ev_app_hom Rep.ihom_ev_app_hom
+-/
 
+#print Rep.ihom_coev_app_hom /-
 @[simp]
 theorem ihom_coev_app_hom (A B : Rep k G) :
     Action.Hom.hom ((ihom.coev A).app B) = (TensorProduct.mk _ _ _).flip := by ext <;> rfl
 #align Rep.ihom_coev_app_hom Rep.ihom_coev_app_hom
+-/
 
 variable (A B C)
 
 /- ./././Mathport/Syntax/Translate/Expr.lean:177:8: unsupported: ambiguous notation -/
+#print Rep.MonoidalClosed.linearHomEquiv /-
 /-- There is a `k`-linear isomorphism between the sets of representation morphisms`Hom(A ⊗ B, C)`
 and `Hom(B, Homₖ(A, C))`. -/
 def MonoidalClosed.linearHomEquiv : (A ⊗ B ⟶ C) ≃ₗ[k] B ⟶ A ⟶[Rep k G] C :=
@@ -396,41 +475,52 @@ def MonoidalClosed.linearHomEquiv : (A ⊗ B ⟶ C) ≃ₗ[k] B ⟶ A ⟶[Rep k
     map_add' := fun f g => rfl
     map_smul' := fun r f => rfl }
 #align Rep.monoidal_closed.linear_hom_equiv Rep.MonoidalClosed.linearHomEquiv
+-/
 
 /- ./././Mathport/Syntax/Translate/Expr.lean:177:8: unsupported: ambiguous notation -/
+#print Rep.MonoidalClosed.linearHomEquivComm /-
 /-- There is a `k`-linear isomorphism between the sets of representation morphisms`Hom(A ⊗ B, C)`
 and `Hom(A, Homₖ(B, C))`. -/
 def MonoidalClosed.linearHomEquivComm : (A ⊗ B ⟶ C) ≃ₗ[k] A ⟶ B ⟶[Rep k G] C :=
   Linear.homCongr k (β_ A B) (Iso.refl _) ≪≫ₗ MonoidalClosed.linearHomEquiv _ _ _
 #align Rep.monoidal_closed.linear_hom_equiv_comm Rep.MonoidalClosed.linearHomEquivComm
+-/
 
 variable {A B C}
 
 /- ./././Mathport/Syntax/Translate/Expr.lean:177:8: unsupported: ambiguous notation -/
+#print Rep.MonoidalClosed.linearHomEquiv_hom /-
 @[simp]
 theorem MonoidalClosed.linearHomEquiv_hom (f : A ⊗ B ⟶ C) :
     (MonoidalClosed.linearHomEquiv A B C f).hom = (TensorProduct.curry f.hom).flip :=
   rfl
 #align Rep.monoidal_closed.linear_hom_equiv_hom Rep.MonoidalClosed.linearHomEquiv_hom
+-/
 
 /- ./././Mathport/Syntax/Translate/Expr.lean:177:8: unsupported: ambiguous notation -/
+#print Rep.MonoidalClosed.linearHomEquivComm_hom /-
 @[simp]
 theorem MonoidalClosed.linearHomEquivComm_hom (f : A ⊗ B ⟶ C) :
     (MonoidalClosed.linearHomEquivComm A B C f).hom = TensorProduct.curry f.hom :=
   rfl
 #align Rep.monoidal_closed.linear_hom_equiv_comm_hom Rep.MonoidalClosed.linearHomEquivComm_hom
+-/
 
+#print Rep.MonoidalClosed.linearHomEquiv_symm_hom /-
 @[simp]
 theorem MonoidalClosed.linearHomEquiv_symm_hom (f : B ⟶ A ⟶[Rep k G] C) :
     ((MonoidalClosed.linearHomEquiv A B C).symm f).hom = TensorProduct.uncurry k A B C f.hom.flip :=
   rfl
 #align Rep.monoidal_closed.linear_hom_equiv_symm_hom Rep.MonoidalClosed.linearHomEquiv_symm_hom
+-/
 
+#print Rep.MonoidalClosed.linearHomEquivComm_symm_hom /-
 @[simp]
 theorem MonoidalClosed.linearHomEquivComm_symm_hom (f : A ⟶ B ⟶[Rep k G] C) :
     ((MonoidalClosed.linearHomEquivComm A B C).symm f).hom = TensorProduct.uncurry k A B C f.hom :=
   by ext <;> rfl
 #align Rep.monoidal_closed.linear_hom_equiv_comm_symm_hom Rep.MonoidalClosed.linearHomEquivComm_symm_hom
+-/
 
 end MonoidalClosed
 
@@ -442,18 +532,24 @@ variable {k G : Type u} [CommRing k] [Monoid G] {V W : Type u} [AddCommGroup V]
   [Module k V] [Module k W] (ρ : Representation k G V) (τ : Representation k G W)
 
 /- ./././Mathport/Syntax/Translate/Expr.lean:177:8: unsupported: ambiguous notation -/
+#print Representation.repOfTprodIso /-
 /-- Tautological isomorphism to help Lean in typechecking. -/
 def repOfTprodIso : Rep.of (ρ.tprod τ) ≅ Rep.of ρ ⊗ Rep.of τ :=
   Iso.refl _
 #align representation.Rep_of_tprod_iso Representation.repOfTprodIso
+-/
 
+#print Representation.repOfTprodIso_apply /-
 theorem repOfTprodIso_apply (x : TensorProduct k V W) : (repOfTprodIso ρ τ).hom.hom x = x :=
   rfl
 #align representation.Rep_of_tprod_iso_apply Representation.repOfTprodIso_apply
+-/
 
+#print Representation.repOfTprodIso_inv_apply /-
 theorem repOfTprodIso_inv_apply (x : TensorProduct k V W) : (repOfTprodIso ρ τ).inv.hom x = x :=
   rfl
 #align representation.Rep_of_tprod_iso_inv_apply Representation.repOfTprodIso_inv_apply
+-/
 
 end Representation
 
@@ -475,6 +571,7 @@ example : MonoidalLinear k (Rep k G) := by infer_instance
 
 noncomputable section
 
+#print Rep.to_Module_monoidAlgebra_map_aux /-
 /-- Auxilliary lemma for `to_Module_monoid_algebra`. -/
 theorem to_Module_monoidAlgebra_map_aux {k G : Type _} [CommRing k] [Monoid G] (V W : Type _)
     [AddCommGroup V] [AddCommGroup W] [Module k V] [Module k W] (ρ : G →* V →ₗ[k] V)
@@ -491,21 +588,27 @@ theorem to_Module_monoidAlgebra_map_aux {k G : Type _} [CommRing k] [Monoid G] (
   · intro r g w
     simp only [AlgHom.map_smul, w, RingHom.id_apply, LinearMap.smul_apply, LinearMap.map_smulₛₗ]
 #align Rep.to_Module_monoid_algebra_map_aux Rep.to_Module_monoidAlgebra_map_aux
+-/
 
+#print Rep.toModuleMonoidAlgebraMap /-
 /-- Auxilliary definition for `to_Module_monoid_algebra`. -/
 def toModuleMonoidAlgebraMap {V W : Rep k G} (f : V ⟶ W) :
     ModuleCat.of (MonoidAlgebra k G) V.ρ.asModule ⟶ ModuleCat.of (MonoidAlgebra k G) W.ρ.asModule :=
   { f.hom with
     map_smul' := fun r x => to_Module_monoidAlgebra_map_aux V.V W.V V.ρ W.ρ f.hom f.comm r x }
 #align Rep.to_Module_monoid_algebra_map Rep.toModuleMonoidAlgebraMap
+-/
 
+#print Rep.toModuleMonoidAlgebra /-
 /-- Functorially convert a representation of `G` into a module over `monoid_algebra k G`. -/
 def toModuleMonoidAlgebra : Rep k G ⥤ ModuleCat.{u} (MonoidAlgebra k G)
     where
   obj V := ModuleCat.of _ V.ρ.asModule
   map V W f := toModuleMonoidAlgebraMap f
 #align Rep.to_Module_monoid_algebra Rep.toModuleMonoidAlgebra
+-/
 
+#print Rep.ofModuleMonoidAlgebra /-
 /-- Functorially convert a module over `monoid_algebra k G` into a representation of `G`. -/
 def ofModuleMonoidAlgebra : ModuleCat.{u} (MonoidAlgebra k G) ⥤ Rep k G
     where
@@ -514,17 +617,23 @@ def ofModuleMonoidAlgebra : ModuleCat.{u} (MonoidAlgebra k G) ⥤ Rep k G
     { hom := { f with map_smul' := fun r x => f.map_smul (algebraMap k _ r) x }
       comm' := fun g => by ext; apply f.map_smul }
 #align Rep.of_Module_monoid_algebra Rep.ofModuleMonoidAlgebra
+-/
 
+#print Rep.ofModuleMonoidAlgebra_obj_coe /-
 theorem ofModuleMonoidAlgebra_obj_coe (M : ModuleCat.{u} (MonoidAlgebra k G)) :
     (ofModuleMonoidAlgebra.obj M : Type u) = RestrictScalars k (MonoidAlgebra k G) M :=
   rfl
 #align Rep.of_Module_monoid_algebra_obj_coe Rep.ofModuleMonoidAlgebra_obj_coe
+-/
 
+#print Rep.ofModuleMonoidAlgebra_obj_ρ /-
 theorem ofModuleMonoidAlgebra_obj_ρ (M : ModuleCat.{u} (MonoidAlgebra k G)) :
     (ofModuleMonoidAlgebra.obj M).ρ = Representation.ofModule k G M :=
   rfl
 #align Rep.of_Module_monoid_algebra_obj_ρ Rep.ofModuleMonoidAlgebra_obj_ρ
+-/
 
+#print Rep.counitIsoAddEquiv /-
 /-- Auxilliary definition for `equivalence_Module_monoid_algebra`. -/
 def counitIsoAddEquiv {M : ModuleCat.{u} (MonoidAlgebra k G)} :
     (ofModuleMonoidAlgebra ⋙ toModuleMonoidAlgebra).obj M ≃+ M :=
@@ -532,7 +641,9 @@ def counitIsoAddEquiv {M : ModuleCat.{u} (MonoidAlgebra k G)} :
   dsimp [of_Module_monoid_algebra, to_Module_monoid_algebra]
   refine' (Representation.ofModule k G ↥M).asModuleEquiv.trans (RestrictScalars.addEquiv _ _ _)
 #align Rep.counit_iso_add_equiv Rep.counitIsoAddEquiv
+-/
 
+#print Rep.unitIsoAddEquiv /-
 /-- Auxilliary definition for `equivalence_Module_monoid_algebra`. -/
 def unitIsoAddEquiv {V : Rep k G} : V ≃+ (toModuleMonoidAlgebra ⋙ ofModuleMonoidAlgebra).obj V :=
   by
@@ -540,7 +651,9 @@ def unitIsoAddEquiv {V : Rep k G} : V ≃+ (toModuleMonoidAlgebra ⋙ ofModuleMo
   refine' V.ρ.as_module_equiv.symm.trans _
   exact (RestrictScalars.addEquiv _ _ _).symm
 #align Rep.unit_iso_add_equiv Rep.unitIsoAddEquiv
+-/
 
+#print Rep.counitIso /-
 /-- Auxilliary definition for `equivalence_Module_monoid_algebra`. -/
 def counitIso (M : ModuleCat.{u} (MonoidAlgebra k G)) :
     (ofModuleMonoidAlgebra ⋙ toModuleMonoidAlgebra).obj M ≅ M :=
@@ -550,7 +663,9 @@ def counitIso (M : ModuleCat.{u} (MonoidAlgebra k G)) :
         dsimp [counit_iso_add_equiv]
         simp }
 #align Rep.counit_iso Rep.counitIso
+-/
 
+#print Rep.unit_iso_comm /-
 theorem unit_iso_comm (V : Rep k G) (g : G) (x : V) :
     unitIsoAddEquiv ((V.ρ g).toFun x) =
       ((ofModuleMonoidAlgebra.obj (toModuleMonoidAlgebra.obj V)).ρ g).toFun (unitIsoAddEquiv x) :=
@@ -559,7 +674,9 @@ theorem unit_iso_comm (V : Rep k G) (g : G) (x : V) :
   simp only [AddEquiv.apply_eq_iff_eq, AddEquiv.apply_symm_apply,
     Representation.asModuleEquiv_symm_map_rho, Representation.ofModule_asModule_act]
 #align Rep.unit_iso_comm Rep.unit_iso_comm
+-/
 
+#print Rep.unitIso /-
 /-- Auxilliary definition for `equivalence_Module_monoid_algebra`. -/
 def unitIso (V : Rep k G) : V ≅ (toModuleMonoidAlgebra ⋙ ofModuleMonoidAlgebra).obj V :=
   Action.mkIso
@@ -571,7 +688,9 @@ def unitIso (V : Rep k G) : V ≅ (toModuleMonoidAlgebra ⋙ ofModuleMonoidAlgeb
             RestrictScalars.addEquiv_symm_map_algebraMap_smul] })
     fun g => by ext; apply unit_iso_comm
 #align Rep.unit_iso Rep.unitIso
+-/
 
+#print Rep.equivalenceModuleMonoidAlgebra /-
 /-- The categorical equivalence `Rep k G ≌ Module (monoid_algebra k G)`. -/
 def equivalenceModuleMonoidAlgebra : Rep k G ≌ ModuleCat.{u} (MonoidAlgebra k G)
     where
@@ -580,6 +699,7 @@ def equivalenceModuleMonoidAlgebra : Rep k G ≌ ModuleCat.{u} (MonoidAlgebra k
   unitIso := NatIso.ofComponents (fun V => unitIso V) (by tidy)
   counitIso := NatIso.ofComponents (fun M => counitIso M) (by tidy)
 #align Rep.equivalence_Module_monoid_algebra Rep.equivalenceModuleMonoidAlgebra
+-/
 
 -- TODO Verify that the equivalence with `Module (monoid_algebra k G)` is a monoidal functor.
 end Rep
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Scott Morrison
 
 ! This file was ported from Lean 3 source module representation_theory.Rep
-! leanprover-community/mathlib commit 74403a3b2551b0970855e14ef5e8fd0d6af1bfc2
+! leanprover-community/mathlib commit cec81510e48e579bde6acd8568c06a87af045b63
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -84,7 +84,6 @@ theorem of_ρ {V : Type u} [AddCommGroup V] [Module k V] (ρ : G →* V →ₗ[k
   rfl
 #align Rep.of_ρ Rep.of_ρ
 
-@[simp]
 theorem Action_ρ_eq_ρ {A : Rep k G} : Action.ρ A = A.ρ :=
   rfl
 #align Rep.Action_ρ_eq_ρ Rep.Action_ρ_eq_ρ
@@ -96,6 +95,23 @@ theorem of_ρ_apply {V : Type u} [AddCommGroup V] [Module k V] (ρ : Representat
   rfl
 #align Rep.of_ρ_apply Rep.of_ρ_apply
 
+@[simp]
+theorem ρ_inv_self_apply {G : Type u} [Group G] (A : Rep k G) (g : G) (x : A) :
+    A.ρ g⁻¹ (A.ρ g x) = x :=
+  show (A.ρ g⁻¹ * A.ρ g) x = x by rw [← map_mul, inv_mul_self, map_one, LinearMap.one_apply]
+#align Rep.ρ_inv_self_apply Rep.ρ_inv_self_apply
+
+@[simp]
+theorem ρ_self_inv_apply {G : Type u} [Group G] {A : Rep k G} (g : G) (x : A) :
+    A.ρ g (A.ρ g⁻¹ x) = x :=
+  show (A.ρ g * A.ρ g⁻¹) x = x by rw [← map_mul, mul_inv_self, map_one, LinearMap.one_apply]
+#align Rep.ρ_self_inv_apply Rep.ρ_self_inv_apply
+
+theorem hom_comm_apply {A B : Rep k G} (f : A ⟶ B) (g : G) (x : A) :
+    f.hom (A.ρ g x) = B.ρ g (f.hom x) :=
+  LinearMap.ext_iff.1 (f.comm g) x
+#align Rep.hom_comm_apply Rep.hom_comm_apply
+
 variable (k G)
 
 /-- The trivial `k`-linear `G`-representation on a `k`-module `V.` -/
@@ -280,114 +296,100 @@ end Linearization
 
 end
 
-section
+section MonoidalClosed
 
 open Action
 
 variable [Group G] (A B C : Rep k G)
 
-noncomputable instance : MonoidalClosed (Rep k G) :=
-  MonoidalClosed.ofEquiv (functorCategoryMonoidalEquivalence _ _)
-
-/-- Explicit description of the 'internal Hom' `iHom(A, B)` of two representations `A, B`:
-this is `F⁻¹(iHom(F(A), F(B)))`, where `F` is an equivalence
-`Rep k G ≌ (single_obj G ⥤ Module k)`. Just used to prove `Rep.ihom_obj_ρ`. -/
-theorem ihom_obj_ρ_def :
-    ((ihom A).obj B).ρ =
-      (FunctorCategoryEquivalence.inverse.obj
-          ((FunctorCategoryEquivalence.functor.obj A).closedIhom.obj
-            (FunctorCategoryEquivalence.functor.obj B))).ρ :=
-  rfl
-#align Rep.ihom_obj_ρ_def Rep.ihom_obj_ρ_def
-
-/-- Given `k`-linear `G`-representations `(A, ρ₁), (B, ρ₂)`, the 'internal Hom' is the
-representation on `Homₖ(A, B)` sending `g : G` and `f : A →ₗ[k] B` to `(ρ₂ g) ∘ₗ f ∘ₗ (ρ₁ g⁻¹)`. -/
-@[simp]
-theorem ihom_obj_ρ : ((ihom A).obj B).ρ = A.ρ.linHom B.ρ :=
-  by
-  refine' MonoidHom.ext fun g => _
-  simpa only [ihom_obj_ρ_def, functor_category_equivalence.inverse_obj_ρ_apply,
-    functor.closed_ihom_obj_map, ← functor.map_inv, single_obj.inv_as_inv]
-#align Rep.ihom_obj_ρ Rep.ihom_obj_ρ
+/-- Given a `k`-linear `G`-representation `(A, ρ₁)`, this is the 'internal Hom' functor sending
+`(B, ρ₂)` to the representation `Homₖ(A, B)` that maps `g : G` and `f : A →ₗ[k] B` to
+`(ρ₂ g) ∘ₗ f ∘ₗ (ρ₁ g⁻¹)`. -/
+@[simps]
+protected def ihom (A : Rep k G) : Rep k G ⥤ Rep k G
+    where
+  obj B := Rep.of (Representation.linHom A.ρ B.ρ)
+  map X Y f :=
+    { hom := ModuleCat.ofHom (LinearMap.llcomp k _ _ _ f.hom)
+      comm' := fun g =>
+        LinearMap.ext fun x =>
+          LinearMap.ext fun y => show f.hom (X.ρ g _) = _ by simpa only [hom_comm_apply] }
+  map_id' B := by ext <;> rfl
+  map_comp' B C D f g := by ext <;> rfl
+#align Rep.ihom Rep.ihom
 
 @[simp]
-theorem ihom_map_hom {B C : Rep k G} (f : B ⟶ C) :
-    ((ihom A).map f).hom = LinearMap.llcomp k A B C f.hom :=
-  rfl
-#align Rep.ihom_map_hom Rep.ihom_map_hom
-
-/-- Unfolds the unit in the adjunction `A ⊗ - ⊣ iHom(A, -)`; just used to prove
-`Rep.ihom_coev_app_hom`. -/
-theorem ihom_coev_app_def :
-    (ihom.coev A).app B =
-      FunctorCategoryEquivalence.unitIso.hom.app B ≫
-        FunctorCategoryEquivalence.inverse.map
-          ((FunctorCategoryEquivalence.functor.obj A).closedUnit.app _ ≫
-            (FunctorCategoryEquivalence.functor.obj A).closedIhom.map
-              ((functorCategoryMonoidalEquivalence (ModuleCat.{u} k) (MonCat.of G)).μ A B)) :=
+protected theorem ihom_obj_ρ_apply {A B : Rep k G} (g : G) (x : A →ₗ[k] B) :
+    ((Rep.ihom A).obj B).ρ g x = B.ρ g ∘ₗ x ∘ₗ A.ρ g⁻¹ :=
   rfl
-#align Rep.ihom_coev_app_def Rep.ihom_coev_app_def
-
-/-- Describes the unit in the adjunction `A ⊗ - ⊣ iHom(A, -)`; given another `k`-linear
-`G`-representation `B,` the `k`-linear map underlying the resulting map `B ⟶ iHom(A, A ⊗ B)` is
-given by flipping the arguments in the natural `k`-bilinear map `A →ₗ[k] B →ₗ[k] A ⊗ B`. -/
-@[simp]
-theorem ihom_coev_app_hom : Action.Hom.hom ((ihom.coev A).app B) = (TensorProduct.mk _ _ _).flip :=
-  by
-  refine' LinearMap.ext fun x => LinearMap.ext fun y => _
-  simpa only [ihom_coev_app_def, functor.map_comp, comp_hom,
-    functor_category_equivalence.inverse_map_hom, functor.closed_ihom_map_app,
-    functor_category_monoidal_equivalence.μ_app]
-#align Rep.ihom_coev_app_hom Rep.ihom_coev_app_hom
-
-variable {A B C}
+#align Rep.ihom_obj_ρ_apply Rep.ihom_obj_ρ_apply
 
 /- ./././Mathport/Syntax/Translate/Expr.lean:177:8: unsupported: ambiguous notation -/
-/-- Given a `k`-linear `G`-representation `A`, the adjunction `A ⊗ - ⊣ iHom(A, -)` defines a
-bijection `Hom(A ⊗ B, C) ≃ Hom(B, iHom(A, C))` for all `B, C`. Given `f : A ⊗ B ⟶ C`, this lemma
-describes the `k`-linear map underlying `f`'s image under the bijection. It is given by currying the
+/-- Given a `k`-linear `G`-representation `A`, this is the Hom-set bijection in the adjunction
+`A ⊗ - ⊣ ihom(A, -)`. It sends `f : A ⊗ B ⟶ C` to a `Rep k G` morphism defined by currying the
 `k`-linear map underlying `f`, giving a map `A →ₗ[k] B →ₗ[k] C`, then flipping the arguments. -/
+@[simps]
+protected def homEquiv (A B C : Rep k G) : (A ⊗ B ⟶ C) ≃ (B ⟶ (Rep.ihom A).obj C)
+    where
+  toFun f :=
+    { hom := (TensorProduct.curry f.hom).flip
+      comm' := fun g => by
+        refine' LinearMap.ext fun x => LinearMap.ext fun y => _
+        change f.hom (_ ⊗ₜ[k] _) = C.ρ g (f.hom (_ ⊗ₜ[k] _))
+        rw [← hom_comm_apply]
+        change _ = f.hom ((A.ρ g * A.ρ g⁻¹) y ⊗ₜ[k] _)
+        simpa only [← map_mul, mul_inv_self, map_one] }
+  invFun f :=
+    { hom := TensorProduct.uncurry k _ _ _ f.hom.flip
+      comm' := fun g =>
+        TensorProduct.ext' fun x y =>
+          by
+          dsimp only [monoidal_category.tensor_left_obj, ModuleCat.comp_def, LinearMap.comp_apply,
+            tensor_rho, ModuleCat.MonoidalCategory.hom_apply, TensorProduct.map_tmul]
+          simp only [TensorProduct.uncurry_apply f.hom.flip, LinearMap.flip_apply, Action_ρ_eq_ρ,
+            hom_comm_apply f g y, Rep.ihom_obj_ρ_apply, LinearMap.comp_apply, ρ_inv_self_apply] }
+  left_inv f := Action.Hom.ext _ _ (TensorProduct.ext' fun x y => rfl)
+  right_inv f := by ext <;> rfl
+#align Rep.hom_equiv Rep.homEquiv
+
+instance : MonoidalClosed (Rep k G)
+    where closed' A :=
+    {
+      isAdj :=
+        { right := Rep.ihom A
+          adj :=
+            Adjunction.mkOfHomEquiv
+              { homEquiv := Rep.homEquiv A
+                homEquiv_naturality_left_symm := fun X Y Z f g => by ext <;> rfl
+                homEquiv_naturality_right := fun X Y Z f g => by ext <;> rfl } } }
+
 @[simp]
-theorem monoidalClosed_curry_hom (f : A ⊗ B ⟶ C) :
-    (MonoidalClosed.curry f).hom = (TensorProduct.curry f.hom).flip :=
-  by
-  rw [monoidal_closed.curry_eq, comp_hom, ihom_coev_app_hom]
+theorem ihom_obj_ρ_def (A B : Rep k G) : ((ihom A).obj B).ρ = ((Rep.ihom A).obj B).ρ :=
   rfl
-#align Rep.monoidal_closed_curry_hom Rep.monoidalClosed_curry_hom
+#align Rep.ihom_obj_ρ_def Rep.ihom_obj_ρ_def
 
-/-- Given a `k`-linear `G`-representation `A`, the adjunction `A ⊗ - ⊣ iHom(A, -)` defines a
-bijection `Hom(A ⊗ B, C) ≃ Hom(B, iHom(A, C))` for all `B, C`. Given `f : B ⟶ iHom(A, C)`, this
-lemma describes the `k`-linear map underlying `f`'s image under the bijection. It is given by
-flipping the arguments of the `k`-linear map underlying `f`, giving a map `A →ₗ[k] B →ₗ[k] C`, then
-uncurrying. -/
 @[simp]
-theorem monoidalClosed_uncurry_hom (f : B ⟶ (ihom A).obj C) :
-    (MonoidalClosed.uncurry f).hom = TensorProduct.uncurry _ _ _ _ f.hom.flip :=
-  by
-  simp only [monoidal_closed.of_equiv_uncurry_def, comp_inv_iso_inv_app,
-    monoidal_functor.comm_tensor_left_inv_app, comp_hom,
-    functor_category_monoidal_equivalence.inverse_map, functor_category_equivalence.inverse_map_hom,
-    functor_category_monoidal_equivalence.μ_iso_inv_app]
-  ext
+theorem homEquiv_def (A B C : Rep k G) : (ihom.adjunction A).homEquiv B C = Rep.homEquiv A B C :=
   rfl
-#align Rep.monoidal_closed_uncurry_hom Rep.monoidalClosed_uncurry_hom
+#align Rep.hom_equiv_def Rep.homEquiv_def
 
-/-- Describes the counit in the adjunction `A ⊗ - ⊣ iHom(A, -)`; given another `k`-linear
-`G`-representation `B,` the `k`-linear map underlying the resulting morphism `A ⊗ iHom(A, B) ⟶ B`
-is given by uncurrying the map `A →ₗ[k] (A →ₗ[k] B) →ₗ[k] B` defined by flipping the arguments in
-the identity map on `Homₖ(A, B).` -/
 @[simp]
-theorem ihom_ev_app_hom :
-    Action.Hom.hom ((ihom.ev A).app B) = TensorProduct.uncurry _ _ _ _ LinearMap.id.flip :=
-  monoidalClosed_uncurry_hom _
+theorem ihom_ev_app_hom (A B : Rep k G) :
+    Action.Hom.hom ((ihom.ev A).app B) = TensorProduct.uncurry _ _ _ _ LinearMap.id.flip := by
+  ext <;> rfl
 #align Rep.ihom_ev_app_hom Rep.ihom_ev_app_hom
 
+@[simp]
+theorem ihom_coev_app_hom (A B : Rep k G) :
+    Action.Hom.hom ((ihom.coev A).app B) = (TensorProduct.mk _ _ _).flip := by ext <;> rfl
+#align Rep.ihom_coev_app_hom Rep.ihom_coev_app_hom
+
 variable (A B C)
 
 /- ./././Mathport/Syntax/Translate/Expr.lean:177:8: unsupported: ambiguous notation -/
 /-- There is a `k`-linear isomorphism between the sets of representation morphisms`Hom(A ⊗ B, C)`
 and `Hom(B, Homₖ(A, C))`. -/
-noncomputable def MonoidalClosed.linearHomEquiv : (A ⊗ B ⟶ C) ≃ₗ[k] B ⟶ A ⟶[Rep k G] C :=
+def MonoidalClosed.linearHomEquiv : (A ⊗ B ⟶ C) ≃ₗ[k] B ⟶ A ⟶[Rep k G] C :=
   {
     (ihom.adjunction A).homEquiv _
       _ with
@@ -398,52 +400,39 @@ noncomputable def MonoidalClosed.linearHomEquiv : (A ⊗ B ⟶ C) ≃ₗ[k] B 
 /- ./././Mathport/Syntax/Translate/Expr.lean:177:8: unsupported: ambiguous notation -/
 /-- There is a `k`-linear isomorphism between the sets of representation morphisms`Hom(A ⊗ B, C)`
 and `Hom(A, Homₖ(B, C))`. -/
-noncomputable def MonoidalClosed.linearHomEquivComm : (A ⊗ B ⟶ C) ≃ₗ[k] A ⟶ B ⟶[Rep k G] C :=
+def MonoidalClosed.linearHomEquivComm : (A ⊗ B ⟶ C) ≃ₗ[k] A ⟶ B ⟶[Rep k G] C :=
   Linear.homCongr k (β_ A B) (Iso.refl _) ≪≫ₗ MonoidalClosed.linearHomEquiv _ _ _
 #align Rep.monoidal_closed.linear_hom_equiv_comm Rep.MonoidalClosed.linearHomEquivComm
 
 variable {A B C}
 
 /- ./././Mathport/Syntax/Translate/Expr.lean:177:8: unsupported: ambiguous notation -/
+@[simp]
 theorem MonoidalClosed.linearHomEquiv_hom (f : A ⊗ B ⟶ C) :
     (MonoidalClosed.linearHomEquiv A B C f).hom = (TensorProduct.curry f.hom).flip :=
-  monoidalClosed_curry_hom _
+  rfl
 #align Rep.monoidal_closed.linear_hom_equiv_hom Rep.MonoidalClosed.linearHomEquiv_hom
 
 /- ./././Mathport/Syntax/Translate/Expr.lean:177:8: unsupported: ambiguous notation -/
+@[simp]
 theorem MonoidalClosed.linearHomEquivComm_hom (f : A ⊗ B ⟶ C) :
     (MonoidalClosed.linearHomEquivComm A B C f).hom = TensorProduct.curry f.hom :=
-  by
-  dsimp only [monoidal_closed.linear_hom_equiv_comm]
-  refine' LinearMap.ext fun x => LinearMap.ext fun y => _
-  simp only [LinearEquiv.trans_apply, monoidal_closed.linear_hom_equiv_hom, linear.hom_congr_apply,
-    iso.refl_hom, iso.symm_hom, LinearMap.toFun_eq_coe, LinearMap.coe_comp, Function.comp_apply,
-    linear.left_comp_apply, linear.right_comp_apply, category.comp_id, Action.comp_hom,
-    LinearMap.flip_apply, TensorProduct.curry_apply, ModuleCat.coe_comp, Function.comp_apply,
-    monoidal_category.braiding_inv_apply]
+  rfl
 #align Rep.monoidal_closed.linear_hom_equiv_comm_hom Rep.MonoidalClosed.linearHomEquivComm_hom
 
+@[simp]
 theorem MonoidalClosed.linearHomEquiv_symm_hom (f : B ⟶ A ⟶[Rep k G] C) :
     ((MonoidalClosed.linearHomEquiv A B C).symm f).hom = TensorProduct.uncurry k A B C f.hom.flip :=
-  monoidalClosed_uncurry_hom _
+  rfl
 #align Rep.monoidal_closed.linear_hom_equiv_symm_hom Rep.MonoidalClosed.linearHomEquiv_symm_hom
 
+@[simp]
 theorem MonoidalClosed.linearHomEquivComm_symm_hom (f : A ⟶ B ⟶[Rep k G] C) :
     ((MonoidalClosed.linearHomEquivComm A B C).symm f).hom = TensorProduct.uncurry k A B C f.hom :=
-  by
-  dsimp only [monoidal_closed.linear_hom_equiv_comm]
-  refine'
-    TensorProduct.AlgebraTensorModule.curry_injective
-      (LinearMap.ext fun x => LinearMap.ext fun y => _)
-  simp only [LinearEquiv.trans_symm, LinearEquiv.trans_apply, linear.hom_congr_symm_apply,
-    iso.refl_inv, LinearMap.coe_comp, Function.comp_apply, category.comp_id, Action.comp_hom,
-    monoidal_closed.linear_hom_equiv_symm_hom, TensorProduct.AlgebraTensorModule.curry_apply,
-    LinearMap.coe_restrictScalars, LinearMap.toFun_eq_coe, LinearMap.flip_apply,
-    TensorProduct.curry_apply, ModuleCat.coe_comp, Function.comp_apply,
-    monoidal_category.braiding_hom_apply, TensorProduct.uncurry_apply]
+  by ext <;> rfl
 #align Rep.monoidal_closed.linear_hom_equiv_comm_symm_hom Rep.MonoidalClosed.linearHomEquivComm_symm_hom
 
-end
+end MonoidalClosed
 
 end Rep
 
Diff
@@ -37,7 +37,7 @@ open CategoryTheory
 
 open CategoryTheory.Limits
 
-/- ./././Mathport/Syntax/Translate/Command.lean:329:31: unsupported: @[derive] abbrev -/
+/- ./././Mathport/Syntax/Translate/Command.lean:328:31: unsupported: @[derive] abbrev -/
 /-- The category of `k`-linear representations of a monoid `G`. -/
 abbrev Rep (k G : Type u) [Ring k] [Monoid G] :=
   Action (ModuleCat.{u} k) (MonCat.of G)
Diff
@@ -37,7 +37,7 @@ open CategoryTheory
 
 open CategoryTheory.Limits
 
-/- ./././Mathport/Syntax/Translate/Command.lean:328:31: unsupported: @[derive] abbrev -/
+/- ./././Mathport/Syntax/Translate/Command.lean:329:31: unsupported: @[derive] abbrev -/
 /-- The category of `k`-linear representations of a monoid `G`. -/
 abbrev Rep (k G : Type u) [Ring k] [Monoid G] :=
   Action (ModuleCat.{u} k) (MonCat.of G)
Diff
@@ -56,14 +56,10 @@ variable [Monoid G]
 instance : CoeSort (Rep k G) (Type u) :=
   ConcreteCategory.hasCoeToSort _
 
-instance (V : Rep k G) : AddCommGroup V :=
-  by
-  change AddCommGroup ((forget₂ (Rep k G) (ModuleCat k)).obj V)
-  infer_instance
+instance (V : Rep k G) : AddCommGroup V := by
+  change AddCommGroup ((forget₂ (Rep k G) (ModuleCat k)).obj V); infer_instance
 
-instance (V : Rep k G) : Module k V :=
-  by
-  change Module k ((forget₂ (Rep k G) (ModuleCat k)).obj V)
+instance (V : Rep k G) : Module k V := by change Module k ((forget₂ (Rep k G) (ModuleCat k)).obj V);
   infer_instance
 
 /-- Specialize the existing `Action.ρ`, changing the type to `representation k G V`.
@@ -203,10 +199,7 @@ on `k[X]`. -/
 @[simps]
 noncomputable def linearizationTrivialIso (X : Type u) :
     (linearization k G).obj (Action.mk X 1) ≅ trivial k G (X →₀ k) :=
-  Action.mkIso (Iso.refl _) fun g => by
-    ext1
-    ext1
-    exact linearization_of _ _ _
+  Action.mkIso (Iso.refl _) fun g => by ext1; ext1; exact linearization_of _ _ _
 #align Rep.linearization_trivial_iso Rep.linearizationTrivialIso
 
 variable (k G)
@@ -505,8 +498,7 @@ theorem to_Module_monoidAlgebra_map_aux {k G : Type _} [CommRing k] [Monoid G] (
   · intro g
     simp only [one_smul, MonoidAlgebra.lift_single, MonoidAlgebra.of_apply]
     exact LinearMap.congr_fun (w g) x
-  · intro g h gw hw
-    simp only [map_add, add_left_inj, LinearMap.add_apply, hw, gw]
+  · intro g h gw hw; simp only [map_add, add_left_inj, LinearMap.add_apply, hw, gw]
   · intro r g w
     simp only [AlgHom.map_smul, w, RingHom.id_apply, LinearMap.smul_apply, LinearMap.map_smulₛₗ]
 #align Rep.to_Module_monoid_algebra_map_aux Rep.to_Module_monoidAlgebra_map_aux
@@ -531,9 +523,7 @@ def ofModuleMonoidAlgebra : ModuleCat.{u} (MonoidAlgebra k G) ⥤ Rep k G
   obj M := Rep.of (Representation.ofModule k G M)
   map M N f :=
     { hom := { f with map_smul' := fun r x => f.map_smul (algebraMap k _ r) x }
-      comm' := fun g => by
-        ext
-        apply f.map_smul }
+      comm' := fun g => by ext; apply f.map_smul }
 #align Rep.of_Module_monoid_algebra Rep.ofModuleMonoidAlgebra
 
 theorem ofModuleMonoidAlgebra_obj_coe (M : ModuleCat.{u} (MonoidAlgebra k G)) :
@@ -590,9 +580,7 @@ def unitIso (V : Rep k G) : V ≅ (toModuleMonoidAlgebra ⋙ ofModuleMonoidAlgeb
           dsimp [unit_iso_add_equiv]
           simp only [Representation.asModuleEquiv_symm_map_smul,
             RestrictScalars.addEquiv_symm_map_algebraMap_smul] })
-    fun g => by
-    ext
-    apply unit_iso_comm
+    fun g => by ext; apply unit_iso_comm
 #align Rep.unit_iso Rep.unitIso
 
 /-- The categorical equivalence `Rep k G ≌ Module (monoid_algebra k G)`. -/
Diff
@@ -513,7 +513,7 @@ theorem to_Module_monoidAlgebra_map_aux {k G : Type _} [CommRing k] [Monoid G] (
 
 /-- Auxilliary definition for `to_Module_monoid_algebra`. -/
 def toModuleMonoidAlgebraMap {V W : Rep k G} (f : V ⟶ W) :
-    ModuleCat.of (MonoidAlgebra k G) V.ρ.AsModule ⟶ ModuleCat.of (MonoidAlgebra k G) W.ρ.AsModule :=
+    ModuleCat.of (MonoidAlgebra k G) V.ρ.asModule ⟶ ModuleCat.of (MonoidAlgebra k G) W.ρ.asModule :=
   { f.hom with
     map_smul' := fun r x => to_Module_monoidAlgebra_map_aux V.V W.V V.ρ W.ρ f.hom f.comm r x }
 #align Rep.to_Module_monoid_algebra_map Rep.toModuleMonoidAlgebraMap
@@ -521,7 +521,7 @@ def toModuleMonoidAlgebraMap {V W : Rep k G} (f : V ⟶ W) :
 /-- Functorially convert a representation of `G` into a module over `monoid_algebra k G`. -/
 def toModuleMonoidAlgebra : Rep k G ⥤ ModuleCat.{u} (MonoidAlgebra k G)
     where
-  obj V := ModuleCat.of _ V.ρ.AsModule
+  obj V := ModuleCat.of _ V.ρ.asModule
   map V W f := toModuleMonoidAlgebraMap f
 #align Rep.to_Module_monoid_algebra Rep.toModuleMonoidAlgebra
 
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Scott Morrison
 
 ! This file was ported from Lean 3 source module representation_theory.Rep
-! leanprover-community/mathlib commit c04bc6e93e23aa0182aba53661a2211e80b6feac
+! leanprover-community/mathlib commit 74403a3b2551b0970855e14ef5e8fd0d6af1bfc2
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -12,7 +12,7 @@ import Mathbin.RepresentationTheory.Basic
 import Mathbin.RepresentationTheory.Action
 import Mathbin.Algebra.Category.Module.Abelian
 import Mathbin.Algebra.Category.Module.Colimits
-import Mathbin.Algebra.Category.Module.Monoidal
+import Mathbin.Algebra.Category.Module.Monoidal.Closed
 import Mathbin.Algebra.Category.Module.Adjunctions
 import Mathbin.CategoryTheory.Closed.FunctorCategory
 
Diff
@@ -37,7 +37,7 @@ open CategoryTheory
 
 open CategoryTheory.Limits
 
-/- ./././Mathport/Syntax/Translate/Command.lean:323:31: unsupported: @[derive] abbrev -/
+/- ./././Mathport/Syntax/Translate/Command.lean:328:31: unsupported: @[derive] abbrev -/
 /-- The category of `k`-linear representations of a monoid `G`. -/
 abbrev Rep (k G : Type u) [Ring k] [Monoid G] :=
   Action (ModuleCat.{u} k) (MonCat.of G)
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Scott Morrison
 
 ! This file was ported from Lean 3 source module representation_theory.Rep
-! leanprover-community/mathlib commit 3dec44d0b621a174c56e994da4aae15ba60110a2
+! leanprover-community/mathlib commit c04bc6e93e23aa0182aba53661a2211e80b6feac
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -100,6 +100,20 @@ theorem of_ρ_apply {V : Type u} [AddCommGroup V] [Module k V] (ρ : Representat
   rfl
 #align Rep.of_ρ_apply Rep.of_ρ_apply
 
+variable (k G)
+
+/-- The trivial `k`-linear `G`-representation on a `k`-module `V.` -/
+def trivial (V : Type u) [AddCommGroup V] [Module k V] : Rep k G :=
+  Rep.of (@Representation.trivial k G V _ _ _ _)
+#align Rep.trivial Rep.trivial
+
+variable {k G}
+
+theorem trivial_def {V : Type u} [AddCommGroup V] [Module k V] (g : G) (v : V) :
+    (trivial k G V).ρ g v = v :=
+  rfl
+#align Rep.trivial_def Rep.trivial_def
+
 -- Verify that limits are calculated correctly.
 noncomputable example : PreservesLimits (forget₂ (Rep k G) (ModuleCat.{u} k)) := by infer_instance
 
@@ -131,30 +145,69 @@ variable {k G}
 
 @[simp]
 theorem linearization_obj_ρ (X : Action (Type u) (MonCat.of G)) (g : G) (x : X.V →₀ k) :
-    ((linearization k G).1.1.obj X).ρ g x = Finsupp.lmapDomain k k (X.ρ g) x :=
+    ((linearization k G).obj X).ρ g x = Finsupp.lmapDomain k k (X.ρ g) x :=
   rfl
 #align Rep.linearization_obj_ρ Rep.linearization_obj_ρ
 
 @[simp]
 theorem linearization_of (X : Action (Type u) (MonCat.of G)) (g : G) (x : X.V) :
-    ((linearization k G).1.1.obj X).ρ g (Finsupp.single x (1 : k)) =
-      Finsupp.single (X.ρ g x) (1 : k) :=
+    ((linearization k G).obj X).ρ g (Finsupp.single x (1 : k)) = Finsupp.single (X.ρ g x) (1 : k) :=
   by rw [linearization_obj_ρ, Finsupp.lmapDomain_apply, Finsupp.mapDomain_single]
 #align Rep.linearization_of Rep.linearization_of
 
-variable (X Y : Action (Type u) (MonCat.of G)) (f : X ⟶ Y)
+variable {X Y : Action (Type u) (MonCat.of G)} (f : X ⟶ Y)
 
 @[simp]
-theorem linearization_map_hom :
-    ((linearization k G).1.1.map f).hom = Finsupp.lmapDomain k k f.hom :=
+theorem linearization_map_hom : ((linearization k G).map f).hom = Finsupp.lmapDomain k k f.hom :=
   rfl
 #align Rep.linearization_map_hom Rep.linearization_map_hom
 
-theorem linearization_map_hom_of (x : X.V) :
-    ((linearization k G).1.1.map f).hom (Finsupp.single x (1 : k)) =
-      Finsupp.single (f.hom x) (1 : k) :=
-  by rw [linearization_map_hom, Finsupp.lmapDomain_apply, Finsupp.mapDomain_single]
-#align Rep.linearization_map_hom_of Rep.linearization_map_hom_of
+theorem linearization_map_hom_single (x : X.V) (r : k) :
+    ((linearization k G).map f).hom (Finsupp.single x r) = Finsupp.single (f.hom x) r := by
+  rw [linearization_map_hom, Finsupp.lmapDomain_apply, Finsupp.mapDomain_single]
+#align Rep.linearization_map_hom_single Rep.linearization_map_hom_single
+
+@[simp]
+theorem linearization_μ_hom (X Y : Action (Type u) (MonCat.of G)) :
+    ((linearization k G).μ X Y).hom = (finsuppTensorFinsupp' k X.V Y.V).toLinearMap :=
+  rfl
+#align Rep.linearization_μ_hom Rep.linearization_μ_hom
+
+@[simp]
+theorem linearization_μ_inv_hom (X Y : Action (Type u) (MonCat.of G)) :
+    (inv ((linearization k G).μ X Y)).hom = (finsuppTensorFinsupp' k X.V Y.V).symm.toLinearMap :=
+  by
+  simp_rw [← Action.forget_map, functor.map_inv, Action.forget_map, linearization_μ_hom]
+  apply is_iso.inv_eq_of_hom_inv_id _
+  exact LinearMap.ext fun x => LinearEquiv.symm_apply_apply _ _
+#align Rep.linearization_μ_inv_hom Rep.linearization_μ_inv_hom
+
+@[simp]
+theorem linearization_ε_hom : (linearization k G).ε.hom = Finsupp.lsingle PUnit.unit :=
+  rfl
+#align Rep.linearization_ε_hom Rep.linearization_ε_hom
+
+@[simp]
+theorem linearization_ε_inv_hom_apply (r : k) :
+    (inv (linearization k G).ε).hom (Finsupp.single PUnit.unit r) = r :=
+  by
+  simp_rw [← Action.forget_map, functor.map_inv, Action.forget_map]
+  rw [← Finsupp.lsingle_apply PUnit.unit r]
+  apply is_iso.hom_inv_id_apply _ _
+#align Rep.linearization_ε_inv_hom_apply Rep.linearization_ε_inv_hom_apply
+
+variable (k G)
+
+/-- The linearization of a type `X` on which `G` acts trivially is the trivial `G`-representation
+on `k[X]`. -/
+@[simps]
+noncomputable def linearizationTrivialIso (X : Type u) :
+    (linearization k G).obj (Action.mk X 1) ≅ trivial k G (X →₀ k) :=
+  Action.mkIso (Iso.refl _) fun g => by
+    ext1
+    ext1
+    exact linearization_of _ _ _
+#align Rep.linearization_trivial_iso Rep.linearizationTrivialIso
 
 variable (k G)
 
@@ -164,10 +217,20 @@ noncomputable abbrev ofMulAction (H : Type u) [MulAction G H] : Rep k G :=
   of <| Representation.ofMulAction k G H
 #align Rep.of_mul_action Rep.ofMulAction
 
+/-- The `k`-linear `G`-representation on `k[G]`, induced by left multiplication. -/
+noncomputable def leftRegular : Rep k G :=
+  ofMulAction k G G
+#align Rep.left_regular Rep.leftRegular
+
+/-- The `k`-linear `G`-representation on `k[Gⁿ]`, induced by left multiplication. -/
+noncomputable def diagonal (n : ℕ) : Rep k G :=
+  ofMulAction k G (Fin n → G)
+#align Rep.diagonal Rep.diagonal
+
 /-- The linearization of a type `H` with a `G`-action is definitionally isomorphic to the
 `k`-linear `G`-representation on `k[H]` induced by the `G`-action on `H`. -/
-noncomputable def linearizationOfMulActionIso (n : ℕ) :
-    (linearization k G).1.1.obj (Action.ofMulAction G (Fin n → G)) ≅ ofMulAction k G (Fin n → G) :=
+noncomputable def linearizationOfMulActionIso (H : Type u) [MulAction G H] :
+    (linearization k G).obj (Action.ofMulAction G H) ≅ ofMulAction k G H :=
   Iso.refl _
 #align Rep.linearization_of_mul_action_iso Rep.linearizationOfMulActionIso
 
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Scott Morrison
 
 ! This file was ported from Lean 3 source module representation_theory.Rep
-! leanprover-community/mathlib commit 0caf3701139ef2e69c215717665361cda205a90b
+! leanprover-community/mathlib commit 3dec44d0b621a174c56e994da4aae15ba60110a2
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -88,11 +88,35 @@ theorem of_ρ {V : Type u} [AddCommGroup V] [Module k V] (ρ : G →* V →ₗ[k
   rfl
 #align Rep.of_ρ Rep.of_ρ
 
+@[simp]
+theorem Action_ρ_eq_ρ {A : Rep k G} : Action.ρ A = A.ρ :=
+  rfl
+#align Rep.Action_ρ_eq_ρ Rep.Action_ρ_eq_ρ
+
+/-- Allows us to apply lemmas about the underlying `ρ`, which would take an element `g : G` rather
+than `g : Mon.of G` as an argument. -/
+theorem of_ρ_apply {V : Type u} [AddCommGroup V] [Module k V] (ρ : Representation k G V)
+    (g : MonCat.of G) : (Rep.of ρ).ρ g = ρ (g : G) :=
+  rfl
+#align Rep.of_ρ_apply Rep.of_ρ_apply
+
 -- Verify that limits are calculated correctly.
 noncomputable example : PreservesLimits (forget₂ (Rep k G) (ModuleCat.{u} k)) := by infer_instance
 
 noncomputable example : PreservesColimits (forget₂ (Rep k G) (ModuleCat.{u} k)) := by infer_instance
 
+@[simp]
+theorem MonoidalCategory.braiding_hom_apply {A B : Rep k G} (x : A) (y : B) :
+    Action.Hom.hom (β_ A B).hom (TensorProduct.tmul k x y) = TensorProduct.tmul k y x :=
+  rfl
+#align Rep.monoidal_category.braiding_hom_apply Rep.MonoidalCategory.braiding_hom_apply
+
+@[simp]
+theorem MonoidalCategory.braiding_inv_apply {A B : Rep k G} (x : A) (y : B) :
+    Action.Hom.hom (β_ A B).inv (TensorProduct.tmul k y x) = TensorProduct.tmul k x y :=
+  rfl
+#align Rep.monoidal_category.braiding_inv_apply Rep.MonoidalCategory.braiding_inv_apply
+
 section Linearization
 
 variable (k G)
@@ -147,6 +171,55 @@ noncomputable def linearizationOfMulActionIso (n : ℕ) :
   Iso.refl _
 #align Rep.linearization_of_mul_action_iso Rep.linearizationOfMulActionIso
 
+variable {k G}
+
+/-- Given an element `x : A`, there is a natural morphism of representations `k[G] ⟶ A` sending
+`g ↦ A.ρ(g)(x).` -/
+@[simps]
+noncomputable def leftRegularHom (A : Rep k G) (x : A) : Rep.ofMulAction k G G ⟶ A
+    where
+  hom := Finsupp.lift _ _ _ fun g => A.ρ g x
+  comm' g := by
+    refine' Finsupp.lhom_ext' fun y => LinearMap.ext_ring _
+    simpa only [LinearMap.comp_apply, ModuleCat.comp_def, Finsupp.lsingle_apply, Finsupp.lift_apply,
+      Action_ρ_eq_ρ, of_ρ_apply, Representation.ofMulAction_single, Finsupp.sum_single_index,
+      zero_smul, one_smul, smul_eq_mul, A.ρ.map_mul]
+#align Rep.left_regular_hom Rep.leftRegularHom
+
+theorem leftRegularHom_apply {A : Rep k G} (x : A) :
+    (leftRegularHom A x).hom (Finsupp.single 1 1) = x := by
+  simpa only [left_regular_hom_hom, Finsupp.lift_apply, Finsupp.sum_single_index, one_smul,
+    A.ρ.map_one, zero_smul]
+#align Rep.left_regular_hom_apply Rep.leftRegularHom_apply
+
+/-- Given a `k`-linear `G`-representation `A`, there is a `k`-linear isomorphism between
+representation morphisms `Hom(k[G], A)` and `A`. -/
+@[simps]
+noncomputable def leftRegularHomEquiv (A : Rep k G) : (Rep.ofMulAction k G G ⟶ A) ≃ₗ[k] A
+    where
+  toFun f := f.hom (Finsupp.single 1 1)
+  map_add' x y := rfl
+  map_smul' r x := rfl
+  invFun x := leftRegularHom A x
+  left_inv f :=
+    by
+    refine' Action.Hom.ext _ _ (Finsupp.lhom_ext' fun x : G => LinearMap.ext_ring _)
+    have :
+      f.hom ((of_mul_action k G G).ρ x (Finsupp.single (1 : G) (1 : k))) =
+        A.ρ x (f.hom (Finsupp.single (1 : G) (1 : k))) :=
+      LinearMap.ext_iff.1 (f.comm x) (Finsupp.single 1 1)
+    simp only [LinearMap.comp_apply, Finsupp.lsingle_apply, left_regular_hom_hom,
+      Finsupp.lift_apply, Finsupp.sum_single_index, one_smul, ← this, zero_smul, of_ρ_apply,
+      Representation.ofMulAction_single x (1 : G) (1 : k), smul_eq_mul, mul_one]
+  right_inv x := leftRegularHom_apply x
+#align Rep.left_regular_hom_equiv Rep.leftRegularHomEquiv
+
+theorem leftRegularHomEquiv_symm_single {A : Rep k G} (x : A) (g : G) :
+    ((leftRegularHomEquiv A).symm x).hom (Finsupp.single g 1) = A.ρ g x := by
+  simp only [left_regular_hom_equiv_symm_apply, left_regular_hom_hom, Finsupp.lift_apply,
+    Finsupp.sum_single_index, zero_smul, one_smul]
+#align Rep.left_regular_hom_equiv_symm_single Rep.leftRegularHomEquiv_symm_single
+
 end Linearization
 
 end
@@ -253,10 +326,92 @@ theorem ihom_ev_app_hom :
   monoidalClosed_uncurry_hom _
 #align Rep.ihom_ev_app_hom Rep.ihom_ev_app_hom
 
+variable (A B C)
+
+/- ./././Mathport/Syntax/Translate/Expr.lean:177:8: unsupported: ambiguous notation -/
+/-- There is a `k`-linear isomorphism between the sets of representation morphisms`Hom(A ⊗ B, C)`
+and `Hom(B, Homₖ(A, C))`. -/
+noncomputable def MonoidalClosed.linearHomEquiv : (A ⊗ B ⟶ C) ≃ₗ[k] B ⟶ A ⟶[Rep k G] C :=
+  {
+    (ihom.adjunction A).homEquiv _
+      _ with
+    map_add' := fun f g => rfl
+    map_smul' := fun r f => rfl }
+#align Rep.monoidal_closed.linear_hom_equiv Rep.MonoidalClosed.linearHomEquiv
+
+/- ./././Mathport/Syntax/Translate/Expr.lean:177:8: unsupported: ambiguous notation -/
+/-- There is a `k`-linear isomorphism between the sets of representation morphisms`Hom(A ⊗ B, C)`
+and `Hom(A, Homₖ(B, C))`. -/
+noncomputable def MonoidalClosed.linearHomEquivComm : (A ⊗ B ⟶ C) ≃ₗ[k] A ⟶ B ⟶[Rep k G] C :=
+  Linear.homCongr k (β_ A B) (Iso.refl _) ≪≫ₗ MonoidalClosed.linearHomEquiv _ _ _
+#align Rep.monoidal_closed.linear_hom_equiv_comm Rep.MonoidalClosed.linearHomEquivComm
+
+variable {A B C}
+
+/- ./././Mathport/Syntax/Translate/Expr.lean:177:8: unsupported: ambiguous notation -/
+theorem MonoidalClosed.linearHomEquiv_hom (f : A ⊗ B ⟶ C) :
+    (MonoidalClosed.linearHomEquiv A B C f).hom = (TensorProduct.curry f.hom).flip :=
+  monoidalClosed_curry_hom _
+#align Rep.monoidal_closed.linear_hom_equiv_hom Rep.MonoidalClosed.linearHomEquiv_hom
+
+/- ./././Mathport/Syntax/Translate/Expr.lean:177:8: unsupported: ambiguous notation -/
+theorem MonoidalClosed.linearHomEquivComm_hom (f : A ⊗ B ⟶ C) :
+    (MonoidalClosed.linearHomEquivComm A B C f).hom = TensorProduct.curry f.hom :=
+  by
+  dsimp only [monoidal_closed.linear_hom_equiv_comm]
+  refine' LinearMap.ext fun x => LinearMap.ext fun y => _
+  simp only [LinearEquiv.trans_apply, monoidal_closed.linear_hom_equiv_hom, linear.hom_congr_apply,
+    iso.refl_hom, iso.symm_hom, LinearMap.toFun_eq_coe, LinearMap.coe_comp, Function.comp_apply,
+    linear.left_comp_apply, linear.right_comp_apply, category.comp_id, Action.comp_hom,
+    LinearMap.flip_apply, TensorProduct.curry_apply, ModuleCat.coe_comp, Function.comp_apply,
+    monoidal_category.braiding_inv_apply]
+#align Rep.monoidal_closed.linear_hom_equiv_comm_hom Rep.MonoidalClosed.linearHomEquivComm_hom
+
+theorem MonoidalClosed.linearHomEquiv_symm_hom (f : B ⟶ A ⟶[Rep k G] C) :
+    ((MonoidalClosed.linearHomEquiv A B C).symm f).hom = TensorProduct.uncurry k A B C f.hom.flip :=
+  monoidalClosed_uncurry_hom _
+#align Rep.monoidal_closed.linear_hom_equiv_symm_hom Rep.MonoidalClosed.linearHomEquiv_symm_hom
+
+theorem MonoidalClosed.linearHomEquivComm_symm_hom (f : A ⟶ B ⟶[Rep k G] C) :
+    ((MonoidalClosed.linearHomEquivComm A B C).symm f).hom = TensorProduct.uncurry k A B C f.hom :=
+  by
+  dsimp only [monoidal_closed.linear_hom_equiv_comm]
+  refine'
+    TensorProduct.AlgebraTensorModule.curry_injective
+      (LinearMap.ext fun x => LinearMap.ext fun y => _)
+  simp only [LinearEquiv.trans_symm, LinearEquiv.trans_apply, linear.hom_congr_symm_apply,
+    iso.refl_inv, LinearMap.coe_comp, Function.comp_apply, category.comp_id, Action.comp_hom,
+    monoidal_closed.linear_hom_equiv_symm_hom, TensorProduct.AlgebraTensorModule.curry_apply,
+    LinearMap.coe_restrictScalars, LinearMap.toFun_eq_coe, LinearMap.flip_apply,
+    TensorProduct.curry_apply, ModuleCat.coe_comp, Function.comp_apply,
+    monoidal_category.braiding_hom_apply, TensorProduct.uncurry_apply]
+#align Rep.monoidal_closed.linear_hom_equiv_comm_symm_hom Rep.MonoidalClosed.linearHomEquivComm_symm_hom
+
 end
 
 end Rep
 
+namespace Representation
+
+variable {k G : Type u} [CommRing k] [Monoid G] {V W : Type u} [AddCommGroup V] [AddCommGroup W]
+  [Module k V] [Module k W] (ρ : Representation k G V) (τ : Representation k G W)
+
+/- ./././Mathport/Syntax/Translate/Expr.lean:177:8: unsupported: ambiguous notation -/
+/-- Tautological isomorphism to help Lean in typechecking. -/
+def repOfTprodIso : Rep.of (ρ.tprod τ) ≅ Rep.of ρ ⊗ Rep.of τ :=
+  Iso.refl _
+#align representation.Rep_of_tprod_iso Representation.repOfTprodIso
+
+theorem repOfTprodIso_apply (x : TensorProduct k V W) : (repOfTprodIso ρ τ).hom.hom x = x :=
+  rfl
+#align representation.Rep_of_tprod_iso_apply Representation.repOfTprodIso_apply
+
+theorem repOfTprodIso_inv_apply (x : TensorProduct k V W) : (repOfTprodIso ρ τ).inv.hom x = x :=
+  rfl
+#align representation.Rep_of_tprod_iso_inv_apply Representation.repOfTprodIso_inv_apply
+
+end Representation
+
 /-!
 # The categorical equivalence `Rep k G ≌ Module.{u} (monoid_algebra k G)`.
 -/
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Scott Morrison
 
 ! This file was ported from Lean 3 source module representation_theory.Rep
-! leanprover-community/mathlib commit 348289cc3e8ea3f1dcddad5fd52c10156435b17f
+! leanprover-community/mathlib commit 0caf3701139ef2e69c215717665361cda205a90b
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -14,6 +14,7 @@ import Mathbin.Algebra.Category.Module.Abelian
 import Mathbin.Algebra.Category.Module.Colimits
 import Mathbin.Algebra.Category.Module.Monoidal
 import Mathbin.Algebra.Category.Module.Adjunctions
+import Mathbin.CategoryTheory.Closed.FunctorCategory
 
 /-!
 # `Rep k G` is the category of `k`-linear representations of `G`.
@@ -46,7 +47,11 @@ instance (k G : Type u) [CommRing k] [Monoid G] : Linear k (Rep k G) := by infer
 
 namespace Rep
 
-variable {k G : Type u} [CommRing k] [Monoid G]
+variable {k G : Type u} [CommRing k]
+
+section
+
+variable [Monoid G]
 
 instance : CoeSort (Rep k G) (Type u) :=
   ConcreteCategory.hasCoeToSort _
@@ -144,6 +149,112 @@ noncomputable def linearizationOfMulActionIso (n : ℕ) :
 
 end Linearization
 
+end
+
+section
+
+open Action
+
+variable [Group G] (A B C : Rep k G)
+
+noncomputable instance : MonoidalClosed (Rep k G) :=
+  MonoidalClosed.ofEquiv (functorCategoryMonoidalEquivalence _ _)
+
+/-- Explicit description of the 'internal Hom' `iHom(A, B)` of two representations `A, B`:
+this is `F⁻¹(iHom(F(A), F(B)))`, where `F` is an equivalence
+`Rep k G ≌ (single_obj G ⥤ Module k)`. Just used to prove `Rep.ihom_obj_ρ`. -/
+theorem ihom_obj_ρ_def :
+    ((ihom A).obj B).ρ =
+      (FunctorCategoryEquivalence.inverse.obj
+          ((FunctorCategoryEquivalence.functor.obj A).closedIhom.obj
+            (FunctorCategoryEquivalence.functor.obj B))).ρ :=
+  rfl
+#align Rep.ihom_obj_ρ_def Rep.ihom_obj_ρ_def
+
+/-- Given `k`-linear `G`-representations `(A, ρ₁), (B, ρ₂)`, the 'internal Hom' is the
+representation on `Homₖ(A, B)` sending `g : G` and `f : A →ₗ[k] B` to `(ρ₂ g) ∘ₗ f ∘ₗ (ρ₁ g⁻¹)`. -/
+@[simp]
+theorem ihom_obj_ρ : ((ihom A).obj B).ρ = A.ρ.linHom B.ρ :=
+  by
+  refine' MonoidHom.ext fun g => _
+  simpa only [ihom_obj_ρ_def, functor_category_equivalence.inverse_obj_ρ_apply,
+    functor.closed_ihom_obj_map, ← functor.map_inv, single_obj.inv_as_inv]
+#align Rep.ihom_obj_ρ Rep.ihom_obj_ρ
+
+@[simp]
+theorem ihom_map_hom {B C : Rep k G} (f : B ⟶ C) :
+    ((ihom A).map f).hom = LinearMap.llcomp k A B C f.hom :=
+  rfl
+#align Rep.ihom_map_hom Rep.ihom_map_hom
+
+/-- Unfolds the unit in the adjunction `A ⊗ - ⊣ iHom(A, -)`; just used to prove
+`Rep.ihom_coev_app_hom`. -/
+theorem ihom_coev_app_def :
+    (ihom.coev A).app B =
+      FunctorCategoryEquivalence.unitIso.hom.app B ≫
+        FunctorCategoryEquivalence.inverse.map
+          ((FunctorCategoryEquivalence.functor.obj A).closedUnit.app _ ≫
+            (FunctorCategoryEquivalence.functor.obj A).closedIhom.map
+              ((functorCategoryMonoidalEquivalence (ModuleCat.{u} k) (MonCat.of G)).μ A B)) :=
+  rfl
+#align Rep.ihom_coev_app_def Rep.ihom_coev_app_def
+
+/-- Describes the unit in the adjunction `A ⊗ - ⊣ iHom(A, -)`; given another `k`-linear
+`G`-representation `B,` the `k`-linear map underlying the resulting map `B ⟶ iHom(A, A ⊗ B)` is
+given by flipping the arguments in the natural `k`-bilinear map `A →ₗ[k] B →ₗ[k] A ⊗ B`. -/
+@[simp]
+theorem ihom_coev_app_hom : Action.Hom.hom ((ihom.coev A).app B) = (TensorProduct.mk _ _ _).flip :=
+  by
+  refine' LinearMap.ext fun x => LinearMap.ext fun y => _
+  simpa only [ihom_coev_app_def, functor.map_comp, comp_hom,
+    functor_category_equivalence.inverse_map_hom, functor.closed_ihom_map_app,
+    functor_category_monoidal_equivalence.μ_app]
+#align Rep.ihom_coev_app_hom Rep.ihom_coev_app_hom
+
+variable {A B C}
+
+/- ./././Mathport/Syntax/Translate/Expr.lean:177:8: unsupported: ambiguous notation -/
+/-- Given a `k`-linear `G`-representation `A`, the adjunction `A ⊗ - ⊣ iHom(A, -)` defines a
+bijection `Hom(A ⊗ B, C) ≃ Hom(B, iHom(A, C))` for all `B, C`. Given `f : A ⊗ B ⟶ C`, this lemma
+describes the `k`-linear map underlying `f`'s image under the bijection. It is given by currying the
+`k`-linear map underlying `f`, giving a map `A →ₗ[k] B →ₗ[k] C`, then flipping the arguments. -/
+@[simp]
+theorem monoidalClosed_curry_hom (f : A ⊗ B ⟶ C) :
+    (MonoidalClosed.curry f).hom = (TensorProduct.curry f.hom).flip :=
+  by
+  rw [monoidal_closed.curry_eq, comp_hom, ihom_coev_app_hom]
+  rfl
+#align Rep.monoidal_closed_curry_hom Rep.monoidalClosed_curry_hom
+
+/-- Given a `k`-linear `G`-representation `A`, the adjunction `A ⊗ - ⊣ iHom(A, -)` defines a
+bijection `Hom(A ⊗ B, C) ≃ Hom(B, iHom(A, C))` for all `B, C`. Given `f : B ⟶ iHom(A, C)`, this
+lemma describes the `k`-linear map underlying `f`'s image under the bijection. It is given by
+flipping the arguments of the `k`-linear map underlying `f`, giving a map `A →ₗ[k] B →ₗ[k] C`, then
+uncurrying. -/
+@[simp]
+theorem monoidalClosed_uncurry_hom (f : B ⟶ (ihom A).obj C) :
+    (MonoidalClosed.uncurry f).hom = TensorProduct.uncurry _ _ _ _ f.hom.flip :=
+  by
+  simp only [monoidal_closed.of_equiv_uncurry_def, comp_inv_iso_inv_app,
+    monoidal_functor.comm_tensor_left_inv_app, comp_hom,
+    functor_category_monoidal_equivalence.inverse_map, functor_category_equivalence.inverse_map_hom,
+    functor_category_monoidal_equivalence.μ_iso_inv_app]
+  ext
+  rfl
+#align Rep.monoidal_closed_uncurry_hom Rep.monoidalClosed_uncurry_hom
+
+/-- Describes the counit in the adjunction `A ⊗ - ⊣ iHom(A, -)`; given another `k`-linear
+`G`-representation `B,` the `k`-linear map underlying the resulting morphism `A ⊗ iHom(A, B) ⟶ B`
+is given by uncurrying the map `A →ₗ[k] (A →ₗ[k] B) →ₗ[k] B` defined by flipping the arguments in
+the identity map on `Homₖ(A, B).` -/
+@[simp]
+theorem ihom_ev_app_hom :
+    Action.Hom.hom ((ihom.ev A).app B) = TensorProduct.uncurry _ _ _ _ LinearMap.id.flip :=
+  monoidalClosed_uncurry_hom _
+#align Rep.ihom_ev_app_hom Rep.ihom_ev_app_hom
+
+end
+
 end Rep
 
 /-!
Diff
@@ -39,7 +39,7 @@ open CategoryTheory.Limits
 /- ./././Mathport/Syntax/Translate/Command.lean:323:31: unsupported: @[derive] abbrev -/
 /-- The category of `k`-linear representations of a monoid `G`. -/
 abbrev Rep (k G : Type u) [Ring k] [Monoid G] :=
-  Action (ModuleCat.{u} k) (Mon.of G)
+  Action (ModuleCat.{u} k) (MonCat.of G)
 #align Rep Rep
 
 instance (k G : Type u) [CommRing k] [Monoid G] : Linear k (Rep k G) := by infer_instance
@@ -94,26 +94,26 @@ variable (k G)
 
 /-- The monoidal functor sending a type `H` with a `G`-action to the induced `k`-linear
 `G`-representation on `k[H].` -/
-noncomputable def linearization : MonoidalFunctor (Action (Type u) (Mon.of G)) (Rep k G) :=
-  (ModuleCat.monoidalFree k).mapAction (Mon.of G)
+noncomputable def linearization : MonoidalFunctor (Action (Type u) (MonCat.of G)) (Rep k G) :=
+  (ModuleCat.monoidalFree k).mapAction (MonCat.of G)
 #align Rep.linearization Rep.linearization
 
 variable {k G}
 
 @[simp]
-theorem linearization_obj_ρ (X : Action (Type u) (Mon.of G)) (g : G) (x : X.V →₀ k) :
+theorem linearization_obj_ρ (X : Action (Type u) (MonCat.of G)) (g : G) (x : X.V →₀ k) :
     ((linearization k G).1.1.obj X).ρ g x = Finsupp.lmapDomain k k (X.ρ g) x :=
   rfl
 #align Rep.linearization_obj_ρ Rep.linearization_obj_ρ
 
 @[simp]
-theorem linearization_of (X : Action (Type u) (Mon.of G)) (g : G) (x : X.V) :
+theorem linearization_of (X : Action (Type u) (MonCat.of G)) (g : G) (x : X.V) :
     ((linearization k G).1.1.obj X).ρ g (Finsupp.single x (1 : k)) =
       Finsupp.single (X.ρ g x) (1 : k) :=
   by rw [linearization_obj_ρ, Finsupp.lmapDomain_apply, Finsupp.mapDomain_single]
 #align Rep.linearization_of Rep.linearization_of
 
-variable (X Y : Action (Type u) (Mon.of G)) (f : X ⟶ Y)
+variable (X Y : Action (Type u) (MonCat.of G)) (f : X ⟶ Y)
 
 @[simp]
 theorem linearization_map_hom :

Changes in mathlib4

mathlib3
mathlib4
chore: adapt to multiple goal linter 2 (#12361)

A PR analogous to #12338: reformatting proofs following the multiple goals linter of #12339.

Diff
@@ -373,9 +373,9 @@ noncomputable def leftRegularHomEquiv (A : Rep k G) : (Rep.ofMulAction k G G ⟶
     simp only [LinearMap.comp_apply, Finsupp.lsingle_apply, leftRegularHom_hom]
     erw [Finsupp.lift_apply]
     rw [Finsupp.sum_single_index, ← this, of_ρ_apply]
-    erw [Representation.ofMulAction_single x (1 : G) (1 : k)]
-    simp only [one_smul, smul_eq_mul, mul_one]
-    · -- This goal didn't exist before leanprover/lean4#2644
+    · erw [Representation.ofMulAction_single x (1 : G) (1 : k)]
+      simp only [one_smul, smul_eq_mul, mul_one]
+      -- This goal didn't exist before leanprover/lean4#2644
       rfl
     · rw [zero_smul]
   right_inv x := leftRegularHom_apply x
style: replace '/--A' by '/-- A' for each letter A. (#11939)

Also do the same for "/-A". This is a purely aesthetic change (and exhaustive).

Diff
@@ -226,7 +226,7 @@ set_option linter.uppercaseLean3 false in
 theorem linearization_μ_inv_hom (X Y : Action (Type u) (MonCat.of G)) :
     (inv ((linearization k G).μ X Y)).hom = (finsuppTensorFinsupp' k X.V Y.V).symm.toLinearMap := by
 -- Porting note (#11039): broken proof was
-/-simp_rw [← Action.forget_map, Functor.map_inv, Action.forget_map, linearization_μ_hom]
+/- simp_rw [← Action.forget_map, Functor.map_inv, Action.forget_map, linearization_μ_hom]
   apply IsIso.inv_eq_of_hom_inv_id _
   exact LinearMap.ext fun x => LinearEquiv.symm_apply_apply _ _-/
   rw [← Action.forget_map, Functor.map_inv]
fix: change refine to exact in files where it speeds up (#11896)

See #11890 and this Zulip discussion for an in-depth explanation of why these refines and not others.

The short answer is that the files in which these replacements took place were more performant after the change than before.

Diff
@@ -665,7 +665,7 @@ set_option linter.uppercaseLean3 false in
 def counitIsoAddEquiv {M : ModuleCat.{u} (MonoidAlgebra k G)} :
     (ofModuleMonoidAlgebra ⋙ toModuleMonoidAlgebra).obj M ≃+ M := by
   dsimp [ofModuleMonoidAlgebra, toModuleMonoidAlgebra]
-  refine' (Representation.ofModule M).asModuleEquiv.trans
+  exact (Representation.ofModule M).asModuleEquiv.trans
     (RestrictScalars.addEquiv k (MonoidAlgebra k G) _)
 set_option linter.uppercaseLean3 false in
 #align Rep.counit_iso_add_equiv Rep.counitIsoAddEquiv
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
@@ -684,8 +684,9 @@ def counitIso (M : ModuleCat.{u} (MonoidAlgebra k G)) :
   LinearEquiv.toModuleIso'
     { counitIsoAddEquiv with
       map_smul' := fun r x => by
+        set_option tactic.skipAssignedInstances false in
         dsimp [counitIsoAddEquiv]
-/- Porting note: rest of broken proof was `simp`. -/
+        /- Porting note: rest of broken proof was `simp`. -/
         rw [AddEquiv.trans_apply]
         rw [AddEquiv.trans_apply]
         erw [@Representation.ofModule_asAlgebraHom_apply_apply k G _ _ _ _ (_)]
style: homogenise porting notes (#11145)

Homogenises porting notes via capitalisation and addition of whitespace.

It makes the following changes:

  • converts "--porting note" into "-- Porting note";
  • converts "porting note" into "Porting note".
Diff
@@ -64,7 +64,7 @@ instance (V : Rep k G) : Module k V := by
 /-- Specialize the existing `Action.ρ`, changing the type to `Representation k G V`.
 -/
 def ρ (V : Rep k G) : Representation k G V :=
--- porting note: was `V.ρ`
+-- Porting note: was `V.ρ`
   Action.ρ V
 set_option linter.uppercaseLean3 false in
 #align Rep.ρ Rep.ρ
chore: classify broken proof was porting notes (#11040)

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

broken proof was

Diff
@@ -225,7 +225,7 @@ set_option linter.uppercaseLean3 false in
 @[simp]
 theorem linearization_μ_inv_hom (X Y : Action (Type u) (MonCat.of G)) :
     (inv ((linearization k G).μ X Y)).hom = (finsuppTensorFinsupp' k X.V Y.V).symm.toLinearMap := by
--- Porting note: broken proof was
+-- Porting note (#11039): broken proof was
 /-simp_rw [← Action.forget_map, Functor.map_inv, Action.forget_map, linearization_μ_hom]
   apply IsIso.inv_eq_of_hom_inv_id _
   exact LinearMap.ext fun x => LinearEquiv.symm_apply_apply _ _-/
chore: remove terminal, terminal refines (#10762)

I replaced a few "terminal" refine/refine's with exact.

The strategy was very simple-minded: essentially any refine whose following line had smaller indentation got replaced by exact and then I cleaned up the mess.

This PR certainly leaves some further terminal refines, but maybe the current change is beneficial.

Diff
@@ -331,7 +331,7 @@ variable {k G}
 noncomputable def leftRegularHom (A : Rep k G) (x : A) : Rep.ofMulAction k G G ⟶ A where
   hom := Finsupp.lift _ _ _ fun g => A.ρ g x
   comm g := by
-    refine' Finsupp.lhom_ext' fun y => LinearMap.ext_ring _
+    refine Finsupp.lhom_ext' fun y => LinearMap.ext_ring ?_
 /- Porting note: rest of broken proof was
     simpa only [LinearMap.comp_apply, ModuleCat.comp_def, Finsupp.lsingle_apply, Finsupp.lift_apply,
       Action_ρ_eq_ρ, of_ρ_apply, Representation.ofMulAction_single, Finsupp.sum_single_index,
refactor(RepresentationTheory/GroupCohomology): tidy up 8599 and add more low degree cocycle API (#8785)
Diff
@@ -290,7 +290,7 @@ set_option linter.uppercaseLean3 false in
 
 section
 
-variable (k G A : Type) [CommRing k] [Monoid G] [AddCommGroup A]
+variable (k G A : Type u) [CommRing k] [Monoid G] [AddCommGroup A]
   [Module k A] [DistribMulAction G A] [SMulCommClass G k A]
 
 /-- Turns a `k`-module `A` with a compatible `DistribMulAction` of a monoid `G` into a
@@ -313,8 +313,8 @@ variable (M G : Type) [Monoid M] [CommGroup G] [MulDistribMulAction M G]
 `ℤ`-linear `M`-representation on `Additive G`. -/
 def ofMulDistribMulAction : Rep ℤ M := Rep.of (Representation.ofMulDistribMulAction M G)
 
-@[simp] theorem ofMulDistribMulAction_ρ_apply_apply (g : M) (a : G) :
-    (ofMulDistribMulAction M G).ρ g a = g • a := rfl
+@[simp] theorem ofMulDistribMulAction_ρ_apply_apply (g : M) (a : Additive G) :
+    (ofMulDistribMulAction M G).ρ g a = Additive.ofMul (g • Additive.toMul a) := rfl
 
 /-- Given an `R`-algebra `S`, the `ℤ`-linear representation associated to the natural action of
 `S ≃ₐ[R] S` on `Sˣ`. -/
chore: reduce imports (#9830)

This uses the improved shake script from #9772 to reduce imports across mathlib. The corresponding noshake.json file has been added to #9772.

Co-authored-by: Mario Carneiro <di.gama@gmail.com>

Diff
@@ -3,10 +3,10 @@ Copyright (c) 2020 Scott Morrison. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Scott Morrison
 -/
-import Mathlib.Algebra.Category.ModuleCat.Abelian
 import Mathlib.Algebra.Category.ModuleCat.Adjunctions
+import Mathlib.Algebra.Category.ModuleCat.Limits
 import Mathlib.Algebra.Category.ModuleCat.Colimits
-import Mathlib.Algebra.Category.ModuleCat.Monoidal.Closed
+import Mathlib.Algebra.Category.ModuleCat.Monoidal.Symmetric
 import Mathlib.CategoryTheory.Elementwise
 import Mathlib.RepresentationTheory.Action.Monoidal
 import Mathlib.RepresentationTheory.Basic
feat: Add API for AlgEquiv. (#8639)

Co-authored-by: Andrew Yang <36414270+erdOne@users.noreply.github.com>

Diff
@@ -686,7 +686,7 @@ def counitIso (M : ModuleCat.{u} (MonoidAlgebra k G)) :
       map_smul' := fun r x => by
         dsimp [counitIsoAddEquiv]
 /- Porting note: rest of broken proof was `simp`. -/
-        rw [AddEquiv.coe_toEquiv, AddEquiv.trans_apply]
+        rw [AddEquiv.trans_apply]
         rw [AddEquiv.trans_apply]
         erw [@Representation.ofModule_asAlgebraHom_apply_apply k G _ _ _ _ (_)]
         exact AddEquiv.symm_apply_apply _ _}
@@ -716,7 +716,7 @@ def unitIso (V : Rep k G) : V ≅ (toModuleMonoidAlgebra ⋙ ofModuleMonoidAlgeb
           simp only [Representation.asModuleEquiv_symm_map_smul,
             RestrictScalars.addEquiv_symm_map_algebraMap_smul] -/
           -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644
-          erw [AddEquiv.coe_toEquiv, AddEquiv.trans_apply,
+          erw [AddEquiv.trans_apply,
             Representation.asModuleEquiv_symm_map_smul]
           rfl })
     fun g => by ext; apply unit_iso_comm
chore: split RepresentationTheory.Action in multiple files (#8660)

Splits Mathlib.RepresentationTheory.Action in multiple files.

Diff
@@ -8,7 +8,7 @@ import Mathlib.Algebra.Category.ModuleCat.Adjunctions
 import Mathlib.Algebra.Category.ModuleCat.Colimits
 import Mathlib.Algebra.Category.ModuleCat.Monoidal.Closed
 import Mathlib.CategoryTheory.Elementwise
-import Mathlib.RepresentationTheory.Action
+import Mathlib.RepresentationTheory.Action.Monoidal
 import Mathlib.RepresentationTheory.Basic
 
 #align_import representation_theory.Rep from "leanprover-community/mathlib"@"cec81510e48e579bde6acd8568c06a87af045b63"
chore: space after (#8178)

Co-authored-by: Moritz Firsching <firsching@google.com>

Diff
@@ -372,7 +372,7 @@ noncomputable def leftRegularHomEquiv (A : Rep k G) : (Rep.ofMulAction k G G ⟶
       Representation.ofMulAction_single x (1 : G) (1 : k), smul_eq_mul, mul_one] -/
     simp only [LinearMap.comp_apply, Finsupp.lsingle_apply, leftRegularHom_hom]
     erw [Finsupp.lift_apply]
-    rw [Finsupp.sum_single_index, ←this, of_ρ_apply]
+    rw [Finsupp.sum_single_index, ← this, of_ρ_apply]
     erw [Representation.ofMulAction_single x (1 : G) (1 : k)]
     simp only [one_smul, smul_eq_mul, mul_one]
     · -- This goal didn't exist before leanprover/lean4#2644
@@ -431,9 +431,9 @@ def homEquiv (A B C : Rep k G) : (A ⊗ B ⟶ C) ≃ (B ⟶ (Rep.ihom A).obj C)
       comm := fun g => by
         refine' LinearMap.ext fun x => LinearMap.ext fun y => _
         change f.hom (_ ⊗ₜ[k] _) = C.ρ g (f.hom (_ ⊗ₜ[k] _))
-        rw [←hom_comm_apply]
+        rw [← hom_comm_apply]
         change _ = f.hom ((A.ρ g * A.ρ g⁻¹) y ⊗ₜ[k] _)
-        simp only [←map_mul, mul_inv_self, map_one]
+        simp only [← map_mul, mul_inv_self, map_one]
         rfl }
   invFun f :=
     { hom := TensorProduct.uncurry k _ _ _ f.hom.flip
feat(RepresentationTheory/GroupCohomology): Noether's generalization of Hilbert's Theorem 90 (#8599)
Diff
@@ -288,6 +288,41 @@ noncomputable def linearizationOfMulActionIso (H : Type u) [MulAction G H] :
 set_option linter.uppercaseLean3 false in
 #align Rep.linearization_of_mul_action_iso Rep.linearizationOfMulActionIso
 
+section
+
+variable (k G A : Type) [CommRing k] [Monoid G] [AddCommGroup A]
+  [Module k A] [DistribMulAction G A] [SMulCommClass G k A]
+
+/-- Turns a `k`-module `A` with a compatible `DistribMulAction` of a monoid `G` into a
+`k`-linear `G`-representation on `A`. -/
+def ofDistribMulAction : Rep k G := Rep.of (Representation.ofDistribMulAction k G A)
+
+@[simp] theorem ofDistribMulAction_ρ_apply_apply (g : G) (a : A) :
+    (ofDistribMulAction k G A).ρ g a = g • a := rfl
+
+/-- Given an `R`-algebra `S`, the `ℤ`-linear representation associated to the natural action of
+`S ≃ₐ[R] S` on `S`. -/
+@[simp] def ofAlgebraAut (R S : Type) [CommRing R] [CommRing S] [Algebra R S] :
+    Rep ℤ (S ≃ₐ[R] S) := ofDistribMulAction ℤ (S ≃ₐ[R] S) S
+
+end
+section
+variable (M G : Type) [Monoid M] [CommGroup G] [MulDistribMulAction M G]
+
+/-- Turns a `CommGroup` `G` with a `MulDistribMulAction` of a monoid `M` into a
+`ℤ`-linear `M`-representation on `Additive G`. -/
+def ofMulDistribMulAction : Rep ℤ M := Rep.of (Representation.ofMulDistribMulAction M G)
+
+@[simp] theorem ofMulDistribMulAction_ρ_apply_apply (g : M) (a : G) :
+    (ofMulDistribMulAction M G).ρ g a = g • a := rfl
+
+/-- Given an `R`-algebra `S`, the `ℤ`-linear representation associated to the natural action of
+`S ≃ₐ[R] S` on `Sˣ`. -/
+@[simp] def ofAlgebraAutOnUnits (R S : Type) [CommRing R] [CommRing S] [Algebra R S] :
+    Rep ℤ (S ≃ₐ[R] S) := Rep.ofMulDistribMulAction (S ≃ₐ[R] S) Sˣ
+
+end
+
 variable {k G}
 
 /-- Given an element `x : A`, there is a natural morphism of representations `k[G] ⟶ A` sending
chore: redistribute some of the results in LinearAlgebra.Basic (#7801)

This reduces the file from ~2600 lines to ~1600 lines.

Co-authored-by: Vierkantor <vierkantor@vierkantor.com> Co-authored-by: Floris van Doorn <fpvdoorn@gmail.com>

Diff
@@ -3,12 +3,13 @@ Copyright (c) 2020 Scott Morrison. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Scott Morrison
 -/
-import Mathlib.RepresentationTheory.Basic
-import Mathlib.RepresentationTheory.Action
 import Mathlib.Algebra.Category.ModuleCat.Abelian
+import Mathlib.Algebra.Category.ModuleCat.Adjunctions
 import Mathlib.Algebra.Category.ModuleCat.Colimits
 import Mathlib.Algebra.Category.ModuleCat.Monoidal.Closed
-import Mathlib.Algebra.Category.ModuleCat.Adjunctions
+import Mathlib.CategoryTheory.Elementwise
+import Mathlib.RepresentationTheory.Action
+import Mathlib.RepresentationTheory.Basic
 
 #align_import representation_theory.Rep from "leanprover-community/mathlib"@"cec81510e48e579bde6acd8568c06a87af045b63"
 
feat(RepresentationTheory/GroupCohomology/LowDegree): H¹(G, A) ≃ Hom(G, A) for a trivial representation (#7988)
Diff
@@ -136,6 +136,15 @@ theorem trivial_def {V : Type u} [AddCommGroup V] [Module k V] (g : G) (v : V) :
 set_option linter.uppercaseLean3 false in
 #align Rep.trivial_def Rep.trivial_def
 
+/-- A predicate for representations that fix every element. -/
+abbrev IsTrivial (A : Rep k G) := A.ρ.IsTrivial
+
+instance {V : Type u} [AddCommGroup V] [Module k V] :
+    IsTrivial (Rep.trivial k G V) where
+
+instance {V : Type u} [AddCommGroup V] [Module k V] (ρ : Representation k G V) [ρ.IsTrivial] :
+    IsTrivial (Rep.of ρ) where
+
 -- Porting note: the two following instances were found automatically in mathlib3
 noncomputable instance : PreservesLimits (forget₂ (Rep k G) (ModuleCat.{u} k)) :=
   Action.instPreservesLimitsForget.{u} _ _
chore: removing unneeded maxHeartbeats (#7761)

Due to recent changes in core we can reduce or remove many set_option maxHeartbeats statements.

I have tried to be careful to not leave anything too close to the line, so don't be surprised if some of these can still be reduced further.

This reduces us from 96 maxHeartbeats statements to 44. (There are 10 false positives in meta or testing code.)

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

Diff
@@ -459,8 +459,6 @@ theorem ihom_ev_app_hom (A B : Rep k G) :
 set_option linter.uppercaseLean3 false in
 #align Rep.ihom_ev_app_hom Rep.ihom_ev_app_hom
 
-/- Porting note: needs extra heartbeats. -/
-set_option maxHeartbeats 240000 in
 @[simp] theorem ihom_coev_app_hom (A B : Rep k G) :
     Action.Hom.hom ((ihom.coev A).app B) = (TensorProduct.mk k _ _).flip :=
   LinearMap.ext fun _ => LinearMap.ext fun _ => rfl
Revert "chore: revert #7703 (#7710)"

This reverts commit f3695eb2.

Diff
@@ -231,7 +231,8 @@ theorem linearization_ε_hom : (linearization k G).ε.hom = Finsupp.lsingle PUni
 set_option linter.uppercaseLean3 false in
 #align Rep.linearization_ε_hom Rep.linearization_ε_hom
 
-@[simp]
+-- This was always a bad simp lemma, but the linter did not notice until lean4#2644
+@[simp, nolint simpNF]
 theorem linearization_ε_inv_hom_apply (r : k) :
     (inv (linearization k G).ε).hom (Finsupp.single PUnit.unit r) = r :=
   IsIso.hom_inv_id_apply (linearization k G).ε r
@@ -299,7 +300,8 @@ set_option linter.uppercaseLean3 false in
 
 theorem leftRegularHom_apply {A : Rep k G} (x : A) :
     (leftRegularHom A x).hom (Finsupp.single 1 1) = x := by
-  rw [leftRegularHom_hom, Finsupp.lift_apply, Finsupp.sum_single_index, one_smul,
+  -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644
+  erw [leftRegularHom_hom, Finsupp.lift_apply, Finsupp.sum_single_index, one_smul,
     A.ρ.map_one, LinearMap.one_apply]
   · rw [zero_smul]
 set_option linter.uppercaseLean3 false in
@@ -328,6 +330,8 @@ noncomputable def leftRegularHomEquiv (A : Rep k G) : (Rep.ofMulAction k G G ⟶
     rw [Finsupp.sum_single_index, ←this, of_ρ_apply]
     erw [Representation.ofMulAction_single x (1 : G) (1 : k)]
     simp only [one_smul, smul_eq_mul, mul_one]
+    · -- This goal didn't exist before leanprover/lean4#2644
+      rfl
     · rw [zero_smul]
   right_inv x := leftRegularHom_apply x
 set_option linter.uppercaseLean3 false in
@@ -335,7 +339,8 @@ set_option linter.uppercaseLean3 false in
 
 theorem leftRegularHomEquiv_symm_single {A : Rep k G} (x : A) (g : G) :
     ((leftRegularHomEquiv A).symm x).hom (Finsupp.single g 1) = A.ρ g x := by
-  rw [leftRegularHomEquiv_symm_apply, leftRegularHom_hom, Finsupp.lift_apply,
+  -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644
+  erw [leftRegularHomEquiv_symm_apply, leftRegularHom_hom, Finsupp.lift_apply,
     Finsupp.sum_single_index, one_smul]
   · rw [zero_smul]
 set_option linter.uppercaseLean3 false in
@@ -395,8 +400,12 @@ def homEquiv (A B C : Rep k G) : (A ⊗ B ⟶ C) ≃ (B ⟶ (Rep.ihom A).obj C)
           hom_comm_apply f g y, Rep.ihom_obj_ρ_apply, LinearMap.comp_apply, ρ_inv_self_apply] -/
         change TensorProduct.uncurry k _ _ _ f.hom.flip (A.ρ g x ⊗ₜ[k] B.ρ g y) =
           C.ρ g (TensorProduct.uncurry k _ _ _ f.hom.flip (x ⊗ₜ[k] y))
-        rw [TensorProduct.uncurry_apply, LinearMap.flip_apply, hom_comm_apply, Rep.ihom_obj_ρ_apply,
-          LinearMap.comp_apply, LinearMap.comp_apply, ρ_inv_self_apply]
+        -- The next 3 tactics used to be `rw` before leanprover/lean4#2644
+        erw [TensorProduct.uncurry_apply, LinearMap.flip_apply, hom_comm_apply,
+          Rep.ihom_obj_ρ_apply,
+          LinearMap.comp_apply, LinearMap.comp_apply] --, ρ_inv_self_apply (A := C)]
+        dsimp
+        erw [ρ_inv_self_apply]
         rfl}
   left_inv f := Action.Hom.ext _ _ (TensorProduct.ext' fun _ _ => rfl)
   right_inv f := by ext; rfl
@@ -494,14 +503,16 @@ theorem MonoidalClosed.linearHomEquivComm_hom (f : A ⊗ B ⟶ C) :
 set_option linter.uppercaseLean3 false in
 #align Rep.monoidal_closed.linear_hom_equiv_comm_hom Rep.MonoidalClosed.linearHomEquivComm_hom
 
-@[simp]
+-- This was always a bad simp lemma, but the linter did not notice until lean4#2644
+@[simp, nolint simpNF]
 theorem MonoidalClosed.linearHomEquiv_symm_hom (f : B ⟶ A ⟶[Rep k G] C) :
     ((MonoidalClosed.linearHomEquiv A B C).symm f).hom = TensorProduct.uncurry k A B C f.hom.flip :=
   rfl
 set_option linter.uppercaseLean3 false in
 #align Rep.monoidal_closed.linear_hom_equiv_symm_hom Rep.MonoidalClosed.linearHomEquiv_symm_hom
 
-@[simp]
+-- This was always a bad simp lemma, but the linter did not notice until lean4#2644
+@[simp, nolint simpNF]
 theorem MonoidalClosed.linearHomEquivComm_symm_hom (f : A ⟶ B ⟶[Rep k G] C) :
     ((MonoidalClosed.linearHomEquivComm A B C).symm f).hom
       = TensorProduct.uncurry k A B C f.hom :=
@@ -661,9 +672,9 @@ def unitIso (V : Rep k G) : V ≅ (toModuleMonoidAlgebra ⋙ ofModuleMonoidAlgeb
 /- Porting note: rest of broken proof was
           simp only [Representation.asModuleEquiv_symm_map_smul,
             RestrictScalars.addEquiv_symm_map_algebraMap_smul] -/
-          rw [AddEquiv.coe_toEquiv, AddEquiv.trans_apply,
-            Representation.asModuleEquiv_symm_map_smul,
-            RestrictScalars.addEquiv_symm_map_algebraMap_smul]
+          -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644
+          erw [AddEquiv.coe_toEquiv, AddEquiv.trans_apply,
+            Representation.asModuleEquiv_symm_map_smul]
           rfl })
     fun g => by ext; apply unit_iso_comm
 set_option linter.uppercaseLean3 false in
chore: revert #7703 (#7710)

This reverts commit 26eb2b0a.

Diff
@@ -231,8 +231,7 @@ theorem linearization_ε_hom : (linearization k G).ε.hom = Finsupp.lsingle PUni
 set_option linter.uppercaseLean3 false in
 #align Rep.linearization_ε_hom Rep.linearization_ε_hom
 
--- This was always a bad simp lemma, but the linter did not notice until lean4#2644
-@[simp, nolint simpNF]
+@[simp]
 theorem linearization_ε_inv_hom_apply (r : k) :
     (inv (linearization k G).ε).hom (Finsupp.single PUnit.unit r) = r :=
   IsIso.hom_inv_id_apply (linearization k G).ε r
@@ -300,8 +299,7 @@ set_option linter.uppercaseLean3 false in
 
 theorem leftRegularHom_apply {A : Rep k G} (x : A) :
     (leftRegularHom A x).hom (Finsupp.single 1 1) = x := by
-  -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644
-  erw [leftRegularHom_hom, Finsupp.lift_apply, Finsupp.sum_single_index, one_smul,
+  rw [leftRegularHom_hom, Finsupp.lift_apply, Finsupp.sum_single_index, one_smul,
     A.ρ.map_one, LinearMap.one_apply]
   · rw [zero_smul]
 set_option linter.uppercaseLean3 false in
@@ -330,8 +328,6 @@ noncomputable def leftRegularHomEquiv (A : Rep k G) : (Rep.ofMulAction k G G ⟶
     rw [Finsupp.sum_single_index, ←this, of_ρ_apply]
     erw [Representation.ofMulAction_single x (1 : G) (1 : k)]
     simp only [one_smul, smul_eq_mul, mul_one]
-    · -- This goal didn't exist before leanprover/lean4#2644
-      rfl
     · rw [zero_smul]
   right_inv x := leftRegularHom_apply x
 set_option linter.uppercaseLean3 false in
@@ -339,8 +335,7 @@ set_option linter.uppercaseLean3 false in
 
 theorem leftRegularHomEquiv_symm_single {A : Rep k G} (x : A) (g : G) :
     ((leftRegularHomEquiv A).symm x).hom (Finsupp.single g 1) = A.ρ g x := by
-  -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644
-  erw [leftRegularHomEquiv_symm_apply, leftRegularHom_hom, Finsupp.lift_apply,
+  rw [leftRegularHomEquiv_symm_apply, leftRegularHom_hom, Finsupp.lift_apply,
     Finsupp.sum_single_index, one_smul]
   · rw [zero_smul]
 set_option linter.uppercaseLean3 false in
@@ -400,12 +395,8 @@ def homEquiv (A B C : Rep k G) : (A ⊗ B ⟶ C) ≃ (B ⟶ (Rep.ihom A).obj C)
           hom_comm_apply f g y, Rep.ihom_obj_ρ_apply, LinearMap.comp_apply, ρ_inv_self_apply] -/
         change TensorProduct.uncurry k _ _ _ f.hom.flip (A.ρ g x ⊗ₜ[k] B.ρ g y) =
           C.ρ g (TensorProduct.uncurry k _ _ _ f.hom.flip (x ⊗ₜ[k] y))
-        -- The next 3 tactics used to be `rw` before leanprover/lean4#2644
-        erw [TensorProduct.uncurry_apply, LinearMap.flip_apply, hom_comm_apply,
-          Rep.ihom_obj_ρ_apply,
-          LinearMap.comp_apply, LinearMap.comp_apply] --, ρ_inv_self_apply (A := C)]
-        dsimp
-        erw [ρ_inv_self_apply]
+        rw [TensorProduct.uncurry_apply, LinearMap.flip_apply, hom_comm_apply, Rep.ihom_obj_ρ_apply,
+          LinearMap.comp_apply, LinearMap.comp_apply, ρ_inv_self_apply]
         rfl}
   left_inv f := Action.Hom.ext _ _ (TensorProduct.ext' fun _ _ => rfl)
   right_inv f := by ext; rfl
@@ -503,16 +494,14 @@ theorem MonoidalClosed.linearHomEquivComm_hom (f : A ⊗ B ⟶ C) :
 set_option linter.uppercaseLean3 false in
 #align Rep.monoidal_closed.linear_hom_equiv_comm_hom Rep.MonoidalClosed.linearHomEquivComm_hom
 
--- This was always a bad simp lemma, but the linter did not notice until lean4#2644
-@[simp, nolint simpNF]
+@[simp]
 theorem MonoidalClosed.linearHomEquiv_symm_hom (f : B ⟶ A ⟶[Rep k G] C) :
     ((MonoidalClosed.linearHomEquiv A B C).symm f).hom = TensorProduct.uncurry k A B C f.hom.flip :=
   rfl
 set_option linter.uppercaseLean3 false in
 #align Rep.monoidal_closed.linear_hom_equiv_symm_hom Rep.MonoidalClosed.linearHomEquiv_symm_hom
 
--- This was always a bad simp lemma, but the linter did not notice until lean4#2644
-@[simp, nolint simpNF]
+@[simp]
 theorem MonoidalClosed.linearHomEquivComm_symm_hom (f : A ⟶ B ⟶[Rep k G] C) :
     ((MonoidalClosed.linearHomEquivComm A B C).symm f).hom
       = TensorProduct.uncurry k A B C f.hom :=
@@ -672,9 +661,9 @@ def unitIso (V : Rep k G) : V ≅ (toModuleMonoidAlgebra ⋙ ofModuleMonoidAlgeb
 /- Porting note: rest of broken proof was
           simp only [Representation.asModuleEquiv_symm_map_smul,
             RestrictScalars.addEquiv_symm_map_algebraMap_smul] -/
-          -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644
-          erw [AddEquiv.coe_toEquiv, AddEquiv.trans_apply,
-            Representation.asModuleEquiv_symm_map_smul]
+          rw [AddEquiv.coe_toEquiv, AddEquiv.trans_apply,
+            Representation.asModuleEquiv_symm_map_smul,
+            RestrictScalars.addEquiv_symm_map_algebraMap_smul]
           rfl })
     fun g => by ext; apply unit_iso_comm
 set_option linter.uppercaseLean3 false in
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
@@ -231,7 +231,8 @@ theorem linearization_ε_hom : (linearization k G).ε.hom = Finsupp.lsingle PUni
 set_option linter.uppercaseLean3 false in
 #align Rep.linearization_ε_hom Rep.linearization_ε_hom
 
-@[simp]
+-- This was always a bad simp lemma, but the linter did not notice until lean4#2644
+@[simp, nolint simpNF]
 theorem linearization_ε_inv_hom_apply (r : k) :
     (inv (linearization k G).ε).hom (Finsupp.single PUnit.unit r) = r :=
   IsIso.hom_inv_id_apply (linearization k G).ε r
@@ -299,7 +300,8 @@ set_option linter.uppercaseLean3 false in
 
 theorem leftRegularHom_apply {A : Rep k G} (x : A) :
     (leftRegularHom A x).hom (Finsupp.single 1 1) = x := by
-  rw [leftRegularHom_hom, Finsupp.lift_apply, Finsupp.sum_single_index, one_smul,
+  -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644
+  erw [leftRegularHom_hom, Finsupp.lift_apply, Finsupp.sum_single_index, one_smul,
     A.ρ.map_one, LinearMap.one_apply]
   · rw [zero_smul]
 set_option linter.uppercaseLean3 false in
@@ -328,6 +330,8 @@ noncomputable def leftRegularHomEquiv (A : Rep k G) : (Rep.ofMulAction k G G ⟶
     rw [Finsupp.sum_single_index, ←this, of_ρ_apply]
     erw [Representation.ofMulAction_single x (1 : G) (1 : k)]
     simp only [one_smul, smul_eq_mul, mul_one]
+    · -- This goal didn't exist before leanprover/lean4#2644
+      rfl
     · rw [zero_smul]
   right_inv x := leftRegularHom_apply x
 set_option linter.uppercaseLean3 false in
@@ -335,7 +339,8 @@ set_option linter.uppercaseLean3 false in
 
 theorem leftRegularHomEquiv_symm_single {A : Rep k G} (x : A) (g : G) :
     ((leftRegularHomEquiv A).symm x).hom (Finsupp.single g 1) = A.ρ g x := by
-  rw [leftRegularHomEquiv_symm_apply, leftRegularHom_hom, Finsupp.lift_apply,
+  -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644
+  erw [leftRegularHomEquiv_symm_apply, leftRegularHom_hom, Finsupp.lift_apply,
     Finsupp.sum_single_index, one_smul]
   · rw [zero_smul]
 set_option linter.uppercaseLean3 false in
@@ -395,8 +400,12 @@ def homEquiv (A B C : Rep k G) : (A ⊗ B ⟶ C) ≃ (B ⟶ (Rep.ihom A).obj C)
           hom_comm_apply f g y, Rep.ihom_obj_ρ_apply, LinearMap.comp_apply, ρ_inv_self_apply] -/
         change TensorProduct.uncurry k _ _ _ f.hom.flip (A.ρ g x ⊗ₜ[k] B.ρ g y) =
           C.ρ g (TensorProduct.uncurry k _ _ _ f.hom.flip (x ⊗ₜ[k] y))
-        rw [TensorProduct.uncurry_apply, LinearMap.flip_apply, hom_comm_apply, Rep.ihom_obj_ρ_apply,
-          LinearMap.comp_apply, LinearMap.comp_apply, ρ_inv_self_apply]
+        -- The next 3 tactics used to be `rw` before leanprover/lean4#2644
+        erw [TensorProduct.uncurry_apply, LinearMap.flip_apply, hom_comm_apply,
+          Rep.ihom_obj_ρ_apply,
+          LinearMap.comp_apply, LinearMap.comp_apply] --, ρ_inv_self_apply (A := C)]
+        dsimp
+        erw [ρ_inv_self_apply]
         rfl}
   left_inv f := Action.Hom.ext _ _ (TensorProduct.ext' fun _ _ => rfl)
   right_inv f := by ext; rfl
@@ -494,14 +503,16 @@ theorem MonoidalClosed.linearHomEquivComm_hom (f : A ⊗ B ⟶ C) :
 set_option linter.uppercaseLean3 false in
 #align Rep.monoidal_closed.linear_hom_equiv_comm_hom Rep.MonoidalClosed.linearHomEquivComm_hom
 
-@[simp]
+-- This was always a bad simp lemma, but the linter did not notice until lean4#2644
+@[simp, nolint simpNF]
 theorem MonoidalClosed.linearHomEquiv_symm_hom (f : B ⟶ A ⟶[Rep k G] C) :
     ((MonoidalClosed.linearHomEquiv A B C).symm f).hom = TensorProduct.uncurry k A B C f.hom.flip :=
   rfl
 set_option linter.uppercaseLean3 false in
 #align Rep.monoidal_closed.linear_hom_equiv_symm_hom Rep.MonoidalClosed.linearHomEquiv_symm_hom
 
-@[simp]
+-- This was always a bad simp lemma, but the linter did not notice until lean4#2644
+@[simp, nolint simpNF]
 theorem MonoidalClosed.linearHomEquivComm_symm_hom (f : A ⟶ B ⟶[Rep k G] C) :
     ((MonoidalClosed.linearHomEquivComm A B C).symm f).hom
       = TensorProduct.uncurry k A B C f.hom :=
@@ -661,9 +672,9 @@ def unitIso (V : Rep k G) : V ≅ (toModuleMonoidAlgebra ⋙ ofModuleMonoidAlgeb
 /- Porting note: rest of broken proof was
           simp only [Representation.asModuleEquiv_symm_map_smul,
             RestrictScalars.addEquiv_symm_map_algebraMap_smul] -/
-          rw [AddEquiv.coe_toEquiv, AddEquiv.trans_apply,
-            Representation.asModuleEquiv_symm_map_smul,
-            RestrictScalars.addEquiv_symm_map_algebraMap_smul]
+          -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644
+          erw [AddEquiv.coe_toEquiv, AddEquiv.trans_apply,
+            Representation.asModuleEquiv_symm_map_smul]
           rfl })
     fun g => by ext; apply unit_iso_comm
 set_option linter.uppercaseLean3 false in
feat: use suppress_compilation in tensor products (#7504)

More principled version of #7281.

Diff
@@ -26,6 +26,7 @@ We construct the categorical equivalence `Rep k G ≌ ModuleCat (MonoidAlgebra k
 We verify that `Rep k G` is a `k`-linear abelian symmetric monoidal category with all (co)limits.
 -/
 
+suppress_compilation
 
 universe u
 
feat(CategoryTheory/Monoidal/Transport): generalize to a faithful functor (#7237)

I needed this to transfer the monoidal structure from ModuleCat to QuadraticModuleCat, but would also work for transferring the same structure from ModuleCat to AlgebraCat.

The changes are:

  • A new CategoryTheory.Monoidal.induced definition, proven from scratch with slightly uglier proofs than what transport used. The new proofs use simp rather more than targeted slice commands, mainly due to lack of patience on my part.
  • CategoryTheory.Monoidal.transport now has a trivial implementation in terms of induced, as does CategoryTheory.MonoidalCategory.fullMonoidalSubcategory (though this was already fairly trivial)
  • CategoryTheory.Monoidal.laxToTransported has been removed, as it's just a less useful version of CategoryTheory.Monoidal.toTransported
  • CategoryTheory.Monoidal.toTransported has been golfed to oblivion, as it now falls out trivially by showing fromTransported first.
Diff
@@ -477,14 +477,16 @@ set_option linter.uppercaseLean3 false in
 
 variable {A B C}
 
-@[simp]
+-- `simpNF` times out
+@[simp, nolint simpNF]
 theorem MonoidalClosed.linearHomEquiv_hom (f : A ⊗ B ⟶ C) :
     (MonoidalClosed.linearHomEquiv A B C f).hom = (TensorProduct.curry f.hom).flip :=
   rfl
 set_option linter.uppercaseLean3 false in
 #align Rep.monoidal_closed.linear_hom_equiv_hom Rep.MonoidalClosed.linearHomEquiv_hom
 
-@[simp]
+-- `simpNF` times out
+@[simp, nolint simpNF]
 theorem MonoidalClosed.linearHomEquivComm_hom (f : A ⊗ B ⟶ C) :
     (MonoidalClosed.linearHomEquivComm A B C f).hom = TensorProduct.curry f.hom :=
   rfl
chore: only four spaces for subsequent lines (#7286)

Co-authored-by: Moritz Firsching <firsching@google.com>

Diff
@@ -407,14 +407,14 @@ variable {A B C}
 /-- Porting note: if we generate this with `@[simps]` the linter complains some types in the LHS
 simplify. -/
 theorem homEquiv_apply_hom (f : A ⊗ B ⟶ C) :
-  (homEquiv A B C f).hom = (TensorProduct.curry f.hom).flip := rfl
+    (homEquiv A B C f).hom = (TensorProduct.curry f.hom).flip := rfl
 set_option linter.uppercaseLean3 false in
 #align Rep.hom_equiv_apply_hom Rep.homEquiv_apply_hom
 
 /-- Porting note: if we generate this with `@[simps]` the linter complains some types in the LHS
 simplify. -/
 theorem homEquiv_symm_apply_hom (f : B ⟶ (Rep.ihom A).obj C) :
-  ((homEquiv A B C).symm f).hom = TensorProduct.uncurry k A B C f.hom.flip := rfl
+    ((homEquiv A B C).symm f).hom = TensorProduct.uncurry k A B C f.hom.flip := rfl
 set_option linter.uppercaseLean3 false in
 #align Rep.hom_equiv_symm_apply_hom Rep.homEquiv_symm_apply_hom
 
perf: remove overspecified fields (#6965)

This removes redundant field values of the form add := add for smaller terms and less unfolding during unification.

A list of all files containing a structure instance of the form { a1, ... with x1 := val, ... } where some xi is a field of some aj was generated by modifying the structure instance elaboration algorithm to print such overlaps to stdout in a custom toolchain.

Using that toolchain, I went through each file on the list and attempted to remove algebraic fields that overlapped and were redundant, eg add := add and not toFun (though some other ones did creep in). If things broke (which was the case in a couple of cases), I did not push further and reverted.

It is possible that pushing harder and trying to remove all redundant overlaps will yield further improvements.

Diff
@@ -630,7 +630,8 @@ def counitIso (M : ModuleCat.{u} (MonoidAlgebra k G)) :
         dsimp [counitIsoAddEquiv]
 /- Porting note: rest of broken proof was `simp`. -/
         rw [AddEquiv.coe_toEquiv, AddEquiv.trans_apply]
-        erw [Representation.ofModule_asAlgebraHom_apply_apply]
+        rw [AddEquiv.trans_apply]
+        erw [@Representation.ofModule_asAlgebraHom_apply_apply k G _ _ _ _ (_)]
         exact AddEquiv.symm_apply_apply _ _}
 set_option linter.uppercaseLean3 false in
 #align Rep.counit_iso Rep.counitIso
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
@@ -552,7 +552,7 @@ example : MonoidalLinear k (Rep k G) := by infer_instance
 noncomputable section
 
 /-- Auxiliary lemma for `toModuleMonoidAlgebra`. -/
-theorem to_Module_monoidAlgebra_map_aux {k G : Type _} [CommRing k] [Monoid G] (V W : Type _)
+theorem to_Module_monoidAlgebra_map_aux {k G : Type*} [CommRing k] [Monoid G] (V W : Type*)
     [AddCommGroup V] [AddCommGroup W] [Module k V] [Module k W] (ρ : G →* V →ₗ[k] V)
     (σ : G →* W →ₗ[k] W) (f : V →ₗ[k] W) (w : ∀ g : G, f.comp (ρ g) = (σ g).comp f)
     (r : MonoidAlgebra k G) (x : V) :
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) 2020 Scott Morrison. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Scott Morrison
-
-! This file was ported from Lean 3 source module representation_theory.Rep
-! leanprover-community/mathlib commit cec81510e48e579bde6acd8568c06a87af045b63
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathlib.RepresentationTheory.Basic
 import Mathlib.RepresentationTheory.Action
@@ -15,6 +10,8 @@ import Mathlib.Algebra.Category.ModuleCat.Colimits
 import Mathlib.Algebra.Category.ModuleCat.Monoidal.Closed
 import Mathlib.Algebra.Category.ModuleCat.Adjunctions
 
+#align_import representation_theory.Rep from "leanprover-community/mathlib"@"cec81510e48e579bde6acd8568c06a87af045b63"
+
 /-!
 # `Rep k G` is the category of `k`-linear representations of `G`.
 
chore: bump to nightly-2023-07-01 (#5409)

Open in Gitpod

Co-authored-by: Komyyy <pol_tta@outlook.jp> Co-authored-by: Scott Morrison <scott.morrison@gmail.com> Co-authored-by: Scott Morrison <scott.morrison@anu.edu.au> Co-authored-by: Ruben Van de Velde <65514131+Ruben-VandeVelde@users.noreply.github.com> Co-authored-by: Mario Carneiro <di.gama@gmail.com>

Diff
@@ -453,7 +453,7 @@ set_option linter.uppercaseLean3 false in
 #align Rep.ihom_ev_app_hom Rep.ihom_ev_app_hom
 
 /- Porting note: needs extra heartbeats. -/
-set_option maxHeartbeats 230000 in
+set_option maxHeartbeats 240000 in
 @[simp] theorem ihom_coev_app_hom (A B : Rep k G) :
     Action.Hom.hom ((ihom.coev A).app B) = (TensorProduct.mk k _ _).flip :=
   LinearMap.ext fun _ => LinearMap.ext fun _ => rfl
chore: tidy various files (#5482)
Diff
@@ -554,7 +554,7 @@ example : MonoidalLinear k (Rep k G) := by infer_instance
 
 noncomputable section
 
-/-- Auxiliary lemma for `to_Module_monoid_algebra`. -/
+/-- Auxiliary lemma for `toModuleMonoidAlgebra`. -/
 theorem to_Module_monoidAlgebra_map_aux {k G : Type _} [CommRing k] [Monoid G] (V W : Type _)
     [AddCommGroup V] [AddCommGroup W] [Module k V] [Module k W] (ρ : G →* V →ₗ[k] V)
     (σ : G →* W →ₗ[k] W) (f : V →ₗ[k] W) (w : ∀ g : G, f.comp (ρ g) = (σ g).comp f)
@@ -571,7 +571,7 @@ theorem to_Module_monoidAlgebra_map_aux {k G : Type _} [CommRing k] [Monoid G] (
 set_option linter.uppercaseLean3 false in
 #align Rep.to_Module_monoid_algebra_map_aux Rep.to_Module_monoidAlgebra_map_aux
 
-/-- Auxiliary definition for `to_Module_monoid_algebra`. -/
+/-- Auxiliary definition for `toModuleMonoidAlgebra`. -/
 def toModuleMonoidAlgebraMap {V W : Rep k G} (f : V ⟶ W) :
     ModuleCat.of (MonoidAlgebra k G) V.ρ.asModule ⟶ ModuleCat.of (MonoidAlgebra k G) W.ρ.asModule :=
   { f.hom with
@@ -607,7 +607,7 @@ theorem ofModuleMonoidAlgebra_obj_ρ (M : ModuleCat.{u} (MonoidAlgebra k G)) :
 set_option linter.uppercaseLean3 false in
 #align Rep.of_Module_monoid_algebra_obj_ρ Rep.ofModuleMonoidAlgebra_obj_ρ
 
-/-- Auxiliary definition for `equivalence_Module_monoid_algebra`. -/
+/-- Auxiliary definition for `equivalenceModuleMonoidAlgebra`. -/
 def counitIsoAddEquiv {M : ModuleCat.{u} (MonoidAlgebra k G)} :
     (ofModuleMonoidAlgebra ⋙ toModuleMonoidAlgebra).obj M ≃+ M := by
   dsimp [ofModuleMonoidAlgebra, toModuleMonoidAlgebra]
@@ -616,7 +616,7 @@ def counitIsoAddEquiv {M : ModuleCat.{u} (MonoidAlgebra k G)} :
 set_option linter.uppercaseLean3 false in
 #align Rep.counit_iso_add_equiv Rep.counitIsoAddEquiv
 
-/-- Auxiliary definition for `equivalence_Module_monoid_algebra`. -/
+/-- Auxiliary definition for `equivalenceModuleMonoidAlgebra`. -/
 def unitIsoAddEquiv {V : Rep k G} : V ≃+ (toModuleMonoidAlgebra ⋙ ofModuleMonoidAlgebra).obj V := by
   dsimp [ofModuleMonoidAlgebra, toModuleMonoidAlgebra]
   refine' V.ρ.asModuleEquiv.symm.trans _
feat: port RepresentationTheory.Rep (#5041)

Co-authored-by: Jeremy Tan Jie Rui <reddeloostw@gmail.com>

Dependencies 11 + 748

749 files ported (98.6%)
290749 lines ported (98.8%)
Show graph

The unported dependencies are