
In
mathematics
Mathematics is a field of study that discovers and organizes methods, Mathematical theory, theories and theorems that are developed and Mathematical proof, proved for the needs of empirical sciences and mathematics itself. There are many ar ...
, a set is a collection of different things; the things are ''
elements'' or ''members'' of the set and are typically
mathematical objects: numbers, symbols, points in space, lines, other
geometric shapes, variables, or other sets. A set may be
finite or
infinite. There is a unique set with no elements, called the
empty set
In mathematics, the empty set or void set is the unique Set (mathematics), set having no Element (mathematics), elements; its size or cardinality (count of elements in a set) is 0, zero. Some axiomatic set theories ensure that the empty set exi ...
; a set with a single element is a
singleton.
Sets are ubiquitous in modern mathematics. Indeed,
set theory
Set theory is the branch of mathematical logic that studies Set (mathematics), sets, which can be informally described as collections of objects. Although objects of any kind can be collected into a set, set theory – as a branch of mathema ...
, more specifically
Zermelo–Fraenkel set theory, has been the standard way to provide rigorous
foundations for all branches of mathematics since the first half of the 20th century.
Context
Before the end of the 19th century, sets were not studied specifically, and were not clearly distinguished from
sequences. Most mathematicians considered
infinity
Infinity is something which is boundless, endless, or larger than any natural number. It is denoted by \infty, called the infinity symbol.
From the time of the Ancient Greek mathematics, ancient Greeks, the Infinity (philosophy), philosophic ...
as
potentialmeaning that it is the result of an endless processand were reluctant to consider
infinite sets, that is sets whose number of members is not a
natural number
In mathematics, the natural numbers are the numbers 0, 1, 2, 3, and so on, possibly excluding 0. Some start counting with 0, defining the natural numbers as the non-negative integers , while others start with 1, defining them as the positive in ...
. Specifically, a
line was not considered as the set of its points, but as a
locus where points may be located.
The mathematical study of infinite sets began with
Georg Cantor
Georg Ferdinand Ludwig Philipp Cantor ( ; ; – 6 January 1918) was a mathematician who played a pivotal role in the creation of set theory, which has become a foundations of mathematics, fundamental theory in mathematics. Cantor establi ...
(1845–1918). This provided some counterintuitive facts and paradoxes. For example, the
number line has an
infinite number of elements that is strictly larger than the infinite number of
natural number
In mathematics, the natural numbers are the numbers 0, 1, 2, 3, and so on, possibly excluding 0. Some start counting with 0, defining the natural numbers as the non-negative integers , while others start with 1, defining them as the positive in ...
s, and any
line segment has the same number of elements as the whole space. Also,
Russell's paradox implies that the phrase "the set of all sets" is self-contradictory.
Together with other counterintuitive results, this led to the
foundational crisis of mathematics, which was eventually resolved with the general adoption of
Zermelo–Fraenkel set theory as a robust foundation of
set theory
Set theory is the branch of mathematical logic that studies Set (mathematics), sets, which can be informally described as collections of objects. Although objects of any kind can be collected into a set, set theory – as a branch of mathema ...
and all mathematics.
Meanwhile, sets started to be widely used in all mathematics. In particular,
algebraic structures and
mathematical spaces are typically defined in terms of sets. Also, many older mathematical results are restated in terms of sets. For example,
Euclid's theorem
Euclid's theorem is a fundamental statement in number theory that asserts that there are Infinite set, infinitely many prime number, prime numbers. It was first proven by Euclid in his work ''Euclid's Elements, Elements''. There are several proof ...
is often stated as "the ''set'' of the
prime number
A prime number (or a prime) is a natural number greater than 1 that is not a Product (mathematics), product of two smaller natural numbers. A natural number greater than 1 that is not prime is called a composite number. For example, 5 is prime ...
s is infinite". This wide use of sets in mathematics was prophesied by
David Hilbert when saying: "No one will drive us from the
paradise which Cantor created for us."
Generally, the common usage of sets in mathematics does not require the full power of Zermelo–Fraenkel set theory. In mathematical practice, sets can be manipulated independently of the
logical framework of this theory.
The object of this article is to summarize the manipulation rules and properties of sets that are commonly used in mathematics, without reference to any logical framework. For the branch of mathematics that studies sets, see
Set theory
Set theory is the branch of mathematical logic that studies Set (mathematics), sets, which can be informally described as collections of objects. Although objects of any kind can be collected into a set, set theory – as a branch of mathema ...
; for an informal presentation of the corresponding logical framework, see
Naive set theory; for a more formal presentation, see
Axiomatic set theory and
Zermelo–Fraenkel set theory.
Basic notions
In mathematics, a set is a collection of different things.
[ Here: p.85] These things are called ''elements'' or ''members'' of the set and are typically
mathematical objects of any kind such as numbers, symbols,
points in space,
lines, other
geometrical shapes,
variables,
functions, or even other sets. A set may also be called a ''collection'' or family, especially when its elements are themselves sets; this may avoid the confusion between the set and its members, and may make reading easier. A set may be specified either by listing its elements or by a property that characterizes its elements, such as for the set of the
prime numbers or the set of all students in a given class.
If is an element of a set , one says that ''belongs'' to or ''is in'' , and this is written as . The statement " is not in " is written as , which can also be read as "''y'' is not in ''B''".
For example, if is the set of the
integers, one has and . Each set is uniquely characterized by its elements. In particular, two sets that have precisely the same elements are
equal (they are the same set).
This property, called
extensionality, can be written in formula as
This implies that there is only one set with no element, the ''
empty set
In mathematics, the empty set or void set is the unique Set (mathematics), set having no Element (mathematics), elements; its size or cardinality (count of elements in a set) is 0, zero. Some axiomatic set theories ensure that the empty set exi ...
'' (or ''null set'') that is denoted , or
A ''
singleton'' is a set with exactly one element. If is this element, the singleton is denoted If is itself a set, it must not be confused with For example, is a set with no elements, while is a singleton with as its unique element.
A set is ''
finite'' if there exists a
natural number
In mathematics, the natural numbers are the numbers 0, 1, 2, 3, and so on, possibly excluding 0. Some start counting with 0, defining the natural numbers as the non-negative integers , while others start with 1, defining them as the positive in ...
such that the first natural numbers can be put in
one to one correspondence with the elements of the set. In this case, one says that is the number of elements of the set. A set is ''
infinite'' if such an does not exist. The ''empty set'' is a finite set with elements.
The natural numbers form an infinite set, commonly denoted . Other examples of infinite sets include
number sets that contain the natural numbers,
real vector spaces,
curves and most sorts of
space
Space is a three-dimensional continuum containing positions and directions. In classical physics, physical space is often conceived in three linear dimensions. Modern physicists usually consider it, with time, to be part of a boundless ...
s.
Specifying a set
Extensionality implies that for specifying a set, one has either to list its elements or to provide a property that uniquely characterizes the set elements.
Roster notation
''Roster'' or ''enumeration notation'' is a notation introduced by
Ernst Zermelo in 1908 that specifies a set by listing its elements between
braces, separated by commas.
For example, one knows that
and
denote sets and not
tuples because of the enclosing braces.
Above notations and for the empty set and for a singleton are examples of roster notation.
When specifying sets, it only matters whether each distinct element is in the set or not; this means a set does not change if elements are repeated or arranged in a different order. For example,
When there is a clear pattern for generating all set elements, one can use
ellipses for abbreviating the notation,
such as in
for the positive integers not greater than .
Ellipses allow also expanding roster notation to some infinite sets. For example, the set of all integers can be denoted as
or
Set-builder notation
Set-builder notation specifies a set as being the set of all elements that satisfy some
logical formula.
More precisely, if is a logical formula depending on a
variable , which evaluates to ''true'' or ''false'' depending on the value of , then
or
denotes the set of all for which is true.
For example, a set can be specified as follows:
In this notation, the
vertical bar ", " is read as "such that", and the whole formula can be read as " is the set of all such that is an integer in the range from 0 to 19 inclusive".
Some logical formulas, such as or cannot be used in set-builder notation because there is no set for which the elements are characterized by the formula. There are several ways for avoiding the problem. One may prove that the formula defines a set; this is often almost immediate, but may be very difficult.
One may also introduce a larger set that must contain all elements of the specified set, and write the notation as
or
One may also define once for all and take the convention that every variable that appears on the left of the vertical bar of the notation represents an element of . This amounts to say that is implicit in set-builder notation. In this case, is often called ''the
domain of discourse'' or a ''
universe
The universe is all of space and time and their contents. It comprises all of existence, any fundamental interaction, physical process and physical constant, and therefore all forms of matter and energy, and the structures they form, from s ...
''.
For example, with the convention that a lower case Latin letter may represent a
real number and nothing else, the
expression
is an abbreviation of
which defines the
irrational numbers.
Subsets
A ''subset'' of a set is a set such that every element of is also an element of .
If is a subset of , one says commonly that is ''contained'' in , ''contains'' , or is a ''superset'' of . This denoted and . However many authors use and instead. The definition of a subset can be expressed in notation as
A set is a ''proper subset'' of a set if and . This is denoted and . When is used for the subset relation, or in case of possible ambiguity, one uses commonly and .
The
relationship between sets established by ⊆ is called ''inclusion'' or ''containment''. Equality between sets can be expressed in terms of subsets. Two sets are equal if and only if they contain each other: that is, and is equivalent to ''A'' = ''B''.
The empty set is a subset of every set: .
Examples:
* The set of all humans is a proper subset of the set of all mammals.
* .
*
Basic operations
There are several standard
operations that produce new sets from given sets, in the same way as
addition
Addition (usually signified by the Plus and minus signs#Plus sign, plus symbol, +) is one of the four basic Operation (mathematics), operations of arithmetic, the other three being subtraction, multiplication, and Division (mathematics), divis ...
and
multiplication
Multiplication is one of the four elementary mathematical operations of arithmetic, with the other ones being addition, subtraction, and division (mathematics), division. The result of a multiplication operation is called a ''Product (mathem ...
produce new numbers from given numbers. The operations that are considered in this section are those such that all elements of the produced sets belong to a previously defined set. These operations are commonly illustrated with
Euler diagrams and
Venn diagrams.
The main basic operations on sets are the following ones.
Intersection

The ''
intersection'' of two sets and is a set denoted whose elements are those elements that belong to both and . That is,
where denotes the
logical and.
Intersection is
associative and
commutative
In mathematics, a binary operation is commutative if changing the order of the operands does not change the result. It is a fundamental property of many binary operations, and many mathematical proofs depend on it. Perhaps most familiar as a pr ...
; this means that for proceeding a sequence of intersections, one may proceed in any order, without the need of parentheses for specifying the
order of operations. Intersection has no general
identity element
In mathematics, an identity element or neutral element of a binary operation is an element that leaves unchanged every element when the operation is applied. For example, 0 is an identity element of the addition of real numbers. This concept is use ...
. However, if one restricts intersection to the subsets of a given set , intersection has as identity element.
If is a nonempty set of sets, its intersection, denoted
is the set whose elements are those elements that belong to all sets in . That is,
These two definitions of the intersection coincide when has two elements.
Union

The ''
union'' of two sets and is a set denoted whose elements are those elements that belong to or or both. That is,
where denotes the
logical or
In logic, disjunction (also known as logical disjunction, logical or, logical addition, or inclusive disjunction) is a logical connective typically notated as \lor and read aloud as "or". For instance, the English language, English language ...
.
Union is
associative and
commutative
In mathematics, a binary operation is commutative if changing the order of the operands does not change the result. It is a fundamental property of many binary operations, and many mathematical proofs depend on it. Perhaps most familiar as a pr ...
; this means that for proceeding a sequence of intersections, one may proceed in any order, without the need of parentheses for specifying the
order of operations. The empty set is an
identity element
In mathematics, an identity element or neutral element of a binary operation is an element that leaves unchanged every element when the operation is applied. For example, 0 is an identity element of the addition of real numbers. This concept is use ...
for the union operation.
If is a set of sets, its union, denoted
is the set whose elements are those elements that belong to at least one set in . That is,
These two definitions of the union coincide when has two elements.
Set difference

The ''set difference'' of two sets and , is a set, denoted or , whose elements are those elements that belong to , but not to . That is,
where denotes the
logical and.

When the difference is also called the ''
complement'' of in . When all sets that are considered are subsets of a fixed ''universal set'' , the complement is often called the ''absolute complement'' of .

The ''
symmetric difference'' of two sets and , denoted , is the set of those elements that belong to or but not to both:
Algebra of subsets
The set of all subsets of a set is called the
powerset of , often denoted . The powerset is an algebraic structure whose main operations are union, intersection, set difference, symmetric difference and absolute complement (complement in ).
The powerset is a
Boolean ring that has the symmetric difference as addition, the intersection as multiplication, the empty set as
additive identity, as
multiplicative identity, and complement as additive inverse.
The powerset is also a
Boolean algebra for which the ''join'' is the union , the ''meet'' is the intersection , and the negation is the set complement.
As every Boolean algebra, the power set is also a
partially ordered set for set inclusion. It is also a
complete lattice.
The axioms of these structures induce many
identities relating subsets, which are detailed in the linked articles.
Functions
A ''function'' from a set the ''domain''to a set the ''codomain''is a rule that assigns to each element of a unique element of . For example, the
square function maps every real number to . Functions can be formally defined in terms of sets by means of their
graph, which are subsets of the
Cartesian product (see below) of the domain and the codomain.
Functions are fundamental for set theory, and examples are given in following sections.
Indexed families
Intuitively, an
indexed family
In mathematics, a family, or indexed family, is informally a collection of objects, each associated with an index from some index set. For example, a family of real numbers, indexed by the set of integers, is a collection of real numbers, wher ...
is a set whose elements are labelled with the elements of another set, the index set. These labels allow the same element to occur several times in the family.
Formally, an indexed family is a function that has the index set as its domain. Generally, the usual
functional notation is not used for indexed families. Instead, the element of the index set is written as a subscript of the name of the family, such as in .
When the index set is , an indexed family is called an
ordered pair. When the index set is the set of the first natural numbers, an indexed family is called an -
tuple. When the index set is the set of all natural numbers an indexed family is called a
sequence.
In all these cases, the natural order of the natural numbers allows omitting indices for explicit indexed families. For example, denotes the 3-tuple such that .
The above notations
and
are commonly replaced with a notation involving indexed families, namely
and
The formulas of the above sections are special cases of the formulas for indexed families, where and . The formulas remain correct, even in the case where for some , since
External operations
In , all elements of sets produced by set operations belong to previously defined sets. In this section, other set operations are considered, which produce sets whose elements can be outside all previously considered sets. These operations are
Cartesian product,
disjoint union,
set exponentiation and
power set.
Cartesian product
The Cartesian product of two sets has already be used for defining functions.
Given two sets and , their ''Cartesian product'', denoted is the set formed by all ordered pairs such that and ; that is,
This definition does not supposes that the two sets are different. In particular,
Since this definition involves a pair of indices (1,2), it generalizes straightforwardly to the Cartesian product or
direct product of any indexed family of sets:
That is, the elements of the Cartesian product of a family of sets are all families of elements such that each one belongs to the set of the same index. The fact that, for every indexed family of nonempty sets, the Cartesian product is a nonempty set is insured by the
axiom of choice.
Set exponentiation
Given two sets and , the ''set exponentiation'', denoted , is the set that has as elements all functions from to .
Equivalently, can be viewed as the Cartesian product of a family, indexed by , of sets that are all equal to . This explains the terminology and the notation, since
exponentiation
In mathematics, exponentiation, denoted , is an operation (mathematics), operation involving two numbers: the ''base'', , and the ''exponent'' or ''power'', . When is a positive integer, exponentiation corresponds to repeated multiplication ...
with integer exponents is a product where all factors are equal to the base.
Power set
The ''power set'' of a set is the set that has all subsets of as elements, including the
empty set
In mathematics, the empty set or void set is the unique Set (mathematics), set having no Element (mathematics), elements; its size or cardinality (count of elements in a set) is 0, zero. Some axiomatic set theories ensure that the empty set exi ...
and itself.
It is often denoted . For example,
There is a natural one-to-one correspondence (
bijection) between the subsets of and the functions from to ; this correspondence associates to each subset the function that takes the value on the subset and elsewhere. Because of this correspondence, the power set of is commonly identified with set exponentiation:
In this notation, is often abbreviated as , which gives
In particular, if has elements, then has elements.
Disjoint union
The ''disjoint union'' of two or more sets is similar to the union, but, if two sets have elements in common, these elements are considered as distinct in the disjoint union. This is obtained by labelling the elements by the indexes of the set they are coming from.
The disjoint union of two sets and is commonly denoted and is thus defined as
If is a set with elements, then has elements, while has elements.
The disjoint union of two sets is a particular case of the disjoint union of an indexed family of sets, which is defined as
The disjoint union is the
coproduct in the
category of sets. Therefore the notation
is commonly used.
Internal disjoint union
Given an indexed family of sets , there is a
natural map
which consists in "forgetting" the indices.
This maps is always surjective; it is bijective if and only if the are
pairwise disjoint, that is, all intersections of two sets of the family are empty. In this case,
and
are commonly identified, and one says that their union is the ''disjoint union'' of the members of the family.
If a set is the disjoint union of a family of subsets, one says also that the family is a
partition of the set.
Cardinality
Informally, the cardinality of a set , often denoted , is the number of its members.
This number is the
natural number
In mathematics, the natural numbers are the numbers 0, 1, 2, 3, and so on, possibly excluding 0. Some start counting with 0, defining the natural numbers as the non-negative integers , while others start with 1, defining them as the positive in ...
when there is a
bijection between the set that is considered and the set of the first natural numbers. The cardinality of the empty set is .
A set with the cardinality of a natural number is called a
finite set which is true for both cases. Otherwise, one has an
infinite set.
The fact that natural numbers measure the cardinality of finite sets is the basis of the concept of natural number, and predates for several thousands years the concept of sets. A large part of
combinatorics is devoted to the computation or estimation of the cardinality of finite sets.
Infinite cardinalities
The cardinality of an infinite set is commonly represented by a
cardinal number
In mathematics, a cardinal number, or cardinal for short, is what is commonly called the number of elements of a set. In the case of a finite set, its cardinal number, or cardinality is therefore a natural number. For dealing with the cas ...
, exactly as the number of elements of a finite set is represented by a natural numbers. The definition of cardinal numbers is too technical for this article; however, many properties of cardinalities can be dealt without referring to cardinal numbers, as follows.
Two sets and have the same cardinality if there exists a one-to-one correspondence (
bijection) between them. This is denoted
and would be an
equivalence relation on sets, if a set of all sets would exist.
For example, the natural numbers and the even natural numbers have the same cardinality, since multiplication by two provides such a bijection. Similarly, the
interval and the set of all real numbers have the same cardinality, a bijection being provided by the function .
Having the same cardinality of a
proper subset is a characteristic property of infinite sets: ''a set is infinite if and only if it has the same cardinality as one of its proper subsets.''
So, by the above example, the natural numbers form an infinite set.
Besides equality, there is a natural inequality between cardinalities: a set has a cardinality smaller than or equal to the cardinality of another set if there is an
injection frome to . This is denoted
Schröder–Bernstein theorem implies that
and
imply
Also, one has
if and only if there is a surjection from to . For every two sets and , one has either
or
So, inequality of cardinalities is a
total order.
The cardinality of the set of the natural numbers, denoted
is the smallest infinite cardinality. This means that if is a set of natural numbers, then either is finite or
Sets with cardinality less than or equal to
are called ''
countable set
In mathematics, a set is countable if either it is finite or it can be made in one to one correspondence with the set of natural numbers. Equivalently, a set is ''countable'' if there exists an injective function from it into the natural numbe ...
s''; these are either finite sets or ''
countably infinite sets'' (sets of cardinality
); some authors use "countable" to mean "countably infinite". Sets with cardinality strictly greater than
are called ''
uncountable set
In mathematics, an uncountable set, informally, is an infinite set that contains too many elements to be countable. The uncountability of a set is closely related to its cardinal number: a set is uncountable if its cardinal number is larger t ...
s''.
Cantor's diagonal argument shows that, for every set , its power set (the set of its subsets) has a greater cardinality:
This implies that there is no greatest cardinality.
Cardinality of the real numbers
The cardinality of set of the
real numbers is called the
cardinality of the continuum and denoted . (The term "
continuum" referred to the
real line before the 20th century, when the real line was not commonly viewed as a set of numbers.)
Since, as seen above, the real line has the same cardinality of an
open interval
In mathematics, a real interval is the set (mathematics), set of all real numbers lying between two fixed endpoints with no "gaps". Each endpoint is either a real number or positive or negative infinity, indicating the interval extends without ...
, every subset of that contains a nonempty
open interval
In mathematics, a real interval is the set (mathematics), set of all real numbers lying between two fixed endpoints with no "gaps". Each endpoint is either a real number or positive or negative infinity, indicating the interval extends without ...
has also the cardinality .
One has
meaning that the cardinality of the real numbers equals the cardinality of the
power set of the natural numbers. In particular,
When published in 1878 by
Georg Cantor
Georg Ferdinand Ludwig Philipp Cantor ( ; ; – 6 January 1918) was a mathematician who played a pivotal role in the creation of set theory, which has become a foundations of mathematics, fundamental theory in mathematics. Cantor establi ...
,
this result was so astonishing that it was refused by mathematicians, and several tens years were needed before its common acceptance.
It can be shown that is also the cardinality of the entire
plane, and of any
finite-dimensional Euclidean space
Euclidean space is the fundamental space of geometry, intended to represent physical space. Originally, in Euclid's ''Elements'', it was the three-dimensional space of Euclidean geometry, but in modern mathematics there are ''Euclidean spaces ...
.
The
continuum hypothesis, was a conjecture formulated by Georg Cantor in 1878 that there is no set with cardinality strictly between and .
In 1963,
Paul Cohen proved that the continuum hypothesis is
independent of the
axioms of
Zermelo–Fraenkel set theory with the
axiom of choice.
[
]
This means that if the most widely used
set theory
Set theory is the branch of mathematical logic that studies Set (mathematics), sets, which can be informally described as collections of objects. Although objects of any kind can be collected into a set, set theory – as a branch of mathema ...
is
consistent (that is not self-contradictory), then the same is true for both the set theory with the continuum hypothesis added as a further axiom, and the set theory with the negation of the continuum hypothesis added.
Axiom of choice
Informally, the axiom of choice says that, given any family of nonempty sets, one can choose simultaneously an element in each of them. Formulated this way, acceptability of this axiom sets a foundational logical question, because of the difficulty of conceiving an infinite instantaneous action. However, there are several equivalent formulations that are much less controversial and have strong consequences in many areas of mathematics. In the present days, the axiom of choice is thus commonly accepted in mainstream mathematics.
A more formal statement of the axiom of choice is: ''the Cartesian product of every indexed family of nonempty sets is non empty''.
Other equivalent forms are described in the following subsections.
Zorn's lemma
Zorn's lemma is an assertion that is equivalent to the axiom of choice under the other axioms of set theory, and is easier to use in usual mathematics.
Let be a partial ordered set. A
chain in is a subset that is
totally ordered under the induced order. Zorn's lemma states that, if every chain in has an
upper bound in , then has (at least) a
maximal element, that is, an element that is not smaller than another element of .
In most uses of Zorn's lemma, is a set of sets, the order is set inclusion, and the upperbound of a chain is taken as the union of its members.
An example of use of Zorn's lemma, is the proof that every
vector space has a
basis. Here the elements of are
linearly independent subsets of the vector space. The union of a chain of elements of is linearly independent, since an infinite set is linearly independent if and only if each finite subset is, and every finite subset of the union of a chain must be included in a member of the chain. So, there exist a maximal linearly independent set. This linearly independent set must span the vector space because of maximality, and is therefore a basis.
Another classical use of Zorn's lemma is the proof that every proper
idealthat is, an ideal that is not the whole ringof a
ring is contained in a
maximal ideal. Here, is the set of the proper ideals containing the given ideal. The union of chain of ideals is an ideal, since the axioms of an ideal involve a finite number of elements. The union of a chain of proper ideals is a proper ideal, since otherwise would belong to the union, and this implies that it would belong to a member of the chain.
Transfinite induction
The axiom of choice is equivalent with the fact that a well-order can be defined on every set, where a well-order is a
total order such that every nonempty subset has a least element.
Simple examples of well-ordered sets are the natural numbers (with the natural order), and, for every , the set of the -
tuples of natural numbers, with the
lexicographic order.
Well-orders allow a generalization of
mathematical induction, which is called ''transfinite induction''. Given a property (
predicate) depending on a natural number, mathematical induction is the fact that for proving that is always true, it suffice to prove that for every ,
: