l3lab/ntp-mathlib huggingface dataset:
/-- Convert from the clifford algebra over a base-changed module to the base-changed clifford
algebra. -/
-- `noncomputable` is a performance workaround for mathlib4#7103
noncomputable def toBaseChange (Q : QuadraticForm R V) :
    CliffordAlgebra (Q.baseChange A) →ₐ[A] A ⊗[R] CliffordAlgebra Q :=
  CliffordAlgebra.lift _ <| by
    refine ⟨TensorProduct.AlgebraTensorModule.map (LinearMap.id : A →ₗ[A] A) (ι Q), ?_⟩
    letI : Invertible (2 : A) := (Invertible.map (algebraMap R A) 2).copy 2 (map_ofNat _ _).symm
    letI : Invertible (2 : A ⊗[R] CliffordAlgebra Q) :=
      (Invertible.map (algebraMap R _) 2).copy 2 (map_ofNat _ _).symm
    

Proof state:
R : Type u_1
A : Type u_2
V : Type u_3
inst✝⁷ : CommRing R
inst✝⁶ : CommRing A
inst✝⁵ : AddCommGroup V
inst✝⁴ : Algebra R A
inst✝³ : Module R V
inst✝² : Module A V
inst✝¹ : IsScalarTower R A V
inst✝ : Invertible 2
Q : QuadraticForm R V
this✝ : Invertible 2 := Invertible.copy (Invertible.map (algebraMap R A) 2) 2 (_ : 2 = (algebraMap R A) 2)
this : Invertible 2 :=
  Invertible.copy (Invertible.map (algebraMap R (A ⊗[R] CliffordAlgebra Q)) 2) 2
    (_ : 2 = (algebraMap R (A ⊗[R] CliffordAlgebra Q)) 2)
⊢ ∀ (m : A ⊗[R] V),
    (TensorProduct.AlgebraTensorModule.map LinearMap.id (ι Q)) m *
        (TensorProduct.AlgebraTensorModule.map LinearMap.id (ι Q)) m =
      (algebraMap A (A ⊗[R] CliffordAlgebra Q)) ((QuadraticForm.baseChange A Q) m)

Next tactic:
suffices hpure_tensor : ∀ v w, (1 * 1) ⊗ₜ[R] (ι Q v * ι Q w) + (1 * 1) ⊗ₜ[R] (ι Q w * ι Q v) =
        QuadraticForm.polarBilin (Q.baseChange A) (1 ⊗ₜ[R] v) (1 ⊗ₜ[R] w) ⊗ₜ[R] 1 by
      -- the crux is that by converting to a statement about linear maps instead of quadratic forms,
      -- we then have access to all the partially-applied `ext` lemmas.
      rw [CliffordAlgebra.forall_mul_self_eq_iff (isUnit_of_invertible _)]
      refine TensorProduct.AlgebraTensorModule.curry_injective ?_
      ext v w
      exact hpure_tensor v w
/-- Convert from the clifford algebra over a base-changed module to the base-changed clifford
algebra. -/
-- `noncomputable` is a performance workaround for mathlib4#7103
noncomputable def toBaseChange (Q : QuadraticForm R V) :
    CliffordAlgebra (Q.baseChange A) →ₐ[A] A ⊗[R] CliffordAlgebra Q :=
  CliffordAlgebra.lift _ <| by
    refine ⟨TensorProduct.AlgebraTensorModule.map (LinearMap.id : A →ₗ[A] A) (ι Q), ?_⟩
    letI : Invertible (2 : A) := (Invertible.map (algebraMap R A) 2).copy 2 (map_ofNat _ _).symm
    letI : Invertible (2 : A ⊗[R] CliffordAlgebra Q) :=
      (Invertible.map (algebraMap R _) 2).copy 2 (map_ofNat _ _).symm
    suffices hpure_tensor : ∀ v w, (1 * 1) ⊗ₜ[R] (ι Q v * ι Q w) + (1 * 1) ⊗ₜ[R] (ι Q w * ι Q v) =
        QuadraticForm.polarBilin (Q.baseChange A) (1 ⊗ₜ[R] v) (1 ⊗ₜ[R] w) ⊗ₜ[R] 1 by
      -- the crux is that by converting to a statement about linear maps instead of quadratic forms,
      -- we then have access to all the partially-applied `ext` lemmas.
      

