# Mathematical Proof/Logic

As discussed in the introduction, logical statements are different from common English. We will discuss concepts like "or," "and," "if," "only if." (Here I would like to point out that in most mathematical papers it is acceptable to use the term "we" when referring to oneself. This is considered polite by not commanding the audience to do something nor excluding them from the discussion.)

## Truth and statement

We encounter statements frequently in mathematics.
Definition. (Statement) A statement is a declarative sentence that is either true or false (but not both), and its truth value is true (denoted by $T$) or false (denoted by $F$).
Example. Consider the following sentences:
* The number 9 is even.
* $1<2$.
* Mathematics is easy.
* How to solve $x^{2}+2x-3=0$?
* Please read this book.
* The sentence 1 and 2 above are statements (even if the sentence 1 is false).
* The sentences 3, 4 and 5 are not statements, since they are not declarative sentences, and we cannot say whether each of them is true or false.
   * In particular, the sentence 3 is an opinion, the sentence 4 is a question, and the sentence 5 is a command. Thus, none of them are declarative.
Exercise.
For the sentences that are not statements, there is a special type of sentences among them, namely open statement.
Definition. (Open statement) An open statement is a sentence whose truth value depends on the input of certain variable.
Remark.
* Since the truth value may change upon input change, we cannot determine the truth value of an open statement (we cannot say it is (always) true or it is (always) false).
Example. Consider the sentence $P(x):x=2$ ($:$ is read "such that").
* This sentence is true when $x=2$, and false otherwise.
* This sentence is an open statement.
To express all possible combinations of truth values of some statements, we usually list them in a table, called a truth table.
Example. (Truth table for two statements) For two statements $P$ and $Q$, the truth table for them is as follows: ${\begin{array}{|c|c|}P&Q\\\hline T&T\\T&F\\F&T\\F&F\\\end{array}}$ and there are four possible combinations of truth values of $P$ and $Q$.
Example. (Truth table for three statements) For three statements $P$, $Q$ and $R$, the truth table for them is as follows: ${\begin{array}{|c|c|c|}P&Q&R\\\hline T&T&T\\T&T&F\\T&F&T\\T&F&F\\F&T&T\\F&T&F\\F&F&T\\F&F&F\\\end{array}}$ and there are eight possible combinations of truth values of $P$, $Q$ and $R$.
Remark.
* In general, there are $\underbrace {2\times \dotsb \times 2} _{n{\text{ times}}}=2^{n}$ possible combinations of truth values of $n$ statements, since each statement has two possible truth values.
* The truth table for three statement may seem to be complicated, and you may miss (or duplicate) some combinations in the truth table if you are not careful enough. Because of this, here is an advice for constructing such truth table:
   * for $P$, write four $T$'s and then four $F$'s, from top to bottom;
   * for $Q$, write in this pattern from top to bottom: $TTFFTTFF$;
   * for $R$, write in this pattern from top to bottom: $TFTFTFTF$.

## Conjunction, disjunction and negation

In this section, we will discuss some ways (conjunction and disjunction) to combine two statements into one statement, which is analogous to Mathematical Proof/Introduction to Set Theory, in which two sets are combined into one set. Also, we will discuss a way (negation) to change a statement to another one.

### Conjunctions

Definition. (Conjunction) The conjunction of statements $P$ and $Q$, denoted by $P\land Q$, is a statement that is true when both $P$ and $Q$ are true, and false otherwise.
Remark.
* $P\land Q$ is read "P and Q", and the conjunction of the statements $P$ and $Q$ can also be expressed by "$P$ and $Q$" directly.
Example. (Truth table for $P\land Q$) The truth table for $P\land Q$ (in terms of possible combinations of truth values of $P$ and $Q$) is ${\begin{array}{|c|c|c|}P&Q&P\land Q\\\hline T&T&T\\T&F&F\\F&T&F\\F&F&F\\\end{array}}$
* We can see that $P\land Q$ is true only when both $P$ and $Q$ are true, and false otherwise.

### Disjunctions

