4.2. The line $p: y=-x+1$ and two points $\mathrm{A}(-1,5)$ and $\mathrm{B}(0,4)$ are given. Determine the point $P$ on the line $p$ for which the sum of the lengths of the segments $|A P|+|P B|$ is minimal.
4.2. Let $B^{\prime}$ denote the point symmetric to point $B$ with respect to line $p$. Its coordinates are $(-3,1)$ (since line $p$ intersects the $y$-axis at point $(0,1)$ at an angle of $\frac{\pi}{4}$). The desired point $P$ is the intersection of line $p$ with the line determined by points $A$ and $B^{\prime}$. This is the line $y=2x+7$. The coordinates of point $P$ are $(-2,3)$.