Skip to main content
\( \newcommand{\lt}{ < } \newcommand{\gt}{ > } \newcommand{\amp}{ & } \)

Section2Logic

Hopefully you get a taste of what it means by "convincing justifications" in Task 1.1. Whether a justification is convincing or not should not depend on who came up with it. A convincing justification not only needs to convince a Fields Medalist but also math major students, or anyone who has the backgrounds of the context. A convincing justification is called a proof and that is what you will learn to construct for the rest of this class. To construct proofs, we will need our own vocabulary and grammar. Let’s get started.

Subsection2.1Statements

Definition2.1

A statement is a declarative sentence that is either true or false but not both. We refer to true (T) or false (F) as the truth value of the statement.

A definition is an exact, unambiguous explanation of the meaning of a mathematical word or phrase. Definitions are the starting points of all mathematical reasonings. They are assumed to be true at all times! All mathematical theorems are derived from definitions.

The truth value of a statement is unambiguous but it does not mean that it is known by anyone. For some statements, we might have to wait to find out their truth values. For other statements, we might not know their truth values till the end of the time.

Some sentences are not statements because they are not declarative. Other sentences are not statements because they use subjective words that cannot be agreed by all people. But there are some sentences that are not statements simply because they use pronouns that are not clear to other people. For example, a sentence like \begin{gather} x \; \text{is a positive rational number}.\label{predicate}\tag{2.1} \end{gather} is too ambiguous to be a statement because we do not know the value of \(x\). If \(x = 1\), then the sentence (2.1) becomes "1 is a positive rational number", which is a true statement; if \(x = \pi\), then the sentence (2.1) becomes “\(\pi\) is a positive rational number” which is a false statement.

A sentence like (2.1) is called a predicate. A predicate has a free variable that may be allowed to take on many possible values. In sentence (2.1), the free variable is "\(x\)" and can be taken on any numbers. If you really want, you can take \(x\) to be a cat and the predicate becomes “A cat is a positive rational number”. Of course it is a false statement.

Subsection2.2Quantifications

There is another way to turn a predicate into a statement, that is, by adding quantifiers. For example, sentence (2.1) is a statement if we add the following type of quantification:\begin{equation*}\text{For every positive integer $x$, $x$ is a positive rational number.}\end{equation*}or a different type of quantification:\begin{equation*}\text{There exists a rational number $x$ such that $x$ is a positive rational number.}\end{equation*} What are the truth values of the previous two statements?

There are two quantifiers:

  • the universal quantifier for all (notation \(\forall\))
  • the existential quantifier there exists (notation \(\exists\))

It is very important to provide enough context to avoid ambiguities when using free variables. For example, if we are talking about real numbers, then it makes sense to say that "For any \(x\), \(x + 1 \gt x\)" and it is a true statement. But if the range of values of \(x\) is not clear, we can say that the statement "For any \(x\), \(x + 1 \gt x\)"" is false because "\(i+1\) is not greater than \(i\)" as we cannot compare complex numbers. So we should always be clear about the context.

We shall realize that the phrases "for all", "for any", "for every" and "for each" are used interchangeably in mathematical English. We can also use the phrase "for some" to replace "there exists". For example, the statement "The inequality \(x^2 \gt 10\) holds for some real number \(x\)" has the same meaning as "There exists a real number \(x\) such that \(x^2 \gt 10\)". Also, we do not use the symbols \(\forall\) and \(\exists\) in formal written mathematics although they are convenient for informal mathematical discourse.

Subsection2.3Logical Connectives

In this section, we will introduce four logical connectives so that we can combine statements into more complex statements to state more complicated mathematics and to construct its proof. We will use \(P, Q, R, \dots\) to denote generic statements and \(P(x), Q(x), R(x), \dots\) to denote generic predicates where \(x\) is the free variable.

Subsubsection2.3.1AND

Definition2.9

If \(P\) and \(Q\) are two statements, then \(P\) and \(Q\) is called the conjunction of \(P\) and \(Q\), denoted by \(P \land Q\).

