The parallelogram law from plane geometry

The sum of the squares of the lengths of two diagonals of a parallelogram is equal to the sum of the squares of all four sides.
Let O,P,S,Q be vertices of a parallelogram (see Fig 1 and Fig 2) Then
   |OS|2 + |QP|2   =   |OP|2 + |PS|2 + |SQ|2 + |QO|2
   |OS|2 + |QP|2   =   |OP|2 + |PS|2 + |SQ|2 + |QO|2
Because opposite sides of a parallelogram have equal lengths, these equations are equivalent to
($)    |OS|2 + |QP|2   =   2|OP|2 + 2|OQ|2
($)    |OS|2 + |QP|2   =   2|OP|2 + 2|OQ|2

Also let θ be the angle at O. So that a genuine parallelogram exists,
         0° < θ < 180°.
There are actually two situations (see Fig 3 and Fig 4):
       0° < θ ≤ 90°   and   90° < θ < 180°.



From vertex Q draw diagonal QP and drop a perpendicular down to line OP. Then pairs of right triangles are formed:
   triangle OMQ and PMQ
in both figures Fig 5 and Fig 6. By the Pythagorean theorem
  |OQ|2 = |OM|2 + |MQ|2,    |QP|2 = |PM|2 + |MQ|2
in both figures. Subtract the two equations to eliminate |MQ|2 to get
(&)    |QP|2 − |OQ|2 = |PM|2 − |OM|2
which is true for both parallelograms.

But now arguments for the black and red parallelograms are different.

In the black parallelogram, eliminate |PM|2 by substitution   |PM| = |OP| − |OM| whose square is
|PM|2 = |OP|2 − 2 |OP| |OM| + |OM|2
Inserting the right side of this equation for |PM|2 in equation (&) produces
(@)    |QP|2 − = |OP|2 + |OQ|2 − 2 |OP| |OM|.

In the red parallelogram, eliminate |PM|2 by substitution   |PM| = |OP| + |OM| to get from (&)
(@)    |QP|2 − = |OP|2 + |OQ|2 + 2 |OP| |OM|.


From vertex S draw diagonal OS and drop a perpendicular down to line OP. Then pairs of right triangles are formed:
   triangle ONS and PNS
in both figures Fig7 and Fig 8. By the Pythagorean theorem
  |PS|2 = |PN|2 + |NS|2,    |OS|2 = |ON|2 + |NS|2
in both figures. Subtract the two equations to eliminate |NS|2 to get
   |OS|2 − |PS|2 = |ON|2 − |PN|2
But |PS| = |OQ| so
(&&)    |OS|2 − |OQ|2 = |ON|2 − |PN|2
which is true for both parallelograms.

But now arguments for the black and red parallelograms are different.

In the black parallelogram, eliminate |ON|2 by substitution   |ON| = |OP| + |PN| whose square is
|ON|2 = |OP|2 − 2 |OP| |PN| + |PN|2
Inserting the right side of this equation for |ON|2 in equation (&&) produces
(%)    |OS|2 = OP2 + |OQ|2 + 2 |OP| |PN|.

In the red parallelogram, eliminate |ON|2 by substitution   |ON| = |OP| − |PN| to get from (&&)
(%)    |OS|2 = |OP|2 + |OQ|2 − 2 |OP| |ON|.

Actually all the black parallelograms are the same. So right triangle OQM and PSN are congruent. Hence |OM| = |PN|.
Similarly, OQM and PSN are congruent. Hence OM = PN. Equations (%) and (%) become
(@@)    |OS|2 = OP2 + |OQ|2 + 2 |OP| |OM|.
(@@)    |OS|2 = OP2 + |OQ|2 − 2 |OP| |OM|. .

Addition of equations (@) and (@@) and addition of equations (@) and (@@) produce the desired equations
|QP|2 + |OS|2 = 2|OP|2 + 2|OQ|2
|QP|2 + |OS|2 = 2|OP|2 + 2|OQ|2