MathFin
Map / Valuation · Interest rates / MathFin.Models.Rates.Bootstrapping

Curve bootstrapping by bracketing search

MathFin.Models.Rates.BootstrappingMSC 91G30MSC 91G60JEL E43 source

Every curve starts as instrument quotes and ends as discount factors; the algorithm between is bootstrapping — solve one instrument at a time for its new discount factor, with the already-solved factors held fixed. This module connects the curve instruments (fraValue, payerSwapValue — both carry zero_iff root conditions in MathFin) to a proved bisection root-finder: each step reprices its instrument to tolerance, and the induction boot carries that to every step under per-step hypotheses stated at the prefix the recursion feeds in.

The module layers:

  • A bisection engine — imported from MathFin.Probability.Analysis.Bisection (not duplicated here): the iteration bisectStep / bisect / bisectMid with its three facts — the bracket is invariant around the threshold, the error is at most half the interval per step, and the estimates converge.
  • A threshold bridge (private) — the engine's hypothesis (∀ x ∈ [lo, hi], f x < C ↔ x < σ) is produced from an affine function with positive slope (mul_sub_lt_neg_iff).
  • The affine bootstrap step — affineStep_err / affineStep_tendsto / affineStep_value_err / affineStep_stepBudget: bisection, from a bracket containing the root (a − c)/b, of an increasing rearrangement x ↦ b·x − a at level −c converges to that root; the instrument reprices to within b·(hi − lo)/2^{n+1} of the quote, and some n ≤ ⌈log₂ (b·(hi−lo)/ε)⌉ steps achieve accuracy ε.
  • The FRA as an instrument — with the earlier discount factor p fixed and the later one x ≠ 0 bootstrapped, the FRA value is p − (1 + δ·K)·x — affine, covered when 1 + δ·K > 0; strictly antitone, so the negated value is an increasing solving function (fraThreshold), and fraValue_newUnknown_eq_quote_iff is the root condition in the new unknown (with fraRoot_agrees_with_pin, it recovers fraValue_zcb_eq_zero_iff on the flat curve).
  • The payer swap as an instrument — with the fixed schedule already bootstrapped (annuity A constant in the new factor x), the value is (P0 − K·A) − x: affine with slope −1, strictly antitone with no positivity condition; at zero quote the fixed rate is par at the root (swapRoot_is_par, consuming payerSwapValue_eq_zero_iff). With one payment at the new maturity (annuity A₀ + δ·x), the value is (P0 − K·A₀) − (1 + K·δ)·x — covered under 1 + K·δ > 0 (swapLastCouponThreshold).
  • The swap is a par coupon bond — the zero-value last-coupon swap at fixed rate K is the coupon-bond pricing equation couponBondPricingEq of Models/Rates/YieldCurve.lean with coupon K·δ and face 1 (payerSwapValue_lastCoupon_eq_zero_iff_couponBond), so the closed-form bootstrap bootstrap_solve names the swap's root, and bisection on the swap recovers the discount factor of the coupon bond (swapBootstrap_recovers_couponBondFactor).
  • The induction — boot builds the curve by structural recursion over the instrument index: step i bisects instrument i's solving function on the prefix bootstrapped so far, so each step literally inherits the previous factors. boot_step_err bounds every step, boot_length (proved by induction) tracks the curve, and boot_reprices_all is the repricing theorem over all instruments — with hypotheses stated at the fed-in prefix (see the scope note). fraChain with boot_reprices_fraChain runs the FRA strip through the induction (fixed rate K i per FRA; step 0 is the spot deposit, anchored at the valuation-date factor 1), and swapChain with boot_reprices_swapChain does the same for the spot-starting swap strip (fixed rate K i per maturity, last-coupon annuity over the prefix) — both discharging every hypothesis of boot_reprices_all except the per-step bracket condition, under the instrument layer's standing conditions.
  • Flat-curve capstone — fraBootstrap_flatCurve: if the fixed rate equals the flat-curve forward rate, bisection at zero quote from any positive bracket around the true later discount factor recovers it to within (hi − lo)/2^{n+1}.

