Pangram verdict · v3.3
We believe that this document is fully human-written
AI likelihood · overall
HumanArticle text · 1,800 words · 6 segments analyzed
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”).Formal logic usually isn’t taught in high school; as far as I know, a rigorous treatment of it isn’t 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.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”:\(\text{“If }\underbrace{\text{you finish house chores}\vphantom{|}}_{A}\text{, }\underbrace{\text{you can play Minecraft}\vphantom{|}}_{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”:\(\text{✅ "If you }\textbf{don't}\text{ finish chores, you }\textbf{can't}\text{ play Minecraft."}\)The statement may imply its converse (“if B then A”) and the contraposition (“if not B then not A”), but only if we take substantial liberties with the phrasing. If we simply shuffle A and B around, we break the implied temporal relationship between the propositions and end up with mild gibberish:\(\text{❓ "If you can play Minecraft, you finish chores."}\)\(\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:\(\text{“If }\underbrace{\text{my cat is hungry}\vphantom{|}}_{A}\text{, }\underbrace{\text{it meows}\vphantom{|}}_{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:\(\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:\(\text{✅ "If my cat }\textbf{doesn't }\text{meow, it }\textbf{isn't }\text{hungry."} \)Our problems with cat logic don’t end here. Let’s consider the following:\(\text{“If }\underbrace{\text{grass is green}\vphantom{|}}_{A}\text{ then }\underbrace{\text{kittens are cute}\vphantom{|}}_{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 antecedent (A) and the consequent (B) are not connected in any obvious way.But what if I told you that every Sunday morning, Bob wakes up with a headache?\(\text{“If }\underbrace{\text{it's Sunday morning}\vphantom{|}}_{A}\text{ then }\underbrace{\text{Bob has a headache}\vphantom{|}}_{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. Yet, in this context, a coincidence is good enough to accept the claim.
Another subjective issue crops up with the following statement:\(\text{“If }\underbrace{\text{skies are purple}\vphantom{|}}_{A}\text{ then }\underbrace{\text{pumpkins are square}\vphantom{|}}_{B}\text{.”}\)It feels wrong, but there’s nothing we can disprove: the consequent is false, but so is the antecedent it’s gated on. We just don’t like that the sentence limits our imagination: perhaps if skies were purple, pumpkins would be donut-shaped? But if the task at hand is to work from true premises toward logical conclusions, and A is not a true premise, why the heck are we trying to form opinions about B? It’s is a universe that doesn’t exist; we’re not given the axioms that govern it.It’s not just the if-then connective that’s cursed; the A and B atoms can cause problems too. 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?…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:A statement in the form “if A then B” (“A ⇒ B”):…does not imply its inverse (“not A ⇒ not B”). A cat that always meows when hungry isn’t required to stay quiet once fed.…doesn’t imply the converse (“B ⇒ A”). By extension, if you hear Mr. Mittens meowing, it’s not a given that he wants a meal.…implies its contraposition (“not B ⇒ not A”). No meows is proof positive that the cat isn’t looking for food.Lack of relevance is not fatal. A true proposition implies any other true proposition. In “if A then B”, it’s enough that A is true in tandem with B, so there’s nothing false about “if grass is green then kittens are cute”.Counter-to-fact conditionals are true.
A false antecedent can imply whatever it wants: “if skies are purple then pumpkins are square”. The sentence is true, with no actual consequences for pumpkin shape.You gotta take sides. The system only deals with statements that can bear a single, binary truth value. If it can’t, it’s not a valid statement.Logic arguments expressed with words are easy to grasp, so to keep the riff-raff out, mathematicians often resort to symbolic notation. For example, the idea that sets A and B are equal to each other if and only if they contain the same elements can be more enigmatically spelled out as:\(\forall A, B \bigl[A = B \iff \forall x ( x \in A \iff x \in B) \bigr]\)My initial plan for this article was to dive into this symbology next. But before we do, it may be useful to show how formal logic acts not only as a convenient language for proofs, but also as the source of math.Arithmetic is the oldest branch of mathematics; it’s also notable for having resisted attempts at formalization for a pretty long time. As it turns out, it’s tricky to explain numbers and basic arithmetic operations as anything other than “the things you know”. I don’t know why an apple plus an apple gives me two apples; I guess it’s just how apples are. It seems to work with fingers too.Regular readers may recall two earlier articles about some of the successful efforts to construct the arithmetic of natural numbers and reals from scratch. In the end, we took the existence of an empty set as a given and then defined numbers and operations through the repeated application of several fairly intuitive rules:The beauty of this method is that it gave us more than what we already knew. For example, it seamlessly generalized to operations on infinite numbers, with mildly surprising results.Unfortunately, in math textbooks, intuitive explanations aren’t the rule. Many of the discipline’s foundational axioms stem from investigations of the natural world, but we prefer to teach the craft as if it owed nothing to reality. In the modern academic practice, the question of where a particular idea came from, or whether an axiom is ontologically correct, is considered vacuous and out of scope. For the most part, you’re just handed a rulebook to play someone else’s game.In the remainder of the section, I’ll try to kill two birds with one stone.
First, we’ll look at yet another method of constructing the reals to develop intuition that will pay off once we get to digital logic (i.e., Boolean algebra). Second, on the topic of my mini-rant about mathematical education, we’ll note that the use of logic doesn’t necessarily make one’s arguments logical.The usual axiomatic approach to defining reals is to give students a collection of roughly fourteen ad-hoc rules for manipulating the elements of an otherwise opaque set we call “ℝ”. The axiomatic method doesn’t care what the set contains or what it means; the method doesn’t even posit the existence of any canonical version of ℝ. The point is just that we propose the existence of some universe of sets that, by an unseen mechanism, obey the specified rules.The rules are usually divided into three parts: field axioms, order axioms, and the axiom of completeness. Field axioms are easy; they pretend to be abstract, but tacitly capture natural laws. They assert the existence of a mystery operation called “addition” (symbol: “+”). The operation takes two operands in the reals and produces a result that’s also in ℝ. Further, the operation is associative and commutative; that is, for any a, b, and c in ℝ, it obeys the following equivalencies:\(\begin{array}{c} a + (b + c) = (a + b) + c \\ a + b = b + a \end{array}\)The same ruleset is given for multiplication (“·”):\(\begin{array}{c} a \cdot (b \cdot c) = (a \cdot b) \cdot c \\ a \cdot b = b \cdot a \end{array}\)So far, we’ve said nothing about what these two operators actually do. Turns out that we don’t have to say much; first, to distinguish between them, the axioms assert the existence of additive and multiplicative identities.
By that, we mean a pair of elements in ℝ, conventionally labeled “0” and “1”, such that for any a ∈ ℝ, the following equalities always hold true:\(\begin{array}{c} a + 0 = a \\ a \cdot 1 = a \end{array}\)Again, the model doesn’t concern itself with the “why” or the “how”; all we’re saying is that in a system that obeys the axioms, there must be a pair of elements for which the equalities hold. And if these elements exist, we might as well label them in a familiar way.Next, we posit that for any a taken from ℝ, there exists an additive inverse (“-a”); and that for any a ≠ 0, we can also find a multiplicative inverse (“1/a”). Because we don’t have subtraction or division defined just yet, we treat these inverses as atomic symbols that obey the following rules:\(\begin{array}{c} a + (-a) = 0 \\ a \cdot (1/a) = 1 \end{array}\)The final field axiom is the distributive property that ties the two operators together: a · (b + c) = a · b + a · c.The neat surprise is that these rules are already good enough to perform calculations in ℝ. By combining the axioms, we can easily prove that there can be only one additive identity (“0”), one multiplicative identity (“1”), and that “0” and “1” can’t be the same. Next, because addition always produces a result in ℝ, we conclude that there is a real associated with the value of 1 + 1. If we label this real “2”, we can for example show the following:\(a \cdot 2 = a \cdot \underbrace{(1 + 1)}_{\substack{\text{by our} \\ \text{definition} \\ \text{of "2"}}} = \underbrace{a \cdot 1 + a \cdot 1\vphantom{)}}_{\substack{\text{expanded in