l3lab/ntp-mathlib huggingface dataset:
theorem sum_embeddings_eq_finrank_mul [FiniteDimensional K F] [IsSeparable K F]
    (pb : PowerBasis K L) :
    ∑ σ : F →ₐ[K] E, σ (algebraMap L F pb.gen) =
      finrank L F •
        (@Finset.univ _ (PowerBasis.AlgHom.fintype pb)).sum fun σ : L →ₐ[K] E => σ pb.gen := by
  haveI : FiniteDimensional L F := FiniteDimensional.right K L F
  haveI : IsSeparable L F := isSeparable_tower_top_of_isSeparable K L F
  letI : Fintype (L →ₐ[K] E) := PowerBasis.AlgHom.fintype pb
  letI : ∀ f : L →ₐ[K] E, Fintype (haveI := f.toRingHom.toAlgebra; AlgHom L F E) := ?_
  rw [Fintype.sum_equiv algHomEquivSigma (fun σ : F →ₐ[K] E => _) fun σ => σ.1 pb.gen, ←
    Finset.univ_sigma_univ, Finset.sum_sigma, ← Finset.sum_nsmul]
  refine' Finset.sum_congr rfl fun σ _ => _
  · 

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
inst✝⁶ : Algebra K F
inst✝⁵ : IsScalarTower K L F
E : Type u_7
inst✝⁴ : Field E
inst✝³ : Algebra K E
inst✝² : IsAlgClosed E
inst✝¹ : FiniteDimensional K F
inst✝ : IsSeparable K F
pb : PowerBasis K L
this✝² : FiniteDimensional L F
this✝¹ : IsSeparable L F
this✝ : Fintype (L →ₐ[K] E) := PowerBasis.AlgHom.fintype pb
this : (f : L →ₐ[K] E) → Fintype (F →ₐ[L] E) := ?refine_1
σ : L →ₐ[K] E
x✝ : σ ∈ Finset.univ
⊢ ∑ s : F →ₐ[L] E, { fst := σ, snd := s }.fst pb.gen = finrank L F • σ pb.gen

Next tactic:
letI : Algebra L E := σ.toRingHom.toAlgebra
theorem sum_embeddings_eq_finrank_mul [FiniteDimensional K F] [IsSeparable K F]
    (pb : PowerBasis K L) :
    ∑ σ : F →ₐ[K] E, σ (algebraMap L F pb.gen) =
      finrank L F •
        (@Finset.univ _ (PowerBasis.AlgHom.fintype pb)).sum fun σ : L →ₐ[K] E => σ pb.gen := by
  haveI : FiniteDimensional L F := FiniteDimensional.right K L F
  haveI : IsSeparable L F := isSeparable_tower_top_of_isSeparable K L F
  letI : Fintype (L →ₐ[K] E) := PowerBasis.AlgHom.fintype pb
  letI : ∀ f : L →ₐ[K] E, Fintype (haveI := f.toRingHom.toAlgebra; AlgHom L F E) := ?_
  rw [Fintype.sum_equiv algHomEquivSigma (fun σ : F →ₐ[K] E => _) fun σ => σ.1 pb.gen, ←
    Finset.univ_sigma_univ, Finset.sum_sigma, ← Finset.sum_nsmul]
  refine' Finset.sum_congr rfl fun σ _ => _
  · letI : Algebra L E := σ.toRingHom.toAlgebra
-- Porting note: `Finset.card_univ` was inside `simp only`.
    

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
inst✝⁶ : Algebra K F
inst✝⁵ : IsScalarTower K L F
E : Type u_7
inst✝⁴ : Field E
inst✝³ : Algebra K E
inst✝² : IsAlgClosed E
inst✝¹ : FiniteDimensional K F
inst✝ : IsSeparable K F
pb : PowerBasis K L
this✝³ : FiniteDimensional L F
this✝² : IsSeparable L F
this✝¹ : Fintype (L →ₐ[K] E) := PowerBasis.AlgHom.fintype pb
this✝ : (f : L →ₐ[K] E) → Fintype (F →ₐ[L] E) := ?refine_1
σ : L →ₐ[K] E
x✝ : σ ∈ Finset.univ
this : Algebra L E := RingHom.toAlgebra ↑σ
⊢ ∑ s : F →ₐ[L] E, { fst := σ, snd := s }.fst pb.gen = finrank L F • σ pb.gen

