# Meagre set

In the mathematical field of general topology, a meagre set (also called a meager set or a set of first category) is a subset of a topological space that is small or negligible in a precise sense detailed below. A set that is not meagre is called nonmeagre, or of the second category. See below for definitions of other related terms.
The meagre subsets of a fixed space form a σ-ideal of subsets; that is, any subset of a meagre set is meagre, and the union of countably many meagre sets is meagre.
Meagre sets play an important role in the formulation of the notion of Baire space and of the Baire category theorem, which is used in the proof of several fundamental results of functional analysis.

## Definitions

Throughout, $X$ will be a topological space.
The definition of meagre set uses the notion of a nowhere dense subset of $X,$ that is, a subset of $X$ whose closure has empty interior. See the corresponding article for more details.
A subset of $X$ is called meagre in $X,$ a meagre subset of $X,$ or of the first category in $X$ if it is a countable union of nowhere dense subsets of $X$. Otherwise, the subset is called nonmeagre in $X,$ a nonmeagre subset of $X,$ or of the second category in $X.$ The qualifier "in $X$" can be omitted if the ambient space is fixed and understood from context.
A topological space is called meagre (respectively, nonmeagre) if it is a meagre (respectively, nonmeagre) subset of itself.
A subset $A$ of $X$ is called comeagre in $X,$ or residual in $X,$ if its complement $X\setminus A$ is meagre in $X$. (This use of the prefix "co" is consistent with its use in other terms such as "cofinite".) A subset is comeagre in $X$ if and only if it is equal to a countable intersection of sets, each of whose interior is dense in $X.$
Remarks on terminology
The notions of nonmeagre and comeagre should not be confused. If the space $X$ is meagre, every subset is both meagre and comeagre, and there are no nonmeagre sets. If the space $X$ is nonmeager, no set is at the same time meagre and comeager, every comeagre set is nonmeagre, and there can be nonmeagre sets that are not comeagre, that is, with nonmeagre complement. See the Examples section below.
As an additional point of terminology, if a subset $A$ of a topological space $X$ is given the subspace topology induced from $X$, one can talk about it being a meagre space, namely being a meagre subset of itself (when considered as a topological space in its own right). In this case $A$ can also be called a meagre subspace of $X$, meaning a meagre space when given the subspace topology. Importantly, this is not the same as being meagre in the whole space $X$. (See the Properties and Examples sections below for the relationship between the two.) Similarly, a nonmeagre subspace will be a set that is nonmeagre in itself, which is not the same as being nonmeagre in the whole space. Be aware however that in the context of topological vector spaces some authors may use the phrase "meagre/nonmeagre subspace" to mean a vector subspace that is a meagre/nonmeagre set relative to the whole space.
The terms first category and second category were the original ones used by René Baire in his thesis of 1899. The meagre terminology was introduced by Bourbaki in 1948.

## Examples

