Why dense subsets are convenient to prove theorems

I will provide two examples in Linear Algebra where density can be exploited in a very slick way.
Plenty of other examples can be found in Approximation Theory and Functional Analysis.

Cayley-Hamilton theorem. If $p$ is the characteristic polynomial of $A$, then $p(A)=0$.
Proof. If $A$ is a diagonalizable matrix the claim is trivial by applying $p$ to the Jordan normal form of $A$. If $A$ is not a diagonalizable matrix, it can be made so by introducing an arbitrarily small perturbation $A\mapsto A_\varepsilon$. Since $p$ is continuous the claim follows by density.

The trace is abelian. We have $\text{Tr}(AB)=\text{Tr}(BA)$.
Proof. If $A$ is invertible then $AB$ and $BA= A^{-1}(AB)A$ are conjugated matrices, hence they have the same characteristic polynomial and the same trace. If $A$ is not invertible, it can be made so by considering $A+\varepsilon I$. Since $\text{Tr}$ is a continuous operator, the claim follows by density.

That should be enough to start understanding why density is really important: it gives us a rigorous way for "cheating", i.e. for working with stronger regularity assumptions.


Let's say you wanted to prove that the sum of the Riemann (or Lebesgue) integrals of two real-valued functions with the same domain is equal to the integral of the sum. (We assume, of course, that each of the two functions is integrable in the required sense.)

To do this, we first prove this property for step functions (for Riemann integrals) or for simple functions (for Lebesgue integrals). E.g., for Lebesgue integrals, the simple functions are dense in the $L^{1}$-space, so for two general functions $f, g$, the result $$ \int f + \int g = \int (f + g) $$ follows by: approximating each of $f, g$ by simple functions $s_{f}, s_{g}$ with accuracy within $\epsilon/2$ in the sense of the $L^{1}$-distance. For the functions $s_{f}, s_{g}$, the desired equality is verifiable more or less directly. Therefore, we obtain that $$ |\int f + \int g - \int (f + g)| < \epsilon. $$ This is one for every positive $\epsilon$, so $$ |\int f + \int g - \int (f + g)| = 0. $$

Another example is the proof of Plancherel's Theorem.


Consider this statement: if $f\colon\mathbb{R}\longrightarrow\mathbb R$ is continuous and such that$$(\forall x,y\in\mathbb{R}):f(x+y)=f(x)+f(y)\text,$$then there is a $c\in\mathbb R$ such that$$(\forall x\in\mathbb{R}):f(x)=cx.$$In order to prove it, take $c=f(1)$. It is easy to prove by induction that$$(\forall n\in\mathbb{N}):f(n)=cn.$$Furthermore, $f(0)=f(0+0)=f(0)+f(0)$ and so $f(0)=0=c\times0$. On the other hand, if $n\in\mathbb N$, $0=f(0)=f\bigl(n+(-n)\bigr)=f(n)+f(-n)$, and so $f(-n)=-f(n)=-cn=c\times(-n)$. So$$(\forall n\in\mathbb{Z}):f(n)=cn.$$It is now easy to prove that$$(\forall q\in\mathbb{Q}):f(q)=cq.$$But how do you prove now that$$(\forall x\in\mathbb{R}):f(x)=cx?$$Simple: you use the fact that $\mathbb Q$ is dense in $\mathbb R$.