Scope of the induction: the hypotheses of boot_step_err and boot_reprices_all are stated at the prefix the recursion actually feeds the step — boot V c lo hi n i, the factors the earlier steps produced — and, on that prefix, on the step's own bracket [lo i, hi i] (bisection evaluates the instrument nowhere else). Each step assumes only what it consumes: the instrument's threshold shape and affine identity at the run's actual earlier factors, and a bracket containing the root computed from them. The first two are exactly the facts the instrument layers provide at any prefix — the FRA by fraValue_affine_of_newUnknown + fraThreshold (under δ ≠ 0, 1 + δ·K > 0, on a positive bracket), the known-schedule swap by payerSwapValue_affine_of_newUnknown + swapThreshold (no slope condition), the last-coupon swap by payerSwapValue_affine_lastCoupon + swapLastCouponThreshold (under 1 + K·δ > 0) — and boot_reprices_fraChain / boot_reprices_swapChain discharge every hypothesis of boot_reprices_all except the bracket condition for fraChain / swapChain, the FRA and swap strips as boot instruments, under those standing conditions. The bracket condition stays a hypothesis: the root moves with the prefix, so which bracket is adequate depends on the factors the run produced, and the theorems ask for exactly that, at the step that uses it. The pointwise per-n error bound is the curve-level statement (convergence of the factors as n → ∞ would follow by induction on i when the hypotheses hold for every n and each threshold is continuous in the prefix — as for fraChain / swapChain, whose roots are affine in it — but is not formalized). Excluded: instruments whose already-fixed legs contain the new factor (forward-starting fixed/floating exchanges — the value is still affine in the bracket but with a slope of unknown sign, possibly zero, so no bracketing sign change is guaranteed), and joint solves for several new factors at once.

Boundary: MathFin/Models/Rates/YieldCurve.lean owns the closed-form bootstrap_solve* names; this module owns the search-based bootstrap, and the swap layer proves that bisection on the swap lands within (hi − lo)/2^{n+1} of the closed-form root, for a bracket containing it (swapBootstrap_recovers_couponBondFactor).

Main definitions

  • boot: the bootstrapped curve, a list of discount factors after the first i instruments, the head being the newest.
  • fraChain: the FRA strip as a boot instrument, instrument i being the FRA with fixed rate K i that reads the new discount factor x.
  • swapChain: the swap strip as a boot instrument, instrument i being the spot-starting payer swap maturing at the new discount factor.

Main results

  • affineStep_err: for b > 0 and a root (a − c)/b in [lo, hi], bisection on b·x − a at target −c is within (hi − lo)/2^{n+1} of that root after n steps.
  • fraValue_affine_of_newUnknown, fraValue_newUnknown_eq_quote_iff: for δ ≠ 0, the FRA value at the bootstrapped forward rate is p − (1 + δK)·x (for x ≠ 0); for x > 0 and 1 + δK > 0 it equals the quote c if and only if x = (p − c)/(1 + δK).
  • strictAntiOn_fraValue, fraStep_err: for δ ≠ 0 and 1 + δK > 0, the FRA value is strictly decreasing on x > 0, and bisection from a bracket [lo, hi] with lo > 0 containing (p − c)/(1 + δK) lands within (hi − lo)/2^{n+1} of it.
  • swapRoot_is_par, strictAnti_payerSwapValue, swapStep_err: for A ≠ 0 the root P0 − K·A of the payer swap has par rate K; the swap value is strictly decreasing in the new factor with no positivity condition, and bisection on it lands within (hi − lo)/2^{n+1} of the root when a bracket contains it.
  • payerSwapValue_lastCoupon_eq_zero_iff_couponBond: the last-coupon swap has zero value at x if and only if x satisfies the coupon-bond pricing equation with coupon K·δ and face 1.
  • swapBootstrap_recovers_couponBondFactor: for 1 + K·δ > 0, if x solves that coupon-bond equation and lies in [lo, hi], bisection on the last-coupon swap lands within (hi − lo)/2^{n+1} of x.
  • boot_length, boot_step_err: boot returns i factors after i instruments, and at step i its new factor is within (hi i − lo i)/2^{n+1} of the threshold root σ, given the threshold shape of the solving function on the bracket and σ in the bracket.
  • boot_reprices_all: for b > 0 and a solving function affine a − b·x on the bracket with root in the bracket, the repriced instrument i is within b·(hi i − lo i)/2^{n+1} of its quote c i.
  • boot_reprices_fraChain, boot_reprices_swapChain: the same repricing bound for the FRA strip (δ ≠ 0, 1 + δ·K i > 0, lo i > 0) and the swap strip (1 + K i·δ > 0), each given that the root lies in the step's bracket.
  • fraBootstrap_flatCurve: for δ ≠ 0, a fixed rate equal to the flat-curve forward rate and a bracket with lo > 0 containing the true later discount factor, bisection at zero quote recovers it within (hi − lo)/2^{n+1}.

