12. Determine the number of common tangents to the curves $f(x)=e^{x-1}$ and $g(x)=\ln x$, and explain the reasoning.

Translate the above text into English, please retain the original text's line breaks and format, and output the translation result directly.
Solve the problem: The curves $f(x)=e^{x-1}$ and $g(x)=\ln x$ have two common tangents.
Let the common tangent line be $l$, which touches the curve $f(x)=e^{x-1}$ at the point $\left(a, e^{a-1}\right)$ and the curve $g(x)=\ln x$ at the point $(b, \ln b)$. The equation of the line $l$ can be written as $y-e^{a-1}=e^{a-1}(x-a)$, i.e., $y=e^{a-1} x+e^{a-1}-a e^{a-1}$;
It can also be written as $y-\ln b=\frac{1}{b}(x-b)$, i.e., $y=\frac{1}{b} x+\ln b-1$.
Since line $l$ is a common tangent, we have $\left\{\begin{array}{l}e^{a-1}=\frac{1}{b} \\ e^{a-1}-a e^{a-1}=\ln b-1\end{array}\right.$.
6 points
Eliminating and rearranging, we get $e^{a-1}-a e^{a-1}+a=0$, so the number of roots of this equation is the number of common tangents between the two curves.
Let $m(x)=e^{x-1}-x e^{x-1}+x, m^{\prime}(x)=1-x e^{x-1}, \quad m^{\prime \prime}(x)=(-1-x) e^{x-1}$.
When $x \in(-\infty,-1)$, $m^{\prime \prime}(x)>0, m^{\prime}(x)=1-x e^{x-1}$ is an increasing function;
When $x \in(-1,+\infty)$, $m^{\prime \prime}(x)<0, m^{\prime}(x)$ is a decreasing function.
Since $m^{\prime}(-1)=1+e^{-2}>0, \quad m^{\prime}(1)=0$, the root of $m^{\prime}(x)=0$ is $x=1$.
10 points
Therefore, when $x \in(-\infty, 1)$, $m^{\prime}(x)>0, m(x)$ is monotonically increasing; when $x \in(1,+\infty)$, $m^{\prime}(x)<0, m(x)$ is monotonically decreasing.
Since $m(-1)=-e^{-2}-1<0, \quad m(0)=1-e^{-1}>0, \quad m(1)=1>0, \quad m(2)=2-e<0$
And the function $m(x)$ is continuous on $\mathbf{R}$, so the function $m(x)=e^{x-1}-x e^{x-1}+x$ has two zeros, one in the interval $(-1,0)$ and the other in the interval $(1,2)$. Therefore, the equation $e^{a-1}-a e^{a-1}+a=0$ has two distinct roots, so the two curves have two common tangents.
14 points