l3lab/ntp-mathlib huggingface dataset:
theorem trace_eq_sum_automorphisms (x : L) [FiniteDimensional K L] [IsGalois K L] :
    algebraMap K L (Algebra.trace K L x) = ∑ σ : L ≃ₐ[K] L, σ x := by
  

Proof state:
R : Type u_1
S : Type u_2
T : Type u_3
inst✝²⁰ : CommRing R
inst✝¹⁹ : CommRing S
inst✝¹⁸ : CommRing T
inst✝¹⁷ : Algebra R S
inst✝¹⁶ : Algebra R T
K : Type u_4
L : Type u_5
inst✝¹⁵ : Field K
inst✝¹⁴ : Field L
inst✝¹³ : Algebra K L
ι κ : Type w
inst✝¹² : Fintype ι
F : Type u_6
inst✝¹¹ : Field F
inst✝¹⁰ : Algebra R L
inst✝⁹ : Algebra L F
inst✝⁸ : Algebra R F
inst✝⁷ : IsScalarTower R L F
inst✝⁶ : Algebra K F
inst✝⁵ : IsScalarTower K L F
E : Type u_7
inst✝⁴ : Field E
inst✝³ : Algebra K E
inst✝² : IsAlgClosed E
x : L
inst✝¹ : FiniteDimensional K L
inst✝ : IsGalois K L
⊢ (algebraMap K L) ((Algebra.trace K L) x) = ∑ σ : L ≃ₐ[K] L, σ x

Next tactic:
apply NoZeroSMulDivisors.algebraMap_injective L (AlgebraicClosure L)
theorem trace_eq_sum_automorphisms (x : L) [FiniteDimensional K L] [IsGalois K L] :
    algebraMap K L (Algebra.trace K L x) = ∑ σ : L ≃ₐ[K] L, σ x := by
  apply NoZeroSMulDivisors.algebraMap_injective L (AlgebraicClosure L)
  

Proof state:
case a
R : Type u_1
S : Type u_2
T : Type u_3
inst✝²⁰ : CommRing R
inst✝¹⁹ : CommRing S
inst✝¹⁸ : CommRing T
inst✝¹⁷ : Algebra R S
inst✝¹⁶ : Algebra R T
K : Type u_4
L : Type u_5
inst✝¹⁵ : Field K
inst✝¹⁴ : Field L
inst✝¹³ : Algebra K L
ι κ : Type w
inst✝¹² : Fintype ι
F : Type u_6
inst✝¹¹ : Field F
inst✝¹⁰ : Algebra R L
inst✝⁹ : Algebra L F
inst✝⁸ : Algebra R F
inst✝⁷ : IsScalarTower R L F
inst✝⁶ : Algebra K F
inst✝⁵ : IsScalarTower K L F
E : Type u_7
inst✝⁴ : Field E
inst✝³ : Algebra K E
inst✝² : IsAlgClosed E
x : L
inst✝¹ : FiniteDimensional K L
inst✝ : IsGalois K L
⊢ (algebraMap L (AlgebraicClosure L)) ((algebraMap K L) ((Algebra.trace K L) x)) =
    (algebraMap L (AlgebraicClosure L)) (∑ σ : L ≃ₐ[K] L, σ x)

Next tactic:
rw [_root_.map_sum (algebraMap L (AlgebraicClosure L))]
theorem trace_eq_sum_automorphisms (x : L) [FiniteDimensional K L] [IsGalois K L] :
    algebraMap K L (Algebra.trace K L x) = ∑ σ : L ≃ₐ[K] L, σ x := by
  apply NoZeroSMulDivisors.algebraMap_injective L (AlgebraicClosure L)
  rw [_root_.map_sum (algebraMap L (AlgebraicClosure L))]
  

Proof state:
case a
R : Type u_1
S : Type u_2
T : Type u_3
inst✝²⁰ : CommRing R
inst✝¹⁹ : CommRing S
inst✝¹⁸ : CommRing T
inst✝¹⁷ : Algebra R S
inst✝¹⁶ : Algebra R T
K : Type u_4
L : Type u_5
inst✝¹⁵ : Field K
inst✝¹⁴ : Field L
inst✝¹³ : Algebra K L
ι κ : Type w
inst✝¹² : Fintype ι
F : Type u_6
inst✝¹¹ : Field F
inst✝¹⁰ : Algebra R L
inst✝⁹ : Algebra L F
inst✝⁸ : Algebra R F
inst✝⁷ : IsScalarTower R L F
inst✝⁶ : Algebra K F
inst✝⁵ : IsScalarTower K L F
E : Type u_7
inst✝⁴ : Field E
inst✝³ : Algebra K E
inst✝² : IsAlgClosed E
x : L
inst✝¹ : FiniteDimensional K L
inst✝ : IsGalois K L
⊢ (algebraMap L (AlgebraicClosure L)) ((algebraMap K L) ((Algebra.trace K L) x)) =
    ∑ x_1 : L ≃ₐ[K] L, (algebraMap L (AlgebraicClosure L)) (x_1 x)

