Theorems with both constructive and non-constructive proofs [00BM]
I've been working on writing up some advanced, optional notes for my Discrete Mathematics students (mostly second-year undergraduates) on classical vs constructive logic, and I wanted a good example of a theorem with both non-constructive and constructive proofs.
A typical example of a non-constructive proof is of the infinitude of primes: for any natural number n, we consider the number n! + 1: either it is prime, or it is divisible by one which must be larger than n, since n! + 1 is clearly not divisible by anything \leq n. This is supposedly nonconstructive since it uses LEM to conclude that n!+1 is either prime or not, but this is totally unsatisfactory to me. Since primality is decidable, this instance of LEM is actually constructively provable, and the whole proof immediately becomes an algorithm for computing a prime larger than any n.
(Another typical "example" is the so-called proof by contradiction that \sqrt {2} is irrational; but of course, it is not a proof by contradiction at all.)
I asked for examples on Mastodon, which led to a very interesting discussion.
- Henrý Ólson suggested the theorem "there exist irrational a and b such that a^b is rational".
- The nonconstructive proof uses LEM: \sqrt {2}^{\sqrt {2}} is either rational or not; if so, it satisfies the theorem, and if not, (\sqrt {2}^{\sqrt {2}})^{\sqrt {2}} = 2 does.
- Constructively, we can show that \lg 9 is irrational and that (\sqrt 2)^{\lg 9} = 3.
- I came up with the theorem "For every natural n, there exists m > n which is not square".
- Both the nonconstructive and constructive proofs depend on the (constructively proved) lemma that if m is square then m+1 is not.
- The nonconstructive proof proceeds by contradiction: suppose every m > n is square. Then in particular n+1 and n+2 are square, but the lemma immediately yields a contradiction.
- The constructive proof considers (n+1)^2+1, which is immediately seen to be non-square by the lemma.
- Jim Kingdon also gave another example, Bézout's identity. This seems like a nice example, and one that is accessible to undergraduates, but I'm still confused about it!
- The constructive proof is via the Extended Euclidean Algorithm.
- The typical non-constructive proof considers the set \{ax + by \mid a, b \in \Z , ax + by > 0\} and notes that it must have a smallest element by the well-ordering property, then proceeds to prove that this smallest positive element is in fact the GCD of a and b. Intuitively, this seems clearly non-constructive, since it does not actually help you compute the smallest element of the set. But I am still a bit confused about where exactly a classical axiom ends up getting used. The version of the well-ordering principle which says that every set has a well-order implies the Axiom of Choice; but we surely don't need such a big hammer here. We are simply using the version that applies to subsets of natural numbers, which is constructively provable (in fact, it is logically equivalent to induction). The answer seems to be that the constructive well-ordering principle for the natural numbers requires membership of the set to be decidable, and deciding whether there exist integers a and b such that ax + by = n for a particular n is nontrivial. If you just throw LEM at it, you get the nonconstructive proof. Or if you work harder, you can actually decide this via the Extended Euclidean Algorithm.