4. $\frac{\sqrt{6}}{6}$ As shown in the figure, connect $B D$ and $D_{1} B_{1}$,

Obviously, $A_{1} C_{1} \perp$ plane $B D D_{1} B_{1}$, let $A_{1} C_{1} \cap D_{1} B_{1}=O$. In the plane $B D D_{1} B_{1}$, construct $O H \perp B D_{1}$ at $H$, then $A_{1} C_{1} \perp O H$, so segment $O H$ is the common perpendicular segment of the skew lines $A_{1} C_{1}$ and $B D_{1}$. In the right triangle $\triangle B B_{1} D_{1}$, $O H$ is half the altitude on the hypotenuse $B D_{1}$, so $O H=\frac{1}{2} \cdot \frac{B B_{1} \cdot B_{1} D_{1}}{B D_{1}}=\frac{1}{2} \cdot \frac{1 \cdot \sqrt{2}}{\sqrt{3}}=\frac{\sqrt{6}}{6}$.
4. For the cube $A B C D-A_{1} B_{1} C_{1} D_{1}$ with edge length 1, the distance between the lines $A_{1} C_{1}$ and $B D_{1}$ is