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]
      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]
      · rw [map_add, map_add, smul_add, 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' : Module.Dual R M
c : R
d : Module.Dual R M
m : CliffordAlgebra Q
x : M
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)
      m =
    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)
        m
⊢ (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)
      ((ι Q) x * m) =
    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)
        ((ι Q) x * m)

Next tactic:
rw [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]
        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]
      · rw [map_add, map_add, smul_add, hx, hy]
      · rw [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' : Module.Dual R M
c : R
d : Module.Dual R M
m : CliffordAlgebra Q
x : M
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)
      m =
    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)
        m
⊢ ((contractLeftAux Q (c • d)) x)
      (m,
        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)
            m) =
    c •
      ((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]
        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]
      · rw [map_add, map_add, smul_add, hx, hy]
      · rw [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' : Module.Dual R M
c : R
d : Module.Dual R M
m : CliffordAlgebra Q
x : M
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)
      m =
    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)
        m
⊢ (c • d) x • m -
      (ι Q) 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)
            m =
    c •
      (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 [LinearMap.smul_apply, smul_assoc, mul_smul_comm, smul_sub]
/-- This is [grinberg_clifford_2016][] Theorem 6  -/
theorem contractLeft_ι_mul (a : M) (b : CliffordAlgebra Q) :
    d⌋(ι Q a * b) = d a • b - ι Q a * (d⌋b) := by
-- Porting note: Lean cannot figure out anymore the third argument
  

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
a : M
b : CliffordAlgebra Q
⊢ (contractLeft d) ((ι Q) a * b) = d a • b - (ι Q) a * (contractLeft d) b

Next tactic:
refine foldr'_ι_mul _ _ ?_ _ _ _
/-- This is [grinberg_clifford_2016][] Theorem 6  -/
theorem contractLeft_ι_mul (a : M) (b : CliffordAlgebra Q) :
    d⌋(ι Q a * b) = d a • b - ι Q a * (d⌋b) := by
-- Porting note: Lean cannot figure out anymore the third argument
  refine foldr'_ι_mul _ _ ?_ _ _ _
  

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
a : M
b : CliffordAlgebra Q
⊢ ∀ (m : M) (x fx : CliffordAlgebra Q),
    ((contractLeftAux Q d) m) ((ι Q) m * x, ((contractLeftAux Q d) m) (x, fx)) = Q m • fx

Next tactic:
exact fun m x fx ↦ contractLeftAux_contractLeftAux Q d m x fx
/-- This is [grinberg_clifford_2016][] Theorem 12  -/
theorem contractRight_mul_ι (a : M) (b : CliffordAlgebra Q) :
    b * ι Q a⌊d = d a • b - b⌊d * ι Q a := by
  

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
a : M
b : CliffordAlgebra Q
⊢ (contractRight (b * (ι Q) a)) d = d a • b - (contractRight b) d * (ι Q) a

Next tactic:
rw [contractRight_eq, reverse.map_mul, reverse_ι, contractLeft_ι_mul, map_sub, map_smul,
    reverse_reverse, reverse.map_mul, reverse_ι, contractRight_eq]
theorem contractLeft_algebraMap_mul (r : R) (b : CliffordAlgebra Q) :
    d⌋(algebraMap _ _ r * b) = algebraMap _ _ r * (d⌋b) := by
  

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
r : R
b : CliffordAlgebra Q
⊢ (contractLeft d) ((algebraMap R (CliffordAlgebra Q)) r * b) =
    (algebraMap R (CliffordAlgebra Q)) r * (contractLeft d) b

Next tactic:
rw [← Algebra.smul_def, map_smul, Algebra.smul_def]
theorem contractLeft_mul_algebraMap (a : CliffordAlgebra Q) (r : R) :
    d⌋(a * algebraMap _ _ r) = d⌋a * algebraMap _ _ r := by
  

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
a : CliffordAlgebra Q
r : R
⊢ (contractLeft d) (a * (algebraMap R (CliffordAlgebra Q)) r) =
    (contractLeft d) a * (algebraMap R (CliffordAlgebra Q)) r

Next tactic:
rw [← Algebra.commutes, contractLeft_algebraMap_mul, Algebra.commutes]
theorem contractRight_algebraMap_mul (r : R) (b : CliffordAlgebra Q) :
    algebraMap _ _ r * b⌊d = algebraMap _ _ r * (b⌊d) := by
  

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
r : R
b : CliffordAlgebra Q
⊢ (contractRight ((algebraMap R (CliffordAlgebra Q)) r * b)) d =
    (algebraMap R (CliffordAlgebra Q)) r * (contractRight b) d

Next tactic:
rw [← Algebra.smul_def, LinearMap.map_smul₂, Algebra.smul_def]
theorem contractRight_mul_algebraMap (a : CliffordAlgebra Q) (r : R) :
    a * algebraMap _ _ r⌊d = a⌊d * algebraMap _ _ r := by
  

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
a : CliffordAlgebra Q
r : R
⊢ (contractRight (a * (algebraMap R (CliffordAlgebra Q)) r)) d =
    (contractRight a) d * (algebraMap R (CliffordAlgebra Q)) r

Next tactic:
rw [← Algebra.commutes, contractRight_algebraMap_mul, Algebra.commutes]
@[simp]
theorem contractLeft_ι (x : M) : d⌋ι Q x = algebraMap R _ (d x) := by
-- Porting note: Lean cannot figure out anymore the third argument
  

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
x : M
⊢ (contractLeft d) ((ι Q) x) = (algebraMap R (CliffordAlgebra Q)) (d x)

Next tactic:
refine (foldr'_ι _ _ ?_ _ _).trans <| by
    simp_rw [contractLeftAux_apply_apply, mul_zero, sub_zero,
      Algebra.algebraMap_eq_smul_one]
@[simp]
theorem contractLeft_ι (x : M) : d⌋ι Q x = algebraMap R _ (d x) := by
-- Porting note: Lean cannot figure out anymore the third argument
  refine (foldr'_ι _ _ ?_ _ _).trans <| by
    

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
x : M
⊢ ((contractLeftAux Q d) x) (1, 0) = (algebraMap R (CliffordAlgebra Q)) (d x)

Next tactic:
simp_rw [contractLeftAux_apply_apply, mul_zero, sub_zero,
      Algebra.algebraMap_eq_smul_one]
@[simp]
theorem contractLeft_ι (x : M) : d⌋ι Q x = algebraMap R _ (d x) := by
-- Porting note: Lean cannot figure out anymore the third argument
  refine (foldr'_ι _ _ ?_ _ _).trans <| by
    simp_rw [contractLeftAux_apply_apply, mul_zero, sub_zero,
      Algebra.algebraMap_eq_smul_one]
  

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
x : M
⊢ ∀ (m : M) (x fx : CliffordAlgebra Q),
    ((contractLeftAux Q d) m) ((ι Q) m * x, ((contractLeftAux Q d) m) (x, fx)) = Q m • fx

Next tactic:
exact fun m x fx ↦ contractLeftAux_contractLeftAux Q d m x fx
@[simp]
theorem contractRight_ι (x : M) : ι Q x⌊d = algebraMap R _ (d x) := by
  

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
x : M
⊢ (contractRight ((ι Q) x)) d = (algebraMap R (CliffordAlgebra Q)) (d x)

Next tactic:
rw [contractRight_eq, reverse_ι, contractLeft_ι, reverse.commutes]
@[simp]
theorem contractLeft_algebraMap (r : R) : d⌋algebraMap R (CliffordAlgebra Q) r = 0 := by
-- Porting note: Lean cannot figure out anymore the third argument
  

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
r : R
⊢ (contractLeft d) ((algebraMap R (CliffordAlgebra Q)) r) = 0

Next tactic:
refine (foldr'_algebraMap _ _ ?_ _ _).trans <| smul_zero _
@[simp]
theorem contractLeft_algebraMap (r : R) : d⌋algebraMap R (CliffordAlgebra Q) r = 0 := by
-- Porting note: Lean cannot figure out anymore the third argument
  refine (foldr'_algebraMap _ _ ?_ _ _).trans <| smul_zero _
  

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
r : R
⊢ ∀ (m : M) (x fx : CliffordAlgebra Q),
    ((contractLeftAux Q d) m) ((ι Q) m * x, ((contractLeftAux Q d) m) (x, fx)) = Q m • fx

Next tactic:
exact fun m x fx ↦ contractLeftAux_contractLeftAux Q d m x fx
@[simp]
theorem contractRight_algebraMap (r : R) : algebraMap R (CliffordAlgebra Q) r⌊d = 0 := by
  

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
r : R
⊢ (contractRight ((algebraMap R (CliffordAlgebra Q)) r)) d = 0

Next tactic:
rw [contractRight_eq, reverse.commutes, contractLeft_algebraMap, map_zero]
@[simp]
theorem contractLeft_one : d⌋(1 : CliffordAlgebra Q) = 0 := by
  

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
⊢ (contractLeft d) 1 = 0

Next tactic:
simpa only [map_one] using contractLeft_algebraMap Q d 1
@[simp]
theorem contractRight_one : (1 : CliffordAlgebra Q)⌊d = 0 := by
  

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
⊢ (contractRight 1) d = 0

Next tactic:
simpa only [map_one] using contractRight_algebraMap Q d 1
/-- This is [grinberg_clifford_2016][] Theorem 7 -/
theorem contractLeft_contractLeft (x : CliffordAlgebra Q) : d⌋(d⌋x) = 0 := by
  

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
x : CliffordAlgebra Q
⊢ (contractLeft d) ((contractLeft d) x) = 0

Next tactic:
induction' x using CliffordAlgebra.left_induction with r x y hx hy m x hx
/-- This is [grinberg_clifford_2016][] Theorem 7 -/
theorem contractLeft_contractLeft (x : CliffordAlgebra Q) : d⌋(d⌋x) = 0 := by
  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
r : R
⊢ (contractLeft d) ((contractLeft d) ((algebraMap R (CliffordAlgebra Q)) r)) = 0

Next tactic:
simp_rw [contractLeft_algebraMap, map_zero]
/-- This is [grinberg_clifford_2016][] Theorem 7 -/
theorem contractLeft_contractLeft (x : CliffordAlgebra Q) : d⌋(d⌋x) = 0 := by
  induction' x using CliffordAlgebra.left_induction with r x y hx hy m x hx
  · simp_rw [contractLeft_algebraMap, map_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
x y : CliffordAlgebra Q
hx : (contractLeft d) ((contractLeft d) x) = 0
hy : (contractLeft d) ((contractLeft d) y) = 0
⊢ (contractLeft d) ((contractLeft d) (x + y)) = 0

Next tactic:
rw [map_add, map_add, hx, hy, add_zero]
/-- This is [grinberg_clifford_2016][] Theorem 7 -/
theorem contractLeft_contractLeft (x : CliffordAlgebra Q) : d⌋(d⌋x) = 0 := by
  induction' x using CliffordAlgebra.left_induction with r x y hx hy m x hx
  · simp_rw [contractLeft_algebraMap, map_zero]
  · rw [map_add, map_add, hx, hy, add_zero]
  · 

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' : Module.Dual R M
m : CliffordAlgebra Q
x : M
hx : (contractLeft d) ((contractLeft d) m) = 0
⊢ (contractLeft d) ((contractLeft d) ((ι Q) x * m)) = 0

Next tactic:
rw [contractLeft_ι_mul, map_sub, contractLeft_ι_mul, hx, LinearMap.map_smul,
      mul_zero, sub_zero, sub_self]
/-- This is [grinberg_clifford_2016][] Theorem 13 -/
theorem contractRight_contractRight (x : CliffordAlgebra Q) : x⌊d⌊d = 0 := by
  

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
x : CliffordAlgebra Q
⊢ (contractRight ((contractRight x) d)) d = 0

Next tactic:
rw [contractRight_eq, contractRight_eq, reverse_reverse, contractLeft_contractLeft, map_zero]
/-- This is [grinberg_clifford_2016][] Theorem 8 -/
theorem contractLeft_comm (x : CliffordAlgebra Q) : d⌋(d'⌋x) = -(d'⌋(d⌋x)) := by
  

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
x : CliffordAlgebra Q
⊢ (contractLeft d) ((contractLeft d') x) = -(contractLeft d') ((contractLeft d) x)

Next tactic:
induction' x using CliffordAlgebra.left_induction with r x y hx hy m x hx
/-- This is [grinberg_clifford_2016][] Theorem 8 -/
theorem contractLeft_comm (x : CliffordAlgebra Q) : d⌋(d'⌋x) = -(d'⌋(d⌋x)) := by
  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
r : R
⊢ (contractLeft d) ((contractLeft d') ((algebraMap R (CliffordAlgebra Q)) r)) =
    -(contractLeft d') ((contractLeft d) ((algebraMap R (CliffordAlgebra Q)) r))

Next tactic:
simp_rw [contractLeft_algebraMap, map_zero, neg_zero]
/-- This is [grinberg_clifford_2016][] Theorem 8 -/
theorem contractLeft_comm (x : CliffordAlgebra Q) : d⌋(d'⌋x) = -(d'⌋(d⌋x)) := by
  induction' x using CliffordAlgebra.left_induction with r x y hx hy m x hx
  · simp_rw [contractLeft_algebraMap, map_zero, neg_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
x y : CliffordAlgebra Q
hx : (contractLeft d) ((contractLeft d') x) = -(contractLeft d') ((contractLeft d) x)
hy : (contractLeft d) ((contractLeft d') y) = -(contractLeft d') ((contractLeft d) y)
⊢ (contractLeft d) ((contractLeft d') (x + y)) = -(contractLeft d') ((contractLeft d) (x + y))

Next tactic:
rw [map_add, map_add, map_add, map_add, hx, hy, neg_add]
/-- This is [grinberg_clifford_2016][] Theorem 8 -/
theorem contractLeft_comm (x : CliffordAlgebra Q) : d⌋(d'⌋x) = -(d'⌋(d⌋x)) := by
  induction' x using CliffordAlgebra.left_induction with r x y hx hy m x hx
  · simp_rw [contractLeft_algebraMap, map_zero, neg_zero]
  · rw [map_add, map_add, map_add, map_add, hx, hy, neg_add]
  · 

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' : Module.Dual R M
m : CliffordAlgebra Q
x : M
hx : (contractLeft d) ((contractLeft d') m) = -(contractLeft d') ((contractLeft d) m)
⊢ (contractLeft d) ((contractLeft d') ((ι Q) x * m)) = -(contractLeft d') ((contractLeft d) ((ι Q) x * m))

Next tactic:
simp only [contractLeft_ι_mul, map_sub, LinearMap.map_smul]
/-- This is [grinberg_clifford_2016][] Theorem 8 -/
theorem contractLeft_comm (x : CliffordAlgebra Q) : d⌋(d'⌋x) = -(d'⌋(d⌋x)) := by
  induction' x using CliffordAlgebra.left_induction with r x y hx hy m x hx
  · simp_rw [contractLeft_algebraMap, map_zero, neg_zero]
  · rw [map_add, map_add, map_add, map_add, hx, hy, neg_add]
  · simp only [contractLeft_ι_mul, map_sub, LinearMap.map_smul]
    

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' : Module.Dual R M
m : CliffordAlgebra Q
x : M
hx : (contractLeft d) ((contractLeft d') m) = -(contractLeft d') ((contractLeft d) m)
⊢ d' x • (contractLeft d) m - (d x • (contractLeft d') m - (ι Q) x * (contractLeft d) ((contractLeft d') m)) =
    -(d x • (contractLeft d') m - (d' x • (contractLeft d) m - (ι Q) x * (contractLeft d') ((contractLeft d) m)))

Next tactic:
rw [neg_sub, sub_sub_eq_add_sub, hx, mul_neg, ← sub_eq_add_neg]
/-- This is [grinberg_clifford_2016][] Theorem 14 -/
theorem contractRight_comm (x : CliffordAlgebra Q) : x⌊d⌊d' = -(x⌊d'⌊d) := by
  

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
x : CliffordAlgebra Q
⊢ (contractRight ((contractRight x) d)) d' = -(contractRight ((contractRight x) d')) d

Next tactic:
rw [contractRight_eq, contractRight_eq, contractRight_eq, contractRight_eq, reverse_reverse,
    reverse_reverse, contractLeft_comm, map_neg]
theorem changeFormAux_changeFormAux (B : BilinForm R M) (v : M) (x : CliffordAlgebra Q) :
    changeFormAux Q B v (changeFormAux Q B v x) = (Q v - B v v) • x := by
  

Proof state:
R : Type u1
inst✝² : CommRing R
M : Type u2
inst✝¹ : AddCommGroup M
inst✝ : Module R M
Q : QuadraticForm R M
B : BilinForm R M
v : M
x : CliffordAlgebra Q
⊢ ((changeFormAux Q B) v) (((changeFormAux Q B) v) x) = (Q v - BilinForm.bilin B v v) • x

Next tactic:
simp only [changeFormAux_apply_apply]
theorem changeFormAux_changeFormAux (B : BilinForm R M) (v : M) (x : CliffordAlgebra Q) :
    changeFormAux Q B v (changeFormAux Q B v x) = (Q v - B v v) • x := by
  simp only [changeFormAux_apply_apply]
  

Proof state:
R : Type u1
inst✝² : CommRing R
M : Type u2
inst✝¹ : AddCommGroup M
inst✝ : Module R M
Q : QuadraticForm R M
B : BilinForm R M
v : M
x : CliffordAlgebra Q
⊢ (ι Q) v * ((ι Q) v * x - (contractLeft ((BilinForm.toLin B) v)) x) -
      (contractLeft ((BilinForm.toLin B) v)) ((ι Q) v * x - (contractLeft ((BilinForm.toLin B) v)) x) =
    (Q v - BilinForm.bilin B v v) • x

Next tactic:
rw [mul_sub, ← mul_assoc, ι_sq_scalar, map_sub, contractLeft_ι_mul, ← sub_add, sub_sub_sub_comm,
    ← Algebra.smul_def, BilinForm.toLin_apply, sub_self, sub_zero, contractLeft_contractLeft,
    add_zero, sub_smul]