LogicGates.org Open the simulatorSimulator

Logical equivalences

The laws of logic: pairs of statements that are true in exactly the same cases, so either can replace the other. Every law in these tables was checked by truth table when this page was built.

What logical equivalence means

Two statements A and B are logically equivalent, written A ≡ B, when they have the same truth value in every row of their truth table. Equivalently, the statement A ↔ B is a tautology. Because the two sides never disagree, you may swap one for the other anywhere, even inside a larger statement, and the meaning does not change. That is what makes the laws below useful: they are the moves allowed when simplifying a statement or proving two statements say the same.

The laws of logic

Most laws come in pairs, one for ∧ and one for ∨. Swap ∧ with ∨ and ⊤ with ⊥ in one and you get the other, which is the principle of duality.

Name Equivalence Checked
Identity p ∧ ⊤ ≡ p ✓ by truth table
p ∨ ⊥ ≡ p ✓ by truth table
Domination p ∨ ⊤ ≡ ⊤ ✓ by truth table
p ∧ ⊥ ≡ ⊥ ✓ by truth table
Idempotent p ∨ p ≡ p ✓ by truth table
p ∧ p ≡ p ✓ by truth table
Double negation ¬¬p ≡ p ✓ by truth table
Commutative p ∨ q ≡ q ∨ p ✓ by truth table
p ∧ q ≡ q ∧ p ✓ by truth table
Associative (p ∨ q) ∨ r ≡ p ∨ (q ∨ r) ✓ by truth table
(p ∧ q) ∧ r ≡ p ∧ (q ∧ r) ✓ by truth table
Distributive p ∨ (q ∧ r) ≡ (p ∨ q) ∧ (p ∨ r) ✓ by truth table
p ∧ (q ∨ r) ≡ (p ∧ q) ∨ (p ∧ r) ✓ by truth table
De Morgan's ¬(p ∧ q) ≡ ¬p ∨ ¬q ✓ by truth table
¬(p ∨ q) ≡ ¬p ∧ ¬q ✓ by truth table
Absorption p ∨ (p ∧ q) ≡ p ✓ by truth table
p ∧ (p ∨ q) ≡ p ✓ by truth table
Negation p ∨ ¬p ≡ ⊤ ✓ by truth table
p ∧ ¬p ≡ ⊥ ✓ by truth table

Equivalences with conditionals

These remove or reshape arrows. The first is used most: it turns any conditional into ∧, ∨ and ¬, where the basic laws apply. See conditional statements for what the arrow means.

Name Equivalence Checked
Material implication p → q ≡ ¬p ∨ q ✓ by truth table
Contraposition p → q ≡ ¬q → ¬p ✓ by truth table
OR as a conditional p ∨ q ≡ ¬p → q ✓ by truth table
AND as a conditional p ∧ q ≡ ¬(p → ¬q) ✓ by truth table
Negated conditional ¬(p → q) ≡ p ∧ ¬q ✓ by truth table
Common antecedent, AND (p → q) ∧ (p → r) ≡ p → q ∧ r ✓ by truth table
Common consequent, AND (p → r) ∧ (q → r) ≡ p ∨ q → r ✓ by truth table
Common antecedent, OR (p → q) ∨ (p → r) ≡ p → q ∨ r ✓ by truth table
Common consequent, OR (p → r) ∨ (q → r) ≡ p ∧ q → r ✓ by truth table
Exportation p ∧ q → r ≡ p → (q → r) ✓ by truth table

Equivalences with biconditionals

A biconditional is two conditionals, so it can always be taken apart into ∧, ∨ and ¬.

Name Equivalence Checked
Two conditionals p ↔ q ≡ (p → q) ∧ (q → p) ✓ by truth table
Negating both sides p ↔ q ≡ ¬p ↔ ¬q ✓ by truth table
Both or neither p ↔ q ≡ (p ∧ q) ∨ (¬p ∧ ¬q) ✓ by truth table
Negated biconditional ¬(p ↔ q) ≡ p ↔ ¬q ✓ by truth table
Negated biconditional as XOR ¬(p ↔ q) ≡ p ⊕ q ✓ by truth table

Printable logical equivalences chart

Every law above on one sheet, each pair checked by truth table before it is drawn, for printing or revision.

Logical equivalences chart: 34 equivalences each checked by truth table, including identity, domination, De Morgan's, distributive, absorption, material implication, contraposition, exportation and the biconditional laws Click to download: Logical equivalences chart

How to negate a statement

To negate a compound statement, push the ¬ inwards with these, one connective at a time:

