MathFin
Map / Probability · Analysis and convexity / MathFin.Probability.Analysis.Bisection

The bisection method

MathFin.Probability.Analysis.BisectionJEL C63MSC 65M06 source

The bisection method looks for a solution of f x = C on a bracket [lo, hi]: evaluate f at the midpoint, keep the half whose endpoints still straddle C, repeat.

Why bisection converges

Bisection only ever asks whether f m < C. So the hypothesis it needs is that σ is the threshold of f against C on the bracket: f x < C ↔ x < σ for x ∈ [lo, hi]. The estimates converge to that threshold. A strictly increasing f with f σ = C has this property (StrictMonoOn.lt_iff_lt), and then the limit is the solution. The property itself asks for neither continuity nor strictness, and in general σ need not solve f σ = C. At a threshold, a step maps the trap [lo, σ] × [σ, hi] (left endpoint below σ, right endpoint above) into itself: the two branches of the step are the two directions of the threshold equivalence. Set.MapsTo.iterate then traps σ in every bracket. Separately, and whatever f is, each step halves the width. A bracket of width (hi − lo) / 2ⁿ that contains σ puts its midpoint within (hi − lo) / 2ⁿ⁺¹ of it.

The iteration is a noncomputable definition over ℝ. Floating-point rounding and stopping rules are out of scope.

Main definitions

  • bisectStep: one bisection step toward f x = C on a bracket: evaluate f at the midpoint and keep the half whose endpoints still straddle C.
  • bisect: the n-th bisection bracket from (a, b).
  • bisectMid: the n-th bisection estimate, the midpoint of the n-th bracket.

Main results

  • bisectStep, bisect, bisectMid: one step, the n-th bracket, and the n-th estimate (the midpoint of the n-th bracket, counted from n = 0); bisect_zero and bisect_succ unfold the iteration.
  • bisectStep_snd_sub_fst, bisect_snd_sub_fst: a step halves the bracket, so from any starting bracket (a, b) the n-th one has width (b − a) / 2ⁿ.
  • mapsTo_bisectStep, bisect_mem: at a threshold σ the trap is invariant, so every bracket contains σ.
  • bisectMid_mem_Icc: at a threshold σ ∈ [lo, hi], every estimate lies in [lo, hi].
  • abs_bisectMid_sub_le, tendsto_bisectMid: the n-th estimate is within (hi − lo) / 2ⁿ⁺¹ of σ, and the estimates converge to σ.

Tags

bisection method, root finding, implied volatility solver, threshold, interval halving, JEL C63, MSC 65M06

Import neighbourhood

Above: what it imports. Below: what imports it.

Declarations 12

defMathFin.bisectStepsource
(ℝ → ℝ) → ℝ → ℝ × ℝ → ℝ × ℝ

One bisection step toward f x = C on the bracket I = (a, b): evaluate f at the midpoint m, keep (m, b) if f m < C and (a, m) otherwise.

defMathFin.bisectsource
(ℝ → ℝ) → ℝ → ℝ → ℝ → ℕ → ℝ × ℝ

The n-th bisection bracket for f x = C, starting from (a, b).

defMathFin.bisectMidsource
(ℝ → ℝ) → ℝ → ℝ → ℝ → ℕ → ℝ

The bisection estimate after n steps: the midpoint of the n-th bracket. At n = 0 it is the midpoint of the starting bracket.

theoremMathFin.bisect_zero @[simp]source
∀ (f : ℝ → ℝ) (C a b : ℝ), bisect f C a b 0 = (a, b)
theoremMathFin.bisect_succsource
∀ (f : ℝ → ℝ) (C a b : ℝ) (n : ℕ), bisect f C a b (n + 1) = bisectStep f C (bisect f C a b n)
theoremMathFin.bisectStep_snd_sub_fstsource
∀ (f : ℝ → ℝ) (C : ℝ) (I : ℝ × ℝ), (bisectStep f C I).2 - (bisectStep f C I).1 = (I.2 - I.1) / 2

A bisection step halves the bracket, whatever f and C are.

theoremMathFin.bisect_snd_sub_fstsource
∀ (f : ℝ → ℝ) (C a b : ℝ) (n : ℕ), (bisect f C a b n).2 - (bisect f C a b n).1 = (b - a) / 2 ^ n

Halving: the n-th bracket has width (b − a) / 2ⁿ, whatever f and C are.

theoremMathFin.mapsTo_bisectStepsource
∀ {f : ℝ → ℝ} {C lo hi σ : ℝ}, (∀ x ∈ Set.Icc lo hi, f x < C ↔ x < σ) → Set.MapsTo (bisectStep f C) (Set.Icc lo σ ×ˢ Set.Icc σ hi) (Set.Icc lo σ ×ˢ Set.Icc σ hi)

The trap is invariant. If σ is the threshold of f against C on [lo, hi], a bisection step keeps the left endpoint in [lo, σ] and the right endpoint in [σ, hi]: at the midpoint m, f m < C means m < σ, and otherwise σ ≤ m.

used by 1: bisect_mem
theoremMathFin.bisect_memsource
∀ {f : ℝ → ℝ} {C lo hi σ : ℝ}, (∀ x ∈ Set.Icc lo hi, f x < C ↔ x < σ) → σ ∈ Set.Icc lo hi → ∀ (n : ℕ), bisect f C lo hi n ∈ Set.Icc lo σ ×ˢ Set.Icc σ hi

Every bisection bracket traps the threshold: the n-th bracket (aₙ, bₙ) from (lo, hi) has aₙ ∈ [lo, σ] and bₙ ∈ [σ, hi].

theoremMathFin.abs_bisectMid_sub_lesource
∀ {f : ℝ → ℝ} {C lo hi σ : ℝ}, (∀ x ∈ Set.Icc lo hi, f x < C ↔ x < σ) → σ ∈ Set.Icc lo hi → ∀ (n : ℕ), |bisectMid f C lo hi n - σ| ≤ (hi - lo) / 2 ^ (n + 1)

Error bound: the n-th estimate is within (hi − lo) / 2ⁿ⁺¹ of the threshold, half the width of a bracket that contains both.

theoremMathFin.bisectMid_mem_Iccsource
∀ {f : ℝ → ℝ} {C lo hi σ : ℝ}, (∀ x ∈ Set.Icc lo hi, f x < C ↔ x < σ) → σ ∈ Set.Icc lo hi → ∀ (n : ℕ), bisectMid f C lo hi n ∈ Set.Icc lo hi

The estimate stays in the bracket: the n-th bisection estimate lies in [lo, hi], since it is the midpoint of a sub-bracket of [lo, hi].

theoremMathFin.tendsto_bisectMidsource
∀ {f : ℝ → ℝ} {C lo hi σ : ℝ}, (∀ x ∈ Set.Icc lo hi, f x < C ↔ x < σ) → σ ∈ Set.Icc lo hi → Filter.Tendsto (bisectMid f C lo hi) Filter.atTop (nhds σ)

Convergence: the bisection estimates converge to the threshold.