On an equivalent definition of cohomological dimension I'm having some trouble with an equivalent definition of cohomological dimension. What I have as definition is 

Given a group $\Gamma$, the comological dimension is defined as $$cd\,\Gamma=\inf\{n\in \mathbb N: \exists \epsilon:P\to \mathbb Z\to 0\,\,\text{projective resolution of length}\,\, n\}$$ where $\mathbb Z$ is provided with the trivial $\mathbb Z \Gamma$-module structure.

I know that this is equivalent to taking $$\sup\{k\in \mathbb N:H^k(\Gamma, M)\neq0\, \text{for some module M}\}$$ which kinda fits the intuition of the cohomogical dimension being the largest non-cero degree of cohomology.
However, when trying to prove this equivalent definition I come across the following: Take a projective resolution of minimal length $n=cd\, \Gamma$ (finite for the moment), And consider the co-chain complex that results from taking $Hom_{\Gamma}(P,M)$, where $M$ is an arbitrary $\Gamma-module$. Since $P_m=0,\forall m>n$ we get $$0\leftarrow Hom_\Gamma(P_n,M)\leftarrow\dots \leftarrow Hom_\Gamma(P_0,M)\leftarrow0$$ Now from what I tried so far, proving the result is a matter of finding $M$ such that $H^n(Hom_\Gamma(P_n,M))\neq0$, which in turn is the same as $Hom_\Gamma(P_{n-1},M)\to Hom_\Gamma(P_n,M)$ being non-surjective for some $M$. And here's where I'm stuck! I can't seem to be able to find such $M$.
I apologize if my question is rather trivial, but it's the first time I come across the definitions and all that. Any help would be greatly appreciated!
 A: That's a very good question ! 
The idea here is that you won't be able to come up with an $M$ out of thin air, so you have to use something that was given to you. What was given to you ? Well, the $P_k$'s for sure !
Now think about it, you have $0\to P_n\to P_{n-1}$ which becomes $\hom(P_{n-1},M)\to \hom(P_n,M)\to 0$, which you want to not be surjective, well there is a "universal" such $M$, that is an $M$ such that if it's surjective for that specific $M$, then it's surjective for all $M$ : it's simply $M=P_n$. 
Indeed if it's surjective for $M=P_n$, then you get $r:P_{n-1}\to P_n$ with $P_n\to P_{n-1}\to P_n = id_{P_n}$ (choose an antecedent for $id_{P_n}$), so that for any $M$ and any $f:P_n\to M$, $f\circ r :P_{n-1}\to M$ is an antecedent for $f$. So if there's any chance that it'd fail, it'll fail for $M=P_n$.
Now assume you have such an $r$. It follows (by basic homological algebra) that the inclusion $P_n\to P_{n-1}$ is actually a summand, that is $P_{n-1}= \mathrm{im}P_n\oplus \ker(P_{n-1}\to P_{n-2})$, and so that gives you (by consider $0\to \ker \to P_{n-2}\to ...$) a shorter projective resolution, which is a contradiction. 
Therefore, $id_{P_n}$ is not in the image, and $H^n(\Gamma, P_n)\neq 0$
