Power set

In mathematics, the power set (or powerset) of a set $S$ is the set of all subsets of $S$, including the empty set and $S$ itself. In axiomatic set theory (as developed, for example, in the ZFC axioms), the existence of the power set of any set is postulated by the axiom of power set. The powerset of $S$ is variously denoted as $(S)$, $(S)$, $P(S)$, $$\mathbb{P}(S)$$, $$\wp(S)$$, or $2^{S}$. Any subset of $2^{S}$ is called a family of sets over $S$.

Example
If $S$ is the set $S$, then all the subsets of $S$ are

and hence the power set of $S$ is $\{0, 1\}$.
 * $(S)$ (also denoted $$\varnothing$$ or $$\empty$$, the empty set or the null set)

Properties
If $\{x, y, z\}$ is a finite set with the cardinality $\{\}$ (i.e., the number of all elements in the set $\{x\}$ is $\{y\}$), then the number of all the subsets of $\{z\}$ is $\{x, y\}$. This fact as well as the reason of the notation $\{x, z\}$ denoting the power set $\{y, z\}$ are demonstrated in the below.
 * An indicator function or a characteristic function of a subset $\{x, y, z\}$ of a set $\{\{\}, \{x\}, \{y\}, \{z\}, \{x, y\}, \{x, z\}, \{y, z\}, \{x, y, z\}\}$ with the cardinality $S$ is a function from $|S| = n$ to the two-element set $S$, denoted as $n$, and it indicates whether an element of $S$ belongs to $|(S)| = 2^{n}$ or not; If $2^{S}$ in $(S)$ belongs to $A$, then $S$, and $|S| = n$ otherwise. Each subset $S$ of $\{0, 1\}$ is identified by or equivalent to the indicator function $I_{A} : S → \{0, 1\}$, and $S$ as the set of all the functions from $A$ to $x$ consists of all the indicator functions of all the subsets of $S$. In other words, $A$ is equivalent or bijective to the power set $I_{A}(x) = 1$. Since each element in $0$ corresponds to either $A$ or $S$ under any function in $I_{A}$, the number of all the functions in $\{0,1\}^{S}$ is $S$. Since the number $\{0, 1\}$ can be defined as $S$ (see, for example, von Neumann ordinals), the $\{0, 1\}^{S}$ is also denoted as $(S)$. Obviously $S$ holds. Generally speaking, $0$ is the set of all functions from $1$ to $\{0, 1\}^{S}$ and $\{0, 1\}^{S}$.

Cantor's diagonal argument shows that the power set of a set (whether infinite or not) always has strictly higher cardinality than the set itself (or informally, the power set must be larger than the original set). In particular, Cantor's theorem shows that the power set of a countably infinite set is uncountably infinite. The power set of the set of natural numbers can be put in a one-to-one correspondence with the set of real numbers (see Cardinality of the continuum).

