Using set difference as an intersection with a complement of a set, and using double negation, givesInterchanging the two sets simply interchanges the two terms of this union, whose commutativity gives
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.
For the first set inclusion, take . Membership in the intersection gives and , while the set difference gives . Consequently .
For the reverse set inclusion, an element of belongs to both and and does not belong to . It therefore belongs to . By double inclusion proof,
Because , the set difference is empty and . Therefore the symmetric difference satisfiesThe disjoint sets and have union , so
Use the definition of symmetric difference. The algebraic laws for set difference and the empty set giveand
Using set difference as intersection with a complement of a set, then De Morgan's laws and distribution, givesFor 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 giveThe second step is De Morgan's laws; the third distributes set intersection over set union. The fourth uses .
By definition the symmetric difference is . Put and . Distribution of set intersection over set union givesFor disjoint sets, set difference removes nothing, so . ConsequentlyHere the second equality combines with ; the last uses .
We prove both set inclusions. If , then and . Since , the latter condition forces , giving . Conversely, if , then and , so . By set extensionality, the two sets are equal. This is a double inclusion proof; the implication involving the set difference uses membership in explicitly.
False. With the sets , and , both set differences are empty but . Removing loses the distinction between their memberships inside .
For the first set inclusion, take . By the definitions of set intersection and set difference, , and . Consequently and , so .
For the reverse set inclusion, take . Membership in the first set difference gives and , while membership in the second gives and . Thus and , proving . The two inclusions establish the required equality.
The set difference is the empty set. Its power set contains exactly one element, the empty set itself. Therefore the cardinality is , not zero.
Product automaton 2026-10-31
A deterministic finite automaton whose automaton state is a pair of automaton states of two given deterministic finite automata, updated componentwise by each input symbol. Choosing accepting pairs by a Boolean function on component acceptance realizes intersection, union, or set difference of the recognized regular languages.
Safe tuple relational calculus 2026-11-05
Safe tuple relational calculus restricts tuple relational calculus so that output values come from the finite input relations or explicit constants, with suitable restrictions on quantification. This prevents an apparently simple database query from demanding an infinite result over an unrestricted value universe. Database query safety is a semantic requirement; merely writing a familiar-looking formula does not ensure it.[ref]
Relational Model slides for Database System Concepts by Abraham Silberschatz and others. slides3.82 and3.86, Safety of Expressions
For a finite unary relation , the database query safely returns . In contrast, over all integers requests every other unary database tuple, an infinite collection. Restricting negation to tuples already drawn from another finite relation gives an expressible finite set difference. Under the usual finite relational model, the safe calculus and relational algebra express the same queries.
Set difference Created 2026-10-05 Updated 2026-10-14
The set difference keeps the set elements of that do not belong to :Thus set difference combines logical conjunction (AND) with logical negation (NOT): pass the first condition and fail the second. The definition applies to any two sets; need not be a subset of .
For and , the two orders give different answers:The common member is removed in both directions. A database filter illustrates the usefulness: if is the set of records matching the first condition and the set matching the second, selects records matching the first but not the second. The Venn diagram in set union shades both directions separately.
The name relative complement emphasizes that the ambient set is : is the complement of within . If a larger universal set contains and , then . Changing that larger universal set does not change the set difference, because membership still requires belonging to . In ZF the set difference exists by the axiom schema of separation. It also gives relative complements within a fixed tuple domain in finite relation closure for set-theoretic coding.
Set union Created 2026-09-24 Updated 2026-10-14
The union collects the set elements belonging to either set, including those belonging to both:Thus membership in a union uses logical disjunction (OR). For and , the union is : the shared member occurs only once, because a set records membership without repeated entries.
In this Venn diagram, belong only to , belongs to both sets, belongs only to , and belong to neither. The surrounding universal set is . Numbers are placed by membership; circle areas do not represent cardinalities. Each panel shades the region selected by its operation.
For a database illustration, let collect records matching one condition and collect records matching another. Their union selects records matching at least one condition, with a record satisfying both still appearing once. This interpretation turns an abstract operation into a reusable rule for combining selections. For an authored treatment of union, intersection, set difference, and complement, see Lehman, Leighton and Meyer, Mathematics for Computer Science (2015), Definition 4.1.1, pp. 82–83.
More generally, the union contains exactly the set elements belonging to at least one set :The existential quantification expresses “at least one”. With no indexing members, the union is the empty set. Combining a set with the empty set leaves it unchanged: .
Union and intersection of set families Created 2026-10-06 Updated 2026-10-14
For set families, and . These are families of distinct sets, rather than multisets indexed by pairs. The four functions theorem gives . Complementing one input family yields the analogous product bound for pairwise set differences.
Venn diagram 2026-10-14
A Venn diagram represents sets by closed curves, with each region recording a possible pattern of membership. For two sets, the regions mean “first only”, “both”, “second only”, and “neither”; the enclosing rectangle can represent the universal set. Shading regions displays union, intersection, set difference, or complement. In the numbered examples in set union and complement, positions encode membership, while curve shapes and region areas do not encode cardinalities.
