l3lab/ntp-mathlib huggingface dataset:
/-- Formula for the discriminant of a power basis using the norm of the field extension. -/
-- Porting note: `(minpoly K pb.gen).derivative` does not work anymore.
theorem discr_powerBasis_eq_norm [IsSeparable K L] :
    discr K pb.basis =
      (-1) ^ (n * (n - 1) / 2) *
      norm K (aeval pb.gen (derivative (R := K) (minpoly K pb.gen))) := by
  let E := AlgebraicClosure L
  letI := fun a b : E => Classical.propDecidable (Eq a b)
  have e : Fin pb.dim ≃ (L →ₐ[K] E) := by
    refine' equivOfCardEq _
    rw [Fintype.card_fin, AlgHom.card]
    exact (PowerBasis.finrank pb).symm
  have hnodup : ((minpoly K pb.gen).aroots E).Nodup :=
    nodup_roots (Separable.map (IsSeparable.separable K pb.gen))
  have hroots : ∀ σ : L →ₐ[K] E, σ pb.gen ∈ (minpoly K pb.gen).aroots E := by
    intro σ
    rw [mem_roots, IsRoot.def, eval_map, ← aeval_def, aeval_algHom_apply]
    repeat' simp [minpoly.ne_zero (IsSeparable.isIntegral K pb.gen)]
  apply (algebraMap K E).injective
  rw [RingHom.map_mul, RingHom.map_pow, RingHom.map_neg, RingHom.map_one,
    discr_powerBasis_eq_prod'' _ _ _ e]
  congr
  rw [norm_eq_prod_embeddings, prod_prod_Ioi_mul_eq_prod_prod_off_diag]
  conv_rhs =>
    congr
    

Proof state:
case s
A : Type u
B : Type v
C : Type z
ι : Type w
inst✝¹⁶ : DecidableEq ι
inst✝¹⁵ : CommRing A
inst✝¹⁴ : CommRing B
inst✝¹³ : Algebra A B
inst✝¹² : CommRing C
inst✝¹¹ : Algebra A C
ι' : Type u_1
inst✝¹⁰ : Fintype ι'
inst✝⁹ : Fintype ι
inst✝⁸ : DecidableEq ι'
K : Type u
L : Type v
E✝ : Type z
inst✝⁷ : Field K
inst✝⁶ : Field L
inst✝⁵ : Field E✝
inst✝⁴ : Algebra K L
inst✝³ : Algebra K E✝
inst✝² : Module.Finite K L
inst✝¹ : IsAlgClosed E✝
b : ι → L
pb : PowerBasis K L
inst✝ : IsSeparable K L
E : Type v := AlgebraicClosure L
this : (a b : E) → Decidable (a = b) := fun a b => Classical.propDecidable (a = b)
e : Fin pb.dim ≃ (L →ₐ[K] E)
hnodup : Multiset.Nodup (aroots (minpoly K pb.gen) E)
hroots : ∀ (σ : L →ₐ[K] E), σ pb.gen ∈ aroots (minpoly K pb.gen) E
| univ
case f
A : Type u
B : Type v
C : Type z
ι : Type w
inst✝¹⁶ : DecidableEq ι
inst✝¹⁵ : CommRing A
inst✝¹⁴ : CommRing B
inst✝¹³ : Algebra A B
inst✝¹² : CommRing C
inst✝¹¹ : Algebra A C
ι' : Type u_1
inst✝¹⁰ : Fintype ι'
inst✝⁹ : Fintype ι
inst✝⁸ : DecidableEq ι'
K : Type u
L : Type v
E✝ : Type z
inst✝⁷ : Field K
inst✝⁶ : Field L
inst✝⁵ : Field E✝
inst✝⁴ : Algebra K L
inst✝³ : Algebra K E✝
inst✝² : Module.Finite K L
inst✝¹ : IsAlgClosed E✝
b : ι → L
pb : PowerBasis K L
inst✝ : IsSeparable K L
E : Type v := AlgebraicClosure L
this : (a b : E) → Decidable (a = b) := fun a b => Classical.propDecidable (a = b)
e : Fin pb.dim ≃ (L →ₐ[K] E)
hnodup : Multiset.Nodup (aroots (minpoly K pb.gen) E)
hroots : ∀ (σ : L →ₐ[K] E), σ pb.gen ∈ aroots (minpoly K pb.gen) E
| fun σ => σ ((aeval pb.gen) (derivative (minpoly K pb.gen)))

