l3lab/ntp-mathlib huggingface dataset:
/-- Contract an element of the clifford algebra with an element `d : Module.Dual R M` from the left.

Note that $v ⌋ x$ is spelt `contractLeft (Q.associated v) x`.

This includes [grinberg_clifford_2016][] Theorem 10.75 -/
def contractLeft : Module.Dual R M →ₗ[R] CliffordAlgebra Q →ₗ[R] CliffordAlgebra Q where
  toFun d := foldr' Q (contractLeftAux Q d) (contractLeftAux_contractLeftAux Q d) 0
  map_add' d₁ d₂ :=
    LinearMap.ext fun x => by
      dsimp only
      rw [LinearMap.add_apply]
      

Proof state:
R : Type u1
inst✝² : CommRing R
M : Type u2
inst✝¹ : AddCommGroup M
inst✝ : Module R M
Q : QuadraticForm R M
d d' d₁ d₂ : Module.Dual R M
x : CliffordAlgebra Q
⊢ (foldr' Q (contractLeftAux Q (d₁ + d₂))
        (_ :
          ∀ (v : M) (x fx : CliffordAlgebra Q),
            ((contractLeftAux Q (d₁ + d₂)) v) ((ι Q) v * x, ((contractLeftAux Q (d₁ + d₂)) v) (x, fx)) = Q v • fx)
        0)
      x =
    (foldr' Q (contractLeftAux Q d₁)
          (_ :
            ∀ (v : M) (x fx : CliffordAlgebra Q),
              ((contractLeftAux Q d₁) v) ((ι Q) v * x, ((contractLeftAux Q d₁) v) (x, fx)) = Q v • fx)
          0)
        x +
      (foldr' Q (contractLeftAux Q d₂)
          (_ :
            ∀ (v : M) (x fx : CliffordAlgebra Q),
              ((contractLeftAux Q d₂) v) ((ι Q) v * x, ((contractLeftAux Q d₂) v) (x, fx)) = Q v • fx)
          0)
        x

Next tactic:
induction' x using CliffordAlgebra.left_induction with r x y hx hy m x hx
/-- Contract an element of the clifford algebra with an element `d : Module.Dual R M` from the left.

Note that $v ⌋ x$ is spelt `contractLeft (Q.associated v) x`.

This includes [grinberg_clifford_2016][] Theorem 10.75 -/
def contractLeft : Module.Dual R M →ₗ[R] CliffordAlgebra Q →ₗ[R] CliffordAlgebra Q where
  toFun d := foldr' Q (contractLeftAux Q d) (contractLeftAux_contractLeftAux Q d) 0
  map_add' d₁ d₂ :=
    LinearMap.ext fun x => by
      dsimp only
      rw [LinearMap.add_apply]
      induction' x using CliffordAlgebra.left_induction with r x y hx hy m x hx
      · 

Proof state:
case hr
R : Type u1
inst✝² : CommRing R
M : Type u2
inst✝¹ : AddCommGroup M
inst✝ : Module R M
Q : QuadraticForm R M
d d' d₁ d₂ : Module.Dual R M
r : R
⊢ (foldr' Q (contractLeftAux Q (d₁ + d₂))
        (_ :
          ∀ (v : M) (x fx : CliffordAlgebra Q),
            ((contractLeftAux Q (d₁ + d₂)) v) ((ι Q) v * x, ((contractLeftAux Q (d₁ + d₂)) v) (x, fx)) = Q v • fx)
        0)
      ((algebraMap R (CliffordAlgebra Q)) r) =
    (foldr' Q (contractLeftAux Q d₁)
          (_ :
            ∀ (v : M) (x fx : CliffordAlgebra Q),
              ((contractLeftAux Q d₁) v) ((ι Q) v * x, ((contractLeftAux Q d₁) v) (x, fx)) = Q v • fx)
          0)
        ((algebraMap R (CliffordAlgebra Q)) r) +
      (foldr' Q (contractLeftAux Q d₂)
          (_ :
            ∀ (v : M) (x fx : CliffordAlgebra Q),
              ((contractLeftAux Q d₂) v) ((ι Q) v * x, ((contractLeftAux Q d₂) v) (x, fx)) = Q v • fx)
          0)
        ((algebraMap R (CliffordAlgebra Q)) r)

