De Morgan's laws Created 2026-09-28 Updated 2026-10-14
De Morgan's laws exchange logical conjunction and logical disjunction when a logical negation moves across them:Here denotes logical equivalence: the two propositional formulas agree under every Boolean valuation.[ref]
3.1 Propositional Logic. Discrete Mathematics: An Open Introduction (3rd edition) by Oscar Levin; Discrete Mathematics: An Open Introduction, 3rd edition by Oscar Levin, §3.1, Logical Equivalence: definition, Example 3.1.3 and De Morgan's Laws box
A complete verification uses the four rows of a truth table. In input order , both sides of the first logical equivalence have output sequence ; both sides of the second have . A proof in words is equally short: failure of “both” means at least one failure, whereas failure of “at least one” means both fail. The differing middle rows explain why simply pushing logical negation inward without changing AND to OR is wrong.
For the events in Boolean operations on events, the corresponding set identities areOne can prove these identities by checking an arbitrary set element : its two membership truth values obey De Morgan's laws. The same reasoning works for any two subsets of a common universal set.
De Morgan's laws shade the same set whether a compound event is complemented first or its component events are complemented first
. Details. For a nested program test, let mean “backup recent”, mean “backup verified”, and mean “manual override authorized”. Rejecting when neither an acceptable backup nor an override is present givesThe transformed condition reads “backup stale or unverified, and no override”. Apply the second of De Morgan's laws at the outside, then the first at the inner logical conjunction. For it rejects; changing only to one makes it accept. With Boolean operands in Python,
not ((recent and verified) or override) and ((not recent) or (not verified)) and (not override) have the same result and inspect the operands in the same order, with the same skipped operands. Negation Created 2026-09-24 Updated 2026-10-14
Logical negation exchanges zero and one: and . For a numerical bit , this is ; applying logical negation twice restores . It acts on the entire propositional formula in its scope. Parentheses therefore matter: says that neither condition holds, while also accepts every case where holds. At their values are zero and one.
On a set, logical negation becomes taking a complement in a fixed universal set. In Boolean operations on events, “not even” selects . “Not both even and at least four” selects ; it does not require both qualifications to fail. De Morgan's laws make the scope of these compound negations precise.
