of a matrix A is obtained by expressing it on a basis adapted to a decomposition into cyclic subspaces whose associated minimal polynomials are the invariant factors of A; two matrices are similar if and only if they have the same rational canonical form. Example Consider the following matrix A, over Q: A has minimal polynomial , so that the dimension of a subspace generated by the repeated images of a single vector is at most 6. The characteristic polynomial is , which is a multiple of the minimal polynomial by a factor . There always exist vectors such that the cyclic subspace that they generate has the same minimal polynomial as the operator has on the whole space; indeed most vectors will have this property, and in this case the first standard basis vector does so: the vectors for are linearly independent and span a cyclic subspace with minimal polynomial . There exist complementary stable subspaces (of dimension 2) to this cyclic subspace, and the space generated by vectors and is an example. In fact one has , so the complementary subspace is a cyclic subspace generated by ; it has minimal polynomial . Since is the minimal polynomial of the whole space, it is clear that must divide (and it is easily checked that it does), and we have found the invariant factors and of A. Then the rational canonical form of A is the block diagonal matrix with the corresponding companion matrices as diagonal blocks, namely A basis on which this form is attained is formed by the vectors above, followed by for ; explicitly this means that for , one has General case and theory Fix a base field F and a finite-dimensional vector space V over F. Given a polynomial P ∈ F[X], there is associated to it a companion matrix CP whose characteristic polynomial and minimal polynomial are both equal to P. Theorem: Let V be a finite-dimensional vector space over a field F, and A a square matrix over F. Then V (viewed as an F[X]-module with the action of X given by A) admits a F[X]-module isomorphism V ≅ F[X]/f1 ⊕ … ⊕ F[X]/fk where the fi ∈ F[X] may be taken to be monic polynomials of positive degree (so they are non-units in F[X]) that satisfy the relations f1 | f2 | … | fk where "a | b" is notation