l3lab/ntp-mathlib huggingface dataset:
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
    | hr r => 

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:
exact hr 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)
  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
    | hr r => exact hr r
    

Proof state:
case hp.hadd
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 _x _y : CliffordAlgebra Q
_i : ℕ
hx✝ : _x ∈ LinearMap.range (ι Q) ^ _i
hy✝ : _y ∈ LinearMap.range (ι Q) ^ _i
ihx : P _x
ihy : P _y
⊢ P (_x + _y)

Next tactic:
| hadd _x _y _i _ _ 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
  | hp i x hx =>
    induction hx using Submodule.pow_induction_on_right' with
    | hr r => exact hr r
    | hadd _x _y _i _ _ ihx ihy => 

Proof state:
case hp.hadd
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 _x _y : CliffordAlgebra Q
_i : ℕ
hx✝ : _x ∈ LinearMap.range (ι Q) ^ _i
hy✝ : _y ∈ LinearMap.range (ι Q) ^ _i
ihx : P _x
ihy : P _y
⊢ P (_x + _y)

Next tactic:
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
  | 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
    

Proof state:
case hp.hmul
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
_i : ℕ
x : CliffordAlgebra Q
_hx : x ∈ LinearMap.range (ι Q) ^ _i
px : P x
m : CliffordAlgebra Q
hm : m ∈ LinearMap.range (ι Q)
⊢ P (x * m)

Next tactic:
| 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
    | hr r => exact hr r
    | hadd _x _y _i _ _ ihx ihy => exact h_add _ _ ihx ihy
    | hmul _i x _hx px m hm =>
      

Proof state:
case hp.hmul
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
_i : ℕ
x : CliffordAlgebra Q
_hx : x ∈ LinearMap.range (ι Q) ^ _i
px : P x
m : CliffordAlgebra Q
hm : m ∈ LinearMap.range (ι Q)
⊢ P (x * m)

Next tactic:
obtain ⟨m, rfl⟩ := hm
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
    | 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
      

Proof state:
case hp.hmul.intro
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
_i : ℕ
x : CliffordAlgebra Q
_hx : x ∈ LinearMap.range (ι Q) ^ _i
px : P x
m : M
⊢ P (x * (ι Q) m)

Next tactic:
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
    | 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
  

Proof state:
case h0
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 0

Next tactic:
| h0 => simpa only [map_zero] using hr 0
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
    | 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 => 

Proof state:
case h0
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 0

Next tactic:
simpa only [map_zero] using hr 0
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
    | 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
  

Proof state:
case hadd
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 _x _y : CliffordAlgebra Q
hx✝ : _x ∈ ⨆ i, LinearMap.range (ι Q) ^ i
hy✝ : _y ∈ ⨆ i, LinearMap.range (ι Q) ^ i
ihx : P _x
ihy : P _y
⊢ P (_x + _y)

Next tactic:
| 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
  | 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 =>
    

Proof state:
case hadd
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 _x _y : CliffordAlgebra Q
hx✝ : _x ∈ ⨆ i, LinearMap.range (ι Q) ^ i
hy✝ : _y ∈ ⨆ i, LinearMap.range (ι Q) ^ i
ihx : P _x
ihy : P _y
⊢ P (_x + _y)

Next tactic:
exact h_add _ _ ihx ihy
theorem left_induction {P : CliffordAlgebra Q → Prop} (hr : ∀ r : R, P (algebraMap _ _ r))
    (h_add : ∀ x y, P x → P y → P (x + y)) (h_mul_ι : ∀ x m, P x → P (ι Q m * x)) : ∀ x, P x := 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
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_ι : ∀ (x : CliffordAlgebra Q) (m : M), P x → P ((ι Q) m * x)
⊢ ∀ (x : CliffordAlgebra Q), P x

Next tactic:
refine' reverse_involutive.surjective.forall.2 _
theorem left_induction {P : CliffordAlgebra Q → Prop} (hr : ∀ r : R, P (algebraMap _ _ r))
    (h_add : ∀ x y, P x → P y → P (x + y)) (h_mul_ι : ∀ x m, P x → P (ι Q m * x)) : ∀ x, P x := by
  refine' reverse_involutive.surjective.forall.2 _
  

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_ι : ∀ (x : CliffordAlgebra Q) (m : M), P x → P ((ι Q) m * x)
⊢ ∀ (x : CliffordAlgebra Q), P (reverse x)

Next tactic:
intro x
theorem left_induction {P : CliffordAlgebra Q → Prop} (hr : ∀ r : R, P (algebraMap _ _ r))
    (h_add : ∀ x y, P x → P y → P (x + y)) (h_mul_ι : ∀ x m, P x → P (ι Q m * x)) : ∀ x, P x := by
  refine' reverse_involutive.surjective.forall.2 _
  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_ι : ∀ (x : CliffordAlgebra Q) (m : M), P x → P ((ι Q) m * x)
x : CliffordAlgebra Q
⊢ P (reverse x)

