Movatterモバイル変換


[0]ホーム

URL:


Jump to content
WikipediaThe Free Encyclopedia
Search

De Morgan's laws

From Wikipedia, the free encyclopedia
Pair of logical equivalences
Transformation rules
Propositional calculus
Rules of inference (List)
Rules of replacement
Predicate logic
Rules of inference
This articlemay containoriginal research. Pleaseimprove it byverifying the claims made and addinginline citations. Statements consisting only of original research should be removed.(September 2025) (Learn how and when to remove this message)
De Morgan's laws represented withVenn diagrams. In each case, the resultant set is the set of all points in any shade of blue.

Inpropositional logic andBoolean algebra,De Morgan's laws,[1][2][3] also known asDe Morgan's theorem,[4] are a pair of transformation rules that are bothvalidrules of inference. They are named afterAugustus De Morgan, a 19th-century British mathematician. The rules allow the expression ofconjunctions anddisjunctions purely in terms of each other vianegation.

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

  • Thecomplement 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" meaningat least one of A or B rather than an "exclusive or" that meansexactly one of A or B.

De Morgan's law with set subtraction operation

Another form of De Morgan's law is the following as seen below.

A(BC)=(AB)(AC),{\displaystyle A-(B\cup C)=(A-B)\cap (A-C),}
A(BC)=(AB)(AC).{\displaystyle A-(B\cap C)=(A-B)\cup (A-C).}

Applications of the rules include simplification of logicalexpressions incomputer programs and digital circuit designs. De Morgan's laws are an example of a more general concept ofmathematical duality.

Formal notation

[edit]

Thenegation of conjunction rule may be written insequent notation:

¬(PQ)(¬P¬Q),and(¬P¬Q)¬(PQ).{\displaystyle {\begin{aligned}\neg (P\land Q)&\vdash (\neg P\lor \neg Q),{\text{and}}\\(\neg P\lor \neg Q)&\vdash \neg (P\land Q).\end{aligned}}}

Thenegation of disjunction rule may be written as:

¬(PQ)(¬P¬Q),and(¬P¬Q)¬(PQ).{\displaystyle {\begin{aligned}\neg (P\lor Q)&\vdash (\neg P\land \neg Q),{\text{and}}\\(\neg P\land \neg Q)&\vdash \neg (P\lor Q).\end{aligned}}}

Inrule form:negation of conjunction

¬(PQ)¬P¬Q¬P¬Q¬(PQ){\displaystyle {\frac {\neg (P\land Q)}{\therefore \neg P\lor \neg Q}}\qquad {\frac {\neg P\lor \neg Q}{\therefore \neg (P\land Q)}}}

andnegation of disjunction

¬(PQ)¬P¬Q¬P¬Q¬(PQ){\displaystyle {\frac {\neg (P\lor Q)}{\therefore \neg P\land \neg Q}}\qquad {\frac {\neg P\land \neg Q}{\therefore \neg (P\lor Q)}}}

and expressed as truth-functionaltautologies ortheorems of propositional logic:

¬(PQ)(¬P¬Q),¬(PQ)(¬P¬Q).{\displaystyle {\begin{aligned}\neg (P\land Q)&\leftrightarrow (\neg P\lor \neg Q),\\\neg (P\lor Q)&\leftrightarrow (\neg P\land \neg Q).\\\end{aligned}}}

whereP{\displaystyle P} andQ{\displaystyle Q} are propositions expressed in some formal system.

Thegeneralized De Morgan's laws provide an equivalence for negating a conjunction or disjunction involving multiple terms.
For a set of propositionsP1,P2,,Pn{\displaystyle P_{1},P_{2},\dots ,P_{n}}, the generalized De Morgan's Laws are as follows:

¬(P1P2Pn)¬P1¬P2¬Pn¬(P1P2Pn)¬P1¬P2¬Pn{\displaystyle {\begin{aligned}\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{aligned}}}

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

Substitution form

[edit]

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:

(PQ)¬(¬P¬Q),(PQ)¬(¬P¬Q).{\displaystyle {\begin{aligned}(P\land Q)&\Longleftrightarrow \neg (\neg P\lor \neg Q),\\(P\lor Q)&\Longleftrightarrow \neg (\neg P\land \neg Q).\end{aligned}}}

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

Set theory

[edit]

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

AB¯=A¯B¯,AB¯=A¯B¯,{\displaystyle {\begin{aligned}{\overline {A\cup B}}&={\overline {A}}\cap {\overline {B}},\\{\overline {A\cap B}}&={\overline {A}}\cup {\overline {B}},\end{aligned}}}

