# Ultrafilter

In the mathematical field of order theory, an ultrafilter on a given partially ordered set (or "poset") P{\textstyle P} is a certain subset of $P,$ namely a maximal filter on $P;$ that is, a proper filter on P{\textstyle P} that cannot be enlarged to a bigger proper filter on $P.$
If $X$ is an arbitrary set, its power set ${\mathcal {P}}(X),$ ordered by set inclusion, is always a Boolean algebra and hence a poset, and ultrafilters on ${\mathcal {P}}(X)$ are usually called ultrafilters on the set $X$. An ultrafilter on a set $X$ may be considered as a finitely additive 0-1-valued measure on ${\mathcal {P}}(X)$. In this view, every subset of $X$ is either considered "almost everything" (has measure 1) or "almost nothing" (has measure 0), depending on whether it belongs to the given ultrafilter or not.$^{:§4}$
Ultrafilters have many applications in set theory, model theory, topology$^{:186}$ and combinatorics.

## Ultrafilters on partial orders

In order theory, an ultrafilter is a subset of a partially ordered set that is maximal among all proper filters. This implies that any filter that properly contains an ultrafilter has to be equal to the whole poset.
Formally, if P{\textstyle P} is a set, partially ordered by $\,\leq \,$ then
* a subset $F\subseteq P$ is called a filter on P{\textstyle P} if
** $F$ is nonempty,
** for every $x,y\in F,$ there exists some element $z\in F$ such that $z\leq x$ and $z\leq y,$ and
** for every $x\in F$ and $y\in P,$ $x\leq y$ implies that $y$ is in $F$ too;
* a proper subset $U$ of P{\textstyle P} is called an ultrafilter on P{\textstyle P} if
** $U$ is a filter on $P,$ and
** there is no proper filter $F$ on P{\textstyle P} that properly extends $U$ (that is, such that $U$ is a proper subset of $F$).

### Types and existence of ultrafilters

Every ultrafilter falls into exactly one of two categories: principal or free. A principal (or fixed, or trivial) ultrafilter is a filter containing a least element. Consequently, each principal ultrafilter is of the form $F_{p}=\{x:p\leq x\}$ for some element $p$ of the given poset. In this case $p$ is called the principal element of the ultrafilter. Any ultrafilter that is not principal is called a free (or non-principal) ultrafilter. For arbitrary $p$, the set $F_{p}$ is a filter, called the principal filter at $p$; it is a principal ultrafilter only if it is maximal.
For ultrafilters on a powerset ${\mathcal {P}}(X),$ a principal ultrafilter consists of all subsets of $X$ that contain a given element $x\in X.$ Each ultrafilter on ${\mathcal {P}}(X)$ that is also a principal filter is of this form.$^{:187}$ Therefore, an ultrafilter $U$ on ${\mathcal {P}}(X)$ is principal if and only if it contains a finite set. If $X$ is infinite, an ultrafilter $U$ on ${\mathcal {P}}(X)$ is hence non-principal if and only if it contains the Fréchet filter of cofinite subsets of $X.$$^{:Proposition3}$ If $X$ is finite, every ultrafilter is principal.$^{:187}$ If $X$ is infinite then the Fréchet filter is not an ultrafilter on the power set of $X$ but it is an ultrafilter on the finite–cofinite algebra of $X.$
Every filter on a Boolean algebra (or more generally, any subset with the finite intersection property) is contained in an ultrafilter (see ultrafilter lemma) and free ultrafilters therefore exist, but the proofs involve the axiom of choice (AC) in the form of Zorn's lemma. On the other hand, the statement that every filter is contained in an ultrafilter does not imply AC. Indeed, it is equivalent to the Boolean prime ideal theorem (BPIT), a well-known intermediate point between the axioms of Zermelo–Fraenkel set theory (ZF) and the ZF theory augmented by the axiom of choice (ZFC). In general, proofs involving the axiom of choice do not produce explicit examples of free ultrafilters, though it is possible to find explicit examples in some models of ZFC; for example, Gödel showed that this can be done in the constructible universe where one can write down an explicit global choice function. In ZF without the axiom of choice, it is possible that every ultrafilter is principal.

## Ultrafilter on a Boolean algebra

An important special case of the concept occurs if the considered poset is a Boolean algebra. In this case, ultrafilters are characterized by containing, for each element $x$ of the Boolean algebra, exactly one of the elements $x$ and $\lnot x$ (the latter being the Boolean complement of $x$):
If P{\textstyle P} is a Boolean algebra and $F$ is a proper filter on $P,$ then the following statements are equivalent:
* $F$ is an ultrafilter on $P,$
* $F$ is a prime filter on $P,$
* for each $x\in P,$ either $x\in F$ or ($\lnot x$) $\in F.$$^{:186}$
A proof that 1. and 2. are equivalent is also given in (Burris, Sankappanavar, 2012, Corollary 3.13, p.133).
Moreover, ultrafilters on a Boolean algebra can be related to maximal ideals and homomorphisms to the 2-element Boolean algebra {true, false} (also known as 2-valued morphisms) as follows:
* Given a homomorphism of a Boolean algebra onto {true, false}, the inverse image of "true" is an ultrafilter, and the inverse image of "false" is a maximal ideal.
* Given a maximal ideal of a Boolean algebra, its complement is an ultrafilter, and there is a unique homomorphism onto {true, false} taking the maximal ideal to "false".
* Given an ultrafilter on a Boolean algebra, its complement is a maximal ideal, and there is a unique homomorphism onto {true, false} taking the ultrafilter to "true".

