Chapter 7: Applications of First-order Logic
Examples and Counter-examples #TODO
Notice that it is hard to demonstrate the truth of a “for all” proposition: You have to consider every possible choice from the domain, which can mean evaluating many propositions.
For example, if is a model with universe , then to directly confirm the truth of , you have to confirm for three different assignments of x.
However, that disconfirming can (in principle) take much less labor. To show that we only need to find one domain element , for which .
Consider this in the context of a concrete example. Take the sentence “all swans are white”. (This example comes from a historical example which is often used in discussions about the philosophy of science.)
To confirm this sentence, one would have to inspect every swan in the universe. Europeans in the 16th century believed that this sentence was true—that is to say, they believed that all swans are white—even though they could not observe every swan. But because every swan that they could observe was white, they made the reasonable (though false) assumption that all swans are white.
But when Europeans discovered Australia, they found a first counter-example: They observed a black swan!
(This has been generalized to the concept of a “black swan event”.)
For our current purposes, the take-away lesson of this story is more limited: Proving that a for-all proposition is true requires inspecting every element of the domain. But proving that it is false requires just one well-chosen element of the domain.
Exercise
Consider a model with domain .
Suppose that
Show that by exhibiting a single element of the domain, , for which .
Do likewise for .
Definition
Suppose that be any first-order proposition.
Vacuous Quantification
Suppose that P and Q are properties.
Suppose that we have a model in which is false for every element of the domain. That is to say, if U is the domain and , then .
Let’s now evaluate
Let be any element of the domain. Then
Notice this last equality! Even without knowing the value of , we can still judge that .
That is because of how the boolean conditional is defined. Whenever the antecedent is false, returns true. So whether or , either way the result will be .
We have just shown that for every , which shows that
This result explains the following definition.
Definition
Let P be a predicate which is false for every element of the domain.
It follows that, for any predicate Q,
This phenomenon is called vacuous quantification.
Exercise
Show how the fact that “the empty set is a subset of every set” follows by vacuous quantification.
Exercise
For any integer x, show that x is positive and negative, if and only if it is both even and odd.
Tautology, Contradiction, and Contingency
Although we have a new syntax and a new semantics, the definition of tautology, contradiction, and contingency are exactly as before.
Definition
Let be a first-order proposition. We say that is a tautology if
for every choice of model .
The proposition is a contradiction if
for every choice of .
If is neither a tautology nor a contradiction, then it is a contingency.
Let’s see examples. Here’s a tautology:
How can we demonstrate that it is a tautology? Let be a model and u any element of the domain. We need to evaluate
If then we compute
On the other hand if then
This demonstrates that no matter what we choose for .
Exercise
Show that is a contradiction.
Infer that is a contradiction.
Show that is a contingency.
Show that is a tautology.
Properties of Binary Relations #TODO
There are several properties that a binary relation can have, which play large roles in mathematics.
- “Reflexive” means “everything is related to itself”.
- “Symmetric” means “if the relation goes one way then it also goes the other”.
- “Transitive” means “if a reaches b and if b reaches c, then a reaches c”.
- “Anti-symmetric” means “the relation can’t go both ways”.
- “Asymmetric” means “the relation can’t go both ways, and no self-loops”.
- “Complete” means “any two nodes have an edge in some direction”.
Definition
Let R be a relation, and a model.
R is called reflexive if

Reflexive, not symmetric, not transitive.

Not reflexive because , although other counter-examples could be given too.
The relation on real numbers is reflexive. For example, .
The relation on sets is reflexive. For example .
The relation “x divides y” on integers is reflexive. For example .
But the strict relations and are not reflexive. Also “x is one more than y” is not reflexive.
Definition continued
R is called symmetric if

Symmetric, not reflexive, not transitive.

Not symmetric because .
For example, “x and y have the same absolute value” is symmetric. That is to say, the relation R is defined by if and only if
The relation “” is symmetric.
But and and are all not symmetric.
Definition continued
R is called transitive if

Transitive, not reflexive, not symmetric.

Not transitive because . One other counter-example is possible.
The relations are all transitive.
The relation “the numbers x and y have the same absolute value” is transitive.
But the relation “the number x is one more than y” is not transitive. The relation “The point x is 1 unit away from y” is not transitive.
Definition continued
R is called an equivalence relation if it is reflexive, symmetric, and transitive.
The relation “for integers, ” is an equivalence relation.
The relation “for finite sets x and y, they contain the same number of elements” is an equivalence relation.
The relations are not equivalence relations. The relation “x is one more than y” is not an equivalence relation.
Definition continued
R is called antisymmetric if
R is called asymmetric if
R is called irreflexive if
Anti-symmetric.
Not anti-symmetric because
R is called connected if
Connected, not reflexive, symmetric, transitive.
Not connected because
R is called a partial order if it is reflexive, antisymmetric, and transitive.
R is called a strict partial order if it is irreflexive, asymmetric, and transitive.
R is called a total order if it is reflexive, antisymmetric, transitive, and connected.
Exercise
Find an example of a relation that is antisymmetric but not asymmetric.
Exercise
Find examples of asymmetric, irreflexive, connected relations, and then also find counter-examples.
Find examples and counter-examples of partial orders, strict partial orders, and total orders.
Consider the random example of a relation R and model with domain . If we have
then this has diagram