Next tactic:
rfl
/-- Formula for the discriminant of a power basis using the norm of the field extension. -/
-- Porting note: `(minpoly K pb.gen).derivative` does not work anymore.
theorem discr_powerBasis_eq_norm [IsSeparable K L] :
    discr K pb.basis =
      (-1) ^ (n * (n - 1) / 2) *
      norm K (aeval pb.gen (derivative (R := K) (minpoly K pb.gen))) := by
  let E := AlgebraicClosure L
  letI := fun a b : E => Classical.propDecidable (Eq a b)
  have e : Fin pb.dim ≃ (L →ₐ[K] E) := by
    refine' equivOfCardEq _
    rw [Fintype.card_fin, AlgHom.card]
    exact (PowerBasis.finrank pb).symm
  have hnodup : ((minpoly K pb.gen).aroots E).Nodup :=
    nodup_roots (Separable.map (IsSeparable.separable K pb.gen))
  have hroots : ∀ σ : L →ₐ[K] E, σ pb.gen ∈ (minpoly K pb.gen).aroots E := by
    intro σ
    rw [mem_roots, IsRoot.def, eval_map, ← aeval_def, aeval_algHom_apply]
    repeat' simp [minpoly.ne_zero (IsSeparable.isIntegral K pb.gen)]
  apply (algebraMap K E).injective
  rw [RingHom.map_mul, RingHom.map_pow, RingHom.map_neg, RingHom.map_one,
    discr_powerBasis_eq_prod'' _ _ _ e]
  congr
  rw [norm_eq_prod_embeddings, prod_prod_Ioi_mul_eq_prod_prod_off_diag]
  conv_rhs =>
    congr
    rfl
    

Proof state:
case f
A : Type u
B : Type v
C : Type z
ι : Type w
inst✝¹⁶ : DecidableEq ι
inst✝¹⁵ : CommRing A
inst✝¹⁴ : CommRing B
inst✝¹³ : Algebra A B
inst✝¹² : CommRing C
inst✝¹¹ : Algebra A C
ι' : Type u_1
inst✝¹⁰ : Fintype ι'
inst✝⁹ : Fintype ι
inst✝⁸ : DecidableEq ι'
K : Type u
L : Type v
E✝ : Type z
inst✝⁷ : Field K
inst✝⁶ : Field L
inst✝⁵ : Field E✝
inst✝⁴ : Algebra K L
inst✝³ : Algebra K E✝
inst✝² : Module.Finite K L
inst✝¹ : IsAlgClosed E✝
b : ι → L
pb : PowerBasis K L
inst✝ : IsSeparable K L
E : Type v := AlgebraicClosure L
this : (a b : E) → Decidable (a = b) := fun a b => Classical.propDecidable (a = b)
e : Fin pb.dim ≃ (L →ₐ[K] E)
hnodup : Multiset.Nodup (aroots (minpoly K pb.gen) E)
hroots : ∀ (σ : L →ₐ[K] E), σ pb.gen ∈ aroots (minpoly K pb.gen) E
| fun σ => σ ((aeval pb.gen) (derivative (minpoly K pb.gen)))

Next tactic:
ext σ
/-- Formula for the discriminant of a power basis using the norm of the field extension. -/
-- Porting note: `(minpoly K pb.gen).derivative` does not work anymore.
theorem discr_powerBasis_eq_norm [IsSeparable K L] :
    discr K pb.basis =
      (-1) ^ (n * (n - 1) / 2) *
      norm K (aeval pb.gen (derivative (R := K) (minpoly K pb.gen))) := by
  let E := AlgebraicClosure L
  letI := fun a b : E => Classical.propDecidable (Eq a b)
  have e : Fin pb.dim ≃ (L →ₐ[K] E) := by
    refine' equivOfCardEq _
    rw [Fintype.card_fin, AlgHom.card]
    exact (PowerBasis.finrank pb).symm
  have hnodup : ((minpoly K pb.gen).aroots E).Nodup :=
    nodup_roots (Separable.map (IsSeparable.separable K pb.gen))
  have hroots : ∀ σ : L →ₐ[K] E, σ pb.gen ∈ (minpoly K pb.gen).aroots E := by
    intro σ
    rw [mem_roots, IsRoot.def, eval_map, ← aeval_def, aeval_algHom_apply]
    repeat' simp [minpoly.ne_zero (IsSeparable.isIntegral K pb.gen)]
  apply (algebraMap K E).injective
  rw [RingHom.map_mul, RingHom.map_pow, RingHom.map_neg, RingHom.map_one,
    discr_powerBasis_eq_prod'' _ _ _ e]
  congr
  rw [norm_eq_prod_embeddings, prod_prod_Ioi_mul_eq_prod_prod_off_diag]
  conv_rhs =>
    congr
    rfl
    ext σ
    

