Pythagoras' Theorem

Pythagoras' Theorem states that given three points $$A_1 \equiv [x_1, y_1]$$, $$A_2 \equiv [x_2, y_2]$$, and $$A_3 \equiv [x_3, y_3]$$, the lines $$l_1 \equiv l(A_2,A_3) $$ and $$l_2 \equiv l(A_1,A_3)$$ are perpendicular exactly when

$$ Q_1 + Q_2 = Q_3 $$

where $$ Q_1 \equiv Q(A_2,A_3)$$, $$ Q_2 \equiv Q(A_1,A_3)$$, and $$ Q_3 \equiv Q(A_1,A_2)$$

Proof
In terms of the coordinates

$$ l_1 = \langle y_2 - y_3 : x_3 - x_2 : x_2 y_3 - x_3 y_2 \rangle $$

$$ l_2 = \langle y_1 - y_3 : x_3 - x_1 : x_1 y_3 - x_3 y_1 \rangle $$

Thus they are perpendicular when

$$ (y_1 - y_3)(y_2 - y_3) + (x_3 - x_1)(x_3 - x_2) = 0 $$

Doubling each side of the equation yields

$$ 2 (y_1 - y_3)(y_2 - y_3) + (x_3 - x_1)(x_3 - x_2)$$

$$= 2 (x_3^2 - x_2 x_3 - x_1 x_3 + x_2 x_1 + y_1 y_2 - y_1 y_3 - y_2 y_3 + y_3^2)$$

$$= (x_2 - x_3)^2 + (y_2 - y_3)^2 + (x_1 - x_3)^2 + (y_1 - y_3) ^ 2 - (x_2 - x_1)^2 - (y_2 - y_1) ^2$$

$$= Q_1 + Q_2 - Q_3$$

as desired.