Build the idea in three steps
- A Pythagorean triple is three whole numbers sitting on a right triangle, and the definition spends exactly one line on it: PythagoreanTriple x y z just means x * x + y * y = z * z.
- Check the family: 3 ^ 2 + 4 ^ 2 = 9 + 16 = 25 = 5 ^ 2, so (3, 4, 5) is a triple — and multiplying every side by 2 gives another: (6, 8, 10).
- The legs are interchangeable: pythagoreanTriple_comm swaps x and y, because x * x + y * y = y * y + x * x. The proof is delta to unfold the one-line definition, then rw [add_comm].
A small example
(5, 12, 13) joins the family: 25 + 144 = 169. Here the word "diagram" and the word "equation" are the same thing — that is the quiet power of a one-line definition.