l3lab/ntp-mathlib huggingface dataset:
/-- The clifford algebra is graded by the even and odd parts. -/
instance gradedAlgebra : GradedAlgebra (evenOdd Q) :=
  GradedAlgebra.ofAlgHom (evenOdd Q)
    -- while not necessary, the `by apply` makes this elaborate faster
    (lift Q ⟨by apply GradedAlgebra.ι Q, by apply GradedAlgebra.ι_sq_scalar Q⟩)
    -- the proof from here onward is mostly similar to the `TensorAlgebra` case, with some extra
    -- handling for the `iSup` in `evenOdd`.
    (by
      ext m
      

Proof state:
case a.h
R : Type u_1
M : Type u_2
inst✝² : CommRing R
inst✝¹ : AddCommGroup M
inst✝ : Module R M
Q : QuadraticForm R M
m : M
⊢ (AlgHom.toLinearMap
          (AlgHom.comp (DirectSum.coeAlgHom (evenOdd Q))
            ((lift Q)
              { val := GradedAlgebra.ι Q,
                property :=
                  (_ :
                    ∀ (m : M),
                      (GradedAlgebra.ι Q) m * (GradedAlgebra.ι Q) m =
                        (algebraMap R (⨁ (i : ZMod 2), ↥(evenOdd Q i))) (Q m)) })) ∘ₗ
        ι Q)
      m =
    (AlgHom.toLinearMap (AlgHom.id R (CliffordAlgebra Q)) ∘ₗ ι Q) m

Next tactic:
dsimp only [LinearMap.comp_apply, AlgHom.toLinearMap_apply, AlgHom.comp_apply,
        AlgHom.id_apply]
/-- The clifford algebra is graded by the even and odd parts. -/
instance gradedAlgebra : GradedAlgebra (evenOdd Q) :=
  GradedAlgebra.ofAlgHom (evenOdd Q)
    -- while not necessary, the `by apply` makes this elaborate faster
    (lift Q ⟨by apply GradedAlgebra.ι Q, by apply GradedAlgebra.ι_sq_scalar Q⟩)
    -- the proof from here onward is mostly similar to the `TensorAlgebra` case, with some extra
    -- handling for the `iSup` in `evenOdd`.
    (by
      ext m
      dsimp only [LinearMap.comp_apply, AlgHom.toLinearMap_apply, AlgHom.comp_apply,
        AlgHom.id_apply]
      

Proof state:
case a.h
R : Type u_1
M : Type u_2
inst✝² : CommRing R
inst✝¹ : AddCommGroup M
inst✝ : Module R M
Q : QuadraticForm R M
m : M
⊢ (DirectSum.coeAlgHom (evenOdd Q))
      (((lift Q)
          { val := GradedAlgebra.ι Q,
            property :=
              (_ :
                ∀ (m : M),
                  (GradedAlgebra.ι Q) m * (GradedAlgebra.ι Q) m =
                    (algebraMap R (⨁ (i : ZMod 2), ↥(evenOdd Q i))) (Q m)) })
        ((ι Q) m)) =
    (ι Q) m

Next tactic:
rw [lift_ι_apply, GradedAlgebra.ι_apply Q, DirectSum.coeAlgHom_of, Subtype.coe_mk]
/-- The clifford algebra is graded by the even and odd parts. -/
instance gradedAlgebra : GradedAlgebra (evenOdd Q) :=
  GradedAlgebra.ofAlgHom (evenOdd Q)
    -- while not necessary, the `by apply` makes this elaborate faster
    (lift Q ⟨by apply GradedAlgebra.ι Q, by apply GradedAlgebra.ι_sq_scalar Q⟩)
    -- the proof from here onward is mostly similar to the `TensorAlgebra` case, with some extra
    -- handling for the `iSup` in `evenOdd`.
    (by
      ext m
      dsimp only [LinearMap.comp_apply, AlgHom.toLinearMap_apply, AlgHom.comp_apply,
        AlgHom.id_apply]
      rw [lift_ι_apply, GradedAlgebra.ι_apply Q, DirectSum.coeAlgHom_of, Subtype.coe_mk])
    (by 

Proof state:
R : Type u_1
M : Type u_2
inst✝² : CommRing R
inst✝¹ : AddCommGroup M
inst✝ : Module R M
Q : QuadraticForm R M
⊢ ∀ (i : ZMod 2) (x : ↥(evenOdd Q i)),
    ((lift Q)
          { val := GradedAlgebra.ι Q,
            property :=
              (_ :
                ∀ (m : M),
                  (GradedAlgebra.ι Q) m * (GradedAlgebra.ι Q) m =
                    (algebraMap R (⨁ (i : ZMod 2), ↥(evenOdd Q i))) (Q m)) })
        ↑x =
      (DirectSum.of (fun i => ↥(evenOdd Q i)) i) x

Next tactic:
apply GradedAlgebra.lift_ι_eq Q
theorem iSup_ι_range_eq_top : ⨆ i : ℕ, LinearMap.range (ι Q) ^ i = ⊤ := by
  

Proof state:
R : Type u_1
M : Type u_2
inst✝² : CommRing R
inst✝¹ : AddCommGroup M
inst✝ : Module R M
Q : QuadraticForm R M
⊢ ⨆ i, LinearMap.range (ι Q) ^ i = ⊤

Next tactic:
rw [← (DirectSum.Decomposition.isInternal (evenOdd Q)).submodule_iSup_eq_top, eq_comm]
theorem iSup_ι_range_eq_top : ⨆ i : ℕ, LinearMap.range (ι Q) ^ i = ⊤ := by
  rw [← (DirectSum.Decomposition.isInternal (evenOdd Q)).submodule_iSup_eq_top, eq_comm]
  

Proof state:
R : Type u_1
M : Type u_2
inst✝² : CommRing R
inst✝¹ : AddCommGroup M
inst✝ : Module R M
Q : QuadraticForm R M
⊢ iSup (evenOdd Q) = ⨆ i, LinearMap.range (ι Q) ^ i

Next tactic:
calc
    -- porting note: needs extra annotations, no longer unifies against the goal in the face of
    -- ambiguity
    ⨆ (i : ZMod 2) (j : { n : ℕ // ↑n = i }), LinearMap.range (ι Q) ^ (j : ℕ) =
        ⨆ i : Σ i : ZMod 2, { n : ℕ // ↑n = i }, LinearMap.range (ι Q) ^ (i.2 : ℕ) :=
      by rw [iSup_sigma]
    _ = ⨆ i : ℕ, LinearMap.range (ι Q) ^ i :=
      Function.Surjective.iSup_congr (fun i => i.2) (fun i => ⟨⟨_, i, rfl⟩, rfl⟩) fun _ => rfl
theorem iSup_ι_range_eq_top : ⨆ i : ℕ, LinearMap.range (ι Q) ^ i = ⊤ := by
  rw [← (DirectSum.Decomposition.isInternal (evenOdd Q)).submodule_iSup_eq_top, eq_comm]
  calc
    -- porting note: needs extra annotations, no longer unifies against the goal in the face of
    -- ambiguity
    ⨆ (i : ZMod 2) (j : { n : ℕ // ↑n = i }), LinearMap.range (ι Q) ^ (j : ℕ) =
        ⨆ i : Σ i : ZMod 2, { n : ℕ // ↑n = i }, LinearMap.range (ι Q) ^ (i.2 : ℕ) :=
      by 

Proof state:
R : Type u_1
M : Type u_2
inst✝² : CommRing R
inst✝¹ : AddCommGroup M
inst✝ : Module R M
Q : QuadraticForm R M
⊢ ⨆ i, ⨆ j, LinearMap.range (ι Q) ^ ↑j = ⨆ i, LinearMap.range (ι Q) ^ ↑i.snd

Next tactic:
rw [iSup_sigma]
theorem evenOdd_isCompl : IsCompl (evenOdd Q 0) (evenOdd Q 1) :=
  (DirectSum.Decomposition.isInternal (evenOdd Q)).isCompl zero_ne_one <| by
    

Proof state:
R : Type u_1
M : Type u_2
inst✝² : CommRing R
inst✝¹ : AddCommGroup M
inst✝ : Module R M
Q : QuadraticForm R M
⊢ Set.univ = {0, 1}

Next tactic:
have : (Finset.univ : Finset (ZMod 2)) = {0, 1} := rfl
theorem evenOdd_isCompl : IsCompl (evenOdd Q 0) (evenOdd Q 1) :=
  (DirectSum.Decomposition.isInternal (evenOdd Q)).isCompl zero_ne_one <| by
    have : (Finset.univ : Finset (ZMod 2)) = {0, 1} := rfl
    

Proof state:
R : Type u_1
M : Type u_2
inst✝² : CommRing R
inst✝¹ : AddCommGroup M
inst✝ : Module R M
Q : QuadraticForm R M
this : Finset.univ = {0, 1}
⊢ Set.univ = {0, 1}

Next tactic:
simpa using congr_arg ((↑) : Finset (ZMod 2) → Set (ZMod 2)) this
/-- To show a property is true on the even or odd part, it suffices to show it is true on the
scalars or vectors (respectively), closed under addition, and under left-multiplication by a pair
of vectors. -/
@[elab_as_elim]
theorem evenOdd_induction (n : ZMod 2) {P : ∀ x, x ∈ evenOdd Q n → Prop}
    (hr :
      ∀ (v) (h : v ∈ LinearMap.range (ι Q) ^ n.val),
        P v (Submodule.mem_iSup_of_mem ⟨n.val, n.nat_cast_zmod_val⟩ h))
    (hadd : ∀ {x y hx hy}, P x hx → P y hy → P (x + y) (Submodule.add_mem _ hx hy))
    (hιι_mul :
      ∀ (m₁ m₂) {x hx},
        P x hx →
          P (ι Q m₁ * ι Q m₂ * x)
            (zero_add n ▸ SetLike.mul_mem_graded (ι_mul_ι_mem_evenOdd_zero Q m₁ m₂) hx))
    (x : CliffordAlgebra Q) (hx : x ∈ evenOdd Q n) : P x hx := by
  

Proof state:
R : Type u_1
M : Type u_2
inst✝² : CommRing R
inst✝¹ : AddCommGroup M
inst✝ : Module R M
Q : QuadraticForm R M
n : ZMod 2
P : (x : CliffordAlgebra Q) → x ∈ evenOdd Q n → Prop
hr :
  ∀ (v : CliffordAlgebra Q) (h : v ∈ LinearMap.range (ι Q) ^ ZMod.val n), P v (_ : v ∈ ⨆ i, LinearMap.range (ι Q) ^ ↑i)
hadd :
  ∀ {x y : CliffordAlgebra Q} {hx : x ∈ evenOdd Q n} {hy : y ∈ evenOdd Q n},
    P x hx → P y hy → P (x + y) (_ : x + y ∈ evenOdd Q n)
hιι_mul :
  ∀ (m₁ m₂ : M) {x : CliffordAlgebra Q} {hx : x ∈ evenOdd Q n},
    P x hx → P ((ι Q) m₁ * (ι Q) m₂ * x) (_ : (ι Q) m₁ * (ι Q) m₂ * x ∈ evenOdd Q n)
x : CliffordAlgebra Q
hx : x ∈ evenOdd Q n
⊢ P x hx

Next tactic:
apply Submodule.iSup_induction' (C := P) _ (hr 0 (Submodule.zero_mem _)) @hadd
/-- To show a property is true on the even or odd part, it suffices to show it is true on the
scalars or vectors (respectively), closed under addition, and under left-multiplication by a pair
of vectors. -/
@[elab_as_elim]
theorem evenOdd_induction (n : ZMod 2) {P : ∀ x, x ∈ evenOdd Q n → Prop}
    (hr :
      ∀ (v) (h : v ∈ LinearMap.range (ι Q) ^ n.val),
        P v (Submodule.mem_iSup_of_mem ⟨n.val, n.nat_cast_zmod_val⟩ h))
    (hadd : ∀ {x y hx hy}, P x hx → P y hy → P (x + y) (Submodule.add_mem _ hx hy))
    (hιι_mul :
      ∀ (m₁ m₂) {x hx},
        P x hx →
          P (ι Q m₁ * ι Q m₂ * x)
            (zero_add n ▸ SetLike.mul_mem_graded (ι_mul_ι_mem_evenOdd_zero Q m₁ m₂) hx))
    (x : CliffordAlgebra Q) (hx : x ∈ evenOdd Q n) : P x hx := by
  apply Submodule.iSup_induction' (C := P) _ (hr 0 (Submodule.zero_mem _)) @hadd
  

Proof state:
R : Type u_1
M : Type u_2
inst✝² : CommRing R
inst✝¹ : AddCommGroup M
inst✝ : Module R M
Q : QuadraticForm R M
n : ZMod 2
P : (x : CliffordAlgebra Q) → x ∈ evenOdd Q n → Prop
hr :
  ∀ (v : CliffordAlgebra Q) (h : v ∈ LinearMap.range (ι Q) ^ ZMod.val n), P v (_ : v ∈ ⨆ i, LinearMap.range (ι Q) ^ ↑i)
hadd :
  ∀ {x y : CliffordAlgebra Q} {hx : x ∈ evenOdd Q n} {hy : y ∈ evenOdd Q n},
    P x hx → P y hy → P (x + y) (_ : x + y ∈ evenOdd Q n)
hιι_mul :
  ∀ (m₁ m₂ : M) {x : CliffordAlgebra Q} {hx : x ∈ evenOdd Q n},
    P x hx → P ((ι Q) m₁ * (ι Q) m₂ * x) (_ : (ι Q) m₁ * (ι Q) m₂ * x ∈ evenOdd Q n)
x : CliffordAlgebra Q
hx : x ∈ evenOdd Q n
⊢ ∀ (i : { n_1 // ↑n_1 = n }) (x : CliffordAlgebra Q) (hx : x ∈ LinearMap.range (ι Q) ^ ↑i),
    P x (_ : x ∈ ⨆ i, LinearMap.range (ι Q) ^ ↑i)

Next tactic:
refine' Subtype.rec _
/-- To show a property is true on the even or odd part, it suffices to show it is true on the
scalars or vectors (respectively), closed under addition, and under left-multiplication by a pair
of vectors. -/
@[elab_as_elim]
theorem evenOdd_induction (n : ZMod 2) {P : ∀ x, x ∈ evenOdd Q n → Prop}
    (hr :
      ∀ (v) (h : v ∈ LinearMap.range (ι Q) ^ n.val),
        P v (Submodule.mem_iSup_of_mem ⟨n.val, n.nat_cast_zmod_val⟩ h))
    (hadd : ∀ {x y hx hy}, P x hx → P y hy → P (x + y) (Submodule.add_mem _ hx hy))
    (hιι_mul :
      ∀ (m₁ m₂) {x hx},
        P x hx →
          P (ι Q m₁ * ι Q m₂ * x)
            (zero_add n ▸ SetLike.mul_mem_graded (ι_mul_ι_mem_evenOdd_zero Q m₁ m₂) hx))
    (x : CliffordAlgebra Q) (hx : x ∈ evenOdd Q n) : P x hx := by
  apply Submodule.iSup_induction' (C := P) _ (hr 0 (Submodule.zero_mem _)) @hadd
  refine' Subtype.rec _
  

Proof state:
R : Type u_1
M : Type u_2
inst✝² : CommRing R
inst✝¹ : AddCommGroup M
inst✝ : Module R M
Q : QuadraticForm R M
n : ZMod 2
P : (x : CliffordAlgebra Q) → x ∈ evenOdd Q n → Prop
hr :
  ∀ (v : CliffordAlgebra Q) (h : v ∈ LinearMap.range (ι Q) ^ ZMod.val n), P v (_ : v ∈ ⨆ i, LinearMap.range (ι Q) ^ ↑i)
hadd :
  ∀ {x y : CliffordAlgebra Q} {hx : x ∈ evenOdd Q n} {hy : y ∈ evenOdd Q n},
    P x hx → P y hy → P (x + y) (_ : x + y ∈ evenOdd Q n)
hιι_mul :
  ∀ (m₁ m₂ : M) {x : CliffordAlgebra Q} {hx : x ∈ evenOdd Q n},
    P x hx → P ((ι Q) m₁ * (ι Q) m₂ * x) (_ : (ι Q) m₁ * (ι Q) m₂ * x ∈ evenOdd Q n)
x : CliffordAlgebra Q
hx : x ∈ evenOdd Q n
⊢ ∀ (val : ℕ) (property : ↑val = n) (x : CliffordAlgebra Q)
    (hx : x ∈ LinearMap.range (ι Q) ^ ↑{ val := val, property := property }),
    P x (_ : x ∈ ⨆ i, LinearMap.range (ι Q) ^ ↑i)

Next tactic:
simp_rw [ZMod.nat_coe_zmod_eq_iff, add_comm n.val]
/-- To show a property is true on the even or odd part, it suffices to show it is true on the
scalars or vectors (respectively), closed under addition, and under left-multiplication by a pair
of vectors. -/
@[elab_as_elim]
theorem evenOdd_induction (n : ZMod 2) {P : ∀ x, x ∈ evenOdd Q n → Prop}
    (hr :
      ∀ (v) (h : v ∈ LinearMap.range (ι Q) ^ n.val),
        P v (Submodule.mem_iSup_of_mem ⟨n.val, n.nat_cast_zmod_val⟩ h))
    (hadd : ∀ {x y hx hy}, P x hx → P y hy → P (x + y) (Submodule.add_mem _ hx hy))
    (hιι_mul :
      ∀ (m₁ m₂) {x hx},
        P x hx →
          P (ι Q m₁ * ι Q m₂ * x)
            (zero_add n ▸ SetLike.mul_mem_graded (ι_mul_ι_mem_evenOdd_zero Q m₁ m₂) hx))
    (x : CliffordAlgebra Q) (hx : x ∈ evenOdd Q n) : P x hx := by
  apply Submodule.iSup_induction' (C := P) _ (hr 0 (Submodule.zero_mem _)) @hadd
  refine' Subtype.rec _
  simp_rw [ZMod.nat_coe_zmod_eq_iff, add_comm n.val]
  

Proof state:
R : Type u_1
M : Type u_2
inst✝² : CommRing R
inst✝¹ : AddCommGroup M
inst✝ : Module R M
Q : QuadraticForm R M
n : ZMod 2
P : (x : CliffordAlgebra Q) → x ∈ evenOdd Q n → Prop
hr :
  ∀ (v : CliffordAlgebra Q) (h : v ∈ LinearMap.range (ι Q) ^ ZMod.val n), P v (_ : v ∈ ⨆ i, LinearMap.range (ι Q) ^ ↑i)
hadd :
  ∀ {x y : CliffordAlgebra Q} {hx : x ∈ evenOdd Q n} {hy : y ∈ evenOdd Q n},
    P x hx → P y hy → P (x + y) (_ : x + y ∈ evenOdd Q n)
hιι_mul :
  ∀ (m₁ m₂ : M) {x : CliffordAlgebra Q} {hx : x ∈ evenOdd Q n},
    P x hx → P ((ι Q) m₁ * (ι Q) m₂ * x) (_ : (ι Q) m₁ * (ι Q) m₂ * x ∈ evenOdd Q n)
x : CliffordAlgebra Q
hx : x ∈ evenOdd Q n
⊢ ∀ (val : ℕ) (property : ∃ k, val = 2 * k + ZMod.val n) (x : CliffordAlgebra Q) (hx : x ∈ LinearMap.range (ι Q) ^ val),
    P x (_ : x ∈ ⨆ i, LinearMap.range (ι Q) ^ ↑i)

Next tactic:
rintro n' ⟨k, rfl⟩ xv
/-- To show a property is true on the even or odd part, it suffices to show it is true on the
scalars or vectors (respectively), closed under addition, and under left-multiplication by a pair
of vectors. -/
@[elab_as_elim]
theorem evenOdd_induction (n : ZMod 2) {P : ∀ x, x ∈ evenOdd Q n → Prop}
    (hr :
      ∀ (v) (h : v ∈ LinearMap.range (ι Q) ^ n.val),
        P v (Submodule.mem_iSup_of_mem ⟨n.val, n.nat_cast_zmod_val⟩ h))
    (hadd : ∀ {x y hx hy}, P x hx → P y hy → P (x + y) (Submodule.add_mem _ hx hy))
    (hιι_mul :
      ∀ (m₁ m₂) {x hx},
        P x hx →
          P (ι Q m₁ * ι Q m₂ * x)
            (zero_add n ▸ SetLike.mul_mem_graded (ι_mul_ι_mem_evenOdd_zero Q m₁ m₂) hx))
    (x : CliffordAlgebra Q) (hx : x ∈ evenOdd Q n) : P x hx := by
  apply Submodule.iSup_induction' (C := P) _ (hr 0 (Submodule.zero_mem _)) @hadd
  refine' Subtype.rec _
  simp_rw [ZMod.nat_coe_zmod_eq_iff, add_comm n.val]
  rintro n' ⟨k, rfl⟩ xv
  

Proof state:
case intro
R : Type u_1
M : Type u_2
inst✝² : CommRing R
inst✝¹ : AddCommGroup M
inst✝ : Module R M
Q : QuadraticForm R M
n : ZMod 2
P : (x : CliffordAlgebra Q) → x ∈ evenOdd Q n → Prop
hr :
  ∀ (v : CliffordAlgebra Q) (h : v ∈ LinearMap.range (ι Q) ^ ZMod.val n), P v (_ : v ∈ ⨆ i, LinearMap.range (ι Q) ^ ↑i)
hadd :
  ∀ {x y : CliffordAlgebra Q} {hx : x ∈ evenOdd Q n} {hy : y ∈ evenOdd Q n},
    P x hx → P y hy → P (x + y) (_ : x + y ∈ evenOdd Q n)
hιι_mul :
  ∀ (m₁ m₂ : M) {x : CliffordAlgebra Q} {hx : x ∈ evenOdd Q n},
    P x hx → P ((ι Q) m₁ * (ι Q) m₂ * x) (_ : (ι Q) m₁ * (ι Q) m₂ * x ∈ evenOdd Q n)
x : CliffordAlgebra Q
hx : x ∈ evenOdd Q n
k : ℕ
xv : CliffordAlgebra Q
⊢ ∀ (hx : xv ∈ LinearMap.range (ι Q) ^ (2 * k + ZMod.val n)), P xv (_ : xv ∈ ⨆ i, LinearMap.range (ι Q) ^ ↑i)

Next tactic:
simp_rw [pow_add, pow_mul]
/-- To show a property is true on the even or odd part, it suffices to show it is true on the
scalars or vectors (respectively), closed under addition, and under left-multiplication by a pair
of vectors. -/
@[elab_as_elim]
theorem evenOdd_induction (n : ZMod 2) {P : ∀ x, x ∈ evenOdd Q n → Prop}
    (hr :
      ∀ (v) (h : v ∈ LinearMap.range (ι Q) ^ n.val),
        P v (Submodule.mem_iSup_of_mem ⟨n.val, n.nat_cast_zmod_val⟩ h))
    (hadd : ∀ {x y hx hy}, P x hx → P y hy → P (x + y) (Submodule.add_mem _ hx hy))
    (hιι_mul :
      ∀ (m₁ m₂) {x hx},
        P x hx →
          P (ι Q m₁ * ι Q m₂ * x)
            (zero_add n ▸ SetLike.mul_mem_graded (ι_mul_ι_mem_evenOdd_zero Q m₁ m₂) hx))
    (x : CliffordAlgebra Q) (hx : x ∈ evenOdd Q n) : P x hx := by
  apply Submodule.iSup_induction' (C := P) _ (hr 0 (Submodule.zero_mem _)) @hadd
  refine' Subtype.rec _
  simp_rw [ZMod.nat_coe_zmod_eq_iff, add_comm n.val]
  rintro n' ⟨k, rfl⟩ xv
  simp_rw [pow_add, pow_mul]
  

Proof state:
case intro
R : Type u_1
M : Type u_2
inst✝² : CommRing R
inst✝¹ : AddCommGroup M
inst✝ : Module R M
Q : QuadraticForm R M
n : ZMod 2
P : (x : CliffordAlgebra Q) → x ∈ evenOdd Q n → Prop
hr :
  ∀ (v : CliffordAlgebra Q) (h : v ∈ LinearMap.range (ι Q) ^ ZMod.val n), P v (_ : v ∈ ⨆ i, LinearMap.range (ι Q) ^ ↑i)
hadd :
  ∀ {x y : CliffordAlgebra Q} {hx : x ∈ evenOdd Q n} {hy : y ∈ evenOdd Q n},
    P x hx → P y hy → P (x + y) (_ : x + y ∈ evenOdd Q n)
hιι_mul :
  ∀ (m₁ m₂ : M) {x : CliffordAlgebra Q} {hx : x ∈ evenOdd Q n},
    P x hx → P ((ι Q) m₁ * (ι Q) m₂ * x) (_ : (ι Q) m₁ * (ι Q) m₂ * x ∈ evenOdd Q n)
x : CliffordAlgebra Q
hx : x ∈ evenOdd Q n
k : ℕ
xv : CliffordAlgebra Q
⊢ ∀ (hx : xv ∈ (LinearMap.range (ι Q) ^ 2) ^ k * LinearMap.range (ι Q) ^ ZMod.val n),
    P xv (_ : xv ∈ ⨆ i, LinearMap.range (ι Q) ^ ↑i)

Next tactic:
intro hxv
/-- To show a property is true on the even or odd part, it suffices to show it is true on the
scalars or vectors (respectively), closed under addition, and under left-multiplication by a pair
of vectors. -/
@[elab_as_elim]
theorem evenOdd_induction (n : ZMod 2) {P : ∀ x, x ∈ evenOdd Q n → Prop}
    (hr :
      ∀ (v) (h : v ∈ LinearMap.range (ι Q) ^ n.val),
        P v (Submodule.mem_iSup_of_mem ⟨n.val, n.nat_cast_zmod_val⟩ h))
    (hadd : ∀ {x y hx hy}, P x hx → P y hy → P (x + y) (Submodule.add_mem _ hx hy))
    (hιι_mul :
      ∀ (m₁ m₂) {x hx},
        P x hx →
          P (ι Q m₁ * ι Q m₂ * x)
            (zero_add n ▸ SetLike.mul_mem_graded (ι_mul_ι_mem_evenOdd_zero Q m₁ m₂) hx))
    (x : CliffordAlgebra Q) (hx : x ∈ evenOdd Q n) : P x hx := by
  apply Submodule.iSup_induction' (C := P) _ (hr 0 (Submodule.zero_mem _)) @hadd
  refine' Subtype.rec _
  simp_rw [ZMod.nat_coe_zmod_eq_iff, add_comm n.val]
  rintro n' ⟨k, rfl⟩ xv
  simp_rw [pow_add, pow_mul]
  intro hxv
  

Proof state:
case intro
R : Type u_1
M : Type u_2
inst✝² : CommRing R
inst✝¹ : AddCommGroup M
inst✝ : Module R M
Q : QuadraticForm R M
n : ZMod 2
P : (x : CliffordAlgebra Q) → x ∈ evenOdd Q n → Prop
hr :
  ∀ (v : CliffordAlgebra Q) (h : v ∈ LinearMap.range (ι Q) ^ ZMod.val n), P v (_ : v ∈ ⨆ i, LinearMap.range (ι Q) ^ ↑i)
hadd :
  ∀ {x y : CliffordAlgebra Q} {hx : x ∈ evenOdd Q n} {hy : y ∈ evenOdd Q n},
    P x hx → P y hy → P (x + y) (_ : x + y ∈ evenOdd Q n)
hιι_mul :
  ∀ (m₁ m₂ : M) {x : CliffordAlgebra Q} {hx : x ∈ evenOdd Q n},
    P x hx → P ((ι Q) m₁ * (ι Q) m₂ * x) (_ : (ι Q) m₁ * (ι Q) m₂ * x ∈ evenOdd Q n)
x : CliffordAlgebra Q
hx : x ∈ evenOdd Q n
k : ℕ
xv : CliffordAlgebra Q
hxv : xv ∈ (LinearMap.range (ι Q) ^ 2) ^ k * LinearMap.range (ι Q) ^ ZMod.val n
⊢ P xv (_ : xv ∈ ⨆ i, LinearMap.range (ι Q) ^ ↑i)

Next tactic:
induction hxv using Submodule.mul_induction_on' with
  | hm a ha b hb =>
    induction ha using Submodule.pow_induction_on_left' with
    | hr r =>
      simp_rw [← Algebra.smul_def]
      exact hr _ (Submodule.smul_mem _ _ hb)
    | hadd x y n hx hy ihx ihy =>
      simp_rw [add_mul]
      apply hadd ihx ihy
    | hmul x hx n'' y hy ihy =>
      revert hx
      simp_rw [pow_two]
      intro hx2
      induction hx2 using Submodule.mul_induction_on' with
      | hm m hm n hn =>
        simp_rw [LinearMap.mem_range] at hm hn
        obtain ⟨m₁, rfl⟩ := hm; obtain ⟨m₂, rfl⟩ := hn
        simp_rw [mul_assoc _ y b]
        refine' hιι_mul _ _ ihy
      | ha x hx y hy ihx ihy =>
        simp_rw [add_mul]
        apply hadd ihx ihy
  | ha x y hx hy ihx ihy =>
    apply hadd ihx ihy
/-- To show a property is true on the even or odd part, it suffices to show it is true on the
scalars or vectors (respectively), closed under addition, and under left-multiplication by a pair
of vectors. -/
@[elab_as_elim]
theorem evenOdd_induction (n : ZMod 2) {P : ∀ x, x ∈ evenOdd Q n → Prop}
    (hr :
      ∀ (v) (h : v ∈ LinearMap.range (ι Q) ^ n.val),
        P v (Submodule.mem_iSup_of_mem ⟨n.val, n.nat_cast_zmod_val⟩ h))
    (hadd : ∀ {x y hx hy}, P x hx → P y hy → P (x + y) (Submodule.add_mem _ hx hy))
    (hιι_mul :
      ∀ (m₁ m₂) {x hx},
        P x hx →
          P (ι Q m₁ * ι Q m₂ * x)
            (zero_add n ▸ SetLike.mul_mem_graded (ι_mul_ι_mem_evenOdd_zero Q m₁ m₂) hx))
    (x : CliffordAlgebra Q) (hx : x ∈ evenOdd Q n) : P x hx := by
  apply Submodule.iSup_induction' (C := P) _ (hr 0 (Submodule.zero_mem _)) @hadd
  refine' Subtype.rec _
  simp_rw [ZMod.nat_coe_zmod_eq_iff, add_comm n.val]
  rintro n' ⟨k, rfl⟩ xv
  simp_rw [pow_add, pow_mul]
  intro hxv
  induction hxv using Submodule.mul_induction_on' with
  

Proof state:
case intro.hm
R : Type u_1
M : Type u_2
inst✝² : CommRing R
inst✝¹ : AddCommGroup M
inst✝ : Module R M
Q : QuadraticForm R M
n : ZMod 2
P : (x : CliffordAlgebra Q) → x ∈ evenOdd Q n → Prop
hr :
  ∀ (v : CliffordAlgebra Q) (h : v ∈ LinearMap.range (ι Q) ^ ZMod.val n), P v (_ : v ∈ ⨆ i, LinearMap.range (ι Q) ^ ↑i)
hadd :
  ∀ {x y : CliffordAlgebra Q} {hx : x ∈ evenOdd Q n} {hy : y ∈ evenOdd Q n},
    P x hx → P y hy → P (x + y) (_ : x + y ∈ evenOdd Q n)
hιι_mul :
  ∀ (m₁ m₂ : M) {x : CliffordAlgebra Q} {hx : x ∈ evenOdd Q n},
    P x hx → P ((ι Q) m₁ * (ι Q) m₂ * x) (_ : (ι Q) m₁ * (ι Q) m₂ * x ∈ evenOdd Q n)
x : CliffordAlgebra Q
hx : x ∈ evenOdd Q n
k : ℕ
xv a : CliffordAlgebra Q
ha : a ∈ (LinearMap.range (ι Q) ^ 2) ^ k
b : CliffordAlgebra Q
hb : b ∈ LinearMap.range (ι Q) ^ ZMod.val n
⊢ P (a * b) (_ : a * b ∈ ⨆ i, LinearMap.range (ι Q) ^ ↑i)

Next tactic:
| hm a ha b hb =>
    induction ha using Submodule.pow_induction_on_left' with
    | hr r =>
      simp_rw [← Algebra.smul_def]
      exact hr _ (Submodule.smul_mem _ _ hb)
    | hadd x y n hx hy ihx ihy =>
      simp_rw [add_mul]
      apply hadd ihx ihy
    | hmul x hx n'' y hy ihy =>
      revert hx
      simp_rw [pow_two]
      intro hx2
      induction hx2 using Submodule.mul_induction_on' with
      | hm m hm n hn =>
        simp_rw [LinearMap.mem_range] at hm hn
        obtain ⟨m₁, rfl⟩ := hm; obtain ⟨m₂, rfl⟩ := hn
        simp_rw [mul_assoc _ y b]
        refine' hιι_mul _ _ ihy
      | ha x hx y hy ihx ihy =>
        simp_rw [add_mul]
        apply hadd ihx ihy
/-- To show a property is true on the even or odd part, it suffices to show it is true on the
scalars or vectors (respectively), closed under addition, and under left-multiplication by a pair
of vectors. -/
@[elab_as_elim]
theorem evenOdd_induction (n : ZMod 2) {P : ∀ x, x ∈ evenOdd Q n → Prop}
    (hr :
      ∀ (v) (h : v ∈ LinearMap.range (ι Q) ^ n.val),
        P v (Submodule.mem_iSup_of_mem ⟨n.val, n.nat_cast_zmod_val⟩ h))
    (hadd : ∀ {x y hx hy}, P x hx → P y hy → P (x + y) (Submodule.add_mem _ hx hy))
    (hιι_mul :
      ∀ (m₁ m₂) {x hx},
        P x hx →
          P (ι Q m₁ * ι Q m₂ * x)
            (zero_add n ▸ SetLike.mul_mem_graded (ι_mul_ι_mem_evenOdd_zero Q m₁ m₂) hx))
    (x : CliffordAlgebra Q) (hx : x ∈ evenOdd Q n) : P x hx := by
  apply Submodule.iSup_induction' (C := P) _ (hr 0 (Submodule.zero_mem _)) @hadd
  refine' Subtype.rec _
  simp_rw [ZMod.nat_coe_zmod_eq_iff, add_comm n.val]
  rintro n' ⟨k, rfl⟩ xv
  simp_rw [pow_add, pow_mul]
  intro hxv
  induction hxv using Submodule.mul_induction_on' with
  | hm a ha b hb =>
    

Proof state:
case intro.hm
R : Type u_1
M : Type u_2
inst✝² : CommRing R
inst✝¹ : AddCommGroup M
inst✝ : Module R M
Q : QuadraticForm R M
n : ZMod 2
P : (x : CliffordAlgebra Q) → x ∈ evenOdd Q n → Prop
hr :
  ∀ (v : CliffordAlgebra Q) (h : v ∈ LinearMap.range (ι Q) ^ ZMod.val n), P v (_ : v ∈ ⨆ i, LinearMap.range (ι Q) ^ ↑i)
hadd :
  ∀ {x y : CliffordAlgebra Q} {hx : x ∈ evenOdd Q n} {hy : y ∈ evenOdd Q n},
    P x hx → P y hy → P (x + y) (_ : x + y ∈ evenOdd Q n)
hιι_mul :
  ∀ (m₁ m₂ : M) {x : CliffordAlgebra Q} {hx : x ∈ evenOdd Q n},
    P x hx → P ((ι Q) m₁ * (ι Q) m₂ * x) (_ : (ι Q) m₁ * (ι Q) m₂ * x ∈ evenOdd Q n)
x : CliffordAlgebra Q
hx : x ∈ evenOdd Q n
k : ℕ
xv a : CliffordAlgebra Q
ha : a ∈ (LinearMap.range (ι Q) ^ 2) ^ k
b : CliffordAlgebra Q
hb : b ∈ LinearMap.range (ι Q) ^ ZMod.val n
⊢ P (a * b) (_ : a * b ∈ ⨆ i, LinearMap.range (ι Q) ^ ↑i)

Next tactic:
induction ha using Submodule.pow_induction_on_left' with
    | hr r =>
      simp_rw [← Algebra.smul_def]
      exact hr _ (Submodule.smul_mem _ _ hb)
    | hadd x y n hx hy ihx ihy =>
      simp_rw [add_mul]
      apply hadd ihx ihy
    | hmul x hx n'' y hy ihy =>
      revert hx
      simp_rw [pow_two]
      intro hx2
      induction hx2 using Submodule.mul_induction_on' with
      | hm m hm n hn =>
        simp_rw [LinearMap.mem_range] at hm hn
        obtain ⟨m₁, rfl⟩ := hm; obtain ⟨m₂, rfl⟩ := hn
        simp_rw [mul_assoc _ y b]
        refine' hιι_mul _ _ ihy
      | ha x hx y hy ihx ihy =>
        simp_rw [add_mul]
        apply hadd ihx ihy