Definition. (Disjunction) The disjunction of statements $P$ and $Q$, denoted by $P\lor Q$, is a statement that is false when both $P$ and $Q$ are false, and true otherwise.
Remark.
* That is, $P\lor Q$ is true when at least one of $P$ and $Q$ is true, and false otherwise.
* $P\lor Q$ is read "P or Q", and the disjunction of the statements $P$ and $Q$ can also be expressed by "$P$ or $Q$" directly.
* The meaning of "or" in mathematics may be different from the meaning of "or" as an English word. For "or" in mathematics, it is used inclusively, i.e. $P$ or $Q$ means $P$ or $Q$ or both. However, as an English word, "or" may be used exclusively, i.e. $P$ or $Q$ means $P$ or $Q$ but not both. For example, when someone say "I will go to library or go to park this afternoon.", we interpret this as "I will either go to library, or go to park, but not both.".
Example. (Truth table for $P\lor Q$) The truth table for $P\lor Q$ is ${\begin{array}{|c|c|c|}P&Q&P\lor Q\\\hline T&T&T\\T&F&T\\F&T&T\\F&F&F\\\end{array}}$
* We can see that $P\lor Q$ is false only when both $P$ and $Q$ are false, and true otherwise.

### Negations

Definition. The negation of a statement $P$, denoted by $\sim P$, is a statement with truth value that is opposite to that of $P$.
Remark.
* $~P$ is read "not P", and the negation of the statement $P$ can also be expressed by "not $P$", or "It is not the case that $P$" directly.
* Another common notation for the negation of a statement $P$ is $\lnot P$.
* We refer to process of expressing a negation of a statement as negating a statement.
Example. (Truth table for $\sim P$) The truth table for $\sim P$ is ${\begin{array}{|c|c|}P&\sim P\\\hline T&F\\F&T\\\end{array}}$
* We can see that $\sim P$ always has the opposite truth value to that of $P$.
To negate a statement, we usually add the word "not" into a statement, or delete it from a statement. For example, the negation of the statement "The number 4 is even." is "The number 4 is not even.", and the negation of the statement "The number 1 is not prime." is "The number 1 is not prime."
Exercise. Complete the following truth table: ${\begin{array}{|c|c|c|c|c|c|}P&Q&\sim P&\sim Q&P\lor Q&(\sim P)\lor (\sim Q)&\sim (P\lor Q)\\\hline T&T\\T&F\\F&T\\F&F\\\end{array}}$
${\begin{array}{|c|c|c|c|c|c|}P&Q&\sim P&\sim Q&P\lor Q&(\sim P)\lor (\sim Q)&\sim (P\lor Q)\\\hline T&T&{\color {red}F}&{\color {red}F}&{\color {red}T}&{\color {red}F}&{\color {red}F}\\T&F&{\color {red}F}&{\color {red}T}&{\color {red}T}&{\color {red}T}&{\color {red}F}\\F&T&{\color {red}T}&{\color {red}F}&{\color {red}T}&{\color {red}T}&{\color {red}F}\\F&F&{\color {red}T}&{\color {red}T}&{\color {red}F}&{\color {red}T}&{\color {red}T}\\\end{array}}$
* We can observe that in some combinations of truth values of $P$ and $Q$, the truth values of $(\sim P)\lor (\sim Q)$ and $\sim (P\lor Q)$ are different.
Exercise. Let $P$ be the statement "The number 3 is even.", and $Q$ be the statement "The number ${\sqrt {2}}$ is irrational."
Write down (in words) the negation of each of $P$ and $Q$ without using the word "not".
* The negation of $P$ can be "The number 3 is odd.".
* The negation of $Q$ can be "The number ${\sqrt {2}}$ is rational."
Exercise. Let $P$ be the statement $3>5.$ and $Q$ be the statement $3<2.$.
(a) Is the statement $\sim (P\land Q)$ true or false?
(b) Is the statement $\sim (P\lor Q)$ true or false?
(c) Is the statement $(\sim P)\land (\sim Q)$ true or false?
(d) Is the statement $(\sim P)\lor (\sim Q)$ true or false?
* First, we can see that both $P$ and $Q$ are false.
(a) Since $P\land Q$ is false, the answer is true.
(b) Since $P\lor Q$ is false, the answer is true.
(c),(d) Since $\sim P$ and $\sim Q$ are both true, the answer for (c) and (d) are both true.

## Conditionals