Next tactic:
rw [← Fintype.sum_equiv (Normal.algHomEquivAut K (AlgebraicClosure L) L)]
theorem trace_eq_sum_automorphisms (x : L) [FiniteDimensional K L] [IsGalois K L] :
    algebraMap K L (Algebra.trace K L x) = ∑ σ : L ≃ₐ[K] L, σ x := by
  apply NoZeroSMulDivisors.algebraMap_injective L (AlgebraicClosure L)
  rw [_root_.map_sum (algebraMap L (AlgebraicClosure L))]
  rw [← Fintype.sum_equiv (Normal.algHomEquivAut K (AlgebraicClosure L) L)]
  · 

Proof state:
case a
R : Type u_1
S : Type u_2
T : Type u_3
inst✝²⁰ : CommRing R
inst✝¹⁹ : CommRing S
inst✝¹⁸ : CommRing T
inst✝¹⁷ : Algebra R S
inst✝¹⁶ : Algebra R T
K : Type u_4
L : Type u_5
inst✝¹⁵ : Field K
inst✝¹⁴ : Field L
inst✝¹³ : Algebra K L
ι κ : Type w
inst✝¹² : Fintype ι
F : Type u_6
inst✝¹¹ : Field F
inst✝¹⁰ : Algebra R L
inst✝⁹ : Algebra L F
inst✝⁸ : Algebra R F
inst✝⁷ : IsScalarTower R L F
inst✝⁶ : Algebra K F
inst✝⁵ : IsScalarTower K L F
E : Type u_7
inst✝⁴ : Field E
inst✝³ : Algebra K E
inst✝² : IsAlgClosed E
x : L
inst✝¹ : FiniteDimensional K L
inst✝ : IsGalois K L
⊢ (algebraMap L (AlgebraicClosure L)) ((algebraMap K L) ((Algebra.trace K L) x)) =
    ∑ x : L →ₐ[K] AlgebraicClosure L, ?a.f✝ x

Next tactic:
rw [← trace_eq_sum_embeddings (AlgebraicClosure L)]
theorem trace_eq_sum_automorphisms (x : L) [FiniteDimensional K L] [IsGalois K L] :
    algebraMap K L (Algebra.trace K L x) = ∑ σ : L ≃ₐ[K] L, σ x := by
  apply NoZeroSMulDivisors.algebraMap_injective L (AlgebraicClosure L)
  rw [_root_.map_sum (algebraMap L (AlgebraicClosure L))]
  rw [← Fintype.sum_equiv (Normal.algHomEquivAut K (AlgebraicClosure L) L)]
  · rw [← trace_eq_sum_embeddings (AlgebraicClosure L)]
    · 

Proof state:
case a
R : Type u_1
S : Type u_2
T : Type u_3
inst✝²⁰ : CommRing R
inst✝¹⁹ : CommRing S
inst✝¹⁸ : CommRing T
inst✝¹⁷ : Algebra R S
inst✝¹⁶ : Algebra R T
K : Type u_4
L : Type u_5
inst✝¹⁵ : Field K
inst✝¹⁴ : Field L
inst✝¹³ : Algebra K L
ι κ : Type w
inst✝¹² : Fintype ι
F : Type u_6
inst✝¹¹ : Field F
inst✝¹⁰ : Algebra R L
inst✝⁹ : Algebra L F
inst✝⁸ : Algebra R F
inst✝⁷ : IsScalarTower R L F
inst✝⁶ : Algebra K F
inst✝⁵ : IsScalarTower K L F
E : Type u_7
inst✝⁴ : Field E
inst✝³ : Algebra K E
inst✝² : IsAlgClosed E
x : L
inst✝¹ : FiniteDimensional K L
inst✝ : IsGalois K L
⊢ (algebraMap L (AlgebraicClosure L)) ((algebraMap K L) ((Algebra.trace K L) x)) =
    (algebraMap K (AlgebraicClosure L)) ((Algebra.trace K L) ?m.1141824)

Next tactic:
simp only [algebraMap_eq_smul_one]
theorem trace_eq_sum_automorphisms (x : L) [FiniteDimensional K L] [IsGalois K L] :
    algebraMap K L (Algebra.trace K L x) = ∑ σ : L ≃ₐ[K] L, σ x := by
  apply NoZeroSMulDivisors.algebraMap_injective L (AlgebraicClosure L)
  rw [_root_.map_sum (algebraMap L (AlgebraicClosure L))]
  rw [← Fintype.sum_equiv (Normal.algHomEquivAut K (AlgebraicClosure L) L)]
  · rw [← trace_eq_sum_embeddings (AlgebraicClosure L)]
    · simp only [algebraMap_eq_smul_one]
-- Porting note: `smul_one_smul` was in the `simp only`.
      

