tendsto_pow_two_div_sub_two_atTop
As the natural number r tends to infinity, 2^r / (2^r - 2) tends to 1.
Statement
theorem tendsto_pow_two_div_sub_two_atTop : Filter.Tendsto (fun r : ℕ => ((2 : ℝ) ^ r) / (((2 : ℝ) ^ r) - 2)) Filter.atTop (nhds 1)
- Source
- step towards four_cycle_graph_code_density_tendsto_one_along_powers_of_two
- Verified
- 04 Nov 2026
- Axioms
Classical.choiceQuot.soundpropext- Used by 1
- four_cycle_graph_code_density_tendsto_one_along_powers_of_twoAs the natural number r tends to infinity, the sequence ((2 : ℝ) ^ r) * kst_code_max_density 2 2 (2 ^ r) tends to 1.
The proof, explained
The sequence 2^r / (2^r - 2) is rewritten algebraically as 1 + 2 / (2^r - 2), which is valid for all r ≥ 2 where the denominator is non-zero. As r → ∞, the power 2^r tends to ∞, which implies that the denominator 2^r - 2 also tends to ∞, so 2 / (2^r - 2) tends to 0 and the sum 1 + 2 / (2^r - 2) tends to 1. Because the original quotient agrees with this sum for all r ≥ 2, filter limit congruence implies that the original sequence also converges to 1.
The sequence 2^r tends to ∞ as r tends to ∞.
Since the base satisfies 2 > 1 (checked by numerical normalization), the sequence of powers 2^r tends to ∞ by tendsto_pow_atTop_atTop_of_one_lt.
uses
tendsto_pow_atTop_atTop_of_one_lthave hpow : Filter.Tendsto (fun r : ℕ => (2 : ℝ) ^ r) Filter.atTop Filter.atTop := tendsto_pow_atTop_atTop_of_one_lt (by norm_num)
The denominator sequence 2^r - 2 tends to ∞ as r tends to ∞.
Adding the constant -2 to the diverging sequence 2^r preserves divergence to ∞ (Filter.tendsto_atTop_add_const_right). Rewriting the subtraction 2^r - 2 as 2^r + (-2) via sub_eq_add_neg, the simplifier concludes that 2^r - 2 tends to ∞.
uses
Filter.tendsto_atTop_add_const_right,sub_eq_add_neghave hden : Filter.Tendsto (fun r : ℕ => (2 : ℝ) ^ r - 2) Filter.atTop Filter.atTop := by have h := Filter.tendsto_atTop_add_const_right Filter.atTop (-2 : ℝ) hpow simpa [sub_eq_add_neg] using h
The sequence 2 / (2^r - 2) tends to 0 as r tends to ∞.
Because the denominator 2^r - 2 tends to ∞, dividing the constant 2 by it produces a sequence tending to 0 by Filter.Tendsto.const_div_atTop.
uses
Filter.Tendsto.const_div_atTophave hfrac : Filter.Tendsto (fun r : ℕ => 2 / ((2 : ℝ) ^ r - 2)) Filter.atTop (nhds 0) := Filter.Tendsto.const_div_atTop hden 2
The shifted sequence 1 + 2 / (2^r - 2) tends to 1 as r tends to ∞.
Adding the constant 1 to the sequence 2 / (2^r - 2) (which tends to 0) shifts the limit to 1 + 0 = 1 by Filter.Tendsto.const_add.
uses
Filter.Tendsto.const_addhave hone : Filter.Tendsto (fun r : ℕ => 1 + 2 / ((2 : ℝ) ^ r - 2)) Filter.atTop (nhds 1) := by simpa using Filter.Tendsto.const_add (1 : ℝ) hfrac
It suffices to show that 1 + 2 / (2^r - 2) = 2^r / (2^r - 2) for all r ≥ 2.
By limit congruence (Filter.Tendsto.congr'), the original sequence converges to 1 if it is eventually equal to 1 + 2 / (2^r - 2). Expanding the filter atTop via Filter.eventually_atTop, this eventuality reduces to exhibiting a threshold, which is chosen to be 2: we then fix an arbitrary r ≥ 2.
uses
Filter.Tendsto.congr',Filter.eventually_atToprefine Filter.Tendsto.congr' ?_ hone change ∀ᶠ r : ℕ in Filter.atTop, 1 + 2 / ((2 : ℝ) ^ r - 2) = (2 : ℝ) ^ r / ((2 : ℝ) ^ r - 2) rw [Filter.eventually_atTop] use 2 intro r hr
For any r ≥ 2, the denominator 2^r - 2 is non-zero.
Since 2 ≥ 1 and r ≥ 2, monotonicity of powers (pow_le_pow_right₀) shows that 2^r ≥ 2^2 = 4. Linear arithmetic then implies 2^r - 2 ≥ 2 > 0, so 2^r - 2 ≠ 0.
uses
pow_le_pow_right₀have hden' : ((2 : ℝ) ^ r - 2) ≠ 0 := by have h2 : (2 : ℝ) ^ r ≥ (2 : ℝ) ^ 2 := pow_le_pow_right₀ (by norm_num) hr norm_num at h2 ⊢ linarith
The algebraic identity 1 + 2 / (2^r - 2) = 2^r / (2^r - 2) holds for all r ≥ 2. automation
Having established that the denominator 2^r - 2 is non-zero, clearing denominators with field_simp reduces the goal to (2^r - 2) + 2 = 2^r, which is verified by polynomial ring simplification.
field_simp [hden'] ring
tendsto_pow_atTop_atTop_of_one_lt- For any base r > 1 in an Archimedean linearly ordered semiring, the sequence r^n tends to ∞ as n tends to ∞.
Filter.tendsto_atTop_add_const_right- Adding a constant to a sequence tending to +∞ along a filter yields a sequence that also tends to +∞.
sub_eq_add_neg- Subtraction is equivalent to adding the negation: a - b = a + (-b).
Filter.Tendsto.const_div_atTop- Dividing a constant by a sequence that tends to +∞ along a filter yields a sequence tending to 0.
Filter.Tendsto.const_add- Adding a constant b to a sequence converging to a yields a sequence converging to b + a.
Filter.Tendsto.congr'- If two functions are eventually equal along a filter and the first tends to a limit, then the second tends to the same limit.
Filter.eventually_atTop- A property holds eventually along atTop on a preorder if and only if it holds for all elements greater than or equal to some threshold.
pow_le_pow_right₀- For a base a ≥ 1, the power function n ↦ a^n is monotonically non-decreasing.
Written by a model (gemini-3.8-flash) from the Lean source alone (no goal states were available). Lean verified the proof; this explanation is a reading aid and is not itself machine-checked.
Lean source view module on GitHub
/-- The sequence 2^r / (2^r - 2) tends to 1 as r tends to infinity. -/theorem tendsto_pow_two_div_sub_two_atTop : Filter.Tendsto (fun r : ℕ => ((2 : ℝ) ^ r) / (((2 : ℝ) ^ r) - 2)) Filter.atTop (nhds 1) := by have hpow : Filter.Tendsto (fun r : ℕ => (2 : ℝ) ^ r) Filter.atTop Filter.atTop := tendsto_pow_atTop_atTop_of_one_lt (by norm_num) have hden : Filter.Tendsto (fun r : ℕ => (2 : ℝ) ^ r - 2) Filter.atTop Filter.atTop := by have h := Filter.tendsto_atTop_add_const_right Filter.atTop (-2 : ℝ) hpow simpa [sub_eq_add_neg] using h have hfrac : Filter.Tendsto (fun r : ℕ => 2 / ((2 : ℝ) ^ r - 2)) Filter.atTop (nhds 0) := Filter.Tendsto.const_div_atTop hden 2 have hone : Filter.Tendsto (fun r : ℕ => 1 + 2 / ((2 : ℝ) ^ r - 2)) Filter.atTop (nhds 1) := by simpa using Filter.Tendsto.const_add (1 : ℝ) hfrac refine Filter.Tendsto.congr' ?_ hone change ∀ᶠ r : ℕ in Filter.atTop, 1 + 2 / ((2 : ℝ) ^ r - 2) = (2 : ℝ) ^ r / ((2 : ℝ) ^ r - 2) rw [Filter.eventually_atTop] use 2 intro r hr have hden' : ((2 : ℝ) ^ r - 2) ≠ 0 := by have h2 : (2 : ℝ) ^ r ≥ (2 : ℝ) ^ 2 := pow_le_pow_right₀ (by norm_num) hr norm_num at h2 ⊢ linarith field_simp [hden'] ring