Theorem: Liouville.frequently_exists_num
File: Mathlib/NumberTheory/Liouville/LiouvilleWith.lean

tactic: refine Classical.not_not.1 fun H => ?_
state_before: x : ℝ
hx : Liouville x
n : ℕ
⊢ ∃ᶠ (b : ℕ) in atTop, ∃ a, x ≠ ↑a / ↑b ∧ abs (x - ↑a / ↑b) < 1 / ↑b ^ n

tactic: simp only [Liouville, not_forall, not_exists, not_frequently, not_and, not_lt,
  eventually_atTop] at H
state_before: x : ℝ
hx : Liouville x
n : ℕ
H : ¬∃ᶠ (b : ℕ) in atTop, ∃ a, x ≠ ↑a / ↑b ∧ abs (x - ↑a / ↑b) < 1 / ↑b ^ n
⊢ False

tactic: rcases H with ⟨N, hN⟩
state_before: x : ℝ
hx : Liouville x
n : ℕ
H : ∃ a, ∀ (b : ℕ), b ≥ a → ∀ (x_1 : ℤ), x ≠ ↑x_1 / ↑b → 1 / ↑b ^ n ≤ abs (x - ↑x_1 / ↑b)
⊢ False

tactic: have : ∀ b > (1 : ℕ), ∀ᶠ m : ℕ in atTop, ∀ a : ℤ, 1 / (b : ℝ) ^ m ≤ |x - a / b| := by
  intro b hb
  replace hb : (1 : ℝ) < b := Nat.one_lt_cast.2 hb
  have H : Tendsto (fun m => 1 / (b : ℝ) ^ m : ℕ → ℝ) atTop (𝓝 0) := by
    simp only [one_div]
    exact tendsto_inv_atTop_zero.comp (tendsto_pow_atTop_atTop_of_one_lt hb)
  refine (H.eventually (hx.irrational.eventually_forall_le_dist_cast_div b)).mono ?_
  exact fun m hm a => hm a
state_before: case intro
x : ℝ
hx : Liouville x
n N : ℕ
hN : ∀ (b : ℕ), b ≥ N → ∀ (x_1 : ℤ), x ≠ ↑x_1 / ↑b → 1 / ↑b ^ n ≤ abs (x - ↑x_1 / ↑b)
⊢ False

tactic: have : ∀ᶠ m : ℕ in atTop, ∀ b < N, 1 < b → ∀ a : ℤ, 1 / (b : ℝ) ^ m ≤ |x - a / b| :=
  (finite_lt_nat N).eventually_all.2 fun b _hb => eventually_imp_distrib_left.2 (this b)
state_before: case intro
x : ℝ
hx : Liouville x
n N : ℕ
hN : ∀ (b : ℕ), b ≥ N → ∀ (x_1 : ℤ), x ≠ ↑x_1 / ↑b → 1 / ↑b ^ n ≤ abs (x - ↑x_1 / ↑b)
this : ∀ (b : ℕ), b > 1 → ∀ᶠ (m : ℕ) in atTop, ∀ (a : ℤ), 1 / ↑b ^ m ≤ abs (x - ↑a / ↑b)
⊢ False

tactic: rcases(this.and (eventually_ge_atTop n)).exists with ⟨m, hm, hnm⟩
state_before: case intro
x : ℝ
hx : Liouville x
n N : ℕ
hN : ∀ (b : ℕ), b ≥ N → ∀ (x_1 : ℤ), x ≠ ↑x_1 / ↑b → 1 / ↑b ^ n ≤ abs (x - ↑x_1 / ↑b)
this✝ : ∀ (b : ℕ), b > 1 → ∀ᶠ (m : ℕ) in atTop, ∀ (a : ℤ), 1 / ↑b ^ m ≤ abs (x - ↑a / ↑b)
this : ∀ᶠ (m : ℕ) in atTop, ∀ (b : ℕ), b < N → 1 < b → ∀ (a : ℤ), 1 / ↑b ^ m ≤ abs (x - ↑a / ↑b)
⊢ False

