l3lab/ntp-mathlib huggingface dataset:
/-- The `k[G]`-linear isomorphism `k[G] ⊗ₖ k[Gⁿ] ≃ k[Gⁿ⁺¹]`, where the `k[G]`-module structure on
the lefthand side is `TensorProduct.leftModule`, whilst that of the righthand side comes from
`Representation.asModule`. Allows us to use `Algebra.TensorProduct.basis` to get a `k[G]`-basis
of the righthand side. -/
def ofMulActionBasisAux :
    MonoidAlgebra k G ⊗[k] ((Fin n → G) →₀ k) ≃ₗ[MonoidAlgebra k G]
      (ofMulAction k G (Fin (n + 1) → G)).asModule :=
  { (Rep.equivalenceModuleMonoidAlgebra.1.mapIso (diagonalSucc k G n).symm).toLinearEquiv with
    map_smul' := fun r x => by
      -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644
      

Proof state:
k G : Type u
inst✝¹ : CommRing k
n : ℕ
inst✝ : Group G
src✝ : ↑(Rep.equivalenceModuleMonoidAlgebra.functor.obj
      (Rep.leftRegular k G ⊗ Rep.trivial k G ((Fin n → G) →₀ k))) ≃ₗ[MonoidAlgebra k G]
  ↑(Rep.equivalenceModuleMonoidAlgebra.functor.obj (Rep.diagonal k G (n + 1))) :=
  Iso.toLinearEquiv (Rep.equivalenceModuleMonoidAlgebra.functor.mapIso (diagonalSucc k G n).symm)
r : MonoidAlgebra k G
x : MonoidAlgebra k G ⊗[k] ((Fin n → G) →₀ k)
⊢ AddHom.toFun src✝.toAddHom (r • x) = (RingHom.id (MonoidAlgebra k G)) r • AddHom.toFun src✝.toAddHom x

Next tactic:
erw [RingHom.id_apply, LinearEquiv.toFun_eq_coe, ← LinearEquiv.map_smul]
/-- The `k[G]`-linear isomorphism `k[G] ⊗ₖ k[Gⁿ] ≃ k[Gⁿ⁺¹]`, where the `k[G]`-module structure on
the lefthand side is `TensorProduct.leftModule`, whilst that of the righthand side comes from
`Representation.asModule`. Allows us to use `Algebra.TensorProduct.basis` to get a `k[G]`-basis
of the righthand side. -/
def ofMulActionBasisAux :
    MonoidAlgebra k G ⊗[k] ((Fin n → G) →₀ k) ≃ₗ[MonoidAlgebra k G]
      (ofMulAction k G (Fin (n + 1) → G)).asModule :=
  { (Rep.equivalenceModuleMonoidAlgebra.1.mapIso (diagonalSucc k G n).symm).toLinearEquiv with
    map_smul' := fun r x => by
      -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644
      erw [RingHom.id_apply, LinearEquiv.toFun_eq_coe, ← LinearEquiv.map_smul]
      

Proof state:
k G : Type u
inst✝¹ : CommRing k
n : ℕ
inst✝ : Group G
src✝ : ↑(Rep.equivalenceModuleMonoidAlgebra.functor.obj
      (Rep.leftRegular k G ⊗ Rep.trivial k G ((Fin n → G) →₀ k))) ≃ₗ[MonoidAlgebra k G]
  ↑(Rep.equivalenceModuleMonoidAlgebra.functor.obj (Rep.diagonal k G (n + 1))) :=
  Iso.toLinearEquiv (Rep.equivalenceModuleMonoidAlgebra.functor.mapIso (diagonalSucc k G n).symm)
r : MonoidAlgebra k G
x : MonoidAlgebra k G ⊗[k] ((Fin n → G) →₀ k)
⊢ src✝ (r • x) = src✝ (r • x)

Next tactic:
congr 1
/-- The `k[G]`-linear isomorphism `k[G] ⊗ₖ k[Gⁿ] ≃ k[Gⁿ⁺¹]`, where the `k[G]`-module structure on
the lefthand side is `TensorProduct.leftModule`, whilst that of the righthand side comes from
`Representation.asModule`. Allows us to use `Algebra.TensorProduct.basis` to get a `k[G]`-basis
of the righthand side. -/
def ofMulActionBasisAux :
    MonoidAlgebra k G ⊗[k] ((Fin n → G) →₀ k) ≃ₗ[MonoidAlgebra k G]
      (ofMulAction k G (Fin (n + 1) → G)).asModule :=
  { (Rep.equivalenceModuleMonoidAlgebra.1.mapIso (diagonalSucc k G n).symm).toLinearEquiv with
    map_smul' := fun r x => by
      -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644
      erw [RingHom.id_apply, LinearEquiv.toFun_eq_coe, ← LinearEquiv.map_smul]
      congr 1
/- Porting note: broken proof was
      refine' x.induction_on _ (fun x y => _) fun y z hy hz => _
      · simp only [smul_zero]
      · simp only [TensorProduct.smul_tmul']
        show (r * x) ⊗ₜ y = _
        rw [← ofMulAction_self_smul_eq_mul, smul_tprod_one_asModule]
      · rw [smul_add, hz, hy, smul_add] -/
      

Proof state:
case h.e_6.h
k G : Type u
inst✝¹ : CommRing k
n : ℕ
inst✝ : Group G
src✝ : ↑(Rep.equivalenceModuleMonoidAlgebra.functor.obj
      (Rep.leftRegular k G ⊗ Rep.trivial k G ((Fin n → G) →₀ k))) ≃ₗ[MonoidAlgebra k G]
  ↑(Rep.equivalenceModuleMonoidAlgebra.functor.obj (Rep.diagonal k G (n + 1))) :=
  Iso.toLinearEquiv (Rep.equivalenceModuleMonoidAlgebra.functor.mapIso (diagonalSucc k G n).symm)
r : MonoidAlgebra k G
x : MonoidAlgebra k G ⊗[k] ((Fin n → G) →₀ k)
⊢ r • x = r • x

Next tactic:
show _ = Representation.asAlgebraHom (tensorObj (Rep.leftRegular k G)
        (Rep.trivial k G ((Fin n → G) →₀ k))).ρ r _
/-- The `k[G]`-linear isomorphism `k[G] ⊗ₖ k[Gⁿ] ≃ k[Gⁿ⁺¹]`, where the `k[G]`-module structure on
the lefthand side is `TensorProduct.leftModule`, whilst that of the righthand side comes from
`Representation.asModule`. Allows us to use `Algebra.TensorProduct.basis` to get a `k[G]`-basis
of the righthand side. -/
def ofMulActionBasisAux :
    MonoidAlgebra k G ⊗[k] ((Fin n → G) →₀ k) ≃ₗ[MonoidAlgebra k G]
      (ofMulAction k G (Fin (n + 1) → G)).asModule :=
  { (Rep.equivalenceModuleMonoidAlgebra.1.mapIso (diagonalSucc k G n).symm).toLinearEquiv with
    map_smul' := fun r x => by
      -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644
      erw [RingHom.id_apply, LinearEquiv.toFun_eq_coe, ← LinearEquiv.map_smul]
      congr 1
/- Porting note: broken proof was
      refine' x.induction_on _ (fun x y => _) fun y z hy hz => _
      · simp only [smul_zero]
      · simp only [TensorProduct.smul_tmul']
        show (r * x) ⊗ₜ y = _
        rw [← ofMulAction_self_smul_eq_mul, smul_tprod_one_asModule]
      · rw [smul_add, hz, hy, smul_add] -/
      show _ = Representation.asAlgebraHom (tensorObj (Rep.leftRegular k G)
        (Rep.trivial k G ((Fin n → G) →₀ k))).ρ r _
      

Proof state:
case h.e_6.h
k G : Type u
inst✝¹ : CommRing k
n : ℕ
inst✝ : Group G
src✝ : ↑(Rep.equivalenceModuleMonoidAlgebra.functor.obj
      (Rep.leftRegular k G ⊗ Rep.trivial k G ((Fin n → G) →₀ k))) ≃ₗ[MonoidAlgebra k G]
  ↑(Rep.equivalenceModuleMonoidAlgebra.functor.obj (Rep.diagonal k G (n + 1))) :=
  Iso.toLinearEquiv (Rep.equivalenceModuleMonoidAlgebra.functor.mapIso (diagonalSucc k G n).symm)
r : MonoidAlgebra k G
x : MonoidAlgebra k G ⊗[k] ((Fin n → G) →₀ k)
⊢ r • x = ((asAlgebraHom (Rep.ρ (Rep.leftRegular k G ⊗ Rep.trivial k G ((Fin n → G) →₀ k)))) r) x

Next tactic:
refine' x.induction_on _ (fun x y => _) fun y z hy hz => _
/-- The `k[G]`-linear isomorphism `k[G] ⊗ₖ k[Gⁿ] ≃ k[Gⁿ⁺¹]`, where the `k[G]`-module structure on
the lefthand side is `TensorProduct.leftModule`, whilst that of the righthand side comes from
`Representation.asModule`. Allows us to use `Algebra.TensorProduct.basis` to get a `k[G]`-basis
of the righthand side. -/
def ofMulActionBasisAux :
    MonoidAlgebra k G ⊗[k] ((Fin n → G) →₀ k) ≃ₗ[MonoidAlgebra k G]
      (ofMulAction k G (Fin (n + 1) → G)).asModule :=
  { (Rep.equivalenceModuleMonoidAlgebra.1.mapIso (diagonalSucc k G n).symm).toLinearEquiv with
    map_smul' := fun r x => by
      -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644
      erw [RingHom.id_apply, LinearEquiv.toFun_eq_coe, ← LinearEquiv.map_smul]
      congr 1
/- Porting note: broken proof was
      refine' x.induction_on _ (fun x y => _) fun y z hy hz => _
      · simp only [smul_zero]
      · simp only [TensorProduct.smul_tmul']
        show (r * x) ⊗ₜ y = _
        rw [← ofMulAction_self_smul_eq_mul, smul_tprod_one_asModule]
      · rw [smul_add, hz, hy, smul_add] -/
      show _ = Representation.asAlgebraHom (tensorObj (Rep.leftRegular k G)
        (Rep.trivial k G ((Fin n → G) →₀ k))).ρ r _
      refine' x.induction_on _ (fun x y => _) fun y z hy hz => _
      · 

Proof state:
case h.e_6.h.refine'_1
k G : Type u
inst✝¹ : CommRing k
n : ℕ
inst✝ : Group G
src✝ : ↑(Rep.equivalenceModuleMonoidAlgebra.functor.obj
      (Rep.leftRegular k G ⊗ Rep.trivial k G ((Fin n → G) →₀ k))) ≃ₗ[MonoidAlgebra k G]
  ↑(Rep.equivalenceModuleMonoidAlgebra.functor.obj (Rep.diagonal k G (n + 1))) :=
  Iso.toLinearEquiv (Rep.equivalenceModuleMonoidAlgebra.functor.mapIso (diagonalSucc k G n).symm)
r : MonoidAlgebra k G
x : MonoidAlgebra k G ⊗[k] ((Fin n → G) →₀ k)
⊢ r • 0 = ((asAlgebraHom (Rep.ρ (Rep.leftRegular k G ⊗ Rep.trivial k G ((Fin n → G) →₀ k)))) r) 0

Next tactic:
rw [smul_zero, map_zero]
/-- The `k[G]`-linear isomorphism `k[G] ⊗ₖ k[Gⁿ] ≃ k[Gⁿ⁺¹]`, where the `k[G]`-module structure on
the lefthand side is `TensorProduct.leftModule`, whilst that of the righthand side comes from
`Representation.asModule`. Allows us to use `Algebra.TensorProduct.basis` to get a `k[G]`-basis
of the righthand side. -/
def ofMulActionBasisAux :
    MonoidAlgebra k G ⊗[k] ((Fin n → G) →₀ k) ≃ₗ[MonoidAlgebra k G]
      (ofMulAction k G (Fin (n + 1) → G)).asModule :=
  { (Rep.equivalenceModuleMonoidAlgebra.1.mapIso (diagonalSucc k G n).symm).toLinearEquiv with
    map_smul' := fun r x => by
      -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644
      erw [RingHom.id_apply, LinearEquiv.toFun_eq_coe, ← LinearEquiv.map_smul]
      congr 1
/- Porting note: broken proof was
      refine' x.induction_on _ (fun x y => _) fun y z hy hz => _
      · simp only [smul_zero]
      · simp only [TensorProduct.smul_tmul']
        show (r * x) ⊗ₜ y = _
        rw [← ofMulAction_self_smul_eq_mul, smul_tprod_one_asModule]
      · rw [smul_add, hz, hy, smul_add] -/
      show _ = Representation.asAlgebraHom (tensorObj (Rep.leftRegular k G)
        (Rep.trivial k G ((Fin n → G) →₀ k))).ρ r _
      refine' x.induction_on _ (fun x y => _) fun y z hy hz => _
      · rw [smul_zero, map_zero]
      · 

Proof state:
case h.e_6.h.refine'_2
k G : Type u
inst✝¹ : CommRing k
n : ℕ
inst✝ : Group G
src✝ : ↑(Rep.equivalenceModuleMonoidAlgebra.functor.obj
      (Rep.leftRegular k G ⊗ Rep.trivial k G ((Fin n → G) →₀ k))) ≃ₗ[MonoidAlgebra k G]
  ↑(Rep.equivalenceModuleMonoidAlgebra.functor.obj (Rep.diagonal k G (n + 1))) :=
  Iso.toLinearEquiv (Rep.equivalenceModuleMonoidAlgebra.functor.mapIso (diagonalSucc k G n).symm)
r : MonoidAlgebra k G
x✝ : MonoidAlgebra k G ⊗[k] ((Fin n → G) →₀ k)
x : MonoidAlgebra k G
y : (Fin n → G) →₀ k
⊢ r • x ⊗ₜ[k] y = ((asAlgebraHom (Rep.ρ (Rep.leftRegular k G ⊗ Rep.trivial k G ((Fin n → G) →₀ k)))) r) (x ⊗ₜ[k] y)

Next tactic:
rw [TensorProduct.smul_tmul', smul_eq_mul, ← ofMulAction_self_smul_eq_mul]
/-- The `k[G]`-linear isomorphism `k[G] ⊗ₖ k[Gⁿ] ≃ k[Gⁿ⁺¹]`, where the `k[G]`-module structure on
the lefthand side is `TensorProduct.leftModule`, whilst that of the righthand side comes from
`Representation.asModule`. Allows us to use `Algebra.TensorProduct.basis` to get a `k[G]`-basis
of the righthand side. -/
def ofMulActionBasisAux :
    MonoidAlgebra k G ⊗[k] ((Fin n → G) →₀ k) ≃ₗ[MonoidAlgebra k G]
      (ofMulAction k G (Fin (n + 1) → G)).asModule :=
  { (Rep.equivalenceModuleMonoidAlgebra.1.mapIso (diagonalSucc k G n).symm).toLinearEquiv with
    map_smul' := fun r x => by
      -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644
      erw [RingHom.id_apply, LinearEquiv.toFun_eq_coe, ← LinearEquiv.map_smul]
      congr 1
/- Porting note: broken proof was
      refine' x.induction_on _ (fun x y => _) fun y z hy hz => _
      · simp only [smul_zero]
      · simp only [TensorProduct.smul_tmul']
        show (r * x) ⊗ₜ y = _
        rw [← ofMulAction_self_smul_eq_mul, smul_tprod_one_asModule]
      · rw [smul_add, hz, hy, smul_add] -/
      show _ = Representation.asAlgebraHom (tensorObj (Rep.leftRegular k G)
        (Rep.trivial k G ((Fin n → G) →₀ k))).ρ r _
      refine' x.induction_on _ (fun x y => _) fun y z hy hz => _
      · rw [smul_zero, map_zero]
      · rw [TensorProduct.smul_tmul', smul_eq_mul, ← ofMulAction_self_smul_eq_mul]
        

Proof state:
case h.e_6.h.refine'_2
k G : Type u
inst✝¹ : CommRing k
n : ℕ
inst✝ : Group G
src✝ : ↑(Rep.equivalenceModuleMonoidAlgebra.functor.obj
      (Rep.leftRegular k G ⊗ Rep.trivial k G ((Fin n → G) →₀ k))) ≃ₗ[MonoidAlgebra k G]
  ↑(Rep.equivalenceModuleMonoidAlgebra.functor.obj (Rep.diagonal k G (n + 1))) :=
  Iso.toLinearEquiv (Rep.equivalenceModuleMonoidAlgebra.functor.mapIso (diagonalSucc k G n).symm)
r : MonoidAlgebra k G
x✝ : MonoidAlgebra k G ⊗[k] ((Fin n → G) →₀ k)
x : MonoidAlgebra k G
y : (Fin n → G) →₀ k
⊢ (r • x) ⊗ₜ[k] y = ((asAlgebraHom (Rep.ρ (Rep.leftRegular k G ⊗ Rep.trivial k G ((Fin n → G) →₀ k)))) r) (x ⊗ₜ[k] y)

Next tactic:
exact (smul_tprod_one_asModule (Representation.ofMulAction k G G) r x y).symm
/-- The `k[G]`-linear isomorphism `k[G] ⊗ₖ k[Gⁿ] ≃ k[Gⁿ⁺¹]`, where the `k[G]`-module structure on
the lefthand side is `TensorProduct.leftModule`, whilst that of the righthand side comes from
`Representation.asModule`. Allows us to use `Algebra.TensorProduct.basis` to get a `k[G]`-basis
of the righthand side. -/
def ofMulActionBasisAux :
    MonoidAlgebra k G ⊗[k] ((Fin n → G) →₀ k) ≃ₗ[MonoidAlgebra k G]
      (ofMulAction k G (Fin (n + 1) → G)).asModule :=
  { (Rep.equivalenceModuleMonoidAlgebra.1.mapIso (diagonalSucc k G n).symm).toLinearEquiv with
    map_smul' := fun r x => by
      -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644
      erw [RingHom.id_apply, LinearEquiv.toFun_eq_coe, ← LinearEquiv.map_smul]
      congr 1
/- Porting note: broken proof was
      refine' x.induction_on _ (fun x y => _) fun y z hy hz => _
      · simp only [smul_zero]
      · simp only [TensorProduct.smul_tmul']
        show (r * x) ⊗ₜ y = _
        rw [← ofMulAction_self_smul_eq_mul, smul_tprod_one_asModule]
      · rw [smul_add, hz, hy, smul_add] -/
      show _ = Representation.asAlgebraHom (tensorObj (Rep.leftRegular k G)
        (Rep.trivial k G ((Fin n → G) →₀ k))).ρ r _
      refine' x.induction_on _ (fun x y => _) fun y z hy hz => _
      · rw [smul_zero, map_zero]
      · rw [TensorProduct.smul_tmul', smul_eq_mul, ← ofMulAction_self_smul_eq_mul]
        exact (smul_tprod_one_asModule (Representation.ofMulAction k G G) r x y).symm
      · 

Proof state:
case h.e_6.h.refine'_3
k G : Type u
inst✝¹ : CommRing k
n : ℕ
inst✝ : Group G
src✝ : ↑(Rep.equivalenceModuleMonoidAlgebra.functor.obj
      (Rep.leftRegular k G ⊗ Rep.trivial k G ((Fin n → G) →₀ k))) ≃ₗ[MonoidAlgebra k G]
  ↑(Rep.equivalenceModuleMonoidAlgebra.functor.obj (Rep.diagonal k G (n + 1))) :=
  Iso.toLinearEquiv (Rep.equivalenceModuleMonoidAlgebra.functor.mapIso (diagonalSucc k G n).symm)
r : MonoidAlgebra k G
x y z : MonoidAlgebra k G ⊗[k] ((Fin n → G) →₀ k)
hy : r • y = ((asAlgebraHom (Rep.ρ (Rep.leftRegular k G ⊗ Rep.trivial k G ((Fin n → G) →₀ k)))) r) y
hz : r • z = ((asAlgebraHom (Rep.ρ (Rep.leftRegular k G ⊗ Rep.trivial k G ((Fin n → G) →₀ k)))) r) z
⊢ r • (y + z) = ((asAlgebraHom (Rep.ρ (Rep.leftRegular k G ⊗ Rep.trivial k G ((Fin n → G) →₀ k)))) r) (y + z)

Next tactic:
rw [smul_add, hz, hy, map_add]
/-- Given a `k`-linear `G`-representation `A`, `diagonalHomEquiv` is a `k`-linear isomorphism of
the set of representation morphisms `Hom(k[Gⁿ⁺¹], A)` with `Fun(Gⁿ, A)`. This lemma says that this
sends a morphism of representations `f : k[Gⁿ⁺¹] ⟶ A` to the function
`(g₁, ..., gₙ) ↦ f(1, g₁, g₁g₂, ..., g₁g₂...gₙ).` -/
theorem diagonalHomEquiv_apply (f : Rep.ofMulAction k G (Fin (n + 1) → G) ⟶ A) (x : Fin n → G) :
    diagonalHomEquiv n A f x = f.hom (Finsupp.single (Fin.partialProd x) 1) := by
/- Porting note: broken proof was
  unfold diagonalHomEquiv
  simpa only [LinearEquiv.trans_apply, Rep.leftRegularHomEquiv_apply,
    MonoidalClosed.linearHomEquivComm_hom, Finsupp.llift_symm_apply, TensorProduct.curry_apply,
    Linear.homCongr_apply, Iso.refl_hom, Iso.trans_inv, Action.comp_hom, ModuleCat.comp_def,
    LinearMap.comp_apply, Representation.repOfTprodIso_inv_apply,
    diagonalSucc_inv_single_single (1 : G) x, one_smul, one_mul] -/
  

Proof state:
k G : Type u
inst✝¹ : CommRing k
n : ℕ
inst✝ : Group G
A : Rep k G
f : ofMulAction k G (Fin (n + 1) → G) ⟶ A
x : Fin n → G
⊢ (diagonalHomEquiv n A) f x = f.hom fun₀ | Fin.partialProd x => 1

Next tactic:
change f.hom ((diagonalSucc k G n).inv.hom (Finsupp.single 1 1 ⊗ₜ[k] Finsupp.single x 1)) = _
/-- Given a `k`-linear `G`-representation `A`, `diagonalHomEquiv` is a `k`-linear isomorphism of
the set of representation morphisms `Hom(k[Gⁿ⁺¹], A)` with `Fun(Gⁿ, A)`. This lemma says that this
sends a morphism of representations `f : k[Gⁿ⁺¹] ⟶ A` to the function
`(g₁, ..., gₙ) ↦ f(1, g₁, g₁g₂, ..., g₁g₂...gₙ).` -/
theorem diagonalHomEquiv_apply (f : Rep.ofMulAction k G (Fin (n + 1) → G) ⟶ A) (x : Fin n → G) :
    diagonalHomEquiv n A f x = f.hom (Finsupp.single (Fin.partialProd x) 1) := by
/- Porting note: broken proof was
  unfold diagonalHomEquiv
  simpa only [LinearEquiv.trans_apply, Rep.leftRegularHomEquiv_apply,
    MonoidalClosed.linearHomEquivComm_hom, Finsupp.llift_symm_apply, TensorProduct.curry_apply,
    Linear.homCongr_apply, Iso.refl_hom, Iso.trans_inv, Action.comp_hom, ModuleCat.comp_def,
    LinearMap.comp_apply, Representation.repOfTprodIso_inv_apply,
    diagonalSucc_inv_single_single (1 : G) x, one_smul, one_mul] -/
  change f.hom ((diagonalSucc k G n).inv.hom (Finsupp.single 1 1 ⊗ₜ[k] Finsupp.single x 1)) = _
  

Proof state:
k G : Type u
inst✝¹ : CommRing k
n : ℕ
inst✝ : Group G
A : Rep k G
f : ofMulAction k G (Fin (n + 1) → G) ⟶ A
x : Fin n → G
⊢ f.hom ((diagonalSucc k G n).inv.hom ((fun₀ | 1 => 1) ⊗ₜ[k] fun₀ | x => 1)) = f.hom fun₀ | Fin.partialProd x => 1

Next tactic:
rw [diagonalSucc_inv_single_single, one_smul, one_mul]
set_option maxHeartbeats 400000 in
/-- Given a `k`-linear `G`-representation `A`, `diagonalHomEquiv` is a `k`-linear isomorphism of
the set of representation morphisms `Hom(k[Gⁿ⁺¹], A)` with `Fun(Gⁿ, A)`. This lemma says that the
inverse map sends a function `f : Gⁿ → A` to the representation morphism sending
`(g₀, ... gₙ) ↦ ρ(g₀)(f(g₀⁻¹g₁, g₁⁻¹g₂, ..., gₙ₋₁⁻¹gₙ))`, where `ρ` is the representation attached
to `A`. -/
theorem diagonalHomEquiv_symm_apply (f : (Fin n → G) → A) (x : Fin (n + 1) → G) :
    ((diagonalHomEquiv n A).symm f).hom (Finsupp.single x 1) =
      A.ρ (x 0) (f fun i : Fin n => (x (Fin.castSucc i))⁻¹ * x i.succ) := by
  

Proof state:
k G : Type u
inst✝¹ : CommRing k
n : ℕ
inst✝ : Group G
A : Rep k G
f : (Fin n → G) → CoeSort.coe A
x : Fin (n + 1) → G
⊢ (((LinearEquiv.symm (diagonalHomEquiv n A)) f).hom fun₀ | x => 1) =
    ((ρ A) (x 0)) (f fun i => (x (Fin.castSucc i))⁻¹ * x (Fin.succ i))

Next tactic:
unfold diagonalHomEquiv
set_option maxHeartbeats 400000 in
/-- Given a `k`-linear `G`-representation `A`, `diagonalHomEquiv` is a `k`-linear isomorphism of
the set of representation morphisms `Hom(k[Gⁿ⁺¹], A)` with `Fun(Gⁿ, A)`. This lemma says that the
inverse map sends a function `f : Gⁿ → A` to the representation morphism sending
`(g₀, ... gₙ) ↦ ρ(g₀)(f(g₀⁻¹g₁, g₁⁻¹g₂, ..., gₙ₋₁⁻¹gₙ))`, where `ρ` is the representation attached
to `A`. -/
theorem diagonalHomEquiv_symm_apply (f : (Fin n → G) → A) (x : Fin (n + 1) → G) :
    ((diagonalHomEquiv n A).symm f).hom (Finsupp.single x 1) =
      A.ρ (x 0) (f fun i : Fin n => (x (Fin.castSucc i))⁻¹ * x i.succ) := by
  unfold diagonalHomEquiv
/- Porting note: broken proof was
  simp only [LinearEquiv.trans_symm, LinearEquiv.symm_symm, LinearEquiv.trans_apply,
    Rep.leftRegularHomEquiv_symm_apply, Linear.homCongr_symm_apply, Action.comp_hom, Iso.refl_inv,
    Category.comp_id, Rep.MonoidalClosed.linearHomEquivComm_symm_hom, Iso.trans_hom,
    ModuleCat.comp_def, LinearMap.comp_apply, Representation.repOfTprodIso_apply,
    diagonalSucc_hom_single x (1 : k), TensorProduct.uncurry_apply, Rep.leftRegularHom_hom,
    Finsupp.lift_apply, ihom_obj_ρ_def, Rep.ihom_obj_ρ_apply, Finsupp.sum_single_index, zero_smul,
    one_smul, Rep.of_ρ, Rep.Action_ρ_eq_ρ, Rep.trivial_def (x 0)⁻¹, Finsupp.llift_apply A k k] -/
  

Proof state:
k G : Type u
inst✝¹ : CommRing k
n : ℕ
inst✝ : Group G
A : Rep k G
f : (Fin n → G) → CoeSort.coe A
x : Fin (n + 1) → G
⊢ (((LinearEquiv.symm
            (LinearEquiv.trans
              (LinearEquiv.trans
                (Linear.homCongr k
                  (diagonalSucc k G n ≪≫ Representation.repOfTprodIso (Representation.ofMulAction k G G) 1)
                  (Iso.refl A))
                (LinearEquiv.trans (MonoidalClosed.linearHomEquivComm (of (Representation.ofMulAction k G G)) (of 1) A)
                  (leftRegularHomEquiv ((ihom (of 1)).obj A))))
              (LinearEquiv.symm (Finsupp.llift (CoeSort.coe A) k k (Fin n → G)))))
          f).hom
      fun₀ | x => 1) =
    ((ρ A) (x 0)) (f fun i => (x (Fin.castSucc i))⁻¹ * x (Fin.succ i))

Next tactic:
simp only [LinearEquiv.trans_symm, LinearEquiv.symm_symm, LinearEquiv.trans_apply,
    leftRegularHomEquiv_symm_apply, Linear.homCongr_symm_apply, Iso.trans_hom, Iso.refl_inv,
    Category.comp_id, Action.comp_hom, MonoidalClosed.linearHomEquivComm_symm_hom]
set_option maxHeartbeats 400000 in
/-- Given a `k`-linear `G`-representation `A`, `diagonalHomEquiv` is a `k`-linear isomorphism of
the set of representation morphisms `Hom(k[Gⁿ⁺¹], A)` with `Fun(Gⁿ, A)`. This lemma says that the
inverse map sends a function `f : Gⁿ → A` to the representation morphism sending
`(g₀, ... gₙ) ↦ ρ(g₀)(f(g₀⁻¹g₁, g₁⁻¹g₂, ..., gₙ₋₁⁻¹gₙ))`, where `ρ` is the representation attached
to `A`. -/
theorem diagonalHomEquiv_symm_apply (f : (Fin n → G) → A) (x : Fin (n + 1) → G) :
    ((diagonalHomEquiv n A).symm f).hom (Finsupp.single x 1) =
      A.ρ (x 0) (f fun i : Fin n => (x (Fin.castSucc i))⁻¹ * x i.succ) := by
  unfold diagonalHomEquiv
/- Porting note: broken proof was
  simp only [LinearEquiv.trans_symm, LinearEquiv.symm_symm, LinearEquiv.trans_apply,
    Rep.leftRegularHomEquiv_symm_apply, Linear.homCongr_symm_apply, Action.comp_hom, Iso.refl_inv,
    Category.comp_id, Rep.MonoidalClosed.linearHomEquivComm_symm_hom, Iso.trans_hom,
    ModuleCat.comp_def, LinearMap.comp_apply, Representation.repOfTprodIso_apply,
    diagonalSucc_hom_single x (1 : k), TensorProduct.uncurry_apply, Rep.leftRegularHom_hom,
    Finsupp.lift_apply, ihom_obj_ρ_def, Rep.ihom_obj_ρ_apply, Finsupp.sum_single_index, zero_smul,
    one_smul, Rep.of_ρ, Rep.Action_ρ_eq_ρ, Rep.trivial_def (x 0)⁻¹, Finsupp.llift_apply A k k] -/
  simp only [LinearEquiv.trans_symm, LinearEquiv.symm_symm, LinearEquiv.trans_apply,
    leftRegularHomEquiv_symm_apply, Linear.homCongr_symm_apply, Iso.trans_hom, Iso.refl_inv,
    Category.comp_id, Action.comp_hom, MonoidalClosed.linearHomEquivComm_symm_hom]
  -- Porting note: This is a sure sign that coercions for morphisms in `ModuleCat`
  -- are still not set up properly.
  -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644
  

Proof state:
k G : Type u
inst✝¹ : CommRing k
n : ℕ
inst✝ : Group G
A : Rep k G
f : (Fin n → G) → CoeSort.coe A
x : Fin (n + 1) → G
⊢ ((((diagonalSucc k G n).hom.hom ≫ (Representation.repOfTprodIso (Representation.ofMulAction k G G) 1).hom.hom) ≫
        (TensorProduct.uncurry k (CoeSort.coe (of (Representation.ofMulAction k G G))) (CoeSort.coe (of 1))
            (CoeSort.coe A))
          (leftRegularHom ((ihom (of 1)).obj A) ((Finsupp.llift (CoeSort.coe A) k k (Fin n → G)) f)).hom)
      fun₀ | x => 1) =
    ((ρ A) (x 0)) (f fun i => (x (Fin.castSucc i))⁻¹ * x (Fin.succ i))

Next tactic:
erw [ModuleCat.coe_comp]