Next tactic:
simp only [Finset.sum_const]
theorem sum_embeddings_eq_finrank_mul [FiniteDimensional K F] [IsSeparable K F]
    (pb : PowerBasis K L) :
    ∑ σ : F →ₐ[K] E, σ (algebraMap L F pb.gen) =
      finrank L F •
        (@Finset.univ _ (PowerBasis.AlgHom.fintype pb)).sum fun σ : L →ₐ[K] E => σ pb.gen := by
  haveI : FiniteDimensional L F := FiniteDimensional.right K L F
  haveI : IsSeparable L F := isSeparable_tower_top_of_isSeparable K L F
  letI : Fintype (L →ₐ[K] E) := PowerBasis.AlgHom.fintype pb
  letI : ∀ f : L →ₐ[K] E, Fintype (haveI := f.toRingHom.toAlgebra; AlgHom L F E) := ?_
  rw [Fintype.sum_equiv algHomEquivSigma (fun σ : F →ₐ[K] E => _) fun σ => σ.1 pb.gen, ←
    Finset.univ_sigma_univ, Finset.sum_sigma, ← Finset.sum_nsmul]
  refine' Finset.sum_congr rfl fun σ _ => _
  · letI : Algebra L E := σ.toRingHom.toAlgebra
-- Porting note: `Finset.card_univ` was inside `simp only`.
    simp only [Finset.sum_const]
    

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
inst✝⁶ : Algebra K F
inst✝⁵ : IsScalarTower K L F
E : Type u_7
inst✝⁴ : Field E
inst✝³ : Algebra K E
inst✝² : IsAlgClosed E
inst✝¹ : FiniteDimensional K F
inst✝ : IsSeparable K F
pb : PowerBasis K L
this✝³ : FiniteDimensional L F
this✝² : IsSeparable L F
this✝¹ : Fintype (L →ₐ[K] E) := PowerBasis.AlgHom.fintype pb
this✝ : (f : L →ₐ[K] E) → Fintype (F →ₐ[L] E) := ?refine_1
σ : L →ₐ[K] E
x✝ : σ ∈ Finset.univ
this : Algebra L E := RingHom.toAlgebra ↑σ
⊢ Finset.card Finset.univ • σ pb.gen = finrank L F • σ pb.gen

Next tactic:
congr
theorem sum_embeddings_eq_finrank_mul [FiniteDimensional K F] [IsSeparable K F]
    (pb : PowerBasis K L) :
    ∑ σ : F →ₐ[K] E, σ (algebraMap L F pb.gen) =
      finrank L F •
        (@Finset.univ _ (PowerBasis.AlgHom.fintype pb)).sum fun σ : L →ₐ[K] E => σ pb.gen := by
  haveI : FiniteDimensional L F := FiniteDimensional.right K L F
  haveI : IsSeparable L F := isSeparable_tower_top_of_isSeparable K L F
  letI : Fintype (L →ₐ[K] E) := PowerBasis.AlgHom.fintype pb
  letI : ∀ f : L →ₐ[K] E, Fintype (haveI := f.toRingHom.toAlgebra; AlgHom L F E) := ?_
  rw [Fintype.sum_equiv algHomEquivSigma (fun σ : F →ₐ[K] E => _) fun σ => σ.1 pb.gen, ←
    Finset.univ_sigma_univ, Finset.sum_sigma, ← Finset.sum_nsmul]
  refine' Finset.sum_congr rfl fun σ _ => _
  · letI : Algebra L E := σ.toRingHom.toAlgebra
-- Porting note: `Finset.card_univ` was inside `simp only`.
    simp only [Finset.sum_const]
    congr
    

