De Morgan's laws
Encyclopedia : D : DE : DEM : De Morgan's laws
In logic, De Morgan's laws (or De Morgan's theorem) are rules in formal logic relating pairs of dual logical operators in a systematic manner expressed in terms of negation. The relationship so induced is called De Morgan duality.
To give some intuition, suppose P is true if and only if it is raining and Q is true if and only if you are wearing a raincoat. If you never go in the rain without a raincoat, then it can't be that P is true and Q is false. Thus, following formula is true:
- not(P and (not Q))
- It's not raining, so you don't care whether you're wearing a raincoat or not;
- You're wearing a raincoat, so you don't care whether it's raining or not.
- (not P) or Q
History and formulations
Augustus De Morgan originally observed that in classical propositional logic the following relationships hold:
- not (P and Q) = (not P) or (not Q)
- not (P or Q) = (not P) and (not Q)
In formal logic the laws are usually written
- [\neg(P\wedge Q)=(\neg P)\vee(\neg Q)]
- [\neg(P\vee Q)=(\neg P)\wedge(\neg Q)]
- [(A\cap B)^C=A^C\cup B^C]
- [(A\cup B)^C=A^C\cap B^C.]
Let us define the dual of any propositional operator P(p, q, ...) depending on elementary propositions p, q, ... to be
- [\neg \mbox^d(\neg p, \neg q, ...).]
- [ \forall x \, P(x) \equiv \neg \exists x \, \neg P(x), ]
- [ \exists x \, P(x) \equiv \neg \forall x \, \neg P(x). ]
- D = .
- [ \forall x \, P(x) \equiv P(a) \wedge P(b) \wedge P(c) ]
- [ \exists x \, P(x) \equiv P(a) \vee P(b) \vee P(c) ].
- [ P(a) \wedge P(b) \wedge P(c) \equiv \neg (\neg P(a) \vee \neg P(b) \vee \neg P(c)) ]
- [ P(a) \vee P(b) \vee P(c) \equiv \neg (\neg P(a) \wedge \neg P(b) \wedge \neg P(c)), ]
Then, the quantifier dualities can be extended further to modal logic, relating the box and diamond operators:
- [ \Box p \equiv \neg \Diamond \neg p ],
- [ \Diamond p \equiv \neg \Box \neg p ].
In the sense of computer science, in several languages (such as Java 1.5) De Morgan's laws can be simplified to:
- !(p && q) is the same as !p || !q
- !(p || q) is the same as !p && !q
Quotes
- The contradictory opposite of a disjunctive proposition is a conjunctive proposition composed of the contradictories of the parts of the disjunctive proposition (William of Ockham, Summa Logicae).
See also
External links
- , [de Morgan's Laws] at MathWorld.
- This article incorporates material from on PlanetMath, which is licensed under the [Text of the GNU Free Documentation LicenseGFDL].
From Wikipedia, the Free Encyclopedia. Original article here. Support Wikipedia by contributing or donating.
All text is available under the terms of the GNU Free Documentation License See Wikipedia Copyrights for details.
