Disjoint union

In mathematics, the disjoint union (or discriminated union) $$A \sqcup B$$ of the sets $A$ and $B$ is the set formed from the elements of $A$ and $B$ labelled (indexed) with the name of the set from which they come. So, an element belonging to both $A$ and $B$ appears twice in the disjoint union, with two different labels.

A disjoint union of an indexed family of sets $$(A_i : i\in I)$$ is a set $$A,$$ often denoted by $\bigsqcup_{i \in I} A_i,$ with an injection of each $$A_i$$ into $$A,$$ such that the images of these injections form a partition of $$A$$ (that is, each element of $$A$$ belongs to exactly one of these images). A disjoint union of a family of pairwise disjoint sets is their union.

In category theory, the disjoint union is the coproduct of the category of sets, and thus defined up to a bijection. In this context, the notation $\coprod_{i\in I} A_i$ is often used.

The disjoint union of two sets $$A$$ and $$B$$ is written with infix notation as $$A \sqcup B$$. Some authors use the alternative notation $$A \uplus B$$ or $$A \operatorname{{\cup}\!\!\!{\cdot}\,} B$$ (along with the corresponding $\biguplus_{i\in I} A_i$ or $\operatorname{{\bigcup}\!\!\!{\cdot}\,}_{i\in I} A_i$ ).

A standard way for building the disjoint union is to define $$A$$ as the set of ordered pairs $$(x, i)$$ such that $$x \in A_i,$$ and the injection $$A_i \to A$$ as $$x \mapsto (x, i).$$

Example
Consider the sets $$A_0 = \{5, 6, 7\}$$ and $$A_1 = \{5, 6\}.$$ It is possible to index the set elements according to set origin by forming the associated sets $$\begin{align} A^*_0 & = \{(5, 0), (6, 0), (7, 0)\} \\ A^*_1 & = \{(5, 1), (6, 1)\}, \\ \end{align} $$

where the second element in each pair matches the subscript of the origin set (for example, the $$0$$ in $$(5, 0)$$ matches the subscript in $$A_0,$$ etc.). The disjoint union $$A_0 \sqcup A_1$$ can then be calculated as follows: $$A_0 \sqcup A_1 = A^*_0 \cup A^*_1 = \{(5, 0), (6, 0), (7, 0), (5, 1), (6, 1)\}.$$

Set theory definition
Formally, let $$\left(A_i : i \in I\right)$$ be an indexed family of sets indexed by $$I.$$ The disjoint union of this family is the set $$\bigsqcup_{i \in I} A_i = \bigcup_{i \in I} \left\{(x, i) : x \in A_i\right\}.$$ The elements of the disjoint union are ordered pairs $$(x, i).$$ Here $$i$$ serves as an auxiliary index that indicates which $$A_i$$ the element $$x$$ came from.

Each of the sets $$A_i$$ is canonically isomorphic to the set $$A_i^* = \left\{(x,i) : x \in A_i\right\}.$$ Through this isomorphism, one may consider that $$A_i$$ is canonically embedded in the disjoint union. For $$i \neq j,$$ the sets $$A_i^*$$ and $$A_j^*$$ are disjoint even if the sets $$A_i$$ and $$A_j$$ are not.

In the extreme case where each of the $$A_i$$ is equal to some fixed set $$A$$ for each $$i \in I,$$ the disjoint union is the Cartesian product of $$A$$ and $$I$$: $$\bigsqcup_{i \in I} A_i = A \times I.$$

Occasionally, the notation $$\sum_{i \in I} A_i$$ is used for the disjoint union of a family of sets, or the notation $$A + B$$ for the disjoint union of two sets. This notation is meant to be suggestive of the fact that the cardinality of the disjoint union is the sum of the cardinalities of the terms in the family. Compare this to the notation for the Cartesian product of a family of sets.

In the language of category theory, the disjoint union is the coproduct in the category of sets. It therefore satisfies the associated universal property. This also means that the disjoint union is the categorical dual of the Cartesian product construction. See Coproduct for more details.

For many purposes, the particular choice of auxiliary index is unimportant, and in a simplifying abuse of notation, the indexed family can be treated simply as a collection of sets. In this case $$A_i^*$$ is referred to as a of $$A_i$$ and the notation $$\underset{A \in C}{\,\,\bigcup\nolimits^{*}\!} A$$ is sometimes used.

Category theory point of view
In category theory the disjoint union is defined as a coproduct in the category of sets.

As such, the disjoint union is defined up to an isomorphism, and the above definition is just one realization of the coproduct, among others. When the sets are pairwise disjoint, the usual union is another realization of the coproduct. This justifies the second definition in the lead.

This categorical aspect of the disjoint union explains why $$\coprod$$ is frequently used, instead of $$\bigsqcup,$$ to denote coproduct.