In the mathematical field of set theory, an **ultrafilter** is a *maximal proper filter*: it is a filter on a given non-empty set which is a certain type of non-empty family of subsets of that is not equal to the power set of (such filters are called *proper*) and that is also "maximal" in that there does not exist any other proper filter on that contains it as a proper subset.
Said differently, a proper filter is called an ultrafilter if there exists *exactly one* proper filter that contains it as a subset, that proper filter (necessarily) being itself.

More formally, an ultrafilter on is a proper filter that is also a maximal filter on with respect to set inclusion, meaning that there does not exist any proper filter on that contains as a proper subset. Ultrafilters on sets are an important special instance of ultrafilters on partially ordered sets, where the partially ordered set consists of the power set and the partial order is subset inclusion

Ultrafilters have many applications in set theory, model theory, and topology.^{[1]}^{: 186 }

See also: Filter (mathematics) and Ultrafilter |

Given an arbitrary set an ultrafilter on is a non-empty family of subsets of such that:

*Proper*or*non-degenerate*: The empty set is not an element of*Upward closed in*: If and if is any superset of (that is, if ) then*π−system*: If and are elements of then so is their intersection- If then either
^{[note 1]}or its relative complement is an element of

Properties (1), (2), and (3) are the defining properties of a *filter on * Some authors do not include non-degeneracy (which is property (1) above) in their definition of "filter". However, the definition of "ultrafilter" (and also of "prefilter" and "filter subbase") always includes non-degeneracy as a defining condition. This article requires that all filters be proper although a filter might be described as "proper" for emphasis.

For a filter that is not an ultrafilter, one would say if and if leaving undefined elsewhere.^{[citation needed]}^{[clarification needed]}

A **filter subbase** is a non-empty family of sets that has the finite intersection property (i.e. all finite intersections are non-empty). Equivalently, a filter subbase is a non-empty family of sets that is contained in

The **upward closure** in of a family of sets is the set

A **prefilter** or **filter base** is a non-empty and proper (i.e. ) family of sets that is **downward directed**, which means that if then there exists some such that Equivalently, a prefilter is any family of sets whose upward closure is a filter, in which case this filter is called the **filter generated by ** and is said to be **a filter base for **

The **dual in **^{[2]} of a family of sets is the set For example, the dual of the power set is itself:
A family of sets is a proper filter on if and only if its dual is a proper ideal on ("*proper*" means not equal to the power set).

**Interpretation as large sets**

The elements of a proper filter on may be thought of as being "large sets (relative to )" and the complements in of a large sets can be thought of as being "small" sets^{[3]} (the "small sets" are exactly the elements in the ideal ).

To see why filters and ideals should respectively be associated with "large" and "small" sets (rather than vice versa), we begin by explaining why sets in an ideal should be interpreted as "small" by considering the notion of "bounded subsets" (such as in a metric space or a normed space like ).
The following properties should be expected of any reasonable generalization of "bounded subsets": subsets of bounded sets should be bounded, the empty set should be bounded, the union of two bounded sets should be bounded, and every point (singleton subset) should be bounded. These are the defining properties of a *bornology* on Explicitly, an ideal that covers is called a *bornology* on and elements of given a bornology are called *bounded sets*. Bounded sets, especially singleton and finite sets, are naturally interpreted as "small sets". Thus we are led to associate ideals with "small sets". Assuming that is not a bounded/"small set" (that is, if or said differently, if is a proper ideal) then it is reasonable to interpret complements of "small sets" as being "large sets". In other words, "large sets" are those belonging to the dual of the ideal Recalling that a family of subsets of is a proper ideal if and only if its dual is a filter on ^{[2]} we are thus led to associate filters with "large sets".

In general, there may be subsets of that are *neither* large nor small (e.g. a set not in nor its dual ), or possibly *simultaneously* large and small (e.g. if is not a proper ideal). A dual ideal is a filter (i.e. proper) if there is no set that is both large and small, or equivalently, if the is not large.^{[3]} A filter is ultra if and only if *every* subset of is either large or else small. With this terminology, the defining properties of a filter can be restarted as: (1) any superset of a large set is large set, (2) the intersection of any two (or finitely many) large sets is large, (3) is a large set (i.e. ), (4) the empty set is not large. Different dual ideals give different notions of "large" sets.

Another way of looking at ultrafilters on a power set is as follows: for a given ultrafilter define a function on by setting if is an element of and otherwise. Such a function is called a 2-valued morphism. Then is finitely additive, and hence a *content* on and every property of elements of is either true almost everywhere or false almost everywhere. However, is usually not *countably additive*, and hence does not define a measure in the usual sense.

