4. As shown in Figure 3, it is known that quadrilateral $A B C D$ is a square, $\triangle A E P$ is an isosceles right triangle, $\angle E \Lambda P$ $=90^{\circ}$, and $D 、 P 、 E=$ are collinear points. If $E A=P A$ $=1, P B=\sqrt{5}$, then $D P$ $=$ . $\qquad$
4. $\sqrt{3}$.

Connect $B E$. It is easy to know, $\triangle A E B \cong \triangle A P D$.
Then $P D=E B$, and $P E \perp E B$.
So $B E=\sqrt{B P^{2}-E P^{2}}=\sqrt{5-2}=\sqrt{3}$.