l3lab/ntp-mathlib huggingface dataset:
theorem GradedAlgebra.lift_ι_eq (i' : ZMod 2) (x' : evenOdd Q i') :
    -- porting note: added a second `by apply`
    lift Q ⟨by apply GradedAlgebra.ι Q, by apply GradedAlgebra.ι_sq_scalar Q⟩ x' =
      DirectSum.of (fun i => evenOdd Q i) i' x' := by
  cases' x' with x' hx'
  dsimp only [Subtype.coe_mk, DirectSum.lof_eq_of]
  induction hx' using Submodule.iSup_induction' with
  | hp i x hx =>
    obtain ⟨i, rfl⟩ := i
    -- porting note: `dsimp only [Subtype.coe_mk] at hx` doesn't work, use `change` instead
    change x ∈ LinearMap.range (ι Q) ^ i at hx
    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 Q, DirectSum.of_mul_of]
      refine' DirectSum.of_eq_of_gradedMonoid_eq (Sigma.subtype_ext _ _) <;>
        

Proof state:
case mk.hp.mk.hmul.intro.refine'_2
R : Type u_1
M : Type u_2
inst✝² : CommRing R
inst✝¹ : AddCommGroup M
inst✝ : Module R M
Q : QuadraticForm R M
x' x✝ : CliffordAlgebra Q
i✝ i : ℕ
x : CliffordAlgebra Q
hx : x ∈ LinearMap.range (ι Q) ^ i
ih :
  ((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) { val := x, property := (_ : x ∈ ⨆ i_1, LinearMap.range (ι Q) ^ ↑i_1) }
w✝ : M
⊢ ↑(GradedMonoid.mk (1 + ↑i)
          (GradedMonoid.GMul.mul { val := (ι Q) w✝, property := (_ : (ι Q) w✝ ∈ evenOdd Q 1) }
            { val := x, property := (_ : x ∈ ⨆ i_1, LinearMap.range (ι Q) ^ ↑i_1) })).snd =
    ↑(GradedMonoid.mk ↑(Nat.succ i)
          { val := (ι Q) w✝ * x, property := (_ : (ι Q) w✝ * x ∈ ⨆ i_1, LinearMap.range (ι Q) ^ ↑i_1) }).snd

Next tactic:
dsimp only [GradedMonoid.mk, Subtype.coe_mk]
theorem GradedAlgebra.lift_ι_eq (i' : ZMod 2) (x' : evenOdd Q i') :
    -- porting note: added a second `by apply`
    lift Q ⟨by apply GradedAlgebra.ι Q, by apply GradedAlgebra.ι_sq_scalar Q⟩ x' =
      DirectSum.of (fun i => evenOdd Q i) i' x' := by
  cases' x' with x' hx'
  dsimp only [Subtype.coe_mk, DirectSum.lof_eq_of]
  induction hx' using Submodule.iSup_induction' with
  | hp i x hx =>
    obtain ⟨i, rfl⟩ := i
    -- porting note: `dsimp only [Subtype.coe_mk] at hx` doesn't work, use `change` instead
    change x ∈ LinearMap.range (ι Q) ^ i at hx
    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 Q, DirectSum.of_mul_of]
      refine' DirectSum.of_eq_of_gradedMonoid_eq (Sigma.subtype_ext _ _) <;>
        dsimp only [GradedMonoid.mk, Subtype.coe_mk]
      · 

Proof state:
case mk.hp.mk.hmul.intro.refine'_1
R : Type u_1
M : Type u_2
inst✝² : CommRing R
inst✝¹ : AddCommGroup M
inst✝ : Module R M
Q : QuadraticForm R M
x' x✝ : CliffordAlgebra Q
i✝ i : ℕ
x : CliffordAlgebra Q
hx : x ∈ LinearMap.range (ι Q) ^ i
ih :
  ((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) { val := x, property := (_ : x ∈ ⨆ i_1, LinearMap.range (ι Q) ^ ↑i_1) }
w✝ : M
⊢ 1 + ↑i = ↑(Nat.succ i)

Next tactic:
rw [Nat.succ_eq_add_one, add_comm, Nat.cast_add, Nat.cast_one]
theorem GradedAlgebra.lift_ι_eq (i' : ZMod 2) (x' : evenOdd Q i') :
    -- porting note: added a second `by apply`
    lift Q ⟨by apply GradedAlgebra.ι Q, by apply GradedAlgebra.ι_sq_scalar Q⟩ x' =
      DirectSum.of (fun i => evenOdd Q i) i' x' := by
  cases' x' with x' hx'
  dsimp only [Subtype.coe_mk, DirectSum.lof_eq_of]
  induction hx' using Submodule.iSup_induction' with
  | hp i x hx =>
    obtain ⟨i, rfl⟩ := i
    -- porting note: `dsimp only [Subtype.coe_mk] at hx` doesn't work, use `change` instead
    change x ∈ LinearMap.range (ι Q) ^ i at hx
    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 Q, DirectSum.of_mul_of]
      refine' DirectSum.of_eq_of_gradedMonoid_eq (Sigma.subtype_ext _ _) <;>
        dsimp only [GradedMonoid.mk, Subtype.coe_mk]
      · rw [Nat.succ_eq_add_one, add_comm, Nat.cast_add, Nat.cast_one]
      

Proof state:
case mk.hp.mk.hmul.intro.refine'_2
R : Type u_1
M : Type u_2
inst✝² : CommRing R
inst✝¹ : AddCommGroup M
inst✝ : Module R M
Q : QuadraticForm R M
x' x✝ : CliffordAlgebra Q
i✝ i : ℕ
x : CliffordAlgebra Q
hx : x ∈ LinearMap.range (ι Q) ^ i
ih :
  ((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) { val := x, property := (_ : x ∈ ⨆ i_1, LinearMap.range (ι Q) ^ ↑i_1) }
w✝ : M
⊢ ↑(GradedMonoid.GMul.mul { val := (ι Q) w✝, property := (_ : (ι Q) w✝ ∈ evenOdd Q 1) }
        { val := x, property := (_ : x ∈ ⨆ i_1, LinearMap.range (ι Q) ^ ↑i_1) }) =
    (ι Q) w✝ * x

Next tactic:
rfl
theorem GradedAlgebra.lift_ι_eq (i' : ZMod 2) (x' : evenOdd Q i') :
    -- porting note: added a second `by apply`
    lift Q ⟨by apply GradedAlgebra.ι Q, by apply GradedAlgebra.ι_sq_scalar Q⟩ x' =
      DirectSum.of (fun i => evenOdd Q i) i' x' := by
  cases' x' with x' hx'
  dsimp only [Subtype.coe_mk, DirectSum.lof_eq_of]
  induction hx' using Submodule.iSup_induction' with
  | hp i x hx =>
    obtain ⟨i, rfl⟩ := i
    -- porting note: `dsimp only [Subtype.coe_mk] at hx` doesn't work, use `change` instead
    change x ∈ LinearMap.range (ι Q) ^ i at hx
    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 Q, DirectSum.of_mul_of]
      refine' DirectSum.of_eq_of_gradedMonoid_eq (Sigma.subtype_ext _ _) <;>
        dsimp only [GradedMonoid.mk, Subtype.coe_mk]
      · rw [Nat.succ_eq_add_one, add_comm, Nat.cast_add, Nat.cast_one]
      rfl
  

Proof state:
case mk.h0
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' : CliffordAlgebra 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)) })
      0 =
    (DirectSum.of (fun i => ↥(evenOdd Q i)) i') { val := 0, property := (_ : 0 ∈ ⨆ i, LinearMap.range (ι Q) ^ ↑i) }

Next tactic:
| h0 =>
    rw [AlgHom.map_zero]
    apply Eq.symm
    apply DFinsupp.single_eq_zero.mpr; rfl
theorem GradedAlgebra.lift_ι_eq (i' : ZMod 2) (x' : evenOdd Q i') :
    -- porting note: added a second `by apply`
    lift Q ⟨by apply GradedAlgebra.ι Q, by apply GradedAlgebra.ι_sq_scalar Q⟩ x' =
      DirectSum.of (fun i => evenOdd Q i) i' x' := by
  cases' x' with x' hx'
  dsimp only [Subtype.coe_mk, DirectSum.lof_eq_of]
  induction hx' using Submodule.iSup_induction' with
  | hp i x hx =>
    obtain ⟨i, rfl⟩ := i
    -- porting note: `dsimp only [Subtype.coe_mk] at hx` doesn't work, use `change` instead
    change x ∈ LinearMap.range (ι Q) ^ i at hx
    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 Q, DirectSum.of_mul_of]
      refine' DirectSum.of_eq_of_gradedMonoid_eq (Sigma.subtype_ext _ _) <;>
        dsimp only [GradedMonoid.mk, Subtype.coe_mk]
      · rw [Nat.succ_eq_add_one, add_comm, Nat.cast_add, Nat.cast_one]
      rfl
  | h0 =>
    

Proof state:
case mk.h0
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' : CliffordAlgebra 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)) })
      0 =
    (DirectSum.of (fun i => ↥(evenOdd Q i)) i') { val := 0, property := (_ : 0 ∈ ⨆ i, LinearMap.range (ι Q) ^ ↑i) }

Next tactic:
rw [AlgHom.map_zero]
theorem GradedAlgebra.lift_ι_eq (i' : ZMod 2) (x' : evenOdd Q i') :
    -- porting note: added a second `by apply`
    lift Q ⟨by apply GradedAlgebra.ι Q, by apply GradedAlgebra.ι_sq_scalar Q⟩ x' =
      DirectSum.of (fun i => evenOdd Q i) i' x' := by
  cases' x' with x' hx'
  dsimp only [Subtype.coe_mk, DirectSum.lof_eq_of]
  induction hx' using Submodule.iSup_induction' with
  | hp i x hx =>
    obtain ⟨i, rfl⟩ := i
    -- porting note: `dsimp only [Subtype.coe_mk] at hx` doesn't work, use `change` instead
    change x ∈ LinearMap.range (ι Q) ^ i at hx
    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 Q, DirectSum.of_mul_of]
      refine' DirectSum.of_eq_of_gradedMonoid_eq (Sigma.subtype_ext _ _) <;>
        dsimp only [GradedMonoid.mk, Subtype.coe_mk]
      · rw [Nat.succ_eq_add_one, add_comm, Nat.cast_add, Nat.cast_one]
      rfl
  | h0 =>
    rw [AlgHom.map_zero]
    

Proof state:
case mk.h0
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' : CliffordAlgebra Q
⊢ 0 = (DirectSum.of (fun i => ↥(evenOdd Q i)) i') { val := 0, property := (_ : 0 ∈ ⨆ i, LinearMap.range (ι Q) ^ ↑i) }

Next tactic:
apply Eq.symm
theorem GradedAlgebra.lift_ι_eq (i' : ZMod 2) (x' : evenOdd Q i') :
    -- porting note: added a second `by apply`
    lift Q ⟨by apply GradedAlgebra.ι Q, by apply GradedAlgebra.ι_sq_scalar Q⟩ x' =
      DirectSum.of (fun i => evenOdd Q i) i' x' := by
  cases' x' with x' hx'
  dsimp only [Subtype.coe_mk, DirectSum.lof_eq_of]
  induction hx' using Submodule.iSup_induction' with
  | hp i x hx =>
    obtain ⟨i, rfl⟩ := i
    -- porting note: `dsimp only [Subtype.coe_mk] at hx` doesn't work, use `change` instead
    change x ∈ LinearMap.range (ι Q) ^ i at hx
    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 Q, DirectSum.of_mul_of]
      refine' DirectSum.of_eq_of_gradedMonoid_eq (Sigma.subtype_ext _ _) <;>
        dsimp only [GradedMonoid.mk, Subtype.coe_mk]
      · rw [Nat.succ_eq_add_one, add_comm, Nat.cast_add, Nat.cast_one]
      rfl
  | h0 =>
    rw [AlgHom.map_zero]
    apply Eq.symm
    

Proof state:
case mk.h0.h
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' : CliffordAlgebra Q
⊢ (DirectSum.of (fun i => ↥(evenOdd Q i)) i') { val := 0, property := (_ : 0 ∈ ⨆ i, LinearMap.range (ι Q) ^ ↑i) } = 0

Next tactic:
apply DFinsupp.single_eq_zero.mpr
theorem GradedAlgebra.lift_ι_eq (i' : ZMod 2) (x' : evenOdd Q i') :
    -- porting note: added a second `by apply`
    lift Q ⟨by apply GradedAlgebra.ι Q, by apply GradedAlgebra.ι_sq_scalar Q⟩ x' =
      DirectSum.of (fun i => evenOdd Q i) i' x' := by
  cases' x' with x' hx'
  dsimp only [Subtype.coe_mk, DirectSum.lof_eq_of]
  induction hx' using Submodule.iSup_induction' with
  | hp i x hx =>
    obtain ⟨i, rfl⟩ := i
    -- porting note: `dsimp only [Subtype.coe_mk] at hx` doesn't work, use `change` instead
    change x ∈ LinearMap.range (ι Q) ^ i at hx
    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 Q, DirectSum.of_mul_of]
      refine' DirectSum.of_eq_of_gradedMonoid_eq (Sigma.subtype_ext _ _) <;>
        dsimp only [GradedMonoid.mk, Subtype.coe_mk]
      · rw [Nat.succ_eq_add_one, add_comm, Nat.cast_add, Nat.cast_one]
      rfl
  | h0 =>
    rw [AlgHom.map_zero]
    apply Eq.symm
    apply DFinsupp.single_eq_zero.mpr; 

Proof state:
case mk.h0.h
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' : CliffordAlgebra Q
⊢ { val := 0, property := (_ : 0 ∈ ⨆ i, LinearMap.range (ι Q) ^ ↑i) } = 0

Next tactic:
rfl
theorem GradedAlgebra.lift_ι_eq (i' : ZMod 2) (x' : evenOdd Q i') :
    -- porting note: added a second `by apply`
    lift Q ⟨by apply GradedAlgebra.ι Q, by apply GradedAlgebra.ι_sq_scalar Q⟩ x' =
      DirectSum.of (fun i => evenOdd Q i) i' x' := by
  cases' x' with x' hx'
  dsimp only [Subtype.coe_mk, DirectSum.lof_eq_of]
  induction hx' using Submodule.iSup_induction' with
  | hp i x hx =>
    obtain ⟨i, rfl⟩ := i
    -- porting note: `dsimp only [Subtype.coe_mk] at hx` doesn't work, use `change` instead
    change x ∈ LinearMap.range (ι Q) ^ i at hx
    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 Q, DirectSum.of_mul_of]
      refine' DirectSum.of_eq_of_gradedMonoid_eq (Sigma.subtype_ext _ _) <;>
        dsimp only [GradedMonoid.mk, Subtype.coe_mk]
      · rw [Nat.succ_eq_add_one, add_comm, Nat.cast_add, Nat.cast_one]
      rfl
  | h0 =>
    rw [AlgHom.map_zero]
    apply Eq.symm
    apply DFinsupp.single_eq_zero.mpr; rfl
  

Proof state:
case mk.hadd
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' x y : CliffordAlgebra Q
hx : x ∈ ⨆ i, LinearMap.range (ι Q) ^ ↑i
hy : y ∈ ⨆ i, LinearMap.range (ι Q) ^ ↑i
ihx :
  ((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') { val := x, property := hx }
ihy :
  ((lift Q)
        { val := GradedAlgebra.ι Q,
          property :=
            (_ :
              ∀ (m : M),
                (GradedAlgebra.ι Q) m * (GradedAlgebra.ι Q) m =
                  (algebraMap R (⨁ (i : ZMod 2), ↥(evenOdd Q i))) (Q m)) })
      y =
    (DirectSum.of (fun i => ↥(evenOdd Q i)) i') { val := y, property := hy }
⊢ ((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 + y) =
    (DirectSum.of (fun i => ↥(evenOdd Q i)) i')
      { val := x + y, property := (_ : x + y ∈ ⨆ i, LinearMap.range (ι Q) ^ ↑i) }

Next tactic:
| hadd x y hx hy ihx ihy =>
    rw [AlgHom.map_add, ihx, ihy, ← map_add]; rfl
theorem GradedAlgebra.lift_ι_eq (i' : ZMod 2) (x' : evenOdd Q i') :
    -- porting note: added a second `by apply`
    lift Q ⟨by apply GradedAlgebra.ι Q, by apply GradedAlgebra.ι_sq_scalar Q⟩ x' =
      DirectSum.of (fun i => evenOdd Q i) i' x' := by
  cases' x' with x' hx'
  dsimp only [Subtype.coe_mk, DirectSum.lof_eq_of]
  induction hx' using Submodule.iSup_induction' with
  | hp i x hx =>
    obtain ⟨i, rfl⟩ := i
    -- porting note: `dsimp only [Subtype.coe_mk] at hx` doesn't work, use `change` instead
    change x ∈ LinearMap.range (ι Q) ^ i at hx
    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 Q, DirectSum.of_mul_of]
      refine' DirectSum.of_eq_of_gradedMonoid_eq (Sigma.subtype_ext _ _) <;>
        dsimp only [GradedMonoid.mk, Subtype.coe_mk]
      · rw [Nat.succ_eq_add_one, add_comm, Nat.cast_add, Nat.cast_one]
      rfl
  | h0 =>
    rw [AlgHom.map_zero]
    apply Eq.symm
    apply DFinsupp.single_eq_zero.mpr; rfl
  | hadd x y hx hy ihx ihy =>
    

Proof state:
case mk.hadd
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' x y : CliffordAlgebra Q
hx : x ∈ ⨆ i, LinearMap.range (ι Q) ^ ↑i
hy : y ∈ ⨆ i, LinearMap.range (ι Q) ^ ↑i
ihx :
  ((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') { val := x, property := hx }
ihy :
  ((lift Q)
        { val := GradedAlgebra.ι Q,
          property :=
            (_ :
              ∀ (m : M),
                (GradedAlgebra.ι Q) m * (GradedAlgebra.ι Q) m =
                  (algebraMap R (⨁ (i : ZMod 2), ↥(evenOdd Q i))) (Q m)) })
      y =
    (DirectSum.of (fun i => ↥(evenOdd Q i)) i') { val := y, property := hy }
⊢ ((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 + y) =
    (DirectSum.of (fun i => ↥(evenOdd Q i)) i')
      { val := x + y, property := (_ : x + y ∈ ⨆ i, LinearMap.range (ι Q) ^ ↑i) }

Next tactic:
rw [AlgHom.map_add, ihx, ihy, ← map_add]
theorem GradedAlgebra.lift_ι_eq (i' : ZMod 2) (x' : evenOdd Q i') :
    -- porting note: added a second `by apply`
    lift Q ⟨by apply GradedAlgebra.ι Q, by apply GradedAlgebra.ι_sq_scalar Q⟩ x' =
      DirectSum.of (fun i => evenOdd Q i) i' x' := by
  cases' x' with x' hx'
  dsimp only [Subtype.coe_mk, DirectSum.lof_eq_of]
  induction hx' using Submodule.iSup_induction' with
  | hp i x hx =>
    obtain ⟨i, rfl⟩ := i
    -- porting note: `dsimp only [Subtype.coe_mk] at hx` doesn't work, use `change` instead
    change x ∈ LinearMap.range (ι Q) ^ i at hx
    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 Q, DirectSum.of_mul_of]
      refine' DirectSum.of_eq_of_gradedMonoid_eq (Sigma.subtype_ext _ _) <;>
        dsimp only [GradedMonoid.mk, Subtype.coe_mk]
      · rw [Nat.succ_eq_add_one, add_comm, Nat.cast_add, Nat.cast_one]
      rfl
  | h0 =>
    rw [AlgHom.map_zero]
    apply Eq.symm
    apply DFinsupp.single_eq_zero.mpr; rfl
  | hadd x y hx hy ihx ihy =>
    rw [AlgHom.map_add, ihx, ihy, ← map_add]; 

Proof state:
case mk.hadd
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' x y : CliffordAlgebra Q
hx : x ∈ ⨆ i, LinearMap.range (ι Q) ^ ↑i
hy : y ∈ ⨆ i, LinearMap.range (ι Q) ^ ↑i
ihx :
  ((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') { val := x, property := hx }
ihy :
  ((lift Q)
        { val := GradedAlgebra.ι Q,
          property :=
            (_ :
              ∀ (m : M),
                (GradedAlgebra.ι Q) m * (GradedAlgebra.ι Q) m =
                  (algebraMap R (⨁ (i : ZMod 2), ↥(evenOdd Q i))) (Q m)) })
      y =
    (DirectSum.of (fun i => ↥(evenOdd Q i)) i') { val := y, property := hy }
⊢ (DirectSum.of (fun i => ↥(evenOdd Q i)) i') ({ val := x, property := hx } + { val := y, property := hy }) =
    (DirectSum.of (fun i => ↥(evenOdd Q i)) i')
      { val := x + y, property := (_ : x + y ∈ ⨆ i, LinearMap.range (ι Q) ^ ↑i) }

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

Proof state:
R : Type u_1
M : Type u_2
inst✝² : CommRing R
inst✝¹ : AddCommGroup M
inst✝ : Module R M
Q : QuadraticForm R M
⊢ M →ₗ[R] ⨁ (i : ZMod 2), ↥(evenOdd Q i)

Next tactic:
apply GradedAlgebra.ι Q
/-- 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 

Proof state:
R : Type u_1
M : Type u_2
inst✝² : CommRing R
inst✝¹ : AddCommGroup M
inst✝ : Module R M
Q : QuadraticForm R M
⊢ ∀ (m : M), (GradedAlgebra.ι Q) m * (GradedAlgebra.ι Q) m = (algebraMap R (⨁ (i : ZMod 2), ↥(evenOdd Q i))) (Q m)

Next tactic:
apply GradedAlgebra.ι_sq_scalar Q
/-- 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
      

Proof state:
R : Type u_1
M : Type u_2
inst✝² : CommRing R
inst✝¹ : AddCommGroup M
inst✝ : Module R M
Q : QuadraticForm R M
⊢ 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)) }) =
    AlgHom.id R (CliffordAlgebra Q)

Next tactic:
ext m