[GOAL]
R : Type u_1
M : Type u_2
inst✝² : CommSemiring R
inst✝¹ : AddCommMonoid M
inst✝ : Module R M
m : M
⊢ ↑(TensorAlgebra.ι R) m ∈ LinearMap.range (TensorAlgebra.ι R) ^ 1
[PROOFSTEP]
simpa only [pow_one] using LinearMap.mem_range_self _ m
[GOAL]
R : Type u_1
M : Type u_2
inst✝² : CommSemiring R
inst✝¹ : AddCommMonoid M
inst✝ : Module R M
m : M
⊢ ↑(TensorAlgebra.ι R) m ∈ LinearMap.range (TensorAlgebra.ι R) ^ 1
[PROOFSTEP]
simpa only [pow_one] using LinearMap.mem_range_self _ m
[GOAL]
R : Type u_1
M : Type u_2
inst✝² : CommSemiring R
inst✝¹ : AddCommMonoid M
inst✝ : Module R M
⊢ AlgHom.comp (DirectSum.coeAlgHom fun x => LinearMap.range (ι R) ^ x) (↑(lift R) (GradedAlgebra.ι R M)) =
    AlgHom.id R (TensorAlgebra R M)
[PROOFSTEP]
ext m
[GOAL]
case w.h
R : Type u_1
M : Type u_2
inst✝² : CommSemiring R
inst✝¹ : AddCommMonoid M
inst✝ : Module R M
m : M
⊢ ↑(LinearMap.comp
          (AlgHom.toLinearMap
            (AlgHom.comp (DirectSum.coeAlgHom fun x => LinearMap.range (ι R) ^ x) (↑(lift R) (GradedAlgebra.ι R M))))
          (ι R))
      m =
    ↑(LinearMap.comp (AlgHom.toLinearMap (AlgHom.id R (TensorAlgebra R M))) (ι R)) m