Proof state:
case refine_2.e_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
inst✝¹ : FiniteDimensional K F
inst✝ : IsSeparable K F
pb : PowerBasis K L
this✝³ : FiniteDimensional L F
this✝² : IsSeparable L F
this✝¹ : Fintype (L →ₐ[K] E) := PowerBasis.AlgHom.fintype pb
this✝ : (f : L →ₐ[K] E) → Fintype (F →ₐ[L] E) := ?refine_1
σ : L →ₐ[K] E
x✝ : σ ∈ Finset.univ
this : Algebra L E := RingHom.toAlgebra ↑σ
⊢ Finset.card Finset.univ = finrank L F

Next tactic:
rw [← AlgHom.card L F E]
theorem sum_embeddings_eq_finrank_mul [FiniteDimensional K F] [IsSeparable K F]
    (pb : PowerBasis K L) :
    ∑ σ : F →ₐ[K] E, σ (algebraMap L F pb.gen) =
      finrank L F •
        (@Finset.univ _ (PowerBasis.AlgHom.fintype pb)).sum fun σ : L →ₐ[K] E => σ pb.gen := by
  haveI : FiniteDimensional L F := FiniteDimensional.right K L F
  haveI : IsSeparable L F := isSeparable_tower_top_of_isSeparable K L F
  letI : Fintype (L →ₐ[K] E) := PowerBasis.AlgHom.fintype pb
  letI : ∀ f : L →ₐ[K] E, Fintype (haveI := f.toRingHom.toAlgebra; AlgHom L F E) := ?_
  rw [Fintype.sum_equiv algHomEquivSigma (fun σ : F →ₐ[K] E => _) fun σ => σ.1 pb.gen, ←
    Finset.univ_sigma_univ, Finset.sum_sigma, ← Finset.sum_nsmul]
  refine' Finset.sum_congr rfl fun σ _ => _
  · letI : Algebra L E := σ.toRingHom.toAlgebra
-- Porting note: `Finset.card_univ` was inside `simp only`.
    simp only [Finset.sum_const]
    congr
    rw [← AlgHom.card L F E]
    

Proof state:
case refine_2.e_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
inst✝¹ : FiniteDimensional K F
inst✝ : IsSeparable K F
pb : PowerBasis K L
this✝³ : FiniteDimensional L F
this✝² : IsSeparable L F
this✝¹ : Fintype (L →ₐ[K] E) := PowerBasis.AlgHom.fintype pb
this✝ : (f : L →ₐ[K] E) → Fintype (F →ₐ[L] E) := ?refine_1
σ : L →ₐ[K] E
x✝ : σ ∈ Finset.univ
this : Algebra L E := RingHom.toAlgebra ↑σ
⊢ Finset.card Finset.univ = Fintype.card (F →ₐ[L] E)
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
inst✝⁶ : Algebra K F
inst✝⁵ : IsScalarTower K L F
E : Type u_7
inst✝⁴ : Field E
inst✝³ : Algebra K E
inst✝² : IsAlgClosed E
inst✝¹ : FiniteDimensional K F
inst✝ : IsSeparable K F
pb : PowerBasis K L
this✝¹ : FiniteDimensional L F
this✝ : IsSeparable L F
this : Fintype (L →ₐ[K] E) := PowerBasis.AlgHom.fintype pb
⊢ (f : L →ₐ[K] E) → Fintype (F →ₐ[L] E)

Next tactic:
exact Finset.card_univ (α := F →ₐ[L] E)
theorem sum_embeddings_eq_finrank_mul [FiniteDimensional K F] [IsSeparable K F]
    (pb : PowerBasis K L) :
    ∑ σ : F →ₐ[K] E, σ (algebraMap L F pb.gen) =
      finrank L F •
        (@Finset.univ _ (PowerBasis.AlgHom.fintype pb)).sum fun σ : L →ₐ[K] E => σ pb.gen := by
  haveI : FiniteDimensional L F := FiniteDimensional.right K L F
  haveI : IsSeparable L F := isSeparable_tower_top_of_isSeparable K L F
  letI : Fintype (L →ₐ[K] E) := PowerBasis.AlgHom.fintype pb
  letI : ∀ f : L →ₐ[K] E, Fintype (haveI := f.toRingHom.toAlgebra; AlgHom L F E) := ?_
  rw [Fintype.sum_equiv algHomEquivSigma (fun σ : F →ₐ[K] E => _) fun σ => σ.1 pb.gen, ←
    Finset.univ_sigma_univ, Finset.sum_sigma, ← Finset.sum_nsmul]
  refine' Finset.sum_congr rfl fun σ _ => _
  · letI : Algebra L E := σ.toRingHom.toAlgebra