Proof state:
case f.h
A : Type u
B : Type v
C : Type z
ι : Type w
inst✝¹⁶ : DecidableEq ι
inst✝¹⁵ : CommRing A
inst✝¹⁴ : CommRing B
inst✝¹³ : Algebra A B
inst✝¹² : CommRing C
inst✝¹¹ : Algebra A C
ι' : Type u_1
inst✝¹⁰ : Fintype ι'
inst✝⁹ : Fintype ι
inst✝⁸ : DecidableEq ι'
K : Type u
L : Type v
E✝ : Type z
inst✝⁷ : Field K
inst✝⁶ : Field L
inst✝⁵ : Field E✝
inst✝⁴ : Algebra K L
inst✝³ : Algebra K E✝
inst✝² : Module.Finite K L
inst✝¹ : IsAlgClosed E✝
b : ι → L
pb : PowerBasis K L
inst✝ : IsSeparable K L
E : Type v := AlgebraicClosure L
this : (a b : E) → Decidable (a = b) := fun a b => Classical.propDecidable (a = b)
e : Fin pb.dim ≃ (L →ₐ[K] E)
hnodup : Multiset.Nodup (aroots (minpoly K pb.gen) E)
hroots : ∀ (σ : L →ₐ[K] E), σ pb.gen ∈ aroots (minpoly K pb.gen) E
σ : L →ₐ[K] E
| σ ((aeval pb.gen) (derivative (minpoly K pb.gen)))

Next tactic:
rw [← aeval_algHom_apply,
      aeval_root_derivative_of_splits (minpoly.monic (IsSeparable.isIntegral K pb.gen))
        (IsAlgClosed.splits_codomain _) (hroots σ),
      ← Finset.prod_mk _ (hnodup.erase _)]
/-- Formula for the discriminant of a power basis using the norm of the field extension. -/
-- Porting note: `(minpoly K pb.gen).derivative` does not work anymore.
theorem discr_powerBasis_eq_norm [IsSeparable K L] :
    discr K pb.basis =
      (-1) ^ (n * (n - 1) / 2) *
      norm K (aeval pb.gen (derivative (R := K) (minpoly K pb.gen))) := by
  let E := AlgebraicClosure L
  letI := fun a b : E => Classical.propDecidable (Eq a b)
  have e : Fin pb.dim ≃ (L →ₐ[K] E) := by
    refine' equivOfCardEq _
    rw [Fintype.card_fin, AlgHom.card]
    exact (PowerBasis.finrank pb).symm
  have hnodup : ((minpoly K pb.gen).aroots E).Nodup :=
    nodup_roots (Separable.map (IsSeparable.separable K pb.gen))
  have hroots : ∀ σ : L →ₐ[K] E, σ pb.gen ∈ (minpoly K pb.gen).aroots E := by
    intro σ
    rw [mem_roots, IsRoot.def, eval_map, ← aeval_def, aeval_algHom_apply]
    repeat' simp [minpoly.ne_zero (IsSeparable.isIntegral K pb.gen)]
  apply (algebraMap K E).injective
  rw [RingHom.map_mul, RingHom.map_pow, RingHom.map_neg, RingHom.map_one,
    discr_powerBasis_eq_prod'' _ _ _ e]
  congr
  rw [norm_eq_prod_embeddings, prod_prod_Ioi_mul_eq_prod_prod_off_diag]
  conv_rhs =>
    congr
    rfl
    ext σ
    rw [← aeval_algHom_apply,
      aeval_root_derivative_of_splits (minpoly.monic (IsSeparable.isIntegral K pb.gen))
        (IsAlgClosed.splits_codomain _) (hroots σ),
      ← Finset.prod_mk _ (hnodup.erase _)]
  