[PROOFSTEP]
dsimp only [LinearMap.comp_apply, AlgHom.toLinearMap_apply, AlgHom.comp_apply, AlgHom.id_apply]
[GOAL]
case w.h
R : Type u_1
M : Type u_2
inst✝² : CommSemiring R
inst✝¹ : AddCommMonoid M
inst✝ : Module R M
m : M
⊢ ↑(DirectSum.coeAlgHom fun x => LinearMap.range (ι R) ^ x) (↑(↑(lift R) (GradedAlgebra.ι R M)) (↑(ι R) m)) = ↑(ι R) m
[PROOFSTEP]
rw [lift_ι_apply, GradedAlgebra.ι_apply R M, DirectSum.coeAlgHom_of, Subtype.coe_mk]
[GOAL]
R : Type u_1
M : Type u_2
inst✝² : CommSemiring R
inst✝¹ : AddCommMonoid M
inst✝ : Module R M
i : ℕ
x : { x // x ∈ LinearMap.range (ι R) ^ i }
⊢ ↑(↑(lift R) (GradedAlgebra.ι R M)) ↑x = ↑(DirectSum.of (fun i => { x // x ∈ LinearMap.range (ι R) ^ i }) i) x
[PROOFSTEP]
cases' x with x hx
[GOAL]
case mk
R : Type u_1
M : Type u_2
inst✝² : CommSemiring R
inst✝¹ : AddCommMonoid M
inst✝ : Module R M
i : ℕ
x : TensorAlgebra R M
hx : x ∈ LinearMap.range (ι R) ^ i
⊢ ↑(↑(lift R) (GradedAlgebra.ι R M)) ↑{ val := x, property := hx } =
    ↑(DirectSum.of (fun i => { x // x ∈ LinearMap.range (ι R) ^ i }) i) { val := x, property := hx }
[PROOFSTEP]
dsimp only [Subtype.coe_mk, DirectSum.lof_eq_of]
  -- porting note: use new `induction using` support that failed in Lean 3
[GOAL]
case mk
R : Type u_1
M : Type u_2
inst✝² : CommSemiring R
inst✝¹ : AddCommMonoid M
inst✝ : Module R M
i : ℕ
x : TensorAlgebra R M
hx : x ∈ LinearMap.range (ι R) ^ i
⊢ ↑(↑(lift R) (GradedAlgebra.ι R M)) x =
    ↑(DirectSum.of (fun i => { x // x ∈ LinearMap.range (ι R) ^ i }) i) { val := x, property := hx }
[PROOFSTEP]
induction hx using Submodule.pow_induction_on_left' with
| hr r => rw [AlgHom.commutes, DirectSum.algebraMap_apply]; rfl
| hadd x y i hx hy ihx ihy => rw [AlgHom.map_add, ihx, ihy, ← map_add]; rfl
| hmul m hm i x hx ih =>
  obtain ⟨_, rfl⟩ := hm
  rw [AlgHom.map_mul, ih, lift_ι_apply, GradedAlgebra.ι_apply R M, DirectSum.of_mul_of]
  exact DirectSum.of_eq_of_gradedMonoid_eq (Sigma.subtype_ext (add_comm _ _) rfl)
[GOAL]
case mk
R : Type u_1
M : Type u_2
inst✝² : CommSemiring R
inst✝¹ : AddCommMonoid M
inst✝ : Module R M
i : ℕ
x : TensorAlgebra R M
hx : x ∈ LinearMap.range (ι R) ^ i
⊢ ↑(↑(lift R) (GradedAlgebra.ι R M)) x =
    ↑(DirectSum.of (fun i => { x // x ∈ LinearMap.range (ι R) ^ i }) i) { val := x, property := hx }
[PROOFSTEP]
induction hx using Submodule.pow_induction_on_left' with
| hr r => rw [AlgHom.commutes, DirectSum.algebraMap_apply]; rfl
| hadd x y i hx hy ihx ihy => rw [AlgHom.map_add, ihx, ihy, ← map_add]; rfl
| hmul m hm i x hx ih =>
  obtain ⟨_, rfl⟩ := hm
  rw [AlgHom.map_mul, ih, lift_ι_apply, GradedAlgebra.ι_apply R M, DirectSum.of_mul_of]
  exact DirectSum.of_eq_of_gradedMonoid_eq (Sigma.subtype_ext (add_comm _ _) rfl)
[GOAL]
case mk.hr
R : Type u_1
M : Type u_2
inst✝² : CommSemiring R
inst✝¹ : AddCommMonoid M
inst✝ : Module R M
i : ℕ
x : TensorAlgebra R M
r : R
⊢ ↑(↑(lift R) (GradedAlgebra.ι R M)) (↑(algebraMap R (TensorAlgebra R M)) r) =
    ↑(DirectSum.of (fun i => { x // x ∈ LinearMap.range (ι R) ^ i }) 0)
      { val := ↑(algebraMap R (TensorAlgebra R M)) r, property := (_ : ↑(algebraMap R (TensorAlgebra R M)) r ∈ 1) }
[PROOFSTEP]

| hr r => rw [AlgHom.commutes, DirectSum.algebraMap_apply]; rfl
[GOAL]
case mk.hr
R : Type u_1
M : Type u_2
inst✝² : CommSemiring R
inst✝¹ : AddCommMonoid M
inst✝ : Module R M
i : ℕ
x : TensorAlgebra R M
r : R
⊢ ↑(↑(lift R) (GradedAlgebra.ι R M)) (↑(algebraMap R (TensorAlgebra R M)) r) =
    ↑(DirectSum.of (fun i => { x // x ∈ LinearMap.range (ι R) ^ i }) 0)
      { val := ↑(algebraMap R (TensorAlgebra R M)) r, property := (_ : ↑(algebraMap R (TensorAlgebra R M)) r ∈ 1) }
[PROOFSTEP]
rw [AlgHom.commutes, DirectSum.algebraMap_apply]
[GOAL]
case mk.hr
R : Type u_1
M : Type u_2
inst✝² : CommSemiring R
inst✝¹ : AddCommMonoid M
inst✝ : Module R M
i : ℕ
x : TensorAlgebra R M
r : R
⊢ ↑(DirectSum.of (fun i => { x // x ∈ LinearMap.range (ι R) ^ i }) 0) (↑DirectSum.GAlgebra.toFun r) =
    ↑(DirectSum.of (fun i => { x // x ∈ LinearMap.range (ι R) ^ i }) 0)
      { val := ↑(algebraMap R (TensorAlgebra R M)) r, property := (_ : ↑(algebraMap R (TensorAlgebra R M)) r ∈ 1) }
[PROOFSTEP]
rfl
[GOAL]
case mk.hadd
R : Type u_1
M : Type u_2
inst✝² : CommSemiring R
inst✝¹ : AddCommMonoid M
inst✝ : Module R M
i✝ : ℕ
x✝ x y : TensorAlgebra R M
i : ℕ
hx : x ∈ LinearMap.range (ι R) ^ i
hy : y ∈ LinearMap.range (ι R) ^ i
ihx :
  ↑(↑(lift R) (GradedAlgebra.ι R M)) x =
    ↑(DirectSum.of (fun i => { x // x ∈ LinearMap.range (ι R) ^ i }) i) { val := x, property := hx }
ihy :
  ↑(↑(lift R) (GradedAlgebra.ι R M)) y =
    ↑(DirectSum.of (fun i => { x // x ∈ LinearMap.range (ι R) ^ i }) i) { val := y, property := hy }
⊢ ↑(↑(lift R) (GradedAlgebra.ι R M)) (x + y) =
    ↑(DirectSum.of (fun i => { x // x ∈ LinearMap.range (ι R) ^ i }) i)
      { val := x + y, property := (_ : x + y ∈ LinearMap.range (ι R) ^ i) }
[PROOFSTEP]

| hadd x y i hx hy ihx ihy => rw [AlgHom.map_add, ihx, ihy, ← map_add]; rfl
[GOAL]
case mk.hadd
R : Type u_1
M : Type u_2
inst✝² : CommSemiring R
inst✝¹ : AddCommMonoid M
inst✝ : Module R M
i✝ : ℕ
x✝ x y : TensorAlgebra R M
i : ℕ
hx : x ∈ LinearMap.range (ι R) ^ i
hy : y ∈ LinearMap.range (ι R) ^ i
ihx :
  ↑(↑(lift R) (GradedAlgebra.ι R M)) x =
    ↑(DirectSum.of (fun i => { x // x ∈ LinearMap.range (ι R) ^ i }) i) { val := x, property := hx }
ihy :
  ↑(↑(lift R) (GradedAlgebra.ι R M)) y =
    ↑(DirectSum.of (fun i => { x // x ∈ LinearMap.range (ι R) ^ i }) i) { val := y, property := hy }
⊢ ↑(↑(lift R) (GradedAlgebra.ι R M)) (x + y) =
    ↑(DirectSum.of (fun i => { x // x ∈ LinearMap.range (ι R) ^ i }) i)
      { val := x + y, property := (_ : x + y ∈ LinearMap.range (ι R) ^ i) }
[PROOFSTEP]
rw [AlgHom.map_add, ihx, ihy, ← map_add]
[GOAL]
case mk.hadd
R : Type u_1
M : Type u_2
inst✝² : CommSemiring R
inst✝¹ : AddCommMonoid M
inst✝ : Module R M
i✝ : ℕ
x✝ x y : TensorAlgebra R M
i : ℕ
hx : x ∈ LinearMap.range (ι R) ^ i
hy : y ∈ LinearMap.range (ι R) ^ i
ihx :
  ↑(↑(lift R) (GradedAlgebra.ι R M)) x =
    ↑(DirectSum.of (fun i => { x // x ∈ LinearMap.range (ι R) ^ i }) i) { val := x, property := hx }
ihy :
  ↑(↑(lift R) (GradedAlgebra.ι R M)) y =
    ↑(DirectSum.of (fun i => { x // x ∈ LinearMap.range (ι R) ^ i }) i) { val := y, property := hy }
⊢ ↑(DirectSum.of (fun i => { x // x ∈ LinearMap.range (ι R) ^ i }) i)
      ({ val := x, property := hx } + { val := y, property := hy }) =
    ↑(DirectSum.of (fun i => { x // x ∈ LinearMap.range (ι R) ^ i }) i)
      { val := x + y, property := (_ : x + y ∈ LinearMap.range (ι R) ^ i) }
[PROOFSTEP]
rfl
[GOAL]
case mk.hmul
R : Type u_1
M : Type u_2
inst✝² : CommSemiring R
inst✝¹ : AddCommMonoid M
inst✝ : Module R M
i✝ : ℕ
x✝ m : TensorAlgebra R M
hm : m ∈ LinearMap.range (ι R)
i : ℕ
x : TensorAlgebra R M
hx : x ∈ LinearMap.range (ι R) ^ i
ih :
  ↑(↑(lift R) (GradedAlgebra.ι R M)) x =
    ↑(DirectSum.of (fun i => { x // x ∈ LinearMap.range (ι R) ^ i }) i) { val := x, property := hx }
⊢ ↑(↑(lift R) (GradedAlgebra.ι R M)) (m * x) =
    ↑(DirectSum.of (fun i => { x // x ∈ LinearMap.range (ι R) ^ i }) (Nat.succ i))
      { val := m * x, property := (_ : m * x ∈ LinearMap.range (ι R) * npowRec i (LinearMap.range (ι R))) }
[PROOFSTEP]

| hmul m hm i x hx ih =>
  obtain ⟨_, rfl⟩ := hm
  rw [AlgHom.map_mul, ih, lift_ι_apply, GradedAlgebra.ι_apply R M, DirectSum.of_mul_of]
  exact DirectSum.of_eq_of_gradedMonoid_eq (Sigma.subtype_ext (add_comm _ _) rfl)
[GOAL]
case mk.hmul
R : Type u_1
M : Type u_2
inst✝² : CommSemiring R
inst✝¹ : AddCommMonoid M
inst✝ : Module R M
i✝ : ℕ
x✝ m : TensorAlgebra R M
hm : m ∈ LinearMap.range (ι R)
i : ℕ
x : TensorAlgebra R M
hx : x ∈ LinearMap.range (ι R) ^ i
ih :
  ↑(↑(lift R) (GradedAlgebra.ι R M)) x =
    ↑(DirectSum.of (fun i => { x // x ∈ LinearMap.range (ι R) ^ i }) i) { val := x, property := hx }
⊢ ↑(↑(lift R) (GradedAlgebra.ι R M)) (m * x) =
    ↑(DirectSum.of (fun i => { x // x ∈ LinearMap.range (ι R) ^ i }) (Nat.succ i))
      { val := m * x, property := (_ : m * x ∈ LinearMap.range (ι R) * npowRec i (LinearMap.range (ι R))) }
[PROOFSTEP]
obtain ⟨_, rfl⟩ := hm
[GOAL]
case mk.hmul.intro
R : Type u_1
M : Type u_2
inst✝² : CommSemiring R
inst✝¹ : AddCommMonoid M
inst✝ : Module R M
i✝ : ℕ
x✝ : TensorAlgebra R M
i : ℕ
x : TensorAlgebra R M
hx : x ∈ LinearMap.range (ι R) ^ i
ih :
  ↑(↑(lift R) (GradedAlgebra.ι R M)) x =
    ↑(DirectSum.of (fun i => { x // x ∈ LinearMap.range (ι R) ^ i }) i) { val := x, property := hx }
w✝ : M
⊢ ↑(↑(lift R) (GradedAlgebra.ι R M)) (↑(ι R) w✝ * x) =
    ↑(DirectSum.of (fun i => { x // x ∈ LinearMap.range (ι R) ^ i }) (Nat.succ i))
      { val := ↑(ι R) w✝ * x,
        property := (_ : ↑(ι R) w✝ * x ∈ LinearMap.range (ι R) * npowRec i (LinearMap.range (ι R))) }
[PROOFSTEP]
rw [AlgHom.map_mul, ih, lift_ι_apply, GradedAlgebra.ι_apply R M, DirectSum.of_mul_of]
[GOAL]
case mk.hmul.intro
R : Type u_1
M : Type u_2
inst✝² : CommSemiring R
inst✝¹ : AddCommMonoid M
inst✝ : Module R M
i✝ : ℕ
x✝ : TensorAlgebra R M
i : ℕ
x : TensorAlgebra R M
hx : x ∈ LinearMap.range (ι R) ^ i
ih :
  ↑(↑(lift R) (GradedAlgebra.ι R M)) x =
    ↑(DirectSum.of (fun i => { x // x ∈ LinearMap.range (ι R) ^ i }) i) { val := x, property := hx }
w✝ : M
⊢ ↑(DirectSum.of (fun i => { x // x ∈ LinearMap.range (ι R) ^ i }) (1 + i))
      (GradedMonoid.GMul.mul { val := ↑(ι R) w✝, property := (_ : ↑(ι R) w✝ ∈ LinearMap.range (ι R) ^ 1) }
        { val := x, property := hx }) =
    ↑(DirectSum.of (fun i => { x // x ∈ LinearMap.range (ι R) ^ i }) (Nat.succ i))
      { val := ↑(ι R) w✝ * x,
        property := (_ : ↑(ι R) w✝ * x ∈ LinearMap.range (ι R) * npowRec i (LinearMap.range (ι R))) }
[PROOFSTEP]
exact DirectSum.of_eq_of_gradedMonoid_eq (Sigma.subtype_ext (add_comm _ _) rfl)