In set theory, a filter is a family of subsets of a given set which has properties generalising those of neighbourhood in topology.
Formally, a filter on a set X is a subset
of the power set
with the properties:
![{\displaystyle X\in {\mathcal {F}};\,}](https://wikimedia.org/api/rest_v1/media/math/render/svg/7658cb3f8312a23b4615e7e7c19b95a4856fa552)
![{\displaystyle \emptyset \not \in {\mathcal {F}};\,}](https://wikimedia.org/api/rest_v1/media/math/render/svg/30caaa3dbd1ba7324ab248018a86e73aed6d04c3)
![{\displaystyle A,B\in {\mathcal {F}}\Rightarrow A\cap B\in {\mathcal {F}};\,}](https://wikimedia.org/api/rest_v1/media/math/render/svg/6d1d7a7b7afaeb1ede631afaf8bf7acc7d42964f)
![{\displaystyle A\in {\mathcal {F}}{\mbox{ and }}A\subseteq B\Rightarrow B\in {\mathcal {F}}.\,}](https://wikimedia.org/api/rest_v1/media/math/render/svg/f7376afaf7a6dbdc17c45cc26b80fd185d7b056c)
If G is a subset of X then the family
![{\displaystyle \langle G\rangle =\{A\subseteq X:G\subseteq A\}\,}](https://wikimedia.org/api/rest_v1/media/math/render/svg/8d59965019473c4d500dec6edb22e8b39acedb2f)
is a filter, the principal filter on G.
In a topological space
, the neighbourhoods of a point x
![{\displaystyle {\mathcal {N}}_{x}=\{N\subseteq X:\exists U\in {\mathcal {T}},x\in u\subseteq N\}\,}](https://wikimedia.org/api/rest_v1/media/math/render/svg/d7457fcdf8e146b3ee58b9696e17f9740765b6ae)
form a filter, the neighbourhood filter of x.
Filter bases
A base
for the filter
is a non-empty collection of non-empty sets such that the family of subsets of X containing some element of
is precisely the filter
.
Ultrafilters
An ultrafilter is a maximal filter: that is, a filter on a set which is not properly contained in any other filter on the set. Equivalently, it is a filter
with the property that for any subset
either
or the complement
.
The principal filter on a singleton set {x}, namely, all subsets of X containing x, is an ultrafilter.