l3lab/ntp-mathlib huggingface dataset:
@[simp]
theorem norm_eq_zero_iff [IsDomain R] [IsDomain S] [Module.Free R S] [Module.Finite R S] {x : S} :
    norm R x = 0 ↔ x = 0 := by
  constructor
  let b := Module.Free.chooseBasis R S
  swap
  · rintro rfl; exact norm_zero
  · letI := Classical.decEq (Module.Free.ChooseBasisIndex R S)
    rw [norm_eq_matrix_det b, ← Matrix.exists_mulVec_eq_zero_iff]
    rintro ⟨v, v_ne, hv⟩
    rw [← b.equivFun.apply_symm_apply v, b.equivFun_symm_apply, b.equivFun_apply,
      leftMulMatrix_mulVec_repr] at hv
    refine (mul_eq_zero.mp (b.ext_elem fun i => ?_)).resolve_right (show ∑ i, v i • b i ≠ 0 from ?_)
    · simpa only [LinearEquiv.map_zero, Pi.zero_apply] using congr_fun hv i
    · 

Proof state:
case mp.intro.intro.refine_2
R : Type u_1
S : Type u_2
T : Type u_3
inst✝¹² : CommRing R
inst✝¹¹ : Ring S
inst✝¹⁰ : Algebra R S
K : Type u_4
L : Type u_5
F : Type u_6
inst✝⁹ : Field K
inst✝⁸ : Field L
inst✝⁷ : Field F
inst✝⁶ : Algebra K L
inst✝⁵ : Algebra K F
ι : Type w
inst✝⁴ : Finite ι
inst✝³ : IsDomain R
inst✝² : IsDomain S
inst✝¹ : Module.Free R S
inst✝ : Module.Finite R S
x : S
b : Basis (Module.Free.ChooseBasisIndex R S) R S := Module.Free.chooseBasis R S
this : DecidableEq (Module.Free.ChooseBasisIndex R S) := Classical.decEq (Module.Free.ChooseBasisIndex R S)
v : Module.Free.ChooseBasisIndex R S → R
v_ne : v ≠ 0
hv : ⇑(b.repr (x * ∑ i : Module.Free.ChooseBasisIndex R S, v i • b i)) = 0
⊢ ∑ i : Module.Free.ChooseBasisIndex R S, v i • b i ≠ 0

Next tactic:
contrapose! v_ne with sum_eq
@[simp]
theorem norm_eq_zero_iff [IsDomain R] [IsDomain S] [Module.Free R S] [Module.Finite R S] {x : S} :
    norm R x = 0 ↔ x = 0 := by
  constructor
  let b := Module.Free.chooseBasis R S
  swap
  · rintro rfl; exact norm_zero
  · letI := Classical.decEq (Module.Free.ChooseBasisIndex R S)
    rw [norm_eq_matrix_det b, ← Matrix.exists_mulVec_eq_zero_iff]
    rintro ⟨v, v_ne, hv⟩
    rw [← b.equivFun.apply_symm_apply v, b.equivFun_symm_apply, b.equivFun_apply,
      leftMulMatrix_mulVec_repr] at hv
    refine (mul_eq_zero.mp (b.ext_elem fun i => ?_)).resolve_right (show ∑ i, v i • b i ≠ 0 from ?_)
    · simpa only [LinearEquiv.map_zero, Pi.zero_apply] using congr_fun hv i
    · contrapose! v_ne with sum_eq
      

Proof state:
case mp.intro.intro.refine_2
R : Type u_1
S : Type u_2
T : Type u_3
inst✝¹² : CommRing R
inst✝¹¹ : Ring S
inst✝¹⁰ : Algebra R S
K : Type u_4
L : Type u_5
F : Type u_6
inst✝⁹ : Field K
inst✝⁸ : Field L
inst✝⁷ : Field F
inst✝⁶ : Algebra K L
inst✝⁵ : Algebra K F
ι : Type w
inst✝⁴ : Finite ι
inst✝³ : IsDomain R
inst✝² : IsDomain S
inst✝¹ : Module.Free R S
inst✝ : Module.Finite R S
x : S
b : Basis (Module.Free.ChooseBasisIndex R S) R S := Module.Free.chooseBasis R S
this : DecidableEq (Module.Free.ChooseBasisIndex R S) := Classical.decEq (Module.Free.ChooseBasisIndex R S)
v : Module.Free.ChooseBasisIndex R S → R
hv : ⇑(b.repr (x * ∑ i : Module.Free.ChooseBasisIndex R S, v i • b i)) = 0
sum_eq : ∑ i : Module.Free.ChooseBasisIndex R S, v i • b i = 0
⊢ v = 0