References

  • P. S. Hagan and G. West, Interpolation methods for curve construction [HaganWest2006], §2
  • J. C. Hull, Options, Futures, and Other Derivatives [Hull], ch. 4 and ch. 7

Tags

curve bootstrapping, bisection, discount factors, FRA, swap rate, yield curve construction, par swap, MSC 91G30, MSC 91G60, JEL E43

Import neighbourhood

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

Corpus entries

mf-bootstrap-par-swap-coupon-bond · interest_rates.json · full statement
Bootstrapping a Par Swap Recovers the Coupon-Bond Discount Factor

A payer swap with floating leg P0 − x (spot-starting when P0 = 1), fixed rate K and one fixed payment of K·δ at each date of the schedule and at the new maturity has zero value exactly when the coupon bond paying K·δ at those dates and face 1 at the last prices at P0 (the coupon-bond pricing equation of the closed-form bootstrap). If the new discount factor x solves that equation and 1 + K·δ > 0, bisection on the zero-quote swap from any bracket [lo, hi] containing x lands within (hi − lo)/2^{n+1} of x after n steps. The bracket containing x is a hypothesis; the rest of the curve (the earlier discount factors P) is taken as given.

mf-bootstrap-swap-strip-reprices · interest_rates.json · full statement
Swap-Strip Bootstrap Reprices Every Swap

The search-based bootstrap boot (swapChain δ K) builds a discount curve by structural recursion: step i bisects the spot-starting payer swap with fixed rate K_i (one fixed payment of K_i·δ at each date bootstrapped so far and at the new one) on the factors the earlier steps produced. At every step i, if 1 + K_i·δ > 0 and the bracket [lo_i, hi_i] contains the root computed from the factors the run actually produced, the new factor reprices swap i's quote c_i to within (1 + K_i·δ)·(hi_i − lo_i)/2^{n+1}. The bracket condition is a hypothesis; convergence of the curve as n → ∞ is not formalized.

Declarations 40

theoremMathFin.Bootstrapping.mul_sub_lt_neg_iffsource
∀ (a b c x : ℝ), 0 < b → (b * x - a < -c ↔ x < (a - c) / b)

The threshold property is global for an affine function with positive slope: b·x − a crosses the level −c exactly at the root x = (a − c)/b.

theoremMathFin.Bootstrapping.abs_sub_mul_sub_eq_mul_abssource
∀ (a b c m : ℝ), 0 < b → |a - b * m - c| = b * |m - (a - c) / b|

The slope-weighted residual: for b > 0, |a − b·m − c| = b · |m − (a − c)/b|.

theoremMathFin.Bootstrapping.affineStep_errsource
∀ (a b c lo hi : ℝ), 0 < b → (a - c) / b ∈ Set.Icc lo hi → ∀ (n : ℕ), |bisectMid (fun x => b * x - a) (-c) lo hi n - (a - c) / b| ≤ (hi - lo) / 2 ^ (n + 1)

Bootstrap step, affine form. For a value function whose increasing rearrangement is x ↦ b·x − a (b > 0) and quote c, bisection from a bracket containing the root (a − c)/b lands within (hi − lo)/2^{n+1} of it.

theoremMathFin.Bootstrapping.affineStep_tendstosource
∀ (a b c lo hi : ℝ), 0 < b → (a - c) / b ∈ Set.Icc lo hi → Filter.Tendsto (bisectMid (fun x => b * x - a) (-c) lo hi) Filter.atTop (nhds ((a - c) / b))

Convergence form of the affine bootstrap step.

theoremMathFin.Bootstrapping.affineStep_value_errsource
∀ (a b c lo hi : ℝ), 0 < b → (a - c) / b ∈ Set.Icc lo hi → ∀ (n : ℕ), |a - b * bisectMid (fun x => b * x - a) (-c) lo hi n - c| ≤ b * ((hi - lo) / 2 ^ (n + 1))