Proof state:
R : Type u_1
A : Type u_2
V : Type u_3
inst✝⁷ : CommRing R
inst✝⁶ : CommRing A
inst✝⁵ : AddCommGroup V
inst✝⁴ : Algebra R A
inst✝³ : Module R V
inst✝² : Module A V
inst✝¹ : IsScalarTower R A V
inst✝ : Invertible 2
Q : QuadraticForm R V
this✝ : Invertible 2 := Invertible.copy (Invertible.map (algebraMap R A) 2) 2 (_ : 2 = (algebraMap R A) 2)
this : Invertible 2 :=
  Invertible.copy (Invertible.map (algebraMap R (A ⊗[R] CliffordAlgebra Q)) 2) 2
    (_ : 2 = (algebraMap R (A ⊗[R] CliffordAlgebra Q)) 2)
hpure_tensor :
  ∀ (v w : V),
    (1 * 1) ⊗ₜ[R] ((ι Q) v * (ι Q) w) + (1 * 1) ⊗ₜ[R] ((ι Q) w * (ι Q) v) =
      BilinForm.bilin (QuadraticForm.polarBilin (QuadraticForm.baseChange A Q)) (1 ⊗ₜ[R] v) (1 ⊗ₜ[R] w) ⊗ₜ[R] 1
⊢ ∀ (m : A ⊗[R] V),
    (TensorProduct.AlgebraTensorModule.map LinearMap.id (ι Q)) m *
        (TensorProduct.AlgebraTensorModule.map LinearMap.id (ι Q)) m =
      (algebraMap A (A ⊗[R] CliffordAlgebra Q)) ((QuadraticForm.baseChange A Q) m)

Next tactic:
rw [CliffordAlgebra.forall_mul_self_eq_iff (isUnit_of_invertible _)]
/-- Convert from the clifford algebra over a base-changed module to the base-changed clifford
algebra. -/
-- `noncomputable` is a performance workaround for mathlib4#7103
noncomputable def toBaseChange (Q : QuadraticForm R V) :
    CliffordAlgebra (Q.baseChange A) →ₐ[A] A ⊗[R] CliffordAlgebra Q :=
  CliffordAlgebra.lift _ <| by
    refine ⟨TensorProduct.AlgebraTensorModule.map (LinearMap.id : A →ₗ[A] A) (ι Q), ?_⟩
    letI : Invertible (2 : A) := (Invertible.map (algebraMap R A) 2).copy 2 (map_ofNat _ _).symm
    letI : Invertible (2 : A ⊗[R] CliffordAlgebra Q) :=
      (Invertible.map (algebraMap R _) 2).copy 2 (map_ofNat _ _).symm
    suffices hpure_tensor : ∀ v w, (1 * 1) ⊗ₜ[R] (ι Q v * ι Q w) + (1 * 1) ⊗ₜ[R] (ι Q w * ι Q v) =
        QuadraticForm.polarBilin (Q.baseChange A) (1 ⊗ₜ[R] v) (1 ⊗ₜ[R] w) ⊗ₜ[R] 1 by
      -- the crux is that by converting to a statement about linear maps instead of quadratic forms,
      -- we then have access to all the partially-applied `ext` lemmas.
      rw [CliffordAlgebra.forall_mul_self_eq_iff (isUnit_of_invertible _)]
      

Proof state:
R : Type u_1
A : Type u_2
V : Type u_3
inst✝⁷ : CommRing R
inst✝⁶ : CommRing A
inst✝⁵ : AddCommGroup V
inst✝⁴ : Algebra R A
inst✝³ : Module R V
inst✝² : Module A V
inst✝¹ : IsScalarTower R A V
inst✝ : Invertible 2
Q : QuadraticForm R V
this✝ : Invertible 2 := Invertible.copy (Invertible.map (algebraMap R A) 2) 2 (_ : 2 = (algebraMap R A) 2)
this : Invertible 2 :=
  Invertible.copy (Invertible.map (algebraMap R (A ⊗[R] CliffordAlgebra Q)) 2) 2
    (_ : 2 = (algebraMap R (A ⊗[R] CliffordAlgebra Q)) 2)
hpure_tensor :
  ∀ (v w : V),
    (1 * 1) ⊗ₜ[R] ((ι Q) v * (ι Q) w) + (1 * 1) ⊗ₜ[R] ((ι Q) w * (ι Q) v) =
      BilinForm.bilin (QuadraticForm.polarBilin (QuadraticForm.baseChange A Q)) (1 ⊗ₜ[R] v) (1 ⊗ₜ[R] w) ⊗ₜ[R] 1
