# Algebra of sets

The algebra of sets defines the properties and laws of sets, the set-theoretic operations of union, intersection, and complementation and the relations of set equality and set inclusion. It also provides systematic procedures for evaluating expressions, and performing calculations, involving these operations and relations.

Any set of sets closed under the set-theoretic operations forms a Boolean algebra with the join operator being union, the meet operator being intersection, and the complement operator being set complement.

## Fundamentals

The algebra of sets is the set-theoretic analogue of the algebra of numbers. Just as arithmetic addition and multiplication are associative and commutative, so are set union and intersection; just as the arithmetic relation "less than or equal" is reflexive, antisymmetric and transitive, so is the set relation of "subset".

It is the algebra of the set-theoretic operations of union, intersection and complementation, and the relations of equality and inclusion. For a basic introduction to sets see the article on sets, for a fuller account see naive set theory, and for a full rigorous axiomatic treatment see axiomatic set theory.

## The fundamental laws of set algebra

The binary operations of set union ([itex]\cup[/itex]) and intersection ([itex]\cap[/itex]) satisfy many identities. Several of these identities or "laws" have well established names.

Commutative laws:
• [itex]A \cup B = B \cup A\,\![/itex]
• [itex]A \cap B = B \cap A\,\![/itex]
Associative laws:
• [itex](A \cup B) \cup C = A \cup (B \cup C)\,\![/itex]
• [itex](A \cap B) \cap C = A \cap (B \cap C)\,\![/itex]
Distributive laws:
• [itex]A \cup (B \cap C) = (A \cup B) \cap (A \cup C)\,\![/itex]
• [itex]A \cap (B \cup C) = (A \cap B) \cup (A \cap C)\,\![/itex]

The analogy between unions and intersections of sets, and addition and multiplication of numbers, is quite striking. Like addition and multiplication, the operations of union and intersection are commutative and associative, and intersection distributes over unions. However, unlike addition and multiplication, union also distributes over intersection.

Two additional pairs of laws involve the special sets called the empty set Ø and the universal set [itex]U[/itex]; together with the complement operator (AC denotes the complement of A). The empty set has no members, and the universal set has all possible members (in a particular context).

Identity laws:
• [itex]A \cup \varnothing = A\,\![/itex]
• [itex]A \cap U = A\,\![/itex]
Complement laws:
• [itex]A \cup A^C = U\,\![/itex]
• [itex]A \cap A^C = \varnothing\,\![/itex]

The identity laws (together with the commutative laws) say that, just like 0 and 1 for addition and multiplication, Ø and U are the identity elements for union and intersection, respectively.

Unlike addition and multiplication, union and intersection do not have inverse elements. However the complement laws give the fundamental properties of the somewhat inverse-like unary operation of set complementation.

The preceding five pairs of laws—the commutative, associative, distributive, identity and complement laws—encompass all of set algebra, in the sense that every valid proposition in the algebra of sets can be derived from them.

Note that if the complement laws are weakened to the rule [itex] (A^C)^C = A [/itex], then this is exactly the algebra of propositional linear logic[clarification needed].

## The principle of duality

Each of the identities stated above is one of a pair of identities such that each can be transformed into the other by interchanging ∪ and ∩, and also Ø and U.

These are examples of an extremely important and powerful property of set algebra, namely, the principle of duality for sets, which asserts that for any true statement about sets, the dual statement obtained by interchanging unions and intersections, interchanging U and Ø and reversing inclusions is also true. A statement is said to be self-dual if it is equal to its own dual.

## Some additional laws for unions and intersections

The following proposition states six more important laws of set algebra, involving unions and intersections.

PROPOSITION 3: For any subsets A and B of a universal set U, the following identities hold:

idempotent laws:
• [itex]A \cup A = A\,\![/itex]
• [itex]A \cap A = A\,\![/itex]
domination laws:
• [itex]A \cup U = U\,\![/itex]
• [itex]A \cap \varnothing = \varnothing\,\![/itex]
absorption laws:
• [itex]A \cup (A \cap B) = A\,\![/itex]
• [itex]A \cap (A \cup B) = A\,\![/itex]

As noted above, each of the laws stated in proposition 3 can be derived from the five fundamental pairs of laws stated above. As an illustration, a proof is given below for the idempotent law for union.

Proof:

 [itex]A \cup A\,\![/itex] [itex]=(A \cup A) \cap U\,\![/itex] by the identity law of intersection [itex]=(A \cup A) \cap (A \cup A^C)\,\![/itex] by the complement law for union [itex]=A \cup (A \cap A^C)\,\![/itex] by the distributive law of union over intersection [itex]=A \cup \varnothing\,\![/itex] by the complement law for intersection [itex]=A\,\![/itex] by the identity law for union

The following proof illustrates that the dual of the above proof is the proof of the dual of the idempotent law for union, namely the idempotent law for intersection.