tactic: rcases hx m with ⟨a, b, hb, hne, hlt⟩
state_before: case intro.intro.intro
x : ℝ
hx : Liouville x
n N : ℕ
hN : ∀ (b : ℕ), b ≥ N → ∀ (x_1 : ℤ), x ≠ ↑x_1 / ↑b → 1 / ↑b ^ n ≤ abs (x - ↑x_1 / ↑b)
this✝ : ∀ (b : ℕ), b > 1 → ∀ᶠ (m : ℕ) in atTop, ∀ (a : ℤ), 1 / ↑b ^ m ≤ abs (x - ↑a / ↑b)
this : ∀ᶠ (m : ℕ) in atTop, ∀ (b : ℕ), b < N → 1 < b → ∀ (a : ℤ), 1 / ↑b ^ m ≤ abs (x - ↑a / ↑b)
m : ℕ
hm : ∀ (b : ℕ), b < N → 1 < b → ∀ (a : ℤ), 1 / ↑b ^ m ≤ abs (x - ↑a / ↑b)
hnm : n ≤ m
⊢ False

tactic: lift b to ℕ using zero_le_one.trans hb.le
state_before: case intro.intro.intro.intro.intro.intro.intro
x : ℝ
hx : Liouville x
n N : ℕ
hN : ∀ (b : ℕ), b ≥ N → ∀ (x_1 : ℤ), x ≠ ↑x_1 / ↑b → 1 / ↑b ^ n ≤ abs (x - ↑x_1 / ↑b)
this✝ : ∀ (b : ℕ), b > 1 → ∀ᶠ (m : ℕ) in atTop, ∀ (a : ℤ), 1 / ↑b ^ m ≤ abs (x - ↑a / ↑b)
this : ∀ᶠ (m : ℕ) in atTop, ∀ (b : ℕ), b < N → 1 < b → ∀ (a : ℤ), 1 / ↑b ^ m ≤ abs (x - ↑a / ↑b)
m : ℕ
hm : ∀ (b : ℕ), b < N → 1 < b → ∀ (a : ℤ), 1 / ↑b ^ m ≤ abs (x - ↑a / ↑b)
hnm : n ≤ m
a b : ℤ
hb : 1 < b
hne : x ≠ ↑a / ↑b
hlt : abs (x - ↑a / ↑b) < 1 / ↑b ^ m
⊢ False

tactic: norm_cast  at hb
state_before: case intro.intro.intro.intro.intro.intro.intro.intro
x : ℝ
hx : Liouville x
n N : ℕ
hN : ∀ (b : ℕ), b ≥ N → ∀ (x_1 : ℤ), x ≠ ↑x_1 / ↑b → 1 / ↑b ^ n ≤ abs (x - ↑x_1 / ↑b)
this✝ : ∀ (b : ℕ), b > 1 → ∀ᶠ (m : ℕ) in atTop, ∀ (a : ℤ), 1 / ↑b ^ m ≤ abs (x - ↑a / ↑b)
this : ∀ᶠ (m : ℕ) in atTop, ∀ (b : ℕ), b < N → 1 < b → ∀ (a : ℤ), 1 / ↑b ^ m ≤ abs (x - ↑a / ↑b)
m : ℕ
hm : ∀ (b : ℕ), b < N → 1 < b → ∀ (a : ℤ), 1 / ↑b ^ m ≤ abs (x - ↑a / ↑b)
hnm : n ≤ m
a : ℤ
b : ℕ
hb : 1 < ↑b
hne : x ≠ ↑a / ↑↑b
hlt : abs (x - ↑a / ↑↑b) < 1 / ↑↑b ^ m
⊢ False

tactic: push_cast at hne hlt
state_before: case intro.intro.intro.intro.intro.intro.intro.intro
x : ℝ
hx : Liouville x
n N : ℕ
hN : ∀ (b : ℕ), b ≥ N → ∀ (x_1 : ℤ), x ≠ ↑x_1 / ↑b → 1 / ↑b ^ n ≤ abs (x - ↑x_1 / ↑b)
this✝ : ∀ (b : ℕ), b > 1 → ∀ᶠ (m : ℕ) in atTop, ∀ (a : ℤ), 1 / ↑b ^ m ≤ abs (x - ↑a / ↑b)
this : ∀ᶠ (m : ℕ) in atTop, ∀ (b : ℕ), b < N → 1 < b → ∀ (a : ℤ), 1 / ↑b ^ m ≤ abs (x - ↑a / ↑b)
m : ℕ
hm : ∀ (b : ℕ), b < N → 1 < b → ∀ (a : ℤ), 1 / ↑b ^ m ≤ abs (x - ↑a / ↑b)
hnm : n ≤ m
a : ℤ
b : ℕ
hne : x ≠ ↑a / ↑↑b
hlt : abs (x - ↑a / ↑↑b) < 1 / ↑↑b ^ m
hb : 1 < b
⊢ False

