l3lab/ntp-mathlib huggingface dataset:
/-- 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. -/
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] _)
        simp only [← map_mul, mul_inv_self, map_one]
        rfl }
  invFun f :=
    { hom := TensorProduct.uncurry k _ _ _ f.hom.flip
      comm := fun g => TensorProduct.ext' fun x y => by
/- Porting note: rest of broken proof was
        dsimp only [MonoidalCategory.tensorLeft_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] -/
        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
        

Proof state:
k G : Type u
inst✝¹ : CommRing k
inst✝ : Group G
A✝ B✝ C✝ A B C : Rep k G
f : B ⟶ (Rep.ihom A).obj C
g : ↑(MonCat.of G)
x : ↑(((functorCategoryEquivalence (ModuleCat k) (MonCat.of G)).symm.inverse.obj A).obj PUnit.unit)
y : ↑(((functorCategoryEquivalence (ModuleCat k) (MonCat.of G)).symm.inverse.obj B).obj PUnit.unit)
⊢ ((TensorProduct.uncurry k (CoeSort.coe A) (↑B.V) (CoeSort.coe C)) (LinearMap.flip f.hom))
      (((ρ A) g) x ⊗ₜ[k] ((ρ B) g) y) =
    ((ρ C) g) (((TensorProduct.uncurry k (CoeSort.coe A) (↑B.V) (CoeSort.coe C)) (LinearMap.flip f.hom)) (x ⊗ₜ[k] y))

Next tactic:
erw [TensorProduct.uncurry_apply, LinearMap.flip_apply, hom_comm_apply,
          Rep.ihom_obj_ρ_apply,
          LinearMap.comp_apply, LinearMap.comp_apply]
/-- 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. -/
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] _)
        simp only [← map_mul, mul_inv_self, map_one]
        rfl }
  invFun f :=
    { hom := TensorProduct.uncurry k _ _ _ f.hom.flip
      comm := fun g => TensorProduct.ext' fun x y => by
/- Porting note: rest of broken proof was
        dsimp only [MonoidalCategory.tensorLeft_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] -/
        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)]
        

Proof state:
k G : Type u
inst✝¹ : CommRing k
inst✝ : Group G
A✝ B✝ C✝ A B C : Rep k G
f : B ⟶ (Rep.ihom A).obj C
g : ↑(MonCat.of G)
x : ↑(((functorCategoryEquivalence (ModuleCat k) (MonCat.of G)).symm.inverse.obj A).obj PUnit.unit)
y : ↑(((functorCategoryEquivalence (ModuleCat k) (MonCat.of G)).symm.inverse.obj B).obj PUnit.unit)
⊢ ((ρ C) g) ((f.hom y ∘ₗ (ρ A) g⁻¹) (((ρ A) g) x)) =
    ((ρ C) g) (((TensorProduct.uncurry k (CoeSort.coe A) (↑B.V) (CoeSort.coe C)) (LinearMap.flip f.hom)) (x ⊗ₜ[k] y))

Next tactic:
dsimp
/-- 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. -/
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] _)
        simp only [← map_mul, mul_inv_self, map_one]
        rfl }
  invFun f :=
    { hom := TensorProduct.uncurry k _ _ _ f.hom.flip
      comm := fun g => TensorProduct.ext' fun x y => by
/- Porting note: rest of broken proof was
        dsimp only [MonoidalCategory.tensorLeft_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] -/
        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
        

Proof state:
k G : Type u
inst✝¹ : CommRing k
inst✝ : Group G
A✝ B✝ C✝ A B C : Rep k G
f : B ⟶ (Rep.ihom A).obj C
g : ↑(MonCat.of G)
x : ↑(((functorCategoryEquivalence (ModuleCat k) (MonCat.of G)).symm.inverse.obj A).obj PUnit.unit)
y : ↑(((functorCategoryEquivalence (ModuleCat k) (MonCat.of G)).symm.inverse.obj B).obj PUnit.unit)
⊢ ((ρ C) g) ((f.hom y) (((ρ A) g⁻¹) (((ρ A) g) x))) =
    ((ρ C) g) (((TensorProduct.uncurry k (CoeSort.coe A) (↑B.V) (CoeSort.coe C)) (LinearMap.flip f.hom)) (x ⊗ₜ[k] y))

Next tactic:
erw [ρ_inv_self_apply]
/-- 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. -/
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] _)
        simp only [← map_mul, mul_inv_self, map_one]
        rfl }
  invFun f :=
    { hom := TensorProduct.uncurry k _ _ _ f.hom.flip
      comm := fun g => TensorProduct.ext' fun x y => by
/- Porting note: rest of broken proof was
        dsimp only [MonoidalCategory.tensorLeft_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] -/
        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]
        