What is the truth value of \(P \land Q\)? Let us consider the following example: \begin{gather} \text{Mike can swim and ski}.\label{andexample}\tag{2.2} \end{gather} Let \(P\) denote "Mike can swim" and \(Q\) denote "Mike can ski". Then the statement (2.2) can be rewritten as \(P \land Q\). We say that the statement (2.2) is true exactly when Mike knows how to swim and knows how to ski at the same time. If Mike cannot swim or cannot ski, then statement (2.2) is false. Thus for generic statements \(P\) and \(Q\), \(P \land Q\) is true only if \(P\) and \(Q\) are both true. We can use a table to describe this:

\(P\) \(Q\) \(P \land Q\)
T T
T F
F T
F F
Table2.10Truth table for \(P \land Q\)

Since \(P\) and \(Q\) are generic statements, we do not know their truth values. We have to list all possible combinations of the truth values of \(P\) and \(Q\). As \(P\) and \(Q\) can be true or false, we have \(2 \times 2 = 4\) different combinations.

Subsubsection2.3.2OR

Definition2.12

If \(P\) and \(Q\) are two statements, then \(P\) or \(Q\) is called the disjunction of \(P\) and \(Q\), denoted by \(P \lor Q\).

Here is an example of use of "or".

\begin{gather} \text{Eat your dinner or you cannot have ice-cream}.\label{dailyor}\tag{2.3} \end{gather}

The above statement is true when exactly one of the following happens:

  1. you eat the dinner (and then you can have ice-cream) or
  2. you cannot have ice-cream (because you did not eat your dinner).

Assuming that the statement (2.3) is true, then it is not possible for both (1) and (2) happen at the same time. In our daily lives, this is how we use "or" most of the time, that is, "\(P\) or \(Q\)" is true when exactly of one of them is true but not both.

Unfortunately, this is not how we use "or" in mathematics. In mathematical logic, "\(P\) or \(Q\)" is true when at least one of \(P\) and \(Q\) is true. In other words, "\(P\) or \(Q\)" is true if \(P\) is true or \(Q\) is true or both of \(P\) and \(Q\) are true. Here is the truth table for \(P \lor Q\)

.
\(P\) \(Q\) \(P \lor Q\)
T T
T F
F T
F F
Table2.13Truth table for \(P \lor Q\)

Subsubsection2.3.3NOT

Definition2.15

If \(P\) is a statement, then not \(P\) is called the negation of \(P\), denoted by \(\sim P\).

The truth table for \(\sim P\) should be straightforward. Try to fill in the blanks of the following table.

\(P\) \(\sim P\)
T
F
Table2.16Truth table for \(\sim P\)

Let us see how to get a useful negation of a statement. Consider the statement: \(3 \gt \pi\). We can negate this statement as "It is not true that \(3 \gt \pi\)". This is correct but not very useful. A more useful negation would be "\(3 \leq \pi\)".

Negations of statements that have quantifiers are slightly more tricky.

Subsubsection2.3.4If ..., then ...

Definition2.22

If \(P\) and \(Q\) are two statements, then "If \(P\), then \(Q\)" is called an implication in which \(P\) is called the hypothesis and \(Q\) is called the conclusion, denoted by \(P \Rightarrow Q\).

First let us find the truth table of ``if ..., then ...''. Consider the following statement: \begin{gather} \text{If tomorrow does not rain, then Mike will go shop at Target.}.\label{ifthenexample}\tag{2.4} \end{gather} Under what situation can we say that the statement (2.4) is false? If tomorrow indeed does not rain but Mike decides not to go shop at Target, then statement (2.4) is certainly false.

Some people would also argue that the statement (2.4) is false in the event that tomorrow does rain and Mike does go shop at Target. Unfortunately, this is not what mathematicians agree upon. In other words, statement (2.4) makes a claim (Mike will go shop at Target) under the assumption that tomorrow does not rain. Statement (2.4) contains absolutely no information about what is going to happen if tomorrow does rain. Therefore, if tomorrow does rain, we cannot say that statement (2.4) is false no matter what happens. Now read this paragraph again before you move on.

To summarize, statement (2.4) is only false when tomorrow does not rain but Mike decides not to go shop at Target. In all other cases, statement (2.4) is true! Now fill in the following truth table.

