l3lab/ntp-mathlib huggingface dataset:
/-- If the `R`-integral element `a : S` has coordinates `≤ y` with respect to some basis `b`,
its norm is less than `normBound abv b * y ^ dim S`. -/
theorem norm_le (a : S) {y : ℤ} (hy : ∀ k, abv (bS.repr a k) ≤ y) :
    abv (Algebra.norm R a) ≤ normBound abv bS * y ^ Fintype.card ι := by
  conv_lhs => rw [← bS.sum_repr a]
  

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
a : S
y : ℤ
hy : ∀ (k : ι), abv ((bS.repr a) k) ≤ y
⊢ abv ((Algebra.norm R) (∑ i : ι, (bS.repr a) i • bS i)) ≤ normBound abv bS * y ^ Fintype.card ι

Next tactic:
rw [Algebra.norm_apply, ← LinearMap.det_toMatrix bS]
/-- If the `R`-integral element `a : S` has coordinates `≤ y` with respect to some basis `b`,
its norm is less than `normBound abv b * y ^ dim S`. -/
theorem norm_le (a : S) {y : ℤ} (hy : ∀ k, abv (bS.repr a k) ≤ y) :
    abv (Algebra.norm R a) ≤ normBound abv bS * y ^ Fintype.card ι := by
  conv_lhs => rw [← bS.sum_repr a]
  rw [Algebra.norm_apply, ← LinearMap.det_toMatrix bS]
  

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
a : S
y : ℤ
hy : ∀ (k : ι), abv ((bS.repr a) k) ≤ y
⊢ abv (Matrix.det ((LinearMap.toMatrix bS bS) ((Algebra.lmul R S) (∑ i : ι, (bS.repr a) i • bS i)))) ≤
    normBound abv bS * y ^ Fintype.card ι

Next tactic:
simp only [Algebra.norm_apply, AlgHom.map_sum, AlgHom.map_smul, map_sum,
    map_smul, Algebra.toMatrix_lmul_eq, normBound, smul_mul_assoc, ← mul_pow]
/-- If the `R`-integral element `a : S` has coordinates `≤ y` with respect to some basis `b`,
its norm is less than `normBound abv b * y ^ dim S`. -/
theorem norm_le (a : S) {y : ℤ} (hy : ∀ k, abv (bS.repr a k) ≤ y) :
    abv (Algebra.norm R a) ≤ normBound abv bS * y ^ Fintype.card ι := by
  conv_lhs => rw [← bS.sum_repr a]
  rw [Algebra.norm_apply, ← LinearMap.det_toMatrix bS]
  simp only [Algebra.norm_apply, AlgHom.map_sum, AlgHom.map_smul, map_sum,
    map_smul, Algebra.toMatrix_lmul_eq, normBound, smul_mul_assoc, ← mul_pow]
  

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
a : S
y : ℤ
hy : ∀ (k : ι), abv ((bS.repr a) k) ≤ y
⊢ abv (Matrix.det (∑ x : ι, (bS.repr a) x • (LinearMap.toMatrix bS bS) ((Algebra.lmul R S) (bS x)))) ≤
    Nat.factorial (Fintype.card ι) •
      (Fintype.card ι •
          (Finset.max'
              (Finset.image (fun ijk => abv ((Algebra.leftMulMatrix bS) (bS ijk.1) ijk.2.1 ijk.2.2)) Finset.univ)
              (_ :
                ∃ x,
                  x ∈
                    Finset.image (fun ijk => abv ((Algebra.leftMulMatrix bS) (bS ijk.1) ijk.2.1 ijk.2.2)) Finset.univ) *
            y)) ^
        Fintype.card ι

Next tactic:
convert Matrix.det_sum_smul_le Finset.univ _ hy using 3
/-- If the `R`-integral element `a : S` has coordinates `≤ y` with respect to some basis `b`,
its norm is less than `normBound abv b * y ^ dim S`. -/
theorem norm_le (a : S) {y : ℤ} (hy : ∀ k, abv (bS.repr a k) ≤ y) :
    abv (Algebra.norm R a) ≤ normBound abv bS * y ^ Fintype.card ι := by
  conv_lhs => rw [← bS.sum_repr a]
  rw [Algebra.norm_apply, ← LinearMap.det_toMatrix bS]
  simp only [Algebra.norm_apply, AlgHom.map_sum, AlgHom.map_smul, map_sum,
    map_smul, Algebra.toMatrix_lmul_eq, normBound, smul_mul_assoc, ← mul_pow]
  convert Matrix.det_sum_smul_le Finset.univ _ hy using 3
  · 

