AFTD Auto-Formalizing Theoretical Domains

condorcet_extremes_tendsto_of_relative_correction

theoremverified

If the ratio q(n) / p(n)^2 satisfies q(n) / p(n)^2 = (1 - 1/n) * (1 + a(n)) for large n where n * a(n) tends to 0, then n * (1 - q(n) / p(n)^2) tends to 1 as n tends to infinity.

Statement

theorem condorcet_extremes_tendsto_of_relative_correction
    (p q : ℕ → ℝ) (a : ℕ → ℝ)
    (h_ratio : ∀ᶠ n : ℕ in Filter.atTop, q n / (p n ^ 2) = (1 - 1 / (n : ℝ)) * (1 + a n))
    (ha : Filter.Tendsto (fun n : ℕ => (n : ℝ) * a n) Filter.atTop (nhds 0)) :
    Filter.Tendsto (fun n : ℕ => (n : ℝ) * (1 - q n / (p n ^ 2))) Filter.atTop (nhds 1)
Source
step towards op_1821_condorcet_extremes_sharp_dependence
Verified
18 Nov 2026
Axioms
Classical.choiceQuot.soundpropext

The proof, explained

The proof first deduces that a(n) tends to 0 by viewing it as (1/n) * (n * a(n)), a product of two terms tending to 0. It then algebraically expands the quantity n * (1 - q(n) / p(n)^2) for large n, rewriting it as 1 + a(n) - n * a(n). Finally, standard limit arithmetic shows this rewritten form tends to 1 + 0 - 0 = 1, which transfers to the original sequence since they are eventually equal.

  1. The perturbation sequence a(n) converges to 0 as n tends to infinity.

    Since n tends to infinity as a real number, the inverse 1/n tends to 0. By the product rule for limits, multiplying 1/n by the hypothesis n * a(n) → 0 shows that (1/n) * (n * a(n)) → 0. For any n ≥ 1, n ≠ 0, so the product simplifies algebraically to a(n), proving that a(n) → 0.

    lines 7–19

    uses tendsto_inv_atTop_zero, tendsto_natCast_atTop_atTop, Filter.eventually_ge_atTop

      have h_a : Filter.Tendsto (fun n : ℕ => a n) Filter.atTop (nhds 0) := by
        have h_inv : Filter.Tendsto (fun n : ℕ => ((n : ℝ))⁻¹) Filter.atTop (nhds 0) :=
          tendsto_inv_atTop_zero.comp tendsto_natCast_atTop_atTop
        have h := h_inv.mul ha
        have h' : Filter.Tendsto (fun n : ℕ => ((n : ℝ))⁻¹ * ((n : ℝ) * a n))
            Filter.atTop (nhds 0) := by
          simpa using h
        refine h'.congr' ?_
        filter_upwards [Filter.eventually_ge_atTop 1] with n hn
        have hn0 : (n : ℝ) ≠ 0 := by
          have : n ≠ 0 := by omega
          exact_mod_cast this
        field_simp
  2. For sufficiently large n, n * (1 - q(n) / p(n)^2) is algebraically equal to 1 + a(n) - n * a(n).

    For n ≥ 1 where the ratio hypothesis holds, we substitute q(n) / p(n)^2 = (1 - 1/n) * (1 + a(n)). Clearing denominators and expanding yields n * (1 - (1 - 1/n) * (1 + a(n))) = n * (1/n - a(n) + a(n)/n) = 1 + a(n) - n * a(n).

    lines 20–28

    uses Filter.eventually_ge_atTop

      have h_eq : (fun n : ℕ => (n : ℝ) * (1 - q n / (p n ^ 2))) =ᶠ[Filter.atTop]
          (fun n : ℕ => 1 + a n - (n : ℝ) * a n) := by
        filter_upwards [h_ratio, Filter.eventually_ge_atTop 1] with n hratio hn
        rw [hratio]
        have hn0 : (n : ℝ) ≠ 0 := by
          have : n ≠ 0 := by omega
          exact_mod_cast this
        field_simp
        ring
  3. The sequence 1 + a(n) - n * a(n) converges to 1 as n tends to infinity.

    The constant 1 converges to 1, and a(n) converges to 0, so their sum converges to 1 + 0 = 1. Subtracting the assumption that n * a(n) → 0, the difference (1 + a(n)) - n * a(n) converges to 1 - 0 = 1.

    lines 29–34

    uses tendsto_const_nhds

      have h_lim : Filter.Tendsto (fun n : ℕ => 1 + a n - (n : ℝ) * a n)
          Filter.atTop (nhds 1) := by
        have h1 : Filter.Tendsto (fun n : ℕ => 1 + a n) Filter.atTop (nhds (1 + 0)) :=
          (tendsto_const_nhds (x := (1 : ℝ))).add h_a
        have h2 := h1.sub ha
        simpa using h2
  4. The original expression n * (1 - q(n) / p(n)^2) converges to 1 as n tends to infinity.

    Because two sequences that are eventually equal share the same limit, the convergence of 1 + a(n) - n * a(n) to 1 implies that n * (1 - q(n) / p(n)^2) also converges to 1.

    line 35

      exact h_lim.congr' h_eq.symm