Proof:

 [itex]A \cap A\,\![/itex] [itex]=(A \cap A) \cup \varnothing[/itex] by the identity law for union [itex]=(A \cap A) \cup (A \cap A^C)\,\![/itex] by the complement law for intersection [itex]=A \cap (A \cup A^C)\,\![/itex] by the distributive law of intersection over union [itex]=A \cap U\,\![/itex] by the complement law for union [itex]=A\,\![/itex] by the identity law for intersection

Intersection can be expressed in terms of set difference :

[itex]A \cap B\,\! = A \smallsetminus (A \smallsetminus B) [/itex]

## Some additional laws for complements

The following proposition states five more important laws of set algebra, involving complements.

PROPOSITION 4: Let A and B be subsets of a universe U, then:

De Morgan's laws:
• [itex](A \cup B)^C = A^C \cap B^C\,\![/itex]
• [itex](A \cap B)^C = A^C \cup B^C\,\![/itex]
double complement or Involution law:
• [itex]{(A^{C})}^{C} = A\,\![/itex]
complement laws for the universal set and the empty set:
• [itex]\varnothing^C = U[/itex]
• [itex]U^C = \varnothing[/itex]

Notice that the double complement law is self-dual.

The next proposition, which is also self-dual, says that the complement of a set is the only set that satisfies the complement laws. In other words, complementation is characterized by the complement laws.

PROPOSITION 5: Let A and B be subsets of a universe U, then:

uniqueness of complements:
• If [itex]A \cup B = U\,\![/itex], and [itex]A \cap B = \varnothing\,\![/itex], then [itex]B = A^C\,\![/itex]

## The algebra of inclusion

The following proposition says that inclusion, that is the binary relation of one set being a subset of another, is a partial order.

PROPOSITION 6: If A, B and C are sets then the following hold:

reflexivity:
• [itex]A \subseteq A\,\![/itex]
antisymmetry:
• [itex]A \subseteq B\,\![/itex] and [itex]B \subseteq A\,\![/itex] if and only if [itex]A = B\,\![/itex]
transitivity:
• If [itex]A \subseteq B\,\![/itex] and [itex]B \subseteq C\,\![/itex], then [itex]A \subseteq C\,\![/itex]

The following proposition says that for any set S, the power set of S, ordered by inclusion, is a bounded lattice, and hence together with the distributive and complement laws above, show that it is a Boolean algebra.

PROPOSITION 7: If A, B and C are subsets of a set S then the following hold:

existence of a least element and a greatest element:
• [itex]\varnothing \subseteq A \subseteq S\,\![/itex]
existence of joins:
• [itex]A \subseteq A \cup B\,\![/itex]
• If [itex]A \subseteq C\,\![/itex] and [itex]B \subseteq C\,\![/itex], then [itex]A \cup B \subseteq C\,\![/itex]
existence of meets:
• [itex]A \cap B \subseteq A\,\![/itex]
• If [itex]C \subseteq A\,\![/itex] and [itex]C \subseteq B\,\![/itex], then [itex]C \subseteq A \cap B\,\![/itex]

The following proposition says that the statement [itex]A \subseteq B\,\![/itex] is equivalent to various other statements involving unions, intersections and complements.

PROPOSITION 8: For any two sets A and B, the following are equivalent:

• [itex]A \subseteq B\,\![/itex]
• [itex]A \cap B = A\,\![/itex]
• [itex]A \cup B = B\,\![/itex]
• [itex]A \smallsetminus B = \varnothing[/itex]
• [itex]B^C \subseteq A^C[/itex]

The above proposition shows that the relation of set inclusion can be characterized by either of the operations of set union or set intersection, which means that the notion of set inclusion is axiomatically superfluous.

## The algebra of relative complements

The following proposition lists several identities concerning relative complements and set-theoretic differences.

PROPOSITION 9: For any universe U and subsets A, B, and C of U, the following identities hold:

• [itex]C \setminus (A \cap B) = (C \setminus A) \cup (C \setminus B)\,\![/itex]
• [itex]C \setminus (A \cup B) = (C \setminus A) \cap (C \setminus B)\,\![/itex]
• [itex]C \setminus (B \setminus A) = (A \cap C)\cup(C \setminus B)\,\![/itex]
• [itex](B \setminus A) \cap C = (B \cap C) \setminus A = B \cap (C \setminus A)\,\![/itex]
• [itex](B \setminus A) \cup C = (B \cup C) \setminus (A \setminus C)\,\![/itex]
• [itex]A \setminus A = \varnothing\,\![/itex]
• [itex]\varnothing \setminus A = \varnothing\,\![/itex]
• [itex]A \setminus \varnothing = A\,\![/itex]
• [itex]B \setminus A = A^C \cap B\,\![/itex]
• [itex](B \setminus A)^C = A \cup B^C\,\![/itex]
• [itex]U \setminus A = A^C\,\![/itex]
• [itex]A \setminus U = \varnothing\,\![/itex]