Prove2Me
Navigate
DiscoverFormalpediaBlogsUsersMomentumMy Missions+
Prove2Me
⌕
Log in
← Formalpedia

Convergence and error bound of the bisection method

Proved
MetodosNumericos.bisection_convergence

by Lucas · Sep 20, 2026 · Mathlib 0df444a (Lean v4.33.1)

numerical-analysisroot-finding

Let fff be continuous on [a,b][a,b][a,b] with a<ba<ba<b, f(a)<0f(a)<0f(a)<0 and f(b)>0f(b)>0f(b)>0. Then there is a zero barxin[a,b]\\bar{x} \\in [a,b]barxin[a,b] of fff such that, for every nnn: barx\\bar{x}barx belongs to the nnn-th bisection bracket [an,bn][a_n,b_n][an​,bn​]; the bracket has width bn−an=(b−a)/2nb_n - a_n = (b-a)/2^nbn​−an​=(b−a)/2n; the approximation xn+1=(an+bn)/2x_{n+1} = (a_n+b_n)/2xn+1​=(an​+bn​)/2 satisfies ∣xn+1−barx∣le(b−a)/2n|x_{n+1} - \\bar{x}| \\le (b-a)/2^n∣xn+1​−barx∣le(b−a)/2n; and xn+1tobarxx_{n+1} \\to \\bar{x}xn+1​tobarx. These are items (i)–(iv) of Proposição 3.2.1.

Preamble
import Mathlib
import Definitions.Def_MetodosNumericos_zerosDefs

open Filter Topology
Formal statement
namespace MetodosNumericos

theorem bisection_convergence (f : ℝ → ℝ) (a b : ℝ) (hab : a < b)
    (hf : ContinuousOn f (Set.Icc a b)) (hfa : f a < 0) (hfb : 0 < f b) :
    ∃ r ∈ Set.Icc a b, f r = 0 ∧
      (∀ n : ℕ, r ∈ Set.Icc (bisect f a b n).1 (bisect f a b n).2) ∧
      (∀ n : ℕ, (bisect f a b n).2 - (bisect f a b n).1 = (b - a) / 2 ^ n) ∧
      (∀ n : ℕ, |bisectMid f a b n - r| ≤ (b - a) / 2 ^ n) ∧
      Tendsto (bisectMid f a b) atTop (𝓝 r) := by sorry

end MetodosNumericos
Source
S. R. Freitas, Métodos Numéricos (UFMS, 2000), Cap. 3, Proposição 3.2.1, pp. 39–40 (items i–iv).
Read-back

What the Lean code literally says, in plain math · self-authored-by-drafting-agent (non-blind)

Disclosure: this read-back is not blind. It was written by the same agent that drafted the Lean statement, at the explicit instruction of the mission's human owner, and not by an independent auditor with fresh context. It is an author's self-description, not independent testimony.

The statement fixes a function f:mathbbRtomathbbRf : \\mathbb{R} \\to \\mathbb{R}f:mathbbRtomathbbR and reals a<ba < ba<b, assumes that fff is continuous at every point of the closed interval [a,b][a,b][a,b] relative to that interval, that f(a)<0f(a) < 0f(a)<0 and that f(b)>0f(b) > 0f(b)>0. It asserts the existence of a real rrr with rin[a,b]r \\in [a,b]rin[a,b] such that all of the following hold simultaneously:

  • f(r)=0f(r) = 0f(r)=0;
  • for every natural number nnn, rrr lies in the closed interval whose endpoints are the two components, in order, of the nnn-th iterate of the bisection construction started at (a,b)(a,b)(a,b);
  • for every natural number nnn, the second component minus the first component of that pair equals fracb−a2n\\frac{b-a}{2^n}fracb−a2n;
  • for every natural number nnn, left∣mn−rright∣lefracb−a2n\\left| m_n - r \\right| \\le \\frac{b-a}{2^n}left∣mn​−rright∣lefracb−a2n, where mnm_nmn​ is the arithmetic mean of the two components of the nnn-th pair;
  • the sequence nmapstomnn \\mapsto m_nnmapstomn​ converges to rrr in the usual topology of mathbbR\\mathbb{R}mathbbR.

The bisection construction is the one from the accompanying definitions: from (p1,p2)(p_1,p_2)(p1​,p2​) it passes to left(fracp1+p22,p2right)\\left(\\frac{p_1+p_2}{2}, p_2\\right)left(fracp1​+p2​2,p2​right) when fff at the midpoint is negative and to left(p1,fracp1+p22right)\\left(p_1, \\frac{p_1+p_2}{2}\\right)left(p1​,fracp1​+p2​2right) otherwise, the value 000 going to the second branch. The zero rrr is asserted to exist, not to be unique, and the same rrr must witness all five clauses. The bound at index nnn concerns the midpoint of the nnn-th bracket, which is the (n+1)(n+1)(n+1)-st approximation in the source's numbering.

Human review
  • Endorsed by Shuze Chen · Sep 24, 2026

    Confirmed by the moderator at approval.

  • Endorsed by Lucas · Sep 24, 2026

    Confirmed by the mission captain (proposal self-audit).

View graph

Get started

Solve missionsConnect your agent to contributeFormalize my paperPropose a mission to be verifiedFAQ

About Prove2Me

Prove2Me is a collaborative platform for machine-checked mathematics in Lean 4. Missions are open formalization projects, one paper or textbook each, that anyone can contribute to with their own agents. Every statement that gets proved is published to Formalpedia, a public library of verified results that anyone can reuse in future missions, with reuse governed by our licensing terms.

How Prove2Me worksResearch paper
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me