Proof state:
k G : Type u
inst✝¹ : CommRing k
inst✝ : Group G
A✝ B✝ C✝ A B C : Rep k G
f : B ⟶ (Rep.ihom A).obj C
g : ↑(MonCat.of G)
x : ↑(((functorCategoryEquivalence (ModuleCat k) (MonCat.of G)).symm.inverse.obj A).obj PUnit.unit)
y : ↑(((functorCategoryEquivalence (ModuleCat k) (MonCat.of G)).symm.inverse.obj B).obj PUnit.unit)
⊢ ((ρ C) g) ((f.hom y) x) =
    ((ρ C) g) (((TensorProduct.uncurry k (CoeSort.coe A) (↑B.V) (CoeSort.coe C)) (LinearMap.flip f.hom)) (x ⊗ₜ[k] y))

Next tactic:
rfl
/-- 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. -/
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] _)
        simp only [← map_mul, mul_inv_self, map_one]
        rfl }
  invFun f :=
    { hom := TensorProduct.uncurry k _ _ _ f.hom.flip
      comm := fun g => TensorProduct.ext' fun x y => by
/- Porting note: rest of broken proof was
        dsimp only [MonoidalCategory.tensorLeft_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] -/
        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]
        rfl}
  left_inv f := Action.Hom.ext _ _ (TensorProduct.ext' fun _ _ => rfl)
  right_inv f := by 

Proof state:
k G : Type u
inst✝¹ : CommRing k
inst✝ : Group G
A✝ B✝ C✝ A B C : Rep k G
f : B ⟶ (Rep.ihom A).obj C
⊢ (fun f => Hom.mk (LinearMap.flip (TensorProduct.curry f.hom)))
      ((fun f =>
          Hom.mk
            ((TensorProduct.uncurry k
                ↑(((functorCategoryEquivalence (ModuleCat k) (MonCat.of G)).symm.inverse.obj A).obj PUnit.unit)
                ↑(((functorCategoryEquivalence (ModuleCat k) (MonCat.of G)).symm.inverse.obj B).obj PUnit.unit) ↑C.V)
              (LinearMap.flip f.hom)))
        f) =
    f

Next tactic:
ext
/-- 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. -/
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] _)
        simp only [← map_mul, mul_inv_self, map_one]
        rfl }
  invFun f :=
    { hom := TensorProduct.uncurry k _ _ _ f.hom.flip
      comm := fun g => TensorProduct.ext' fun x y => by
/- Porting note: rest of broken proof was
        dsimp only [MonoidalCategory.tensorLeft_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] -/
        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]
        rfl}
  left_inv f := Action.Hom.ext _ _ (TensorProduct.ext' fun _ _ => rfl)
  right_inv f := by ext; 

Proof state:
case h.h
k G : Type u
inst✝¹ : CommRing k
inst✝ : Group G
A✝ B✝ C✝ A B C : Rep k G
f : B ⟶ (Rep.ihom A).obj C
x✝ : ↑B.V
⊢ ((fun f => Hom.mk (LinearMap.flip (TensorProduct.curry f.hom)))
          ((fun f =>
              Hom.mk
                ((TensorProduct.uncurry k
                    ↑(((functorCategoryEquivalence (ModuleCat k) (MonCat.of G)).symm.inverse.obj A).obj PUnit.unit)
                    ↑(((functorCategoryEquivalence (ModuleCat k) (MonCat.of G)).symm.inverse.obj B).obj PUnit.unit)
                    ↑C.V)
                  (LinearMap.flip f.hom)))
            f)).hom
      x✝ =
    f.hom x✝

Next tactic:
rfl
@[simp]
theorem ihom_ev_app_hom (A B : Rep k G) :
    Action.Hom.hom ((ihom.ev A).app B)
      = TensorProduct.uncurry k A (A →ₗ[k] B) B LinearMap.id.flip := by
  

Proof state:
k G : Type u
inst✝¹ : CommRing k
inst✝ : Group G
A✝ B✝ C A B : Rep k G
⊢ ((ihom.ev A).app B).hom =
    (TensorProduct.uncurry k (CoeSort.coe A) (CoeSort.coe A →ₗ[k] CoeSort.coe B) (CoeSort.coe B))
      (LinearMap.flip LinearMap.id)

Next tactic:
ext
@[simp]
theorem ihom_ev_app_hom (A B : Rep k G) :
    Action.Hom.hom ((ihom.ev A).app B)
      = TensorProduct.uncurry k A (A →ₗ[k] B) B LinearMap.id.flip := by
  ext; 

Proof state:
case h
k G : Type u
inst✝¹ : CommRing k
inst✝ : Group G
A✝ B✝ C A B : Rep k G
x✝ : ↑((ihom A ⋙ tensorLeft A).obj B).V
⊢ ((ihom.ev A).app B).hom x✝ =
    ((TensorProduct.uncurry k (CoeSort.coe A) (CoeSort.coe A →ₗ[k] CoeSort.coe B) (CoeSort.coe B))
        (LinearMap.flip LinearMap.id))
      x✝

Next tactic:
rfl
example : SymmetricCategory (Rep k G) := by 

Proof state:
k G : Type u
inst✝¹ : CommRing k
inst✝ : Monoid G
⊢ SymmetricCategory (Rep k G)

Next tactic:
infer_instance
example : MonoidalPreadditive (Rep k G) := by 

Proof state:
k G : Type u
inst✝¹ : CommRing k
inst✝ : Monoid G
⊢ MonoidalPreadditive (Rep k G)

Next tactic:
infer_instance
example : MonoidalLinear k (Rep k G) := by 

Proof state:
k G : Type u
inst✝¹ : CommRing k
inst✝ : Monoid G
⊢ MonoidalLinear k (Rep k G)

Next tactic:
infer_instance
/-- 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)
    (r : MonoidAlgebra k G) (x : V) :
    f ((((MonoidAlgebra.lift k G (V →ₗ[k] V)) ρ) r) x) =
      (((MonoidAlgebra.lift k G (W →ₗ[k] W)) σ) r) (f x) := by
  

