# Mathematical Proof and the Principles of Mathematics/Logic/The universal quantifier

We've introduced the idea of quantifiers in general, and the universal quantifier in particular. Before going on to the second quantifier we'll give the rules of inference for the first one.

## Proving a universal

To prove a statement of the form
    For all $x$, $P(x)$
first ask the reader to pick an arbitrary constant $a$, then prove the statement $P(a)$. The idea is that, since the constant $a$ was chosen at random, with no assumptions other than that it's an object in the universe of discourse, the proof of $P(a)$ is valid hold no matter the choice of $a$. Therefore $P(x)$ is true for all $x.$
Note that for a proof if implication, the reader is asked to make an assumption, then you as the prover must derive a conclusion. Similarly, in the proof of a universal, the reader is asked to do something, namely pick a constant, then you as the prover must derive a conclusion. So we'll state the rule of inference in a way similar to the way the first rule inference for implication is stated.
    If by choosing $a$ as an arbitrary constant one can derive $P(a)$, then deduce
       For all $x$, $P(x)$
With this in mind, we'll make the structure of the proof of a universal will be
| Line | Statement | Justification |
| 1 | Choose $a$ | Arbitrary constant |
| (something) |||
| n | $P(a)$ | ? |
| n+1 | For all $x$, $P(x)$ | From 1 and n |
The indentation is used to show that the letter a introduced on line 1 has no meaning outside the range 1 through n.
(It should be noted here that most books on logic follow a different convention. The rule is often stated as
    From $P(x)$ deduce
       For all $x$, $P(x)$.
where $x$ is an unbound variable in $P(x)$ and subject to restrictions on where $x$ appears elsewhere in the proof. This may be a valid form of reasoning, but it's not the way a proof is normally written in a mathematical context. For one thing, the expression $P(x)$, since it has an unbound variable, is really a predicate, not a statement. But proofs in mathematics, aside from the occasional imperative such as "Assume ... ," contain only statements. The rule also requires the distinction between bound and unbound variables. But we're avoiding that distinction and focusing on the difference between statements and predicates instead.)

## Example proof #1

We use the rule of inference above to prove:
    Prop. 1: For all $x$, ($P(x)$ implies $P(x)$).
First, lay out the structure of the proof as above.
| Line | Statement | Justification |
| 1 | Choose $a$ | Arbitrary constant |
| (something) |||
| n | $P(a)$ implies $P(a)$ | ? |
| n+1 | For all $x$, ($P(x)$ implies $P(x)$) | From 1 and n |
The task now is to prove $P(a)$ implies $P(a)$, but $P(a)$ is a statement so we can apply the previously proven proposition
    $P$ implies $P$.
So the proof can be completed as
| Line | Statement | Justification |
| 1 | Choose $a$ | Arbitrary constant |
| 2 | $P(a)$ implies $P(a)$ | Prop. 1 on Direct proofs for implication. |
| 3 | For all $x$, ($P(x)$ implies $P(x)$) | From 1 and 2 |
In prose form this becomes:
    Prop. 1: For all $x$, ($P(x)$ implies $P(x)$).
    Proof: Let $a$ be arbitrary. Then $P(a)$ implies $P(a)$ by Prop. 1 on Direct proofs for implication. Therefore $P(x)$ implies $P(x)$ for all $x$.

## Using a universal

The rule for using a universal quantifier is relatively simple.
    If $a$ is a constant then from
       For all $x$, $P(x)$
    deduce
       $P(a)$.
Basically this says that if $P(x)$ holds for all $x$ then it holds for a particular value, $a$, of $x$. Note that this is only valid when $a$ is defined in the current scope.

## Example proof #2

We now have all the rules of inference needed to proof statements involving universal quantifiers, so let's put them to work with another example. The classical syllogism
    All people are mortal.
    Socrates is a person.
    Therefore Socrates is mortal.
may be restated in our notation as
    For all $x$, ($P(x)$ implies $M(x)$).
    $P(s)$
    Therefore $M(s)$
where $P(x)$ is the predicate $x$ is a person, $M(x)$ is the predicate $x$, and $s$ is the constant Socrates. This is supposed to be a syllogism, in other words the conclusion is supposed to be valid for any $P$, $M$ and $s$, as long as the first two statements are valid. This amounts to
    Prop. 2: For all $x$, ($P(x)$ implies $M(x)$) and $P(s)$ implies $M(s)$