A family of subsets of is called **ultra** if and any of the following equivalent conditions are satisfied:^{[2]}^{[4]}

- For every set there exists some set such that or (or equivalently, such that equals or ).
- For every set there exists some set such that equals or
- Here, is defined to be the union of all sets in
- This characterization of " is ultra" does not depend on the set so mentioning the set is optional when using the term "ultra."

- For
*every*set (not necessarily even a subset of ) there exists some set such that equals or- If satisfies this condition then so does
*every*superset In particular, a set is ultra if and only if and contains as a subset some ultra family of sets.

- If satisfies this condition then so does

A filter subbase that is ultra is necessarily a prefilter.^{[proof 1]}

The ultra property can now be used to define both ultrafilters and ultra prefilters:

- An
**ultra prefilter**^{[2]}^{[4]}is a prefilter that is ultra. Equivalently, it is a filter subbase that is ultra.

- An
**ultrafilter**^{[2]}^{[4]}on is a (proper) filter on that is ultra. Equivalently, it is any filter on that is generated by an ultra prefilter.

**Ultra prefilters as maximal prefilters**

To characterize ultra prefilters in terms of "maximality," the following relation is needed.

- Given two families of sets and the family is said to be
**coarser**^{[5]}^{[6]}than and is**finer**than and**subordinate to**written or*N*⊢*M*, if for every there is some such that The families and are called**equivalent**if and The families and are**comparable**if one of these sets is finer than the other.^{[5]}

The subordination relationship, i.e. is a preorder so the above definition of "equivalent" does form an equivalence relation. If then but the converse does not hold in general. However, if is upward closed, such as a filter, then if and only if Every prefilter is equivalent to the filter that it generates. This shows that it is possible for filters to be equivalent to sets that are not filters.

If two families of sets and are equivalent then either both and are ultra (resp. prefilters, filter subbases) or otherwise neither one of them is ultra (resp. a prefilter, a filter subbase).
In particular, if a filter subbase is not also a prefilter, then it is *not* equivalent to the filter or prefilter that it generates. If and are both filters on then and are equivalent if and only if If a proper filter (resp. ultrafilter) is equivalent to a family of sets then is necessarily a prefilter (resp. ultra prefilter).
Using the following characterization, it is possible to define prefilters (resp. ultra prefilters) using only the concept of filters (resp. ultrafilters) and subordination:

- An arbitrary family of sets is a prefilter if and only it is equivalent to a (proper) filter.
- An arbitrary family of sets is an ultra prefilter if and only it is equivalent to an ultrafilter.

- A
**maximal prefilter on**^{[2]}^{[4]}is a prefilter that satisfies any of the following equivalent conditions:

- is ultra.
- is
**maximal**on with respect to meaning that if satisfies then^{[4]} - There is no prefilter properly subordinate to
^{[4]} - If a (proper) filter on satisfies then
- The filter on generated by is ultra.

There are no ultrafilters on the empty set, so it is henceforth assumed that is nonempty.

A filter *sub*base on is an ultrafilter on if and only if any of the following equivalent conditions hold:^{[2]}^{[4]}

- for any either or
- is a maximal filter subbase on meaning that if is any filter subbase on then implies
^{[3]}

A (proper) filter on is an ultrafilter on if and only if any of the following equivalent conditions hold:

- is ultra;
- is generated by an ultra prefilter;
- For any subset or
^{[3]}- So an ultrafilter decides for every whether is "large" (i.e. ) or "small" (i.e. ).
^{[7]}

- So an ultrafilter decides for every whether is "large" (i.e. ) or "small" (i.e. ).
- For each subset either
^{[note 1]}is in or () is. - This condition can be restated as: is partitioned by and its dual
- The sets and are disjoint for all prefilters on

- is an ideal on
^{[3]} - For any finite family of subsets of (where ), if then for some index
- In words, a "large" set cannot be a finite union of sets that aren't large.
^{[8]}

- In words, a "large" set cannot be a finite union of sets that aren't large.
- For any if then or
- For any if then or (a filter with this property is called a
).*prime filter* - For any if and then
*either*or - is a maximal filter; that is, if is a filter on such that then Equivalently, is a maximal filter if there is no filter on that contains as a proper subset (that is, no filter is strictly finer than ).
^{[3]}

If then its *grill on * is the family

where may be written if is clear from context.
For example, and if then
If then and moreover, if is a filter subbase then