Apart from the above ways to form a new statement, we also have another very common way, namely the "if-then combination". The statement formed using the "if-then combination" is called a conditional.
Definition. (Conditionals) The conditional of two statements $P$ and $Q$ is the statement "If $P$ then $Q$.", denoted by $P\to Q$. $P$ and $Q$ are called the hypothesis and consequent of the conditional respectively. The conditional $P\to Q$ is false when $P$ is true and $Q$ is false, and true otherwise.
Example. (Truth table for $P\to Q$) The truth table for $P\to Q$ is ${\begin{array}{|c|c|c|}P&Q&P\to Q\\\hline T&T&T\\T&F&F\\F&T&T\\F&F&T\\\end{array}}$
* We can observe that, in particular, even if the hypothesis $P$ is false, the conditional $P\to Q$ is true, by definition.
* Another observation is that when the consequent is true, then no matter the hypothesis is true or false, the conditional must be true (see 1st and 3rd row).
To understand more intuitively why the conditional is always true when the hypothesis is false, consider the following example.
Example. Suppose Bob is taking a mathematics course, called MATH1001. The course instructor of MATH1001 warns Bob that if he fails the final examination of this course, then he will fail this course. Let $P$ be the statement "Bob fails the final examination of MATH1001.", and $Q$ be the statement "Bob fails MATH1001". Then, the statement made by the course instructor is "$P\to Q$".
For the statement made by the course instructor to be true, either Bob actually fails the final examination of MATH1001, and he actually fails the course, or Bob passes the final examination of MATH1001. In the latter case, whether Bob fails MATH1001 or not does not matter, since the course instructor does not promise anything if Bob passes the final examination of MATH1001.
For the statement made by the course instructor to be false, the only situation is that Bob fails the final examination of MATH1001, but he still passes MATH1001 ($P$ is true and $Q$ is false) (this shows that the instructor is lying!).

### Converse and biconditionals

After discussing conditional of $P$ and $Q$, we will discuss biconditional of $P$ and $Q$. As suggested by its name, there are two conditionals involved. The conditional involved, in addition to $P\to Q$, is $Q\to P$, which is called the converse of the conditional $P\to Q$.
In mathematics, given that the conditional $P\to Q$ is true, we are often interested in knowing whether its converse $Q\to P$ is true as well.
Example. The converse of the statement made by the course instructor in the previous example is "If Bob fails MATH1001, then he fails the final examination of MATH1001.".
Definition. (Biconditionals) The biconditional of two statements $P$ and $Q$, denoted by $P\leftrightarrow Q$, is $(P\to Q)\land (Q\to P)$, that is, "If $P$ then $Q$." and "If $Q$ then $P$.".
Remark.
* We also write $P$ if and only if $Q$ in this case.
   * To understand the phrase "if and only if" more clearly, consider the following:
   * $P$ if and only if $Q$ can be interpreted as "$P$ if $Q$ and $P$ only if $Q$".
   * For "$P$ if $Q$", it should be easy to accept that it means "If $Q$ then $P$".
   * For "$P$ only if $Q$, it means $P$ can only be true when $Q$ is true. That is, $Q$ is a necessary condition for $P$. Thus, we can deduce that when $P$ is true, $Q$ must be true (or else $P$ cannot possibly be true). Hence, "$P$ only if $Q$" means "If $P$ then $Q$.".
Example. (Truth table for $P\leftrightarrow Q$) The truth table for $P\leftrightarrow Q$ is ${\begin{array}{|c|c|c|}P&Q&P\to Q&Q\to P&P\leftrightarrow Q\\\hline T&T&T&T&T\\T&F&F&T&F\\F&T&T&F&F\\F&F&T&T&T\\\end{array}}$
* We can see that $P\leftrightarrow Q$ is true when both $P$ and $Q$ have the same truth values (i.e. either both $P$ and $Q$ are true, or both $P$ and $Q$ are false), and false otherwise.

### Implication and logical equivalence

