{
  "id": "disjoint-union",
  "title": "Disjoint Union",
  "lang": "en",
  "source_lang": "en",
  "summary": "A disjoint union combines sets while preserving each element’s source, using tags when necessary to keep overlapping elements distinct.",
  "category": "mathematics",
  "subcategory": "discrete-logic",
  "type": "concept",
  "aliases": [
    "Tagged union",
    "Disjoint sum"
  ],
  "generated_at": "2026-11-05",
  "model": "pro/gpt-6.1-sol",
  "url": "https://aiwiki.page/en/disjoint-union/",
  "translations": {
    "zh-Hans": {
      "url": "https://aiwiki.page/zh/disjoint-union/",
      "json": "https://aiwiki.page/zh/disjoint-union.json"
    }
  },
  "sections": [
    {
      "heading": "",
      "text": "A disjoint union is a construction in set theory that combines a family of sets while retaining the identity of the set from which each element comes. Elements are given tags identifying their source, so that the same element occurring in different sets produces distinct elements in the result. The term also refers to an ordinary union of sets already known to be pairwise disjoint. Disjoint unions provide the coproduct construction for sets and have corresponding forms in topology, measure theory, and type theory."
    },
    {
      "heading": "Definition and notation",
      "text": "Let \\((A_i)_{i\\in I}\\) be a family of sets indexed by a set \\(I\\). Its tagged disjoint union is\n\n\\[\\bigsqcup_{i\\in I}A_i = \\{(x,i):i\\in I,\\ x\\in A_i\\}.\\]\n\nEach ordered pair \\((x,i)\\) records both an element \\(x\\) and its source index \\(i\\). Consequently,\n\n\\[(x,i)=(y,j) \\quad\\Longleftrightarrow\\quad x=y\\ \\text{and}\\ i=j.\\]\n\nSome authors put the index first, writing \\((i,x)\\); this gives an equivalent construction.\n\nFor two sets, a common definition is\n\n\\[A\\sqcup B=(A\\times\\{0\\})\\cup(B\\times\\{1\\}),\\]\n\nwhere \\(\\times\\) denotes the Cartesian product. The tags \\(0\\) and \\(1\\) are arbitrary distinct labels. Other notation includes \\(\\amalg\\) and the categorical symbol \\(\\coprod\\); notation varies between subjects.\n\nFor each \\(i\\in I\\), there is a canonical injection\n\n\\[\\iota_i:A_i\\longrightarrow\\bigsqcup_{j\\in I}A_j, \\qquad \\iota_i(x)=(x,i).\\]\n\nThe images \\(\\iota_i(A_i)\\) are pairwise disjoint and together exhaust the disjoint union. The construction therefore replaces each original set with a separate copy of it."
    },
    {
      "heading": "Difference from ordinary union",
      "text": "An ordinary union identifies equal elements regardless of where they occur. A tagged disjoint union does not.\n\nFor example, let\n\n\\[A=\\{1,2\\}, \\qquad B=\\{2,3\\}.\\]\n\nThen\n\n\\[A\\cup B=\\{1,2,3\\},\\]\n\nwhereas\n\n\\[A\\sqcup B=\\{(1,0),(2,0),(2,1),(3,1)\\}.\\]\n\nThe ordinary union has three elements; the disjoint union has four. The two occurrences of \\(2\\) remain distinct because their tags differ. In particular, \\(A\\sqcup A\\) consists of two separate copies of \\(A\\), unlike \\(A\\cup A=A\\).\n\nThere is always a tag-forgetting function\n\n\\[q:\\bigsqcup_{i\\in I}A_i\\longrightarrow\\bigcup_{i\\in I}A_i, \\qquad q(x,i)=x.\\]\n\nThis function is surjective. It is injective exactly when the original family is pairwise disjoint, and in that case it is a bijection.\n\nThis explains the second common use of the terminology. If the sets \\(A_i\\) are already pairwise disjoint, authors may write\n\n\\[X=\\bigsqcup_{i\\in I}A_i\\]\n\nto assert that \\(X\\) is their ordinary union and that no two distinct members overlap. Here the notation expresses a property of the decomposition, rather than an explicit tagging construction.\n\nA partition of a set is a decomposition into nonempty, pairwise disjoint subsets. Disjoint unions are more general: their components may be empty, repeated, or overlapping before tags are introduced."
    },
    {
      "heading": "Universal property",
      "text": "The essential structural feature of a disjoint union is its universal property. Given a set \\(Y\\) and a function\n\n\\[f_i:A_i\\to Y\\]\n\nfor every \\(i\\in I\\), there is exactly one function\n\n\\[f:\\bigsqcup_{i\\in I}A_i\\to Y\\]\n\nsuch that\n\n\\[f\\circ\\iota_i=f_i \\qquad\\text{for every }i\\in I.\\]\n\nIt is defined by\n\n\\[f(x,i)=f_i(x).\\]\n\nThus, specifying a function out of a disjoint union is equivalent to specifying a function separately on every component. The tags make these definitions compatible automatically. For an ordinary union of overlapping sets, separate functions can be combined only if they agree wherever their domains overlap.\n\nIn category theory, this property says that a disjoint union is a coproduct in the category of sets. It characterizes the construction up to a unique bijection that respects the component injections. The particular choice of tags is therefore incidental.\n\nThe corresponding statement is not true for arbitrary functions into a disjoint union: such a function need not have its entire image in one component. It may select a different component for each input."
    },
    {
      "heading": "Cardinality and elementary identities",
      "text": "Disjoint union defines addition of cardinalities:\n\n\\[\\left|\\bigsqcup_{i\\in I}A_i\\right| = \\sum_{i\\in I}|A_i|.\\]\n\nFor finite sets, this is the rule that counting separate groups requires adding their sizes, without subtracting overlaps because the tagged copies do not overlap.\n\nThere are canonical bijections\n\n\\[A\\sqcup B\\cong B\\sqcup A,\\]\n\n\\[(A\\sqcup B)\\sqcup C\\cong A\\sqcup(B\\sqcup C),\\]\n\nand\n\n\\[A\\sqcup\\varnothing\\cong A,\\]\n\nwhere \\(\\varnothing\\) is the empty set. These are generally bijections rather than literal equalities: different constructions can use different nested tags.\n\nCartesian product distributes over disjoint union:\n\n\\[X\\times\\left(\\bigsqcup_{i\\in I}A_i\\right) \\cong \\bigsqcup_{i\\in I}(X\\times A_i).\\]\n\nA bijection sends \\((x,(a,i))\\) to \\(((x,a),i)\\). The disjoint union of a family indexed by the empty set is empty."
    },
    {
      "heading": "Topological disjoint union",
      "text": "For a family of topological spaces \\((X_i)_{i\\in I}\\), the underlying tagged disjoint union carries a natural topology, called the disjoint union topology or sum topology. A subset \\(U\\) is open exactly when\n\n\\[\\iota_i^{-1}(U)\\]\n\nis open in \\(X_i\\) for every \\(i\\).\n\nEach injection identifies \\(X_i\\) with its image equipped with the subspace topology. Each component image is both an open set and a closed set. A function from the disjoint union to another topological space is continuous if and only if its restriction to every component is continuous. This makes the construction a coproduct of topological spaces.\n\nSeveral consequences distinguish this topology from merely decomposing a set:\n\n- If at least two components are nonempty, the sum is not a connected space.\n- A disjoint union is a compact space exactly when each component is compact and only finitely many components are nonempty.\n- A decomposition into pairwise disjoint subspaces need not reproduce the original topology as a topological sum.\n\nFor example, the real line is the set-theoretic disjoint union of its singleton subsets. The topological sum of those singletons is discrete, however, and is not the usual topology of the real line."
    },
    {
      "heading": "Other uses and distinctions",
      "text": "In measure theory, measurable spaces \\((X_i,\\Sigma_i)\\) have a disjoint-union measurable structure: a subset is measurable when its inverse image under every component injection belongs to \\(\\Sigma_i\\). Given measures \\(\\mu_i\\), a measure on this space is\n\n\\[\\mu(E)=\\sum_{i\\in I}\\mu_i\\bigl(\\iota_i^{-1}(E)\\bigr),\\]\n\nwith an arbitrary sum of nonnegative terms interpreted as the supremum of its finite partial sums.\n\nIn type theory and programming languages, binary disjoint unions appear as sum types. A value records either an element of one type or an element of another, together with a constructor identifying the alternative. Functions on such values are defined by case analysis.\n\nIn graph theory, a disjoint union combines separate copies of graphs without adding edges between different copies.\n\nDisjoint union must be distinguished from the direct sum of algebraic structures. A tagged union of two vector spaces, for example, does not by itself define addition between vectors belonging to different components. Its underlying set is therefore not the usual vector-space direct sum. More generally, the coproduct in a category depends on the structure and structure-preserving maps involved; it is not always constructed by taking a disjoint union of underlying sets."
    }
  ],
  "links": [
    "set-theory",
    "set-mathematics",
    "ordered-pair",
    "cartesian-product",
    "injective-function",
    "mathematical-function",
    "bijective-function",
    "set-partition",
    "universal-property",
    "category-theory",
    "cardinality",
    "empty-set",
    "topological-space",
    "subspace-topology",
    "open-set",
    "continuous-function",
    "connected-space",
    "compact-space",
    "real-number",
    "measure-theory",
    "type-theory",
    "graph-theory",
    "direct-sum"
  ],
  "sources": [],
  "license": "https://creativecommons.org/licenses/by/4.0/"
}