{
  "id": "de-morgans-laws",
  "title": "De Morgan’s Laws",
  "lang": "en",
  "source_lang": "en",
  "summary": "De Morgan’s laws describe how negation interchanges conjunction and disjunction, with corresponding identities for sets and quantified statements.",
  "category": "mathematics",
  "subcategory": "discrete-logic",
  "type": "concept",
  "aliases": [
    "De Morgan’s rules",
    "De Morgan’s theorems"
  ],
  "generated_at": "2026-10-04",
  "model": "pro/gpt-6.1-sol",
  "url": "https://aiwiki.page/en/de-morgans-laws/",
  "translations": {
    "zh-Hans": {
      "url": "https://aiwiki.page/zh/de-morgans-laws/",
      "json": "https://aiwiki.page/zh/de-morgans-laws.json"
    }
  },
  "sections": [
    {
      "heading": "",
      "text": "De Morgan’s laws are two fundamental equivalences in propositional logic and Boolean algebra: negating a conjunction produces a disjunction of negations, while negating a disjunction produces a conjunction of negations. They connect expressions involving “and,” “or,” and “not,” and have corresponding forms in set theory. Their name honors Augustus De Morgan, a nineteenth-century mathematician whose work contributed to the development of symbolic logic. (openstax.org)"
    },
    {
      "heading": "Logical formulation",
      "text": "For propositions \\(P\\) and \\(Q\\), the laws are\n\n\\[\\neg(P\\land Q)\\equiv(\\neg P\\lor\\neg Q),\\]\n\n\\[\\neg(P\\lor Q)\\equiv(\\neg P\\land\\neg Q).\\]\n\nHere \\(\\neg\\) denotes negation, \\(\\land\\) denotes conjunction, and \\(\\lor\\) denotes disjunction. The equivalence symbol means that both expressions have the same truth value under every assignment of truth values to their constituent propositions. The laws therefore permit replacement in either direction, not merely inference from left to right. (cs.cornell.edu)\n\nThe disjunction is inclusive: \\(P\\lor Q\\) is true when either proposition, or both, are true. It is not exclusive OR. Consequently, “not both” means that at least one proposition is false, whereas “neither” means that both are false. For example, negating “the door is locked and the window is closed” gives “the door is not locked or the window is not closed.” Negating the corresponding “or” statement gives “the door is not locked and the window is not closed.” (openstax.org)\n\nChanging only the connective, or only negating the components, does not implement either law. The outer negation must be removed while each component is negated and conjunction and disjunction are exchanged. (openstax.org)"
    },
    {
      "heading": "Verification and proof",
      "text": "In classical logic, a truth table provides a direct proof. There are four possible assignments to two propositions:\n\n\\(P\\) | \\(Q\\) | \\(\\neg(P\\land Q)\\) | \\(\\neg P\\lor\\neg Q\\) | \\(\\neg(P\\lor Q)\\) | \\(\\neg P\\land\\neg Q\\)\nT | T | F | F | F | F\nT | F | T | T | F | F\nF | T | T | T | F | F\nF | F | T | T | T | T\n\nThe matching columns establish both equivalences. Expressed as biconditionals, the laws are tautologies: they are true for every possible assignment, regardless of what \\(P\\) and \\(Q\\) describe. (openstax.org)\n\nRepeated application extends the laws to any finite list of propositions. Thus, negating “\\(P_1\\) and … and \\(P_n\\)” yields “not \\(P_1\\) or … or not \\(P_n\\).” Nested expressions can likewise be transformed one connective at a time; the grouping determines which subexpressions are negated at each step. (interactivetextbooks.tudelft.nl)"
    },
    {
      "heading": "Set-theoretic form",
      "text": "For subsets \\(A\\) and \\(B\\) of a fixed universe \\(U\\), let \\(A^c=U\\setminus A\\) denote the complement of \\(A\\). The set versions are\n\n\\[(A\\cup B)^c=A^c\\cap B^c, \\qquad (A\\cap B)^c=A^c\\cup B^c.\\]\n\nThe first states that being outside a union means being outside both sets. The second states that being outside an intersection means being outside at least one. The universe must remain fixed because complements are relative to it. (interactivetextbooks.tudelft.nl)\n\nThese identities follow by considering an arbitrary element \\(x\\in U\\). Membership in a union corresponds to disjunction, membership in an intersection corresponds to conjunction, and membership in a complement corresponds to negation. Applying the logical laws therefore proves equality of the relevant sets. (interactivetextbooks.tudelft.nl)"
    },
    {
      "heading": "Quantifiers",
      "text": "In first-order logic, related equivalences exchange universal and existential quantification:\n\n\\[\\neg\\forall x\\,P(x)\\equiv\\exists x\\,\\neg P(x),\\]\n\n\\[\\neg\\exists x\\,P(x)\\equiv\\forall x\\,\\neg P(x).\\]\n\nNegating “every object has property \\(P\\)” asserts the existence of a counterexample, not that every object lacks the property. Negating “some object has property \\(P\\)” asserts that no object has it. The domain of quantification remains unchanged during these transformations. (web.sas.upenn.edu)\n\nFor instance, “not every integer is even” becomes “there exists an integer that is not even.” With several quantifiers, negation moves inward successively, exchanging each universal quantifier with an existential quantifier and vice versa without reversing their order. (inf.ed.ac.uk)"
    },
    {
      "heading": "Computational applications",
      "text": "In computer science, De Morgan’s laws help transform formulas into negation normal form, where negations occur only immediately before atomic propositions. After other connectives have been eliminated, repeated application of the laws and double-negation elimination pushes negations inward. This is a preparatory step in converting formulas to conjunctive normal form. (comp.nus.edu.sg)\n\nIn digital electronics, the laws give equivalent descriptions of logic gates. A NAND operation is equivalent to OR applied to inverted inputs; a NOR operation is equivalent to AND applied to inverted inputs. These equivalences allow circuit designers to exchange gate forms and relocate inversions while preserving the Boolean function computed by the circuit. (ocw.mit.edu)"
    },
    {
      "heading": "Limits beyond classical logic",
      "text": "The two laws do not have identical status in intuitionistic logic. The equivalence\n\n\\[\\neg(P\\lor Q)\\leftrightarrow(\\neg P\\land\\neg Q)\\]\n\nremains valid, as does the implication\n\n\\[(\\neg P\\lor\\neg Q)\\rightarrow\\neg(P\\land Q).\\]\n\nHowever, \\(\\neg(P\\land Q)\\rightarrow(\\neg P\\lor\\neg Q)\\) is not generally derivable. Constructively, a proof that \\(P\\) and \\(Q\\) cannot both hold need not supply a proof identifying either one as false. Classical principles such as the law of excluded middle restore this missing direction; ordinary two-valued truth-table verification does not establish its intuitionistic validity. (cs.cornell.edu)"
    }
  ],
  "links": [
    "propositional-logic",
    "boolean-algebra",
    "set-theory",
    "augustus-de-morgan",
    "logic",
    "logical-negation",
    "logical-conjunction",
    "logical-disjunction",
    "exclusive-or",
    "classical-logic",
    "truth-table",
    "mathematical-proof",
    "tautology",
    "subset",
    "set-complement",
    "set-union",
    "set-intersection",
    "first-order-logic",
    "computer-science",
    "double-negation-elimination",
    "conjunctive-normal-form",
    "logic-gate",
    "intuitionistic-logic",
    "law-of-excluded-middle"
  ],
  "sources": [
    {
      "title": "openstax.org/books/contemporary-mathematics/pages/2-6-de-morgans-laws",
      "url": "https://openstax.org/books/contemporary-mathematics/pages/2-6-de-morgans-laws"
    },
    {
      "title": "cs.cornell.edu/courses/cs3110/2008fa/lectures/logic.html",
      "url": "https://www.cs.cornell.edu/courses/cs3110/2008fa/lectures/logic.html"
    },
    {
      "title": "interactivetextbooks.tudelft.nl/delftse-foundations-of-computation/content/sets…",
      "url": "https://interactivetextbooks.tudelft.nl/delftse-foundations-of-computation/content/sets/boolean-algebra.html"
    },
    {
      "title": "web.sas.upenn.edu/ancoop/2018/07/10/logic-quantifiers/",
      "url": "https://web.sas.upenn.edu/ancoop/2018/07/10/logic-quantifiers/"
    },
    {
      "title": "inf.ed.ac.uk/teaching/courses/dmmr/slides/13-14/Ch1b.pdf",
      "url": "https://www.inf.ed.ac.uk/teaching/courses/dmmr/slides/13-14/Ch1b.pdf"
    },
    {
      "title": "comp.nus.edu.sg/~cs3234/cs3234-tut02-sol.pdf",
      "url": "https://www.comp.nus.edu.sg/~cs3234/cs3234-tut02-sol.pdf"
    },
    {
      "title": "ocw.mit.edu/courses/6-004-computation-structures-spring-2017/pages/c4/c4s1/",
      "url": "https://ocw.mit.edu/courses/6-004-computation-structures-spring-2017/pages/c4/c4s1/"
    },
    {
      "title": "cs.cornell.edu/courses/cs3110/2018fa/lec/21-coq-logic/notes.html",
      "url": "https://www.cs.cornell.edu/courses/cs3110/2018fa/lec/21-coq-logic/notes.html"
    }
  ],
  "license": "https://creativecommons.org/licenses/by/4.0/"
}