Throughout we use the notation of the statement. We first record an identity used twice below.
(P) Let x,y∈Rn, let t∈R, put s=1−t and w=tx+sy. Then
t(x⋅(Mx))+s(y⋅(My))−w⋅(Mw)=ts((x−y)⋅(M(x−y))).
Indeed, since M⊤=M, claim 5 of Elementary Properties of the Transpose of a Real Matrix together with claim 1 of Bilinearity and Symmetry of the Dot Product on Rn gives x⋅(My)=y⋅(Mx). By claim 3 of Linearity of the Matrix-Vector Product and the Quadratic Form as a Double Sum we have Mw=t(Mx)+s(My), so expanding with claims 2, 3, 4 and 5 of Bilinearity and Symmetry of the Dot Product on Rn,
w⋅(Mw)=t2x⋅(Mx)+2tsx⋅(My)+s2y⋅(My).
Hence the left-hand side of the display equals (t−t2)x⋅(Mx)+(s−s2)y⋅(My)−2tsx⋅(My). Since t+s=1 we have t−t2=t(1−t)=ts and s−s2=s(1−s)=st, so this equals
ts(x⋅(Mx)−2x⋅(My)+y⋅(My))=ts((x−y)⋅(M(x−y))),
the last equality by expanding (x−y)⋅(M(x−y)) in the same way and using x⋅(My)=y⋅(Mx).
Claim 1. By claim 4 of Linearity of the Matrix-Vector Product and the Quadratic Form as a Double Sum and the coordinate description of the dot product,
Q(z)=21i=1∑nj=1∑nMijzizj+i=1∑nqizi+c.
For i∈[n] let πi:Rn→R be the ith coordinate function, πi(z)=zi. The set Rn is open, every point being the centre of a ball contained in it. By claim 2 of Constants, Coordinate Functions, Sums and Products of Ck Functions on a Euclidean Open Set the functions πi and the constant functions are smooth on Rn, hence of class C2, and by claim 3 of that lemma sums, scalar multiples and products of functions of class C2 are again of class C2. Since a finite sum is defined recursively, induction on the upper limit shows that a finite sum of functions of class C2 is of class C2. Applying this to the display shows that Q is of class C2 on Rn.
We next compute the partial derivatives. Directly from Partial Derivative on a Euclidean Open Set, for k,i∈[n] and a∈Rn the difference quotient of πi at a with respect to the kth variable is constantly 1 if k=i and constantly 0 otherwise, so ∂kπi(a)=1 if k=i and ∂kπi(a)=0 otherwise. By claim 1 of Constants, Coordinate Functions, Sums and Products of Ck Functions on a Euclidean Open Set, extended to finite sums by the same induction as above, and by the product rule there,
∂kQ(z)=21i=1∑nj=1∑nMij(∂kπi(z)zj+zi∂kπj(z))+i=1∑nqi∂kπi(z).
By claim 7 of Properties of Finite Sums the last sum equals qk. Splitting the double sum by claim 2 of Properties of Finite Sums, applied to the inner and then the outer sum, gives two double sums. In the first, for fixed i claim 3 of Properties of Finite Sums gives ∑jMij∂kπi(z)zj=∂kπi(z)∑jMijzj=∂kπi(z)(Mz)i by Matrix-Vector Product, and then claim 7 of Properties of Finite Sums over i leaves only the term i=k, giving (Mz)k. In the second, for fixed i only the term j=k survives, again by claim 7, giving Mikzi, and summing over i and using Mik=Mki gives ∑iMkizi=(Mz)k. Hence
∂kQ(z)=21((Mz)k+(Mz)k)+qk=(Mz)k+qk=(Mz+q)k,
so DQ(z)=Mz+q by Gradient of a Real-Valued Function on a Euclidean Open Set. Consequently ∂lQ is the function z↦∑j=1nMljzj+ql, whose partial derivative with respect to the kth variable is, by the same computation, ∂k∂lQ(z)=∑j=1nMlj∂kπj(z)=Mlk. By Hessian Matrix of a C^2 Function the entry of D2Q(z) in row k and column l is ∂k∂lQ(z)=Mlk=Mkl, so D2Q(z)=M.
Finally, for open V⊆Rn the restriction of Q to V is of class C2 on V by claim 3 of Restriction of a Ck Map to an Open Subset, and its partial derivatives at points of V agree with those of Q by claim 1 of that lemma, so its gradient and Hessian at z∈V are Mz+q and M.
Claim 2. Let z0∈V−b, so z0+b∈V. Since V is open there is a positive ρ with {z′:dE(z′,z0+b)<ρ}⊆V. For z∈Rn we have (z+b)−(z0+b)=z−z0, so dE(z+b,z0+b)=∥z−z0∥=dE(z,z0) by claim 2 of Elementary Properties of the Euclidean Norm on Rn; hence dE(z,z0)<ρ implies z+b∈V, that is z∈V−b. So V−b is open.
Let ψ be of class C2 on V and let i∈[n] and z∈V−b. For h∈R the point obtained from z by adding h to its ith coordinate, translated by b, is the point obtained from z+b by adding h to its ith coordinate; therefore the difference quotients of ψb at z and of ψ at z+b with respect to the ith variable coincide, and Partial Derivative on a Euclidean Open Set gives that ∂iψb(z) exists and equals ∂iψ(z+b). In other words ∂iψb=(∂iψ)b, the translate of ∂iψ in the same sense.
The translation map T:V−b→V, T(z)=z+b, satisfies dE(T(z),T(z′))=dE(z,z′) as computed above, hence is Lipschitz and so continuous by A Lipschitz Map is Uniformly Continuous. Therefore, by claim 3 of Semicontinuity and Continuity Under Composition with a Continuous Map, the translate of any function continuous on V is continuous on V−b. Since ψ is of class C2 on V, it is of class C1 and each ∂iψ is of class C1 on V, by clauses 1 and 2 of C^k Maps on a Euclidean Open Set. Applying the two previous paragraphs, ψb is continuous on V−b, its partial derivatives exist and equal the translates of those of ψ and are continuous, so ψb is of class C1; and the same argument applied to each ∂iψ shows that ∂iψb=(∂iψ)b is of class C1 on V−b. By clause 2 of C^k Maps on a Euclidean Open Set, ψb is of class C2 on V−b. Finally Dψb(z)=(∂1ψ(z+b),…,∂nψ(z+b))=Dψ(z+b), and the entry of D2ψb(z) in row i and column j is ∂i∂jψb(z)=∂i((∂jψ)b)(z)=∂i∂jψ(z+b), so D2ψb(z)=D2ψ(z+b).
Claim 3. Let x,y∈C and let t∈R with 0≤t≤1; put s=1−t, so 0≤s, and w=tx+sy, which lies in C because C is convex. Since t+s=1, claims 2, 4 and 5 of Bilinearity and Symmetry of the Dot Product on Rn give t(q⋅x+c)+s(q⋅y+c)=q⋅w+c. Hence, by (P),
tQ(x)+sQ(y)−Q(w)=21(tx⋅(Mx)+sy⋅(My)−w⋅(Mw))=21ts((x−y)⋅(M(x−y))).
By hypothesis 0n⪯M, which by The Positive Semidefinite Ordering on Symmetric Matrices means ζ⋅(0nζ)≤ζ⋅(Mζ) for every ζ; since ζ⋅(0nζ)=∑i=1n∑j=1n0⋅ζiζj=0 by claim 4 of Linearity of the Matrix-Vector Product and the Quadratic Form as a Double Sum together with two applications of claim 7 of Properties of Finite Sums, every summand being 0, the quadratic form (x−y)⋅(M(x−y)) is nonnegative. As ts is nonnegative, the right-hand side is nonnegative, so Q(w)≤tQ(x)+sQ(y). By Convex Real-Valued Function on a Convex Subset of Rn the restriction of Q to C is convex on C.
Claim 4. Write L=∥M∥, which is nonnegative by claim 1 of Properties of the Norm of a Symmetric Real Matrix; hence 0≤λ+L. Let x,y∈C and t∈R with 0≤t≤1, put s=1−t and w=tx+sy∈C. Since f is semiconvex on C with constant λ, Quadratic Increment Characterisation of Semiconvexity gives
f(w)≤tf(x)+sf(y)+2λts∥x−y∥2.
Using t(q⋅x+c)+s(q⋅y+c)=q⋅w+c as in claim 3, we obtain
g(w)−(tg(x)+sg(y))=(f(w)−tf(x)−sf(y))+21(tx⋅(Mx)+sy⋅(My)−w⋅(Mw)),
so by the previous display and (P),
g(w)−(tg(x)+sg(y))≤2λts∥x−y∥2+21ts((x−y)⋅(M(x−y))).
By claim 2 of Properties of the Norm of a Symmetric Real Matrix and claim 3 of Properties of the Absolute Value in an Ordered Field, (x−y)⋅(M(x−y))≤L∥x−y∥2, and ts is nonnegative, so
g(w)≤tg(x)+sg(y)+2λ+Lts∥x−y∥2.
As x,y∈C and t were arbitrary, Quadratic Increment Characterisation of Semiconvexity shows that g is semiconvex on C with constant λ+L=λ+∥M∥.