tactic: cases' le_or_lt N b with h h
state_before: case intro.intro.intro.intro.intro.intro.intro.intro
x : ℝ
hx : Liouville x
n N : ℕ
hN : ∀ (b : ℕ), b ≥ N → ∀ (x_1 : ℤ), x ≠ ↑x_1 / ↑b → 1 / ↑b ^ n ≤ abs (x - ↑x_1 / ↑b)
this✝ : ∀ (b : ℕ), b > 1 → ∀ᶠ (m : ℕ) in atTop, ∀ (a : ℤ), 1 / ↑b ^ m ≤ abs (x - ↑a / ↑b)
this : ∀ᶠ (m : ℕ) in atTop, ∀ (b : ℕ), b < N → 1 < b → ∀ (a : ℤ), 1 / ↑b ^ m ≤ abs (x - ↑a / ↑b)
m : ℕ
hm : ∀ (b : ℕ), b < N → 1 < b → ∀ (a : ℤ), 1 / ↑b ^ m ≤ abs (x - ↑a / ↑b)
hnm : n ≤ m
a : ℤ
b : ℕ
hb : 1 < b
hne : x ≠ ↑a / ↑b
hlt : abs (x - ↑a / ↑b) < 1 / ↑b ^ m
⊢ False

tactic: intro b hb
state_before: x : ℝ
hx : Liouville x
n N : ℕ
hN : ∀ (b : ℕ), b ≥ N → ∀ (x_1 : ℤ), x ≠ ↑x_1 / ↑b → 1 / ↑b ^ n ≤ abs (x - ↑x_1 / ↑b)
⊢ ∀ (b : ℕ), b > 1 → ∀ᶠ (m : ℕ) in atTop, ∀ (a : ℤ), 1 / ↑b ^ m ≤ abs (x - ↑a / ↑b)

tactic: replace hb : (1 : ℝ) < b := Nat.one_lt_cast.2 hb
state_before: x : ℝ
hx : Liouville x
n N : ℕ
hN : ∀ (b : ℕ), b ≥ N → ∀ (x_1 : ℤ), x ≠ ↑x_1 / ↑b → 1 / ↑b ^ n ≤ abs (x - ↑x_1 / ↑b)
b : ℕ
hb : b > 1
⊢ ∀ᶠ (m : ℕ) in atTop, ∀ (a : ℤ), 1 / ↑b ^ m ≤ abs (x - ↑a / ↑b)

tactic: have H : Tendsto (fun m => 1 / (b : ℝ) ^ m : ℕ → ℝ) atTop (𝓝 0) := by
  simp only [one_div]
  exact tendsto_inv_atTop_zero.comp (tendsto_pow_atTop_atTop_of_one_lt hb)
state_before: x : ℝ
hx : Liouville x
n N : ℕ
hN : ∀ (b : ℕ), b ≥ N → ∀ (x_1 : ℤ), x ≠ ↑x_1 / ↑b → 1 / ↑b ^ n ≤ abs (x - ↑x_1 / ↑b)
b : ℕ
hb : 1 < ↑b
⊢ ∀ᶠ (m : ℕ) in atTop, ∀ (a : ℤ), 1 / ↑b ^ m ≤ abs (x - ↑a / ↑b)

tactic: refine (H.eventually (hx.irrational.eventually_forall_le_dist_cast_div b)).mono ?_
state_before: x : ℝ
hx : Liouville x
n N : ℕ
hN : ∀ (b : ℕ), b ≥ N → ∀ (x_1 : ℤ), x ≠ ↑x_1 / ↑b → 1 / ↑b ^ n ≤ abs (x - ↑x_1 / ↑b)
b : ℕ
hb : 1 < ↑b
H : Tendsto (fun m => 1 / ↑b ^ m) atTop (𝓝 0)
⊢ ∀ᶠ (m : ℕ) in atTop, ∀ (a : ℤ), 1 / ↑b ^ m ≤ abs (x - ↑a / ↑b)