⊢ LinearMap.compl₂ (LinearMap.mul A (A ⊗[R] CliffordAlgebra Q))
          (TensorProduct.AlgebraTensorModule.map LinearMap.id (ι Q)) ∘ₗ
        TensorProduct.AlgebraTensorModule.map LinearMap.id (ι Q) +
      LinearMap.compl₂ (LinearMap.flip (LinearMap.mul A (A ⊗[R] CliffordAlgebra Q)))
          (TensorProduct.AlgebraTensorModule.map LinearMap.id (ι Q)) ∘ₗ
        TensorProduct.AlgebraTensorModule.map LinearMap.id (ι Q) =
    LinearMap.compr₂ (BilinForm.toLin (QuadraticForm.polarBilin (QuadraticForm.baseChange A Q)))
      (Algebra.linearMap A (A ⊗[R] CliffordAlgebra Q))

Next tactic:
refine TensorProduct.AlgebraTensorModule.curry_injective ?_
/-- Convert from the clifford algebra over a base-changed module to the base-changed clifford
algebra. -/
-- `noncomputable` is a performance workaround for mathlib4#7103
noncomputable def toBaseChange (Q : QuadraticForm R V) :
    CliffordAlgebra (Q.baseChange A) →ₐ[A] A ⊗[R] CliffordAlgebra Q :=
  CliffordAlgebra.lift _ <| by
    refine ⟨TensorProduct.AlgebraTensorModule.map (LinearMap.id : A →ₗ[A] A) (ι Q), ?_⟩
    letI : Invertible (2 : A) := (Invertible.map (algebraMap R A) 2).copy 2 (map_ofNat _ _).symm
    letI : Invertible (2 : A ⊗[R] CliffordAlgebra Q) :=
      (Invertible.map (algebraMap R _) 2).copy 2 (map_ofNat _ _).symm
    suffices hpure_tensor : ∀ v w, (1 * 1) ⊗ₜ[R] (ι Q v * ι Q w) + (1 * 1) ⊗ₜ[R] (ι Q w * ι Q v) =
        QuadraticForm.polarBilin (Q.baseChange A) (1 ⊗ₜ[R] v) (1 ⊗ₜ[R] w) ⊗ₜ[R] 1 by
      -- the crux is that by converting to a statement about linear maps instead of quadratic forms,
      -- we then have access to all the partially-applied `ext` lemmas.
      rw [CliffordAlgebra.forall_mul_self_eq_iff (isUnit_of_invertible _)]
      refine TensorProduct.AlgebraTensorModule.curry_injective ?_
      

Proof state:
R : Type u_1
A : Type u_2
V : Type u_3
inst✝⁷ : CommRing R
inst✝⁶ : CommRing A
inst✝⁵ : AddCommGroup V
inst✝⁴ : Algebra R A
inst✝³ : Module R V
inst✝² : Module A V
inst✝¹ : IsScalarTower R A V
inst✝ : Invertible 2
Q : QuadraticForm R V
this✝ : Invertible 2 := Invertible.copy (Invertible.map (algebraMap R A) 2) 2 (_ : 2 = (algebraMap R A) 2)
this : Invertible 2 :=
  Invertible.copy (Invertible.map (algebraMap R (A ⊗[R] CliffordAlgebra Q)) 2) 2
    (_ : 2 = (algebraMap R (A ⊗[R] CliffordAlgebra Q)) 2)
hpure_tensor :
  ∀ (v w : V),
    (1 * 1) ⊗ₜ[R] ((ι Q) v * (ι Q) w) + (1 * 1) ⊗ₜ[R] ((ι Q) w * (ι Q) v) =
      BilinForm.bilin (QuadraticForm.polarBilin (QuadraticForm.baseChange A Q)) (1 ⊗ₜ[R] v) (1 ⊗ₜ[R] w) ⊗ₜ[R] 1
⊢ TensorProduct.AlgebraTensorModule.curry
      (LinearMap.compl₂ (LinearMap.mul A (A ⊗[R] CliffordAlgebra Q))
            (TensorProduct.AlgebraTensorModule.map LinearMap.id (ι Q)) ∘ₗ
          TensorProduct.AlgebraTensorModule.map LinearMap.id (ι Q) +
        LinearMap.compl₂ (LinearMap.flip (LinearMap.mul A (A ⊗[R] CliffordAlgebra Q)))
            (TensorProduct.AlgebraTensorModule.map LinearMap.id (ι Q)) ∘ₗ
          TensorProduct.AlgebraTensorModule.map LinearMap.id (ι Q)) =
    TensorProduct.AlgebraTensorModule.curry
      (LinearMap.compr₂ (BilinForm.toLin (QuadraticForm.polarBilin (QuadraticForm.baseChange A Q)))
        (Algebra.linearMap A (A ⊗[R] CliffordAlgebra Q)))

