AFTD Auto-Formalizing Theoretical Domains

pell_family_asymptotic_base

theoremverifiedformalization

The sequence (2 * pell_number (n - 2))^(1/n) converges to 1 + Real.sqrt 2 as n tends to infinity.

Statement

theorem pell_family_asymptotic_base :
    Filter.Tendsto (fun n : ℕ => ((2 * (pell_number (n - 2) : ℝ)) ^ ((1 : ℝ) / (n : ℝ))))
      Filter.atTop (nhds (1 + Real.sqrt 2))
Formalizes
arXiv:2610.08525 Sec. 5, Theorem 14
Verified
20 Oct 2026
Axioms
Classical.choiceQuot.soundpropext
Built on 1
  • pell_numberThe Pell numbers are defined by P(0) = 0, P(1) = 1, and P(m+2) = P(m) + 2 P(m+1).

Read back from the Lean

As $n \to \infty$ through the natural numbers, the sequence given by $(2 \cdot P(n - 2))^{1/n}$ converges to $1 + \sqrt{2}$ (with respect to the standard topology on $\mathbb{R}$), where $P(k)$ is the $k$-th Pell number (with $n - 2$ denoting truncated natural number subtraction).

Written by a model that saw only the Lean, never the English above. If the two disagree, that is worth a challenge.

The proof, explained

