Group extension: $H^n(\mathbb{Z},M)$

Let $M$ be any $\mathbb{Z}$-module. Find $H^n(\mathbb{Z}, M)$ for all $n$. Use different approaches for the case $n=2$.

First approach: because $\mathbb{Z}$ is a free $\mathbb{Z}$-module, it is also projective. Hence by the main theorem (in any textbook), $H^n(\mathbb{Z}, M) = 0$

Second approach (for $n=2$) was to use arguments on the level of group extensions $0 \to M \to E \to \mathbb{Z} \to 1$.

For this I used the (well-known) theorem that says there is a bijection $H^2(G,M) \leftrightarrow \{\text{equivalence classes of extensions of G by M}\}$

Next I noticed that we can find, for all $m$ some extension $0 \to Z/m \to \mathbb{Z}/m \oplus \mathbb{Z} \to \mathbb{Z} \to 0$

This makes me believe that $H^2(\mathbb{Z}, M) \neq 0$.

Here, I am wrong (I know... but I don't see my error yet... and I'm in the process of understanding the theory). Maybe $H^2(\mathbb{Z}, M)$ doesnt' measure (up to equivalence) the number of extensions $0 \to Z/m \to \mathbb{Z}/m \oplus \mathbb{Z} \to \mathbb{Z} \to 0$ we can find, which according to my above reasoning would be countably infinite (for each $m$ we have an extension). Can someone perhaps point out a correct answer for the second approach, so I can fix my own train of thought.

-
The extension you have written is $0$ under the equivalence relation one puts on the sequences (it splits). –  Tobias Kildetoft Jan 24 '13 at 14:30
What Tobias means might be that $H^2$ is still 0, because, for any fixed M, there is only the trivial extension to be found. Is it true? –  awllower Jan 24 '13 at 14:35
Cross-posted with artofproblemsolving.com/Forum/viewtopic.php?f=61&t=514769 , where I think I did point out the main issue of confusion. Was I not clear enough? Do ask if you don't understand something. –  darij grinberg Jan 24 '13 at 15:10
darij, I am the same poster. The other post was already 20 days old, and only you replied. Therefore I tried a different audience. You cleared up the confusion on the terminology. I understood your post. Nonetheless, I still haven't mastered what $H^2$ "measures". My main confusion lied in the fact that I thought $H^2(\mathbb{Z}, M)$ is countably infinite -- which it is not. –  yannickvda Jan 24 '13 at 15:17
Well, one thing you should have done is removing the "first approach", since nobody told you $Z$ is a projective (let alone free) $\mathbb Z\left[Z\right]$-module (where $Z$ is the group $\mathbb Z$, not the ring $\mathbb Z$). (Moreover, that main theorem requires $n>0$.) –  darij grinberg Jan 24 '13 at 15:36

1) Here is another approach: Write $\mathbb{Z}=\langle t\rangle$. Then $$\cdots \to 0 \to \mathbb{Z}[\mathbb{Z}]\xrightarrow{1-t}\mathbb{Z}[\mathbb{Z}]\xrightarrow{\varepsilon}\mathbb{Z} \to 0$$ is a projective resolution of $\mathbb Z$ over $\mathbb{Z}[\mathbb{Z}]$, where $\varepsilon$ is the usual augmentation and the other map is multiplication by $1-t$. Hence $$H^n(\mathbb Z,M) := Ext^n_{\mathbb{Z}[\mathbb{Z}]}(\mathbb Z,M) = 0$$ for all $n \ge 2$ and each $G$-module $M$.

2) Regarding your 2nd approach: You have to show that each extension $$0 \to M \to E \xrightarrow{\kappa} \mathbb{Z} \to 0$$ splits. Let $e \in E$ s.t. $\kappa(e)=t$. Then a splitting is defined by $\mathbb Z \to E,\;t \mapsto e$.

3) I agree with darij grinberg that your first approach is wrong. It seems that you are considering $Ext^n_{\mathbb{Z}}(\mathbb Z,M)$ while actually $Ext^n_{\mathbb{Z}[\mathbb{Z}]}(\mathbb Z,M)$ is needed.

Added: According to awllower's comment I should add $H^i(\mathbb{Z},M)$ for $i=0,1$. From 1) we immediately find: $$H^0(\mathbb{Z},M)=M^\mathbb{Z}:=\{m \in M \mid tm=m\}\quad\text{(the invariants)}$$ $$H^1(\mathbb{Z},M)=M_\mathbb{Z}:=\frac{M}{(1-t)m\mid m\in M\}}\text{(the coinvariants)}$$

-
You have cleared the matter when $n\geq 2$. But what about $H^1(Z,M)$? Since the first approach of OP is wrong, this requires a remark at least, right? –  awllower Feb 10 '13 at 13:18
Added $H^0,H^1$. –  tj_ Feb 10 '13 at 23:02
Thanks for the clarification. –  awllower Feb 11 '13 at 3:07