When all elements in theuniverse, i.e. all elements under consideration, are considered to bemembers of a given setU, theabsolute complement ofA is the set of elements inU that are not inA.
Therelative complement ofA with respect to a setB, also termed theset difference ofB andA, written is the set of elements inB that are not inA.
IfA is a set, then theabsolute complement ofA (or simply thecomplement ofA) is the set of elements not inA (within a larger set that is implicitly defined). In other words, letU be a set that contains all the elements under study; if there is no need to mentionU, either because it has been previously specified, or it is obvious and unique, then the absolute complement ofA is the relative complement ofA inU:[3]
The absolute complement ofA is usually denoted by. Other notations include[2][4]
Assume that the universe is the set ofintegers. IfA is the set of odd numbers, then the complement ofA is the set of even numbers. IfB is the set ofmultiples of 3, then the complement ofB is the set of numberscongruent to 1 or 2 modulo 3 (or, in simpler terms, the integers that are not multiples of 3).
Assume that the universe is thestandard 52-card deck. If the setA is the suit of spades, then the complement ofA is theunion of the suits of clubs, diamonds, and hearts. If the setB is the union of the suits of clubs and diamonds, then the complement ofB is the union of the suits of hearts and spades.
IfA andB are sets, then therelative complement ofA inB,[5] also termed theset difference ofB andA,[6] is the set of elements inB but not inA.
Therelative complement ofA inB:
The relative complement ofA inB is denoted according to theISO 31-11 standard. It is sometimes written but this notation is ambiguous, as in some contexts (for example,Minkowski set operations infunctional analysis) it can be interpreted as the set of all elements whereb is taken fromB anda fromA.
Abinary relation is defined as a subset of aproduct of sets Thecomplementary relation is the set complement of in The complement of relation can be writtenHere, is often viewed as alogical matrix with rows representing the elements of and columns elements of The truth of corresponds to 1 in row column Producing the complementary relation to then corresponds to switching all 1s to 0s, and 0s to 1s for the logical matrix of the complement.
In theLaTeX typesetting language, the command\setminus[7] is usually used for rendering a set difference symbol, which is similar to abackslash symbol. When rendered, the\setminus command looks identical to\backslash, except that it has a little more space in front and behind the slash, akin to the LaTeX sequence\mathbin{\backslash}. A variant\smallsetminus is available in the amssymb package, but this symbol is not included separately in Unicode. The symbol (as opposed to) is produced by\complement. (It corresponds to the Unicode symbolU+2201∁COMPLEMENT.)
^The set in which the complement is considered is thus implicitly mentioned in an absolute complement, and explicitly mentioned in a relative complement.