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

tactic: use 2
state_before: x : ℝ
⊢ LiouvilleWith 1 x
state_after: case h
x : ℝ
⊢ ∃ᶠ (n : ℕ) in atTop, ∃ m, x ≠ ↑m / ↑n ∧ |x - ↑m / ↑n| < 2 / ↑n ^ 1

tactic: refine ((eventually_gt_atTop 0).mono fun n hn => ?_).frequently
state_before: case h
x : ℝ
⊢ ∃ᶠ (n : ℕ) in atTop, ∃ m, x ≠ ↑m / ↑n ∧ |x - ↑m / ↑n| < 2 / ↑n ^ 1
state_after: case h
x : ℝ
n : ℕ
hn : 0 < n
⊢ ∃ m, x ≠ ↑m / ↑n ∧ |x - ↑m / ↑n| < 2 / ↑n ^ 1

tactic: have hn' : (0 : ℝ) < n := by simpa
state_before: case h
x : ℝ
n : ℕ
hn : 0 < n
⊢ ∃ m, x ≠ ↑m / ↑n ∧ |x - ↑m / ↑n| < 2 / ↑n ^ 1
state_after: case h
x : ℝ
n : ℕ
hn : 0 < n
hn' : 0 < ↑n
⊢ ∃ m, x ≠ ↑m / ↑n ∧ |x - ↑m / ↑n| < 2 / ↑n ^ 1

tactic: have : x < ↑(⌊x * ↑n⌋ + 1) / ↑n := by
  rw [lt_div_iff hn', Int.cast_add, Int.cast_one];
  exact Int.lt_floor_add_one _
state_before: case h
x : ℝ
n : ℕ
hn : 0 < n
hn' : 0 < ↑n
⊢ ∃ m, x ≠ ↑m / ↑n ∧ |x - ↑m / ↑n| < 2 / ↑n ^ 1
state_after: case h
x : ℝ
n : ℕ
hn : 0 < n
hn' : 0 < ↑n
this : x < ↑(⌊x * ↑n⌋ + 1) / ↑n
⊢ ∃ m, x ≠ ↑m / ↑n ∧ |x - ↑m / ↑n| < 2 / ↑n ^ 1

tactic: refine ⟨⌊x * n⌋ + 1, this.ne, ?_⟩
state_before: case h
x : ℝ
n : ℕ
hn : 0 < n
hn' : 0 < ↑n
this : x < ↑(⌊x * ↑n⌋ + 1) / ↑n
⊢ ∃ m, x ≠ ↑m / ↑n ∧ |x - ↑m / ↑n| < 2 / ↑n ^ 1
state_after: case h
x : ℝ
n : ℕ
hn : 0 < n
hn' : 0 < ↑n
this : x < ↑(⌊x * ↑n⌋ + 1) / ↑n
⊢ |x - ↑(⌊x * ↑n⌋ + 1) / ↑n| < 2 / ↑n ^ 1

tactic: rw [abs_sub_comm, abs_of_pos (sub_pos.2 this), rpow_one, sub_lt_iff_lt_add',
  add_div_eq_mul_add_div _ _ hn'.ne']
state_before: case h
x : ℝ
n : ℕ
hn : 0 < n
hn' : 0 < ↑n
this : x < ↑(⌊x * ↑n⌋ + 1) / ↑n
⊢ |x - ↑(⌊x * ↑n⌋ + 1) / ↑n| < 2 / ↑n ^ 1
state_after: case h
x : ℝ
n : ℕ
hn : 0 < n
hn' : 0 < ↑n
this : x < ↑(⌊x * ↑n⌋ + 1) / ↑n
⊢ ↑(⌊x * ↑n⌋ + 1) / ↑n < (x * ↑n + 2) / ↑n

tactic: gcongr
state_before: case h
x : ℝ
n : ℕ
hn : 0 < n
hn' : 0 < ↑n
this : x < ↑(⌊x * ↑n⌋ + 1) / ↑n
⊢ ↑(⌊x * ↑n⌋ + 1) / ↑n < (x * ↑n + 2) / ↑n
state_after: case h.h
x : ℝ
n : ℕ
hn : 0 < n
hn' : 0 < ↑n
this : x < ↑(⌊x * ↑n⌋ + 1) / ↑n
⊢ ↑(⌊x * ↑n⌋ + 1) < x * ↑n + 2

tactic: calc _ ≤ x * n + 1 := by push_cast; gcongr; apply Int.floor_le
  _ < x * n + 2 := by linarith
state_before: case h.h
x : ℝ
n : ℕ
hn : 0 < n
hn' : 0 < ↑n
this : x < ↑(⌊x * ↑n⌋ + 1) / ↑n
⊢ ↑(⌊x * ↑n⌋ + 1) < x * ↑n + 2
state_after: no goals

tactic: simpa
state_before: x : ℝ
n : ℕ
hn : 0 < n
⊢ 0 < ↑n
state_after: no goals

tactic: rw [lt_div_iff hn', Int.cast_add, Int.cast_one]
state_before: x : ℝ
n : ℕ
hn : 0 < n
hn' : 0 < ↑n
⊢ x < ↑(⌊x * ↑n⌋ + 1) / ↑n
state_after: x : ℝ
n : ℕ
hn : 0 < n
hn' : 0 < ↑n
⊢ x * ↑n < ↑⌊x * ↑n⌋ + 1

tactic: exact Int.lt_floor_add_one _
state_before: x : ℝ
n : ℕ
hn : 0 < n
hn' : 0 < ↑n
⊢ x * ↑n < ↑⌊x * ↑n⌋ + 1
state_after: no goals

tactic: push_cast
state_before: x : ℝ
n : ℕ
hn : 0 < n
hn' : 0 < ↑n
this : x < ↑(⌊x * ↑n⌋ + 1) / ↑n
⊢ ↑(⌊x * ↑n⌋ + 1) ≤ x * ↑n + 1
state_after: x : ℝ
n : ℕ
hn : 0 < n
hn' : 0 < ↑n
this : x < ↑(⌊x * ↑n⌋ + 1) / ↑n
⊢ ↑⌊x * ↑n⌋ + 1 ≤ x * ↑n + 1

tactic: gcongr
state_before: x : ℝ
n : ℕ
hn : 0 < n
hn' : 0 < ↑n
this : x < ↑(⌊x * ↑n⌋ + 1) / ↑n
⊢ ↑⌊x * ↑n⌋ + 1 ≤ x * ↑n + 1
state_after: case bc
x : ℝ
n : ℕ
hn : 0 < n
hn' : 0 < ↑n
this : x < ↑(⌊x * ↑n⌋ + 1) / ↑n
⊢ ↑⌊x * ↑n⌋ ≤ x * ↑n

tactic: apply Int.floor_le
state_before: case bc
x : ℝ
n : ℕ
hn : 0 < n
hn' : 0 < ↑n
this : x < ↑(⌊x * ↑n⌋ + 1) / ↑n
⊢ ↑⌊x * ↑n⌋ ≤ x * ↑n
state_after: no goals

tactic: linarith
state_before: x : ℝ
n : ℕ
hn : 0 < n
hn' : 0 < ↑n
this : x < ↑(⌊x * ↑n⌋ + 1) / ↑n
⊢ x * ↑n + 1 < x * ↑n + 2
state_after: no goals