When the conditional $P\to Q$ is true, we can say "$P$ implies $Q$", denoted by $P\Rightarrow Q$. On the other hand, when $P$ does not imply $Q$, i.e. $P\to Q$ is false, we denote this by $P\nRightarrow Q$.
We have some other equivalently ways to say "$P$ implies $Q$", namely
* $P$ is a sufficient condition for $Q$ (or $P$ is sufficient for $Q$ in short)
   * We call $P$ to be sufficient for $Q$ since when $P$ implies $Q$, then "$P$ is true" is sufficient to deduce "$Q$ is true".
* $Q$ is a necessary condition for $P$ (or $Q$ is necessary for $P$ in short)
   * We call $Q$ to be necessary for $P$ since when $P$ implies $Q$, the hypothesis cannot be possibly true when the consequent $Q$ is false (or else the conditional $P\to Q$ will be false). This explains the necessity of "$Q$ is true".
When $P\Rightarrow Q$, we are often interested knowing whether the converse of $P\to Q$ is true or not, i.e. whether we have $Q\Rightarrow P$ or not.
In the case where $P\Rightarrow Q$ but $Q\nRightarrow P$, we have multiple equivalent ways to express this:
* $P$ is sufficient but not necessary for $Q$.
   * From the previous interpretation, when we say $P$ is necessary for $Q$, we mean $Q\Rightarrow P$. Hence, when $P$ is sufficient but not necessary for $Q$, we mean ${\color {blue}P\Rightarrow Q}$ and ${\color {red}Q\nRightarrow P}$.
* $P$ is a stronger condition than $Q$ (or $P$ is stronger than $Q$ in short).
In the case where $P\Rightarrow Q$ and $Q\Rightarrow P$ as well, the biconditional $P\leftrightarrow Q$ is also true, and we denote this by $P\Leftrightarrow Q$. There are also multiple equivalent ways to express this:
* $P$ is logically equivalent to $Q$.
   * We say they are logically equivalent since they always have the same truth values (because $P\leftrightarrow Q$ is true), which is related to logic.
* "$P$ if and only if $Q$" (is true).
   * Recall that we also use "$P$ if and only if $Q$" to express the biconditional $P\leftrightarrow Q$. Thus, technically, we should write "$P$ if and only if $Q$" is true in the case where $P\Leftrightarrow Q$. However, we rarely write this in practice, and usually omit the phrase "is true" since it makes the expression more complicated. So, when we write "$P$ if and only if $Q$" in this context, we mean that the biconditional is true without saying it explicitly.
   * Usually, when we just write "$P$ if and only if $Q$", we have the meaning of the logical equivalence $P\Leftrightarrow Q$, rather than the statement $P\leftrightarrow Q$. If we really want to have the latter meaning, we should specify that "$P$ if and only if $Q$" refers to a statement.
* $P$ is necessary and sufficient for $Q$.
   * Following the previous interpretation, $P$ is necessary and sufficient for $Q$ means ${\color {blue}Q\Rightarrow P}$ and ${\color {red}P\Rightarrow Q}$.
