Type Set operation Set theory The disjoint union ${\displaystyle 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. ${\displaystyle \bigsqcup _{i\in I}A_{i}=\bigcup _{i\in I}\left\{(x,i):x\in A_{i}\right\}}$

In mathematics, a disjoint union (or discriminated union) of a family of sets ${\displaystyle (A_{i}:i\in I)}$ is a set ${\displaystyle A,}$ often denoted by ${\textstyle \bigsqcup _{i\in I}A_{i},}$ with an injection of each ${\displaystyle A_{i}}$ into ${\displaystyle A,}$ such that the images of these injections form a partition of ${\displaystyle A}$ (that is, each element of ${\displaystyle 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 ${\textstyle \coprod _{i\in I}A_{i}}$ is often used.

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

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

## Example

Consider the sets ${\displaystyle A_{0}=\{5,6,7\}}$ and ${\displaystyle A_{1}=\{5,6\}.}$ It is possible to index the set elements according to set origin by forming the associated sets {\displaystyle {\begin{aligned}A_{0}^{*}&=\{(5,0),(6,0),(7,0)\}\\A_{1}^{*}&=\{(5,1),(6,1)\},\\\end{aligned}}}

where the second element in each pair matches the subscript of the origin set (for example, the ${\displaystyle 0}$ in ${\displaystyle (5,0)}$ matches the subscript in ${\displaystyle A_{0},}$ etc.). The disjoint union ${\displaystyle A_{0}\sqcup A_{1}}$ can then be calculated as follows:

${\displaystyle 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 ${\displaystyle \left\{A_{i}:i\in I\right\}}$ be a family of sets indexed by ${\displaystyle I.}$ The disjoint union of this family is the set

${\displaystyle \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 ${\displaystyle (x,i).}$ Here ${\displaystyle i}$ serves as an auxiliary index that indicates which ${\displaystyle A_{i}}$ the element ${\displaystyle x}$ came from.

Each of the sets ${\displaystyle A_{i}}$ is canonically isomorphic to the set

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

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

${\displaystyle \bigsqcup _{i\in I}A_{i}=A\times I.}$

Occasionally, the notation

${\displaystyle \sum _{i\in I}A_{i}}$
is used for the disjoint union of a family of sets, or the notation ${\displaystyle 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 ${\displaystyle A_{i}^{*}}$ is referred to as a copy of ${\displaystyle A_{i}}$ and the notation ${\displaystyle {\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 ${\displaystyle \coprod }$ is frequently used, instead of ${\displaystyle \bigsqcup ,}$ to denote coproduct.