tendsto_inv_atTop_zero
The function x ↦ x⁻¹ converges to 0 as x tends to infinity.
tendsto_natCast_atTop_atTop
The natural-to-real coercion n ↦ (n : ℝ) tends to infinity as n tends to infinity.
Filter.eventually_ge_atTop
In a directed order, elements are eventually greater than or equal to any given threshold a.
tendsto_const_nhds
A constant function converges to that constant value in the neighborhood topology.

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

/-- If the ratio q(n) / p(n)^2 satisfies q(n) / p(n)^2 = (1 - 1/n) * (1 + a(n)) where n * a(n) tends to 0, then n * (1 - q(n) / p(n)^2) tends to 1. -/theorem condorcet_extremes_tendsto_of_relative_correction    (p q : ℕ → ℝ) (a : ℕ → ℝ)    (h_ratio : ∀ᶠ n : ℕ in Filter.atTop, q n / (p n ^ 2) = (1 - 1 / (n : ℝ)) * (1 + a n))    (ha : Filter.Tendsto (fun n : ℕ => (n : ℝ) * a n) Filter.atTop (nhds 0)) :    Filter.Tendsto (fun n : ℕ => (n : ℝ) * (1 - q n / (p n ^ 2))) Filter.atTop (nhds 1) := by  have h_a : Filter.Tendsto (fun n : ℕ => a n) Filter.atTop (nhds 0) := by    have h_inv : Filter.Tendsto (fun n : ℕ => ((n : ℝ))⁻¹) Filter.atTop (nhds 0) :=      tendsto_inv_atTop_zero.comp tendsto_natCast_atTop_atTop    have h := h_inv.mul ha    have h' : Filter.Tendsto (fun n : ℕ => ((n : ℝ))⁻¹ * ((n : ℝ) * a n))        Filter.atTop (nhds 0) := by      simpa using h    refine h'.congr' ?_    filter_upwards [Filter.eventually_ge_atTop 1] with n hn    have hn0 : (n : ℝ) ≠ 0 := by      have : n ≠ 0 := by omega      exact_mod_cast this    field_simp  have h_eq : (fun n : ℕ => (n : ℝ) * (1 - q n / (p n ^ 2))) =ᶠ[Filter.atTop]      (fun n : ℕ => 1 + a n - (n : ℝ) * a n) := by    filter_upwards [h_ratio, Filter.eventually_ge_atTop 1] with n hratio hn    rw [hratio]    have hn0 : (n : ℝ) ≠ 0 := by      have : n ≠ 0 := by omega      exact_mod_cast this    field_simp    ring  have h_lim : Filter.Tendsto (fun n : ℕ => 1 + a n - (n : ℝ) * a n)      Filter.atTop (nhds 1) := by    have h1 : Filter.Tendsto (fun n : ℕ => 1 + a n) Filter.atTop (nhds (1 + 0)) :=      (tendsto_const_nhds (x := (1 : ℝ))).add h_a    have h2 := h1.sub ha    simpa using h2  exact h_lim.congr' h_eq.symm
See it in the graphDiscuss this resultChallenge it