List of set identities and relations

This article lists mathematical properties and laws of sets, involving 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.

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

Notation
Throughout this article, capital letters (such as $$A, B, C, L, M, R, S,$$ and $$X$$) will denote sets. On the left hand side of an identity, typically, This is to facilitate applying identities to expressions that are complicated or use the same symbols as the identity. For example, the identity $$(L \,\setminus\, M) \,\setminus\, R ~=~ (L \,\setminus\, R) \,\setminus\, (M \,\setminus\, R)$$ may be read as: $$(\text{Left set} \,\setminus\, \text{Middle set}) \,\setminus\, \text{Right set} ~=~ (\text{Left set} \,\setminus\, \text{Right set}) \,\setminus\, (\text{Middle set} \,\setminus\, \text{Right set}).$$
 * $$L$$ will be the eft most set,
 * $$M$$ will be the iddle set, and
 * $$R$$ will be the ight most set.

Elementary set operations
For sets $$L$$ and $$R,$$ define: $$\begin{alignat}{4} L \cup R     &&~\stackrel{\scriptscriptstyle\text{def}}{=}~ \{~ x ~:~ x \in L \;&&\text{ or }\;\, &&\; x \in R ~\} \\ L \cap R     &&~\stackrel{\scriptscriptstyle\text{def}}{=}~ \{~ x ~:~ x \in L \;&&\text{ and }    &&\; x \in R ~\} \\ L \setminus R &&~\stackrel{\scriptscriptstyle\text{def}}{=}~ \{~ x ~:~ x \in L \;&&\text{ and }   &&\; x \notin R ~\} \\ \end{alignat}$$ and $$L \triangle R ~\stackrel{\scriptscriptstyle\text{def}}{=}~ \{~ x ~:~ x \text{ belongs to exactly one of } L \text{ and } R ~\}$$ where the $$L \triangle R$$ is sometimes denoted by $$L \ominus R$$ and equals: $$\begin{alignat}{4} L \;\triangle\; R ~&=~ (L ~\setminus~ &&R) ~\cup~     &&(R ~\setminus~ &&L) \\ ~&=~ (L ~\cup~     &&R) ~\setminus~ &&(L ~\cap~      &&R). \end{alignat}$$

One set $$L$$ is said to another set $$R$$ if $$L \cap R \neq \varnothing.$$ Sets that do not intersect are said to be.

The power set of $$X$$ is the set of all subsets of $$X$$ and will be denoted by $$\wp(X) ~\stackrel{\scriptscriptstyle\text{def}}{=}~ \{~ L ~:~ L \subseteq X ~\}.$$

Universe set and complement notation

The notation $$L^\complement ~\stackrel{\scriptscriptstyle\text{def}}{=}~ X \setminus L.$$ may be used if $$L$$ is a subset of some set $$X$$ that is understood (say from context, or because it is clearly stated what the superset $$X$$ is). It is emphasized that the definition of $$L^\complement$$ depends on context. For instance, had $$L$$ been declared as a subset of $$Y,$$ with the sets $$Y$$ and $$X$$ not necessarily related to each other in any way, then $$L^\complement$$ would likely mean $$Y \setminus L$$ instead of $$X \setminus L.$$

If it is needed then unless indicated otherwise, it should be assumed that $$X$$ denotes the universe set, which means that all sets that are used in the formula are subsets of $$X.$$ In particular, the complement of a set $$L$$ will be denoted by $$L^\complement$$ where unless indicated otherwise, it should be assumed that $$L^\complement$$ denotes the complement of $$L$$ in (the universe) $$X.$$

One subset involved
Assume $$L \subseteq X.$$

Identity:

Definition: $$e$$ is called a left identity element of a binary operator $$\,\ast\,$$ if $$e \,\ast\, R = R$$ for all $$R$$ and it is called a right identity element of $$\,\ast\,$$ if $$L \,\ast\, e = L$$ for all $$L.$$ A left identity element that is also a right identity element if called an identity element.

The empty set $$\varnothing$$ is an identity element of binary union $$\cup$$ and symmetric difference $$\triangle,$$ and it is also a right identity element of set subtraction $$\, \setminus:$$

$$\begin{alignat}{10} L \cap X                 &\;=\;&& L &\;=\;&  X \cap L                  ~\text{ where } L \subseteq X \\[1.4ex] L \cup \varnothing       &\;=\;&& L &\;=\;& \varnothing \cup L        \\[1.4ex] L \,\triangle \varnothing &\;=\;&& L &\;=\;& \varnothing \,\triangle L \\[1.4ex] L \setminus \varnothing  &\;=\;&& L \\[1.4ex] \end{alignat}$$ but $$\varnothing$$ is not a left identity element of $$\, \setminus \,$$ since $$\varnothing \setminus L = \varnothing$$ so $\varnothing \setminus L = L$ if and only if $$L = \varnothing.$$

Idempotence $$L \ast L = L$$ and Nilpotence $$L \ast L = \varnothing$$:

$$\begin{alignat}{10} L \cup L                 &\;=\;&& L            && \quad \text{ (Idempotence)} \\[1.4ex] L \cap L                 &\;=\;&& L            && \quad \text{ (Idempotence)} \\[1.4ex] L \,\triangle\, L        &\;=\;&& \varnothing  && \quad \text{ (Nilpotence of index 2)} \\[1.4ex] L \setminus L            &\;=\;&& \varnothing  && \quad \text{ (Nilpotence of index 2)} \\[1.4ex] \end{alignat}$$

Domination/Absorbing element:

Definition: $$z$$ is called a left absorbing element of a binary operator $$\,\ast\,$$ if $$z \,\ast\, R = z$$ for all $$R$$ and it is called a right absorbing element of $$\,\ast\,$$ if $$L \,\ast\, z = z$$ for all $$L.$$ A left absorbing element that is also a right absorbing element if called an absorbing element. Absorbing elements are also sometime called annihilating elements or zero elements.

A universe set is an absorbing element of binary union $$\cup.$$ The empty set $$\varnothing$$ is an absorbing element of binary intersection $$\cap$$ and binary Cartesian product $$\times,$$ and it is also a left absorbing element of set subtraction $$\, \setminus:$$

$$\begin{alignat}{10} X \cup L                 &\;=\;&& X           &\;=\;& L \cup X ~\text{ where } L \subseteq X \\[1.4ex] \varnothing \cap L       &\;=\;&& \varnothing &\;=\;& L \cap \varnothing  \\[1.4ex] \varnothing \times L     &\;=\;&& \varnothing &\;=\;& L \times \varnothing \\[1.4ex] \varnothing \setminus L  &\;=\;&& \varnothing &\;\;& \\[1.4ex] \end{alignat}$$ but $$\varnothing$$ is not a right absorbing element of set subtraction since $$L \setminus \varnothing = L$$ where $L \setminus \varnothing = \varnothing$ if and only if $L = \varnothing.$

Double complement or involution law:

$$\begin{alignat}{10} X \setminus (X \setminus L) &= L &&\qquad\text{ Also written }\quad &&\left(L^\complement\right)^\complement = L &&\quad&&\text{ where } L \subseteq X \quad \text{ (Double complement/Involution law)} \\[1.4ex] \end{alignat}$$

$$L \setminus \varnothing = L$$ $$\begin{alignat}{4} \varnothing &= L          &&\setminus L \\ &= \varnothing &&\setminus L \\ &= L          &&\setminus X ~\text{ where } L \subseteq X \\ \end{alignat}$$

$$L^\complement = X \setminus L \quad \text{ (definition of notation)}$$

$$\begin{alignat}{10} L \,\cup (X \setminus L) &= X &&\qquad\text{ Also written }\quad &&L \cup L^\complement = X &&\quad&&\text{ where } L \subseteq X \\[1.4ex]

L \,\triangle (X \setminus L) &= X &&\qquad\text{ Also written }\quad &&L \,\triangle L^\complement = X &&\quad&&\text{ where } L \subseteq X \\[1.4ex]

L \,\cap (X \setminus L) &= \varnothing &&\qquad\text{ Also written }\quad &&L \cap L^\complement = \varnothing &&\quad&& \\[1.4ex] \end{alignat}$$

$$\begin{alignat}{10} X \setminus \varnothing &= X &&\qquad\text{ Also written }\quad &&\varnothing^\complement = X &&\quad&&\text{ (Complement laws for the empty set))} \\[1.4ex]

X \setminus X &= \varnothing &&\qquad\text{ Also written }\quad &&X^\complement = \varnothing &&\quad&&\text{ (Complement laws for the universe set)} \\[1.4ex] \end{alignat}$$

Two sets involved
In the left hand sides of the following identities, $$L$$ is the eft most set and $$R$$ is the ight most set. Assume both $$L \text{ and } R$$ are subsets of some universe set $$X.$$

Formulas for binary set operations ⋂, ⋃, \, and ∆
In the left hand sides of the following identities, $$L$$ is the eft most set and $$R$$ is the ight most set. Whenever necessary, both $$L \text{ and } R$$ should be assumed to be subsets of some universe set $$X,$$ so that $$L^\complement := X \setminus L \text{ and } R^\complement := X \setminus R.$$

$$\begin{alignat}{9} L \cap R &= L &&\,\,\setminus\,  &&(L &&\,\,\setminus &&R) \\ &= R &&\,\,\setminus\,  &&(R &&\,\,\setminus &&L) \\ &= L &&\,\,\setminus\,  &&(L &&\,\triangle\, &&R) \\ &= L &&\,\triangle\,    &&(L &&\,\,\setminus &&R) \\ \end{alignat}$$

$$\begin{alignat}{9} L \cup R &= (&&L \,\triangle\, R) &&\,\,\cup     && &&L &&       &&  \\ &= (&&L \,\triangle\, R) &&\,\triangle\, &&(&&L &&\cap\, &&R) \\ &= (&&R \,\setminus\, L) &&\,\,\cup     && &&L &&       &&    \text{ (union is disjoint)} \\ \end{alignat}$$

$$\begin{alignat}{9} L \,\triangle\, R &= &&R \,\triangle\, L    &&                  && &&                     && \\ &= (&&L \,\cup\, R)       &&\,\setminus\,     &&(&&L \,\,\cap\, R)      && \\ &= (&&L \,\setminus\, R)  &&\cup\,            &&(&&R \,\,\setminus\, L) && \text{ (union is disjoint)} \\ &= (&&L \,\triangle\, M)  &&\,\triangle\,     &&(&&M \,\triangle\, R)   && \text{ where } M \text{ is an arbitrary set. } \\ &= (&&L^\complement)                &&\,\triangle\,     &&(&&R^\complement)                 && \\ \end{alignat}$$

$$\begin{alignat}{9} L \setminus R &=  &&L                   &&\,\,\setminus     &&(L &&\,\,\cap       &&R) \\ &=  &&L                   &&\,\,\cap          &&(L &&\,\triangle\,  &&R) \\ &=  &&L                   &&\,\triangle\,     &&(L &&\,\,\cap       &&R) \\ &=  &&R                   &&\,\triangle\,     &&(L &&\,\,\cup       &&R) \\ \end{alignat}$$

De Morgan's laws
De Morgan's laws state that for $$L, R \subseteq X:$$

