DeMorgan's Laws

Learn how to apply the negation operator on some composite propositions.

It is not straightforward, though not difficult, to negate a conjunction or a disjunction of two propositions. There are chances of making subtle errors in this process, which requires careful attention.

How can we negate a conjunction or a disjunction of two propositions? DeMorgan’s celebrated laws provide the answer. Once we understand these laws, we will be able to apply the negation operator to compound propositions, significantly enhancing our capabilities. There are two natural parts to this question; let’s consider them one by one.

Negation of a conjunction

Let’s first look at how we can negate a conjunction. Let pp and qq be two propositions. According to DeMorgan’s first law:

¬(pq)¬p¬q.\begin{equation} \neg\left(p \land q\right)\equiv \neg p \lor \neg q. \end{equation}

Making a truth table for both expressions in equivalence (1) verifies this law:

pp qq ¬p\neg p ¬q\neg q pqp \land q ¬(pq)\neg\left(p \land q\right) ¬p¬q\neg p \lor \neg q
T T F F T F F
T F F T F T T
F T T F F T T
F F T T F T T

The last two columns of the truth table contain the same truth values, thereby proving the law formally. We can also write this law in our “bar” notation as:

(pq)pq.\overline{ \left(p \land q\right)} \equiv {\overline p} \lor \overline{ q}.

We can use verbal reasoning to verify this law: The left-hand side of equivalence (1) is true exactly when pp and qq are not simultaneously true. At the same time, the right-hand side is true if at least one of them is false. These are two different ways of saying the same thing.

Another way to understand this law is to say that to refute pqp \land q; we have to either refute pp or refute qq.

In comparison, let’s construct the truth table for ¬(pq)\neg\left(p \land q\right) and ¬p¬q\neg p \land \neg q.

pp qq ¬p\neg p ¬q\neg q pqp \land q ¬(pq)\neg\left(p \land q\right) ¬p¬q\neg p \land \neg q
T T F F T F F
T F F T F T F
F T T F F T F
F F T T F T T

The last two columns of the truth table are not the same. This shows that negation does not distribute over conjunction. Note that ¬(pq)\neg ( p \land q ) differs from ¬p¬q\neg p \land \neg q exactly when one of the propositions pp or qq is true, and the other is false.

Examples

Let’s look at a few examples to understand further this negation operator’s behavior in the conjunction of two propositions.


Consider the following propositions:

  • sms_m: Sara likes mathematics.
  • scs_c: Sara likes coffee.

Let LsmscL \equiv s_m \land s_c and N=¬LN = \neg L. The proposition LL says Sara likes mathematics and coffee. In contrast, NN asserts that it is not the case that Sara likes mathematics and coffee.

The proposition LL is true when Sara dislikes both mathematics and coffee. What if Sara likes mathematics, but she does not like coffee? Or if she likes coffee and does not like mathematics? Then LL will be false, and therefore NN will be true. The statement NN is false only if Sara likes both the coffee and the mathematics.

Now consider,

B¬sm¬sc.B \equiv \neg s_m \land \neg s_c.

The statement BB says that it is not the case that Sara likes mathematics and it is not the case that Sara likes coffee.

If Sara likes mathematics and does not like coffee, then BB is false because she likes mathematics. What about NN? It is true because she does not like coffee, and therefore is not the case that she likes both mathematics and coffee because she does not like coffee.

Note: NN is very different from BB. To understand this difference we should focus on the cases when the truth value of NN and BB differ. This happens precisely when sms_m and scs_c have different truth values.

Let’s look at another example.


Consider the following propositions:

  • mdm_d: Maria has a dog.
  • mcm_c: Maria has a cat.

Now let,

  • pmdmcp \equiv m_d \land m_c: Maria has a dog and a cat.
  • q¬(mdmc)q \equiv \neg\left(m_d \land m_c \right): It is not the case that Maria has a dog and a cat.

The proposition qq will be true if Maria does not have a cat, regardless of whether she has a dog or not. Similarly, qq will be true if Maria does not have a dog, regardless of whether she has a cat or not. Hence,

