Write [n] for the initial segment determined by n. By Symmetric, Positive Semidefinite, and Positive Definite Real Matrices and Transpose of a Real Matrix, symmetry of B means Bij=Bji for all i,j∈[n], and positive semidefiniteness means 0≤z⋅(Bz) for every z∈Rn. Record that squares are nonnegative in an ordered field: 00=0 by Zero Products and Elementary Identities in a Field; if 0<t then 0<tt by claim 5 of Elementary Order Arithmetic in an Ordered Field; and if t<0 then 0<−t by claim 4 of that lemma, so 0<(−t)(−t)=tt.
Claim 1. By claim 4 of Linearity of the Matrix-Vector Product and the Quadratic Form as a Double Sum,
y⋅(Bx)=i=1∑nj=1∑nBijyixj,x⋅(By)=i=1∑nj=1∑nBijxiyj,
the sums being finite sums in R. Interchanging the order of summation in the first double sum by Interchange of a Finite Double Sum and then renaming the two summation indices turns it into ∑i=1n∑j=1nBjiyjxi, which equals the second double sum because Bji=Bij and multiplication in R is commutative.
Claim 2. Put α=x⋅(Bx), β=x⋅(By) and γ=y⋅(By), so that 0≤α and 0≤γ. Let t∈R. By claim 3 of Linearity of the Matrix-Vector Product and the Quadratic Form as a Double Sum and claims 2, 4 and 5 of Bilinearity and Symmetry of the Dot Product on Rn, together with claim 1 above,
0≤(x+ty)⋅(B(x+ty))=α+tβ+tβ+t2γ.(∗)
Since ≤ is total, either γ=0 or 0<γ.
Suppose γ=0, so that t2γ=0 by Zero Products and Elementary Identities in a Field and (∗) reads 0≤α+tβ+tβ for every t∈R. Assume for contradiction that β=0. Setting 2=1+1, we have 0<2 by claim 8 of Elementary Order Arithmetic in an Ordered Field, so 2=0, and therefore 2β=0 by Zero Products and Elementary Identities in a Field. Taking t=−(α+1)(2β)−1 in (∗), and using tβ+tβ=t(2β), gives 0≤α−(α+1)=−1, which contradicts 0<1 (claim 6 of Elementary Order Arithmetic in an Ordered Field) by claim 4 of that lemma. Hence β=0, so β2=0 and αγ=0 by Zero Products and Elementary Identities in a Field, and the asserted inequality reads 0≤0.
Suppose now 0<γ. By claim 7 of Elementary Order Arithmetic in an Ordered Field, γ−1 exists and 0<γ−1. Taking t=−βγ−1 in (∗) and simplifying with the field axioms,
tβ+tβ+t2γ=−β2γ−1−β2γ−1+β2γ−1=−β2γ−1,
so 0≤α−β2γ−1, that is β2γ−1≤α by claim 3 of Elementary Arithmetic in an Ordered Field. Multiplying by the nonnegative element γ using claim 5 of Elementary Arithmetic in an Ordered Field, and using γ(β2γ−1)=β2, gives β2≤γα=αγ.
Claim 3. Suppose x⋅(Bx)=0 and let i∈[n]. Let ei∈Rn be the point whose ith coordinate is 1 and whose remaining coordinates are 0. Applying claim 2 with y=ei, and using 0s=0 from Zero Products and Elementary Identities in a Field,
(x⋅(Bei))2≤0⋅(ei⋅(Bei))=0.
Since squares are nonnegative, (x⋅(Bei))2=0, and hence x⋅(Bei)=0 by Zero Products and Elementary Identities in a Field. By claim 1, ei⋅(Bx)=x⋅(Bei)=0.
Finally, by Difference, Dot Product, and Orthogonality in Rn, ei⋅(Bx)=∑k=1n(ei)k(Bx)k; every summand with k=i vanishes, because (ei)k=0 and 0s=0, so claim 7 of Properties of Finite Sums evaluates this sum as (ei)i(Bx)i=(Bx)i. Hence (Bx)i=0 for every i∈[n], that is Bx=0Rn by The Origin of Rn.