$$\begin{alignat}{10} X \setminus (L \cap R) &= (X \setminus L) \cup (X \setminus R) &&\qquad\text{ Also written }\quad &&(L \cap R)^\complement = L^\complement \cup R^\complement &&\quad&&\text{ (De Morgan's law)} \\[1.4ex]

X \setminus (L \cup R) &= (X \setminus L) \cap (X \setminus R) &&\qquad\text{ Also written }\quad &&(L \cup R)^\complement = L^\complement \cap R^\complement &&\quad&&\text{ (De Morgan's law)} \\[1.4ex] \end{alignat}$$

Commutativity
Unions, intersection, and symmetric difference are commutative operations:

$$\begin{alignat}{10} L \cup R               &\;=\;&& R \cup L        && \quad \text{ (Commutativity)} \\[1.4ex] L \cap R               &\;=\;&& R \cap L        && \quad \text{ (Commutativity)} \\[1.4ex] L \,\triangle R        &\;=\;&& R \,\triangle L && \quad \text{ (Commutativity)} \\[1.4ex] \end{alignat}$$

Set subtraction is not commutative. However, the commutativity of set subtraction can be characterized: from $$(L \,\setminus\, R) \cap (R \,\setminus\, L) = \varnothing$$ it follows that: $$L \,\setminus\, R = R \,\setminus\, L \quad \text{ if and only if } \quad L = R.$$ Said differently, if distinct symbols always represented distinct sets, then the true formulas of the form $$\,\cdot\, \,\setminus\, \,\cdot\, = \,\cdot\, \,\setminus\, \,\cdot\,$$ that could be written would be those involving a single symbol; that is, those of the form: $$S \,\setminus\, S = S \,\setminus\, S.$$ But such formulas are necessarily true for binary operation $$\,\ast\,$$ (because $$x \,\ast\, x = x \,\ast\, x$$ must hold by definition of equality), and so in this sense, set subtraction is as diametrically opposite to being commutative as is possible for a binary operation. Set subtraction is also neither left alternative nor right alternative; instead, $$(L \setminus L) \setminus R = L \setminus (L \setminus R)$$ if and only if $$L \cap R = \varnothing$$ if and only if $$(R \setminus L) \setminus L = R \setminus (L \setminus L).$$ Set subtraction is quasi-commutative and satisfies the Jordan identity.

Other identities involving two sets
Absorption laws:

$$\begin{alignat}{4} L \cup (L \cap R) &\;=\;&& L  && \quad \text{ (Absorption)} \\[1.4ex] L \cap (L \cup R) &\;=\;&& L  && \quad \text{ (Absorption)} \\[1.4ex] \end{alignat}$$

Other properties

$$\begin{alignat}{10} L \setminus R &= L \cap (X \setminus R) &&\qquad\text{ Also written }\quad &&L \setminus R = L \cap R^\complement &&\quad&&\text{ where } L, R \subseteq X \\[1.4ex]

X \setminus (L \setminus R) &= (X \setminus L) \cup R &&\qquad\text{ Also written }\quad &&(L \setminus R)^\complement = L^\complement \cup R &&\quad&&\text{ where } R \subseteq X \\[1.4ex]

L \setminus R &= (X \setminus R) \setminus (X \setminus L) &&\qquad\text{ Also written }\quad &&L \setminus R = R^\complement \setminus L^\complement &&\quad&&\text{ where } L, R \subseteq X \\[1.4ex] \end{alignat}$$

Intervals:

$$(a, b) \cap (c, d) = (\max\{a,c\}, \min\{b,d\})$$ $$[a, b) \cap [c, d) = [\max\{a,c\}, \min\{b,d\})$$

Subsets ⊆ and supersets ⊇
The following statements are equivalent for any $$L, R \subseteq X:$$  $$L \subseteq R$$  $$L \cap R = L$$ $$L \cup R = R$$ $$L \,\triangle\, R = R \setminus L$$ $$L \,\triangle\, R \subseteq R \setminus L$$ $$L \setminus R = \varnothing$$ $$L$$ and $$X \setminus R$$ are disjoint (that is, $$L \cap (X \setminus R) = \varnothing$$) <li>$$X \setminus R \subseteq X \setminus L \qquad$$ (that is, $$R^\complement \subseteq L^\complement$$)</li> </ol>
 * Definition of : if $$l \in L$$ then $$l \in R$$</li>

The following statements are equivalent for any $$L, R \subseteq X:$$ <ol> <li>$$L \not\subseteq R$$</li> <li>There exists some $$l \in L \setminus R.$$</li> </ol>

Set equality
The following statements are equivalent: <ol> <li>$$L = R$$</li> <li>$$L \,\triangle\, R = \varnothing$$</li> <li>$$L \,\setminus\, R = R \,\setminus\, L$$</li> </ol>

<ul> <li>If $$L \cap R = \varnothing$$ then $$L = R$$ if and only if $$L = \varnothing = R.$$</li> <li>Uniqueness of complements: If $L \cup R = X \text{ and } L \cap R = \varnothing$ then $$R = X \setminus L$$</li> </ul>

Empty set
A set $$L$$ is empty if the sentence $$\forall x (x \not\in L)$$ is true, where the notation $$x \not\in L$$ is shorthand for $$\lnot (x \in L).$$

If $$L$$ is any set then the following are equivalent: <ol> <li>$$L$$ is not empty, meaning that the sentence $$\lnot [\forall x (x \not\in L)]$$ is true (literally, the logical negation of "$$L$$ is empty" holds true).</li> <li>(In classical mathematics) $$L$$ is inhabited, meaning: $$\exists x (x \in L)$$ </li> <li>$$L \not\subseteq R$$ for some set $$R$$</li> </ol>
 * In constructive mathematics, "not empty" and "inhabited" are not equivalent: every inhabited set is not empty but the converse is not always guaranteed; that is, in constructive mathematics, a set $$L$$ that is not empty (where by definition, "$$L$$ is empty" means that the statement $$\forall x (x \not\in L)$$ is true) might not have an inhabitant (which is an $$x$$ such that $$x \in L$$).

If $$L$$ is any set then the following are equivalent: <ol> <li>$$L$$ is empty ($$L = \varnothing$$), meaning: $$\forall x (x \not\in L)$$</li> <li>$$L \cup R \subseteq R$$ for every set $$R$$</li> <li>$$L \subseteq R$$ for every set $$R$$</li> <li>$$L \subseteq R \setminus L$$ for some/every set $$R$$</li> <li>$$\varnothing / L = L$$</li> </ol>

Given any $$x,$$ the following are equivalent:

<ol> <li>$x \not\in L \setminus R$ </li> <li>$x \in L \cap R \; \text{ or } \; x \not\in L.$ </li> <li>$x \in R \; \text{ or } \; x \not\in L.$ </li> </ol>

Moreover, $$(L \setminus R) \cap R = \varnothing \qquad \text{ always holds}.$$

Meets, Joins, and lattice properties
Inclusion is a partial order: Explicitly, this means that inclusion $$\,\subseteq,\,$$ which is a binary operation, has the following three properties: <ul> <li>Reflexivity: $L \subseteq L$ </li> <li>Antisymmetry: $(L \subseteq R \text{ and } R \subseteq L) \text{ if and only if } L = R$ </li> <li>Transitivity: $\text{If }L \subseteq M \text{ and } M \subseteq R \text{ then } L \subseteq R$ </li> </ul>

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.

Existence of a least element and a greatest element: $$\varnothing \subseteq L \subseteq X$$

Joins/supremums exist: $$L \subseteq L \cup R$$

The union $$L \cup R$$ is the join/supremum of $$L$$ and $$R$$ with respect to $$\,\subseteq\,$$ because: <ol> <li>$$L \subseteq L \cup R$$ and $$R \subseteq L \cup R,$$ and</li> <li>if $$Z$$ is a set such that $$L \subseteq Z$$ and $$R \subseteq Z$$ then $$L \cup R \subseteq Z.$$</li> </ol>

The intersection $$L \cap R$$ is the join/supremum of $$L$$ and $$R$$ with respect to $$\,\supseteq.\,$$

Meets/infimums exist: $$L \cap R \subseteq L$$

The intersection $$L \cap R$$ is the meet/infimum of $$L$$ and $$R$$ with respect to $$\,\subseteq\,$$ because: <ol> <li>if $$L \cap R \subseteq L$$ and $$L \cap R \subseteq R,$$ and</li> <li>if $$Z$$ is a set such that $$Z \subseteq L$$ and $$Z \subseteq R$$ then $$Z \subseteq L \cap R.$$</li> </ol>

The union $$L \cup R$$ is the meet/infimum of $$L$$ and $$R$$ with respect to $$\,\supseteq.\,$$

Other inclusion properties:

$$L \setminus R \subseteq L$$ $$(L \setminus R) \cap L = L \setminus R$$

<ul> <li>If $$L \subseteq R$$ then $$L \,\triangle\, R = R \setminus L.$$</li> <li>If $$L \subseteq X$$ and $$R \subseteq Y$$ then $$L \times R \subseteq X \times Y$$</li> </ul>

Three sets involved
In the left hand sides of the following identities, $$L$$ is the eft most set, $$M$$ is the iddle set, and $$R$$ is the ight most set.

Precedence rules

There is no universal agreement on the order of precedence of the basic set operators. Nevertheless, many authors use precedence rules for set operators, although these rules vary with the author.

One common convention is to associate intersection $$L \cap R = \{x : (x \in L) \land (x \in R)\}$$ with logical conjunction (and) $$L \land R$$ and associate union $$L \cup R = \{x : (x \in L) \lor (x \in R)\}$$ with logical disjunction (or) $$L \lor R,$$ and then transfer the precedence of these logical operators (where $$\,\land\,$$ has precedence over $$\,\lor\,$$) to these set operators, thereby giving $$\,\cap\,$$ precedence over $$\,\cup.\,$$ So for example, $$L \cup M \cap R$$ would mean $$L \cup (M \cap R)$$ since it would be associated with the logical statement $$L \lor M \land R ~=~ L \lor (M \land R)$$ and similarly, $$L \cup M \cap R \cup Z$$ would mean $$L \cup (M \cap R) \cup Z$$ since it would be associated with $$L \lor M \land R \lor Z ~=~ L \lor (M \land R) \lor Z.$$

Sometimes, set complement (subtraction) $$\,\setminus\,$$ is also associated with logical complement (not) $$\,\lnot,\,$$ in which case it will have the highest precedence. More specifically, $$L \setminus R = \{x : (x \in L) \land \lnot (x \in R)\}$$ is rewritten $$L \land \lnot R$$ so that for example, $$L \cup M \setminus R$$ would mean $$L \cup (M \setminus R)$$ since it would be rewritten as the logical statement $$L \lor M \land \lnot R$$ which is equal to $$L \lor (M \land \lnot R).$$ For another example, because $$L \land \lnot M \land R$$ means $$L \land (\lnot M) \land R,$$ which is equal to both $$(L \land (\lnot M)) \land R$$ and $$L \land ((\lnot M) \land R) ~=~ L \land (R \land (\lnot M))$$ (where $$(\lnot M) \land R$$ was rewritten as $$R \land (\lnot M)$$), the formula $$L \setminus M \cap R$$ would refer to the set $$(L \setminus M) \cap R = L \cap (R \setminus M);$$ moreover, since $$L \land (\lnot M) \land R = (L \land R) \land \lnot M,$$ this set is also equal to $$(L \cap R) \setminus M$$ (other set identities can similarly be deduced from propositional calculus identities in this way). However, because set subtraction is not associative $$(L \setminus M) \setminus R \neq L \setminus (M \setminus R),$$ a formula such as $$L \setminus M \setminus R$$ would be ambiguous; for this reason, among others, set subtraction is often not assigned any precedence at all.

Symmetric difference $$L \triangle R = \{x : (x \in L) \oplus (x \in R)\}$$ is sometimes associated with exclusive or (xor) $$L \oplus R$$ (also sometimes denoted by $$\,\veebar$$), in which case if the order of precedence from highest to lowest is $$\,\lnot, \,\oplus, \,\land, \,\lor\,$$ then the order of precedence (from highest to lowest) for the set operators would be $$\,\setminus,\, \triangle,\, \cap,\, \cup.$$ There is no universal agreement on the precedence of exclusive disjunction $$\,\oplus\,$$ with respect to the other logical connectives, which is why symmetric difference $$\,\triangle\,$$ is not often assigned a precedence.

Associativity
Definition: A binary operator $$\,\ast\,$$ is called associative if $$(L \,\ast\, M) \,\ast\, R = L \,\ast\, (M \,\ast\, R)$$ always holds.

The following set operators are associative:

$$\begin{alignat}{5} (L \cup M) \cup R              &\;=\;\;&& L \cup (M \cup R) \\[1.4ex] (L \cap M) \cap R              &\;=\;\;&& L \cap (M \cap R) \\[1.4ex] (L \,\triangle M) \,\triangle R &\;=\;\;&& L \,\triangle (M \,\triangle R) \\[1.4ex] \end{alignat}$$

For set subtraction, instead of associativity, only the following is always guaranteed: $$(L \,\setminus\, M) \,\setminus\, R \;{\color{red}{\subseteq}}\; L \,\setminus\, (M \,\setminus\, R)$$ where equality holds if and only if $$L \cap R = \varnothing$$ (this condition does not depend on $$M$$). Thus $\; (L \setminus M) \setminus R = L \setminus (M \setminus R) \;$ if and only if $$\; (R \setminus M) \setminus L = R \setminus (M \setminus L), \;$$ where the only difference between the left and right hand side set equalities is that the locations of $$L \text{ and } R$$ have been swapped.

Distributivity
Definition: If $$\ast \text{ and } \bullet$$ are binary operators then if $$L \,\ast\, (M \,\bullet\, R) ~=~ (L \,\ast\, M) \,\bullet\, (L \,\ast\,R) \qquad\qquad \text{ for all } L, M, R$$ while if $$(L \,\bullet\, M) \,\ast\, R ~=~ (L \,\ast\, R) \,\bullet\, (M \,\ast\,R) \qquad\qquad \text{ for all } L, M, R.$$ The operator if it both left distributes and right distributes over $$\,\bullet\,.\,$$ In the definitions above, to transform one side to the other, the innermost operator (the operator inside the parentheses) becomes the outermost operator and the outermost operator becomes the innermost operator.

Right distributivity:

$$\begin{alignat}{9} (L \,\cap\, M) \,\cup\, R     ~&=&& (L \,\cup\, R) \,&&\cap\, &&(M \,\cup\, R)             \qquad &&\text{ (Right-distributivity of } \,\cup\, \text{ over } \,\cap\, \text{)} \\[1.4ex] (L \,\cup\, M) \,\cup\, R     ~&=&& (L \,\cup\, R) \,&&\cup\, &&(M \,\cup\, R)             \qquad &&\text{ (Right-distributivity of } \,\cup\, \text{ over } \,\cup\, \text{)} \\[1.4ex] (L \,\cup\, M) \,\cap\, R     ~&=&& (L \,\cap\, R) \,&&\cup\, &&(M \,\cap\, R)             \qquad &&\text{ (Right-distributivity of } \,\cap\, \text{ over } \,\cup\, \text{)} \\[1.4ex] (L \,\cap\, M) \,\cap\, R     ~&=&& (L \,\cap\, R) \,&&\cap\, &&(M \,\cap\, R)             \qquad &&\text{ (Right-distributivity of } \,\cap\, \text{ over } \,\cap\, \text{)} \\[1.4ex] (L \,\triangle\, M) \,\cap\, R     ~&=&& (L \,\cap\, R) \,&&\triangle\, &&(M \,\cap\, R)    \qquad &&\text{ (Right-distributivity of } \,\cap\, \text{ over } \,\triangle\, \text{)} \\[1.4ex] (L \,\cap\, M) \,\times\, R     ~&=&& (L \,\times\, R) \,&&\cap\, &&(M \,\times\, R)             \qquad &&\text{ (Right-distributivity of } \,\times\, \text{ over } \,\cap\, \text{)} \\[1.4ex] (L \,\cup\, M) \,\times\, R     ~&=&& (L \,\times\, R) \,&&\cup\, &&(M \,\times\, R)              \qquad &&\text{ (Right-distributivity of } \,\times\, \text{ over } \,\cup\, \text{)} \\[1.4ex] (L \,\setminus\, M) \,\times\, R     ~&=&& (L \,\times\, R) \,&&\setminus\, &&(M \,\times\, R)    \qquad &&\text{ (Right-distributivity of } \,\times\, \text{ over } \,\setminus\, \text{)} \\[1.4ex] (L \,\triangle\, M) \,\times\, R     ~&=&& (L \,\times\, R) \,&&\triangle\, &&(M \,\times\, R)    \qquad &&\text{ (Right-distributivity of } \,\times\, \text{ over } \,\triangle\, \text{)} \\[1.4ex] (L \,\cup\, M) \,\setminus\, R     ~&=&& (L \,\setminus\, R) \,&&\cup\, &&(M \,\setminus\, R)      \qquad &&\text{ (Right-distributivity of } \,\setminus\, \text{ over } \,\cup\, \text{)} \\[1.4ex] (L \,\cap\, M) \,\setminus\, R     ~&=&& (L \,\setminus\, R) \,&&\cap\, &&(M \,\setminus\, R)      \qquad &&\text{ (Right-distributivity of } \,\setminus\, \text{ over } \,\cap\, \text{)} \\[1.4ex] (L \,\triangle\, M) \,\setminus\, R ~&=&& (L \,\setminus\, R) &&\,\triangle\, &&(M \,\setminus\, R) \qquad &&\text{ (Right-distributivity of } \,\setminus\, \text{ over } \,\triangle\, \text{)} \\[1.4ex] (L \,\setminus\, M) \,\setminus\, R ~&=&& (L \,\setminus\, R) &&\,\setminus\, &&(M \,\setminus\, R)  \qquad &&\text{ (Right-distributivity of } \,\setminus\, \text{ over } \,\setminus\, \text{)} \\[1.4ex] ~&=&&\;\;\;~ L &&\,\setminus\, &&(M \cup R) \\[1.4ex] \end{alignat}$$

Left distributivity:

$$\begin{alignat}{5} L \cup  (M \cap R)            &\;=\;\;&& (L \cup M)     \cap        (L \cup R) \qquad &&\text{ (Left-distributivity of } \,\cup\, \text{ over } \,\cap\, \text{)} \\[1.4ex] L \cup  (M \cup R)            &\;=\;\;&& (L \cup M)     \cup        (L \cup R) &&\text{ (Left-distributivity of } \,\cup\, \text{ over } \,\cup\, \text{)} \\[1.4ex] L \cap  (M \cup R)            &\;=\;\;&& (L \cap M)     \cup        (L \cap R) &&\text{ (Left-distributivity of } \,\cap\, \text{ over } \,\cup\, \text{)} \\[1.4ex] L \cap  (M \cap R)            &\;=\;\;&& (L \cap M)     \cap        (L \cap R) &&\text{ (Left-distributivity of } \,\cap\, \text{ over } \,\cap\, \text{)} \\[1.4ex] L \cap  (M \,\triangle\, R)   &\;=\;\;&& (L \cap M)   \,\triangle\, (L \cap R) &&\text{ (Left-distributivity of } \,\cap\, \text{ over } \,\triangle\, \text{)} \\[1.4ex] L \times (M \cap R)           &\;=\;\;&& (L \times M)   \cap        (L \times R) &&\text{ (Left-distributivity of } \,\times\, \text{ over } \,\cap\, \text{)} \\[1.4ex] L \times (M \cup R)           &\;=\;\;&& (L \times M)   \cup        (L \times R) &&\text{ (Left-distributivity of } \,\times\, \text{ over } \,\cup\, \text{)} \\[1.4ex] L \times (M \,\setminus R)    &\;=\;\;&& (L \times M) \,\setminus   (L \times R) &&\text{ (Left-distributivity of } \,\times\, \text{ over } \,\setminus\, \text{)} \\[1.4ex] L \times (M \,\triangle R)    &\;=\;\;&& (L \times M) \,\triangle   (L \times R) &&\text{ (Left-distributivity of } \,\times\, \text{ over } \,\triangle\, \text{)} \\[1.4ex] \end{alignat}$$

Distributivity and symmetric difference ∆
Intersection distributes over symmetric difference: $$\begin{alignat}{5} L \,\cap\, (M \,\triangle\, R) ~&=&& (L \,\cap\, M) \,\triangle\, (L \,\cap\, R) ~&&~ \\[1.4ex] \end{alignat}$$ $$\begin{alignat}{5} (L \,\triangle\, M) \,\cap\, R~&=&& (L \,\cap\, R) \,\triangle\, (M \,\cap\, R) ~&&~ \\[1.4ex] \end{alignat}$$

Union does not distribute over symmetric difference because only the following is guaranteed in general: $$\begin{alignat}{5} L \cup (M \,\triangle\, R) {\color{red}{\supseteq}} \color{black}{\,} (L \cup M) \,\triangle\, (L \cup R) ~ &~=~&& (M \,\triangle\, R) \,\setminus\, L &~=~&& (M \,\setminus\, L) \,\triangle\, (R \,\setminus\, L) \\[1.4ex] \end{alignat}$$

Symmetric difference does not distribute over itself: $$L \,\triangle\, (M \,\triangle\, R) {\color{red}{\neq}} \color{black}{\,} (L \,\triangle\, M) \,\triangle\, (L \,\triangle\, R) ~=~ M \,\triangle\, R$$ and in general, for any sets $$L \text{ and } A$$ (where $$A$$ represents $$M \,\triangle\, R$$), $$L \,\triangle\, A$$ might not be a subset, nor a superset, of $$L$$ (and the same is true for $$A$$).

Distributivity and set subtraction \
Failure of set subtraction to left distribute:

Set subtraction is distributive over itself. However, set subtraction is left distributive over itself because only the following is guaranteed in general: $$\begin{alignat}{5} L \,\setminus\, (M \,\setminus\, R) &{\color{red}{\supseteq}}&& \color{black}{\,} (L \,\setminus\, M) \,\setminus\, (L \,\setminus\, R) = L \cap R \,\setminus\, M \\[1.4ex] \end{alignat}$$ where equality holds if and only if $$L \,\setminus\, M = L \,\cap\, R,$$ which happens if and only if $$L \cap M \cap R = \varnothing \text{ and } L \setminus M \subseteq R.$$

For symmetric difference, the sets $$L \,\setminus\, (M \,\triangle\, R)$$ and $$(L \,\setminus\, M) \,\triangle\, (L \,\setminus\, R) = L \,\cap\, (M \,\triangle\, R)$$ are always disjoint. So these two sets are equal if and only if they are both equal to $$\varnothing.$$ Moreover, $$L \,\setminus\, (M \,\triangle\, R) = \varnothing$$ if and only if $$L \cap M \cap R = \varnothing \text{ and } L \subseteq M \cup R.$$

To investigate the left distributivity of set subtraction over unions or intersections, consider how the sets involved in (both of) De Morgan's laws are all related: $$\begin{alignat}{5} (L \,\setminus\, M) \,\cap\, (L \,\setminus\, R) = L \,\setminus\, (M \,\cup\, R) ~&{\color{red}{\subseteq}}&& \color{black}{\,} L \,\setminus\, (M \,\cap\, R) = (L \,\setminus\, M) \,\cup\, (L \,\setminus\, R) \\[1.4ex] \end{alignat}$$ always holds (the equalities on the left and right are De Morgan's laws) but equality is not guaranteed in general (that is, the containment $${\color{red}{\subseteq}}$$ might be strict). Equality holds if and only if $$L \,\setminus\, (M \,\cap\, R) \;\subseteq\; L \,\setminus\, (M \,\cup\, R),$$ which happens if and only if $$L \,\cap\, M = L \,\cap\, R.$$

This observation about De Morgan's laws shows that $$\,\setminus\,$$ is left distributive over $$\,\cup\,$$ or $$\,\cap\,$$ because only the following are guaranteed in general: $$\begin{alignat}{5} L \,\setminus\, (M \,\cup\, R) ~&{\color{red}{\subseteq}}&& \color{black}{\,} (L \,\setminus\, M) \,\cup\, (L \,\setminus\, R) = L \,\setminus\, (M \,\cap\, R) \\[1.4ex] \end{alignat}$$ $$\begin{alignat}{5} L \,\setminus\, (M \,\cap\, R) ~&{\color{red}{\supseteq}}&& \color{black}{\,} (L \,\setminus\, M) \,\cap\, (L \,\setminus\, R) = L \,\setminus\, (M \,\cup\, R) \\[1.4ex] \end{alignat}$$ where equality holds for one (or equivalently, for both) of the above two inclusion formulas if and only if $$L \,\cap\, M = L \,\cap\, R.$$

The following statements are equivalent: <ol> <li>$$L \cap M \,=\, L \cap R$$</li> <li>$$L \,\setminus\, M \,=\, L \,\setminus\, R$$</li> <li>$$L \,\setminus\, (M \,\cap\, R) = (L \,\setminus\, M) \,\cap\, (L \,\setminus\, R);$$ that is, $$\,\setminus\,$$ left distributes over $$\,\cap\,$$ for these three particular sets</li> <li>$$L \,\setminus\, (M \,\cup\, R) = (L \,\setminus\, M) \,\cup\, (L \,\setminus\, R);$$ that is, $$\,\setminus\,$$ left distributes over $$\,\cup\,$$ for these three particular sets</li> <li>$$L \,\setminus\, (M \,\cap\, R) \,=\, L \,\setminus\, (M \,\cup\, R)$$</li> <li>$$L \cap (M \cup R) \,=\, L \cap M \cap R$$</li> <li>$$L \cap (M \cup R) ~\subseteq~ M \cap R$$</li> <li>$$L \cap R ~\subseteq~ M \;$$ and $$\; L \cap M ~\subseteq~ R$$</li> <li>$$L \setminus (M \setminus R) \,=\, L \setminus (R \setminus M)$$</li> <li>$$L \setminus (M \setminus R) \,=\, L \setminus (R \setminus M) \,=\, L$$</li> </ol>

Quasi-commutativity: $$(L \setminus M) \setminus R ~=~ (L \setminus R) \setminus M \qquad \text{ (Quasi-commutative)}$$ always holds but in general, $$L \setminus (M \setminus R) {\color{red}{\neq}} L \setminus (R \setminus M).$$ However, $$L \setminus (M \setminus R) ~\subseteq~ L \setminus (R \setminus M)$$ if and only if $$L \cap R ~\subseteq~ M$$ if and only if $$L \setminus (R \setminus M) ~=~ L.$$

Set subtraction complexity: To manage the many identities involving set subtraction, this section is divided based on where the set subtraction operation and parentheses are located on the left hand side of the identity. The great variety and (relative) complexity of formulas involving set subtraction (compared to those without it) is in part due to the fact that unlike $$\,\cup, \,\cap,$$ and $$\triangle,\,$$ set subtraction is neither associative nor commutative and it also is not left distributive over $$\,\cup, \,\cap, \,\triangle,$$ or even over itself.

Two set subtractions
Set subtraction is associative in general: $$(L \,\setminus\, M) \,\setminus\, R \;{\color{red}{\neq}}\; L \,\setminus\, (M \,\setminus\, R)$$ since only the following is always guaranteed: $$(L \,\setminus\, M) \,\setminus\, R \;{\color{red}{\subseteq}}\; L \,\setminus\, (M \,\setminus\, R).$$

(L\M)\R
$$\begin{alignat}{4} (L \setminus M) \setminus R &= &&L \setminus (M \cup R) \\[0.6ex] &= (&&L \setminus R) \setminus M \\[0.6ex] &= (&&L \setminus M) \cap (L \setminus R) \\[0.6ex] &= (&&L \setminus R) \setminus M \\[0.6ex] &= (&&L \,\setminus\, R) \,\setminus\, (M \,\setminus\, R) \\[1.4ex] \end{alignat}$$

L\(M\R)
$$\begin{alignat}{4} L \setminus (M \setminus R) &= (L \setminus M) \cup (L \cap R) \\[1.4ex] \end{alignat}$$
 * If $$L \subseteq M \text{ then } L \setminus (M \setminus R) = L \cap R$$
 * $L \setminus (M \setminus R) \subseteq (L \setminus M) \cup R$ with equality if and only if $$R \subseteq L.$$

(L\M) ⁎ R
Set subtraction on the left, and parentheses on the 

$$\begin{alignat}{4} \left(L \setminus M\right) \cup R &= (L \cup R) \setminus (M \setminus R) \\ &= (L \setminus (M \cup R)) \cup R \text{ (the outermost union is disjoint) } \\ \end{alignat}$$


 * $$\begin{alignat}{4}

(L \setminus M) \cap R &= (&&L \cap R) \setminus (M \cap R) \text{ (Distributive law of } \cap \text{ over } \setminus \text{ )} \\ &= (&&L \cap R) \setminus M \\ &= &&L \cap (R \setminus M) \\ \end{alignat}$$

$$\begin{alignat}{5} (L \,\setminus\, M) \,\cap\, (L \,\setminus\, R) = L \,\setminus\, (M \,\cup\, R) ~&{\color{red}{\subseteq}}&& \color{black}{\,} L \,\setminus\, (M \,\cap\, R) = (L \,\setminus\, M) \,\cup\, (L \,\setminus\, R) \\[1.4ex] \end{alignat}$$ $$\begin{alignat}{4} (L \setminus M) ~\triangle~ R &= (L \setminus (M \cup R)) \cup (R \setminus L) \cup (L \cap M \cap R) \text{ (the three outermost sets are pairwise disjoint) } \\ \end{alignat}$$

$$(L \,\setminus M) \times R = (L \times R) \,\setminus (M \times R)   \text{ (Distributivity)}$$

L\(M ⁎ R)
Set subtraction on the left, and parentheses on the 

$$\begin{alignat}{3} L \setminus (M \cup R) &= (L \setminus M) &&\,\cap\,   (&&L \setminus R) ~\text{ (De Morgan's law) } \\ &= (L \setminus M) &&\,\,\setminus &&R \\ &= (L \setminus R) &&\,\,\setminus &&M \\ \end{alignat}$$

$$\begin{alignat}{4} L \setminus (M \cap R) &= (L \setminus M) \cup (L \setminus R) ~\text{ (De Morgan's law) } \\ \end{alignat}$$ where the above two sets that are the subjects of De Morgan's laws always satisfy $$L \,\setminus\, (M \,\cup\, R) {\color{red}{\subseteq}} \color{black}{\,} L \,\setminus\, (M \,\cap\, R).$$

$$\begin{alignat}{4} L \setminus (M ~\triangle~ R) &= (L \setminus (M \cup R)) \cup (L \cap M \cap R) \text{ (the outermost union is disjoint) } \\ \end{alignat}$$

(L ⁎ M)\R
Set subtraction on the right, and parentheses on the 

$$\begin{alignat}{4} (L \cup M) \setminus R &= (L \setminus R) \cup (M \setminus R) \\ \end{alignat}$$

$$\begin{alignat}{4} (L \cap M) \setminus R &= (&&L \setminus R) &&\cap (M \setminus R) \\ &= &&L              &&\cap (M \setminus R) \\ &= &&M              &&\cap (L \setminus R) \\ \end{alignat}$$

$$\begin{alignat}{4} (L \,\triangle\, M)  \setminus R &= (L \setminus R) ~&&\triangle~ (M \setminus R) \\ &= (L \cup R)     ~&&\triangle~ (M \cup R) \\ \end{alignat}$$

L ⁎ (M\R)
Set subtraction on the right, and parentheses on the 

$$\begin{alignat}{3} L \cup (M \setminus R) &= && &&L              &&\cup\;            &&(M \setminus (R \cup L)) &&\text{ (the outermost union is disjoint) } \\ &= [&&(&&L \setminus M) &&\cup\;           &&(R \cap L)] \cup (M \setminus R)       &&\text{ (the outermost union is disjoint) } \\ &= &&(&&L \setminus (M \cup R)) \;&&\;\cup &&(R \cap L)\,\, \cup (M \setminus R)   &&\text{ (the three outermost sets are pairwise disjoint) } \\ \end{alignat}$$


 * $$\begin{alignat}{4}

L \cap (M \setminus R) &= (&&L \cap M)     &&\setminus (L \cap R) \text{ (Distributive law of } \cap \text{ over } \setminus \text{ )}  \\ &= (&&L \cap M)     &&\setminus R  \\ &= &&M              &&\cap (L \setminus R) \\ &= (&&L \setminus R) &&\cap (M \setminus R) \\ \end{alignat} $$

$$L \times (M \,\setminus R) = (L \times M) \,\setminus (L \times R)   \text{ (Distributivity)}$$

(L • M) ⁎ (M • R)
Operations of the form $$(L \bullet M) \ast (M \bullet R)$$:

$$\begin{alignat}{9} (L \cup M)           &\,\cup\,&&       (&&M \cup R) && &&\;=\;\;&& L \cup M \cup R \\[1.4ex] (L \cup M)           &\,\cap\,&&       (&&M \cup R) && &&\;=\;\;&& M \cup (L \cap R) \\[1.4ex] (L \cup M)           &\,\setminus\,&&  (&&M \cup R) && &&\;=\;\;&& L \,\setminus\, (M \cup R) \\[1.4ex] (L \cup M)           &\,\triangle\,&&  (&&M \cup R) && &&\;=\;\;&& (L \,\setminus\, (M \cup R)) \,\cup\, (R \,\setminus\, (L \cup M)) \\[1.4ex] &\,&&\,&&\,&& &&\;=\;\;&& (L \,\triangle\, R) \,\setminus\, M \\[1.4ex] (L \cap M)           &\,\cup\,&&       (&&M \cap R) && &&\;=\;\;&& M \cup (L \cap R) \\[1.4ex] (L \cap M)           &\,\cap\,&&       (&&M \cap R) && &&\;=\;\;&& L \cap M \cap R \\[1.4ex] (L \cap M)           &\,\setminus\,&&  (&&M \cap R) && &&\;=\;\;&& (L \cap M) \,\setminus\, R \\[1.4ex] (L \cap M)           &\,\triangle\,&&  (&&M \cap R) && &&\;=\;\;&& [(L \,\cap M) \cup (M \,\cap R)] \,\setminus\, (L \,\cap M \,\cap R) \\[1.4ex] (L \,\setminus M)    &\,\cup\,&&  (&&M \,\setminus R) && &&\;=\;\;&& (L \,\cup M) \,\setminus (M \,\cap\, R) \\[1.4ex] (L \,\setminus M)    &\,\cap\,&&  (&&M \,\setminus R) && &&\;=\;\;&& \varnothing \\[1.4ex] (L \,\setminus M)    &\,\setminus\,&&  (&&M \,\setminus R) && &&\;=\;\;&& L \,\setminus M \\[1.4ex] (L \,\setminus M)    &\,\triangle\,&&  (&&M \,\setminus R) && &&\;=\;\;&& (L \,\setminus M) \cup (M \,\setminus R) \\[1.4ex] &\,&&\,&&\,&& &&\;=\;\;&& (L \,\cup M) \setminus (M \,\cap R) \\[1.4ex] (L \,\triangle\, M)  &\,\cup\,&&  (&&M \,\triangle\, R) && &&\;=\;\;&& (L \,\cup\, M \,\cup\, R) \,\setminus\, (L \,\cap\, M \,\cap\, R) \\[1.4ex] (L \,\triangle\, M)  &\,\cap\,&&  (&&M \,\triangle\, R) && &&\;=\;\;&& ((L \,\cap\, R) \,\setminus\, M) \,\cup\, (M \,\setminus\, (L \,\cup\, R)) \\[1.4ex] (L \,\triangle\, M)  &\,\setminus\,&&  (&&M \,\triangle\, R) && &&\;=\;\;&& (L \,\setminus\, (M \,\cup\, R)) \,\cup\, ((M \,\cap\, R) \,\setminus\, L) \\[1.4ex] (L \,\triangle\, M)  &\,\triangle\,&&  (&&M \,\triangle\, R) && &&\;=\;\;&& L \,\triangle\, R \\[1.7ex] \end{alignat}$$

(L • M) ⁎ (R\M)
Operations of the form $$(L \bullet M) \ast (R \,\setminus\, M)$$:

$$\begin{alignat}{9} (L \cup M)           &\,\cup\,&&       (&&R \,\setminus\, M) && &&\;=\;\;&& L \cup M \cup R \\[1.4ex] (L \cup M)           &\,\cap\,&&       (&&R \,\setminus\, M) && &&\;=\;\;&& (L \cap R) \,\setminus\, M \\[1.4ex] (L \cup M)           &\,\setminus\,&&  (&&R \,\setminus\, M) && &&\;=\;\;&& M \cup (L \,\setminus\, R) \\[1.4ex] (L \cup M)           &\,\triangle\,&&  (&&R \,\setminus\, M) && &&\;=\;\;&& M \cup (L \,\triangle\, R) \\[1.4ex] (L \cap M)           &\,\cup\,&&       (&&R \,\setminus\, M) && &&\;=\;\;&& [L \cap (M \cup R)] \cup [R \,\setminus\, (L \cup M)] \qquad \text{ (disjoint union)} \\[1.4ex] &\,&&\,&&\,&& &&\;=\;\;&& (L \cap M) \,\triangle\, (R \,\setminus\, M) \\[1.4ex] (L \cap M)           &\,\cap\,&&       (&&R \,\setminus\, M) && &&\;=\;\;&& \varnothing \\[1.4ex] (L \cap M)           &\,\setminus\,&&   (&&R \,\setminus\, M) && &&\;=\;\;&& L \cap M \\[1.4ex] (L \cap M)           &\,\triangle\,&&  (&&R \,\setminus\, M) && &&\;=\;\;&& (L \cap M) \cup (R \,\setminus\, M) \qquad \text{ (disjoint union)} \\[1.4ex] (L \,\setminus\, M)  &\,\cup\,&&       (&&R \,\setminus\, M) && &&\;=\;\;&& L \cup R \,\setminus\, M \\[1.4ex] (L \,\setminus\, M)  &\,\cap\,&&       (&&R \,\setminus\, M) && &&\;=\;\;&& (L \cap R) \,\setminus\, M \\[1.4ex] (L \,\setminus\, M)  &\,\setminus\,&&  (&&R \,\setminus\, M) && &&\;=\;\;&& L \,\setminus\, (M \cup R) \\[1.4ex] (L \,\setminus\, M)  &\,\triangle\,&&  (&&R \,\setminus\, M) && &&\;=\;\;&& (L \,\triangle\, R) \,\setminus\, M \\[1.4ex] (L \,\triangle\, M)  &\,\cup\,&&       (&&R \,\setminus\, M) && &&\;=\;\;&& (L \cup M \cup R) \,\setminus\, (L \cap M) \\[1.4ex] (L \,\triangle\, M)  &\,\cap\,&&       (&&R \,\setminus\, M) && &&\;=\;\;&& (L \cap R) \,\setminus\, M \\[1.4ex] (L \,\triangle\, M)  &\,\setminus\,&&  (&&R \,\setminus\, M) && &&\;=\;\;&& [L \,\setminus\, (M \cup R)] \cup (M \,\setminus\, L) \qquad \text{ (disjoint union)} \\[1.4ex] &\,&&\,&&\,&& &&\;=\;\;&& (L \,\triangle\, M) \setminus (L \,\cap R) \\[1.4ex] (L \,\triangle\, M)  &\,\triangle\,&&  (&&R \,\setminus\, M) && &&\;=\;\;&& L \,\triangle\, (M \cup R) \\[1.7ex] \end{alignat}$$

(L\M) ⁎ (L\R)
Operations of the form $$(L \,\setminus\, M) \ast (L \,\setminus\, R)$$:

$$\begin{alignat}{9} (L \,\setminus M) &\,\cup\,&&  (&&L \,\setminus R)              &&\;=\;&&  L \,\setminus\, (M \,\cap\, R)        \\[1.4ex] (L \,\setminus M) &\,\cap\,&&  (&&L \,\setminus R)              &&\;=\;&&  L \,\setminus\, (M \,\cup\, R)        \\[1.4ex] (L \,\setminus M) &\,\setminus\,&&  (&&L \,\setminus R)              &&\;=\;&&  (L \,\cap\, R) \,\setminus\, M        \\[1.4ex] (L \,\setminus M) &\,\triangle\,&&  (&&L \,\setminus R)              &&\;=\;&&  L \,\cap\, (M \,\triangle\, R)        \\[1.4ex] &\,&&\,&&\, &&\;=\;&& (L \cap M)  \,\triangle\, (L \cap R)  \\[1.4ex] \end{alignat}$$

Other simplifications
Other properties:

$$L \cap M = R \;\text{ and }\; L \cap R = M \qquad \text{ if and only if } \qquad M = R \subseteq L.$$

<ul> <li>If $$L \subseteq M$$ then $$L \setminus R = L \cap (M \setminus R).$$</li> <li>$$L \times (M \,\setminus R) = (L \times M) \,\setminus (L \times R)$$</li> <li>If $$L \subseteq R$$ then $$M \setminus R \subseteq M \setminus L.$$</li> <li>$$L \cap M \cap R = \varnothing$$ if and only if for any $$x \in L \cup M \cup R,$$ $$x$$ belongs to of the sets $$L, M, \text{ and } R.$$</li> </ul>

Symmetric difference ∆ of finitely many sets
Given finitely many sets $$L_1, \ldots, L_n,$$ something belongs to their symmetric difference if and only if it belongs to an odd number of these sets. Explicitly, for any $$x,$$ $$x \in L_1 \triangle \cdots \triangle L_n$$ if and only if the cardinality $$\left|\left\{i : x \in L_i\right\}\right|$$ is odd. (Recall that symmetric difference is associative so parentheses are not needed for the set $$L_1 \triangle \cdots \triangle L_n$$).

Consequently, the symmetric difference of three sets satisfies: $$\begin{alignat}{4} L \,\triangle\, M \,\triangle\, R &= (L \cap M \cap R) \cup \{x : x \text{ belongs to exactly one of the sets } L, M, R \} \text{ (the union is disjoint) } \\ &= [L \cap M \cap R] \cup [L \setminus (M \cup R)] \cup [M \setminus (L \cup R)] \cup [R \setminus (L \cup M)] \text{ (all 4 sets enclosed by [ ] are pairwise disjoint) } \\ \end{alignat}$$

Binary ⨯ distributes over ⋃ and ⋂ and \ and ∆
The binary Cartesian product ⨯ distributes over unions, intersections, set subtraction, and symmetric difference:

$$\begin{alignat}{9} (L \,\cap\, M) \,\times\, R     ~&=&& (L \,\times\, R) \,&&\cap\, &&(M \,\times\, R)        \qquad &&\text{ (Right-distributivity of } \,\times\, \text{ over } \,\cap\, \text{)} \\[1.4ex] (L \,\cup\, M) \,\times\, R     ~&=&& (L \,\times\, R) \,&&\cup\, &&(M \,\times\, R)        \qquad &&\text{ (Right-distributivity of } \,\times\, \text{ over } \,\cup\, \text{)} \\[1.4ex] (L \,\setminus\, M) \,\times\, R ~&=&& (L \,\times\, R) \,&&\setminus\, &&(M \,\times\, R)  \qquad &&\text{ (Right-distributivity of } \,\times\, \text{ over } \,\setminus\, \text{)} \\[1.4ex] (L \,\triangle\, M) \,\times\, R ~&=&& (L \,\times\, R) \,&&\triangle\, &&(M \,\times\, R)  \qquad &&\text{ (Right-distributivity of } \,\times\, \text{ over } \,\triangle\, \text{)} \\[1.4ex] \end{alignat}$$

$$\begin{alignat}{5} L \times  (M \cap R)            &\;=\;\;&& (L \times M)     \cap       (L \times R) \qquad &&\text{ (Left-distributivity of } \,\times\, \text{ over } \,\cap\, \text{)} \\[1.4ex] L \times  (M \cup R)            &\;=\;\;&& (L \times M)    \cup       (L \times R) &&\text{ (Left-distributivity of } \,\times\, \text{ over } \,\cup\, \text{)} \\[1.4ex] L \times  (M \setminus R)       &\;=\;\;&& (L \times M)    \setminus  (L \times R) &&\text{ (Left-distributivity of } \,\times\, \text{ over } \,\setminus\, \text{)} \\[1.4ex] L \times  (M \triangle R)       &\;=\;\;&& (L \times M)    \triangle  (L \times R) &&\text{ (Left-distributivity of } \,\times\, \text{ over } \,\triangle\, \text{)} \\[1.4ex] \end{alignat}$$

But in general, ⨯ does not distribute over itself: $$L \times (M \times R) ~\color{Red}{\neq}\color{Black}{}~ (L \times M) \times (L \times R)$$ $$(L \times M) \times R ~\color{Red}{\neq}\color{Black}{}~ (L \times R) \times (M \times R).$$

Binary ⋂ of finite ⨯
$$(L \times R) \cap \left(L_2 \times R_2\right) ~=~ \left(L \cap L_2\right) \times \left(R \cap R_2\right)$$ $$(L \times M \times R) \cap \left(L_2 \times M_2 \times R_2\right) ~=~ \left(L \cap L_2\right) \times \left(M \cap M_2\right) \times \left(R \cap R_2\right)$$

Binary ⋃ of finite ⨯
$$\begin{alignat}{9} \left(L \times R\right) ~\cup~ \left(L_2 \times R_2\right) ~&=~ \left[\left(L \setminus L_2\right) \times R\right] ~\cup~ \left[\left(L_2 \setminus L\right) \times R_2\right] ~\cup~ \left[\left(L \cap L_2\right) \times \left(R \cup R_2\right)\right] \\[0.5ex] ~&=~ \left[L \times \left(R \setminus R_2\right)\right] ~\cup~ \left[L_2 \times \left(R_2 \setminus R\right)\right] ~\cup~ \left[\left(L \cup L_2\right) \times \left(R \cap R_2\right)\right] \\ \end{alignat}$$

Difference \ of finite ⨯
$$\begin{alignat}{9} \left(L \times R\right) ~\setminus~ \left(L_2 \times R_2\right) ~&=~ \left[\left(L \,\setminus\, L_2\right) \times R\right] ~\cup~ \left[L \times \left(R \,\setminus\, R_2\right)\right] \\ \end{alignat}$$ and $$(L \times M \times R) ~\setminus~ \left(L_2 \times M_2 \times R_2\right) ~=~ \left[\left(L \,\setminus\, L_2\right) \times M \times R\right] ~\cup~ \left[L \times \left(M \,\setminus\, M_2\right) \times R\right] ~\cup~ \left[L \times M \times \left(R \,\setminus\, R_2\right)\right]$$

Finite ⨯ of differences \
$$\left(L \,\setminus\, L_2\right) \times \left(R \,\setminus\, R_2\right) ~=~ \left(L \times R\right) \,\setminus\, \left[\left(L_2 \times R\right) \cup \left(L \times R_2\right)\right]$$

$$\left(L \,\setminus\, L_2\right) \times \left(M \,\setminus\, M_2\right) \times \left(R \,\setminus\, R_2\right) ~=~ \left(L \times M \times R\right) \,\setminus\, \left[\left(L_2 \times M \times R\right) \cup \left(L \times M_2 \times R\right) \cup \left(L \times M \times R_2\right)\right]$$

Symmetric difference ∆ and finite ⨯
$$L \times \left(R \,\triangle\, R_2\right) ~=~ \left[L \times \left(R \,\setminus\, R_2\right)\right] \,\cup\, \left[L \times \left(R_2 \,\setminus\, R\right)\right]$$ $$\left(L \,\triangle\, L_2\right) \times R ~=~ \left[\left(L \,\setminus\, L_2\right) \times R\right] \,\cup\, \left[\left(L_2 \,\setminus\, L\right) \times R\right]$$

$$\begin{alignat}{4} \left(L \,\triangle\, L_2\right) \times \left(R \,\triangle\, R_2\right) ~&=~ && && \,\left[\left(L \cup L_2\right) \times \left(R \cup R_2\right)\right] \;\setminus\; \left[\left(\left(L \cap L_2\right) \times R\right) \;\cup\; \left(L \times \left(R \cap R_2\right)\right)\right] \\[0.7ex] &=~ & &&& \,\left[\left(L \,\setminus\, L_2\right) \times \left(R_2 \,\setminus\, R\right)\right] \,\cup\, \left[\left(L_2 \,\setminus\, L\right) \times \left(R_2 \,\setminus\, R\right)\right] \,\cup\, \left[\left(L \,\setminus\, L_2\right) \times \left(R \,\setminus\, R_2\right)\right] \,\cup\, \left[\left(L_2 \,\setminus\, L\right) \cup \left(R \,\setminus\, R_2\right)\right] \\ \end{alignat}$$

$$\begin{alignat}{4} \left(L \,\triangle\, L_2\right) \times \left(M \,\triangle\, M_2\right) \times \left(R \,\triangle\, R_2\right) ~&=~ \left[\left(L \cup L_2\right) \times \left(M \cup M_2\right) \times \left(R \cup R_2\right)\right] \;\setminus\; \left[\left(\left(L \cap L_2\right) \times M \times R\right) \;\cup\; \left(L \times \left(M \cap M_2\right) \times R\right) \;\cup\; \left(L \times M \times \left(R \cap R_2\right)\right)\right] \\ \end{alignat}$$

In general, $$\left(L \,\triangle\, L_2\right) \times \left(R \,\triangle\, R_2\right)$$ need not be a subset nor a superset of $$\left(L \times R\right) \,\triangle\, \left(L_2 \times R_2\right).$$

$$\begin{alignat}{4} \left(L \times R\right) \,\triangle\, \left(L_2 \times R_2\right) ~&=~ && \left(L \times R\right) \cup \left(L_2 \times R_2\right) \;\setminus\; \left[\left(L \cap L_2\right) \times \left(R \cap R_2\right)\right] \\[0.7ex] \end{alignat}$$

$$\begin{alignat}{4} \left(L \times M \times R\right) \,\triangle\, \left(L_2 \times M_2 \times R_2\right) ~&=~ && \left(L \times M \times R\right) \cup \left(L_2 \times M_2 \times R_2\right) \;\setminus\; \left[\left(L \cap L_2\right) \times \left(M \cap M_2\right) \times \left(R \cap R_2\right)\right] \\[0.7ex] \end{alignat}$$

Arbitrary families of sets
Let $$\left(L_i\right)_{i \in I},$$ $$\left(R_j\right)_{j \in J},$$ and $$\left(S_{i,j}\right)_{(i, j) \in I \times J}$$ be indexed families of sets. Whenever the assumption is needed, then all indexing sets, such as $$I$$ and $$J,$$ are assumed to be non-empty.

Definitions
A or (more briefly) a  refers to a set whose elements are sets.

An is a function from some set, called its, into some family of sets. An indexed family of sets will be denoted by $$\left(L_i\right)_{i \in I},$$ where this notation assigns the symbol $$I$$ for the indexing set and for every index $$i \in I,$$ assigns the symbol $$L_i$$ to the value of the function at $$i.$$ The function itself may then be denoted by the symbol $$L_\bull,$$ which is obtained from the notation $$\left(L_i\right)_{i \in I}$$ by replacing the index $$i$$ with a bullet symbol $$\bullet\,;$$ explicitly, $$L_\bull$$ is the function: $$\begin{alignat}{4} L_\bull :\;&& I &&\;\to   \;& \left\{L_i : i \in I\right\} \\[0.3ex] && i &&\;\mapsto\;& L_i \\ \end{alignat}$$ which may be summarized by writing $$L_\bull = \left(L_i\right)_{i \in I}.$$

Any given indexed family of sets $$L_\bull = \left(L_i\right)_{i \in I}$$ (which is a function) can be canonically associated with its image/range $$\operatorname{Im} L_\bull ~\stackrel{\scriptscriptstyle\text{def}}{=}~ \left\{L_i : i \in I\right\}$$ (which is a family of sets). Conversely, any given family of sets $$\mathcal{B}$$ may be associated with the $$\mathcal{B}$$-indexed family of sets $$(B)_{B \in \mathcal{B}},$$ which is technically the identity map $$\mathcal{B} \to \mathcal{B}.$$ However, this is a bijective correspondence because an indexed family of sets $$L_\bull = \left(L_i\right)_{i \in I}$$ is  required to be injective (that is, there may exist distinct indices $$i \neq j$$ such as $$L_i = L_j$$), which in particular means that it is possible for distinct indexed families of sets (which are functions) to be associated with the same family of sets (by having the same image/range).

Arbitrary unions defined

If $$I = \varnothing$$ then $$\bigcup_{i \in \varnothing} L_i = \{x ~:~ \text{ there exists } i \in \varnothing \text{ such that } x \in L_i\} = \varnothing,$$ which is somethings called the (despite being called a convention, this equality follows from the definition).

If $$\mathcal{B}$$ is a family of sets then $$\cup \mathcal{B}$$ denotes the set: $$\bigcup \mathcal{B} \stackrel{\scriptscriptstyle\text{def}}{=}~ \bigcup_{B \in \mathcal{B}} B \stackrel{\scriptscriptstyle\text{def}}{=}~ \{x ~:~ \text{ there exists } B \in \mathcal{B} \text{ such that } x \in B\}.$$

Arbitrary intersections defined

If $$I \neq \varnothing$$ then

If $$\mathcal{B} \neq \varnothing$$ is a family of sets then $$\cap \mathcal{B}$$ denotes the set: $$\bigcap \mathcal{B} \stackrel{\scriptscriptstyle\text{def}}{=}~ \bigcap_{B \in B} B \stackrel{\scriptscriptstyle\text{def}}{=}~ \{x ~:~ x \in B \text{ for every } B \in \mathcal{B}\} ~=~ \{x ~:~ \text{ for all } B, \text{ if } B \in \mathcal{B} \text{ then } x \in B\}.$$

Nullary intersections

If $$I = \varnothing$$ then $$\bigcap_{i \in \varnothing} L_i = \{x ~:~ \text{ for all } i, \text{ if } i \in \varnothing \text{ then } x \in L_i\}$$ where every possible thing $$x$$ in the universe vacuously satisfied the condition: "if $$i \in \varnothing$$ then $$x \in L_i$$". Consequently, $${\textstyle\bigcap\limits_{i \in \varnothing}} L_i = \{x : \text{ true }\}$$ consists of in the universe.

So if $$I = \varnothing$$ and:
 * 1) if you are working in a model in which there exists some universe  $$X$$ then $${\textstyle\bigcap\limits_{i \in \varnothing}} L_i = \{x ~:~ x \in L_i \text{ for every } i \in \varnothing\} ~=~ X.$$
 * 2) otherwise, if you are working in a model in which "the class of all things $$x$$" is not a set (by far the most common situation) then $${\textstyle\bigcap\limits_{i \in \varnothing}} L_i$$ is because $${\textstyle\bigcap\limits_{i \in \varnothing}} L_i$$ consists of, which makes $${\textstyle\bigcap\limits_{i \in \varnothing}} L_i$$ a proper class and  a set.


 * Assumption: Henceforth, whenever a formula requires some indexing set to be non-empty in order for an arbitrary intersection to be well-defined, then this will automatically be assumed without mention.

A consequence of this is the following assumption/definition:


 * A  of sets or an  refers to the intersection of a finite collection of sets.

Some authors adopt the so called , which is the convention that an empty intersection of sets is equal to some canonical set. In particular, if all sets are subsets of some set $$X$$ then some author may declare that the empty intersection of these sets be equal to $$X.$$ However, the nullary intersection convention is not as commonly accepted as the nullary union convention and this article will not adopt it (this is due to the fact that unlike the empty union, the value of the empty intersection depends on $$X$$ so if there are multiple sets under consideration, which is commonly the case, then the value of the empty intersection risks becoming ambiguous).

Multiple index sets $$\bigcup_{\stackrel{i \in I,}{j \in J}} S_{i,j} \stackrel{\scriptscriptstyle\text{def}}{=}~ \bigcup_{(i, j) \in I \times J} S_{i,j}$$ $$\bigcap_{\stackrel{i \in I,}{j \in J}} S_{i,j} \stackrel{\scriptscriptstyle\text{def}}{=}~ \bigcap_{(i, j) \in I \times J} S_{i,j}$$

Binary ⋂ of arbitrary ⋃'s
and


 * If all $$\left(L_i\right)_{i \in I}$$ are pairwise disjoint and all $$\left(R_j\right)_{j \in J}$$ are also pairwise disjoint, then so are all $$\left(L_i \cap R_j\right)_{(i, j) \in I \times J}$$ (that is, if $$(i, j) \neq \left(i_2, j_2\right)$$ then $$\left(L_i \cap R_j\right) \cap \left(L_{i_2} \cap R_{j_2}\right) = \varnothing$$).


 * Importantly, if $$I = J$$ then in general, $$~\left(\bigcup_{i \in I} L_i\right) \cap \left(\bigcup_{i \in I} R_i\right) \color{Red}{\neq}\color{Black}{} \bigcup_{i \in I} \left(L_i \cap R_i\right)~$$ (an example of this is given below). The single union on the right hand side  be over all pairs $$(i, j) \in I \times I:$$ $$~\left(\bigcup_{i \in I} L_i\right) \cap \left(\bigcup_{i \in I} R_i\right) = \bigcup_{\stackrel{i \in I,}{j \in I}} \left(L_i \cap R_j\right).~$$ The same is usually true for other similar non-trivial set equalities and relations that depend on two (potentially unrelated) indexing sets $$I$$ and $$J$$ (such as $$ or $$). Two exceptions are $$ (unions of unions) and $$ (intersections of intersections), but both of these are among the most trivial of set equalities (although even for these equalities there is still something that must be proven ).
 * : Let $$X \neq \varnothing$$ and let $$I = \{1, 2\}.$$ Let $$L_1 \colon= R_2 \colon= X$$ and let $$L_2 \colon= R_1 \colon= \varnothing.$$ Then $$X = X \cap X = \left(L_1 \cup L_2\right) \cap \left(R_2 \cup R_2\right) = \left(\bigcup_{i \in I} L_i\right) \cap \left(\bigcup_{i \in I} R_i\right) ~\neq~ \bigcup_{i \in I} \left(L_i \cap R_i\right) = \left(L_1 \cap R_1\right) \cup \left(L_2 \cap R_2\right) = \varnothing \cup \varnothing = \varnothing.$$ Furthermore, $$\varnothing = \varnothing \cup \varnothing = \left(L_1 \cap L_2\right) \cup \left(R_2 \cap R_2\right) = \left(\bigcap_{i \in I} L_i\right) \cup \left(\bigcap_{i \in I} R_i\right) ~\neq~ \bigcap_{i \in I} \left(L_i \cup R_i\right) = \left(L_1 \cup R_1\right) \cap \left(L_2 \cup R_2\right) = X \cap X = X.$$

Binary ⋃ of arbitrary ⋂'s
and


 * Importantly, if $$I = J$$ then in general, $$~\left(\bigcap_{i \in I} L_i\right) \cup \left(\bigcap_{i \in I} R_i\right) \color{Red}{\neq}\color{Black}{} \bigcap_{i \in I} \left(L_i \cup R_i\right)~$$ (an example of this is given above). The single intersection on the right hand side  be over all pairs $$(i, j) \in I \times I:$$ $$~\left(\bigcap_{i \in I} L_i\right) \cup \left(\bigcap_{i \in I} R_i\right) = \bigcap_{\stackrel{i \in I,}{j \in I}} \left(L_i \cup R_j\right).~$$

Incorrectly distributing by swapping ⋂ and ⋃
Naively swapping $$\;{\textstyle\bigcup\limits_{i \in I}}\;$$ and $$\;{\textstyle\bigcap\limits_{j \in J}}\;$$ may produce a different set

The following inclusion always holds:

In general, equality need not hold and moreover, the right hand side depends on how for each fixed $$i \in I,$$ the sets $$\left(S_{i,j}\right)_{j \in J}$$ are labelled; and analogously, the left hand side depends on how for each fixed $$j \in J,$$ the sets $$\left(S_{i,j}\right)_{i \in I}$$ are labelled. An example demonstrating this is now given.

<ul> <li>Example of dependence on labeling and failure of equality: To see why equality need not hold when $$\cup$$ and $$\cap$$ are swapped, let $$I \colon= J \colon= \{1, 2\},$$ and let $$S_{11} = \{1, 2\},~S_{12} = \{1, 3\},~S_{21} = \{3, 4\},$$ and $$S_{22} = \{2, 4\}.$$ Then $$\{1, 4\} = \{1\} \cup \{4\} = \left(S_{11} \cap S_{12}\right) \cup \left(S_{21} \cap S_{22}\right) = \bigcup_{i \in I} \left(\bigcap_{j \in J} S_{i,j}\right) ~\neq~ \bigcap_{j \in J} \left(\bigcup_{i \in I} S_{i,j}\right) = \left(S_{11} \cup S_{21}\right) \cap \left(S_{12} \cup S_{22}\right) = \{1, 2, 3, 4\}.$$ If $$S_{11}$$ and $$S_{21}$$ are swapped while $$S_{12}$$ and $$S_{22}$$ are unchanged, which gives rise to the sets $$\hat{S}_{11} \colon= \{3, 4\},~\hat{S}_{12} \colon= \{1, 3\},~\hat{S}_{21} \colon= \{1, 2\},$$ and $$\hat{S}_{22} \colon= \{2, 4\},$$ then $$\{2, 3\} = \{3\} \cup \{2\} = \left(\hat{S}_{11} \cap \hat{S}_{12}\right) \cup \left(\hat{S}_{21} \cap \hat{S}_{22}\right) = \bigcup_{i \in I} \left(\bigcap_{j \in J} \hat{S}_{i,j}\right) ~\neq~ \bigcap_{j \in J} \left(\bigcup_{i \in I} \hat{S}_{i,j}\right) = \left(\hat{S}_{11} \cup \hat{S}_{21}\right) \cap \left(\hat{S}_{12} \cup \hat{S}_{22}\right) = \{1, 2, 3, 4\}.$$ In particular, the left hand side is no longer $$\{1, 4\},$$ which shows that the left hand side $${\textstyle\bigcup\limits_{i \in I}} \; {\textstyle\bigcap\limits_{j \in J}} S_{i,j}$$ depends on how the sets are labelled. If instead $$S_{11}$$ and $$S_{12}$$ are swapped while $$S_{21}$$ and $$S_{22}$$ are unchanged, which gives rise to the sets $$\overline{S}_{11} \colon= \{1, 3\},~ \overline{S}_{12} \colon= \{1, 2\},~ \overline{S}_{21} \colon= \{3, 4\},$$ and $$\overline{S}_{22} \colon= \{2, 4\},$$ then both the left hand side and right hand side are equal to $$\{1, 4\},$$ which shows that the right hand side also depends on how the sets are labeled.</li> </ul>

Equality in $$ can hold under certain circumstances, such as in $$, which is the special case where $$\left(S_{i,j}\right)_{(i,j) \in I \times J}$$ is $$\left(L_i \setminus R_j\right)_{(i,j) \in I \times J}$$ (that is, $$S_{i,j} \colon= L_i \setminus R_j$$ with the same indexing sets $$I$$ and $$J$$), or such as in $$, which is the special case where $$\left(S_{i,j}\right)_{(i,j) \in I \times J}$$ is $$\left(L_i \setminus R_j\right)_{(j, i) \in J \times I}$$ (that is, $$\hat{S}_{j,i} \colon= L_i \setminus R_j$$ with the indexing sets $$I$$ and $$J$$ swapped). For a correct formula that extends the distributive laws, an approach other than just switching $$\cup$$ and $$\cap$$ is needed.

Correct distributive laws
Suppose that for each $$i \in I,$$ $$J_i$$ is a non-empty index set and for each $$j \in J_i,$$ let $$T_{i,j}$$ be any set (for example, to apply this law to $$\left(S_{i,j}\right)_{(i, j) \in I \times J},$$ use $$J_i \colon= J$$ for all $$i \in I$$ and use $$T_{i,j} \colon= S_{i,j}$$ for all $$i \in I$$ and all $$j \in J_i = J$$). Let $${\textstyle \prod} J_{\bull} ~\stackrel{\scriptscriptstyle\text{def}}{=}~ \prod_{i \in I} J_i$$ denote the Cartesian product, which can be interpreted as the set of all functions $$f ~:~ I ~\to~ {\textstyle\bigcup\limits_{i \in I}} J_i$$ such that $$f(i) \in J_i$$ for every $$i \in I.$$ Such a function may also be denoted using the tuple notation $$\left(f_i\right)_{i \in I}$$ where $$f_i ~\stackrel{\scriptscriptstyle\text{def}}{=}~ f(i)$$ for every $$i \in I$$ and conversely, a tuple $$\left(f_i\right)_{i \in I}$$ is just notation for the function with domain $$I$$ whose value at $$i \in I$$ is $$f_i;$$ both notations can be used to denote the elements of $${\textstyle \prod} J_{\bull}.$$ Then

where $${\textstyle \prod} J_{\bull} ~\stackrel{\scriptscriptstyle\text{def}}{=}~ {\textstyle\prod\limits_{i \in I}} J_i.$$

Applying the distributive laws
$$\bigcap_{i \in I} \; \bigcup_{j \in J} S_{i,j} = \bigcup_{f \in J^I} \; \bigcap_{i \in I} S_{i,f(i)}$$ $$\bigcup_{i \in I} \; \bigcap_{j \in J} S_{i,j} = \bigcap_{f \in J^I} \; \bigcup_{i \in I} S_{i,f(i)}$$

which when combined with $$ implies: $$\bigcup_{i \in I} \; \bigcap_{j \in J} S_{i,j} ~=~ \bigcap_{f \in J^I} \; \bigcup_{i \in I} S_{i,f(i)} \color{Red}{\subseteq}\color{Black}{} \bigcup_{g \in I^J} \; \bigcap_{j \in J} S_{g(j),j} ~=~ \bigcap_{j \in J} \; \bigcup_{i \in I} S_{i,j}$$ where
 * on the left hand side, the indices $$f \text{ and } i$$ range over $$f \in J^I \text{ and } i \in I$$ (so the subscripts of $$S_{i,f(i)}$$ range over $$i \in I \text{ and } f(i) \in f(I) \subseteq J$$)
 * on the right hand side, the indices $$g \text{ and } j$$ range over $$g \in I^J \text{ and } j \in J$$ (so the subscripts of $$S_{g(j),j}$$ range over $$j \in J \text{ and } g(j) \in g(J) \subseteq I$$).

Every map $$f \in {\textstyle \prod} J_{\bull} ~\stackrel{\scriptscriptstyle\text{def}}{=}~ {\textstyle\prod\limits_{i \in I}} J_i = J_1 \times J_2 = K \times L$$ can be bijectively identified with the pair $$\left(f(1), f(2)\right) \in K \times L$$ (the inverse sends $$(k,l) \in K \times L$$ to the map $$f_{(k,l)} \in {\textstyle \prod} J_{\bull}$$ defined by $$1 \mapsto k$$ and $$2 \mapsto l;$$ this is technically just a change of notation). Recall that $$ was $$~\bigcap_{i \in I} \; \bigcup_{j \in J_i} T_{i,j} = \bigcup_{f \in {\textstyle \prod} J_{\bull}} \; \bigcap_{i \in I} T_{i,f(i)}.~$$ Expanding and simplifying the left hand side gives $$\bigcap_{i \in I} \; \bigcup_{j \in J_i} T_{i,j} = \left(\bigcup_{j \in J_1} T_{1,j}\right) \cap \left(\;\bigcup_{j \in J_2} T_{2,j}\right) = \left(\bigcup_{k \in K} T_{1,k}\right) \cap \left(\;\bigcup_{l \in L} T_{2,l}\right) = \left(\bigcup_{k \in K} C_k\right) \cap \left(\;\bigcup_{l \in L} D_l\right) $$ and doing the same to the right hand side gives: $$\bigcup_{f \in \prod J_{\bull}} \; \bigcap_{i \in I} T_{i,f(i)} = \bigcup_{f \in \prod J_{\bull}} \left(T_{1,f(1)} \cap T_{2,f(2)}\right) = \bigcup_{f \in \prod J_{\bull}} \left(C_{f(1)} \cap D_{f(2)}\right) = \bigcup_{(k,l) \in K \times L} \left(C_k \cap D_l\right) = \bigcup_{\stackrel{k \in K,}{l \in L}} \left(C_k \cap D_l\right). $$

Thus the general identity $$ reduces down to the previously given set equality $$: $$\left(\bigcup_{k \in K} C_k\right) \cap \;\bigcup_{l \in L} D_l = \bigcup_{\stackrel{k \in K,}{l \in L}} \left(C_k \cap D_l\right).$$

Distributing subtraction over ⋃ and ⋂
The next identities are known as De Morgan's laws.

The following four set equalities can be deduced from the equalities $$ - $$ above.

In general, naively swapping $$\;\cup\;$$ and $$\;\cap\;$$ may produce a different set (see this note for more details). The equalities $$\bigcup_{i \in I} \; \bigcap_{j \in J} \left(L_i \setminus R_j\right) ~=~ \bigcap_{j \in J} \; \bigcup_{i \in I} \left(L_i \setminus R_j\right) \quad \text{ and } \quad \bigcup_{j \in J} \; \bigcap_{i \in I} \left(L_i \setminus R_j\right) ~=~ \bigcap_{i \in I} \; \bigcup_{j \in J} \left(L_i \setminus R_j\right)$$ found in $$ and $$ are thus unusual in that they state exactly that swapping $$\;\cup\;$$ and $$\;\cap\;$$ will change the resulting set.

Commutativity and associativity of ⋃ and ⋂
Commutativity:

$$\bigcup_{\stackrel{i \in I,}{j \in J}} S_{i,j} \stackrel{\scriptscriptstyle\text{def}}{=}~ \bigcup_{(i, j) \in I \times J} S_{i,j} ~=~ \bigcup_{i \in I} \left(\bigcup_{j \in J} S_{i,j}\right) ~=~ \bigcup_{j \in J} \left(\bigcup_{i \in I} S_{i,j}\right)$$

$$\bigcap_{\stackrel{i \in I,}{j \in J}} S_{i,j} \stackrel{\scriptscriptstyle\text{def}}{=}~ \bigcap_{(i, j) \in I \times J} S_{i,j} ~=~ \bigcap_{i \in I} \left(\bigcap_{j \in J} S_{i,j}\right) ~=~ \bigcap_{j \in J} \left(\bigcap_{i \in I} S_{i,j}\right)$$

Unions of unions and intersections of intersections:

$$\left(\bigcup_{i \in I} L_i\right) \cup R ~=~ \bigcup_{i \in I} \left(L_i \cup R\right)$$ $$\left(\bigcap_{i \in I} L_i\right) \cap R ~=~ \bigcap_{i \in I} \left(L_i \cap R\right)$$ and

and if $$I = J$$ then also:

Intersections ⋂ of Π
If $$\left(S_{i,j}\right)_{(i,j) \in I \times J}$$ is a family of sets then


 * Moreover, a tuple $$\left(x_i\right)_{i \in I}$$ belongs to the set in $$ above if and only if $$x_i \in S_{i,j}$$ for all $$i \in I$$ and all $$j \in J.$$

In particular, if $$\left(L_i\right)_{i \in I}$$ and $$\left(R_i\right)_{i \in I}$$ are two families indexed by the same set then $$\left(\prod_{i \in I} L_i\right) \cap \prod_{i \in I} R_i ~=~ \prod_{i \in I} \left(L_i \cap R_i\right)$$ So for instance, $$(L \times R) \cap \left(L_2 \times R_2\right) ~=~ \left(L \cap L_2\right) \times \left(R \cap R_2\right)$$ $$(L \times R) \cap \left(L_2 \times R_2\right) \cap \left(L_3 \times R_3\right) ~=~ \left(L \cap L_2 \cap L_3\right) \times \left(R \cap R_2 \cap R_3\right)$$ and $$(L \times M \times R) \cap \left(L_2 \times M_2 \times R_2\right) ~=~ \left(L \cap L_2\right) \times \left(M \cap M_2\right) \times \left(R \cap R_2\right)$$

Intersections of products indexed by different sets

Let $$\left(L_i\right)_{i \in I}$$ and $$\left(R_j\right)_{j \in J}$$ be two families indexed by different sets.

Technically, $$I \neq J$$ implies $$\left({\textstyle\prod\limits_{i \in I}} L_i\right) \cap {\textstyle\prod\limits_{j \in J}} R_j = \varnothing.$$ However, sometimes these products are somehow identified as the same set through some bijection or one of these products is identified as a subset of the other via some injective map, in which case (by abuse of notation) this intersection may be equal to some other (possibly non-empty) set.
 * For example, if $$I := \{1, 2\}$$ and $$J := \{1, 2, 3\}$$ with all sets equal to $$\R$$ then $${\textstyle\prod\limits_{i \in I}} L_i = {\textstyle\prod\limits_{i \in \{1, 2\}}} \R = \R^2$$ and $${\textstyle\prod\limits_{j \in J}} R_j = {\textstyle\prod\limits_{j \in \{1, 2, 3\}}} \R = \R^3$$ where $$\R^2 \cap \R^3 = \varnothing$$, for example, $${\textstyle\prod\limits_{i \in \{1, 2\}}} \R = \R^2$$ is identified as a subset of $${\textstyle\prod\limits_{j \in \{1, 2, 3\}}} \R = \R^3$$ through some injection, such as maybe $$(x, y) \mapsto (x, y, 0)$$ for instance; however, in this particular case the product $${\textstyle\prod\limits_{i \in I = \{1, 2\}}} L_i$$ actually represents the $$J$$-indexed product $${\textstyle\prod\limits_{j \in J = \{1, 2, 3\}}} L_i$$ where $$L_3 := \{0\}.$$
 * For another example, take $$I := \{1, 2\}$$ and $$J := \{1, 2, 3\}$$ with $$L_1 := \R^2$$ and $$L_2, R_1, R_2, \text{ and } R_3$$ all equal to $$\R.$$ Then $${\textstyle\prod\limits_{i \in I}}L_i = \R^2 \times \R$$ and $${\textstyle\prod\limits_{j \in J}} R_j = \R \times \R \times \R,$$ which can both be identified as the same set via the bijection that sends $$((x, y), z) \in \R^2 \times \R$$ to $$(x, y, z) \in \R \times \R \times \R.$$ Under this identification, $$\left({\textstyle\prod\limits_{i \in I}} L_i\right) \cap \, {\textstyle\prod\limits_{j \in J}} R_j ~=~ \R^3.$$

Binary ⨯ distributes over arbitrary ⋃ and ⋂
The binary Cartesian product ⨯ distributes over arbitrary intersections (when the indexing set is not empty) and over arbitrary unions:

$$\begin{alignat}{5} L \times  \left(\bigcup_{i \in I} R_i\right) &\;=\;\;&& \bigcup_{i \in I} (L \times R_i) \qquad &&\text{ (Left-distributivity of } \,\times\, \text{ over } \,\cup\, \text{)} \\[1.4ex] L \times  \left(\bigcap_{i \in I} R_i\right) &\;=\;\;&& \bigcap_{i \in I} (L \times R_i) \qquad &&\text{ (Left-distributivity of } \,\times\, \text{ over } \,\bigcap_{i \in I}\, \text{ when } I \neq \varnothing\, \text{)} \\[1.4ex] \left(\bigcup_{i \in I} L_i\right) \times R &\;=\;\;&& \bigcup_{i \in I} (L_i \times R) \qquad &&\text{ (Right-distributivity of } \,\times\, \text{ over } \,\cup\, \text{)} \\[1.4ex] \left(\bigcap_{i \in I} L_i\right) \times R &\;=\;\;&& \bigcap_{i \in I} (L_i \times R) \qquad &&\text{ (Right-distributivity of } \,\times\, \text{ over } \,\bigcap_{i \in I}\, \text{ when } I \neq \varnothing\, \text{)} \\[1.4ex] \end{alignat}$$

Distributing arbitrary Π over arbitrary ⋃
Suppose that for each $$i \in I,$$ $$J_i$$ is a non-empty index set and for each $$j \in J_i,$$ let $$T_{i,j}$$ be any set (for example, to apply this law to $$\left(S_{i,j}\right)_{(i, j) \in I \times J},$$ use $$J_i \colon= J$$ for all $$i \in I$$ and use $$T_{i,j} \colon= S_{i,j}$$ for all $$i \in I$$ and all $$j \in J_i = J$$). Let $${\textstyle \prod} J_{\bull} ~\stackrel{\scriptscriptstyle\text{def}}{=}~ \prod_{i \in I} J_i$$ denote the Cartesian product, which (as mentioned above) can be interpreted as the set of all functions $$f ~:~ I ~\to~ {\textstyle\bigcup\limits_{i \in I}} J_i$$ such that $$f(i) \in J_i$$ for every $$i \in I$$. Then

where $${\textstyle \prod} J_{\bull} ~\stackrel{\scriptscriptstyle\text{def}}{=}~ {\textstyle\prod\limits_{i \in I}} J_i.$$

Unions ⋃ of Π
For unions, only the following is guaranteed in general: $$\bigcup_{j \in J} \; \prod_{i \in I} S_{i,j} \color{Red}{\subseteq}\color{Black}{} \prod_{i \in I} \; \bigcup_{j \in J} S_{i,j} \qquad \text{ and } \qquad \bigcup_{i \in I} \; \prod_{j \in J} S_{i,j} \color{Red}{\subseteq}\color{Black}{} \prod_{j \in J} \; \bigcup_{i \in I} S_{i,j}$$ where $$\left(S_{i,j}\right)_{(i,j) \in I \times J}$$ is a family of sets.


 * Example where equality fails: Let $$I = J = \{1, 2\},$$ let $$S_{1,1} = S_{2,2} = \varnothing,$$ let $$X \neq \varnothing,$$ and let $$S_{1,2} = S_{2,1} = X.$$ Then $$\varnothing = \varnothing \cup \varnothing = \left(\prod_{i \in I} S_{i,1}\right) \cup \left(\prod_{i \in I} S_{i,2}\right) = \bigcup_{j \in J} \; \prod_{i \in I} S_{i,j} \color{Red}{\neq}\color{Black}{} \prod_{i \in I} \; \bigcup_{j \in J} S_{i,j} = \left(\bigcup_{j \in J} S_{1,j}\right) \times \left(\bigcup_{j \in J} S_{2,j}\right) = X \times X.$$ More generally, $\varnothing = \bigcup_{j \in J} \; \prod_{i \in I} S_{i,j}$ if and only if for each $$j \in J,$$ at least one of the sets in the $$I$$-indexed collections of sets $$S_{\bullet,j} = \left(S_{i,j}\right)_{i\in I}$$ is empty, while $\prod_{i \in I} \; \bigcup_{j \in J} S_{i,j} \neq \varnothing$  if and only if for each $$i \in I,$$ at least one of the sets in the $$J$$-indexed collections of sets $$S_{i,\bullet} = \left(S_{i,j}\right)_{j\in J}$$ is not empty.

However, $$\begin{alignat}{9} \left(L \times R\right) ~\cup~ \left(L_2 \times R_2\right) ~&=~ \left[\left(L \setminus L_2\right) \times R\right] ~\cup~ \left[\left(L_2 \setminus L\right) \times R_2\right] ~\cup~ \left[\left(L \cap L_2\right) \times \left(R \cup R_2\right)\right] \\[0.5ex] ~&=~ \left[L \times \left(R \setminus R_2\right)\right] ~\cup~ \left[L_2 \times \left(R_2 \setminus R\right)\right] ~\cup~ \left[\left(L \cup L_2\right) \times \left(R \cap R_2\right)\right] \\ \end{alignat}$$

Difference \ of Π
If $$\left(L_i\right)_{i \in I}$$ and $$\left(R_i\right)_{i \in I}$$ are two families of sets then: $$\begin{alignat}{9} \left(\prod_{i \in I} L_i\right) ~\setminus~ \prod_{i \in I}R_i ~&=~ \;~ \bigcup_{j \in I} \; ~ \prod_{i \in I} \begin{cases}L_j \,\setminus\, R_j & \text{ if } i = j \\ L_i & \text{ if } i \neq j \\ \end{cases} \\[0.5ex] ~&=~ \;~ \bigcup_{j \in I} \; ~ \Big[\left(L_j \,\setminus\, R_j\right) ~\times~ \prod_{\stackrel{i \in I,}{j \neq i}} L_i\Big] \\[0.5ex] ~&=~ \bigcup_{\stackrel{j \in I,}{L_j \not\subseteq R_j}} \Big[\left(L_j \,\setminus\, R_j\right) ~\times~ \prod_{\stackrel{i \in I,}{j \neq i}} L_i\Big] \\[0.3ex] \end{alignat}$$ so for instance, $$\begin{alignat}{9} \left(L \times R\right) ~\setminus~ \left(L_2 \times R_2\right) ~&=~ \left[\left(L \,\setminus\, L_2\right) \times R\right] ~\cup~ \left[L \times \left(R \,\setminus\, R_2\right)\right] \\ \end{alignat}$$ and $$(L \times M \times R) ~\setminus~ \left(L_2 \times M_2 \times R_2\right) ~=~ \left[\left(L \,\setminus\, L_2\right) \times M \times R\right] ~\cup~ \left[L \times \left(M \,\setminus\, M_2\right) \times R\right] ~\cup~ \left[L \times M \times \left(R \,\setminus\, R_2\right)\right]$$

Symmetric difference ∆ of Π
$$\begin{alignat}{9} \left(\prod_{i \in I} L_i\right) ~\triangle~ \left(\prod_{i \in I} R_i\right) ~&=~ \;~ \left(\prod_{i \in I} L_i\right) ~\cup~ \left(\prod_{i \in I} R_i\right) \;\setminus\; \prod_{i \in I} L_i \cap R_i \\[0.5ex] \end{alignat}$$

Functions and sets
Let $$f : X \to Y$$ be any function.

Let $$L \text{ and } R$$ be completely arbitrary sets. Assume $$A \subseteq X \text{ and } C \subseteq Y.$$

Definitions
Let $$f : X \to Y$$ be any function, where we denote its $$X$$ by $$\operatorname{domain} f$$ and denote its  $$Y$$ by $$\operatorname{codomain} f.$$

Many of the identities below do not actually require that the sets be somehow related to $$f$$'s domain or codomain (that is, to $$X$$ or $$Y$$) so when some kind of relationship is necessary then it will be clearly indicated. Because of this, in this article, if $$L$$ is declared to be "," and it is not indicated that $$L$$ must be somehow related to $$X$$ or $$Y$$ (say for instance, that it be a subset $$X$$ or $$Y$$) then it is meant that $$L$$ is truly arbitrary. This generality is useful in situations where $$f : X \to Y$$ is a map between two subsets $$X \subseteq U$$ and $$Y \subseteq V$$ of some larger sets $$U$$ and $$V,$$ and where the set $$L$$ might not be entirely contained in $$X = \operatorname{domain} f$$ and/or $$Y = \operatorname{codomain} f$$ (e.g. if all that is known about $$L$$ is that $$L \subseteq U$$); in such a situation it may be useful to know what can and cannot be said about $$f(L)$$ and/or $$f^{-1}(L)$$ without having to introduce a (potentially unnecessary) intersection such as: $$f(L \cap X)$$ and/or $$f^{-1}(L \cap Y).$$

Images and preimages of sets

If $$L$$ is set then the  is defined to be the set: $$f(L) ~\stackrel{\scriptscriptstyle\text{def}}{=}~ \{\,f(l) ~:~ l \in L \cap \operatorname{domain} f\,\}$$ while the is: $$f^{-1}(L) ~\stackrel{\scriptscriptstyle\text{def}}{=}~ \{\,x \in \operatorname{domain} f ~:~ f(x) \in L\,\}$$ where if $$L = \{s\}$$ is a singleton set then the or  is $$f^{-1}(s) ~\stackrel{\scriptscriptstyle\text{def}}{=}~ f^{-1}(\{s\}) ~=~ \{\,x \in \operatorname{domain} f ~:~ f(x) = s\,\}.$$

Denote by $$\operatorname{Im} f$$ or $$\operatorname{image} f$$ the or  of $$f : X \to Y,$$ which is the set: $$\operatorname{Im} f ~\stackrel{\scriptscriptstyle\text{def}}{=}~ f(X) ~\stackrel{\scriptscriptstyle\text{def}}{=}~ f(\operatorname{domain} f) ~=~ \{f(x) ~:~ x \in \operatorname{domain} f\}.$$

Saturated sets

A set $$A$$ is said to be or a  if any of the following equivalent conditions are satisfied: <ol> <li>There exists a set $$R$$ such that $$A = f^{-1}(R).$$ <li>$$A = f^{-1}(f(A)).$$</li> <li>$$A \supseteq f^{-1}(f(A))$$ and $$A \subseteq \operatorname{domain} f.$$ <li>$$A \subseteq \operatorname{domain} f$$ and if $$a \in A$$ and $$x \in \operatorname{domain} f$$ satisfy $$f(x) = f(a),$$ then $$x \in A.$$ <li>Whenever a fiber of $$f$$ intersects $$A,$$ then $$A$$ contains the entire fiber. In other words, $$A$$ contains every $$f$$-fiber that intersects it.</li> <li>The intersection of $$A$$ with a fiber of $$f$$ is equal to the empty set or to the fiber itself. </li> </ol> For a set $$A$$ to be $$f$$-saturated, it is necessary that $$A \subseteq \operatorname{domain} f.$$
 * Any such set $$R$$ necessarily contains $$f(A)$$ as a subset.
 * Any set not entirely contained in the domain of $$f$$ cannot be $$f$$-saturated.</li>
 * The inclusion $$L \cap \operatorname{domain} f \subseteq f^{-1}(f(L))$$ always holds, where if $$A \subseteq \operatorname{domain} f$$ then this becomes $$A \subseteq f^{-1}(f(A)).$$</li>
 * Explicitly: whenever $$y \in \operatorname{Im} f$$ is such that $$A \cap f^{-1}(y) \neq \varnothing,$$ then $$f^{-1}(y) s\subseteq A.$$
 * In both this statement and the next, the set $$\operatorname{Im} f$$ may be replaced with any superset of $$\operatorname{Im} f$$ (such as $$\operatorname{codomain} f$$) and the resulting statement will still be equivalent to the rest.
 * Explicitly: for every $$y \in \operatorname{Im} f,$$ the intersection $$A \cap f^{-1}(y)$$ is equal to the empty set $$\varnothing$$ or to $$f^{-1}(y)$$ (that is, $$A \cap f^{-1}(y) = \varnothing$$ or $$A \cap f^{-1}(y) = f^{-1}(y)$$).

Compositions and restrictions of functions

If $$f$$ and $$g$$ are maps then $$g \circ f$$ denotes the map $$g \circ f ~:~ \{\,x \in \operatorname{domain} f ~:~ f(x) \in \operatorname{domain} g\,\} ~\to~ \operatorname{codomain} g$$ with domain and codomain $$\begin{alignat}{4} \operatorname{domain}  (g \circ f) &= \{\,x \in \operatorname{domain} f ~:~ f(x) \in \operatorname{domain}  g\,\} \\[0.4ex] \operatorname{codomain} (g \circ f) &= \operatorname{codomain} g \\[0.7ex] \end{alignat}$$ defined by $$(g \circ f)(x) ~\stackrel{\scriptscriptstyle\text{def}}{=}~ g(f(x)).$$

The denoted by $$f\big\vert_L,$$ is the map $$f\big\vert_L ~:~ L \cap \operatorname{domain} f ~\to~ Y$$ with $$\operatorname{domain} f\big\vert_L ~=~ L \cap \operatorname{domain} f$$ defined by sending $$x \in L \cap \operatorname{domain} f$$ to $$f(x);$$ that is, $$f\big\vert_L(x) ~\stackrel{\scriptscriptstyle\text{def}}{=}~ f (x).$$ Alternatively, $$~f\big\vert_L ~=~ f \circ \operatorname{In}~$$ where $$~\operatorname{In} ~:~ L \cap X \to X~$$ denotes the inclusion map, which is defined by $$\operatorname{In}(s) ~\stackrel{\scriptscriptstyle\text{def}}{=}~ s.$$

(Pre)Images of arbitrary unions ⋃'s and intersections ⋂'s
If $$\left(L_i\right)_{i \in I}$$ is a family of arbitrary sets indexed by $$I \neq \varnothing$$ then: $$\begin{alignat}{4} f\left(\bigcap_{i \in I} L_i\right)      \;&~\;\color{Red}{\subseteq}\color{Black}{}~ \;\;\;\bigcap_{i \in I} f\left(L_i\right) \\ f\left(\bigcup_{i \in I} L_i\right)      \;&~=~ \;\bigcup_{i \in I} f\left(L_i\right) \\ f^{-1}\left(\bigcup_{i \in I} L_i\right) \;&~=~ \;\bigcup_{i \in I} f^{-1}\left(L_i\right) \\ f^{-1}\left(\bigcap_{i \in I} L_i\right) \;&~=~ \;\bigcap_{i \in I} f^{-1}\left(L_i\right) \\ \end{alignat}$$

So of these four identities, it is  that are not always preserved. Preimages preserve all basic set operations. Unions are preserved by both images and preimages.

If all $$L_i$$ are $$f$$-saturated then $$\bigcap_{i \in I} L_i$$ be will be $$f$$-saturated and equality will hold in the first relation above; explicitly, this means:

If $$\left(A_i\right)_{i \in I}$$ is a family of arbitrary subsets of $$X = \operatorname{domain} f,$$ which means that $$A_i \subseteq X$$ for all $$i,$$ then $$ becomes:

(Pre)Images of binary set operations
Throughout, let $$L$$ and $$R$$ be any sets and let $$f : X \to Y$$ be any function.

Summary

As the table below shows, set equality is guaranteed  for  of: intersections, set subtractions, and symmetric differences.

Preimages preserve set operations

Preimages of sets are well-behaved with respect to all basic set operations:

$$\begin{alignat}{4} f^{-1}(L \cup R) ~&=~ f^{-1}(L) \cup f^{-1}(R) \\ f^{-1}(L \cap R) ~&=~ f^{-1}(L) \cap f^{-1}(R) \\ f^{-1}(L \setminus\, R) ~&=~ f^{-1}(L) \setminus\, f^{-1}(R) \\ f^{-1}(L \,\triangle\, R) ~&=~ f^{-1}(L) \,\triangle\, f^{-1}(R) \\ \end{alignat}$$

In words, preimages distribute over unions, intersections, set subtraction, and symmetric difference.

Images preserve unions

Images of unions are well-behaved:

$$\begin{alignat}{4} f(L \cup R) ~&=~ f(L) \cup f(R) \\ \end{alignat}$$

but images of the other basic set operations are since only the following are guaranteed in general:

$$\begin{alignat}{4} f(L \cap R) ~&\subseteq~ f(L) \cap f(R) \\ f(L \setminus R) ~&\supseteq~ f(L) \setminus f(R) \\ f(L \triangle R) ~&\supseteq~ f(L) \,\triangle\, f(R) \\ \end{alignat}$$

In words, images distribute over unions but not necessarily over intersections, set subtraction, or symmetric difference. What these latter three operations have in common is set subtraction: they either set subtraction $$L \setminus R$$ or else they can naturally  as the set subtraction of two sets: $$L \cap R = L \setminus (L \setminus R) \quad \text{ and } \quad L \triangle R = (L \cup R) \setminus (L \cap R).$$

If $$L = X$$ then $$f(X \setminus R) \supseteq f(X) \setminus f(R)$$ where as in the more general case, equality is not guaranteed. If $$f$$ is surjective then $$f(X \setminus R) ~\supseteq~ Y \setminus f(R),$$ which can be rewritten as: $$f\left(R^\complement\right) ~\supseteq~ f(R)^\complement$$ if $$R^\complement ~\stackrel{\scriptscriptstyle\text{def}}{=}~ X \setminus R$$ and $$f(R)^\complement ~\stackrel{\scriptscriptstyle\text{def}}{=}~ Y \setminus f(R).$$

Counter-examples: images of operations not distributing


If $$f : \{1, 2\} \to Y$$ is constant, $$L = \{1\},$$ and $$R = \{2\}$$ then all four of the set containments $$\begin{alignat}{4} f(L \cap R) ~&\subsetneq~ f(L) \cap f(R) \\ f(L \setminus R) ~&\supsetneq~ f(L) \setminus f(R) \\ f(X \setminus R) ~&\supsetneq~ f(X) \setminus f(R) \\ f(L \triangle R) ~&\supsetneq~ f(L) \triangle f(R) \\ \end{alignat}$$ are strict/proper (that is, the sets are not equal) since one side is the empty set while the other is non-empty. Thus equality is not guaranteed for even the simplest of functions. The example above is now generalized to show that these four set equalities can fail for any constant function whose domain contains at least two (distinct) points.



<ol> <li>The containment $$~f(L \setminus R) ~\supsetneq~ f(L) \setminus f(R)~$$ is strict: $$\{y\} ~=~ f(L \setminus R) ~\neq~ f(L) \setminus f(R) ~=~ \{y\} \setminus \{y\} ~=~ \varnothing$$ In words: functions might not distribute over set subtraction $\,\setminus\,$ </li> <li>The containment $$~f(X \setminus R) ~\supsetneq~ f(X) \setminus f(R)~$$ is strict: $$\{y\} ~=~ f(X \setminus R) ~\neq~ f(X) \setminus f(R) ~=~ \{y\} \setminus \{y\} ~=~ \varnothing.$$ </li> <li>The containment $$~f(L ~\triangle~ R) ~\supsetneq~ f(L) ~\triangle~ f(R)~$$ is strict: $$\{y\} ~=~ f\left(L ~\triangle~ R\right) ~\neq~ f(L) ~\triangle~ f(R) ~=~ \{y\} \triangle \{y\} ~=~ \varnothing$$ In words: functions might not distribute over symmetric difference $\,\triangle\,$ (which can be defined as the set subtraction of two sets: $$L \triangle R = (L \cup R) \setminus (L \cap R)$$). </li> <li>The containment $$~f(L \cap R) ~\subsetneq~ f(L) \cap f(R)~$$ is strict: $$\varnothing ~=~ f(\varnothing) ~=~ f(L \cap R) ~\neq~ f(L) \cap f(R) ~=~ \{y\} \cap \{y\} ~=~ \{y\}$$ In words: functions might not distribute over set intersection $\,\cap\,$ (which can be defined as the set subtraction of two sets: $$L \cap R = L \setminus (L \setminus R)$$). </li> </ol>

What the set operations in these four examples have in common is that they either set subtraction $$\setminus$$ (examples (1) and (2)) or else they can naturally  as the set subtraction of two sets (examples (3) and (4)).

Mnemonic: In fact, for each of the above four set formulas for which equality is not guaranteed, the direction of the containment (that is, whether to use $$\,\subseteq \text{ or } \supseteq\,$$) can always be deduced by imagining the function $$f$$ as being and the two sets ($$L$$ and $$R$$) as being non-empty disjoint subsets of its domain. This is because equality fails for such a function and sets: one side will be always be $$\varnothing$$ and the other non-empty − from this fact, the correct choice of $$\,\subseteq \text{ or } \supseteq\,$$ can be deduced by answering: "which side is empty?" For example, to decide if the $$?$$ in $$f(L \triangle R) \setminus f(R) ~\;~?~\;~ f((L \triangle R) \setminus R)$$ should be $$\,\subseteq \text{ or } \supseteq,\,$$ pretend that $$f$$ is constant and that $$L \triangle R$$ and $$R$$ are non-empty disjoint subsets of $$f$$'s domain; then the hand side would be empty (since $$f(L \triangle R) \setminus f(R) = \{f\text{'s single value}\} \setminus \{f\text{'s single value}\} = \varnothing$$), which indicates that $$\,?\,$$ should be $$\,\subseteq\,$$ (the resulting statement is always guaranteed to be true) because this is the choice that will make $$\varnothing = \text{left hand side} ~\;~?~\;~ \text{right hand side}$$ true. Alternatively, the correct direction of containment can also be deduced by consideration of any constant $$f : \{1, 2\} \to Y$$ with $$L = \{1\}$$ and $$R = \{2\}.$$

Furthermore, this mnemonic can also be used to correctly deduce whether or not a set operation always distribute over images or preimages; for example, to determine whether or not $$f(L \cap R)$$ always equals $$f(L) \cap f(R),$$ or alternatively, whether or not $$f^{-1}(L \cap R)$$ always equals $$f^{-1}(L) \cap f^{-1}(R)$$ (although $$\,\cap\,$$ was used here, it can replaced by $$\,\cup, \,\setminus, \text{ or } \,\triangle$$). The answer to such a question can, as before, be deduced by consideration of this constant function: the answer for the general case (that is, for arbitrary $$f, L,$$ and $$R$$) is always the same as the answer for this choice of (constant) function and disjoint non-empty sets.

Conditions guaranteeing that images distribute over set operations
Characterizations of when equality holds for sets:

For any function $$f : X \to Y,$$ the following statements are equivalent: <ol style="list-style-type: lower-latin;"> <li>$$f : X \to Y$$ is injective. </li> <li>$$f(L \cap R) = f(L) \,\cap\, f(R) \, \text{ for all } \, L, R \subseteq X.$$ (The equals sign $$\,=\,$$ can be replaced with $$\,\supseteq\,$$). </li> <li>$$f(L \,\setminus R) = f(L) \,\setminus\, f(R) \; \text{ for all } \, L, R \subseteq X.$$ (The equals sign $$\,=\,$$ can be replaced with $$\,\subseteq\,$$). </li> <li>$$f(X \setminus R) = f(X) \setminus\, f(R) \; \text{ for all } \, R \subseteq X.$$ (The equals sign $$\,=\,$$ can be replaced with $$\,\subseteq\,$$). </li> <li>$$f(L \,\triangle\, R) = f(L) \,\triangle\, f(R) \; \text{ for all } \, L, R \subseteq X.$$ (The equals sign $$\,=\,$$ can be replaced with $$\,\subseteq\,$$). </li> <li>Any one of the four statements (b) - (e) but with the words "for all" replaced with any one of the following: <ol style="list-style-type: lower-latin;"> <li>"for all singleton subsets" <li>"for all disjoint singleton subsets" <li>"for all disjoint subsets"</li> </ol> </li> </ol>
 * This means: $$f(x) \neq f(y)$$ for all distinct $$x, y \in X.$$
 * In particular, the statement that results from (d) gives a characterization of injectivity that explicitly involves only one point (rather than two): $$f$$ is injective if and only if $$f(x) \not\in f(X \setminus \{x\}) \; \text{ for every } \, x \in X.$$</li>
 * For statement (d), this is the same as: "for all singleton subsets" (because the definition of "pairwise disjoint" is satisfies vacuously by any family that consists of exactly 1 set).</li>

In particular, if a map is not known to be injective then barring additional information, there is no guarantee that any of the equalities in statements (b) - (e) hold.

An example above can be used to help prove this characterization. Indeed, comparison of that example with such a proof suggests that the example is representative of the fundamental reason why one of these four equalities in statements (b) - (e) might not hold (that is, representative of "what goes wrong" when a set equality does not hold).

Conditions for f(L⋂R) = f(L)⋂f(R)
$$f(L \cap R) ~\subseteq~ f(L) \cap f(R) \qquad\qquad \text{ always holds}$$

Characterizations of equality: The following statements are equivalent: <ol style="list-style-type: lower-latin;"> <li>$$f(L \cap R) ~=~ f(L) \cap f(R)$$</li> <li>$$f(L \cap R) ~\supseteq~ f(L) \cap f(R)$$</li> <li>$$L \cap f^{-1}(f(R)) ~\subseteq~ f^{-1}(f(L \cap R))$$ <li>$$R \cap f^{-1}(f(L)) ~\subseteq~ f^{-1}(f(L \cap R))$$</li> <li>$$L \cap f^{-1}(f(R)) ~=~ f^{-1}(f(L \cap R)) \cap L$$</li> <li>$$R \cap f^{-1}(f(L)) ~=~ f^{-1}(f(L \cap R)) \cap R$$</li> <li>If $$l \in L$$ satisfies $$f(l) \in f(R)$$ then $$f(l) \in f(L \cap R).$$</li> <li>If $$y \in f(L)$$ but $$y \notin f(L \cap R)$$ then $$y \notin f(R).$$</li> <li>$$f(L) \, \setminus \, f(L \cap R) ~\subseteq~ f(L) \, \setminus \, f(R)$$</li> <li>$$f(R) \, \setminus \, f(L \cap R) ~\subseteq~ f(R) \, \setminus \, f(L)$$</li> <li>$$f(L \cup R) \setminus f(L \cap R) ~\subseteq~ f(L) \,\triangle\, f(R)$$</li> <li>Any of the above three conditions (i) - (k) but with the subset symbol $$\,\subseteq\,$$ replaced with an equals sign $$\,=.\,$$</li> </ol>
 * The left hand side $$L \cap f^{-1}(f(R))$$ is always equal to $$L \cap f^{-1}(f(L) \cap f(R))$$ (because $$L \cap f^{-1}(f(R)) ~\subseteq~ f^{-1}(f(L))$$ always holds).</li>

Sufficient conditions for equality: Equality holds if any of the following are true: <ol style="list-style-type: lower-latin;"> <li>$$f$$ is injective. </li> <li>The restriction $$f\big\vert_{L \cup R}$$ is injective.</li> <li>$$f^{-1}(f(R)) ~\subseteq~ R$$ </li> <li>$$f^{-1}(f(L)) ~\subseteq~ L$$ </li> <li>$$R$$ is $$f$$-saturated; that is, $$f^{-1}(f(R)) = R$$ </li> <li>$$L$$ is $$f$$-saturated; that is, $$f^{-1}(f(L)) = L$$</li> <li>$$f(L) ~\subseteq~ f(L \cap R)$$</li> <li>$$f(R) ~\subseteq~ f(L \cap R)$$</li> <li>$$f(L \,\setminus\, R) ~\subseteq~ f(L) \setminus \, f(R)$$ or equivalently, $$f(L \,\setminus\, R) ~=~ f(L) \setminus f(R)$$</li> <li>$$f(R \,\setminus\, L) ~\subseteq~ f(R) \setminus \, f(L)$$ or equivalently, $$f(R \,\setminus\, L) ~=~ f(R) \setminus f(L)$$</li> <li>$$f\left(L ~\triangle~ R\right) \subseteq f(L) ~\triangle~ f(R)$$ or equivalently, $$f\left(L ~\triangle~ R\right) = f(L) ~\triangle~ f(R)$$</li> <li>$$R \cap \operatorname{domain} f \,\subseteq L$$</li> <li>$$L \cap \operatorname{domain} f \,\subseteq R$$</li> <li>$$R \subseteq L$$</li> <li>$$L \subseteq R$$</li> </ol>

In addition, the following always hold: $$f\left(f^{-1}(L) \cap R\right) ~=~ L \cap f(R)$$ $$f\left(f^{-1}(L) \cup R\right) ~=~ (L \cap \operatorname{Im} f) \cup f(R)$$

Conditions for f(L\R) = f(L)\f(R)
$$f(L \setminus R) ~\supseteq~ f(L) \setminus f(R) \qquad\qquad \text{ always holds}$$

Characterizations of equality: The following statements are equivalent: <ol style="list-style-type: lower-latin;"> <li>$$f(L \setminus R) ~=~ f(L) \setminus f(R)$$</li> <li>$$f(L \setminus R) ~\subseteq~ f(L) \setminus f(R)$$</li> <li>$$L \cap f^{-1}(f(R)) ~\subseteq~ R$$</li> <li>$$L \cap f^{-1}(f(R)) ~=~ L \cap R \cap \operatorname{domain} f$$</li> <li>Whenever $$y \in f(L) \cap f(R)$$ then $$L \cap f^{-1}(y) \subseteq R.$$</li> <li>$f(L) \cap f(R) ~\subseteq~ \left\{y \in f(L) : L \cap f^{-1}(y) \subseteq R\right\}$ <li>$f(L) \cap f(R) ~=~ \left\{y \in f(L) : L \cap f^{-1}(y) \subseteq R\right\}$ </ol>
 * The set on the right hand side is always equal to $$\left\{y \in f(L \cap R) : L \cap f^{-1}(y) \,\subseteq R\right\}.$$</li>
 * This is the above condition (f) but with the subset symbol $$\,\subseteq\,$$ replaced with an equals sign $$\,=.\,$$</li>

Necessary conditions for equality (excluding characterizations): If equality holds then the following are necessarily true: <ol style="list-style-type: lower-latin;"> <li>$$f(L \cap R) = f(L) \cap f(R),$$ or equivalently $$f(L \cap R) \supseteq f(L) \cap f(R).$$</li> <li>$$L \cap f^{-1}(f(R)) ~=~ L \cap f^{-1}(f(L \cap R))$$ or equivalently, $$L \cap f^{-1}(f(R)) ~\subseteq~ f^{-1}(f(L \cap R))$$</li> <li>$$R \cap f^{-1}(f(L)) ~=~ R \cap f^{-1}(f(L \cap R))$$</li> </ol>

Sufficient conditions for equality: Equality holds if any of the following are true: <ol style="list-style-type: lower-latin;"> <li>$$f$$ is injective.</li> <li>The restriction $$f\big\vert_{L \cup R}$$ is injective.</li> <li>$$f^{-1}(f(R)) ~\subseteq~ R$$ or equivalently, $$R \cap \operatorname{domain} f ~=~ f^{-1}(f(R))$$</li> <li>$$R$$ is $$f$$-saturated; that is, $$R = f^{-1}(f(R)).$$ </li> <li>$$f\left(L ~\triangle~ R\right) \subseteq f(L) ~\triangle~ f(R)$$ or equivalently, $$f\left(L ~\triangle~ R\right) = f(L) ~\triangle~ f(R)$$</li> </ol>

Conditions for f(X\R) = f(X)\f(R)
$$f(X \setminus R) ~\supseteq~ f(X) \setminus f(R) \qquad\qquad \text{ always holds, where } f : X \to Y$$

Characterizations of equality: The following statements are equivalent: <ol style="list-style-type: lower-latin;"> <li>$$f(X \setminus R) ~=~ f(X) \setminus f(R)$$</li> <li>$$f(X \setminus R) ~\subseteq~ f(X) \setminus f(R)$$</li> <li>$$f^{-1}(f(R)) \,\subseteq\, R$$</li> <li>$$f^{-1}(f(R)) \,=\, R \cap \operatorname{domain} f$$</li> <li>$$R \cap \operatorname{domain} f$$ is $$f$$-saturated.</li> <li>Whenever $$y \in f(R)$$ then $$f^{-1}(y) \subseteq R.$$</li> <li>$f(R) ~\subseteq~ \left\{ y \in f(R) : f^{-1}(y) \subseteq R \right\}$ </li> <li>$f(R) ~=~ \left\{ y \in f(R) : f^{-1}(y) \subseteq R \right\}$ </li> </ol> where if $$R \subseteq \operatorname{domain} f$$ then this list can be extended to include: <ol style="list-style-type: lower-latin;" start=9> <li>$$R$$ is $$f$$-saturated; that is, $$R = f^{-1}(f(R)).$$</li> </ol>

Sufficient conditions for equality: Equality holds if any of the following are true: <ol style="list-style-type: lower-latin;"> <li>$$f$$ is injective.</li> <li>$$R$$ is $$f$$-saturated; that is, $$R = f^{-1}(f(R)).$$</li> </ol>

Conditions for f(L∆R) = f(L)∆f(R)
$$f\left(L ~\triangle~ R\right) ~\supseteq~ f(L) ~\triangle~ f(R) \qquad\qquad \text{ always holds}$$

Characterizations of equality: The following statements are equivalent: <ol style="list-style-type: lower-latin;"> <li>$$f\left(L ~\triangle~ R\right) = f(L) ~\triangle~ f(R)$$</li> <li>$$f\left(L ~\triangle~ R\right) \subseteq f(L) ~\triangle~ f(R)$$</li> <li>$$f(L \,\setminus\, R) = f(L) \,\setminus\, f(R)$$ and  $$f(R \,\setminus\, L) = f(R) \,\setminus\, f(L)$$</li> <li>$$f(L \,\setminus\, R) \subseteq f(L) \,\setminus\, f(R)$$ and  $$f(R \,\setminus\, L) \subseteq f(R) \,\setminus\, f(L)$$</li> <li>$$L \cap f^{-1}(f(R)) ~\subseteq~ R$$ and  $$R \cap f^{-1}(f(L)) ~\subseteq~ L$$ <li>$$L \cap f^{-1}(f(R)) ~=~ R \cap f^{-1}(f(L))$$ <li>$$L \cap f^{-1}(f(L \cap R)) ~=~ R \cap f^{-1}(f(L \cap R))$$ and  $$f(L \cap R) ~\supseteq~ f(L) \cap f(R).$$</li> </ol>
 * The inclusions $$L \cap f^{-1}(f(R)) ~\subseteq~ f^{-1}(f(L))$$ and $$R \cap f^{-1}(f(L)) ~\subseteq~ f^{-1}(f(R))$$ always hold.</li>
 * If this above set equality holds, then this set will also be equal to both $$L \cap R \cap \operatorname{domain} f$$ and $$L \cap R \cap f^{-1}(f(L \cap R)).$$</li>

Necessary conditions for equality (excluding characterizations): If equality holds then the following are necessarily true: <ol style="list-style-type: lower-latin;"> <li>$$f(L \cap R) = f(L) \cap f(R),$$ or equivalently $$f(L \cap R) \supseteq f(L) \cap f(R).$$</li> <li>$$L \cap f^{-1}(f(L \cap R)) ~=~ R \cap f^{-1}(f(L \cap R))$$</li> </ol>

Sufficient conditions for equality: Equality holds if any of the following are true: <ol style="list-style-type: lower-latin;"> <li>$$f$$ is injective.</li> <li>The restriction $$f\big\vert_{L \cup R}$$ is injective.</li> </ol>

Formulas for f(L\R) =
For any function $$f : X \to Y$$ and any sets $$L$$ and $$R,$$ $$\begin{alignat}{4} f(L \setminus R) &= Y \;\,\, \setminus \left\{ y \in Y ~\;\,  ~:~ L \cap f^{-1}(y) \subseteq R \right\} \\[0.4ex] &= f(L)       \setminus \left\{ y \in f(L)~\,      ~:~ L \cap f^{-1}(y) \subseteq R \right\} \\[0.4ex] &= f(L)       \setminus \left\{ y \in f(L \cap R)        ~:~ L \cap f^{-1}(y) \subseteq R \right\} \\[0.4ex] &= f(L)       \setminus \left\{ y \in V\,    ~:~ L \cap f^{-1}(y) \subseteq R \right\} \qquad && \text{ for any superset } \quad V \supseteq f(L \cap R) \\[0.4ex] &= f(S)       \setminus \left\{ y \in f(S)~\,      ~:~ L \cap f^{-1}(y) \subseteq R \right\} \qquad && \text{ for any superset } \quad S \supseteq L \cap X. \\[0.7ex] \end{alignat}$$

Formulas for f(X\R) =
Taking $$L := X = \operatorname{domain} f$$ in the above formulas gives: $$\begin{alignat}{4} f(X \setminus R) &= Y \;\,\,           \setminus \left\{ y \in Y ~\;\,\,           :~ f^{-1}(y) \subseteq R \right\} \\[0.4ex] &= f(X)                  \setminus \left\{ y \in f(X) ~                 :~ f^{-1}(y) \subseteq R \right\} \\[0.4ex] &= f(X)                  \setminus \left\{ y \in f(R) ~                 :~ f^{-1}(y) \subseteq R \right\} \\[0.4ex] &= f(X)                  \setminus \left\{ y \in W \;\,\,            :~ f^{-1}(y) \subseteq R \right\} \qquad \text{ for any superset } \quad W \supseteq f(R) \\[0.4ex] \end{alignat}$$ where the set $$\left\{ y \in f(R) : f^{-1}(y) \subseteq R \right\}$$ is equal to the image under $$f$$ of the largest $$f$$-saturated subset of $$R.$$ <ul> <li>In general, only $$f(X \setminus R) \,\supseteq\, f(X) \setminus f(R)$$ always holds and equality is not guaranteed; but replacing "$$f(R)$$" with its subset "$$\left\{ y \in f(R) : f^{-1}(y) \subseteq R \right\}$$" results in a formula in which equality is guaranteed: $$f(X \setminus R) \,=\, f(X) \setminus \left\{ y \in f(R) : f^{-1}(y) \subseteq R \right\}.$$ From this it follows that: $$f(X \setminus R) = f(X) \setminus f(R) \quad \text{ if and only if } \quad f(R) = \left\{ y \in f(R) : f^{-1}(y) \subseteq R \right\} \quad \text{ if and only if } \quad f^{-1}(f(R)) \subseteq R.$$ </li> <li>If $$f_R := \left\{y \in f(X) : f^{-1}(y) \subseteq R\right\}$$ then $$f(X \setminus R) = f(X) \setminus f_R,$$ which can be written more symmetrically as $$f(X \setminus R) = f_X \setminus f_R$$ (since $$f_X = f(X)$$). </li> </ul>

Formulas for f(L∆R) =
It follows from $$L \,\triangle\, R = (L \cup R) \setminus (L \cap R)$$ and the above formulas for the image of a set subtraction that for any function $$f : X \to Y$$ and any sets $$L$$ and $$R,$$ $$\begin{alignat}{4} f(L \,\triangle\, R) &= Y \;\;\; \setminus \left\{ y \in Y \,\;\,~  ~:~ L \cap f^{-1}(y) = R \cap f^{-1}(y)\right\} \\[0.4ex] &= f(L \cup R) \setminus \left\{ y \in f(L \cup R)       ~:~ L \cap f^{-1}(y) = R \cap f^{-1}(y)\right\} \\[0.4ex] &= f(L \cup R) \setminus \left\{ y \in f(L \cap R)       ~:~ L \cap f^{-1}(y) = R \cap f^{-1}(y)\right\} \\[0.4ex] &= f(L \cup R) \setminus \left\{ y \in V \,  ~:~ L \cap f^{-1}(y) = R \cap f^{-1}(y)\right\} \qquad && \text{ for any superset } \quad V \supseteq f(L \cap R) \\[0.4ex] &= f(S) \,\,~\, \setminus \left\{ y \in f(S) \,\; ~:~ L \cap f^{-1}(y) = R \cap f^{-1}(y)\right\} \qquad && \text{ for any superset } \quad S \supseteq (L \cup R) \cap X. \\[0.7ex] \end{alignat}$$

Formulas for f(L) =
It follows from the above formulas for the image of a set subtraction that for any function $$f : X \to Y$$ and any set $$L,$$$$\begin{alignat}{4} f(L) &= Y \;\,          \setminus \left\{y \in Y \;\,           ~:~ f^{-1}(y) \cap L = \varnothing\right\} \\[0.4ex] &= \operatorname{Im} f \setminus \left\{y \in \operatorname{Im} f ~:~ f^{-1}(y) \cap L = \varnothing\right\} \\[0.4ex] &= W \,            \setminus \left\{y \in W \;\,            ~:~ f^{-1}(y) \cap L = \varnothing\right\} \qquad \text{ for any superset } \quad W \supseteq f(L) \\[0.7ex] \end{alignat}$$

This is more easily seen as being a consequence of the fact that for any $$y \in Y,$$ $$f^{-1}(y) \cap L = \varnothing$$ if and only if $$y \not\in f(L).$$

Formulas for f(L⋂R) =
It follows from the above formulas for the image of a set that for any function $$f : X \to Y$$ and any sets $$L$$ and $$R,$$ $$\begin{alignat}{4} f(L \cap R) &= Y \setminus \left\{y \in Y ~:~ L \cap R \cap f^{-1}(y) = \varnothing\right\}       && \\[0.4ex] &= f(L)  \setminus \left\{y \in f(L)   ~:~ L \cap R \cap f^{-1}(y) = \varnothing\right\}        && \\[0.4ex] &= f(L)  \setminus \left\{y \in U ~:~ L \cap R \cap f^{-1}(y) = \varnothing\right\} \qquad && \text{ for any superset } \quad U \supseteq f(L) \\[0.4ex] &= f(R)  \setminus \left\{y \in f(R)   ~:~ L \cap R \cap f^{-1}(y) = \varnothing\right\}        && \\[0.4ex] &= f(R)  \setminus \left\{y \in V ~:~ L \cap R \cap f^{-1}(y) = \varnothing\right\} \qquad && \text{ for any superset } \quad V \supseteq f(R) \\[0.4ex] &= f(L) \cap f(R) \setminus \left\{y \in f(L) \cap f(R) ~:~ L \cap R \cap f^{-1}(y) = \varnothing\right\}       && \\[0.7ex] \end{alignat}$$ where moreover, for any $$y \in Y,$$
 * $$L \cap f^{-1}(y) \subseteq L \setminus R~$$ if and only if $$~L \cap R \cap f^{-1}(y) = \varnothing~$$ if and only if $$~R \cap f^{-1}(y) \subseteq R \setminus L~$$ if and only if $$~y \not\in f(L \cap R).$$

The sets $$U$$ and $$V$$ mentioned above could, in particular, be any of the sets $$f(L \cup R), \;\operatorname{Im} f,$$ or $$Y,$$ for example.

(Pre)Images of set operations on (pre)images
Let $$L$$ and $$R$$ be arbitrary sets, $$f : X \to Y$$ be any map, and let $$A \subseteq X$$ and $$C \subseteq Y.$$

(Pre)Images of operations on images

Since $$f(L) \setminus f(L \setminus R) ~=~ \left\{y \in f(L \cap R) ~:~ L \cap f^{-1}(y) \subseteq R\right\},$$

$$\begin{alignat}{4} f^{-1}(f(L) \setminus f(L \setminus R)) &=&& f^{-1}\left(\left\{y \in f(L \cap R) ~:~ L \cap f^{-1}(y) \subseteq R\right\}\right) \\ &=&& \left\{x \in f^{-1}(f(L \cap R)) ~:~ L \cap f^{-1}(f(x)) \subseteq R\right\} \\ \end{alignat}$$

Since $$f(X) \setminus f(L \setminus R) ~=~ \left\{y \in f(X) ~:~ L \cap f^{-1}(y) \subseteq R\right\},$$ $$\begin{alignat}{4} f^{-1}(Y \setminus f(L \setminus R)) &~=~&& f^{-1}(f(X) \setminus f(L \setminus R)) \\ &=&& f^{-1}\left(\left\{y \in f(X) ~:~ L \cap f^{-1}(y) \subseteq R\right\}\right) \\ &=&& \left\{x \in X ~:~ L \cap f^{-1}(f(x)) \subseteq R\right\} \\ &~=~&& X \setminus f^{-1}(f(L \setminus R)) \\ \end{alignat}$$

Using $$L := X,$$ this becomes $$~f(X) \setminus f(X \setminus R) ~=~ \left\{y \in f(R) ~:~ f^{-1}(y) \subseteq R\right\}~$$ and $$\begin{alignat}{4} f^{-1}(Y \setminus f(X \setminus R)) &~=~&& f^{-1}(f(X) \setminus f(X \setminus R)) \\ &=&& f^{-1}\left(\left\{y \in f(R) ~:~ f^{-1}(y) \subseteq R\right\}\right) \\ &=&& \left\{r \in R \cap X ~:~ f^{-1}(f(r)) \subseteq R\right\} \\ &\subseteq&& R \\ \end{alignat}$$ and so $$\begin{alignat}{4} f^{-1}(Y \setminus f(L)) &~=~&& f^{-1}(f(X) \setminus f(L)) \\ &=&& f^{-1}\left(\left\{y \in f(X \setminus L) ~:~ f^{-1}(y) \cap L = \varnothing\right\}\right) \\ &=&& \{x \in X \setminus L ~:~ f(x) \not\in f(L)\} \\ &=&& X \setminus f^{-1}(f(L)) \\ &\subseteq&& X \setminus L \\ \end{alignat}$$

(Pre)Images and Cartesian products Π
Let $$\prod Y_{\bull} ~\stackrel{\scriptscriptstyle\text{def}}{=}~ \prod_{j \in J} Y_j$$ and for every $$k \in J,$$ let $$\pi_k ~:~ \prod_{j \in J} Y_j ~\to~ Y_k$$ denote the canonical projection onto $$Y_k.$$

Definitions

Given a collection of maps $$F_j : X \to Y_j$$ indexed by $$j \in J,$$ define the map $$\begin{alignat}{4} \left(F_j\right)_{j \in J} :\;&& X &&\;\to\;   & \prod_{j \in J} Y_j \\[0.3ex] && x &&\;\mapsto\;& \left(F_j\left(x_j\right)\right)_{j \in J}, \\ \end{alignat}$$ which is also denoted by $$F_{\bull} = \left(F_j\right)_{j \in J}.$$ This is the unique map satisfying $$\pi_j \circ F_{\bull} = F_j \quad \text{ for all } j \in J.$$

Conversely, if given a map $$F ~:~ X ~\to~ \prod_{j \in J} Y_j$$ then $$F = \left(\pi_j \circ F\right)_{j \in J}.$$ Explicitly, what this means is that if $$F_k ~\stackrel{\scriptscriptstyle\text{def}}{=}~ \pi_k \circ F ~:~ X ~\to~ Y_k$$ is defined for every $$k \in J,$$ then $$F$$ the unique map satisfying: $$\pi_j \circ F = F_j$$ for all $$j \in J;$$ or said more briefly, $$F = \left(F_j\right)_{j \in J}.$$

The map $$F_{\bull} = \left(F_j\right)_{j \in J} ~:~ X ~\to~ \prod_{j \in J} Y_j$$ should not be confused with the Cartesian product $$\prod_{j \in J} F_j$$ of these maps, which is by definition is the map $$\begin{alignat}{4} \prod_{j \in J} F_j :\;&& \prod_{j \in J} X         &&~\;\to\;~    & \prod_{j \in J} Y_j \\[0.3ex] && \left(x_j\right)_{j \in J} &&~\;\mapsto\;~& \left(F_j\left(x_j\right)\right)_{j \in J} \\ \end{alignat}$$ with domain $$\prod_{j \in J} X = X^J$$ rather than $$X.$$

Preimage and images of a Cartesian product

Suppose $$F_{\bull} = \left(F_j\right)_{j \in J} ~:~ X ~\to~ \prod_{j \in J} Y_j.$$

If $$A ~\subseteq~ X$$ then $$F_{\bull}(A) \;\color{Red}{\subseteq}\color{Black}{}\; \prod_{j \in J} F_j(A).$$

If $$B ~\subseteq~ \prod_{j \in J} Y_j$$ then $$F_{\bull}^{-1}(B) \;\color{Red}{\subseteq}\color{Black}{}\; \bigcap_{j \in J} F_j^{-1}\left(\pi_j(B)\right)$$ where equality will hold if $$B = \prod_{j \in J} \pi_j(B),$$ in which case $F_{\bull}^{-1}(B) = \displaystyle\bigcap_{j \in J} F_j^{-1}\left(\pi_j(B)\right)$ and

For equality to hold, it suffices for there to exist a family $$\left(B_j\right)_{j \in J}$$ of subsets $$B_j \subseteq Y_j$$ such that $$B = \prod_{j \in J} B_j,$$ in which case:

and $$\pi_j(B) = B_j$$ for all $$j \in J.$$

Containments ⊆ and intersections ⋂ of images and preimages
Equivalences and implications of images and preimages

Intersection of a set and a (pre)image

The following statements are equivalent: <ol> <li>$$\varnothing = f(L) \cap R$$</li> <li>$$\varnothing = L \cap f^{-1}(R)$$</li> <li>$$\varnothing = f^{-1}(f(L)) \cap f^{-1}(R)$$</li> <li>$$\varnothing = f^{-1}(f(L) \cap R)$$</li> </ol>

Thus for any $$t,$$ $$t \not\in f(L) \quad \text{ if and only if } \quad L \cap f^{-1}(t) = \varnothing.$$

Definitions
A or simply a  is a set whose elements are sets. A is a family of subsets of $$X.$$

The of a set $$X$$ is the set of all subsets of $$X$$: $$\wp(X) ~\colon=~ \{\; S ~:~ S \subseteq X\; \}.$$

Notation for sequences of sets

Throughout, $$S \text{ and } T$$ will be arbitrary sets and $$S_{\bull}$$ and will denote a net or a sequence of sets where if it is a sequence then this will be indicated by either of the notations $$S_{\bull} = \left(S_i\right)_{i=1}^{\infty} \qquad \text{ or } \qquad S_{\bull} = \left(S_i\right)_{i \in \N}$$ where $$\N$$ denotes the natural numbers. A notation $$S_{\bull} = \left(S_i\right)_{i \in I}$$ indicates that $$S_{\bull}$$ is a net directed by $$(I, \leq),$$ which (by definition) is a sequence if the set $$I,$$ which is called the net's indexing set, is the natural numbers (that is, if $$I = \N$$) and $$\,\leq\,$$ is the natural order on $$\N.$$

Disjoint and monotone sequences of sets

If $$S_i \cap S_j = \varnothing$$ for all distinct indices $$i \neq j$$ then $$S_{\bull}$$ is called a or simply a. A sequence or net $$S_{\bull}$$ of set is called or  if (resp.  or ) if for all indices $$i \leq j,$$ $$S_i \subseteq S_j$$ (resp. $$S_i \supseteq S_j$$). A sequence or net $$S_{\bull}$$ of set is called (resp. ) if it is non-decreasing (resp. is non-increasing) and also $$S_i \neq S_j$$ for all  indices $$i \text{ and } j.$$ It is called if it is non-decreasing or non-increasing and it is called  if it is strictly increasing or strictly decreasing.

A sequences or net $$S_{\bull}$$ is said to denoted by $$S_{\bull} \uparrow S$$ or $$S_{\bull} \nearrow S,$$ if $$S_{\bull}$$ is increasing and the union of all $$S_i$$ is $$S;$$ that is, if $$\bigcup_{n} S_n = S \qquad \text{ and } \qquad S_i \subseteq S_j \quad \text{ whenever } i \leq j.$$ It is said to denoted by $$S_{\bull} \downarrow S$$ or $$S_{\bull} \searrow S,$$ if $$S_{\bull}$$ is increasing and the intersection of all $$S_i$$ is $$S$$ that is, if $$\bigcap_{n} S_n = S \qquad \text{ and } \qquad S_i \supseteq S_j \quad \text{ whenever } i \leq j.$$

Definitions of elementwise operations on families

If $$\mathcal{L} \text{ and } \mathcal{R}$$ are families of sets and if $$S$$ is any set then define: $$\mathcal{L} \;(\cup)\; \mathcal{R} ~\colon=~ \{~ L \cup R ~:~ L \in \mathcal{L} ~\text{ and }~ R \in \mathcal{R} ~\}$$ $$\mathcal{L} \;(\cap)\; \mathcal{R} ~\colon=~ \{~ L \cap R ~:~ L \in \mathcal{L} ~\text{ and }~ R \in \mathcal{R} ~\}$$ $$\mathcal{L} \;(\setminus)\; \mathcal{R} ~\colon=~ \{~ L \setminus R ~:~ L \in \mathcal{L} ~\text{ and }~ R \in \mathcal{R} ~\}$$ $$\mathcal{L} \;(\triangle)\; \mathcal{R} ~\colon=~ \{~ L \;\triangle\; R ~:~ L \in \mathcal{L} ~\text{ and }~ R \in \mathcal{R} ~\}$$ $$\mathcal{L}\big\vert_S ~\colon=~ \{ L \cap S ~:~ L \in \mathcal{L} \} = \mathcal{L} \;(\cap)\; \{S\}$$ which are respectively called  ,  , ' (') ',  , and the '/ The regular union, intersection, and set difference are all defined as usual and are denoted with their usual notation: $$\mathcal{L} \cup \mathcal{R}, \mathcal{L} \cap \mathcal{R}, \mathcal{L} \;\triangle\; \mathcal{R},$$ and $$\mathcal{L} \setminus \mathcal{R},$$ respectively. These elementwise operations on families of sets play an important role in, among other subjects, the theory of filters and prefilters on sets.

The of a family $$\mathcal{L} \subseteq \wp(X)$$ is the family: $$\mathcal{L}^{\uparrow X} ~\colon=~ \bigcup_{L \in \mathcal{L}} \{\; S ~:~ L \subseteq S \subseteq X \;\} ~=~ \{\; S \subseteq X ~:~ \text{ there exists } L \in \mathcal{L} \text{ such that } L \subseteq S \;\}$$ and the is the family: $$\mathcal{L}^{\downarrow} ~\colon=~ \bigcup_{L \in \mathcal{L}} \wp(L) ~=~ \{\; S ~:~ \text{ there exists } L \in \mathcal{L} \text{ such that } S \subseteq L \;\}.$$

Definitions of categories of families of sets
A family $$\mathcal{L}$$ is called, , or in $$X$$ if $$\mathcal{L} \subseteq \wp(X)$$ and $$\mathcal{L} = \mathcal{L}^{\uparrow X}.$$ A family $$\mathcal{L}$$ is called if $$\mathcal{L} = \mathcal{L}^{\downarrow}.$$

A family $$\mathcal{L}$$ is said to be:
 * (resp. ) if whenever $$L, R \in \mathcal{L}$$ then $$L \cap R \in \mathcal{L}$$ (respectively, $$L \cup R \in \mathcal{L}$$).
 * (resp. ) if whenever $$L_1, L_2, L_3, \ldots$$ are elements of $$\mathcal{L}$$ then so is their intersections $$\bigcap_{i=1}^{\infty} L_i := L_1 \cap L_2 \cap L_3 \cap \cdots$$ (resp. so is their union $$\bigcup_{i=1}^{\infty} L_i := L_1 \cup L_2 \cup L_3 \cup \cdots$$).
 * (or ) if whenever $$L \in \mathcal{L}$$ then $$X \setminus L \in \mathcal{L}.$$

A family $$\mathcal{L}$$ of sets is called a/an:
 * if $$\mathcal{L} \neq \varnothing$$ and $$\mathcal{L}$$ is closed under finite-intersections.
 * Every non-empty family $$\mathcal{L}$$ is contained in a unique smallest (with respect to $$\subseteq$$) π−system that is denoted by $$\pi(\mathcal{L})$$ and called
 * and is said to have if $$\mathcal{L} \neq \varnothing$$ and $$\varnothing \not\in \pi(\mathcal{L}).$$
 * if $$\mathcal{L} \neq \varnothing$$ is a family of subsets of $$X$$ that is a π−system, is upward closed in $$X,$$ and is also, which by definition means that it does not contain the empty set as an element.
 * or if it is a non-empty family of subsets of some set $$X$$ whose upward closure in $$X$$ is a filter on $$X.$$
 * is a non-empty family of subsets of $$X$$ that contains the empty set, forms a π−system, and is also closed under complementation with respect to $$X.$$
 * is an algebra on $$X$$ that is closed under countable unions (or equivalently, closed under countable intersections).

Sequences of sets often arise in measure theory.

Algebra of sets

A family $$\Phi$$ of subsets of a set $$X$$ is said to be  if $$\varnothing \in \Phi$$ and for all $$L, R \in \Phi,$$ all three of the sets $$X \setminus R, \,L \cap R,$$ and $$L \cup R$$ are elements of $$\Phi.$$ The article on this topic lists set identities and other relationships these three operations.

Every algebra of sets is also a ring of sets and a π-system.

Algebra generated by a family of sets

Given any family $$\mathcal{S}$$ of subsets of $$X,$$ there is a unique smallest algebra of sets in $$X$$ containing $$\mathcal{S}.$$ It is called  and it will be denote it by $$\Phi_{\mathcal{S}}.$$ This algebra can be constructed as follows:

<ol> <li>If $$\mathcal{S} = \varnothing$$ then $$\Phi_{\mathcal{S}} = \{\varnothing, X\}$$ and we are done. Alternatively, if $$\mathcal{S}$$ is empty then $$\mathcal{S}$$ may be replaced with $$\{\varnothing\}, \{X\}, \text{ or } \{\varnothing, X\}$$ and continue with the construction.</li> <li>Let $$\mathcal{S}_0$$ be the family of all sets in $$\mathcal{S}$$ together with their complements (taken in $$X$$).</li> <li>Let $$\mathcal{S}_1$$ be the family of all possible finite intersections of sets in $$\mathcal{S}_0.$$ </li> <li>Then the algebra generated by $$\mathcal{S}$$ is the set $$\Phi_{\mathcal{S}}$$ consisting of all possible finite unions of sets in $$\mathcal{S}_1.$$</li> </ol>

Elementwise operations on families
Let $$\mathcal{L}, \mathcal{M},$$ and $$\mathcal{R}$$ be families of sets over $$X.$$ On the left hand sides of the following identities, $$\mathcal{L}$$ is the eft most family, $$\mathcal{M}$$ is in the iddle, and $$\mathcal{R}$$ is the ight most set.

Commutativity: $$\mathcal{L} \;(\cup)\; \mathcal{R} = \mathcal{R} \;(\cup)\; \mathcal{L}$$ $$\mathcal{L} \;(\cap)\; \mathcal{R} = \mathcal{R} \;(\cap)\; \mathcal{L}$$

Associativity: $$[\mathcal{L} \;(\cup)\; \mathcal{M}] \;(\cup)\; \mathcal{R} = \mathcal{L} \;(\cup)\; [\mathcal{M} \;(\cup)\; \mathcal{R}]$$ $$[\mathcal{L} \;(\cap)\; \mathcal{M}] \;(\cap)\; \mathcal{R} = \mathcal{L} \;(\cap)\; [\mathcal{M} \;(\cap)\; \mathcal{R}]$$

Identity: $$\mathcal{L} \;(\cup)\; \{\varnothing\} = \mathcal{L}$$ $$\mathcal{L} \;(\cap)\; \{X\} = \mathcal{L}$$ $$\mathcal{L} \;(\setminus)\; \{\varnothing\} = \mathcal{L}$$

Domination: $$\mathcal{L} \;(\cup)\; \{X\} = \{X\} ~\text{ if } \mathcal{L} \neq \varnothing$$ $$\mathcal{L} \;(\cap)\; \{\varnothing\} = \{\varnothing\} ~\text{ if } \mathcal{L} \neq \varnothing$$ $$\mathcal{L} \;(\cup)\; \varnothing = \varnothing$$ $$\mathcal{L} \;(\cap)\; \varnothing = \varnothing$$ $$\mathcal{L} \;(\setminus)\; \varnothing = \varnothing$$ $$\varnothing \;(\setminus)\; \mathcal{R} = \varnothing$$

Power set
$$\wp(L \cap R) ~=~ \wp(L) \cap \wp(R)$$ $$\wp(L \cup R) ~=~ \wp(L) \ (\cup)\ \wp(R) ~\supseteq~ \wp(L) \cup \wp(R).$$

If $$L$$ and $$R$$ are subsets of a vector space $$X$$ and if $$s$$ is a scalar then $$\wp(s L) ~=~ s \wp(L)$$ $$\wp(L + R) ~\supseteq~ \wp(L) + \wp(R).$$

Sequences of sets
Suppose that $$L$$ is any set such that $$L \supseteq R_i$$ for every index $$i.$$ If $$R_\bull$$ decreases to $$R$$ then $$L \setminus R_\bull := \left(L \setminus R_i\right)_i$$ increases to $$L \setminus R$$ whereas if instead $$R_\bull$$ increases to $$R$$ then $$L \setminus R_\bull$$ decreases to $$L \setminus R.$$

If $$L \text{ and } R$$ are arbitrary sets and if $$L_\bull = \left(L_i\right)_i$$ increases (resp. decreases) to $$L$$ then $$\left(L_i \setminus R\right)_i$$ increase (resp. decreases) to $$L \setminus R.$$

Partitions
Suppose that $$S_\bull = \left(S_i\right)_{i = 1}^\infty$$ is any sequence of sets, that $$S \subseteq \bigcup_i S_i$$ is any subset, and for every index $$i,$$ let $$D_i = \left(S_i \cap S\right) \setminus \bigcup_{m=1}^i \left(S_m \cap S\right).$$ Then $$S = \bigcup_i D_i$$ and $$D_\bull := \left(D_i\right)_{i=1}^\infty$$ is a sequence of pairwise disjoint sets.

Suppose that $$S_\bull = \left(S_i\right)_{i = 1}^\infty$$ is non-decreasing, let $$S_0 = \varnothing,$$ and let $$D_i = S_i \setminus S_{i-1}$$ for every $$i = 1, 2, \ldots.$$ Then $$\bigcup_i S_i = \bigcup_i D_i$$ and $$D_\bull = \left(D_i\right)_{i=1}^\infty$$ is a sequence of pairwise disjoint sets.