TITLE: Are most matrices diagonalizable?
QUESTION [40 upvotes]: More precisely, does the set of non-diagonalizable (over $\mathbb C$) matrices have Lebesgue measure zero in $\mathbb R^{n\times n}$ or $\mathbb C^{n\times n}$? 
Intuitively, I would think yes, since in order for a matrix to be non-diagonalizable its characteristic polynomial would have to have a multiple root. But most monic polynomials of degree $n$ have distinct roots. Can this argument be formalized?

REPLY [35 votes]: Yes. Here is a proof over $\mathbb{C} $.

Matrices with repeated eigenvalues are cut out as the zero locus of the discriminant of the characteristic polynomial, thus are algebraic sets. 
Some matrices have unique eigenvalues, so this algebraic set is proper.
Proper closed algebraic sets have measure $0.$ (intuitively, a proper closed algebraic set is a locally finite union of embedded submanifolds of lower dimension)
(over $\mathbb{C} $) The set of matrices that aren't diagonalizable is contained in this set, so it also has measure $0$. (not over $\mathbb{R}$, see this comment https://math.stackexchange.com/a/207785/565)

REPLY [8 votes]: Let $A$ be a real matrix with a non-real eigenvalue. It's rather easy to see that if you perturb $A$ a little bit $A$ still will have a non-real eigenvalue. For instance if $A$ is a rotation matrix (as in Georges answer), applying a perturbed version of $A$ will still come close to rotating the vectors by a fixed angle so this perturbed version can't have any real eigenvalues.