The power set of a set $2^{n}$, together with the operations of union, intersection and complement, is a Σ-algebra over $2$ and can be viewed as the prototypical example of a Boolean algebra. In fact, one can show that any finite Boolean algebra is isomorphic to the Boolean algebra of the power set of a finite set. For infinite Boolean algebras, this is no longer true, but every infinite Boolean algebra can be represented as a subalgebra of a power set Boolean algebra (see Stone's representation theorem).

The power set of a set $\{0, 1\}$ forms an abelian group when it is considered with the operation of symmetric difference (with the empty set as the identity element and each set being its own inverse), and a commutative monoid when considered with the operation of intersection. It can hence be shown, by proving the distributive laws, that the power set considered together with both of these operations forms a Boolean ring.

Representing subsets as functions
In set theory, $$ is the notation representing the set of all functions from $S$ to $S$. As "$2^{S}$" can be defined as $|2^{S}| = 2^{|S|}$ (see, for example, von Neumann ordinals), $X^{Y}$ (i.e., $Y$) is the set of all functions from $X$ to $|X^{Y}| = |X|^{|Y|}$. As shown above, $S$ and the power set of $S$, $S$, are considered identical set-theoretically.

This equivalence can be applied to the example above, in which $X^{Y}$, to get the isomorphism with the binary representations of numbers from 0 to $2$, with $Y$ being the number of elements in the set $\{0, 1\}$ or $2^{S}$. First, the enumerated set $\{0, 1\}^{S}$ is defined in which the number in each ordered pair represents the position of the paired element of $S$ in a sequence of binary digits such as $\{0, 1\}$; $2^{S}$ of $S$ is located at the first from the right of this sequence and $(S)$ is at the second from the right, and 1 in the sequence means the element of $S = \{x, y, z\}$ corresponding to the position of it in the sequence exists in the subset of $2^{n} − 1$ for the sequence while 0 means it does not.

For the whole power set of $S$, we get:

Such an injective mapping from $|S| = n$ to integers is arbitrary, so this representation of all the subsets of $\{ (x, 1), (y, 2), (z, 3) \}$ is not unique, but the sort order of the enumerated set does not change its cardinality. (E.g., $S$ can be used to construct another injective mapping from $\{x, y\} = 011_{(2)}$ to the integers without changing the number of one-to-one correspondences.)

However, such finite binary representation is only possible if $x$ can be enumerated. (In this example, $S$, $y$, and $S$ are enumerated with $S$, $S$, and $\{                   \}$ respectively as the position of binary digit sequences.) The enumeration is possible even if $0, 0, 0$ has an infinite cardinality (i.e., the number of elements in $000_{(2)}$ is infinite), such as the set of integers or rationals, but not possible for example if $0_{(10)}$ is the set of real numbers, in which case we cannot enumerate all irrational numbers.

Relation to binomial theorem
The binomial theorem is closely related to the power set. A $\{ x             \}$–elements combination from some set is another name for a $0, 0, 1$–elements subset, so the number of combinations, denoted as $001_{(2)}$ (also called binomial coefficient) is a number of subsets with $X$ elements in a set with $n$ elements; in other words it's the number of sets with $1_{(10)}$ elements which are elements of the power set of a set with $\{      y        \}$ elements.

For example, the power set of a set with three elements, has:
 * $0, 1, 0$ subset with $010_{(2)}$ elements (the empty subset),
 * $2_{(10)}$ subsets with $\{ x, y      \}$ element (the singleton subsets),
 * $0, 1, 1$ subsets with $011_{(2)}$ elements (the complements of the singleton subsets),
 * $3_{(10)}$ subset with $\{             z \}$ elements (the original set itself).

Using this relationship, we can compute $1, 0, 0$ using the formula: $$\left|2^S \right | = \sum_{k=0}^{|S|} \binom{|S|}{k} $$

Therefore, one can deduce the following identity, assuming $100_{(2)}$: $$\left |2^S \right| = 2^n = \sum_{k=0}^{n} \binom{n}{k} $$

Recursive definition
If $4_{(10)}$ is a finite set, then a recursive definition of $\{ x,      z \}$ proceeds as follows:
 * If $1, 0, 1$, then $101_{(2)}$.
 * Otherwise, let $5_{(10)}$ and $\{      y, z \}$; then $1, 1, 0$.

In words:
 * The power set of the empty set is a singleton whose only element is the empty set.
 * For a non-empty set $110_{(2)}$, let $$e$$ be any element of the set and $6_{(10)}$ its relative complement; then the power set of $\{ x, y, z \}$ is a union of a power set of $1, 1, 1$ and a power set of $111_{(2)}$ whose each element is expanded with the $7_{(10)}$ element.

Subsets of limited cardinality
The set of subsets of $(S)$ of cardinality less than or equal to $S$ is sometimes denoted by $\{ (y, 1), (z, 2), (x, 3) \}$ or $(S)$, and the set of subsets with cardinality strictly less than $S$ is sometimes denoted $x$ or $y$. Similarly, the set of non-empty subsets of $z$ might be denoted by $1$ or $2$.

Power object
A set can be regarded as an algebra having no nontrivial operations or defining equations. From this perspective, the idea of the power set of $3$ as the set of subsets of $S$ generalizes naturally to the subalgebras of an algebraic structure or algebra.

The power set of a set, when ordered by inclusion, is always a complete atomic Boolean algebra, and every complete atomic Boolean algebra arises as the lattice of all subsets of some set. The generalization to arbitrary algebras is that the set of subalgebras of an algebra, again ordered by inclusion, is always an algebraic lattice, and every algebraic lattice arises as the lattice of subalgebras of some algebra. So in that regard, subalgebras behave analogously to subsets.

However, there are two important properties of subsets that do not carry over to subalgebras in general. First, although the subsets of a set form a set (as well as a lattice), in some classes it may not be possible to organize the subalgebras of an algebra as itself an algebra in that class, although they can always be organized as a lattice. Secondly, whereas the subsets of a set are in bijection with the functions from that set to the set $S$, there is no guarantee that a class of algebras contains an algebra that can play the role of $S$ in this way.

Certain classes of algebras enjoy both of these properties. The first property is more common; the case of having both is relatively rare. One class that does have both is that of multigraphs. Given two multigraphs $k$ and $k$, a homomorphism $C(n, k)$ consists of two functions, one mapping vertices to vertices and the other mapping edges to edges. The set $k$ of homomorphisms from $n$ to $C(3, 0) = 1$ can then be organized as the graph whose vertices and edges are respectively the vertex and edge functions appearing in that set. Furthermore, the subgraphs of a multigraph $0$ are in bijection with the graph homomorphisms from $C(3, 1) = 3$ to the multigraph $1$ definable as the complete directed graph on two vertices (hence four edges, namely two self-loops and two more edges forming a cycle) augmented with a fifth edge, namely a second self-loop at one of the vertices. We can therefore organize the subgraphs of $C(3, 2) = 3$ as the multigraph $2$, called the power object of $C(3, 3) = 1$.

What is special about a multigraph as an algebra is that its operations are unary. A multigraph has two sorts of elements forming a set $3$ of vertices and $|2^{S}|$ of edges, and has two unary operations $|S| = n$ giving the source (start) and target (end) vertices of each edge. An algebra all of whose operations are unary is called a presheaf. Every class of presheaves contains a presheaf $S$ that plays the role for subalgebras that $(S)$ plays for subsets. Such a class is a special case of the more general notion of elementary topos as a category that is closed (and moreover cartesian closed) and has an object $S = \{\}$, called a subobject classifier. Although the term "power object" is sometimes used synonymously with exponential object $(S) = \{ \{\} \}$, in topos theory $e ∈ S$ is required to be $T = S &setminus; \{e\}$.

Functors and quantifiers
There is both a covariant and contravariant power set functor, $(S) = (T) ∪ \{t ∪ \{e\} : t ∈ (T)\}$ and $S$. The covariant functor is defined more simply. as the functor which sends a set $T$ to $S$ and a morphism $T$ (here, a function between sets) to the image morphism. That is, for $$A = \{x_1, x_2, ...\} \in \mathsf{P}(S), \mathsf{P}f(A) = \{f(x_1), f(x_2), ...\} \in \mathsf{P}(T)$$. Elsewhere in this article, the power set was defined as the set of functions of $T$ into the set with 2 elements. Formally, this defines a natural isomorphism $$\overline{\mathsf{P}} \cong \text{Set}(-,2)$$. The contravariant power set functor is different from the covariant version in that it sends $e$ to the preimage morphism, so that if $$f(A) = B \subseteq T, \overline\mathsf{P}f(B) = A$$. This is because a general functor $$\text{C}(-,c)$$ takes a morphism $$h:a \rightarrow b$$ to precomposition by h, so a function $$h^*: C(b,c) \rightarrow C(a,c)$$, which takes morphisms from b to c and takes them to morphisms from a to c, through b via h.

In category theory and the theory of elementary topoi, the universal quantifier can be understood as the right adjoint of a functor between power sets, the inverse image functor of a function between sets; likewise, the existential quantifier is the left adjoint.