A cubic spline with knots is twice continuously differentiable and restricts to a polynomial of degree at most three between consecutive knots. It is a natural cubic spline when it is linear outside , equivalently when its second derivative vanishes at the two outer knots and on the exterior intervals.
Let be the natural cubic spline interpolating prescribed values and let be any other interpolant in . Then . Piecewise integration by parts, using that between knots, is continuous, on the exterior intervals, and every jump of is multiplied by , gives
Consequently
Equality forces almost everywhere. Then is affine and its zeros at at least two distinct knots force , proving uniqueness.
For the penalized problem, fix a vector of fitted values. The preceding variational result says that its natural spline interpolant has the least roughness among all functions taking those values, and by assumption that roughness is . The infinite-dimensional problem therefore reduces to
Because is positive semidefinite, is positive definite. The unique fitted-value vector is
and is its unique natural cubic spline interpolant.
For Leave-one-out cross-validation, let minimize
and define
If , its normal equations say
Thus , where
Taking the th coordinate and writing gives
Therefore one spline fit and the diagonal of its smoothing matrix give