This is an implication, so start with the standard outline for a direct proof.
| Line | Statement | Justification |
| 1 | For all $x$, ($P(x)$ implies $M(x)$) and $P(s)$ | Hypothesis |
| (something) |||
| n | $M(s)$ | ? |
| n+1 | For all $x$, ($P(x)$ implies $M(x)$) and $P(s)$ implies $M(s)$ | From 1 and n |
It's probably a good idea to break up the 'and' into separate statements.
| Line | Statement | Justification |
| 1 | For all $x$, ($P(x)$ implies $M(x)$) and $P(s)$ | Hypothesis |
| 2 | For all $x$, ($P(x)$ implies $M(x)$) | From 1 |
| 3 | $P(s)$ | From 1 |
| (something) |||
| n | $M(s)$ | ? |
| n+1 | For all $x$, ($P(x)$ implies $M(x)$) and $P(s)$ implies $M(s)$ | From 1 and n |
We have $P(s)$ and need to derive $M(s)$, so something like $P(s)$ implies $M(s)$ will do the trick. But we can get that by applying s to the universal quantifier. Filling in the details gives:
| Line | Statement | Justification |
| 1 | For all $x$, ($P(x)$ implies $M(x)$) and $P(s)$ | Hypothesis |
| 2 | For all $x$, ($P(x)$ implies $M(x)$) | From 1 |
| 3 | $P(s)$ | From 1 |
| 4 | $P(s)$ implies $M(s)$ | From 2 |
| 5 | $M(s)$ | From 2 and 4 |
| 6 | For all $x$, ($P(x)$ implies $M(x)$) and $P(s)$ implies $M(s)$ | From 1 and 5 |

## Translating categorical propositions

Historically, logic dealt with categorical propositions; these are statements that relate two predicates in specific ways. There are four types:
    All P are Q.
    No P are Q.
    Some P are Q.
    Some P are not Q.
The first type, which we've already seen in the previous section, becomes
    For all $x$, ($P(x)$ implies $Q(x)$).
in our notation. The second type may be rephrased as
    All P are not Q.
So in our notation it becomes
    For all $x$, ($P(x)$ implies not $Q(x)$).
Note that we have from propositional logic
    $P(a)$ implies not $Q(a)$ iff $Q(a)$ implies not $P(a)$.
We leave it as an exercise to prove
    No P are Q iff No Q are P.
Now think about what it would mean for the first type
    All P are Q.
to be False. There would need to be some object which is a P but not a Q. In other words, the statement of the fourth type
    Some P are not Q.
would have to be True. On the other hand, if
    Some P are not Q.
is False, then there are no P which are not Q, or put another way,
    All P are Q.
So the fourth statement
    Some P are not Q.
can be translated as
    Not (all P are Q).
or
    Not (for all $x$, ($P(x)$ implies $Q(x)$)).
Similarly, the third statement
    Some P are Q.
Can be translated as
    Not (no P are Q).
or
    Not (for all $x$, ($P(x)$ implies not $Q(x)$)).
We'll introduce another quantifier in the next page which will make these expressions more tractable. In the mean time, we leave it as an exercise to translate two of the categorical syllogisms
    All P are Q.
    All Q are R.
    Therefore all P are R.
and
    All P are Q.
    No R are Q.
    Therefore No P are R.
into our notation and prove them using the rules of inference we've given up to now.
You may have noticed that results our attempts to translate categorical propositions to our notation have been both more verbose and less like natural language than the originals. So you might well wonder what is the advantage of our notation. One advantage is that our notation is expressive enough to include all mathematical statements while categorical propositions alone are too restrictive. Secondly, the categorical syllogisms do not cover all the valid forms of reasoning which are needed to prove theorems. Consider
    All triangles and rectangles are rectilinear figures.
    All squares are rectangles with all sides equal.
    Therefore all squares are rectilinear figures.
This seems to be a valid syllogism, but since the premises both involve three predicates instead of two, it's not one of the categorical syllogisms. In addition, categorical propositions deal only with predicates and not relations, and it would be impossible to do much mathematics with predicates only.