Negation Is equivalent to Checked
¬¬p p ✓ by truth table
¬(p ∧ q) ¬p ∨ ¬q ✓ by truth table
¬(p ∨ q) ¬p ∧ ¬q ✓ by truth table
¬(p → q) p ∧ ¬q ✓ by truth table
¬(p ↔ q) p ↔ ¬q ✓ by truth table
¬(p ⊕ q) p ↔ q ✓ by truth table

For example, the negation of "if it is sunny, we go to the beach and have a picnic" is ¬(s → b ∧ c) ≡ s ∧ ¬(b ∧ c) ≡ s ∧ (¬b ∨ ¬c): it is sunny, and we skip the beach or skip the picnic.

Look-alikes that are not equivalent

Each of these pairs differs in at least one row, found by the engine. One row is enough to show two statements are not equivalent.

Pair Differ when Why
p → q ≢ q → p p true, q false A conditional is not the same as its converse.
(p → q) → r ≢ p → (q → r) p false, q true, r false The conditional is not associative, so brackets matter.
¬(p ∧ q) ≢ ¬p ∧ ¬q p true, q false The negation has to flip the ∧ to ∨ as well (De Morgan).
¬(p → q) ≢ ¬p → ¬q p true, q true Negating a conditional does not give its inverse.

How to prove two statements are equivalent

There are two ways, and both are proofs.

  1. Truth table. Write both statements as columns and check that they agree in every row. It always works, but the table doubles with every new letter.
  2. Chain of laws. Start from one side and rewrite it, one law per line, until you reach the other. Each line is equivalent to the one before, so the first is equivalent to the last. This is shorter for statements with many letters and shows why the equivalence holds.

Show that (p → q) ∧ (p → ¬q) ≡ ¬p

(p → q) ∧ (p → ¬q)
≡ (¬p ∨ q) ∧ (¬p ∨ ¬q) Material implication, twice
≡ ¬p ∨ (q ∧ ¬q) Distributive law
≡ ¬p ∨ ⊥ Negation law
≡ ¬p Identity law

Show that p ∧ q → p ∨ q is a tautology

p ∧ q → p ∨ q
≡ ¬(p ∧ q) ∨ (p ∨ q) Material implication
≡ (¬p ∨ ¬q) ∨ (p ∨ q) De Morgan's law
≡ (p ∨ ¬p) ∨ (q ∨ ¬q) Associative and commutative laws
≡ ⊤ ∨ ⊤ Negation law
≡ ⊤ Domination law

Each line of both chains was checked against the line before when this page was built. A statement that reduces to ⊤ is a tautology, as in the second chain. To check your own pair, use the logical equivalence calculator, or put both statements, separated by a comma, into the truth table calculator.

The same laws in boolean algebra

Digital electronics uses exactly these laws, written with 1 and 0 for ⊤ and ⊥, + for ∨, multiplication for ∧ and a bar or prime for ¬. The distributive law p ∧ (q ∨ r) ≡ (p ∧ q) ∨ (p ∧ r) is p(q + r) = pq + pr. See the laws of boolean algebra for that notation and De Morgan's laws for the pair used most in circuit design. The rules of inference build on these: a proof may use any law in this table to rewrite a line.

Questions

What does it mean for two statements to be logically equivalent?

Two statements are logically equivalent when they have the same truth value in every row of their truth table, so each can replace the other anywhere without changing the meaning. It is written A ≡ B, and holds exactly when A ↔ B is a tautology.

What are the laws of logic?

The laws of logic are the standard logical equivalences: identity, domination, idempotent, double negation, commutative, associative, distributive, De Morgan's, absorption and negation, plus the equivalences for conditionals and biconditionals. The three classical laws of thought are the law of identity, the law of non-contradiction and the law of excluded middle.

How do you prove that two statements are logically equivalent?

Either build a truth table and check that the two columns match in every row, or start from one statement and rewrite it with known equivalences, one law per step, until you reach the other. To prove they are not equivalent, find one row where they differ.

What is the difference between ≡ and ↔?

p ↔ q is a statement inside the logic: it is true in some rows and false in others. p ≡ q is a claim about two statements: that p ↔ q is true in every row. Some books use ⇔ for either one, so check the conventions of your course.

Is p → q equivalent to ¬p ∨ q?

Yes. Both are false in exactly one row, where p is true and q is false. This equivalence, often called material implication, is the usual first step when simplifying a statement with arrows in it, because the other laws are about ∧, ∨ and ¬.

Are the laws of logic the same as the laws of boolean algebra?

Yes, in different notation. Boolean algebra writes ∧ as multiplication, ∨ as +, ¬p as p′ and ⊤ and ⊥ as 1 and 0, so p ∧ (q ∨ r) ≡ (p ∧ q) ∨ (p ∧ r) becomes p(q + r) = pq + pr. The conditional has no boolean operator of its own and is written ¬p + q.