q¬md¬mc.q \equiv \neg m_d \lor \neg m_c.

Negation of a disjunction

DeMorgan’s second law describes how to negate a disjunction of two propositions. According to DeMorgan’s second law:

¬(pq)¬p¬q.\begin{equation} \neg\left(p \lor q\right)\equiv \neg p \land \neg q. \end{equation}

Where pp and qq are two arbitrary propositions. Once again, equivalence (2) is easily verified by making a truth table.

pp qq ¬p\neg p ¬q\neg q pqp \lor q ¬(pq)\neg\left(p \lor q\right) ¬p¬q\neg p \land \neg q
T T F F T F F
T F F T T F F
F T T F T F F
F F T T F T T

The last two columns of the truth table contain the same truth values, thereby proving the law. We can also write this law in our “bar” notation as,

(pq)pq.\overline{ \left(p \lor q\right)} \equiv {\overline p} \land \overline{ q}.

Once again, verbal reasoning clarifies why this law holds: The left-hand side of Equivalence (2) when true, asserts that it is not the case that pp or qq are true. At the same time, the right-hand side claims that both pp and qq are false. Again, these are two different ways of saying the same thing.

Another way to understand this law is to say that to refute pqp \lor q, we have to refute pp and refute qq.

Quiz

Q

In which case ¬(pq)\neg (p \lor q) has a different truth value from ¬p¬q\neg p \lor \neg q?

A)

pp is true and qq is true.

B)

pp is true and qq is false.

C)

pp is false and qq is true.

D)

pp is false and qq is false.

Examples

Let’s look at a few examples to comprehend this behavior of the negation operator on the disjunction of two propositions.


Consider mdm_d and mcm_c again. Recall that,

  • mdm_d: Maria has a dog.
  • mcm_c: Maria has a cat.

Now,

  • mp=mdmcm_p= m_d \lor m_c: Maria has a dog or a cat. (Here mpm_p stands for Maria has a pet)

  • mn=¬(mdmc)m_n = \neg\left(m_d \lor m_c\right): It is not the case that Maria has a dog or a cat. (Here mnm_n stands for Maria has no pet).

Maria

The proposition mpm_p will only be false if Maria does not have a cat and she also does not have a dog; this is precisely the scenario when mnm_n should be true and should be false otherwise. Therefore,

mn¬md¬mc.m_n \equiv \neg m_d \land \neg m_c.


Let’s consider,

  • EgE_g: Elizabeth is wearing glasses.
  • SgS_g: Smith is wearing glasses.

The disjunction of EgE_g and SgS_g gives us:

  • G=EgSgG =E_g \lor S_g: Elizabeth is wearing glasses or Smith is wearing glasses.

The proposition GG is only false when both Elizabeth and Smith are not wearing glasses. Therefore, the negation of GG is only true when both Elizabeth and Smith are not wearing glasses.

  • N=¬GN = \neg G: It is not the case that Elizabeth is wearing glasses or Smith is wearing glasses.
  • ¬Eg¬Sg\neg E_g \land \neg S_g: Elizabeth is not wearing glasses, and Smith is not wearing glasses.

We have,

N¬G¬Eg¬Sg.N \equiv \neg G \equiv \neg E_{g} \land \neg S_{g}.

Summarizing DeMorgan’s laws

We summarize the DeMorgan’s laws in the table below:

DeMorgan’s law Description Logical Equivalence Law in bar notation
1 Negating a conjunction of two propositions ¬(pq)¬p¬q\neg\left(p \land q\right) \equiv \neg p \lor \neg q (pq)pq\overline{( p \land q)} \equiv \overline{p} \lor \overline{q}
2 Negating a disjunction of two propositions ¬(pq)¬p¬q\neg\left(p \lor q\right) \equiv \neg p \land \neg q (pq)pq\overline{( p \lor q)} \equiv \overline{p} \land \overline{q}

There is a simple way to remember these laws:

“When we push negation through the two basic binary operations, they switch their roles.”

Alert: The above colloquial phrase must be understood precisely and used with care.

