A cohomology theory $h^*$ satisfies the weak equivalence axiom (wea) if for every weak homotopy equivalence $f : X \to Y$ there is a (degreewise) isomorphism $h^*(Y)\to h^*(X)$ induced by $f$.
There is an exercise in Strom's book that asks to prove that ordinary, represented reduced cohomology $X\mapsto [X, K(G,n)]$ does not satisfy the wea.
The counterexample is the following:
Let $\mathbb N$ be the discrete set $\{0,1,2,...\}$ and $L$ be the set $\{0\}\cup \{1/n\mid n\ge 1\}\subset \mathbb R$ with the subspace topology. Then there is a map $\mathbb N\to L$ which is a weak homotopy equivalence, but it does not induce isomorphisms in reduced cohomology.
My attempt to a proof follows: I want to dot all the i's of this exercise.
Any map $\mathbb N\to L$ will be continuous, because $\mathbb N$ is discrete; I think $\varphi : 0\mapsto 0, n\mapsto 1/n$ does the job; to see this let's note that
- The connected component of $0$ in $L$ is the singleton $\{0\}$.
Proof. Easy: connected components form a partition of a space, and every other point $1/n$ has the singleton $\{1/n\}$ as connected self-component. $\square$
- Let $X$ be connected; then $$ [X,L]\cong \hom(X,L)\cong L$$ in the sense that two maps are homotopic iff they are equal, and there are only constant maps.
Proof. If $f : X\to L$ does not assume the value $0$, then it factors through a discrete subspace of $L$, and the result follows; if there is $x_0$ such that $f(x_0)=0$, then $f(X)$ must be connected and contain $0$, so it must be $\{0\}$. So there are only constant maps: now if $f,g$ are homotopic through $H : X\times [0,1]\to L$, then $f=g$ because $X\times [0,1]$ is connected, and then $H$ must be constant. $\square$
Corollary of 1+2 is that each map $[S^n,\mathbb N]\to [S^n,L]$ is the zero map between homotopy groups, and a bijection on $\pi_0$'s, so the first part of the claim is proved.
Now,
the map induced on $H^0$'s is not an isomorphism of abelian groups.
Proof. Let $f$ be a continuous map $L\to K(G,0)$. Then $f(0)=\lim_{n\to \infty} f(1/n)$, so that $f$ must be eventually constant (its codomain is $G^\delta$, $G$ with the discrete topology). On the other hand, $[\mathbb N, G^\delta]$ is a countable product of copies of $G$, so (for example) the jumping sequence $(0,g,0,g...)$ for $g\neq 0$ does not lie in the image of $\varphi^*$. $\square$
As in every fairy-tale there's a moral in this story:
- This mess happens because $L$ is not a CW complex (CW's have the discrete topology on 0-skeleta, but $0\in L$ is a limit point).
- In fact, if the spaces are CW's, then this pathology disappears: cohomology detects $n$-homotopy equivalences for simply connected spaces.
Now for my question(s):
0. A question on definitions. $L$ is not a CW. But it has the weak homotopy type of a CW complex; does this make $L$ "nice" in some sense?
1. A metamathematical question. Is there something else to learn from this counterexample? Who's the wisest between homotopy groups and reduced cohomology, or in other words: are $\pi_n$'s unable to see some information that instead $\tilde{H}^n$ does see, and that I should take care of, or rather $\tilde{H}^n$'s are too picky?
2. A more concrete question. Are there cohomology groups of $\mathbb N$ and $L$ different in higher degrees? Better said: how do you (dis)prove that $H^n(L,G)$ is zero for $n\ge 1$? Again, what worries me is that $L$ is not a CW complex, but it does have the weak homotopy type of a CW complex.
When I first saw this exercise I was surprised: I bet that the chain map of the singular complexes $C^*(\mathbb N, G)$ and $C^*(L, G)$ is a quasi-isomorphism. So that's why I want to be so picky: I want to see if this guess is false, or if all that matters to build this counterexample lives in degree zero.
No: every space has the weak homotopy type of a CW complex. I don't know Strom's book, but you can probably find this result somewhere in it. In Hatcher's Algebraic Topology, it's Proposition 4.13.
For most purposes, $\tilde{H}^n$ is too picky, and the "correct" way to define the cohomology of a space like $L$ is as the cohomology of a weak equivalent CW complex (or just use a cohomology theory like singular cohomology that does satisfy wea). The vast majority of homotopy theory is primarily concerned with spaces up to weak homotopy equivalence, not up to homotopy equivalence (for instance, if you talk about "the homotopy category of spaces" lacking any additional context, a topologist will assume you're talking about the category you get from $Top$ by inverting weak homotopy equivalences, or equivalently the category of CW complexes and homotopy classes of maps). If for some reason you do want to study spaces that aren't homotopy equivalent to CW complexes on a finer level, usually the "right" cohomology theory to use is something like Cech cohomology, not representable cohomology.
If $X$ is any path-connected pointed space whose basepoint $p$ has a neighborhood $U$ that is strongly contractible to $p$, then every pointed map $f:L\to X$ is nullhomotopic. In particular, this is true if $X$ is any connected CW complex like $K(G,n)$ for $n>0$. (I assume you mean to take $0$ as the basepoint of $L$; if you pick a different basepoint, then you will instead need a contractible neighborhood of $f(0)$.)
Indeed, to construct a nullhomotopy of $f$, just use the contraction of $U$ to $p$ for all $x\in L$ such that $f(x)\in U$, and pick some arbitrary path to $p$ for $x\in L$ such that $f(x)\not\in U$. This will be continuous since $U$ is a neighborhood of $p$ so $f(1/n)\in U$ for all sufficiently large $n$.
Here is a more complicated result that is simultaneously more and less general. If $X$ is any path-connected pointed space whose basepoint $p$ has a countable neighborhood base of path-connected sets $(U_m)$, then any pointed map $L\to X$ is nullhomotopic. (Again, I assume $0$ is the basepoint of $L$, but there is a similar result if you have a different basepoint. Note that these hypotheses are true of any connected finite CW complex $X$, and thus the conclusion follows for any connected CW complex $X$ since $L$ is compact so the image of any $L\to X$ is contained in a connected finite subcomplex.)
To prove this, let $f:L\to X$ be a pointed map. We may assume our neighborhood base $U_m$ is nested and $U_0=X$. For each $n\geq 1$, let $m(n)$ be the greatest $m$ such that $f(1/n)\in U_m$, or $m(n)=n$ if $f(1/n)\in U_m$ for all $m$. Note that since $U_m$ is a neighborhood of $p=f(0)$, $f(1/n)\in U_m$ for all sufficiently large $n$, so $m(n)\to\infty$ as $n\to\infty$.
We now define our homotopy $H:L\times I\to X$. For each $n$, we choose some path $\gamma_n$ from $f(1/n)$ to $p$ in $U_{m(n)}$. We then define $H(1/n,t)=f(1/n)$ for $0\leq t\leq 1-2^{-m(n)}$, $H(1/n,t)=p$ for $1-2^{-m(n)-1}\leq t\leq 1$, and for $1-2^{-m(n)}\leq t\leq 1-2^{-m(n)-1}$ we let $H(1/n,t)$ follow the path $\gamma_n$. We also define $H(0,t)=p$ for all $t$.
Clearly, as long as this $H$ is continuous, it gives a basepoint-preserving homotopy from $f$ to the constant map. Continuity of $H$ at any point $(1/n,t)$ is obvious, and continuity at $(0,t)$ for $t< 1$ follows from the fact for $s$ near $t$, $H(1/n,s)=f(1/n)$ for all sufficiently large $n$. Finally, for continuity at $(0,1)$, since the $U_m$ are a neighborhood base at $p$, it suffices to show that $H^{-1}(U_m)$ contains a neighborhood of $(0,1)$ for all $m$. But this is clear, since if $n$ is large enough such that $m(n)\geq m$, then $H(1/n,t)\in U_{m(n)}\subseteq U_m$ for all $t$.