-- Porting note: `Finset.card_univ` was inside `simp only`.
    simp only [Finset.sum_const]
    congr
    rw [← AlgHom.card L F E]
    exact Finset.card_univ (α := F →ₐ[L] E)
  · 

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
inst✝⁶ : Algebra K F
inst✝⁵ : IsScalarTower K L F
E : Type u_7
inst✝⁴ : Field E
inst✝³ : Algebra K E
inst✝² : IsAlgClosed E
inst✝¹ : FiniteDimensional K F
inst✝ : IsSeparable K F
pb : PowerBasis K L
this✝² : FiniteDimensional L F
this✝¹ : IsSeparable L F
this✝ : Fintype (L →ₐ[K] E) := PowerBasis.AlgHom.fintype pb
this : (f : L →ₐ[K] E) → Fintype (F →ₐ[L] E) := fun σ => minpoly.AlgHom.fintype L F E
⊢ ∀ (x : F →ₐ[K] E), x ((algebraMap L F) pb.gen) = (algHomEquivSigma x).fst pb.gen

Next tactic:
intro σ
theorem sum_embeddings_eq_finrank_mul [FiniteDimensional K F] [IsSeparable K F]
    (pb : PowerBasis K L) :
    ∑ σ : F →ₐ[K] E, σ (algebraMap L F pb.gen) =
      finrank L F •
        (@Finset.univ _ (PowerBasis.AlgHom.fintype pb)).sum fun σ : L →ₐ[K] E => σ pb.gen := by
  haveI : FiniteDimensional L F := FiniteDimensional.right K L F
  haveI : IsSeparable L F := isSeparable_tower_top_of_isSeparable K L F
  letI : Fintype (L →ₐ[K] E) := PowerBasis.AlgHom.fintype pb
  letI : ∀ f : L →ₐ[K] E, Fintype (haveI := f.toRingHom.toAlgebra; AlgHom L F E) := ?_
  rw [Fintype.sum_equiv algHomEquivSigma (fun σ : F →ₐ[K] E => _) fun σ => σ.1 pb.gen, ←
    Finset.univ_sigma_univ, Finset.sum_sigma, ← Finset.sum_nsmul]
  refine' Finset.sum_congr rfl fun σ _ => _
  · letI : Algebra L E := σ.toRingHom.toAlgebra
-- Porting note: `Finset.card_univ` was inside `simp only`.
    simp only [Finset.sum_const]
    congr
    rw [← AlgHom.card L F E]
    exact Finset.card_univ (α := F →ₐ[L] E)
  · intro σ
    

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
inst✝⁶ : Algebra K F
inst✝⁵ : IsScalarTower K L F
E : Type u_7
inst✝⁴ : Field E
inst✝³ : Algebra K E
inst✝² : IsAlgClosed E
inst✝¹ : FiniteDimensional K F
inst✝ : IsSeparable K F
pb : PowerBasis K L
this✝² : FiniteDimensional L F
this✝¹ : IsSeparable L F
this✝ : Fintype (L →ₐ[K] E) := PowerBasis.AlgHom.fintype pb
this : (f : L →ₐ[K] E) → Fintype (F →ₐ[L] E) := fun σ => minpoly.AlgHom.fintype L F E
σ : F →ₐ[K] E
⊢ σ ((algebraMap L F) pb.gen) = (algHomEquivSigma σ).fst pb.gen