Proof state:
case a
R : Type u_1
S : Type u_2
T : Type u_3
inst✝²⁰ : CommRing R
inst✝¹⁹ : CommRing S
inst✝¹⁸ : CommRing T
inst✝¹⁷ : Algebra R S
inst✝¹⁶ : Algebra R T
K : Type u_4
L : Type u_5
inst✝¹⁵ : Field K
inst✝¹⁴ : Field L
inst✝¹³ : Algebra K L
ι κ : Type w
inst✝¹² : Fintype ι
F : Type u_6
inst✝¹¹ : Field F
inst✝¹⁰ : Algebra R L
inst✝⁹ : Algebra L F
inst✝⁸ : Algebra R F
inst✝⁷ : IsScalarTower R L F
inst✝⁶ : Algebra K F
inst✝⁵ : IsScalarTower K L F
E : Type u_7
inst✝⁴ : Field E
inst✝³ : Algebra K E
inst✝² : IsAlgClosed E
x : L
inst✝¹ : FiniteDimensional K L
inst✝ : IsGalois K L
⊢ ((Algebra.trace K L) x • 1) • 1 = (Algebra.trace K L) ?m.1141824 • 1

Next tactic:
apply smul_one_smul
theorem trace_eq_sum_automorphisms (x : L) [FiniteDimensional K L] [IsGalois K L] :
    algebraMap K L (Algebra.trace K L x) = ∑ σ : L ≃ₐ[K] L, σ x := by
  apply NoZeroSMulDivisors.algebraMap_injective L (AlgebraicClosure L)
  rw [_root_.map_sum (algebraMap L (AlgebraicClosure L))]
  rw [← Fintype.sum_equiv (Normal.algHomEquivAut K (AlgebraicClosure L) L)]
  · rw [← trace_eq_sum_embeddings (AlgebraicClosure L)]
    · simp only [algebraMap_eq_smul_one]
-- Porting note: `smul_one_smul` was in the `simp only`.
      apply smul_one_smul
  · 

Proof state:
case a.h
R : Type u_1
S : Type u_2
T : Type u_3
inst✝²⁰ : CommRing R
inst✝¹⁹ : CommRing S
inst✝¹⁸ : CommRing T
inst✝¹⁷ : Algebra R S
inst✝¹⁶ : Algebra R T
K : Type u_4
L : Type u_5
inst✝¹⁵ : Field K
inst✝¹⁴ : Field L
inst✝¹³ : Algebra K L
ι κ : Type w
inst✝¹² : Fintype ι
F : Type u_6
inst✝¹¹ : Field F
inst✝¹⁰ : Algebra R L
inst✝⁹ : Algebra L F
inst✝⁸ : Algebra R F
inst✝⁷ : IsScalarTower R L F
inst✝⁶ : Algebra K F
inst✝⁵ : IsScalarTower K L F
E : Type u_7
inst✝⁴ : Field E
inst✝³ : Algebra K E
inst✝² : IsAlgClosed E
x : L
inst✝¹ : FiniteDimensional K L
inst✝ : IsGalois K L
⊢ ∀ (x_1 : L →ₐ[K] AlgebraicClosure L),
    x_1 x = (algebraMap L (AlgebraicClosure L)) (((Normal.algHomEquivAut K (AlgebraicClosure L) L) x_1) x)

Next tactic:
intro σ
theorem trace_eq_sum_automorphisms (x : L) [FiniteDimensional K L] [IsGalois K L] :
    algebraMap K L (Algebra.trace K L x) = ∑ σ : L ≃ₐ[K] L, σ x := by
  apply NoZeroSMulDivisors.algebraMap_injective L (AlgebraicClosure L)
  rw [_root_.map_sum (algebraMap L (AlgebraicClosure L))]
  rw [← Fintype.sum_equiv (Normal.algHomEquivAut K (AlgebraicClosure L) L)]
  · rw [← trace_eq_sum_embeddings (AlgebraicClosure L)]
    · simp only [algebraMap_eq_smul_one]
-- Porting note: `smul_one_smul` was in the `simp only`.
      apply smul_one_smul
  · intro σ
    

Proof state:
case a.h
R : Type u_1
S : Type u_2
T : Type u_3
inst✝²⁰ : CommRing R
inst✝¹⁹ : CommRing S
inst✝¹⁸ : CommRing T
inst✝¹⁷ : Algebra R S
inst✝¹⁶ : Algebra R T
K : Type u_4
L : Type u_5
inst✝¹⁵ : Field K
inst✝¹⁴ : Field L
inst✝¹³ : Algebra K L
ι κ : Type w
inst✝¹² : Fintype ι
F : Type u_6
inst✝¹¹ : Field F
inst✝¹⁰ : Algebra R L
inst✝⁹ : Algebra L F
inst✝⁸ : Algebra R F
inst✝⁷ : IsScalarTower R L F
inst✝⁶ : Algebra K F
inst✝⁵ : IsScalarTower K L F
E : Type u_7
inst✝⁴ : Field E
inst✝³ : Algebra K E
inst✝² : IsAlgClosed E
x : L
inst✝¹ : FiniteDimensional K L
inst✝ : IsGalois K L
σ : L →ₐ[K] AlgebraicClosure L
⊢ σ x = (algebraMap L (AlgebraicClosure L)) (((Normal.algHomEquivAut K (AlgebraicClosure L) L) σ) x)