## Ultrafilter on the power set of a set

Given an arbitrary set $X,$ its power set ${\mathcal {P}}(X),$ ordered by set inclusion, is always a Boolean algebra; hence the results of the above section apply. An (ultra)filter on ${\mathcal {P}}(X)$ is often called just an "(ultra)filter on $X$". Given an arbitrary set $X,$ an ultrafilter on ${\mathcal {P}}(X)$ is a set ${\mathcal {U}}$ consisting of subsets of $X$ such that:
* The empty set is not an element of ${\mathcal {U}}$.
* If $A$ is an element of ${\mathcal {U}}$ then so is every superset $B\supset A$.
* If $A$ and $B$ are elements of ${\mathcal {U}}$ then so is the intersection $A\cap B$.
* If $A$ is a subset of $X,$ then either $A$ or its complement $X\setminus A$ is an element of ${\mathcal {U}}$.
Equivalently, a family ${\mathcal {U}}$ of subsets of $X$ is an ultrafilter if and only if for any finite collection ${\mathcal {F}}$ of subsets of $X$, there is some $x\in X$ such that ${\mathcal {U}}\cap {\mathcal {F}}=F_{x}\cap {\mathcal {F}}$ where $F_{x}=\{Y\subseteq X:x\in Y\}$ is the principal ultrafilter seeded by $x$. In other words, an ultrafilter may be seen as a family of sets which "locally" resembles a principal ultrafilter.
An equivalent form of a given ${\mathcal {U}}$ is a 2-valued morphism, a function $m$ on ${\mathcal {P}}(X)$ defined as $m(A)=1$ if $A$ is an element of ${\mathcal {U}}$ and $m(A)=0$ otherwise. Then $m$ is finitely additive, and hence a content on ${\mathcal {P}}(X),$ and every property of elements of $X$ is either true almost everywhere or false almost everywhere. However, $m$ is usually not countably additive, and hence does not define a measure in the usual sense.
For a filter ${\mathcal {F}}$ that is not an ultrafilter, one can define $m(A)=1$ if $A\in {\mathcal {F}}$ and $m(A)=0$ if $X\setminus A\in {\mathcal {F}},$ leaving $m$ undefined elsewhere.

## Applications

Ultrafilters on power sets are useful in topology, especially in relation to compact Hausdorff spaces, and in model theory in the construction of ultraproducts and ultrapowers. Every ultrafilter on a compact Hausdorff space converges to exactly one point. Likewise, ultrafilters on Boolean algebras play a central role in Stone's representation theorem. In set theory ultrafilters are used to show that the axiom of constructibility is incompatible with the existence of a measurable cardinal κ. This is proved by taking the ultrapower of the set theoretical universe modulo a κ-complete, non-principal ultrafilter.
The set $G$ of all ultrafilters of a poset P{\textstyle P} can be topologized in a natural way, that is in fact closely related to the above-mentioned representation theorem. For any element $x$ of P{\textstyle P}, let $D_{x}=\left\{U\in G:x\in U\right\}.$ This is most useful when P{\textstyle P} is again a Boolean algebra, since in this situation the set of all $D_{x}$ is a base for a compact Hausdorff topology on $G$. Especially, when considering the ultrafilters on a powerset ${\mathcal {P}}(S)$, the resulting topological space is the Stone–Čech compactification of a discrete space of cardinality $|S|.$
The ultraproduct construction in model theory uses ultrafilters to produce a new model starting from a sequence of $X$-indexed models; for example, the compactness theorem can be proved this way. In the special case of ultrapowers, one gets elementary extensions of structures. For example, in nonstandard analysis, the hyperreal numbers can be constructed as an ultraproduct of the real numbers, extending the domain of discourse from real numbers to sequences of real numbers. This sequence space is regarded as a superset of the reals by identifying each real with the corresponding constant sequence. To extend the familiar functions and relations (e.g., + and <) from the reals to the hyperreals, the natural idea is to define them pointwise. But this would lose important logical properties of the reals; for example, pointwise < is not a total ordering. So instead the functions and relations are defined "pointwise modulo" $U$, where $U$ is an ultrafilter on the index set of the sequences; by Łoś' theorem, this preserves all properties of the reals that can be stated in first-order logic. If $U$ is nonprincipal, then the extension thereby obtained is nontrivial.
In geometric group theory, non-principal ultrafilters are used to define the asymptotic cone of a group. This construction yields a rigorous way to consider looking at the group from infinity, that is the large scale geometry of the group. Asymptotic cones are particular examples of ultralimits of metric spaces.
Gödel's ontological proof of God's existence uses as an axiom that the set of all "positive properties" is an ultrafilter.
In social choice theory, non-principal ultrafilters are used to define a rule (called a social welfare function) for aggregating the preferences of infinitely many individuals. Contrary to Arrow's impossibility theorem for finitely many individuals, such a rule satisfies the conditions (properties) that Arrow proposes (for example, Kirman and Sondermann, 1972). Mihara (1997, 1999) shows, however, such rules are practically of limited interest to social scientists, since they are non-algorithmic or non-computable.