Cohomology groups of real projective space My question concerns the cohomology groups $H^k(RP^n,\mathbb{Z}_2)$. We know that $H_k(RP^n,\mathbb{Z}_2) = \mathbb{Z}_2$ if $0 \leq k \leq n$ and is trivial otherwise. I looked up the solution and it says that $H^k(RP^n,\mathbb{Z}_2) = \mathbb{Z}_2$ also when $0 \leq k \leq n$ and is trivial otherwise.
But we have $Ext(H_{k-1}(RP^n,\mathbb{Z}_2), \mathbb{Z}_2) = Ext(\mathbb{Z}_2, \mathbb{Z}_2) = \mathbb{Z}_2$ for $1 \leq k \leq n+1$ and $Hom(H_{k}(RP^n,\mathbb{Z}_2), \mathbb{Z}_2) = Hom(\mathbb{Z}_2, \mathbb{Z}_2) = \mathbb{Z}_2$ for $0 \leq k \leq n$. So for $1 \leq k \leq n$ we should have $H^k (RP^n,\mathbb{Z}_2) = \mathbb{Z}_2 \oplus \mathbb{Z}_2$ by the universal coefficient theorem. What is wrong with this calculation? 
 A: Have a look at the statement of the universal coefficient theorem, and pay attention to the difference between $R$ and $G$,
$$
0 \to \operatorname{Ext}_R^1(\operatorname{H}_{k-1}(X; R), G) \to H^k(X; G) \to \operatorname{Hom}_R(H_k(X; R), G)\to 0.
$$
In the context of your question, $G = \Bbb Z_2$ and there are two ways to apply the universal coefficient theorem:
Over the field $R = \Bbb Z_2$
In this case, the $\operatorname{Ext}$ term is $\operatorname{Ext}_\Bbb{Z_2}^1(H_{k-1}(\Bbb R P^n, \Bbb Z_2), \Bbb Z_2)$. Since $\Bbb Z_2$ is free over $\Bbb Z_2$ (or more generally since $\Bbb Z_2$ is a field), the $\operatorname{Ext}$ term is trivial.
Over the PID $R = \Bbb Z$ and $\Bbb Z$-module $G = \Bbb Z_2$
In this case, the $\operatorname{Ext}$ term is $\operatorname{Ext}_\Bbb Z^1(H_{k-1}(\Bbb R P^n, \Bbb Z), \Bbb Z_2)$ and the $\operatorname{Hom}$ term is $\operatorname{Hom}_\Bbb Z(H_k(\Bbb R P^n, \Bbb Z), \Bbb Z_2)$. I'll let you work out the details, but you will get the same result.
A: You got confused with the coefficients that are involved in the universal coefficient theorem. Let $K$ be a principle ideal domain and $M$ a $K$-module. We have a short exact sequence
$$
  0 \to Ext_K(\  H_{l-1}(RP^n, K),\ M) \to H^l(RP^n, M) \to Hom_{K}(\ H_l(RP^n, R),\ M) \to 0 \,.
$$
You looked at $Ext_K(\  H_{l-1}(RP^n, M),\ M)$ and $Hom_{M}( H_l(RP^n, M),\ M)$.
A: The universal coefficient theorem that you're trying to use only works for chain complexes whose terms are free abelian groups. But when you take homology with coefficients in $\Bbb Z_2$, your chain groups aren't at all free abelian groups. Rather, they are free as $\Bbb Z_2$-modules. The version of the universal coefficient theorem you want to use here is $$H^k(\Bbb{RP}^2, \Bbb Z_2) \cong \text{Ext}_{\Bbb Z_2}(H_{k-1}(\Bbb{RP}^2, \Bbb Z_2), \Bbb Z_2) \oplus \text{Hom}_{\Bbb Z_2}(H_k(\Bbb{RP}^2, \Bbb Z_2), \Bbb Z_2)$$
The latter term is still $\Bbb Z_2$, but the former term is actually $0$: we have a free resolution of $\Bbb Z_2$-modules: $$0 \rightarrow \Bbb Z_2 \rightarrow \Bbb Z_2 \rightarrow 0$$ But dualizing and then taking the first cohomology group of this gives us $0$. So $\text{Ext}_{\Bbb Z_2}(\Bbb Z_2, \Bbb Z_2) = 0$, and thus $H^k(\Bbb{RP}^2, \Bbb Z_2) \cong \Bbb Z_2$.
