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
    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 => ?_]
    · exact hroots _
-- Porting note: `@mem_compl` was not necessary.
    · 

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
hi : i ∈ Finset.sigma univ fun i => {i}ᶜ
h : (e i.fst) pb.gen = (e i.snd) pb.gen
⊢ False

Next tactic:
simp only [true_and_iff, mem_univ, Ne.def, mem_sigma, @mem_compl _ _ _ (_),
        mem_singleton] at hi
/-- 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 => ?_]
    · exact hroots _
-- Porting note: `@mem_compl` was not necessary.
    · simp only [true_and_iff, mem_univ, Ne.def, mem_sigma, @mem_compl _ _ _ (_),
        mem_singleton] at hi
      

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
h : (e i.fst) pb.gen = (e i.snd) pb.gen
hi : ¬i.snd = i.fst
⊢ False

Next tactic:
rw [← PowerBasis.liftEquiv_apply_coe, ← PowerBasis.liftEquiv_apply_coe] at 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 => ?_]
    · exact hroots _
-- Porting note: `@mem_compl` was not necessary.
    · simp only [true_and_iff, mem_univ, Ne.def, mem_sigma, @mem_compl _ _ _ (_),
        mem_singleton] at hi
      rw [← PowerBasis.liftEquiv_apply_coe, ← PowerBasis.liftEquiv_apply_coe] at h
      

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
h : ↑((PowerBasis.liftEquiv pb) (e i.fst)) = ↑((PowerBasis.liftEquiv pb) (e i.snd))
hi : ¬i.snd = i.fst
⊢ False

Next tactic:
exact hi (e.injective <| pb.liftEquiv.injective <| Subtype.eq h.symm)
/-- 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 => ?_]
    · exact hroots _
-- Porting note: `@mem_compl` was not necessary.
    · simp only [true_and_iff, mem_univ, Ne.def, mem_sigma, @mem_compl _ _ _ (_),
        mem_singleton] at hi
      rw [← PowerBasis.liftEquiv_apply_coe, ← PowerBasis.liftEquiv_apply_coe] at h
      exact hi (e.injective <| pb.liftEquiv.injective <| Subtype.eq h.symm)
  · 

Proof state:
case a.e_a.refine'_2
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 j : (_ : Fin pb.dim) × Fin pb.dim
hi : i ∈ Finset.sigma univ fun i => {i}ᶜ
hj : j ∈ Finset.sigma univ fun i => {i}ᶜ
hij :
  (fun i x => { fst := e i.snd, snd := (e i.fst) pb.gen }) i hi =
    (fun i x => { fst := e i.snd, snd := (e i.fst) pb.gen }) j hj
⊢ i = j

Next tactic:
simp only [Sigma.mk.inj_iff, EmbeddingLike.apply_eq_iff_eq, heq_eq_eq] at hij
/-- 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 => ?_]
    · exact hroots _
-- Porting note: `@mem_compl` was not necessary.
    · simp only [true_and_iff, mem_univ, Ne.def, mem_sigma, @mem_compl _ _ _ (_),
        mem_singleton] at hi
      rw [← PowerBasis.liftEquiv_apply_coe, ← PowerBasis.liftEquiv_apply_coe] at h
      exact hi (e.injective <| pb.liftEquiv.injective <| Subtype.eq h.symm)
  · simp only [Sigma.mk.inj_iff, EmbeddingLike.apply_eq_iff_eq, heq_eq_eq] at hij
    

Proof state:
case a.e_a.refine'_2
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 j : (_ : Fin pb.dim) × Fin pb.dim
hi : i ∈ Finset.sigma univ fun i => {i}ᶜ
hj : j ∈ Finset.sigma univ fun i => {i}ᶜ
hij : i.snd = j.snd ∧ (e i.fst) pb.gen = (e j.fst) pb.gen
⊢ i = j

