A square is folded so that a vertex lies on an opposite side. Prove the perimeter of the red triangle equals the semiperimeter of the square.