# 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, the complement operator being set complement, the bottom being ${\displaystyle \varnothing }$ and the top being the universe set under consideration.

## 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 properties of set algebra

The binary operations of set union (${\displaystyle \cup }$ ) and intersection (${\displaystyle \cap }$ ) satisfy many identities. Several of these identities or "laws" have well established names.

Commutative property:
• ${\displaystyle A\cup B=B\cup A}$
• ${\displaystyle A\cap B=B\cap A}$
Associative property:
• ${\displaystyle (A\cup B)\cup C=A\cup (B\cup C)}$
• ${\displaystyle (A\cap B)\cap C=A\cap (B\cap C)}$
Distributive property:
• ${\displaystyle A\cup (B\cap C)=(A\cup B)\cap (A\cup C)}$
• ${\displaystyle A\cap (B\cup C)=(A\cap B)\cup (A\cap C)}$

The union and intersection of sets may be seen as analogous to the addition and multiplication of numbers. Like addition and multiplication, the operations of union and intersection are commutative and associative, and intersection distributes over union. However, unlike addition and multiplication, union also distributes over intersection.

Two additional pairs of properties involve the special sets called the empty set Ø and the universe set ${\displaystyle U}$ ; together with the complement operator (${\displaystyle A^{C}}$  denotes the complement of ${\displaystyle A}$ . This can also be written as ${\displaystyle A^{'}}$ , read as A prime). The empty set has no members, and the universe set has all possible members (in a particular context).

Identity :
• ${\displaystyle A\cup \varnothing =A}$
• ${\displaystyle A\cap U=A}$
Complement :
• ${\displaystyle A\cup A^{C}=U}$
• ${\displaystyle A\cap A^{C}=\varnothing }$

The identity expressions (together with the commutative expressions) 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 formulae—the commutative, associative, distributive, identity and complement formulae—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 formulae are weakened to the rule ${\displaystyle (A^{C})^{C}=A}$ , 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 universe set U, the following identities hold:

idempotent laws:
• ${\displaystyle A\cup A=A}$
• ${\displaystyle A\cap A=A}$
domination laws:
• ${\displaystyle A\cup U=U}$
• ${\displaystyle A\cap \varnothing =\varnothing }$
absorption laws:
• ${\displaystyle A\cup (A\cap B)=A}$
• ${\displaystyle A\cap (A\cup B)=A}$

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:

 ${\displaystyle A\cup A}$ ${\displaystyle =(A\cup A)\cap U}$ by the identity law of intersection ${\displaystyle =(A\cup A)\cap (A\cup A^{C})}$ by the complement law for union ${\displaystyle =A\cup (A\cap A^{C})}$ by the distributive law of union over intersection ${\displaystyle =A\cup \varnothing }$ by the complement law for intersection ${\displaystyle =A}$ 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:

 ${\displaystyle A\cap A}$ ${\displaystyle =(A\cap A)\cup \varnothing }$ by the identity law for union ${\displaystyle =(A\cap A)\cup (A\cap A^{C})}$ by the complement law for intersection ${\displaystyle =A\cap (A\cup A^{C})}$ by the distributive law of intersection over union ${\displaystyle =A\cap U}$ by the complement law for union ${\displaystyle =A}$ by the identity law for intersection

Intersection can be expressed in terms of set difference :

${\displaystyle A\cap B=A\setminus (A\setminus B)}$

### Intersection and unions of arbitrary collections of sets

Let ${\displaystyle \left(S_{i,j}\right)_{(i,j)\in I\times J}}$  be a collection of sets.

• ${\displaystyle \cup _{i\in I}\left(\cap _{j\in J}S_{i,j}\right)\subseteq \cap _{j\in J}\left(\cup _{i\in I}S_{i,j}\right)}$
• ${\displaystyle \cup _{i\in I}\left(\cup _{j\in J}S_{i,j}\right)=\cup _{j\in J}\left(\cup _{i\in I}S_{i,j}\right)}$
• ${\displaystyle \cap _{i\in I}\left(\cap _{j\in J}S_{i,j}\right)=\cap _{j\in J}\left(\cap _{i\in I}S_{i,j}\right)}$
• ${\displaystyle \prod _{j\in J}\left(\cap _{i\in I}S_{i,j}\right)=\cap _{i\in I}\left(\prod _{j\in J}S_{i,j}\right)}$
• In particular, ${\displaystyle \left(\prod _{i\in I}A_{i}\right)\cap \left(\prod _{i\in I}B_{i}\right)=\prod _{i\in I}\left(A_{i}\cap B_{i}\right)}$
• ${\displaystyle A\cap \left(\cup _{i\in I}B_{i}\right)=\cup _{i\in I}\left(A\cap B_{i}\right)}$
• More generally, suppose that for each iI, Ji is some non-empty index set and for each jJi, Si,j is a set. Let ${\displaystyle {\mathcal {F}}}$  be the set of all functions f on I such that for each iI, f(i) ∈ Ji (note that if all Ji are equal to a set J then ${\displaystyle {\mathcal {F}}=J^{I}}$ ). Then
${\displaystyle \cap _{i\in I}\left[\cup _{j\in J_{i}}S_{i,j}\right]=\cup _{f\in {\mathcal {F}}}\left[\cap _{i\in I}S_{i,f(i)}\right]}$ .

## 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:
• ${\displaystyle (A\cup B)^{C}=A^{C}\cap B^{C}}$
• ${\displaystyle (A\cap B)^{C}=A^{C}\cup B^{C}}$
double complement or involution law:
• ${\displaystyle {(A^{C})}^{C}=A}$
complement laws for the universe set and the empty set:
• ${\displaystyle \varnothing ^{C}=U}$
• ${\displaystyle U^{C}=\varnothing }$

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 ${\displaystyle A\cup B=U}$ , and ${\displaystyle A\cap B=\varnothing }$ , then ${\displaystyle B=A^{C}}$

## 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:
• ${\displaystyle A\subseteq A}$
antisymmetry:
• ${\displaystyle A\subseteq B}$  and ${\displaystyle B\subseteq A}$  if and only if ${\displaystyle A=B}$
transitivity:
• If ${\displaystyle A\subseteq B}$  and ${\displaystyle B\subseteq C}$ , then ${\displaystyle A\subseteq C}$

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:
• ${\displaystyle \varnothing \subseteq A\subseteq S}$
existence of joins:
• ${\displaystyle A\subseteq A\cup B}$
• If ${\displaystyle A\subseteq C}$  and ${\displaystyle B\subseteq C}$ , then ${\displaystyle A\cup B\subseteq C}$
existence of meets:
• ${\displaystyle A\cap B\subseteq A}$
• If ${\displaystyle C\subseteq A}$  and ${\displaystyle C\subseteq B}$ , then ${\displaystyle C\subseteq A\cap B}$

The following proposition says that the statement ${\displaystyle A\subseteq B}$  is equivalent to various other statements involving unions, intersections and complements.

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

• ${\displaystyle A\subseteq B}$
• ${\displaystyle A\cap B=A}$
• ${\displaystyle A\cup B=B}$
• ${\displaystyle A\setminus B=\varnothing }$
• ${\displaystyle B^{C}\subseteq A^{C}}$

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:

• ${\displaystyle C\setminus (A\cap B)=(C\setminus A)\cup (C\setminus B)}$
• ${\displaystyle C\setminus (A\cup B)=(C\setminus A)\cap (C\setminus B)}$
• ${\displaystyle C\setminus (B\setminus A)=\left(C\cap A\right)\cup \left(C\setminus B\right)}$
• So if CB, then ${\displaystyle C\setminus (B\setminus A)=C\cap A}$
• ${\displaystyle (B\setminus A)\cap C=(B\cap C)\setminus A=B\cap (C\setminus A)}$
• ${\displaystyle (B\setminus A)\cup C=(B\cup C)\setminus (A\setminus C)}$
• ${\displaystyle (B\setminus A)\setminus C=B\setminus (A\cup C)}$
• ${\displaystyle \left(C\cup A\right)\setminus \left(B\setminus A\right)=\left(C\setminus B\right)\cup A}$
• ${\displaystyle A\setminus A=\varnothing }$
• ${\displaystyle \varnothing \setminus A=\varnothing }$
• ${\displaystyle A\setminus \varnothing =A}$
• ${\displaystyle B\setminus A=A^{C}\cap B}$
• ${\displaystyle (B\setminus A)^{C}=A\cup B^{C}}$
• ${\displaystyle U\setminus A=A^{C}}$
• ${\displaystyle A\setminus U=\varnothing }$

## Sets and maps

Throughout, f : XY will be a function between two sets, S, S2, and ${\displaystyle \left(S_{a}\right)_{a\in A}}$  will be subsets of X, and T, T2, and ${\displaystyle \left(T_{b}\right)_{b\in B}}$  will be subsets of Y, where we assume that A and B are not empty.

Recall that ${\displaystyle f^{-1}(T)=\{x\in X\,|\,f(x)\in T\}}$  denotes the preimage of ${\displaystyle T}$  under ${\displaystyle f}$ , and that S is said to be f-saturated or simply saturated if ${\displaystyle S=f^{-1}\left(f\left(S\right)\right)}$ .

### Images and preimages of unions and intersections

• ${\displaystyle f\left(\cap _{a\in A}S_{a}\right)\subseteq \cap _{a\in A}f\left(S_{a}\right)}$ .
• If all Sa are f-saturated then equality holds and ${\displaystyle \cap _{a\in A}S_{a}}$  be will be f-saturated.
• ${\displaystyle f\left(\cup _{a\in A}S_{a}\right)=\cup _{a\in A}f\left(S_{a}\right)}$ .
• ${\displaystyle f^{-1}\left(\cap _{b\in B}T_{b}\right)=\cap _{b\in B}f^{-1}\left(T_{b}\right)}$ .
• ${\displaystyle f^{-1}\left(\cup _{b\in B}T_{b}\right)=\cup _{b\in B}f^{-1}\left(T_{b}\right)}$ .

### Images and preimages

• ${\displaystyle f\left(f^{-1}\left(T\right)\right)\subseteq T}$  with equality if ${\displaystyle T\subseteq \operatorname {Im} f}$ , where ${\displaystyle \operatorname {Im} f}$  is the image of ${\displaystyle f}$  Thus:
• ${\displaystyle f\left(f^{-1}\left(T\right)\right)=T\cap \operatorname {Im} f}$ .
• ${\displaystyle f\left(f^{-1}\left(T\right)\cap S\right)=T\cap f\left(S\right)}$ .
• ${\displaystyle S\subseteq f^{-1}\left(f\left(S\right)\right)}$ .
• For equality to hold, it suffices for ${\displaystyle f}$  to be injective.
• ${\displaystyle f\left(f^{-1}\left(f\left(S\right)\right)\right)=S}$ .
• ${\displaystyle f^{-1}\left(f\left(f^{-1}\left(T\right)\right)\right)=T}$ .
• If ${\displaystyle T\subseteq \operatorname {Im} f}$  and ${\displaystyle T_{2}\subseteq Y}$ , then ${\displaystyle f^{-1}\left(T\right)\subseteq f^{-1}\left(T_{2}\right)}$  if and only if ${\displaystyle T\subseteq T_{2}}$ .

### Complements

• ${\displaystyle f^{-1}\left(T\setminus T_{2}\right)=f^{-1}\left(T\right)\setminus f^{-1}\left(T_{2}\right)}$ .
• ${\displaystyle f(S)\setminus f(S_{2})\subseteq f(S\setminus S_{2})}$  with equality if ${\displaystyle S_{2}=f^{-1}\left(f\left(S_{2}\right)\right)}$  (note that this condition depends entirely on S2 and not on S). Thus:
• ${\displaystyle X\setminus f^{-1}\left(T\right)=f^{-1}\left(Y\setminus T\right)}$ , or written differently, ${\displaystyle f^{-1}\left(T\right)^{\operatorname {C} }=f^{-1}\left(T^{\operatorname {C} }\right)}$ .
• If ${\displaystyle f}$  is surjective then ${\displaystyle Y\setminus f(S)\subseteq f(X\setminus S)}$  or written differently, ${\displaystyle f(S)^{\operatorname {C} }\subseteq f(S^{\operatorname {C} })}$ .

### Restrictions

If ${\displaystyle f{\big \vert }_{S}:S\to Y}$  is the restriction of f to S, then:

• ${\displaystyle \left(f{\big \vert }_{S}\right)^{-1}\left(T\right)=S\cap f^{-1}\left(T\right)}$ .

### Products

Let ${\displaystyle \left(Y_{b}\right)_{b\in B}}$  be a collection of sets and for each cB, let ${\displaystyle \pi _{c}:\prod _{b\in B}Y_{b}\to Y_{c}}$  denote the canonical projection onto Yc and let Fc : X → Yc be a map. Let ${\displaystyle F:=\left(F_{b}\right)_{b\in B}:X\to \prod _{b\in B}Y_{b}}$  be the unique map such that for all bB, ${\displaystyle \pi _{b}\circ F=F_{b}}$ .

• For any ${\displaystyle U\subseteq \prod _{b\in B}Y_{b}}$ , ${\displaystyle F^{-1}\left(U\right)\subseteq \prod _{b\in B}F_{b}^{-1}\left(\pi _{b}\left(U\right)\right)}$ .
• If there is a B-indexed collection of subsets UbYb such that ${\displaystyle U=\prod _{b\in B}U_{b}}$  then equality holds; that is, ${\displaystyle F^{-1}\left(\prod _{b\in B}U_{b}\right)=\prod _{b\in B}F_{b}^{-1}\left(U_{b}\right)}$ .

• Topological space — a subset of ${\displaystyle \wp (X)}$ , the power set of ${\displaystyle X}$ , closed with respect to arbitrary union, finite intersection and containing ${\displaystyle \emptyset }$  and ${\displaystyle X}$ .