Solution (source code)

= Solution

Let $\mathfrak q$ be a <prime ideal> of $C$. Its <quotient ring> $D=C/\mathfrak q$ is a nonzero <integral domain> and a finite-dimensional $K$-vector space. For $0\ne a\in D$, multiplication by $a$ is an <injective> $K$-linear map $D\to D$, because $D$ has no zero divisors. An <injective> <endomorphism> of a <finite-dimensional vector space> is <surjective>. In particular $ab=1$ for some $b\in D$. Every nonzero element is therefore invertible, so $D$ is a <field> and $\mathfrak q$ is a <maximal ideal>.

To prove finiteness, select any $r$ distinct <maximal ideals> $\mathfrak m_1,\ldots,\mathfrak m_r$. Distinct <maximal ideals> are comaximal: $\mathfrak m_i+\mathfrak m_j$ strictly contains $\mathfrak m_i$, so must equal $C$. The <Chinese remainder theorem> gives a <surjection>
$$
C\longrightarrow\prod_{i=1}^rC/\mathfrak m_i.
$$
Here is the needed surjectivity explicitly. For each $j\ne i$, choose $a_{ij}\in\mathfrak m_j$ with $a_{ij}\equiv1\pmod{\mathfrak m_i}$, using comaximality. Then $e_i=\prod_{j\ne i}a_{ij}$ is one modulo $\mathfrak m_i$ and zero modulo the other selected <ideals>. Given any residue tuple represented by $b_i$, the element $\sum_i b_ie_i$ maps to that tuple. Thus the displayed map really is <surjective>.

Each nonzero <field> quotient has $K$-dimension at least one, so
$$
r\leq\sum_{i=1}^r\dim_K(C/\mathfrak m_i)\leq\dim_KC.
$$
There cannot be more than $\dim_KC$ <maximal ideals>, because otherwise one could select a finite list exceeding this bound. Consequently
$$
\boxed{\operatorname{Spec}C=\operatorname{MaxSpec}C,\qquad |\operatorname{MaxSpec}C|\leq\dim_KC<\infty.}
$$
This proves the description of the <spectrum of a finite-dimensional commutative algebra>. If $C=0$, its spectrum is empty and the same conclusion holds.