Given any family of sets, the (external) disjoint union (also written , , etc) of the family is the set of all (ordered) pairs with in the index set and in .
As stated, the type of the second element of such a pair depends on the first element, which is natural in dependent type theory (see at dependent sum type) and no problem for material set theory, but it may be ill formed in a structural set theory or in some forms of type theory, especially those based on the internal language of topos theory. Alternatively, one may define to be the set of those elements of the cartesian product of the power sets such that there is exactly one index such that is inhabited and that is a singleton. If you're trying to be predicative too, then you may need to simply adopt the existence of disjoint unions as an axiom (the axiom of disjoint unions) in your foundations, stating the following facts about it.
There is a natural injection (mapping to , or mapping to ) for each index . Conversely, for each element of , there is a unique index and such that is in the image of the injection from . It is common to treat as a subset of ; so if no confusion can result (in particular, when the notation for an element of always makes the ambient set clear), one often suppresses the index in the notation for an element of the disjoint union.
Given sets and , the disjoint union of the binary family is written (also , , etc); its elements may be written (if care is needed) as and , and , and , and in many other styles.
Given sets through , the disjoint union of the -ary family is written (or similarly); its elements may be written (if care is needed) as for and .
Given sets , , etc, the disjoint union of the countably infinitary family is written (or similarly); its elements may be written (if care is needed) as for a natural number and .
Given a set , the disjoint union of the unary family may be identified with itself; that is, we identify for the unique index with .
The disjoint union of the empty family is empty; it has no elements.
If a family of subsets of a given set are all pairwise disjoint (that is, has an element only if , for any indices and ), then the union is naturally bijective with the (external) disjoint union defined above. Conversely, given an external disjoint union , each may be identified with a subset of (as explained above); these subsets are all pairwise disjoint, and their union is the entire disjoint union.
Accordingly, a union of pairwise disjoint subsets may be called an internal disjoint union. (Compare the internal vs external notions of direct sum.)