Proof state:
k✝ G✝ : Type u
inst✝⁷ : CommRing k✝
inst✝⁶ : Monoid G✝
k : Type u_1
G : Type u_2
inst✝⁵ : CommRing k
inst✝⁴ : Monoid G
V : Type u_3
W : Type u_4
inst✝³ : AddCommGroup V
inst✝² : AddCommGroup W
inst✝¹ : Module k V
inst✝ : Module k W
ρ : G →* V →ₗ[k] V
σ : G →* W →ₗ[k] W
f : V →ₗ[k] W
w : ∀ (g : G), f ∘ₗ ρ g = σ g ∘ₗ f
r : MonoidAlgebra k G
x : V
⊢ f ((((MonoidAlgebra.lift k G (V →ₗ[k] V)) ρ) r) x) = (((MonoidAlgebra.lift k G (W →ₗ[k] W)) σ) r) (f x)

Next tactic:
apply MonoidAlgebra.induction_on r
/-- 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)
    (r : MonoidAlgebra k G) (x : V) :
    f ((((MonoidAlgebra.lift k G (V →ₗ[k] V)) ρ) r) x) =
      (((MonoidAlgebra.lift k G (W →ₗ[k] W)) σ) r) (f x) := by
  apply MonoidAlgebra.induction_on r
  · 

Proof state:
case hM
k✝ G✝ : Type u
inst✝⁷ : CommRing k✝
inst✝⁶ : Monoid G✝
k : Type u_1
G : Type u_2
inst✝⁵ : CommRing k
inst✝⁴ : Monoid G
V : Type u_3
W : Type u_4
inst✝³ : AddCommGroup V
inst✝² : AddCommGroup W
inst✝¹ : Module k V
inst✝ : Module k W
ρ : G →* V →ₗ[k] V
σ : G →* W →ₗ[k] W
f : V →ₗ[k] W
w : ∀ (g : G), f ∘ₗ ρ g = σ g ∘ₗ f
r : MonoidAlgebra k G
x : V
⊢ ∀ (g : G),
    f ((((MonoidAlgebra.lift k G (V →ₗ[k] V)) ρ) ((MonoidAlgebra.of k G) g)) x) =
      (((MonoidAlgebra.lift k G (W →ₗ[k] W)) σ) ((MonoidAlgebra.of k G) g)) (f x)

