For finite sets $A$ and $B$, it is clear that $A \subseteq B$ and $|A| \geq |B|$ implies $A = B$. While an obvious fact, it can sometimes be a nice shortcut in proofs.


Analogously, if $V$ and $W$ are finite-dimensional vector spaces such that $V \subseteq W$ and $dim\ V \geq dim\ W$ then $V = W$. This is an especially useful tool when $V$ is defined parametrically and $W$ is defined implicitly. Then you can easily prove $V \subseteq W$ by plugging the parametric expression for $V$ into the equations for $W$. Counting the dimensions can take more work, but you sometimes get lucky.


For a while I've been wondering how this extends to algebraic varieties.


Here's an attempted application to proving the spectral theorem. Fix the dimension $n$; all matrices will be $n \times n$. The theorem says that for every symmetric matrix $S$ there exists an orthogonal matrix $Q$ and a diagonal matrix $D$ such that


$$Q^T\ D\ Q = S.$$


Let $A$ and $B$ respectively denote the matrices of the form on the left-hand and right-hand side. $A$ is defined parametrically by a function $f$ from $D$ and $Q$, and $B$ is defined implicitly by the symmetry condition. We want to prove $A = B$. It is clear that $A \subseteq B$:


$$(Q^T\ D\ Q)^T = Q^T\ D^T\ (Q^T)^T = Q^T\ D\ Q,$$


so $Q^T\ D\ Q$ is symmetric.


The domain of $f$ has dimension $dim\ D + dim\ Q$ where $dim\ D = n$ and $dim\ Q = (n-1) + \cdots + 1$, while $S$'s space has dimension $n + (n-1) + \cdots + 1$, so the dimensions seem to match.


But what about $f$'s degree of injectivity? It isn't perfectly injective: if $D$ and $D'$ equal the identity matrix then $Q^T\ D\ Q = Q'^T\ D'\ Q'$ for any independent combination of $Q$ and $Q'$.


My question is thus twofold:



> 
> What is the right generalization of the theorem for vector spaces to algebraic varieties?
> 
> 
> 


and



> 
> Can the attempted proof of the spectral theorem be salvaged with a genericity argument?
> 
> 
> 


I'm happy with the extant proofs of the spectral theorem, so this is more curiosity than anything else.



Proving equality of varieties by dimension counting
I guess this answers at least part of the question, so I will post it as an answer. As in my comment above: the correct generalization is that if $X \subset Y$ is a closed subvariety, if $X$ and $Y$ are both irreducible, and if $\dim X = \dim Y$, then $X = Y$. At this level of generality this is an application of the noetherian property of finite-dimensional varieties over a field together with the definition of irreducible. From this you can deduce that even if $X$ is *locally closed* in $Y$, it must be dense (since $X$ has the same dimension as its closure). An even more general form of this theorem is that if you have merely a dominant map $X \to Y$ (that is, its image is dense) then the minimal dimension of a fiber is $\dim X - \dim Y$ and this occurs generically ($X$ and $Y$ should still be irreducible). 


This is often combined with another theorem: if $X$ is irreducible and $X \to Y$ is surjective, then so is $Y$; conversely, if $Y$ is irreducible and the fibers of that map are irreducible of the same dimension, then so is $X$. Now you can perform the following trick beloved of algebraic geometers (e.g. anything in Harris' "Algebraic Geometry: A First Course", under the aegis of "incidence correspondences"; this theorem is 11.14): to compute the dimension of $Y$, cover it by $X$ and then have $X$ cover some other, irreducible $Z$ whose dimension is easy to compute. Then apply both the irreducibility and dimension theorems twice. Unfortunately, unless they are all projective varieties (which they often are in applications of this method) this is more of a way of computing dimension than of showing that maps are surjective (however, see for example the appendix to section 4 of Mumford's "Abelian Varieties" for an impressive example of this).


To show that $X \to Y$ is surjective, one general method that comes to mind is to show that it is dominant and has some kind of "closure" property. Either it could be actually closed, or perhaps you have a group acting on both $X$ and $Y$, transitively on $Y$, for which the map is equivariant. IANAAG (I am not an algebraic geometer) so this is probably hopelessly naive as far as general methods go.


