7. Given the function $f(x)$
$=\left\{\begin{array}{l}\ln x, x>1, \\ \frac{1}{2} x+\frac{1}{2}, x \leqslant 1 .\end{array}\right.$ If $m<n$, and $f(m)=f(n)$, then the minimum value of $n-m$ is $\qquad$ .
Let $f(m)=f(n)=t, t \in(0,1]$, then $\frac{1}{2} m+\frac{1}{2}=t \Rightarrow m=2 t-1$, $\ln n=t \Rightarrow n=\mathrm{e}^{t}$. Thus $\varphi(t)=n-m=\mathrm{e}^{t}-2 t+1, \varphi^{\prime}(t)=\mathrm{e}^{t}-2$, so $\varphi(t)_{\min }=\varphi(\ln 2)=3-2 \ln 2$.