# Beginning Rigorous Mathematics/Basic Logic

In the previous chapter we made clear what a logical statement is. In this chapter we will define and derive rules for working with compound logical statements. The symbols used to combining statements are called "logical operators".

In this section the symbols ${\displaystyle P}$ and ${\displaystyle Q}$ denote any logical statements.

# Logical operators and Truth Tables

Truth tables are used in two ways. Firstly to define exactly what a certain compounded statement means, and secondly to derive the properties of more complicated compounded statements. Truth tables exhaust all possible combinations of the truth of falsehood of the constituent statements in the compounded statement to yield exactly under what combinations of truth and falsehood of the constituent statements, the compound statement is true or false.

## Definitions

### Not, Negation

We define the symbol "${\displaystyle \lnot }$" to mean "not". If ${\displaystyle P}$ is a statement then ${\displaystyle \lnot P}$ is also a statement. It inverts the truth or falsehood of logical statements. In other words, if the statement ${\displaystyle P}$ is true, then the statement ${\displaystyle \lnot P}$ is false and if ${\displaystyle P}$ is false, then ${\displaystyle \lnot P}$ is true. We call ${\displaystyle \lnot P}$ the negation of ${\displaystyle P}$.

We rigorously define the symbol "${\displaystyle \lnot }$" by the following truth table

${\displaystyle P}$ ${\displaystyle \neg P}$
T F
F T

Even though "not" simplest logical operator, the negation of statements is important when trying to prove that certain objects have or do not have certain properties. It makes the skill of being able to correctly negate statements an important one.

### And, Conjunction

We define the symbol "${\displaystyle \land }$" to mean "and". If ${\displaystyle P}$ and ${\displaystyle Q}$ are statements then ${\displaystyle P\land Q}$ is also a statement, is called the conjunction of ${\displaystyle P}$ and ${\displaystyle Q}$, and it reads "${\displaystyle P}$ AND ${\displaystyle Q}$". The compound statement ${\displaystyle P\land Q}$ is true only when both statements ${\displaystyle P}$ and ${\displaystyle Q}$ are true.

We rigorously define the symbol "${\displaystyle \land }$" by the following truth table

${\displaystyle P}$ ${\displaystyle Q}$ ${\displaystyle P\land Q}$
T T T
T F F
F T F
F F F

### Or, Disjunction

We define the symbol "${\displaystyle \lor }$" to mean "or". If ${\displaystyle P}$ and ${\displaystyle Q}$ are statements then ${\displaystyle P\lor Q}$ is also a statement, is called the disjunction of ${\displaystyle P}$ and ${\displaystyle Q}$, and it reads "${\displaystyle P}$ OR ${\displaystyle Q}$". The compound statement ${\displaystyle P\lor Q}$ is true only when either ${\displaystyle P}$ or ${\displaystyle Q}$ or both statements ${\displaystyle P}$ and ${\displaystyle Q}$ are true.

We rigorously define the symbol "${\displaystyle \lor }$" by the following truth table

${\displaystyle P}$ ${\displaystyle Q}$ ${\displaystyle P\lor Q}$
T T T
T F T
F T T
F F F

### If ... then, Implication

We define the symbol "${\displaystyle \Rightarrow }$" to mean "implies". If ${\displaystyle P}$ and ${\displaystyle Q}$ are statements then ${\displaystyle P\Rightarrow Q}$ is also a statement and it reads "${\displaystyle P}$ IMPLIES ${\displaystyle Q}$" or also "IF ${\displaystyle P}$ THEN ${\displaystyle Q}$". The compound statement ${\displaystyle P\Rightarrow Q}$ is false only when ${\displaystyle P}$ is true and ${\displaystyle Q}$ is false. We call ${\displaystyle P}$ the hypothesis and ${\displaystyle Q}$ the Conclusion of the implication.

We rigorously define the symbol "${\displaystyle \Rightarrow }$" by the following truth table

${\displaystyle P}$ ${\displaystyle Q}$ ${\displaystyle P\Rightarrow Q}$
T T T
T F F
F T T
F F T

We call the statement "${\displaystyle Q\Rightarrow P}$" the converse of "${\displaystyle P\Rightarrow Q}$".

Logical implication plays an important role since most theorems take on the form of an implication.

### If and only if, Equivalence

We define the symbol "${\displaystyle \Leftrightarrow }$" to mean "if and only if". If ${\displaystyle P}$ and ${\displaystyle Q}$ are statements then ${\displaystyle P\Leftrightarrow Q}$ is also a statement and it reads "${\displaystyle P}$ is true if and only if ${\displaystyle Q}$ is true".

We rigorously define the symbol "${\displaystyle \Leftrightarrow }$" by the following truth table

${\displaystyle P}$ ${\displaystyle Q}$ ${\displaystyle P\Leftrightarrow Q}$
T T T
T F F
F T F
F F T

## Basic results

In this section we will prove some basic equivalences for compounded logical statements. We say that two (compound) statements are logically equivalent when written in the same truth table, their columns are identical. Knowing how to write statements into logically equivalent statements is very useful in the sense that a statement might be difficult to prove, yet a logically equivalent statement might be easier to prove.

### Lemma 1 (DeMorgan's law, part 1)

${\displaystyle \lnot (P\land Q)}$ is logically equivalent to ${\displaystyle \lnot P\lor \lnot Q}$

Proof

