A finite stochastic matrix $P = (p(x,y))$ has a unique invariant probability measure if and only if $\dim\ker(P^* - 1) = 1$.

Assume that $\dim\ker(P^* - 1) = 1$. We know from proposition that $P$ has an invariant probability measure. Now suppose that $\mu_1$ and $\mu_2$ are invariant probability measures. Since $\mu_1,\mu_2\in \ker(P^* - 1)\setminus \{ 0 \}$ and $\dim\ker(P^* - 1) = 1$, there exists $\lambda \in \R$ such that $\mu_2 = \lambda\mu_1$. Since $\sum_{x\in S}\mu_1(x) = \sum_{x\in S}\mu_2(x) = 1$, we conclude that $\lambda = 1$ and thus $\mu_1 = \mu_2$.

On the other hand, assume that $P$ has a unique invariant probability measure $\mu$. Let $f\in \ker(P^* - 1)$. We show that $f$ is a scalar multiple of $\mu\in\ker(P^* - 1)$. First, assume that $\sum_{x\in S}f(x) \ne 0$. Then we may assume w.l.o.g. that $\sum_{x\in S}f(x) = 1$. Now let $\mu_0$ be the probability measure defined by $\mu_0(x) = 1/|S|$ for all $x\in S$. If $\epsilon > 0$ is sufficiently small, then all entries of $\nu_0 := \epsilon f + (1-\epsilon) \mu_0$ are nonnegative, so $\nu_0$ is a probability measure on $S$ because \[ \sum_{x\in S}\nu_0(x) = \epsilon \sum_{x\in S}f(x) + (1-\epsilon)\sum_{x\in S}\mu_0(x) = \epsilon + (1-\epsilon) = 1. \] Since $P^*f = f$, we have $P^{*j}\nu_0 = \epsilon f + (1-\epsilon)P^{*j}\mu_0$ for all $j\in \N_0$. Thus, \[ \nu_n := \frac{1}{n} \sum_{j=0}^{n-1}P^{*j}\nu_0 = \epsilon f + (1-\epsilon)\mu_n, \] where $\mu_n$ is defined as in the proof of proposition. We know that every accumulation point of the sequence $\mu_n$ is the unique invariant probability measure $\mu$, and the same is true for the sequence $\nu_n = \epsilon f + (1-\epsilon)\mu_n$. Actually, both sequences thus converge to $\mu$ because $M_1\subseteq \ell_1^n$ is compact. This implies that $\mu = \epsilon f + (1-\epsilon)\mu\iff f = \mu$.

If $\sum_{x\in S}f(x) = 0$, we consider $\mu + f\in\ker(P^* - 1)$. Since $\sum_{x\in S}(\mu(x) + f(x)) = 1$, by the same reasoning as above, we have $\mu + f = \mu$, so $f = 0 = 0\cdot \mu$.