Exercise
Show that the above relation is
- reflexive
- not irreflexive
- not symmetric
- antisymmetric
- not asymmetric
- transitive
- not an equivalence relation
- a partial order
- not complete
Quantifier Equivalences
Notice that if you express “Not every person is free” this is equivalent to expressing “Some person is not free”.
Likewise “It is not true that someone is free” is equivalent to “Everyone is not free”.
If two propositions, are equivalent, we will write . From the observations above, we should expect to find that
and
for every predicate P.
But first we must define equivalence for first-order propositions. Yet again, however, the definition is just as it was for propositional formulas.
Definition
Let and be first-order propositions.
Then and are said to be equivalent if is a tautology. When they are equivalent we write
Exercise
Let P be any property.
- Prove that
- Prove that
At Least One, At Most One
Quantifiers can actually do just a little bit of counting.
This isn’t too surprising. After all, if is a false statement, then the number of things with property P is zero. If is true, then the number of things with property P is at least one (although exactly what its number is could be anything, from 1 to infinity).
Can we express, using quantifiers, that “the number of things with property P is exactly 1”?
Well, we know that we can express that the number is “at least one”. If we could also express that the number is “at most one”, it would then follow that the number is “exactly 1”.
So we need to find a way to express “the number of things with property P is at most one”. Here’s how:
This may seem strange or confusing, so let’s talk about what’s going on here.
This proposition says “If x and y are any two objects with property P, then x is y.”
You might, with effort, develop an intuition for why this means that there is at most one object with property P. But let’s analyze it formally, as that might give you something more concrete to understand.
Let’s examine this in the context of a small example. Consider the domain {1, 2, 3} and the proposition “There is at most one even number.” The proposition is true because there is precisely one number which is even.
But the proposition “There is at most one odd number” is false.
Let represent “x is even”, and represent “x is odd”.
To express that “there is at most one even number,” we write
so our formal analysis should evaluate this to T.
To express that “there is at most one odd number,” we write
which should evaluate to F.
Below, we will look at every possible assignment of domain elements to the variables, and judge whether .
To do so, we need to evaluate the proposition under the assignments
That’s 9 assignments in total.
-
Under this assignment, we compute the evaluation.
-
.
At this point we can kind of tell that this proposition is always going to be true whenever we pick a not-even number. It’ll just keep making the antecedent false, and therefore the conditional will be true.
Let’s skip ahead and try the one assignment where the antecedent will be true, .
Yet again the proposition is true under this assignment!
Exercise
Above we tested three of the nine possible assignments:
Pick one more possible assignment and evaluate using that assignment.
Explain why .
The proposition should be false.
To show that it is false, we need to find a single assignment to x and y for which the proposition is false. I bet that if we use the assignment then the proposition will be false. Let’s test it out!
Yep! I was able to find some assignment to x and y such that the proposition was false. Therefore the universal claim is false!
Exercise
Suppose that you have any property, P.
- Explain how to write a formula which expresses that “there is at least one P”.
- Explain how to write a formula which expresses that “there is at most one P.
- Write a formula which expresses that “there is exactly one P”.
- Write a formula which expresses that “there is at least one thing in the domain of discourses”.
- Write a formula which expresses that “there is at most one thing in the domain of discourse”.
At Least n, At Most n
So far we’re able to count using quantifiers: 0 and 1.
How do you express that there are exactly 2 elements of the domain with a property P? Just as we did for 1: We will find a way to express that there are at least two elements with property P. Then we will express that there are at most two elements.
To express that there are at least two elements, you might guess that it’s . However, this is not correct!
This proposition is true, even when there is just one element with property P!
This is because, technically speaking, for both existential quantifiers we can select the same element. If we select u for both of them, where , then the proposition is true.
So apparently it is not enough to merely state that “there are two things with property P”, so to speak. You must specify “there are two distinct things with property P”.
This is how one says “there are at least two objects with property P”.
Now how about “at most two”?
This is a generalization of the “at most one” logic. This time we say “if you pick any three things, then some two of them must be equal”. Effectively this means that you cannot have three distinct things, so there are at most two.
Exercise
How do you state that “there are exactly two things with property P”?
Exercise
How do you state that “there are at least three things” and “there are at most three things”? Hint: For “at least three things” you need three inequalities. For “at most three things” you need 3+2+1 = 6 equalities.