Tutorials › Topology (Undergraduate) › Rationals, Irrationals, and Category in the Real Line

The Baire Category Theorem · Tutorial 606 of 799

Rationals, Irrationals, and Category in the Real Line

See how countability and the Baire theorem distinguish category-small sets from sets that are topologically sparse.

Advanced 9 min read

What You'll Learn

  • Define nowhere-dense, meager, residual, and dense \(G_\delta\) sets in the real line.
  • Show that each singleton in the real line is nowhere dense.
  • Express the rationals as a countable union of nowhere-dense sets.
  • Prove that the irrationals form a residual \(G_\delta\) set.
  • Apply the complete-metric Baire theorem to prove that the irrationals are dense.
  • Explain why a meager set, such as the rationals, can still be dense.

Category in the Real Line

In the real line, a set can be small in the sense of category and still occur in every open interval. The rationals illustrate this: they are dense, yet they are meager. Their complement, the irrationals, is residual and dense. The point of the Baire category theorem here is not that the irrationals outnumber the rationals, but that a countable intersection of open dense sets in a complete metric space remains dense.

Throughout, \(\mathbb{R}\) has its standard topology, induced by the usual metric \(d(x,y)=|x-y|\). A set \(D\subseteq\mathbb{R}\) is dense if every nonempty open subset of \(\mathbb{R}\) intersects \(D\). Equivalently, \(\overline{D}=\mathbb{R}\). We will use open intervals as neighborhoods: every open neighborhood of a real number contains an open interval around that number.

Definition: A set \(A\subseteq\mathbb{R}\) is nowhere dense if the interior of its closure is empty, that is, \(\operatorname{int}\overline{A}=\varnothing\). A set is meager if it is a countable union of nowhere-dense sets. A set \(R\) is residual if its complement \(\mathbb{R}\setminus R\) is meager. A \(G_\delta\) set is a countable intersection of open sets.

These definitions describe different properties. Nowhere dense and meager refer to coverings by sets whose closures have empty interior. Residual means that the complement is meager; in an arbitrary space that alone need not make a set dense. The Baire theorem supplies the density conclusion in the complete-metric setting we use here.

Why Each Rational Can Be Covered by a Nowhere-Dense Set

Proposition: For every \(q\in\mathbb{R}\), the singleton \(\{q\}\) is closed and nowhere dense in \(\mathbb{R}\).

Proof. To show that \(\{q\}\) is closed, take any \(x\in\mathbb{R}\setminus\{q\}\). Then \(|x-q|>0\), and the open interval \((x-|x-q|/2,x+|x-q|/2)\) contains \(x\) but not \(q\). Thus the complement of \(\{q\}\) is open, so \(\overline{\{q\}}=\{q\}\). To show that its interior is empty, suppose an open set \(U\) contains \(q\). There is some \(r>0\) for which \((q-r,q+r)\subseteq U\). This interval contains \(q+r/2\), which differs from \(q\). Hence \(U\) cannot be a subset of \(\{q\}\). No open neighborhood of \(q\) lies inside \(\{q\}\), so \(\operatorname{int}\{q\}=\varnothing\). Its closure therefore has empty interior, as required. \(\square\)

Worked Example: A Rational Singleton

Consider \(\{2/3\}\) in the standard real line. Its closure is \(\{2/3\}\), since it is a singleton and the proposition shows every singleton is closed. For any \(r>0\), the interval \((2/3-r,2/3+r)\) contains \(2/3+r/2\). This point differs from \(2/3\), so the interval is not contained in \(\{2/3\}\). Thus the singleton has empty interior, and because its closure is itself, it is nowhere dense.

Check: the same argument works for every positive radius \(r\), not just for a particular neighborhood. That verifies empty interior directly from the definition.

The Rationals Are Meager

To use the singleton result, we need a countable listing of the rationals. Every rational is \(m/n\) for an integer \(m\) and a positive integer \(n\). The pairs \((m,n)\in\mathbb{Z}\times\mathbb{N}\) can be listed in a sequence: list them in increasing order of \(|m|+n\), and within each fixed value of \(|m|+n\), list the finitely many possible pairs in a fixed order. Every pair occurs, because its value of \(|m|+n\) is a finite integer and each such group is finite. Applying \((m,n)\mapsto m/n\) gives a sequence \((q_n)_{n\in\mathbb{N}}\) whose terms include every rational. Repetitions do not affect the union of the singletons.

Theorem: The rationals \(\mathbb{Q}\) are meager in \(\mathbb{R}\).

Proof. Use the sequence \((q_n)\) just described. Since every rational appears in it, \(\mathbb{Q}=\bigcup_{n\in\mathbb{N}}\{q_n\}\). By the proposition, each \(\{q_n\}\) is nowhere dense in \(\mathbb{R}\). The definition of meager is a countable union of nowhere-dense sets, so \(\mathbb{Q}\) is meager. \(\square\)

This proof uses the rationals’ countability and the nowhere-denseness of each singleton. In particular, it does not say that the rationals are absent from some interval. Indeed, every nonempty open interval contains rationals. The category property and density answer different questions.

Worked Example: Finding a Rational in an Interval

