Smooth completing-square proof of the Morse lemma (source code)

= Smooth completing-square proof of the Morse lemma

At a <nondegenerate critical point> placed at the origin, integral <Taylor theorem> gives $f(x)-f(0)=x^TA(x)x$, where $A(x)$ is a smooth symmetric matrix and $A(0)=\tfrac12\operatorname{Hess}f(0)$. A constant linear change makes $A(0)$ diagonal with entries $\pm1$. Successive completion of squares, with the <Schur complement> at each step, produces a smooth invertible triangular matrix $B(x)$ such that $x^TA(x)x=\sum_i\epsilon_i(B(x)x)_i^2$. The pivots keep their nonzero signs near zero. The map $x\mapsto B(x)x$ has invertible derivative at zero, so the <inverse function theorem> makes it a coordinate system. The signs are the <Hessian matrix> signature by <Sylvester's law of inertia>.