The empty set is always a closed nowhere dense (and thus meagre) subset of every topological space.
In the nonmeagre space $X=[0,1]\cup ([2,3]\cap \mathbb {Q} )$ the set $[2,3]\cap \mathbb {Q}$ is meagre. The set $[0,1]$ is nonmeagre and comeagre.
In the nonmeagre space $X=[0,2]$ the set $[0,1]$ is nonmeagre. But it is not comeagre, as its complement $(1,2]$ is also nonmeagre.
A countable T$_1$ space without isolated point is meagre. So it is also meagre in any space that contains it as a subspace. For example, $\mathbb {Q}$ is both a meagre subspace of $\mathbb {R}$ (that is, meagre in itself with the subspace topology induced from $\mathbb {R}$) and a meagre subset of $\mathbb {R} .$
The Cantor set is nowhere dense in $\mathbb {R}$ and hence meagre in $\mathbb {R} .$ But it is nonmeagre in itself, since it is a complete metric space.
The set $([0,1]\cap \mathbb {Q} )\cup \{2\}$ is not nowhere dense in $\mathbb {R}$, but it is meagre in $\mathbb {R}$. It is nonmeagre in itself (since as a subspace it contains an isolated point).
The line $\mathbb {R} \times \{0\}$ is meagre in the plane $\mathbb {R} ^{2}.$ But it is a nonmeagre subspace, that is, it is nonmeagre in itself.
The set $S=(\mathbb {Q} \times \mathbb {Q} )\cup (\mathbb {R} \times \{0\})$ is a meagre subset of $\mathbb {R} ^{2}$ even though its meagre subset $\mathbb {R} \times \{0\}$ is a nonmeagre subspace (that is, $\mathbb {R}$ is not a meagre topological space). A countable Hausdorff space without isolated points is meagre, whereas any topological space that contains an isolated point is nonmeagre. Because the rational numbers are countable, they are meagre as a subset of the reals and as a space—that is, they do not form a Baire space.
Any topological space that contains an isolated point is nonmeagre (because no set containing the isolated point can be nowhere dense). In particular, every nonempty discrete space is nonmeagre.
There is a subset $H$ of the real numbers $\mathbb {R}$ that splits every nonempty open set into two nonmeagre sets. That is, for every nonempty open set $U\subseteq \mathbb {R}$, the sets $U\cap H$ and $U\setminus H$ are both nonmeagre.
In the space $C([0,1])$ of continuous real-valued functions on $[0,1]$ with the topology of uniform convergence, the set $A$ of continuous real-valued functions on $[0,1]$ that have a derivative at some point is meagre. Since $C([0,1])$ is a complete metric space, it is nonmeagre. So the complement of $A$, which consists of the continuous real-valued nowhere differentiable functions on $[0,1],$ is comeagre and nonmeagre. In particular that set is not empty. This is one way to show the existence of continuous nowhere differentiable functions.
On an infinite-dimensional Banach space, there exists a discontinuous linear functional whose kernel is nonmeagre. Also, under Martin's axiom, on each separable Banach space, there exists a discontinuous linear functional whose kernel is meagre (this statement disproves the Wilansky–Klee conjecture).

## Characterizations and sufficient conditions

Every nonempty Baire space is nonmeagre. In particular, by the Baire category theorem every nonempty complete metric space and every nonempty locally compact Hausdorff space is nonmeagre.
Every nonempty Baire space is nonmeagre but there exist nonmeagre spaces that are not Baire spaces. Since complete (pseudo)metric spaces as well as Hausdorff locally compact spaces are Baire spaces, they are also nonmeagre spaces.
Any subset of a meagre set is a meagre set, as is the union of countably many meagre sets. If $h:X\to X$ is a homeomorphism then a subset $S\subseteq X$ is meagre if and only if $h(S)$ is meagre.
Every nowhere dense subset is a meagre set. Consequently, any closed subset of $X$ whose interior in $X$ is empty is of the first category of $X$ (that is, it is a meager subset of $X$).
The Banach category theorem states that in any space $X,$ the union of any family of open sets of the first category is of the first category.
All subsets and all countable unions of meagre sets are meagre. Thus the meagre subsets of a fixed space form a σ-ideal of subsets, a suitable notion of negligible set.
Dually, all supersets and all countable intersections of comeagre sets are comeagre. Every superset of a nonmeagre set is nonmeagre.
Suppose $A\subseteq Y\subseteq X,$ where $Y$ has the subspace topology induced from $X.$ The set $A$ may be meagre in $X$ without being meagre in $Y.$ However the following results hold:
* If $A$ is meagre in $Y,$ then $A$ is meagre in $X.$
* If $Y$ is open in $X,$ then $A$ is meagre in $Y$ if and only if $A$ is meagre in $X.$
* If $Y$ is dense in $X,$ then $A$ is meagre in $Y$ if and only if $A$ is meagre in $X.$
And correspondingly for nonmeagre sets:
* If $A$ is nonmeagre in $X,$ then $A$ is nonmeagre in $Y.$
* If $Y$ is open in $X,$ then $A$ is nonmeagre in $Y$ if and only if $A$ is nonmeagre in $X.$
* If $Y$ is dense in $X,$ then $A$ is nonmeagre in $Y$ if and only if $A$ is nonmeagre in $X.$
In particular, every subset of $X$ that is meagre in itself is meagre in $X.$ Every subset of $X$ that is nonmeagre in $X$ is nonmeagre in itself. And for an open set or a dense set in $X,$ being meagre in $X$ is equivalent to being meagre in itself, and similarly for the nonmeagre property.
A topological space $X$ is nonmeagre if and only if every countable intersection of dense open sets in $X$ is nonempty.

