{
  "id": "set-union",
  "title": "Set Union",
  "lang": "en",
  "source_lang": "en",
  "summary": "The union of a collection of sets is the set containing exactly those elements that belong to at least one set in the collection.",
  "category": "mathematics",
  "subcategory": "discrete-logic",
  "type": "concept",
  "aliases": [
    "Union of sets",
    "set-theoretic union"
  ],
  "generated_at": "2026-11-04",
  "model": "pro/gpt-6.1-sol",
  "url": "https://aiwiki.page/en/set-union/",
  "translations": {
    "zh-Hans": {
      "url": "https://aiwiki.page/zh/set-union/",
      "json": "https://aiwiki.page/zh/set-union.json"
    }
  },
  "sections": [
    {
      "heading": "",
      "text": "In set theory, the union of a collection of sets is the set of all elements that belong to at least one member of that collection. For two sets \\(A\\) and \\(B\\), their union is written \\(A\\cup B\\). An element belongs to \\(A\\cup B\\) if it belongs to \\(A\\), to \\(B\\), or to both. Union is a fundamental set operation, used throughout mathematics to combine collections without retaining repeated occurrences of an element."
    },
    {
      "heading": "Definition and notation",
      "text": "The union of two sets is defined by\n\n\\[A\\cup B=\\{x:x\\in A\\text{ or }x\\in B\\}.\\]\n\nThe word “or” is inclusive: membership in both sets is allowed. In the language of propositional logic,\n\n\\[x\\in A\\cup B \\quad\\Longleftrightarrow\\quad (x\\in A)\\lor(x\\in B).\\]\n\nFor example, if\n\n\\[A=\\{1,2,3\\},\\qquad B=\\{3,4,5\\},\\]\n\nthen\n\n\\[A\\cup B=\\{1,2,3,4,5\\}.\\]\n\nThe element \\(3\\) appears only once because sets do not record multiplicity.\n\nUnion differs from intersection, written \\(A\\cap B\\), which contains only elements belonging to both sets. It also differs from the Cartesian product \\(A\\times B\\), whose elements are ordered pairs rather than the individual elements of \\(A\\) and \\(B\\)."
    },
    {
      "heading": "Unions of families of sets",
      "text": "Union applies to any set-indexed family, not just to two sets. If \\((A_i)_{i\\in I}\\) is a family of sets indexed by a set \\(I\\), its union is\n\n\\[\\bigcup_{i\\in I}A_i = \\{x:\\text{there exists }i\\in I\\text{ such that }x\\in A_i\\}.\\]\n\nIf \\(\\mathcal A\\) is itself a set whose elements are sets, the equivalent notation is\n\n\\[\\bigcup\\mathcal A = \\{x:\\text{there exists }A\\in\\mathcal A\\text{ such that }x\\in A\\}.\\]\n\nFor example,\n\n\\[\\bigcup\\bigl\\{\\{1,2\\},\\{2,3\\},\\{4\\}\\bigr\\} = \\{1,2,3,4\\}.\\]\n\nThis operation removes one level of set membership. It does not recursively unpack every set that occurs as an element. For instance,\n\n\\[\\bigcup\\bigl\\{\\{1\\},\\{\\{2\\}\\}\\bigr\\} = \\{1,\\{2\\}\\}.\\]\n\nHere \\(\\{2\\}\\), rather than \\(2\\), is an element of the union.\n\nEmpty and infinite unions\n\nThe union of an empty family is the empty set:\n\n\\[\\bigcup\\varnothing=\\varnothing.\\]\n\nThere is no set in the family from which an element could enter the union. This is distinct from a family containing one empty set, although its union is also empty:\n\n\\[\\bigcup\\{\\varnothing\\}=\\varnothing.\\]\n\nInfinite unions can produce sets substantially larger than any individual member. For example,\n\n\\[\\bigcup_{n=1}^{\\infty}\\{1,2,\\ldots,n\\} = \\{1,2,3,\\ldots\\}.\\]\n\nUsing interval notation in the real numbers,\n\n\\[\\bigcup_{n=1}^{\\infty}\\left(0,1-\\frac{1}{n+1}\\right) = (0,1).\\]\n\nEvery real number strictly between \\(0\\) and \\(1\\) lies in at least one interval, but neither endpoint belongs to any of them."
    },
    {
      "heading": "Algebraic properties",
      "text": "Union satisfies several basic identities.\n\nProperty | Identity\nCommutativity | \\(A\\cup B=B\\cup A\\)\nAssociativity | \\((A\\cup B)\\cup C=A\\cup(B\\cup C)\\)\n[[idempotence | Idempotence]]\nIdentity | \\(A\\cup\\varnothing=A\\)\nAbsorption | \\(A\\cup(A\\cap B)=A\\)\n\nAssociativity makes expressions such as \\(A\\cup B\\cup C\\) unambiguous without parentheses.\n\nUnion and intersection distribute over one another:\n\n\\[A\\cap(B\\cup C) = (A\\cap B)\\cup(A\\cap C),\\]\n\n\\[A\\cup(B\\cap C) = (A\\cup B)\\cap(A\\cup C).\\]\n\nIntersection with a fixed set also distributes over an arbitrary union:\n\n\\[A\\cap\\left(\\bigcup_{i\\in I}B_i\\right) = \\bigcup_{i\\in I}(A\\cap B_i).\\]\n\nRelative to a fixed universal set \\(U\\), De Morgan’s laws give\n\n\\[U\\setminus\\left(\\bigcup_{i\\in I}A_i\\right) = \\bigcap_{i\\in I}(U\\setminus A_i).\\]\n\nThus, an element lies outside a union exactly when it lies outside every set in the family.\n\nThese identities can be proved by comparing membership conditions on the two sides. For example, membership in \\(A\\cap(B\\cup C)\\) means belonging to \\(A\\) and to at least one of \\(B\\) or \\(C\\), which is equivalent to membership in \\((A\\cap B)\\cup(A\\cap C)\\)."
    },
    {
      "heading": "Inclusion and least upper bounds",
      "text": "Union is closely related to the subset relation. Both input sets are contained in their union:\n\n\\[A\\subseteq A\\cup B,\\qquad B\\subseteq A\\cup B.\\]\n\nMoreover, if \\(A\\subseteq C\\) and \\(B\\subseteq C\\), then\n\n\\[A\\cup B\\subseteq C.\\]\n\nConsequently, \\(A\\cup B\\) is the smallest set containing both \\(A\\) and \\(B\\).\n\nMore generally, \\(\\bigcup_{i\\in I}A_i\\) is the least upper bound of the family under inclusion. Within the power set \\(\\mathcal P(U)\\), ordered by the partial order \\(\\subseteq\\), union therefore serves as the join operation. Together with intersection and complementation, it forms part of the standard Boolean algebra of subsets of \\(U\\).\n\nUnion is also monotone:\n\n\\[A\\subseteq C,\\quad B\\subseteq D \\quad\\Longrightarrow\\quad A\\cup B\\subseteq C\\cup D.\\]"
    },
    {
      "heading": "Cardinality and disjoint unions",
      "text": "For finite sets, the cardinality of a union satisfies\n\n\\[|A\\cup B|=|A|+|B|-|A\\cap B|.\\]\n\nThe subtraction corrects for elements counted once in each set. This is the two-set case of the inclusion–exclusion principle.\n\nIf the sets are disjoint, meaning \\(A\\cap B=\\varnothing\\), then\n\n\\[|A\\cup B|=|A|+|B|.\\]\n\nFor a finite pairwise disjoint family,\n\n\\[\\left|\\bigcup_{i=1}^{n}A_i\\right| = \\sum_{i=1}^{n}|A_i|.\\]\n\nAn ordinary union identifies elements shared by different sets. A disjoint union instead retains their origins by attaching labels. One construction is\n\n\\[A\\sqcup B = (A\\times\\{0\\})\\cup(B\\times\\{1\\}).\\]\n\nAn element common to \\(A\\) and \\(B\\) then contributes two distinct tagged elements.\n\nIn standard set theory with the axiom of choice, a countable union of countable sets is countable. This statement is not generally provable in set theory without some form of choice."
    },
    {
      "heading": "Uses in mathematics",
      "text": "Probability and measure\n\nIn probability, the union of two events represents the event that at least one occurs:\n\n\\[P(A\\cup B)=P(A)+P(B)-P(A\\cap B).\\]\n\nFor a countable family of events, the union bound states\n\n\\[P\\left(\\bigcup_{n=1}^{\\infty}A_n\\right) \\leq \\sum_{n=1}^{\\infty}P(A_n).\\]\n\nEquality holds for pairwise disjoint events by countable additivity.\n\nA sigma-algebra is closed under countable unions, not necessarily arbitrary unions. This restriction is central to measure theory: an arbitrary union of measurable sets need not be measurable.\n\nTopology\n\nIn topology, arbitrary unions of open sets are open. Finite unions of closed sets are closed, but infinite unions need not be. For example, each interval\n\n\\[[1/n,1]\\]\n\nis closed in \\(\\mathbb R\\), while\n\n\\[\\bigcup_{n=1}^{\\infty}[1/n,1]=(0,1]\\]\n\nis not closed.\n\nAlgebraic structures\n\nThe union of structured subsets need not preserve their structure. For example, the union of the two coordinate axes in \\(\\mathbb R^2\\) is not a linear subspace: it contains \\((1,0)\\) and \\((0,1)\\), but not their sum \\((1,1)\\).\n\nBy contrast, the union of a nonempty family of subspaces totally ordered by inclusion is a subspace. Any two vectors in the union belong together to one member of the family, allowing closure under vector addition and scalar multiplication to be checked there."
    },
    {
      "heading": "Set-theoretic foundations",
      "text": "In Zermelo–Fraenkel set theory, the axiom of union ensures that for every set \\(\\mathcal A\\), there is a set containing exactly the elements that belong to some member of \\(\\mathcal A\\). Binary union follows by first forming the pair \\(\\{A,B\\}\\) and then taking its union:\n\n\\[A\\cup B=\\bigcup\\{A,B\\}.\\]\n\nThe requirement that \\(\\mathcal A\\) be a set matters. Union notation does not imply that every unrestricted collection has a union that is itself a set. For example, the collection of all sets is not a set in this theory."
    }
  ],
  "links": [
    "set-theory",
    "set-mathematics",
    "propositional-logic",
    "set-intersection",
    "cartesian-product",
    "empty-set",
    "real-number",
    "idempotence",
    "de-morgans-laws",
    "subset",
    "power-set",
    "partial-order",
    "boolean-algebra",
    "cardinality",
    "inclusion-exclusion-principle",
    "disjoint-union",
    "axiom-of-choice",
    "countable-set",
    "probability",
    "event-probability",
    "sigma-algebra",
    "measure-theory",
    "topology",
    "open-set",
    "closed-set",
    "linear-subspace",
    "zermelo-fraenkel-set-theory"
  ],
  "sources": [],
  "license": "https://creativecommons.org/licenses/by/4.0/"
}