# How to prove that ${\mathbf{GL}_{n}}(\mathbb{R})$ is dense in ${\mathbf{M}_{n}}(\mathbb{R})$

This question is inspired by an old question on here.

Prove:

$${\mathbf{GL}_{n}}(\mathbb{R})$$ is dense in $${\mathbf{M}_{n}}(\mathbb{R})$$

Proof:

$${\mathbf{GL}_{n}}(\mathbb{R}) = \{A \in {\mathbf{M}_{n}}(\mathbb{R}) : \det A \neq 0\}$$ where $${\mathbf{M}_{n}}(\mathbb{R})$$ consists of all $$n \times n$$ matrices with real entries.

We want to prove that $${\mathbf{GL}_{n}}(\mathbb{R})$$ is dense in $${\mathbf{M}_{n}}(\mathbb{R})$$.

$${\mathbf{GL}_{n}}(\mathbb{R})$$ is dense in $${\mathbf{M}_{n}}(\mathbb{R})$$ if every matrix $$A \in {\mathbf{M}_{n}}(\mathbb{R})$$ either belongs to $${\mathbf{GL}_{n}}(\mathbb{R})$$ or is a limit point of $${\mathbf{GL}_{n}}(\mathbb{R})$$.

A matrix $$P$$ is a limit point of $${\mathbf{GL}_{n}}(\mathbb{R})$$ in $${\mathbf{M}_{n}}(\mathbb{R})$$ if and only if every open set $$U$$ containing $$P$$ also contains a point of $${\mathbf{GL}_{n}}(\mathbb{R})$$ different from $$P$$.

And now when we should start to think I am not sure what to do as I have never worked with $${\mathbf{GL}_{n}}(\mathbb{R})$$ or $${\mathbf{M}_{n}}(\mathbb{R})$$ before.

I would appreciate a hint or a few on how to continue.

• If you think of the characteristic polynomial of $A$, can you find matrices close to $A$ whose determinant is nonzero? Commented Mar 11, 2016 at 16:36
• Under what topology? Spectral norms?
– Vim
Commented Mar 11, 2016 at 17:12
• @Vim Yes, that is of course important. It is the usual topology of euclidean $n^2$-space, i.e. $\mathbb{R}^{n^2}$ Commented Mar 11, 2016 at 19:20

Let $$A\in M_n$$. Choose $$\epsilon >0$$ such that $$\epsilon$$ is less than the smallest positive eigenvalue of $$A$$ (if any exists, otherwise any positive $$\epsilon$$ will do). Observe that $$A-\epsilon I$$ is invertible (otherwise, $$\epsilon$$ is an eigenvalue for $$A$$), therefore $$A_\epsilon \in GL_n$$.

• I am a little out of my depth here when it comes to linear algebra because i have not studied linear algebra in a long time. But these things you mention I might be able to work with. Thanks! Commented Mar 11, 2016 at 16:58
• Sorry but I have a basic question. If $A$ is not invertible so there is no such $\epsilon$? If I understood you well it not just simply necessary to chose any $\epsilon >0$ that is different of any eigen value Commented Dec 15, 2023 at 18:46

I particularly like this argument. Take any matrix $A$ and any invertible matrix $B$. Consider $$p(t) = \det((1-t)A+tB)$$ which is clearly a polynomial in one variable, and it is not zero polynomial because $p(1)\neq 0$. Thus, it has finitely many zeroes. That means that you can find arbitrarily small $t$ such that $C_t = (1-t)A+tB$ is invertible and we have $$\|A-C_t\| = |t|\|A-B\|<\varepsilon,\quad |t|<\frac{\varepsilon}{\|A-B\|}$$ Geometrically, we consider a line segment through matrices $A$ and $B$ and can find invertible matrix on it arbitrarily close to $A$.

• Yes, this argument i really like too! Commented Mar 11, 2016 at 17:50

The function $$\det g$$ is a polynomial in the $$g_{ij}$$. In particular, it's equal to its Taylor series everywhere. It follows that the closed set $$X = \{g\in M_n(\mathbb{R}):\, \det g = 0\}$$ has empty interior, and thus its complement $$GL_n(\mathbb{R})$$ is dense.

• That's nice and quick.
– zhw.
Commented Mar 11, 2016 at 18:03
• +1 Why does it follow that X has empty interior? Commented Mar 11, 2016 at 19:28
• @JKnecht: If it contained an open ball, then the Taylor series of $\det g$ around the center of that ball would vanish. Commented Mar 11, 2016 at 20:46

The set $X$ of matrices with zero determinant is a submanifold of codimension $1$ (with some singularities). Then by Sard's theorem it has measure zero. It follows that its complement is dense.

• +1 Sard's theorem was new for me, and reading about it I also learned about null sets, Lebesgue measure etc. Commented Mar 11, 2016 at 20:08
• Could you provide more detail about how Sard's theorem applies here? I'm a little unclear what mapping you're applying it to, since it doesn't appear that $\det: \mathbf{M}_n(\mathbb R) \to \mathbb R$ is what you want. Thanks! Commented Mar 28, 2016 at 21:58
• Assume $N$ is an embedded submanifold of $M$ of codimension $>0$. Work in a chart $U\subseteq\mathbb{R}^{\dim M}$ of $M$ and apply Sard to the inclusion of (a subset of) $N$ in $\mathbb{R}^{\dim M}$. Commented Mar 29, 2016 at 0:37

Let $A \in M_n(K)$, with $K=\mathbb{R}$ or $\mathbb{C}$, then $\chi_A(\lambda)=\det\left(A-\lambda I_n \right)$ is a nonzero polynomial, so it has a finite number of roots. So it exits a $p \in \mathbb{N}$ such that $\forall k>p \text{, }$ $\chi_A(1/k)\neq 0$ and then the sequence $$\left(A-\frac{1}{k} \cdot I_n\right)_{k>p}\longrightarrow A$$

(1) If $A=[a_1\cdots a_n]$ with ${\rm rank}\ A=k,\ k<n$, then we can assume that $\{ a_1,\cdots,a_k\}$ is linearly independent. If $\{a_1,\cdots,a_k, b_{k+1},\cdots, b_n\}$ is linearly independent and if $B:= [ 0\cdots 0\ b_{k+1}\ \cdots\ b_n]$, then ${\rm det}\ (A+ \epsilon B) = {\rm det} \ [a_1\cdots a_k \ \epsilon b_{k+1}\ \cdots\ \epsilon b_n]\neq 0$
(2) $M_n({\bf R})$ has a inner product, i.e., $|X|^2={\rm trace}\ XX^T$ and we have a metric $d(X,Y)=|X-Y|$. So since $|A-(A+ \epsilon B)|=\epsilon |B|$ Hence $A$ has an invertible matrix within arbitrary small distance. That is $Gl_n({\bf R})$ is dense.