Jump to content

De Morgan's laws: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
Useless
Tags: Visual edit Mobile edit Mobile web edit
Set theory and Boolean algebra: split set theory and boolean algebra, they are slightly different
(79 intermediate revisions by 47 users not shown)
Line 4: Line 4:
{{Transformation rules}}
{{Transformation rules}}


In [[propositional calculus|propositional logic]] and [[Boolean algebra]], '''De Morgan's laws'''<ref>Copi and Cohen{{Full citation needed|date=January 2015}}</ref><ref>{{citation|first=Patrick J.|last=Hurley|title=A Concise Introduction to Logic|edition=12th|publisher=Cengage Learning|year=2015|isbn=978-1-285-19654-1}}</ref><ref>Moore and Parker{{Full citation needed|date=January 2015}}</ref> are a pair of transformation rules that are both [[Validity (logic)|valid]] [[rule of inference|rules of inference]]. They are named after [[Augustus De Morgan]], a 19th-century British mathematician. The rules allow the expression of [[Logical conjunction|conjunctions]] and [[Logical disjunction|disjunctions]] purely in terms of each other via [[logical negation|negation]].
In [[propositional calculus|propositional logic]] and [[Boolean algebra]], '''De Morgan's laws''',<ref>{{Cite book |last1=Copi |first1=Irving M. |url=https://www.taylorfrancis.com/books/mono/10.4324/9781315510897/introduction-logic-irving-copi-carl-cohen-kenneth-mcmahon |title=Introduction to Logic |last2=Cohen |first2=Carl |last3=McMahon |first3=Kenneth |date=2016 |doi=10.4324/9781315510897|isbn=9781315510880 }}</ref><ref>{{citation|first=Patrick J.|last=Hurley|title=A Concise Introduction to Logic|edition=12th|publisher=Cengage Learning|year=2015|isbn=978-1-285-19654-1}}</ref><ref>{{Cite book |last=Moore |first=Brooke Noel |url=https://www.worldcat.org/oclc/689858599 |title=Critical thinking |date=2012 |publisher=McGraw-Hill |others=Richard Parker |isbn=978-0-07-803828-0 |edition=10th |location=New York |oclc=689858599}}</ref> also known as '''De Morgan's theorem''',<ref>[http://hyperphysics.phy-astr.gsu.edu/hbase/Electronic/DeMorgan.html DeMorgan's &#91;sic&#93; Theorem]</ref> are a pair of transformation rules that are both [[Validity (logic)|valid]] [[rule of inference|rules of inference]]. They are named after [[Augustus De Morgan]], a 19th-century British mathematician. The rules allow the expression of [[Logical conjunction|conjunctions]] and [[Logical disjunction|disjunctions]] purely in terms of each other via [[logical negation|negation]].


The rules can be expressed in English as:
The rules can be expressed in English as:
* The negation of a disjunction is the conjunction of the negations
* The negation of "A and B" is the same as "not A or not B."
* The negation of a conjunction is the disjunction of the negations
* The negation of "A or B" is the same as "not A and not B."
or
or
* The [[Complement (set theory)|complement]] of the union of two sets is the same as the intersection of their complements
* The [[Complement (set theory)|complement]] of the union of two sets is the same as the intersection of their complements
Line 17: Line 17:
where "A or B" is an "[[inclusive or]]" meaning ''at least'' one of A or B rather than an "[[exclusive or]]" that means ''exactly'' one of A or B.
where "A or B" is an "[[inclusive or]]" meaning ''at least'' one of A or B rather than an "[[exclusive or]]" that means ''exactly'' one of A or B.


In [[set theory]] and [[Boolean algebra (logic)|Boolean algebra]], these are written formally as
In [[set theory]], these are written formally as
:<math>\begin{align}
:<math>\begin{align}
\overline{A \cup B} &= \overline{A} \cap \overline{B}, \\
\overline{A \cup B} &= \overline{A} \cap \overline{B}, \\
Line 27: Line 27:
* <math>\cap</math> is the [[Intersection (set theory)|intersection]], and
* <math>\cap</math> is the [[Intersection (set theory)|intersection]], and
* <math>\cup</math> is the [[Union (set theory)|union]].
* <math>\cup</math> is the [[Union (set theory)|union]].
[[File:In Quest of Univeral Logic Morgan.png|right|thumbnail|400px|The equivalency of ¬φ ∨ ¬ψ and ¬(φ ∧ ψ) is displayed in this truth table.<ref name="Quest_Univeral_Logic ">
{{citation
|last1=Kashef |first1=Arman.
|year=2023
|title= In Quest of Univeral Logic: A brief overview of formal logic's evolution
|doi= 10.13140/RG.2.2.24043.82724/1
|url=https://www.researchgate.net/publication/366867569}}
</ref>]]


In [[formal language]], the rules are written as
In [[formal language]] and [[formal language|Boolean algebra]], the rules are written as
:<math>\neg(P\lor Q)\iff(\neg P)\land(\neg Q),</math>
:<math>\neg(P\lor Q)\iff(\neg P)\land(\neg Q),</math>
and
and
:<math>\neg(P\land Q)\iff(\neg P)\lor(\neg Q)</math>
:<math>\neg(P\land Q)\iff(\neg P)\lor(\neg Q)</math>
where
where
* ''P'' and ''Q are propositions,''
* <math>P</math> and <math>Q</math> are propositions or Boolean variable,
* [[Negation|<math>\neg</math>]] is the negation logic operator (NOT),
* [[Negation|<math>\neg</math>]] is the negation logic operator (NOT),
* [[Logical conjunction|<math>\land</math>]] is the conjunction logic operator (AND),
* [[Logical conjunction|<math>\land</math>]] is the conjunction logic operator (AND),
* [[Logical disjunction|<math>\lor</math>]] is the disjunction logic operator (OR),
* [[Logical disjunction|<math>\lor</math>]] is the disjunction logic operator (OR),
* [[If and only if|<math>\iff</math>]] is a [[metalogic]]al symbol meaning "can be replaced in a [[formal proof|logical proof]] with".
* [[If and only if|<math>\iff</math>]] is a [[metalogic]]al symbol meaning "can be replaced in a [[formal proof|logical proof]] with", often read as "if and only if". For any combination of true/false values for P and Q, the left and right sides of the arrow will hold the same truth value after evaluation.
[[File:De Morgan's law with set subtraction operation.png|thumb|De Morgan's law with set subtraction operation.]]

Another form of De Morgan's law is the following as seen in the right figure.
:<math>A -(B \cup C) = (A - B) \cap (A - C),</math>
:<math>A -(B \cap C) = (A - B) \cup (A - C).</math>
Applications of the rules include simplification of logical [[Expression (computer science)|expressions]] in [[computer program]]s and digital circuit designs. De Morgan's laws are an example of a more general concept of [[duality (mathematics)|mathematical duality]].
Applications of the rules include simplification of logical [[Expression (computer science)|expressions]] in [[computer program]]s and digital circuit designs. De Morgan's laws are an example of a more general concept of [[duality (mathematics)|mathematical duality]].


==Formal notation==
==Formal notation==
The ''negation of conjunction'' rule may be written in [[sequent]] notation:
The ''negation of conjunction'' rule may be written in [[sequent]] notation:
:<math>\begin{align}
:<math>\neg(P \land Q) \vdash (\neg P \lor \neg Q)</math>,
\neg(P \land Q) &\vdash (\neg P \lor \neg Q), \text{and} \\
and
:<math>(\neg P \lor \neg Q) \vdash \neg(P \land Q)</math>.
(\neg P \lor \neg Q) &\vdash \neg(P \land Q).
\end{align}</math>


The ''negation of disjunction'' rule may be written as:
The ''negation of disjunction'' rule may be written as:
:<math>\begin{align}
:<math>\neg(P \lor Q) \vdash (\neg P \land \neg Q)</math>,
\neg(P \lor Q) &\vdash (\neg P \land \neg Q), \text{and} \\
and
:<math>(\neg P \land \neg Q) \vdash \neg(P \lor Q)</math>.
(\neg P \land \neg Q) &\vdash \neg(P \lor Q).
\end{align}</math>


In [[Rule of inference|rule form]]: ''negation of conjunction''
In [[Rule of inference|rule form]]: ''negation of conjunction''
<div style="margin-left: 2em">
:<math>\frac{\neg (P \land Q)}{\therefore \neg P \lor \neg Q}</math>
<math>
:<math>\frac{\neg P \lor \neg Q}{\therefore \neg (P \land Q)}</math>
\frac{\neg (P \land Q)}{\therefore \neg P \lor \neg Q}
\qquad
\frac{\neg P \lor \neg Q}{\therefore \neg (P \land Q)}
</math>
</div>


and ''negation of disjunction''
and ''negation of disjunction''
<div style="margin-left: 2em">
:<math>\frac{\neg (P \lor Q)}{\therefore \neg P \land \neg Q}</math>
<math>
:<math>\frac{\neg P \land \neg Q}{\therefore \neg (P \lor Q)}</math>
\frac{\neg (P \lor Q)}{\therefore \neg P \land \neg Q}
\qquad
\frac{\neg P \land \neg Q}{\therefore \neg (P \lor Q)}
</math>
</div>


and expressed as a truth-functional [[Tautology (logic)|tautology]] or [[theorem]] of propositional logic:
and expressed as truth-functional [[Tautology (logic)|tautologies]] or [[theorem]]s of propositional logic:


:<math>\begin{align}
:<math>\begin{align}
\neg (P \land Q) &\to (\neg P \lor \neg Q), \\
\neg (P \land Q) &\leftrightarrow (\neg P \lor \neg Q), \\
(\neg P \lor \neg Q) &\to \neg (P \land Q), \\
\neg (P \lor Q) &\leftrightarrow (\neg P \land \neg Q). \\
\neg (P \lor Q) &\to (\neg P \land \neg Q), \\
(\neg P \land \neg Q) &\to \neg (P \lor Q),
\end{align}</math>
\end{align}</math>


where <math>P</math> and <math>Q</math> are propositions expressed in some formal system.
where <math>P</math> and <math>Q</math> are propositions expressed in some formal system.

The '''generalized De Morgan’s laws''' provide an equivalence for negating a conjunction or disjunction involving multiple terms.<br/>For a set of propositions <math>P_1, P_2, \dots,P_n</math>, the generalized De Morgan’s Laws are as follows:
:<math>\begin{align}
\lnot(P_1 \land P_2 \land \dots \land P_n) \leftrightarrow \lnot P_1 \lor \lnot P_2 \lor \ldots \lor \lnot P_n \\
\lnot(P_1 \lor P_2 \lor \dots \lor P_n) \leftrightarrow \lnot P_1 \land \lnot P_2 \land \ldots \land \lnot P_n
\end{align}</math>

These laws generalize De Morgan’s original laws for negating conjunctions and disjunctions.


===Substitution form===
===Substitution form===
Line 75: Line 104:


:<math>\begin{align}
:<math>\begin{align}
(P \land Q) &\Longleftrightarrow \neg (\neg P \lor \neg Q), \\
(P \land Q) &\Longleftrightarrow \neg (\neg P \lor \neg Q), \\
(P \lor Q) &\Longleftrightarrow \neg (\neg P \land \neg Q).
(P \lor Q) &\Longleftrightarrow \neg (\neg P \land \neg Q).
\end{align}</math>
\end{align}</math>


This emphasizes the need to invert both the inputs and the output, as well as change the operator when doing a substitution.
This emphasizes the need to invert both the inputs and the output, as well as change the operator when doing a substitution.


===Set theory===
The laws have an important gap to the (<math>\neg(\neg p) \iff p</math>) double negation law. <math>\mathbb{L}</math>, to become a formal logic system: <math>\ p, q, r, ...., \emptyset \in \mathbb{L}\ </math> sequence reports symbols that are defined well formed at first order. The same system has those conjunctions: <math>C_{|j}:x\ |\ x \in set :: \{\land, \lor, \iff, \vdash\}</math>. Obviously, <math>C_{|j} = set, \ x \in C_{|j}</math> is valid knowledge, then there is at least one <math>x</math> conjunction, which -<math>T </math> number —in the truth table, basic proposition of <math>x</math>— is equal to atomic existence context of <math>x</math>, of course according to the <math>\forall x:(\mathbb{L}\vDash \forall c \subsetneq C_{|j}, \ x\in c)</math> knowledge. We regarded the equivalence theory, the logic does. At this point, De Morgan Laws show effect that is upward or downward, the atomic context of <math>x</math>.<ref>{{cite web |last1=Hayes |first1=Andy |last2=Wu |first2=Vincent |title=De Morgan's Laws |url=https://brilliant.org/wiki/de-morgans-laws/ |website=brilliant.org/}}</ref>
In set theory, it is often stated as "union and intersection interchange under complementation",<ref name="r l goodstein">''Boolean Algebra'' by R. L. Goodstein. {{ISBN|0-486-45894-6}}</ref> which can be formally expressed as:

===Set theory and Boolean algebra===
In set theory and [[Boolean algebra (logic)|Boolean algebra]], it is often stated as "union and intersection interchange under complementation",<ref>''Boolean Algebra'' by R. L. Goodstein. {{ISBN|0-486-45894-6}}</ref> which can be formally expressed as:
:<math>\begin{align}
:<math>\begin{align}
\overline{A \cup B} &= \overline{A} \cap \overline{B}, \\
\overline{A \cup B} &= \overline{A} \cap \overline{B}, \\
Line 95: Line 122:
* <math>\cup</math> is the [[Union (set theory)|union]] operator (OR).
* <math>\cup</math> is the [[Union (set theory)|union]] operator (OR).


==== Infinite unions and intersections ====
==== Unions and intersections of any number of sets ====
The generalized form is
The generalized form is
: <math>\begin{align}
: <math>\begin{align}
Line 102: Line 129:
\end{align}</math>
\end{align}</math>


where {{math|''I''}} is some, possibly uncountable, indexing set.
where {{math|''I''}} is some, possibly countably or uncountably infinite, indexing set.


In set notation, De Morgan's laws can be remembered using the [[mnemonic]] "break the line, change the sign".<ref>[https://books.google.com/books?id=NdAjEDP5mDsC&pg=PA81 ''2000 Solved Problems in Digital Electronics''] by S. P. Bali</ref>
In set notation, De Morgan's laws can be remembered using the [[mnemonic]] "break the line, change the sign".<ref>[https://books.google.com/books?id=NdAjEDP5mDsC&pg=PA81 ''2000 Solved Problems in Digital Electronics''] by S. P. Bali</ref>


===Boolean algebra===

In Boolean algebra, similarly, this law which can be formally expressed as:
:<math>\begin{align}
\overline{A \land B} &= \overline{A} \lor \overline{B}, \\
\overline{A \lor B} &= \overline{A} \land \overline{B},
\end{align}</math>

where:
* <math>\overline{A}</math> is the negation of <math>A</math>, the [[overline]] being written above the terms to be negated,
* <math>\land</math> is the [[logical conjunction]] operator (AND),
* <math>\lor</math> is the [[logical disjunction]] operator (OR).

which can be generalized to

: <math>\begin{align}
\overline{A_1 \land A_2 \land \ldots \land A_{n}} = \overline{A_1} \lor \overline{A_2} \lor \ldots \lor \overline{A_{n}}, \\
\overline{A_1 \lor A_2 \lor \ldots \lor A_{n}} = \overline{A_1} \land \overline{A_2} \land \ldots \land \overline{A_{n}}.
\end{align}</math>
===Engineering===
===Engineering===
In [[Electrical engineering|electrical]] and [[computer engineering]], De Morgan's laws are commonly written as:
In [[Electrical engineering|electrical]] and [[computer engineering]], De Morgan's laws are commonly written as:
: <math>\overline{A \cdot B} \equiv \overline {A} + \overline {B}</math>
: <math>\overline{(A \cdot B)} \equiv (\overline {A} + \overline {B})</math>


and
and
Line 134: Line 180:
Evaluating Search B, the search "(NOT cats)" will hit on documents that do not contain "cats", which is Documents 2 and 4. Similarly the search "(NOT dogs)" will hit on Documents 1 and 4. Applying the AND operator to these two searches (which is Search B) will hit on the documents that are common to these two searches, which is Document 4.
Evaluating Search B, the search "(NOT cats)" will hit on documents that do not contain "cats", which is Documents 2 and 4. Similarly the search "(NOT dogs)" will hit on Documents 1 and 4. Applying the AND operator to these two searches (which is Search B) will hit on the documents that are common to these two searches, which is Document 4.


A similar evaluation can be applied to show that the following two searches will return the same set of documents (Documents 1, 2, 4):
A similar evaluation can be applied to show that the following two searches will both return Documents 1, 2, and 4:
:Search C: NOT (cats AND dogs),
:Search C: NOT (cats AND dogs),
:Search D: (NOT cats) OR (NOT dogs).
:Search D: (NOT cats) OR (NOT dogs).


==History==
==History==
The laws are named after [[Augustus De Morgan]] (1806–1871),<ref>''[http://www.mtsu.edu/~phys2020/Lectures/L19-L25/L3/DeMorgan/body_demorgan.html DeMorgan's Theorems]'' at mtsu.edu</ref> who introduced a formal version of the laws to classical [[propositional logic]]. De Morgan's formulation was influenced by algebraization of logic undertaken by [[George Boole]], which later cemented De Morgan's claim to the find. Nevertheless, a similar observation was made by [[Aristotle]], and was known to Greek and Medieval logicians.<ref>Bocheński's ''History of Formal Logic''</ref> For example, in the 14th century, [[William of Ockham]] wrote down the words that would result by reading the laws out.<ref>William of Ockham, ''Summa Logicae'', part II, sections 32 and 33.</ref> [[Jean Buridan]], in his ''Summulae de Dialectica'', also describes rules of conversion that follow the lines of De Morgan's laws.<ref>Jean Buridan, ''Summula de Dialectica''. Trans. Gyula Klima. New Haven: Yale University Press, 2001. See especially Treatise 1, Chapter 7, Section 5. {{ISBN|0-300-08425-0}}</ref> Still, De Morgan is given credit for stating the laws in the terms of modern formal logic, and incorporating them into the language of logic. De Morgan's laws can be proved easily, and may even seem trivial.<ref>[http://www.engr.iupui.edu/~orr/webpages/cpt120/mathbios/ademo.htm Augustus De Morgan (1806–1871)] {{webarchive|url=https://web.archive.org/web/20100715185655/http://www.engr.iupui.edu/~orr/webpages/cpt120/mathbios/ademo.htm |date=2010-07-15 }} by Robert H. Orr</ref> Nonetheless, these laws are helpful in making valid inferences in proofs and deductive arguments.
The laws are named after [[Augustus De Morgan]] (1806–1871),<ref>{{cite web |url=http://www.mtsu.edu/~phys2020/Lectures/L19-L25/L3/DeMorgan/body_demorgan.html |title=DeMorgan's Theorems |archive-url=https://web.archive.org/web/20080323122125/http://www.mtsu.edu/~phys2020/Lectures/L19-L25/L3/DeMorgan/body_demorgan.html |archive-date=2008-03-23 |publisher=[[Middle Tennessee State University]] }}</ref> who introduced a formal version of the laws to classical [[propositional logic]]. De Morgan's formulation was influenced by algebraization of logic undertaken by [[George Boole]], which later cemented De Morgan's claim to the find. Nevertheless, a similar observation was made by [[Aristotle]], and was known to Greek and Medieval logicians.<ref>Bocheński's ''History of Formal Logic''</ref> For example, in the 14th century, [[William of Ockham]] wrote down the words that would result by reading the laws out.<ref>William of Ockham, ''Summa Logicae'', part II, sections 32 and 33.</ref> [[Jean Buridan]], in his {{lang|la|Summulae de Dialectica}}, also describes rules of conversion that follow the lines of De Morgan's laws.<ref>Jean Buridan, ''Summula de Dialectica''. Trans. Gyula Klima. New Haven: Yale University Press, 2001. See especially Treatise 1, Chapter 7, Section 5. {{ISBN|0-300-08425-0}}</ref> Still, De Morgan is given credit for stating the laws in the terms of modern formal logic, and incorporating them into the language of logic. De Morgan's laws can be proved easily, and may even seem trivial.<ref>{{cite web |url=http://www.engr.iupui.edu/~orr/webpages/cpt120/mathbios/ademo.htm |title=Augustus De Morgan (1806–1871) |archive-url=https://web.archive.org/web/20100715185655/http://www.engr.iupui.edu/~orr/webpages/cpt120/mathbios/ademo.htm |archive-date=2010-07-15 |author=Robert H. Orr |publisher=[[Indiana University–Purdue University Indianapolis]] }}</ref> Nonetheless, these laws are helpful in making valid inferences in proofs and deductive arguments.


==Proof for Boolean algebra==
==Informal proof==
De Morgan's theorem may be applied to the negation of a [[disjunction]] or the negation of a [[Logical conjunction|conjunction]] in all or part of a formula.
De Morgan's theorem may be applied to the negation of a [[disjunction]] or the negation of a [[Logical conjunction|conjunction]] in all or part of a formula.


Line 162: Line 208:
Working in the opposite direction again, the second expression asserts that at least one of "not A" and "not B" must be true, or equivalently that at least one of A and B must be false. Since at least one of them must be false, then their conjunction would likewise be false. Negating said conjunction thus results in a true expression, and this expression is identical to the first claim.
Working in the opposite direction again, the second expression asserts that at least one of "not A" and "not B" must be true, or equivalently that at least one of A and B must be false. Since at least one of them must be false, then their conjunction would likewise be false. Negating said conjunction thus results in a true expression, and this expression is identical to the first claim.


==Formal Proof ==
==Proof for set theory==
Here we use <math>\overline{A}</math> to denote the complement of A, as above in {{seclink|De Morgan's laws|Set theory and Boolean algebra|nopage=y}}. The proof that <math>\overline{A\cap B} = \overline{A} \cup \overline{B}</math> is completed in 2 steps by proving both <math>\overline{A\cap B} \subseteq \overline{A} \cup \overline{B}</math> and <math>\overline{A} \cup \overline{B} \subseteq \overline{A\cap B}</math>.
Proof 1. (A U B)' = A' ^ B'


Part (a)
===Part 1===


Let <math>x \in \overline{A \cap B}</math>. Then, <math>x \not\in A \cap B</math>.
Let x belongs to (A U B)' .


Because <math>A \cap B = \{\,y\ |\ y\in A \wedge y \in B\,\}</math>, it must be the case that <math>x \not\in A</math> or <math>x \not\in B</math>.
=> x does not belongs to (A U B).


If <math>x \not\in A</math>, then <math>x \in \overline{A}</math>, so <math>x \in \overline{A} \cup \overline{B}</math>.
Since, if x belongs to A or x belongs to B => x belongs to (A U B).


Similarly, if <math>x \not\in B</math>, then <math>x \in \overline{B}</math>, so <math>x \in \overline{A}\cup \overline{B}</math>.
So, if x does not belongs to (A U B) => x does not belongs to A and x does not belongs to B


Thus, <math>\forall x\Big( x \in \overline{A\cap B} \implies x \in \overline{A} \cup \overline{B}\Big)</math>;
=> x belongs to A' and x belongs to B'


that is, <math>\overline{A\cap B} \subseteq \overline{A} \cup \overline{B}</math>.
=> x belongs to (A' ^ B')


===Part 2===
So, (A U B)' is subset of (A' ^ B')


To prove the reverse direction, let <math>x \in \overline{A} \cup \overline{B}</math>, and for contradiction assume <math>x \not\in \overline{A\cap B}</math>.
Part (b)


Under that assumption, it must be the case that <math>x \in A\cap B</math>,
Let y belongs to (A' ^ B').


so it follows that <math>x \in A</math> and <math>x \in B</math>, and thus <math>x \not\in \overline{A}</math> and <math>x \not\in \overline{B}</math>.
=> y belongs to A' and y belongs to B'


However, that means <math>x \not\in \overline{A} \cup \overline{B}</math>, in contradiction to the hypothesis that <math>x \in \overline{A} \cup \overline{B}</math>,
=> y does not belongs to A and y does not belongs to B


therefore, the assumption <math>x \not\in \overline{A\cap B}</math> must not be the case, meaning that <math>x \in \overline{A\cap B}</math>.
since, if y belongs to (A U B) => y belongs to A or y belongs to B.


Hence, <math>\forall x\Big( x \in \overline{A} \cup \overline{B} \implies x \in \overline{A\cap B}\Big)</math>,
So, if y does not belongs to A and y does not belongs to B => y does not belongs to (A U B).


that is, <math>\overline{A} \cup \overline{B} \subseteq \overline{A\cap B}</math>.
=> y belongs to (A U B)'


===Conclusion===
so, (A' ^ B') is a subset of (A U B)'


If <math>\overline{A} \cup \overline{B} \subseteq \overline{A\cap B}</math> ''and'' <math>\overline{A \cap B} \subseteq \overline{A} \cup \overline{B}</math>, then <math>\overline{A\cap B} = \overline{A} \cup \overline{B}</math>; this concludes the proof of De Morgan's law.
Hence, (A U B) = (A' ^ B').


The other De Morgan's law, <math>\overline{A \cup B} = \overline{A} \cap \overline{B}</math>, is proven similarly.
Similarly, reader try to proof 2 .

i.e (A ^ B)' = ( A' U B')

Hint :- Use negations of the statements on the set not to its complements.

Thanks for reading ...Best wishes .




===1===

.

Implies

Implies

complement




.

,



===2.Implies===

,


==Generalising De Morgan duality==
==Generalising De Morgan duality==
Line 281: Line 295:
== In intuitionistic logic ==
== In intuitionistic logic ==
Three out of the four implications of de Morgan's laws hold in [[intuitionistic logic]]. Specifically, we have
Three out of the four implications of de Morgan's laws hold in [[intuitionistic logic]]. Specifically, we have
:<math>\neg(P\lor Q)\iff(\neg P)\land(\neg Q),</math>
:<math>\neg(P\lor Q)\,\leftrightarrow\,\big((\neg P)\land(\neg Q)\big),</math>
and
and
:<math>(P\lor Q)\rightarrow \neg ((\neg P)\land(\neg Q)),</math>
:<math>\big((\neg P)\lor(\neg Q)\big)\,\to\,\neg(P\land Q).</math>
The converse of the last implication does not hold in pure intuitionistic logic. That is, the failure of the joint proposition <math>P\land Q</math> cannot necessarily be resolved to the failure of either of the two [[logical conjunction|conjuncts]]. For example, from knowing it not to be the case that both Alice and Bob showed up to their date, it does not follow who did not show up. The latter principle is equivalent to the principle of the [[Law_of_excluded_middle#Law_of_the_weak_excluded_middle|weak excluded middle]] <math>{\mathrm {WPEM}}</math>,
:<math>(P\land Q)\rightarrow \neg ((\neg P)\lor(\neg Q)),</math>
:<math>(\neg P)\lor(\neg Q) \rightarrow \neg(P\land Q) </math>
:<math>(\neg P)\lor\neg(\neg P).</math>
This weak form can be used as a foundation for an [[intermediate logic]].
while the converse of the last implication does not hold in pure intuitionistic logic and would be equivalent to the law of the weak excluded middle
For a refined version of the failing law concerning existential statements, see the [[limited principle of omniscience|lesser limited principle of omniscience]] <math>{\mathrm {LLPO}}</math>, which however is different from <math>{\mathrm {WLPO}}</math>.
:<math>\neg P \lor \neg \neg P</math>

which can be used as a foundation for an [[intermediate logic]].
The validity of the other three De Morgan's laws remains true if negation <math>\neg P</math> is replaced by implication <math>P\to C</math> for some arbitrary constant predicate C, meaning that the above laws are still true in [[minimal logic]].

Similarly to the above, the quantifier laws:
:<math>\forall x\,\neg P(x)\,\leftrightarrow\,\neg\exists x\,P(x)</math>
and
:<math>\exists x\,\neg P(x)\,\to\,\neg\forall x\,P(x).</math>
are tautologies even in minimal logic with negation replaced with implying a fixed <math>Q</math>, while the converse of the last law does not have to be true in general.

Further, one still has
:<math>(P\lor Q)\,\to\,\neg\big((\neg P)\land(\neg Q)\big),</math>
:<math>(P\land Q)\,\to\,\neg\big((\neg P)\lor(\neg Q)\big),</math>
:<math>\forall x\,P(x)\,\to\,\neg\exists x\,\neg P(x),</math>
:<math>\exists x\,P(x)\,\to\,\neg\forall x\,\neg P(x),</math>
but their inversion implies [[excluded middle]], <math>{\mathrm {PEM}}</math>.

==In computer engineering==

* De Morgan's laws are widely used in computer engineering and digital logic for the purpose of simplifying circuit designs.<ref>{{citation|title=Digital Circuit Design for Computer Science Students: An Introductory Textbook|first=Niklaus|last=Wirth|author-link=Niklaus Wirth|publisher=Springer|year=1995|isbn=9783540585770|page=16|url=https://books.google.com/books?id=zSIzKYQ6x0AC&pg=PA16}}</ref>
* In modern programming languages, due to the optimisation of compilers and interpreters, the performance differences between these options are negligible or completely absent.


==See also==
==See also==
* [[Conjunction/disjunction duality]]
* [[Isomorphism]] – NOT operator as isomorphism between positive logic and negative logic
* [[Homogeneity (linguistics)]]
* [[Isomorphism]]
* [[List of Boolean algebra topics]]
* [[List of Boolean algebra topics]]
* [[List of set identities and relations]]
* [[List of set identities and relations]]

Revision as of 13:23, 11 September 2024

De Morgan's laws represented with Venn diagrams. In each case, the resultant set is the set of all points in any shade of blue.

In propositional logic and Boolean algebra, De Morgan's laws,[1][2][3] also known as De Morgan's theorem,[4] are a pair of transformation rules that are both valid rules of inference. They are named after Augustus De Morgan, a 19th-century British mathematician. The rules allow the expression of conjunctions and disjunctions purely in terms of each other via negation.

The rules can be expressed in English as:

  • The negation of "A and B" is the same as "not A or not B."
  • The negation of "A or B" is the same as "not A and not B."

or

  • The complement of the union of two sets is the same as the intersection of their complements
  • The complement of the intersection of two sets is the same as the union of their complements

or

  • not (A or B) = (not A) and (not B)
  • not (A and B) = (not A) or (not B)

where "A or B" is an "inclusive or" meaning at least one of A or B rather than an "exclusive or" that means exactly one of A or B.

In set theory, these are written formally as

where

  • and are sets,
  • is the complement of ,
  • is the intersection, and
  • is the union.
The equivalency of ¬φ ∨ ¬ψ and ¬(φ ∧ ψ) is displayed in this truth table.[5]

In formal language and Boolean algebra, the rules are written as

and

where

De Morgan's law with set subtraction operation.

Another form of De Morgan's law is the following as seen in the right figure.

Applications of the rules include simplification of logical expressions in computer programs and digital circuit designs. De Morgan's laws are an example of a more general concept of mathematical duality.

Formal notation

The negation of conjunction rule may be written in sequent notation:

The negation of disjunction rule may be written as:

In rule form: negation of conjunction

and negation of disjunction

and expressed as truth-functional tautologies or theorems of propositional logic:

where and are propositions expressed in some formal system.

The generalized De Morgan’s laws provide an equivalence for negating a conjunction or disjunction involving multiple terms.
For a set of propositions , the generalized De Morgan’s Laws are as follows:

These laws generalize De Morgan’s original laws for negating conjunctions and disjunctions.

Substitution form

De Morgan's laws are normally shown in the compact form above, with the negation of the output on the left and negation of the inputs on the right. A clearer form for substitution can be stated as:

This emphasizes the need to invert both the inputs and the output, as well as change the operator when doing a substitution.

Set theory

In set theory, it is often stated as "union and intersection interchange under complementation",[6] which can be formally expressed as:

where:

  • is the negation of , the overline being written above the terms to be negated,
  • is the intersection operator (AND),
  • is the union operator (OR).

Unions and intersections of any number of sets

The generalized form is

where I is some, possibly countably or uncountably infinite, indexing set.

In set notation, De Morgan's laws can be remembered using the mnemonic "break the line, change the sign".[7]

Boolean algebra

In Boolean algebra, similarly, this law which can be formally expressed as:

where:

  • is the negation of , the overline being written above the terms to be negated,
  • is the logical conjunction operator (AND),
  • is the logical disjunction operator (OR).

which can be generalized to

Engineering

In electrical and computer engineering, De Morgan's laws are commonly written as:

and

where:

  • is the logical AND,
  • is the logical OR,
  • the overbar is the logical NOT of what is underneath the overbar.

Text searching

De Morgan's laws commonly apply to text searching using Boolean operators AND, OR, and NOT. Consider a set of documents containing the words "cats" and "dogs". De Morgan's laws hold that these two searches will return the same set of documents:

Search A: NOT (cats OR dogs)
Search B: (NOT cats) AND (NOT dogs)

The corpus of documents containing "cats" or "dogs" can be represented by four documents:

Document 1: Contains only the word "cats".
Document 2: Contains only "dogs".
Document 3: Contains both "cats" and "dogs".
Document 4: Contains neither "cats" nor "dogs".

To evaluate Search A, clearly the search "(cats OR dogs)" will hit on Documents 1, 2, and 3. So the negation of that search (which is Search A) will hit everything else, which is Document 4.

Evaluating Search B, the search "(NOT cats)" will hit on documents that do not contain "cats", which is Documents 2 and 4. Similarly the search "(NOT dogs)" will hit on Documents 1 and 4. Applying the AND operator to these two searches (which is Search B) will hit on the documents that are common to these two searches, which is Document 4.

A similar evaluation can be applied to show that the following two searches will both return Documents 1, 2, and 4:

Search C: NOT (cats AND dogs),
Search D: (NOT cats) OR (NOT dogs).

History

The laws are named after Augustus De Morgan (1806–1871),[8] who introduced a formal version of the laws to classical propositional logic. De Morgan's formulation was influenced by algebraization of logic undertaken by George Boole, which later cemented De Morgan's claim to the find. Nevertheless, a similar observation was made by Aristotle, and was known to Greek and Medieval logicians.[9] For example, in the 14th century, William of Ockham wrote down the words that would result by reading the laws out.[10] Jean Buridan, in his Summulae de Dialectica, also describes rules of conversion that follow the lines of De Morgan's laws.[11] Still, De Morgan is given credit for stating the laws in the terms of modern formal logic, and incorporating them into the language of logic. De Morgan's laws can be proved easily, and may even seem trivial.[12] Nonetheless, these laws are helpful in making valid inferences in proofs and deductive arguments.

Proof for Boolean algebra

De Morgan's theorem may be applied to the negation of a disjunction or the negation of a conjunction in all or part of a formula.

Negation of a disjunction

In the case of its application to a disjunction, consider the following claim: "it is false that either of A or B is true", which is written as:

In that it has been established that neither A nor B is true, then it must follow that both A is not true and B is not true, which may be written directly as:

If either A or B were true, then the disjunction of A and B would be true, making its negation false. Presented in English, this follows the logic that "since two things are both false, it is also false that either of them is true".

Working in the opposite direction, the second expression asserts that A is false and B is false (or equivalently that "not A" and "not B" are true). Knowing this, a disjunction of A and B must be false also. The negation of said disjunction must thus be true, and the result is identical to the first claim.

Negation of a conjunction

The application of De Morgan's theorem to conjunction is very similar to its application to a disjunction both in form and rationale. Consider the following claim: "it is false that A and B are both true", which is written as:

In order for this claim to be true, either or both of A or B must be false, for if they both were true, then the conjunction of A and B would be true, making its negation false. Thus, one (at least) or more of A and B must be false (or equivalently, one or more of "not A" and "not B" must be true). This may be written directly as,

Presented in English, this follows the logic that "since it is false that two things are both true, at least one of them must be false".

Working in the opposite direction again, the second expression asserts that at least one of "not A" and "not B" must be true, or equivalently that at least one of A and B must be false. Since at least one of them must be false, then their conjunction would likewise be false. Negating said conjunction thus results in a true expression, and this expression is identical to the first claim.

Proof for set theory

Here we use to denote the complement of A, as above in § Set theory and Boolean algebra. The proof that is completed in 2 steps by proving both and .

Part 1

Let . Then, .

Because , it must be the case that or .

If , then , so .

Similarly, if , then , so .

Thus, ;

that is, .

Part 2

To prove the reverse direction, let , and for contradiction assume .

Under that assumption, it must be the case that ,

so it follows that and , and thus and .

However, that means , in contradiction to the hypothesis that ,

therefore, the assumption must not be the case, meaning that .

Hence, ,

that is, .

Conclusion

If and , then ; this concludes the proof of De Morgan's law.

The other De Morgan's law, , is proven similarly.

Generalising De Morgan duality

De Morgan's Laws represented as a circuit with logic gates (International Electrotechnical Commission diagrams).

In extensions of classical propositional logic, the duality still holds (that is, to any logical operator one can always find its dual), since in the presence of the identities governing negation, one may always introduce an operator that is the De Morgan dual of another. This leads to an important property of logics based on classical logic, namely the existence of negation normal forms: any formula is equivalent to another formula where negations only occur applied to the non-logical atoms of the formula. The existence of negation normal forms drives many applications, for example in digital circuit design, where it is used to manipulate the types of logic gates, and in formal logic, where it is needed to find the conjunctive normal form and disjunctive normal form of a formula. Computer programmers use them to simplify or properly negate complicated logical conditions. They are also often useful in computations in elementary probability theory.

Let one define the dual of any propositional operator P(p, q, ...) depending on elementary propositions p, q, ... to be the operator defined by

Extension to predicate and modal logic

This duality can be generalised to quantifiers, so for example the universal quantifier and existential quantifier are duals:

To relate these quantifier dualities to the De Morgan laws, set up a model with some small number of elements in its domain D, such as

D = {a, b, c}.

Then

and

But, using De Morgan's laws,

and

verifying the quantifier dualities in the model.

Then, the quantifier dualities can be extended further to modal logic, relating the box ("necessarily") and diamond ("possibly") operators:

In its application to the alethic modalities of possibility and necessity, Aristotle observed this case, and in the case of normal modal logic, the relationship of these modal operators to the quantification can be understood by setting up models using Kripke semantics.

In intuitionistic logic

Three out of the four implications of de Morgan's laws hold in intuitionistic logic. Specifically, we have

and

The converse of the last implication does not hold in pure intuitionistic logic. That is, the failure of the joint proposition cannot necessarily be resolved to the failure of either of the two conjuncts. For example, from knowing it not to be the case that both Alice and Bob showed up to their date, it does not follow who did not show up. The latter principle is equivalent to the principle of the weak excluded middle ,

This weak form can be used as a foundation for an intermediate logic. For a refined version of the failing law concerning existential statements, see the lesser limited principle of omniscience , which however is different from .

The validity of the other three De Morgan's laws remains true if negation is replaced by implication for some arbitrary constant predicate C, meaning that the above laws are still true in minimal logic.

Similarly to the above, the quantifier laws:

and

are tautologies even in minimal logic with negation replaced with implying a fixed , while the converse of the last law does not have to be true in general.

Further, one still has

but their inversion implies excluded middle, .

In computer engineering

  • De Morgan's laws are widely used in computer engineering and digital logic for the purpose of simplifying circuit designs.[13]
  • In modern programming languages, due to the optimisation of compilers and interpreters, the performance differences between these options are negligible or completely absent.

See also

References

  1. ^ Copi, Irving M.; Cohen, Carl; McMahon, Kenneth (2016). Introduction to Logic. doi:10.4324/9781315510897. ISBN 9781315510880.
  2. ^ Hurley, Patrick J. (2015), A Concise Introduction to Logic (12th ed.), Cengage Learning, ISBN 978-1-285-19654-1
  3. ^ Moore, Brooke Noel (2012). Critical thinking. Richard Parker (10th ed.). New York: McGraw-Hill. ISBN 978-0-07-803828-0. OCLC 689858599.
  4. ^ DeMorgan's [sic] Theorem
  5. ^ Kashef, Arman. (2023), In Quest of Univeral Logic: A brief overview of formal logic's evolution, doi:10.13140/RG.2.2.24043.82724/1
  6. ^ Boolean Algebra by R. L. Goodstein. ISBN 0-486-45894-6
  7. ^ 2000 Solved Problems in Digital Electronics by S. P. Bali
  8. ^ "DeMorgan's Theorems". Middle Tennessee State University. Archived from the original on 2008-03-23.
  9. ^ Bocheński's History of Formal Logic
  10. ^ William of Ockham, Summa Logicae, part II, sections 32 and 33.
  11. ^ Jean Buridan, Summula de Dialectica. Trans. Gyula Klima. New Haven: Yale University Press, 2001. See especially Treatise 1, Chapter 7, Section 5. ISBN 0-300-08425-0
  12. ^ Robert H. Orr. "Augustus De Morgan (1806–1871)". Indiana University–Purdue University Indianapolis. Archived from the original on 2010-07-15.
  13. ^ Wirth, Niklaus (1995), Digital Circuit Design for Computer Science Students: An Introductory Textbook, Springer, p. 16, ISBN 9783540585770