l3lab/ntp-mathlib huggingface dataset:
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]
  rw [mul_comm (b x), ← 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 : κ
⊢ P y α * (trace A B) (b y * P x β • b x) = P y α * traceMatrix A b y x * P x β

Next tactic:
ring_nf
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]
  rw [mul_comm (b x), ← smul_def]
  ring_nf
  

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 * P x β • b x) = P y α * traceMatrix A b y x * P x β

Next tactic:
rw [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]
  rw [mul_comm (b x), ← smul_def]
  ring_nf
  rw [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 * P x β • b x) = P y α * (traceMatrix A b y x * P x β)

Next tactic:
simp [mul_comm]
theorem traceMatrix_of_matrix_mulVec [Fintype κ] (b : κ → B) (P : Matrix κ κ A) :
    traceMatrix A ((P.map (algebraMap A B)).mulVec 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 (mulVec (Matrix.map P ⇑(algebraMap A B)) b) = P * traceMatrix A b * Pᵀ

Next tactic:
refine' AddEquiv.injective (transposeAddEquiv κ κ A) _
theorem traceMatrix_of_matrix_mulVec [Fintype κ] (b : κ → B) (P : Matrix κ κ A) :
    traceMatrix A ((P.map (algebraMap A B)).mulVec b) = P * traceMatrix A b * Pᵀ := by
  refine' AddEquiv.injective (transposeAddEquiv κ κ A) _
  

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
⊢ (transposeAddEquiv κ κ A) (traceMatrix A (mulVec (Matrix.map P ⇑(algebraMap A B)) b)) =
    (transposeAddEquiv κ κ A) (P * traceMatrix A b * Pᵀ)

Next tactic:
rw [transposeAddEquiv_apply, transposeAddEquiv_apply, ← vecMul_transpose, ← transpose_map,
    traceMatrix_of_matrix_vecMul, transpose_transpose, transpose_mul, transpose_transpose,
    transpose_mul]
theorem traceMatrix_of_basis [Fintype κ] [DecidableEq κ] (b : Basis κ A B) :
    traceMatrix A b = BilinForm.toMatrix b (traceForm 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
inst✝¹ : Fintype κ
inst✝ : DecidableEq κ
b : Basis κ A B
⊢ traceMatrix A ⇑b = (BilinForm.toMatrix b) (traceForm A B)

Next tactic:
ext (i j)
theorem traceMatrix_of_basis [Fintype κ] [DecidableEq κ] (b : Basis κ A B) :
    traceMatrix A b = BilinForm.toMatrix b (traceForm A B) := by
  ext (i j)
  

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 κ
inst✝ : DecidableEq κ
b : Basis κ A B
i j : κ
⊢ traceMatrix A (⇑b) i j = (BilinForm.toMatrix b) (traceForm A B) i j

Next tactic:
rw [traceMatrix_apply, traceForm_apply, traceForm_toMatrix]
theorem traceMatrix_of_basis_mulVec (b : Basis ι A B) (z : B) :
    (traceMatrix A b).mulVec (b.equivFun z) = fun i => trace A B (z * b i) := 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
b : Basis ι A B
z : B
⊢ mulVec (traceMatrix A ⇑b) ((Basis.equivFun b) z) = fun i => (trace A B) (z * b i)

Next tactic:
ext i
theorem traceMatrix_of_basis_mulVec (b : Basis ι A B) (z : B) :
    (traceMatrix A b).mulVec (b.equivFun z) = fun i => trace A B (z * b i) := by
  ext i
  

Proof state:
case 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
b : Basis ι A B
z : B
i : ι
⊢ mulVec (traceMatrix A ⇑b) ((Basis.equivFun b) z) i = (trace A B) (z * b i)

Next tactic:
rw [← col_apply ((traceMatrix A b).mulVec (b.equivFun z)) i Unit.unit, col_mulVec,
    Matrix.mul_apply, traceMatrix]
theorem traceMatrix_of_basis_mulVec (b : Basis ι A B) (z : B) :
    (traceMatrix A b).mulVec (b.equivFun z) = fun i => trace A B (z * b i) := by
  ext i
  rw [← col_apply ((traceMatrix A b).mulVec (b.equivFun z)) i Unit.unit, col_mulVec,
    Matrix.mul_apply, traceMatrix]
  

Proof state:
case 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
b : Basis ι A B
z : B
i : ι
⊢ ∑ j : ι, of (fun i j => BilinForm.bilin (traceForm A B) (b i) (b j)) i j * col ((Basis.equivFun b) z) j () =
    (trace A B) (z * b i)

Next tactic:
simp only [col_apply, traceForm_apply]
theorem traceMatrix_of_basis_mulVec (b : Basis ι A B) (z : B) :
    (traceMatrix A b).mulVec (b.equivFun z) = fun i => trace A B (z * b i) := by
  ext i
  rw [← col_apply ((traceMatrix A b).mulVec (b.equivFun z)) i Unit.unit, col_mulVec,
    Matrix.mul_apply, traceMatrix]
  simp only [col_apply, traceForm_apply]
  

Proof state:
case 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
b : Basis ι A B
z : B
i : ι
⊢ ∑ x : ι, of (fun i j => (trace A B) (b i * b j)) i x * (Basis.equivFun b) z x = (trace A B) (z * b i)

Next tactic:
conv_lhs =>
    congr
    rfl
    ext
    rw [mul_comm _ (b.equivFun z _), ← smul_eq_mul, of_apply, ← LinearMap.map_smul]
theorem traceMatrix_of_basis_mulVec (b : Basis ι A B) (z : B) :
    (traceMatrix A b).mulVec (b.equivFun z) = fun i => trace A B (z * b i) := by
  ext i
  rw [← col_apply ((traceMatrix A b).mulVec (b.equivFun z)) i Unit.unit, col_mulVec,
    Matrix.mul_apply, traceMatrix]
  simp only [col_apply, traceForm_apply]
  conv_lhs =>
    

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
b : Basis ι A B
z : B
i : ι
| ∑ x : ι, of (fun i j => (trace A B) (b i * b j)) i x * (Basis.equivFun b) z x

Next tactic:
congr
    rfl
    ext
    rw [mul_comm _ (b.equivFun z _), ← smul_eq_mul, of_apply, ← LinearMap.map_smul]
theorem traceMatrix_of_basis_mulVec (b : Basis ι A B) (z : B) :
    (traceMatrix A b).mulVec (b.equivFun z) = fun i => trace A B (z * b i) := by
  ext i
  rw [← col_apply ((traceMatrix A b).mulVec (b.equivFun z)) i Unit.unit, col_mulVec,
    Matrix.mul_apply, traceMatrix]
  simp only [col_apply, traceForm_apply]
  conv_lhs =>
    

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
b : Basis ι A B
z : B
i : ι
| ∑ x : ι, of (fun i j => (trace A B) (b i * b j)) i x * (Basis.equivFun b) z x

Next tactic:
congr
theorem traceMatrix_of_basis_mulVec (b : Basis ι A B) (z : B) :
    (traceMatrix A b).mulVec (b.equivFun z) = fun i => trace A B (z * b i) := by
  ext i
  rw [← col_apply ((traceMatrix A b).mulVec (b.equivFun z)) i Unit.unit, col_mulVec,
    Matrix.mul_apply, traceMatrix]
  simp only [col_apply, traceForm_apply]
  conv_lhs =>
    congr
    

Proof state:
case s
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
b : Basis ι A B
z : B
i : ι
| univ
case 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
b : Basis ι A B
z : B
i : ι
| fun x => of (fun i j => (trace A B) (b i * b j)) i x * (Basis.equivFun b) z x

Next tactic:
rfl
theorem traceMatrix_of_basis_mulVec (b : Basis ι A B) (z : B) :
    (traceMatrix A b).mulVec (b.equivFun z) = fun i => trace A B (z * b i) := by
  ext i
  rw [← col_apply ((traceMatrix A b).mulVec (b.equivFun z)) i Unit.unit, col_mulVec,
    Matrix.mul_apply, traceMatrix]
  simp only [col_apply, traceForm_apply]
  conv_lhs =>
    congr
    rfl
    

Proof state:
case 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
b : Basis ι A B
z : B
i : ι
| fun x => of (fun i j => (trace A B) (b i * b j)) i x * (Basis.equivFun b) z x

Next tactic:
ext
theorem traceMatrix_of_basis_mulVec (b : Basis ι A B) (z : B) :
    (traceMatrix A b).mulVec (b.equivFun z) = fun i => trace A B (z * b i) := by
  ext i
  rw [← col_apply ((traceMatrix A b).mulVec (b.equivFun z)) i Unit.unit, col_mulVec,
    Matrix.mul_apply, traceMatrix]
  simp only [col_apply, traceForm_apply]
  conv_lhs =>
    congr
    rfl
    ext
    

Proof state:
case 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
b : Basis ι A B
z : B
i x✝ : ι
| of (fun i j => (trace A B) (b i * b j)) i x✝ * (Basis.equivFun b) z x✝

Next tactic:
rw [mul_comm _ (b.equivFun z _), ← smul_eq_mul, of_apply, ← LinearMap.map_smul]
theorem traceMatrix_of_basis_mulVec (b : Basis ι A B) (z : B) :
    (traceMatrix A b).mulVec (b.equivFun z) = fun i => trace A B (z * b i) := by
  ext i
  rw [← col_apply ((traceMatrix A b).mulVec (b.equivFun z)) i Unit.unit, col_mulVec,
    Matrix.mul_apply, traceMatrix]
  simp only [col_apply, traceForm_apply]
  conv_lhs =>
    congr
    rfl
    ext
    rw [mul_comm _ (b.equivFun z _), ← smul_eq_mul, of_apply, ← LinearMap.map_smul]
  

Proof state:
case 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
b : Basis ι A B
z : B
i : ι
⊢ ∑ x : ι, (trace A B) ((Basis.equivFun b) z x • (b i * b x)) = (trace A B) (z * b i)

Next tactic:
rw [← _root_.map_sum]
theorem traceMatrix_of_basis_mulVec (b : Basis ι A B) (z : B) :
    (traceMatrix A b).mulVec (b.equivFun z) = fun i => trace A B (z * b i) := by
  ext i
  rw [← col_apply ((traceMatrix A b).mulVec (b.equivFun z)) i Unit.unit, col_mulVec,
    Matrix.mul_apply, traceMatrix]
  simp only [col_apply, traceForm_apply]
  conv_lhs =>
    congr
    rfl
    ext
    rw [mul_comm _ (b.equivFun z _), ← smul_eq_mul, of_apply, ← LinearMap.map_smul]
  rw [← _root_.map_sum]
  

Proof state:
case 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
b : Basis ι A B
z : B
i : ι
⊢ (trace A B) (∑ x : ι, (Basis.equivFun b) z x • (b i * b x)) = (trace A B) (z * b i)

Next tactic:
congr
theorem traceMatrix_of_basis_mulVec (b : Basis ι A B) (z : B) :
    (traceMatrix A b).mulVec (b.equivFun z) = fun i => trace A B (z * b i) := by
  ext i
  rw [← col_apply ((traceMatrix A b).mulVec (b.equivFun z)) i Unit.unit, col_mulVec,
    Matrix.mul_apply, traceMatrix]
  simp only [col_apply, traceForm_apply]
  conv_lhs =>
    congr
    rfl
    ext
    rw [mul_comm _ (b.equivFun z _), ← smul_eq_mul, of_apply, ← LinearMap.map_smul]
  rw [← _root_.map_sum]
  congr
  

Proof state:
case h.h.e_6.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
b : Basis ι A B
z : B
i : ι
⊢ ∑ x : ι, (Basis.equivFun b) z x • (b i * b x) = z * b i

Next tactic:
conv_lhs =>
    congr
    rfl
    ext
    rw [← mul_smul_comm]
theorem traceMatrix_of_basis_mulVec (b : Basis ι A B) (z : B) :
    (traceMatrix A b).mulVec (b.equivFun z) = fun i => trace A B (z * b i) := by
  ext i
  rw [← col_apply ((traceMatrix A b).mulVec (b.equivFun z)) i Unit.unit, col_mulVec,
    Matrix.mul_apply, traceMatrix]
  simp only [col_apply, traceForm_apply]
  conv_lhs =>
    congr
    rfl
    ext
    rw [mul_comm _ (b.equivFun z _), ← smul_eq_mul, of_apply, ← LinearMap.map_smul]
  rw [← _root_.map_sum]
  congr
  conv_lhs =>
    

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
b : Basis ι A B
z : B
i : ι
| ∑ x : ι, (Basis.equivFun b) z x • (b i * b x)

Next tactic:
congr
    rfl
    ext
    rw [← mul_smul_comm]
theorem traceMatrix_of_basis_mulVec (b : Basis ι A B) (z : B) :
    (traceMatrix A b).mulVec (b.equivFun z) = fun i => trace A B (z * b i) := by
  ext i
  rw [← col_apply ((traceMatrix A b).mulVec (b.equivFun z)) i Unit.unit, col_mulVec,
    Matrix.mul_apply, traceMatrix]
  simp only [col_apply, traceForm_apply]
  conv_lhs =>
    congr
    rfl
    ext
    rw [mul_comm _ (b.equivFun z _), ← smul_eq_mul, of_apply, ← LinearMap.map_smul]
  rw [← _root_.map_sum]
  congr
  conv_lhs =>
    

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
b : Basis ι A B
z : B
i : ι
| ∑ x : ι, (Basis.equivFun b) z x • (b i * b x)

Next tactic:
congr