tactic: exact fun m hm a => hm a
state_before: x : ℝ
hx : Liouville x
n N : ℕ
hN : ∀ (b : ℕ), b ≥ N → ∀ (x_1 : ℤ), x ≠ ↑x_1 / ↑b → 1 / ↑b ^ n ≤ abs (x - ↑x_1 / ↑b)
b : ℕ
hb : 1 < ↑b
H : Tendsto (fun m => 1 / ↑b ^ m) atTop (𝓝 0)
⊢ ∀ (x_1 : ℕ), (∀ (m : ℤ), 1 / ↑b ^ x_1 ≤ dist x (↑m / ↑b)) → ∀ (a : ℤ), 1 / ↑b ^ x_1 ≤ abs (x - ↑a / ↑b)

tactic: simp only [one_div]
state_before: x : ℝ
hx : Liouville x
n N : ℕ
hN : ∀ (b : ℕ), b ≥ N → ∀ (x_1 : ℤ), x ≠ ↑x_1 / ↑b → 1 / ↑b ^ n ≤ abs (x - ↑x_1 / ↑b)
b : ℕ
hb : 1 < ↑b
⊢ Tendsto (fun m => 1 / ↑b ^ m) atTop (𝓝 0)

tactic: exact tendsto_inv_atTop_zero.comp (tendsto_pow_atTop_atTop_of_one_lt hb)
state_before: x : ℝ
hx : Liouville x
n N : ℕ
hN : ∀ (b : ℕ), b ≥ N → ∀ (x_1 : ℤ), x ≠ ↑x_1 / ↑b → 1 / ↑b ^ n ≤ abs (x - ↑x_1 / ↑b)
b : ℕ
hb : 1 < ↑b
⊢ Tendsto (fun m => (↑b ^ m)⁻¹) atTop (𝓝 0)

tactic: refine' (hN b h a hne).not_lt (hlt.trans_le _)
state_before: case intro.intro.intro.intro.intro.intro.intro.intro.inl
x : ℝ
hx : Liouville x
n N : ℕ
hN : ∀ (b : ℕ), b ≥ N → ∀ (x_1 : ℤ), x ≠ ↑x_1 / ↑b → 1 / ↑b ^ n ≤ abs (x - ↑x_1 / ↑b)
this✝ : ∀ (b : ℕ), b > 1 → ∀ᶠ (m : ℕ) in atTop, ∀ (a : ℤ), 1 / ↑b ^ m ≤ abs (x - ↑a / ↑b)
this : ∀ᶠ (m : ℕ) in atTop, ∀ (b : ℕ), b < N → 1 < b → ∀ (a : ℤ), 1 / ↑b ^ m ≤ abs (x - ↑a / ↑b)
m : ℕ
hm : ∀ (b : ℕ), b < N → 1 < b → ∀ (a : ℤ), 1 / ↑b ^ m ≤ abs (x - ↑a / ↑b)
hnm : n ≤ m
a : ℤ
b : ℕ
hb : 1 < b
hne : x ≠ ↑a / ↑b
hlt : abs (x - ↑a / ↑b) < 1 / ↑b ^ m
h : N ≤ b
⊢ False

tactic: replace hb : (1 : ℝ) < b := Nat.one_lt_cast.2 hb
state_before: case intro.intro.intro.intro.intro.intro.intro.intro.inl
x : ℝ
hx : Liouville x
n N : ℕ
hN : ∀ (b : ℕ), b ≥ N → ∀ (x_1 : ℤ), x ≠ ↑x_1 / ↑b → 1 / ↑b ^ n ≤ abs (x - ↑x_1 / ↑b)
this✝ : ∀ (b : ℕ), b > 1 → ∀ᶠ (m : ℕ) in atTop, ∀ (a : ℤ), 1 / ↑b ^ m ≤ abs (x - ↑a / ↑b)
this : ∀ᶠ (m : ℕ) in atTop, ∀ (b : ℕ), b < N → 1 < b → ∀ (a : ℤ), 1 / ↑b ^ m ≤ abs (x - ↑a / ↑b)
m : ℕ
hm : ∀ (b : ℕ), b < N → 1 < b → ∀ (a : ℤ), 1 / ↑b ^ m ≤ abs (x - ↑a / ↑b)
hnm : n ≤ m
a : ℤ
b : ℕ
hb : 1 < b
hne : x ≠ ↑a / ↑b
hlt : abs (x - ↑a / ↑b) < 1 / ↑b ^ m
h : N ≤ b
⊢ 1 / ↑b ^ m ≤ 1 / ↑b ^ n