Next tactic:
ext v w
/-- Convert from the clifford algebra over a base-changed module to the base-changed clifford
algebra. -/
-- `noncomputable` is a performance workaround for mathlib4#7103
noncomputable def toBaseChange (Q : QuadraticForm R V) :
    CliffordAlgebra (Q.baseChange A) →ₐ[A] A ⊗[R] CliffordAlgebra Q :=
  CliffordAlgebra.lift _ <| by
    refine ⟨TensorProduct.AlgebraTensorModule.map (LinearMap.id : A →ₗ[A] A) (ι Q), ?_⟩
    letI : Invertible (2 : A) := (Invertible.map (algebraMap R A) 2).copy 2 (map_ofNat _ _).symm
    letI : Invertible (2 : A ⊗[R] CliffordAlgebra Q) :=
      (Invertible.map (algebraMap R _) 2).copy 2 (map_ofNat _ _).symm
    suffices hpure_tensor : ∀ v w, (1 * 1) ⊗ₜ[R] (ι Q v * ι Q w) + (1 * 1) ⊗ₜ[R] (ι Q w * ι Q v) =
        QuadraticForm.polarBilin (Q.baseChange A) (1 ⊗ₜ[R] v) (1 ⊗ₜ[R] w) ⊗ₜ[R] 1 by
      -- the crux is that by converting to a statement about linear maps instead of quadratic forms,
      -- we then have access to all the partially-applied `ext` lemmas.
      rw [CliffordAlgebra.forall_mul_self_eq_iff (isUnit_of_invertible _)]
      refine TensorProduct.AlgebraTensorModule.curry_injective ?_
      ext v w
      

Proof state:
case h.h.a.h.h
R : Type u_1
A : Type u_2
V : Type u_3
inst✝⁷ : CommRing R
inst✝⁶ : CommRing A
inst✝⁵ : AddCommGroup V
inst✝⁴ : Algebra R A
inst✝³ : Module R V
inst✝² : Module A V
inst✝¹ : IsScalarTower R A V
inst✝ : Invertible 2
Q : QuadraticForm R V
this✝ : Invertible 2 := Invertible.copy (Invertible.map (algebraMap R A) 2) 2 (_ : 2 = (algebraMap R A) 2)
this : Invertible 2 :=
  Invertible.copy (Invertible.map (algebraMap R (A ⊗[R] CliffordAlgebra Q)) 2) 2
    (_ : 2 = (algebraMap R (A ⊗[R] CliffordAlgebra Q)) 2)
hpure_tensor :
  ∀ (v w : V),
    (1 * 1) ⊗ₜ[R] ((ι Q) v * (ι Q) w) + (1 * 1) ⊗ₜ[R] ((ι Q) w * (ι Q) v) =
      BilinForm.bilin (QuadraticForm.polarBilin (QuadraticForm.baseChange A Q)) (1 ⊗ₜ[R] v) (1 ⊗ₜ[R] w) ⊗ₜ[R] 1
v w : V
⊢ ((TensorProduct.AlgebraTensorModule.curry
          (((TensorProduct.AlgebraTensorModule.curry
                (LinearMap.compl₂ (LinearMap.mul A (A ⊗[R] CliffordAlgebra Q))
                      (TensorProduct.AlgebraTensorModule.map LinearMap.id (ι Q)) ∘ₗ
                    TensorProduct.AlgebraTensorModule.map LinearMap.id (ι Q) +
                  LinearMap.compl₂ (LinearMap.flip (LinearMap.mul A (A ⊗[R] CliffordAlgebra Q)))
                      (TensorProduct.AlgebraTensorModule.map LinearMap.id (ι Q)) ∘ₗ
                    TensorProduct.AlgebraTensorModule.map LinearMap.id (ι Q)))
              1)
            v))
        1)
      w =
    ((TensorProduct.AlgebraTensorModule.curry
          (((TensorProduct.AlgebraTensorModule.curry
                (LinearMap.compr₂ (BilinForm.toLin (QuadraticForm.polarBilin (QuadraticForm.baseChange A Q)))
                  (Algebra.linearMap A (A ⊗[R] CliffordAlgebra Q))))
              1)
            v))
        1)
      w

