-- Mathlib/NumberTheory/Transcendental/Liouville/LiouvilleWith.lean
theorem liouvilleWith_one (x : ℝ) : LiouvilleWith 1 x

Proof state:
x : ℝ
n : ℕ
hn : 0 < n
hn' : 0 < ↑n
⊢ x * ↑n < ↑⌊x * ↑n⌋ + 1

Tactic:
exact Int.lt_floor_add_one _

Result:
no goals

Proof state:
x : ℝ
n : ℕ
hn : 0 < n
⊢ 0 < ↑n

Tactic:
simpa

Result:
no goals

Proof state:
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

Result:
no goals

Proof state:
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

Result:
case h
x : ℝ
n : ℕ
hn : 0 < n
⊢ ∃ m, x ≠ ↑m / ↑n ∧ |x - ↑m / ↑n| < 2 / ↑n ^ 1

Proof state:
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']

Result:
case h
x : ℝ
n : ℕ
hn : 0 < n
hn' : 0 < ↑n
this : x < ↑(⌊x * ↑n⌋ + 1) / ↑n
⊢ ↑(⌊x * ↑n⌋ + 1) / ↑n < (x * ↑n + 2) / ↑n

Proof state:
x : ℝ
n : ℕ
hn : 0 < n
hn' : 0 < ↑n
this : x < ↑(⌊x * ↑n⌋ + 1) / ↑n
⊢ x * ↑n + 1 < x * ↑n + 2

Tactic:
linarith

Result:
no goals

Proof state:
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, ?_⟩

Result:
case h
x : ℝ
n : ℕ
hn : 0 < n
hn' : 0 < ↑n
this : x < ↑(⌊x * ↑n⌋ + 1) / ↑n
⊢ |x - ↑(⌊x * ↑n⌋ + 1) / ↑n| < 2 / ↑n ^ 1

Proof state:
case h
x : ℝ
n : ℕ
hn : 0 < n
⊢ ∃ m, x ≠ ↑m / ↑n ∧ |x - ↑m / ↑n| < 2 / ↑n ^ 1

Tactic:
have hn' : (0 : ℝ) < n := by simpa

Result:
case h
x : ℝ
n : ℕ
hn : 0 < n
hn' : 0 < ↑n
⊢ ∃ m, x ≠ ↑m / ↑n ∧ |x - ↑m / ↑n| < 2 / ↑n ^ 1

Proof state:
x : ℝ
n : ℕ
hn : 0 < n
hn' : 0 < ↑n
⊢ x < ↑(⌊x * ↑n⌋ + 1) / ↑n

Tactic:
rw [lt_div_iff₀ hn', Int.cast_add, Int.cast_one]

Result:
x : ℝ
n : ℕ
hn : 0 < n
hn' : 0 < ↑n
⊢ x * ↑n < ↑⌊x * ↑n⌋ + 1

Proof state:
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

Result:
no goals

Proof state:
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

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

Proof state:
x : ℝ
n : ℕ
hn : 0 < n
hn' : 0 < ↑n
this : x < ↑(⌊x * ↑n⌋ + 1) / ↑n
⊢ ↑(⌊x * ↑n⌋ + 1) ≤ x * ↑n + 1

Tactic:
push_cast

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

Proof state:
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 _

Result:
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

Proof state:
x : ℝ
n : ℕ
hn : 0 < n
hn' : 0 < ↑n
this : x < ↑(⌊x * ↑n⌋ + 1) / ↑n
⊢ ↑⌊x * ↑n⌋ + 1 ≤ x * ↑n + 1

Tactic:
gcongr

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

Proof state:
x : ℝ
⊢ LiouvilleWith 1 x

Tactic:
use 2

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