4. In the right triangular prism $A_{1} B_{1} C_{1}-A B C$, $\angle B A C=\frac{\pi}{2}, A B=A C=A A_{1}=1$. Given that $G$ and $E$ are the midpoints of $A_{1} B_{1}$ and $C C_{1}$, respectively, and $D$ and $F$ are moving points on segments $A C$ and $A B$ (excluding the endpoints). If $G D \perp E F$, then the range of the length of segment $D F$ is
A. $\left[\frac{1}{\sqrt{5}}, 1\right)$
B. $\left[\frac{1}{5}, 2\right)$
C. $[1, \sqrt{2})$
D. $\left[\frac{1}{\sqrt{5}}, \sqrt{2}\right)$
Answer
As shown in the figure, using $\overrightarrow{A B}, \overrightarrow{A C}, \overrightarrow{A A_{1}}$ as the $x, y, z$ axes to establish a rectangular coordinate system, then $E\left(0,1, \frac{1}{2}\right), G\left(\frac{1}{2}, 0,1\right)$. Let $F(x, 0,0), D(0, y, 0), \overrightarrow{G D}=\left(-\frac{1}{2}, y,-1\right)$,
$\overrightarrow{E F}=\left(x,-1,-\frac{1}{2}\right)$. Therefore, $\overrightarrow{G D} \cdot \overrightarrow{E F}=-\frac{1}{2} x-y+\frac{1}{2}=0$
$\Rightarrow x+2 y-1=0 \Rightarrow y=\frac{1-x}{2} \in\left(0, \frac{1}{2}\right)$.
Thus, $D F^{2}=x^{2}+y^{2}=(2 y-1)^{2}+y^{2}=5 y^{2}-4 y+1$
$=5\left(y-\frac{2}{5}\right)^{2}+\frac{1}{5} \in\left[\frac{1}{5}, 1\right) \Rightarrow D F \in\left[\frac{1}{\sqrt{5}}, 1\right)$.
Therefore, the answer is $A$.