l3lab/ntp-mathlib huggingface dataset:
/-- Two algebra morphisms from the even subalgebra are equal if they agree on pairs of generators.

See note [partially-applied ext lemmas]. -/
@[ext high]
theorem even.algHom_ext ⦃f g : even Q →ₐ[R] A⦄ (h : (even.ι Q).compr₂ f = (even.ι Q).compr₂ g) :
    f = g := by
  rw [EvenHom.ext_iff] at h
  ext ⟨x, hx⟩
  refine' even_induction _ _ _ _ _ hx
  · intro r
    exact (f.commutes r).trans (g.commutes r).symm
  · intro x y hx hy ihx ihy
    

Proof state:
case H.mk.refine'_2
R : Type uR
M : Type uM
inst✝⁶ : CommRing R
inst✝⁵ : AddCommGroup M
inst✝⁴ : Module R M
Q : QuadraticForm R M
A : Type uA
B : Type uB
inst✝³ : Ring A
inst✝² : Ring B
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f✝ : EvenHom Q A
f g : ↥(even Q) →ₐ[R] A
h : (EvenHom.compr₂ (ι Q) f).bilin = (EvenHom.compr₂ (ι Q) g).bilin
x✝ : CliffordAlgebra Q
hx✝ : x✝ ∈ even Q
x y : CliffordAlgebra Q
hx : x ∈ evenOdd Q 0
hy : y ∈ evenOdd Q 0
ihx : f { val := x, property := hx } = g { val := x, property := hx }
ihy : f { val := y, property := hy } = g { val := y, property := hy }
⊢ f { val := x + y, property := (_ : x + y ∈ evenOdd Q 0) } = g { val := x + y, property := (_ : x + y ∈ evenOdd Q 0) }

Next tactic:
have := congr_arg₂ (· + ·) ihx ihy
/-- Two algebra morphisms from the even subalgebra are equal if they agree on pairs of generators.

See note [partially-applied ext lemmas]. -/
@[ext high]
theorem even.algHom_ext ⦃f g : even Q →ₐ[R] A⦄ (h : (even.ι Q).compr₂ f = (even.ι Q).compr₂ g) :
    f = g := by
  rw [EvenHom.ext_iff] at h
  ext ⟨x, hx⟩
  refine' even_induction _ _ _ _ _ hx
  · intro r
    exact (f.commutes r).trans (g.commutes r).symm
  · intro x y hx hy ihx ihy
    have := congr_arg₂ (· + ·) ihx ihy
    

Proof state:
case H.mk.refine'_2
R : Type uR
M : Type uM
inst✝⁶ : CommRing R
inst✝⁵ : AddCommGroup M
inst✝⁴ : Module R M
Q : QuadraticForm R M
A : Type uA
B : Type uB
inst✝³ : Ring A
inst✝² : Ring B
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f✝ : EvenHom Q A
f g : ↥(even Q) →ₐ[R] A
h : (EvenHom.compr₂ (ι Q) f).bilin = (EvenHom.compr₂ (ι Q) g).bilin
x✝ : CliffordAlgebra Q
hx✝ : x✝ ∈ even Q
x y : CliffordAlgebra Q
hx : x ∈ evenOdd Q 0
hy : y ∈ evenOdd Q 0
ihx : f { val := x, property := hx } = g { val := x, property := hx }
ihy : f { val := y, property := hy } = g { val := y, property := hy }
this :
  (fun x x_1 => x + x_1) (f { val := x, property := hx }) (f { val := y, property := hy }) =
    (fun x x_1 => x + x_1) (g { val := x, property := hx }) (g { val := y, property := hy })
⊢ f { val := x + y, property := (_ : x + y ∈ evenOdd Q 0) } = g { val := x + y, property := (_ : x + y ∈ evenOdd Q 0) }

Next tactic:
exact (f.map_add _ _).trans (this.trans <| (g.map_add _ _).symm)
/-- Two algebra morphisms from the even subalgebra are equal if they agree on pairs of generators.

See note [partially-applied ext lemmas]. -/
@[ext high]
theorem even.algHom_ext ⦃f g : even Q →ₐ[R] A⦄ (h : (even.ι Q).compr₂ f = (even.ι Q).compr₂ g) :
    f = g := by
  rw [EvenHom.ext_iff] at h
  ext ⟨x, hx⟩
  refine' even_induction _ _ _ _ _ hx
  · intro r
    exact (f.commutes r).trans (g.commutes r).symm
  · intro x y hx hy ihx ihy
    have := congr_arg₂ (· + ·) ihx ihy
    exact (f.map_add _ _).trans (this.trans <| (g.map_add _ _).symm)
  · 

