> [Linked-cluster theorem](https://en.wikipedia.org/wiki/Feynman_diagram#Connected_diagrams:_linked-cluster_theorem)$^1$ 
$$\ln Z~=~\frac{i}{\hbar} W_c, \tag{1}$$ 
where $Z$ is the partition function and $W_c$ is the generating functional of connected diagrams.

_Proof._ We will use a [replica trick](https://en.wikipedia.org/wiki/Replica_trick), cf. Ref. 1. 

1. Recall that if a theory consists of $n$ independent sub-theories with partition functions $Z_1, \ldots, Z_n$ (i.e. interactions are only allowed within each sub-theories), then the partition function for the full theory is the product $Z_1 \cdots Z_n$.

2. Introduce $n$ copies of the original theory under investigation, where $n\in\mathbb{N}$ is a positive integer. The replica partition function becomes just a power
$$\sum\left\{\text{all replica diagrams}\right\}
~=~Z^n,\tag{2}$$
because different copies do not interact. Each field $\phi^{\alpha}_{(i)}(x)$ in the replica theory now carries a copy label $i\in\{1, \ldots, n\}$, and doesn't talk to other copies. 

3. Given a Feynman diagram $D$ in the original theory, the contributions to the corresponding replica Feynman diagram should be multiplied with a factor $n^{\#(D)}$, where $\#(D)$ denotes the number of [connected components](https://en.wikipedia.org/wiki/Connected_component_(graph_theory)) of $D$.
In other words,
$$\begin{align} \sum & \left\{\text{all replica diagrams}\right\}\cr
&~=~ 1 + n\sum\left\{\text{connected original diagrams}\right\} +{\cal O}(n^2).\end{align} \tag{3}$$
In eq. (3) we have implicitly normalized the partition function such that $1$ is the value of the empty diagram, which by definition is _not_ [connected](https://en.wikipedia.org/wiki/Connected_space#Connected_components).

4. _Possibly illuminating example._ If an original diagram $D^2/2!$ consists of the same connected diagram $D$ twice, the corresponding replica contributions $$(\sum_{i=1}^n D_{(i)})^2/2!~=~ n^2 D^2/2!$$ scale as $n^2$. Here $2!$ is a symmetry factor. The fact that the corresponding diagonal replica contributions $$(\sum_{i=1}^n D_{(i)}^2)/2!~=~ n D^2/2!$$ only scale with a lower power $n$ is not relevant/important because it is (implicitly) assumed that the RHS of eq. (3) is organized according to original (rather than replica) diagrams. End of example.

5. Now let's continue the proof. Equivalent to eq. (3), by Taylor expansion,
$$\begin{align} \ln\sum &\left\{\text{all replica diagrams}\right\}\cr
~\stackrel{(3)}{=}~& n\sum\left\{\text{connected original diagrams}\right\} +{\cal O}(n^2). \end{align} \tag{4}$$

6. Combining eqs. (2) & (4) yield
$$\ln Z - \sum\left\{\text{connected original diagrams}\right\} ~\stackrel{(2)+(4)}{=}~{\cal O}(n^1) .\tag{5}$$ 
The LHS. of eq. (5) is independent of $n$, i.e. it is a constant wrt. $n$. But since the RHS. of eq. (5) has no ${\cal O}(n^0)$ terms, the constant must be  zero. (Alternatively, we may formally treat the integer $n$ as a real number, and take the limit $n\to 0^{+}.$) This yields the linked-cluster theorem (1). $\Box$

See also [this](http://physics.stackexchange.com/q/107049/2451) and [this](https://physics.stackexchange.com/q/129080/2451) related Phys.SE posts.

References:

1. X.G. Wen, _QFT of many-body systems,_ (2004); p. 143.

--

$^1$NB: Conventionally in QFT, one allows for a multiplicative normalization factor in the partition function $Z$, which hence corresponds to an additive constant in $W_c$, cf. eq. (1).