All Posts
Study Guide

The Role of Examples and Counterexamples in Mathematics

How examples and counterexamples drive mathematical understanding, with a catalog of famous counterexamples and strategies for constructing your own.

Why Examples Are the Lifeblood of Mathematics

When Paul Halmos was asked for advice on learning mathematics, he said:

"A good stock of examples, as large as possible, is indispensable for a thorough understanding of any concept."

Examples are how we test definitions, verify theorems, build intuition, and discover new results. Counterexamples are how we understand the limits of our theorems and the necessity of our hypotheses.

This post explores the role of both in mathematical thinking.


Examples: What They Do

1. Making Definitions Concrete

Definitions in mathematics are abstract. Examples make them real.

When you first encounter the definition of a group — a set GG with an operation satisfying closure, associativity, identity, and inverses — it can feel arbitrary. But the moment you see examples, the definition comes alive:

  • (Z,+)(\mathbb{Z}, +): the integers under addition. The identity is 00, the inverse of nn is n-n.
  • (S3,)(S_3, \circ): the symmetric group on three elements, consisting of all permutations of {1,2,3}\{1, 2, 3\}.
  • (Z/nZ,+)(\mathbb{Z}/n\mathbb{Z}, +): integers modulo nn under addition.
  • The trivial group {e}\{e\}: the simplest example.

Each example highlights a different aspect of the definition. Z\mathbb{Z} shows that groups can be infinite and abelian. S3S_3 shows that groups can be finite and non-abelian. The trivial group shows the definition is not vacuous.

2. Testing Conjectures

Before trying to prove a statement, test it on examples. This can either:

  • Build confidence that the statement is true, motivating a proof attempt.
  • Reveal a counterexample, saving you from trying to prove something false.

Example. "Every continuous function on a closed interval is bounded." Test this on f(x)=x2f(x) = x^2 on [0,1][0, 1] — bounded. Test f(x)=sin(x)f(x) = \sin(x) on [0,2π][0, 2\pi] — bounded. The conjecture looks plausible. (It is in fact true, as a consequence of the extreme value theorem.)

Now try: "Every continuous function on an open interval is bounded." Test f(x)=1/xf(x) = 1/x on (0,1)(0, 1) — unbounded. Counterexample found. The closed interval hypothesis is necessary.

3. Guiding Proof Strategy

Often, working through an example reveals the structure of a general proof.

If you need to prove that every finite integral domain is a field, start by examining Z/5Z\mathbb{Z}/5\mathbb{Z}. In this specific case, you can verify that every nonzero element has a multiplicative inverse by listing them:

11=1,23=1,44=1.1 \cdot 1 = 1, \quad 2 \cdot 3 = 1, \quad 4 \cdot 4 = 1.

(Here all arithmetic is modulo 5.) The key observation is that the map xaxx \mapsto ax is injective for a0a \ne 0 (because the ring has no zero divisors), and an injective map from a finite set to itself is surjective. This specific observation generalizes directly to the proof for any finite integral domain.


Counterexamples: Why They Matter

A counterexample is an example showing that a statement is false. In mathematics, a single counterexample is enough to destroy a conjecture, no matter how plausible it seems.

Principle. A theorem with nn hypotheses needs nn counterexamples — one for each hypothesis — to show that no hypothesis can be dropped.

Famous Counterexamples

Here is a collection of counterexamples that every mathematics student should know:

Analysis

Claim (false): Every continuous function is differentiable.

Counterexample: The Weierstrass function f(x)=n=0ancos(bnπx)f(x) = \sum_{n=0}^{\infty} a^n \cos(b^n \pi x) where 0<a<10 < a < 1, bb is a positive odd integer, and ab>1+32πab > 1 + \frac{3}{2}\pi. This function is continuous everywhere and differentiable nowhere. Karl Weierstrass presented it in 1872, shocking the mathematical community.

Claim (false): If fnff_n \to f pointwise and each fnf_n is continuous, then ff is continuous.

Counterexample: Let fn(x)=xnf_n(x) = x^n on [0,1][0, 1]. Each fnf_n is continuous, and fn(x)0f_n(x) \to 0 for x[0,1)x \in [0, 1) and fn(1)1f_n(1) \to 1. The limit function is discontinuous at x=1x = 1. This is why we need uniform convergence to preserve continuity.

Claim (false): If an\sum a_n converges, then an0a_n \to 0 rapidly.

Counterexample: The harmonic-like series 1/n\sum 1/n diverges even though 1/n01/n \to 0. Convergence of ana_n to zero is necessary but not sufficient for convergence of the series.

Algebra

Claim (false): Every group in which every element has order 2 is abelian.

Wait — this one is actually true. If g2=eg^2 = e for all gg, then g=g1g = g^{-1}, so gh=(gh)1=h1g1=hggh = (gh)^{-1} = h^{-1}g^{-1} = hg. This illustrates that sometimes the conjecture is correct, and the "counterexample hunt" instead reveals a proof.

Claim (false): Every commutative ring with unity is an integral domain.

