Write for a two-input NAND gate. Three elementary constructions are
The last identity is De Morgan's laws. To see that these operations suffice from first principles, take any finite truth table. For each row whose output is , form the conjunction of input literals that matches exactly that row: use when the row has , and when it has . Disjoin all such conjunctions. On any input, precisely its matching row conjunction can be true, so this disjunctive normal form equals the desired Boolean function.
Replace each negation, conjunction and disjunction by the displayed NAND gate constructions, nesting two-input gates for longer conjunctions or disjunctions. Constant outputs are available too: for any input , , and NANDing that value with itself gives . Thus
A zero-input constant circuit additionally needs a supplied constant signal, such as a fixed logic supply. The positive-arity construction already covers constant-valued Boolean functions having one or more unused inputs.
For a three-input CMOS NAND gate, put three PMOS transistors in parallel from the positive supply to the output , and three NMOS transistors in series from to ground. Each input controls one device in each network:
Figure 1.
Three-input CMOS NAND: parallel PMOS pull-up paths and a series NMOS pull-down path
. Details.
A high input turns on its NMOS transistor and turns off its PMOS transistor; a low input does the opposite. If , every series NMOS transistor conducts and every PMOS transistor is off, pulling low. If any input is zero, its NMOS transistor breaks the series path and its PMOS transistor provides a path to , pulling high. Consequently
For ideal settled inputs, the complementary networks do not simultaneously connect supply to ground. The CMOS arrangement gives a driven high or low output in every input case, rather than leaving the output floating.
Temporarily deny the desired logical disjunction. If held, it would introduce that very logical disjunction, producing logical falsity; double-negation elimination therefore gives . The same argument gives , contradicting the premise. The complete natural deduction derivation is:
Consequently
The uses of double-negation elimination are justified by the supplied rules. This distinguishes the proof from the preceding constructive direction of De Morgan's laws.
Write each set difference as an intersection with a complement of a set. Applying De Morgan's laws and then the distributive property gives
The complements turn the inner union into an intersection and vice versa. Thus
Use De Morgan's laws to remove the complement of a set, then distribute the two unions:
The first and last intersections in the middle line are the empty set. The remaining union is precisely the collection of elements belonging to exactly one of the original sets. Therefore both expressions define the same symmetric difference:
By De Morgan's laws, taking a set difference from a union requires exclusion from both sets, while taking a set difference from an intersection requires exclusion from at least one:
For example, belongs to the first left-hand side precisely when , and ; these are exactly the membership conditions on the first right-hand side. For the second identity, replace the two exclusions by their logical disjunction.
Prove both identities by mathematical induction. The base case is the two-set form of De Morgan's laws. For the union identity, suppose the result holds for . Applying the two-set identity and then the inductive hypothesis gives
For the intersection identity, the corresponding step is
These close the two inductions.
Apply the two identities already proved with . Every is a subset of the common universe, and a complement is the set difference from that universe. Therefore
Replacing each set difference from by its complement notation gives the claimed finite forms of De Morgan's laws.
Use proof by contradiction, expanding the final classical step explicitly into negation introduction followed by double-negation elimination. First the assumption forces : otherwise immediately gives the prohibited logical disjunction. It similarly forces . The formal natural deduction derivation is
Hence
This direction of De Morgan's laws uses the classical rule supplied on the source rule sheet; it has not been silently treated as an available inference rule.
Each parenthesized pair in the given Boolean function tests equality of two input bits:
This is logical equivalence, or the two-input XNOR gate function. Thus is one whenever either input pair agrees. Generate the four complemented inputs with four inverters, and define the following NAND gate outputs:
Feed these four outputs into a single four-input NAND gate. De Morgan's laws give
Here juxtaposition denotes logical conjunction. The construction uses only inverters, two-input NAND gates and one four-input NAND gate, as required.
Every complement of a set is taken in the same universal set . Apply De Morgan's laws for propositional logic to the membership propositions. For every ,
Equality of membership for every element proves the set identities
Take every complement of a set relative to . By set difference, De Morgan's laws, and distribution of set intersection over set union,
Here the middle term is the empty set, since a set and its complement of a set are disjoint.
Using set difference as intersection with a complement of a set, then De Morgan's laws and distribution, gives
For the third equality, expand the two set unions: the terms and are absorbed by , and . This proves the required identity entirely by set algebra.
Write . The rules for set difference, set intersection, and complement of a set give
The second step is De Morgan's laws; the third distributes set intersection over set union. The fourth uses .
Derive each negated component in its own subproof, then combine them. Assumption lines below begin local scopes; the listed discharge ranges close those scopes.
LineFormulaJustification
1Premise
2Assume locally
3Disjunction introduction rule, left, 2
4Negation elimination rule, 1 and 3
5Negation introduction rule, discharging 2–4
6Assume locally
7Disjunction introduction rule, right, 6
8Negation elimination rule, 1 and 7
9Negation introduction rule, discharging 6–8
10Conjunction introduction rule, 5 and 9
Only the original premise remains open. No classical principle is needed for this direction of De Morgan's laws.
The supplied double-negation elimination rule provides the classical step needed to recover each positive component:
LineFormulaJustification
1Premise
2Assume locally
3Disjunction introduction rule, left, 2
4Negation elimination rule, 1 and 3
5Negation introduction rule, discharging 2–4
6Double-negation elimination, 5
7Assume locally
8Disjunction introduction rule, right, 7
9Negation elimination rule, 1 and 8
10Negation introduction rule, discharging 7–9
11Double-negation elimination, 10
12Conjunction introduction rule, 6 and 11
Both local negated assumptions have been discharged. The proof establishes the positive conjunction without assuming an unproved derived version of De Morgan's laws.
The printed expression has one unmatched closing parenthesis. Remove that final surplus parenthesis and read the first disjunct as ; the other disjunct has outer universal quantification over the displayed implication. To distinguish the two independent bound uses of , rename the first to .
Push the outer negation through the logical disjunction and through the quantifiers. Negating the implication preserves its existential antecedent and negates its consequent. Applying De Morgan's laws and the quantifier negation rules gives the negation normal form
Each negation is now directly before an atomic formula. No bound variable has been captured, and no original existential quantification in the antecedent has accidentally been negated twice.
Eliminate the logical implication and apply De Morgan's laws:
This is disjunctive normal form: a logical disjunction of conjunctions of literals. It has four literal occurrences, namely , meeting the stated bound.
Simultaneous propositional substitution gives
Let . The first disjunct equals . By De Morgan's laws, implies , so absorption reduces that first disjunct to . The second disjunct is and is also absorbed by . Therefore
The resulting Boolean function is false only when both and are true, providing a four-row truth table check.
Assume the logical conjunction temporarily, then eliminate the premise's logical disjunction by cases. A natural deduction proof, with each indented assumption delimiting its own subproof, is:
1.  not P or not Q                    premise
2.  | P and Q                        temporary assumption
3.  | P                              and-elim-L, 2
4.  | Q                              and-elim-R, 2
5.  | | not P                        first disjunction case
6.  | | false                        not-elim, 3,5
7.  | | not Q                        second disjunction case
8.  | | false                        not-elim, 4,7
9.  | false                          or-elim, 1, cases 5-6 and 7-8
10. not (P and Q)                     not-intro, discharge 2-9
Lines 5–6 and 7–8 are separate sibling subproofs, not one nested inside the other. Both derive the same contradiction under the common assumption on line 2. Logical disjunction elimination discharges the two case assumptions, and negation introduction then discharges the logical conjunction assumption. The sole undischarged premise is the required one. This proof uses only the supplied logical conjunction, logical disjunction and negation rules; no converse form of De Morgan's laws is being assumed as an extra rule.