Solution (source code)

= Solution

In the cyclic quotient $R/(d)$, the <kernel> is formed by residue classes of <polynomials> $h$ such that $d\mid Xh$. If $X\nmid d$, coprimality forces $d\mid h$, so the <kernel> is zero. If $d=Xe$, divisibility is equivalent to $e\mid h$, and the residue classes of multiples of $e$ modulo $Xe$ form a one-dimensional $K$-space. Hence
$$
\boxed{\dim\ker\alpha=\begin{cases}0,&d(0)\ne0,\\1,&d(0)=0.\end{cases}}
$$
This too is immediately readable in the cyclic case, even if zero is a repeated root. The zero-dimensional <module> has <kernel> <dimension> zero separately.