How to compute dimension of a space? Let $I\subset S=K[X_1,X_2,\dots,X_n]$ be a monomial ideal.
(a) Show that $\dim_K S/I < ∞ ⇔ ∃a∈\mathbb{Z}_+ : X^a_i \in I  ∀i$.
(b) Given integers $a_i\in \mathbb{Z}_+$, compute $\dim_K S/I$ for $I=(X^{a_1}_1,\dots,X^{a_n}_n)$.
 A: I'm going to give a few hints. (I will write $k[\mathbf{x}]$ for $k[x_1,\cdots,x_n]$)
First, all of $I, K[\mathbf{x}]$ and $K[\mathbf{x}]/I$ are $k$-vector spaces. Their bases are easy to describe: since $I$ is a monomial ideal, a k-basis for $I$ is given by all its monomials $\mathbf{x}^\mathbb{a}$. A k-basis for $k[\mathbf{x}]$ is given by $\mathbf{x}^\mathbf{a}$ where $\mathbf{a} \in \mathbb{N}^n$ (we allow $0 \in \mathbb{N}$).
So a k-basis for $k[\mathbf{x}]/I$ is given by all monomials $\mathbf{x}^\mathbf{a}$ with $\mathbf{x}^\mathbf{a}$ not in $I$. This mean that $\dim_K S/I $ is finite if and only if there are only finitely many monomials not in $I$. Can you do the rest from here?
A: (a) The "canonical" basis of $S$ as a $K$-vectorspace is the set of all monomials in $S$, that is, $\mathcal M=\{X_1^{a_1}\cdots X_n^{a_n}:a_i\in\mathbb{Z}_+\mbox{ for all } i=1,\dots,n\}$. Obviously, the set of residue classes modulo $I$ of the elements in $\mathcal M$ provide a system of generators of the $K$-vectorspace $S/I$.
If there is $a\in\mathbb{Z}_+$ such that $X_i^a\in I$ for all $i=1,\dots,n$, then $X_1^{a_1}\cdots X_n^{a_n}\in I$ provided $a_1+\cdots+a_n\ge na-n+1$. This shows that a finite set consisting of residue classes modulo $I$ of monomials generate the $K$-vectorspace $S/I$, so $\dim_KS/I<\infty$.
Conversely, if $\dim_KS/I<\infty$, the set of the residue classes modulo $I$ of the elements in $\mathcal M$ contains a (finite) basis. Let's denote this basis by $\mathcal B=\{m_1,\dots,m_t\}$, where $m_i$ is the residue class modulo $I$ of a monomial $M_i\notin I$. Since $\mathcal B$ is finite only finitely many elements of the form $x_i^{m_i}$ belong to $\mathcal B$. (Here $x_i$ denotes the residue class of $X_i$ modulo $I$.) Therefore there exists $a\in\mathbb{Z}_+$ such that $x_i^a\notin\mathcal B$ for all $i=1,\dots,n$. But $x_i^a\in S/I$, so it is a linear combination of the elements of $\mathcal B$. One can write $x_i^a=\sum_{i=1}^t\lambda_im_i$ and lifting this to $S$ one gets $X_i^a-\sum_{i=1}^t\lambda_iM_i\in I$. Now one uses the following 
Lemma. If $I\subset S$ is a monomial ideal and $\sum_{i=1}^s\alpha_iN_i\in I$, where $N_i$ are monomials and $\alpha_i\in K,$ $\alpha_i\neq 0$, then $N_i\in I$ for all $i$.
In our case $M_i\notin I$ for all $i$, hence $\lambda_i=0$ for all $i$ and $X_i^a\in I$.
(b) The observations made before and the following 
Lemma. A monomial $N$ belongs to $I$ if and only if there exists a monomial $M\in I$ such that $M\mid N$.
show that a $K$-basis for $S/I$ in this case is given by the set $$\mathcal B=\{x_1^{i_1}\cdots x_n^{i_n}: 0\le i_1<a_1,\dots, 0\le i_n<a_n\},$$
so $\dim_KS/I=a_1\cdots a_n$.