Next tactic:
exact hpure_tensor v w
/-- Convert from the clifford algebra over a base-changed module to the base-changed clifford
algebra. -/
-- `noncomputable` is a performance workaround for mathlib4#7103
noncomputable def toBaseChange (Q : QuadraticForm R V) :
    CliffordAlgebra (Q.baseChange A) →ₐ[A] A ⊗[R] CliffordAlgebra Q :=
  CliffordAlgebra.lift _ <| by
    refine ⟨TensorProduct.AlgebraTensorModule.map (LinearMap.id : A →ₗ[A] A) (ι Q), ?_⟩
    letI : Invertible (2 : A) := (Invertible.map (algebraMap R A) 2).copy 2 (map_ofNat _ _).symm
    letI : Invertible (2 : A ⊗[R] CliffordAlgebra Q) :=
      (Invertible.map (algebraMap R _) 2).copy 2 (map_ofNat _ _).symm
    suffices hpure_tensor : ∀ v w, (1 * 1) ⊗ₜ[R] (ι Q v * ι Q w) + (1 * 1) ⊗ₜ[R] (ι Q w * ι Q v) =
        QuadraticForm.polarBilin (Q.baseChange A) (1 ⊗ₜ[R] v) (1 ⊗ₜ[R] w) ⊗ₜ[R] 1 by
      -- the crux is that by converting to a statement about linear maps instead of quadratic forms,
      -- we then have access to all the partially-applied `ext` lemmas.
      rw [CliffordAlgebra.forall_mul_self_eq_iff (isUnit_of_invertible _)]
      refine TensorProduct.AlgebraTensorModule.curry_injective ?_
      ext v w
      exact hpure_tensor v w
    

Proof state:
R : Type u_1
A : Type u_2
V : Type u_3
inst✝⁷ : CommRing R
inst✝⁶ : CommRing A
inst✝⁵ : AddCommGroup V
inst✝⁴ : Algebra R A
inst✝³ : Module R V
inst✝² : Module A V
inst✝¹ : IsScalarTower R A V
inst✝ : Invertible 2
Q : QuadraticForm R V
this✝ : Invertible 2 := Invertible.copy (Invertible.map (algebraMap R A) 2) 2 (_ : 2 = (algebraMap R A) 2)
this : Invertible 2 :=
  Invertible.copy (Invertible.map (algebraMap R (A ⊗[R] CliffordAlgebra Q)) 2) 2
    (_ : 2 = (algebraMap R (A ⊗[R] CliffordAlgebra Q)) 2)
⊢ ∀ (v w : V),
    (1 * 1) ⊗ₜ[R] ((ι Q) v * (ι Q) w) + (1 * 1) ⊗ₜ[R] ((ι Q) w * (ι Q) v) =
      BilinForm.bilin (QuadraticForm.polarBilin (QuadraticForm.baseChange A Q)) (1 ⊗ₜ[R] v) (1 ⊗ₜ[R] w) ⊗ₜ[R] 1

Next tactic:
intros v w
/-- Convert from the clifford algebra over a base-changed module to the base-changed clifford
algebra. -/
-- `noncomputable` is a performance workaround for mathlib4#7103
noncomputable def toBaseChange (Q : QuadraticForm R V) :
    CliffordAlgebra (Q.baseChange A) →ₐ[A] A ⊗[R] CliffordAlgebra Q :=
  CliffordAlgebra.lift _ <| by
    refine ⟨TensorProduct.AlgebraTensorModule.map (LinearMap.id : A →ₗ[A] A) (ι Q), ?_⟩
    letI : Invertible (2 : A) := (Invertible.map (algebraMap R A) 2).copy 2 (map_ofNat _ _).symm
    letI : Invertible (2 : A ⊗[R] CliffordAlgebra Q) :=
      (Invertible.map (algebraMap R _) 2).copy 2 (map_ofNat _ _).symm
    suffices hpure_tensor : ∀ v w, (1 * 1) ⊗ₜ[R] (ι Q v * ι Q w) + (1 * 1) ⊗ₜ[R] (ι Q w * ι Q v) =
        QuadraticForm.polarBilin (Q.baseChange A) (1 ⊗ₜ[R] v) (1 ⊗ₜ[R] w) ⊗ₜ[R] 1 by
      -- the crux is that by converting to a statement about linear maps instead of quadratic forms,
      -- we then have access to all the partially-applied `ext` lemmas.
      rw [CliffordAlgebra.forall_mul_self_eq_iff (isUnit_of_invertible _)]
      refine TensorProduct.AlgebraTensorModule.curry_injective ?_
      ext v w
      exact hpure_tensor v w
    intros v w
    