Next tactic:
simp_rw [foldr'_algebraMap, smul_zero, zero_add]
/-- Contract an element of the clifford algebra with an element `d : Module.Dual R M` from the left.

Note that $v ⌋ x$ is spelt `contractLeft (Q.associated v) x`.

This includes [grinberg_clifford_2016][] Theorem 10.75 -/
def contractLeft : Module.Dual R M →ₗ[R] CliffordAlgebra Q →ₗ[R] CliffordAlgebra Q where
  toFun d := foldr' Q (contractLeftAux Q d) (contractLeftAux_contractLeftAux Q d) 0
  map_add' d₁ d₂ :=
    LinearMap.ext fun x => by
      dsimp only
      rw [LinearMap.add_apply]
      induction' x using CliffordAlgebra.left_induction with r x y hx hy m x hx
      · simp_rw [foldr'_algebraMap, smul_zero, zero_add]
      · 

Proof state:
case h_add
R : Type u1
inst✝² : CommRing R
M : Type u2
inst✝¹ : AddCommGroup M
inst✝ : Module R M
Q : QuadraticForm R M
d d' d₁ d₂ : Module.Dual R M
x y : CliffordAlgebra Q
hx :
  (foldr' Q (contractLeftAux Q (d₁ + d₂))
        (_ :
          ∀ (v : M) (x fx : CliffordAlgebra Q),
            ((contractLeftAux Q (d₁ + d₂)) v) ((ι Q) v * x, ((contractLeftAux Q (d₁ + d₂)) v) (x, fx)) = Q v • fx)
        0)
      x =
    (foldr' Q (contractLeftAux Q d₁)
          (_ :
            ∀ (v : M) (x fx : CliffordAlgebra Q),
              ((contractLeftAux Q d₁) v) ((ι Q) v * x, ((contractLeftAux Q d₁) v) (x, fx)) = Q v • fx)
          0)
        x +
      (foldr' Q (contractLeftAux Q d₂)
          (_ :
            ∀ (v : M) (x fx : CliffordAlgebra Q),
              ((contractLeftAux Q d₂) v) ((ι Q) v * x, ((contractLeftAux Q d₂) v) (x, fx)) = Q v • fx)
          0)
        x
hy :
  (foldr' Q (contractLeftAux Q (d₁ + d₂))
        (_ :
          ∀ (v : M) (x fx : CliffordAlgebra Q),
            ((contractLeftAux Q (d₁ + d₂)) v) ((ι Q) v * x, ((contractLeftAux Q (d₁ + d₂)) v) (x, fx)) = Q v • fx)
        0)
      y =
    (foldr' Q (contractLeftAux Q d₁)
          (_ :
            ∀ (v : M) (x fx : CliffordAlgebra Q),
              ((contractLeftAux Q d₁) v) ((ι Q) v * x, ((contractLeftAux Q d₁) v) (x, fx)) = Q v • fx)
          0)
        y +
      (foldr' Q (contractLeftAux Q d₂)
          (_ :
            ∀ (v : M) (x fx : CliffordAlgebra Q),
              ((contractLeftAux Q d₂) v) ((ι Q) v * x, ((contractLeftAux Q d₂) v) (x, fx)) = Q v • fx)
          0)
        y
⊢ (foldr' Q (contractLeftAux Q (d₁ + d₂))
        (_ :
          ∀ (v : M) (x fx : CliffordAlgebra Q),
            ((contractLeftAux Q (d₁ + d₂)) v) ((ι Q) v * x, ((contractLeftAux Q (d₁ + d₂)) v) (x, fx)) = Q v • fx)
        0)
      (x + y) =
    (foldr' Q (contractLeftAux Q d₁)
          (_ :
            ∀ (v : M) (x fx : CliffordAlgebra Q),
              ((contractLeftAux Q d₁) v) ((ι Q) v * x, ((contractLeftAux Q d₁) v) (x, fx)) = Q v • fx)
          0)
        (x + y) +
      (foldr' Q (contractLeftAux Q d₂)
          (_ :
            ∀ (v : M) (x fx : CliffordAlgebra Q),
              ((contractLeftAux Q d₂) v) ((ι Q) v * x, ((contractLeftAux Q d₂) v) (x, fx)) = Q v • fx)
          0)
        (x + y)

Next tactic:
rw [map_add, map_add, map_add, add_add_add_comm, hx, hy]
/-- Contract an element of the clifford algebra with an element `d : Module.Dual R M` from the left.

Note that $v ⌋ x$ is spelt `contractLeft (Q.associated v) x`.

This includes [grinberg_clifford_2016][] Theorem 10.75 -/
def contractLeft : Module.Dual R M →ₗ[R] CliffordAlgebra Q →ₗ[R] CliffordAlgebra Q where
  toFun d := foldr' Q (contractLeftAux Q d) (contractLeftAux_contractLeftAux Q d) 0
  map_add' d₁ d₂ :=
    LinearMap.ext fun x => by
      dsimp only
      rw [LinearMap.add_apply]
      induction' x using CliffordAlgebra.left_induction with r x y hx hy m x hx
      · simp_rw [foldr'_algebraMap, smul_zero, zero_add]
      · rw [map_add, map_add, map_add, add_add_add_comm, hx, hy]
      · 

Proof state:
case h_mul_ι
R : Type u1
inst✝² : CommRing R
M : Type u2
inst✝¹ : AddCommGroup M
inst✝ : Module R M
Q : QuadraticForm R M
d d' d₁ d₂ : Module.Dual R M
m : CliffordAlgebra Q
x : M
hx :
  (foldr' Q (contractLeftAux Q (d₁ + d₂))
        (_ :
          ∀ (v : M) (x fx : CliffordAlgebra Q),
            ((contractLeftAux Q (d₁ + d₂)) v) ((ι Q) v * x, ((contractLeftAux Q (d₁ + d₂)) v) (x, fx)) = Q v • fx)
        0)
      m =
    (foldr' Q (contractLeftAux Q d₁)
          (_ :
            ∀ (v : M) (x fx : CliffordAlgebra Q),
              ((contractLeftAux Q d₁) v) ((ι Q) v * x, ((contractLeftAux Q d₁) v) (x, fx)) = Q v • fx)
          0)
        m +
      (foldr' Q (contractLeftAux Q d₂)
          (_ :
            ∀ (v : M) (x fx : CliffordAlgebra Q),
              ((contractLeftAux Q d₂) v) ((ι Q) v * x, ((contractLeftAux Q d₂) v) (x, fx)) = Q v • fx)
          0)
        m
⊢ (foldr' Q (contractLeftAux Q (d₁ + d₂))
        (_ :
          ∀ (v : M) (x fx : CliffordAlgebra Q),
            ((contractLeftAux Q (d₁ + d₂)) v) ((ι Q) v * x, ((contractLeftAux Q (d₁ + d₂)) v) (x, fx)) = Q v • fx)
        0)
      ((ι Q) x * m) =
    (foldr' Q (contractLeftAux Q d₁)
          (_ :
            ∀ (v : M) (x fx : CliffordAlgebra Q),
              ((contractLeftAux Q d₁) v) ((ι Q) v * x, ((contractLeftAux Q d₁) v) (x, fx)) = Q v • fx)
          0)
        ((ι Q) x * m) +
      (foldr' Q (contractLeftAux Q d₂)
          (_ :
            ∀ (v : M) (x fx : CliffordAlgebra Q),
              ((contractLeftAux Q d₂) v) ((ι Q) v * x, ((contractLeftAux Q d₂) v) (x, fx)) = Q v • fx)
          0)
        ((ι Q) x * m)

Next tactic:
rw [foldr'_ι_mul, foldr'_ι_mul, foldr'_ι_mul, hx]
/-- Contract an element of the clifford algebra with an element `d : Module.Dual R M` from the left.

Note that $v ⌋ x$ is spelt `contractLeft (Q.associated v) x`.

This includes [grinberg_clifford_2016][] Theorem 10.75 -/
def contractLeft : Module.Dual R M →ₗ[R] CliffordAlgebra Q →ₗ[R] CliffordAlgebra Q where
  toFun d := foldr' Q (contractLeftAux Q d) (contractLeftAux_contractLeftAux Q d) 0
  map_add' d₁ d₂ :=
    LinearMap.ext fun x => by
      dsimp only
      rw [LinearMap.add_apply]
      induction' x using CliffordAlgebra.left_induction with r x y hx hy m x hx
      · simp_rw [foldr'_algebraMap, smul_zero, zero_add]
      · rw [map_add, map_add, map_add, add_add_add_comm, hx, hy]
      · rw [foldr'_ι_mul, foldr'_ι_mul, foldr'_ι_mul, hx]
        

Proof state:
case h_mul_ι
R : Type u1
inst✝² : CommRing R
M : Type u2
inst✝¹ : AddCommGroup M
inst✝ : Module R M
Q : QuadraticForm R M
d d' d₁ d₂ : Module.Dual R M
m : CliffordAlgebra Q
x : M
hx :
  (foldr' Q (contractLeftAux Q (d₁ + d₂))
        (_ :
          ∀ (v : M) (x fx : CliffordAlgebra Q),
            ((contractLeftAux Q (d₁ + d₂)) v) ((ι Q) v * x, ((contractLeftAux Q (d₁ + d₂)) v) (x, fx)) = Q v • fx)
        0)
      m =
    (foldr' Q (contractLeftAux Q d₁)
          (_ :
            ∀ (v : M) (x fx : CliffordAlgebra Q),
              ((contractLeftAux Q d₁) v) ((ι Q) v * x, ((contractLeftAux Q d₁) v) (x, fx)) = Q v • fx)
          0)
        m +
      (foldr' Q (contractLeftAux Q d₂)
          (_ :
            ∀ (v : M) (x fx : CliffordAlgebra Q),
              ((contractLeftAux Q d₂) v) ((ι Q) v * x, ((contractLeftAux Q d₂) v) (x, fx)) = Q v • fx)
          0)
        m
⊢ ((contractLeftAux Q (d₁ + d₂)) x)
      (m,
        (foldr' Q (contractLeftAux Q d₁)
              (_ :
                ∀ (v : M) (x fx : CliffordAlgebra Q),
                  ((contractLeftAux Q d₁) v) ((ι Q) v * x, ((contractLeftAux Q d₁) v) (x, fx)) = Q v • fx)
              0)
            m +
          (foldr' Q (contractLeftAux Q d₂)
              (_ :
                ∀ (v : M) (x fx : CliffordAlgebra Q),
                  ((contractLeftAux Q d₂) v) ((ι Q) v * x, ((contractLeftAux Q d₂) v) (x, fx)) = Q v • fx)
              0)
            m) =
    ((contractLeftAux Q d₁) x)
        (m,
          (foldr' Q (contractLeftAux Q d₁)
              (_ :
                ∀ (v : M) (x fx : CliffordAlgebra Q),
                  ((contractLeftAux Q d₁) v) ((ι Q) v * x, ((contractLeftAux Q d₁) v) (x, fx)) = Q v • fx)
              0)
            m) +
      ((contractLeftAux Q d₂) x)
        (m,
          (foldr' Q (contractLeftAux Q d₂)
              (_ :
                ∀ (v : M) (x fx : CliffordAlgebra Q),
                  ((contractLeftAux Q d₂) v) ((ι Q) v * x, ((contractLeftAux Q d₂) v) (x, fx)) = Q v • fx)
              0)
            m)

Next tactic:
dsimp only [contractLeftAux_apply_apply]
/-- Contract an element of the clifford algebra with an element `d : Module.Dual R M` from the left.

Note that $v ⌋ x$ is spelt `contractLeft (Q.associated v) x`.

This includes [grinberg_clifford_2016][] Theorem 10.75 -/
def contractLeft : Module.Dual R M →ₗ[R] CliffordAlgebra Q →ₗ[R] CliffordAlgebra Q where
  toFun d := foldr' Q (contractLeftAux Q d) (contractLeftAux_contractLeftAux Q d) 0
  map_add' d₁ d₂ :=
    LinearMap.ext fun x => by
      dsimp only
      rw [LinearMap.add_apply]
      induction' x using CliffordAlgebra.left_induction with r x y hx hy m x hx
      · simp_rw [foldr'_algebraMap, smul_zero, zero_add]
      · rw [map_add, map_add, map_add, add_add_add_comm, hx, hy]
      · rw [foldr'_ι_mul, foldr'_ι_mul, foldr'_ι_mul, hx]
        dsimp only [contractLeftAux_apply_apply]
        

Proof state:
case h_mul_ι
R : Type u1
inst✝² : CommRing R
M : Type u2
inst✝¹ : AddCommGroup M
inst✝ : Module R M
Q : QuadraticForm R M
d d' d₁ d₂ : Module.Dual R M
m : CliffordAlgebra Q
x : M
hx :
  (foldr' Q (contractLeftAux Q (d₁ + d₂))
        (_ :
          ∀ (v : M) (x fx : CliffordAlgebra Q),
            ((contractLeftAux Q (d₁ + d₂)) v) ((ι Q) v * x, ((contractLeftAux Q (d₁ + d₂)) v) (x, fx)) = Q v • fx)
        0)
      m =
    (foldr' Q (contractLeftAux Q d₁)
          (_ :
            ∀ (v : M) (x fx : CliffordAlgebra Q),
              ((contractLeftAux Q d₁) v) ((ι Q) v * x, ((contractLeftAux Q d₁) v) (x, fx)) = Q v • fx)
          0)
        m +
      (foldr' Q (contractLeftAux Q d₂)
          (_ :
            ∀ (v : M) (x fx : CliffordAlgebra Q),
              ((contractLeftAux Q d₂) v) ((ι Q) v * x, ((contractLeftAux Q d₂) v) (x, fx)) = Q v • fx)
          0)
        m
⊢ (d₁ + d₂) x • m -
      (ι Q) x *
        ((foldr' Q (contractLeftAux Q d₁)
              (_ :
                ∀ (v : M) (x fx : CliffordAlgebra Q),
                  ((contractLeftAux Q d₁) v) ((ι Q) v * x, ((contractLeftAux Q d₁) v) (x, fx)) = Q v • fx)
              0)
            m +
          (foldr' Q (contractLeftAux Q d₂)
              (_ :
                ∀ (v : M) (x fx : CliffordAlgebra Q),
                  ((contractLeftAux Q d₂) v) ((ι Q) v * x, ((contractLeftAux Q d₂) v) (x, fx)) = Q v • fx)
              0)
            m) =
    d₁ x • m -
        (ι Q) x *
          (foldr' Q (contractLeftAux Q d₁)
              (_ :
                ∀ (v : M) (x fx : CliffordAlgebra Q),
                  ((contractLeftAux Q d₁) v) ((ι Q) v * x, ((contractLeftAux Q d₁) v) (x, fx)) = Q v • fx)
              0)
            m +
      (d₂ x • m -
        (ι Q) x *
          (foldr' Q (contractLeftAux Q d₂)
              (_ :
                ∀ (v : M) (x fx : CliffordAlgebra Q),
                  ((contractLeftAux Q d₂) v) ((ι Q) v * x, ((contractLeftAux Q d₂) v) (x, fx)) = Q v • fx)
              0)
            m)

Next tactic:
rw [sub_add_sub_comm, mul_add, LinearMap.add_apply, add_smul]
/-- Contract an element of the clifford algebra with an element `d : Module.Dual R M` from the left.

Note that $v ⌋ x$ is spelt `contractLeft (Q.associated v) x`.

This includes [grinberg_clifford_2016][] Theorem 10.75 -/
def contractLeft : Module.Dual R M →ₗ[R] CliffordAlgebra Q →ₗ[R] CliffordAlgebra Q where
  toFun d := foldr' Q (contractLeftAux Q d) (contractLeftAux_contractLeftAux Q d) 0
  map_add' d₁ d₂ :=
    LinearMap.ext fun x => by
      dsimp only
      rw [LinearMap.add_apply]
      induction' x using CliffordAlgebra.left_induction with r x y hx hy m x hx
      · simp_rw [foldr'_algebraMap, smul_zero, zero_add]
      · rw [map_add, map_add, map_add, add_add_add_comm, hx, hy]
      · rw [foldr'_ι_mul, foldr'_ι_mul, foldr'_ι_mul, hx]
        dsimp only [contractLeftAux_apply_apply]
        rw [sub_add_sub_comm, mul_add, LinearMap.add_apply, add_smul]
  map_smul' c d :=
    LinearMap.ext fun x => by
      dsimp only
      

Proof state:
R : Type u1
inst✝² : CommRing R
M : Type u2
inst✝¹ : AddCommGroup M
inst✝ : Module R M
Q : QuadraticForm R M
d✝ d' : Module.Dual R M
c : R
d : Module.Dual R M
x : CliffordAlgebra Q
⊢ (foldr' Q (contractLeftAux Q (c • d))
        (_ :
          ∀ (v : M) (x fx : CliffordAlgebra Q),
            ((contractLeftAux Q (c • d)) v) ((ι Q) v * x, ((contractLeftAux Q (c • d)) v) (x, fx)) = Q v • fx)
        0)
      x =
    ((RingHom.id R) c •
        foldr' Q (contractLeftAux Q d)
          (_ :
            ∀ (v : M) (x fx : CliffordAlgebra Q),
              ((contractLeftAux Q d) v) ((ι Q) v * x, ((contractLeftAux Q d) v) (x, fx)) = Q v • fx)
          0)
      x

Next tactic:
rw [LinearMap.smul_apply, RingHom.id_apply]
/-- Contract an element of the clifford algebra with an element `d : Module.Dual R M` from the left.

Note that $v ⌋ x$ is spelt `contractLeft (Q.associated v) x`.

This includes [grinberg_clifford_2016][] Theorem 10.75 -/
def contractLeft : Module.Dual R M →ₗ[R] CliffordAlgebra Q →ₗ[R] CliffordAlgebra Q where
  toFun d := foldr' Q (contractLeftAux Q d) (contractLeftAux_contractLeftAux Q d) 0
  map_add' d₁ d₂ :=
    LinearMap.ext fun x => by
      dsimp only
      rw [LinearMap.add_apply]
      induction' x using CliffordAlgebra.left_induction with r x y hx hy m x hx
      · simp_rw [foldr'_algebraMap, smul_zero, zero_add]
      · rw [map_add, map_add, map_add, add_add_add_comm, hx, hy]
      · rw [foldr'_ι_mul, foldr'_ι_mul, foldr'_ι_mul, hx]
        dsimp only [contractLeftAux_apply_apply]
        rw [sub_add_sub_comm, mul_add, LinearMap.add_apply, add_smul]
  map_smul' c d :=
    LinearMap.ext fun x => by
      dsimp only
      rw [LinearMap.smul_apply, RingHom.id_apply]
      

Proof state:
R : Type u1
inst✝² : CommRing R
M : Type u2
inst✝¹ : AddCommGroup M
inst✝ : Module R M
Q : QuadraticForm R M
d✝ d' : Module.Dual R M
c : R
d : Module.Dual R M
x : CliffordAlgebra Q
⊢ (foldr' Q (contractLeftAux Q (c • d))
        (_ :
          ∀ (v : M) (x fx : CliffordAlgebra Q),
            ((contractLeftAux Q (c • d)) v) ((ι Q) v * x, ((contractLeftAux Q (c • d)) v) (x, fx)) = Q v • fx)
        0)
      x =
    c •
      (foldr' Q (contractLeftAux Q d)
          (_ :
            ∀ (v : M) (x fx : CliffordAlgebra Q),
              ((contractLeftAux Q d) v) ((ι Q) v * x, ((contractLeftAux Q d) v) (x, fx)) = Q v • fx)
          0)
        x

Next tactic:
induction' x using CliffordAlgebra.left_induction with r x y hx hy m x hx
/-- Contract an element of the clifford algebra with an element `d : Module.Dual R M` from the left.

Note that $v ⌋ x$ is spelt `contractLeft (Q.associated v) x`.

This includes [grinberg_clifford_2016][] Theorem 10.75 -/
def contractLeft : Module.Dual R M →ₗ[R] CliffordAlgebra Q →ₗ[R] CliffordAlgebra Q where
  toFun d := foldr' Q (contractLeftAux Q d) (contractLeftAux_contractLeftAux Q d) 0
  map_add' d₁ d₂ :=
    LinearMap.ext fun x => by
      dsimp only
      rw [LinearMap.add_apply]
      induction' x using CliffordAlgebra.left_induction with r x y hx hy m x hx
      · simp_rw [foldr'_algebraMap, smul_zero, zero_add]
      · rw [map_add, map_add, map_add, add_add_add_comm, hx, hy]
      · rw [foldr'_ι_mul, foldr'_ι_mul, foldr'_ι_mul, hx]
        dsimp only [contractLeftAux_apply_apply]
        rw [sub_add_sub_comm, mul_add, LinearMap.add_apply, add_smul]
  map_smul' c d :=
    LinearMap.ext fun x => by
      dsimp only
      rw [LinearMap.smul_apply, RingHom.id_apply]
      induction' x using CliffordAlgebra.left_induction with r x y hx hy m x hx
      · 

Proof state:
case hr
R : Type u1
inst✝² : CommRing R
M : Type u2
inst✝¹ : AddCommGroup M
inst✝ : Module R M
Q : QuadraticForm R M
d✝ d' : Module.Dual R M
c : R
d : Module.Dual R M
r : R
⊢ (foldr' Q (contractLeftAux Q (c • d))
        (_ :
          ∀ (v : M) (x fx : CliffordAlgebra Q),
            ((contractLeftAux Q (c • d)) v) ((ι Q) v * x, ((contractLeftAux Q (c • d)) v) (x, fx)) = Q v • fx)
        0)
      ((algebraMap R (CliffordAlgebra Q)) r) =
    c •
      (foldr' Q (contractLeftAux Q d)
          (_ :
            ∀ (v : M) (x fx : CliffordAlgebra Q),
              ((contractLeftAux Q d) v) ((ι Q) v * x, ((contractLeftAux Q d) v) (x, fx)) = Q v • fx)
          0)
        ((algebraMap R (CliffordAlgebra Q)) r)

Next tactic:
simp_rw [foldr'_algebraMap, smul_zero]
/-- Contract an element of the clifford algebra with an element `d : Module.Dual R M` from the left.

Note that $v ⌋ x$ is spelt `contractLeft (Q.associated v) x`.

This includes [grinberg_clifford_2016][] Theorem 10.75 -/
def contractLeft : Module.Dual R M →ₗ[R] CliffordAlgebra Q →ₗ[R] CliffordAlgebra Q where
  toFun d := foldr' Q (contractLeftAux Q d) (contractLeftAux_contractLeftAux Q d) 0
  map_add' d₁ d₂ :=
    LinearMap.ext fun x => by
      dsimp only
      rw [LinearMap.add_apply]
      induction' x using CliffordAlgebra.left_induction with r x y hx hy m x hx
      · simp_rw [foldr'_algebraMap, smul_zero, zero_add]
      · rw [map_add, map_add, map_add, add_add_add_comm, hx, hy]
      · rw [foldr'_ι_mul, foldr'_ι_mul, foldr'_ι_mul, hx]
        dsimp only [contractLeftAux_apply_apply]
        rw [sub_add_sub_comm, mul_add, LinearMap.add_apply, add_smul]
  map_smul' c d :=
    LinearMap.ext fun x => by
      dsimp only
      rw [LinearMap.smul_apply, RingHom.id_apply]
      induction' x using CliffordAlgebra.left_induction with r x y hx hy m x hx
      · simp_rw [foldr'_algebraMap, smul_zero]
      · 

Proof state:
case h_add
R : Type u1
inst✝² : CommRing R
M : Type u2
inst✝¹ : AddCommGroup M
inst✝ : Module R M
Q : QuadraticForm R M
d✝ d' : Module.Dual R M
c : R
d : Module.Dual R M
x y : CliffordAlgebra Q
hx :
  (foldr' Q (contractLeftAux Q (c • d))
        (_ :
          ∀ (v : M) (x fx : CliffordAlgebra Q),
            ((contractLeftAux Q (c • d)) v) ((ι Q) v * x, ((contractLeftAux Q (c • d)) v) (x, fx)) = Q v • fx)
        0)
      x =
    c •
      (foldr' Q (contractLeftAux Q d)
          (_ :
            ∀ (v : M) (x fx : CliffordAlgebra Q),
              ((contractLeftAux Q d) v) ((ι Q) v * x, ((contractLeftAux Q d) v) (x, fx)) = Q v • fx)
          0)
        x
hy :
  (foldr' Q (contractLeftAux Q (c • d))
        (_ :
          ∀ (v : M) (x fx : CliffordAlgebra Q),
            ((contractLeftAux Q (c • d)) v) ((ι Q) v * x, ((contractLeftAux Q (c • d)) v) (x, fx)) = Q v • fx)
        0)
      y =
    c •
      (foldr' Q (contractLeftAux Q d)
          (_ :
            ∀ (v : M) (x fx : CliffordAlgebra Q),
              ((contractLeftAux Q d) v) ((ι Q) v * x, ((contractLeftAux Q d) v) (x, fx)) = Q v • fx)
          0)
        y
⊢ (foldr' Q (contractLeftAux Q (c • d))
        (_ :
          ∀ (v : M) (x fx : CliffordAlgebra Q),
            ((contractLeftAux Q (c • d)) v) ((ι Q) v * x, ((contractLeftAux Q (c • d)) v) (x, fx)) = Q v • fx)
        0)
      (x + y) =
    c •
      (foldr' Q (contractLeftAux Q d)
          (_ :
            ∀ (v : M) (x fx : CliffordAlgebra Q),
              ((contractLeftAux Q d) v) ((ι Q) v * x, ((contractLeftAux Q d) v) (x, fx)) = Q v • fx)
          0)
        (x + y)

Next tactic:
rw [map_add, map_add, smul_add, hx, hy]