l3lab/ntp-mathlib huggingface dataset:
@[simp]
theorem trace_prod_apply [Module.Free R S] [Module.Free R T] [Module.Finite R S] [Module.Finite R T]
    (x : S × T) : trace R (S × T) x = trace R S x.fst + trace R T x.snd := by
  nontriviality R
  let f := (lmul R S).toLinearMap.prodMap (lmul R T).toLinearMap
  have : (lmul R (S × T)).toLinearMap = (prodMapLinear R S T S T R).comp f :=
    LinearMap.ext₂ Prod.mul_def
  

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 ι
b : Basis ι R S
inst✝³ : Module.Free R S
inst✝² : Module.Free R T
inst✝¹ : Module.Finite R S
inst✝ : Module.Finite R T
x : S × T
✝ : Nontrivial R
f : S × T →ₗ[R] Module.End R S × Module.End R T :=
  prodMap (AlgHom.toLinearMap (lmul R S)) (AlgHom.toLinearMap (lmul R T))
this : AlgHom.toLinearMap (lmul R (S × T)) = prodMapLinear R S T S T R ∘ₗ f
⊢ (trace R (S × T)) x = (trace R S) x.1 + (trace R T) x.2

Next tactic:
simp_rw [trace, this]
@[simp]
theorem trace_prod_apply [Module.Free R S] [Module.Free R T] [Module.Finite R S] [Module.Finite R T]
    (x : S × T) : trace R (S × T) x = trace R S x.fst + trace R T x.snd := by
  nontriviality R
  let f := (lmul R S).toLinearMap.prodMap (lmul R T).toLinearMap
  have : (lmul R (S × T)).toLinearMap = (prodMapLinear R S T S T R).comp f :=
    LinearMap.ext₂ Prod.mul_def
  simp_rw [trace, this]
  

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 ι
b : Basis ι R S
inst✝³ : Module.Free R S
inst✝² : Module.Free R T
inst✝¹ : Module.Finite R S
inst✝ : Module.Finite R T
x : S × T
✝ : Nontrivial R
f : S × T →ₗ[R] Module.End R S × Module.End R T :=
  prodMap (AlgHom.toLinearMap (lmul R S)) (AlgHom.toLinearMap (lmul R T))
this : AlgHom.toLinearMap (lmul R (S × T)) = prodMapLinear R S T S T R ∘ₗ f
⊢ (comp (LinearMap.trace R (S × T))
        (prodMapLinear R S T S T R ∘ₗ prodMap (AlgHom.toLinearMap (lmul R S)) (AlgHom.toLinearMap (lmul R T))))
      x =
    (comp (LinearMap.trace R S) (AlgHom.toLinearMap (lmul R S))) x.1 +
      (comp (LinearMap.trace R T) (AlgHom.toLinearMap (lmul R T))) x.2

Next tactic:
exact trace_prodMap' _ _
theorem trace_prod [Module.Free R S] [Module.Free R T] [Module.Finite R S] [Module.Finite R T] :
    trace R (S × T) = (trace R S).coprod (trace R T) :=
  LinearMap.ext fun 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 ι
b : Basis ι R S
inst✝³ : Module.Free R S
inst✝² : Module.Free R T
inst✝¹ : Module.Finite R S
inst✝ : Module.Finite R T
p : S × T
⊢ (trace R (S × T)) p = (coprod (trace R S) (trace R T)) p

Next tactic:
rw [coprod_apply, trace_prod_apply]
theorem traceForm_toMatrix [DecidableEq ι] (i j) :
    BilinForm.toMatrix b (traceForm R S) i j = trace R S (b i * b j) := 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 ι
b : Basis ι R S
inst✝ : DecidableEq ι
i j : ι
⊢ (BilinForm.toMatrix b) (traceForm R S) i j = (trace R S) (b i * b j)

