# Inference of the collapsed Gibbs sampling for LDA

I am trying to understand the inference procedure of collapsed Gibbs sampling for LDA model. I refer to this document and LDA wiki page. I cannot figure out how does it simplify the sample equation especially the last two rows of the following equations to get the final result:

Which part of them can be dropped and why?
The inference procedure in the wiki seems slightly different, but how can they get the same result?

This is a common trick. You want to sample, let say, a variable $$z_1$$ that is either 0 or 1, and you stumble on something intractable with your variable inside Gamma functions: $$\Gamma(\alpha + \sum_n z_n)$$ You would like to save your variable and take it out of its Gamma jail, so that whatever remains on the Gamma can be treated as a constant.
$$\Gamma(\alpha + \sum_n z_n) \\= \Gamma([\alpha + \sum_n z_n - z_1] + z_1)\\= \Gamma([\alpha + \sum_n z_n - z_1])(\alpha + \sum_n z_n - z_1)^{z_1}\\ \propto (\alpha + \sum_n z_n - z_1)^{z_1}$$
where we used the identity $$\Gamma(a + 1) = \Gamma(a)a$$.