-- Mathlib/NumberTheory/ClassNumber/Finite.lean
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 ι

Proof state:
case intro
R : Type u_1
S : Type u_2
inst✝⁶ : EuclideanDomain R
inst✝⁵ : CommRing S
inst✝⁴ : IsDomain S
inst✝³ : Algebra R S
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.image (fun k => abv ((bS.repr a) k)) Finset.univ).Nonempty
⊢ ↑(abv ((Algebra.norm R) a)) < ↑(normBound abv bS) * y ^ Fintype.card ι

Tactic:
set y' : ℤ := Finset.max' _ him with y'_def

Result:
case intro
R : Type u_1
S : Type u_2
inst✝⁶ : EuclideanDomain R
inst✝⁵ : CommRing S
inst✝⁴ : IsDomain S
inst✝³ : Algebra R S
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.image (fun k => abv ((bS.repr a) k)) Finset.univ).Nonempty
y' : ℤ := (Finset.image (fun k => abv ((bS.repr a) k)) Finset.univ).max' him
y'_def : y' = (Finset.image (fun k => abv ((bS.repr a) k)) Finset.univ).max' him
⊢ ↑(abv ((Algebra.norm R) a)) < ↑(normBound abv bS) * y ^ Fintype.card ι

Proof state:
R : Type u_1
S : Type u_2
inst✝⁶ : EuclideanDomain R
inst✝⁵ : CommRing S
inst✝⁴ : IsDomain S
inst✝³ : Algebra R S
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.image (fun k => abv ((bS.repr a) k)) Finset.univ).Nonempty
y' : ℤ := (Finset.image (fun k => abv ((bS.repr a) k)) Finset.univ).max' him
y'_def : y' = (Finset.image (fun k => abv ((bS.repr a) k)) Finset.univ).max' him
hy' : ∀ (k : ι), abv ((bS.repr a) k) ≤ y'
⊢ (Finset.image (fun x => ↑x) (Finset.image (fun k => abv ((bS.repr a) k)) Finset.univ)).max' ?h < y

case h
R : Type u_1
S : Type u_2
inst✝⁶ : EuclideanDomain R
inst✝⁵ : CommRing S
inst✝⁴ : IsDomain S
inst✝³ : Algebra R S
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.image (fun k => abv ((bS.repr a) k)) Finset.univ).Nonempty
y' : ℤ := (Finset.image (fun k => abv ((bS.repr a) k)) Finset.univ).max' him
y'_def : y' = (Finset.image (fun k => abv ((bS.repr a) k)) Finset.univ).max' him
hy' : ∀ (k : ι), abv ((bS.repr a) k) ≤ y'
⊢ (Finset.image (fun x => ↑x) (Finset.image (fun k => abv ((bS.repr a) k)) Finset.univ)).Nonempty

Tactic:
apply (Finset.max'_lt_iff _ (him.image _)).mpr

Result:
R : Type u_1
S : Type u_2
inst✝⁶ : EuclideanDomain R
inst✝⁵ : CommRing S
inst✝⁴ : IsDomain S
inst✝³ : Algebra R S
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.image (fun k => abv ((bS.repr a) k)) Finset.univ).Nonempty
y' : ℤ := (Finset.image (fun k => abv ((bS.repr a) k)) Finset.univ).max' him
y'_def : y' = (Finset.image (fun k => abv ((bS.repr a) k)) Finset.univ).max' him
hy' : ∀ (k : ι), abv ((bS.repr a) k) ≤ y'
⊢ ∀ y_1 ∈ Finset.image (fun x => ↑x) (Finset.image (fun k => abv ((bS.repr a) k)) Finset.univ), y_1 < y

Proof state:
case intro
R : Type u_1
S : Type u_2
inst✝⁶ : EuclideanDomain R
inst✝⁵ : CommRing S
inst✝⁴ : IsDomain S
inst✝³ : Algebra R S
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.image (fun k => abv ((bS.repr a) k)) Finset.univ).Nonempty
y' : ℤ := (Finset.image (fun k => abv ((bS.repr a) k)) Finset.univ).max' him
y'_def : y' = (Finset.image (fun k => abv ((bS.repr a) k)) Finset.univ).max' him
⊢ ↑(abv ((Algebra.norm R) a)) < ↑(normBound abv bS) * y ^ Fintype.card ι

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⟩)

Result:
case intro
R : Type u_1
S : Type u_2
inst✝⁶ : EuclideanDomain R
inst✝⁵ : CommRing S
inst✝⁴ : IsDomain S
inst✝³ : Algebra R S
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.image (fun k => abv ((bS.repr a) k)) Finset.univ).Nonempty
y' : ℤ := (Finset.image (fun k => abv ((bS.repr a) k)) Finset.univ).max' him
y'_def : y' = (Finset.image (fun k => abv ((bS.repr a) k)) Finset.univ).max' him
hy' : ∀ (k : ι), abv ((bS.repr a) k) ≤ y'
⊢ ↑(abv ((Algebra.norm R) a)) < ↑(normBound abv bS) * y ^ Fintype.card ι

Proof state:
case intro.c0
R : Type u_1
S : Type u_2
inst✝⁶ : EuclideanDomain R
inst✝⁵ : CommRing S
inst✝⁴ : IsDomain S
inst✝³ : Algebra R S
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.image (fun k => abv ((bS.repr a) k)) Finset.univ).Nonempty
y' : ℤ := (Finset.image (fun k => abv ((bS.repr a) k)) Finset.univ).max' him
y'_def : y' = (Finset.image (fun k => abv ((bS.repr a) k)) Finset.univ).max' him
hy' : ∀ (k : ι), abv ((bS.repr a) k) ≤ y'
this : ↑y' < y
y'_nonneg : 0 ≤ y'
⊢ 0 ≤ ↑y' ^ Fintype.card ι

Tactic:
exact pow_nonneg (Int.cast_nonneg.mpr y'_nonneg) _

Result:
no goals

Proof state:
case intro.intro.intro.intro
R : Type u_1
S : Type u_2
inst✝⁶ : EuclideanDomain R
inst✝⁵ : CommRing S
inst✝⁴ : IsDomain S
inst✝³ : Algebra R S
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.image (fun k => abv ((bS.repr a) k)) Finset.univ).Nonempty
y' : ℤ := (Finset.image (fun k => abv ((bS.repr a) k)) Finset.univ).max' him
y'_def : y' = (Finset.image (fun k => abv ((bS.repr a) k)) Finset.univ).max' him
hy' : ∀ (k : ι), abv ((bS.repr a) k) ≤ y'
k : ι
⊢ ↑(abv ((bS.repr a) k)) < y

Tactic:
exact hy k

Result:
no goals

Proof state:
R : Type u_1
S : Type u_2
inst✝⁶ : EuclideanDomain R
inst✝⁵ : CommRing S
inst✝⁴ : IsDomain S
inst✝³ : Algebra R S
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.image (fun k => abv ((bS.repr a) k)) Finset.univ).Nonempty
y' : ℤ := (Finset.image (fun k => abv ((bS.repr a) k)) Finset.univ).max' him
y'_def : y' = (Finset.image (fun k => abv ((bS.repr a) k)) Finset.univ).max' him
k : ι
⊢ abv ((bS.repr a) k) ≤ y'

Tactic:
exact @Finset.le_max' ℤ _ _ _ (Finset.mem_image.mpr ⟨k, Finset.mem_univ _, rfl⟩)

Result:
no goals