l3lab/ntp-mathlib huggingface dataset:
/-- If `exp R x.fst` converges to `e` then `(exp R x).snd` converges to `e • x.snd`. -/
theorem hasSum_snd_expSeries_of_smul_comm [Field 𝕜] [CharZero 𝕜] [Ring R] [AddCommGroup M]
    [Algebra 𝕜 R] [Module R M] [Module Rᵐᵒᵖ M] [SMulCommClass R Rᵐᵒᵖ M] [Module 𝕜 M]
    [IsScalarTower 𝕜 R M] [IsScalarTower 𝕜 Rᵐᵒᵖ M] [TopologicalRing R] [TopologicalAddGroup M]
    [ContinuousSMul R M] [ContinuousSMul Rᵐᵒᵖ M] (x : tsze R M)
    (hx : MulOpposite.op x.fst • x.snd = x.fst • x.snd) {e : R}
    (h : HasSum (fun n => expSeries 𝕜 R n fun _ => x.fst) e) :
    HasSum (fun n => snd (expSeries 𝕜 (tsze R M) n fun _ => x)) (e • x.snd) := by
  simp_rw [expSeries_apply_eq] at *
  conv =>
    congr
    ext n
    rw [snd_smul, snd_pow_of_smul_comm _ _ hx, nsmul_eq_smul_cast 𝕜 n, smul_smul, inv_mul_eq_div, ←
      inv_div, ← smul_assoc]
  apply HasSum.smul_const
  rw [← hasSum_nat_add_iff' 1]
  rw [Finset.range_one, Finset.sum_singleton, Nat.cast_zero, div_zero, inv_zero, zero_smul,
    sub_zero]
  simp_rw [← Nat.succ_eq_add_one, Nat.pred_succ, Nat.factorial_succ, Nat.cast_mul, ←
    Nat.succ_eq_add_one,
    mul_div_cancel_left _ ((@Nat.cast_ne_zero 𝕜 _ _ _).mpr <| Nat.succ_ne_zero _)]
  

Proof state:
case hf
𝕜 : Type u_1
R : Type u_2
M : Type u_3
inst✝¹⁶ : TopologicalSpace R
inst✝¹⁵ : TopologicalSpace M
inst✝¹⁴ : Field 𝕜
inst✝¹³ : CharZero 𝕜
inst✝¹² : Ring R
inst✝¹¹ : AddCommGroup M
inst✝¹⁰ : Algebra 𝕜 R
inst✝⁹ : Module R M
inst✝⁸ : Module Rᵐᵒᵖ M
inst✝⁷ : SMulCommClass R Rᵐᵒᵖ M
inst✝⁶ : Module 𝕜 M
inst✝⁵ : IsScalarTower 𝕜 R M
inst✝⁴ : IsScalarTower 𝕜 Rᵐᵒᵖ M
inst✝³ : TopologicalRing R
inst✝² : TopologicalAddGroup M
inst✝¹ : ContinuousSMul R M
inst✝ : ContinuousSMul Rᵐᵒᵖ M
x : tsze R M
hx : MulOpposite.op (fst x) • snd x = fst x • snd x
e : R
h : HasSum (fun n => (↑(Nat.factorial n))⁻¹ • fst x ^ n) e
⊢ HasSum (fun n => (↑(Nat.factorial n))⁻¹ • fst x ^ n) e

Next tactic:
exact h
/-- If `exp R x.fst` converges to `e` then `exp R x` converges to `inl e + inr (e • x.snd)`. -/
theorem hasSum_expSeries_of_smul_comm [Field 𝕜] [CharZero 𝕜] [Ring R] [AddCommGroup M] [Algebra 𝕜 R]
    [Module R M] [Module Rᵐᵒᵖ M] [SMulCommClass R Rᵐᵒᵖ M] [Module 𝕜 M] [IsScalarTower 𝕜 R M]
    [IsScalarTower 𝕜 Rᵐᵒᵖ M] [TopologicalRing R] [TopologicalAddGroup M] [ContinuousSMul R M]
    [ContinuousSMul Rᵐᵒᵖ M] (x : tsze R M) (hx : MulOpposite.op x.fst • x.snd = x.fst • x.snd)
    {e : R} (h : HasSum (fun n => expSeries 𝕜 R n fun _ => x.fst) e) :
    HasSum (fun n => expSeries 𝕜 (tsze R M) n fun _ => x) (inl e + inr (e • x.snd)) := by
  

Proof state:
𝕜 : Type u_1
R : Type u_2
M : Type u_3
inst✝¹⁶ : TopologicalSpace R
inst✝¹⁵ : TopologicalSpace M
inst✝¹⁴ : Field 𝕜
inst✝¹³ : CharZero 𝕜
inst✝¹² : Ring R
inst✝¹¹ : AddCommGroup M
inst✝¹⁰ : Algebra 𝕜 R
inst✝⁹ : Module R M
inst✝⁸ : Module Rᵐᵒᵖ M
inst✝⁷ : SMulCommClass R Rᵐᵒᵖ M
inst✝⁶ : Module 𝕜 M
inst✝⁵ : IsScalarTower 𝕜 R M
inst✝⁴ : IsScalarTower 𝕜 Rᵐᵒᵖ M
inst✝³ : TopologicalRing R
inst✝² : TopologicalAddGroup M
inst✝¹ : ContinuousSMul R M
inst✝ : ContinuousSMul Rᵐᵒᵖ M
x : tsze R M
hx : MulOpposite.op (fst x) • snd x = fst x • snd x
e : R
h : HasSum (fun n => (expSeries 𝕜 R n) fun x_1 => fst x) e
⊢ HasSum (fun n => (expSeries 𝕜 (tsze R M) n) fun x_1 => x) (inl e + inr (e • snd x))

Next tactic:
simpa only [inl_fst_add_inr_snd_eq] using
    (hasSum_inl _ <| hasSum_fst_expSeries 𝕜 x h).add
      (hasSum_inr _ <| hasSum_snd_expSeries_of_smul_comm 𝕜 x hx h)
theorem exp_def_of_smul_comm (x : tsze R M) (hx : MulOpposite.op x.fst • x.snd = x.fst • x.snd) :
    exp 𝕜 x = inl (exp 𝕜 x.fst) + inr (exp 𝕜 x.fst • x.snd) := by
  

Proof state:
𝕜 : Type u_1
R : Type u_2
M : Type u_3
inst✝¹⁷ : IsROrC 𝕜
inst✝¹⁶ : NormedRing R
inst✝¹⁵ : AddCommGroup M
inst✝¹⁴ : NormedAlgebra 𝕜 R
inst✝¹³ : Module R M
inst✝¹² : Module Rᵐᵒᵖ M
inst✝¹¹ : SMulCommClass R Rᵐᵒᵖ M
inst✝¹⁰ : Module 𝕜 M
inst✝⁹ : IsScalarTower 𝕜 R M
inst✝⁸ : IsScalarTower 𝕜 Rᵐᵒᵖ M
inst✝⁷ : TopologicalSpace M
inst✝⁶ : TopologicalRing R
inst✝⁵ : TopologicalAddGroup M
inst✝⁴ : ContinuousSMul R M
inst✝³ : ContinuousSMul Rᵐᵒᵖ M
inst✝² : CompleteSpace R
inst✝¹ : T2Space R
inst✝ : T2Space M
x : tsze R M
hx : MulOpposite.op (fst x) • snd x = fst x • snd x
⊢ exp 𝕜 x = inl (exp 𝕜 (fst x)) + inr (exp 𝕜 (fst x) • snd x)

Next tactic:
simp_rw [exp, FormalMultilinearSeries.sum]
theorem exp_def_of_smul_comm (x : tsze R M) (hx : MulOpposite.op x.fst • x.snd = x.fst • x.snd) :
    exp 𝕜 x = inl (exp 𝕜 x.fst) + inr (exp 𝕜 x.fst • x.snd) := by
  simp_rw [exp, FormalMultilinearSeries.sum]
  

Proof state:
𝕜 : Type u_1
R : Type u_2
M : Type u_3
inst✝¹⁷ : IsROrC 𝕜
inst✝¹⁶ : NormedRing R
inst✝¹⁵ : AddCommGroup M
inst✝¹⁴ : NormedAlgebra 𝕜 R
inst✝¹³ : Module R M
inst✝¹² : Module Rᵐᵒᵖ M
inst✝¹¹ : SMulCommClass R Rᵐᵒᵖ M
inst✝¹⁰ : Module 𝕜 M
inst✝⁹ : IsScalarTower 𝕜 R M
inst✝⁸ : IsScalarTower 𝕜 Rᵐᵒᵖ M
inst✝⁷ : TopologicalSpace M
inst✝⁶ : TopologicalRing R
inst✝⁵ : TopologicalAddGroup M
inst✝⁴ : ContinuousSMul R M
inst✝³ : ContinuousSMul Rᵐᵒᵖ M
inst✝² : CompleteSpace R
inst✝¹ : T2Space R
inst✝ : T2Space M
x : tsze R M
hx : MulOpposite.op (fst x) • snd x = fst x • snd x
⊢ (∑' (n : ℕ), (expSeries 𝕜 (tsze R M) n) fun x_1 => x) =
    inl (∑' (n : ℕ), (expSeries 𝕜 R n) fun x_1 => fst x) +
      inr ((∑' (n : ℕ), (expSeries 𝕜 R n) fun x_1 => fst x) • snd x)

Next tactic:
refine' (hasSum_expSeries_of_smul_comm 𝕜 x hx _).tsum_eq
theorem exp_def_of_smul_comm (x : tsze R M) (hx : MulOpposite.op x.fst • x.snd = x.fst • x.snd) :
    exp 𝕜 x = inl (exp 𝕜 x.fst) + inr (exp 𝕜 x.fst • x.snd) := by
  simp_rw [exp, FormalMultilinearSeries.sum]
  refine' (hasSum_expSeries_of_smul_comm 𝕜 x hx _).tsum_eq
  

Proof state:
𝕜 : Type u_1
R : Type u_2
M : Type u_3
inst✝¹⁷ : IsROrC 𝕜
inst✝¹⁶ : NormedRing R
inst✝¹⁵ : AddCommGroup M
inst✝¹⁴ : NormedAlgebra 𝕜 R
inst✝¹³ : Module R M
inst✝¹² : Module Rᵐᵒᵖ M
inst✝¹¹ : SMulCommClass R Rᵐᵒᵖ M
inst✝¹⁰ : Module 𝕜 M
inst✝⁹ : IsScalarTower 𝕜 R M
inst✝⁸ : IsScalarTower 𝕜 Rᵐᵒᵖ M
inst✝⁷ : TopologicalSpace M
inst✝⁶ : TopologicalRing R
inst✝⁵ : TopologicalAddGroup M
inst✝⁴ : ContinuousSMul R M
inst✝³ : ContinuousSMul Rᵐᵒᵖ M
inst✝² : CompleteSpace R
inst✝¹ : T2Space R
inst✝ : T2Space M
x : tsze R M
hx : MulOpposite.op (fst x) • snd x = fst x • snd x
⊢ HasSum (fun n => (expSeries 𝕜 R n) fun x_1 => fst x) (∑' (n : ℕ), (expSeries 𝕜 R n) fun x_1 => fst x)

Next tactic:
exact expSeries_hasSum_exp _
@[simp]
theorem exp_inl (x : R) : exp 𝕜 (inl x : tsze R M) = inl (exp 𝕜 x) := by
  

Proof state:
𝕜 : Type u_1
R : Type u_2
M : Type u_3
inst✝¹⁷ : IsROrC 𝕜
inst✝¹⁶ : NormedRing R
inst✝¹⁵ : AddCommGroup M
inst✝¹⁴ : NormedAlgebra 𝕜 R
inst✝¹³ : Module R M
inst✝¹² : Module Rᵐᵒᵖ M
inst✝¹¹ : SMulCommClass R Rᵐᵒᵖ M
inst✝¹⁰ : Module 𝕜 M
inst✝⁹ : IsScalarTower 𝕜 R M
inst✝⁸ : IsScalarTower 𝕜 Rᵐᵒᵖ M
inst✝⁷ : TopologicalSpace M
inst✝⁶ : TopologicalRing R
inst✝⁵ : TopologicalAddGroup M
inst✝⁴ : ContinuousSMul R M
inst✝³ : ContinuousSMul Rᵐᵒᵖ M
inst✝² : CompleteSpace R
inst✝¹ : T2Space R
inst✝ : T2Space M
x : R
⊢ exp 𝕜 (inl x) = inl (exp 𝕜 x)

Next tactic:
rw [exp_def_of_smul_comm, snd_inl, fst_inl, smul_zero, inr_zero, add_zero]
@[simp]
theorem exp_inl (x : R) : exp 𝕜 (inl x : tsze R M) = inl (exp 𝕜 x) := by
  rw [exp_def_of_smul_comm, snd_inl, fst_inl, smul_zero, inr_zero, add_zero]
  · 

Proof state:
case hx
𝕜 : Type u_1
R : Type u_2
M : Type u_3
inst✝¹⁷ : IsROrC 𝕜
inst✝¹⁶ : NormedRing R
inst✝¹⁵ : AddCommGroup M
inst✝¹⁴ : NormedAlgebra 𝕜 R
inst✝¹³ : Module R M
inst✝¹² : Module Rᵐᵒᵖ M
inst✝¹¹ : SMulCommClass R Rᵐᵒᵖ M
inst✝¹⁰ : Module 𝕜 M
inst✝⁹ : IsScalarTower 𝕜 R M
inst✝⁸ : IsScalarTower 𝕜 Rᵐᵒᵖ M
inst✝⁷ : TopologicalSpace M
inst✝⁶ : TopologicalRing R
inst✝⁵ : TopologicalAddGroup M
inst✝⁴ : ContinuousSMul R M
inst✝³ : ContinuousSMul Rᵐᵒᵖ M
inst✝² : CompleteSpace R
inst✝¹ : T2Space R
inst✝ : T2Space M
x : R
⊢ MulOpposite.op (fst (inl x)) • snd (inl x) = fst (inl x) • snd (inl x)

Next tactic:
rw [snd_inl, fst_inl, smul_zero, smul_zero]
@[simp]
theorem exp_inr (m : M) : exp 𝕜 (inr m : tsze R M) = 1 + inr m := by
  

Proof state:
𝕜 : Type u_1
R : Type u_2
M : Type u_3
inst✝¹⁷ : IsROrC 𝕜
inst✝¹⁶ : NormedRing R
inst✝¹⁵ : AddCommGroup M
inst✝¹⁴ : NormedAlgebra 𝕜 R
inst✝¹³ : Module R M
inst✝¹² : Module Rᵐᵒᵖ M
inst✝¹¹ : SMulCommClass R Rᵐᵒᵖ M
inst✝¹⁰ : Module 𝕜 M
inst✝⁹ : IsScalarTower 𝕜 R M
inst✝⁸ : IsScalarTower 𝕜 Rᵐᵒᵖ M
inst✝⁷ : TopologicalSpace M
inst✝⁶ : TopologicalRing R
inst✝⁵ : TopologicalAddGroup M
inst✝⁴ : ContinuousSMul R M
inst✝³ : ContinuousSMul Rᵐᵒᵖ M
inst✝² : CompleteSpace R
inst✝¹ : T2Space R
inst✝ : T2Space M
m : M
⊢ exp 𝕜 (inr m) = 1 + inr m

Next tactic:
rw [exp_def_of_smul_comm, snd_inr, fst_inr, exp_zero, one_smul, inl_one]
@[simp]
theorem exp_inr (m : M) : exp 𝕜 (inr m : tsze R M) = 1 + inr m := by
  rw [exp_def_of_smul_comm, snd_inr, fst_inr, exp_zero, one_smul, inl_one]
  · 

Proof state:
case hx
𝕜 : Type u_1
R : Type u_2
M : Type u_3
inst✝¹⁷ : IsROrC 𝕜
inst✝¹⁶ : NormedRing R
inst✝¹⁵ : AddCommGroup M
inst✝¹⁴ : NormedAlgebra 𝕜 R
inst✝¹³ : Module R M
inst✝¹² : Module Rᵐᵒᵖ M
inst✝¹¹ : SMulCommClass R Rᵐᵒᵖ M
inst✝¹⁰ : Module 𝕜 M
inst✝⁹ : IsScalarTower 𝕜 R M
inst✝⁸ : IsScalarTower 𝕜 Rᵐᵒᵖ M
inst✝⁷ : TopologicalSpace M
inst✝⁶ : TopologicalRing R
inst✝⁵ : TopologicalAddGroup M
inst✝⁴ : ContinuousSMul R M
inst✝³ : ContinuousSMul Rᵐᵒᵖ M
inst✝² : CompleteSpace R
inst✝¹ : T2Space R
inst✝ : T2Space M
m : M
⊢ MulOpposite.op (fst (inr m)) • snd (inr m) = fst (inr m) • snd (inr m)

Next tactic:
rw [snd_inr, fst_inr, MulOpposite.op_zero, zero_smul, zero_smul]
@[simp]
theorem fst_exp (x : tsze R M) : fst (exp 𝕜 x) = exp 𝕜 x.fst := by
  

Proof state:
𝕜 : Type u_1
R : Type u_2
M : Type u_3
inst✝¹⁵ : IsROrC 𝕜
inst✝¹⁴ : NormedCommRing R
inst✝¹³ : AddCommGroup M
inst✝¹² : NormedAlgebra 𝕜 R
inst✝¹¹ : Module R M
inst✝¹⁰ : Module Rᵐᵒᵖ M
inst✝⁹ : IsCentralScalar R M
inst✝⁸ : Module 𝕜 M
inst✝⁷ : IsScalarTower 𝕜 R M
inst✝⁶ : TopologicalSpace M
inst✝⁵ : TopologicalRing R
inst✝⁴ : TopologicalAddGroup M
inst✝³ : ContinuousSMul R M
inst✝² : CompleteSpace R
inst✝¹ : T2Space R
inst✝ : T2Space M
x : tsze R M
⊢ fst (exp 𝕜 x) = exp 𝕜 (fst x)

Next tactic:
rw [exp_def, fst_add, fst_inl, fst_inr, add_zero]
@[simp]
theorem snd_exp (x : tsze R M) : snd (exp 𝕜 x) = exp 𝕜 x.fst • x.snd := by
  

Proof state:
𝕜 : Type u_1
R : Type u_2
M : Type u_3
inst✝¹⁵ : IsROrC 𝕜
inst✝¹⁴ : NormedCommRing R
inst✝¹³ : AddCommGroup M
inst✝¹² : NormedAlgebra 𝕜 R
inst✝¹¹ : Module R M
inst✝¹⁰ : Module Rᵐᵒᵖ M
inst✝⁹ : IsCentralScalar R M
inst✝⁸ : Module 𝕜 M
inst✝⁷ : IsScalarTower 𝕜 R M
inst✝⁶ : TopologicalSpace M
inst✝⁵ : TopologicalRing R
inst✝⁴ : TopologicalAddGroup M
inst✝³ : ContinuousSMul R M
inst✝² : CompleteSpace R
inst✝¹ : T2Space R
inst✝ : T2Space M
x : tsze R M
⊢ snd (exp 𝕜 x) = exp 𝕜 (fst x) • snd x

Next tactic:
rw [exp_def, snd_add, snd_inl, snd_inr, zero_add]
/-- Polar form of trivial-square-zero extension. -/
theorem eq_smul_exp_of_invertible (x : tsze R M) [Invertible x.fst] :
    x = x.fst • exp 𝕜 (⅟ x.fst • inr x.snd) := by
  

Proof state:
𝕜 : Type u_1
R : Type u_2
M : Type u_3
inst✝¹⁶ : IsROrC 𝕜
inst✝¹⁵ : NormedCommRing R
inst✝¹⁴ : AddCommGroup M
inst✝¹³ : NormedAlgebra 𝕜 R
inst✝¹² : Module R M
inst✝¹¹ : Module Rᵐᵒᵖ M
inst✝¹⁰ : IsCentralScalar R M
inst✝⁹ : Module 𝕜 M
inst✝⁸ : IsScalarTower 𝕜 R M
inst✝⁷ : TopologicalSpace M
inst✝⁶ : TopologicalRing R
inst✝⁵ : TopologicalAddGroup M
inst✝⁴ : ContinuousSMul R M
inst✝³ : CompleteSpace R
inst✝² : T2Space R
inst✝¹ : T2Space M
x : tsze R M
inst✝ : Invertible (fst x)
⊢ x = fst x • exp 𝕜 (⅟(fst x) • inr (snd x))

Next tactic:
rw [← inr_smul, exp_inr, smul_add, ← inl_one, ← inl_smul, ← inr_smul, smul_eq_mul, mul_one,
    smul_smul, mul_invOf_self, one_smul, inl_fst_add_inr_snd_eq]
/-- This lemma demonstrates the origin of the `foldr` name. -/
theorem foldr_prod_map_ι (l : List M) (f : M →ₗ[R] N →ₗ[R] N) (hf) (n : N) :
    foldr Q f hf n (l.map <| ι Q).prod = List.foldr (fun m n => f m n) n l := by
  

Proof state:
R : Type u_1
M : Type u_2
N : Type u_3
inst✝⁴ : CommRing R
inst✝³ : AddCommGroup M
inst✝² : AddCommGroup N
inst✝¹ : Module R M
inst✝ : Module R N
Q : QuadraticForm R M
l : List M
f : M →ₗ[R] N →ₗ[R] N
hf : ∀ (m : M) (x : N), (f m) ((f m) x) = Q m • x
n : N
⊢ ((foldr Q f hf) n) (List.prod (List.map (⇑(ι Q)) l)) = List.foldr (fun m n => (f m) n) n l

Next tactic:
induction' l with hd tl ih
/-- This lemma demonstrates the origin of the `foldr` name. -/
theorem foldr_prod_map_ι (l : List M) (f : M →ₗ[R] N →ₗ[R] N) (hf) (n : N) :
    foldr Q f hf n (l.map <| ι Q).prod = List.foldr (fun m n => f m n) n l := by
  induction' l with hd tl ih
  · 

Proof state:
case nil
R : Type u_1
M : Type u_2
N : Type u_3
inst✝⁴ : CommRing R
inst✝³ : AddCommGroup M
inst✝² : AddCommGroup N
inst✝¹ : Module R M
inst✝ : Module R N
Q : QuadraticForm R M
f : M →ₗ[R] N →ₗ[R] N
hf : ∀ (m : M) (x : N), (f m) ((f m) x) = Q m • x
n : N
⊢ ((foldr Q f hf) n) (List.prod (List.map ⇑(ι Q) [])) = List.foldr (fun m n => (f m) n) n []

Next tactic:
rw [List.map_nil, List.prod_nil, List.foldr_nil, foldr_one]
/-- This lemma demonstrates the origin of the `foldr` name. -/
theorem foldr_prod_map_ι (l : List M) (f : M →ₗ[R] N →ₗ[R] N) (hf) (n : N) :
    foldr Q f hf n (l.map <| ι Q).prod = List.foldr (fun m n => f m n) n l := by
  induction' l with hd tl ih
  · rw [List.map_nil, List.prod_nil, List.foldr_nil, foldr_one]
  · 

Proof state:
case cons
R : Type u_1
M : Type u_2
N : Type u_3
inst✝⁴ : CommRing R
inst✝³ : AddCommGroup M
inst✝² : AddCommGroup N
inst✝¹ : Module R M
inst✝ : Module R N
Q : QuadraticForm R M
f : M →ₗ[R] N →ₗ[R] N
hf : ∀ (m : M) (x : N), (f m) ((f m) x) = Q m • x
n : N
hd : M
tl : List M
ih : ((foldr Q f hf) n) (List.prod (List.map (⇑(ι Q)) tl)) = List.foldr (fun m n => (f m) n) n tl
⊢ ((foldr Q f hf) n) (List.prod (List.map (⇑(ι Q)) (hd :: tl))) = List.foldr (fun m n => (f m) n) n (hd :: tl)

Next tactic:
rw [List.map_cons, List.prod_cons, List.foldr_cons, foldr_mul, foldr_ι, ih]
@[simp]
theorem foldl_ι (f : M →ₗ[R] N →ₗ[R] N) (hf) (n : N) (m : M) : foldl Q f hf n (ι Q m) = f m n := by
  

Proof state:
R : Type u_1
M : Type u_2
N : Type u_3
inst✝⁴ : CommRing R
inst✝³ : AddCommGroup M
inst✝² : AddCommGroup N
inst✝¹ : Module R M
inst✝ : Module R N
Q : QuadraticForm R M
f : M →ₗ[R] N →ₗ[R] N
hf : ∀ (m : M) (x : N), (f m) ((f m) x) = Q m • x
n : N
m : M
⊢ ((foldl Q f hf) n) ((ι Q) m) = (f m) n

Next tactic:
rw [← foldr_reverse, reverse_ι, foldr_ι]
@[simp]
theorem foldl_algebraMap (f : M →ₗ[R] N →ₗ[R] N) (hf) (n : N) (r : R) :
    foldl Q f hf n (algebraMap R _ r) = r • n := by
  

Proof state:
R : Type u_1
M : Type u_2
N : Type u_3
inst✝⁴ : CommRing R
inst✝³ : AddCommGroup M
inst✝² : AddCommGroup N
inst✝¹ : Module R M
inst✝ : Module R N
Q : QuadraticForm R M
f : M →ₗ[R] N →ₗ[R] N
hf : ∀ (m : M) (x : N), (f m) ((f m) x) = Q m • x
n : N
r : R
⊢ ((foldl Q f hf) n) ((algebraMap R (CliffordAlgebra Q)) r) = r • n

Next tactic:
rw [← foldr_reverse, reverse.commutes, foldr_algebraMap]
@[simp]
theorem foldl_one (f : M →ₗ[R] N →ₗ[R] N) (hf) (n : N) : foldl Q f hf n 1 = n := by
  

Proof state:
R : Type u_1
M : Type u_2
N : Type u_3
inst✝⁴ : CommRing R
inst✝³ : AddCommGroup M
inst✝² : AddCommGroup N
inst✝¹ : Module R M
inst✝ : Module R N
Q : QuadraticForm R M
f : M →ₗ[R] N →ₗ[R] N
hf : ∀ (m : M) (x : N), (f m) ((f m) x) = Q m • x
n : N
⊢ ((foldl Q f hf) n) 1 = n

Next tactic:
rw [← foldr_reverse, reverse.map_one, foldr_one]
@[simp]
theorem foldl_mul (f : M →ₗ[R] N →ₗ[R] N) (hf) (n : N) (a b : CliffordAlgebra Q) :
    foldl Q f hf n (a * b) = foldl Q f hf (foldl Q f hf n a) b := by
  

Proof state:
R : Type u_1
M : Type u_2
N : Type u_3
inst✝⁴ : CommRing R
inst✝³ : AddCommGroup M
inst✝² : AddCommGroup N
inst✝¹ : Module R M
inst✝ : Module R N
Q : QuadraticForm R M
f : M →ₗ[R] N →ₗ[R] N
hf : ∀ (m : M) (x : N), (f m) ((f m) x) = Q m • x
n : N
a b : CliffordAlgebra Q
⊢ ((foldl Q f hf) n) (a * b) = ((foldl Q f hf) (((foldl Q f hf) n) a)) b

Next tactic:
rw [← foldr_reverse, ← foldr_reverse, ← foldr_reverse, reverse.map_mul, foldr_mul]
/-- This lemma demonstrates the origin of the `foldl` name. -/
theorem foldl_prod_map_ι (l : List M) (f : M →ₗ[R] N →ₗ[R] N) (hf) (n : N) :
    foldl Q f hf n (l.map <| ι Q).prod = List.foldl (fun m n => f n m) n l := by
  

Proof state:
R : Type u_1
M : Type u_2
N : Type u_3
inst✝⁴ : CommRing R
inst✝³ : AddCommGroup M
inst✝² : AddCommGroup N
inst✝¹ : Module R M
inst✝ : Module R N
Q : QuadraticForm R M
l : List M
f : M →ₗ[R] N →ₗ[R] N
hf : ∀ (m : M) (x : N), (f m) ((f m) x) = Q m • x
n : N
⊢ ((foldl Q f hf) n) (List.prod (List.map (⇑(ι Q)) l)) = List.foldl (fun m n => (f n) m) n l

Next tactic:
rw [← foldr_reverse, reverse_prod_map_ι, ← List.map_reverse, foldr_prod_map_ι, List.foldr_reverse]
theorem right_induction {P : CliffordAlgebra Q → Prop} (hr : ∀ r : R, P (algebraMap _ _ r))
    (h_add : ∀ x y, P x → P y → P (x + y)) (h_ι_mul : ∀ m x, P x → P (x * ι Q m)) : ∀ x, P x := by
  /- It would be neat if we could prove this via `foldr` like how we prove
    `CliffordAlgebra.induction`, but going via the grading seems easier. -/
  

Proof state:
R : Type u_1
M : Type u_2
N : Type u_3
inst✝⁴ : CommRing R
inst✝³ : AddCommGroup M
inst✝² : AddCommGroup N
inst✝¹ : Module R M
inst✝ : Module R N
Q : QuadraticForm R M
P : CliffordAlgebra Q → Prop
hr : ∀ (r : R), P ((algebraMap R (CliffordAlgebra Q)) r)
h_add : ∀ (x y : CliffordAlgebra Q), P x → P y → P (x + y)
h_ι_mul : ∀ (m : M) (x : CliffordAlgebra Q), P x → P (x * (ι Q) m)
⊢ ∀ (x : CliffordAlgebra Q), P x

Next tactic:
intro x
theorem right_induction {P : CliffordAlgebra Q → Prop} (hr : ∀ r : R, P (algebraMap _ _ r))
    (h_add : ∀ x y, P x → P y → P (x + y)) (h_ι_mul : ∀ m x, P x → P (x * ι Q m)) : ∀ x, P x := by
  /- It would be neat if we could prove this via `foldr` like how we prove
    `CliffordAlgebra.induction`, but going via the grading seems easier. -/
  intro x
  

Proof state:
R : Type u_1
M : Type u_2
N : Type u_3
inst✝⁴ : CommRing R
inst✝³ : AddCommGroup M
inst✝² : AddCommGroup N
inst✝¹ : Module R M
inst✝ : Module R N
Q : QuadraticForm R M
P : CliffordAlgebra Q → Prop
hr : ∀ (r : R), P ((algebraMap R (CliffordAlgebra Q)) r)
h_add : ∀ (x y : CliffordAlgebra Q), P x → P y → P (x + y)
h_ι_mul : ∀ (m : M) (x : CliffordAlgebra Q), P x → P (x * (ι Q) m)
x : CliffordAlgebra Q
⊢ P x

Next tactic:
have : x ∈ ⊤ := Submodule.mem_top (R := R)
theorem right_induction {P : CliffordAlgebra Q → Prop} (hr : ∀ r : R, P (algebraMap _ _ r))
    (h_add : ∀ x y, P x → P y → P (x + y)) (h_ι_mul : ∀ m x, P x → P (x * ι Q m)) : ∀ x, P x := by
  /- It would be neat if we could prove this via `foldr` like how we prove
    `CliffordAlgebra.induction`, but going via the grading seems easier. -/
  intro x
  have : x ∈ ⊤ := Submodule.mem_top (R := R)
  

Proof state:
R : Type u_1
M : Type u_2
N : Type u_3
inst✝⁴ : CommRing R
inst✝³ : AddCommGroup M
inst✝² : AddCommGroup N
inst✝¹ : Module R M
inst✝ : Module R N
Q : QuadraticForm R M
P : CliffordAlgebra Q → Prop
hr : ∀ (r : R), P ((algebraMap R (CliffordAlgebra Q)) r)
h_add : ∀ (x y : CliffordAlgebra Q), P x → P y → P (x + y)
h_ι_mul : ∀ (m : M) (x : CliffordAlgebra Q), P x → P (x * (ι Q) m)
x : CliffordAlgebra Q
this : x ∈ ⊤
⊢ P x

Next tactic:
rw [← iSup_ι_range_eq_top] at this
theorem right_induction {P : CliffordAlgebra Q → Prop} (hr : ∀ r : R, P (algebraMap _ _ r))
    (h_add : ∀ x y, P x → P y → P (x + y)) (h_ι_mul : ∀ m x, P x → P (x * ι Q m)) : ∀ x, P x := by
  /- It would be neat if we could prove this via `foldr` like how we prove
    `CliffordAlgebra.induction`, but going via the grading seems easier. -/
  intro x
  have : x ∈ ⊤ := Submodule.mem_top (R := R)
  rw [← iSup_ι_range_eq_top] at this
  

Proof state:
R : Type u_1
M : Type u_2
N : Type u_3
inst✝⁴ : CommRing R
inst✝³ : AddCommGroup M
inst✝² : AddCommGroup N
inst✝¹ : Module R M
inst✝ : Module R N
Q : QuadraticForm R M
P : CliffordAlgebra Q → Prop
hr : ∀ (r : R), P ((algebraMap R (CliffordAlgebra Q)) r)
h_add : ∀ (x y : CliffordAlgebra Q), P x → P y → P (x + y)
h_ι_mul : ∀ (m : M) (x : CliffordAlgebra Q), P x → P (x * (ι Q) m)
x : CliffordAlgebra Q
this : x ∈ ⨆ i, LinearMap.range (ι Q) ^ i
⊢ P x

Next tactic:
induction this using Submodule.iSup_induction' with -- _ this (fun i x hx => ?_) _ h_add
  | hp i x hx =>
    induction hx using Submodule.pow_induction_on_right' with
    | hr r => exact hr r
    | hadd _x _y _i _ _ ihx ihy => exact h_add _ _ ihx ihy
    | hmul _i x _hx px m hm =>
      obtain ⟨m, rfl⟩ := hm
      exact h_ι_mul _ _ px
  | h0 => simpa only [map_zero] using hr 0
  | hadd _x _y _ _ ihx ihy =>
    exact h_add _ _ ihx ihy
theorem right_induction {P : CliffordAlgebra Q → Prop} (hr : ∀ r : R, P (algebraMap _ _ r))
    (h_add : ∀ x y, P x → P y → P (x + y)) (h_ι_mul : ∀ m x, P x → P (x * ι Q m)) : ∀ x, P x := by
  /- It would be neat if we could prove this via `foldr` like how we prove
    `CliffordAlgebra.induction`, but going via the grading seems easier. -/
  intro x
  have : x ∈ ⊤ := Submodule.mem_top (R := R)
  rw [← iSup_ι_range_eq_top] at this
  induction this using Submodule.iSup_induction' with -- _ this (fun i x hx => ?_) _ h_add
  

Proof state:
case hp
R : Type u_1
M : Type u_2
N : Type u_3
inst✝⁴ : CommRing R
inst✝³ : AddCommGroup M
inst✝² : AddCommGroup N
inst✝¹ : Module R M
inst✝ : Module R N
Q : QuadraticForm R M
P : CliffordAlgebra Q → Prop
hr : ∀ (r : R), P ((algebraMap R (CliffordAlgebra Q)) r)
h_add : ∀ (x y : CliffordAlgebra Q), P x → P y → P (x + y)
h_ι_mul : ∀ (m : M) (x : CliffordAlgebra Q), P x → P (x * (ι Q) m)
x✝ : CliffordAlgebra Q
i : ℕ
x : CliffordAlgebra Q
hx : x ∈ LinearMap.range (ι Q) ^ i
⊢ P x

Next tactic:
| hp i x hx =>
    induction hx using Submodule.pow_induction_on_right' with
    | hr r => exact hr r
    | hadd _x _y _i _ _ ihx ihy => exact h_add _ _ ihx ihy
    | hmul _i x _hx px m hm =>
      obtain ⟨m, rfl⟩ := hm
      exact h_ι_mul _ _ px
theorem right_induction {P : CliffordAlgebra Q → Prop} (hr : ∀ r : R, P (algebraMap _ _ r))
    (h_add : ∀ x y, P x → P y → P (x + y)) (h_ι_mul : ∀ m x, P x → P (x * ι Q m)) : ∀ x, P x := by
  /- It would be neat if we could prove this via `foldr` like how we prove
    `CliffordAlgebra.induction`, but going via the grading seems easier. -/
  intro x
  have : x ∈ ⊤ := Submodule.mem_top (R := R)
  rw [← iSup_ι_range_eq_top] at this
  induction this using Submodule.iSup_induction' with -- _ this (fun i x hx => ?_) _ h_add
  | hp i x hx =>
    

Proof state:
case hp
R : Type u_1
M : Type u_2
N : Type u_3
inst✝⁴ : CommRing R
inst✝³ : AddCommGroup M
inst✝² : AddCommGroup N
inst✝¹ : Module R M
inst✝ : Module R N
Q : QuadraticForm R M
P : CliffordAlgebra Q → Prop
hr : ∀ (r : R), P ((algebraMap R (CliffordAlgebra Q)) r)
h_add : ∀ (x y : CliffordAlgebra Q), P x → P y → P (x + y)
h_ι_mul : ∀ (m : M) (x : CliffordAlgebra Q), P x → P (x * (ι Q) m)
x✝ : CliffordAlgebra Q
i : ℕ
x : CliffordAlgebra Q
hx : x ∈ LinearMap.range (ι Q) ^ i
⊢ P x

Next tactic:
induction hx using Submodule.pow_induction_on_right' with
    | hr r => exact hr r
    | hadd _x _y _i _ _ ihx ihy => exact h_add _ _ ihx ihy
    | hmul _i x _hx px m hm =>
      obtain ⟨m, rfl⟩ := hm
      exact h_ι_mul _ _ px
theorem right_induction {P : CliffordAlgebra Q → Prop} (hr : ∀ r : R, P (algebraMap _ _ r))
    (h_add : ∀ x y, P x → P y → P (x + y)) (h_ι_mul : ∀ m x, P x → P (x * ι Q m)) : ∀ x, P x := by
  /- It would be neat if we could prove this via `foldr` like how we prove
    `CliffordAlgebra.induction`, but going via the grading seems easier. -/
  intro x
  have : x ∈ ⊤ := Submodule.mem_top (R := R)
  rw [← iSup_ι_range_eq_top] at this
  induction this using Submodule.iSup_induction' with -- _ this (fun i x hx => ?_) _ h_add
  | hp i x hx =>
    induction hx using Submodule.pow_induction_on_right' with
    

Proof state:
case hp.hr
R : Type u_1
M : Type u_2
N : Type u_3
inst✝⁴ : CommRing R
inst✝³ : AddCommGroup M
inst✝² : AddCommGroup N
inst✝¹ : Module R M
inst✝ : Module R N
Q : QuadraticForm R M
P : CliffordAlgebra Q → Prop
hr : ∀ (r : R), P ((algebraMap R (CliffordAlgebra Q)) r)
h_add : ∀ (x y : CliffordAlgebra Q), P x → P y → P (x + y)
h_ι_mul : ∀ (m : M) (x : CliffordAlgebra Q), P x → P (x * (ι Q) m)
x✝ : CliffordAlgebra Q
i : ℕ
x : CliffordAlgebra Q
r : R
⊢ P ((algebraMap R (CliffordAlgebra Q)) r)

Next tactic:
| hr r => exact hr r