Next tactic:
induction' x using CliffordAlgebra.right_induction with r x y hx hy m x hx
theorem left_induction {P : CliffordAlgebra Q → Prop} (hr : ∀ r : R, P (algebraMap _ _ r))
    (h_add : ∀ x y, P x → P y → P (x + y)) (h_mul_ι : ∀ x m, P x → P (ι Q m * x)) : ∀ x, P x := by
  refine' reverse_involutive.surjective.forall.2 _
  intro x
  induction' x using CliffordAlgebra.right_induction with r x y hx hy m x hx
  · 

Proof state:
case 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_ι : ∀ (x : CliffordAlgebra Q) (m : M), P x → P ((ι Q) m * x)
r : R
⊢ P (reverse ((algebraMap R (CliffordAlgebra Q)) r))

Next tactic:
simpa only [reverse.commutes] using hr r
theorem left_induction {P : CliffordAlgebra Q → Prop} (hr : ∀ r : R, P (algebraMap _ _ r))
    (h_add : ∀ x y, P x → P y → P (x + y)) (h_mul_ι : ∀ x m, P x → P (ι Q m * x)) : ∀ x, P x := by
  refine' reverse_involutive.surjective.forall.2 _
  intro x
  induction' x using CliffordAlgebra.right_induction with r x y hx hy m x hx
  · simpa only [reverse.commutes] using hr r
  · 

Proof state:
case h_add
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_ι : ∀ (x : CliffordAlgebra Q) (m : M), P x → P ((ι Q) m * x)
x y : CliffordAlgebra Q
hx : P (reverse x)
hy : P (reverse y)
⊢ P (reverse (x + y))

Next tactic:
simpa only [map_add] using h_add _ _ hx hy
theorem left_induction {P : CliffordAlgebra Q → Prop} (hr : ∀ r : R, P (algebraMap _ _ r))
    (h_add : ∀ x y, P x → P y → P (x + y)) (h_mul_ι : ∀ x m, P x → P (ι Q m * x)) : ∀ x, P x := by
  refine' reverse_involutive.surjective.forall.2 _
  intro x
  induction' x using CliffordAlgebra.right_induction with r x y hx hy m x hx
  · simpa only [reverse.commutes] using hr r
  · simpa only [map_add] using h_add _ _ hx hy
  · 

Proof state:
case h_ι_mul
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_ι : ∀ (x : CliffordAlgebra Q) (m : M), P x → P ((ι Q) m * x)
m : M
x : CliffordAlgebra Q
hx : P (reverse x)
⊢ P (reverse (x * (ι Q) m))

Next tactic:
simpa only [reverse.map_mul, reverse_ι] using h_mul_ι _ _ hx
/-- Auxiliary definition for `CliffordAlgebra.foldr'` -/
def foldr'Aux (f : M →ₗ[R] CliffordAlgebra Q × N →ₗ[R] N) :
    M →ₗ[R] Module.End R (CliffordAlgebra Q × 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] CliffordAlgebra Q × N →ₗ[R] N
⊢ M →ₗ[R] Module.End R (CliffordAlgebra Q × N)

Next tactic:
have v_mul := (Algebra.lmul R (CliffordAlgebra Q)).toLinearMap ∘ₗ ι Q
/-- Auxiliary definition for `CliffordAlgebra.foldr'` -/
def foldr'Aux (f : M →ₗ[R] CliffordAlgebra Q × N →ₗ[R] N) :
    M →ₗ[R] Module.End R (CliffordAlgebra Q × N) := by
  have v_mul := (Algebra.lmul R (CliffordAlgebra Q)).toLinearMap ∘ₗ ι Q
  

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] CliffordAlgebra Q × N →ₗ[R] N
v_mul : M →ₗ[R] Module.End R (CliffordAlgebra Q)
⊢ M →ₗ[R] Module.End R (CliffordAlgebra Q × N)

Next tactic:
have l := v_mul.compl₂ (LinearMap.fst _ _ N)
/-- Auxiliary definition for `CliffordAlgebra.foldr'` -/
def foldr'Aux (f : M →ₗ[R] CliffordAlgebra Q × N →ₗ[R] N) :
    M →ₗ[R] Module.End R (CliffordAlgebra Q × N) := by
  have v_mul := (Algebra.lmul R (CliffordAlgebra Q)).toLinearMap ∘ₗ ι Q
  have l := v_mul.compl₂ (LinearMap.fst _ _ N)
  

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] CliffordAlgebra Q × N →ₗ[R] N
v_mul : M →ₗ[R] Module.End R (CliffordAlgebra Q)
l : M →ₗ[R] CliffordAlgebra Q × N →ₗ[R] CliffordAlgebra Q
⊢ M →ₗ[R] Module.End R (CliffordAlgebra Q × N)

Next tactic:
exact
    { toFun := fun m => (l m).prod (f m)
      map_add' := fun v₂ v₂ =>
        LinearMap.ext fun x =>
          Prod.ext (LinearMap.congr_fun (l.map_add _ _) x) (LinearMap.congr_fun (f.map_add _ _) x)
      map_smul' := fun c v =>
        LinearMap.ext fun x =>
          Prod.ext (LinearMap.congr_fun (l.map_smul _ _) x)
            (LinearMap.congr_fun (f.map_smul _ _) x) }
