This works over the reals but not over the complex field. Consider the set of all $n\times n$ matrices $A$ such that 1. $A^2=A$ 2.$A^T=A$ 3. $\mathrm{Trace}(A)=1$

The first condition makes $A$ a projection to a subspace of $\mathbb{R}^n$. The second ensures that $A$ is *diagonalizable* so its eigenvalues are all 0 or 1.The third guarantees that the image of the projection is one-dimensional. Such matrices are in a 1-1 correspondence with one-dimensional subspaces and so constitute $\mathbb{R}P^{n-1}$.

This seems to represent real projective spaces as affine varieties, with plenty of induced nonzero regular functions. How do we reconcile this with the fact that projective spaces have only constant regular functions?

This does not work over the complexes since $A$ would have to equal its conjugate transpose (to be guaranteed diagonalizable) and conjugation is not algebraic.

This is puzzling me to no end...

isinvertible as a function on $\mathbb R$, although it is not ... – Emerton Jul 10 '12 at 17:41