That proof can also be done sort of backwards and is arguably easier that way. Instead of using three triangles of known dimensions and proving they can be assembled into a rectangle, start with the rectangle and find the dimensions of the triangles.

Take a right triangle with sides , , and . Draw perpendiculars to the hypotenuse at each end and a parallel line through the third vertex to make a rectangle .

Angles and are congruent (alternate interior angles). So are and since both are complementary with . So triangles and are similar; the hypotenuses are in the ratio , so the vertical leg and the horizontal leg . Likewise we find (as it should be) and . But then implies or, multiplying though by , .

(Right away you know this proof fails in non Euclidean geometry, because in the first steps it relies on there being one and only one line parallel to through .)

this proof fails in non Euclidean geometryNot just that; this even works as a proof by contradiction that there are no non-identical congruent triangles in non-Euclidean geometries. (Probably many proofs of PT can be adapted for that, or for some other result of non-Euclidean geometry, I suppose.)