Next tactic:
simp only [algHomEquivSigma, Equiv.coe_fn_mk, AlgHom.restrictDomain, AlgHom.comp_apply,
      IsScalarTower.coe_toAlgHom']
theorem trace_eq_sum_embeddings [FiniteDimensional K L] [IsSeparable K L] {x : L} :
    algebraMap K E (Algebra.trace K L x) = ∑ σ : L →ₐ[K] E, σ 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
inst✝¹ : FiniteDimensional K L
inst✝ : IsSeparable K L
x : L
⊢ (algebraMap K E) ((Algebra.trace K L) x) = ∑ σ : L →ₐ[K] E, σ x

Next tactic:
have hx := IsSeparable.isIntegral K x
theorem trace_eq_sum_embeddings [FiniteDimensional K L] [IsSeparable K L] {x : L} :
    algebraMap K E (Algebra.trace K L x) = ∑ σ : L →ₐ[K] E, σ x := by
  have hx := IsSeparable.isIntegral K x
  

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
inst✝¹ : FiniteDimensional K L
inst✝ : IsSeparable K L
x : L
hx : IsIntegral K x
⊢ (algebraMap K E) ((Algebra.trace K L) x) = ∑ σ : L →ₐ[K] E, σ x

Next tactic:
let pb := (adjoin.powerBasis hx)
theorem trace_eq_sum_embeddings [FiniteDimensional K L] [IsSeparable K L] {x : L} :
    algebraMap K E (Algebra.trace K L x) = ∑ σ : L →ₐ[K] E, σ x := by
  have hx := IsSeparable.isIntegral K x
  let pb := (adjoin.powerBasis hx)
  

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
inst✝¹ : FiniteDimensional K L
inst✝ : IsSeparable K L
x : L
hx : IsIntegral K x
pb : PowerBasis K ↥K⟮x⟯ := adjoin.powerBasis hx
⊢ (algebraMap K E) ((Algebra.trace K L) x) = ∑ σ : L →ₐ[K] E, σ x

Next tactic:
rw [trace_eq_trace_adjoin K x, Algebra.smul_def, RingHom.map_mul, ← adjoin.powerBasis_gen hx,
    trace_eq_sum_embeddings_gen E pb (IsAlgClosed.splits_codomain _)]
theorem trace_eq_sum_embeddings [FiniteDimensional K L] [IsSeparable K L] {x : L} :
    algebraMap K E (Algebra.trace K L x) = ∑ σ : L →ₐ[K] E, σ x := by
  have hx := IsSeparable.isIntegral K x
  let pb := (adjoin.powerBasis hx)
  rw [trace_eq_trace_adjoin K x, Algebra.smul_def, RingHom.map_mul, ← adjoin.powerBasis_gen hx,
    trace_eq_sum_embeddings_gen E pb (IsAlgClosed.splits_codomain _)]
-- Porting note: the following `convert` was `exact`, with `← algebra.smul_def, algebra_map_smul`
-- in the previous `rw`.
  · 

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
inst✝¹ : FiniteDimensional K L
inst✝ : IsSeparable K L
x : L
hx : IsIntegral K x
pb : PowerBasis K ↥K⟮x⟯ := adjoin.powerBasis hx
⊢ (algebraMap K E) ((algebraMap ℕ K) (finrank (↥K⟮x⟯) L)) * ∑ σ : ↥K⟮x⟯ →ₐ[K] E, σ pb.gen = ∑ σ : L →ₐ[K] E, σ x

Next tactic:
convert (sum_embeddings_eq_finrank_mul L E pb).symm
theorem trace_eq_sum_embeddings [FiniteDimensional K L] [IsSeparable K L] {x : L} :
    algebraMap K E (Algebra.trace K L x) = ∑ σ : L →ₐ[K] E, σ x := by
  have hx := IsSeparable.isIntegral K x
  let pb := (adjoin.powerBasis hx)
  rw [trace_eq_trace_adjoin K x, Algebra.smul_def, RingHom.map_mul, ← adjoin.powerBasis_gen hx,
    trace_eq_sum_embeddings_gen E pb (IsAlgClosed.splits_codomain _)]
-- Porting note: the following `convert` was `exact`, with `← algebra.smul_def, algebra_map_smul`
-- in the previous `rw`.
  · convert (sum_embeddings_eq_finrank_mul L E pb).symm
    

Proof state:
case h.e'_2.h.e
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
inst✝¹ : FiniteDimensional K L
inst✝ : IsSeparable K L
x : L
hx : IsIntegral K x
pb : PowerBasis K ↥K⟮x⟯ := adjoin.powerBasis hx
⊢ HMul.hMul ((algebraMap K E) ((algebraMap ℕ K) (finrank (↥K⟮x⟯) L))) = HSMul.hSMul (finrank (↥K⟮x⟯) L)

Next tactic:
ext
theorem trace_eq_sum_embeddings [FiniteDimensional K L] [IsSeparable K L] {x : L} :
    algebraMap K E (Algebra.trace K L x) = ∑ σ : L →ₐ[K] E, σ x := by
  have hx := IsSeparable.isIntegral K x
  let pb := (adjoin.powerBasis hx)
  rw [trace_eq_trace_adjoin K x, Algebra.smul_def, RingHom.map_mul, ← adjoin.powerBasis_gen hx,
    trace_eq_sum_embeddings_gen E pb (IsAlgClosed.splits_codomain _)]
-- Porting note: the following `convert` was `exact`, with `← algebra.smul_def, algebra_map_smul`
-- in the previous `rw`.
  · convert (sum_embeddings_eq_finrank_mul L E pb).symm
    ext
    

Proof state:
case h.e'_2.h.e.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
inst✝¹ : FiniteDimensional K L
inst✝ : IsSeparable K L
x : L
hx : IsIntegral K x
pb : PowerBasis K ↥K⟮x⟯ := adjoin.powerBasis hx
x✝ : E
⊢ (algebraMap K E) ((algebraMap ℕ K) (finrank (↥K⟮x⟯) L)) * x✝ = finrank (↥K⟮x⟯) L • x✝

Next tactic:
simp
theorem trace_eq_sum_embeddings [FiniteDimensional K L] [IsSeparable K L] {x : L} :
    algebraMap K E (Algebra.trace K L x) = ∑ σ : L →ₐ[K] E, σ x := by
  have hx := IsSeparable.isIntegral K x
  let pb := (adjoin.powerBasis hx)
  rw [trace_eq_trace_adjoin K x, Algebra.smul_def, RingHom.map_mul, ← adjoin.powerBasis_gen hx,
    trace_eq_sum_embeddings_gen E pb (IsAlgClosed.splits_codomain _)]
-- Porting note: the following `convert` was `exact`, with `← algebra.smul_def, algebra_map_smul`
-- in the previous `rw`.
  · convert (sum_embeddings_eq_finrank_mul L E pb).symm
    ext
    simp
  · 

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
inst✝¹ : FiniteDimensional K L
inst✝ : IsSeparable K L
x : L
hx : IsIntegral K x
pb : PowerBasis K ↥K⟮x⟯ := adjoin.powerBasis hx
⊢ Separable (minpoly K pb.gen)

Next tactic:
haveI := isSeparable_tower_bot_of_isSeparable K K⟮x⟯ L
theorem trace_eq_sum_embeddings [FiniteDimensional K L] [IsSeparable K L] {x : L} :
    algebraMap K E (Algebra.trace K L x) = ∑ σ : L →ₐ[K] E, σ x := by
  have hx := IsSeparable.isIntegral K x
  let pb := (adjoin.powerBasis hx)
  rw [trace_eq_trace_adjoin K x, Algebra.smul_def, RingHom.map_mul, ← adjoin.powerBasis_gen hx,
    trace_eq_sum_embeddings_gen E pb (IsAlgClosed.splits_codomain _)]
-- Porting note: the following `convert` was `exact`, with `← algebra.smul_def, algebra_map_smul`
-- in the previous `rw`.
  · convert (sum_embeddings_eq_finrank_mul L E pb).symm
    ext
    simp
  · haveI := isSeparable_tower_bot_of_isSeparable K K⟮x⟯ L
    

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
inst✝¹ : FiniteDimensional K L
inst✝ : IsSeparable K L
x : L
hx : IsIntegral K x
pb : PowerBasis K ↥K⟮x⟯ := adjoin.powerBasis hx
this : IsSeparable K ↥K⟮x⟯
⊢ Separable (minpoly K pb.gen)

Next tactic:
exact IsSeparable.separable K _