Next tactic:
rw [BilinForm.toMatrix_apply, traceForm_apply]
theorem traceForm_toMatrix_powerBasis (h : PowerBasis R S) :
    BilinForm.toMatrix h.basis (traceForm R S) = of fun i j => trace R S (h.gen ^ (i.1 + j.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 ι
b : Basis ι R S
h : PowerBasis R S
⊢ (BilinForm.toMatrix h.basis) (traceForm R S) = of fun i j => (trace R S) (h.gen ^ (↑i + ↑j))

Next tactic:
ext
theorem traceForm_toMatrix_powerBasis (h : PowerBasis R S) :
    BilinForm.toMatrix h.basis (traceForm R S) = of fun i j => trace R S (h.gen ^ (i.1 + j.1)) :=
  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 ι
b : Basis ι R S
h : PowerBasis R S
i✝ x✝ : Fin h.dim
⊢ (BilinForm.toMatrix h.basis) (traceForm R S) i✝ x✝ = of (fun i j => (trace R S) (h.gen ^ (↑i + ↑j))) i✝ x✝

Next tactic:
rw [traceForm_toMatrix, of_apply, pow_add, h.basis_eq_pow, h.basis_eq_pow]
/-- Given `pb : PowerBasis K S`, the trace of `pb.gen` is `-(minpoly K pb.gen).nextCoeff`. -/
theorem PowerBasis.trace_gen_eq_nextCoeff_minpoly [Nontrivial S] (pb : PowerBasis K S) :
    Algebra.trace K S pb.gen = -(minpoly K pb.gen).nextCoeff := 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 K S
inst✝¹ : Algebra K F
inst✝ : Nontrivial S
pb : PowerBasis K S
⊢ (Algebra.trace K S) pb.gen = -nextCoeff (minpoly K pb.gen)

Next tactic:
have d_pos : 0 < pb.dim := PowerBasis.dim_pos pb
/-- Given `pb : PowerBasis K S`, the trace of `pb.gen` is `-(minpoly K pb.gen).nextCoeff`. -/
theorem PowerBasis.trace_gen_eq_nextCoeff_minpoly [Nontrivial S] (pb : PowerBasis K S) :
    Algebra.trace K S pb.gen = -(minpoly K pb.gen).nextCoeff := by
  have d_pos : 0 < pb.dim := PowerBasis.dim_pos 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 K S
inst✝¹ : Algebra K F
inst✝ : Nontrivial S
pb : PowerBasis K S
d_pos : 0 < pb.dim
⊢ (Algebra.trace K S) pb.gen = -nextCoeff (minpoly K pb.gen)

Next tactic:
have d_pos' : 0 < (minpoly K pb.gen).natDegree := by simpa
/-- Given `pb : PowerBasis K S`, the trace of `pb.gen` is `-(minpoly K pb.gen).nextCoeff`. -/
theorem PowerBasis.trace_gen_eq_nextCoeff_minpoly [Nontrivial S] (pb : PowerBasis K S) :
    Algebra.trace K S pb.gen = -(minpoly K pb.gen).nextCoeff := by
  have d_pos : 0 < pb.dim := PowerBasis.dim_pos pb
  have d_pos' : 0 < (minpoly K pb.gen).natDegree := 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 K S
inst✝¹ : Algebra K F
inst✝ : Nontrivial S
pb : PowerBasis K S
d_pos : 0 < pb.dim
⊢ 0 < natDegree (minpoly K pb.gen)

Next tactic:
simpa
/-- Given `pb : PowerBasis K S`, the trace of `pb.gen` is `-(minpoly K pb.gen).nextCoeff`. -/
theorem PowerBasis.trace_gen_eq_nextCoeff_minpoly [Nontrivial S] (pb : PowerBasis K S) :
    Algebra.trace K S pb.gen = -(minpoly K pb.gen).nextCoeff := by
  have d_pos : 0 < pb.dim := PowerBasis.dim_pos pb
  have d_pos' : 0 < (minpoly K pb.gen).natDegree := by simpa
  

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 K S
inst✝¹ : Algebra K F
inst✝ : Nontrivial S
pb : PowerBasis K S
d_pos : 0 < pb.dim
d_pos' : 0 < natDegree (minpoly K pb.gen)
⊢ (Algebra.trace K S) pb.gen = -nextCoeff (minpoly K pb.gen)

Next tactic:
haveI : Nonempty (Fin pb.dim) := ⟨⟨0, d_pos⟩⟩
/-- Given `pb : PowerBasis K S`, the trace of `pb.gen` is `-(minpoly K pb.gen).nextCoeff`. -/
theorem PowerBasis.trace_gen_eq_nextCoeff_minpoly [Nontrivial S] (pb : PowerBasis K S) :
    Algebra.trace K S pb.gen = -(minpoly K pb.gen).nextCoeff := by
  have d_pos : 0 < pb.dim := PowerBasis.dim_pos pb
  have d_pos' : 0 < (minpoly K pb.gen).natDegree := by simpa
  haveI : Nonempty (Fin pb.dim) := ⟨⟨0, d_pos⟩⟩
  

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 K S
inst✝¹ : Algebra K F
inst✝ : Nontrivial S
pb : PowerBasis K S
d_pos : 0 < pb.dim
d_pos' : 0 < natDegree (minpoly K pb.gen)
this : Nonempty (Fin pb.dim)
⊢ (Algebra.trace K S) pb.gen = -nextCoeff (minpoly K pb.gen)

Next tactic:
rw [trace_eq_matrix_trace pb.basis, trace_eq_neg_charpoly_coeff, charpoly_leftMulMatrix, ←
    pb.natDegree_minpoly, Fintype.card_fin, ← nextCoeff_of_pos_natDegree _ d_pos']
/-- Given `pb : PowerBasis K S`, then the trace of `pb.gen` is
`((minpoly K pb.gen).aroots F).sum`. -/
theorem PowerBasis.trace_gen_eq_sum_roots [Nontrivial S] (pb : PowerBasis K S)
    (hf : (minpoly K pb.gen).Splits (algebraMap K F)) :
    algebraMap K F (trace K S pb.gen) = ((minpoly K pb.gen).aroots F).sum := 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 K S
inst✝¹ : Algebra K F
inst✝ : Nontrivial S
pb : PowerBasis K S
hf : Splits (algebraMap K F) (minpoly K pb.gen)
⊢ (algebraMap K F) ((Algebra.trace K S) pb.gen) = Multiset.sum (aroots (minpoly K pb.gen) F)

Next tactic:
rw [PowerBasis.trace_gen_eq_nextCoeff_minpoly, RingHom.map_neg, ←
    nextCoeff_map (algebraMap K F).injective,
    sum_roots_eq_nextCoeff_of_monic_of_split ((minpoly.monic (PowerBasis.isIntegral_gen _)).map _)
      ((splits_id_iff_splits _).2 hf),
    neg_neg]
theorem trace_gen_eq_zero {x : L} (hx : ¬IsIntegral K x) :
    Algebra.trace K K⟮x⟯ (AdjoinSimple.gen K x) = 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 K S
inst✝ : Algebra K F
x : L
hx : ¬IsIntegral K x
⊢ (Algebra.trace K ↥K⟮x⟯) (gen K x) = 0

Next tactic:
rw [trace_eq_zero_of_not_exists_basis, LinearMap.zero_apply]
theorem trace_gen_eq_zero {x : L} (hx : ¬IsIntegral K x) :
    Algebra.trace K K⟮x⟯ (AdjoinSimple.gen K x) = 0 := by
  rw [trace_eq_zero_of_not_exists_basis, LinearMap.zero_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 K S
inst✝ : Algebra K F
x : L
hx : ¬IsIntegral K x
⊢ ¬∃ s, Nonempty (Basis { x_1 // x_1 ∈ s } K ↥K⟮x⟯)

Next tactic:
contrapose! hx
theorem trace_gen_eq_zero {x : L} (hx : ¬IsIntegral K x) :
    Algebra.trace K K⟮x⟯ (AdjoinSimple.gen K x) = 0 := by
  rw [trace_eq_zero_of_not_exists_basis, LinearMap.zero_apply]
  contrapose! hx
  

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 K S
inst✝ : Algebra K F
x : L
hx : ∃ s, Nonempty (Basis { x_1 // x_1 ∈ s } K ↥K⟮x⟯)
⊢ IsIntegral K x

Next tactic:
obtain ⟨s, ⟨b⟩⟩ := hx
theorem trace_gen_eq_zero {x : L} (hx : ¬IsIntegral K x) :
    Algebra.trace K K⟮x⟯ (AdjoinSimple.gen K x) = 0 := by
  rw [trace_eq_zero_of_not_exists_basis, LinearMap.zero_apply]
  contrapose! hx
  obtain ⟨s, ⟨b⟩⟩ := hx
  

Proof state:
case h.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 K S
inst✝ : Algebra K F
x : L
s : Finset ↥K⟮x⟯
b : Basis { x_1 // x_1 ∈ s } K ↥K⟮x⟯
⊢ IsIntegral K x

Next tactic:
refine' .of_mem_of_fg K⟮x⟯.toSubalgebra _ x _
theorem trace_gen_eq_zero {x : L} (hx : ¬IsIntegral K x) :
    Algebra.trace K K⟮x⟯ (AdjoinSimple.gen K x) = 0 := by
  rw [trace_eq_zero_of_not_exists_basis, LinearMap.zero_apply]
  contrapose! hx
  obtain ⟨s, ⟨b⟩⟩ := hx
  refine' .of_mem_of_fg K⟮x⟯.toSubalgebra _ x _
  · 

Proof state:
case h.intro.intro.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 K S
inst✝ : Algebra K F
x : L
s : Finset ↥K⟮x⟯
b : Basis { x_1 // x_1 ∈ s } K ↥K⟮x⟯
⊢ Submodule.FG (Subalgebra.toSubmodule K⟮x⟯.toSubalgebra)

Next tactic:
exact (Submodule.fg_iff_finiteDimensional _).mpr (FiniteDimensional.of_fintype_basis b)
theorem trace_gen_eq_zero {x : L} (hx : ¬IsIntegral K x) :
    Algebra.trace K K⟮x⟯ (AdjoinSimple.gen K x) = 0 := by
  rw [trace_eq_zero_of_not_exists_basis, LinearMap.zero_apply]
  contrapose! hx
  obtain ⟨s, ⟨b⟩⟩ := hx
  refine' .of_mem_of_fg K⟮x⟯.toSubalgebra _ x _
  · exact (Submodule.fg_iff_finiteDimensional _).mpr (FiniteDimensional.of_fintype_basis b)
  · 

Proof state:
case h.intro.intro.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 K S
inst✝ : Algebra K F
x : L
s : Finset ↥K⟮x⟯
b : Basis { x_1 // x_1 ∈ s } K ↥K⟮x⟯
⊢ x ∈ K⟮x⟯.toSubalgebra

Next tactic:
exact subset_adjoin K _ (Set.mem_singleton x)
theorem trace_gen_eq_sum_roots (x : L) (hf : (minpoly K x).Splits (algebraMap K F)) :
    algebraMap K F (trace K K⟮x⟯ (AdjoinSimple.gen K x)) =
      ((minpoly K x).aroots F).sum := 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 K S
inst✝ : Algebra K F
x : L
hf : Splits (algebraMap K F) (minpoly K x)
⊢ (algebraMap K F) ((Algebra.trace K ↥K⟮x⟯) (gen K x)) = Multiset.sum (aroots (minpoly K x) F)

Next tactic:
have injKxL := (algebraMap K⟮x⟯ L).injective
theorem trace_gen_eq_sum_roots (x : L) (hf : (minpoly K x).Splits (algebraMap K F)) :
    algebraMap K F (trace K K⟮x⟯ (AdjoinSimple.gen K x)) =
      ((minpoly K x).aroots F).sum := by
  have injKxL := (algebraMap K⟮x⟯ L).injective
  

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 K S
inst✝ : Algebra K F
x : L
hf : Splits (algebraMap K F) (minpoly K x)
injKxL : Function.Injective ⇑(algebraMap (↥K⟮x⟯) L)
⊢ (algebraMap K F) ((Algebra.trace K ↥K⟮x⟯) (gen K x)) = Multiset.sum (aroots (minpoly K x) F)

Next tactic:
by_cases hx : IsIntegral K x
theorem trace_gen_eq_sum_roots (x : L) (hf : (minpoly K x).Splits (algebraMap K F)) :
    algebraMap K F (trace K K⟮x⟯ (AdjoinSimple.gen K x)) =
      ((minpoly K x).aroots F).sum := by
  have injKxL := (algebraMap K⟮x⟯ L).injective
  by_cases hx : IsIntegral K x; 

Proof state:
case pos
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 K S
inst✝ : Algebra K F
x : L
hf : Splits (algebraMap K F) (minpoly K x)
injKxL : Function.Injective ⇑(algebraMap (↥K⟮x⟯) L)
hx : IsIntegral K x
⊢ (algebraMap K F) ((Algebra.trace K ↥K⟮x⟯) (gen K x)) = Multiset.sum (aroots (minpoly K x) F)
case neg
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 K S
inst✝ : Algebra K F
x : L
hf : Splits (algebraMap K F) (minpoly K x)
injKxL : Function.Injective ⇑(algebraMap (↥K⟮x⟯) L)
hx : ¬IsIntegral K x
⊢ (algebraMap K F) ((Algebra.trace K ↥K⟮x⟯) (gen K x)) = Multiset.sum (aroots (minpoly K x) F)

Next tactic:
swap
theorem trace_gen_eq_sum_roots (x : L) (hf : (minpoly K x).Splits (algebraMap K F)) :
    algebraMap K F (trace K K⟮x⟯ (AdjoinSimple.gen K x)) =
      ((minpoly K x).aroots F).sum := by
  have injKxL := (algebraMap K⟮x⟯ L).injective
  by_cases hx : IsIntegral K x; swap
  · 

Proof state:
case neg
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 K S
inst✝ : Algebra K F
x : L
hf : Splits (algebraMap K F) (minpoly K x)
injKxL : Function.Injective ⇑(algebraMap (↥K⟮x⟯) L)
hx : ¬IsIntegral K x
⊢ (algebraMap K F) ((Algebra.trace K ↥K⟮x⟯) (gen K x)) = Multiset.sum (aroots (minpoly K x) F)

Next tactic:
simp [minpoly.eq_zero hx, trace_gen_eq_zero hx, aroots_def]
theorem trace_gen_eq_sum_roots (x : L) (hf : (minpoly K x).Splits (algebraMap K F)) :
    algebraMap K F (trace K K⟮x⟯ (AdjoinSimple.gen K x)) =
      ((minpoly K x).aroots F).sum := by
  have injKxL := (algebraMap K⟮x⟯ L).injective
  by_cases hx : IsIntegral K x; swap
  · simp [minpoly.eq_zero hx, trace_gen_eq_zero hx, aroots_def]
  

Proof state:
case pos
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 K S
inst✝ : Algebra K F
x : L
hf : Splits (algebraMap K F) (minpoly K x)
injKxL : Function.Injective ⇑(algebraMap (↥K⟮x⟯) L)
hx : IsIntegral K x
⊢ (algebraMap K F) ((Algebra.trace K ↥K⟮x⟯) (gen K x)) = Multiset.sum (aroots (minpoly K x) F)

Next tactic:
rw [← adjoin.powerBasis_gen hx, (adjoin.powerBasis hx).trace_gen_eq_sum_roots]
theorem trace_gen_eq_sum_roots (x : L) (hf : (minpoly K x).Splits (algebraMap K F)) :
    algebraMap K F (trace K K⟮x⟯ (AdjoinSimple.gen K x)) =
      ((minpoly K x).aroots F).sum := by
  have injKxL := (algebraMap K⟮x⟯ L).injective
  by_cases hx : IsIntegral K x; swap
  · simp [minpoly.eq_zero hx, trace_gen_eq_zero hx, aroots_def]
  rw [← adjoin.powerBasis_gen hx, (adjoin.powerBasis hx).trace_gen_eq_sum_roots] <;>
    

Proof state:
case pos
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 K S
inst✝ : Algebra K F
x : L
hf : Splits (algebraMap K F) (minpoly K x)
injKxL : Function.Injective ⇑(algebraMap (↥K⟮x⟯) L)
hx : IsIntegral K x
⊢ Multiset.sum (aroots (minpoly K (adjoin.powerBasis hx).gen) F) = Multiset.sum (aroots (minpoly K x) F)

Next tactic:
rw [adjoin.powerBasis_gen hx, ← minpoly.algebraMap_eq injKxL]
theorem trace_gen_eq_sum_roots (x : L) (hf : (minpoly K x).Splits (algebraMap K F)) :
    algebraMap K F (trace K K⟮x⟯ (AdjoinSimple.gen K x)) =
      ((minpoly K x).aroots F).sum := by
  have injKxL := (algebraMap K⟮x⟯ L).injective
  by_cases hx : IsIntegral K x; swap
  · simp [minpoly.eq_zero hx, trace_gen_eq_zero hx, aroots_def]
  rw [← adjoin.powerBasis_gen hx, (adjoin.powerBasis hx).trace_gen_eq_sum_roots] <;>
    

Proof state:
case pos
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 K S
inst✝ : Algebra K F
x : L
hf : Splits (algebraMap K F) (minpoly K x)
injKxL : Function.Injective ⇑(algebraMap (↥K⟮x⟯) L)
hx : IsIntegral K x
⊢ Splits (algebraMap K F) (minpoly K (adjoin.powerBasis hx).gen)

Next tactic:
rw [adjoin.powerBasis_gen hx, ← minpoly.algebraMap_eq injKxL]
theorem trace_gen_eq_sum_roots (x : L) (hf : (minpoly K x).Splits (algebraMap K F)) :
    algebraMap K F (trace K K⟮x⟯ (AdjoinSimple.gen K x)) =
      ((minpoly K x).aroots F).sum := by
  have injKxL := (algebraMap K⟮x⟯ L).injective
  by_cases hx : IsIntegral K x; swap
  · simp [minpoly.eq_zero hx, trace_gen_eq_zero hx, aroots_def]
  rw [← adjoin.powerBasis_gen hx, (adjoin.powerBasis hx).trace_gen_eq_sum_roots] <;>
    rw [adjoin.powerBasis_gen hx, ← minpoly.algebraMap_eq injKxL] <;>
    

Proof state:
case pos
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 K S
inst✝ : Algebra K F
x : L
hf : Splits (algebraMap K F) (minpoly K x)
injKxL : Function.Injective ⇑(algebraMap (↥K⟮x⟯) L)
hx : IsIntegral K x
⊢ Multiset.sum (aroots (minpoly K ((algebraMap (↥K⟮x⟯) L) (gen K x))) F) = Multiset.sum (aroots (minpoly K x) F)

Next tactic:
try simp only [AdjoinSimple.algebraMap_gen _ _]
theorem trace_gen_eq_sum_roots (x : L) (hf : (minpoly K x).Splits (algebraMap K F)) :
    algebraMap K F (trace K K⟮x⟯ (AdjoinSimple.gen K x)) =
      ((minpoly K x).aroots F).sum := by
  have injKxL := (algebraMap K⟮x⟯ L).injective
  by_cases hx : IsIntegral K x; swap
  · simp [minpoly.eq_zero hx, trace_gen_eq_zero hx, aroots_def]
  rw [← adjoin.powerBasis_gen hx, (adjoin.powerBasis hx).trace_gen_eq_sum_roots] <;>
    rw [adjoin.powerBasis_gen hx, ← minpoly.algebraMap_eq injKxL] <;>
    try 

Proof state:
case pos
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 K S
inst✝ : Algebra K F
x : L
hf : Splits (algebraMap K F) (minpoly K x)
injKxL : Function.Injective ⇑(algebraMap (↥K⟮x⟯) L)
hx : IsIntegral K x
⊢ Multiset.sum (aroots (minpoly K ((algebraMap (↥K⟮x⟯) L) (gen K x))) F) = Multiset.sum (aroots (minpoly K x) F)

Next tactic:
simp only [AdjoinSimple.algebraMap_gen _ _]