RandomInstance can be used to create visual representations of geometric theorems. The Pythagorean theorem is a fundamental theorem in Euclidean geometry that states that for any right triangle with leg lengths and and hypotenuse , .
Visualize the Pythagorean theorem in terms of the areas of the squares based on each side of a right triangle.
A beautiful visual proof is to inscribe a square of side length in a square of side length in such a way that each vertex of the inner square divides a side of the outer square into two segments of length and .
Indeed, the area of the large square can be calculated in two ways.
The area of the outer square is the square of its side length , yielding .
Alternatively, the inner square has area , and each of the four triangles has area , so the area of the large square is , which is .
Hence , so .