In Milnor/Stasheff characteristic classes there is the proof that $H^\*(BO(n);\mathbb{Z}\_2)$ is the polynomial ring on the first n Stiefel-Whitney classes. I understand the part that the latter ring is contained in $H^\*(BO(n);\mathbb{Z}\_2)$, but for the other inclusion he writes:



> 
> Let $C^i(BO(n))$ represent the i-cochains of $BO(n)$ and $Z^i(BO(n))$ the i-cocycles. The dimension of $C^i(BO(n))$ as a vector space over $\mathbb{Z}\_2$ is the number of i-dimensional cells [meaning CW-cells of $BO(n)$][...]
> 
> 
> 


And then concludes that $H^i(BO(n);\mathbb{Z}\_2)$ is already the degree-i part of $\mathbb{Z}\_2[w\_1,\dots,w\_n]$ by a dimension argument.


However, why is $\text{dim}\_{\mathbb{Z}\_2}C^i(BO(n))$ the number of i-cells of the CW-complex $BO(n)$? I am assuming that he means the singular i-cochains. But can't that have huge dimension over the ground ring? Am I thinking of the wrong cochain complex?


Also, is there a more "modern" approach to the proof not using Serre's spectral sequence? Reference welcome.



Milnor's proof of cohomology of BO(n)
One approach is as follows. All cohomology groups will be taken with coefficients $\mathbb{Z}/2$.


1. Define $w\_1(L)\in H^1(X)$ for real line bundles $L$ over $X$, and prove various properties. (There are several ways to do this, which I will not summarise here.)
2. Prove a real projective bundle theorem. In more detail, for any $n$-dimensional real vector bundle $V$ over $X$, let $PV$ denote the associated bundle of projective spaces, let $L$ be the tautological line bundle over $PV$, and put $x=w\_1(L)\in H^1(PV)$. Define 
$$\alpha\_X\colon\bigoplus\_{i=0}^{n-1}H^{\*-i}(X)\to H^\*(PV)$$
by $\alpha\_X(\underline{a})=\sum\_ia\_ix^i$. If $V$ is trivialisable then $PV\simeq X\times\mathbb{R}P^{n-1}$ and it is easy to see that is an isomorphism. An argument with the five-lemma and Mayer-Vietoris sequences shows that if $U,W\subseteq X$ and $\alpha\_U,\alpha\_W,\alpha\_{U\cap W}$ are isomorphisms then $\alpha\_U$ is also an isomorphism. Using this we deduce that $\alpha\_X$ is an isomorphism whenever $X$ has a finite cover on which $V$ is trivialisable, and in particular when $X$ is compact. Using the Milnor exact sequence we deduce that $\alpha\_X$ is an isomorphism for all $X$.
3. By considering $\alpha\_X^{-1}(x^n)$ we see that there is a unique system of classes $w\_i(V)\in H^i(X)$ (with $w\_0(V)=1$) such that $x$ is a root of the polynomial $f\_V(t)=\sum\_{i=0}^nw\_i(V)t^{n-i}$. It follows that $H^\*(PV)=H^\*(X)[x]/f\_V(x)$ as rings.
4. It is now not hard to check that $w\_i(V|\_Y)=w\_i(V)|\_Y$ for all $Y\subseteq X$, and also that $w\_i(U\oplus V)=\sum\_{i=j+k}w\_j(U)w\_k(V)$. Equivalently, we have $f\_{V|\_Y}(t)=f\_V(t)|\_Y$ and $f\_{U\oplus V}(t)=f\_U(t)f\_V(t)$.
5. Now let $T\_n$ be the tautological bundle over $BO(n)$, and put $w\_{n,i}=w\_i(T\_n)\in H^i(BO(n))$. The claim is that $H^\*(BO(n))=\mathbb{Z}/2[w\_{n,1},\dotsc,w\_{n,n}]$. We can assume inductively that the corresponding thing is true for $BO(n-1)$. It is also not hard to identify the projective bundle $PT\_n$ over $BO(n)$ with $BO(n-1)\times BO(1)$, so the projective bundle theorem tells us that the ring
$$ H^\*(BO(n-1))\otimes H^\*(BO(1)) = \mathbb{Z}/2[w\_{n-1,1},\dotsc,w\_{n-1,n-1},x] $$
is freely generated by $\{1,\dotsc,x^{n-1}\}$ as a module over $H^\*(BO(n))$. Also, we see that $w\_{ni}$ maps to $w\_{n-1,i}+w\_{n-1,i-1}x$ for $0<i<n$, and $w\_{nn}\mapsto w\_{n-1,n-1}x$. From here it is a matter of pure algebra to check that $H^\*(BO(n))=\mathbb{Z}/2[w\_{n1},\dotsc,w\_{nn}]$.