Counterexample: Z/6Z\mathbb{Z}/6\mathbb{Z} is a commutative ring with unity, but 23=02 \cdot 3 = 0, so it has zero divisors and is not an integral domain.

Topology

Claim (false): Every connected space is path-connected.

Counterexample: The topologist's sine curve, defined as the closure of {(x,sin(1/x)):x>0}\{(x, \sin(1/x)) : x > 0\} in R2\mathbb{R}^2. This space is connected but not path-connected — you cannot draw a continuous path from a point on the yy-axis to a point on the oscillating curve.

Claim (false): A subset of Rn\mathbb{R}^n is compact if and only if it is bounded.

Counterexample: (0,1)(0, 1) is bounded but not compact (consider the open cover {(1/n,1):n1}\{(1/n, 1) : n \ge 1\}). Compactness in Rn\mathbb{R}^n requires both closed and bounded (Heine-Borel).

Linear Algebra

Claim (false): If AB=0AB = 0, then A=0A = 0 or B=0B = 0.

Counterexample: A=(1000)A = \begin{pmatrix} 1 & 0 \\ 0 & 0 \end{pmatrix}, B=(0001)B = \begin{pmatrix} 0 & 0 \\ 0 & 1 \end{pmatrix}. Then AB=0AB = 0 but neither AA nor BB is the zero matrix.


How to Construct Counterexamples

Finding counterexamples is a skill. Here are strategies:

Strategy 1: Start Small

Try the smallest or simplest objects first. For groups, try Z/2Z\mathbb{Z}/2\mathbb{Z}, Z/3Z\mathbb{Z}/3\mathbb{Z}, S3S_3. For topological spaces, try R\mathbb{R}, [0,1][0,1], S1S^1. For matrices, try 2×22 \times 2 matrices.

Strategy 2: Look at the Hypotheses

If a theorem requires hypothesis HH, look for an object that satisfies all hypotheses except HH and check whether the conclusion fails.

Strategy 3: Use Pathological Examples

Mathematics has a rich tradition of "pathological" objects designed to break naive assumptions:

  • The Cantor set (uncountable, measure zero, nowhere dense, compact, totally disconnected)
  • The Dirichlet function (discontinuous everywhere)
  • The long line (connected, locally Euclidean, not second-countable)
  • The Hawaiian earring (path-connected, not semi-locally simply connected)

Keeping a mental catalog of these objects is extremely useful.

Strategy 4: Modify Known Examples

If you know one counterexample, you can often modify it to create others. The Weierstrass function can be adapted to create functions with various combinations of continuity, differentiability, and integrability properties.


Building Your Own Example Library

Every serious mathematics student should maintain a personal catalog of examples and counterexamples, organized by subject.

A useful format is:

ConceptExampleCounterexample
Continuous functionf(x)=x2f(x) = x^2Dirichlet function
Compact set[0,1][0,1](0,1)(0,1)
Normal subgroupAnSnA_n \trianglelefteq S_n(12)\langle (12) \rangle in S3S_3
Connected spaceR\mathbb{R}Q\mathbb{Q}

Add to this catalog as you learn new concepts. Over time, it becomes one of your most valuable study resources.


The Art of the Minimal Example

A minimal example is the simplest object that exhibits a particular property. Finding minimal examples is an art:

  • The smallest non-abelian group is S3S_3 (order 6).
  • The smallest field that is not Z/pZ\mathbb{Z}/p\mathbb{Z} for any prime pp is F4\mathbb{F}_4 (the field with 4 elements).
  • The simplest example of a normal extension that is not Galois (in characteristic pp) is a purely inseparable extension.

Minimal examples are valuable because they strip away all irrelevant complexity, leaving only the essential structure.


When Examples Lead to Theorems

Sometimes, the careful study of examples leads to the discovery of new theorems.

Euler studied examples of polyhedra and noticed that VE+F=2V - E + F = 2 for every convex polyhedron (vertices minus edges plus faces). This observation, born from examples, led to one of the most important results in topology: the Euler characteristic.

Gauss studied examples of primes and conjectured the prime number theorem based on numerical evidence, long before a proof was found.

In both cases, extensive computation and example-gathering preceded the general result.


Summary

  • Examples make abstract definitions concrete and testable.
  • Counterexamples reveal the necessity of hypotheses and the limits of theorems.
  • Building a personal library of examples is one of the most effective study strategies in mathematics.
  • Learning to construct counterexamples is a skill that improves with practice.

The mathematician who has the richest collection of examples has the deepest understanding.


References

  • Lynn Arthur Steen and J. Arthur Seebach Jr., Counterexamples in Topology, Dover, 1995.
  • Bernard Gelbaum and John Olmsted, Counterexamples in Analysis, Dover, 2003.
  • Joseph Romano and Andrew Siegel, Counterexamples in Probability and Statistics, Chapman and Hall, 1986.
  • Paul Halmos, I Want to Be a Mathematician, Springer, 1985.
  • John B. Conway, A Course in Functional Analysis, Springer, 1990.
  • Michael Artin, Algebra, Pearson, 2010.