Next tactic:
simp only [Normal.algHomEquivAut, AlgHom.restrictNormal', Equiv.coe_fn_mk,
      AlgEquiv.coe_ofBijective, AlgHom.restrictNormal_commutes, id.map_eq_id, RingHom.id_apply]
theorem traceMatrix_reindex {κ' : Type*} (b : Basis κ A B) (f : κ ≃ κ') :
    traceMatrix A (b.reindex f) = reindex f f (traceMatrix A b) := by 

Proof state:
R : Type u_1
S : Type u_2
T : Type u_3
inst✝¹⁸ : CommRing R
inst✝¹⁷ : CommRing S
inst✝¹⁶ : CommRing T
inst✝¹⁵ : Algebra R S
inst✝¹⁴ : Algebra R T
K : Type u_4
L : Type u_5
inst✝¹³ : Field K
inst✝¹² : Field L
inst✝¹¹ : Algebra K L
ι κ : Type w
inst✝¹⁰ : Fintype ι
F : Type u_6
inst✝⁹ : Field F
inst✝⁸ : Algebra R L
inst✝⁷ : Algebra L F
inst✝⁶ : Algebra R F
inst✝⁵ : IsScalarTower R L F
A : Type u
B : Type v
C : Type z
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : Algebra A B
inst✝¹ : CommRing C
inst✝ : Algebra A C
κ' : Type u_7
b : Basis κ A B
f : κ ≃ κ'
⊢ traceMatrix A ⇑(Basis.reindex b f) = (reindex f f) (traceMatrix A ⇑b)

Next tactic:
ext (x y)
theorem traceMatrix_reindex {κ' : Type*} (b : Basis κ A B) (f : κ ≃ κ') :
    traceMatrix A (b.reindex f) = reindex f f (traceMatrix A b) := by ext (x y); 

Proof state:
case a.h
R : Type u_1
S : Type u_2
T : Type u_3
inst✝¹⁸ : CommRing R
inst✝¹⁷ : CommRing S
inst✝¹⁶ : CommRing T
inst✝¹⁵ : Algebra R S
inst✝¹⁴ : Algebra R T
K : Type u_4
L : Type u_5
inst✝¹³ : Field K
inst✝¹² : Field L
inst✝¹¹ : Algebra K L
ι κ : Type w
inst✝¹⁰ : Fintype ι
F : Type u_6
inst✝⁹ : Field F
inst✝⁸ : Algebra R L
inst✝⁷ : Algebra L F
inst✝⁶ : Algebra R F
inst✝⁵ : IsScalarTower R L F
A : Type u
B : Type v
C : Type z
inst✝⁴ : CommRing A
inst✝³ : CommRing B
inst✝² : Algebra A B
inst✝¹ : CommRing C
inst✝ : Algebra A C
κ' : Type u_7
b : Basis κ A B
f : κ ≃ κ'
x y : κ'
⊢ traceMatrix A (⇑(Basis.reindex b f)) x y = (reindex f f) (traceMatrix A ⇑b) x y

Next tactic:
simp
theorem traceMatrix_of_matrix_vecMul [Fintype κ] (b : κ → B) (P : Matrix κ κ A) :
    traceMatrix A ((P.map (algebraMap A B)).vecMul b) = Pᵀ * traceMatrix A b * P := by
  

Proof state:
R : Type u_1
S : Type u_2
T : Type u_3
inst✝¹⁹ : CommRing R
inst✝¹⁸ : CommRing S
inst✝¹⁷ : CommRing T
inst✝¹⁶ : Algebra R S
inst✝¹⁵ : Algebra R T
K : Type u_4
L : Type u_5
inst✝¹⁴ : Field K
inst✝¹³ : Field L
inst✝¹² : Algebra K L
ι κ : Type w
inst✝¹¹ : Fintype ι
F : Type u_6
inst✝¹⁰ : Field F
inst✝⁹ : Algebra R L
inst✝⁸ : Algebra L F
inst✝⁷ : Algebra R F
inst✝⁶ : IsScalarTower R L F
A : Type u
B : Type v
C : Type z
inst✝⁵ : CommRing A
inst✝⁴ : CommRing B
inst✝³ : Algebra A B
inst✝² : CommRing C
inst✝¹ : Algebra A C
inst✝ : Fintype κ
b : κ → B
P : Matrix κ κ A
⊢ traceMatrix A (vecMul b (Matrix.map P ⇑(algebraMap A B))) = Pᵀ * traceMatrix A b * P

