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.