All logic, no bite - lcamtuf’s thing
lcamtuf’s thing
SubscribeSign in
All logic, no bite<br>This radio station gets many requests for treatises on formal logic.<br>Jun 27, 2026
Share
Today, I’d like to talk about logic — and before I do, I should probably explain why. But before we get to that, a definition may be in order: in a nutshell, logic is a system for drawing conclusions from premises (“facts”).<br>Formal logic usually isn’t taught in high school; as far as I know, it’s not even a requirement for most computer science degrees. The concept is familiar to most mathematicians and to a handful of software engineers who dabble in esoteric programming languages. As for everyone else, we might know about “digital logic”, a simple algebra of binary numbers that involves operators such as AND, NOT, and OR. What’s less clear is how we get from zeroes and ones to some semblance of human reasoning.<br>A mathematician’s lament
For mathematicians, the most common role of formal logic is to provide a more precise vocabulary for proofs. To illustrate some of the ambiguities of everyday speech, consider the following statement in the form of “if A then B”:<br>\(\text{“If }\underbrace{\text{you finish house chores}\vphantom{\biggl(}}_{A}\text{, }\underbrace{\text{you can play Minecraft}\vphantom{\biggl(}}_{B}\text{.”}\)
It’s something a parent could say to a child. In that use, the phrasing clearly implies its own inverse, “if not A then not B”:<br>\(\text{✅ "If you }\textbf{don't}\text{ finish chores, you }\textbf{can't}\text{ play Minecraft."}\)
On the flip side, it probably doesn’t imply its converse (“if B then A”) or the contraposition (“if not B then not A”). I say “probably” because there’s a temporal relationship baked into the order of the propositions; if we reverse it, we end up with mild gibberish:<br>\(\text{❓ "If you }\textbf{can't}\text{ play Minecraft, you }\textbf{don't}\text{ finish chores."}\)
Do all other “if A then B” statements play by the same rules? Nope:<br>\(\text{“If }\underbrace{\text{my cat is hungry}\vphantom{\biggl(}}_{A}\text{, }\underbrace{\text{it meows}\vphantom{\biggl(}}_{B}\text{.”}\)
This time around, the phrasing doesn’t imply the inverse (“if not A then not B”). The speaker isn’t suggesting that Mr. Mittens meows only when it wants to eat. Therefore, we can’t infer the following:<br>\(\textrm{❌ }{\text{“If }{\text{my cat }\textbf{isn't }\text{hungry, it}\textbf{ doesn't}\text{ meow."}}}\)
On the flip side, if the original assertion is true — if the cat always begs for food — the contraposition (“if not B then not A”) follows in a straightforward way:<br>\(\text{✅ "If my cat }\textbf{doesn't }\text{meow, it }\textbf{isn't }\text{hungry."} \)
Our problems with cat logic don’t end here. Next, let’s consider the following:<br>\(\text{“If }\underbrace{\text{grass is green}\vphantom{\biggl(}}_{A}\text{ then }\underbrace{\text{kittens are cute}\vphantom{\biggl(}}_{B}\text{.”}\)
Both A and B are true, but most people would peg the statement as false — or at least wrong. The truths coincide, but we reject the argument because the concepts are not connected in any obvious way.<br>But what if I told you that every Sunday morning, Bob wakes up with a headache?<br>\(\text{“If }\underbrace{\text{it's Sunday morning}\vphantom{\biggl(}}_{A}\text{ then }\underbrace{\text{Bob has a headache}\vphantom{\biggl(}}_{B}\text{.”}\)
As before, I don’t know what’s the connection. Maybe there isn’t one; maybe the timing of Bob’s migraines is just a cosmic coincidence. In this context, a coincidence is good enough to accept the claim.<br>It’s not just the if-then connective that’s cursed; the A and B atoms are also suspect. In our examples, they appear to be declarations of facts — but can we proclaim anything we want? If I say “this statement is false”, is that a truth or a falsehood? Neither? Both?…<br>These semantic gotchas are great if you’re devising brain-teasers for nerds; they’re not helpful if you’re writing down a mathematical argument. This is why mathematicians rely on formal logic to define some predictable ground rules. The classic approach is pretty close to common sense, but it resolves the ambiguities by making several ad hoc calls. In particular:<br>A statement in the form “if A then B” does not imply its inverse (“if not A then not B”). The assertion that Mr. Mittens meows when hungry doesn’t rule out meowing for other causes.
By extension, the syntax does not imply the converse (“if B then A”). If you hear meowing, it’s not a given that the cat wants to be fed.
On the flip side, the construction does imply its contraposition (“if not B then not A”). No meows is proof positive that the cat had its meal.
To prove “if A then B”, it’s sufficient to show that B is true whenever A is true. There’s nothing wrong with “if grass is green then kittens are cute”.
The system only deals with statements that can bear a binary truth value. We don’t allow “neither” or “both”.
Logic statements expressed with words are easy to...