\(P\) \(Q\) \(P \Rightarrow Q\)
T T
T F
F T
F F
Table2.23Truth table for \(P \Rightarrow Q\)

Some of the ways that "if...then..." are being used in Task 2.24 are strange. There are at least two reasons. The first is that if we know for sure the truth value of the hypothesis \(P\), then we will never say "if \(P\), then \(Q\)" as there is no need to assume the truthfulness of \(P\) (see below for one exception). The second reason is that when we say "if \(P\), then \(Q\)", there must be some relationships between \(P\) and \(Q\). Some of the hypotheses and conclusions in Task 2.24 have no real connections. Here are some examples of how we do use ``if...then...'' in our daily life.

  • The hypothesis \(P\) is an entirely hypothetical situation that is false. For example, "If I were you, then I will quit this job." or "If Euler does not know math, then nobody knows math."
  • The hypothesis \(P\) is a statement whose truth value is not known now but may be found out at a later time. For example, "If tomorrow rains, then I will go out."; or "If I win the lottery someday, then I will donate all of them."
  • The hypothesis \(P\) is a statement whose truth value is known to the human society but not known to the speakers. For example, "If England has ever won a World Cup, then I will give you ten dollars."

In mathematics, what usually comes after "if" is a predicate and the predicate can sometimes have more than one variable.

Definition2.26

An example that proves the falsity of a universal ("for all") statement is called a counterexample.

There are three statements that are naturally associated with an implication. They are created by reversing the direction of the implication and/or adding negations.

Definition2.28

Let \(P\) and \(Q\) be two statements. The converse of the statement \(P \Rightarrow Q\) is the statement \(Q \Rightarrow P\). The inverse of the statement \(P \Rightarrow Q\) is the statement \((\sim P) \Rightarrow (\sim Q)\). The contrapositive of the statement \(P \Rightarrow Q\) is the statement \((\sim Q) \Rightarrow (\sim P)\).

Definition2.30

Let \(P\) and \(Q\) be two statements. If an implication \(P \Rightarrow Q\) and its converse \(Q \Rightarrow P\) are both true, then we say that \(P\) if and only if \(Q\), and denote it by \(P \Leftrightarrow Q\). The connective "if and only if" can be abbreviated as "iff" for informal writing.

If the statement \(P \Leftrightarrow Q\) is true, then \(P\) and \(Q\) are both true exactly at the same time, and are false exactly at the same time. We also call it \(P\) is logically equivalent to \(Q\). The truth table of \(P \Leftrightarrow Q\) is as follows:

\(P\) \(Q\) \(P \Leftrightarrow Q\)
T T
T F
F T
F F
Table2.31Truth table for \(P \Leftrightarrow Q\)

How to check two statements are logically equivalent? We will investigate this question in the next section.

Subsection2.4Using Truth Tables

In Section 2.3, we investigated the truth tables of \(P \land Q\), \(P \lor Q\), \(P \Rightarrow Q\) and \(\sim P\). We can use them to construct truth tables for more complicated statements. Here is an example.

Surprised about the answer? Because of what you have discovered, we can conclude that \(P \Rightarrow Q\) and the statement \((\sim P) \lor Q\) are logically equivalent. Using the notation "\(\Leftrightarrow\)", it can be denoted as \begin{equation*}(P \Rightarrow Q) \Leftrightarrow ((\sim P) \lor Q).\end{equation*} Another example would be \(P\) is logically equivalent to \(\sim (\sim P)\) (you should write down the details by yourself).

The previous task says that \(\Leftrightarrow\) can be defined using \(\Rightarrow\) and \(\land\).

It is often we have to negate a statement that involves the logical connectives "and" and "or". The DeMorgan's Law tells use how to do this in general.

Definition2.42

A statement like \(R \land (\sim R)\) that is never true is called a contradiction.

If we consider the truth table of \(R \land (\sim R)\), we see that no matter \(R\) is true or false, \(R \land (\sim R)\) is always false.

\(R\) \((\sim R)\) \(R \land (\sim R)\)
T F
F T
Table2.43Truth table for \(R \land (\sim R)\)