# Disjoint union

{{ safesubst:#invoke:Unsubst||$N=Refimprove |date=__DATE__ |$B= {{#invoke:Message box|ambox}} }}

In set theory, the **disjoint union** (or **discriminated union**) of a family of sets is a modified union operation that indexes the elements according to which set they originated in; disjoint sets have no element in common.

When one says that a set is the disjoint union of a family of subsets, this means that it is the union of the subsets and that the subsets are pairwise disjoint.

## Example

Disjoint union of sets = {1, 2, 3} and = {1, 2} can be computed by finding:

so

## Set theory definition

Formally, let {*A*_{i} : *i* ∈ *I*} be a family of sets indexed by *I*. The **disjoint union** of this family is the set

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

Through this isomorphism, one may consider that *A*_{i} is canonically embedded in the disjoint union.
For *i* ≠ *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* ∈ *I*, the disjoint union is the Cartesian product of *A* and *I*:

One may occasionally see the notation

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.

Disjoint unions are also sometimes written or .

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 is referred to as a *copy* of and the notation 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 is frequently used, instead of , to denote *coproduct*.

## See also

- Coproduct
- Disjoint union (topology)
- Disjoint union of graphs
- Partition of a set
- Tagged union
- Union (computer science)