Theorem: eventually_residual_liouville
File: Mathlib/NumberTheory/Liouville/Residual.lean

tactic: rw [Filter.Eventually, setOf_liouville_eq_irrational_inter_iInter_iUnion]
state_before: ⊢ ∀ᶠ (x : ℝ) in residual ℝ, Liouville x
state_after: ⊢ {x | Irrational x} ∩ ⋂ n, ⋃ a, ⋃ b, ⋃ (_ : 1 < b), ball (↑a / ↑b) (1 / ↑b ^ n) ∈ residual ℝ

tactic: refine eventually_residual_irrational.and ?_
state_before: ⊢ {x | Irrational x} ∩ ⋂ n, ⋃ a, ⋃ b, ⋃ (_ : 1 < b), ball (↑a / ↑b) (1 / ↑b ^ n) ∈ residual ℝ
state_after: ⊢ ∀ᶠ (x : ℝ) in residual ℝ, x ∈ ⋂ n, ⋃ a, ⋃ b, ⋃ (_ : 1 < b), ball (↑a / ↑b) (1 / ↑b ^ n)

tactic: refine residual_of_dense_Gδ ?_ (Rat.denseEmbedding_coe_real.dense.mono ?_)
state_before: ⊢ ∀ᶠ (x : ℝ) in residual ℝ, x ∈ ⋂ n, ⋃ a, ⋃ b, ⋃ (_ : 1 < b), ball (↑a / ↑b) (1 / ↑b ^ n)
state_after: case refine_1

⊢ IsGδ {x | (fun x => x ∈ ⋂ n, ⋃ a, ⋃ b, ⋃ (_ : 1 < b), ball (↑a / ↑b) (1 / ↑b ^ n)) x}

case refine_2

⊢ range Rat.cast ⊆ {x | (fun x => x ∈ ⋂ n, ⋃ a, ⋃ b, ⋃ (_ : 1 < b), ball (↑a / ↑b) (1 / ↑b ^ n)) x}

tactic: exact .iInter fun n => IsOpen.isGδ <|
      isOpen_iUnion fun a => isOpen_iUnion fun b => isOpen_iUnion fun _hb => isOpen_ball
state_before: case refine_1

⊢ IsGδ {x | (fun x => x ∈ ⋂ n, ⋃ a, ⋃ b, ⋃ (_ : 1 < b), ball (↑a / ↑b) (1 / ↑b ^ n)) x}
state_after: no goals

tactic: rintro _ ⟨r, rfl⟩
state_before: case refine_2

⊢ range Rat.cast ⊆ {x | (fun x => x ∈ ⋂ n, ⋃ a, ⋃ b, ⋃ (_ : 1 < b), ball (↑a / ↑b) (1 / ↑b ^ n)) x}
state_after: case refine_2.intro
r : ℚ
⊢ ↑r ∈ {x | (fun x => x ∈ ⋂ n, ⋃ a, ⋃ b, ⋃ (_ : 1 < b), ball (↑a / ↑b) (1 / ↑b ^ n)) x}

tactic: simp only [mem_iInter, mem_iUnion]
state_before: case refine_2.intro
r : ℚ
⊢ ↑r ∈ {x | (fun x => x ∈ ⋂ n, ⋃ a, ⋃ b, ⋃ (_ : 1 < b), ball (↑a / ↑b) (1 / ↑b ^ n)) x}
state_after: case refine_2.intro
r : ℚ
⊢ ↑r ∈ {x | ∀ (i : ℕ), ∃ i_1 i_2, ∃ (_ : 1 < i_2), x ∈ ball (↑i_1 / ↑i_2) (1 / ↑i_2 ^ i)}

tactic: refine fun n => ⟨r.num * 2, r.den * 2, ?_, ?_⟩
state_before: case refine_2.intro
r : ℚ
⊢ ↑r ∈ {x | ∀ (i : ℕ), ∃ i_1 i_2, ∃ (_ : 1 < i_2), x ∈ ball (↑i_1 / ↑i_2) (1 / ↑i_2 ^ i)}
state_after: case refine_2.intro.refine_1
r : ℚ
n : ℕ
⊢ 1 < ↑r.den * 2

case refine_2.intro.refine_2
r : ℚ
n : ℕ
⊢ ↑r ∈ ball (↑(r.num * 2) / ↑(↑r.den * 2)) (1 / ↑(↑r.den * 2) ^ n)

tactic: have := Int.ofNat_le.2 r.pos
state_before: case refine_2.intro.refine_1
r : ℚ
n : ℕ
⊢ 1 < ↑r.den * 2
state_after: case refine_2.intro.refine_1
r : ℚ
n : ℕ
this : ↑(Nat.succ 0) ≤ ↑r.den
⊢ 1 < ↑r.den * 2

tactic: rw [Int.ofNat_one] at this
state_before: case refine_2.intro.refine_1
r : ℚ
n : ℕ
this : ↑(Nat.succ 0) ≤ ↑r.den
⊢ 1 < ↑r.den * 2
state_after: case refine_2.intro.refine_1
r : ℚ
n : ℕ
this : 1 ≤ ↑r.den
⊢ 1 < ↑r.den * 2

tactic: omega
state_before: case refine_2.intro.refine_1
r : ℚ
n : ℕ
this : 1 ≤ ↑r.den
⊢ 1 < ↑r.den * 2
state_after: no goals

tactic: convert @mem_ball_self ℝ _ (r : ℝ) _ _
state_before: case refine_2.intro.refine_2
r : ℚ
n : ℕ
⊢ ↑r ∈ ball (↑(r.num * 2) / ↑(↑r.den * 2)) (1 / ↑(↑r.den * 2) ^ n)
state_after: case h.e'_5.h.e'_3
r : ℚ
n : ℕ
⊢ ↑(r.num * 2) / ↑(↑r.den * 2) = ↑r

case refine_2.intro.refine_2.convert_2
r : ℚ
n : ℕ
⊢ 0 < 1 / ↑(↑r.den * 2) ^ n

tactic: push_cast
state_before: case h.e'_5.h.e'_3
r : ℚ
n : ℕ
⊢ ↑(r.num * 2) / ↑(↑r.den * 2) = ↑r
state_after: case h.e'_5.h.e'_3
r : ℚ
n : ℕ
⊢ ↑r.num * 2 / (↑r.den * 2) = ↑r

tactic: norm_cast
state_before: case h.e'_5.h.e'_3
r : ℚ
n : ℕ
⊢ ↑r.num * 2 / (↑r.den * 2) = ↑r
state_after: case h.e'_5.h.e'_3
r : ℚ
n : ℕ
⊢ Rat.divInt (r.num * 2) ↑(r.den * 2) = r

tactic: simp [Rat.divInt_mul_right (two_ne_zero), Rat.mkRat_self]
state_before: case h.e'_5.h.e'_3
r : ℚ
n : ℕ
⊢ Rat.divInt (r.num * 2) ↑(r.den * 2) = r
state_after: no goals

tactic: refine one_div_pos.2 (pow_pos (Int.cast_pos.2 ?_) _)
state_before: case refine_2.intro.refine_2.convert_2
r : ℚ
n : ℕ
⊢ 0 < 1 / ↑(↑r.den * 2) ^ n
state_after: case refine_2.intro.refine_2.convert_2
r : ℚ
n : ℕ
⊢ 0 < ↑r.den * 2

tactic: exact mul_pos (Int.natCast_pos.2 r.pos) zero_lt_two
state_before: case refine_2.intro.refine_2.convert_2
r : ℚ
n : ℕ
⊢ 0 < ↑r.den * 2
state_after: no goals