l3lab/ntp-mathlib huggingface dataset:
theorem det_traceMatrix_ne_zero' [IsSeparable K L] : det (traceMatrix K pb.basis) ≠ 0 := by
  suffices algebraMap K (AlgebraicClosure L) (det (traceMatrix K pb.basis)) ≠ 0 by
    refine' mt (fun ht => _) this
    rw [ht, RingHom.map_zero]
  haveI : FiniteDimensional K L := pb.finiteDimensional
  let e : Fin pb.dim ≃ (L →ₐ[K] AlgebraicClosure L) := (Fintype.equivFinOfCardEq ?_).symm
  rw [RingHom.map_det, RingHom.mapMatrix_apply,
    traceMatrix_eq_embeddingsMatrixReindex_mul_trans K _ _ e,
    embeddingsMatrixReindex_eq_vandermonde, det_mul, det_transpose]
-- Porting note: the following is necessary.
  haveI := IsDomain.to_noZeroDivisors (AlgebraicClosure L)
  refine' mt mul_self_eq_zero.mp _
  · simp only [det_vandermonde, Finset.prod_eq_zero_iff, not_exists, sub_eq_zero]
    

Proof state:
case refine_2
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
pb : PowerBasis K L
inst✝ : IsSeparable K L
this✝ : FiniteDimensional K L
e : Fin pb.dim ≃ (L →ₐ[K] AlgebraicClosure L) := (Fintype.equivFinOfCardEq ?refine_1).symm
this : NoZeroDivisors (AlgebraicClosure L)
⊢ ∀ (x : Fin pb.dim),
    ¬(x ∈ Finset.univ ∧
        ∃ a ∈ Finset.Ioi x,
          ((Fintype.equivFinOfCardEq ?refine_1).symm a) pb.gen = ((Fintype.equivFinOfCardEq ?refine_1).symm x) pb.gen)

Next tactic:
rintro i ⟨_, j, hij, h⟩
theorem det_traceMatrix_ne_zero' [IsSeparable K L] : det (traceMatrix K pb.basis) ≠ 0 := by
  suffices algebraMap K (AlgebraicClosure L) (det (traceMatrix K pb.basis)) ≠ 0 by
    refine' mt (fun ht => _) this
    rw [ht, RingHom.map_zero]
  haveI : FiniteDimensional K L := pb.finiteDimensional
  let e : Fin pb.dim ≃ (L →ₐ[K] AlgebraicClosure L) := (Fintype.equivFinOfCardEq ?_).symm
  rw [RingHom.map_det, RingHom.mapMatrix_apply,
    traceMatrix_eq_embeddingsMatrixReindex_mul_trans K _ _ e,
    embeddingsMatrixReindex_eq_vandermonde, det_mul, det_transpose]
-- Porting note: the following is necessary.
  haveI := IsDomain.to_noZeroDivisors (AlgebraicClosure L)
  refine' mt mul_self_eq_zero.mp _
  · simp only [det_vandermonde, Finset.prod_eq_zero_iff, not_exists, sub_eq_zero]
    rintro i ⟨_, j, hij, h⟩
    

Proof state:
case refine_2.intro.intro.intro
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
pb : PowerBasis K L
inst✝ : IsSeparable K L
this✝ : FiniteDimensional K L
e : Fin pb.dim ≃ (L →ₐ[K] AlgebraicClosure L) := (Fintype.equivFinOfCardEq ?refine_1).symm
this : NoZeroDivisors (AlgebraicClosure L)
i : Fin pb.dim
left✝ : i ∈ Finset.univ
j : Fin pb.dim
hij : j ∈ Finset.Ioi i
h : ((Fintype.equivFinOfCardEq ?refine_1).symm j) pb.gen = ((Fintype.equivFinOfCardEq ?refine_1).symm i) pb.gen
⊢ False

