This article is about the operation on sets. For the computer science meaning of the term, see Tagged union. For the operation on graphs, see disjoint union of graphs.
In mathematics, the disjoint union (or discriminated union) 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 is a set often denoted by with an injection of each into such that the images of these injections form a partition of (that is, each element of belongs to exactly one of these images). A disjoint union of a family of pairwise disjoint sets is their union.
The disjoint union of two sets and is written with infix notation as . Some authors use the alternative notation or (along with the corresponding or ).
A standard way for building the disjoint union is to define as the set of ordered pairs such that and the injection as
Example
Consider the sets and It is possible to index the set elements according to set origin by forming the associated sets
where the second element in each pair matches the subscript of the origin set (for example, the in matches the subscript in etc.). The disjoint union can then be calculated as follows:
Set theory definition
Formally, let be an indexed family of sets indexed by The disjoint union of this family is the set
The elements of the disjoint union are ordered pairs Here serves as an auxiliary index that indicates which the element came from.
Each of the sets is canonically isomorphic to the set
Through this isomorphism, one may consider that is canonically embedded in the disjoint union.
For the sets and are disjoint even if the sets and are not.
In the extreme case where each of the is equal to some fixed set for each the disjoint union is the Cartesian product of and :
Occasionally, the notation
is used for the disjoint union of a family of sets, or the notation 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.
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.
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.
Direct limit – Special case of colimit in category theory
Disjoint union (topology) – space formed by equipping the disjoint union of the underlying sets with a natural topology called the disjoint union topologyPages displaying wikidata descriptions as a fallback
Sum type – Data structure used to hold a value that could take on several different, but fixed, typesPages displaying short descriptions of redirect targets
Tagged union – Data structure used to hold a value that could take on several different, but fixed, types
Union (computer science) – Data type that allows for values that are one of multiple different data typesPages displaying short descriptions of redirect targets