Propositional logic is the branch of mathematical logic that studies the truth values of declarative statements and how they form complex systems using logical operators. It serves as the formal foundation for computer circuitry design, software verification algorithms, and rigorous mathematical proofs.
At its core, mathematical logic provides rules, methodologies, and systematic techniques to determine whether a given mathematical argument is valid. It allows us to prove a theorem—a statement that can be shown to be true under certain specified conditions.
A proposition (or statement) is a declarative sentence that is either strictly True () or False (), but not both. We typically represent propositions using uppercase letters such as or lowercase letters .
┌────────────────────────┐
│ Declarative Statement │
└───────────┬────────────┘
│
┌───────────────┴───────────────┐
▼ ▼
┌─────────────────────────┐ ┌─────────────────────────┐
│ Propositional Statement │ │ Non-Proposition │
│ (Has clear truth value) │ │ (Commands/Opinions/etc) │
└────────────┬────────────┘ └─────────────────────────┘
│
┌───────┴───────┐
▼ ▼
┌───────┐ ┌───────┐
│ True │ │ False │
│ (T) │ │ (F) │
└───────┘ └───────┘We construct complex, compound propositions from simpler ones using logical operators (also called connectives).
The negation of a proposition , written as (read as "not "), has the opposite truth value of .
| | | | :---: | :---: | | | | | | |
The conjunction of and , written as (read as " and "), is true if and only if both and are true. Otherwise, it is false.
| | | | | :---: | :---: | :---: | | | | | | | | | | | | | | | | |
The disjunction of and , written as (read as " or "), is true if at least one of the propositions is true. It is false only when both and are false.
| | | | | :---: | :---: | :---: | | | | | | | | | | | | | | | | |
An implication (read as "if , then ") expresses a conditional relationship. Here, is called the hypothesis (or antecedent), and is called the conclusion (or consequent). The implication is false only when a true hypothesis leads to a false conclusion ().
| | | | | :---: | :---: | :---: | | | | | | | | | | | | | | | | |
The biconditional statement (read as " if and only if ") is true when both and share the same truth values.
| | | | | :---: | :---: | :---: | | | | | | | | | | | | | | | | |
Given a conditional statement , we can form three related conditional propositions:
Let's illustrate these with an example:
Crucial Relationship: A conditional statement is always logically equivalent to its contrapositive (). The converse and inverse are also logically equivalent to each other ().
Translating ambiguous natural language sentences into precise logical formulas is vital for systems engineering. Consider the following policy:
"You cannot ride the roller coaster if you are under 4 feet tall unless you are older than 16 years old."
We begin by identifying the atomic propositional variables:
Now we analyze the logic of "unless". The clause "unless you are older than 16 years old" means "if you are not older than 16 years old" (). So, if you are not older than 16 (), then being under 4 feet tall () implies you cannot ride the roller coaster ().
We write this mathematically as:
Alternatively, we can group the conditions: "If you are under 4 feet tall AND you are not older than 16 years old, then you cannot ride the roller coaster."
Let us prove that these two formulations are logically equivalent using truth tables:
| | | | | | | | | | | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
The truth values for both formulations are identical across all eight assignments, validating the translation.
Compound propositions are categorized based on their possible valuations:
┌────────────────────────┐
│ Compound Proposition │
└───────────┬────────────┘
│
┌────────────────┼────────────────┐
▼ ▼ ▼
┌───────────┐ ┌───────────┐ ┌───────────┐
│ Tautology │ │Contingency│ │Contradiction
│ [Always T]│ │ [T or F] │ │ [Always F]│
└───────────┘ └───────────┘ └───────────┘If a formula is a tautology, we can obtain another tautology by consistently substituting more complex formulas for the variables in . This formula is called a substitution instance of .
For example, let be the tautology:
If we substitute with , the resulting formula is still a tautology:
Two compound propositions and are logically equivalent if they share the same truth values in all possible scenarios. Symbolically, we write this as , which means that the biconditional statement is a tautology.
Let's show that is logically equivalent to :
Thus, .
A statement formula logically implies (or tautologically implies) if the conditional statement is a tautology. We write this as:
Two formulas and are duals of each other if we can obtain one from the other by swapping:
Note: Negation operators () remain unchanged when finding the dual of an expression.
Example: The dual of is .
A set of logical connectives is functionally complete if any possible truth function can be expressed solely using the operators in that set.
The NAND operation yields false only when both inputs are true.
| | | | | :---: | :---: | :---: | | | | | | | | | | | | | | | | |
The NOR operation yields true only when both inputs are false.
| | | | | :---: | :---: | :---: | | | | | | | | | | | | | | | | |
In computer science, logical values are represented as binary digits (bits):
A bit string is a sequence of zero or more bits. Bitwise operations apply logical operators to each corresponding pair of bits in two strings of equal length.
String A: 0 1 1 0 1 1 0 1 1 0
String B: 1 1 0 0 0 1 1 1 0 1
─────────────────────────────
Bitwise OR: 1 1 1 0 1 1 1 1 1 1 (A v B)
Bitwise AND: 0 1 0 0 0 1 0 1 1 0 (A ^ B)
Bitwise XOR: 1 0 1 0 1 0 1 0 1 1 (A ⊕ B)To evaluate logical statements without ambiguity and minimize the need for parentheses, we use a standard order of operations.
| Rank | Operator | Name | | :---: | :---: | :---: | | 1 | | Negation | | 2 | | Conjunction | | 3 | | Disjunction | | 4 | | Conditional | | 5 | | Biconditional |
Example: is evaluated as .
Logical statements can be written using three distinct parenthetic notation styles depending on the placement of the operator relative to its operands:
A declarative sentence that is either strictly True (T) or False (F), but not both.
Operators such as negation, conjunction, disjunction, conditional, and biconditional used to combine statements.
A tautology is a compound statement that is always true, whereas a contradiction is always false, regardless of the truth values of its variables.
Two statement formulas are equivalent if they yield the exact same truth values under all possible valuations.
A set of logical operators that can express any possible truth function without requiring external connectives.
Test your understanding with 5 questions
What is the contrapositive of the conditional statement P -> Q?
Which of the following compound propositions is a contradiction?
If P is True and Q is False, what is the truth value of the implication P -> Q?
What is the dual of the compound proposition (P v Q) ^ R?
Which set of connectives is functionally complete on its own?
6 Modules
6 Modules