Next tactic:
ext (α β)
theorem traceMatrix_of_matrix_vecMul [Fintype κ] (b : κ → B) (P : Matrix κ κ A) :
    traceMatrix A ((P.map (algebraMap A B)).vecMul b) = Pᵀ * traceMatrix A b * P := by
  ext (α β)
  

Proof state:
case a.h
R : Type u_1
S : Type u_2
T : Type u_3
inst✝¹⁹ : CommRing R
inst✝¹⁸ : CommRing S
inst✝¹⁷ : CommRing T
inst✝¹⁶ : Algebra R S
inst✝¹⁵ : Algebra R T
K : Type u_4
L : Type u_5
inst✝¹⁴ : Field K
inst✝¹³ : Field L
inst✝¹² : Algebra K L
ι κ : Type w
inst✝¹¹ : Fintype ι
F : Type u_6
inst✝¹⁰ : Field F
inst✝⁹ : Algebra R L
inst✝⁸ : Algebra L F
inst✝⁷ : Algebra R F
inst✝⁶ : IsScalarTower R L F
A : Type u
B : Type v
C : Type z
inst✝⁵ : CommRing A
inst✝⁴ : CommRing B
inst✝³ : Algebra A B
inst✝² : CommRing C
inst✝¹ : Algebra A C
inst✝ : Fintype κ
b : κ → B
P : Matrix κ κ A
α β : κ
⊢ traceMatrix A (vecMul b (Matrix.map P ⇑(algebraMap A B))) α β = (Pᵀ * traceMatrix A b * P) α β

Next tactic:
rw [traceMatrix_apply, vecMul, dotProduct, vecMul, dotProduct, Matrix.mul_apply,
    BilinForm.sum_left,
    Fintype.sum_congr _ _ fun i : κ =>
      BilinForm.sum_right _ _ (b i * P.map (algebraMap A B) i α) fun y : κ =>
        b y * P.map (algebraMap A B) y β,
    sum_comm]
theorem traceMatrix_of_matrix_vecMul [Fintype κ] (b : κ → B) (P : Matrix κ κ A) :
    traceMatrix A ((P.map (algebraMap A B)).vecMul b) = Pᵀ * traceMatrix A b * P := by
  ext (α β)
  rw [traceMatrix_apply, vecMul, dotProduct, vecMul, dotProduct, Matrix.mul_apply,
    BilinForm.sum_left,
    Fintype.sum_congr _ _ fun i : κ =>
      BilinForm.sum_right _ _ (b i * P.map (algebraMap A B) i α) fun y : κ =>
        b y * P.map (algebraMap A B) y β,
    sum_comm]
  

Proof state:
case a.h
R : Type u_1
S : Type u_2
T : Type u_3
inst✝¹⁹ : CommRing R
inst✝¹⁸ : CommRing S
inst✝¹⁷ : CommRing T
inst✝¹⁶ : Algebra R S
inst✝¹⁵ : Algebra R T
K : Type u_4
L : Type u_5
inst✝¹⁴ : Field K
inst✝¹³ : Field L
inst✝¹² : Algebra K L
ι κ : Type w
inst✝¹¹ : Fintype ι
F : Type u_6
inst✝¹⁰ : Field F
inst✝⁹ : Algebra R L
inst✝⁸ : Algebra L F
inst✝⁷ : Algebra R F
inst✝⁶ : IsScalarTower R L F
A : Type u
B : Type v
C : Type z
inst✝⁵ : CommRing A
inst✝⁴ : CommRing B
inst✝³ : Algebra A B
inst✝² : CommRing C
inst✝¹ : Algebra A C
inst✝ : Fintype κ
b : κ → B
P : Matrix κ κ A
α β : κ
⊢ ∑ y : κ,
      ∑ x : κ,
        BilinForm.bilin (traceForm A B) (b x * Matrix.map P (⇑(algebraMap A B)) x α)
          (b y * Matrix.map P (⇑(algebraMap A B)) y β) =
    ∑ j : κ, (Pᵀ * traceMatrix A b) α j * P j β

Next tactic:
congr
theorem traceMatrix_of_matrix_vecMul [Fintype κ] (b : κ → B) (P : Matrix κ κ A) :
    traceMatrix A ((P.map (algebraMap A B)).vecMul b) = Pᵀ * traceMatrix A b * P := by
  ext (α β)
  rw [traceMatrix_apply, vecMul, dotProduct, vecMul, dotProduct, Matrix.mul_apply,
    BilinForm.sum_left,
    Fintype.sum_congr _ _ fun i : κ =>
      BilinForm.sum_right _ _ (b i * P.map (algebraMap A B) i α) fun y : κ =>
        b y * P.map (algebraMap A B) y β,
    sum_comm]
  congr; 

