[proofplan]
We show that any distribution $\lambda$ in detailed balance with $P$ is automatically invariant for $P$, by summing the detailed balance equations $\lambda_j p_{j,i} = \lambda_i p_{i,j}$ over $j$ and using the stochastic row-sum property $\sum_j p_{i,j} = 1$. Uniqueness and positive recurrence then follow from the [Existence and Uniqueness of Invariant Distribution](/theorems/2223): since the chain is irreducible and admits a normalised invariant measure, every state is positive recurrent and $\lambda$ is the unique invariant distribution. Reversibility follows by comparing $\hat{p}_{i,j} = (\lambda_j / \lambda_i) p_{j,i}$ with $p_{i,j}$, which the detailed balance equations force to be equal.
[/proofplan]
[step:Sum the detailed balance equations over $j$ to show $\lambda$ is invariant]
Fix an arbitrary state $i \in S$. The detailed balance hypothesis states that $\lambda_j p_{j,i} = \lambda_i p_{i,j}$ for all $j \in S$. Summing both sides over $j \in S$:
\begin{align*}
\sum_{j \in S} \lambda_j p_{j,i} = \sum_{j \in S} \lambda_i p_{i,j} = \lambda_i \sum_{j \in S} p_{i,j} = \lambda_i,
\end{align*}
where the final equality uses the fact that $P$ is a stochastic matrix, so each row sums to one: $\sum_{j \in S} p_{i,j} = 1$. Since $i \in S$ was arbitrary, we have $(\lambda P)_i = \lambda_i$ for all $i$, i.e., $\lambda P = \lambda$. Hence $\lambda$ is an invariant distribution for $P$.
[guided]
The goal is to show that the local pairwise condition (detailed balance) implies the global condition (invariance). Invariance of $\lambda$ means $\lambda = \lambda P$, i.e., for every state $i \in S$,
\begin{align*}
\sum_{j \in S} \lambda_j p_{j,i} = \lambda_i.
\end{align*}
This is a sum over all states $j$ -- can we evaluate it using only the pairwise detailed balance equations? Yes: the detailed balance hypothesis gives us $\lambda_j p_{j,i} = \lambda_i p_{i,j}$ for each individual $j$, so we can replace every summand:
\begin{align*}
\sum_{j \in S} \lambda_j p_{j,i} = \sum_{j \in S} \lambda_i p_{i,j} = \lambda_i \sum_{j \in S} p_{i,j}.
\end{align*}
Now $\sum_{j \in S} p_{i,j} = 1$ because $P$ is a stochastic matrix (each row is a probability distribution over states). Therefore $\sum_{j \in S} \lambda_j p_{j,i} = \lambda_i$, which is exactly the invariance equation for state $i$. Since $i$ was arbitrary, $\lambda P = \lambda$.
Why does this work so cleanly? The detailed balance equations decompose the global balance equation $\sum_j \lambda_j p_{j,i} = \lambda_i$ into a sum of pairwise identities $\lambda_j p_{j,i} = \lambda_i p_{i,j}$. Summing these pairwise identities recovers global balance automatically. This is why detailed balance is strictly stronger than global balance: it implies invariance, but the converse fails (as the deterministic cycle $1 \to 2 \to 3 \to 1$ demonstrates).
[/guided]
[/step]
[step:Conclude uniqueness and positive recurrence from irreducibility]
The chain is irreducible by hypothesis, and $\lambda$ is a probability distribution (normalised, with $\sum_{i \in S} \lambda_i = 1$) that is invariant for $P$. By the [Existence and Uniqueness of Invariant Distribution](/theorems/2223), the existence of an invariant distribution for an irreducible chain implies that every state is positive recurrent, and the invariant distribution is unique. Therefore $\lambda$ is the unique invariant distribution of $P$.
[guided]
We have established that $\lambda$ is invariant. Could there be another invariant distribution? The [Existence and Uniqueness of Invariant Distribution](/theorems/2223) states: if $(X_n)$ is an irreducible Markov chain on a countable state space $S$ with transition matrix $P$, and an invariant distribution $\pi$ exists, then every state $i \in S$ is positive recurrent and $\pi_i = 1/\mu_i$ where $\mu_i = \mathbb{E}_i[T_i]$ is the mean return time. In particular, $\pi$ is the unique invariant distribution.
We verify the hypotheses: the chain has transition matrix $P$ on state space $S$ and is irreducible by assumption. We have just shown that $\lambda$ is an invariant distribution. Therefore the theorem applies, yielding two conclusions: (1) every state in $S$ is positive recurrent, and (2) $\lambda$ is the unique invariant distribution.
This step is where irreducibility is consumed. Without irreducibility, the state space could decompose into multiple communicating classes, each potentially carrying its own invariant measure, and uniqueness would fail.
[/guided]
[/step]
[step:Verify that the chain is reversible when started in $\lambda$]
By the [Reversed Chain is Markov](/theorems/2227), when the chain is started in its invariant distribution $\lambda$, the reversed chain $Y_k = X_{N-k}$ has transition matrix $\hat{P}$ given by $\hat{p}_{i,j} = (\lambda_j / \lambda_i) p_{j,i}$. The detailed balance equations state $\lambda_i p_{i,j} = \lambda_j p_{j,i}$, which rearranges to $p_{j,i} = (\lambda_i / \lambda_j) p_{i,j}$. Substituting:
\begin{align*}
\hat{p}_{i,j} = \frac{\lambda_j}{\lambda_i} \cdot p_{j,i} = \frac{\lambda_j}{\lambda_i} \cdot \frac{\lambda_i}{\lambda_j} p_{i,j} = p_{i,j}.
\end{align*}
Since $\hat{p}_{i,j} = p_{i,j}$ for all $i, j \in S$, we have $\hat{P} = P$, so the reversed chain has the same transition matrix as the original. By definition, the chain is reversible when started in $\lambda$.
[guided]
Reversibility means that the chain, when started in its invariant distribution, looks statistically identical run forwards and backwards. Formally, the reversed chain $Y_k = X_{N-k}$ must have the same transition matrix as the original chain.
By the [Reversed Chain is Markov](/theorems/2227), when $X_0 \sim \lambda$ (where $\lambda$ is invariant for $P$), the reversed process $Y$ is a Markov chain with transition matrix $\hat{P}$ defined by $\hat{p}_{i,j} = (\lambda_j / \lambda_i) p_{j,i}$. The theorem requires that $(X_n)$ be positive recurrent and irreducible with invariant distribution $\lambda$ -- we verified these conditions in the previous step.
We now check that $\hat{P} = P$. The detailed balance hypothesis gives $\lambda_i p_{i,j} = \lambda_j p_{j,i}$ for all $i, j \in S$. Since the chain is irreducible, $\lambda_i > 0$ for all $i$ (this follows from $\lambda_i = 1/\mu_i > 0$), so we may divide both sides by $\lambda_j$ to obtain $p_{j,i} = (\lambda_i / \lambda_j) p_{i,j}$. Substituting into the formula for $\hat{p}_{i,j}$:
\begin{align*}
\hat{p}_{i,j} = \frac{\lambda_j}{\lambda_i} \cdot p_{j,i} = \frac{\lambda_j}{\lambda_i} \cdot \frac{\lambda_i}{\lambda_j} \cdot p_{i,j} = p_{i,j}.
\end{align*}
This holds for every pair $(i, j)$, so $\hat{P} = P$. The chain is reversible.
The detailed balance equations are precisely the condition that makes $\hat{P} = P$. This is not a coincidence -- the definition of reversibility ($\hat{P} = P$) is equivalent to $(\lambda_j / \lambda_i) p_{j,i} = p_{i,j}$, which is exactly the detailed balance equation $\lambda_i p_{i,j} = \lambda_j p_{j,i}$ rearranged.
[/guided]
[/step]