Kahibaro
Discord Login Register

Logical operators

Logical operators are tools for building more complicated statements out of simpler ones. In this chapter, we treat them as a kind of “grammar” for mathematical statements: they tell us how to connect, modify, and compare statements so that their truth values are clear.

We will assume that you already know what a mathematical statement is and what it means for a statement to be true or false. Here, we focus on how logical operators work with those truth values.

Basic idea: truth values and connectives

In this chapter, we use:

A logical operator takes one or more statements and produces a new statement whose truth depends in a precise way on the truth of the originals.

We will look at the most common operators:

Later, you will see these operators used constantly in definitions, theorems, and proofs.

Throughout, it is useful to imagine each letter like a switch that can be either on (true) or off (false), and the operator describes how the output switch depends on the input switches.

Negation: “not”

Negation turns a statement into its opposite in terms of truth.

Examples of negation in words:

The important point: the negation of $P$ is not a commentary on whether we personally know $P$ is true; it is a formal statement whose truth value is the opposite of $P$’s.

Negation affects all parts of a statement, not just one word. When you negate a compound statement such as “$P$ and $Q$”, you do not simply say “not $P$ and $Q$”. Systematic rules for this are covered later as logical equivalences but are worth mentioning here by name:

We will use these laws when transforming logical expressions.

Conjunction: “and”

Conjunction connects two statements and requires both to be true.

Truth table for “and”:

$$
\begin{array}{c|c|c}
P & Q & P \land Q \\
\hline
\text{T} & \text{T} & \text{T} \\
\text{T} & \text{F} & \text{F} \\
\text{F} & \text{T} & \text{F} \\
\text{F} & \text{F} & \text{F}
\end{array}
$$

So $P \land Q$ is true only in one case: when both $P$ and $Q$ are true.

Examples:

Important points:

Disjunction: “or”

Disjunction connects two statements and accepts either of them being true.

This is called the inclusive or. It allows the possibility that both are true.

Truth table:

$$
\begin{array}{c|c|c}
P & Q & P \lor Q \\
\hline
\text{T} & \text{T} & \text{T} \\
\text{T} & \text{F} & \text{T} \\
\text{F} & \text{T} & \text{T} \\
\text{F} & \text{F} & \text{F}
\end{array}
$$

Examples:

In everyday speech, “or” is often exclusive, meaning “one or the other, but not both” (for example, a menu might say “coffee or tea”, suggesting you pick exactly one). When mathematics needs that meaning, it is usually specified explicitly, or written as
“$P$ or $Q$ but not both”, which can be expressed in terms of the basic operators:

$$
\text{“exactly one of } P, Q \text{ is true”} \quad \Longleftrightarrow \quad (P \lor Q) \land \lnot(P \land Q).
$$

However, unless otherwise stated, “or” in mathematics means inclusive or.

Implication: “if … then …”

Implication expresses a conditional relationship between two statements.

Meaning in words:

Truth table:

$$
\begin{array}{c|c|c}
P & Q & P \Rightarrow Q \\
\hline
\text{T} & \text{T} & \text{T} \\
\text{T} & \text{F} & \text{F} \\
\text{F} & \text{T} & \text{T} \\
\text{F} & \text{F} & \text{T}
\end{array}
$$

This table often feels strange at first, especially the last two rows. Here is how to interpret them:

Examples:

Implication can be re-expressed using other operators:

$$
P \Rightarrow Q \quad \text{is logically equivalent to} \quad \lnot P \lor Q.
$$

This means “if $P$, then $Q$” is logically the same as “either $P$ is false or $Q$ is true”. This equivalence is very useful for simplifying logical expressions and for proofs.

Special forms related to implication

Given a statement $P \Rightarrow Q$, there are some related statements you will often see:

These three are different in general. The most important fact is:

Example:

Understanding these relationships is essential for reading and constructing mathematical arguments, especially proofs that use contraposition.

Biconditional: “if and only if”

The biconditional connects two statements in a way that asserts they are equivalent in truth value.

Meaning:

Truth table:

$$
\begin{array}{c|c|c}
P & Q & P \Leftrightarrow Q \\
\hline
\text{T} & \text{T} & \text{T} \\
\text{T} & \text{F} & \text{F} \\
\text{F} & \text{T} & \text{F} \\
\text{F} & \text{F} & \text{T}
\end{array}
$$

You can also see the biconditional as a combination of two implications:

$$
P \Leftrightarrow Q \quad \text{is logically equivalent to} \quad (P \Rightarrow Q) \land (Q \Rightarrow P).
$$

So “$P$ if and only if $Q$” means:

Examples:

Biconditionals are frequently used in definitions and in the precise formulation of “if and only if” theorems.

Combining operators and using parentheses

Logical operators can be combined to form more complex expressions, such as:

Parentheses are used to indicate grouping, just as in arithmetic.

There is also a commonly used precedence (or order of evaluation) when parentheses are omitted; while different texts may vary, a typical order from highest to lowest is:

  1. $\lnot$ (negation)
  2. $\land$ (and)
  3. $\lor$ (or)
  4. $\Rightarrow$ (implication)
  5. $\Leftrightarrow$ (biconditional)

For example, the expression
$$
\lnot P \land Q \Rightarrow R
$$
is usually read as
$$
((\lnot P) \land Q) \Rightarrow R
$$
and not as
$$
\lnot(P \land (Q \Rightarrow R)).
$$

To avoid ambiguity, especially as a beginner, it is wise to use parentheses generously.

Truth tables for compound statements

For any compound statement built using logical operators, you can systematically determine its truth value in all possible cases by constructing a truth table.

The general method is:

  1. List all possible combinations of truth values for the basic statements $P, Q, R, \dots$.
  2. Compute the value of each sub-expression step by step.
  3. End with the truth values of the entire expression.

Example: Consider $(P \land Q) \Rightarrow R$.

We start with columns for $P, Q, R$, then compute $P \land Q$, and finally the implication:

$$
\begin{array}{c|c|c|c|c}
P & Q & R & P \land Q & (P \land Q) \Rightarrow R \\
\hline
\text{T} & \text{T} & \text{T} & \text{T} & \text{T} \\
\text{T} & \text{T} & \text{F} & \text{T} & \text{F} \\
\text{T} & \text{F} & \text{T} & \text{F} & \text{T} \\
\text{T} & \text{F} & \text{F} & \text{F} & \text{T} \\
\text{F} & \text{T} & \text{T} & \text{F} & \text{T} \\
\text{F} & \text{T} & \text{F} & \text{F} & \text{T} \\
\text{F} & \text{F} & \text{T} & \text{F} & \text{T} \\
\text{F} & \text{F} & \text{F} & \text{F} & \text{T}
\end{array}
$$

This table shows, for example, that $(P \land Q) \Rightarrow R$ is false only in the second row, when $P$ and $Q$ are both true but $R$ is false. In all other cases it is true.

Truth tables are a basic tool for:

The deeper study of such relationships belongs to later chapters, but the ability to read and create truth tables starts here.

Logical operators and set operations (preview)

Since you already know about sets and elements, it is worth briefly noticing a relationship you will use repeatedly:

Then:

More connections of this kind, and their visual representation with Venn diagrams, belong to the surrounding chapters on sets. Here, it is enough to see logical operators as the underlying “language” describing membership conditions.

Summary

Logical operators allow you to:

Understanding how these operators behave, especially via truth tables, is a foundation for reading and writing clear mathematical statements and for all later work with proof and reasoning.

Views: 13

Comments

Please login to add a comment.

Don't have an account? Register now!