Informal introduction to formal logic

 In mathematics, we must prove (almost) everything and the proofs must be done logically and rigorously. Therefore, we need some understanding of basic logic. Here, I will informally explain some rudimentary formal logic.



Definitions

(Proposition): A proposition is a statement that is either true or false. "True" and "false" are called the truth values, and are often denoted \(\top\) and \(\bot\).

Here is an example. "Dr. Akira teaches at UBD." is a statement that is either true or false (we understand the existence of Dr. Akira and UBD), hence a proposition.

The following statement is also a proposition, although we don't know if it's true or false (yet):

Any even number greater than or equal to 4 is equal to a sum of two primes.

See also: Goldbach's conjecture 

Next, we define several operations on propositions. Note that propositions combined with these operations are again propositions. 

(Conjunction, logical "and"): Let \(P\) and \(Q\) be propositions. Their conjunction \(P \land Q\) is defined by the following truth table: \begin{equation} \begin{array}{cc|c} P & Q & P \land Q\\\hline \top & \top & \top\\ \top & \bot & \bot\\ \bot & \top & \bot\\ \bot & \bot & \bot\\ \hline \end{array} \end{equation}

We "interpret" the conjunction as logical "and," that is, if \(P\) and \(Q\) are both true, then \(P\land Q\) is true. 

(Disjunction, logical "or"): Let \(P\) and \(Q\) be propositions. Their conjunction \(P \land Q\) is defined by the following truth table: \begin{equation} \begin{array}{cc|c} P & Q & P \lor Q\\\hline \top & \top & \top\\ \top & \bot & \top\\ \bot & \top & \top\\ \bot & \bot & \bot\\ \hline \end{array} \end{equation}

We "interpret" the conjunction as logical "or," that is, if \(P\) or \(Q\) is true, then \(P\lor Q\) is true. 

(Negation, logical "not"): Let \(P\) be a proposition. Its negation is defined by the following truth table: \begin{equation} \begin{array}{c|c} P & \lnot P\\\hline \top & \bot \\ \bot & \top \\\hline \end{array} \end{equation}

We interpret the negation as logical "not," that is, if \(P\) is true (false), then \(\lnot P\) is false (true).

(Implication, "if...then..."): Let \(P\) and \(Q\) be propositions. The implication \(P \implies Q\) is defined by the following truth table: \begin{equation} \begin{array}{cc|c} P & Q & P \implies Q\\\hline \top & \top & \top \\ \top & \bot & \bot \\ \bot & \top & \top\\ \bot & \bot & \top \\\hline \end{array} \end{equation}

We interpret the implication \(P\implies Q\) as "if \(P\) then \(Q\)" or "\(P\) implies "\(Q\)." Note in particular that an implication is true if the left-hand side of \(\implies\) is false (by the way, the left- and right-hand sides of \(\implies\) are called a premise and a conclusion, respectively).

Examples

We can connect propositions with the above operations to make new propositions.

Let us show that \(\lnot (P \land Q)\) and \((\lnot P)\lor (\lnot Q)\) are equivalent. We say that two propositions are equivalent if their truth tables are identical. First, let's write down the truth table for \(\lnot(P \land Q)\): \begin{equation} \begin{array}{cc|c|c} P & Q & P \land Q & \lnot (P\land Q)\\\hline \top & \top & \top & \bot\\ \top & \bot & \bot & \top\\ \bot & \top & \bot & \top\\ \bot & \bot & \bot & \top\\\hline \end{array} \end{equation} It is often helpful to write down the smaller components of a complicated logical expression, such as \(P \land Q\), which is a "smaller" component of \(\lnot (P \land Q)\). Next, \((\lnot P)\lor (\lnot Q)\): \begin{equation} \begin{array}{cc|cc|c} P & Q & \lnot P & \lnot Q & (\lnot P) \lor (\lnot Q)\\\hline \top & \top & \bot & \bot & \bot\\ \top & \bot & \bot & \top & \top\\ \bot & \top & \top & \bot & \top\\ \bot & \bot & \top & \top & \top\\\hline \end{array} \end{equation} By comparing the two tables, we can see that \(\lnot (P \land Q)\) and \((\lnot P)\lor (\lnot Q)\) are indeed equivalent.

If two propositions \(P\) and \(Q\) are equivalent, we write
\[P \equiv Q\]
to denote their equivalence.