Repricing bound. The instrument value a − b·x at the bisection estimate is within b·(hi − lo)/2^{n+1} of the quote c — the slope-weighed half-interval.

theoremMathFin.Bootstrapping.affineStep_stepBudgetsource
∀ (a b c lo hi ε : ℝ), 0 < b → (a - c) / b ∈ Set.Icc lo hi → 0 < ε → ∃ n, |a - b * bisectMid (fun x => b * x - a) (-c) lo hi n - c| ≤ ε ∧ n ≤ ⌈Real.logb 2 (b * (hi - lo) / ε)⌉₊

Step budget. Some number n ≤ ⌈log₂ (b·(hi − lo)/ε)⌉ of bisection steps achieves repricing accuracy ε. Real.logb 2 is log₂; Mathlib states the log ladder over Real.logb.

theoremMathFin.Bootstrapping.fraValue_affine_of_newUnknownsource
∀ (p δ K x : ℝ), δ ≠ 0 → x ≠ 0 → fraValue δ x (fraForwardRate p x δ) K = p - (1 + δ * K) * x

The FRA as an affine function of its new unknown. With the earlier discount factor p fixed and the later one x bootstrapped, the FRA value at fixed rate K is p − (1 + δ·K)·x — consuming fraValue_forwardRate_eq_discount_difference.

theoremMathFin.Bootstrapping.fraValue_newUnknown_eq_quote_iffsource
∀ (p δ K c x : ℝ), δ ≠ 0 → 0 < x → 0 < 1 + δ * K → (fraValue δ x (fraForwardRate p x δ) K = c ↔ x = (p - c) / (1 + δ * K))

The FRA root condition — the zero_iff layer in the new unknown. For a positive candidate factor, the FRA reprices the quote exactly at x = (p − c)/(1 + δ·K). With fraRoot_agrees_with_pin it recovers fraValue_zcb_eq_zero_iff at c = 0 on the flat zcb curve, for K with 1 + δ·K > 0.

theoremMathFin.Bootstrapping.fraValue_affine_zcbsource
∀ (r δ K T1 T2 : ℝ), δ ≠ 0 → fraValue δ (zcb r 0 T2) (fraForwardRate (zcb r 0 T1) (zcb r 0 T2) δ) K = zcb r 0 T1 - (1 + δ * K) * zcb r 0 T2

Consistency: on the flat zcb curve the affine identity reproduces fraValue_zcb_eq_discount_difference (right side equal by ring).

theoremMathFin.Bootstrapping.strictAntiOn_fraValuesource
∀ (p δ K : ℝ), δ ≠ 0 → 0 < 1 + δ * K → StrictAntiOn (fun x => fraValue δ x (fraForwardRate p x δ) K) (Set.Ioi 0)

FRA monotonicity (the licensing fact for bracketing): in the new discount factor, on positive factors, the FRA value is strictly antitone — affine with slope −(1 + δ·K), covered when 1 + δ·K > 0.

theoremMathFin.Bootstrapping.fraThresholdsource
∀ (p δ K c lo hi : ℝ), δ ≠ 0 → 0 < 1 + δ * K → 0 < lo → ∀ x ∈ Set.Icc lo hi, -fraValue δ x (fraForwardRate p x δ) K < -c ↔ x < (p - c) / (1 + δ * K)

FRA threshold: on a bracket of positive discount factors, the negated FRA value at level −c is an increasing solving function with threshold (p − c)/(1 + δ·K) — the exact hypothesis the engine's error bound consumes.

theoremMathFin.Bootstrapping.fraStep_errsource
∀ (p δ K c lo hi : ℝ), δ ≠ 0 → 0 < 1 + δ * K → 0 < lo → (p - c) / (1 + δ * K) ∈ Set.Icc lo hi → ∀ (n : ℕ), |bisectMid (fun x => -fraValue δ x (fraForwardRate p x δ) K) (-c) lo hi n - (p - c) / (1 + δ * K)| ≤ (hi - lo) / 2 ^ (n + 1)

FRA bootstrap step. Bisection of the negated FRA value at the negated quote computes the later discount factor to within (hi − lo)/2^{n+1}.

theoremMathFin.Bootstrapping.fraStep_tendstosource
∀ (p δ K c lo hi : ℝ), δ ≠ 0 → 0 < 1 + δ * K → 0 < lo → (p - c) / (1 + δ * K) ∈ Set.Icc lo hi → Filter.Tendsto (bisectMid (fun x => -fraValue δ x (fraForwardRate p x δ) K) (-c) lo hi) Filter.atTop (nhds ((p - c) / (1 + δ * K)))

