Rational canonical form under an affine change (source code)

= Rational canonical form under an affine change
{title2=$f(t)\mapsto a^{\deg f}f((t-b)/a)\quad(a\ne0)$}

Let $U=aT+bI$ on a nonzero finite-dimensional <vector space> over a <field>, with $a\ne0$. An invariant block for $T$ is also invariant for $U$. If $v,Tv,\ldots,T^{d-1}v$ is its <cyclic vector> basis, then $v,Uv,\ldots,U^{d-1}v$ is another basis: the <binomial theorem> gives a triangular change-of-basis matrix with diagonal $1,a,\ldots,a^{d-1}$. The monic polynomial $g(t)=a^df((t-b)/a)$ annihilates this block, and its degree is $d$, so it is the block's <minimal polynomial>. In the new cyclic basis the block is $C(g)$.

The substitution preserves divisibility of the monic <invariant factors of a linear operator>. Apply it to every block to obtain the <rational canonical form> of $U$. If $a=0$, then $U=bI$ is a <scalar matrix> instead: all invariant factors are $t-b$, one for each dimension. This exceptional case cannot be obtained by dividing by $a$.