l3lab/ntp-mathlib huggingface dataset:
/-- If the `R`-integral element `a : S` has coordinates `< y` with respect to some basis `b`,
its norm is strictly less than `normBound abv b * y ^ dim S`. -/
theorem norm_lt {T : Type*} [LinearOrderedRing T] (a : S) {y : T}
    (hy : ∀ k, (abv (bS.repr a k) : T) < y) :
    (abv (Algebra.norm R a) : T) < normBound abv bS * y ^ Fintype.card ι := by
  obtain ⟨i⟩ := bS.index_nonempty
  have him : (Finset.univ.image fun k => abv (bS.repr a k)).Nonempty :=
    ⟨_, Finset.mem_image.mpr ⟨i, Finset.mem_univ _, rfl⟩⟩
  set y' : ℤ := Finset.max' _ him with y'_def
  have hy' : ∀ k, abv (bS.repr a k) ≤ y' := by
    intro k
    exact @Finset.le_max' ℤ _ _ _ (Finset.mem_image.mpr ⟨k, Finset.mem_univ _, rfl⟩)
  have : (y' : T) < y := by
    rw [y'_def, ←
      Finset.max'_image (show Monotone (_ : ℤ → T) from fun x y h => Int.cast_le.mpr h)]
    apply (Finset.max'_lt_iff _ (him.image _)).mpr
    simp only [Finset.mem_image, exists_prop]
    rintro _ ⟨x, ⟨k, -, rfl⟩, rfl⟩
    exact hy k
  have y'_nonneg : 0 ≤ y' := le_trans (abv.nonneg _) (hy' i)
  apply (Int.cast_le.mpr (norm_le abv bS a hy')).trans_lt
  simp only [Int.cast_mul, Int.cast_pow]
  apply mul_lt_mul' le_rfl
  · exact pow_lt_pow_left this (Int.cast_nonneg.mpr y'_nonneg) (@Fintype.card_ne_zero _ _ ⟨i⟩)
  · exact pow_nonneg (Int.cast_nonneg.mpr y'_nonneg) _
  · 

Proof state:
case intro.hc
R : Type u_1
S : Type u_2
K : Type u_3
L : Type u_4
inst✝¹⁵ : EuclideanDomain R
inst✝¹⁴ : CommRing S
inst✝¹³ : IsDomain S
inst✝¹² : Field K
inst✝¹¹ : Field L
inst✝¹⁰ : Algebra R K
inst✝⁹ : IsFractionRing R K
inst✝⁸ : Algebra K L
inst✝⁷ : FiniteDimensional K L
inst✝⁶ : IsSeparable K L
algRL : Algebra R L
inst✝⁵ : IsScalarTower R K L
inst✝⁴ : Algebra R S
inst✝³ : Algebra S L
ist : IsScalarTower R S L
iic : IsIntegralClosure S R L
abv : AbsoluteValue R ℤ
ι : Type u_5
inst✝² : DecidableEq ι
inst✝¹ : Fintype ι
bS : Basis ι R S
T : Type u_6
inst✝ : LinearOrderedRing T
a : S
y : T
hy : ∀ (k : ι), ↑(abv ((bS.repr a) k)) < y
i : ι
him : Finset.Nonempty (Finset.image (fun k => abv ((bS.repr a) k)) Finset.univ)
y' : ℤ := Finset.max' (Finset.image (fun k => abv ((bS.repr a) k)) Finset.univ) him
y'_def : y' = Finset.max' (Finset.image (fun k => abv ((bS.repr a) k)) Finset.univ) him
hy' : ∀ (k : ι), abv ((bS.repr a) k) ≤ y'
this : ↑y' < y
y'_nonneg : 0 ≤ y'
⊢ 0 < ↑(normBound abv bS)

Next tactic:
exact Int.cast_pos.mpr (normBound_pos abv bS)
/-- A nonzero ideal has an element of minimal norm. -/
-- porting note: port of Int.exists_least_of_bdd requires DecidablePred, so we use classical
theorem exists_min (I : (Ideal S)⁰) :
    ∃ b ∈ (I : Ideal S),
      b ≠ 0 ∧ ∀ c ∈ (I : Ideal S), abv (Algebra.norm R c) < abv (Algebra.norm R b) → c =
      (0 : S) := by
  

Proof state:
R : Type u_1
S : Type u_2
K : Type u_3
L : Type u_4
inst✝¹⁴ : EuclideanDomain R
inst✝¹³ : CommRing S
inst✝¹² : IsDomain S
inst✝¹¹ : Field K
inst✝¹⁰ : Field L
inst✝⁹ : Algebra R K
inst✝⁸ : IsFractionRing R K
inst✝⁷ : Algebra K L
inst✝⁶ : FiniteDimensional K L
inst✝⁵ : IsSeparable K L
algRL : Algebra R L
inst✝⁴ : IsScalarTower R K L
inst✝³ : Algebra R S
inst✝² : Algebra S L
ist : IsScalarTower R S L
iic : IsIntegralClosure S R L
abv : AbsoluteValue R ℤ
ι : Type u_5
inst✝¹ : DecidableEq ι
inst✝ : Fintype ι
bS : Basis ι R S
I : ↥(Ideal S)⁰
⊢ ∃ b ∈ ↑I, b ≠ 0 ∧ ∀ c ∈ ↑I, abv ((Algebra.norm R) c) < abv ((Algebra.norm R) b) → c = 0

Next tactic:
classical
  obtain ⟨_, ⟨b, b_mem, b_ne_zero, rfl⟩, min⟩ := @Int.exists_least_of_bdd
      (fun a => ∃ b ∈ (I : Ideal S), b ≠ (0 : S) ∧ abv (Algebra.norm R b) = a) _
    (by
      use 0
      rintro _ ⟨b, _, _, rfl⟩
      apply abv.nonneg)
    (by
      obtain ⟨b, b_mem, b_ne_zero⟩ := (I : Ideal S).ne_bot_iff.mp (nonZeroDivisors.coe_ne_zero I)
      exact ⟨_, ⟨b, b_mem, b_ne_zero, rfl⟩⟩)
  · refine' ⟨b, b_mem, b_ne_zero, _⟩
    intro c hc lt
    contrapose! lt with c_ne_zero
    exact min _ ⟨c, hc, c_ne_zero, rfl⟩
/-- A nonzero ideal has an element of minimal norm. -/
-- porting note: port of Int.exists_least_of_bdd requires DecidablePred, so we use classical
theorem exists_min (I : (Ideal S)⁰) :
    ∃ b ∈ (I : Ideal S),
      b ≠ 0 ∧ ∀ c ∈ (I : Ideal S), abv (Algebra.norm R c) < abv (Algebra.norm R b) → c =
      (0 : S) := by
  classical
  

Proof state:
R : Type u_1
S : Type u_2
K : Type u_3
L : Type u_4
inst✝¹⁴ : EuclideanDomain R
inst✝¹³ : CommRing S
inst✝¹² : IsDomain S
inst✝¹¹ : Field K
inst✝¹⁰ : Field L
inst✝⁹ : Algebra R K
inst✝⁸ : IsFractionRing R K
inst✝⁷ : Algebra K L
inst✝⁶ : FiniteDimensional K L
inst✝⁵ : IsSeparable K L
algRL : Algebra R L
inst✝⁴ : IsScalarTower R K L
inst✝³ : Algebra R S
inst✝² : Algebra S L
ist : IsScalarTower R S L
iic : IsIntegralClosure S R L
abv : AbsoluteValue R ℤ
ι : Type u_5
inst✝¹ : DecidableEq ι
inst✝ : Fintype ι
bS : Basis ι R S
I : ↥(Ideal S)⁰
⊢ ∃ b ∈ ↑I, b ≠ 0 ∧ ∀ c ∈ ↑I, abv ((Algebra.norm R) c) < abv ((Algebra.norm R) b) → c = 0

Next tactic:
obtain ⟨_, ⟨b, b_mem, b_ne_zero, rfl⟩, min⟩ := @Int.exists_least_of_bdd
      (fun a => ∃ b ∈ (I : Ideal S), b ≠ (0 : S) ∧ abv (Algebra.norm R b) = a) _
    (by
      use 0
      rintro _ ⟨b, _, _, rfl⟩
      apply abv.nonneg)
    (by
      obtain ⟨b, b_mem, b_ne_zero⟩ := (I : Ideal S).ne_bot_iff.mp (nonZeroDivisors.coe_ne_zero I)
      exact ⟨_, ⟨b, b_mem, b_ne_zero, rfl⟩⟩)
/-- A nonzero ideal has an element of minimal norm. -/
-- porting note: port of Int.exists_least_of_bdd requires DecidablePred, so we use classical
theorem exists_min (I : (Ideal S)⁰) :
    ∃ b ∈ (I : Ideal S),
      b ≠ 0 ∧ ∀ c ∈ (I : Ideal S), abv (Algebra.norm R c) < abv (Algebra.norm R b) → c =
      (0 : S) := by
  classical
  obtain ⟨_, ⟨b, b_mem, b_ne_zero, rfl⟩, min⟩ := @Int.exists_least_of_bdd
      (fun a => ∃ b ∈ (I : Ideal S), b ≠ (0 : S) ∧ abv (Algebra.norm R b) = a) _
    (by
      

Proof state:
R : Type u_1
S : Type u_2
K : Type u_3
L : Type u_4
inst✝¹⁴ : EuclideanDomain R
inst✝¹³ : CommRing S
inst✝¹² : IsDomain S
inst✝¹¹ : Field K
inst✝¹⁰ : Field L
inst✝⁹ : Algebra R K
inst✝⁸ : IsFractionRing R K
inst✝⁷ : Algebra K L
inst✝⁶ : FiniteDimensional K L
inst✝⁵ : IsSeparable K L
algRL : Algebra R L
inst✝⁴ : IsScalarTower R K L
inst✝³ : Algebra R S
inst✝² : Algebra S L
ist : IsScalarTower R S L
iic : IsIntegralClosure S R L
abv : AbsoluteValue R ℤ
ι : Type u_5
inst✝¹ : DecidableEq ι
inst✝ : Fintype ι
bS : Basis ι R S
I : ↥(Ideal S)⁰
⊢ ∃ b, ∀ (z : ℤ), (fun a => ∃ b ∈ ↑I, b ≠ 0 ∧ abv ((Algebra.norm R) b) = a) z → b ≤ z

Next tactic:
use 0
/-- A nonzero ideal has an element of minimal norm. -/
-- porting note: port of Int.exists_least_of_bdd requires DecidablePred, so we use classical
theorem exists_min (I : (Ideal S)⁰) :
    ∃ b ∈ (I : Ideal S),
      b ≠ 0 ∧ ∀ c ∈ (I : Ideal S), abv (Algebra.norm R c) < abv (Algebra.norm R b) → c =
      (0 : S) := by
  classical
  obtain ⟨_, ⟨b, b_mem, b_ne_zero, rfl⟩, min⟩ := @Int.exists_least_of_bdd
      (fun a => ∃ b ∈ (I : Ideal S), b ≠ (0 : S) ∧ abv (Algebra.norm R b) = a) _
    (by
      use 0
      

Proof state:
case h
R : Type u_1
S : Type u_2
K : Type u_3
L : Type u_4
inst✝¹⁴ : EuclideanDomain R
inst✝¹³ : CommRing S
inst✝¹² : IsDomain S
inst✝¹¹ : Field K
inst✝¹⁰ : Field L
inst✝⁹ : Algebra R K
inst✝⁸ : IsFractionRing R K
inst✝⁷ : Algebra K L
inst✝⁶ : FiniteDimensional K L
inst✝⁵ : IsSeparable K L
algRL : Algebra R L
inst✝⁴ : IsScalarTower R K L
inst✝³ : Algebra R S
inst✝² : Algebra S L
ist : IsScalarTower R S L
iic : IsIntegralClosure S R L
abv : AbsoluteValue R ℤ
ι : Type u_5
inst✝¹ : DecidableEq ι
inst✝ : Fintype ι
bS : Basis ι R S
I : ↥(Ideal S)⁰
⊢ ∀ (z : ℤ), (fun a => ∃ b ∈ ↑I, b ≠ 0 ∧ abv ((Algebra.norm R) b) = a) z → 0 ≤ z

Next tactic:
rintro _ ⟨b, _, _, rfl⟩
/-- A nonzero ideal has an element of minimal norm. -/
-- porting note: port of Int.exists_least_of_bdd requires DecidablePred, so we use classical
theorem exists_min (I : (Ideal S)⁰) :
    ∃ b ∈ (I : Ideal S),
      b ≠ 0 ∧ ∀ c ∈ (I : Ideal S), abv (Algebra.norm R c) < abv (Algebra.norm R b) → c =
      (0 : S) := by
  classical
  obtain ⟨_, ⟨b, b_mem, b_ne_zero, rfl⟩, min⟩ := @Int.exists_least_of_bdd
      (fun a => ∃ b ∈ (I : Ideal S), b ≠ (0 : S) ∧ abv (Algebra.norm R b) = a) _
    (by
      use 0
      rintro _ ⟨b, _, _, rfl⟩
      

Proof state:
case h.intro.intro.intro
R : Type u_1
S : Type u_2
K : Type u_3
L : Type u_4
inst✝¹⁴ : EuclideanDomain R
inst✝¹³ : CommRing S
inst✝¹² : IsDomain S
inst✝¹¹ : Field K
inst✝¹⁰ : Field L
inst✝⁹ : Algebra R K
inst✝⁸ : IsFractionRing R K
inst✝⁷ : Algebra K L
inst✝⁶ : FiniteDimensional K L
inst✝⁵ : IsSeparable K L
algRL : Algebra R L
inst✝⁴ : IsScalarTower R K L
inst✝³ : Algebra R S
inst✝² : Algebra S L
ist : IsScalarTower R S L
iic : IsIntegralClosure S R L
abv : AbsoluteValue R ℤ
ι : Type u_5
inst✝¹ : DecidableEq ι
inst✝ : Fintype ι
bS : Basis ι R S
I : ↥(Ideal S)⁰
b : S
left✝¹ : b ∈ ↑I
left✝ : b ≠ 0
⊢ 0 ≤ abv ((Algebra.norm R) b)

Next tactic:
apply abv.nonneg
/-- A nonzero ideal has an element of minimal norm. -/
-- porting note: port of Int.exists_least_of_bdd requires DecidablePred, so we use classical
theorem exists_min (I : (Ideal S)⁰) :
    ∃ b ∈ (I : Ideal S),
      b ≠ 0 ∧ ∀ c ∈ (I : Ideal S), abv (Algebra.norm R c) < abv (Algebra.norm R b) → c =
      (0 : S) := by
  classical
  obtain ⟨_, ⟨b, b_mem, b_ne_zero, rfl⟩, min⟩ := @Int.exists_least_of_bdd
      (fun a => ∃ b ∈ (I : Ideal S), b ≠ (0 : S) ∧ abv (Algebra.norm R b) = a) _
    (by
      use 0
      rintro _ ⟨b, _, _, rfl⟩
      apply abv.nonneg)
    (by
      

Proof state:
R : Type u_1
S : Type u_2
K : Type u_3
L : Type u_4
inst✝¹⁴ : EuclideanDomain R
inst✝¹³ : CommRing S
inst✝¹² : IsDomain S
inst✝¹¹ : Field K
inst✝¹⁰ : Field L
inst✝⁹ : Algebra R K
inst✝⁸ : IsFractionRing R K
inst✝⁷ : Algebra K L
inst✝⁶ : FiniteDimensional K L
inst✝⁵ : IsSeparable K L
algRL : Algebra R L
inst✝⁴ : IsScalarTower R K L
inst✝³ : Algebra R S
inst✝² : Algebra S L
ist : IsScalarTower R S L
iic : IsIntegralClosure S R L
abv : AbsoluteValue R ℤ
ι : Type u_5
inst✝¹ : DecidableEq ι
inst✝ : Fintype ι
bS : Basis ι R S
I : ↥(Ideal S)⁰
⊢ ∃ z, (fun a => ∃ b ∈ ↑I, b ≠ 0 ∧ abv ((Algebra.norm R) b) = a) z

Next tactic:
obtain ⟨b, b_mem, b_ne_zero⟩ := (I : Ideal S).ne_bot_iff.mp (nonZeroDivisors.coe_ne_zero I)
/-- A nonzero ideal has an element of minimal norm. -/
-- porting note: port of Int.exists_least_of_bdd requires DecidablePred, so we use classical
theorem exists_min (I : (Ideal S)⁰) :
    ∃ b ∈ (I : Ideal S),
      b ≠ 0 ∧ ∀ c ∈ (I : Ideal S), abv (Algebra.norm R c) < abv (Algebra.norm R b) → c =
      (0 : S) := by
  classical
  obtain ⟨_, ⟨b, b_mem, b_ne_zero, rfl⟩, min⟩ := @Int.exists_least_of_bdd
      (fun a => ∃ b ∈ (I : Ideal S), b ≠ (0 : S) ∧ abv (Algebra.norm R b) = a) _
    (by
      use 0
      rintro _ ⟨b, _, _, rfl⟩
      apply abv.nonneg)
    (by
      obtain ⟨b, b_mem, b_ne_zero⟩ := (I : Ideal S).ne_bot_iff.mp (nonZeroDivisors.coe_ne_zero I)
      

Proof state:
case intro.intro
R : Type u_1
S : Type u_2
K : Type u_3
L : Type u_4
inst✝¹⁴ : EuclideanDomain R
inst✝¹³ : CommRing S
inst✝¹² : IsDomain S
inst✝¹¹ : Field K
inst✝¹⁰ : Field L
inst✝⁹ : Algebra R K
inst✝⁸ : IsFractionRing R K
inst✝⁷ : Algebra K L
inst✝⁶ : FiniteDimensional K L
inst✝⁵ : IsSeparable K L
algRL : Algebra R L
inst✝⁴ : IsScalarTower R K L
inst✝³ : Algebra R S
inst✝² : Algebra S L
ist : IsScalarTower R S L
iic : IsIntegralClosure S R L
abv : AbsoluteValue R ℤ
ι : Type u_5
inst✝¹ : DecidableEq ι
inst✝ : Fintype ι
bS : Basis ι R S
I : ↥(Ideal S)⁰
b : S
b_mem : b ∈ ↑I
b_ne_zero : b ≠ 0
⊢ ∃ z, (fun a => ∃ b ∈ ↑I, b ≠ 0 ∧ abv ((Algebra.norm R) b) = a) z

Next tactic:
exact ⟨_, ⟨b, b_mem, b_ne_zero, rfl⟩⟩
/-- A nonzero ideal has an element of minimal norm. -/
-- porting note: port of Int.exists_least_of_bdd requires DecidablePred, so we use classical
theorem exists_min (I : (Ideal S)⁰) :
    ∃ b ∈ (I : Ideal S),
      b ≠ 0 ∧ ∀ c ∈ (I : Ideal S), abv (Algebra.norm R c) < abv (Algebra.norm R b) → c =
      (0 : S) := by
  classical
  obtain ⟨_, ⟨b, b_mem, b_ne_zero, rfl⟩, min⟩ := @Int.exists_least_of_bdd
      (fun a => ∃ b ∈ (I : Ideal S), b ≠ (0 : S) ∧ abv (Algebra.norm R b) = a) _
    (by
      use 0
      rintro _ ⟨b, _, _, rfl⟩
      apply abv.nonneg)
    (by
      obtain ⟨b, b_mem, b_ne_zero⟩ := (I : Ideal S).ne_bot_iff.mp (nonZeroDivisors.coe_ne_zero I)
      exact ⟨_, ⟨b, b_mem, b_ne_zero, rfl⟩⟩)
  · 

Proof state:
case intro.intro.intro.intro.intro
R : Type u_1
S : Type u_2
K : Type u_3
L : Type u_4
inst✝¹⁴ : EuclideanDomain R
inst✝¹³ : CommRing S
inst✝¹² : IsDomain S
inst✝¹¹ : Field K
inst✝¹⁰ : Field L
inst✝⁹ : Algebra R K
inst✝⁸ : IsFractionRing R K
inst✝⁷ : Algebra K L
inst✝⁶ : FiniteDimensional K L
inst✝⁵ : IsSeparable K L
algRL : Algebra R L
inst✝⁴ : IsScalarTower R K L
inst✝³ : Algebra R S
inst✝² : Algebra S L
ist : IsScalarTower R S L
iic : IsIntegralClosure S R L
abv : AbsoluteValue R ℤ
ι : Type u_5
inst✝¹ : DecidableEq ι
inst✝ : Fintype ι
bS : Basis ι R S
I : ↥(Ideal S)⁰
b : S
b_mem : b ∈ ↑I
b_ne_zero : b ≠ 0
min : ∀ (z : ℤ), (∃ b ∈ ↑I, b ≠ 0 ∧ abv ((Algebra.norm R) b) = z) → abv ((Algebra.norm R) b) ≤ z
⊢ ∃ b ∈ ↑I, b ≠ 0 ∧ ∀ c ∈ ↑I, abv ((Algebra.norm R) c) < abv ((Algebra.norm R) b) → c = 0

Next tactic:
refine' ⟨b, b_mem, b_ne_zero, _⟩
/-- A nonzero ideal has an element of minimal norm. -/
-- porting note: port of Int.exists_least_of_bdd requires DecidablePred, so we use classical
theorem exists_min (I : (Ideal S)⁰) :
    ∃ b ∈ (I : Ideal S),
      b ≠ 0 ∧ ∀ c ∈ (I : Ideal S), abv (Algebra.norm R c) < abv (Algebra.norm R b) → c =
      (0 : S) := by
  classical
  obtain ⟨_, ⟨b, b_mem, b_ne_zero, rfl⟩, min⟩ := @Int.exists_least_of_bdd
      (fun a => ∃ b ∈ (I : Ideal S), b ≠ (0 : S) ∧ abv (Algebra.norm R b) = a) _
    (by
      use 0
      rintro _ ⟨b, _, _, rfl⟩
      apply abv.nonneg)
    (by
      obtain ⟨b, b_mem, b_ne_zero⟩ := (I : Ideal S).ne_bot_iff.mp (nonZeroDivisors.coe_ne_zero I)
      exact ⟨_, ⟨b, b_mem, b_ne_zero, rfl⟩⟩)
  · refine' ⟨b, b_mem, b_ne_zero, _⟩
    

Proof state:
case intro.intro.intro.intro.intro
R : Type u_1
S : Type u_2
K : Type u_3
L : Type u_4
inst✝¹⁴ : EuclideanDomain R
inst✝¹³ : CommRing S
inst✝¹² : IsDomain S
inst✝¹¹ : Field K
inst✝¹⁰ : Field L
inst✝⁹ : Algebra R K
inst✝⁸ : IsFractionRing R K
inst✝⁷ : Algebra K L
inst✝⁶ : FiniteDimensional K L
inst✝⁵ : IsSeparable K L
algRL : Algebra R L
inst✝⁴ : IsScalarTower R K L
inst✝³ : Algebra R S
inst✝² : Algebra S L
ist : IsScalarTower R S L
iic : IsIntegralClosure S R L
abv : AbsoluteValue R ℤ
ι : Type u_5
inst✝¹ : DecidableEq ι
inst✝ : Fintype ι
bS : Basis ι R S
I : ↥(Ideal S)⁰
b : S
b_mem : b ∈ ↑I
b_ne_zero : b ≠ 0
min : ∀ (z : ℤ), (∃ b ∈ ↑I, b ≠ 0 ∧ abv ((Algebra.norm R) b) = z) → abv ((Algebra.norm R) b) ≤ z
⊢ ∀ c ∈ ↑I, abv ((Algebra.norm R) c) < abv ((Algebra.norm R) b) → c = 0

Next tactic:
intro c hc lt
/-- A nonzero ideal has an element of minimal norm. -/
-- porting note: port of Int.exists_least_of_bdd requires DecidablePred, so we use classical
theorem exists_min (I : (Ideal S)⁰) :
    ∃ b ∈ (I : Ideal S),
      b ≠ 0 ∧ ∀ c ∈ (I : Ideal S), abv (Algebra.norm R c) < abv (Algebra.norm R b) → c =
      (0 : S) := by
  classical
  obtain ⟨_, ⟨b, b_mem, b_ne_zero, rfl⟩, min⟩ := @Int.exists_least_of_bdd
      (fun a => ∃ b ∈ (I : Ideal S), b ≠ (0 : S) ∧ abv (Algebra.norm R b) = a) _
    (by
      use 0
      rintro _ ⟨b, _, _, rfl⟩
      apply abv.nonneg)
    (by
      obtain ⟨b, b_mem, b_ne_zero⟩ := (I : Ideal S).ne_bot_iff.mp (nonZeroDivisors.coe_ne_zero I)
      exact ⟨_, ⟨b, b_mem, b_ne_zero, rfl⟩⟩)
  · refine' ⟨b, b_mem, b_ne_zero, _⟩
    intro c hc lt
    

Proof state:
case intro.intro.intro.intro.intro
R : Type u_1
S : Type u_2
K : Type u_3
L : Type u_4
inst✝¹⁴ : EuclideanDomain R
inst✝¹³ : CommRing S
inst✝¹² : IsDomain S
inst✝¹¹ : Field K
inst✝¹⁰ : Field L
inst✝⁹ : Algebra R K
inst✝⁸ : IsFractionRing R K
inst✝⁷ : Algebra K L
inst✝⁶ : FiniteDimensional K L
inst✝⁵ : IsSeparable K L
algRL : Algebra R L
inst✝⁴ : IsScalarTower R K L
inst✝³ : Algebra R S
inst✝² : Algebra S L
ist : IsScalarTower R S L
iic : IsIntegralClosure S R L
abv : AbsoluteValue R ℤ
ι : Type u_5
inst✝¹ : DecidableEq ι
inst✝ : Fintype ι
bS : Basis ι R S
I : ↥(Ideal S)⁰
b : S
b_mem : b ∈ ↑I
b_ne_zero : b ≠ 0
min : ∀ (z : ℤ), (∃ b ∈ ↑I, b ≠ 0 ∧ abv ((Algebra.norm R) b) = z) → abv ((Algebra.norm R) b) ≤ z
c : S
hc : c ∈ ↑I
lt : abv ((Algebra.norm R) c) < abv ((Algebra.norm R) b)
⊢ c = 0

Next tactic:
contrapose! lt with c_ne_zero
/-- A nonzero ideal has an element of minimal norm. -/
-- porting note: port of Int.exists_least_of_bdd requires DecidablePred, so we use classical
theorem exists_min (I : (Ideal S)⁰) :
    ∃ b ∈ (I : Ideal S),
      b ≠ 0 ∧ ∀ c ∈ (I : Ideal S), abv (Algebra.norm R c) < abv (Algebra.norm R b) → c =
      (0 : S) := by
  classical
  obtain ⟨_, ⟨b, b_mem, b_ne_zero, rfl⟩, min⟩ := @Int.exists_least_of_bdd
      (fun a => ∃ b ∈ (I : Ideal S), b ≠ (0 : S) ∧ abv (Algebra.norm R b) = a) _
    (by
      use 0
      rintro _ ⟨b, _, _, rfl⟩
      apply abv.nonneg)
    (by
      obtain ⟨b, b_mem, b_ne_zero⟩ := (I : Ideal S).ne_bot_iff.mp (nonZeroDivisors.coe_ne_zero I)
      exact ⟨_, ⟨b, b_mem, b_ne_zero, rfl⟩⟩)
  · refine' ⟨b, b_mem, b_ne_zero, _⟩
    intro c hc lt
    contrapose! lt with c_ne_zero
    

Proof state:
case intro.intro.intro.intro.intro
R : Type u_1
S : Type u_2
K : Type u_3
L : Type u_4
inst✝¹⁴ : EuclideanDomain R
inst✝¹³ : CommRing S
inst✝¹² : IsDomain S
inst✝¹¹ : Field K
inst✝¹⁰ : Field L
inst✝⁹ : Algebra R K
inst✝⁸ : IsFractionRing R K
inst✝⁷ : Algebra K L
inst✝⁶ : FiniteDimensional K L
inst✝⁵ : IsSeparable K L
algRL : Algebra R L
inst✝⁴ : IsScalarTower R K L
inst✝³ : Algebra R S
inst✝² : Algebra S L
ist : IsScalarTower R S L
iic : IsIntegralClosure S R L
abv : AbsoluteValue R ℤ
ι : Type u_5
inst✝¹ : DecidableEq ι
inst✝ : Fintype ι
bS : Basis ι R S
I : ↥(Ideal S)⁰
b : S
b_mem : b ∈ ↑I
b_ne_zero : b ≠ 0
min : ∀ (z : ℤ), (∃ b ∈ ↑I, b ≠ 0 ∧ abv ((Algebra.norm R) b) = z) → abv ((Algebra.norm R) b) ≤ z
c : S
hc : c ∈ ↑I
c_ne_zero : c ≠ 0
⊢ abv ((Algebra.norm R) b) ≤ abv ((Algebra.norm R) c)

Next tactic:
exact min _ ⟨c, hc, c_ne_zero, rfl⟩
@[simp]
theorem mem_finsetApprox {x : R} :
    x ∈ finsetApprox bS adm ↔ ∃ i j, i ≠ j ∧ distinctElems bS adm i - distinctElems bS adm j =
    x := by
  

Proof state:
R : Type u_1
S : Type u_2
K : Type u_3
L : Type u_4
inst✝¹⁶ : EuclideanDomain R
inst✝¹⁵ : CommRing S
inst✝¹⁴ : IsDomain S
inst✝¹³ : Field K
inst✝¹² : Field L
inst✝¹¹ : Algebra R K
inst✝¹⁰ : IsFractionRing R K
inst✝⁹ : Algebra K L
inst✝⁸ : FiniteDimensional K L
inst✝⁷ : IsSeparable K L
algRL : Algebra R L
inst✝⁶ : IsScalarTower R K L
inst✝⁵ : Algebra R S
inst✝⁴ : Algebra S L
ist : IsScalarTower R S L
iic : IsIntegralClosure S R L
abv : AbsoluteValue R ℤ
ι : Type u_5
inst✝³ : DecidableEq ι
inst✝² : Fintype ι
bS : Basis ι R S
adm : AbsoluteValue.IsAdmissible abv
inst✝¹ : Infinite R
inst✝ : DecidableEq R
x : R
⊢ x ∈ finsetApprox bS adm ↔ ∃ i j, i ≠ j ∧ (distinctElems bS adm) i - (distinctElems bS adm) j = x

Next tactic:
simp only [finsetApprox, Finset.mem_erase, Finset.mem_image]
@[simp]
theorem mem_finsetApprox {x : R} :
    x ∈ finsetApprox bS adm ↔ ∃ i j, i ≠ j ∧ distinctElems bS adm i - distinctElems bS adm j =
    x := by
  simp only [finsetApprox, Finset.mem_erase, Finset.mem_image]
  

Proof state:
R : Type u_1
S : Type u_2
K : Type u_3
L : Type u_4
inst✝¹⁶ : EuclideanDomain R
inst✝¹⁵ : CommRing S
inst✝¹⁴ : IsDomain S
inst✝¹³ : Field K
inst✝¹² : Field L
inst✝¹¹ : Algebra R K
inst✝¹⁰ : IsFractionRing R K
inst✝⁹ : Algebra K L
inst✝⁸ : FiniteDimensional K L
inst✝⁷ : IsSeparable K L
algRL : Algebra R L
inst✝⁶ : IsScalarTower R K L
inst✝⁵ : Algebra R S
inst✝⁴ : Algebra S L
ist : IsScalarTower R S L
iic : IsIntegralClosure S R L
abv : AbsoluteValue R ℤ
ι : Type u_5
inst✝³ : DecidableEq ι
inst✝² : Fintype ι
bS : Basis ι R S
adm : AbsoluteValue.IsAdmissible abv
inst✝¹ : Infinite R
inst✝ : DecidableEq R
x : R
⊢ (x ≠ 0 ∧ ∃ a ∈ Finset.univ, (distinctElems bS adm) a.1 - (distinctElems bS adm) a.2 = x) ↔
    ∃ i j, i ≠ j ∧ (distinctElems bS adm) i - (distinctElems bS adm) j = x

Next tactic:
constructor
@[simp]
theorem mem_finsetApprox {x : R} :
    x ∈ finsetApprox bS adm ↔ ∃ i j, i ≠ j ∧ distinctElems bS adm i - distinctElems bS adm j =
    x := by
  simp only [finsetApprox, Finset.mem_erase, Finset.mem_image]
  constructor
  · 

Proof state:
case mp
R : Type u_1
S : Type u_2
K : Type u_3
L : Type u_4
inst✝¹⁶ : EuclideanDomain R
inst✝¹⁵ : CommRing S
inst✝¹⁴ : IsDomain S
inst✝¹³ : Field K
inst✝¹² : Field L
inst✝¹¹ : Algebra R K
inst✝¹⁰ : IsFractionRing R K
inst✝⁹ : Algebra K L
inst✝⁸ : FiniteDimensional K L
inst✝⁷ : IsSeparable K L
algRL : Algebra R L
inst✝⁶ : IsScalarTower R K L
inst✝⁵ : Algebra R S
inst✝⁴ : Algebra S L
ist : IsScalarTower R S L
iic : IsIntegralClosure S R L
abv : AbsoluteValue R ℤ
ι : Type u_5
inst✝³ : DecidableEq ι
inst✝² : Fintype ι
bS : Basis ι R S
adm : AbsoluteValue.IsAdmissible abv
inst✝¹ : Infinite R
inst✝ : DecidableEq R
x : R
⊢ (x ≠ 0 ∧ ∃ a ∈ Finset.univ, (distinctElems bS adm) a.1 - (distinctElems bS adm) a.2 = x) →
    ∃ i j, i ≠ j ∧ (distinctElems bS adm) i - (distinctElems bS adm) j = x

Next tactic:
rintro ⟨hx, ⟨i, j⟩, _, rfl⟩
@[simp]
theorem mem_finsetApprox {x : R} :
    x ∈ finsetApprox bS adm ↔ ∃ i j, i ≠ j ∧ distinctElems bS adm i - distinctElems bS adm j =
    x := by
  simp only [finsetApprox, Finset.mem_erase, Finset.mem_image]
  constructor
  · rintro ⟨hx, ⟨i, j⟩, _, rfl⟩
    

Proof state:
case mp.intro.intro.mk.intro
R : Type u_1
S : Type u_2
K : Type u_3
L : Type u_4
inst✝¹⁶ : EuclideanDomain R
inst✝¹⁵ : CommRing S
inst✝¹⁴ : IsDomain S
inst✝¹³ : Field K
inst✝¹² : Field L
inst✝¹¹ : Algebra R K
inst✝¹⁰ : IsFractionRing R K
inst✝⁹ : Algebra K L
inst✝⁸ : FiniteDimensional K L
inst✝⁷ : IsSeparable K L
algRL : Algebra R L
inst✝⁶ : IsScalarTower R K L
inst✝⁵ : Algebra R S
inst✝⁴ : Algebra S L
ist : IsScalarTower R S L
iic : IsIntegralClosure S R L
abv : AbsoluteValue R ℤ
ι : Type u_5
inst✝³ : DecidableEq ι
inst✝² : Fintype ι
bS : Basis ι R S
adm : AbsoluteValue.IsAdmissible abv
inst✝¹ : Infinite R
inst✝ : DecidableEq R
i j : Fin (Nat.succ (cardM bS adm))
left✝ : (i, j) ∈ Finset.univ
hx : (distinctElems bS adm) (i, j).1 - (distinctElems bS adm) (i, j).2 ≠ 0
⊢ ∃ i_1 j_1,
    i_1 ≠ j_1 ∧
      (distinctElems bS adm) i_1 - (distinctElems bS adm) j_1 =
        (distinctElems bS adm) (i, j).1 - (distinctElems bS adm) (i, j).2

Next tactic:
refine' ⟨i, j, _, rfl⟩
@[simp]
theorem mem_finsetApprox {x : R} :
    x ∈ finsetApprox bS adm ↔ ∃ i j, i ≠ j ∧ distinctElems bS adm i - distinctElems bS adm j =
    x := by
  simp only [finsetApprox, Finset.mem_erase, Finset.mem_image]
  constructor
  · rintro ⟨hx, ⟨i, j⟩, _, rfl⟩
    refine' ⟨i, j, _, rfl⟩
    

Proof state:
case mp.intro.intro.mk.intro
R : Type u_1
S : Type u_2
K : Type u_3
L : Type u_4
inst✝¹⁶ : EuclideanDomain R
inst✝¹⁵ : CommRing S
inst✝¹⁴ : IsDomain S
inst✝¹³ : Field K
inst✝¹² : Field L
inst✝¹¹ : Algebra R K
inst✝¹⁰ : IsFractionRing R K
inst✝⁹ : Algebra K L
inst✝⁸ : FiniteDimensional K L
inst✝⁷ : IsSeparable K L
algRL : Algebra R L
inst✝⁶ : IsScalarTower R K L
inst✝⁵ : Algebra R S
inst✝⁴ : Algebra S L
ist : IsScalarTower R S L
iic : IsIntegralClosure S R L
abv : AbsoluteValue R ℤ
ι : Type u_5
inst✝³ : DecidableEq ι
inst✝² : Fintype ι
bS : Basis ι R S
adm : AbsoluteValue.IsAdmissible abv
inst✝¹ : Infinite R
inst✝ : DecidableEq R
i j : Fin (Nat.succ (cardM bS adm))
left✝ : (i, j) ∈ Finset.univ
hx : (distinctElems bS adm) (i, j).1 - (distinctElems bS adm) (i, j).2 ≠ 0
⊢ i ≠ j

Next tactic:
rintro rfl