The hairy ball theorem of algebraic topology states that there is no nonvanishing continuoustangent vector field on even-dimensional n-spheres. For the ordinary sphere, or 2‑sphere, if f is a continuous function that assigns a vector in R3 to every point p on a sphere such that f is always tangent to the sphere at p, then there is at least one p such that f = 0. The theorem was first proved by Henri Poincaré for the 2-sphere in 1885, and extended to higher dimensions in 1912 by Luitzen Egbertus Jan Brouwer. The theorem has been expressed colloquially as "you can't comb a hairy ball flat without creating a cowlick" or "you can't comb the hair on a coconut".
Counting zeros
Every zero of a vector field has a "index", and it can be shown that the sum of all of the indices at all of the zeros must be two, because the Euler characteristic of the 2-sphere is two. Therefore, there must be at least one zero. This is a consequence of the Poincaré–Hopf theorem. In the case of the torus, the Euler characteristic is 0; and it is possible to "comb a hairy doughnut flat". In this regard, it follows that for any compactregular 2-dimensional manifold with non-zero Euler characteristic, any continuous tangent vector field has at least one zero.
A common problem in computer graphics is to generate a non-zero vector in R3 that is orthogonal to a given non-zero one. There is no single continuous function that can do this for all non-zero vector inputs. This is a corollary of the hairy ball theorem. To see this, consider the given vector as the radius of a sphere and note that finding a non-zero vector orthogonal to the given one is equivalent to finding a non-zero vector that is tangent to the surface of that sphere where it touches the radius. However, the hairy ball theorem says there exists no continuous function that can do this for every point on the sphere.
A consequence of the hairy ball theorem is that any continuous function that maps an even-dimensional sphere into itself has either a fixed point or a point that maps onto its own antipodal point. This can be seen by transforming the function into a tangential vector field as follows. Let s be the function mapping the sphere to itself, and let v be the tangential vector function to be constructed. For each point p, construct the stereographic projection of s with p as the point of tangency. Then v is the displacement vector of this projected point relative to p. According to the hairy ball theorem, there is a p such that v = 0, so that s = p. This argument breaks down only if there exists a point p for which s is the antipodal point of p, since such a point is the only one that cannot be stereographically projected onto the tangent plane of p.
Higher dimensions
The connection with the Euler characteristic χ suggests the correct generalisation: the 2n-sphere has no non-vanishing vector field for. The difference between even and odd dimensions is that, because the only nonzero Betti numbers of the m-sphere are b0 and bm, their alternating sum χ is 2 for m even, and 0 for m odd.