where:

Unions and intersections of any number of sets

[edit]

The generalized form is

iIAi¯iIAi¯,iIAi¯iIAi¯,{\displaystyle {\begin{aligned}{\overline {\bigcap _{i\in I}A_{i}}}&\equiv \bigcup _{i\in I}{\overline {A_{i}}},\\{\overline {\bigcup _{i\in I}A_{i}}}&\equiv \bigcap _{i\in I}{\overline {A_{i}}},\end{aligned}}}

whereI is some, possibly countably or uncountably infinite, indexing set.

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

Boolean algebra

[edit]

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

AB¯=A¯B¯,AB¯=A¯B¯,{\displaystyle {\begin{aligned}{\overline {A\land B}}&={\overline {A}}\lor {\overline {B}},\\{\overline {A\lor B}}&={\overline {A}}\land {\overline {B}},\end{aligned}}}

where:

which can be generalized to

A1A2An¯=A1¯A2¯An¯,A1A2An¯=A1¯A2¯An¯.{\displaystyle {\begin{aligned}{\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{aligned}}}

Engineering

[edit]

Inelectrical andcomputer engineering, De Morgan's laws are commonly written as:

(AB)¯(A¯+B¯){\displaystyle {\overline {(A\cdot B)}}\equiv ({\overline {A}}+{\overline {B}})}

and

(A+B)¯(A¯B¯),{\displaystyle {\overline {(A+B)}}\equiv ({\overline {A}}\cdot {\overline {B}}),}

where:

Text searching

[edit]

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

[edit]

The laws are named afterAugustus De Morgan (1806–1871),[7] who introduced a formal version of the laws to classicalpropositional logic. De Morgan's formulation was influenced by the algebraization of logic undertaken byGeorge Boole, which later cemented De Morgan's claim to the find. Nevertheless, a similar observation was made byAristotle, and was known to Greek and Medieval logicians.[8] For example, in the 14th century,William of Ockham wrote down the words that would result by reading the laws out.[9]Jean Buridan, in hisSummulae de Dialectica, also describes rules of conversion that follow the lines of De Morgan's laws.[10] 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.[11] Nonetheless, these laws are helpful in making valid inferences in proofs and deductive arguments.

Proof for Boolean algebra

[edit]

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

Negation of a disjunction

[edit]

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:

¬(AB).{\displaystyle \neg (A\lor B).}

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

(¬A)(¬B).{\displaystyle (\neg A)\wedge (\neg B).}

If either A or Bwere 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

[edit]

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:

¬(AB).{\displaystyle \neg (A\land B).}

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,

(¬A)(¬B).{\displaystyle (\neg A)\lor (\neg B).}

Presented in a natural language like English, it is expressed as "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

[edit]

Here we useA¯{\displaystyle {\overline {A}}} to denote the complement of A, as above in§ Set theory and Boolean algebra. The proof thatAB¯=A¯B¯{\displaystyle {\overline {A\cap B}}={\overline {A}}\cup {\overline {B}}} is completed in 2 steps by proving bothAB¯A¯B¯{\displaystyle {\overline {A\cap B}}\subseteq {\overline {A}}\cup {\overline {B}}} andA¯B¯AB¯{\displaystyle {\overline {A}}\cup {\overline {B}}\subseteq {\overline {A\cap B}}}.

Part 1

[edit]

LetxAB¯{\displaystyle x\in {\overline {A\cap B}}}. Then,xAB{\displaystyle x\not \in A\cap B}.

BecauseAB={y | yAyB}{\displaystyle A\cap B=\{\,y\ |\ y\in A\wedge y\in B\,\}}, it must be the case thatxA{\displaystyle x\not \in A} orxB{\displaystyle x\not \in B}.

IfxA{\displaystyle x\not \in A}, thenxA¯{\displaystyle x\in {\overline {A}}}, soxA¯B¯{\displaystyle x\in {\overline {A}}\cup {\overline {B}}}.

Similarly, ifxB{\displaystyle x\not \in B}, thenxB¯{\displaystyle x\in {\overline {B}}}, soxA¯B¯{\displaystyle x\in {\overline {A}}\cup {\overline {B}}}.

Thus,x(xAB¯xA¯B¯){\displaystyle \forall x{\Big (}x\in {\overline {A\cap B}}\implies x\in {\overline {A}}\cup {\overline {B}}{\Big )}};

that is,AB¯A¯B¯{\displaystyle {\overline {A\cap B}}\subseteq {\overline {A}}\cup {\overline {B}}}.

Part 2

[edit]

To prove the reverse direction, letxA¯B¯{\displaystyle x\in {\overline {A}}\cup {\overline {B}}}, and for contradiction assumexAB¯{\displaystyle x\not \in {\overline {A\cap B}}}.

Under that assumption, it must be the case thatxAB{\displaystyle x\in A\cap B},

so it follows thatxA{\displaystyle x\in A} andxB{\displaystyle x\in B}, and thusxA¯{\displaystyle x\not \in {\overline {A}}} andxB¯{\displaystyle x\not \in {\overline {B}}}.

However, that meansxA¯B¯{\displaystyle x\not \in {\overline {A}}\cup {\overline {B}}}, in contradiction to the hypothesis thatxA¯B¯{\displaystyle x\in {\overline {A}}\cup {\overline {B}}},

therefore, the assumptionxAB¯{\displaystyle x\not \in {\overline {A\cap B}}} must not be the case, meaning thatxAB¯{\displaystyle x\in {\overline {A\cap B}}}.

Hence,x(xA¯B¯xAB¯){\displaystyle \forall x{\Big (}x\in {\overline {A}}\cup {\overline {B}}\implies x\in {\overline {A\cap B}}{\Big )}},

that is,A¯B¯AB¯{\displaystyle {\overline {A}}\cup {\overline {B}}\subseteq {\overline {A\cap B}}}.

Conclusion

[edit]

IfA¯B¯AB¯{\displaystyle {\overline {A}}\cup {\overline {B}}\subseteq {\overline {A\cap B}}}andAB¯A¯B¯{\displaystyle {\overline {A\cap B}}\subseteq {\overline {A}}\cup {\overline {B}}}, thenAB¯=A¯B¯{\displaystyle {\overline {A\cap B}}={\overline {A}}\cup {\overline {B}}}; this concludes the proof of De Morgan's law.

The other De Morgan's law,AB¯=A¯B¯{\displaystyle {\overline {A\cup B}}={\overline {A}}\cap {\overline {B}}}, is proven similarly.

Generalising De Morgan duality

[edit]
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 onclassical logic, namely the existence ofnegation 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 indigital circuit design, where it is used to manipulate the types oflogic gates, and in formal logic, where it is needed to find theconjunctive normal form anddisjunctive normal form of a formula. Computer programmers use them to simplify or properly negate complicatedlogical conditions. They are also often useful in computations in elementaryprobability theory.

Let one define the dual of any propositional operator P(p,q, ...) depending on elementary propositionsp,q, ... to be the operatorPd{\displaystyle {\mbox{P}}^{d}} defined by

Pd(p,q,...)=¬P(¬p,¬q,).{\displaystyle {\mbox{P}}^{d}(p,q,...)=\neg P(\neg p,\neg q,\dots ).}

Extension to predicate and modal logic

[edit]

This duality can be generalised to quantifiers, so for example theuniversal quantifier andexistential quantifier are duals:

xP(x)¬[x¬P(x)]{\displaystyle \forall x\,P(x)\equiv \neg [\exists x\,\neg P(x)]}
xP(x)¬[x¬P(x)]{\displaystyle \exists x\,P(x)\equiv \neg [\forall x\,\neg P(x)]}

To relate these quantifier dualities to the De Morgan laws, consider adomain of discourseD (with some small number of entities) to which properties are ascribed universally and existentially, such as

D = {a,b,c}.

Then express universal quantifier equivalently by conjunction of individual statements

xP(x)P(a)P(b)P(c){\displaystyle \forall x\,P(x)\equiv P(a)\land P(b)\land P(c)}

and existential quantifier by disjunction of individual statements

xP(x)P(a)P(b)P(c).{\displaystyle \exists x\,P(x)\equiv P(a)\lor P(b)\lor P(c).}

But, using De Morgan's laws,

P(a)P(b)P(c)¬(¬P(a)¬P(b)¬P(c)){\displaystyle P(a)\land P(b)\land P(c)\equiv \neg (\neg P(a)\lor \neg P(b)\lor \neg P(c))}

and

P(a)P(b)P(c)¬(¬P(a)¬P(b)¬P(c)),{\displaystyle P(a)\lor P(b)\lor P(c)\equiv \neg (\neg P(a)\land \neg P(b)\land \neg P(c)),}

verifying the quantifier dualities in the model.

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

p¬¬p,{\displaystyle \Box p\equiv \neg \Diamond \neg p,}
p¬¬p.{\displaystyle \Diamond p\equiv \neg \Box \neg p.}

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

In intuitionistic logic

[edit]

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

¬(PQ)((¬P)(¬Q)),{\displaystyle \neg (P\lor Q)\,\leftrightarrow \,{\big (}(\neg P)\land (\neg Q){\big )},}

and

((¬P)(¬Q))¬(PQ).{\displaystyle {\big (}(\neg P)\lor (\neg Q){\big )}\,\to \,\neg (P\land Q).}

The converse of the last implication does not hold in pure intuitionistic logic. That is, the failure of the joint propositionPQ{\displaystyle P\land Q} cannot necessarily be resolved to the failure of either of the twoconjuncts. 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 theweak excluded middleWPEM{\displaystyle {\mathrm {WPEM} }},

(¬P)¬(¬P).{\displaystyle (\neg P)\lor \neg (\neg P).}

This weak form can be used as a foundation for anintermediate logic.For a refined version of the failing law concerning existential statements, see thelesser limited principle of omniscienceLLPO{\displaystyle {\mathrm {LLPO} }}, which however is different fromWLPO{\displaystyle {\mathrm {WLPO} }}.

The validity of the other three De Morgan's laws remains true if negation¬P{\displaystyle \neg P} is replaced by implicationPC{\displaystyle P\to C} for some arbitrary constant predicate C, meaning that the above laws are still true inminimal logic.

Similarly to the above, the quantifier laws:

x¬P(x)¬xP(x){\displaystyle \forall x\,\neg P(x)\,\leftrightarrow \,\neg \exists x\,P(x)}

and

x¬P(x)¬xP(x).{\displaystyle \exists x\,\neg P(x)\,\to \,\neg \forall x\,P(x).}

are tautologies even in minimal logic with negation replaced with implying a fixedQ{\displaystyle Q}, while the converse of the last law does not have to be true in general.

Further, one still has

(PQ)¬((¬P)(¬Q)),{\displaystyle (P\lor Q)\,\to \,\neg {\big (}(\neg P)\land (\neg Q){\big )},}
(PQ)¬((¬P)(¬Q)),{\displaystyle (P\land Q)\,\to \,\neg {\big (}(\neg P)\lor (\neg Q){\big )},}
xP(x)¬x¬P(x),{\displaystyle \forall x\,P(x)\,\to \,\neg \exists x\,\neg P(x),}
xP(x)¬x¬P(x),{\displaystyle \exists x\,P(x)\,\to \,\neg \forall x\,\neg P(x),}

but their inversion impliesexcluded middle,PEM{\displaystyle {\mathrm {PEM} }}.

In computer engineering

[edit]
  • De Morgan's laws are widely used in computer engineering and digital logic for the purpose of simplifying circuit designs.[12]
  • In modern programming languages, compilers and interpreters use De Morgan's laws to optimize Boolean expressions. Therefore performance differences between logically equivalent expressions are usually negligible or completely absent.

See also

[edit]

References

[edit]
  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. ^Boolean Algebra by R. L. Goodstein.ISBN 0-486-45894-6
  6. ^2000 Solved Problems in Digital Electronics by S. P. Bali
  7. ^"DeMorgan's Theorems".Middle Tennessee State University. Archived fromthe original on 2008-03-23.
  8. ^Bocheński, I. M. (1961).A History of Formal Logic. Notre Dame, Indiana:University of Notre Dame Press. p. 207.LCCN 58014183.
  9. ^William of Ockham,Summa Logicae, part II, sections 32 and 33.
  10. ^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
  11. ^Robert H. Orr."Augustus De Morgan (1806–1871)".Indiana University–Purdue University Indianapolis. Archived fromthe original on 2010-07-15.
  12. ^Wirth, Niklaus (1995),Digital Circuit Design for Computer Science Students: An Introductory Textbook, Springer, p. 16,ISBN 9783540585770

External links

[edit]
General
Law of noncontradiction
Classical logics
Principles
Rules
Introduction
Elimination
People
Works
Overview
Venn diagram of set intersection
Axioms
Operations
  • Concepts
  • Methods
Set types
Theories
Set theorists
Retrieved from "https://en.wikipedia.org/w/index.php?title=De_Morgan%27s_laws&oldid=1317507965"
Categories:
Hidden categories:

[8]ページ先頭

©2009-2026 Movatter.jp