Next tactic:
intro g
/-- 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)
    (r : MonoidAlgebra k G) (x : V) :
    f ((((MonoidAlgebra.lift k G (V →ₗ[k] V)) ρ) r) x) =
      (((MonoidAlgebra.lift k G (W →ₗ[k] W)) σ) r) (f x) := by
  apply MonoidAlgebra.induction_on r
  · intro g
    

Proof state:
case hM
k✝ G✝ : Type u
inst✝⁷ : CommRing k✝
inst✝⁶ : Monoid G✝
k : Type u_1
G : Type u_2
inst✝⁵ : CommRing k
inst✝⁴ : Monoid G
V : Type u_3
W : Type u_4
inst✝³ : AddCommGroup V
inst✝² : AddCommGroup W
inst✝¹ : Module k V
inst✝ : Module k W
ρ : G →* V →ₗ[k] V
σ : G →* W →ₗ[k] W
f : V →ₗ[k] W
w : ∀ (g : G), f ∘ₗ ρ g = σ g ∘ₗ f
r : MonoidAlgebra k G
x : V
g : G
⊢ f ((((MonoidAlgebra.lift k G (V →ₗ[k] V)) ρ) ((MonoidAlgebra.of k G) g)) x) =
    (((MonoidAlgebra.lift k G (W →ₗ[k] W)) σ) ((MonoidAlgebra.of k G) g)) (f x)

Next tactic:
simp only [one_smul, MonoidAlgebra.lift_single, MonoidAlgebra.of_apply]
/-- 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)
    (r : MonoidAlgebra k G) (x : V) :
    f ((((MonoidAlgebra.lift k G (V →ₗ[k] V)) ρ) r) x) =
      (((MonoidAlgebra.lift k G (W →ₗ[k] W)) σ) r) (f x) := by
  apply MonoidAlgebra.induction_on r
  · intro g
    simp only [one_smul, MonoidAlgebra.lift_single, MonoidAlgebra.of_apply]
    

Proof state:
case hM
k✝ G✝ : Type u
inst✝⁷ : CommRing k✝
inst✝⁶ : Monoid G✝
k : Type u_1
G : Type u_2
inst✝⁵ : CommRing k
inst✝⁴ : Monoid G
V : Type u_3
W : Type u_4
inst✝³ : AddCommGroup V
inst✝² : AddCommGroup W
inst✝¹ : Module k V
inst✝ : Module k W
ρ : G →* V →ₗ[k] V
σ : G →* W →ₗ[k] W
f : V →ₗ[k] W
w : ∀ (g : G), f ∘ₗ ρ g = σ g ∘ₗ f
r : MonoidAlgebra k G
x : V
g : G
⊢ f ((ρ g) x) = (σ g) (f x)

Next tactic:
exact LinearMap.congr_fun (w g) x
/-- 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)
    (r : MonoidAlgebra k G) (x : V) :
    f ((((MonoidAlgebra.lift k G (V →ₗ[k] V)) ρ) r) x) =
      (((MonoidAlgebra.lift k G (W →ₗ[k] W)) σ) r) (f x) := by
  apply MonoidAlgebra.induction_on r
  · intro g
    simp only [one_smul, MonoidAlgebra.lift_single, MonoidAlgebra.of_apply]
    exact LinearMap.congr_fun (w g) x
  · 

Proof state:
case hadd
k✝ G✝ : Type u
inst✝⁷ : CommRing k✝
inst✝⁶ : Monoid G✝
k : Type u_1
G : Type u_2
inst✝⁵ : CommRing k
inst✝⁴ : Monoid G
V : Type u_3
W : Type u_4
inst✝³ : AddCommGroup V
inst✝² : AddCommGroup W
inst✝¹ : Module k V
inst✝ : Module k W
ρ : G →* V →ₗ[k] V
σ : G →* W →ₗ[k] W
f : V →ₗ[k] W
w : ∀ (g : G), f ∘ₗ ρ g = σ g ∘ₗ f
r : MonoidAlgebra k G
x : V
⊢ ∀ (f_1 g : MonoidAlgebra k G),
    f ((((MonoidAlgebra.lift k G (V →ₗ[k] V)) ρ) f_1) x) = (((MonoidAlgebra.lift k G (W →ₗ[k] W)) σ) f_1) (f x) →
      f ((((MonoidAlgebra.lift k G (V →ₗ[k] V)) ρ) g) x) = (((MonoidAlgebra.lift k G (W →ₗ[k] W)) σ) g) (f x) →
        f ((((MonoidAlgebra.lift k G (V →ₗ[k] V)) ρ) (f_1 + g)) x) =
          (((MonoidAlgebra.lift k G (W →ₗ[k] W)) σ) (f_1 + g)) (f x)