tactic: have hb0 : (0 : ℝ) < b := zero_lt_one.trans hb
state_before: case intro.intro.intro.intro.intro.intro.intro.intro.inl
x : ℝ
hx : Liouville x
n N : ℕ
hN : ∀ (b : ℕ), b ≥ N → ∀ (x_1 : ℤ), x ≠ ↑x_1 / ↑b → 1 / ↑b ^ n ≤ abs (x - ↑x_1 / ↑b)
this✝ : ∀ (b : ℕ), b > 1 → ∀ᶠ (m : ℕ) in atTop, ∀ (a : ℤ), 1 / ↑b ^ m ≤ abs (x - ↑a / ↑b)
this : ∀ᶠ (m : ℕ) in atTop, ∀ (b : ℕ), b < N → 1 < b → ∀ (a : ℤ), 1 / ↑b ^ m ≤ abs (x - ↑a / ↑b)
m : ℕ
hm : ∀ (b : ℕ), b < N → 1 < b → ∀ (a : ℤ), 1 / ↑b ^ m ≤ abs (x - ↑a / ↑b)
hnm : n ≤ m
a : ℤ
b : ℕ
hne : x ≠ ↑a / ↑b
hlt : abs (x - ↑a / ↑b) < 1 / ↑b ^ m
h : N ≤ b
hb : 1 < ↑b
⊢ 1 / ↑b ^ m ≤ 1 / ↑b ^ n

tactic: exact one_div_le_one_div_of_le (pow_pos hb0 _) (pow_le_pow hb.le hnm)
state_before: case intro.intro.intro.intro.intro.intro.intro.intro.inl
x : ℝ
hx : Liouville x
n N : ℕ
hN : ∀ (b : ℕ), b ≥ N → ∀ (x_1 : ℤ), x ≠ ↑x_1 / ↑b → 1 / ↑b ^ n ≤ abs (x - ↑x_1 / ↑b)
this✝ : ∀ (b : ℕ), b > 1 → ∀ᶠ (m : ℕ) in atTop, ∀ (a : ℤ), 1 / ↑b ^ m ≤ abs (x - ↑a / ↑b)
this : ∀ᶠ (m : ℕ) in atTop, ∀ (b : ℕ), b < N → 1 < b → ∀ (a : ℤ), 1 / ↑b ^ m ≤ abs (x - ↑a / ↑b)
m : ℕ
hm : ∀ (b : ℕ), b < N → 1 < b → ∀ (a : ℤ), 1 / ↑b ^ m ≤ abs (x - ↑a / ↑b)
hnm : n ≤ m
a : ℤ
b : ℕ
hne : x ≠ ↑a / ↑b
hlt : abs (x - ↑a / ↑b) < 1 / ↑b ^ m
h : N ≤ b
hb : 1 < ↑b
hb0 : 0 < ↑b
⊢ 1 / ↑b ^ m ≤ 1 / ↑b ^ n

tactic: exact (hm b h hb _).not_lt hlt
state_before: case intro.intro.intro.intro.intro.intro.intro.intro.inr
x : ℝ
hx : Liouville x
n N : ℕ
hN : ∀ (b : ℕ), b ≥ N → ∀ (x_1 : ℤ), x ≠ ↑x_1 / ↑b → 1 / ↑b ^ n ≤ abs (x - ↑x_1 / ↑b)
this✝ : ∀ (b : ℕ), b > 1 → ∀ᶠ (m : ℕ) in atTop, ∀ (a : ℤ), 1 / ↑b ^ m ≤ abs (x - ↑a / ↑b)
this : ∀ᶠ (m : ℕ) in atTop, ∀ (b : ℕ), b < N → 1 < b → ∀ (a : ℤ), 1 / ↑b ^ m ≤ abs (x - ↑a / ↑b)
m : ℕ
hm : ∀ (b : ℕ), b < N → 1 < b → ∀ (a : ℤ), 1 / ↑b ^ m ≤ abs (x - ↑a / ↑b)
hnm : n ≤ m
a : ℤ
b : ℕ
hb : 1 < b
hne : x ≠ ↑a / ↑b
hlt : abs (x - ↑a / ↑b) < 1 / ↑b ^ m
h : b < N
⊢ False