Proof state:
case a.h.e_f
R : Type u_1
S : Type u_2
T : Type u_3
inst✝¹⁹ : CommRing R
inst✝¹⁸ : CommRing S
inst✝¹⁷ : CommRing T
inst✝¹⁶ : Algebra R S
inst✝¹⁵ : Algebra R T
K : Type u_4
L : Type u_5
inst✝¹⁴ : Field K
inst✝¹³ : Field L
inst✝¹² : Algebra K L
ι κ : Type w
inst✝¹¹ : Fintype ι
F : Type u_6
inst✝¹⁰ : Field F
inst✝⁹ : Algebra R L
inst✝⁸ : Algebra L F
inst✝⁷ : Algebra R F
inst✝⁶ : IsScalarTower R L F
A : Type u
B : Type v
C : Type z
inst✝⁵ : CommRing A
inst✝⁴ : CommRing B
inst✝³ : Algebra A B
inst✝² : CommRing C
inst✝¹ : Algebra A C
inst✝ : Fintype κ
b : κ → B
P : Matrix κ κ A
α β : κ
⊢ (fun y =>
      ∑ x : κ,
        BilinForm.bilin (traceForm A B) (b x * Matrix.map P (⇑(algebraMap A B)) x α)
          (b y * Matrix.map P (⇑(algebraMap A B)) y β)) =
    fun j => (Pᵀ * traceMatrix A b) α j * P j β

Next tactic:
ext x
theorem traceMatrix_of_matrix_vecMul [Fintype κ] (b : κ → B) (P : Matrix κ κ A) :
    traceMatrix A ((P.map (algebraMap A B)).vecMul b) = Pᵀ * traceMatrix A b * P := by
  ext (α β)
  rw [traceMatrix_apply, vecMul, dotProduct, vecMul, dotProduct, Matrix.mul_apply,
    BilinForm.sum_left,
    Fintype.sum_congr _ _ fun i : κ =>
      BilinForm.sum_right _ _ (b i * P.map (algebraMap A B) i α) fun y : κ =>
        b y * P.map (algebraMap A B) y β,
    sum_comm]
  congr; ext x
  

Proof state:
case a.h.e_f.h
R : Type u_1
S : Type u_2
T : Type u_3
inst✝¹⁹ : CommRing R
inst✝¹⁸ : CommRing S
inst✝¹⁷ : CommRing T
inst✝¹⁶ : Algebra R S
inst✝¹⁵ : Algebra R T
K : Type u_4
L : Type u_5
inst✝¹⁴ : Field K
inst✝¹³ : Field L
inst✝¹² : Algebra K L
ι κ : Type w
inst✝¹¹ : Fintype ι
F : Type u_6
inst✝¹⁰ : Field F
inst✝⁹ : Algebra R L
inst✝⁸ : Algebra L F
inst✝⁷ : Algebra R F
inst✝⁶ : IsScalarTower R L F
A : Type u
B : Type v
C : Type z
inst✝⁵ : CommRing A
inst✝⁴ : CommRing B
inst✝³ : Algebra A B
inst✝² : CommRing C
inst✝¹ : Algebra A C
inst✝ : Fintype κ
b : κ → B
P : Matrix κ κ A
α β x : κ
⊢ ∑ x_1 : κ,
      BilinForm.bilin (traceForm A B) (b x_1 * Matrix.map P (⇑(algebraMap A B)) x_1 α)
        (b x * Matrix.map P (⇑(algebraMap A B)) x β) =
    (Pᵀ * traceMatrix A b) α x * P x β

Next tactic:
rw [Matrix.mul_apply, sum_mul]
theorem traceMatrix_of_matrix_vecMul [Fintype κ] (b : κ → B) (P : Matrix κ κ A) :
    traceMatrix A ((P.map (algebraMap A B)).vecMul b) = Pᵀ * traceMatrix A b * P := by
  ext (α β)
  rw [traceMatrix_apply, vecMul, dotProduct, vecMul, dotProduct, Matrix.mul_apply,
    BilinForm.sum_left,
    Fintype.sum_congr _ _ fun i : κ =>
      BilinForm.sum_right _ _ (b i * P.map (algebraMap A B) i α) fun y : κ =>
        b y * P.map (algebraMap A B) y β,
    sum_comm]
  congr; ext x
  rw [Matrix.mul_apply, sum_mul]
  

Proof state:
case a.h.e_f.h
R : Type u_1
S : Type u_2
T : Type u_3
inst✝¹⁹ : CommRing R
inst✝¹⁸ : CommRing S
inst✝¹⁷ : CommRing T
inst✝¹⁶ : Algebra R S
inst✝¹⁵ : Algebra R T
K : Type u_4
L : Type u_5
inst✝¹⁴ : Field K
inst✝¹³ : Field L
inst✝¹² : Algebra K L
ι κ : Type w
inst✝¹¹ : Fintype ι
F : Type u_6
inst✝¹⁰ : Field F
inst✝⁹ : Algebra R L
inst✝⁸ : Algebra L F
inst✝⁷ : Algebra R F
inst✝⁶ : IsScalarTower R L F
A : Type u
B : Type v
C : Type z
inst✝⁵ : CommRing A
inst✝⁴ : CommRing B
inst✝³ : Algebra A B
inst✝² : CommRing C
inst✝¹ : Algebra A C
inst✝ : Fintype κ
b : κ → B
P : Matrix κ κ A
α β x : κ
⊢ ∑ x_1 : κ,
      BilinForm.bilin (traceForm A B) (b x_1 * Matrix.map P (⇑(algebraMap A B)) x_1 α)
        (b x * Matrix.map P (⇑(algebraMap A B)) x β) =
    ∑ x_1 : κ, Pᵀ α x_1 * traceMatrix A b x_1 x * P x β

