l3lab/ntp-mathlib huggingface dataset:
/-- The instance `Algebra k (MonoidAlgebra A G)` whenever we have `Algebra k A`.

In particular this provides the instance `Algebra k (MonoidAlgebra k G)`.
-/
instance algebra {A : Type*} [CommSemiring k] [Semiring A] [Algebra k A] [Monoid G] :
    Algebra k (MonoidAlgebra A G) :=
  { singleOneRingHom.comp (algebraMap k A) with
    -- Porting note: `ext` → `refine Finsupp.ext fun _ => ?_`
    smul_def' := fun r a => by
      refine Finsupp.ext fun _ => ?_
      -- Porting note: Newly required.
      rw [Finsupp.coe_smul]
      simp [single_one_mul_apply, Algebra.smul_def, Pi.smul_apply]
    commutes' := fun r f => by
      refine Finsupp.ext fun _ => ?_
      

Proof state:
k : Type u₁
G : Type u₂
H : Type u_1
R : Type u_2
A : Type u_3
inst✝³ : CommSemiring k
inst✝² : Semiring A
inst✝¹ : Algebra k A
inst✝ : Monoid G
src✝ : k →+* MonoidAlgebra A G := RingHom.comp singleOneRingHom (algebraMap k A)
r : k
f : MonoidAlgebra A G
x✝ : G
⊢ ({ toMonoidHom := ↑src✝, map_zero' := (_ : OneHom.toFun (↑↑src✝) 0 = 0),
            map_add' :=
              (_ : ∀ (x y : k), OneHom.toFun (↑↑src✝) (x + y) = OneHom.toFun (↑↑src✝) x + OneHom.toFun (↑↑src✝) y) }
          r *
        f)
      x✝ =
    (f *
        { toMonoidHom := ↑src✝, map_zero' := (_ : OneHom.toFun (↑↑src✝) 0 = 0),
            map_add' :=
              (_ : ∀ (x y : k), OneHom.toFun (↑↑src✝) (x + y) = OneHom.toFun (↑↑src✝) x + OneHom.toFun (↑↑src✝) y) }
          r)
      x✝

Next tactic:
simp [single_one_mul_apply, mul_single_one_apply, Algebra.commutes]
/-- The instance `Algebra k (MonoidAlgebra A G)` whenever we have `Algebra k A`.

In particular this provides the instance `Algebra k (MonoidAlgebra k G)`.
-/
instance algebra {A : Type*} [CommSemiring k] [Semiring A] [Algebra k A] [Monoid G] :
    Algebra k (MonoidAlgebra A G) :=
  { singleOneRingHom.comp (algebraMap k A) with
    -- Porting note: `ext` → `refine Finsupp.ext fun _ => ?_`
    smul_def' := fun r a => by
      

Proof state:
k : Type u₁
G : Type u₂
H : Type u_1
R : Type u_2
A : Type u_3
inst✝³ : CommSemiring k
inst✝² : Semiring A
inst✝¹ : Algebra k A
inst✝ : Monoid G
src✝ : k →+* MonoidAlgebra A G := RingHom.comp singleOneRingHom (algebraMap k A)
r : k
a : MonoidAlgebra A G
⊢ r • a =
    { toMonoidHom := ↑src✝, map_zero' := (_ : OneHom.toFun (↑↑src✝) 0 = 0),
          map_add' :=
            (_ : ∀ (x y : k), OneHom.toFun (↑↑src✝) (x + y) = OneHom.toFun (↑↑src✝) x + OneHom.toFun (↑↑src✝) y) }
        r *
      a

Next tactic:
refine Finsupp.ext fun _ => ?_
/-- The instance `Algebra k (MonoidAlgebra A G)` whenever we have `Algebra k A`.

In particular this provides the instance `Algebra k (MonoidAlgebra k G)`.
-/
instance algebra {A : Type*} [CommSemiring k] [Semiring A] [Algebra k A] [Monoid G] :
    Algebra k (MonoidAlgebra A G) :=
  { singleOneRingHom.comp (algebraMap k A) with
    -- Porting note: `ext` → `refine Finsupp.ext fun _ => ?_`
    smul_def' := fun r a => by
      refine Finsupp.ext fun _ => ?_
      -- Porting note: Newly required.
      

Proof state:
k : Type u₁
G : Type u₂
H : Type u_1
R : Type u_2
A : Type u_3
inst✝³ : CommSemiring k
inst✝² : Semiring A
inst✝¹ : Algebra k A
inst✝ : Monoid G
src✝ : k →+* MonoidAlgebra A G := RingHom.comp singleOneRingHom (algebraMap k A)
r : k
a : MonoidAlgebra A G
x✝ : G
⊢ (r • a) x✝ =
    ({ toMonoidHom := ↑src✝, map_zero' := (_ : OneHom.toFun (↑↑src✝) 0 = 0),
            map_add' :=
              (_ : ∀ (x y : k), OneHom.toFun (↑↑src✝) (x + y) = OneHom.toFun (↑↑src✝) x + OneHom.toFun (↑↑src✝) y) }
          r *
        a)
      x✝

Next tactic:
rw [Finsupp.coe_smul]
/-- The instance `Algebra k (MonoidAlgebra A G)` whenever we have `Algebra k A`.

In particular this provides the instance `Algebra k (MonoidAlgebra k G)`.
-/
instance algebra {A : Type*} [CommSemiring k] [Semiring A] [Algebra k A] [Monoid G] :
    Algebra k (MonoidAlgebra A G) :=
  { singleOneRingHom.comp (algebraMap k A) with
    -- Porting note: `ext` → `refine Finsupp.ext fun _ => ?_`
    smul_def' := fun r a => by
      refine Finsupp.ext fun _ => ?_
      -- Porting note: Newly required.
      rw [Finsupp.coe_smul]
      

Proof state:
k : Type u₁
G : Type u₂
H : Type u_1
R : Type u_2
A : Type u_3
inst✝³ : CommSemiring k
inst✝² : Semiring A
inst✝¹ : Algebra k A
inst✝ : Monoid G
src✝ : k →+* MonoidAlgebra A G := RingHom.comp singleOneRingHom (algebraMap k A)
r : k
a : MonoidAlgebra A G
x✝ : G
⊢ (r • ⇑a) x✝ =
    ({ toMonoidHom := ↑src✝, map_zero' := (_ : OneHom.toFun (↑↑src✝) 0 = 0),
            map_add' :=
              (_ : ∀ (x y : k), OneHom.toFun (↑↑src✝) (x + y) = OneHom.toFun (↑↑src✝) x + OneHom.toFun (↑↑src✝) y) }
          r *
        a)
      x✝

Next tactic:
simp [single_one_mul_apply, Algebra.smul_def, Pi.smul_apply]
/-- `Finsupp.single 1` as an `AlgHom` -/
@[simps! apply]
def singleOneAlgHom {A : Type*} [CommSemiring k] [Semiring A] [Algebra k A] [Monoid G] :
    A →ₐ[k] MonoidAlgebra A G :=
  { singleOneRingHom with
    commutes' := fun r => by
      -- Porting note: `ext` → `refine Finsupp.ext fun _ => ?_`
      

Proof state:
k : Type u₁
G : Type u₂
H : Type u_1
R : Type u_2
A : Type u_3
inst✝³ : CommSemiring k
inst✝² : Semiring A
inst✝¹ : Algebra k A
inst✝ : Monoid G
src✝ : A →+* MonoidAlgebra A G := singleOneRingHom
r : k
⊢ OneHom.toFun
      (↑↑{ toMonoidHom := ↑src✝, map_zero' := (_ : OneHom.toFun (↑↑src✝) 0 = 0),
            map_add' :=
              (_ : ∀ (x y : A), OneHom.toFun (↑↑src✝) (x + y) = OneHom.toFun (↑↑src✝) x + OneHom.toFun (↑↑src✝) y) })
      ((algebraMap k A) r) =
    (algebraMap k (MonoidAlgebra A G)) r

Next tactic:
refine Finsupp.ext fun _ => ?_
/-- `Finsupp.single 1` as an `AlgHom` -/
@[simps! apply]
def singleOneAlgHom {A : Type*} [CommSemiring k] [Semiring A] [Algebra k A] [Monoid G] :
    A →ₐ[k] MonoidAlgebra A G :=
  { singleOneRingHom with
    commutes' := fun r => by
      -- Porting note: `ext` → `refine Finsupp.ext fun _ => ?_`
      refine Finsupp.ext fun _ => ?_
      

Proof state:
k : Type u₁
G : Type u₂
H : Type u_1
R : Type u_2
A : Type u_3
inst✝³ : CommSemiring k
inst✝² : Semiring A
inst✝¹ : Algebra k A
inst✝ : Monoid G
src✝ : A →+* MonoidAlgebra A G := singleOneRingHom
r : k
x✝ : G
⊢ (OneHom.toFun
        (↑↑{ toMonoidHom := ↑src✝, map_zero' := (_ : OneHom.toFun (↑↑src✝) 0 = 0),
              map_add' :=
                (_ : ∀ (x y : A), OneHom.toFun (↑↑src✝) (x + y) = OneHom.toFun (↑↑src✝) x + OneHom.toFun (↑↑src✝) y) })
        ((algebraMap k A) r))
      x✝ =
    ((algebraMap k (MonoidAlgebra A G)) r) x✝

Next tactic:
simp
/-- `Finsupp.single 1` as an `AlgHom` -/
@[simps! apply]
def singleOneAlgHom {A : Type*} [CommSemiring k] [Semiring A] [Algebra k A] [Monoid G] :
    A →ₐ[k] MonoidAlgebra A G :=
  { singleOneRingHom with
    commutes' := fun r => by
      -- Porting note: `ext` → `refine Finsupp.ext fun _ => ?_`
      refine Finsupp.ext fun _ => ?_
      simp
      

Proof state:
k : Type u₁
G : Type u₂
H : Type u_1
R : Type u_2
A : Type u_3
inst✝³ : CommSemiring k
inst✝² : Semiring A
inst✝¹ : Algebra k A
inst✝ : Monoid G
src✝ : A →+* MonoidAlgebra A G := singleOneRingHom
r : k
x✝ : G
⊢ (fun₀ | 1 => (algebraMap k A) r) x✝ = ((algebraMap k (MonoidAlgebra A G)) r) x✝

Next tactic:
rfl
theorem single_eq_algebraMap_mul_of [CommSemiring k] [Monoid G] (a : G) (b : k) :
    single a b = algebraMap k (MonoidAlgebra k G) b * of k G a := by 

Proof state:
k : Type u₁
G : Type u₂
H : Type u_1
R : Type u_2
inst✝¹ : CommSemiring k
inst✝ : Monoid G
a : G
b : k
⊢ single a b = (algebraMap k (MonoidAlgebra k G)) b * (of k G) a

Next tactic:
simp
theorem single_algebraMap_eq_algebraMap_mul_of {A : Type*} [CommSemiring k] [Semiring A]
    [Algebra k A] [Monoid G] (a : G) (b : k) :
    single a (algebraMap k A b) = algebraMap k (MonoidAlgebra A G) b * of A G a := by 

Proof state:
k : Type u₁
G : Type u₂
H : Type u_1
R : Type u_2
A : Type u_3
inst✝³ : CommSemiring k
inst✝² : Semiring A
inst✝¹ : Algebra k A
inst✝ : Monoid G
a : G
b : k
⊢ single a ((algebraMap k A) b) = (algebraMap k (MonoidAlgebra A G)) b * (of A G) a

Next tactic:
simp
theorem induction_on [Semiring k] [Monoid G] {p : MonoidAlgebra k G → Prop} (f : MonoidAlgebra k G)
    (hM : ∀ g, p (of k G g)) (hadd : ∀ f g : MonoidAlgebra k G, p f → p g → p (f + g))
    (hsmul : ∀ (r : k) (f), p f → p (r • f)) : p f := by
  

Proof state:
k : Type u₁
G : Type u₂
H : Type u_1
R : Type u_2
inst✝¹ : Semiring k
inst✝ : Monoid G
p : MonoidAlgebra k G → Prop
f : MonoidAlgebra k G
hM : ∀ (g : G), p ((of k G) g)
hadd : ∀ (f g : MonoidAlgebra k G), p f → p g → p (f + g)
hsmul : ∀ (r : k) (f : MonoidAlgebra k G), p f → p (r • f)
⊢ p f

Next tactic:
refine' Finsupp.induction_linear f _ (fun f g hf hg => hadd f g hf hg) fun g r => _
theorem induction_on [Semiring k] [Monoid G] {p : MonoidAlgebra k G → Prop} (f : MonoidAlgebra k G)
    (hM : ∀ g, p (of k G g)) (hadd : ∀ f g : MonoidAlgebra k G, p f → p g → p (f + g))
    (hsmul : ∀ (r : k) (f), p f → p (r • f)) : p f := by
  refine' Finsupp.induction_linear f _ (fun f g hf hg => hadd f g hf hg) fun g r => _
  · 

Proof state:
case refine'_1
k : Type u₁
G : Type u₂
H : Type u_1
R : Type u_2
inst✝¹ : Semiring k
inst✝ : Monoid G
p : MonoidAlgebra k G → Prop
f : MonoidAlgebra k G
hM : ∀ (g : G), p ((of k G) g)
hadd : ∀ (f g : MonoidAlgebra k G), p f → p g → p (f + g)
hsmul : ∀ (r : k) (f : MonoidAlgebra k G), p f → p (r • f)
⊢ p 0

Next tactic:
simpa using hsmul 0 (of k G 1) (hM 1)
theorem induction_on [Semiring k] [Monoid G] {p : MonoidAlgebra k G → Prop} (f : MonoidAlgebra k G)
    (hM : ∀ g, p (of k G g)) (hadd : ∀ f g : MonoidAlgebra k G, p f → p g → p (f + g))
    (hsmul : ∀ (r : k) (f), p f → p (r • f)) : p f := by
  refine' Finsupp.induction_linear f _ (fun f g hf hg => hadd f g hf hg) fun g r => _
  · simpa using hsmul 0 (of k G 1) (hM 1)
  · 

Proof state:
case refine'_2
k : Type u₁
G : Type u₂
H : Type u_1
R : Type u_2
inst✝¹ : Semiring k
inst✝ : Monoid G
p : MonoidAlgebra k G → Prop
f : MonoidAlgebra k G
hM : ∀ (g : G), p ((of k G) g)
hadd : ∀ (f g : MonoidAlgebra k G), p f → p g → p (f + g)
hsmul : ∀ (r : k) (f : MonoidAlgebra k G), p f → p (r • f)
g : G
r : k
⊢ p fun₀ | g => r

Next tactic:
convert hsmul r (of k G g) (hM g)
theorem induction_on [Semiring k] [Monoid G] {p : MonoidAlgebra k G → Prop} (f : MonoidAlgebra k G)
    (hM : ∀ g, p (of k G g)) (hadd : ∀ f g : MonoidAlgebra k G, p f → p g → p (f + g))
    (hsmul : ∀ (r : k) (f), p f → p (r • f)) : p f := by
  refine' Finsupp.induction_linear f _ (fun f g hf hg => hadd f g hf hg) fun g r => _
  · simpa using hsmul 0 (of k G 1) (hM 1)
  · convert hsmul r (of k G g) (hM g)
    -- Porting note: Was `simp only`.
    

Proof state:
case h.e'_1
k : Type u₁
G : Type u₂
H : Type u_1
R : Type u_2
inst✝¹ : Semiring k
inst✝ : Monoid G
p : MonoidAlgebra k G → Prop
f : MonoidAlgebra k G
hM : ∀ (g : G), p ((of k G) g)
hadd : ∀ (f g : MonoidAlgebra k G), p f → p g → p (f + g)
hsmul : ∀ (r : k) (f : MonoidAlgebra k G), p f → p (r • f)
g : G
r : k
⊢ (fun₀ | g => r) = r • (of k G) g

Next tactic:
rw [of_apply, smul_single', mul_one]
/-- `liftNCRingHom` as an `AlgHom`, for when `f` is an `AlgHom` -/
def liftNCAlgHom (f : A →ₐ[k] B) (g : G →* B) (h_comm : ∀ x y, Commute (f x) (g y)) :
    MonoidAlgebra A G →ₐ[k] B :=
  { liftNCRingHom (f : A →+* B) g h_comm with
    commutes' := by 

Proof state:
k : Type u₁
G : Type u₂
H : Type u_1
R : Type u_2
inst✝⁶ : CommSemiring k
inst✝⁵ : Monoid G
inst✝⁴ : Monoid H
A : Type u₃
inst✝³ : Semiring A
inst✝² : Algebra k A
B : Type u_3
inst✝¹ : Semiring B
inst✝ : Algebra k B
f : A →ₐ[k] B
g : G →* B
h_comm : ∀ (x : A) (y : G), Commute (f x) (g y)
src✝ : MonoidAlgebra A G →+* B := liftNCRingHom (↑f) g h_comm
⊢ ∀ (r : k),
    OneHom.toFun
        (↑↑{ toMonoidHom := ↑src✝, map_zero' := (_ : OneHom.toFun (↑↑src✝) 0 = 0),
              map_add' :=
                (_ :
                  ∀ (x y : MonoidAlgebra A G),
                    OneHom.toFun (↑↑src✝) (x + y) = OneHom.toFun (↑↑src✝) x + OneHom.toFun (↑↑src✝) y) })
        ((algebraMap k (MonoidAlgebra A G)) r) =
      (algebraMap k B) r

Next tactic:
simp [liftNCRingHom]
/-- Any monoid homomorphism `G →* A` can be lifted to an algebra homomorphism
`MonoidAlgebra k G →ₐ[k] A`. -/
def lift : (G →* A) ≃ (MonoidAlgebra k G →ₐ[k] A) where
  invFun f := (f : MonoidAlgebra k G →* A).comp (of k G)
  toFun F := liftNCAlgHom (Algebra.ofId k A) F fun _ _ => Algebra.commutes _ _
  left_inv f := by
    

Proof state:
k : Type u₁
G : Type u₂
H : Type u_1
R : Type u_2
inst✝⁶ : CommSemiring k
inst✝⁵ : Monoid G
inst✝⁴ : Monoid H
A : Type u₃
inst✝³ : Semiring A
inst✝² : Algebra k A
B : Type u_3
inst✝¹ : Semiring B
inst✝ : Algebra k B
f : G →* A
⊢ (fun f => MonoidHom.comp (↑f) (of k G))
      ((fun F =>
          liftNCAlgHom (Algebra.ofId k A) F
            (_ : ∀ (x : k) (x_1 : G), (algebraMap k A) x * F x_1 = F x_1 * (algebraMap k A) x))
        f) =
    f

Next tactic:
ext
/-- Any monoid homomorphism `G →* A` can be lifted to an algebra homomorphism
`MonoidAlgebra k G →ₐ[k] A`. -/
def lift : (G →* A) ≃ (MonoidAlgebra k G →ₐ[k] A) where
  invFun f := (f : MonoidAlgebra k G →* A).comp (of k G)
  toFun F := liftNCAlgHom (Algebra.ofId k A) F fun _ _ => Algebra.commutes _ _
  left_inv f := by
    ext
    

Proof state:
case h
k : Type u₁
G : Type u₂
H : Type u_1
R : Type u_2
inst✝⁶ : CommSemiring k
inst✝⁵ : Monoid G
inst✝⁴ : Monoid H
A : Type u₃
inst✝³ : Semiring A
inst✝² : Algebra k A
B : Type u_3
inst✝¹ : Semiring B
inst✝ : Algebra k B
f : G →* A
x✝ : G
⊢ ((fun f => MonoidHom.comp (↑f) (of k G))
        ((fun F =>
            liftNCAlgHom (Algebra.ofId k A) F
              (_ : ∀ (x : k) (x_1 : G), (algebraMap k A) x * F x_1 = F x_1 * (algebraMap k A) x))
          f))
      x✝ =
    f x✝

Next tactic:
simp [liftNCAlgHom, liftNCRingHom]
/-- Any monoid homomorphism `G →* A` can be lifted to an algebra homomorphism
`MonoidAlgebra k G →ₐ[k] A`. -/
def lift : (G →* A) ≃ (MonoidAlgebra k G →ₐ[k] A) where
  invFun f := (f : MonoidAlgebra k G →* A).comp (of k G)
  toFun F := liftNCAlgHom (Algebra.ofId k A) F fun _ _ => Algebra.commutes _ _
  left_inv f := by
    ext
    simp [liftNCAlgHom, liftNCRingHom]
  right_inv F := by
    

Proof state:
k : Type u₁
G : Type u₂
H : Type u_1
R : Type u_2
inst✝⁶ : CommSemiring k
inst✝⁵ : Monoid G
inst✝⁴ : Monoid H
A : Type u₃
inst✝³ : Semiring A
inst✝² : Algebra k A
B : Type u_3
inst✝¹ : Semiring B
inst✝ : Algebra k B
F : MonoidAlgebra k G →ₐ[k] A
⊢ (fun F =>
        liftNCAlgHom (Algebra.ofId k A) F
          (_ : ∀ (x : k) (x_1 : G), (algebraMap k A) x * F x_1 = F x_1 * (algebraMap k A) x))
      ((fun f => MonoidHom.comp (↑f) (of k G)) F) =
    F

Next tactic:
ext
/-- Any monoid homomorphism `G →* A` can be lifted to an algebra homomorphism
`MonoidAlgebra k G →ₐ[k] A`. -/
def lift : (G →* A) ≃ (MonoidAlgebra k G →ₐ[k] A) where
  invFun f := (f : MonoidAlgebra k G →* A).comp (of k G)
  toFun F := liftNCAlgHom (Algebra.ofId k A) F fun _ _ => Algebra.commutes _ _
  left_inv f := by
    ext
    simp [liftNCAlgHom, liftNCRingHom]
  right_inv F := by
    ext
    

Proof state:
case h.h
k : Type u₁
G : Type u₂
H : Type u_1
R : Type u_2
inst✝⁶ : CommSemiring k
inst✝⁵ : Monoid G
inst✝⁴ : Monoid H
A : Type u₃
inst✝³ : Semiring A
inst✝² : Algebra k A
B : Type u_3
inst✝¹ : Semiring B
inst✝ : Algebra k B
F : MonoidAlgebra k G →ₐ[k] A
x✝ : G
⊢ (MonoidHom.comp
        (↑((fun F =>
              liftNCAlgHom (Algebra.ofId k A) F
                (_ : ∀ (x : k) (x_1 : G), (algebraMap k A) x * F x_1 = F x_1 * (algebraMap k A) x))
            ((fun f => MonoidHom.comp (↑f) (of k G)) F)))
        (of k G))
      x✝ =
    (MonoidHom.comp (↑F) (of k G)) x✝

Next tactic:
simp [liftNCAlgHom, liftNCRingHom]
theorem lift_apply (F : G →* A) (f : MonoidAlgebra k G) :
    lift k G A F f = f.sum fun a b => b • F a := by 

Proof state:
k : Type u₁
G : Type u₂
H : Type u_1
R : Type u_2
inst✝⁶ : CommSemiring k
inst✝⁵ : Monoid G
inst✝⁴ : Monoid H
A : Type u₃
inst✝³ : Semiring A
inst✝² : Algebra k A
B : Type u_3
inst✝¹ : Semiring B
inst✝ : Algebra k B
F : G →* A
f : MonoidAlgebra k G
⊢ ((lift k G A) F) f = sum f fun a b => b • F a

Next tactic:
simp only [lift_apply', Algebra.smul_def]
@[simp]
theorem lift_single (F : G →* A) (a b) : lift k G A F (single a b) = b • F a := by
  

Proof state:
k : Type u₁
G : Type u₂
H : Type u_1
R : Type u_2
inst✝⁶ : CommSemiring k
inst✝⁵ : Monoid G
inst✝⁴ : Monoid H
A : Type u₃
inst✝³ : Semiring A
inst✝² : Algebra k A
B : Type u_3
inst✝¹ : Semiring B
inst✝ : Algebra k B
F : G →* A
a : G
b : k
⊢ ((lift k G A) F) (single a b) = b • F a

Next tactic:
rw [lift_def, liftNC_single, Algebra.smul_def, AddMonoidHom.coe_coe]
theorem lift_of (F : G →* A) (x) : lift k G A F (of k G x) = F x := by 

Proof state:
k : Type u₁
G : Type u₂
H : Type u_1
R : Type u_2
inst✝⁶ : CommSemiring k
inst✝⁵ : Monoid G
inst✝⁴ : Monoid H
A : Type u₃
inst✝³ : Semiring A
inst✝² : Algebra k A
B : Type u_3
inst✝¹ : Semiring B
inst✝ : Algebra k B
F : G →* A
x : G
⊢ ((lift k G A) F) ((of k G) x) = F x

Next tactic:
simp
/-- Decomposition of a `k`-algebra homomorphism from `MonoidAlgebra k G` by
its values on `F (single a 1)`. -/
theorem lift_unique (F : MonoidAlgebra k G →ₐ[k] A) (f : MonoidAlgebra k G) :
    F f = f.sum fun a b => b • F (single a 1) := by
  

Proof state:
k : Type u₁
G : Type u₂
H : Type u_1
R : Type u_2
inst✝⁶ : CommSemiring k
inst✝⁵ : Monoid G
inst✝⁴ : Monoid H
A : Type u₃
inst✝³ : Semiring A
inst✝² : Algebra k A
B : Type u_3
inst✝¹ : Semiring B
inst✝ : Algebra k B
F : MonoidAlgebra k G →ₐ[k] A
f : MonoidAlgebra k G
⊢ F f = sum f fun a b => b • F (single a 1)

Next tactic:
conv_lhs =>
    rw [lift_unique' F]
    simp [lift_apply]
/-- Decomposition of a `k`-algebra homomorphism from `MonoidAlgebra k G` by
its values on `F (single a 1)`. -/
theorem lift_unique (F : MonoidAlgebra k G →ₐ[k] A) (f : MonoidAlgebra k G) :
    F f = f.sum fun a b => b • F (single a 1) := by
  conv_lhs =>
    

Proof state:
k : Type u₁
G : Type u₂
H : Type u_1
R : Type u_2
inst✝⁶ : CommSemiring k
inst✝⁵ : Monoid G
inst✝⁴ : Monoid H
A : Type u₃
inst✝³ : Semiring A
inst✝² : Algebra k A
B : Type u_3
inst✝¹ : Semiring B
inst✝ : Algebra k B
F : MonoidAlgebra k G →ₐ[k] A
f : MonoidAlgebra k G
| F f

Next tactic:
rw [lift_unique' F]
    simp [lift_apply]
/-- Decomposition of a `k`-algebra homomorphism from `MonoidAlgebra k G` by
its values on `F (single a 1)`. -/
theorem lift_unique (F : MonoidAlgebra k G →ₐ[k] A) (f : MonoidAlgebra k G) :
    F f = f.sum fun a b => b • F (single a 1) := by
  conv_lhs =>
    

Proof state:
k : Type u₁
G : Type u₂
H : Type u_1
R : Type u_2
inst✝⁶ : CommSemiring k
inst✝⁵ : Monoid G
inst✝⁴ : Monoid H
A : Type u₃
inst✝³ : Semiring A
inst✝² : Algebra k A
B : Type u_3
inst✝¹ : Semiring B
inst✝ : Algebra k B
F : MonoidAlgebra k G →ₐ[k] A
f : MonoidAlgebra k G
| F f

Next tactic:
rw [lift_unique' F]
/-- Decomposition of a `k`-algebra homomorphism from `MonoidAlgebra k G` by
its values on `F (single a 1)`. -/
theorem lift_unique (F : MonoidAlgebra k G →ₐ[k] A) (f : MonoidAlgebra k G) :
    F f = f.sum fun a b => b • F (single a 1) := by
  conv_lhs =>
    rw [lift_unique' F]
    

Proof state:
k : Type u₁
G : Type u₂
H : Type u_1
R : Type u_2
inst✝⁶ : CommSemiring k
inst✝⁵ : Monoid G
inst✝⁴ : Monoid H
A : Type u₃
inst✝³ : Semiring A
inst✝² : Algebra k A
B : Type u_3
inst✝¹ : Semiring B
inst✝ : Algebra k B
F : MonoidAlgebra k G →ₐ[k] A
f : MonoidAlgebra k G
| ((lift k G A) (MonoidHom.comp (↑F) (of k G))) f

Next tactic:
simp [lift_apply]
variable (A) in
theorem mapDomain_algebraMap {F : Type*} [MonoidHomClass F G H] (f : F) (r : k) :
    mapDomain f (algebraMap k (MonoidAlgebra A G) r) = algebraMap k (MonoidAlgebra A H) r := by
  

Proof state:
k : Type u₁
G : Type u₂
H : Type u_1
R : Type u_2
inst✝⁷ : CommSemiring k
inst✝⁶ : Monoid G
inst✝⁵ : Monoid H
A : Type u₃
inst✝⁴ : Semiring A
inst✝³ : Algebra k A
B : Type u_3
inst✝² : Semiring B
inst✝¹ : Algebra k B
F : Type u_4
inst✝ : MonoidHomClass F G H
f : F
r : k
⊢ mapDomain (⇑f) ((algebraMap k (MonoidAlgebra A G)) r) = (algebraMap k (MonoidAlgebra A H)) r

Next tactic:
simp only [coe_algebraMap, mapDomain_single, map_one, (· ∘ ·)]
/-- Build a `k[G]`-linear map from a `k`-linear map and evidence that it is `G`-equivariant. -/
def equivariantOfLinearOfComm : V →ₗ[MonoidAlgebra k G] W where
  toFun := f
  map_add' v v' := by 

Proof state:
k : Type u₁
G : Type u₂
H : Type u_1
R : Type u_2
inst✝⁹ : Monoid G
inst✝⁸ : CommSemiring k
V : Type u₃
W : Type u₄
inst✝⁷ : AddCommMonoid V
inst✝⁶ : Module k V
inst✝⁵ : Module (MonoidAlgebra k G) V
inst✝⁴ : IsScalarTower k (MonoidAlgebra k G) V
inst✝³ : AddCommMonoid W
inst✝² : Module k W
inst✝¹ : Module (MonoidAlgebra k G) W
inst✝ : IsScalarTower k (MonoidAlgebra k G) W
f : V →ₗ[k] W
h : ∀ (g : G) (v : V), f (single g 1 • v) = single g 1 • f v
v v' : V
⊢ f (v + v') = f v + f v'

Next tactic:
simp
/-- Build a `k[G]`-linear map from a `k`-linear map and evidence that it is `G`-equivariant. -/
def equivariantOfLinearOfComm : V →ₗ[MonoidAlgebra k G] W where
  toFun := f
  map_add' v v' := by simp
  map_smul' c v := by
    -- Porting note: `dsimp` is required for beta reduction.
    

Proof state:
k : Type u₁
G : Type u₂
H : Type u_1
R : Type u_2
inst✝⁹ : Monoid G
inst✝⁸ : CommSemiring k
V : Type u₃
W : Type u₄
inst✝⁷ : AddCommMonoid V
inst✝⁶ : Module k V
inst✝⁵ : Module (MonoidAlgebra k G) V
inst✝⁴ : IsScalarTower k (MonoidAlgebra k G) V
inst✝³ : AddCommMonoid W
inst✝² : Module k W
inst✝¹ : Module (MonoidAlgebra k G) W
inst✝ : IsScalarTower k (MonoidAlgebra k G) W
f : V →ₗ[k] W
h : ∀ (g : G) (v : V), f (single g 1 • v) = single g 1 • f v
c : MonoidAlgebra k G
v : V
⊢ AddHom.toFun { toFun := ⇑f, map_add' := (_ : ∀ (v v' : V), f (v + v') = f v + f v') } (c • v) =
    (RingHom.id (MonoidAlgebra k G)) c •
      AddHom.toFun { toFun := ⇑f, map_add' := (_ : ∀ (v v' : V), f (v + v') = f v + f v') } v

Next tactic:
dsimp only []
/-- Build a `k[G]`-linear map from a `k`-linear map and evidence that it is `G`-equivariant. -/
def equivariantOfLinearOfComm : V →ₗ[MonoidAlgebra k G] W where
  toFun := f
  map_add' v v' := by simp
  map_smul' c v := by
    -- Porting note: `dsimp` is required for beta reduction.
    dsimp only []
    -- Porting note: Was `apply`.
    

Proof state:
k : Type u₁
G : Type u₂
H : Type u_1
R : Type u_2
inst✝⁹ : Monoid G
inst✝⁸ : CommSemiring k
V : Type u₃
W : Type u₄
inst✝⁷ : AddCommMonoid V
inst✝⁶ : Module k V
inst✝⁵ : Module (MonoidAlgebra k G) V
inst✝⁴ : IsScalarTower k (MonoidAlgebra k G) V
inst✝³ : AddCommMonoid W
inst✝² : Module k W
inst✝¹ : Module (MonoidAlgebra k G) W
inst✝ : IsScalarTower k (MonoidAlgebra k G) W
f : V →ₗ[k] W
h : ∀ (g : G) (v : V), f (single g 1 • v) = single g 1 • f v
c : MonoidAlgebra k G
v : V
⊢ f (c • v) = (RingHom.id (MonoidAlgebra k G)) c • f v

Next tactic:
refine Finsupp.induction c ?_ ?_
/-- Build a `k[G]`-linear map from a `k`-linear map and evidence that it is `G`-equivariant. -/
def equivariantOfLinearOfComm : V →ₗ[MonoidAlgebra k G] W where
  toFun := f
  map_add' v v' := by simp
  map_smul' c v := by
    -- Porting note: `dsimp` is required for beta reduction.
    dsimp only []
    -- Porting note: Was `apply`.
    refine Finsupp.induction c ?_ ?_
    · 

Proof state:
case refine_1
k : Type u₁
G : Type u₂
H : Type u_1
R : Type u_2
inst✝⁹ : Monoid G
inst✝⁸ : CommSemiring k
V : Type u₃
W : Type u₄
inst✝⁷ : AddCommMonoid V
inst✝⁶ : Module k V
inst✝⁵ : Module (MonoidAlgebra k G) V
inst✝⁴ : IsScalarTower k (MonoidAlgebra k G) V
inst✝³ : AddCommMonoid W
inst✝² : Module k W
inst✝¹ : Module (MonoidAlgebra k G) W
inst✝ : IsScalarTower k (MonoidAlgebra k G) W
f : V →ₗ[k] W
h : ∀ (g : G) (v : V), f (single g 1 • v) = single g 1 • f v
c : MonoidAlgebra k G
v : V
⊢ f (0 • v) = (RingHom.id (MonoidAlgebra k G)) 0 • f v

Next tactic:
simp