Next tactic:
apply b.equivFun.symm.injective
@[simp]
theorem norm_eq_zero_iff [IsDomain R] [IsDomain S] [Module.Free R S] [Module.Finite R S] {x : S} :
    norm R x = 0 ↔ x = 0 := by
  constructor
  let b := Module.Free.chooseBasis R S
  swap
  · rintro rfl; exact norm_zero
  · letI := Classical.decEq (Module.Free.ChooseBasisIndex R S)
    rw [norm_eq_matrix_det b, ← Matrix.exists_mulVec_eq_zero_iff]
    rintro ⟨v, v_ne, hv⟩
    rw [← b.equivFun.apply_symm_apply v, b.equivFun_symm_apply, b.equivFun_apply,
      leftMulMatrix_mulVec_repr] at hv
    refine (mul_eq_zero.mp (b.ext_elem fun i => ?_)).resolve_right (show ∑ i, v i • b i ≠ 0 from ?_)
    · simpa only [LinearEquiv.map_zero, Pi.zero_apply] using congr_fun hv i
    · contrapose! v_ne with sum_eq
      apply b.equivFun.symm.injective
      

Proof state:
case mp.intro.intro.refine_2.a
R : Type u_1
S : Type u_2
T : Type u_3
inst✝¹² : CommRing R
inst✝¹¹ : Ring S
inst✝¹⁰ : Algebra R S
K : Type u_4
L : Type u_5
F : Type u_6
inst✝⁹ : Field K
inst✝⁸ : Field L
inst✝⁷ : Field F
inst✝⁶ : Algebra K L
inst✝⁵ : Algebra K F
ι : Type w
inst✝⁴ : Finite ι
inst✝³ : IsDomain R
inst✝² : IsDomain S
inst✝¹ : Module.Free R S
inst✝ : Module.Finite R S
x : S
b : Basis (Module.Free.ChooseBasisIndex R S) R S := Module.Free.chooseBasis R S
this : DecidableEq (Module.Free.ChooseBasisIndex R S) := Classical.decEq (Module.Free.ChooseBasisIndex R S)
v : Module.Free.ChooseBasisIndex R S → R
hv : ⇑(b.repr (x * ∑ i : Module.Free.ChooseBasisIndex R S, v i • b i)) = 0
sum_eq : ∑ i : Module.Free.ChooseBasisIndex R S, v i • b i = 0
⊢ (LinearEquiv.symm (Basis.equivFun b)) v = (LinearEquiv.symm (Basis.equivFun b)) 0

Next tactic:
rw [b.equivFun_symm_apply, sum_eq, LinearEquiv.map_zero]
theorem norm_eq_zero_iff_of_basis [IsDomain R] [IsDomain S] (b : Basis ι R S) {x : S} :
    Algebra.norm R x = 0 ↔ x = 0 := by
  

Proof state:
R : Type u_1
S : Type u_2
T : Type u_3
inst✝¹⁰ : CommRing R
inst✝⁹ : Ring S
inst✝⁸ : Algebra R S
K : Type u_4
L : Type u_5
F : Type u_6
inst✝⁷ : Field K
inst✝⁶ : Field L
inst✝⁵ : Field F
inst✝⁴ : Algebra K L
inst✝³ : Algebra K F
ι : Type w
inst✝² : Finite ι
inst✝¹ : IsDomain R
inst✝ : IsDomain S
b : Basis ι R S
x : S
⊢ (norm R) x = 0 ↔ x = 0

Next tactic:
haveI : Module.Free R S := Module.Free.of_basis b
theorem norm_eq_zero_iff_of_basis [IsDomain R] [IsDomain S] (b : Basis ι R S) {x : S} :
    Algebra.norm R x = 0 ↔ x = 0 := by
  haveI : Module.Free R S := Module.Free.of_basis b
  

Proof state:
R : Type u_1
S : Type u_2
T : Type u_3
inst✝¹⁰ : CommRing R
inst✝⁹ : Ring S
inst✝⁸ : Algebra R S
K : Type u_4
L : Type u_5
F : Type u_6
inst✝⁷ : Field K
inst✝⁶ : Field L
inst✝⁵ : Field F
inst✝⁴ : Algebra K L
inst✝³ : Algebra K F
ι : Type w
inst✝² : Finite ι
inst✝¹ : IsDomain R
inst✝ : IsDomain S
b : Basis ι R S
x : S
this : Module.Free R S
⊢ (norm R) x = 0 ↔ x = 0