Proof state:
case H.mk.refine'_3
R : Type uR
M : Type uM
inst✝⁶ : CommRing R
inst✝⁵ : AddCommGroup M
inst✝⁴ : Module R M
Q : QuadraticForm R M
A : Type uA
B : Type uB
inst✝³ : Ring A
inst✝² : Ring B
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f✝ : EvenHom Q A
f g : ↥(even Q) →ₐ[R] A
h : (EvenHom.compr₂ (ι Q) f).bilin = (EvenHom.compr₂ (ι Q) g).bilin
x : CliffordAlgebra Q
hx : x ∈ even Q
⊢ ∀ (m₁ m₂ : M) {x : CliffordAlgebra Q} {hx : x ∈ evenOdd Q 0},
    f { val := x, property := hx } = g { val := x, property := hx } →
      f
          { val := (CliffordAlgebra.ι Q) m₁ * (CliffordAlgebra.ι Q) m₂ * x,
            property := (_ : (CliffordAlgebra.ι Q) m₁ * (CliffordAlgebra.ι Q) m₂ * x ∈ evenOdd Q 0) } =
        g
          { val := (CliffordAlgebra.ι Q) m₁ * (CliffordAlgebra.ι Q) m₂ * x,
            property := (_ : (CliffordAlgebra.ι Q) m₁ * (CliffordAlgebra.ι Q) m₂ * x ∈ evenOdd Q 0) }

Next tactic:
intro m₁ m₂ x hx ih
/-- Two algebra morphisms from the even subalgebra are equal if they agree on pairs of generators.

See note [partially-applied ext lemmas]. -/
@[ext high]
theorem even.algHom_ext ⦃f g : even Q →ₐ[R] A⦄ (h : (even.ι Q).compr₂ f = (even.ι Q).compr₂ g) :
    f = g := by
  rw [EvenHom.ext_iff] at h
  ext ⟨x, hx⟩
  refine' even_induction _ _ _ _ _ hx
  · intro r
    exact (f.commutes r).trans (g.commutes r).symm
  · intro x y hx hy ihx ihy
    have := congr_arg₂ (· + ·) ihx ihy
    exact (f.map_add _ _).trans (this.trans <| (g.map_add _ _).symm)
  · intro m₁ m₂ x hx ih
    

Proof state:
case H.mk.refine'_3
R : Type uR
M : Type uM
inst✝⁶ : CommRing R
inst✝⁵ : AddCommGroup M
inst✝⁴ : Module R M
Q : QuadraticForm R M
A : Type uA
B : Type uB
inst✝³ : Ring A
inst✝² : Ring B
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f✝ : EvenHom Q A
f g : ↥(even Q) →ₐ[R] A
h : (EvenHom.compr₂ (ι Q) f).bilin = (EvenHom.compr₂ (ι Q) g).bilin
x✝ : CliffordAlgebra Q
hx✝ : x✝ ∈ even Q
m₁ m₂ : M
x : CliffordAlgebra Q
hx : x ∈ evenOdd Q 0
ih : f { val := x, property := hx } = g { val := x, property := hx }
⊢ f
      { val := (CliffordAlgebra.ι Q) m₁ * (CliffordAlgebra.ι Q) m₂ * x,
        property := (_ : (CliffordAlgebra.ι Q) m₁ * (CliffordAlgebra.ι Q) m₂ * x ∈ evenOdd Q 0) } =
    g
      { val := (CliffordAlgebra.ι Q) m₁ * (CliffordAlgebra.ι Q) m₂ * x,
        property := (_ : (CliffordAlgebra.ι Q) m₁ * (CliffordAlgebra.ι Q) m₂ * x ∈ evenOdd Q 0) }

Next tactic:
have := congr_arg₂ (· * ·) (LinearMap.congr_fun (LinearMap.congr_fun h m₁) m₂) ih
/-- Two algebra morphisms from the even subalgebra are equal if they agree on pairs of generators.