Proof state:
case a.e_a
A : Type u
B : Type v
C : Type z
ι : Type w
inst✝¹⁶ : DecidableEq ι
inst✝¹⁵ : CommRing A
inst✝¹⁴ : CommRing B
inst✝¹³ : Algebra A B
inst✝¹² : CommRing C
inst✝¹¹ : Algebra A C
ι' : Type u_1
inst✝¹⁰ : Fintype ι'
inst✝⁹ : Fintype ι
inst✝⁸ : DecidableEq ι'
K : Type u
L : Type v
E✝ : Type z
inst✝⁷ : Field K
inst✝⁶ : Field L
inst✝⁵ : Field E✝
inst✝⁴ : Algebra K L
inst✝³ : Algebra K E✝
inst✝² : Module.Finite K L
inst✝¹ : IsAlgClosed E✝
b : ι → L
pb : PowerBasis K L
inst✝ : IsSeparable K L
E : Type v := AlgebraicClosure L
this : (a b : E) → Decidable (a = b) := fun a b => Classical.propDecidable (a = b)
e : Fin pb.dim ≃ (L →ₐ[K] E)
hnodup : Multiset.Nodup (aroots (minpoly K pb.gen) E)
hroots : ∀ (σ : L →ₐ[K] E), σ pb.gen ∈ aroots (minpoly K pb.gen) E
⊢ ∏ i : Fin pb.dim, ∏ j in {i}ᶜ, ((e j) pb.gen - (e i) pb.gen) =
    ∏ σ : L →ₐ[K] E,
      ∏ a in
        { val := Multiset.erase (aroots (minpoly K pb.gen) E) (σ pb.gen),
          nodup := (_ : Multiset.Nodup (Multiset.erase (aroots (minpoly K pb.gen) E) (σ pb.gen))) },
        (σ pb.gen - a)

Next tactic:
rw [prod_sigma', prod_sigma']
/-- Formula for the discriminant of a power basis using the norm of the field extension. -/
-- Porting note: `(minpoly K pb.gen).derivative` does not work anymore.
theorem discr_powerBasis_eq_norm [IsSeparable K L] :
    discr K pb.basis =
      (-1) ^ (n * (n - 1) / 2) *
      norm K (aeval pb.gen (derivative (R := K) (minpoly K pb.gen))) := by
  let E := AlgebraicClosure L
  letI := fun a b : E => Classical.propDecidable (Eq a b)
  have e : Fin pb.dim ≃ (L →ₐ[K] E) := by
    refine' equivOfCardEq _
    rw [Fintype.card_fin, AlgHom.card]
    exact (PowerBasis.finrank pb).symm
  have hnodup : ((minpoly K pb.gen).aroots E).Nodup :=
    nodup_roots (Separable.map (IsSeparable.separable K pb.gen))
  have hroots : ∀ σ : L →ₐ[K] E, σ pb.gen ∈ (minpoly K pb.gen).aroots E := by
    intro σ
    rw [mem_roots, IsRoot.def, eval_map, ← aeval_def, aeval_algHom_apply]
    repeat' simp [minpoly.ne_zero (IsSeparable.isIntegral K pb.gen)]
  apply (algebraMap K E).injective
  rw [RingHom.map_mul, RingHom.map_pow, RingHom.map_neg, RingHom.map_one,
    discr_powerBasis_eq_prod'' _ _ _ e]
  congr
  rw [norm_eq_prod_embeddings, prod_prod_Ioi_mul_eq_prod_prod_off_diag]
  conv_rhs =>
    congr
    rfl
    ext σ
    rw [← aeval_algHom_apply,
      aeval_root_derivative_of_splits (minpoly.monic (IsSeparable.isIntegral K pb.gen))
        (IsAlgClosed.splits_codomain _) (hroots σ),
      ← Finset.prod_mk _ (hnodup.erase _)]
  rw [prod_sigma', prod_sigma']
  

