Propositional logic [00BH]
- March 14, 2026
Introduction to Propositional Logic [002R]
- December 15, 2025
Motivation [002N]
- December 14, 2025
Consider the following two problems:
- 30 people each buy a ticket to see the heffalump. The owner pays $12 for food and ends up with $33 in profit. How much does one ticket cost?
- In what circumstances does the following loop stop?
while (tickets < 30 or (!heffalumps.isEmpty() and not(count > 5))): ...
How would you solve these? Different students give different answers, but if you are like many, you would solve the first one by writing down an algebraic equation and solving it, and the second one by talking about it and thinking hard. The first problem definitely seems easier.
It turns out that people used to solve algebra problems like the first using natural language and thinking really hard. Formal notation is a superpower! Our goal is to allow you to solve the second problem using a formal language too.
As another motivation for our study: how do we rigorously prove a mathematical statement, i.e. how can we completely convince ourselves and others of its truth? How do we know what details we need to include, and what counts as a correct argument? As we will see, the language of propositional logic can help with this, too!
Propositions [002O]
- December 14, 2025
Definition Proposition [002P]
- December 14, 2025
A proposition is a declarative statement that can be true or false.
Remark [002T]
- December 15, 2025
This is not really a formal definition, but just an intuitive idea of what propositions should be. Later, we will define more formal ways to create propositions.
Example [002Q]
- December 14, 2025
Some example propositions:
- Washington, D.C. is the capital city of the United States.
- 9 is evenly divisible by 3.
- Toronto is the capital of Canada.
- 9 < 3.
- Every even natural number greater than 2 can be written as the sum of two prime numbers.
The first two propositions are true. The next two are false. The last one is a famous proposition called the Goldbach Conjecture; we do not know if it is true or false. However, all of these are valid propositions.
Example [002S]
- December 15, 2025
Some examples of things which are not propositions:
- 3 + 7
- Please hold this.
- Is the moon made of cheese?
The first is an expression with a numeric value, not a declarative true or false statement. The second is a command, and the third is a question. The question could be answered by a proposition (e.g. "The moon is made of cheese."), but it is not itself a proposition.
Remark Propositional variables [002U]
- December 15, 2025
We will tend to use the letters p, q, r, s or P, Q, R, S to stand for arbitrary propositions.
Booleans in Disco [003O]
- January 28, 2026
In Disco, the type Bool has two values, T and F (which can also be written True and False, or true and false):
Disco> :type T T : Bool Disco> :type F F : Bool Disco> true T Disco> False F
One way we can create Bool values in Disco is using comparison operators:
Disco> 3 < 9 T Disco> 3 > 9 F Disco> 6 <= 7 T Disco> 6 >= 7 F Disco> 5 == 5 T Disco> 6 /= 5 T
Propositional connectives [002V]
- December 16, 2025
Now we will see how to put propositions together to build up more complex propositions.
Negation (NOT) [003D]
- January 21, 2026
The first and simplest connective we will consider is negation, which flips a proposition from true to false and vice versa.
Definition Negation [002W]
- December 16, 2025
If P is any proposition, the negation of P is written \neg P (or sometimes \overline {P}) and read as "not P" or "It is not the case that P." \neg P is true whenever P is false, and vice versa.
Remark Truth table for negation [002Y]
- December 16, 2025
We can summarize the definition of negation with a truth table showing the truth value of \neg P for each possible value of P: \begin {array}{cc}P & \neg P \\ \hline \mathsf {T} & \mathsf {F} \\ \mathsf {F} & \mathsf {T} \end {array}
In general, a truth table is a table showing the value of some expression for every possible combination of values for some variables. In this case, there is only one variable, so the table only has two rows—one for P = \mathsf {T} and one for P = \mathsf {F}.
Remark Disco :table command [002X]
- December 16, 2025
We can also get Disco to show us the truth table for
negation, using the :table command:
Disco> :table not F T T F
Conjunction (AND) [003E]
- January 21, 2026
The next connective we consider is conjunction, commonly known as AND.
Definition Conjunction [002Z]
- December 16, 2025
The conjunction of propositions P and Q is written P \land Q, and pronounced "P and Q". It is true when both P and Q are true, and false otherwise.
Remark [0030]
- December 16, 2025
One way you can remember the symbol \land is by noticing that it looks a bit like a capital letter A (for "And") without the crossbar.
Remark Truth table for conjunction [0031]
- December 16, 2025
Let's make a truth table. Notice that the truth table for \neg P needed two rows, one for \mathsf {T} and one for \mathsf {F}. The truth table for P \land Q will need four rows, one for each possible combination of truth values for P and Q. \begin {array}{ccc} P & Q & P \land Q \\ \hline \mathsf {T} & \mathsf {T} & \mathsf {T} \\ \mathsf {T} & \mathsf {F} & \mathsf {F} \\ \mathsf {F} & \mathsf {T} & \mathsf {F} \\ \mathsf {F} & \mathsf {F} & \mathsf {F} \\ \end {array}
Conjunction in Disco [003P]
- January 28, 2026
In Disco, conjunction can be written /\, or and, or &&:
Disco> T and F F Disco> (1 < 5) && (6 <= 6) T Disco> true /\ (99 == 990) F
As before, we can also get Disco to show us a truth table:
Disco> :table /\ F F F F T F T F F T T TThe rows are in a different order than the table shown previously, but the order of the rows doesn't really matter.
Example [003G]
- January 21, 2026
Conjunction works just like we expect in natural language. Consider: "It is not raining today and I had eggs for breakfast."
This is true if both parts are true. If it's raining, the statement is false. If I ate something other than eggs, it's false. Of course it's definitely false when it's raining and I ate something other than eggs.
If we let r = "It is raining today" and e = "I had eggs for breakfast", then we can translate this sentence into propositional logic as \neg r \land e. Note that negation has "higher precedence" than conjunction (it has "stickier glue") so this is unambiguous. It does not mean \neg (r \land e), which would be different. If in doubt, just use parentheses: (\neg r) \land e.
Disjunction (OR) [003F]
- January 21, 2026
We next consider disjunction, commonly known as OR.
Definition Disjunction [003H]
- January 21, 2026
The disjunction of P and Q is written P \lor Q, and pronounced "P or Q". It is true when at least one of P and Q are true, and false when both are false.
Remark Truth table for disjunction [003I]
- January 21, 2026
We can make a truth table for disjunction as follows: \begin {array}{ccc} P & Q & P \lor Q \\ \hline \mathsf {T} & \mathsf {T} & \mathsf {T} \\ \mathsf {T} & \mathsf {F} & \mathsf {T} \\ \mathsf {F} & \mathsf {T} & \mathsf {T} \\ \mathsf {F} & \mathsf {F} & \mathsf {F} \\ \end {array}
Remark Notation for conjunction vs disjunction [003J]
- January 21, 2026
The symbols \land and \lor are easy to mix up. Just remember that \land looks like a capital "A" for "And", \lor looks like a capital "V" for "Vote" (a vote is when you choose between options).
Remark Duality of conjunction and disjunction [003K]
- January 21, 2026
There's a good reason the symbols for conjunction and disjunction are upside down versions of each
other: they are "opposite" (the mathy word is "dual") in the
sense that if we consider an opposite world where everything false
becomes true and vice versa, then \land becomes \lor and vice
versa. Consider the following alternative definition of disjunction:
The disjunction of propositions P and Q is false when both P
and Q are false, and true otherwise.Definition Disjunction (alternative) [003L]
Disjunction in Disco [003Q]
- January 28, 2026
In Disco, disjunction can be written \/, or or, or ||:
Disco> T or F T Disco> (1 < 5) || (6 <= 6) T Disco> false \/ (99 == 990) F
Remark Disjunction in English: inclusive and exclusive OR [003M]
- January 21, 2026
Unlike the word "and", whose English meaning corresponds pretty exactly with its meaning in logic, we use the English word "or" in at least two logically distinct ways. Consider the following English sentences:
- The prerequisite for Algorithms is MATH 240 or permission of the instructor.
- Each entree is served with your choice of soup or a salad.
In the first example, it's OK for both things to be true: it is fine if you pass MATH 240 and also (for some reason) get the instructor's permission to take Algorithms. This is called inclusive or, and corresponds to disjunction (\lor ).
In the other example, you can choose soup, or a salad, but not both (you would be charged extra, at the very least). This is called exclusive or, sometimes written P \oplus Q. It is true when exactly one of P, Q is true, and false otherwise. (Put another way, it is true when P and Q are different, and false when they are the same.) Exclusive or is very important in computer science, but rarely comes up in mathematical logic.
Example [003N]
- January 21, 2026
Let r = "It is raining today", e = "I had eggs for breakfast", and c = "I had cereal for breakfast." Consider the sentence "Either it is raining, or I ate cereal and not eggs for breakfast." We can translate this sentence into propositional logic as follows: r \lor (c \land \neg e) Note that it's not necessarily clear which kind of or to use here; it doesn't matter too much. Also, the parenthesis may technically not be required, but it's probably best to include them.
Implication (IF-THEN) [003R]
- January 28, 2026
The last major connective we will consider is implication, which may be less familiar but is no less important.
Definition Implication [003S]
- January 28, 2026
Let P and Q be propositions. The conditional or implication "if P, then Q" is written P \to Q. It is true if Q is true whenever P is true.
Remark Terminology for the parts of an implication [003T]
- January 28, 2026
In an implication P \to Q, the left-hand proposition P is called the premise or hypothesis. Q is called the conclusion.
You do not need to memorize these terms, but you should be familiar with them.
Truth table for implication [003U]
- January 28, 2026
Let's figure out what the truth table for implication should be. I like to think of it this way: if someone makes you a promise of the form "if ... then ...", in what scenarios have they lied to you?
Consider the propositions
- P = "You fulfill all the requirements for an A."
- Q = "You get an A."
- You complete all the requirements and get an A. This is great; I have kept my promise.
- You complete all the requirements but don't get an A. Obviously in this scenario I lied and you should be super mad at me, and probably complain to my department chair or the Provost.
- Let's next consider the scenario where you don't complete the requirements for an A, and don't get an A. You might be mad at yourself but you certainly can't be mad at me. I still made a true statement.
- The last case is the one that sometimes trips people up: what if you don't complete the requirements, but you get an A anyway? You obviously won't be upset in this scenario (though other students might!), but did I lie? Actually, I didn't. I only said what would happen if you DO complete the requirements. I am free to do whatever I want (including giving you an A anyway) if you don't. (In fact, I occasionally do this in special circumstances!)
So overall we have the following truth table: \begin {array}{ccc} P & Q & P \to Q \\ \hline \mathsf {T} & \mathsf {T} & \mathsf {T} \\ \mathsf {T} & \mathsf {F} & \mathsf {F} \\ \mathsf {F} & \mathsf {T} & \mathsf {T} \\ \mathsf {F} & \mathsf {F} & \mathsf {T} \\ \end {array}
In other words, the only scenario in which an implication P \to Q is false is when P is true but Q is false. It is true in all other cases. "If the premise is false, anything goes!"
Implication in English [003V]
- January 28, 2026
There are lots of ways to express conditionals in English besides just "if P then Q". For example:
- if P, Q
- P implies Q
- Q if P
- P only if Q
- Q whenever P
Again, you need not memorize this list, but it's good to be aware of these.
Definition Related conditionals [003W]
- January 28, 2026
Given an implication P \to Q, we have:
- the converse is Q \to P
- the inverse is \neg P \to \neg Q
- the contrapositive is \neg Q \to \neg P (the contrapositive is the inverse of the converse or vice versa)
Theorem Relationship of an implication to its variants [003X]
- January 28, 2026
An implication and its contrapositive always have the same truth value. On the other hand, an implication does not always have the same truth value as its inverse or converse.
Definition Biconditional [003Y]
- January 28, 2026
Let P and Q be propositions. The biconditional P \leftrightarrow Q (pronounced "P if and only if Q") is true when P and Q have the same truth value, and false otherwise.
Remark If and only if [003Z]
- January 28, 2026
We often abbreviate "if and only if" as "iff".
Tautologies and equivalence [0040]
- January 28, 2026
Definition Tautologies and contradictions [0041]
- January 28, 2026
A proposition that is always true, no matter the values of the propositional variables it contains, is a tautology. One that is always false is a contradiction.
Definition Logical equivalence [0042]
- January 28, 2026
Two propositions that always have the same truth value are logically equivalent, written P \equiv Q. Alternatively, P \equiv Q when P \leftrightarrow Q is a tautology.
Example [0043]
- January 28, 2026
Show that P \to Q \equiv \neg P \lor Q.
One way we could do this is by making a truth table: \begin {array}{ccccc} P & Q & P \to Q & \neg P & \neg P \lor Q \\ \hline \mathsf {T} & \mathsf {T} & \mathsf {T} & \mathsf {F} & \mathsf {T} \\ \mathsf {T} & \mathsf {F} & \mathsf {F} & \mathsf {F} & \mathsf {F} \\ \mathsf {F} & \mathsf {T} & \mathsf {T} & \mathsf {T} & \mathsf {T} \\ \mathsf {F} & \mathsf {F} & \mathsf {T} & \mathsf {T} & \mathsf {T} \\ \end {array} Notice that the columns for P \rightarrow Q and \neg P \lor Q are exactly the same, which means that these two propositions always have the same truth value. Hence they are logically equivalent.
We could also use Disco to check this automatically, like so:
Disco> :test forall p: Bool, q:Bool. (p -> q) == (not p \/ q)
- Certainly true: ∀p, q. (p -> q) == (not p \/ q)
No counterexamples exist; all possible values were checked.Example [0044]
- January 28, 2026
Show that P \to Q \equiv \neg Q \to \neg P.
Algebraic laws for propositional logic [0045]
- January 31, 2026
In algebra, you learned a number of equational laws that allow you to manipulate algebraic expressions. For example, the distributive law tells us that x \cdot (y + z) = x \cdot y + x \cdot z. Once you have internalized these laws, you can manipulate symbolic algebraic expressions without having to think hard about what they mean. There are algebraic laws that allow us to work similarly with propositional logic: Formal notation is a superpower!
Mnemonic principles for propositional logic laws [0046]
- January 31, 2026
There are two important organizing/mnemonic principles:
- Most equivalences have an "opposite world" version where we switch \land / \lor and \mathsf {T} / \mathsf {F}.
- We can get some intuition by thinking in terms of multiplication
and addition:
- \mathsf {T} is kind of like 1
- \mathsf {F} is kind of like 0
- \neg is kind of like subtracting from 1
- \land is kind of like \times
- \lor is kind of like +, but with a maximum result of 1
Propositional logic laws [0047]
- January 31, 2026
Remark [0048]
- January 31, 2026
Idempotence, "opposite world distributivity", and the De Morgan laws are the surprising ones that don't have a nice counterpart in terms of multiplication and addition.
Remark [004A]
- January 31, 2026
Note that associativity means we are justified in writing things like p \land q \land r \land s \land t \land \dots with no parentheses, since where we put parentheses doesn't matter. (But if we mix \land and \lor we definitely need parentheses!!)
Sporadic laws [0049]
- January 31, 2026
Then there are three special equivalences which don't have opposite world versions:
- Double negation elimination: \neg (\neg p) \equiv p
- Implication: p \rightarrow q \equiv \neg p \lor q
- Iff: p \leftrightarrow q \equiv (p \rightarrow q) \land (q \rightarrow p)
You should convince yourself of all these, using either a truth table or thinking about a logical argument.
From now on, we don't have to use truth tables anymore, we can prove any equivalence we want using these core equivalences. Here are a couple examples.
Example [004B]
- January 31, 2026
Prove (p \rightarrow q) \land (p \rightarrow r) \equiv p \rightarrow (q \land r).
\begin {align*} &(p \rightarrow q) \land (p \rightarrow r) \\ &\equiv \quad \quad \quad \{\text {Implication, twice}\} \\ & (\neg p \lor q) \land (\neg p \lor r) \\ & \equiv \quad \quad \quad \{\text {Factor out $\neg p$ (distributivity, backwards)}\} \\ & \neg p \lor (q \land r) \\ & \equiv \quad \quad \quad \{\text {Implication}\} \\ & p \rightarrow (q \land r) \end {align*}Example [004D]
- February 2, 2026
Simplify: \neg (p \rightarrow \neg (\neg q \lor (r \land q))).
Predicates and Quantifiers [004E]
- February 3, 2026
By this point we’ve caught up with the ancient Greeks. However, it turns out that propositional logic isn’t expressive enough to talk about everything we want to reason about mathematically. In particular we can’t make general sorts of statements involving words like “all” or “some”. These are called quantifiers since they allow us to "quantify" (in a very limited way) how many things a certain proposition is true for. We've seen that we are able to write tests with forall in Disco; we will now see more formally what this means.
Predicates [004F]
- February 3, 2026
Before we can formally define quantifiers, we must come to terms with parameterized propositions, which will allow us to talk about more than one thing. For example, consider the statement x + 2 = 5. By itself, this is not a proposition because we can’t say whether it is true or false; it depends on x.
Disco> :test x + 2 == 5 Error: there is nothing named x. https://disco-lang.readthedocs.io/en/latest/reference/unbound.html
However, it’s almost a proposition: it’s “waiting for” a value of x to be filled in, at which point it will be a proposition. We can make this explicit by defining P(x) to be the statement “x + 2 = 5”; then P(x) is a predicate, that is, a function that takes x as input and outputs a proposition.
P : N -> Bool P(x) = x + 2 == 5
- P(2) represents the proposition 2 + 2 = 5 (which happens to be false).
- P(3) represents the proposition 3 + 2 = 5 (which happens to be true).
We can also make multi-argument predicates, just like we can have functions of multiple variables. For example, let J(x,y) mean “x is less than the square of y”.
J : N * N -> Bool J(x,y) = x < y^2
Universal quantifier (\forall ) [004G]
- February 3, 2026
The first quantifier we will learn about is the universal quantifier, which lets us encode the idea behind English words like "all", "every", and "each", that is, universal statements that are supposed to be true for every member of some domain.
Definition Universal quantifier [004H]
- February 3, 2026
If P(x) is a predicate and D is some “domain” (i.e. set of values, i.e. type) then \forall x: D .\; P(x) (pronounced “for all x in D, P(x)”) is a proposition which is true iff P(x) is true for every x in the domain D.
Remark [004I]
- February 3, 2026
You also often see the notation \forall x \in D. P(x).
Sometimes mathematicians omit writing the domain D as part of the notation, and simply require that it be mentioned off to the side somehwere what the "domain of discourse" is, but this is silly and dangerous: specifying the domain of discourse is not optional (it can determine whether the proposition is true or false), so we should force ourselves to put it in the notation. Otherwise, the notation is ambiguous.
Example [004J]
- February 3, 2026
- \forall {n}: {\mathbb {N}}.\; P(n): assuming P is defined as above, this is a false proposition: it is not the case that n + 2 = 5 for every natural number n.
- \forall {n}: {\mathbb {N}}.\; n \geq 0: this is a true proposition. Every natural number is greater than or equal to zero.
- \forall {x}: {\Z }.\; x \geq 0: this is false. For example, -2 is less than zero.
- \forall {x}: {\Z }.\; x^2 \geq 0: this is true.
We can explore the same examples with Disco:
Disco> :test forall n:N. P(n)
- Certainly false: ∀n. P(n)
Counterexample:
n = 0
Disco> :test forall n:N. n >= 0
- Possibly true: ∀n. n >= 0
Checked 100 possibilities without finding a counterexample.
Disco> :test forall x:Z. x >= 0
- Certainly false: ∀x. x >= 0
Found counterexample:
x = -1
- Left side: -1
- Right side: 0
Disco> :test forall x:Z. x^2 >= 0
- Possibly true: ∀x. x ^ 2 >= 0
Checked 100 possibilities without finding a counterexample.
Disco> :test forall b:Bool. (b /\ b) == b
- Certainly true: ∀b. (b /\ b) == b
No counterexamples exist.Remark [004K]
- February 3, 2026
We should think of \forall as being like a big “and”. That is, \forall x:D.\; P(x) \equiv P(x_1) \land P(x_2) \land P(x_3) \land \dots where x_1, x_2, x_3, ... are all the elements of the domain D. But writing out such giant lists of propositions would be tedious; the domain could even be infinite, as in the last example! But even though this is not literally true it will help us think about what properties \forall should have.
\forall with an empty domain [004N]
- February 4, 2026
Consider this example: suppose H is the domain of "Hendrix students who are over 11 feet tall". Is the following proposition true or false? \forall {h}: {H}.\; h \text { plays varsity pickleball} The strange thing here, of course, is that the domain H is empty. What should it mean to say that "every" element of a domain has some property, when the domain is in fact empty?
Although we don't even have a varsity pickleball team, the perhaps surprising answer is that this is true, and in fact any \forall with an empty domain should be true. On one level, you can just take my word for it: this is the standard, commonly accepted definition within mathematics. But there are also good reasons for defining it this way: things work out more elegantly and consistently this way. Here are a couple ways to think about it:
- In order for the proposition \forall {x}: {D}.\; P(x) to be false, there should be a counterexample, that is, a specific value of x in the domain D for which P(x) is false. If the domain D is empty, then clearly no counterexamples can exist.
- Recall that we can think of \forall like a big \land : \forall {x}: {D}.\; P(x) \equiv P(x_1) \land P(x_2) \land P(x_3) \land \dots So what do we get when we take the \land of zero things? The answer is that we should get the identity element for \land —which is \mathsf {T}; just like the sum of zero things is zero (the identity element for addition), the product of zero things is one (the identity element for multiplication), and so on.
This is our first example of the theme Don't be afraid of zero! For example, we could require any \forall to have a non-empty domain, and say that it is undefined when the domain has size zero. But this is unnecessary: there is a perfectly elegant way to define it.
Existential quantifier (\exists ) [004O]
- February 4, 2026
Next, we consider the existential quantifier, which lets us encode existential statements using words like "some" or "exists". An existential statement is more specific than a universal statement: rather than saying that a proposition is true for every member of some domain, it just says that it is true for some members.
Definition Existential quantifier [004L]
- February 3, 2026
If P(x) is a predicate and D any domain, then \exists x:D.\; P(x) (“there exists an x in D such that P(x)”) is a proposition which is true iff there is at least one x in D such that P(x) holds.
Example [004M]
- February 3, 2026
- \exists {n}: {\mathbb {N}}.\; P(n): This is a true proposition, since, for example, P(2) is true.
- \exists {x}: {\Z }.\; x^2 = 16: This is a true proposition. Both 4 and -4 are integers which satisfy x^2 = 16.
- \exists {x}: {\Z }.\; x^2 = 17: This is a false proposition. There is no integer whose square is 17.
- \forall {x}: {\mathbb {N}}.\; \exists {y}: {\mathbb {N}}.\; J(x,y): This is true: for every natural number x, there is some other natural number y such that x < y^2.
- \forall {y}: {\mathbb {N}}.\; \exists {x}: {\mathbb {N}}.\; J(x,y): This is false, since when y = 0, there is no natural number x such that J(x,y), that is, x < 0^2.
Disco> :test exists x:N. P(x)
- Certainly true: ∃x. P(x)
Found example:
x = 3
Disco> :test exists x:Z. x^2 == 17
- Possibly false: ∃x. x ^ 2 == 17
No example was found; checked 100 possibilities.
Disco> :test exists x:Z. x^2 == 16
- Certainly true: ∃x. x ^ 2 == 16
Found example:
x = 4
- Left side: 16
- Right side: 16
Disco> :test forall x:N. exists y:N. J(x,y)
- Possibly true: ∀x. ∃y. J(x, y)
Checked 100 possibilities without finding a counterexample.
Disco> :test forall y:N. exists x:N. J(x,y)
- Possibly false: ∀y. ∃x. J(x, y)
No example was found; checked 100 possibilities.
Counterexample:
y = 0Remark [004Q]
- February 5, 2026
Dually to \forall , we can think of \exists as being like a big “or”. That is, \exists {x}: {D}.\; P(x) \equiv P(x_1) \lor P(x_2) \lor P(x_3) \lor \dots where x_1, x_2, x_3, ... are all the elements of the domain D.
\exists with an empty domain [004P]
- February 4, 2026
Is the following proposition true or false? \exists {h}: {H}.\; h \text { plays on the varsity pickleball team} The proposition is clearly false. Even something like \exists {h}: {H}.\; h \text { has taken MATH 240} is false: there are certainly Hendrix students who have taken MATH 240, but none in the domain H! And in general, \exists {x}: {D}.\; P(x) is always false when the domain D is empty.
This is more intuitive than \forall with an empty domain, but we can justify it in similar ways. For example, if \exists corresponds to a big \lor , an \exists with an empty domain corresponds to the question: what do we get when we take the \lor of zero things? The identity element for \lor , of course, namely \mathsf {F}.
Example propositions with nested quantifiers [0050]
- February 5, 2026
Decide whether each proposition is true or false.
Example [0052]
- February 5, 2026
\forall {n}: {\mathbb {N}}.\; \exists {z}: {\Z }.\; n < z
This is true. For any natural number n we pick, we can always find an integer which is larger, for example, n+1. Notice that for each n, we are allowed to choose a different z.
Example [0053]
- February 5, 2026
\forall {z}: {\Z }.\; \exists {n}: {\mathbb {N}}.\; z < n
This is also true. We cannot always pick z+1 since it might not be a natural number. But, for example, we could pick 0 when z is negative and z+1 when z is nonnegative.
Example [0054]
- February 5, 2026
\forall {z}: {\Z }.\; \exists {n}: {\mathbb {N}}.\; n < z
This is false. For example, when z = -1, there is no natural number which is less than z.
Example [0055]
- February 5, 2026
\exists {n}: {\mathbb {N}}.\; \forall {z}: {\Z }.\; n < z
This is false. There is no natural number which is less than all integers.
Example [0056]
- February 5, 2026
\exists {z}: {\Z }.\; \forall {n}: {\mathbb {N}}.\; z < n
This is true: for example, we could pick z = -1 again, which is less than all natural numbers.
Translating English sentences into propositional logic with quantifiers [004R]
- February 5, 2026
Let's look at some examples of expressing natural language statements in formal propositional logic.
Example [004S]
- February 5, 2026
“Every natural number is less than or equal to its own square.” \forall n:\mathbb {N}. n \leq n^2 (This is a true proposition.)
Example [004T]
- February 5, 2026
“The square of any integer is nonnegative.” \forall x:\Z . x^2 \geq 0 (This is also true.)
Example [004U]
- February 5, 2026
“1369 is a perfect square.” \exists n:\mathbb {N}. n^2 = 1369 This also happens to be true. Note that this is much nicer than trying to write something like \mathrm {IsInteger}(\sqrt {n}). \sqrt {-} is complicated, and we don’t know how to define \mathrm {IsInteger}.
Example [004V]
- February 5, 2026
“n is even.” \mathrm {Even}(n) \equiv (\exists {k}: {\Z }.\; 2k = n).
Example [004W]
- February 5, 2026
“n is odd.” \mathrm {Odd}(n) = (\exists {k}: {\Z }.\; 2k + 1 = n). Or we could define it as \neg \mathrm {Even}(n). (It is actually slightly nontrivial to prove formally that \mathrm {Odd}(n) \equiv \neg \mathrm {Even}(n)—we won’t be able to prove it until we go over the Division Algorithm later in the semester!)
Example [004X]
- February 5, 2026
“If n is even, then n + 2 is even.” \forall {n}: {\Z }.\; \mathrm {Even}(n) \to \mathrm {Even}(n+2) Note that bare variables in mathematical statements like this tend to hide an implicit \forall !
De Morgan laws for quantifiers [004Y]
- February 5, 2026
The quantifiers \forall and \exists have de Morgan-like equivalences: \begin {align*} \neg (\forall x:D.\; P(x)) &\equiv \exists x:D.\; \neg P(x) \\ \neg (\exists x:D.\; P(x)) &\equiv \forall x:D.\; \neg P(x) \end {align*} Intuitively, if P(x) is not true for all x, then it must be false for at least one; likewise, if it is not the case that there is some x for which P(x) is true, then P(x) is false for all x.
Alternatively, if we remember that \forall is like a big AND and \exists is like a big OR, then we can see these as actual instances of the de Morgan laws for \land and \lor .
Example [004Z]
- February 5, 2026
What is the negation of \forall {a}: {\mathbb {N}}.\; \exists {b}: {\mathbb {N}}.\; (a = 0) \lor (a + b = 0)?
\begin {align*} & \neg ( \forall {a}: {\mathbb {N}}.\; \exists {b}: {\mathbb {N}}.\; (a = 0) \lor (a + b = 0)) \\ & \equiv \quad \quad \quad \{ \text {de Morgan} \} \\ & \exists {a}: {\mathbb {N}}.\; \neg (\exists {b}: {\mathbb {N}}.\; (a = 0) \lor (a + b = 0)) \\ & \equiv \quad \quad \quad \{ \text {de Morgan} \} \\ & \exists {a}: {\mathbb {N}}.\; \forall {b}: {\mathbb {N}}.\; \neg ((a = 0) \lor (a + b = 0)) \\ & \equiv \quad \quad \quad \{ \text {de Morgan} \} \\ & \exists {a}: {\mathbb {N}}.\; \forall {b}: {\mathbb {N}}.\; (a \neq 0) \land (a + b \neq 0) \end {align*}Quantifier restriction [0051]
- February 5, 2026
We naturally make "for all" and "exists" statements in English about adjectives applied to sets, like "all even numbers" or "there exists a prime, happy number greater than 17". The most natural way to encode such statements is by making up a domain to represent the adjectives, like "\forall {n}: {\mathrm {Even}}.\; \dots " where \mathrm {Even} represents the set of even numbers, or "\exists {n}: {H}.\;" where H is the set of prime, happy numbers greater than 17. However, when we hide all the conditions inside the definition of a domain, we cannot work with those conditions using the tools of propositional logic we have developed. Therefore, we are going to learn how to translate statements involving complicated domains into logically equivalent statements with simpler, standard domains.
Expanding restricted forall [00HR]
- July 16, 2026
How would we encode the (false) proposition “every even integer is equal to 2”? The most straightforward way is to write \forall {x}: {\mathrm {Even}}.\; x = 2. However, there is a logically equivalent way that uses a more primitive domain: \forall {x}: {\Z }.\; \mathrm {Even}(x) \to (x = 2). Why does this work? In the case of \forall {x}: {\mathrm {Even}}.\; x = 2, we are directly making a statement about every element of the set of even numbers. In the case of \forall {x}: {\Z }.\; \mathrm {Even}(x) \to (x = 2), it looks like we are making a broader statement about all integers—but the implication \mathrm {Even}(x) \to \dots restricts it again to only saying something interesting about even numbers. For odd numbers, we will end up with \mathsf {F} \to \dots which is equivalent to \mathsf {T}.
More generally, suppose D is some domain and S is a subset of D, and let S(x) be a predicate meaning “x is a member of S”. Then \forall {x}: {S}.\; P(x) \equiv \forall {x}: {D}.\; S(x) \to P(x). In other words, we can translate \forall {x}: {S}.\; \dots into \forall {x}: {D}.\; S(x) \to \dots .
Expanding restricted exists [00HS]
- July 16, 2026
We can do something similar with "exists" statements. For example, how would we encode the proposition "there exists an even integer which is equal to 2"? Again, one way would be \exists {x}: {\mathrm {Even}}.\; x = 2, but I claim this is equivalent to \exists {x}: {\Z }.\;{\mathrm {Even}(x) \land (x = 2)}. In the original proposition, we are claiming that an element of the smaller set \mathrm {Even} exists with a certain property. In the expanded version, we are claiming that an element of \Z exists with a certain property—but in order to re-focus on just the even integers, the property we claim is that the integer is a member of \mathrm {Even} and is equal to 2.
In general, suppose D is some domain and S is a subset of D, and let S(x) be a predicate meaning “x is a member of S”. Then \exists {x}: {S}.\; P(x) \equiv \exists {x}: {D}.\; S(x) \land P(x). In other words, we can translate \exists {x}: {S}.\; \dots into \exists {x}: {D}.\; S(x) \land \dots .
Remark [00HT]
- July 16, 2026
Example [00HU]
- July 16, 2026
As a final example, let’s encode the statement “Every even natural number can be written as the sum of two primes” in formal propositional logic. Assume we have a predicate \mathrm {Prime}(n) meaning “n is prime” (we will see how to define this later). First, we can write it directly as \forall {n}: {\mathrm {Even}}.\; \exists {p}: {\mathrm {Prime}}.\; \exists {q}: {\mathrm {Prime}}.\; n = p + q. We can now progress from left to right, expanding each quantifier into one that uses a more primitive domain:
Incidentally, this proposition is definitely false as written, since 0 and 2 cannot be written as a sum of primes. However, if we add a restriction that n > 2, this is the famous Goldbach conjecture, which we think is probably true, but no one has been able to prove!