The grill of a filter on is called a *filter-grill on *^{[9]} For any is a filter-grill on if and only if (1) is upward closed in and (2) for all sets and if then or The grill operation induces a bijection

whose inverse is also given by ^{[9]} If then is a filter-grill on if and only if ^{[9]} or equivalently, if and only if is an ultrafilter on ^{[9]} That is, a filter on is a filter-grill if and only if it is ultra. For any non-empty is both a filter on and a filter-grill on if and only if (1) and (2) for all the following equivalences hold:

- if and only if if and only if
^{[9]}

If is any non-empty family of sets then the **Kernel of ** is the intersection of all sets in ^{[10]}

A non-empty family of sets is called:

**free**if and**fixed**otherwise (that is, if ).**principal**if**principal at a point**if and is a singleton set; in this case, if then is said to be**principal at**

If a family of sets is fixed then is ultra if and only if some element of is a singleton set, in which case will necessarily be a prefilter. Every principal prefilter is fixed, so a principal prefilter is ultra if and only if is a singleton set. A singleton set is ultra if and only if its sole element is also a singleton set.

Every filter on that is principal at a single point is an ultrafilter, and if in addition is finite, then there are no ultrafilters on other than these.^{[10]} If there exists a free ultrafilter (or even filter subbase) on a set then must be infinite.

The next theorem shows that every ultrafilter falls into one of two categories: either it is free or else it is a principal filter generated by a single point.

**Proposition** — If is an ultrafilter on then the following are equivalent:

- is fixed, or equivalently, not free.
- is principal.
- Some element of is a finite set.
- Some element of is a singleton set.
- is principal at some point of which means for some
- does
*not*contain the Fréchet filter on as a subset. - is sequential.
^{[9]}

If and are families of sets such that is ultra, and then is necessarily ultra. A filter subbase that is not a prefilter cannot be ultra; but it is nevertheless still possible for the prefilter and filter generated by to be ultra.

Suppose is ultra and is a set.
The trace is ultra if and only if it does not contain the empty set.
Furthermore, at least one of the sets and will be ultra (this result extends to any finite partition of ).
If are filters on is an ultrafilter on and then there is some that satisfies ^{[11]}
This result is not necessarily true for an infinite family of filters.^{[11]}

The image under a map of an ultra set is again ultra and if is an ultra prefilter then so is The property of being ultra is preserved under bijections. However, the preimage of an ultrafilter is not necessarily ultra, not even if the map is surjective. For example, if has more than one point and if the range of consists of a single point then is an ultra prefilter on but its preimage is not ultra. Alternatively, if is a principal filter generated by a point in then the preimage of contains the empty set and so is not ultra.

The elementary filter induced by an infinite sequence, all of whose points are distinct, is *not* an ultrafilter.^{[11]} If then denotes the set consisting all subsets of having cardinality and if contains at least () distinct points, then is ultra but it is not contained in any prefilter. This example generalizes to any integer and also to if contains more than one element. Ultra sets that are not also prefilters are rarely used.

For every and every let If is an ultrafilter on then the set of all such that is an ultrafilter on ^{[12]}

The functor associating to any set the set of of all ultrafilters on forms a monad called the ultrafilter monad. The unit map

sends any element to the principal ultrafilter given by

This monad admits a conceptual explanation as the codensity monad of the inclusion of the category of finite sets into the category of all sets.^{[13]}

The ultrafilter lemma was first proved by Alfred Tarski in 1930.^{[12]}

**The ultrafilter lemma/principle/theorem ^{[5]}** — Every proper filter on a set is contained in some ultrafilter on

The ultrafilter lemma is equivalent to each of the following statements:

- For every prefilter on a set there exists a maximal prefilter on subordinate to it.
^{[2]} - Every proper filter subbase on a set is contained in some ultrafilter on

A consequence of the ultrafilter lemma is that every filter is equal to the intersection of all ultrafilters containing it.^{[14]}^{[note 2]}

The following results can be proven using the ultrafilter lemma.
A free ultrafilter exists on a set if and only if is infinite. Every proper filter is equal to the intersection of all ultrafilters containing it.^{[5]} Since there are filters that are not ultra, this shows that the intersection of a family of ultrafilters need not be ultra. A family of sets can be extended to a free ultrafilter if and only if the intersection of any finite family of elements of is infinite.

See also: Boolean prime ideal theorem and Set-theoretic topology |