Next tactic:
haveI : Module.Finite R S := Module.Finite.of_basis b
theorem norm_eq_zero_iff_of_basis [IsDomain R] [IsDomain S] (b : Basis ι R S) {x : S} :
    Algebra.norm R x = 0 ↔ x = 0 := by
  haveI : Module.Free R S := Module.Free.of_basis b
  haveI : Module.Finite R S := Module.Finite.of_basis b
  

Proof state:
R : Type u_1
S : Type u_2
T : Type u_3
inst✝¹⁰ : CommRing R
inst✝⁹ : Ring S
inst✝⁸ : Algebra R S
K : Type u_4
L : Type u_5
F : Type u_6
inst✝⁷ : Field K
inst✝⁶ : Field L
inst✝⁵ : Field F
inst✝⁴ : Algebra K L
inst✝³ : Algebra K F
ι : Type w
inst✝² : Finite ι
inst✝¹ : IsDomain R
inst✝ : IsDomain S
b : Basis ι R S
x : S
this✝ : Module.Free R S
this : Module.Finite R S
⊢ (norm R) x = 0 ↔ x = 0

Next tactic:
exact norm_eq_zero_iff
theorem norm_eq_norm_adjoin [FiniteDimensional K L] [IsSeparable K L] (x : L) :
    norm K x = norm K (AdjoinSimple.gen K x) ^ finrank K⟮x⟯ L := by
  

Proof state:
R : Type u_1
S : Type u_2
T : Type u_3
inst✝⁹ : CommRing R
inst✝⁸ : Ring S
inst✝⁷ : Algebra R S
K : Type u_4
L : Type u_5
F : Type u_6
inst✝⁶ : Field K
inst✝⁵ : Field L
inst✝⁴ : Field F
inst✝³ : Algebra K L
inst✝² : Algebra K F
ι : Type w
inst✝¹ : FiniteDimensional K L
inst✝ : IsSeparable K L
x : L
⊢ (norm K) x = (norm K) (AdjoinSimple.gen K x) ^ finrank (↥K⟮x⟯) L

Next tactic:
letI := isSeparable_tower_top_of_isSeparable K K⟮x⟯ L
theorem norm_eq_norm_adjoin [FiniteDimensional K L] [IsSeparable K L] (x : L) :
    norm K x = norm K (AdjoinSimple.gen K x) ^ finrank K⟮x⟯ L := by
  letI := isSeparable_tower_top_of_isSeparable K K⟮x⟯ L
  

Proof state:
R : Type u_1
S : Type u_2
T : Type u_3
inst✝⁹ : CommRing R
inst✝⁸ : Ring S
inst✝⁷ : Algebra R S
K : Type u_4
L : Type u_5
F : Type u_6
inst✝⁶ : Field K
inst✝⁵ : Field L
inst✝⁴ : Field F
inst✝³ : Algebra K L
inst✝² : Algebra K F
ι : Type w
inst✝¹ : FiniteDimensional K L
inst✝ : IsSeparable K L
x : L
this : IsSeparable (↥K⟮x⟯) L := isSeparable_tower_top_of_isSeparable K (↥K⟮x⟯) L
⊢ (norm K) x = (norm K) (AdjoinSimple.gen K x) ^ finrank (↥K⟮x⟯) L

Next tactic:
let pbL := Field.powerBasisOfFiniteOfSeparable K⟮x⟯ L
theorem norm_eq_norm_adjoin [FiniteDimensional K L] [IsSeparable K L] (x : L) :
    norm K x = norm K (AdjoinSimple.gen K x) ^ finrank K⟮x⟯ L := by
  letI := isSeparable_tower_top_of_isSeparable K K⟮x⟯ L
  let pbL := Field.powerBasisOfFiniteOfSeparable K⟮x⟯ L
  