Next tactic:
congr
theorem traceMatrix_of_matrix_vecMul [Fintype κ] (b : κ → B) (P : Matrix κ κ A) :
    traceMatrix A ((P.map (algebraMap A B)).vecMul b) = Pᵀ * traceMatrix A b * P := by
  ext (α β)
  rw [traceMatrix_apply, vecMul, dotProduct, vecMul, dotProduct, Matrix.mul_apply,
    BilinForm.sum_left,
    Fintype.sum_congr _ _ fun i : κ =>
      BilinForm.sum_right _ _ (b i * P.map (algebraMap A B) i α) fun y : κ =>
        b y * P.map (algebraMap A B) y β,
    sum_comm]
  congr; ext x
  rw [Matrix.mul_apply, sum_mul]
  congr; 

Proof state:
case a.h.e_f.h.e_f
R : Type u_1
S : Type u_2
T : Type u_3
inst✝¹⁹ : CommRing R
inst✝¹⁸ : CommRing S
inst✝¹⁷ : CommRing T
inst✝¹⁶ : Algebra R S
inst✝¹⁵ : Algebra R T
K : Type u_4
L : Type u_5
inst✝¹⁴ : Field K
inst✝¹³ : Field L
inst✝¹² : Algebra K L
ι κ : Type w
inst✝¹¹ : Fintype ι
F : Type u_6
inst✝¹⁰ : Field F
inst✝⁹ : Algebra R L
inst✝⁸ : Algebra L F
inst✝⁷ : Algebra R F
inst✝⁶ : IsScalarTower R L F
A : Type u
B : Type v
C : Type z
inst✝⁵ : CommRing A
inst✝⁴ : CommRing B
inst✝³ : Algebra A B
inst✝² : CommRing C
inst✝¹ : Algebra A C
inst✝ : Fintype κ
b : κ → B
P : Matrix κ κ A
α β x : κ
⊢ (fun x_1 =>
      BilinForm.bilin (traceForm A B) (b x_1 * Matrix.map P (⇑(algebraMap A B)) x_1 α)
        (b x * Matrix.map P (⇑(algebraMap A B)) x β)) =
    fun x_1 => Pᵀ α x_1 * traceMatrix A b x_1 x * P x β

Next tactic:
ext y
theorem traceMatrix_of_matrix_vecMul [Fintype κ] (b : κ → B) (P : Matrix κ κ A) :
    traceMatrix A ((P.map (algebraMap A B)).vecMul b) = Pᵀ * traceMatrix A b * P := by
  ext (α β)
  rw [traceMatrix_apply, vecMul, dotProduct, vecMul, dotProduct, Matrix.mul_apply,
    BilinForm.sum_left,
    Fintype.sum_congr _ _ fun i : κ =>
      BilinForm.sum_right _ _ (b i * P.map (algebraMap A B) i α) fun y : κ =>
        b y * P.map (algebraMap A B) y β,
    sum_comm]
  congr; ext x
  rw [Matrix.mul_apply, sum_mul]
  congr; ext y
  

Proof state:
case a.h.e_f.h.e_f.h
R : Type u_1
S : Type u_2
T : Type u_3
inst✝¹⁹ : CommRing R
inst✝¹⁸ : CommRing S
inst✝¹⁷ : CommRing T
inst✝¹⁶ : Algebra R S
inst✝¹⁵ : Algebra R T
K : Type u_4
L : Type u_5
inst✝¹⁴ : Field K
inst✝¹³ : Field L
inst✝¹² : Algebra K L
ι κ : Type w
inst✝¹¹ : Fintype ι
F : Type u_6
inst✝¹⁰ : Field F
inst✝⁹ : Algebra R L
inst✝⁸ : Algebra L F
inst✝⁷ : Algebra R F
inst✝⁶ : IsScalarTower R L F
A : Type u
B : Type v
C : Type z
inst✝⁵ : CommRing A
inst✝⁴ : CommRing B
inst✝³ : Algebra A B
inst✝² : CommRing C
inst✝¹ : Algebra A C
inst✝ : Fintype κ
b : κ → B
P : Matrix κ κ A
α β x y : κ
⊢ BilinForm.bilin (traceForm A B) (b y * Matrix.map P (⇑(algebraMap A B)) y α)
      (b x * Matrix.map P (⇑(algebraMap A B)) x β) =
    Pᵀ α y * traceMatrix A b y x * P x β