See note [partially-applied ext lemmas]. -/
@[ext high]
theorem even.algHom_ext ⦃f g : even Q →ₐ[R] A⦄ (h : (even.ι Q).compr₂ f = (even.ι Q).compr₂ g) :
    f = g := by
  rw [EvenHom.ext_iff] at h
  ext ⟨x, hx⟩
  refine' even_induction _ _ _ _ _ hx
  · intro r
    exact (f.commutes r).trans (g.commutes r).symm
  · intro x y hx hy ihx ihy
    have := congr_arg₂ (· + ·) ihx ihy
    exact (f.map_add _ _).trans (this.trans <| (g.map_add _ _).symm)
  · intro m₁ m₂ x hx ih
    have := congr_arg₂ (· * ·) (LinearMap.congr_fun (LinearMap.congr_fun h m₁) m₂) ih
    

Proof state:
case H.mk.refine'_3
R : Type uR
M : Type uM
inst✝⁶ : CommRing R
inst✝⁵ : AddCommGroup M
inst✝⁴ : Module R M
Q : QuadraticForm R M
A : Type uA
B : Type uB
inst✝³ : Ring A
inst✝² : Ring B
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f✝ : EvenHom Q A
f g : ↥(even Q) →ₐ[R] A
h : (EvenHom.compr₂ (ι Q) f).bilin = (EvenHom.compr₂ (ι Q) g).bilin
x✝ : CliffordAlgebra Q
hx✝ : x✝ ∈ even Q
m₁ m₂ : M
x : CliffordAlgebra Q
hx : x ∈ evenOdd Q 0
ih : f { val := x, property := hx } = g { val := x, property := hx }
this :
  (fun x x_1 => x * x_1) (((EvenHom.compr₂ (ι Q) f).bilin m₁) m₂) (f { val := x, property := hx }) =
    (fun x x_1 => x * x_1) (((EvenHom.compr₂ (ι Q) g).bilin m₁) m₂) (g { val := x, property := hx })
⊢ f
      { val := (CliffordAlgebra.ι Q) m₁ * (CliffordAlgebra.ι Q) m₂ * x,
        property := (_ : (CliffordAlgebra.ι Q) m₁ * (CliffordAlgebra.ι Q) m₂ * x ∈ evenOdd Q 0) } =
    g
      { val := (CliffordAlgebra.ι Q) m₁ * (CliffordAlgebra.ι Q) m₂ * x,
        property := (_ : (CliffordAlgebra.ι Q) m₁ * (CliffordAlgebra.ι Q) m₂ * x ∈ evenOdd Q 0) }