Convergence form of the FRA bootstrap step.

theoremMathFin.Bootstrapping.fraRoot_parForwardsource
∀ (p δ K : ℝ), δ ≠ 0 → p ≠ 0 → fraForwardRate p (p / (1 + δ * K)) δ = K

At the zero quote the FRA root makes the forward rate par: at the bootstrapped factor p/(1 + δ·K) the simple forward rate equals the quoted fixed rate (one direction; the equivalence on the flat curve is fraRoot_agrees_with_pin).

theoremMathFin.Bootstrapping.fraRoot_agrees_with_pinsource
∀ (r δ K T1 T2 : ℝ), δ ≠ 0 → (zcb r 0 T2 = zcb r 0 T1 / (1 + δ * K) ↔ K = fraForwardRate (zcb r 0 T1) (zcb r 0 T2) δ)

The bridge to fraValue_zcb_eq_zero_iff: on the flat zcb curve the bootstrap root p/(1 + δ·K) and the par-forward characterization (fraValue_zcb_eq_zero_iff's right side, K = fraForwardRate p x δ) describe the same factor.

theoremMathFin.Bootstrapping.payerSwapValue_affine_of_newUnknownsource
∀ (P0 K A x : ℝ), payerSwapValue P0 x K A = P0 - K * A - 1 * x

Swap, fixed schedule known. With the annuity A already bootstrapped (every fixed payment sits at a maturity before the new one), the payer swap value in the new factor x is (P0 − K·A) − x: affine with slope −1, hence strictly decreasing with no positivity condition (strictAnti_payerSwapValue).

theoremMathFin.Bootstrapping.strictAnti_payerSwapValuesource
∀ (P0 K A : ℝ), StrictAnti fun x => payerSwapValue P0 x K A

Swap monotonicity, known schedule: strictly antitone on all of ℝ.

theoremMathFin.Bootstrapping.swapThresholdsource
∀ (P0 K A c lo hi x : ℝ), x ∈ Set.Icc lo hi → (-payerSwapValue P0 x K A < -c ↔ x < P0 - K * A - c)

Swap threshold, known schedule: the negated value at level −c has threshold P0 − K·A − c.

theoremMathFin.Bootstrapping.swapStep_errsource
∀ (P0 K A c lo hi : ℝ), P0 - K * A - c ∈ Set.Icc lo hi → ∀ (n : ℕ), |bisectMid (fun x => -payerSwapValue P0 x K A) (-c) lo hi n - (P0 - K * A - c)| ≤ (hi - lo) / 2 ^ (n + 1)

Swap bootstrap step, known schedule: bisection of the negated value at the negated quote computes the new discount factor to within (hi − lo)/2^{n+1}.

theoremMathFin.Bootstrapping.swapStep_tendstosource
∀ (P0 K A c lo hi : ℝ), P0 - K * A - c ∈ Set.Icc lo hi → Filter.Tendsto (bisectMid (fun x => -payerSwapValue P0 x K A) (-c) lo hi) Filter.atTop (nhds (P0 - K * A - c))

Convergence form of the swap bootstrap step.

theoremMathFin.Bootstrapping.swapRoot_is_parsource
∀ (P0 K A : ℝ), A ≠ 0 → parSwapRate P0 (P0 - K * A) A = K

The par-rate interpretation of the swap root: at quote zero the fixed rate is par at the bootstrapped factor P0 − K·A — consuming payerSwapValue_eq_zero_iff.

theoremMathFin.Bootstrapping.payerSwapValue_affine_lastCouponsource
∀ (P0 K A₀ δ x : ℝ), payerSwapValue P0 x K (A₀ + δ * x) = P0 - K * A₀ - (1 + K * δ) * x

Swap with one payment at the new maturity. The fixed leg's annuity is A₀ + δ·x (A₀ = annuity δ P s over the already-bootstrapped schedule, plus one accrual at the new factor): value (P0 − K·A₀) − (1 + K·δ)·x — affine, covered when 1 + K·δ > 0.

theoremMathFin.Bootstrapping.payerSwapValue_affine_lastCoupon_annuitysource
∀ {ι : Type u_1} (P0 K δ x : ℝ) (P : ι → ℝ) (s : Finset ι), payerSwapValue P0 x K (annuity δ P s + δ * x) = P0 - K * annuity δ P s - (1 + K * δ) * x

Same, with the annuity in the annuity δ P s form.

theoremMathFin.Bootstrapping.strictAnti_payerSwapValue_lastCouponsource
∀ (P0 K A₀ δ : ℝ), 0 < 1 + K * δ → StrictAnti fun x => payerSwapValue P0 x K (A₀ + δ * x)

Monotonicity of the last-coupon swap: strictly antitone on all of ℝ under the slope condition 1 + K·δ > 0.

theoremMathFin.Bootstrapping.swapLastCouponThresholdsource
∀ (P0 K A₀ δ c lo hi : ℝ), 0 < 1 + K * δ → ∀ x ∈ Set.Icc lo hi, -payerSwapValue P0 x K (A₀ + δ * x) < -c ↔ x < (P0 - K * A₀ - c) / (1 + K * δ)

Threshold of the last-coupon swap.

theoremMathFin.Bootstrapping.swapStep_lastCoupon_errsource
∀ (P0 K A₀ δ c lo hi : ℝ), 0 < 1 + K * δ → (P0 - K * A₀ - c) / (1 + K * δ) ∈ Set.Icc lo hi → ∀ (n : ℕ), |bisectMid (fun x => -payerSwapValue P0 x K (A₀ + δ * x)) (-c) lo hi n - (P0 - K * A₀ - c) / (1 + K * δ)| ≤ (hi - lo) / 2 ^ (n + 1)

Bootstrap step for the last-coupon swap.

theoremMathFin.Bootstrapping.payerSwapValue_lastCoupon_eq_zero_iff_couponBondsource
∀ {ι : Type u_1} (s : Finset ι) (P : ι → ℝ) (P0 K δ x : ℝ), payerSwapValue P0 x K (annuity δ P s + δ * x) = 0 ↔ couponBondPricingEq s (fun x => K * δ) P P0 (K * δ) 1 x

A zero-value swap is a par coupon bond. The last-coupon payer swap (floating leg P0 − x, one fixed payment of K·δ at each date of s and at the new factor x) has zero value exactly when the coupon bond paying K·δ at every date and face 1 at the last prices at P0: the pricing equation couponBondPricingEq of Models/Rates/YieldCurve.lean with coupon K·δ and face 1.

theoremMathFin.Bootstrapping.swapBootstrap_recovers_couponBondFactorsource
∀ {ι : Type u_1} (s : Finset ι) (P : ι → ℝ) (P0 K δ x lo hi : ℝ), 0 < 1 + K * δ → couponBondPricingEq s (fun x => K * δ) P P0 (K * δ) 1 x → x ∈ Set.Icc lo hi → ∀ (n : ℕ), |bisectMid (fun y => -payerSwapValue P0 y K (annuity δ P s + δ * y)) 0 lo hi n - x| ≤ (hi - lo) / 2 ^ (n + 1)

Swap bootstrapping recovers the coupon-bond discount factor. If the new factor x solves the par-coupon-bond pricing equation — coupon K·δ at every date of s and at the new one, face 1, price P0 — then bisection on the zero-quote last-coupon swap, from any bracket [lo, hi] containing x, lands within (hi − lo)/2^{n+1} of it (1 + K·δ > 0). The closed-form bootstrap bootstrap_solve identifies x with the swap's bisection root (P0 − K·A₀)/(1 + K·δ).

defMathFin.Bootstrapping.bootsource
(ℕ → List ℝ → ℝ) → (ℕ → ℝ) → (ℕ → ℝ) → (ℕ → ℝ) → ℕ → ℕ → List ℝ

The bootstrapped curve: after the first i instruments, a list of discount factors, the head being the newest.

theoremMathFin.Bootstrapping.boot_lengthsource
∀ (V : ℕ → List ℝ → ℝ) (c lo hi : ℕ → ℝ) (n i : ℕ), (boot V c lo hi n i).length = i

Length: after i instruments the curve holds i factors.

theoremMathFin.Bootstrapping.boot_succ_ne_nilsource
∀ (V : ℕ → List ℝ → ℝ) (c lo hi : ℕ → ℝ) (n i : ℕ), boot V c lo hi n (i + 1) ≠ []

Every non-initial curve is nonempty, so its head is the newest factor.

theoremMathFin.Bootstrapping.boot_step_errsource
∀ (V : ℕ → List ℝ → ℝ) (c lo hi : ℕ → ℝ) (σ : ℕ → List ℝ → ℝ) (i n : ℕ), (∀ x ∈ Set.Icc (lo i) (hi i), -V i (x :: boot V c lo hi n i) < -c i ↔ x < σ i (boot V c lo hi n i)) → σ i (boot V c lo hi n i) ∈ Set.Icc (lo i) (hi i) → |(boot V c lo hi n (i + 1)).head ⋯ - σ i (boot V c lo hi n i)| ≤ (hi i - lo i) / 2 ^ (n + 1)

The bootstrap step theorem, at the fed-in prefix. For every instrument i, the i-th bootstrapped factor (with n bisection steps per instrument) is within (hi i − lo i)/2^{n+1} of that instrument's threshold σ i p, where p is the prefix the recursion actually feeds step i — the factors the earlier steps produced (boot V c lo hi n i), not an arbitrary list. The threshold hypothesis and the root-in-bracket condition are assumed exactly there: each step consumes only its own instrument's shape, on its own bracket, at the factors the run produced. The prefix itself depends on n, so the hypotheses are per-n: if they hold for every n, the gap to the prefix-dependent threshold tends to 0 (not stated as a theorem); convergence of the factors themselves is not stated either (it would follow by induction on i when, in addition, each σ i is continuous in the prefix).

theoremMathFin.Bootstrapping.boot_reprices_allsource
∀ (V : ℕ → List ℝ → ℝ) (c lo hi : ℕ → ℝ) (a b : ℕ → List ℝ → ℝ) (i n : ℕ), 0 < b i (boot V c lo hi n i) → (∀ x ∈ Set.Icc (lo i) (hi i), V i (x :: boot V c lo hi n i) = a i (boot V c lo hi n i) - b i (boot V c lo hi n i) * x) → (a i (boot V c lo hi n i) - c i) / b i (boot V c lo hi n i) ∈ Set.Icc (lo i) (hi i) → |V i ((boot V c lo hi n (i + 1)).head ⋯ :: boot V c lo hi n i) - c i| ≤ b i (boot V c lo hi n i) * ((hi i - lo i) / 2 ^ (n + 1))

The bootstrap repricing theorem, at the fed-in prefix. Given instrument i's affine shape V i (x :: p) = a i p − b i p · x on the step's own bracket (bisection evaluates the instrument only there), slope b i p > 0, and the root (a i p − c i)/b i p in the bracket — all at the prefix p the recursion feeds step i — the bootstrapped factor reprices instrument i's quote up to the slope-weighted half-interval b i p · (hi i − lo i)/2^{n+1}. The shape and slope are exactly the facts the instrument layers of this file provide at whatever prefix is fed in (FRA: fraValue_affine_of_newUnknown + fraThreshold; known-schedule swap: payerSwapValue_affine_of_newUnknown + swapThreshold; last-coupon swap: payerSwapValue_affine_lastCoupon + swapLastCouponThreshold), so the only run-dependent input left is the per-step bracket choice; boot_reprices_fraChain / boot_reprices_swapChain discharge every hypothesis but it for the FRA and swap strips, under the FRA / swap standing conditions.

defMathFin.Bootstrapping.fraChainsource
ℝ → (ℕ → ℝ) → ℕ → List ℝ → ℝ

The FRA strip as a boot instrument: instrument i is the FRA with fixed rate K i, reading the new factor x and the previous factor off the fed-in list; on the empty prefix (step 0) the previous factor is the valuation-date factor 1, so the first instrument is the spot deposit. (The [] branch is never fed by boot, which always passes x :: prefix.)

theoremMathFin.Bootstrapping.fraChain_cons @[simp]source
∀ (δ : ℝ) (K : ℕ → ℝ) (x : ℝ) (p : List ℝ) (i : ℕ), fraChain δ K i (x :: p) = fraValue δ x (fraForwardRate (p.head?.getD 1) x δ) (K i)

The unfolding equation: on x :: p the strip instrument is the FRA value function of the instrument layer, the earlier factor read off the head of p (defaulting to the valuation-date factor 1 when p is empty, so on [x] it is the spot deposit) — matching swapChain_cons's general shape on the fed-in list.

theoremMathFin.Bootstrapping.boot_reprices_fraChainsource
∀ (δ : ℝ) (K c lo hi : ℕ → ℝ) (n i : ℕ), δ ≠ 0 → 0 < 1 + δ * K i → 0 < lo i → ((boot (fraChain δ K) c lo hi n i).head?.getD 1 - c i) / (1 + δ * K i) ∈ Set.Icc (lo i) (hi i) → |fraChain δ K i ((boot (fraChain δ K) c lo hi n (i + 1)).head ⋯ :: boot (fraChain δ K) c lo hi n i) - c i| ≤ (1 + δ * K i) * ((hi i - lo i) / 2 ^ (n + 1))

The FRA strip reprices inside the induction. At every step i (step 0 is the spot deposit, anchored at the valuation-date factor 1), under the FRA layer's standing conditions — δ ≠ 0, 1 + δ·K i > 0, a positive bracket — the only hypothesis left is the bracket condition at the fed-in prefix: [lo i, hi i] must contain the root computed from the actual previous factor ((boot (fraChain δ K) c lo hi n i).head?.getD 1 − c i) / (1 + δ·K i). Then the bootstrapped factor reprices instrument i's quote to within (1 + δ·K i)·(hi i − lo i)/2^{n+1}.

defMathFin.Bootstrapping.swapChainsource
ℝ → (ℕ → ℝ) → ℕ → List ℝ → ℝ

The swap strip as a boot instrument: instrument i is the spot-starting payer swap (P0 = 1) maturing at the new factor x, with fixed rate K i and one fixed payment (accrual δ) at each bootstrapped date and at the new one — annuity δ·(Σ prefix) + δ·x, the last-coupon form of the swap layer. Every step, including the first (empty prefix: the one-period swap), is a genuine swap; the [] branch is never fed by boot.

theoremMathFin.Bootstrapping.swapChain_cons @[simp]source
∀ (δ : ℝ) (K : ℕ → ℝ) (x : ℝ) (p : List ℝ) (i : ℕ), swapChain δ K i (x :: p) = payerSwapValue 1 x (K i) (δ * p.sum + δ * x)

The unfolding equation of the swap strip instrument.

theoremMathFin.Bootstrapping.boot_reprices_swapChainsource
∀ (δ : ℝ) (K c lo hi : ℕ → ℝ) (n i : ℕ), 0 < 1 + K i * δ → (1 - K i * (δ * (boot (swapChain δ K) c lo hi n i).sum) - c i) / (1 + K i * δ) ∈ Set.Icc (lo i) (hi i) → |swapChain δ K i ((boot (swapChain δ K) c lo hi n (i + 1)).head ⋯ :: boot (swapChain δ K) c lo hi n i) - c i| ≤ (1 + K i * δ) * ((hi i - lo i) / 2 ^ (n + 1))

The swap strip reprices inside the induction. At every step i, under the last-coupon slope condition 1 + K i·δ > 0 (no bracket positivity is needed: the swap value is affine on all of ℝ), the only hypothesis left is the bracket condition at the fed-in prefix: [lo i, hi i] must contain the root (1 − K i·δ·Σ prefix − c i)/(1 + K i·δ) computed from the factors the run actually produced. Then the bootstrapped factor reprices swap i's quote (c i = 0 for a par-rate quote K i) to within (1 + K i·δ)·(hi i − lo i)/2^{n+1}.

theoremMathFin.Bootstrapping.fraBootstrap_flatCurvesource
∀ (r δ K T1 T2 lo hi : ℝ), δ ≠ 0 → K = fraForwardRate (zcb r 0 T1) (zcb r 0 T2) δ → zcb r 0 T2 ∈ Set.Icc lo hi → 0 < lo → ∀ (n : ℕ), |bisectMid (fun x => -fraValue δ x (fraForwardRate (zcb r 0 T1) x δ) K) 0 lo hi n - zcb r 0 T2| ≤ (hi - lo) / 2 ^ (n + 1)

Flat-curve capstone. If the fixed rate equals the flat-curve forward rate, the FRA's true later discount factor on the zcb curve is the root of the solving function at zero quote (an algebraic identity), and bisection at zero quote from any positive bracket around it recovers the factor to within (hi − lo)/2^{n+1}.