Next tactic:
exact (Finset.mem_Ioi.mp hij).ne' (e.injective <| pb.algHom_ext h)
theorem det_traceMatrix_ne_zero' [IsSeparable K L] : det (traceMatrix K pb.basis) ≠ 0 := by
  suffices algebraMap K (AlgebraicClosure L) (det (traceMatrix K pb.basis)) ≠ 0 by
    refine' mt (fun ht => _) this
    rw [ht, RingHom.map_zero]
  haveI : FiniteDimensional K L := pb.finiteDimensional
  let e : Fin pb.dim ≃ (L →ₐ[K] AlgebraicClosure L) := (Fintype.equivFinOfCardEq ?_).symm
  rw [RingHom.map_det, RingHom.mapMatrix_apply,
    traceMatrix_eq_embeddingsMatrixReindex_mul_trans K _ _ e,
    embeddingsMatrixReindex_eq_vandermonde, det_mul, det_transpose]
-- Porting note: the following is necessary.
  haveI := IsDomain.to_noZeroDivisors (AlgebraicClosure L)
  refine' mt mul_self_eq_zero.mp _
  · simp only [det_vandermonde, Finset.prod_eq_zero_iff, not_exists, sub_eq_zero]
    rintro i ⟨_, j, hij, h⟩
    exact (Finset.mem_Ioi.mp hij).ne' (e.injective <| pb.algHom_ext h)
  · 

Proof state:
case refine_1
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
pb : PowerBasis K L
inst✝ : IsSeparable K L
this : FiniteDimensional K L
⊢ Fintype.card (L →ₐ[K] AlgebraicClosure L) = pb.dim

Next tactic:
rw [AlgHom.card, pb.finrank]
theorem det_traceForm_ne_zero [IsSeparable K L] [DecidableEq ι] (b : Basis ι K L) :
    det (BilinForm.toMatrix b (traceForm K L)) ≠ 0 := 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
pb : PowerBasis K L
inst✝¹ : IsSeparable K L
inst✝ : DecidableEq ι
b : Basis ι K L
⊢ det ((BilinForm.toMatrix b) (traceForm K L)) ≠ 0

Next tactic:
haveI : FiniteDimensional K L := FiniteDimensional.of_fintype_basis b
theorem det_traceForm_ne_zero [IsSeparable K L] [DecidableEq ι] (b : Basis ι K L) :
    det (BilinForm.toMatrix b (traceForm K L)) ≠ 0 := by
  haveI : FiniteDimensional K L := FiniteDimensional.of_fintype_basis b
  

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
pb : PowerBasis K L
inst✝¹ : IsSeparable K L
inst✝ : DecidableEq ι
b : Basis ι K L
this : FiniteDimensional K L
⊢ det ((BilinForm.toMatrix b) (traceForm K L)) ≠ 0

Next tactic:
let pb : PowerBasis K L := Field.powerBasisOfFiniteOfSeparable _ _
theorem det_traceForm_ne_zero [IsSeparable K L] [DecidableEq ι] (b : Basis ι K L) :
    det (BilinForm.toMatrix b (traceForm K L)) ≠ 0 := by
  haveI : FiniteDimensional K L := FiniteDimensional.of_fintype_basis b
  let pb : PowerBasis K L := Field.powerBasisOfFiniteOfSeparable _ _
  

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
pb✝ : PowerBasis K L
inst✝¹ : IsSeparable K L
inst✝ : DecidableEq ι
b : Basis ι K L
this : FiniteDimensional K L
pb : PowerBasis K L := Field.powerBasisOfFiniteOfSeparable K L
⊢ det ((BilinForm.toMatrix b) (traceForm K L)) ≠ 0