Proof state:
case h.e'_4.h.e'_6.h.e'_5
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
a : S
y : ℤ
hy : ∀ (k : ι), abv ((bS.repr a) k) ≤ y
⊢ Fintype.card ι •
      (Finset.max' (Finset.image (fun ijk => abv ((Algebra.leftMulMatrix bS) (bS ijk.1) ijk.2.1 ijk.2.2)) Finset.univ)
          (_ :
            ∃ x,
              x ∈ Finset.image (fun ijk => abv ((Algebra.leftMulMatrix bS) (bS ijk.1) ijk.2.1 ijk.2.2)) Finset.univ) *
        y) =
    Finset.card Finset.univ • y * ?convert_5

Next tactic:
rw [Finset.card_univ, smul_mul_assoc, mul_comm]
/-- If the `R`-integral element `a : S` has coordinates `≤ y` with respect to some basis `b`,
its norm is less than `normBound abv b * y ^ dim S`. -/
theorem norm_le (a : S) {y : ℤ} (hy : ∀ k, abv (bS.repr a k) ≤ y) :
    abv (Algebra.norm R a) ≤ normBound abv bS * y ^ Fintype.card ι := by
  conv_lhs => rw [← bS.sum_repr a]
  rw [Algebra.norm_apply, ← LinearMap.det_toMatrix bS]
  simp only [Algebra.norm_apply, AlgHom.map_sum, AlgHom.map_smul, map_sum,
    map_smul, Algebra.toMatrix_lmul_eq, normBound, smul_mul_assoc, ← mul_pow]
  convert Matrix.det_sum_smul_le Finset.univ _ hy using 3
  · rw [Finset.card_univ, smul_mul_assoc, mul_comm]
  · 

Proof state:
case convert_6
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
a : S
y : ℤ
hy : ∀ (k : ι), abv ((bS.repr a) k) ≤ y
⊢ ∀ (k i j : ι),
    abv ((LinearMap.toMatrix bS bS) ((Algebra.lmul R S) (bS k)) i j) ≤
      Finset.max' (Finset.image (fun ijk => abv ((Algebra.leftMulMatrix bS) (bS ijk.1) ijk.2.1 ijk.2.2)) Finset.univ)
        (_ : ∃ x, x ∈ Finset.image (fun ijk => abv ((Algebra.leftMulMatrix bS) (bS ijk.1) ijk.2.1 ijk.2.2)) Finset.univ)

Next tactic:
intro i j k
/-- If the `R`-integral element `a : S` has coordinates `≤ y` with respect to some basis `b`,
its norm is less than `normBound abv b * y ^ dim S`. -/
theorem norm_le (a : S) {y : ℤ} (hy : ∀ k, abv (bS.repr a k) ≤ y) :
    abv (Algebra.norm R a) ≤ normBound abv bS * y ^ Fintype.card ι := by
  conv_lhs => rw [← bS.sum_repr a]
  rw [Algebra.norm_apply, ← LinearMap.det_toMatrix bS]
  simp only [Algebra.norm_apply, AlgHom.map_sum, AlgHom.map_smul, map_sum,
    map_smul, Algebra.toMatrix_lmul_eq, normBound, smul_mul_assoc, ← mul_pow]
  convert Matrix.det_sum_smul_le Finset.univ _ hy using 3
  · rw [Finset.card_univ, smul_mul_assoc, mul_comm]
  · intro i j k
    

Proof state:
case convert_6
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
a : S
y : ℤ
hy : ∀ (k : ι), abv ((bS.repr a) k) ≤ y
i j k : ι
⊢ abv ((LinearMap.toMatrix bS bS) ((Algebra.lmul R S) (bS i)) j k) ≤
    Finset.max' (Finset.image (fun ijk => abv ((Algebra.leftMulMatrix bS) (bS ijk.1) ijk.2.1 ijk.2.2)) Finset.univ)
      (_ : ∃ x, x ∈ Finset.image (fun ijk => abv ((Algebra.leftMulMatrix bS) (bS ijk.1) ijk.2.1 ijk.2.2)) Finset.univ)