Theorem (De Morgan's laws)

Let \(P\) and \(Q\) be any propositions.
We have \[ \begin{eqnarray} \lnot(P \lor Q) &\equiv & (\lnot P) \land (\lnot Q),\\ \lnot(P \land Q) &\equiv & (\lnot P) \lor (\lnot Q). \end{eqnarray}\]
Proof. Exercise. (See above.) ■

Sometimes, we want propositions to depend on some inputs.

(Predicate) A proposition that depends on variables is called a predicate.

Example: Let \(P(x)\) be the predicate that "\(x\) is an even integer." Then, \( P(2) = \top \), \( P(3.1415) = \bot \), \( P(\text{``elephant''}) = \bot, \) etc.

Example: Let \(P(x,y)\) be the predicate that "\(x < y\)" (i.e., \(x\) is less than \(y\)). Then \(P(1, 2)=\top, P(5, -1) = \bot\), etc.

Quantifiers

Next, consider the following "proposition":
For all \(x \in \mathbb{Z}\), there exists \(y\in\mathbb{Z}\) such that \(x < y\).

(This statement means that, for any integer \(x\), there is (always) another integer \(y\) that is greater than \(x\). This is clearly true!)

Here we have quantifiers such as "for all" or "there exists" that restrict the behavour of the variables \(x\) and \(y\) in the predicate "\(x < y\)." We introduce the symbols for these quantifiers. The above proposition can be expressed as 

\[\forall x\in \mathbb{Z} ~ \exists y \in \mathbb{Z} (x < y).\]

The symbol "\(\forall\)" is called the universal quantifier and is read as "for all..." or "for any..." or "for every...." 

The symbol "\(\exists\)" is called the existential quantifier and is read as "there exist(s)..." or "for some..."

The order of appearance of quantifiers matters. That is, the above proposition is different from

\[\exists y \in \mathbb{Z} ~ \forall x\in \mathbb{Z}  (x < y).\]

The latter reads as "There exists an integer \(y\) such that, for every integer \(x\), \(x < y\) holds." But this means that there exists the greatest integer \(y\) (that is greater than any integers); this is clearly false.

Negation involving quantifiers

Note the following equivalence:
\[\lnot (x < y) \equiv x \geq y.\]

This means that "Not that \(x\) is less than \(y\)" is equivalent to "\(x\) is greater than or equal to \(y\)." This equivalence is based on the mathematical meaning of \(<\) and \(\geq\).

Next, note the following equivalence:

\[\lnot (\forall x \in A (P(x))) \equiv \exists x\in A (\lnot P(x)).\]

This means that, if "\(P(x)\) holds for all \(x\in A\)" does not hold, then there exists an \(x\in A\) such that \(P(x)\) does not hold, and vice versa.

We also have the following equivalence:

\[\lnot (\exists x\in A (P(x))) \equiv \forall x\in A (\lnot P(x)).\]

In plain English, if "\(P(x)\) holds for some \(x\in A\)" does not hold, it means that "for any \(x \in A\), \(P(x)\) does not hold."

Example: \[\begin{eqnarray} \lnot(\exists y\in \mathbb{Z} ~ \forall x\in\mathbb{Z} ~ (x < y)) &\equiv & \forall y \in\mathbb{Z}\lnot(\forall x\in\mathbb{Z} ~ (x < y))\\ &\equiv&\forall y \in\mathbb{Z} ~\exists x\in\mathbb{Z} ~ (\lnot(x < y))\\ &\equiv&\forall y \in\mathbb{Z} ~\exists x\in\mathbb{Z} ~ (x \geq y). \end{eqnarray}\]

Note that the original proposition "\(\exists y\in \mathbb{Z} ~ \forall x\in\mathbb{Z} ~ (x < y)\)" is false, but its negation "\(\forall y \in\mathbb{Z} ~\exists x\in\mathbb{Z} ~ (x \geq y)\)" is indeed true.

Propositions about members of the empty set.

Any propositions (predicates) about members of the empty set are true. For example,

\[\forall x \in \emptyset ~ (\text{$x$ is a fish})\]

is true. So is

\[\forall x \in \emptyset ~ (\text{$x$ is not a fish}).\]

This is because the proposition that \(x \in \emptyset\) is always false.


Comments

Popular posts from this blog

Open sets and closed sets in \(\mathbb{R}^n\)

Euclidean spaces

Applications of multiple integrals