4. In $\triangle A B C$, $A B=A C, D$ is the midpoint of $B C$, $B E \perp A C$ at $E$, intersecting $A D$ at $P$. Given $B P=3$, $P E=1$. Then $P A=$ $\qquad$ .
4. $\sqrt{3}$.

As shown in the right figure, from $A D \perp B C$ and $B E \perp A C$, we know that $P, D, C, E$ are concyclic, so $B D \cdot B C = B P \cdot B E = 12$.
Solving this, we get $B D = \sqrt{6}$.
Thus, $P D = \sqrt{B P^{2} - B D^{2}} = \sqrt{3}$.
Furthermore, since $A, B, D, E$ are concyclic, we have $P A \cdot P D = P B \cdot P E = 3$.
Therefore, $P A = \sqrt{3}$.