Proof state:
R : Type u_1
A : Type u_2
V : Type u_3
inst✝⁷ : CommRing R
inst✝⁶ : CommRing A
inst✝⁵ : AddCommGroup V
inst✝⁴ : Algebra R A
inst✝³ : Module R V
inst✝² : Module A V
inst✝¹ : IsScalarTower R A V
inst✝ : Invertible 2
Q : QuadraticForm R V
this✝ : Invertible 2 := Invertible.copy (Invertible.map (algebraMap R A) 2) 2 (_ : 2 = (algebraMap R A) 2)
this : Invertible 2 :=
  Invertible.copy (Invertible.map (algebraMap R (A ⊗[R] CliffordAlgebra Q)) 2) 2
    (_ : 2 = (algebraMap R (A ⊗[R] CliffordAlgebra Q)) 2)
v w : V
⊢ (1 * 1) ⊗ₜ[R] ((ι Q) v * (ι Q) w) + (1 * 1) ⊗ₜ[R] ((ι Q) w * (ι Q) v) =
    BilinForm.bilin (QuadraticForm.polarBilin (QuadraticForm.baseChange A Q)) (1 ⊗ₜ[R] v) (1 ⊗ₜ[R] w) ⊗ₜ[R] 1

Next tactic:
rw [← TensorProduct.tmul_add, CliffordAlgebra.ι_mul_ι_add_swap,
      QuadraticForm.polarBilin_baseChange, BilinForm.baseChange_tmul, one_mul,
      TensorProduct.smul_tmul, Algebra.algebraMap_eq_smul_one, QuadraticForm.polarBilin_apply]
theorem toBaseChange_comp_involute (Q : QuadraticForm R V) :
    (toBaseChange A Q).comp (involute : CliffordAlgebra (Q.baseChange A) →ₐ[A] _) =
      (Algebra.TensorProduct.map (AlgHom.id _ _) involute).comp (toBaseChange A Q) := by
  

Proof state:
R : Type u_1
A : Type u_2
V : Type u_3
inst✝⁷ : CommRing R
inst✝⁶ : CommRing A
inst✝⁵ : AddCommGroup V
inst✝⁴ : Algebra R A
inst✝³ : Module R V
inst✝² : Module A V
inst✝¹ : IsScalarTower R A V
inst✝ : Invertible 2
Q : QuadraticForm R V
⊢ AlgHom.comp (toBaseChange A Q) involute =
    AlgHom.comp (Algebra.TensorProduct.map (AlgHom.id A A) involute) (toBaseChange A Q)

Next tactic:
ext v
theorem toBaseChange_comp_involute (Q : QuadraticForm R V) :
    (toBaseChange A Q).comp (involute : CliffordAlgebra (Q.baseChange A) →ₐ[A] _) =
      (Algebra.TensorProduct.map (AlgHom.id _ _) involute).comp (toBaseChange A Q) := by
  ext v
  

Proof state:
case a.a.h.h
R : Type u_1
A : Type u_2
V : Type u_3
inst✝⁷ : CommRing R
inst✝⁶ : CommRing A
inst✝⁵ : AddCommGroup V
inst✝⁴ : Algebra R A
inst✝³ : Module R V
inst✝² : Module A V
inst✝¹ : IsScalarTower R A V
inst✝ : Invertible 2
Q : QuadraticForm R V
v : V
⊢ ((TensorProduct.AlgebraTensorModule.curry
          (AlgHom.toLinearMap (AlgHom.comp (toBaseChange A Q) involute) ∘ₗ ι (QuadraticForm.baseChange A Q)))
        1)
      v =
    ((TensorProduct.AlgebraTensorModule.curry
          (AlgHom.toLinearMap (AlgHom.comp (Algebra.TensorProduct.map (AlgHom.id A A) involute) (toBaseChange A Q)) ∘ₗ
            ι (QuadraticForm.baseChange A Q)))
        1)
      v

Next tactic:
show toBaseChange A Q (involute (ι (Q.baseChange A) (1 ⊗ₜ[R] v)))
    = (Algebra.TensorProduct.map (AlgHom.id _ _) involute :
        A ⊗[R] CliffordAlgebra Q →ₐ[A] _)
      (toBaseChange A Q (ι (Q.baseChange A) (1 ⊗ₜ[R] v)))
theorem toBaseChange_comp_involute (Q : QuadraticForm R V) :
    (toBaseChange A Q).comp (involute : CliffordAlgebra (Q.baseChange A) →ₐ[A] _) =
      (Algebra.TensorProduct.map (AlgHom.id _ _) involute).comp (toBaseChange A Q) := by
  ext v
  show toBaseChange A Q (involute (ι (Q.baseChange A) (1 ⊗ₜ[R] v)))
    = (Algebra.TensorProduct.map (AlgHom.id _ _) involute :
        A ⊗[R] CliffordAlgebra Q →ₐ[A] _)
      (toBaseChange A Q (ι (Q.baseChange A) (1 ⊗ₜ[R] v)))
  