Next tactic:
exact (f.map_mul _ _).trans (this.trans <| (g.map_mul _ _).symm)
/-- An auxiliary bilinear map that is later passed into `CliffordAlgebra.foldr`. Our desired result
is stored in the `A` part of the accumulator, while auxiliary recursion state is stored in the `S f`
part. -/
private def fFold : M →ₗ[R] A × S f →ₗ[R] A × S f :=
  LinearMap.mk₂ R
    (fun m acc =>
      /- We could write this `snd` term in a point-free style as follows, but it wouldn't help as we
        don't have any prod or subtype combinators to deal with n-linear maps of this degree.
        ```lean
        (LinearMap.lcomp R _ (Algebra.lmul R A).to_linear_map.flip).comp $
          (LinearMap.llcomp R M A A).flip.comp f.flip : M →ₗ[R] A →ₗ[R] M →ₗ[R] A)
        ```
        -/
      (acc.2.val m,
        ⟨(LinearMap.mulRight R acc.1).comp (f.bilin.flip m), Submodule.subset_span <| ⟨_, _, rfl⟩⟩))
    (fun m₁ m₂ a =>
      Prod.ext (LinearMap.map_add _ m₁ m₂)
        (Subtype.ext <|
          LinearMap.ext fun m₃ =>
            show f.bilin m₃ (m₁ + m₂) * a.1 = f.bilin m₃ m₁ * a.1 + f.bilin m₃ m₂ * a.1 by
              

Proof state:
R : Type uR
M : Type uM
inst✝⁶ : CommRing R
inst✝⁵ : AddCommGroup M
inst✝⁴ : Module R M
Q : QuadraticForm R M
A : Type uA
B : Type uB
inst✝³ : Ring A
inst✝² : Ring B
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : EvenHom Q A
m₁ m₂ : M
a : A × ↥(CliffordAlgebra.even.lift.S f)
m₃ : M
⊢ (f.bilin m₃) (m₁ + m₂) * a.1 = (f.bilin m₃) m₁ * a.1 + (f.bilin m₃) m₂ * a.1

Next tactic:
rw [map_add, add_mul]
/-- An auxiliary bilinear map that is later passed into `CliffordAlgebra.foldr`. Our desired result
is stored in the `A` part of the accumulator, while auxiliary recursion state is stored in the `S f`
part. -/
private def fFold : M →ₗ[R] A × S f →ₗ[R] A × S f :=
  LinearMap.mk₂ R
    (fun m acc =>
      /- We could write this `snd` term in a point-free style as follows, but it wouldn't help as we
        don't have any prod or subtype combinators to deal with n-linear maps of this degree.
        ```lean
        (LinearMap.lcomp R _ (Algebra.lmul R A).to_linear_map.flip).comp $
          (LinearMap.llcomp R M A A).flip.comp f.flip : M →ₗ[R] A →ₗ[R] M →ₗ[R] A)
        ```
        -/
      (acc.2.val m,
        ⟨(LinearMap.mulRight R acc.1).comp (f.bilin.flip m), Submodule.subset_span <| ⟨_, _, rfl⟩⟩))
    (fun m₁ m₂ a =>
      Prod.ext (LinearMap.map_add _ m₁ m₂)
        (Subtype.ext <|
          LinearMap.ext fun m₃ =>
            show f.bilin m₃ (m₁ + m₂) * a.1 = f.bilin m₃ m₁ * a.1 + f.bilin m₃ m₂ * a.1 by
              rw [map_add, add_mul]))
    (fun c m a =>
      Prod.ext (LinearMap.map_smul _ c m)
        (Subtype.ext <|
          LinearMap.ext fun m₃ =>
            show f.bilin m₃ (c • m) * a.1 = c • (f.bilin m₃ m * a.1) by
              

Proof state:
R : Type uR
M : Type uM
inst✝⁶ : CommRing R
inst✝⁵ : AddCommGroup M
inst✝⁴ : Module R M
Q : QuadraticForm R M
A : Type uA
B : Type uB
inst✝³ : Ring A
inst✝² : Ring B
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : EvenHom Q A
c : R
m : M
a : A × ↥(CliffordAlgebra.even.lift.S f)
m₃ : M
⊢ (f.bilin m₃) (c • m) * a.1 = c • ((f.bilin m₃) m * a.1)

Next tactic:
rw [LinearMap.map_smul, smul_mul_assoc]
private theorem fFold_fFold (m : M) (x : A × S f) : fFold f m (fFold f m x) = Q m • x := by
  

Proof state:
R : Type uR
M : Type uM
inst✝⁶ : CommRing R
inst✝⁵ : AddCommGroup M
inst✝⁴ : Module R M
Q : QuadraticForm R M
A : Type uA
B : Type uB
inst✝³ : Ring A
inst✝² : Ring B
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : EvenHom Q A
m : M
x : A × ↥(CliffordAlgebra.even.lift.S f)
⊢ ((CliffordAlgebra.even.lift.fFold f) m) (((CliffordAlgebra.even.lift.fFold f) m) x) = Q m • x

Next tactic:
obtain ⟨a, ⟨g, hg⟩⟩ := x
private theorem fFold_fFold (m : M) (x : A × S f) : fFold f m (fFold f m x) = Q m • x := by
  obtain ⟨a, ⟨g, hg⟩⟩ := x
  

Proof state:
case mk.mk
R : Type uR
M : Type uM
inst✝⁶ : CommRing R
inst✝⁵ : AddCommGroup M
inst✝⁴ : Module R M
Q : QuadraticForm R M
A : Type uA
B : Type uB
inst✝³ : Ring A
inst✝² : Ring B
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : EvenHom Q A
m : M
a : A
g : M →ₗ[R] A
hg : g ∈ CliffordAlgebra.even.lift.S f
⊢ ((CliffordAlgebra.even.lift.fFold f) m) (((CliffordAlgebra.even.lift.fFold f) m) (a, { val := g, property := hg })) =
    Q m • (a, { val := g, property := hg })

Next tactic:
ext : 2
private theorem fFold_fFold (m : M) (x : A × S f) : fFold f m (fFold f m x) = Q m • x := by
  obtain ⟨a, ⟨g, hg⟩⟩ := x
  ext : 2
  · 

Proof state:
case mk.mk.a
R : Type uR
M : Type uM
inst✝⁶ : CommRing R
inst✝⁵ : AddCommGroup M
inst✝⁴ : Module R M
Q : QuadraticForm R M
A : Type uA
B : Type uB
inst✝³ : Ring A
inst✝² : Ring B
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : EvenHom Q A
m : M
a : A
g : M →ₗ[R] A
hg : g ∈ CliffordAlgebra.even.lift.S f
⊢ (((CliffordAlgebra.even.lift.fFold f) m)
        (((CliffordAlgebra.even.lift.fFold f) m) (a, { val := g, property := hg }))).1 =
    (Q m • (a, { val := g, property := hg })).1

Next tactic:
change f.bilin m m * a = Q m • a
private theorem fFold_fFold (m : M) (x : A × S f) : fFold f m (fFold f m x) = Q m • x := by
  obtain ⟨a, ⟨g, hg⟩⟩ := x
  ext : 2
  · change f.bilin m m * a = Q m • a
    

Proof state:
case mk.mk.a
R : Type uR
M : Type uM
inst✝⁶ : CommRing R
inst✝⁵ : AddCommGroup M
inst✝⁴ : Module R M
Q : QuadraticForm R M
A : Type uA
B : Type uB
inst✝³ : Ring A
inst✝² : Ring B
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : EvenHom Q A
m : M
a : A
g : M →ₗ[R] A
hg : g ∈ CliffordAlgebra.even.lift.S f
⊢ (f.bilin m) m * a = Q m • a

Next tactic:
rw [Algebra.smul_def, f.contract]
private theorem fFold_fFold (m : M) (x : A × S f) : fFold f m (fFold f m x) = Q m • x := by
  obtain ⟨a, ⟨g, hg⟩⟩ := x
  ext : 2
  · change f.bilin m m * a = Q m • a
    rw [Algebra.smul_def, f.contract]
  · 

Proof state:
case mk.mk.a.a
R : Type uR
M : Type uM
inst✝⁶ : CommRing R
inst✝⁵ : AddCommGroup M
inst✝⁴ : Module R M
Q : QuadraticForm R M
A : Type uA
B : Type uB
inst✝³ : Ring A
inst✝² : Ring B
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : EvenHom Q A
m : M
a : A
g : M →ₗ[R] A
hg : g ∈ CliffordAlgebra.even.lift.S f
⊢ ↑(((CliffordAlgebra.even.lift.fFold f) m)
          (((CliffordAlgebra.even.lift.fFold f) m) (a, { val := g, property := hg }))).2 =
    ↑(Q m • (a, { val := g, property := hg })).2

Next tactic:
ext m₁
private theorem fFold_fFold (m : M) (x : A × S f) : fFold f m (fFold f m x) = Q m • x := by
  obtain ⟨a, ⟨g, hg⟩⟩ := x
  ext : 2
  · change f.bilin m m * a = Q m • a
    rw [Algebra.smul_def, f.contract]
  · ext m₁
    

Proof state:
case mk.mk.a.a.h
R : Type uR
M : Type uM
inst✝⁶ : CommRing R
inst✝⁵ : AddCommGroup M
inst✝⁴ : Module R M
Q : QuadraticForm R M
A : Type uA
B : Type uB
inst✝³ : Ring A
inst✝² : Ring B
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : EvenHom Q A
m : M
a : A
g : M →ₗ[R] A
hg : g ∈ CliffordAlgebra.even.lift.S f
m₁ : M
⊢ ↑(((CliffordAlgebra.even.lift.fFold f) m)
            (((CliffordAlgebra.even.lift.fFold f) m) (a, { val := g, property := hg }))).2
      m₁ =
    ↑(Q m • (a, { val := g, property := hg })).2 m₁

Next tactic:
change f.bilin _ _ * g m = Q m • g m₁
private theorem fFold_fFold (m : M) (x : A × S f) : fFold f m (fFold f m x) = Q m • x := by
  obtain ⟨a, ⟨g, hg⟩⟩ := x
  ext : 2
  · change f.bilin m m * a = Q m • a
    rw [Algebra.smul_def, f.contract]
  · ext m₁
    change f.bilin _ _ * g m = Q m • g m₁
    

Proof state:
case mk.mk.a.a.h
R : Type uR
M : Type uM
inst✝⁶ : CommRing R
inst✝⁵ : AddCommGroup M
inst✝⁴ : Module R M
Q : QuadraticForm R M
A : Type uA
B : Type uB
inst✝³ : Ring A
inst✝² : Ring B
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : EvenHom Q A
m : M
a : A
g : M →ₗ[R] A
hg : g ∈ CliffordAlgebra.even.lift.S f
m₁ : M
⊢ (f.bilin m₁) m * g m = Q m • g m₁

Next tactic:
apply Submodule.span_induction' _ _ _ _ hg
private theorem fFold_fFold (m : M) (x : A × S f) : fFold f m (fFold f m x) = Q m • x := by
  obtain ⟨a, ⟨g, hg⟩⟩ := x
  ext : 2
  · change f.bilin m m * a = Q m • a
    rw [Algebra.smul_def, f.contract]
  · ext m₁
    change f.bilin _ _ * g m = Q m • g m₁
    apply Submodule.span_induction' _ _ _ _ hg
    · 

Proof state:
R : Type uR
M : Type uM
inst✝⁶ : CommRing R
inst✝⁵ : AddCommGroup M
inst✝⁴ : Module R M
Q : QuadraticForm R M
A : Type uA
B : Type uB
inst✝³ : Ring A
inst✝² : Ring B
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : EvenHom Q A
m : M
a : A
g : M →ₗ[R] A
hg : g ∈ CliffordAlgebra.even.lift.S f
m₁ : M
⊢ ∀ x ∈ {f' | ∃ x m₂, f' = (LinearMap.lcomp R A ((LinearMap.flip f.bilin) m₂)) (LinearMap.mulRight R x)},
    (f.bilin m₁) m * x m = Q m • x m₁

Next tactic:
rintro _ ⟨b, m₃, rfl⟩
private theorem fFold_fFold (m : M) (x : A × S f) : fFold f m (fFold f m x) = Q m • x := by
  obtain ⟨a, ⟨g, hg⟩⟩ := x
  ext : 2
  · change f.bilin m m * a = Q m • a
    rw [Algebra.smul_def, f.contract]
  · ext m₁
    change f.bilin _ _ * g m = Q m • g m₁
    apply Submodule.span_induction' _ _ _ _ hg
    · rintro _ ⟨b, m₃, rfl⟩
      

Proof state:
case intro.intro
R : Type uR
M : Type uM
inst✝⁶ : CommRing R
inst✝⁵ : AddCommGroup M
inst✝⁴ : Module R M
Q : QuadraticForm R M
A : Type uA
B : Type uB
inst✝³ : Ring A
inst✝² : Ring B
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : EvenHom Q A
m : M
a : A
g : M →ₗ[R] A
hg : g ∈ CliffordAlgebra.even.lift.S f
m₁ : M
b : A
m₃ : M
⊢ (f.bilin m₁) m * ((LinearMap.lcomp R A ((LinearMap.flip f.bilin) m₃)) (LinearMap.mulRight R b)) m =
    Q m • ((LinearMap.lcomp R A ((LinearMap.flip f.bilin) m₃)) (LinearMap.mulRight R b)) m₁

Next tactic:
change f.bilin _ _ * (f.bilin _ _ * b) = Q m • (f.bilin _ _ * b)
private theorem fFold_fFold (m : M) (x : A × S f) : fFold f m (fFold f m x) = Q m • x := by
  obtain ⟨a, ⟨g, hg⟩⟩ := x
  ext : 2
  · change f.bilin m m * a = Q m • a
    rw [Algebra.smul_def, f.contract]
  · ext m₁
    change f.bilin _ _ * g m = Q m • g m₁
    apply Submodule.span_induction' _ _ _ _ hg
    · rintro _ ⟨b, m₃, rfl⟩
      change f.bilin _ _ * (f.bilin _ _ * b) = Q m • (f.bilin _ _ * b)
      

Proof state:
case intro.intro
R : Type uR
M : Type uM
inst✝⁶ : CommRing R
inst✝⁵ : AddCommGroup M
inst✝⁴ : Module R M
Q : QuadraticForm R M
A : Type uA
B : Type uB
inst✝³ : Ring A
inst✝² : Ring B
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : EvenHom Q A
m : M
a : A
g : M →ₗ[R] A
hg : g ∈ CliffordAlgebra.even.lift.S f
m₁ : M
b : A
m₃ : M
⊢ (f.bilin m₁) m * ((f.bilin m) m₃ * b) = Q m • ((f.bilin m₁) m₃ * b)

Next tactic:
rw [← smul_mul_assoc, ← mul_assoc, f.contract_mid]
private theorem fFold_fFold (m : M) (x : A × S f) : fFold f m (fFold f m x) = Q m • x := by
  obtain ⟨a, ⟨g, hg⟩⟩ := x
  ext : 2
  · change f.bilin m m * a = Q m • a
    rw [Algebra.smul_def, f.contract]
  · ext m₁
    change f.bilin _ _ * g m = Q m • g m₁
    apply Submodule.span_induction' _ _ _ _ hg
    · rintro _ ⟨b, m₃, rfl⟩
      change f.bilin _ _ * (f.bilin _ _ * b) = Q m • (f.bilin _ _ * b)
      rw [← smul_mul_assoc, ← mul_assoc, f.contract_mid]
    · 

Proof state:
R : Type uR
M : Type uM
inst✝⁶ : CommRing R
inst✝⁵ : AddCommGroup M
inst✝⁴ : Module R M
Q : QuadraticForm R M
A : Type uA
B : Type uB
inst✝³ : Ring A
inst✝² : Ring B
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : EvenHom Q A
m : M
a : A
g : M →ₗ[R] A
hg : g ∈ CliffordAlgebra.even.lift.S f
m₁ : M
⊢ (f.bilin m₁) m * 0 m = Q m • 0 m₁

Next tactic:
change f.bilin m₁ m * 0 = Q m • (0 : A)
private theorem fFold_fFold (m : M) (x : A × S f) : fFold f m (fFold f m x) = Q m • x := by
  obtain ⟨a, ⟨g, hg⟩⟩ := x
  ext : 2
  · change f.bilin m m * a = Q m • a
    rw [Algebra.smul_def, f.contract]
  · ext m₁
    change f.bilin _ _ * g m = Q m • g m₁
    apply Submodule.span_induction' _ _ _ _ hg
    · rintro _ ⟨b, m₃, rfl⟩
      change f.bilin _ _ * (f.bilin _ _ * b) = Q m • (f.bilin _ _ * b)
      rw [← smul_mul_assoc, ← mul_assoc, f.contract_mid]
    · change f.bilin m₁ m * 0 = Q m • (0 : A)  -- porting note: `•` now needs the type of `0`
      

Proof state:
R : Type uR
M : Type uM
inst✝⁶ : CommRing R
inst✝⁵ : AddCommGroup M
inst✝⁴ : Module R M
Q : QuadraticForm R M
A : Type uA
B : Type uB
inst✝³ : Ring A
inst✝² : Ring B
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : EvenHom Q A
m : M
a : A
g : M →ₗ[R] A
hg : g ∈ CliffordAlgebra.even.lift.S f
m₁ : M
⊢ (f.bilin m₁) m * 0 = Q m • 0

Next tactic:
rw [mul_zero, smul_zero]
private theorem fFold_fFold (m : M) (x : A × S f) : fFold f m (fFold f m x) = Q m • x := by
  obtain ⟨a, ⟨g, hg⟩⟩ := x
  ext : 2
  · change f.bilin m m * a = Q m • a
    rw [Algebra.smul_def, f.contract]
  · ext m₁
    change f.bilin _ _ * g m = Q m • g m₁
    apply Submodule.span_induction' _ _ _ _ hg
    · rintro _ ⟨b, m₃, rfl⟩
      change f.bilin _ _ * (f.bilin _ _ * b) = Q m • (f.bilin _ _ * b)
      rw [← smul_mul_assoc, ← mul_assoc, f.contract_mid]
    · change f.bilin m₁ m * 0 = Q m • (0 : A)  -- porting note: `•` now needs the type of `0`
      rw [mul_zero, smul_zero]
    · 

Proof state:
R : Type uR
M : Type uM
inst✝⁶ : CommRing R
inst✝⁵ : AddCommGroup M
inst✝⁴ : Module R M
Q : QuadraticForm R M
A : Type uA
B : Type uB
inst✝³ : Ring A
inst✝² : Ring B
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : EvenHom Q A
m : M
a : A
g : M →ₗ[R] A
hg : g ∈ CliffordAlgebra.even.lift.S f
m₁ : M
⊢ ∀
    x ∈
      Submodule.span R {f' | ∃ x m₂, f' = (LinearMap.lcomp R A ((LinearMap.flip f.bilin) m₂)) (LinearMap.mulRight R x)},
    ∀
      y ∈
        Submodule.span R
          {f' | ∃ x m₂, f' = (LinearMap.lcomp R A ((LinearMap.flip f.bilin) m₂)) (LinearMap.mulRight R x)},
      (f.bilin m₁) m * x m = Q m • x m₁ →
        (f.bilin m₁) m * y m = Q m • y m₁ → (f.bilin m₁) m * (x + y) m = Q m • (x + y) m₁

Next tactic:
rintro x hx y hy ihx ihy
private theorem fFold_fFold (m : M) (x : A × S f) : fFold f m (fFold f m x) = Q m • x := by
  obtain ⟨a, ⟨g, hg⟩⟩ := x
  ext : 2
  · change f.bilin m m * a = Q m • a
    rw [Algebra.smul_def, f.contract]
  · ext m₁
    change f.bilin _ _ * g m = Q m • g m₁
    apply Submodule.span_induction' _ _ _ _ hg
    · rintro _ ⟨b, m₃, rfl⟩
      change f.bilin _ _ * (f.bilin _ _ * b) = Q m • (f.bilin _ _ * b)
      rw [← smul_mul_assoc, ← mul_assoc, f.contract_mid]
    · change f.bilin m₁ m * 0 = Q m • (0 : A)  -- porting note: `•` now needs the type of `0`
      rw [mul_zero, smul_zero]
    · rintro x hx y hy ihx ihy
      

Proof state:
R : Type uR
M : Type uM
inst✝⁶ : CommRing R
inst✝⁵ : AddCommGroup M
inst✝⁴ : Module R M
Q : QuadraticForm R M
A : Type uA
B : Type uB
inst✝³ : Ring A
inst✝² : Ring B
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : EvenHom Q A
m : M
a : A
g : M →ₗ[R] A
hg : g ∈ CliffordAlgebra.even.lift.S f
m₁ : M
x : M →ₗ[R] A
hx :
  x ∈ Submodule.span R {f' | ∃ x m₂, f' = (LinearMap.lcomp R A ((LinearMap.flip f.bilin) m₂)) (LinearMap.mulRight R x)}
y : M →ₗ[R] A
hy :
  y ∈ Submodule.span R {f' | ∃ x m₂, f' = (LinearMap.lcomp R A ((LinearMap.flip f.bilin) m₂)) (LinearMap.mulRight R x)}
ihx : (f.bilin m₁) m * x m = Q m • x m₁
ihy : (f.bilin m₁) m * y m = Q m • y m₁
⊢ (f.bilin m₁) m * (x + y) m = Q m • (x + y) m₁

Next tactic:
rw [LinearMap.add_apply, LinearMap.add_apply, mul_add, smul_add, ihx, ihy]
private theorem fFold_fFold (m : M) (x : A × S f) : fFold f m (fFold f m x) = Q m • x := by
  obtain ⟨a, ⟨g, hg⟩⟩ := x
  ext : 2
  · change f.bilin m m * a = Q m • a
    rw [Algebra.smul_def, f.contract]
  · ext m₁
    change f.bilin _ _ * g m = Q m • g m₁
    apply Submodule.span_induction' _ _ _ _ hg
    · rintro _ ⟨b, m₃, rfl⟩
      change f.bilin _ _ * (f.bilin _ _ * b) = Q m • (f.bilin _ _ * b)
      rw [← smul_mul_assoc, ← mul_assoc, f.contract_mid]
    · change f.bilin m₁ m * 0 = Q m • (0 : A)  -- porting note: `•` now needs the type of `0`
      rw [mul_zero, smul_zero]
    · rintro x hx y hy ihx ihy
      rw [LinearMap.add_apply, LinearMap.add_apply, mul_add, smul_add, ihx, ihy]
    · 

Proof state:
R : Type uR
M : Type uM
inst✝⁶ : CommRing R
inst✝⁵ : AddCommGroup M
inst✝⁴ : Module R M
Q : QuadraticForm R M
A : Type uA
B : Type uB
inst✝³ : Ring A
inst✝² : Ring B
inst✝¹ : Algebra R A
inst✝ : Algebra R B
f : EvenHom Q A
m : M
a : A
g : M →ₗ[R] A
hg : g ∈ CliffordAlgebra.even.lift.S f
m₁ : M
⊢ ∀ (a : R),
    ∀
      x ∈
        Submodule.span R
          {f' | ∃ x m₂, f' = (LinearMap.lcomp R A ((LinearMap.flip f.bilin) m₂)) (LinearMap.mulRight R x)},
      (f.bilin m₁) m * x m = Q m • x m₁ → (f.bilin m₁) m * (a • x) m = Q m • (a • x) m₁

Next tactic:
rintro x hx c ihx