Throughout this section, **ZF** refers to Zermelo–Fraenkel set theory and **ZFC** refers to **ZF** with the Axiom of Choice (**AC**). The ultrafilter lemma is independent of **ZF**. That is, there exist models in which the axioms of **ZF** hold but the ultrafilter lemma does not. There also exist models of **ZF** in which every ultrafilter is necessarily principal.

Every filter that contains a singleton set is necessarily an ultrafilter and given the definition of the discrete ultrafilter does not require more than **ZF**.
If is finite then every ultrafilter is a discrete filter at a point; consequently, free ultrafilters can only exist on infinite sets.
In particular, if is finite then the ultrafilter lemma can be proven from the axioms **ZF**.
The existence of free ultrafilter on infinite sets can be proven if the axiom of choice is assumed.
More generally, the ultrafilter lemma can be proven by using the axiom of choice, which in brief states that any Cartesian product of non-empty sets is non-empty. Under **ZF**, the axiom of choice is, in particular, equivalent to (a) Zorn's lemma, (b) Tychonoff's theorem, (c) the weak form of the vector basis theorem (which states that every vector space has a basis), (d) the strong form of the vector basis theorem, and other statements.
However, the ultrafilter lemma is strictly weaker than the axiom of choice.
While free ultrafilters can be proven to exist, it is *not* possible to construct an explicit example of a free ultrafilter; that is, free ultrafilters are intangible.^{[15]}
Alfred Tarski proved that under **ZFC**, the cardinality of the set of all free ultrafilters on an infinite set is equal to the cardinality of where denotes the power set of ^{[16]}
Other authors attribute this discovery to Bedřich Pospíšil (following a combinatorial argument from Fichtenholz, and Kantorovitch, improved by Hausdorff).^{[17]}^{[18]}

Under **ZF**, the axiom of choice can be used to prove both the ultrafilter lemma and the Krein–Milman theorem; conversely, under **ZF**, the ultrafilter lemma together with the Krein–Milman theorem can prove the axiom of choice.^{[19]}

The ultrafilter lemma is a relatively weak axiom. For example, each of the statements in the following list can *not* be deduced from **ZF** together with *only* the ultrafilter lemma:

- A countable union of countable sets is a countable set.
- The axiom of countable choice (
**ACC**). - The axiom of dependent choice (
**ADC**).

Under **ZF**, the ultrafilter lemma is equivalent to each of the following statements:^{[20]}

- The Boolean prime ideal theorem (
**BPIT**).- This equivalence is provable in
**ZF**set theory without the Axiom of Choice (**AC**).

- This equivalence is provable in
- Stone's representation theorem for Boolean algebras.
- Any product of Boolean spaces is a Boolean space.
^{[21]} - Boolean Prime Ideal Existence Theorem: Every nondegenerate Boolean algebra has a prime ideal.
^{[22]} - Tychonoff's theorem for Hausdorff spaces: Any product of compact Hausdorff spaces is compact.
^{[21]} - If is endowed with the discrete topology then for any set the product space is compact.
^{[21]} - Each of the following versions of the Banach-Alaoglu theorem is equivalent to the ultrafilter lemma:
- Any equicontinuous set of scalar-valued maps on a topological vector space (TVS) is relatively compact in the weak-* topology (that is, it is contained in some weak-* compact set).
^{[23]} - The polar of any neighborhood of the origin in a TVS is a weak-* compact subset of its continuous dual space.
^{[23]} - The closed unit ball in the continuous dual space of any normed space is weak-* compact.
^{[23]}- If the normed space is separable then the ultrafilter lemma is sufficient but not necessary to prove this statement.

- Any equicontinuous set of scalar-valued maps on a topological vector space (TVS) is relatively compact in the weak-* topology (that is, it is contained in some weak-* compact set).
- A topological space is compact if every ultrafilter on converges to some limit.
^{[24]} - A topological space is compact if
*and only if*every ultrafilter on converges to some limit.^{[24]}- The addition of the words "and only if" is the only difference between this statement and the one immediately above it.

- The Ultranet lemma: Every net has a universal subnet.
^{[25]} - A topological space is compact if and only if every ultranet on converges to some limit.
^{[24]}- If the words "and only if" are removed then the resulting statement remains equivalent to the ultrafilter lemma.
^{[24]}

- If the words "and only if" are removed then the resulting statement remains equivalent to the ultrafilter lemma.
- A convergence space is compact if every ultrafilter on converges.
^{[24]} - A uniform space is compact if it is complete and totally bounded.
^{[24]} - The Stone–Čech compactification Theorem.
^{[21]} - Each of the following versions of the compactness theorem is equivalent to the ultrafilter lemma:
- If is a set of first-order sentences such that every finite subset of has a model, then has a model.
^{[26]} - If is a set of zero-order sentences such that every finite subset of has a model, then has a model.
^{[26]}