Theorem. (Some laws about conjunction, disjunction and negation) In the following, $P$, $Q$ and $R$ are arbitrary statements.
* ${\big\sim (\sim P){\big )}\Leftrightarrow P$ (double negation)
* $P\land Q\Leftrightarrow Q\land P$ (commutative law of conjunction)
* $P\lor Q\Leftrightarrow Q\lor P$ (commutative law of disjunction)
* $P\land (Q\land R)\Leftrightarrow (P\land Q)\land R$ (associative law of conjunction)
* $P\lor (Q\lor R)\Leftrightarrow (P\lor Q)\lor R$ (associative law of conjunction)
* $P\lor (Q\land R)\Leftrightarrow (P\lor Q)\land (P\lor R)$ (distributive law)
* $P\land (Q\lor R)\Leftrightarrow (P\land Q)\lor (P\land R)$ (distributive law)
* ${\big\sim (P\land Q){\big )}\Leftrightarrow (\sim P)\lor (\sim Q)$ (De Morgan's law)
* ${\big\sim (P\lor Q){\big )}\Leftrightarrow (\sim P)\land (\sim Q)$ (De Morgan's law)
Proof. They can be shown using truth tables.
$\Box$
Remark.
* You may observe that there are also some analogous results in set theory (some even have the same name!), discussed in the chapter about set theory. This is because the results discussed in the chapter about set theory are actually proven from the corresponding results above almost directly.
Theorem. (Bridge between conditional and disjunction) The statements $P\to Q$ and $(\sim P)\lor Q$ are logically equivalent.
Proof. It can be shown using the following truth table: ${\begin{array}{|c|c|c|c|c|}P&Q&\sim P&P\to Q&(\sim P)\lor Q\\\hline T&T&F&T&T\\T&F&F&F&F\\F&T&T&T&T\\F&F&T&T&T\\\end{array}}$
$\Box$
Theorem. (Logical equivalence of a conditional and its contrapositive) The contrapositive of a conditional $P\to Q$ is defined to be another conditional $(\sim Q)\to (\sim P)$, and they are logically equivalent.
Proof. Using the bridge between conditional and disjunction and some other laws, it can be shown as follows: $P\to Q\Leftrightarrow (\sim P)\lor Q\Leftrightarrow Q\lor (\sim P)\Leftrightarrow {\big\sim (\sim Q){\big )}\lor (\sim P)\Leftrightarrow (\sim Q)\to (\sim P).$
$\Box$
Remark.
* It may seem "surprising" when we "suddenly" negate $Q$ twice. Indeed, when we are thinking about how to prove the logical equivalence, we do not directly do this from nowhere. Instead, we are "motivated" to do so after observing that $P\to Q\Leftrightarrow (\sim P)\lor Q$ and $(\sim Q)\to (\sim P)\Leftrightarrow {\big\sim (\sim Q){\big )}\lor (\sim P)$. So, we sort of finish the above series of equivalence "like a sandwich" (from left to right and from right to left simultaneously). This may be useful for other similar proofs.
* This result is very important for Proof by Contrapositive, which will be discussed later.

## Tautologies and contradictions

Before defining what tautologies and contradictions are, we need to introduce some terms first. In the previous sections, we have discussed the meaning of the symbols $\sim ,\lor ,\land ,\to$ and $\leftrightarrow$. These symbols are sometimes called logical connectives, and we can use logically connectives to make some complicated statements. Such statements, which are composed of at least one given (or component) statements (usually denoted by $P,Q,R$ etc.) and at least one logical connective, are called compound statements.
Definition. (Tautologies and contradictions) A compound statement $S$ is called a tautology (contradiction) if it is true (false) for each possible combination of truth values of the component statement(s) that comprise $S$.
Remark.
* We use $\mathbf {T}$ to denote a tautology and $\mathbf {F}$ to denote a contradiction.
* When a statement $S$ is a tautology, we can also write $S\Leftrightarrow \mathbf {T}$, since it means $S$ and $\mathbf {T}$ always have the same truth value, and because the truth value of $\mathbf {T}$ is always true, the truth value of $S$ is also always true, i.e. $S$ is a tautology.
   * Because of this, when we want to prove that a statement $S$ is always true, one way is to show that $S\Leftrightarrow \mathbf {T}$. For example, if we want to prove that $P\to Q$ and $(\sim Q)\to (\sim P)$ are logically equivalent, we may show that $\left[{\bigP\to Q{\big )}\leftrightarrow {\big(\sim Q)\to (\sim P){\big )}\right]\Leftrightarrow \mathbf {T}$.
Example. Let $P$ be an arbitrary statement. Then,
* $P\lor (\sim P)$ is a tautology.
* $P\land (\sim P)$ is a contradiction.
This is because the truth table for $P\lor (\sim P)$ is ${\begin{array}{|c|c|c|}P&\sim P&P\lor (\sim P)\\\hline T&F&T\\F&T&T\\\end{array}}$ and the truth table for $P\land (\sim P)$ is ${\begin{array}{|c|c|c|}P&\sim P&P\land (\sim P)\\\hline T&F&F\\F&T&F\\\end{array}}.$
Example. Let $P$ and $Q$ be arbitrary statements. Then, $(P\land Q)\to (P\lor Q)$ is a tautology, since its truth table is ${\begin{array}{|c|c|c|c|c|}P&Q&P\land Q&P\lor Q&(P\land Q)\to (P\lor Q)\\\hline T&T&T&T&T\\T&F&F&T&T\\F&T&F&T&T\\F&F&F&F&T\\\end{array}}.$
Exercise. The following are some further questions on this example.
Prove that $(P\land Q)\to (P\lor Q)$ is a tautology without using truth tables.
Since $(P\land Q)\to (P\lor Q)\Leftrightarrow {\big\sim (P\land Q){\big )}\lor (P\lor Q)\Leftrightarrow {\big(\sim P)\lor (\sim Q){\big )}\lor (P\lor Q)\Leftrightarrow {\big(\sim P)\lor P{\big )}\lor {\big(\sim Q)\lor Q{\big )}\Leftrightarrow \mathbf {T} \lor \mathbf {T} \Leftrightarrow \mathbf {T} ,$ the given conditional is a tautology.
A student claims that $(P\lor Q)\to (P\land Q)$ is a contradiction with the following argument:
    Since $(P\lor Q)\to (P\land Q)\Leftrightarrow {\big\sim (P\lor Q){\big )}\lor (P\land Q)\Leftrightarrow {\big(\sim P)\land (\sim Q)){\big )}\lor (P\land Q)\Leftrightarrow {\big(\sim P)\land P){\big )}\lor {\big(\sim Q)\land Q{\big )}\Leftrightarrow \mathbf {F} \lor \mathbf {F} \Leftrightarrow \mathbf {F}$, the conditional is a contradiction.
