Logical laws and transformations

Logical laws are rules that show how statements can be rewritten without changing their truth value. They are used to simplify logical expressions and to show that two different expressions actually mean the same thing. Logical laws work like calculation rules in logic, in the same way that we have calculation rules in arithmetic.

 

 

Symbols

In logic, different symbols are used to show relationships between statements:

 

  • \( = \) means ordinary equality, as in arithmetic: \( 2+2 = 4 \).
  • \( \equiv \) means logical equivalence: two expressions always have the same truth value.
  • \( \Rightarrow \) means implication: if one statement is true, the other must also be true.

 

 

$$ \large \begin{array}{|l|l|} \hline \text{Law} & \text{Equivalence} \\ \hline \text{Identity laws} & p \land \text{true} \equiv p \\ & p \lor \text{false} \equiv p \\ \hline \text{Complement laws} & p \lor \lnot p \equiv \text{true} \\ & p \land \lnot p \equiv \text{false} \\ \hline \text{De Morgan's laws (statements)} & \lnot (p \land q) \equiv \lnot p \lor \lnot q \\ & \lnot (p \lor q) \equiv \lnot p \land \lnot q \\ \hline \text{De Morgan's laws (quantifiers)} & \lnot (\forall x : P(x)) \equiv \exists x : \lnot P(x) \\ & \lnot (\exists x : P(x)) \equiv \forall x : \lnot P(x) \\ \hline \text{Double negation} & \lnot (\lnot p) \equiv p \\ \hline \text{Distributivity} & p \land (q \lor r) \equiv (p \land q) \lor (p \land r) \\ & p \lor (q \land r) \equiv (p \lor q) \land (p \lor r) \\ \hline \text{Commutativity} & p \land q \equiv q \land p \\ & p \lor q \equiv q \lor p \\ \hline \text{Associativity} & (p \land q) \land r \equiv p \land (q \land r) \\ & (p \lor q) \lor r \equiv p \lor (q \lor r) \\ \hline \text{Idempotence} & p \land p \equiv p \\ & p \lor p \equiv p \\ \hline \text{Absorption} & p \lor (p \land q) \equiv p \\ & p \land (p \lor q) \equiv p \\ \hline \end{array} $$

 

 

Identity laws

The identity laws show that true and false act as neutral elements for and and or respectively:

 

$$ \large p \land \text{true} \equiv p \qquad p \lor \text{false} \equiv p $$

 

Example:

"It is raining, and it is true" simply means "it is raining".

 

 

Complement laws

A statement combined with its negation always yields either true or false:

 

$$ \large p \lor \lnot p \equiv \text{true} \qquad p \land \lnot p \equiv \text{false} $$

 

Example:

"Either it is raining, or it is not raining" is always true.

 

 

De Morgan's laws

Negation distributes over and and or:

 

$$ \large \lnot (p \land q) \equiv (\lnot p) \lor (\lnot q) $$

$$ \large \lnot (p \lor q) \equiv (\lnot p) \land (\lnot q) $$

 

Example:

"It is not both Monday and raining" means the same as "either it is not Monday, or it is not raining".

 

De Morgan's laws also apply to quantifiers:

 

$$ \large \lnot (\forall x : P(x)) \equiv \exists x : \lnot P(x) $$

$$ \large \lnot (\exists x : P(x)) \equiv \forall x : \lnot P(x) $$

 

 

Double negation

Negating a statement twice gives the statement itself back:

 

$$ \large \lnot (\lnot p) \equiv p $$

 

Example:

"It is not the case that 7 is not prime" means "7 is prime".

 

 

Distributivity

Conjunction and disjunction can be distributed over each other:

 

$$ \large p \land (q \lor r) \equiv (p \land q) \lor (p \land r) $$

$$ \large p \lor (q \land r) \equiv (p \lor q) \land (p \lor r) $$

 

Example:

"I buy milk, and either bread or cheese" is equivalent to "I buy milk and bread, or milk and cheese".

 

 

Commutativity

The order of statements does not matter with and and or:

 

$$ \large p \land q \equiv q \land p \qquad p \lor q \equiv q \lor p $$

 

Example:

"It is raining, and it is windy" means the same as "it is windy, and it is raining".

 

 

Associativity

The placement of parentheses does not matter when connecting several statements with the same operator:

 

$$ \large (p \land q) \land r \equiv p \land (q \land r) $$

$$ \large (p \lor q) \lor r \equiv p \lor (q \lor r) $$

 

Example:

"((it is raining and it is windy) and it is cold)" is the same as "(it is raining and (it is windy and it is cold))".

 

 

Idempotence

Repeating the same statement with and or or does not add new content:

 

$$ \large p \land p \equiv p \qquad p \lor p \equiv p $$

 

Example:

"It is raining and it is raining" simply means "it is raining".

 

 

Absorption

Combinations of statements can often be reduced to just one of them:

 

$$ \large p \lor (p \land q) \equiv p $$

$$ \large p \land (p \lor q) \equiv p $$

 

Example:

"It is raining, or it is raining and windy" simply means "it is raining".

 

 

Summary

Logical laws make it possible to rewrite and simplify logical expressions without changing their meaning. Together they form a set of rules similar to the calculation rules in algebra. They are used both to simplify expressions, to prove logical relationships, and in applications such as computer science and Boolean algebra.

 

 

Formulas

Logical symbols

$$ \begin{array}{rl} \forall & = \; \text{for all} \\[12pt] \exists & = \; \text{there exists} \\[12pt] \wedge & = \; \text{and} \\[12pt] \vee & = \; \text{or} \\[12pt] \neg & = \; \text{not} \\[12pt] \Rightarrow & = \; \text{if ... then} \\[12pt] \Leftrightarrow & = \; \text{if and only if} \end{array} $$