★ Classical vs constructive logic [007U]
- February 25, 2026
Motivation [007V]
- February 25, 2026
The way we introduced propositions was based on the idea of propositions as Booleans: each proposition is either true or false, and propositional connectives such as \land , \rightarrow , and so on were introduced via truth tables, that is, whether they result in a true or false proposition when given various Boolean values as input.
This is fine when we are dealing with Boolean conditions in programs or digital logic circuits. But in a larger sense it is unsatisfactory: in many cases, we don't just want to know whether something is true or false, we want to know why it is true. Besides just being part of human nature, understanding why things are true can also have practical benefits, for example, when writing programs to actually calculate things.
Truth vs provability [008U]
- March 2, 2026
The key is to switch our perspective: rather than focusing on whether propositions are true, we want to know whether they are provable, i.e. whether it is possible to provide specific (computational) evidence which establishes that they must be true. We are not content to know that something has to be true, but require direct evidence.
As a metaphorical example, imagine we want to know whether a certain student attended a certain class. But we don't accept just a plain answer of "yes"; we require direct evidence. Of course, we would have to decide what counted as direct evidence; perhaps, say, we would require a written statement from the instructor, who saw them in class with their own eyes and recorded their presence in the gradebook. Whatever we decided, we would only accept that direct evidence, and not circumstantial evidence: for example, if someone saw the student enter the class and then leave the class again later, we would not accept that as evidence in place of an actual statement from the instructor, even if it seems like it would logically imply that the student must have been in class the whole time and the instructor must therefore have observed and recorded their presence.
Example constructive and non-constructive proofs [008T]
- March 2, 2026
So what kind of proofs do we want, and what kind do we want to reject? As an example, consider the proposition "for every natural number, there is a larger number which is not a square". Intuitively, this proposition shows that there are infinitely many non-squares: no matter where we are on the number line, we can always find a non-square farther along. We might encode this in formal propositional logic as follows:
Theorem Infinitude of non-squares [008V]
Definition Perfect squares [008W]
No consecutive squares [008X]
- March 3, 2026
If any natural number n \geq 1 is a perfect square, then n+1 is not. That is, \forall {n}: {\mathbb {N}}.\; (n \geq 1) \to (\mathrm {Square}(n) \to \neg \mathrm {Square}(n+1)).
Proof.
- March 3, 2026
Subproof. No consecutive squares ›
- March 3, 2026
Subproof. No consecutive squares ›
- March 3, 2026
Since we have supposed that n and n+1 are both squares, by definition there are natural numbers j and k such that n = j^2 and n+1 = k^2. Note that k > j (since k^2 > j^2) and also j \geq 1 (since n \geq 1).
(n+1) - n = 1, but also
Hence we have proved n+1-n = 1 and also n+1-n \geq 2, which is absurd.
Non-constructive proof of infinite nonsquares [009J]
- March 7, 2026
First, let's see how we might prove there are infinitely many non-squares in a way that is logical, but doesn't explicitly tell us why it has to be true.
Proof.
- March 7, 2026
Subproof. Non-constructive proof of infinite nonsquares ›
- March 7, 2026
This proof (besides being unnecessarily complicated) is unsatisfying in exactly the way discussed previously: it establishes that there must exist a number bigger than n which is not square, but it doesn't really tell us how to find one. In fact, it tells us that either n+1 or n+2 must be a non-square, but it doesn't tell us which!
Constructuve proof of infinite nonsquares [009K]
- March 7, 2026
Here is a different proof:
Proof.
- March 7, 2026
Unlike the previous proof, this proof directly tells us how to calculate, for any n, a bigger number which is not a square.
Constructive logic [007W]
- February 25, 2026
In fact, the way the rules for proof were presented is (mostly) constructive logic! Rather than defining each connective by a truth table, we can actually define each connective by its introduction and elimination rules, i.e. by how to prove them, and how to use them if we already know them.
Classical algebraic laws [0081]
- February 26, 2026
Some of the algebraic laws we learned are only valid in classical logic, and not in constructive logic. For example:
- The law of excluded middle, which says that P \lor \neg P \equiv \mathsf {T}. The problem is that a proof of P \lor Q is supposed to tell us which one of P or Q is provable, along with a proof. But excluded middle would allow us to simply assume we know P \lor \neg P, without being able to actually tell us which of P or \neg P is true.
- The double negation law, \neg \neg P \equiv P. The problem with this one is that a proof of \neg \neg P is much less informative than a proof of P: a proof of \neg \neg P doesn't really tell us why P is true, only why it can't not be true.
- One particular direction of a de Morgan law, namely, \neg (P \land Q) \to \neg P \lor \neg Q. XXX