Proof state:
case a.a.h.h
R : Type u_1
A : Type u_2
V : Type u_3
inst✝⁷ : CommRing R
inst✝⁶ : CommRing A
inst✝⁵ : AddCommGroup V
inst✝⁴ : Algebra R A
inst✝³ : Module R V
inst✝² : Module A V
inst✝¹ : IsScalarTower R A V
inst✝ : Invertible 2
Q : QuadraticForm R V
v : V
⊢ (toBaseChange A Q) (involute ((ι (QuadraticForm.baseChange A Q)) (1 ⊗ₜ[R] v))) =
    (Algebra.TensorProduct.map (AlgHom.id A A) involute)
      ((toBaseChange A Q) ((ι (QuadraticForm.baseChange A Q)) (1 ⊗ₜ[R] v)))

Next tactic:
rw [toBaseChange_ι, involute_ι, map_neg (toBaseChange A Q), toBaseChange_ι,
    Algebra.TensorProduct.map_tmul, AlgHom.id_apply, involute_ι, TensorProduct.tmul_neg]
/-- Auxiliary theorem used to prove `toBaseChange_reverse` without needing induction. -/
theorem toBaseChange_comp_reverseOp (Q : QuadraticForm R V) :
    (toBaseChange A Q).op.comp (reverseOp) =
      ((Algebra.TensorProduct.opAlgEquiv R A A (CliffordAlgebra Q)).toAlgHom.comp <|
        (Algebra.TensorProduct.map
          (AlgEquiv.toOpposite A A).toAlgHom (reverseOp (Q := Q))).comp
        (toBaseChange A Q)) := by
  

Proof state:
R : Type u_1
A : Type u_2
V : Type u_3
inst✝⁷ : CommRing R
inst✝⁶ : CommRing A
inst✝⁵ : AddCommGroup V
inst✝⁴ : Algebra R A
inst✝³ : Module R V
inst✝² : Module A V
inst✝¹ : IsScalarTower R A V
inst✝ : Invertible 2
Q : QuadraticForm R V
⊢ AlgHom.comp (AlgHom.op (toBaseChange A Q)) reverseOp =
    AlgHom.comp (↑(Algebra.TensorProduct.opAlgEquiv R A A (CliffordAlgebra Q)))
      (AlgHom.comp (Algebra.TensorProduct.map (↑(AlgEquiv.toOpposite A A)) reverseOp) (toBaseChange A Q))

Next tactic:
ext v
/-- Auxiliary theorem used to prove `toBaseChange_reverse` without needing induction. -/
theorem toBaseChange_comp_reverseOp (Q : QuadraticForm R V) :
    (toBaseChange A Q).op.comp (reverseOp) =
      ((Algebra.TensorProduct.opAlgEquiv R A A (CliffordAlgebra Q)).toAlgHom.comp <|
        (Algebra.TensorProduct.map
          (AlgEquiv.toOpposite A A).toAlgHom (reverseOp (Q := Q))).comp
        (toBaseChange A Q)) := by
  ext v
  

Proof state:
case a.a.h.h
R : Type u_1
A : Type u_2
V : Type u_3
inst✝⁷ : CommRing R
inst✝⁶ : CommRing A
inst✝⁵ : AddCommGroup V
inst✝⁴ : Algebra R A
inst✝³ : Module R V
inst✝² : Module A V
inst✝¹ : IsScalarTower R A V
inst✝ : Invertible 2
Q : QuadraticForm R V
v : V
⊢ ((TensorProduct.AlgebraTensorModule.curry
          (AlgHom.toLinearMap (AlgHom.comp (AlgHom.op (toBaseChange A Q)) reverseOp) ∘ₗ
            ι (QuadraticForm.baseChange A Q)))
        1)
      v =
    ((TensorProduct.AlgebraTensorModule.curry
          (AlgHom.toLinearMap
              (AlgHom.comp (↑(Algebra.TensorProduct.opAlgEquiv R A A (CliffordAlgebra Q)))
                (AlgHom.comp (Algebra.TensorProduct.map (↑(AlgEquiv.toOpposite A A)) reverseOp) (toBaseChange A Q))) ∘ₗ
            ι (QuadraticForm.baseChange A Q)))
        1)
      v

