# Is diagonalizability a local property?

Let $$R$$ be a commutative unital ring. Let $$n\in\mathbb{N}_+$$. Consider a $$n\times n$$-matrix $$A=(a_{ij})_{i,j=1}^n$$ with entries in $$R$$. A diagonal matrix is defined obviously. We can define several notions about diagonalizability (for some prime $$\mathfrak{p}\subseteq R$$):

1. $$A$$ is diagonalizable in $$R$$: if there exists an $$n\times n$$-matrix $$P$$ with entires in $$R$$ such that $$\det(P)\in R^\times$$ and $$PAP^{-1}$$ is diagonal;
2. $$A$$ is diagonalizable in $$R_{\mathfrak{p}}$$: consider $$A$$ as a matrix over $$R_{\mathfrak{p}}$$ and similarly defined;
3. $$A$$ is diagonalizable in $$\kappa(\mathfrak{p})$$: similarly defined;
4. $$A$$ is diagonalizable in $$\overline{\kappa(\mathfrak{p})}$$: similarly defined, where we consider an algebraic closure.

Obviously $$(1)\implies(2)\implies(3)\implies(4)$$. Moreover $$(4)$$ has the minimal polynomial criterion. I have two observations:

• (2) is an open condition on $$\mathfrak{p}$$: the primes $$\mathfrak{p}$$ such that $$A$$ is diagonalizable in $$R_{\mathfrak{p}}$$ form an open subset of $$\mathrm{Spec}(R)$$;
• (4) is a constructible condition on $$\mathfrak{p}$$: the primes $$\mathfrak{p}$$ such that $$(4)$$ holds form a constructible subset. This is seen from the morphism, whose image is where $$(4)$$ holds $$\mathrm{GL}_n\times\mathbb{A}^n\to \mathbb{A}^{n\times n},\quad P,\lambda_1,\cdots,\lambda_n\mapsto P\begin{pmatrix}\lambda_1\\&\ddots\\&&\lambda_n\end{pmatrix}P^{-1}.$$

I do not expect either $$(3)\implies(2)$$ or $$(4)\implies(3)$$, though my intuition of local diagonalizability is $$(4)$$. My question is about $$(2)\implies(1)$$. For the title I mean the following.

If $$A$$ is diagonalizable in $$R_{\mathfrak{p}}$$ for all primes $$\mathfrak{p}$$, can we claim that $$A$$ is diagonalizable?

• I'm confused: if $A=1$ is the identity and $R=\mathbb{C}$, there's no Euclidean neighborhood of $1$ consisting only of diagonal matrices, because each neighborhood will contain a matrix equal to $1$ plus a nonzero off-diagonal term, which is not diagonalizable. So in particular, there's no such neighborhood in the Zariski topology, and I believe (2) is not open, merely constructible. Jun 8 at 9:15
• I'm confused as to what you mean by Spec($A$). Jun 8 at 11:31
• @DaveBenson That is Spec(R), just edited. Jun 8 at 14:08
• @Gro-Tsen I do not think this is a counterexample. Your example satisfies (1) since $A$ is the identity matrix (is this what in your mind?), and then (1) is true for any $R$. Then (2) holds for every prime of $\mathrm{Spec}(R)$. Jun 8 at 14:13
• @Gro-Tsen if you believe this locus is constructible, then it is actually open since it is also stable under generalisation [Tag 0903]: if $\mathfrak p \subseteq \mathfrak q$ and $A_{\mathfrak q}$ is diagonalisable, then $A_{\mathfrak p}$ is diagonalisable as well. I think you might be confusing stalks with fibres, but it was already noted that (4) is only constructible. Jun 8 at 14:36