Comment on his claim.
* The claim is wrong.
* The step ${\big(\sim P)\land (\sim Q)){\big )}\lor (P\land Q)\Leftrightarrow {\big(\sim P)\land P){\big )}\lor {\big(\sim Q)\land Q{\big )}$ is incorrect, since we should use distributive law here instead, and we cannot apply associative law with two types of logical connector here.
* Indeed, it is shown in an above question that the conditional $(P\lor Q)\to (P\land Q)$ is neither tautology nor contradiction.
Theorem. (Laws about tautologies and contradictions) Let $P$ be an arbitrary statement. Then,
* $P\lor \mathbf {T} \Leftrightarrow \mathbf {T}$.
* $P\land \mathbf {T} \Leftrightarrow P$.
* $P\lor \mathbf {F} \Leftrightarrow P$.
* $P\land \mathbf {F} \Leftrightarrow F$.
* $(\sim \mathbf {T} )\Leftrightarrow \mathbf {F}$.
* $(\sim \mathbf {F} )\Leftrightarrow \mathbf {T}$.
Proof. They can be shown using truth tables.
$\Box$

## Quantifiers

Recall that an open statement is a sentence whose truth values depends on the input of certain variable. In this section, we will discuss a way to change an open statement into a statement, by "restricting the input" using quantifiers, and such statement made is called an quantified statement. For example, consider the statement "The square of each real number is nonnegative.". It can be rephrased as "For each real number $x$, $x^{2}\geq 0$." We can let $P(x)$ be the open statement "$x^{2}\geq 0$". Then, it can be further rephrased as "For each real number $x$, $P(x)$." In this case, we can observe how an open statement ($P(x)$) is converted to a statement (For each real number $x$, $P(x)$), and the phrase "for each" is a type of the universal quantifier. Other phrases that are also universal quantifiers include "for every", "for all" and "whenever". The universal quantifier is usually denoted by $\forall$ (an inverted "A"). After introducing this notation, the statement we mention can be further rephrased as "$\forall x\in \mathbb {R} ,x^{2}\geq 0$" (we also use some set notations here).
In general, we can use the universal quantifier to change an open statement $P(x)$ to a statement, which is "$\forall x\in S,P(x)$" in which $S$ is a (universal) set (or domain) which restricts the input $x$.
Apart from the universal quantifier, another way to convert an open statement into a statement is using an existential quantifier. Each of the phrases "there exists", "there is", "there is at least one", "for some", "for at least one" is referred to as an existential quantifier, and is denoted by $\exists$ (an inverted "E"). For example, we can rewrite the statement "The square of some real number is negative." as "$\exists x\in \mathbb {R} ,x^{2}<0.$" (which is false).
In general, we can use the existential quantifier to change an open statement $P(x)$ to a statement, which is "$\exists x\in S,P(x)$" in which $S$ is a (universal) set (or domain) which restricts the input $x$.
Another quantifier that is related to existential quantifier is the unique existential quantifier. Each of the phrases "there exists a unique", "there is exactly one", "for a unique", "for exactly one" is referred to as unique existential quantifier, which is denoted by $\exists !$. For example, we can rewrite the statement "There exists a unique real number $x$ such that $2x=0$." as "$\exists !x\in \mathbb {R} ,2x=0$." We can express the unique existential quantifier in terms of existential and universal quantifiers, by defining "$\exists !x\in S,P(x)$" as $\left(\exists x\in S,P(x)\right)\land \left(\forall x_{1},x_{2}\in S,P(x_{1})\land P(x_{2})\to x_{1}=x_{2}\right)$ where the left bracket is the existence part, and the right bracket is the uniqueness part. In words, the expression means
    There exists $x\in S$ such that $P(x)$, AND for every $x_{1},x_{2}\in S$, if $P(x_{1})$ and $P(x_{2})$, then $x_{1}=x_{2}$ (i.e., $x_{1}$ and $x_{2}$ are actually referring to the same thing, so there is exactly one $x$ such that $P(x)$).
