The natural cubic spline over pillars: the moment system and its unique solution
A natural cubic spline interpolating values y 0, …, y n at strictly increasing pillars x 0 < ⋯ < x n (e.g. an FX/equity vol smile sampled at pillar deltas) reduces, by the textbook derivation (matching first derivatives at the interior pillars and imposing the natural boundary conditions M 0 = M n = 0), to a linear system in the unknown interior second derivatives (moments) M 1, …, M (n-1). The system is defined here as the textbook states it, and then proved to be that condition: it holds exactly when adjacent cubic pieces have the same slope at the shared pillar (momentMatrix_mulVec_eq_iff). It is the normalized moment form of J. Stoer & R. Bulirsch, Introduction to Numerical Analysis, 3rd ed. (Springer, 2002), §2.4.2: dividing each row of the standard natural- spline system (stated on the same unknowns M i, with diagonal 2(h (i-1) + h i)) by h (i-1) + h i turns that diagonal into a constant 2 with off-diagonal weights μ i, λ i ≥ 0 summing to 1. Existence and uniqueness of the natural cubic spline is R. L. Burden & J. D. Faires, Numerical Analysis, 9th ed. (2011), Theorem 3.11; the strict-diagonal-dominance step formalized here is the same nonsingularity argument that theorem's proof uses, run on the normalized system. Distinct from the parametric SVI smile already in the repository (MathFin.SVI): this is a pillar-interpolation scheme, not a functional form.
Main definitions
gap, mu, lam — the pillar gaps and the two tridiagonal weights of the normalized moment system (μ i + λ i = 1 at every interior pillar).rhs — the moment system's right-hand side at an interior pillar.momentMatrix — the normalized moment-system matrix: constant diagonal 2, off-diagonal entries μ, λ (the row reads 2 M j + μ j · M (j-1) + λ j · M (j+1)).interpSpline — the standard piecewise-cubic formula built from the pillars, the data and a candidate moment sequence.
Main results
momentMatrix_invertible — the moment system's coefficient matrix is a unit, because it is strictly row diagonally dominant: Mathlib's det_ne_zero_of_sum_row_lt_diag (a corollary of Gershgorin's circle theorem) applied to the fact that every row has diagonal entry 2 and off-diagonal entries μ, λ ≥ 0 with μ + λ = 1 < 2.exists_unique_moments — consequently the moment system has exactly one solution (Matrix.mulVec_injective_iff_isUnit for uniqueness, A⁻¹ *ᵥ d for existence): this is the textbook's "the matrix is nonsingular" step of natural-cubic-spline uniqueness.hasDerivAt_interpSpline, hasDerivAt_deriv_interpSpline, deriv_interpSpline_left, deriv_interpSpline_right, deriv_deriv_interpSpline_left, deriv_deriv_interpSpline_right — the slopes of a piece at its two ends, and its second derivative M i, M (i+1) there.deriv_interpSpline_match_iff, momentMatrix_mulVec_eq_iff — the moment equation at a pillar is exactly the slope matching of the two adjacent pieces, so the moment system (with natural ends) is exactly the C¹ gluing condition.exists_unique_natural_spline_moments — there is exactly one moment sequence M with natural ends M 0 = M n = 0 whose moment-form pieces have equal slopes (C¹ matching) at every interior pillar. Separate lemmas show each piece interpolates the data and has second derivative M i at x i; there is no single glued function and no C² / ContDiff statement.interpSpline_left_eq, interpSpline_right_eq — the piecewise cubic interpSpline matches the pillar values y i, y (i+1) exactly at both ends of each piece [x i, x (i+1)], for any moment sequence (the interpolation property does not depend on which system the moments solve).svi_pillar_interpSpline_eq, svi_pillar_moments_unique — the connection to the parametric SVI smile already in the repository: if the pillar values are samples of an SVI slice's total variance at the pillar log-strikes, the spline reproduces that sampled value exactly at both pillars of each piece, and the natural-spline moment system for those SVI-sampled pillars has exactly one solution.
Scope
The glued function is not a single Lean object: the spline is the family of pieces interpSpline with the moments of exists_unique_natural_spline_moments, and its C¹ matching is the statement that adjacent pieces agree in slope (deriv_interpSpline_match_iff). The second derivatives of each piece are computed (deriv_deriv_interpSpline_left/_right), but no C² or ContDiff statement about one function on [x 0, x n] is made. The derivation of the moment system from the spline conditions is replaced by the equivalence momentMatrix_mulVec_eq_iff. The pillar values are arbitrary: nothing here says a spline through a vol smile or call price smile is free of arbitrage.
References
Tags
natural cubic spline, moment system, strict diagonal dominance, pillar interpolation, vol smile, MSC 91G60, JEL G13
Import neighbourhood
Above: what it imports. Below: what imports it.
Corpus entries
mf-cubic-spline-moments-unique · black_scholes.json · full statement
Natural Cubic Spline Moment System Has a Unique Solution
A natural cubic spline interpolating values y_0, ..., y_n at strictly increasing pillars x_0 < ... < x_n -- e.g. an FX/equity vol smile sampled at pillar deltas -- has, by the textbook derivation, a linear system in the interior second derivatives (moments) M_1, ..., M_(n-1) once the natural boundary conditions M_0 = M_n = 0 are substituted in; this entry defines that system (Stoer-Bulirsch normal form) and proves it uniquely solvable (the companion entry mf-natural-cubic-spline-exists-unique proves the system is the C^1 matching condition of the cubic pieces). Its coefficient matrix has diagonal entries 2 and off-diagonal entries mu_i, lambda_i >= 0 with mu_i + lambda_i = 1 < 2 in every row, so it is strictly row diagonally dominant and therefore a unit; the moment system has exactly one solution for any data y and any strictly increasing pillars x. In the module, not in the snippet: the piecewise-cubic formula built from any candidate moment sequence also matches the pillar values exactly at both ends of each piece, independent of which system the moments solve.
mf-natural-cubic-spline-exists-unique · black_scholes.json · full statement
Natural Cubic Spline Exists and Is Unique (C^1 Matching of the Moment Form)
For strictly increasing pillars x_0 < ... < x_n (n >= 2) and any data y, there is exactly one moment sequence M_0, ..., M_n with natural ends M_0 = M_n = 0 for which the moment-form cubic pieces on consecutive pillar intervals have equal slopes (C^1 matching) at every interior pillar. In the module, not in the snippet, separate lemmas show each piece interpolates the data and has second derivative M_i at x_i and M_(i+1) at x_(i+1); there is no single glued function and no C^2 or ContDiff statement. Proved by showing the Stoer-Bulirsch moment system is exactly the slope-matching condition and is uniquely solvable by strict diagonal dominance. Scope: the spline is the family of pieces, not a single function on [x_0, x_n] with a ContDiff statement; the data are arbitrary and nothing says a spline of a smile is arbitrage-free.
Declarations 30
defMathFin.CubicSpline.gapsource (ℕ → ℝ) → ℕ → ℝ
The gap h i = x (i+1) - x i between consecutive pillars.
defMathFin.CubicSpline.musource (ℕ → ℝ) → ℕ → ℝ
The left tridiagonal weight μ i = h (i-1) / (h (i-1) + h i) of the natural-cubic-spline moment system, at interior pillar index i.
defMathFin.CubicSpline.lamsource (ℕ → ℝ) → ℕ → ℝ
The right tridiagonal weight λ i = h i / (h (i-1) + h i) = 1 - μ i.
defMathFin.CubicSpline.rhssource (ℕ → ℝ) → (ℕ → ℝ) → ℕ → ℝ
The moment system's right-hand side at interior pillar index i: d i = 6/(h (i-1) + h i) · ((y (i+1) - y i)/h i - (y i - y (i-1))/h (i-1)).
theoremMathFin.CubicSpline.gap_possource ∀ {n : ℕ} (x : ℕ → ℝ), (∀ i < n, x i < x (i + 1)) → ∀ {i : ℕ}, i < n → 0 < gap x itheoremMathFin.CubicSpline.mu_nonnegsource ∀ (x : ℕ → ℝ) {i : ℕ}, 0 < gap x (i - 1) → 0 < gap x i → 0 ≤ mu x itheoremMathFin.CubicSpline.lam_nonnegsource ∀ (x : ℕ → ℝ) {i : ℕ}, 0 < gap x (i - 1) → 0 < gap x i → 0 ≤ lam x itheoremMathFin.CubicSpline.mu_add_lam_eq_onesource ∀ (x : ℕ → ℝ) {i : ℕ}, 0 < gap x (i - 1) → 0 < gap x i → mu x i + lam x i = 1defMathFin.CubicSpline.momentMatrixsource (ℕ → ℝ) → (n : ℕ) → Matrix (Fin (n - 1)) (Fin (n - 1)) ℝ
The tridiagonal moment-system matrix for the natural cubic spline on n + 1 pillars x 0 < ⋯ < x n, acting on the interior moments M 1, …, M (n-1) after the natural boundary conditions M 0 = M n = 0 have been substituted in. Row/column j : Fin (n - 1) corresponds to pillar index j.val + 1.
theoremMathFin.CubicSpline.momentMatrix_apply_selfsource ∀ (x : ℕ → ℝ) (n : ℕ) (j : Fin (n - 1)), momentMatrix x n j j = 2
theoremMathFin.CubicSpline.sum_fin_ite_const_lesource ∀ {m : ℕ} (P : Fin m → Prop) [DecidablePred P], (∀ (a b : Fin m), P a → P b → a = b) → ∀ {c : ℝ}, 0 ≤ c → (∑ k, if P k then c else 0) ≤ cA sum over Fin m that takes the value c ≥ 0 where P holds and 0 elsewhere is at most c when at most one index satisfies P.
theoremMathFin.CubicSpline.momentMatrix_dominantsource ∀ {n : ℕ} (x : ℕ → ℝ), 2 ≤ n → (∀ i < n, x i < x (i + 1)) → ∀ (j : Fin (n - 1)), ∑ k ∈ Finset.univ.erase j, ‖momentMatrix x n j k‖ < ‖momentMatrix x n j j‖Strict row diagonal dominance of the moment-system matrix. Every row has diagonal entry 2 and off-diagonal entries μ, λ ≥ 0 summing to at most μ + λ = 1 < 2, since a row has at most two nonzero off-diagonal entries (the left and right tridiagonal neighbours).
theoremMathFin.CubicSpline.momentMatrix_invertiblesource ∀ {n : ℕ} (x : ℕ → ℝ), 2 ≤ n → (∀ i < n, x i < x (i + 1)) → IsUnit (momentMatrix x n)Uniqueness of the natural cubic spline's interior moments (the nonsingularity step behind Burden & Faires, Numerical Analysis, 9th ed. (2011), Theorem 3.11, run on the normalized moment system of Stoer & Bulirsch, Introduction to Numerical Analysis, 3rd ed. (2002), §2.4.2): the moment system's coefficient matrix is a unit. A strictly row diagonally dominant real matrix has nonzero determinant (det_ne_zero_of_sum_row_lt_diag, Mathlib's Gershgorin.lean), hence is a unit (Matrix.isUnit_iff_isUnit_det).
theoremMathFin.CubicSpline.exists_unique_momentssource ∀ {n : ℕ} (x y : ℕ → ℝ), 2 ≤ n → (∀ i < n, x i < x (i + 1)) → ∃! M, (momentMatrix x n).mulVec M = fun j => rhs x y (↑j + 1)Existence and uniqueness of the natural cubic spline's interior moments. The linear system momentMatrix x n *ᵥ M = d — the natural-boundary moment system, with d the right-hand side rhs at each interior pillar — has exactly one solution M.
defMathFin.CubicSpline.interpSplinesource (ℕ → ℝ) → (ℕ → ℝ) → (ℕ → ℝ) → ℕ → ℝ → ℝ
The standard piecewise-cubic formula on the piece [x i, x (i+1)], built from the gap, the two pillar values and the two candidate moments Mi = M i, Mi1 = M (i+1): the moment form of the natural cubic spline piece, equivalent to the one in J. Stoer & R. Bulirsch, Introduction to Numerical Analysis, 3rd ed. (2002), §2.4.2 (regrouped here into two linear-in-t terms rather than kept in their own A j, B j grouping). Defined for any moment sequence M, independent of which linear system (if any) it solves.
theoremMathFin.CubicSpline.interpSpline_left_eqsource ∀ (x y M : ℕ → ℝ) {i : ℕ}, gap x i ≠ 0 → interpSpline x y M i (x i) = y iThe piecewise cubic matches the left pillar value exactly: interpSpline x y M i (x i) = y i.
theoremMathFin.CubicSpline.interpSpline_right_eqsource ∀ (x y M : ℕ → ℝ) {i : ℕ}, gap x i ≠ 0 → interpSpline x y M i (x (i + 1)) = y (i + 1)The piecewise cubic matches the right pillar value exactly: interpSpline x y M i (x (i+1)) = y (i+1).
theoremMathFin.CubicSpline.hasDerivAt_interpSplinesource ∀ (x y M : ℕ → ℝ) (i : ℕ) (t : ℝ), HasDerivAt (interpSpline x y M i) (-(M i * (x (i + 1) - t) ^ 2 / (2 * gap x i)) + M (i + 1) * (t - x i) ^ 2 / (2 * gap x i) - (y i / gap x i - M i * gap x i / 6) + (y (i + 1) / gap x i - M (i + 1) * gap x i / 6)) t
The first derivative of the piecewise cubic on [x i, x (i+1)], in moment form.
theoremMathFin.CubicSpline.hasDerivAt_deriv_interpSplinesource ∀ (x y M : ℕ → ℝ) (i : ℕ) (t : ℝ), HasDerivAt (deriv (interpSpline x y M i)) (M i * (x (i + 1) - t) / gap x i + M (i + 1) * (t - x i) / gap x i) t
The second derivative of the piecewise cubic on [x i, x (i+1)]: linear interpolation of the two moments.
theoremMathFin.CubicSpline.deriv_interpSpline_rightsource ∀ (x y M : ℕ → ℝ) {i : ℕ}, gap x i ≠ 0 → deriv (interpSpline x y M i) (x (i + 1)) = (y (i + 1) - y i) / gap x i + gap x i * M i / 6 + gap x i * M (i + 1) / 3The slope of the piece [x i, x (i+1)] at its right end.
theoremMathFin.CubicSpline.deriv_interpSpline_leftsource ∀ (x y M : ℕ → ℝ) {i : ℕ}, gap x i ≠ 0 → deriv (interpSpline x y M i) (x i) = (y (i + 1) - y i) / gap x i - gap x i * M i / 3 - gap x i * M (i + 1) / 6The slope of the piece [x i, x (i+1)] at its left end.
theoremMathFin.CubicSpline.deriv_deriv_interpSpline_leftsource ∀ (x y M : ℕ → ℝ) {i : ℕ}, gap x i ≠ 0 → deriv (deriv (interpSpline x y M i)) (x i) = M iThe curvature of the piece [x i, x (i+1)] at its left end is the moment M i.
theoremMathFin.CubicSpline.deriv_deriv_interpSpline_rightsource ∀ (x y M : ℕ → ℝ) {i : ℕ}, gap x i ≠ 0 → deriv (deriv (interpSpline x y M i)) (x (i + 1)) = M (i + 1)The curvature of the piece [x i, x (i+1)] at its right end is the moment M (i+1).
theoremMathFin.CubicSpline.deriv_interpSpline_match_iffsource ∀ (x y M : ℕ → ℝ) {i : ℕ}, 0 < gap x i → 0 < gap x (i + 1) → (deriv (interpSpline x y M i) (x (i + 1)) = deriv (interpSpline x y M (i + 1)) (x (i + 1)) ↔ mu x (i + 1) * M i + 2 * M (i + 1) + lam x (i + 1) * M (i + 2) = rhs x y (i + 1))The moment equation at an interior pillar is the first-derivative matching of the two adjacent pieces. For consecutive gaps h i, h (i+1) ≠ 0 with positive sum, the pieces on [x i, x (i+1)] and [x (i+1), x (i+2)] have the same slope at x (i+1) exactly when row i of the moment system holds: μ M i + 2 M (i+1) + λ M (i+2) = rhs.
theoremMathFin.CubicSpline.sum_fin_ite_val_eqsource ∀ {m : ℕ} (a : ℕ) (c : ℝ), (∑ k, if ↑k = a then c else 0) = if a < m then c else 0A sum over Fin m that takes the value c at the index whose value is a : ℕ and 0 elsewhere is c when a < m and 0 otherwise.
theoremMathFin.CubicSpline.momentMatrix_mulVec_applysource ∀ {n : ℕ} (x M : ℕ → ℝ), M 0 = 0 → M n = 0 → ∀ (j : Fin (n - 1)), (momentMatrix x n).mulVec (fun k => M (↑k + 1)) j = mu x (↑j + 1) * M ↑j + 2 * M (↑j + 1) + lam x (↑j + 1) * M (↑j + 2)A row of the moment system. Applied to the interior moments M 1, …, M (n-1) of a sequence with natural ends M 0 = M n = 0, row j of momentMatrix reads μ M j + 2 M (j+1) + λ M (j+2): the missing neighbours at the two ends are the zero moments.
theoremMathFin.CubicSpline.momentMatrix_mulVec_eq_iffsource ∀ {n : ℕ} (x y M : ℕ → ℝ), (∀ i < n, x i < x (i + 1)) → M 0 = 0 → M n = 0 → ((((momentMatrix x n).mulVec fun k => M (↑k + 1)) = fun j => rhs x y (↑j + 1)) ↔ ∀ (i : ℕ), i + 2 ≤ n → deriv (interpSpline x y M i) (x (i + 1)) = deriv (interpSpline x y M (i + 1)) (x (i + 1)))The moment system is exactly the C¹ gluing condition. For moments with natural ends M 0 = M n = 0, the interior moments solve the moment system if and only if every pair of adjacent pieces interpSpline x y M i, interpSpline x y M (i+1) has the same slope at the shared pillar x (i+1).
theoremMathFin.CubicSpline.exists_unique_natural_spline_momentssource ∀ {n : ℕ} (x y : ℕ → ℝ), 2 ≤ n → (∀ i < n, x i < x (i + 1)) → ∃ M, M 0 = 0 ∧ M n = 0 ∧ (∀ (i : ℕ), i + 2 ≤ n → deriv (interpSpline x y M i) (x (i + 1)) = deriv (interpSpline x y M (i + 1)) (x (i + 1))) ∧ ∀ (M' : ℕ → ℝ), M' 0 = 0 → M' n = 0 → (∀ (i : ℕ), i + 2 ≤ n → deriv (interpSpline x y M' i) (x (i + 1)) = deriv (interpSpline x y M' (i + 1)) (x (i + 1))) → ∀ k ≤ n, M' k = M kThe natural cubic spline exists and is unique. For strictly increasing pillars x 0 < ⋯ < x n (2 ≤ n) and any values y, there is a moment sequence with natural ends M 0 = M n = 0 for which adjacent pieces of interpSpline match in slope at every interior pillar, and it is the only one on 0, …, n. Separately, each piece interpolates the data (interpSpline_left_eq, interpSpline_right_eq) and has second derivative M i at x i from the right and M (i+1) at x (i+1) from the left (deriv_deriv_interpSpline_left, deriv_deriv_interpSpline_right); this theorem makes no C² claim.
theoremMathFin.CubicSpline.svi_pillar_interpSpline_eqsource ∀ (p : Params) (x M : ℕ → ℝ) {i : ℕ}, gap x i ≠ 0 → interpSpline x (fun j => variance p (x j)) M i (x i) = variance p (x i) ∧ interpSpline x (fun j => variance p (x j)) M i (x (i + 1)) = variance p (x (i + 1))Pillar interpolation of an SVI smile. If a smile's pillar values are samples of a raw-SVI slice's total variance MathFin.SVI.variance p at the pillar log-strikes x i, the natural-cubic-spline piecewise formula reproduces that sampled total variance exactly at both pillars of the piece [x i, x (i+1)], for any candidate moment sequence M. This is the pillar-interpolation reading of SVI's parametric smile: distinct from, and does not derive, the parametric curve MathFin.SVI.variance itself between pillars.
theoremMathFin.CubicSpline.svi_pillar_moments_uniquesource ∀ {n : ℕ} (p : Params) (x : ℕ → ℝ), 2 ≤ n → (∀ i < n, x i < x (i + 1)) → ∃! M, (momentMatrix x n).mulVec M = fun j => rhs x (fun k => variance p (x k)) (↑j + 1)Unique natural-spline moments for an SVI-sampled smile. Specializing exists_unique_moments to pillar values y j = MathFin.SVI.variance p (x j) sampled from a raw-SVI slice: the natural cubic spline interpolating an SVI smile's own pillar samples has exactly one moment vector, for any strictly increasing pillars x and any SVI parameters p.