Let $H$ be a hilbert space and $C$ a nonempty closed convex subset. Then we have the projection $P_C: H \to C$.
I want to show that this operator is a contraction. The proof uses the identity
$$\Vert P_C g - P_C h\Vert^2 = \Re( \langle P_Cg -g, P_Cg -P_Ch \rangle + \langle P_C h - h , P_C h - P_C g\rangle + \langle g-h, P_C g - P_C h \rangle).$$
I can't see how we get this identity. How do we derive this?
I don't think anything fancy is going on in this step: we can write $\|P_Cg-P_Ch\|^2 = \langle P_Cg-P_Ch,P_Cg-P_Ch\rangle$, and we can rewrite the first $P_Cg-P_Ch$ as $(P_Cg-g)-(P_Ch-h)+(g-h)$ (leave the second entry as is). This gives the quantity inside the real part of the RHS of the identity, and since the quantity is clearly real we can add on the real part for free.