Next tactic:
rw [← BilinForm.toMatrix_mul_basis_toMatrix pb.basis b, ←
    det_comm' (pb.basis.toMatrix_mul_toMatrix_flip b) _, ← Matrix.mul_assoc, det_mul]
theorem det_traceForm_ne_zero [IsSeparable K L] [DecidableEq ι] (b : Basis ι K L) :
    det (BilinForm.toMatrix b (traceForm K L)) ≠ 0 := by
  haveI : FiniteDimensional K L := FiniteDimensional.of_fintype_basis b
  let pb : PowerBasis K L := Field.powerBasisOfFiniteOfSeparable _ _
  rw [← BilinForm.toMatrix_mul_basis_toMatrix pb.basis b, ←
    det_comm' (pb.basis.toMatrix_mul_toMatrix_flip b) _, ← Matrix.mul_assoc, det_mul]
  

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
pb✝ : PowerBasis K L
inst✝¹ : IsSeparable K L
inst✝ : DecidableEq ι
b : Basis ι K L
this : FiniteDimensional K L
pb : PowerBasis K L := Field.powerBasisOfFiniteOfSeparable K L
⊢ det (Basis.toMatrix pb.basis ⇑b * (Basis.toMatrix pb.basis ⇑b)ᵀ) *
      det ((BilinForm.toMatrix pb.basis) (traceForm K L)) ≠
    0
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
pb✝ : PowerBasis K L
inst✝¹ : IsSeparable K L
inst✝ : DecidableEq ι
b : Basis ι K L
this : FiniteDimensional K L
pb : PowerBasis K L := Field.powerBasisOfFiniteOfSeparable K L
⊢ Basis.toMatrix b ⇑pb.basis * Basis.toMatrix pb.basis ⇑b = 1

Next tactic:
swap
theorem det_traceForm_ne_zero [IsSeparable K L] [DecidableEq ι] (b : Basis ι K L) :
    det (BilinForm.toMatrix b (traceForm K L)) ≠ 0 := by
  haveI : FiniteDimensional K L := FiniteDimensional.of_fintype_basis b
  let pb : PowerBasis K L := Field.powerBasisOfFiniteOfSeparable _ _
  rw [← BilinForm.toMatrix_mul_basis_toMatrix pb.basis b, ←
    det_comm' (pb.basis.toMatrix_mul_toMatrix_flip b) _, ← Matrix.mul_assoc, det_mul]
  swap; · 

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
pb✝ : PowerBasis K L
inst✝¹ : IsSeparable K L
inst✝ : DecidableEq ι
b : Basis ι K L
this : FiniteDimensional K L
pb : PowerBasis K L := Field.powerBasisOfFiniteOfSeparable K L
⊢ Basis.toMatrix b ⇑pb.basis * Basis.toMatrix pb.basis ⇑b = 1

Next tactic:
apply Basis.toMatrix_mul_toMatrix_flip
theorem det_traceForm_ne_zero [IsSeparable K L] [DecidableEq ι] (b : Basis ι K L) :
    det (BilinForm.toMatrix b (traceForm K L)) ≠ 0 := by
  haveI : FiniteDimensional K L := FiniteDimensional.of_fintype_basis b
  let pb : PowerBasis K L := Field.powerBasisOfFiniteOfSeparable _ _
  rw [← BilinForm.toMatrix_mul_basis_toMatrix pb.basis b, ←
    det_comm' (pb.basis.toMatrix_mul_toMatrix_flip b) _, ← Matrix.mul_assoc, det_mul]
  swap; · apply Basis.toMatrix_mul_toMatrix_flip
  

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
pb✝ : PowerBasis K L
inst✝¹ : IsSeparable K L
inst✝ : DecidableEq ι
b : Basis ι K L
this : FiniteDimensional K L
pb : PowerBasis K L := Field.powerBasisOfFiniteOfSeparable K L
⊢ det (Basis.toMatrix pb.basis ⇑b * (Basis.toMatrix pb.basis ⇑b)ᵀ) *
      det ((BilinForm.toMatrix pb.basis) (traceForm K L)) ≠
    0

Next tactic:
refine'
    mul_ne_zero
      (isUnit_of_mul_eq_one _ ((b.toMatrix pb.basis)ᵀ * b.toMatrix pb.basis).det _).ne_zero _
theorem det_traceForm_ne_zero [IsSeparable K L] [DecidableEq ι] (b : Basis ι K L) :
    det (BilinForm.toMatrix b (traceForm K L)) ≠ 0 := by
  haveI : FiniteDimensional K L := FiniteDimensional.of_fintype_basis b
  let pb : PowerBasis K L := Field.powerBasisOfFiniteOfSeparable _ _
  rw [← BilinForm.toMatrix_mul_basis_toMatrix pb.basis b, ←
    det_comm' (pb.basis.toMatrix_mul_toMatrix_flip b) _, ← Matrix.mul_assoc, det_mul]
  swap; · apply Basis.toMatrix_mul_toMatrix_flip
  refine'
    mul_ne_zero
      (isUnit_of_mul_eq_one _ ((b.toMatrix pb.basis)ᵀ * b.toMatrix pb.basis).det _).ne_zero _
  · 

Proof state:
case refine'_1
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
pb✝ : PowerBasis K L
inst✝¹ : IsSeparable K L
inst✝ : DecidableEq ι
b : Basis ι K L
this : FiniteDimensional K L
pb : PowerBasis K L := Field.powerBasisOfFiniteOfSeparable K L
⊢ det (Basis.toMatrix pb.basis ⇑b * (Basis.toMatrix pb.basis ⇑b)ᵀ) *
      det ((Basis.toMatrix b ⇑pb.basis)ᵀ * Basis.toMatrix b ⇑pb.basis) =
    1

Next tactic:
calc
      (pb.basis.toMatrix b * (pb.basis.toMatrix b)ᵀ).det *
            ((b.toMatrix pb.basis)ᵀ * b.toMatrix pb.basis).det =
          (pb.basis.toMatrix b * (b.toMatrix pb.basis * pb.basis.toMatrix b)ᵀ *
              b.toMatrix pb.basis).det :=
        by simp only [← det_mul, Matrix.mul_assoc, Matrix.transpose_mul]
      _ = 1 := by
        simp only [Basis.toMatrix_mul_toMatrix_flip, Matrix.transpose_one, Matrix.mul_one,
          Matrix.det_one]
theorem det_traceForm_ne_zero [IsSeparable K L] [DecidableEq ι] (b : Basis ι K L) :
    det (BilinForm.toMatrix b (traceForm K L)) ≠ 0 := by
  haveI : FiniteDimensional K L := FiniteDimensional.of_fintype_basis b
  let pb : PowerBasis K L := Field.powerBasisOfFiniteOfSeparable _ _
  rw [← BilinForm.toMatrix_mul_basis_toMatrix pb.basis b, ←
    det_comm' (pb.basis.toMatrix_mul_toMatrix_flip b) _, ← Matrix.mul_assoc, det_mul]
  swap; · apply Basis.toMatrix_mul_toMatrix_flip
  refine'
    mul_ne_zero
      (isUnit_of_mul_eq_one _ ((b.toMatrix pb.basis)ᵀ * b.toMatrix pb.basis).det _).ne_zero _
  · calc
      (pb.basis.toMatrix b * (pb.basis.toMatrix b)ᵀ).det *
            ((b.toMatrix pb.basis)ᵀ * b.toMatrix pb.basis).det =
          (pb.basis.toMatrix b * (b.toMatrix pb.basis * pb.basis.toMatrix b)ᵀ *
              b.toMatrix pb.basis).det :=
        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
pb✝ : PowerBasis K L
inst✝¹ : IsSeparable K L
inst✝ : DecidableEq ι
b : Basis ι K L
this : FiniteDimensional K L
pb : PowerBasis K L := Field.powerBasisOfFiniteOfSeparable K L
⊢ det (Basis.toMatrix pb.basis ⇑b * (Basis.toMatrix pb.basis ⇑b)ᵀ) *
      det ((Basis.toMatrix b ⇑pb.basis)ᵀ * Basis.toMatrix b ⇑pb.basis) =
    det
      (Basis.toMatrix pb.basis ⇑b * (Basis.toMatrix b ⇑pb.basis * Basis.toMatrix pb.basis ⇑b)ᵀ *
        Basis.toMatrix b ⇑pb.basis)

Next tactic:
simp only [← det_mul, Matrix.mul_assoc, Matrix.transpose_mul]
theorem det_traceForm_ne_zero [IsSeparable K L] [DecidableEq ι] (b : Basis ι K L) :
    det (BilinForm.toMatrix b (traceForm K L)) ≠ 0 := by
  haveI : FiniteDimensional K L := FiniteDimensional.of_fintype_basis b
  let pb : PowerBasis K L := Field.powerBasisOfFiniteOfSeparable _ _
  rw [← BilinForm.toMatrix_mul_basis_toMatrix pb.basis b, ←
    det_comm' (pb.basis.toMatrix_mul_toMatrix_flip b) _, ← Matrix.mul_assoc, det_mul]
  swap; · apply Basis.toMatrix_mul_toMatrix_flip
  refine'
    mul_ne_zero
      (isUnit_of_mul_eq_one _ ((b.toMatrix pb.basis)ᵀ * b.toMatrix pb.basis).det _).ne_zero _
  · calc
      (pb.basis.toMatrix b * (pb.basis.toMatrix b)ᵀ).det *
            ((b.toMatrix pb.basis)ᵀ * b.toMatrix pb.basis).det =
          (pb.basis.toMatrix b * (b.toMatrix pb.basis * pb.basis.toMatrix b)ᵀ *
              b.toMatrix pb.basis).det :=
        by simp only [← det_mul, Matrix.mul_assoc, Matrix.transpose_mul]
      _ = 1 := 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
pb✝ : PowerBasis K L
inst✝¹ : IsSeparable K L
inst✝ : DecidableEq ι
b : Basis ι K L
this : FiniteDimensional K L
pb : PowerBasis K L := Field.powerBasisOfFiniteOfSeparable K L
⊢ det
      (Basis.toMatrix pb.basis ⇑b * (Basis.toMatrix b ⇑pb.basis * Basis.toMatrix pb.basis ⇑b)ᵀ *
        Basis.toMatrix b ⇑pb.basis) =
    1

Next tactic:
simp only [Basis.toMatrix_mul_toMatrix_flip, Matrix.transpose_one, Matrix.mul_one,
          Matrix.det_one]
theorem det_traceForm_ne_zero [IsSeparable K L] [DecidableEq ι] (b : Basis ι K L) :
    det (BilinForm.toMatrix b (traceForm K L)) ≠ 0 := by
  haveI : FiniteDimensional K L := FiniteDimensional.of_fintype_basis b
  let pb : PowerBasis K L := Field.powerBasisOfFiniteOfSeparable _ _
  rw [← BilinForm.toMatrix_mul_basis_toMatrix pb.basis b, ←
    det_comm' (pb.basis.toMatrix_mul_toMatrix_flip b) _, ← Matrix.mul_assoc, det_mul]
  swap; · apply Basis.toMatrix_mul_toMatrix_flip
  refine'
    mul_ne_zero
      (isUnit_of_mul_eq_one _ ((b.toMatrix pb.basis)ᵀ * b.toMatrix pb.basis).det _).ne_zero _
  · calc
      (pb.basis.toMatrix b * (pb.basis.toMatrix b)ᵀ).det *
            ((b.toMatrix pb.basis)ᵀ * b.toMatrix pb.basis).det =
          (pb.basis.toMatrix b * (b.toMatrix pb.basis * pb.basis.toMatrix b)ᵀ *
              b.toMatrix pb.basis).det :=
        by simp only [← det_mul, Matrix.mul_assoc, Matrix.transpose_mul]
      _ = 1 := by
        simp only [Basis.toMatrix_mul_toMatrix_flip, Matrix.transpose_one, Matrix.mul_one,
          Matrix.det_one]
  

Proof state:
case refine'_2
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
pb✝ : PowerBasis K L
inst✝¹ : IsSeparable K L
inst✝ : DecidableEq ι
b : Basis ι K L
this : FiniteDimensional K L
pb : PowerBasis K L := Field.powerBasisOfFiniteOfSeparable K L
⊢ det ((BilinForm.toMatrix pb.basis) (traceForm K L)) ≠ 0

Next tactic:
simpa only [traceMatrix_of_basis] using det_traceMatrix_ne_zero' pb
theorem Algebra.trace_ne_zero [FiniteDimensional K L] [IsSeparable K L] :
    Algebra.trace K L ≠ 0 := 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
pb : PowerBasis K L
inst✝¹ : FiniteDimensional K L
inst✝ : IsSeparable K L
⊢ trace K L ≠ 0

Next tactic:
intro e
theorem Algebra.trace_ne_zero [FiniteDimensional K L] [IsSeparable K L] :
    Algebra.trace K L ≠ 0 := by
  intro e
  

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
pb : PowerBasis K L
inst✝¹ : FiniteDimensional K L
inst✝ : IsSeparable K L
e : trace K L = 0
⊢ False

Next tactic:
let pb : PowerBasis K L := Field.powerBasisOfFiniteOfSeparable _ _
theorem Algebra.trace_ne_zero [FiniteDimensional K L] [IsSeparable K L] :
    Algebra.trace K L ≠ 0 := by
  intro e
  let pb : PowerBasis K L := Field.powerBasisOfFiniteOfSeparable _ _
  

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
pb✝ : PowerBasis K L
inst✝¹ : FiniteDimensional K L
inst✝ : IsSeparable K L
e : trace K L = 0
pb : PowerBasis K L := Field.powerBasisOfFiniteOfSeparable K L
⊢ False

Next tactic:
apply det_traceMatrix_ne_zero' pb
theorem Algebra.trace_ne_zero [FiniteDimensional K L] [IsSeparable K L] :
    Algebra.trace K L ≠ 0 := by
  intro e
  let pb : PowerBasis K L := Field.powerBasisOfFiniteOfSeparable _ _
  apply det_traceMatrix_ne_zero' pb
  

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
pb✝ : PowerBasis K L
inst✝¹ : FiniteDimensional K L
inst✝ : IsSeparable K L
e : trace K L = 0
pb : PowerBasis K L := Field.powerBasisOfFiniteOfSeparable K L
⊢ det (traceMatrix K ⇑pb.basis) = 0

Next tactic:
rw [show traceMatrix K pb.basis = 0 by ext; simp [e], Matrix.det_zero]
theorem Algebra.trace_ne_zero [FiniteDimensional K L] [IsSeparable K L] :
    Algebra.trace K L ≠ 0 := by
  intro e
  let pb : PowerBasis K L := Field.powerBasisOfFiniteOfSeparable _ _
  apply det_traceMatrix_ne_zero' pb
  rw [show traceMatrix K pb.basis = 0 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
pb✝ : PowerBasis K L
inst✝¹ : FiniteDimensional K L
inst✝ : IsSeparable K L
e : trace K L = 0
pb : PowerBasis K L := Field.powerBasisOfFiniteOfSeparable K L
⊢ traceMatrix K ⇑pb.basis = 0

Next tactic:
ext
theorem Algebra.trace_ne_zero [FiniteDimensional K L] [IsSeparable K L] :
    Algebra.trace K L ≠ 0 := by
  intro e
  let pb : PowerBasis K L := Field.powerBasisOfFiniteOfSeparable _ _
  apply det_traceMatrix_ne_zero' pb
  rw [show traceMatrix K pb.basis = 0 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
pb✝ : PowerBasis K L
inst✝¹ : FiniteDimensional K L
inst✝ : IsSeparable K L
e : trace K L = 0
pb : PowerBasis K L := Field.powerBasisOfFiniteOfSeparable K L
i✝ x✝ : Fin pb.dim
⊢ traceMatrix K (⇑pb.basis) i✝ x✝ = OfNat.ofNat 0 i✝ x✝

Next tactic:
simp [e]