The proof establishes the asymptotic limit of (2 P_{n-2})^{1/n} using Binet's closed form P_m = (aᵐ - bᵐ)/(2√2), where a = 1 + √2 and b = 1 - √2. Because |b| ≤ 1/2 < 1, the term bᵐ is bounded by (1/2) aᵐ for m ≥ 1, which sandwiches 2 P_{n-2} between constant multiples of aⁿ: aⁿ c₁ ≤ 2 P_{n-2} ≤ aⁿ c₂. Taking 1/n-th powers sandwiches (2 P_{n-2})^{1/n} between a c₁^{1/n} and a c₂^{1/n}. Since c^{1/n} → 1 as n → ∞ for any positive constant c, both bounds converge to a = 1 + √2, and the squeeze theorem yields the result.

  1. The roots a = 1 + √2 and b = 1 - √2 satisfy a > 0, 1 ≤ a, a² = 2a + 1, b² = 2b + 1, |b| ≤ 1/2, and 2√2 ≠ 0.

    We establish rational bounds on √2, namely 1 < √2 < 3/2, by squaring and comparing with rational numbers (1 < 2 < 9/4). The characteristic roots a = 1 + √2 and b = 1 - √2 satisfy the recurrence relation x² = 2x + 1. Using 1 < √2 < 3/2, we get a ≥ 1, a > 0, and |b| = √2 - 1 ≤ 1/2, while 2√2 is strictly positive and therefore non-zero.

    lines 5–18

    uses Real.lt_sqrt, Real.sqrt_lt', Real.sq_sqrt

      have hsqrt2_pos : 0 < Real.sqrt 2 := Real.sqrt_pos.2 (by norm_num)
      have hsqrt2_gt : (1:ℝ) < Real.sqrt 2 := by
        rw [Real.lt_sqrt (by norm_num)]; norm_num
      have hsqrt2_lt : Real.sqrt 2 < 3/2 := by
        rw [Real.sqrt_lt' (by norm_num : (0:ℝ) < 3/2)]; norm_num
      have hsq2 : Real.sqrt 2 ^ 2 = 2 := Real.sq_sqrt (by norm_num)
      set b : ℝ := 1 - Real.sqrt 2 with hb_def
      set a : ℝ := 1 + Real.sqrt 2 with ha_def
      have a_pos : 0 < a := by rw [ha_def]; linarith
      have a_ge_one : 1 ≤ a := by rw [ha_def]; linarith
      have a_sq : a ^ 2 = 2 * a + 1 := by rw [ha_def]; nlinarith
      have b_sq : b ^ 2 = 2 * b + 1 := by rw [hb_def]; nlinarith
      have hb : |b| ≤ 1/2 := abs_le.2 ⟨by rw [hb_def]; linarith, by rw [hb_def]; linarith⟩
      have hsqrt2_ne : (2 * Real.sqrt 2 : ℝ) ≠ 0 := by positivity
  2. For all m ∈ ℕ, the Pell numbers satisfy the closed-form Binet formula P_m = (aᵐ - bᵐ) / (2√2).

    The formula is proved by two-step induction on m. The base cases m = 0 and m = 1 follow directly from P₀ = 0 and P₁ = 1, since a⁰ - b⁰ = 0 and a¹ - b¹ = (1 + √2) - (1 - √2) = 2√2. For the inductive step, substituting the recurrence P_{n+2} = 2 P_{n+1} + P_n and the induction hypotheses reduces the claim to a^{n+2} - b^{n+2} = 2(a^{n+1} - b^{n+1}) + (aⁿ - bⁿ), which holds because a² = 2a + 1 and b² = 2b + 1.

    lines 19–36

    uses Nat.twoStepInduction, pell_number.eq_1, pell_number.eq_2, pell_number.eq_3, pow_one, div_self, pow_add

      have closed_form : ∀ m : ℕ, (pell_number m : ℝ) = (a ^ m - b ^ m) / (2 * Real.sqrt 2) := by
        intro m
        induction m using Nat.twoStepInduction with
        | zero => simp [pell_number.eq_1]
        | one =>
          have h1 : a ^ 1 - b ^ 1 = 2 * Real.sqrt 2 := by
            rw [pow_one, pow_one, ha_def, hb_def]; ring
          rw [pell_number.eq_2, h1, div_self hsqrt2_ne]
          norm_num
        | more n ih1 ih2 =>
          have hstep : a ^ (n + 2) - b ^ (n + 2) = 2 * (a ^ (n + 1) - b ^ (n + 1)) + (a ^ n - b ^ n) := by
            rw [pow_add, pow_add, pow_add, pow_add, a_sq, b_sq]
            ring
          change ((pell_number (n + 2) : ℕ) : ℝ) = (a ^ (n + 2) - b ^ (n + 2)) / (2 * Real.sqrt 2)
          rw [show n + 2 = n.succ.succ from rfl, pell_number.eq_3, hstep]
          push_cast
          rw [ih1, ih2]
          ring
  3. For every m ≥ 1, the quantity 2 P_m satisfies the bounds aᵐ / (2√2) ≤ 2 P_m ≤ 3 aᵐ / (2√2).

    Since |b| ≤ 1/2, we have |b|ᵐ ≤ (1/2)ᵐ ≤ 1/2. Because a ≥ 1, we have 1 ≤ aᵐ, so |bᵐ| = |b|ᵐ ≤ (1/2) aᵐ. This gives -(1/2) aᵐ ≤ bᵐ ≤ (1/2) aᵐ, which bounds the numerator: (1/2) aᵐ ≤ aᵐ - bᵐ ≤ (3/2) aᵐ. Since 2 P_m = (aᵐ - bᵐ) / √2, dividing these bounds by √2 establishes the claimed lower and upper bounds on 2 P_m.

    lines 37–61

    uses pow_le_pow_left₀, abs_nonneg, pow_le_pow_of_le_one, pow_one, one_le_pow₀, mul_le_mul_of_nonneg_left, abs_pow, le_trans, le_abs_self, neg_abs_le, div_le_div_iff₀

      have bounds : ∀ m : ℕ, 1 ≤ m →
          2 * (pell_number m : ℝ) ≤ 3 * a ^ m / (2 * Real.sqrt 2) ∧
          a ^ m / (2 * Real.sqrt 2) ≤ 2 * (pell_number m : ℝ) := by
        intro m hm
        have hkey : |b| ^ m ≤ (1/2) * a ^ m := by
          have h1 : |b| ^ m ≤ (1/2) ^ m := pow_le_pow_left₀ (abs_nonneg b) hb m
          have h2 : (1/2 : ℝ) ^ m ≤ (1/2) ^ 1 := pow_le_pow_of_le_one (by norm_num) (by norm_num) hm
          rw [pow_one] at h2
          have h3 : (1 : ℝ) ≤ a ^ m := one_le_pow₀ a_ge_one
          have h4 : (1/2 : ℝ) * 1 ≤ (1/2) * a ^ m := by
            apply mul_le_mul_of_nonneg_left h3 (by norm_num)
          linarith
        have hbm : |b ^ m| ≤ (1/2) * a ^ m := by rw [abs_pow]; exact hkey
        have h1 : b ^ m ≤ (1/2) * a ^ m := le_trans (le_abs_self _) hbm
        have h2 : -(1/2) * a ^ m ≤ b ^ m := by
          have := neg_abs_le (b ^ m); linarith
        have hdu : a ^ m - b ^ m ≤ 3 * a ^ m / 2 := by linarith
        have hdl : a ^ m / 2 ≤ a ^ m - b ^ m := by linarith
        have e : (2:ℝ) * ((a ^ m - b ^ m) / (2 * Real.sqrt 2)) = (a ^ m - b ^ m) / Real.sqrt 2 := by
          field_simp
        constructor
        · rw [closed_form m, e, div_le_div_iff₀ hsqrt2_pos (by positivity)]
          nlinarith
        · rw [closed_form m, e, div_le_div_iff₀ (by positivity) hsqrt2_pos]
          nlinarith
  4. For any positive constant c, c^{1/n} converges to 1 as n → ∞.

    We express c^{1/n} as exp((ln c) * (1/n)). Because 1/n → 0 as n → ∞, the product (ln c) * (1/n) tends to 0. By continuity of the exponential function, exp((ln c) * (1/n)) converges to exp(0) = 1.

    lines 62–70

    uses Filter.Tendsto.const_mul, tendsto_one_div_atTop_nhds_zero_nat, mul_zero, Function.comp_def, Real.rpow_def_of_pos

      have hlim : ∀ c : ℝ, 0 < c → Filter.Tendsto (fun n : ℕ => c ^ ((1:ℝ)/(n:ℝ))) Filter.atTop (nhds 1) := by
        intro c hc
        have h1 : Filter.Tendsto (fun n : ℕ => Real.log c * (1/(n:ℝ))) Filter.atTop (nhds (Real.log c * 0)) :=
          Filter.Tendsto.const_mul (Real.log c) tendsto_one_div_atTop_nhds_zero_nat
        rw [mul_zero] at h1
        have h2 : Filter.Tendsto (fun n : ℕ => Real.exp (Real.log c * (1/(n:ℝ)))) Filter.atTop (nhds 1) := by
          have := Real.continuous_exp.continuousAt.tendsto.comp h1
          simpa [Function.comp_def] using this
        simpa only [Real.rpow_def_of_pos hc] using h2
  5. For positive constants c₁ = 1 / (2√2 a²) and c₂ = 3 / (2√2 a²), every n ≥ 3 satisfies a * c₁^{1/n} ≤ (2 P_{n-2})^{1/n} ≤ a * c₂^{1/n}.

    For n ≥ 3, we set m = n - 2 ≥ 1 and rewrite a^{n-2} as aⁿ / a². The bounds on 2 P_{n-2} become aⁿ c₁ ≤ 2 P_{n-2} ≤ aⁿ c₂. Since taking 1/n-th powers is monotone on non-negative reals, (aⁿ c₁)^{1/n} ≤ (2 P_{n-2})^{1/n} ≤ (aⁿ c₂)^{1/n}. Factoring the powers yields (aⁿ cᵢ)^{1/n} = (aⁿ)^{1/n} cᵢ^{1/n} = a cᵢ^{1/n}, giving the desired sandwich bounds.

    lines 71–111

    uses Real.rpow_natCast, Real.rpow_mul, Real.rpow_one, pow_add, Real.rpow_le_rpow, Real.mul_rpow, pow_nonneg

      set c₁ : ℝ := 1 / (a ^ 2 * (2 * Real.sqrt 2)) with hc1_def
      set c₂ : ℝ := 3 / (a ^ 2 * (2 * Real.sqrt 2)) with hc2_def
      have hc1_pos : 0 < c₁ := by rw [hc1_def]; positivity
      have hc2_pos : 0 < c₂ := by rw [hc2_def]; positivity
      have step : ∀ n : ℕ, 3 ≤ n →
          a * c₁ ^ ((1:ℝ)/(n:ℝ)) ≤ ((2 * (pell_number (n-2) : ℝ)) ^ ((1:ℝ)/(n:ℝ)))
          ∧ ((2 * (pell_number (n-2) : ℝ)) ^ ((1:ℝ)/(n:ℝ))) ≤ a * c₂ ^ ((1:ℝ)/(n:ℝ)) := by
        intro n hn
        have hn3 : 1 ≤ n - 2 := by omega
        have hnn : n ≠ 0 := by omega
        have hn0 : (n : ℝ) ≠ 0 := by exact_mod_cast hnn
        have ha_rpow : (a ^ n : ℝ) ^ ((1:ℝ) / (n:ℝ)) = a := by
          rw [← Real.rpow_natCast a n, ← Real.rpow_mul a_pos.le]
          have he : (n:ℝ) * (1/(n:ℝ)) = 1 := by field_simp
          rw [he, Real.rpow_one]
        have hpow2 : a ^ (n - 2) = a ^ n / a ^ 2 := by
          have hpow : a ^ n = a ^ (n - 2) * a ^ 2 := by
            rw [← pow_add]; congr 1; omega
          rw [hpow]
          have : (a^2 : ℝ) ≠ 0 := by positivity
          field_simp
        have hbnd := bounds (n-2) hn3
        have hlo : a ^ n * c₁ ≤ 2 * (pell_number (n-2) : ℝ) := by
          have h := hbnd.2
          rw [hpow2] at h
          have he : a ^ n / a ^ 2 / (2 * Real.sqrt 2) = a ^ n * c₁ := by
            rw [hc1_def]; field_simp
          rwa [he] at h
        have hhi : 2 * (pell_number (n-2) : ℝ) ≤ a ^ n * c₂ := by
          have h := hbnd.1
          rw [hpow2] at h
          have he : 3 * (a ^ n / a ^ 2) / (2 * Real.sqrt 2) = a ^ n * c₂ := by
            rw [hc2_def]; field_simp
          rwa [he] at h
        have hA_nn : (0:ℝ) ≤ 2 * (pell_number (n-2) : ℝ) := by positivity
        have hexp_nn : (0:ℝ) ≤ 1/(n:ℝ) := by positivity
        constructor
        · have h1 := Real.rpow_le_rpow (by positivity : (0:ℝ) ≤ a ^ n * c₁) hlo hexp_nn
          rwa [Real.mul_rpow (pow_nonneg a_pos.le n) hc1_pos.le, ha_rpow] at h1
        · have h1 := Real.rpow_le_rpow hA_nn hhi hexp_nn
          rwa [Real.mul_rpow (pow_nonneg a_pos.le n) hc2_pos.le, ha_rpow] at h1
  6. Both bounding sequences a * c₁^{1/n} and a * c₂^{1/n} converge to a = 1 + √2 as n → ∞.

    Since c₁ > 0 and c₂ > 0, the limit lemma implies that c₁^{1/n} → 1 and c₂^{1/n} → 1. Multiplying each by the constant a shows that both bounding sequences converge to a * 1 = a = 1 + √2.

    lines 112–117

      have hlimlo : Filter.Tendsto (fun n : ℕ => a * c₁ ^ ((1:ℝ)/(n:ℝ))) Filter.atTop (nhds a) := by
        have h := (hlim c₁ hc1_pos).const_mul a
        simpa using h
      have hlimhi : Filter.Tendsto (fun n : ℕ => a * c₂ ^ ((1:ℝ)/(n:ℝ))) Filter.atTop (nhds a) := by
        have h := (hlim c₂ hc2_pos).const_mul a
        simpa using h
  7. The sequence (2 P_{n-2})^{1/n} converges to 1 + √2 as n → ∞.

    The sandwich bounds a * c₁^{1/n} ≤ (2 P_{n-2})^{1/n} ≤ a * c₂^{1/n} hold for all n ≥ 3, which is an event that holds eventually as n → ∞. Because both bounds converge to 1 + √2, the squeeze theorem (tendsto_of_tendsto_of_tendsto_of_le_of_le') implies that (2 P_{n-2})^{1/n} also converges to 1 + √2.

    lines 118–122

    uses tendsto_of_tendsto_of_tendsto_of_le_of_le', Filter.eventually_ge_atTop

      refine tendsto_of_tendsto_of_tendsto_of_le_of_le' hlimlo hlimhi ?_ ?_
      · filter_upwards [Filter.eventually_ge_atTop 3] with n hn
        exact (step n hn).1
      · filter_upwards [Filter.eventually_ge_atTop 3] with n hn
        exact (step n hn).2
Real.lt_sqrt
For non-negative x, x < √y if and only if x² < y.
Real.sqrt_lt'
For positive y, √x < y if and only if x < y².
Real.sq_sqrt
For non-negative x, (√x)² = x.
Nat.twoStepInduction
Two-step induction principle on natural numbers with base cases 0 and 1.
pell_number.eq_1
The 0-th Pell number is 0.
pell_number.eq_2
The 1-st Pell number is 1.
pell_number.eq_3
The recurrence relation P_{m+2} = 2 P_{m+1} + P_m for Pell numbers.
pow_one
Any element raised to the power 1 equals itself.
div_self
Any non-zero element divided by itself equals 1.
pow_add
Exponents add under multiplication: a^{m+n} = a^m a^n.
pow_le_pow_left₀
If 0 ≤ a ≤ b, then aⁿ ≤ bⁿ for all n ∈ ℕ.
abs_nonneg
The absolute value of any element is non-negative.
pow_le_pow_of_le_one
For 0 ≤ a ≤ 1, raising a to a larger power yields a smaller or equal result: if m ≤ n, then aⁿ ≤ aᵐ.
one_le_pow₀
If 1 ≤ a, then 1 ≤ aⁿ for all n ∈ ℕ.
mul_le_mul_of_nonneg_left
Multiplying an inequality b ≤ c on the left by a non-negative element preserves the inequality: a * b ≤ a * c.
abs_pow
The absolute value of a power is the power of the absolute value: |aⁿ| = |a|ⁿ.
le_trans
Transitivity of inequality: if a ≤ b and b ≤ c, then a ≤ c.
le_abs_self
Every number is bounded above by its absolute value: a ≤ |a|.
neg_abs_le
The negative absolute value of a is less than or equal to a: -|a| ≤ a.
div_le_div_iff₀
For positive denominators b and d, a / b ≤ c / d if and only if a * d ≤ c * b.
Filter.Tendsto.const_mul
If f(n) → L as n → ∞, then c * f(n) → c * L.
tendsto_one_div_atTop_nhds_zero_nat
The sequence 1/n converges to 0 as n → ∞.
mul_zero
Multiplying any number by zero yields zero: a * 0 = 0.
Function.comp_def
Definition of function composition: (f ∘ g)(x) = f(g(x)).
Real.rpow_def_of_pos
For x > 0 and real y, xʸ = exp(y * ln x).
Real.rpow_natCast
The real power xⁿ with n cast to ℝ equals the natural power xⁿ.
Real.rpow_mul
For non-negative x, powers multiply: x^{y * z} = (xʸ)ᶻ.
Real.rpow_one
Any real number raised to the real power 1 equals itself.
Real.rpow_le_rpow
For 0 ≤ x ≤ y and non-negative z, xᶻ ≤ yᶻ.
Real.mul_rpow
For non-negative x and y, (x * y)ᶻ = xᶻ * yᶻ.
pow_nonneg
If a ≥ 0, then aⁿ ≥ 0 for all natural numbers n.
tendsto_of_tendsto_of_tendsto_of_le_of_le'
The squeeze theorem: if g(n) ≤ f(n) ≤ h(n) eventually, and both g(n) → L and h(n) → L, then f(n) → L.
Filter.eventually_ge_atTop
For any threshold N, eventually n ≥ N as n → ∞.

Written by a model (gemini-3.8-flash) from the Lean proof and the goal states Lean reported at each step. 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 * pell_number (n - 2))^(1/n) converges to 1 + √2 as n → ∞. -/theorem pell_family_asymptotic_base :    Filter.Tendsto (fun n : ℕ => ((2 * (pell_number (n - 2) : ℝ)) ^ ((1 : ℝ) / (n : ℝ))))      Filter.atTop (nhds (1 + Real.sqrt 2)) := by  have hsqrt2_pos : 0 < Real.sqrt 2 := Real.sqrt_pos.2 (by norm_num)  have hsqrt2_gt : (1:ℝ) < Real.sqrt 2 := by    rw [Real.lt_sqrt (by norm_num)]; norm_num  have hsqrt2_lt : Real.sqrt 2 < 3/2 := by    rw [Real.sqrt_lt' (by norm_num : (0:ℝ) < 3/2)]; norm_num  have hsq2 : Real.sqrt 2 ^ 2 = 2 := Real.sq_sqrt (by norm_num)  set b : ℝ := 1 - Real.sqrt 2 with hb_def  set a : ℝ := 1 + Real.sqrt 2 with ha_def  have a_pos : 0 < a := by rw [ha_def]; linarith  have a_ge_one : 1 ≤ a := by rw [ha_def]; linarith  have a_sq : a ^ 2 = 2 * a + 1 := by rw [ha_def]; nlinarith  have b_sq : b ^ 2 = 2 * b + 1 := by rw [hb_def]; nlinarith  have hb : |b| ≤ 1/2 := abs_le.2 ⟨by rw [hb_def]; linarith, by rw [hb_def]; linarith⟩  have hsqrt2_ne : (2 * Real.sqrt 2 : ℝ) ≠ 0 := by positivity  have closed_form : ∀ m : ℕ, (pell_number m : ℝ) = (a ^ m - b ^ m) / (2 * Real.sqrt 2) := by    intro m    induction m using Nat.twoStepInduction with    | zero => simp [pell_number.eq_1]    | one =>      have h1 : a ^ 1 - b ^ 1 = 2 * Real.sqrt 2 := by        rw [pow_one, pow_one, ha_def, hb_def]; ring      rw [pell_number.eq_2, h1, div_self hsqrt2_ne]      norm_num    | more n ih1 ih2 =>      have hstep : a ^ (n + 2) - b ^ (n + 2) = 2 * (a ^ (n + 1) - b ^ (n + 1)) + (a ^ n - b ^ n) := by        rw [pow_add, pow_add, pow_add, pow_add, a_sq, b_sq]        ring      change ((pell_number (n + 2) : ℕ) : ℝ) = (a ^ (n + 2) - b ^ (n + 2)) / (2 * Real.sqrt 2)      rw [show n + 2 = n.succ.succ from rfl, pell_number.eq_3, hstep]      push_cast      rw [ih1, ih2]      ring  have bounds : ∀ m : ℕ, 1 ≤ m →      2 * (pell_number m : ℝ) ≤ 3 * a ^ m / (2 * Real.sqrt 2) ∧      a ^ m / (2 * Real.sqrt 2) ≤ 2 * (pell_number m : ℝ) := by    intro m hm    have hkey : |b| ^ m ≤ (1/2) * a ^ m := by      have h1 : |b| ^ m ≤ (1/2) ^ m := pow_le_pow_left₀ (abs_nonneg b) hb m      have h2 : (1/2 : ℝ) ^ m ≤ (1/2) ^ 1 := pow_le_pow_of_le_one (by norm_num) (by norm_num) hm      rw [pow_one] at h2      have h3 : (1 : ℝ) ≤ a ^ m := one_le_pow₀ a_ge_one      have h4 : (1/2 : ℝ) * 1 ≤ (1/2) * a ^ m := by        apply mul_le_mul_of_nonneg_left h3 (by norm_num)      linarith    have hbm : |b ^ m| ≤ (1/2) * a ^ m := by rw [abs_pow]; exact hkey    have h1 : b ^ m ≤ (1/2) * a ^ m := le_trans (le_abs_self _) hbm    have h2 : -(1/2) * a ^ m ≤ b ^ m := by      have := neg_abs_le (b ^ m); linarith    have hdu : a ^ m - b ^ m ≤ 3 * a ^ m / 2 := by linarith    have hdl : a ^ m / 2 ≤ a ^ m - b ^ m := by linarith    have e : (2:ℝ) * ((a ^ m - b ^ m) / (2 * Real.sqrt 2)) = (a ^ m - b ^ m) / Real.sqrt 2 := by      field_simp    constructor    · rw [closed_form m, e, div_le_div_iff₀ hsqrt2_pos (by positivity)]      nlinarith    · rw [closed_form m, e, div_le_div_iff₀ (by positivity) hsqrt2_pos]      nlinarith  have hlim : ∀ c : ℝ, 0 < c → Filter.Tendsto (fun n : ℕ => c ^ ((1:ℝ)/(n:ℝ))) Filter.atTop (nhds 1) := by    intro c hc    have h1 : Filter.Tendsto (fun n : ℕ => Real.log c * (1/(n:ℝ))) Filter.atTop (nhds (Real.log c * 0)) :=      Filter.Tendsto.const_mul (Real.log c) tendsto_one_div_atTop_nhds_zero_nat    rw [mul_zero] at h1    have h2 : Filter.Tendsto (fun n : ℕ => Real.exp (Real.log c * (1/(n:ℝ)))) Filter.atTop (nhds 1) := by      have := Real.continuous_exp.continuousAt.tendsto.comp h1      simpa [Function.comp_def] using this    simpa only [Real.rpow_def_of_pos hc] using h2  set c₁ : ℝ := 1 / (a ^ 2 * (2 * Real.sqrt 2)) with hc1_def  set c₂ : ℝ := 3 / (a ^ 2 * (2 * Real.sqrt 2)) with hc2_def  have hc1_pos : 0 < c₁ := by rw [hc1_def]; positivity  have hc2_pos : 0 < c₂ := by rw [hc2_def]; positivity  have step : ∀ n : ℕ, 3 ≤ n →      a * c₁ ^ ((1:ℝ)/(n:ℝ)) ≤ ((2 * (pell_number (n-2) : ℝ)) ^ ((1:ℝ)/(n:ℝ)))      ∧ ((2 * (pell_number (n-2) : ℝ)) ^ ((1:ℝ)/(n:ℝ))) ≤ a * c₂ ^ ((1:ℝ)/(n:ℝ)) := by    intro n hn    have hn3 : 1 ≤ n - 2 := by omega    have hnn : n ≠ 0 := by omega    have hn0 : (n : ℝ) ≠ 0 := by exact_mod_cast hnn    have ha_rpow : (a ^ n : ℝ) ^ ((1:ℝ) / (n:ℝ)) = a := by      rw [← Real.rpow_natCast a n, ← Real.rpow_mul a_pos.le]      have he : (n:ℝ) * (1/(n:ℝ)) = 1 := by field_simp      rw [he, Real.rpow_one]    have hpow2 : a ^ (n - 2) = a ^ n / a ^ 2 := by      have hpow : a ^ n = a ^ (n - 2) * a ^ 2 := by        rw [← pow_add]; congr 1; omega      rw [hpow]      have : (a^2 : ℝ) ≠ 0 := by positivity      field_simp    have hbnd := bounds (n-2) hn3    have hlo : a ^ n * c₁ ≤ 2 * (pell_number (n-2) : ℝ) := by      have h := hbnd.2      rw [hpow2] at h      have he : a ^ n / a ^ 2 / (2 * Real.sqrt 2) = a ^ n * c₁ := by        rw [hc1_def]; field_simp      rwa [he] at h    have hhi : 2 * (pell_number (n-2) : ℝ) ≤ a ^ n * c₂ := by      have h := hbnd.1      rw [hpow2] at h      have he : 3 * (a ^ n / a ^ 2) / (2 * Real.sqrt 2) = a ^ n * c₂ := by        rw [hc2_def]; field_simp      rwa [he] at h    have hA_nn : (0:ℝ) ≤ 2 * (pell_number (n-2) : ℝ) := by positivity    have hexp_nn : (0:ℝ) ≤ 1/(n:ℝ) := by positivity    constructor    · have h1 := Real.rpow_le_rpow (by positivity : (0:ℝ) ≤ a ^ n * c₁) hlo hexp_nn      rwa [Real.mul_rpow (pow_nonneg a_pos.le n) hc1_pos.le, ha_rpow] at h1    · have h1 := Real.rpow_le_rpow hA_nn hhi hexp_nn      rwa [Real.mul_rpow (pow_nonneg a_pos.le n) hc2_pos.le, ha_rpow] at h1  have hlimlo : Filter.Tendsto (fun n : ℕ => a * c₁ ^ ((1:ℝ)/(n:ℝ))) Filter.atTop (nhds a) := by    have h := (hlim c₁ hc1_pos).const_mul a    simpa using h  have hlimhi : Filter.Tendsto (fun n : ℕ => a * c₂ ^ ((1:ℝ)/(n:ℝ))) Filter.atTop (nhds a) := by    have h := (hlim c₂ hc2_pos).const_mul a    simpa using h  refine tendsto_of_tendsto_of_tendsto_of_le_of_le' hlimlo hlimhi ?_ ?_  · filter_upwards [Filter.eventually_ge_atTop 3] with n hn    exact (step n hn).1  · filter_upwards [Filter.eventually_ge_atTop 3] with n hn    exact (step n hn).2
See it in the graphDiscuss this resultChallenge it