Proof state:
R : Type u_1
S : Type u_2
T : Type u_3
inst✝⁹ : CommRing R
inst✝⁸ : Ring S
inst✝⁷ : Algebra R S
K : Type u_4
L : Type u_5
F : Type u_6
inst✝⁶ : Field K
inst✝⁵ : Field L
inst✝⁴ : Field F
inst✝³ : Algebra K L
inst✝² : Algebra K F
ι : Type w
inst✝¹ : FiniteDimensional K L
inst✝ : IsSeparable K L
x : L
this : IsSeparable (↥K⟮x⟯) L := isSeparable_tower_top_of_isSeparable K (↥K⟮x⟯) L
pbL : PowerBasis (↥K⟮x⟯) L := Field.powerBasisOfFiniteOfSeparable (↥K⟮x⟯) L
⊢ (norm K) x = (norm K) (AdjoinSimple.gen K x) ^ finrank (↥K⟮x⟯) L

Next tactic:
let pbx := IntermediateField.adjoin.powerBasis (IsSeparable.isIntegral K x)
theorem norm_eq_norm_adjoin [FiniteDimensional K L] [IsSeparable K L] (x : L) :
    norm K x = norm K (AdjoinSimple.gen K x) ^ finrank K⟮x⟯ L := by
  letI := isSeparable_tower_top_of_isSeparable K K⟮x⟯ L
  let pbL := Field.powerBasisOfFiniteOfSeparable K⟮x⟯ L
  let pbx := IntermediateField.adjoin.powerBasis (IsSeparable.isIntegral K x)
  -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644
  

Proof state:
R : Type u_1
S : Type u_2
T : Type u_3
inst✝⁹ : CommRing R
inst✝⁸ : Ring S
inst✝⁷ : Algebra R S
K : Type u_4
L : Type u_5
F : Type u_6
inst✝⁶ : Field K
inst✝⁵ : Field L
inst✝⁴ : Field F
inst✝³ : Algebra K L
inst✝² : Algebra K F
ι : Type w
inst✝¹ : FiniteDimensional K L
inst✝ : IsSeparable K L
x : L
this : IsSeparable (↥K⟮x⟯) L := isSeparable_tower_top_of_isSeparable K (↥K⟮x⟯) L
pbL : PowerBasis (↥K⟮x⟯) L := Field.powerBasisOfFiniteOfSeparable (↥K⟮x⟯) L
pbx : PowerBasis K ↥K⟮x⟯ := adjoin.powerBasis (_ : IsIntegral K x)
⊢ (norm K) x = (norm K) (AdjoinSimple.gen K x) ^ finrank (↥K⟮x⟯) L

Next tactic:
erw [← AdjoinSimple.algebraMap_gen K x, norm_eq_matrix_det (pbx.basis.smul pbL.basis) _,
    smul_leftMulMatrix_algebraMap, det_blockDiagonal, norm_eq_matrix_det pbx.basis]
theorem norm_eq_norm_adjoin [FiniteDimensional K L] [IsSeparable K L] (x : L) :
    norm K x = norm K (AdjoinSimple.gen K x) ^ finrank K⟮x⟯ L := by
  letI := isSeparable_tower_top_of_isSeparable K K⟮x⟯ L
  let pbL := Field.powerBasisOfFiniteOfSeparable K⟮x⟯ L
  let pbx := IntermediateField.adjoin.powerBasis (IsSeparable.isIntegral K x)
  -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644
  erw [← AdjoinSimple.algebraMap_gen K x, norm_eq_matrix_det (pbx.basis.smul pbL.basis) _,
    smul_leftMulMatrix_algebraMap, det_blockDiagonal, norm_eq_matrix_det pbx.basis]
  

Proof state:
R : Type u_1
S : Type u_2
T : Type u_3
inst✝⁹ : CommRing R
inst✝⁸ : Ring S
inst✝⁷ : Algebra R S
K : Type u_4
L : Type u_5
F : Type u_6
inst✝⁶ : Field K
inst✝⁵ : Field L
inst✝⁴ : Field F
inst✝³ : Algebra K L
inst✝² : Algebra K F
ι : Type w
inst✝¹ : FiniteDimensional K L
inst✝ : IsSeparable K L
x : L
this : IsSeparable (↥K⟮x⟯) L := isSeparable_tower_top_of_isSeparable K (↥K⟮x⟯) L
pbL : PowerBasis (↥K⟮x⟯) L := Field.powerBasisOfFiniteOfSeparable (↥K⟮x⟯) L
pbx : PowerBasis K ↥K⟮x⟯ := adjoin.powerBasis (_ : IsIntegral K x)
⊢ ∏ k : Fin pbL.dim, det ((leftMulMatrix pbx.basis) (AdjoinSimple.gen K x)) =
    det ((leftMulMatrix pbx.basis) (AdjoinSimple.gen K ((algebraMap (↥K⟮x⟯) L) (AdjoinSimple.gen K x)))) ^
      finrank (↥K⟮(algebraMap (↥K⟮x⟯) L) (AdjoinSimple.gen K x)⟯) L