Next tactic:
show op (toBaseChange A Q (reverse (ι (Q.baseChange A) (1 ⊗ₜ[R] v)))) =
    Algebra.TensorProduct.opAlgEquiv R A A (CliffordAlgebra Q)
      (Algebra.TensorProduct.map (AlgEquiv.toOpposite A A).toAlgHom (reverseOp (Q := Q))
        (toBaseChange A Q (ι (Q.baseChange A) (1 ⊗ₜ[R] v))))
/-- Auxiliary theorem used to prove `toBaseChange_reverse` without needing induction. -/
theorem toBaseChange_comp_reverseOp (Q : QuadraticForm R V) :
    (toBaseChange A Q).op.comp (reverseOp) =
      ((Algebra.TensorProduct.opAlgEquiv R A A (CliffordAlgebra Q)).toAlgHom.comp <|
        (Algebra.TensorProduct.map
          (AlgEquiv.toOpposite A A).toAlgHom (reverseOp (Q := Q))).comp
        (toBaseChange A Q)) := by
  ext v
  show op (toBaseChange A Q (reverse (ι (Q.baseChange A) (1 ⊗ₜ[R] v)))) =
    Algebra.TensorProduct.opAlgEquiv R A A (CliffordAlgebra Q)
      (Algebra.TensorProduct.map (AlgEquiv.toOpposite A A).toAlgHom (reverseOp (Q := Q))
        (toBaseChange A Q (ι (Q.baseChange A) (1 ⊗ₜ[R] v))))
  

Proof state:
case a.a.h.h
R : Type u_1
A : Type u_2
V : Type u_3
inst✝⁷ : CommRing R
inst✝⁶ : CommRing A
inst✝⁵ : AddCommGroup V
inst✝⁴ : Algebra R A
inst✝³ : Module R V
inst✝² : Module A V
inst✝¹ : IsScalarTower R A V
inst✝ : Invertible 2
Q : QuadraticForm R V
v : V
⊢ op ((toBaseChange A Q) (reverse ((ι (QuadraticForm.baseChange A Q)) (1 ⊗ₜ[R] v)))) =
    (Algebra.TensorProduct.opAlgEquiv R A A (CliffordAlgebra Q))
      ((Algebra.TensorProduct.map (↑(AlgEquiv.toOpposite A A)) reverseOp)
        ((toBaseChange A Q) ((ι (QuadraticForm.baseChange A Q)) (1 ⊗ₜ[R] v))))

Next tactic:
rw [toBaseChange_ι, reverse_ι, toBaseChange_ι, Algebra.TensorProduct.map_tmul,
    Algebra.TensorProduct.opAlgEquiv_tmul, reverseOp_ι]
/-- Auxiliary theorem used to prove `toBaseChange_reverse` without needing induction. -/
theorem toBaseChange_comp_reverseOp (Q : QuadraticForm R V) :
    (toBaseChange A Q).op.comp (reverseOp) =
      ((Algebra.TensorProduct.opAlgEquiv R A A (CliffordAlgebra Q)).toAlgHom.comp <|
        (Algebra.TensorProduct.map
          (AlgEquiv.toOpposite A A).toAlgHom (reverseOp (Q := Q))).comp
        (toBaseChange A Q)) := by
  ext v
  show op (toBaseChange A Q (reverse (ι (Q.baseChange A) (1 ⊗ₜ[R] v)))) =
    Algebra.TensorProduct.opAlgEquiv R A A (CliffordAlgebra Q)
      (Algebra.TensorProduct.map (AlgEquiv.toOpposite A A).toAlgHom (reverseOp (Q := Q))
        (toBaseChange A Q (ι (Q.baseChange A) (1 ⊗ₜ[R] v))))
  rw [toBaseChange_ι, reverse_ι, toBaseChange_ι, Algebra.TensorProduct.map_tmul,
    Algebra.TensorProduct.opAlgEquiv_tmul, reverseOp_ι]
  

Proof state:
case a.a.h.h
R : Type u_1
A : Type u_2
V : Type u_3
inst✝⁷ : CommRing R
inst✝⁶ : CommRing A
inst✝⁵ : AddCommGroup V
inst✝⁴ : Algebra R A
inst✝³ : Module R V
inst✝² : Module A V
inst✝¹ : IsScalarTower R A V
inst✝ : Invertible 2
Q : QuadraticForm R V
v : V
⊢ op (1 ⊗ₜ[R] (ι Q) v) = op (unop (↑(AlgEquiv.toOpposite A A) 1) ⊗ₜ[R] unop (op ((ι Q) v)))

Next tactic:
rfl