Propositional Logic
Master the fundamentals of propositional logic, including propositions, logical connectives, truth tables, logical equivalences, and normal forms. These concepts form the foundation of discrete mathematics and are essential for computer science.
- Understand the concept of propositions and distinguish them from other types of sentences
- Master all logical connectives (negation, conjunction, disjunction, implication, biconditional) and their properties
- Construct and interpret truth tables for compound propositions
- Apply logical equivalences including De Morgan's laws to simplify propositions
- Convert propositions to Disjunctive Normal Form (DNF) and Conjunctive Normal Form (CNF)
- Recognize tautologies, contradictions, and contingencies
1. Propositions
A proposition (or statement) is a declarative sentence that is either true or false, but not both.
We call the truth or falsity of a proposition its truth value, denoted by:
- or for true
- or for false
Determine which of the following are propositions:
- "Washington, D.C., is the capital of the United States."
✓ Proposition - This is a declarative sentence with truth value T (true). - "What time is it?"
✗ Not a proposition - This is a question, not a declarative sentence. - "x + 2 = 5"
✗ Not a proposition - This is an open sentence. Its truth value depends on the value of x. - "Read this carefully."
✗ Not a proposition - This is a command, not a declarative sentence. - "2 + 2 = 5"
✓ Proposition - This is a declarative sentence with truth value F (false).
Paradoxes are not considered propositions. For example:
- "This statement is false." (Liar's paradox)
- "I am lying."
These sentences cannot be assigned a consistent truth value, so they are not propositions.
We use letters such as , , , , ... to represent propositional variables, which stand for propositions. The area of logic that deals with propositions is called propositional logic or propositional calculus.
2. Logical Connectives
Logical operators (or logical connectives) are used to form new propositions from existing propositions. These compound propositions are built using propositional variables and logical connectives.
The fundamental logical connectives are:
| Name | Symbol | Read as | Example |
|---|---|---|---|
| Negation | NOT p | It is not raining | |
| Conjunction | p AND q | It is raining and cold | |
| Disjunction | p OR q | It is raining or cold | |
| Exclusive Or | p XOR q | Either p or q, but not both | |
| Conditional | IF p THEN q | If it rains, then it is wet | |
| Biconditional | p IF AND ONLY IF q | p is true iff q is true |
Precedence of Logical Operators:
When multiple operators appear without parentheses, they are evaluated in this order (highest to lowest):
For example, means .
Conditional Statements
The conditional statement (also called an implication) is one of the most important connectives in logic.
For propositions and , the conditional statement is false when is true and is false, and true otherwise.
In :
- is called the hypothesis (or antecedent, or premise)
- is called the conclusion (or consequence)
For the implication , we can define three related conditional statements:
- Converse:
- Inverse:
- Contrapositive:
Important: The contrapositive is logically equivalent to the original implication, while the converse and inverse are equivalent to each other but not to the original.
The biconditional statement (read "p if and only if q" or "p iff q") is true when and have the same truth value, and false otherwise.
3. Truth Tables
A truth table displays the truth value of a compound proposition for all possible combinations of truth values of its propositional variables.
For a compound proposition with distinct propositional variables, the truth table has rows.
Here are the truth tables for the fundamental logical connectives:
Negation ()
| T | F |
| F | T |
Conjunction, Disjunction, and XOR
| T | T | T | T | F |
| T | F | F | T | T |
| F | T | F | T | T |
| F | F | F | F | F |
Conditional and Biconditional
| T | T | T | T |
| T | F | F | F |
| F | T | T | F |
| F | F | T | T |
Note: The conditional is false only when the premise is true but the conclusion is false (highlighted in red).
4. Logical Equivalences
- Tautology: A proposition that is always true, e.g.,
- Contradiction: A proposition that is always false, e.g.,
- Contingency: A proposition that is neither a tautology nor a contradiction
Two propositions and are logically equivalent, denoted , if is a tautology.
Equivalently, means and have the same truth value in all possible cases.
The following logical equivalences are fundamental and frequently used:
Implication Laws:
Contrapositive Law:
Biconditional Laws:
We prove using a truth table:
| 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 and are identical (highlighted), the two propositions are logically equivalent. The second De Morgan's law can be proven similarly.
Simplify the proposition
Solution:
(Distributive law)
(Distributive law)
(Negation and Idempotent laws)
(Identity law)
(Associative law)
(Distributive law)
(Negation law)
(Identity law)
(Idempotent law)
5. Propositional Normal Forms
- A literal is a variable or its negation, e.g., ,
- A conjunctive clause (or simply clause) is a conjunction of literals
- A disjunctive clause is a disjunction of literals
A formula is in Disjunctive Normal Form (DNF) if it is written as a disjunction of conjunctive clauses.
General form:
where each is a literal.
Example:
A formula is in Conjunctive Normal Form (CNF) if it is written as a conjunction of disjunctive clauses.
General form:
where each is a literal.
Example:
- Minterm: A conjunctive clause where each variable appears exactly once (either negated or not). For n variables, there are minterms.
Example with 3 variables:
- Maxterm: A disjunctive clause where each variable appears exactly once (either negated or not). For n variables, there are maxterms.
Example with 3 variables:
- Full Disjunctive Normal Form: A DNF where every clause is a minterm
- Full Conjunctive Normal Form: A CNF where every clause is a maxterm
Every compound proposition can be expressed in both DNF and CNF. Moreover, the full DNF and full CNF representations are unique (up to reordering of terms).
Convert the proposition to DNF and CNF.
Step 1: Eliminate the implication
Step 2: Apply distributive law for DNF (already in DNF)
is already in DNF form.
DNF:
Step 3: Convert to CNF using distributive law
(Distributive law)
CNF:
Find the full DNF of a proposition with the following truth table:
| Output | ||
|---|---|---|
| T | T | T |
| T | F | F |
| F | T | T |
| F | F | F |
Solution: Take each row where the output is T (highlighted rows):
- Row 1: (both variables are true)
- Row 3: (p is false, q is true)
Full DNF:
This can be simplified to just using factoring, but the full DNF representation is unique.
Practice Quiz
Frequently Asked Questions
Why is 'p → q' true when p is false?
This is called vacuous truth or material implication. The statement "If p then q" only makes a claim about what happens when p is true. When p is false, the implication makes no claim, so it's considered vacuously true.
Example: "If I win the lottery (false), then I'll buy you a car." Since I didn't win the lottery, the promise is not broken regardless of whether I buy you a car.
What's the difference between 'or' in logic and everyday language?
In logic, is inclusive OR: "p or q" means at least one is true (possibly both). In everyday language, "or" can be inclusive or exclusive depending on context.
Exclusive OR () means exactly one is true, but not both. For example, "You can have tea or coffee" typically means exclusive or in a restaurant context.
How do I remember De Morgan's Laws?
Think: "Break the line, change the sign." When you negate a compound statement:
- Break the line: Remove the parentheses and change to (or vice versa)
- Change the sign: Negate each individual proposition
So becomes .
What's the practical use of normal forms?
Normal forms are crucial in:
- Digital circuit design: DNF corresponds to sum-of-products, CNF to product-of-sums
- SAT solvers: Many automated theorem provers work with CNF
- Database queries: SQL WHERE clauses often use DNF
- Simplification: Standardized forms make it easier to compare and simplify propositions
Is the contrapositive always equivalent to the original implication?
Yes! is always logically equivalent to its contrapositive . This is a fundamental truth in logic and is the basis for proof by contrapositive.
However, the converse () and inverse () are NOT necessarily equivalent to the original statement (though they are equivalent to each other).
Example: "If it rains, the ground is wet" has the same meaning as "If the ground is not wet, it didn't rain."
How many logical equivalences do I need to memorize?
Focus on these essential ones:
- De Morgan's Laws: For negating AND/OR
- Distributive Laws: For rearranging expressions
- Implication Law:
- Double Negation:
The others (identity, domination, idempotent, etc.) are intuitive and can be derived from basic logic principles.