In many branches of mathematics, it seems to me that a good counterexample can be worth just as much as a good theorem or lemma. The only branch where I think this is explicitly recognized in the literature is topology, where for example Munkres is careful to point out and discuss his favorite counterexamples in his book, and Counterexamples in Topology is quite famous. The art of coming up with counterexamples, especially minimal counterexamples, is in my mind an important one to cultivate, and perhaps it is not emphasized enough these days.

So: what are your favorite examples of counterexamples that really illuminate something about some aspect of a subject?

Bonus points if the counterexample is minimal in some sense, bonus points if you can make this sense rigorous, and extra bonus points if the counterexample was important enough to impact yours or someone else's research, especially if it was simple enough to present in an undergraduate textbook.

@Regenbogen - I am familiar with the proof that Selmer's curve has points everywhere locally but not globally. But that counterexample led many people to study the manner in which the Hasse Prinicple could fail. For example, there is the Brauer-Manin Obstruction. However Skorobogatov has found examples of curves with trivial Manin obstruction and everywhere local points but no global points, so the story is not finished...In my comment I was suggesting that someone more familiar with the current work might use this example.
–
Ben LinowitzMar 2 '10 at 17:23

55 Answers
55

The matrix $\left(\begin{smallmatrix}0 & 1\\
0 & 0\end{smallmatrix}\right)$ has the following wonderful properties. (Feel free to add or edit; I can't remember all the reason I loathed it when I was learning linear algebra. It's funny how unexciting they all now seem, but it's a counterexample for almost every wrong linear algebra proof I tried to give.)

Only zeroes as eigenvalues, but non-zero minimal polynomial (in particular, the minimal polynomial has bigger degree than the number of eigenvalues). Probably my favorite way to state this fact: the minimal polynomial is not irreducible or square-free. The same thing in a fancier language: the Jordan canonical form is not diagonal.

Not diagonalizable, even over an algebraically closed field.

Not divisible over $\mathbb C$. There are no matrices $M$ and integers $n\ge2$ so that $M^n = \left(\begin{smallmatrix}0 & 1\\\
0 & 0\end{smallmatrix}\right).$ All diagonalizable and most non-diagonalizable complex matrices have $n$th roots.

(This is because, if there was a square root, it'd have minimal polynomial x4, but since it's a two-by-two matrix, Cayley-Hamilton implies that the characteristic polynomial has degree 2).

The matrix is nilpotent but not zero.

It's one of the best examples when you need to remember why matrix multiplication is not commutative.

Thinking of k2 as a k[x]-module where x acts as this matrix should give wonderful (counter)-examples of modules for all the same reasons.

Also, $\left(\begin{smallmatrix}1 & 1\\ 0 & 1\end{smallmatrix}\right)$ is an example of an invertible matrix with the first three properties above. Its action on k2 is in some sense the simplest example of a representation of a group ($\mathbb{Z}$) which is indecomposable but not irreducible.

"the minimal polynomial is not irreducible" I am not sure I get your point. Minimal polynomials are usually not irreducible. Did you mean "does not have to be multiplicity-free"?
–
Vladimir DotsenkoMar 3 '10 at 14:38

I think it's better to remember that functions are not commutative: if f puts pants on a person and g puts underpants on them, then f(g(naked person)=half-naked person, and g(f(naked person)=half-naked superman.
–
Michał MasnyMar 8 at 15:23

A polynomial $p(x) \in \mathbb{Z}[x]$ is irreducible if it is irreducible $\bmod l$ for some prime $l$. This is an important and useful enough sufficient criterion for irreducibility that one might wonder whether it is necessary: in other words, if $p(x)$ is irreducible, is it necessarily irreducible $\bmod l$ for some prime $l$?

The answer is no. For example, the polynomial $p(x) = x^4 + 16$ is irreducible in $\mathbb{Z}[x]$, but reducible $\bmod l$ for every prime $l$. This is because for every odd prime $l$, one of $2, -2, -1$ is a quadratic residue. In the first case, $p(x) = (x^2 + 2 \sqrt{2} x + 4)(x^2 - 2 \sqrt{2} x + 4)$. In the second case, $p(x) = (x^2 + 2 \sqrt{-2} x - 4)(x^2 - 2 \sqrt{-2} x - 4)$. In the third case, $p(x) = (x^2 + 4i)(x^2 - 4i)$. This result can be thought of as a failure of a local-global principle, and the counterexample is minimal in the sense that the answer is yes for quadratic and cubic polynomials.

This is a very good answer. I would go so far as to say that if you're studying general topology but haven't encountered the Cantor set, your ideas of what a topological space can be are fundamentally incomplete.
–
Pete L. ClarkDec 29 '10 at 6:49

4

“It is totally disconnected, yet it is not a discrete space.” As a professional matter, I like $\mathbb Q_p$ even better as an example of this behaviour. (Of course, topologically it's nearly the same!) If I may piggy-back on Pete's comment, if you haven't encountered $\mathbb Q_p$, then your ideas of what a complete metric space can be are fundamentally incomplete. :-)
–
L SpiceMar 28 '11 at 16:03

3

also positive measure cantor set is a very nice example to difference betwean meagre and null sets
–
Ostap ChervakApr 10 '11 at 9:57

The sequence which is 0 or 1 depending on which of m and n is greater also works. See the fifth example from tricki.org/article/Just-do-it_proofs and its accompanying discussion.
–
aorqMar 19 '11 at 18:18

14

Yeah, that works, too! However, I experienced that undergraduates sometimes feel a bit uncomfortable with such "piecewise" definitions and are more happy with a more "natural" example (whatever that means).
–
DirkMar 19 '11 at 19:58

And it has quaternionic representations - something that serves as counterexample to many beginner's conjectures in representation theory (a la "any representation can be constructed in the smallest field where its character lives").
–
darij grinbergApr 4 '10 at 15:59

The Weierstrass function - which I guess is a counterexample to the conjecture that a function which is continuous everywhere must be differentiable somewhere. I remember being pretty amazed when I first encountered it. It made me realize that continuity and differentiability are really different notions.

It's path-connected but not semi-locally simply connected (because any small neighborhood of the origin must contain a non-contractible loop). This implies many interesting properties, which make it a great counter-example. For instance...

The Hawaiian Earring cannot have a universal cover.

The Hawaiian Earring is not a CW-complex, although it is a compact, complete metric space

An example of a space which is semi-locally simply connected and simply connected but is not locally simply connected is the cone on the Hawaiian Earring.

For many years people thought the fundamental group was always a topological group. This turns out to be false, thanks to the Hawaiian Earring. There's a nice post about this here on MO

This question is Community Wiki for a reason. I'm sure there are other examples of conjectures the Hawaiian Earring has disproven, so please add them!

I like the fact, that it's fundamental group is uncountable. This is a vivid example for showing students, which are new to algebraic topology, that the fundamental group are not just "some" loops in the space.
–
archipelagoMar 23 '13 at 13:39

5

The analogs in higher dimensions have nonzero homology in arbitrarily high dimensions!
–
Jeff StromMar 23 '13 at 14:48

they can be written as an HNN extension of $\mathbb{Z}$ over $\mathbb{Z}$. (This means that they're constructed by 'gluing' $\mathbb{Z}$ to itself in some way.)

So from the point of view of combinatorial group theory, they could hardly be simpler. And yet, for suitable values of $p$ and $q$ (typically $p,q$ relatively prime integers greater than 1 will do), we find that:

they're non-Hopfian, meaning that they admit a self-epimorphism with non-trivial kernel;

hence they're not even residually finite;

they have exponential Dehn function (meaning that the word problem can be solved, but only very slowly);

their virtual first Betti number is one (meaning that every finite-index subgroup has abelianisation of rank one)...

Counterexamples are very important when a student learns how to think in intuitionistic logic (and he has already been "spoiled" by classical logic). The counterexamples destroy the classical intuition, and when properly explained they help the student understand how to think intuitionistically. Some that seem to work praticularly well in my experience involve finite sets. Intuitionistically the following are not provable:

A subset of a finite set is finite.

The powerset of a finite set is finite.

If a subset of $\mathbb{N}$ is not finite then it is infinite.

The elements of a finite set may be listed without repetition.

All of these can be rescued with the additional assumption that the sets involved have decidable equality and that the subsets involved have decidable membership.

However, it does not really help the student to just know that certain "obvious" facts are not provable. He really needs to see how the "facts" can be false. The ones listed above are all false in the effective topos, but that's a complicated gadget for a beginner. It turns out informal explanations work well enough because most students know a little bit of programming. They just needs to know that the Halting Oracle does not exist.

My favorite counterexample in intuitionistic logic is that it is consistent to assume the so-called Axiom of Enumerability, which says that there are countably many countable subsets of $\mathbb{N}$. (Explanation: in the effective topos this just means that there is an effective enumeration of computably enumerable subsets of $\mathbb{N}$.) Many basic theorems of computability theory can be proved, phrased in a suitable form, from the axiom of enumerability using just constructive logic and no mention of machines of any kind.

Which definitions of "finite set" and "infinite set" are you using?
–
aorqMar 2 '10 at 14:33

3

A set $A$ is finite if there exists a natural number $n$ and an onto map $e : \lbrace{1, ..., n\rbrace} \to A$. A set $B$ is infinite if there exists 1-1 map $m : \mathbb{N} \to B$, i.e., $B$ contains an infinite sequence without repetitions.
–
Andrej BauerMar 2 '10 at 21:34

The Poincaré homology sphere, a spherical 3-manifold with fundamental group the binary isosahedral group, was Poincaré's counterexample to the original formulation (in terms of homology) of his conjecture. Due to its countless descriptions -- as a spherical 3-manifold, via Dehn surgery, as the configuration space of an isosahedron, etc -- it's still a motivational example in geometry and topology.

(1) It is upper semicontinuous on $\mathbb{R}$, yet has a dense set of discontinuities (every one of which is removable) (namely $\mathbb{Q})$.

(2) Since it is bounded and has a set of measure zero as its set of discontinuities, it is Riemann integrable. So if we consider $g(x) = \int_0^x f(t)\ dt$, we see that $g \equiv 0$, so that $g'(x) \not \hskip 2pt = f(x)$ on a dense set.

Part of why Desargues "Theorem" is intriguing is that it holds in some projective planes and not in others. There are finite planes where it holds and finite planes where it does not hold. If there is a way to introduce coordinates for the plane with numbers from a division ring then then Desargues Theorem will hold. It also holds for projective planes sitting in higher dimensional projective spaces. In the real projective plane the theorem holds. The Moulton plane is a fascinating example.
–
Joseph MalkevitchMar 3 '10 at 14:05

The blowup of $\mathbb{P}^2$ in the 9 points of intersection of two generic cubics admits infinitely many $(-1)$ curves. This example is very important in getting rid of the naif picture of algebraic surfaces.

Even though the idea of "blowing down" is to get rid "a" (-1) curve. You can always blow down finitely many times to get rid of all of them, even if you start infinitely many. This is a nice example of that case.
–
MattApr 4 '10 at 17:38

A basic result in commutative algebra asserts that direct limits commute with tensor products. My favourite counterexample to the statement obtained by replacing "direct" with "inverse" is the following. Let $p$ be a prime number; then

Finite topological spaces often provide nice and simple counterexamples in topology, including algebraic topology (check J. Barmak's thesis). After getting familiar with those spaces one easily comes up with examples of phenomena such as weakly homotopy equivalent spaces which are not homotopy equivalent (spaces consisting of 4 points and 6 points suffice) or homomorphisms between homology/homotopy groups that are not induced by continuous maps.

Of course, other counterexamples are available, but finite ones are certainly minimal in a sense.

Here $n$ denotes the $n$th power map on $S^1$. Thinking of $S^1$ as $\mathbb{R}/\mathbb{Z}$, one finds that the colimit of this sequence (in the category of topological spaces) is the quotient group $\mathbb{R}/\mathbb{Q}$. Note that this quotient group, topologized as a quotient space of $\mathbb{R}$ by the relation $x\sim y$ if $x-y\in \mathbb{Q}$, has the indiscrete topology. In particular, the colimit of this sequence is a contractible topological space and has trivial homotopy groups.

On the other hand, the colimit of the corresponding sequence of fundamental groups is the group $\mathbb{Q}$ (checking this is a fun exercise).

(There's something sort of odd here, because one might have guessed that $\mathbb{R}/\mathbb{Q}$ would be a model for $K(\mathbb{Q}, 1)$, since after all $\mathbb{R}$ is a free $\mathbb{Q}$-space. But there are no interesting open sets in the quotient and hence no chance of local triviality.)

Initially, I thought this counterexample was extremely non-instructive, since I assumed that Tutte discovered it via some ingenious trial and error. But, after seeing a talk by Bill Cunningham, I discovered how Tutte came up with his counterexample and why it is a counterexample (it's unclear from looking at Tutte's graph that it is not Hamiltonian). The idea is quite simple but useful. Tutte assumed that Tait's conjecture was true and proceeded to prove a sequence of stronger (yet equivalent) conjectures. He then found a very small counterexample to the strongest conjecture, and then deconstructed the sequence of proofs to obtain a counterexample to Tait's conjecture.

I really like this method because it shows that there is hope for a mathematical caveman like me as long as I use my brain. That is, the counterexample was actually not pulled out of thin air like I initially thought.

Very few results are pulled out of thin air. The problem is, mathematical culture has not favored showing where they do come from.
–
Mariano Suárez-Alvarez♦Mar 3 '10 at 16:56

5

I'd add that one of the reason for this is that journals have a strong preference for short articles, although today, with internet distribution, I do not see any reason for this. As a result, mathematicians cut out the why from the proofs, leaving only the necessary steps. But this is of course discussed in other threads...
–
Andrea FerrettiMar 3 '10 at 17:09

In other words, there exist matrices $X_m\in GL_2(\mathbf Z/m\mathbf Z)$ such that $X_mA \equiv BX_m \mod m$ for every $m$, but there does not exist a matrix $X\in GL_n(\mathbf Z)$ such that $XA = BX$.

This is due to Stebe, Conjugacy separability of groups of integer matrices. Proc. Amer.
Math. Soc., 32:1–7, 1972.

Similarly, the symmetric group on 5 letters has no subgroup of order 15, since (up to isomorphism) the only group of order 15 is the cyclic group, and $S_5$ has no element of order 15.
–
Gerry MyersonMar 27 '11 at 23:35

Let $P dx + Q dy$ be a one-form, or if you're using the terminology of an introductory multivariable calculus course, a "vector field" that you can take line integrals of. Then students learn Green's Theorem, which says that if some countour $C$ bounds a region $D$, then $$\int_C P dx + Q dy = \int_D \left(\frac{dQ}{dx}-\frac{dP}{dy}\right) dx dy.$$

From this, one deduces that if the expression on the right hand side vanishes, then the integral around any contour is $0$. In particular, this allows one to define a primitive for $P dx + Q dy$.

Many students (myself included, a long way back) don't pay enough attention to the hypotheses in Green's Theorem and then assume that this is true of the following one-form (or "vector field"), which is my fundamental counterexample:

$$\frac{-ydx}{x^2+y^2} + \frac{xdy}{x^2+y^2}$$

Eventually a student discovers that the integral of this around the origin is $2 \pi$ and then wonders what went wrong. The problem is that the hypothesis of Green's Theorem requires that the form be defined everywhere in $D$.

In other words, this is a fundamental counterexample to the claim that a one-form in the plane with zero curl (where by "curl" I just mean the right hand side of the above) has a primitive.

Furthermore, this is a fundamental example of a nontrivial element in a de Rham cohomology group. In this case, the one-form above generates $H^1_{\text{dR}}(\mathbb{R}^2\setminus \{(0,0)\},\mathbb{R})$.

There exists a $3$-dimensional smooth projective variety $X$ which cannot be birational to a smooth variety with nef canonical bundle. This is because $K_X$ is big; if it was also nef it would have no cohomology and we could compute its self-intersection with Riemann-Roch by looking at the number of sections of its powers. It turns out that the self-intersection would be $3/2$.

This example (by Reid, I think) shows that if you want to have minimal models you have to allow singular varieties, so that $K_X$ can still be defined, but is not a Cartier divisor. This has led to the whole branch of birational geometry studying the type of singularities which are allowed in the minimal model program, like terminal, canonical, log-terminal, KLT and so on.

My favourite counterexample is purely academic: it does not have any applications, but I think it is pretty.

Let $X = \mathbb{N} \times \mathbb{N}$. Define a non-empty set $U \subseteq X$ to be open if for cofinitely many $x \in \mathbb{N}$ the set $\{ y \in \mathbb{N} \vert (x,y) \in U\}$ is cofinite.

Construct a sequence in $X$ that hits every point in $X$ exactly once. In other words, take a bijection $\mathbb{N} \rightarrow X$. Then:

$X$ is countable;

every point in $X$ is an accumulation point of this sequence, but

the sequence has no convergent subsequences.

In particular, this is an example in a countable set that accumulation point of a sequence does not have to be a limit of a subsequence. I call this the Herreshoff topology for the (high-school) student of mine who came up with it. (I could not find it anywhere else, although I do not discard that I did not look hard enough.)

This is sort of Arens-Fort space: en.wikipedia.org/wiki/Arens-Fort_space. Here you have the neighbourhoods of (0,0) in that space (considering (0,0) to be not in N x N), where there N x N is discrete. Your sequence then has the same properties.
–
Henno BrandsmaMar 6 '10 at 8:40

In question #14739, I asked whether the product of two ideals of a commutative ring $R$ could be defined lattice-theoretically the same way the sum and intersection can. Bjorn Poonen gave a great counterexample that shows the answer is no! This supports a point fpqc had been trying to make to me earlier that the relationship between $R$ and the Zariski topology on $\text{Spec } R$ was more subtle than I had thought: in particular, it has more structure than just the Galois connection.

The following are, I think, the "worst possible" counterexamples in measure theory. They would benefit from a nice list of properties -- I have a feeling that I'm forgetting a lot. Feel free to improve!

The Cantor set and its friend the Cantor function are standard counterexamples. Keeps increasing regardless of the zero derivative almost everywhere... Also, the corresponding measure $\mu$, defined so that the measure of the interval [a,b] is f(a)-f(b) where f is the Cantor function is supported on a Lebesgue-zero set.

Another good source of examples is the measurable set $A \subset [0,1]$ such that for any interval I, $\lambda(I\cap A) > 0$ and $\lambda(I\cap A^c) > 0$. ($\lambda$ is the Lebesgue measure, c denotes complement).

Here's a construction of A that I heard from Ulrik Buchholtz. Instead of just constructing A, we'll make two disjoint sets A and B which have intersection of positive measure with any interval. Consider the set of all subintervals of [0, 1] with rational endpoints. It is countable, so let In be the n-th interval in the list. Put two fat (positive-measure) disjoint Cantor sets (one for A and one for B) inside I1. (We can just put the second inside some gap of the first). By the main property of Cantor sets, every interval In minus the Cantor sets is a non-empty union of intervals. So, we can put two fat disjoint Cantor sets (also disjoint from the previous ones) inside I2, and keep going forever. Every time, we add one Cantor set to A and one to B.

Now, each subinterval of [0,1] will contain one of the In-s, and therefore its intersection with both A and B has positive measure. Both A and B are countable unions of measurable sets, and therefore measurable. We are done.

@llya The fat Cantor set is one of the great teaching examples of both analysis and topology.Most professors just go over the plain vanilla Cantor set. This is really doing the class a disservice because they don't really get the depth of the sheer diversity of pathology that can occur the real line simply by varying the details of the method of construction of the set,
–
The MathemagicianJul 29 '10 at 18:36

1

I also like the proof of the existence of the set $A$ you mentioned above using the Baire category. Consider the metric on measurable sets you get from the inclusion into L^{1}, to prove that such an $A$ exists, it suffices by Baire category to show that for any interval $I$ with rational endpoints the collection of sets $A$ which have $0<\lambda(A\cap I)<\lambda(I)$ are open and dense. But this is essentially a triviality.
–
Benjamin HayesMay 2 '11 at 19:53

I like the Sorgenfrey line. It's finer than the metric topology on R, and hereditarily Lindelöf, hereditarily separable, first countable, but not second countable. It's non-orderable, but generalised orderable, etc. It's a popular example for metrisation theorems, e.g. All its compact subsets are at most countable.