Next tactic:
rw [map_apply, traceForm_apply, mul_comm (b y), ← smul_def]
theorem traceMatrix_of_matrix_vecMul [Fintype κ] (b : κ → B) (P : Matrix κ κ A) :
    traceMatrix A ((P.map (algebraMap A B)).vecMul b) = Pᵀ * traceMatrix A b * P := by
  ext (α β)
  rw [traceMatrix_apply, vecMul, dotProduct, vecMul, dotProduct, Matrix.mul_apply,
    BilinForm.sum_left,
    Fintype.sum_congr _ _ fun i : κ =>
      BilinForm.sum_right _ _ (b i * P.map (algebraMap A B) i α) fun y : κ =>
        b y * P.map (algebraMap A B) y β,
    sum_comm]
  congr; ext x
  rw [Matrix.mul_apply, sum_mul]
  congr; ext y
  rw [map_apply, traceForm_apply, mul_comm (b y), ← smul_def]
  

Proof state:
case a.h.e_f.h.e_f.h
R : Type u_1
S : Type u_2
T : Type u_3
inst✝¹⁹ : CommRing R
inst✝¹⁸ : CommRing S
inst✝¹⁷ : CommRing T
inst✝¹⁶ : Algebra R S
inst✝¹⁵ : Algebra R T
K : Type u_4
L : Type u_5
inst✝¹⁴ : Field K
inst✝¹³ : Field L
inst✝¹² : Algebra K L
ι κ : Type w
inst✝¹¹ : Fintype ι
F : Type u_6
inst✝¹⁰ : Field F
inst✝⁹ : Algebra R L
inst✝⁸ : Algebra L F
inst✝⁷ : Algebra R F
inst✝⁶ : IsScalarTower R L F
A : Type u
B : Type v
C : Type z
inst✝⁵ : CommRing A
inst✝⁴ : CommRing B
inst✝³ : Algebra A B
inst✝² : CommRing C
inst✝¹ : Algebra A C
inst✝ : Fintype κ
b : κ → B
P : Matrix κ κ A
α β x y : κ
⊢ (trace A B) (P y α • b y * (b x * Matrix.map P (⇑(algebraMap A B)) x β)) = Pᵀ α y * traceMatrix A b y x * P x β

Next tactic:
simp only [id.smul_eq_mul, RingHom.id_apply, map_apply, transpose_apply, LinearMap.map_smulₛₗ,
    traceForm_apply, Algebra.smul_mul_assoc]
theorem traceMatrix_of_matrix_vecMul [Fintype κ] (b : κ → B) (P : Matrix κ κ A) :
    traceMatrix A ((P.map (algebraMap A B)).vecMul b) = Pᵀ * traceMatrix A b * P := by
  ext (α β)
  rw [traceMatrix_apply, vecMul, dotProduct, vecMul, dotProduct, Matrix.mul_apply,
    BilinForm.sum_left,
    Fintype.sum_congr _ _ fun i : κ =>
      BilinForm.sum_right _ _ (b i * P.map (algebraMap A B) i α) fun y : κ =>
        b y * P.map (algebraMap A B) y β,
    sum_comm]
  congr; ext x
  rw [Matrix.mul_apply, sum_mul]
  congr; ext y
  rw [map_apply, traceForm_apply, mul_comm (b y), ← smul_def]
  simp only [id.smul_eq_mul, RingHom.id_apply, map_apply, transpose_apply, LinearMap.map_smulₛₗ,
    traceForm_apply, Algebra.smul_mul_assoc]
  

Proof state:
case a.h.e_f.h.e_f.h
R : Type u_1
S : Type u_2
T : Type u_3
inst✝¹⁹ : CommRing R
inst✝¹⁸ : CommRing S
inst✝¹⁷ : CommRing T
inst✝¹⁶ : Algebra R S
inst✝¹⁵ : Algebra R T
K : Type u_4
L : Type u_5
inst✝¹⁴ : Field K
inst✝¹³ : Field L
inst✝¹² : Algebra K L
ι κ : Type w
inst✝¹¹ : Fintype ι
F : Type u_6
inst✝¹⁰ : Field F
inst✝⁹ : Algebra R L
inst✝⁸ : Algebra L F
inst✝⁷ : Algebra R F
inst✝⁶ : IsScalarTower R L F
A : Type u
B : Type v
C : Type z
inst✝⁵ : CommRing A
inst✝⁴ : CommRing B
inst✝³ : Algebra A B
inst✝² : CommRing C
inst✝¹ : Algebra A C
inst✝ : Fintype κ
b : κ → B
P : Matrix κ κ A
α β x y : κ
⊢ P y α * (trace A B) (b y * (b x * (algebraMap A B) (P x β))) = P y α * traceMatrix A b y x * P x β

Next tactic:
rw [mul_comm (b x), ← smul_def]