Next tactic:
apply Finset.le_max'
/-- If the `R`-integral element `a : S` has coordinates `≤ y` with respect to some basis `b`,
its norm is less than `normBound abv b * y ^ dim S`. -/
theorem norm_le (a : S) {y : ℤ} (hy : ∀ k, abv (bS.repr a k) ≤ y) :
    abv (Algebra.norm R a) ≤ normBound abv bS * y ^ Fintype.card ι := by
  conv_lhs => rw [← bS.sum_repr a]
  rw [Algebra.norm_apply, ← LinearMap.det_toMatrix bS]
  simp only [Algebra.norm_apply, AlgHom.map_sum, AlgHom.map_smul, map_sum,
    map_smul, Algebra.toMatrix_lmul_eq, normBound, smul_mul_assoc, ← mul_pow]
  convert Matrix.det_sum_smul_le Finset.univ _ hy using 3
  · rw [Finset.card_univ, smul_mul_assoc, mul_comm]
  · intro i j k
    apply Finset.le_max'
    

Proof state:
case convert_6.H2
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
a : S
y : ℤ
hy : ∀ (k : ι), abv ((bS.repr a) k) ≤ y
i j k : ι
⊢ abv ((LinearMap.toMatrix bS bS) ((Algebra.lmul R S) (bS i)) j k) ∈
    Finset.image (fun ijk => abv ((Algebra.leftMulMatrix bS) (bS ijk.1) ijk.2.1 ijk.2.2)) Finset.univ

Next tactic:
exact Finset.mem_image.mpr ⟨⟨i, j, k⟩, Finset.mem_univ _, rfl⟩
/-- 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
  

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
T : Type u_6
inst✝ : LinearOrderedRing T
a : S
y : T
hy : ∀ (k : ι), ↑(abv ((bS.repr a) k)) < y
⊢ ↑(abv ((Algebra.norm R) a)) < ↑(normBound abv bS) * y ^ Fintype.card ι

Next tactic:
obtain ⟨i⟩ := bS.index_nonempty
/-- 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
  

Proof state:
case 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
T : Type u_6
inst✝ : LinearOrderedRing T
a : S
y : T
hy : ∀ (k : ι), ↑(abv ((bS.repr a) k)) < y
i : ι
⊢ ↑(abv ((Algebra.norm R) a)) < ↑(normBound abv bS) * y ^ Fintype.card ι

Next tactic:
have him : (Finset.univ.image fun k => abv (bS.repr a k)).Nonempty :=
    ⟨_, Finset.mem_image.mpr ⟨i, Finset.mem_univ _, rfl⟩⟩
/-- 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⟩⟩
  

Proof state:
case 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
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)
⊢ ↑(abv ((Algebra.norm R) a)) < ↑(normBound abv bS) * y ^ Fintype.card ι

Next tactic:
set y' : ℤ := Finset.max' _ him with y'_def
/-- 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
  

Proof state:
case 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
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
⊢ ↑(abv ((Algebra.norm R) a)) < ↑(normBound abv bS) * y ^ Fintype.card ι

Next tactic:
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⟩)
/-- 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
    

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
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
⊢ ∀ (k : ι), abv ((bS.repr a) k) ≤ y'

Next tactic:
intro k
/-- 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
    

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
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
k : ι
⊢ abv ((bS.repr a) k) ≤ y'

Next tactic:
exact @Finset.le_max' ℤ _ _ _ (Finset.mem_image.mpr ⟨k, Finset.mem_univ _, rfl⟩)
/-- 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⟩)
  

Proof state:
case 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
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'
⊢ ↑(abv ((Algebra.norm R) a)) < ↑(normBound abv bS) * y ^ Fintype.card ι

Next tactic:
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
/-- 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
    

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
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'
⊢ ↑y' < y

Next tactic:
rw [y'_def, ←
      Finset.max'_image (show Monotone (_ : ℤ → T) from fun x y h => Int.cast_le.mpr h)]