Next tactic:
have h := hij.2
/-- If `K` and `L` are fields and `IsScalarTower R K L`, and `b : ι → L` satisfies
` ∀ i, IsIntegral R (b i)`, then `IsIntegral R (discr K b)`. -/
theorem discr_isIntegral {b : ι → L} (h : ∀ i, IsIntegral R (b i)) : IsIntegral R (discr K b) := 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
R : Type z
inst✝³ : CommRing R
inst✝² : Algebra R K
inst✝¹ : Algebra R L
inst✝ : IsScalarTower R K L
b : ι → L
h : ∀ (i : ι), IsIntegral R (b i)
⊢ IsIntegral R (discr K b)

Next tactic:
classical
  rw [discr_def]
  exact IsIntegral.det fun i j ↦ isIntegral_trace ((h i).mul (h j))
/-- If `K` and `L` are fields and `IsScalarTower R K L`, and `b : ι → L` satisfies
` ∀ i, IsIntegral R (b i)`, then `IsIntegral R (discr K b)`. -/
theorem discr_isIntegral {b : ι → L} (h : ∀ i, IsIntegral R (b i)) : IsIntegral R (discr K b) := by
  classical
  

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
R : Type z
inst✝³ : CommRing R
inst✝² : Algebra R K
inst✝¹ : Algebra R L
inst✝ : IsScalarTower R K L
b : ι → L
h : ∀ (i : ι), IsIntegral R (b i)
⊢ IsIntegral R (discr K b)

Next tactic:
rw [discr_def]
/-- If `K` and `L` are fields and `IsScalarTower R K L`, and `b : ι → L` satisfies
` ∀ i, IsIntegral R (b i)`, then `IsIntegral R (discr K b)`. -/
theorem discr_isIntegral {b : ι → L} (h : ∀ i, IsIntegral R (b i)) : IsIntegral R (discr K b) := by
  classical
  rw [discr_def]
  

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
R : Type z
inst✝³ : CommRing R
inst✝² : Algebra R K
inst✝¹ : Algebra R L
inst✝ : IsScalarTower R K L
b : ι → L
h : ∀ (i : ι), IsIntegral R (b i)
⊢ IsIntegral R (det (traceMatrix K b))

Next tactic:
exact IsIntegral.det fun i j ↦ isIntegral_trace ((h i).mul (h j))
/-- Let `K` be the fraction field of an integrally closed domain `R` and let `L` be a finite
separable extension of `K`. Let `B : PowerBasis K L` be such that `IsIntegral R B.gen`.
Then for all, `z : L` that are integral over `R`, we have
`(discr K B.basis) • z ∈ adjoin R ({B.gen} : Set L)`. -/
theorem discr_mul_isIntegral_mem_adjoin [IsSeparable K L] [IsIntegrallyClosed R]
    [IsFractionRing R K] {B : PowerBasis K L} (hint : IsIntegral R B.gen) {z : L}
    (hz : IsIntegral R z) : discr K B.basis • z ∈ adjoin R ({B.gen} : Set L) := 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
R : Type z
inst✝⁶ : CommRing R
inst✝⁵ : Algebra R K
inst✝⁴ : Algebra R L
inst✝³ : IsScalarTower R K L
inst✝² : IsSeparable K L
inst✝¹ : IsIntegrallyClosed R
inst✝ : IsFractionRing R K
B : PowerBasis K L
hint : IsIntegral R B.gen
z : L
hz : IsIntegral R z
⊢ discr K ⇑B.basis • z ∈ adjoin R {B.gen}

Next tactic:
have hinv : IsUnit (traceMatrix K B.basis).det := by
    simpa [← discr_def] using discr_isUnit_of_basis _ B.basis
/-- Let `K` be the fraction field of an integrally closed domain `R` and let `L` be a finite
separable extension of `K`. Let `B : PowerBasis K L` be such that `IsIntegral R B.gen`.
Then for all, `z : L` that are integral over `R`, we have
`(discr K B.basis) • z ∈ adjoin R ({B.gen} : Set L)`. -/
theorem discr_mul_isIntegral_mem_adjoin [IsSeparable K L] [IsIntegrallyClosed R]
    [IsFractionRing R K] {B : PowerBasis K L} (hint : IsIntegral R B.gen) {z : L}
    (hz : IsIntegral R z) : discr K B.basis • z ∈ adjoin R ({B.gen} : Set L) := by
  have hinv : IsUnit (traceMatrix K B.basis).det := 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