In general, we need to separate the existence and uniqueness part as above to prove statements involving unique existential quantifier.

### Negation of quantified statements

Example. The statement "$\exists A\subseteq U,A=U$" can be expressed in words (partially) as "There exists a set $A\subseteq U$ such that $A=U$."
Exercise. Write down the negation of this statement in words (partially). (Hint: What is the negation of "$n\geq 1$ ($n$ is a nonnegative integer)."? Hence, what is the negation of "There is at least one $x\in S$ such that $P(x)$."?)
* For the hint, the negation of "$n\geq 1$ ($n$ is a nonnegative integer)." is "$n=0$", and the negation of "There is at least one $x\in S$ such that $P(x)$." is hence "There is no $x\in S$ such that $P(x)$". It can also be expressed equivalently as "For each $x\in S$, $P(x)$ is not satisfied.", or $\forall x\in S,\sim P(x)$.
* Inspired from the hint, the negation of this statement can be written as "For each set $A\subseteq U$, $A\neq U$."
From this example, we can see that the negation of the statement "$\exists x\in S,P(x)$" is logically equivalent to "$\forall x\in S,\sim P(x)$". Now, it is natural for us to want to know also the negation of the statement "$\forall x\in S,P(x)$. Consider this: when it is not the case that $P(x)$ is true for each $x\in S$, it means that $P(x)$ is false for at least one $x\in S$. In other words, $\exists x\in S,\sim P(x)$. Hence, we know that the negation of the statement "$\forall x\in S,P(x)$" is logically equivalent to $\exists x\in S,\sim P(x)$.

### Quantified statements with more than one quantifier

A quantified statement may contain more than one quantifier. When only one type of quantifier is used in such quantified statement, the situation is simpler. For example, consider the statement "For each real number $x$ and for each real number $y$, $xy$ is a real number." It can be written as "$\forall x\in \mathbb {R} ,\forall y\in \mathbb {R} ,xy\in \mathbb {R}$". When we interchange "$\forall x\in \mathbb {R}$" and "$\forall y\in \mathbb {R}$", the meaning of the statement is not affected (the statement still means "The product of two arbitrary real numbers is a real number.") Because of this, we can simply write the statement as "$\forall x,y\in \mathbb {R} ,xy\in \mathbb {R}$" without any ambiguity.
For an example that involve two existential quantifiers, consider the statement "There exists an real number $x$ and an real number $y$ such that $xy$ is a real number." It can be written as "$\exists x\in \mathbb {R} ,\exists y\in \mathbb {R} ,xy\in \mathbb {R}$." Similarly, interchanging "$\exists x\in \mathbb {R}$" and "$\exists y\in \mathbb {R}$" does not affect the meaning of the statement (the statement still means "For at least one pair of real numbers $x$ and $y$, $xy$ is a real number.") Because of this, we can simply write the statement as "$\exists x,y\in \mathbb {R} ,xy\in \mathbb {R}$" without any ambiguity.
However, when both types of quantifier are used in such quantified statement, things get more complicated. For example, consider the statement "For each integer $x$, there exists an integer $y$ such that $y<x$." This can also be written as "$\forall x\in \mathbb {Z} ,\exists y\in \mathbb {Z} ,y<x$". It means that for each integer, we can find a (strictly) smaller one, and we can see that this is a true statement. For instance, if you choose $x=13$, I can choose $y=-99,0$ or $12$. Indeed, for the integer $x$ chosen by you, I can always choose my $y$ as $x-1$ so that $y<x$.
Let's see what happen if we interchange "$\forall x\in \mathbb {Z}$" and "$\exists y\in \mathbb {Z}$". The statement becomes $\exists y\in \mathbb {Z} ,\forall x\in \mathbb {Z} ,y<x$, meaning that there exists an integer $y$ such that it is (strictly) smaller than every integer $x$! This is false, since, for example, there is no integer that is (strictly) smaller than itself (which is an integer). In this example, we can see that interchanging the positions of universal quantifier and existential quantifier can change the meaning of the statement. Hence, it is very important to understand clearly the meaning of a quantified statement with both universal and existential quantifiers. To ease the understanding, here is a tips for reading such statement:
    For the variable associated to the quantifier $\exists$, it may depend on the variable(s) introduced earlier in the statement, but must be independent from the variable(s) introduced later in the statement.
