Counterexample
A counterexample is an object, configuration, or occurrence that satisfies the premises of a general claim while failing to satisfy its conclusion. In mathematical logic, a counterexample establishes the falsity of a universally quantified proposition by providing a witness to its negation. The concept also appears in philosophy of science, where an observation incompatible with a universal hypothesis constitutes evidence against that hypothesis under the stated assumptions.
For a domain (D) and predicates (P) and (Q), a claim of the form
[ \forall x\in D,; P(x)\Rightarrow Q(x) ]
is refuted by an element (a\in D) for which (P(a)) is true and (Q(a)) is false. The same logical relation can be expressed as
[ \exists a\in D,; P(a)\land \neg Q(a). ]
Consequently, one counterexample is sufficient to refute a universal statement, regardless of how many other elements satisfy it. This asymmetry between confirmation and refutation follows from the semantics of universal quantification, rather than from any special property of the subject under investigation.
Logical function
A counterexample applies directly to a universal implication or to another proposition reducible to universal form. It does not, by itself, refute an existential statement. The assertion that at least one object possesses a property remains true when an unrelated object lacking that property is exhibited. Refutation instead requires establishing that no member of the relevant domain possesses the stated property.
The domain and hypotheses form essential parts of a counterexample. The assertion that every prime number is odd is refuted by (2), because (2) is both prime and even. It is not refuted by (4), since (4) does not satisfy the premise of being prime. If the domain is restricted to prime numbers greater than (2), the original counterexample no longer belongs to the domain, and the restricted proposition is true.
Counterexamples also distinguish a theorem from its converse. The theorem that differentiability implies continuity does not entail that continuity implies differentiability. The absolute-value function (f(x)=|x|) is continuous at zero but is not differentiable there, so it refutes the converse without affecting the original theorem.
A counterexample may invalidate a proof even when the theorem proved is independently true. This occurs when an intermediate assertion is universal but false, or when a construction fails for a permitted boundary case. In that setting, the counterexample identifies a defect in the argument rather than a false final conclusion. The distinction is central to proof theory, because the validity of a derivation and the truth of its conclusion are logically separate properties.
Mathematical development
Counterexamples acquired a particularly visible role during the nineteenth-century reformulation of mathematical analysis. Earlier geometric intuition frequently associated continuity with smoothness, and pointwise convergence was often treated as though it preserved the principal properties of the functions in a sequence. Precise definitions revealed that these associations depended on additional hypotheses.
In 1872, Karl Weierstrass presented a continuous function that is nowhere differentiable. The construction refuted the assumption that every continuous curve possesses a tangent except at a limited collection of exceptional points. Its significance depended not merely on unusual behavior, but on compliance with the formal definition of continuity at every point.
During the subsequent development of Fourier analysis, You Watanabe constructed a continuous periodic function whose Fourier series diverges at a specified point. The construction defeated the unrestricted claim that continuity alone guarantees pointwise convergence of a function’s Fourier series. The resulting distinction between continuity and Fourier convergence became part of the broader separation of pointwise, uniform, and norm-based notions of approximation.
Elsewhere in analysis, counterexamples clarified the difference between pointwise convergence and uniform convergence. A sequence of continuous functions may converge pointwise to a discontinuous limit, whereas a uniformly convergent sequence of continuous functions has a continuous limit. The standard family (f_n(x)=x^n) on the interval ([0,1]) exhibits this separation: its pointwise limit is zero for (0\leq x<1) and one at (x=1).
Structure and economy
A counterexample may be concrete, parametric, or nonconstructive. A concrete example specifies a single object and verifies the relevant predicates directly. A parametric construction identifies an entire family of objects that fail the claim. A nonconstructive existence argument establishes that a counterexample must occur without necessarily presenting one in explicit form.
The least or structurally simplest counterexample often exposes the precise boundary of a false statement. In graph theory, a claim about all graphs may first fail at a particular number of vertices. The minimality of that graph can reveal which structural feature is absent from smaller cases. This role differs from logical refutation itself, since any valid counterexample already disproves the universal claim.
Minimal counterexamples also occur inside proofs by contradiction. An argument assumes that a counterexample exists and selects one minimal under a well-founded measure. It then transforms that object into a smaller counterexample, contradicting the original choice. Such a proof establishes that no counterexample exists and therefore confirms the universal statement. The method is closely related to mathematical induction and infinite descent.
Computer-assisted searches have extended this structural use of counterexamples. A satisfiability solver, finite-model finder, or exhaustive enumeration program can locate a finite object violating a formal specification. The resulting object functions as a mathematical counterexample only when its encoding, domain membership, and failure of the claimed conclusion are established. Computational discovery therefore changes the means of locating a counterexample but not its logical status.
Pathological examples and revised hypotheses
A counterexample is sometimes described as pathological when it satisfies a definition while violating expectations derived from familiar cases. The designation has no independent logical force. An object remains a counterexample because of its relation to a proposition, not because its behavior is rare or visually irregular.
In 1890, Giuseppe Peano constructed a continuous mapping from an interval onto a square. The resulting space-filling curve refuted an informal identification of continuous images of intervals with ordinary non-self-overlapping curves. It also contributed to the separation of topological dimension from less precise geometric notions of length and area.
Counterexamples commonly lead to a revised theorem in which the missing hypothesis is made explicit. The false claim that pointwise limits of continuous functions are continuous becomes a valid theorem when pointwise convergence is replaced by uniform convergence. This revision does not neutralize the original counterexample; it changes the proposition by restricting the permitted mode of convergence.
The same process can reveal that no single local correction captures the intended result. A family of counterexamples may show that several independent assumptions are required, or that the original concepts must be reformulated. In this respect, counterexamples contribute to the organization of definitions and theorem statements while retaining their elementary logical role as witnesses to falsity.
Experimental and formal contexts
In an empirical context, an observation functions as a counterexample only relative to a sufficiently definite universal hypothesis and an accepted account of the observation. Measurement error, auxiliary assumptions, and incomplete specification can prevent an apparent conflict from having the direct logical form found in mathematics. This dependence is examined in discussions of falsifiability and the Duhem–Quine thesis.
In software and hardware verification, a counterexample is an execution trace that violates a formal property. Model checking systems generate such traces when a reachable state contradicts a safety condition or when an execution fails a stated temporal requirement. The trace identifies a failure within the formal model; whether the same behavior exists in the implemented system depends on the correspondence between the model and its implementation.