{
  "id": "set-complement",
  "title": "Set Complement",
  "lang": "en",
  "source_lang": "en",
  "summary": "The complement of a set consists of all elements in a specified universe that do not belong to that set.",
  "category": "mathematics",
  "subcategory": "discrete-logic",
  "type": "concept",
  "aliases": [
    "Complement of a set",
    "Complementary set"
  ],
  "generated_at": "2026-11-05",
  "model": "pro/gpt-6.1-sol",
  "url": "https://aiwiki.page/en/set-complement/",
  "translations": {
    "zh-Hans": {
      "url": "https://aiwiki.page/zh/set-complement/",
      "json": "https://aiwiki.page/zh/set-complement.json"
    }
  },
  "sections": [
    {
      "heading": "",
      "text": "In set theory, the complement of a set \\(A\\), relative to a specified universe \\(U\\), is the set of all elements of \\(U\\) that do not belong to \\(A\\). It is commonly denoted by \\(A^c\\), \\(A'\\), or \\(U\\setminus A\\). Complementation expresses “not belonging” within a fixed domain and is a fundamental operation in logic, probability, topology, and the algebra of sets."
    },
    {
      "heading": "Definition and notation",
      "text": "Let \\(A\\) be a subset of a universe \\(U\\). The complement of \\(A\\) in \\(U\\) is defined by\n\n\\[A^c=U\\setminus A=\\{x\\in U:x\\notin A\\}.\\]\n\nThus, an element belongs to \\(A^c\\) precisely when it belongs to \\(U\\) but not to \\(A\\).\n\nCommon notations include:\n\n- \\(A^c\\), especially in probability;\n- \\(A'\\), often in elementary set theory;\n- \\(\\overline{A}\\), although this also denotes closure in topology;\n- \\(U\\setminus A\\), which makes the universe explicit.\n\nA notation such as \\(A^c\\) is unambiguous only when the universe is understood. For example, if \\(A=\\{2,4\\}\\), then\n\n\\[\\{1,2,3,4,5\\}\\setminus A=\\{1,3,5\\},\\]\n\nwhereas its complement within the integers includes every integer except \\(2\\) and \\(4\\).\n\nRelative complement and set difference\n\nFor arbitrary sets \\(A\\) and \\(B\\), the relative complement of \\(A\\) in \\(B\\), also called the set difference \\(B\\setminus A\\), is\n\n\\[B\\setminus A=\\{x\\in B:x\\notin A\\}.\\]\n\nThis definition does not require \\(A\\subseteq B\\): elements of \\(A\\) outside \\(B\\) have no effect on the result. Ordinary complementation is the special case in which \\(B\\) is the designated universe.\n\nOrder matters. In general,\n\n\\[B\\setminus A\\ne A\\setminus B.\\]\n\nFor example, if \\(A=\\{1,2\\}\\) and \\(B=\\{2,3\\}\\), then \\(B\\setminus A=\\{3\\}\\), while \\(A\\setminus B=\\{1\\}\\)."
    },
    {
      "heading": "Fundamental properties",
      "text": "The following identities hold in classical set theory, with every complement taken relative to the same universe \\(U\\).\n\nExhaustion, disjointness, and uniqueness\n\nA set and its complement together contain every element of the universe, and they have no element in common:\n\n\\[A\\cup A^c=U, \\qquad A\\cap A^c=\\varnothing.\\]\n\nHere, \\(\\cup\\) denotes union, \\(\\cap\\) denotes intersection, and \\(\\varnothing\\) is the empty set.\n\nThese two properties uniquely characterize the complement: if \\(B\\subseteq U\\) satisfies \\(A\\cup B=U\\) and \\(A\\cap B=\\varnothing\\), then \\(B=A^c\\).\n\nThe extreme cases are\n\n\\[\\varnothing^c=U, \\qquad U^c=\\varnothing.\\]\n\nDouble complementation\n\nTaking the complement twice returns the original set:\n\n\\[(A^c)^c=A.\\]\n\nConsequently, complementation is an involution: applying it twice has no net effect.\n\nReversal of inclusion\n\nComplementation reverses containment:\n\n\\[A\\subseteq B \\quad\\Longleftrightarrow\\quad B^c\\subseteq A^c.\\]\n\nIf \\(A\\) is contained in \\(B\\), every element outside \\(B\\) must also be outside \\(A\\). The converse follows by taking complements again.\n\nDe Morgan’s laws\n\nDe Morgan’s laws describe how complementation interchanges unions and intersections:\n\n\\[(A\\cup B)^c=A^c\\cap B^c,\\]\n\n\\[(A\\cap B)^c=A^c\\cup B^c.\\]\n\nMore generally, for a family \\((A_i)_{i\\in I}\\) of subsets of \\(U\\),\n\n\\[\\left(\\bigcup_{i\\in I}A_i\\right)^c = \\bigcap_{i\\in I}A_i^c,\\]\n\n\\[\\left(\\bigcap_{i\\in I}A_i\\right)^c = \\bigcup_{i\\in I}A_i^c.\\]\n\nFor an empty index set, these formulas use the conventions that the empty union is \\(\\varnothing\\) and the empty intersection within \\(U\\) is \\(U\\).\n\nSet difference can also be expressed using intersection and complementation:\n\n\\[B\\setminus A=B\\cap A^c.\\]\n\nThis formula assumes an ambient universe containing both \\(A\\) and \\(B\\)."
    },
    {
      "heading": "Logical and algebraic interpretation",
      "text": "Membership in a complement corresponds to negation:\n\n\\[x\\in A^c \\quad\\Longleftrightarrow\\quad x\\in U\\ \\text{and}\\ x\\notin A.\\]\n\nWhen the domain is already restricted to \\(U\\), this becomes simply “\\(x\\) belongs to \\(A^c\\) if and only if \\(x\\) does not belong to \\(A\\).” Union and intersection similarly correspond to logical disjunction and conjunction. The identities of set complementation therefore parallel identities in classical propositional logic.\n\nThe power set \\(\\mathcal P(U)\\), consisting of all subsets of \\(U\\), forms a Boolean algebra under union, intersection, and complementation. Its least element is \\(\\varnothing\\), and its greatest element is \\(U\\). Complementation defines an inclusion-reversing bijection from \\(\\mathcal P(U)\\) to itself.\n\nThese classical identities require care in intuitionistic logic. If complement is defined by negated membership, the equation \\(A\\cup A^c=U\\) for arbitrary \\(A\\) embodies the law of excluded middle, and double complementation need not recover \\(A\\)."
    },
    {
      "heading": "Applications",
      "text": "Probability and measure\n\nIn a probability space, the universe is the sample space \\(\\Omega\\). The complement of an event \\(A\\) is the event that \\(A\\) does not occur. Its probability satisfies\n\n\\[P(A^c)=1-P(A).\\]\n\nFor example, the event “at least one success occurs” is the complement of “no successes occur.” This can make probabilities easier to calculate, although any assumptions about independence must be justified separately.\n\nA sigma-algebra is, by definition, closed under complementation relative to its underlying space. Thus, whenever an event is measurable, its complement is measurable as well.\n\nMore generally, in measure theory, if \\(\\mu(U)<\\infty\\) and \\(A\\) is measurable, then\n\n\\[\\mu(U\\setminus A)=\\mu(U)-\\mu(A).\\]\n\nIf both measures on the right are infinite, this subtraction is not defined; it cannot be used to determine the measure of the complement.\n\nTopology\n\nIn a topological space \\(X\\), a subset \\(F\\) is closed exactly when \\(X\\setminus F\\) is open. Complementation therefore converts statements about open sets into corresponding statements about closed sets.\n\nFor instance, arbitrary unions of open sets are open. By De Morgan’s laws, this is equivalent to the statement that arbitrary intersections of closed sets are closed.\n\nThe ambient space remains essential. A set may have different complements, and different openness or closedness properties, depending on which space contains it.\n\nFunctions and indicators\n\nFor a function \\(f:X\\to Y\\) and a subset \\(B\\subseteq Y\\), inverse images preserve complements:\n\n\\[f^{-1}(Y\\setminus B) = X\\setminus f^{-1}(B).\\]\n\nHere \\(f^{-1}(B)\\) denotes a preimage, not necessarily an inverse function. The identity holds without requiring \\(f\\) to be injective or surjective. Direct images do not, in general, preserve complements.\n\nComplementation also has a numerical expression through the indicator function:\n\n\\[\\mathbf 1_{A^c}(x)=1-\\mathbf 1_A(x), \\qquad x\\in U.\\]\n\nFor finite \\(U\\), the corresponding counting identity is\n\n\\[|A^c|=|U|-|A|.\\]\n\nThis finite subtraction rule does not extend directly to arbitrary infinite cardinalities."
    },
    {
      "heading": "Scope and distinctions",
      "text": "In Zermelo–Fraenkel set theory, there is no set containing every set. A complement must therefore be taken relative to a specified set, not an unrestricted universal set. An alleged set of all sets would lead to Russell’s paradox.\n\nSet complementation is also distinct from the orthogonal complement of a subspace in an inner-product space. An orthogonal complement consists of vectors perpendicular to every vector in the given subspace; it is not the collection of vectors outside that subspace. In particular, a subspace and its orthogonal complement both contain the zero vector, whereas a set and its set-theoretic complement are disjoint."
    }
  ],
  "links": [
    "set-theory",
    "set-mathematics",
    "subset",
    "closure-topology",
    "integer",
    "set-difference",
    "set-union",
    "set-intersection",
    "empty-set",
    "de-morgans-laws",
    "propositional-logic",
    "power-set",
    "boolean-algebra",
    "bijective-function",
    "intuitionistic-logic",
    "law-of-excluded-middle",
    "probability-space",
    "sample-space",
    "event-probability",
    "sigma-algebra",
    "measure-theory",
    "topological-space",
    "closed-set",
    "open-set",
    "indicator-function",
    "zermelo-fraenkel-set-theory",
    "russells-paradox",
    "orthogonal-complement"
  ],
  "sources": [],
  "license": "https://creativecommons.org/licenses/by/4.0/"
}