Next tactic:
simp only [Finset.card_fin, Finset.prod_const]
theorem norm_eq_norm_adjoin [FiniteDimensional K L] [IsSeparable K L] (x : L) :
    norm K x = norm K (AdjoinSimple.gen K x) ^ finrank K⟮x⟯ L := by
  letI := isSeparable_tower_top_of_isSeparable K K⟮x⟯ L
  let pbL := Field.powerBasisOfFiniteOfSeparable K⟮x⟯ L
  let pbx := IntermediateField.adjoin.powerBasis (IsSeparable.isIntegral K x)
  -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644
  erw [← AdjoinSimple.algebraMap_gen K x, norm_eq_matrix_det (pbx.basis.smul pbL.basis) _,
    smul_leftMulMatrix_algebraMap, det_blockDiagonal, norm_eq_matrix_det pbx.basis]
  simp only [Finset.card_fin, Finset.prod_const]
  

Proof state:
R : Type u_1
S : Type u_2
T : Type u_3
inst✝⁹ : CommRing R
inst✝⁸ : Ring S
inst✝⁷ : Algebra R S
K : Type u_4
L : Type u_5
F : Type u_6
inst✝⁶ : Field K
inst✝⁵ : Field L
inst✝⁴ : Field F
inst✝³ : Algebra K L
inst✝² : Algebra K F
ι : Type w
inst✝¹ : FiniteDimensional K L
inst✝ : IsSeparable K L
x : L
this : IsSeparable (↥K⟮x⟯) L := isSeparable_tower_top_of_isSeparable K (↥K⟮x⟯) L
pbL : PowerBasis (↥K⟮x⟯) L := Field.powerBasisOfFiniteOfSeparable (↥K⟮x⟯) L
pbx : PowerBasis K ↥K⟮x⟯ := adjoin.powerBasis (_ : IsIntegral K x)
⊢ det ((leftMulMatrix (adjoin.powerBasis (_ : IsIntegral K x)).basis) (AdjoinSimple.gen K x)) ^
      (Field.powerBasisOfFiniteOfSeparable (↥K⟮x⟯) L).dim =
    det
        ((leftMulMatrix (adjoin.powerBasis (_ : IsIntegral K x)).basis)
          (AdjoinSimple.gen K ((algebraMap (↥K⟮x⟯) L) (AdjoinSimple.gen K x)))) ^
      finrank (↥K⟮(algebraMap (↥K⟮x⟯) L) (AdjoinSimple.gen K x)⟯) L

Next tactic:
congr
theorem norm_eq_norm_adjoin [FiniteDimensional K L] [IsSeparable K L] (x : L) :
    norm K x = norm K (AdjoinSimple.gen K x) ^ finrank K⟮x⟯ L := by
  letI := isSeparable_tower_top_of_isSeparable K K⟮x⟯ L
  let pbL := Field.powerBasisOfFiniteOfSeparable K⟮x⟯ L
  let pbx := IntermediateField.adjoin.powerBasis (IsSeparable.isIntegral K x)
  -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644
  erw [← AdjoinSimple.algebraMap_gen K x, norm_eq_matrix_det (pbx.basis.smul pbL.basis) _,
    smul_leftMulMatrix_algebraMap, det_blockDiagonal, norm_eq_matrix_det pbx.basis]
  simp only [Finset.card_fin, Finset.prod_const]
  congr
  

Proof state:
case e_a
R : Type u_1
S : Type u_2
T : Type u_3
inst✝⁹ : CommRing R
inst✝⁸ : Ring S
inst✝⁷ : Algebra R S
K : Type u_4
L : Type u_5
F : Type u_6
inst✝⁶ : Field K
inst✝⁵ : Field L
inst✝⁴ : Field F
inst✝³ : Algebra K L
inst✝² : Algebra K F
ι : Type w
inst✝¹ : FiniteDimensional K L
inst✝ : IsSeparable K L
x : L
this : IsSeparable (↥K⟮x⟯) L := isSeparable_tower_top_of_isSeparable K (↥K⟮x⟯) L
pbL : PowerBasis (↥K⟮x⟯) L := Field.powerBasisOfFiniteOfSeparable (↥K⟮x⟯) L
pbx : PowerBasis K ↥K⟮x⟯ := adjoin.powerBasis (_ : IsIntegral K x)
⊢ (Field.powerBasisOfFiniteOfSeparable (↥K⟮x⟯) L).dim = finrank (↥K⟮(algebraMap (↥K⟮x⟯) L) (AdjoinSimple.gen K x)⟯) L