Proof state:
case a.e_a
A : Type u
B : Type v
C : Type z
ι : Type w
inst✝¹⁶ : DecidableEq ι
inst✝¹⁵ : CommRing A
inst✝¹⁴ : CommRing B
inst✝¹³ : Algebra A B
inst✝¹² : CommRing C
inst✝¹¹ : Algebra A C
ι' : Type u_1
inst✝¹⁰ : Fintype ι'
inst✝⁹ : Fintype ι
inst✝⁸ : DecidableEq ι'
K : Type u
L : Type v
E✝ : Type z
inst✝⁷ : Field K
inst✝⁶ : Field L
inst✝⁵ : Field E✝
inst✝⁴ : Algebra K L
inst✝³ : Algebra K E✝
inst✝² : Module.Finite K L
inst✝¹ : IsAlgClosed E✝
b : ι → L
pb : PowerBasis K L
inst✝ : IsSeparable K L
E : Type v := AlgebraicClosure L
this : (a b : E) → Decidable (a = b) := fun a b => Classical.propDecidable (a = b)
e : Fin pb.dim ≃ (L →ₐ[K] E)
hnodup : Multiset.Nodup (aroots (minpoly K pb.gen) E)
hroots : ∀ (σ : L →ₐ[K] E), σ pb.gen ∈ aroots (minpoly K pb.gen) E
⊢ ∏ x in Finset.sigma univ fun i => {i}ᶜ, ((e x.snd) pb.gen - (e x.fst) pb.gen) =
    ∏ x in
      Finset.sigma univ fun σ =>
        { val := Multiset.erase (aroots (minpoly K pb.gen) E) (σ pb.gen),
          nodup := (_ : Multiset.Nodup (Multiset.erase (aroots (minpoly K pb.gen) E) (σ pb.gen))) },
      (x.fst pb.gen - x.snd)

Next tactic:
refine'
    prod_bij (fun i _ => ⟨e i.2, e i.1 pb.gen⟩) (fun i hi => _) (fun i _ => by simp)
      (fun i j hi hj hij => _) fun σ hσ => _