- If is a set of first-order sentences such that every finite subset of has a model, then has a model.
- The completeness theorem: If is a set of zero-order sentences that is syntactically consistent, then it has a model (that is, it is semantically consistent).

Any statement that can be deduced from the ultrafilter lemma (together with **ZF**) is said to be *weaker* than the ultrafilter lemma.
A weaker statement is said to be *strictly weaker* if under **ZF**, it is not equivalent to the ultrafilter lemma.
Under **ZF**, the ultrafilter lemma implies each of the following statements:

- The Axiom of Choice for Finite sets (
**ACF**): Given and a family of non-empty*finite*sets, their product is not empty.^{[25]} - A countable union of finite sets is a countable set.
- However,
**ZF**with the ultrafilter lemma is too weak to prove that a countable union of*countable*sets is a countable set.

- However,
- The Hahn–Banach theorem.
^{[25]}- In
**ZF**, the Hahn–Banach theorem is strictly weaker than the ultrafilter lemma.

- In
- The Banach–Tarski paradox.
- In fact, under
**ZF**, the Banach–Tarski paradox can be deduced from the Hahn–Banach theorem,^{[27]}^{[28]}which is strictly weaker than the Ultrafilter Lemma.

- In fact, under
- Every set can be linearly ordered.
- Every field has a unique algebraic closure.
- The Alexander subbase theorem.
^{[25]} - Non-trivial ultraproducts exist.
- The weak ultrafilter theorem: A free ultrafilter exists on
- Under
**ZF**, the weak ultrafilter theorem does not imply the ultrafilter lemma; that is, it is strictly weaker than the ultrafilter lemma.

- Under
- There exists a free ultrafilter on every infinite set;
- This statement is actually strictly weaker than the ultrafilter lemma.
**ZF**alone does not even imply that there exists a non-principal ultrafilter on*some*set.

The **completeness** of an ultrafilter on a powerset is the smallest cardinal κ such that there are κ elements of whose intersection is not in The definition of an ultrafilter implies that the completeness of any powerset ultrafilter is at least . An ultrafilter whose completeness is *greater* than —that is, the intersection of any countable collection of elements of is still in —is called **countably complete** or **σ-complete**.

The completeness of a countably complete nonprincipal ultrafilter on a powerset is always a measurable cardinal.^{[citation needed]}

The **Rudin–Keisler ordering** (named after Mary Ellen Rudin and Howard Jerome Keisler) is a preorder on the class of powerset ultrafilters defined as follows: if is an ultrafilter on and an ultrafilter on then if there exists a function such that

- if and only if

for every subset

Ultrafilters and are called **Rudin–Keisler equivalent**, denoted *U* ≡_{RK} *V*, if there exist sets and and a bijection that satisfies the condition above. (If and have the same cardinality, the definition can be simplified by fixing )

It is known that ≡_{RK} is the kernel of ≤_{RK}, i.e., that *U* ≡_{RK} *V* if and only if and ^{[29]}

There are several special properties that an ultrafilter on where extends the natural numbers, may possess, which prove useful in various areas of set theory and topology.

- A non-principal ultrafilter is called a
**P-point**(or**weakly selective**) if for every partition of such that for all there exists some such that is a finite set for each - A non-principal ultrafilter is called
**Ramsey**(or**selective**) if for every partition of such that for all there exists some such that is a singleton set for each

It is a trivial observation that all Ramsey ultrafilters are P-points. Walter Rudin proved that the continuum hypothesis implies the existence of Ramsey ultrafilters.^{[30]}
In fact, many hypotheses imply the existence of Ramsey ultrafilters, including Martin's axiom. Saharon Shelah later showed that it is consistent that there are no P-point ultrafilters.^{[31]} Therefore, the existence of these types of ultrafilters is independent of ZFC.

P-points are called as such because they are topological P-points in the usual topology of the space βω \ ω of non-principal ultrafilters. The name Ramsey comes from Ramsey's theorem. To see why, one can prove that an ultrafilter is Ramsey if and only if for every 2-coloring of there exists an element of the ultrafilter that has a homogeneous color.

An ultrafilter on is Ramsey if and only if it is minimal in the Rudin–Keisler ordering of non-principal powerset ultrafilters.^{[32]}