Sturm counts are exact for a nearby matrix, and bisection keeps the k-th eigenvalue bracketed full
This proof shows: correctness, termination.
Notation of the page: T is real symmetric tridiagonal of order n with diagonal a1,…,an and off-diagonal b1,…,bn−1; its eigenvalues in increasing order are μ1≤⋯≤μn (so μk=λn+1−k in the decreasing order of the area); c(x)=#{i:μi<x}. The pivots are d1=a1−x and di=(ai−x)−bi−12/di−1.
Lemma 1 (pivots and minors). Let p0=1 and pi(x)=det(Ti−xI) for the leading i×i block Ti. Then pi=(ai−x)pi−1−bi−12pi−2, and if p1,…,pi−1=0, then di=pi/pi−1.
Proof. Expanding det(Ti−xI) along the last row gives the recurrence. Then pi/pi−1=(ai−x)−bi−12pi−2/pi−1=(ai−x)−bi−12/di−1 by induction. □
Theorem 1 (the count). If all pivots d1,…,dn are nonzero, then the number of negative pivots equals c(x).
Proof. When all di=0, Gaussian elimination without pivoting gives T−xI=LDLT with L unit lower bidiagonal (li+1,i=bi/di) and D=diag(d1,…,dn), which is checked entry by entry: the (i+1,i) entry is li+1,idi=bi and the (i+1,i+1) entry is li+1,i2di+di+1=bi2/di+di+1=ai+1−x. By Sylvester's law of inertia, T−xI and D have the same number of negative eigenvalues. The eigenvalues of T−xI are μi−x, so that number is c(x). □
If x is not an eigenvalue of any leading block, all pivots are nonzero. The implementation replaces a pivot with ∣di∣<πmin by −πmin, where πmin=SAFMIN⋅max(1,maxibi2). In exact arithmetic this is the count for x replaced by a point within a distance of order πmin, and it keeps bi2/di finite: bi2/πmin≤1/SAFMIN does not overflow.
Theorem 2 (floating point, Kahan 1966). In IEEE arithmetic, the computed count at x is the exact count c~(x) of a matrix T~ with the same diagonal and off-diagonal entries b~i=bi(1+ηi), ∣ηi∣≤2.5u+O(u2), up to the replacement of tiny pivots described above.
Proof. Write ϵj for rounding errors with ∣ϵj∣≤u. Step i computes t=(ai−x)(1+ϵ1), s=bi−12(1+ϵ2), q=(s/d^i−1)(1+ϵ3) and d^i=(t−q)(1+ϵ4). Define the scaled pivots di′=d^i/((1+ϵ1)(1+ϵ4)), which have the signs of d^i. Then d^i−1=di−1′(1+ϵ1′)(1+ϵ4′) with the errors of step i−1, and
di′=(ai−x)−(1+ϵ1)(1+ϵ1′)(1+ϵ4′)bi−12(1+ϵ2)(1+ϵ3)⋅di−1′1. So the di′ are the exact pivots of the matrix with the same diagonal and b~i−12=bi−12⋅(1+ϵ2)(1+ϵ3)/((1+ϵ1)(1+ϵ1′)(1+ϵ4′)). This is five factors of the form 1+O(u), so b~i−1=bi−1(1+ηi−1) with ∣ηi−1∣≤2.5u+O(u2). The computed and the exact pivots have the same signs, so the counts agree (Kahan 1966; Demmel, Section 5.3.4). □
By Weyl's inequality, ∣μ~k−μk∣≤∥T~−T∥2≤2⋅2.5umaxi∣bi∣+O(u2), an absolute error of order u∥T∥2. For classes of matrices whose eigenvalues are determined to high relative accuracy by relative changes of the bi (for example zero diagonal, the case of a bidiagonal SVD), the eigenvalues of T~ are relatively close to those of T and bisection gives high relative accuracy (Demmel and Kahan 1990). In IEEE arithmetic the computed count is also a monotone function of x (Demmel, Dhillon and Ren 1995), which the bracketing argument below uses.
Theorem 3 (bisection invariant). Let the loop start with c(ℓ)<k≤c(h) for ℓ<h. If each step sets h←x when c(x)≥k and ℓ←x otherwise, then c(ℓ)<k≤c(h) holds after each step, and so μk∈[ℓ,h).
Proof. The update keeps the two inequalities by construction. c(ℓ)<k means fewer than k eigenvalues lie below ℓ, so μk≥ℓ. c(h)≥k means at least k eigenvalues lie below h, so μk<h. □
The start. By the Gershgorin theorem, every eigenvalue lies in [gℓ,gh] with gℓ=mini(ai−∣bi−1∣−∣bi∣) and gh=maxi(ai+∣bi−1∣+∣bi∣). The code widens this interval by 2numax(∣gℓ∣,∣gh∣)+2πmin, which covers the perturbations of Theorem 2 and the pivot replacement, so that the computed counts satisfy c(ℓ)=0<k≤n=c(h).
Termination and the result. Each step halves h−ℓ, as long as the midpoint is a floating-point number strictly between ℓ and h. So after s steps h−ℓ=2−s(h0−ℓ0), and the loop stops after at most ⌈log2((h0−ℓ0)/τ)⌉ steps for an absolute tolerance τ>0. With τ=0 it stops when the relative width reaches 2u or no floating-point number lies strictly between ℓ and h, which happens after at most about 2100 steps (the exponent range plus the 53 binary digits of the significand). The returned midpoint is within (h−ℓ)/2 of the k-th eigenvalue of the matrix T~ of Theorem 2.