## Properties

Every nowhere dense subset of $X$ is meagre. Consequently, any closed subset with empty interior is meagre. Thus a closed subset of $X$ that is of the second category in $X$ must have non-empty interior in $X$ (because otherwise it would be nowhere dense and thus of the first category).
If $B\subseteq X$ is of the second category in $X$ and if $S_{1},S_{2},\ldots$ are subsets of $X$ such that $B\subseteq S_{1}\cup S_{2}\cup \cdots$ then at least one $S_{n}$ is of the second category in $X.$

### Meagre subsets and Lebesgue measure

There exist nowhere dense subsets (which are thus meagre subsets) that have positive Lebesgue measure.
A meagre set in $\mathbb {R}$ need not have Lebesgue measure zero, and can even have full measure. For example, in the interval $[0,1]$ fat Cantor sets, like the Smith–Volterra–Cantor set, are closed nowhere dense and they can be constructed with a measure arbitrarily close to $1.$ The union of a countable number of such sets with measure approaching $1$ gives a meagre subset of $[0,1]$ with measure $1.$
Dually, there can be nonmeagre sets with measure zero. The complement of any meagre set of measure $1$ in $[0,1]$ (for example the one in the previous paragraph) has measure $0$ and is comeagre in $[0,1],$ and hence nonmeagre in $[0,1]$ since $[0,1]$ is a Baire space.
Here is another example of a nonmeagre set in $\mathbb {R}$ with measure $0$: $\bigcap _{m=1}^{\infty }\bigcup _{n=1}^{\infty }\left(r_{n}-\left({\tfrac {1}{2}}\right)^{n+m},r_{n}+\left({\tfrac {1}{2}}\right)^{n+m}\right)$ where $r_{1},r_{2},\ldots$ is a sequence that enumerates the rational numbers.

### Relation to Borel hierarchy

Just as a nowhere dense subset need not be closed, but is always contained in a closed nowhere dense subset (viz, its closure), a meagre set need not be an $F_{\sigma }$ set (countable union of closed sets), but is always contained in an $F_{\sigma }$ set made from nowhere dense sets (by taking the closure of each set).
Dually, just as the complement of a nowhere dense set need not be open, but has a dense interior (contains a dense open set), a comeagre set need not be a $G_{\delta }$ set (countable intersection of open sets), but contains a dense $G_{\delta }$ set formed from dense open sets.

## Banach–Mazur game

Meagre sets have a useful alternative characterization in terms of the Banach–Mazur game. Let $Y$ be a topological space, ${\mathcal {W}}$ be a family of subsets of $Y$ that have nonempty interiors such that every nonempty open set has a subset belonging to ${\mathcal {W}},$ and $X$ be any subset of $Y.$ Then there is a Banach–Mazur game $MZ(X,Y,{\mathcal {W}}).$ In the Banach–Mazur game, two players, $P$ and $Q,$ alternately choose successively smaller elements of ${\mathcal {W}}$ to produce a sequence $W_{1}\supseteq W_{2}\supseteq W_{3}\supseteq \cdots .$ Player $P$ wins if the intersection of this sequence contains a point in $X$; otherwise, player $Q$ wins.
Theorem — For any ${\mathcal {W}}$ meeting the above criteria, player $Q$ has a winning strategy if and only if $X$ is meagre.

## Erdos–Sierpinski duality

Many arguments about meagre sets also apply to null sets, i.e. sets of Lebesgue measure 0. The Erdos–Sierpinski duality theorem states that if the continuum hypothesis holds, there is an involution from reals to reals where the image of a null set of reals is a meagre set, and vice versa. In fact, the image of a set of reals under the map is null if and only if the original set was meagre, and vice versa.