/-- Formula for the discriminant of a power basis using the norm of the field extension. -/
-- Porting note: `(minpoly K pb.gen).derivative` does not work anymore.
theorem discr_powerBasis_eq_norm [IsSeparable K L] :
    discr K pb.basis =
      (-1) ^ (n * (n - 1) / 2) *
      norm K (aeval pb.gen (derivative (R := K) (minpoly K pb.gen))) := by
  let E := AlgebraicClosure L
  letI := fun a b : E => Classical.propDecidable (Eq a b)
  have e : Fin pb.dim ≃ (L →ₐ[K] E) := by
    refine' equivOfCardEq _
    rw [Fintype.card_fin, AlgHom.card]
    exact (PowerBasis.finrank pb).symm
  have hnodup : ((minpoly K pb.gen).aroots E).Nodup :=
    nodup_roots (Separable.map (IsSeparable.separable K pb.gen))
  have hroots : ∀ σ : L →ₐ[K] E, σ pb.gen ∈ (minpoly K pb.gen).aroots E := by
    intro σ
    rw [mem_roots, IsRoot.def, eval_map, ← aeval_def, aeval_algHom_apply]
    repeat' simp [minpoly.ne_zero (IsSeparable.isIntegral K pb.gen)]
  apply (algebraMap K E).injective
  rw [RingHom.map_mul, RingHom.map_pow, RingHom.map_neg, RingHom.map_one,
    discr_powerBasis_eq_prod'' _ _ _ e]
  congr
  rw [norm_eq_prod_embeddings, prod_prod_Ioi_mul_eq_prod_prod_off_diag]
  conv_rhs =>
    congr
    rfl
    ext σ
    rw [← aeval_algHom_apply,
      aeval_root_derivative_of_splits (minpoly.monic (IsSeparable.isIntegral K pb.gen))
        (IsAlgClosed.splits_codomain _) (hroots σ),
      ← Finset.prod_mk _ (hnodup.erase _)]
  rw [prod_sigma', prod_sigma']
  refine'
    prod_bij (fun i _ => ⟨e i.2, e i.1 pb.gen⟩) (fun i hi => _) (fun i _ => by 

Proof state:
A : Type u
B : Type v
C : Type z
ι : Type w
inst✝¹⁶ : DecidableEq ι
inst✝¹⁵ : CommRing A
inst✝¹⁴ : CommRing B
inst✝¹³ : Algebra A B
inst✝¹² : CommRing C
inst✝¹¹ : Algebra A C
ι' : Type u_1
inst✝¹⁰ : Fintype ι'
inst✝⁹ : Fintype ι
inst✝⁸ : DecidableEq ι'
K : Type u
L : Type v
E✝ : Type z
inst✝⁷ : Field K
inst✝⁶ : Field L
inst✝⁵ : Field E✝
inst✝⁴ : Algebra K L
inst✝³ : Algebra K E✝
inst✝² : Module.Finite K L
inst✝¹ : IsAlgClosed E✝
b : ι → L
pb : PowerBasis K L
inst✝ : IsSeparable K L
E : Type v := AlgebraicClosure L
this : (a b : E) → Decidable (a = b) := fun a b => Classical.propDecidable (a = b)
e : Fin pb.dim ≃ (L →ₐ[K] E)
hnodup : Multiset.Nodup (aroots (minpoly K pb.gen) E)
hroots : ∀ (σ : L →ₐ[K] E), σ pb.gen ∈ aroots (minpoly K pb.gen) E
i : (_ : Fin pb.dim) × Fin pb.dim
x✝ : i ∈ Finset.sigma univ fun i => {i}ᶜ
⊢ (e i.snd) pb.gen - (e i.fst) pb.gen =
    ((fun i x => { fst := e i.snd, snd := (e i.fst) pb.gen }) i x✝).fst pb.gen -
      ((fun i x => { fst := e i.snd, snd := (e i.fst) pb.gen }) i x✝).snd

Next tactic:
simp
/-- Formula for the discriminant of a power basis using the norm of the field extension. -/
-- Porting note: `(minpoly K pb.gen).derivative` does not work anymore.
theorem discr_powerBasis_eq_norm [IsSeparable K L] :
    discr K pb.basis =
      (-1) ^ (n * (n - 1) / 2) *
      norm K (aeval pb.gen (derivative (R := K) (minpoly K pb.gen))) := by
  let E := AlgebraicClosure L
  letI := fun a b : E => Classical.propDecidable (Eq a b)
  have e : Fin pb.dim ≃ (L →ₐ[K] E) := by
    refine' equivOfCardEq _
    rw [Fintype.card_fin, AlgHom.card]
    exact (PowerBasis.finrank pb).symm
  have hnodup : ((minpoly K pb.gen).aroots E).Nodup :=
    nodup_roots (Separable.map (IsSeparable.separable K pb.gen))
  have hroots : ∀ σ : L →ₐ[K] E, σ pb.gen ∈ (minpoly K pb.gen).aroots E := by
    intro σ
    rw [mem_roots, IsRoot.def, eval_map, ← aeval_def, aeval_algHom_apply]
    repeat' simp [minpoly.ne_zero (IsSeparable.isIntegral K pb.gen)]
  apply (algebraMap K E).injective
  rw [RingHom.map_mul, RingHom.map_pow, RingHom.map_neg, RingHom.map_one,
    discr_powerBasis_eq_prod'' _ _ _ e]
  congr
  rw [norm_eq_prod_embeddings, prod_prod_Ioi_mul_eq_prod_prod_off_diag]
  conv_rhs =>
    congr
    rfl
    ext σ
    rw [← aeval_algHom_apply,
      aeval_root_derivative_of_splits (minpoly.monic (IsSeparable.isIntegral K pb.gen))
        (IsAlgClosed.splits_codomain _) (hroots σ),
      ← Finset.prod_mk _ (hnodup.erase _)]
  rw [prod_sigma', prod_sigma']
  refine'
    prod_bij (fun i _ => ⟨e i.2, e i.1 pb.gen⟩) (fun i hi => _) (fun i _ => by simp)
      (fun i j hi hj hij => _) fun σ hσ => _
  · 

Proof state:
case a.e_a.refine'_1
A : Type u
B : Type v
C : Type z
ι : Type w
inst✝¹⁶ : DecidableEq ι
inst✝¹⁵ : CommRing A
inst✝¹⁴ : CommRing B
inst✝¹³ : Algebra A B
inst✝¹² : CommRing C
inst✝¹¹ : Algebra A C
ι' : Type u_1
inst✝¹⁰ : Fintype ι'
inst✝⁹ : Fintype ι
inst✝⁸ : DecidableEq ι'
K : Type u
L : Type v
E✝ : Type z
inst✝⁷ : Field K
inst✝⁶ : Field L
inst✝⁵ : Field E✝
inst✝⁴ : Algebra K L
inst✝³ : Algebra K E✝
inst✝² : Module.Finite K L
inst✝¹ : IsAlgClosed E✝
b : ι → L
pb : PowerBasis K L
inst✝ : IsSeparable K L
E : Type v := AlgebraicClosure L
this : (a b : E) → Decidable (a = b) := fun a b => Classical.propDecidable (a = b)
e : Fin pb.dim ≃ (L →ₐ[K] E)
hnodup : Multiset.Nodup (aroots (minpoly K pb.gen) E)
hroots : ∀ (σ : L →ₐ[K] E), σ pb.gen ∈ aroots (minpoly K pb.gen) E
i : (_ : Fin pb.dim) × Fin pb.dim
hi : i ∈ Finset.sigma univ fun i => {i}ᶜ
⊢ (fun i x => { fst := e i.snd, snd := (e i.fst) pb.gen }) i hi ∈
    Finset.sigma univ fun σ =>
      { val := Multiset.erase (aroots (minpoly K pb.gen) E) (σ pb.gen),
        nodup := (_ : Multiset.Nodup (Multiset.erase (aroots (minpoly K pb.gen) E) (σ pb.gen))) }

Next tactic:
simp only [true_and_iff, Finset.mem_mk, mem_univ, mem_sigma]
/-- Formula for the discriminant of a power basis using the norm of the field extension. -/
-- Porting note: `(minpoly K pb.gen).derivative` does not work anymore.
theorem discr_powerBasis_eq_norm [IsSeparable K L] :
    discr K pb.basis =
      (-1) ^ (n * (n - 1) / 2) *
      norm K (aeval pb.gen (derivative (R := K) (minpoly K pb.gen))) := by
  let E := AlgebraicClosure L
  letI := fun a b : E => Classical.propDecidable (Eq a b)
  have e : Fin pb.dim ≃ (L →ₐ[K] E) := by
    refine' equivOfCardEq _
    rw [Fintype.card_fin, AlgHom.card]
    exact (PowerBasis.finrank pb).symm
  have hnodup : ((minpoly K pb.gen).aroots E).Nodup :=
    nodup_roots (Separable.map (IsSeparable.separable K pb.gen))
  have hroots : ∀ σ : L →ₐ[K] E, σ pb.gen ∈ (minpoly K pb.gen).aroots E := by
    intro σ
    rw [mem_roots, IsRoot.def, eval_map, ← aeval_def, aeval_algHom_apply]
    repeat' simp [minpoly.ne_zero (IsSeparable.isIntegral K pb.gen)]
  apply (algebraMap K E).injective
  rw [RingHom.map_mul, RingHom.map_pow, RingHom.map_neg, RingHom.map_one,
    discr_powerBasis_eq_prod'' _ _ _ e]
  congr
  rw [norm_eq_prod_embeddings, prod_prod_Ioi_mul_eq_prod_prod_off_diag]
  conv_rhs =>
    congr
    rfl
    ext σ
    rw [← aeval_algHom_apply,
      aeval_root_derivative_of_splits (minpoly.monic (IsSeparable.isIntegral K pb.gen))
        (IsAlgClosed.splits_codomain _) (hroots σ),
      ← Finset.prod_mk _ (hnodup.erase _)]
  rw [prod_sigma', prod_sigma']
  refine'
    prod_bij (fun i _ => ⟨e i.2, e i.1 pb.gen⟩) (fun i hi => _) (fun i _ => by simp)
      (fun i j hi hj hij => _) fun σ hσ => _
  · simp only [true_and_iff, Finset.mem_mk, mem_univ, mem_sigma]
    

Proof state:
case a.e_a.refine'_1
A : Type u
B : Type v
C : Type z
ι : Type w
inst✝¹⁶ : DecidableEq ι
inst✝¹⁵ : CommRing A
inst✝¹⁴ : CommRing B
inst✝¹³ : Algebra A B
inst✝¹² : CommRing C
inst✝¹¹ : Algebra A C
ι' : Type u_1
inst✝¹⁰ : Fintype ι'
inst✝⁹ : Fintype ι
inst✝⁸ : DecidableEq ι'
K : Type u
L : Type v
E✝ : Type z
inst✝⁷ : Field K
inst✝⁶ : Field L
inst✝⁵ : Field E✝
inst✝⁴ : Algebra K L
inst✝³ : Algebra K E✝
inst✝² : Module.Finite K L
inst✝¹ : IsAlgClosed E✝
b : ι → L
pb : PowerBasis K L
inst✝ : IsSeparable K L
E : Type v := AlgebraicClosure L
this : (a b : E) → Decidable (a = b) := fun a b => Classical.propDecidable (a = b)
e : Fin pb.dim ≃ (L →ₐ[K] E)
hnodup : Multiset.Nodup (aroots (minpoly K pb.gen) E)
hroots : ∀ (σ : L →ₐ[K] E), σ pb.gen ∈ aroots (minpoly K pb.gen) E
i : (_ : Fin pb.dim) × Fin pb.dim
hi : i ∈ Finset.sigma univ fun i => {i}ᶜ
⊢ (e i.fst) pb.gen ∈ Multiset.erase (aroots (minpoly K pb.gen) E) ((e i.snd) pb.gen)

Next tactic:
rw [Multiset.mem_erase_of_ne fun h => ?_]
/-- Formula for the discriminant of a power basis using the norm of the field extension. -/
-- Porting note: `(minpoly K pb.gen).derivative` does not work anymore.
theorem discr_powerBasis_eq_norm [IsSeparable K L] :
    discr K pb.basis =
      (-1) ^ (n * (n - 1) / 2) *
      norm K (aeval pb.gen (derivative (R := K) (minpoly K pb.gen))) := by
  let E := AlgebraicClosure L
  letI := fun a b : E => Classical.propDecidable (Eq a b)
  have e : Fin pb.dim ≃ (L →ₐ[K] E) := by
    refine' equivOfCardEq _
    rw [Fintype.card_fin, AlgHom.card]
    exact (PowerBasis.finrank pb).symm
  have hnodup : ((minpoly K pb.gen).aroots E).Nodup :=
    nodup_roots (Separable.map (IsSeparable.separable K pb.gen))
  have hroots : ∀ σ : L →ₐ[K] E, σ pb.gen ∈ (minpoly K pb.gen).aroots E := by
    intro σ
    rw [mem_roots, IsRoot.def, eval_map, ← aeval_def, aeval_algHom_apply]
    repeat' simp [minpoly.ne_zero (IsSeparable.isIntegral K pb.gen)]
  apply (algebraMap K E).injective
  rw [RingHom.map_mul, RingHom.map_pow, RingHom.map_neg, RingHom.map_one,
    discr_powerBasis_eq_prod'' _ _ _ e]
  congr
  rw [norm_eq_prod_embeddings, prod_prod_Ioi_mul_eq_prod_prod_off_diag]
  conv_rhs =>
    congr
    rfl
    ext σ
    rw [← aeval_algHom_apply,
      aeval_root_derivative_of_splits (minpoly.monic (IsSeparable.isIntegral K pb.gen))
        (IsAlgClosed.splits_codomain _) (hroots σ),
      ← Finset.prod_mk _ (hnodup.erase _)]
  rw [prod_sigma', prod_sigma']
  refine'
    prod_bij (fun i _ => ⟨e i.2, e i.1 pb.gen⟩) (fun i hi => _) (fun i _ => by simp)
      (fun i j hi hj hij => _) fun σ hσ => _
  · simp only [true_and_iff, Finset.mem_mk, mem_univ, mem_sigma]
    rw [Multiset.mem_erase_of_ne fun h => ?_]
    · 

Proof state:
case a.e_a.refine'_1
A : Type u
B : Type v
C : Type z
ι : Type w
inst✝¹⁶ : DecidableEq ι
inst✝¹⁵ : CommRing A
inst✝¹⁴ : CommRing B
inst✝¹³ : Algebra A B
inst✝¹² : CommRing C
inst✝¹¹ : Algebra A C
ι' : Type u_1
inst✝¹⁰ : Fintype ι'
inst✝⁹ : Fintype ι
inst✝⁸ : DecidableEq ι'
K : Type u
L : Type v
E✝ : Type z
inst✝⁷ : Field K
inst✝⁶ : Field L
inst✝⁵ : Field E✝
inst✝⁴ : Algebra K L
inst✝³ : Algebra K E✝
inst✝² : Module.Finite K L
inst✝¹ : IsAlgClosed E✝
b : ι → L
pb : PowerBasis K L
inst✝ : IsSeparable K L
E : Type v := AlgebraicClosure L
this : (a b : E) → Decidable (a = b) := fun a b => Classical.propDecidable (a = b)
e : Fin pb.dim ≃ (L →ₐ[K] E)
hnodup : Multiset.Nodup (aroots (minpoly K pb.gen) E)
hroots : ∀ (σ : L →ₐ[K] E), σ pb.gen ∈ aroots (minpoly K pb.gen) E
i : (_ : Fin pb.dim) × Fin pb.dim
hi : i ∈ Finset.sigma univ fun i => {i}ᶜ
⊢ (e i.fst) pb.gen ∈ aroots (minpoly K pb.gen) E

Next tactic:
exact hroots _