theorem foldr'Aux_foldr'Aux (f : M →ₗ[R] CliffordAlgebra Q × N →ₗ[R] N)
    (hf : ∀ m x fx, f m (ι Q m * x, f m (x, fx)) = Q m • fx) (v : M) (x_fx) :
    foldr'Aux Q f v (foldr'Aux Q f v x_fx) = Q v • x_fx := 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] CliffordAlgebra Q × N →ₗ[R] N
hf : ∀ (m : M) (x : CliffordAlgebra Q) (fx : N), (f m) ((ι Q) m * x, (f m) (x, fx)) = Q m • fx
v : M
x_fx : CliffordAlgebra Q × N
⊢ ((foldr'Aux Q f) v) (((foldr'Aux Q f) v) x_fx) = Q v • x_fx

Next tactic:
cases' x_fx with x fx
theorem foldr'Aux_foldr'Aux (f : M →ₗ[R] CliffordAlgebra Q × N →ₗ[R] N)
    (hf : ∀ m x fx, f m (ι Q m * x, f m (x, fx)) = Q m • fx) (v : M) (x_fx) :
    foldr'Aux Q f v (foldr'Aux Q f v x_fx) = Q v • x_fx := by
  cases' x_fx with x fx
  

Proof state:
case mk
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] CliffordAlgebra Q × N →ₗ[R] N
hf : ∀ (m : M) (x : CliffordAlgebra Q) (fx : N), (f m) ((ι Q) m * x, (f m) (x, fx)) = Q m • fx
v : M
x : CliffordAlgebra Q
fx : N
⊢ ((foldr'Aux Q f) v) (((foldr'Aux Q f) v) (x, fx)) = Q v • (x, fx)

Next tactic:
simp only [foldr'Aux_apply_apply]
theorem foldr'Aux_foldr'Aux (f : M →ₗ[R] CliffordAlgebra Q × N →ₗ[R] N)
    (hf : ∀ m x fx, f m (ι Q m * x, f m (x, fx)) = Q m • fx) (v : M) (x_fx) :
    foldr'Aux Q f v (foldr'Aux Q f v x_fx) = Q v • x_fx := by
  cases' x_fx with x fx
  simp only [foldr'Aux_apply_apply]
  

Proof state:
case mk
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] CliffordAlgebra Q × N →ₗ[R] N
hf : ∀ (m : M) (x : CliffordAlgebra Q) (fx : N), (f m) ((ι Q) m * x, (f m) (x, fx)) = Q m • fx
v : M
x : CliffordAlgebra Q
fx : N
⊢ ((ι Q) v * ((ι Q) v * x), (f v) ((ι Q) v * x, (f v) (x, fx))) = Q v • (x, fx)

Next tactic:
rw [← mul_assoc, ι_sq_scalar, ← Algebra.smul_def, hf, Prod.smul_mk]
theorem foldr'_ι_mul (f : M →ₗ[R] CliffordAlgebra Q × N →ₗ[R] N)
    (hf : ∀ m x fx, f m (ι Q m * x, f m (x, fx)) = Q m • fx) (n m) (x) :
    foldr' Q f hf n (ι Q m * x) = f m (x, foldr' Q f hf n x) := 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] CliffordAlgebra Q × N →ₗ[R] N
hf : ∀ (m : M) (x : CliffordAlgebra Q) (fx : N), (f m) ((ι Q) m * x, (f m) (x, fx)) = Q m • fx
n : N
m : M
x : CliffordAlgebra Q
⊢ (foldr' Q f hf n) ((ι Q) m * x) = (f m) (x, (foldr' Q f hf n) x)

Next tactic:
dsimp [foldr']
theorem foldr'_ι_mul (f : M →ₗ[R] CliffordAlgebra Q × N →ₗ[R] N)
    (hf : ∀ m x fx, f m (ι Q m * x, f m (x, fx)) = Q m • fx) (n m) (x) :
    foldr' Q f hf n (ι Q m * x) = f m (x, foldr' Q f hf n x) := by
  dsimp [foldr']
  

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] CliffordAlgebra Q × N →ₗ[R] N
hf : ∀ (m : M) (x : CliffordAlgebra Q) (fx : N), (f m) ((ι Q) m * x, (f m) (x, fx)) = Q m • fx
n : N
m : M
x : CliffordAlgebra Q
⊢ (((foldr Q (foldr'Aux Q f)
            (_ : ∀ (v : M) (x_fx : CliffordAlgebra Q × N), ((foldr'Aux Q f) v) (((foldr'Aux Q f) v) x_fx) = Q v • x_fx))
          (1, n))
        ((ι Q) m * x)).2 =
    (f m)
      (x,
        (((foldr Q (foldr'Aux Q f)
                (_ :
                  ∀ (v : M) (x_fx : CliffordAlgebra Q × N),
                    ((foldr'Aux Q f) v) (((foldr'Aux Q f) v) x_fx) = Q v • x_fx))
              (1, n))
            x).2)

Next tactic:
rw [foldr_mul, foldr_ι, foldr'Aux_apply_apply]