Generalized form

To look at the generalized version of DeMorgan’s laws, assume the conjunction of nn propositions.

pp1p2p3pn.p\equiv p_1\land p_2\land p_3\land \cdots\land p_n.

If we look at ¬p\neg p,

¬p¬(p1p2p3pn).\neg p \equiv \neg\left(p_1\land p_2\land p_3\land \cdots\land p_n\right).

As conjunction operator is associative, we can view the above logical equivalence as,

¬p¬(p1(p2p3pn)).\neg p \equiv \neg\left(p_1 \land \left( p_2 \land p_3 \land \cdots \land p_n\right)\right).

Now applying the DeMorgan’s law gives:

¬q=¬p1¬(p2p3pn).\neg q=\neg p_1\lor \neg\left(p_2\land p_3\land \cdots\land p_n\right).

Let’s do one more step.

¬p¬p1¬(p2(p3pn)).\neg p \equiv \neg p_1\lor \neg\left(p_2\land \left(p_3\land \cdots\land p_n\right)\right).

¬p=¬p1¬p2¬(p3pn).\neg p=\neg p_1\lor \neg p_2\lor \neg\left(p_3\land \cdots\land p_n\right).

If we keep doing this step, in the end, we’ll get the following result:

¬p=¬p1¬p2¬p3¬pn.\neg p=\neg p_1\lor \neg p_2\lor \neg p_3\lor \cdots\lor \neg p_n.

Therefore,

¬i=1npii=1n¬pi.\neg \bigwedge_{i=1}^n p_i \equiv \bigvee_{i=1}^n \neg p_i.

Negation of iterative conjunction
Negation of iterative conjunction

Similarly we can get a result for distribution of negation over disjunction of nn propositions. Let,

q=q1q2q3qn.q=q_1\lor q_2 \lor q_3 \lor \cdots \lor q_n.

Then,

¬q=¬q1¬q2¬q3¬qn.\neg q = \neg q_1 \land \neg q_2 \land \neg q_3 \land \cdots \land \neg q_n.

Therefore,

¬i=1nqii=1n¬qi.\neg \bigvee_{i=1}^n q_i \equiv \bigwedge_{i=1}^n \neg q_i.

Negation of iterative disjunction
Negation of iterative disjunction

Note: Distributive law does not hold for the negation operator. DeMorgan’s laws provide us with a way to handle this situation.

Quiz

Test your understanding of DeMorgan’s law.

1

hsh_s: Harry likes to play soccer. <br> hph_p: Harry likes to play ping pong.

H=hshpH = h_s \land h_p<br>

Which statement, if assumed true, will make ¬H\neg H true?

A)

Harry does not like to play soccer.

B)

Harry does not like to play ping pong.

C)

Harry likes to play both soccer and ping pong.

D)

Harry likes to play soccer, or he likes to play ping pong.

Question 1 of 40 attempted

Application in real life

Let’s now look at an example with important implications in real life. Consider an insurance company that requires a client, Carla, to have yearly health checkups. Furthermore, Carla must see a doctor from a designated list upon developing any symptoms.


Let,

  • HH: Carla gets an annual health checkup.

  • DD: Carla visits a designated doctor for first advice upon developing any symptoms.


The insurance pays the health expense if she meets both requirements.

Let,

IHD.I \equiv H \land D.

If II is true, Carla can claim her health expenses. Carla needs to understand when the insurance company can deny her health expenses. She has to understand when II is false or equivalently when ¬I\neg I is true. According to DeMorgan’s law:

¬I¬H¬D.\neg I \equiv \neg H \lor \neg D.

DeMorgan’s law entails that if she fails to go for a yearly checkup or fails to consult a doctor from the designated list for first advice upon developing any symptoms, she does not fulfill the insurance company’s requirements.

As seen under the light of DeMorgan’s laws, the harshness of these requirements becomes apparent. The insurance company’s demands are fair if Carla fully understands them.

To fully understand such legalese, we must understand the meaning of sentences that simultaneously use negation, conjunction, and disjunction.