Next tactic:
rw [← PowerBasis.finrank, AdjoinSimple.algebraMap_gen K x]
theorem _root_.IntermediateField.AdjoinSimple.norm_gen_eq_one {x : L} (hx : ¬IsIntegral K x) :
    norm K (AdjoinSimple.gen K x) = 1 := by
  

Proof state:
R : Type u_1
S : Type u_2
T : Type u_3
inst✝⁷ : CommRing R
inst✝⁶ : Ring S
inst✝⁵ : Algebra R S
K : Type u_4
L : Type u_5
F : Type u_6
inst✝⁴ : Field K
inst✝³ : Field L
inst✝² : Field F
inst✝¹ : Algebra K L
inst✝ : Algebra K F
ι : Type w
x : L
hx : ¬IsIntegral K x
⊢ (norm K) (AdjoinSimple.gen K x) = 1

Next tactic:
rw [norm_eq_one_of_not_exists_basis]
theorem _root_.IntermediateField.AdjoinSimple.norm_gen_eq_one {x : L} (hx : ¬IsIntegral K x) :
    norm K (AdjoinSimple.gen K x) = 1 := by
  rw [norm_eq_one_of_not_exists_basis]
  

Proof state:
case h
R : Type u_1
S : Type u_2
T : Type u_3
inst✝⁷ : CommRing R
inst✝⁶ : Ring S
inst✝⁵ : Algebra R S
K : Type u_4
L : Type u_5
F : Type u_6
inst✝⁴ : Field K
inst✝³ : Field L
inst✝² : Field F
inst✝¹ : Algebra K L
inst✝ : Algebra K F
ι : Type w
x : L
hx : ¬IsIntegral K x
⊢ ¬∃ s, Nonempty (Basis { x_1 // x_1 ∈ s } K ↥K⟮x⟯)

Next tactic:
contrapose! hx
theorem _root_.IntermediateField.AdjoinSimple.norm_gen_eq_one {x : L} (hx : ¬IsIntegral K x) :
    norm K (AdjoinSimple.gen K x) = 1 := by
  rw [norm_eq_one_of_not_exists_basis]
  contrapose! hx
  

Proof state:
case h
R : Type u_1
S : Type u_2
T : Type u_3
inst✝⁷ : CommRing R
inst✝⁶ : Ring S
inst✝⁵ : Algebra R S
K : Type u_4
L : Type u_5
F : Type u_6
inst✝⁴ : Field K
inst✝³ : Field L
inst✝² : Field F
inst✝¹ : Algebra K L
inst✝ : Algebra K F
ι : Type w
x : L
hx : ∃ s, Nonempty (Basis { x_1 // x_1 ∈ s } K ↥K⟮x⟯)
⊢ IsIntegral K x

Next tactic:
obtain ⟨s, ⟨b⟩⟩ := hx
theorem _root_.IntermediateField.AdjoinSimple.norm_gen_eq_one {x : L} (hx : ¬IsIntegral K x) :
    norm K (AdjoinSimple.gen K x) = 1 := by
  rw [norm_eq_one_of_not_exists_basis]
  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✝⁶ : Ring S
inst✝⁵ : Algebra R S
K : Type u_4
L : Type u_5
F : Type u_6
inst✝⁴ : Field K
inst✝³ : Field L
inst✝² : Field F
inst✝¹ : Algebra K L
inst✝ : Algebra K F
ι : Type w
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 _root_.IntermediateField.AdjoinSimple.norm_gen_eq_one {x : L} (hx : ¬IsIntegral K x) :
    norm K (AdjoinSimple.gen K x) = 1 := by
  rw [norm_eq_one_of_not_exists_basis]
  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✝⁶ : Ring S
inst✝⁵ : Algebra R S
K : Type u_4
L : Type u_5
F : Type u_6
inst✝⁴ : Field K
inst✝³ : Field L
inst✝² : Field F
inst✝¹ : Algebra K L
inst✝ : Algebra K F
ι : Type w
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 (of_fintype_basis b)
theorem _root_.IntermediateField.AdjoinSimple.norm_gen_eq_one {x : L} (hx : ¬IsIntegral K x) :
    norm K (AdjoinSimple.gen K x) = 1 := by
  rw [norm_eq_one_of_not_exists_basis]
  contrapose! hx
  obtain ⟨s, ⟨b⟩⟩ := hx
  refine .of_mem_of_fg K⟮x⟯.toSubalgebra ?_ x ?_
  · exact (Submodule.fg_iff_finiteDimensional _).mpr (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✝⁶ : Ring S
inst✝⁵ : Algebra R S
K : Type u_4
L : Type u_5
F : Type u_6
inst✝⁴ : Field K
inst✝³ : Field L
inst✝² : Field F
inst✝¹ : Algebra K L
inst✝ : Algebra K F
ι : Type w
x : L
s : Finset ↥K⟮x⟯
b : Basis { x_1 // x_1 ∈ s } K ↥K⟮x⟯
⊢ x ∈ K⟮x⟯.toSubalgebra

Next tactic:
exact IntermediateField.subset_adjoin K _ (Set.mem_singleton x)
theorem _root_.IntermediateField.AdjoinSimple.norm_gen_eq_prod_roots (x : L)
    (hf : (minpoly K x).Splits (algebraMap K F)) :
    (algebraMap K F) (norm K (AdjoinSimple.gen K x)) =
      ((minpoly K x).aroots F).prod := by
  

Proof state:
R : Type u_1
S : Type u_2
T : Type u_3
inst✝⁷ : CommRing R
inst✝⁶ : Ring S
inst✝⁵ : Algebra R S
K : Type u_4
L : Type u_5
F : Type u_6
inst✝⁴ : Field K
inst✝³ : Field L
inst✝² : Field F
inst✝¹ : Algebra K L
inst✝ : Algebra K F
ι : Type w
x : L
hf : Splits (algebraMap K F) (minpoly K x)
⊢ (algebraMap K F) ((norm K) (AdjoinSimple.gen K x)) = Multiset.prod (aroots (minpoly K x) F)

Next tactic:
have injKxL := (algebraMap K⟮x⟯ L).injective
theorem _root_.IntermediateField.AdjoinSimple.norm_gen_eq_prod_roots (x : L)
    (hf : (minpoly K x).Splits (algebraMap K F)) :
    (algebraMap K F) (norm K (AdjoinSimple.gen K x)) =
      ((minpoly K x).aroots F).prod := 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✝⁶ : Ring S
inst✝⁵ : Algebra R S
K : Type u_4
L : Type u_5
F : Type u_6
inst✝⁴ : Field K
inst✝³ : Field L
inst✝² : Field F
inst✝¹ : Algebra K L
inst✝ : Algebra K F
ι : Type w
x : L
hf : Splits (algebraMap K F) (minpoly K x)
injKxL : Function.Injective ⇑(algebraMap (↥K⟮x⟯) L)
⊢ (algebraMap K F) ((norm K) (AdjoinSimple.gen K x)) = Multiset.prod (aroots (minpoly K x) F)

Next tactic:
by_cases hx : IsIntegral K x
theorem _root_.IntermediateField.AdjoinSimple.norm_gen_eq_prod_roots (x : L)
    (hf : (minpoly K x).Splits (algebraMap K F)) :
    (algebraMap K F) (norm K (AdjoinSimple.gen K x)) =
      ((minpoly K x).aroots F).prod := 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✝⁶ : Ring S
inst✝⁵ : Algebra R S
K : Type u_4
L : Type u_5
F : Type u_6
inst✝⁴ : Field K
inst✝³ : Field L
inst✝² : Field F
inst✝¹ : Algebra K L
inst✝ : Algebra K F
ι : Type w
x : L
hf : Splits (algebraMap K F) (minpoly K x)
injKxL : Function.Injective ⇑(algebraMap (↥K⟮x⟯) L)
hx : IsIntegral K x
⊢ (algebraMap K F) ((norm K) (AdjoinSimple.gen K x)) = Multiset.prod (aroots (minpoly K x) F)
case neg
R : Type u_1
S : Type u_2
T : Type u_3
inst✝⁷ : CommRing R
inst✝⁶ : Ring S
inst✝⁵ : Algebra R S
K : Type u_4
L : Type u_5
F : Type u_6
inst✝⁴ : Field K
inst✝³ : Field L
inst✝² : Field F
inst✝¹ : Algebra K L
inst✝ : Algebra K F
ι : Type w
x : L
hf : Splits (algebraMap K F) (minpoly K x)
injKxL : Function.Injective ⇑(algebraMap (↥K⟮x⟯) L)
hx : ¬IsIntegral K x
⊢ (algebraMap K F) ((norm K) (AdjoinSimple.gen K x)) = Multiset.prod (aroots (minpoly K x) F)

Next tactic:
swap
theorem _root_.IntermediateField.AdjoinSimple.norm_gen_eq_prod_roots (x : L)
    (hf : (minpoly K x).Splits (algebraMap K F)) :
    (algebraMap K F) (norm K (AdjoinSimple.gen K x)) =
      ((minpoly K x).aroots F).prod := 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✝⁶ : Ring S
inst✝⁵ : Algebra R S
K : Type u_4
L : Type u_5
F : Type u_6
inst✝⁴ : Field K
inst✝³ : Field L
inst✝² : Field F
inst✝¹ : Algebra K L
inst✝ : Algebra K F
ι : Type w
x : L
hf : Splits (algebraMap K F) (minpoly K x)
injKxL : Function.Injective ⇑(algebraMap (↥K⟮x⟯) L)
hx : ¬IsIntegral K x
⊢ (algebraMap K F) ((norm K) (AdjoinSimple.gen K x)) = Multiset.prod (aroots (minpoly K x) F)

Next tactic:
simp [minpoly.eq_zero hx, IntermediateField.AdjoinSimple.norm_gen_eq_one hx, aroots_def]
theorem _root_.IntermediateField.AdjoinSimple.norm_gen_eq_prod_roots (x : L)
    (hf : (minpoly K x).Splits (algebraMap K F)) :
    (algebraMap K F) (norm K (AdjoinSimple.gen K x)) =
      ((minpoly K x).aroots F).prod := by
  have injKxL := (algebraMap K⟮x⟯ L).injective
  by_cases hx : IsIntegral K x; swap
  · simp [minpoly.eq_zero hx, IntermediateField.AdjoinSimple.norm_gen_eq_one hx, aroots_def]
  

Proof state:
case pos
R : Type u_1
S : Type u_2
T : Type u_3
inst✝⁷ : CommRing R
inst✝⁶ : Ring S
inst✝⁵ : Algebra R S
K : Type u_4
L : Type u_5
F : Type u_6
inst✝⁴ : Field K
inst✝³ : Field L
inst✝² : Field F
inst✝¹ : Algebra K L
inst✝ : Algebra K F
ι : Type w
x : L
hf : Splits (algebraMap K F) (minpoly K x)
injKxL : Function.Injective ⇑(algebraMap (↥K⟮x⟯) L)
hx : IsIntegral K x
⊢ (algebraMap K F) ((norm K) (AdjoinSimple.gen K x)) = Multiset.prod (aroots (minpoly K x) F)

Next tactic:
rw [← adjoin.powerBasis_gen hx, PowerBasis.norm_gen_eq_prod_roots]
theorem _root_.IntermediateField.AdjoinSimple.norm_gen_eq_prod_roots (x : L)
    (hf : (minpoly K x).Splits (algebraMap K F)) :
    (algebraMap K F) (norm K (AdjoinSimple.gen K x)) =
      ((minpoly K x).aroots F).prod := by
  have injKxL := (algebraMap K⟮x⟯ L).injective
  by_cases hx : IsIntegral K x; swap
  · simp [minpoly.eq_zero hx, IntermediateField.AdjoinSimple.norm_gen_eq_one hx, aroots_def]
  rw [← adjoin.powerBasis_gen hx, PowerBasis.norm_gen_eq_prod_roots] <;>
    

Proof state:
case pos
R : Type u_1
S : Type u_2
T : Type u_3
inst✝⁷ : CommRing R
inst✝⁶ : Ring S
inst✝⁵ : Algebra R S
K : Type u_4
L : Type u_5
F : Type u_6
inst✝⁴ : Field K
inst✝³ : Field L
inst✝² : Field F
inst✝¹ : Algebra K L
inst✝ : Algebra K F
ι : Type w
x : L
hf : Splits (algebraMap K F) (minpoly K x)
injKxL : Function.Injective ⇑(algebraMap (↥K⟮x⟯) L)
hx : IsIntegral K x
⊢ Multiset.prod (aroots (minpoly K (adjoin.powerBasis hx).gen) F) = Multiset.prod (aroots (minpoly K x) F)

Next tactic:
rw [adjoin.powerBasis_gen hx, ← minpoly.algebraMap_eq injKxL]