Intuition behind filter on a set In "Counter-examples in topology" of Steen and Seebach, they define a filter on a set $X$ is a collection F of subsets of $X$ with the following properties:


*

*Every subset of $X$ which contains a set of $F$ belongs to $F$ 

*Every finite intersection of sets of $F$ belongs to $F$

*$\varnothing$ is not in $F$
My question is: what is the intuition behind this definition?
 A: Generally each filter encodes a possible meaning of what it means for a subset of $X$ to be "large enough" or "contain enough points" for something.
In addition to Asaf's examples, other good filters to keep in mind are


*

*The principal filter of $x\in X$, which is the set of all subsets of $X$ that contain $x$. Here "large enough" is almost trivial, being large enough just means to contain $x$.

*The neighborhood filter of $x$, when $X$ is a topological space. This is the set of all subsets of $X$ that have $x$ as an interior point.
These example show that being "large" or (in Asaf's words) including "most" elements can be very context dependent and doesn't need to correspond to "most" in an objective sense.

The neighborhood filter is particularly important because it is the prototype of the use of filters to generalize the notion of limits. Filters are one possible answer to what kind of thing does "$x\to 5$" in $\lim\limits_{x\to 5} f(x)$ stand for.
For example, when $\mathcal F$ is a filter in $X$ and $f$ is some function defined on $X$, we can define $$\lim_{x\to\mathcal F} f(x)=y \text{ means that } \forall \varepsilon>0\, \exists F\in\mathcal F\, \forall x\in F : |f(x)-y|<\varepsilon$$ 
If we choose $\mathcal F$ to be the punctured-neighborhood filter at $5$ gives us the usual limit for $x\to 5$. But there are other filters that give one-sided limits ($x\to 5^+$ corresponds to the filter of all sets that contain $(5,5+\delta]$ for some $\delta>0$) or limits involving infinity ($x\to-\infty$ corresponds to the filter of all sets that contain $(-\infty,y]$ for some $y\in\mathbb R$), and so forth, which can now be considered instances of a single uniform concept.
A: Filters come to model the notion of "large sets", or subsets which include "most" of the elements of $X$.


*

*Most elements of $X$ are in $X$; and most elements are not in $\varnothing$.

*If most elements are in $A$ and most elements are in $B$, then most elements are in $A\cap B$.

*If most elements are in $A$, and $A\subseteq B$, then of course that most elements are in $B$.


Examples for "most" can be seen in the canonical examples, the cofinite filter, namely $\mathcal F=\{A\subseteq X\mid X\setminus A\text{ is finite}\}$. Then every $A\in\mathcal F$ includes most of the elements of $X$ in this aspect.
Similarly, $\{A\subseteq[0,1]\mid m(A)=1\}$ where $m$ is the Lebesgue measure, also gives us a filter on $[0,1]$ which give us subsets which are almost everything in terms of measure.
A: My intuition for a filter is very literal. I imagin you have a set of elements $S$ and you send them though "actual filters" and recive some outputs i.e. subsets of the original set $A \subset S$. The thing we call filter $X$ is then the collection of subsets ("actual filters") of the original set $X \subset P(S)$ (where $P(S)$ denotes the power set of $S$).
The filter $X$ describes a collection of "actual filters" that fulfill a certain property. Thus every "actual filter" $A$ in $X$ should at least contain the elements from the original set $S$ we are interested in when considering the filter $X$. So the complement of "actual filters" contains elements we are not interested in (you can show the fact: $A \in X \implies A^c \not\in X$ only from the definition of filters).
Now the interpretation of the definition of filters:

*

*Clearly $S$ has to be in the filter $X$, because the element(s) we are interested in are certainly in $S$. And with the same notinon $\emptyset$ is not in our filter because the "actual filter" $\emptyset$ filters out all elements, thus also the ones we are interested in.


*If we have two "actual filters" $A$ and $B$ in our collection $X$, then they both contain the elements we are interested in (i.e. only filter out elements we do not care about) thus the intercection of these "actual filters" $A\cap B$ also contains the elements we are interested in, so $A \cap B$ is in $X$.


*Suppose $A$ is a "actual filter" in our collection $X$ then every superset of $A$ also filters out the elements we are interested in. For every set $B$ the union $A \cup B$ is a superset of $A$. So $A \cup B$ is in $X$.
This interpretation breaks abaprt a bit, if you consider Frechet filters which contain sets that have finite complements. Instead of spesific elements, the Frechet filter describes "actual filters" that only filter out a finite amount of elements.
Ultrafilters $U$ would then be the maximal collection of "actual filters" that filter out elements with a certain property associated to our filter.