What does it mean? For example, consider the above example. In the first case, we have $\forall x\in \mathbb {Z} ,\exists y\in \mathbb {Z} ,y<x.$. Then, since the variable $x$ appears earlier than the variable $y$ which associated to $\exists$, $y$ may depend on $x$ (This is similar to the case in English. In a sentence, a thing may depend on other things mentioned earlier.). For instance, when you choose $x=13$, and I choose $y=12$. Then, $y<x$. However, if you change your choice to $x=9$, then my $y=12$ does not work, and I need to change my $y$ to, say, 8 so that $y<x$. Then, we can see that $y$ depends on $x$ in this case. In the second case, we have $\exists y\in \mathbb {Z} ,\forall x\in Z,y<x$. In this case, the variable $x$ appears later than the variable $y$. Hence, the variable $y$ must be independent from $x$. That is, when such $y$ is determined, it needs to satisfy $y<x$ for each $x$ chosen, and the $y$ cannot change depend on what $x$ is. Indeed, $y$ cannot possibly depend on $x$, since $y$ is supposed to be determined when $x$ is not even introduced!

## Exercises

In the following questions, $P,Q,R,S$ are statements.
A. Construct the truth tables for each the following statements, and also give its converse and contrapositive:
* $\sim P\to Q$
* $P\to (\sim Q)$
* $(P\lor Q)\to R$
* $(P\land Q)\to (R\lor S)$
* $(R\to S)\to (P\to Q)$
B. Negate the following statements:
* $P\land Q$
* $(P\lor Q)\land (R\land S)$
* $(P\land \sim Q)\lor (\sim R\lor S)$
* ↑ When we construct a truth table for a statement that involves some statements, we need to also list all possible combinations of truth values of the statements involved, so that we can observe the truth value for that statement under all situations.
* ↑ In this case, we may call this conditional to be vacuously true, since the conditional is meaningless (when the hypothesis is false, no matter the consequent is true or false, the conditional is true. Thus, "the conditional is true" is "useless" when the hypothesis is false).
* ↑ For example, it may be the case that Bob does not hand in any assignment, and thus even if he passes the final examination, he still fails the course ($P$ is false and $Q$ is true). It may also be the case that Bob passes the final examination, and perform consistently well in all assignments, and thus he passes the course ($P$ is false and $Q$ is false).
* ↑ It is not necessary for $Q\to P$ to be true when $P\to Q$ is true. For example, when $P$ is false and $Q$ is true, $P\to Q$ is (vacuously) true, but $Q\to P$ is false.
* ↑ It is not necessary for $Q\Rightarrow P$ when $P\Rightarrow Q$. See, for example, the third row of the above truth table for $P\leftrightarrow Q$, in which $P\to Q$ is true while $Q\to P$ is false. Indeed, it is a common mistake to think that we must also have $Q\Rightarrow P$ when $P\Rightarrow Q$.
* ↑ "Some" in mathematics always means "at least one".
* ↑ In the form of "$\exists x\in S,P(x)$", this statement can also be written as "$\exists A\in {\mathcal {P}}(U),A=U$."