For a concrete interval, find a rational number strictly between \(5/2\) and \(13/5\). The width of the interval is \(13/5-5/2=26/10-25/10=1/10\). Choose \(n=11\), so \(n(1/10)=11/10>1\). Now \(na=11(5/2)=55/2=27.5\). The least integer strictly greater than \(27.5\) is \(m=28\), giving the rational \(m/n=28/11\).

Check both strict inequalities using positive denominators: \(28/11>5/2\) because \(56>55\), and \(28/11<13/5\) because \(140<143\). Thus \(5/2<28/11<13/5\).

More generally, if \(a<b\), choose \(n\in\mathbb{N}\) with \(n(b-a)>1\), which is possible by the Archimedean property. Let \(m=\lfloor na\rfloor+1\), the least integer strictly greater than \(na\). Then \(na<m\leq na+1\), so \(a<m/n\leq a+1/n<b\). This verifies that every nonempty open interval contains a rational.

The Irrationals Are Residual and Dense

For each \(q_n\in\mathbb{Q}\), the complement \(\mathbb{R}\setminus\{q_n\}\) is open because \(\{q_n\}\) is closed. It is also dense: any nonempty open interval contains at least two distinct points, so it cannot be contained in the singleton \(\{q_n\}\). Consequently the interval intersects \(\mathbb{R}\setminus\{q_n\}\).

The complete-metric Baire theorem, proved in earlier material, states that if a metric space is complete, then every countable intersection of open dense subsets is dense. The usual metric on \(\mathbb{R}\) is complete: every Cauchy sequence of real numbers converges to a real number. We can therefore apply the theorem to the open dense sets \(\mathbb{R}\setminus\{q_n\}\).

Theorem: The irrationals \(\mathbb{R}\setminus\mathbb{Q}\) form a dense \(G_\delta\) subset of \(\mathbb{R}\), and hence are residual and dense.

Proof. Since the sequence \((q_n)\) includes every rational, a real number belongs to every set \(\mathbb{R}\setminus\{q_n\}\) exactly when it is not rational. Therefore \(\mathbb{R}\setminus\mathbb{Q}=\bigcap_{n\in\mathbb{N}}(\mathbb{R}\setminus\{q_n\})\). Each set in this intersection is open and dense, as verified above. The intersection is a \(G_\delta\) by definition, and the complete-metric Baire theorem says that it is dense in \(\mathbb{R}\). Its complement is \(\mathbb{Q}\), which is meager by the preceding theorem. Thus the irrationals are residual as well as dense. \(\square\)

Worked Example: Irrationals in an Arbitrary Interval

Let \(U\) be any nonempty open subset of \(\mathbb{R}\). The set \(U\) is itself a nonempty open set. Since \(\mathbb{R}\setminus\mathbb{Q}\) is dense, the theorem gives \(U\cap(\mathbb{R}\setminus\mathbb{Q})\ne\varnothing\). Thus \(U\) contains an irrational. In particular, every open interval, however small, contains an irrational.

The conclusion follows from the Baire theorem applied to the whole family of complements of rational singletons. It does not follow merely from the fact that each individual complement is dense: countable intersections of dense sets are not dense in every topological space. Here it is the completeness of \(\mathbb{R}\) that makes the Baire theorem applicable.

A Common Pitfall: Meager Does Not Mean Nondense

A tempting but incorrect conclusion is that a meager set must miss some nonempty open interval. The rationals disprove it: we proved that \(\mathbb{Q}\) is meager, and the interval argument above shows that every nonempty open interval contains a rational. Hence \(\mathbb{Q}\) is both meager and dense.

The erroneous reasoning often confuses “nowhere dense” with “meager.” Nowhere dense means that the closure has empty interior; meager allows a countable union of nowhere-dense sets. Neither definition says that the union misses an open set. In this example each rational is a nowhere-dense singleton, and the countable union of all those singletons is still dense.

Likewise, residual does not mean open or equal to the whole space. The irrationals are residual because their complement is meager, and they are dense here because the Baire theorem applies. They are not open: every open interval contains a rational, so no nonempty open interval can be contained in the irrationals. The key distinctions are summarized below.

PropertyMeaning hereReal-line example
Nowhere denseThe closure has empty interiorEvery singleton \(\{q\}\)
MeagerA countable union of nowhere-dense sets\(\mathbb{Q}\)
ResidualThe complement is meager\(\mathbb{R}\setminus\mathbb{Q}\)
DenseMeets every nonempty open setBoth \(\mathbb{Q}\) and \(\mathbb{R}\setminus\mathbb{Q}\)

Check Your Understanding

For each question, distinguish the definition being tested from the Baire theorem’s additional conclusion.

  1. Why does \(\operatorname{int}\overline{\{q\}}=\varnothing\) hold for every \(q\in\mathbb{R}\)?
  2. Explain why repetitions in a sequence listing all rationals do not affect the proof that \(\mathbb{Q}\) is meager.
  3. Write \(\mathbb{R}\setminus\mathbb{Q}\) as a countable intersection of open sets, and identify why each set in the intersection is dense.
  4. Which hypothesis allows the Baire theorem to show that the irrationals are dense in \(\mathbb{R}\)?
  5. How can \(\mathbb{Q}\) be both meager and dense without contradicting either definition?