9. Let $O(0,0), A(1,0), B(0,1)$, and $P$ be a moving point on the line segment $AB$, $\boldsymbol{A P}=\lambda \boldsymbol{A B}$. If
$$
O P \cdot A B \geqslant P A \cdot P B,
$$

then the range of the real number $\lambda$ is $\qquad$
9. $\left[1-\frac{\sqrt{2}}{2}, 1\right]$.

Using the graph, we can set point $P(1-\lambda, \lambda)(0<\lambda<1)$. Then
$$
\begin{array}{l}
\boldsymbol{O P}=(1-\lambda, \lambda), \boldsymbol{A} \boldsymbol{B}=(-1,1), \\
\boldsymbol{P A}=(\lambda,-\lambda), \boldsymbol{P B}(\lambda-1,1-\lambda) .
\end{array}
$$

From $\boldsymbol{O P} \cdot \boldsymbol{A B} \geqslant \boldsymbol{P A} \cdot \boldsymbol{P B}$, we get
$$
\lambda-1+\lambda \geqslant \lambda^{2}-\lambda+\lambda^{2}-\lambda \text {. }
$$

Solving this, we get $1-\frac{\sqrt{2}}{2} \leqslant \lambda \leqslant 1$.
Therefore, the range of the real number $\lambda$ is $\left[1-\frac{\sqrt{2}}{2}, 1\right]$.