Here is a simple counterexample (simplified and generalised after Mohan's comment): let $$R$$ be a domain with a non-free finite projective module $$P$$, and let $$Q$$ be a finite projective module with $$P \oplus Q \cong R^n$$. This gives an idempotent matrix $$A \in M_n(R)$$ corresponding to $$(p,q) \mapsto (p,0)$$.

For each prime ideal $$\mathfrak p \subseteq R$$, the modules $$P_{\mathfrak p}$$ and $$Q_{\mathfrak p}$$ are free. If $$S \colon P_{\mathfrak p} \oplus Q_{\mathfrak p} \stackrel\sim\to R_{\mathfrak p}^n$$ is the isomorphism above and $$D \colon P_{\mathfrak p} \oplus Q_{\mathfrak p} \to P_{\mathfrak p} \oplus Q_{\mathfrak p}$$ the diagonal matrix $$(p,q) \mapsto (p,0)$$, then $$A_{\mathfrak p} = SDS^{-1}$$ is diagonalisable. (We can really think of $$D$$ as a matrix, at least after choosing bases for $$P_{\mathfrak p}$$ and $$Q_{\mathfrak p}$$.)

But $$A$$ is not globally diagonalisable since $$P$$ is not free: if $$A = SDS^{-1}$$ for some diagonal idempotent matrix $$D$$ and some invertible matrix $$S$$, then $$S$$ induces an isomorphism $$S \colon \operatorname{im}(D) \stackrel\sim\to \operatorname{im}(A)$$. But $$\operatorname{im}(D)$$ is free whereas $$\operatorname{im}(A) \cong P$$ is not free.

Example. Carrying this out for $$R = \mathbf Z[\sqrt{-5}]$$ and $$P = (2,1+\sqrt{-5}) \subseteq R$$ produces the matrix $$A = \begin{pmatrix} -2 & -1-\sqrt{-5} \\ 1-\sqrt{-5} & 3 \end{pmatrix}.$$ The image contains the vectors $$\left(\begin{smallmatrix} -2 \\ 1-\sqrt{-5} \end{smallmatrix}\right)$$ and $$\left(\begin{smallmatrix} -1-\sqrt{-5} \\ 3\end{smallmatrix}\right)$$, which are linearly dependent but not common multiples of some other vector in $$R^2$$.

Motivation. If $$A_{\mathfrak p}$$ is diagonalisable for all $$\mathfrak p \subseteq R$$, then there exists an open cover $$U_1 \cup \ldots \cup U_m = \operatorname{Spec} R$$ such that $$A|_{U_i}$$ is diagonalisable for all $$i$$. This gives matrices $$S_i \in \operatorname{GL}_n(U_i)$$ such that $$D_i := S_i^{-1}A|_{U_i}S_i$$ is diagonal.

Assuming for simplicity that $$R$$ is a domain, we conclude in particular that all eigenvalues $$\lambda_1,\ldots,\lambda_r$$ of $$A$$ lie in $$R$$, since they lie in $$R_{\mathfrak p}$$ for all prime ideals $$\mathfrak p$$. Choose some diagonal matrix $$D \in M_n(R)$$ with the same eigenvalues/multiplicities as $$A$$, and assume without loss of generality that $$D_i = D|_{U_i}$$ for all $$i$$. Then $$S_j^{-1}S_i \in \operatorname{GL}_n(U_i \cap U_j)$$ is a matrix commuting with $$D$$, giving a cocycle in $$H^1(\operatorname{Spec} R,G)$$, where $$G = C_{\operatorname{GL}_n}(D)$$ is the centraliser of $$D$$. This cocycle is a coboundary if and only if $$A$$ and $$D$$ are globally conjugate matrices.

Under the additional hypothesis that $$\lambda_i - \lambda_j \in R^\times$$ whenever $$i \neq j$$, a straightforward computation shows $$G = \prod_{i=1}^r \operatorname{GL}_{m_i}$$, where $$m_i$$ is the algebraic multiplicity of the eigenvalue $$\lambda_i$$. Thus, in this case the only obstruction is in $$\prod_{i=1}^r H^1(\operatorname{Spec} R, \operatorname{GL}_n)$$, leading to the example above.

But in general, $$G$$ need not be a flat group scheme over $$R$$, so the situation is considerably more complicated. For instance, if $$D$$ is the diagonal matrix $$\left(\begin{smallmatrix}2 & 0 \\ 0 & 5\end{smallmatrix}\right)$$, then $$G \times \operatorname{Spec} \mathbf F_3$$ is the full group $$\operatorname{GL}_{2,\mathbf F_3}$$, so $$G$$ has a vertical component above $$p=3$$. Even in the case of a PID, it is not so clear to me what is going on...

Remark. If $$R$$ is no longer a domain, it is probably more natural to look at the centraliser of $$A$$ instead of $$D$$ (which is some sort of 'Zariski inner form' of $$C_{\operatorname{GL}_n}(D)$$ in the domain case, so it should have the same $$H^1$$). I expect there might be other global obstructions coming from the non-injectivity of the maps $$R \to R_{\mathfrak p}$$: perhaps there are too many global choices of $$D$$ to run the argument above.

You could also imagine an obstruction in $$H^1(\operatorname{Spec} R, S_n)$$ for globally ordering the eigenvalues in the matrix $$D$$, although all examples I know where $$H^1(\operatorname{Spec} R, S_n) \neq 1$$ also have $$H^1(\operatorname{Spec} R, \operatorname{GL}_m) \neq 1$$ for $$m \gg 0$$. (An irreducible scheme has no higher cohomology in constant sheaves, even for $$H^1$$ with non-abelian coefficients, so we didn't see this problem in the case above.)

• Nice. If 2 implies 1, the argument shows that all finitely generated projjective modules are free. Is the converse true? If all projective modules are free, does 2.imply 1? Jun 9 at 1:12
• @Mohan thanks, your comment made clear what the key point of my construction is. Now edited, with some comments about whether this is the only obstruction. Jun 9 at 15:40