R : Type z
inst✝⁶ : CommRing R
inst✝⁵ : Algebra R K
inst✝⁴ : Algebra R L
inst✝³ : IsScalarTower R K L
inst✝² : IsSeparable K L
inst✝¹ : IsIntegrallyClosed R
inst✝ : IsFractionRing R K
B : PowerBasis K L
hint : IsIntegral R B.gen
z : L
hz : IsIntegral R z
⊢ IsUnit (det (traceMatrix K ⇑B.basis))

Next tactic:
simpa [← discr_def] using discr_isUnit_of_basis _ B.basis
/-- Let `K` be the fraction field of an integrally closed domain `R` and let `L` be a finite
separable extension of `K`. Let `B : PowerBasis K L` be such that `IsIntegral R B.gen`.
Then for all, `z : L` that are integral over `R`, we have
`(discr K B.basis) • z ∈ adjoin R ({B.gen} : Set L)`. -/
theorem discr_mul_isIntegral_mem_adjoin [IsSeparable K L] [IsIntegrallyClosed R]
    [IsFractionRing R K] {B : PowerBasis K L} (hint : IsIntegral R B.gen) {z : L}
    (hz : IsIntegral R z) : discr K B.basis • z ∈ adjoin R ({B.gen} : Set L) := by
  have hinv : IsUnit (traceMatrix K B.basis).det := by
    simpa [← discr_def] using discr_isUnit_of_basis _ B.basis
  

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
R : Type z
inst✝⁶ : CommRing R
inst✝⁵ : Algebra R K
inst✝⁴ : Algebra R L
inst✝³ : IsScalarTower R K L
inst✝² : IsSeparable K L
inst✝¹ : IsIntegrallyClosed R
inst✝ : IsFractionRing R K
B : PowerBasis K L
hint : IsIntegral R B.gen
z : L
hz : IsIntegral R z
hinv : IsUnit (det (traceMatrix K ⇑B.basis))
⊢ discr K ⇑B.basis • z ∈ adjoin R {B.gen}

Next tactic:
have H :
    (traceMatrix K B.basis).det • (traceMatrix K B.basis).mulVec (B.basis.equivFun z) =
      (traceMatrix K B.basis).det • fun i => trace K L (z * B.basis i) :=
    by congr; exact traceMatrix_of_basis_mulVec _ _
/-- Let `K` be the fraction field of an integrally closed domain `R` and let `L` be a finite
separable extension of `K`. Let `B : PowerBasis K L` be such that `IsIntegral R B.gen`.
Then for all, `z : L` that are integral over `R`, we have
`(discr K B.basis) • z ∈ adjoin R ({B.gen} : Set L)`. -/
theorem discr_mul_isIntegral_mem_adjoin [IsSeparable K L] [IsIntegrallyClosed R]
    [IsFractionRing R K] {B : PowerBasis K L} (hint : IsIntegral R B.gen) {z : L}
    (hz : IsIntegral R z) : discr K B.basis • z ∈ adjoin R ({B.gen} : Set L) := by
  have hinv : IsUnit (traceMatrix K B.basis).det := by
    simpa [← discr_def] using discr_isUnit_of_basis _ B.basis
  have H :
    (traceMatrix K B.basis).det • (traceMatrix K B.basis).mulVec (B.basis.equivFun z) =
      (traceMatrix K B.basis).det • fun i => trace K L (z * B.basis 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
R : Type z
inst✝⁶ : CommRing R
inst✝⁵ : Algebra R K
inst✝⁴ : Algebra R L
inst✝³ : IsScalarTower R K L
inst✝² : IsSeparable K L
inst✝¹ : IsIntegrallyClosed R
inst✝ : IsFractionRing R K
B : PowerBasis K L
hint : IsIntegral R B.gen
z : L
hz : IsIntegral R z
hinv : IsUnit (det (traceMatrix K ⇑B.basis))
⊢ det (traceMatrix K ⇑B.basis) • mulVec (traceMatrix K ⇑B.basis) ((Basis.equivFun B.basis) z) =
    det (traceMatrix K ⇑B.basis) • fun i => (trace K L) (z * B.basis i)

Next tactic:
congr