5. On the sides $B C$ and $C D$ of the square $A B C D$, points $E$ and $F$ are chosen such that the angle $E A F$ is $45^{\circ}$. The length of the side of the square is 1. Find the perimeter of triangle $C E F$.
Solution. If point $D$ is reflected across line $A F$, and then across line $A E$, it will transition to point $B$. Indeed, the composition of two axial symmetries relative to intersecting lines is a rotation by twice the angle between the lines. In our case, these two symmetries are equivalent to a $90^{\circ}$ rotation around point $A$.

This means that the image of point $D$ under the symmetry relative to $A F$ and the image of point $B$ under the symmetry relative to $A E$ are the same

![](https://cdn.mathpix.com/cropped/2024_05_06_12c6f2bb73fb9dd0ba03g-2.jpg?height=437&width=417&top_left_y=804&top_left_x=1525)
point; on the diagram, it is denoted by $K$. From point $K$, segments $A E$ and $A F$ are seen at a $90^{\circ}$ angle (since angles are preserved under symmetry, for example, angles $A B E$ and $A K E$ are equal). Therefore, point $K$ is the foot of the perpendicular dropped from point $A$ to line $E F$.

Finally, since $B E = E K$ and $D F = F K$ (lengths of segments are preserved under symmetry), we see that the perimeter of triangle $C E F$ is equal to the sum of the lengths of sides $B C$ and $C D$ of the square.

Answer: 2.