Next tactic:
intro g h gw hw
/-- 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)
    (r : MonoidAlgebra k G) (x : V) :
    f ((((MonoidAlgebra.lift k G (V →ₗ[k] V)) ρ) r) x) =
      (((MonoidAlgebra.lift k G (W →ₗ[k] W)) σ) r) (f x) := by
  apply MonoidAlgebra.induction_on r
  · intro g
    simp only [one_smul, MonoidAlgebra.lift_single, MonoidAlgebra.of_apply]
    exact LinearMap.congr_fun (w g) x
  · intro g h gw hw; 

Proof state:
case hadd
k✝ G✝ : Type u
inst✝⁷ : CommRing k✝
inst✝⁶ : Monoid G✝
k : Type u_1
G : Type u_2
inst✝⁵ : CommRing k
inst✝⁴ : Monoid G
V : Type u_3
W : Type u_4
inst✝³ : AddCommGroup V
inst✝² : AddCommGroup W
inst✝¹ : Module k V
inst✝ : Module k W
ρ : G →* V →ₗ[k] V
σ : G →* W →ₗ[k] W
f : V →ₗ[k] W
w : ∀ (g : G), f ∘ₗ ρ g = σ g ∘ₗ f
r : MonoidAlgebra k G
x : V
g h : MonoidAlgebra k G
gw : f ((((MonoidAlgebra.lift k G (V →ₗ[k] V)) ρ) g) x) = (((MonoidAlgebra.lift k G (W →ₗ[k] W)) σ) g) (f x)
hw : f ((((MonoidAlgebra.lift k G (V →ₗ[k] V)) ρ) h) x) = (((MonoidAlgebra.lift k G (W →ₗ[k] W)) σ) h) (f x)
⊢ f ((((MonoidAlgebra.lift k G (V →ₗ[k] V)) ρ) (g + h)) x) = (((MonoidAlgebra.lift k G (W →ₗ[k] W)) σ) (g + h)) (f x)

Next tactic:
simp only [map_add, add_left_inj, LinearMap.add_apply, hw, gw]
/-- 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)
    (r : MonoidAlgebra k G) (x : V) :
    f ((((MonoidAlgebra.lift k G (V →ₗ[k] V)) ρ) r) x) =
      (((MonoidAlgebra.lift k G (W →ₗ[k] W)) σ) r) (f x) := by
  apply MonoidAlgebra.induction_on r
  · 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]
  · 

Proof state:
case hsmul
k✝ G✝ : Type u
inst✝⁷ : CommRing k✝
inst✝⁶ : Monoid G✝
k : Type u_1
G : Type u_2
inst✝⁵ : CommRing k
inst✝⁴ : Monoid G
V : Type u_3
W : Type u_4
inst✝³ : AddCommGroup V
inst✝² : AddCommGroup W
inst✝¹ : Module k V
inst✝ : Module k W
ρ : G →* V →ₗ[k] V
σ : G →* W →ₗ[k] W
f : V →ₗ[k] W
w : ∀ (g : G), f ∘ₗ ρ g = σ g ∘ₗ f
r : MonoidAlgebra k G
x : V
⊢ ∀ (r : k) (f_1 : MonoidAlgebra k G),
    f ((((MonoidAlgebra.lift k G (V →ₗ[k] V)) ρ) f_1) x) = (((MonoidAlgebra.lift k G (W →ₗ[k] W)) σ) f_1) (f x) →
      f ((((MonoidAlgebra.lift k G (V →ₗ[k] V)) ρ) (r • f_1)) x) =
        (((MonoidAlgebra.lift k G (W →ₗ[k] W)) σ) (r • f_1)) (f x)

Next tactic:
intro r g w