${\displaystyle P}$ ${\displaystyle Q}$ ${\displaystyle P\land Q}$ ${\displaystyle \lnot (P\land Q)}$ ${\displaystyle \lnot P}$ ${\displaystyle \lnot Q}$ ${\displaystyle \lnot P\lor \lnot Q}$
T T T F F F F
T F F T F T T
F T F T T F T
F F F T T T T

Since the columns for the compound statements are identical, they are logically equivalent. QED

Proving the following theorems are left as exercises.

### Lemma 2 (DeMorgan's law, part 2)

${\displaystyle \lnot (P\lor Q)}$ is logically equivalent to ${\displaystyle \lnot P\land \lnot Q}$

### Lemma 3

${\displaystyle P\Leftrightarrow Q}$ is logically equivalent to ${\displaystyle (P\Rightarrow Q)\land (Q\Rightarrow P)}$

### Lemma 4

${\displaystyle \lnot (P\Rightarrow Q)}$ is logically equivalent to ${\displaystyle P\land (\lnot Q)}$

### Lemma 5

${\displaystyle P\Rightarrow Q}$ is logically equivalent to ${\displaystyle \lnot P\lor Q}$

### Lemma 6 (Contrapositive)

${\displaystyle P\Rightarrow Q}$ is logically equivalent to ${\displaystyle \lnot Q\Rightarrow \lnot P}$

### Lemma 7

${\displaystyle P\Leftrightarrow Q}$ is logically equivalent to ${\displaystyle \lnot P\Leftrightarrow \lnot Q}$

# Predicates and Quantifiers

A predicate is defined to be a function mapping any set into the set ${\displaystyle \{T,F\}}$ where the symbols ${\displaystyle T}$ and ${\displaystyle F}$ mean 'true' and 'false' respectively. A predicate can be thought of a collection of statements, one for each element of the domain of the predicate.

For example, we may define the predicate ${\displaystyle P:\mathbb {Z} \to \{T,F\}}$ by ${\displaystyle P(x):=}$"x is an even integer". Instead of writing "${\displaystyle P(5)=F}$" and "${\displaystyle P(16)=T}$" we will say and write "${\displaystyle P(5)}$ is false" and "${\displaystyle P(16)}$ is true".

If ${\displaystyle P:A\to \{T,F\}}$ is a predicate, then the predicate ${\displaystyle \lnot P:A\to \{T,F\}}$ defined to be such that ${\displaystyle \lnot P(x)}$ is true exactly when ${\displaystyle P(x)}$ is false and ${\displaystyle \lnot P(x)}$ is false exactly when ${\displaystyle P(x)}$ is true, is called the negation of ${\displaystyle P}$.

There are two quantifiers denoted by the symbols "${\displaystyle \forall }$" and "${\displaystyle \exists }$" which read "for all" and "there exists" respectively.

Let ${\displaystyle P:A\to \{T,F\}}$ be a predicate and let ${\displaystyle B}$ be any subset of ${\displaystyle A}$ (subsets are discussed in the next section). Then ${\displaystyle \forall x\in B:P(x)}$ which reads "For all elements ${\displaystyle x}$ contained in ${\displaystyle B}$, P(x) is true." is a statement, and is defined to be true exactly when ${\displaystyle P(x)}$ is true for every element ${\displaystyle x}$ contained in ${\displaystyle B}$.

Similarly, ${\displaystyle \exists x\in B:P(x)}$ which reads "There exists an element ${\displaystyle x}$ contained in ${\displaystyle B}$ such that P(x) is true." is a statement, and is defined to be true exactly when ${\displaystyle P(x)}$ is true for at least one element ${\displaystyle x}$ contained in ${\displaystyle B}$.

We define the negation of statements involving quantifiers as follows ${\displaystyle \lnot (\forall x\in B:P(x)):=\exists x\in B:\lnot P(x)}$ and ${\displaystyle \lnot (\exists x\in B:P(x)):=\forall x\in B:\lnot P(x)}$

# Logical rules of inferrence

Proving the truth of statements require knowledge of standard valid logical rules of inference, the most important of which are:

If ${\displaystyle P}$ and ${\displaystyle Q}$ are both true then so is ${\displaystyle P\land Q}$

## Simplification

If ${\displaystyle P\land Q}$ is true then ${\displaystyle P}$ is true.

If ${\displaystyle P\land Q}$ is true then ${\displaystyle Q}$ is true.

If ${\displaystyle P}$ is true then ${\displaystyle P\lor Q}$ is true (regardless of the truth or falsehood of ${\displaystyle Q}$).

## Disjunctive syllogism

If ${\displaystyle P\lor Q}$ is true, and ${\displaystyle P}$ is false then ${\displaystyle Q}$ is true.

If ${\displaystyle P\lor Q}$ is true, and ${\displaystyle Q}$ is false then ${\displaystyle P}$ is true.

## Modus Ponens

If ${\displaystyle P\Rightarrow Q}$ is true, and ${\displaystyle P}$ is true, then ${\displaystyle Q}$ is true.

## Modus Tollens

If ${\displaystyle P\Rightarrow Q}$ is true, and ${\displaystyle Q}$ is false, then ${\displaystyle P}$ is false.

In a mathematical proof, these rules are usually not explicitly mentioned as they have become second nature to mature students and authors of mathematics. We will be very explicit and pedantic in the proofs of some results in the following chapters, so will mention them.