Structure theorem for finitely generated modules over a principal ideal domain  In mathematics, in the field of abstract algebra, the structure theorem for finitely generated modules over a principal ideal domain is a generalization of the fundamental theorem of finitely generated abelian groups and roughly states that finitely generated modules over a principal ideal domain (PID) can be uniquely decomposed in much the same way that integers have a prime factorization. The result provides a simple framework to understand various canonical form results for square matrices over fields. When a vector space over a field "F" has a finite generating set, then one may extract from it a basis consisting of a finite number "n" of vectors, and the space is therefore isomorphic to "F""n". The corresponding statement with the "F" generalized to a principal ideal domain "R" is no longer true, since a basis for a finitely generated module over "R" might not exist. However such a module is still isomorphic to a quotient of some module "Rn" with "n" finite (to see this it suffices to construct the morphism that sends the elements of the canonical basis of "Rn" to the generators of the module, and take the quotient by its kernel.) By changing the choice of generating set, one can in fact describe the module as the quotient of some "Rn" by a particularly simple submodule, and this is the structure theorem. The structure theorem for finitely generated modules over a principal ideal domain usually appears in the following two forms. For every finitely generated module over a principal ideal domain , there is a unique decreasing sequence of proper ideals formula_1 such that is isomorphic to the sum of cyclic modules: The generators formula_3 of the ideals are unique up to multiplication by a unit, and are called invariant factors of "M". Since the ideals should be proper, these factors must not themselves be invertible (this avoids trivial factors in the sum), and the inclusion of the ideals means one has divisibility formula_4. The free part is visible in the part of the decomposition corresponding to factors formula_5. Such factors, if any, occur at the end of the sequence. While the direct sum is uniquely determined by , the isomorphism giving the decomposition itself is "not unique" in general. For instance if is actually a field, then all occurring ideals must be zero, and one obtains the decomposition of a finite dimensional vector space into a direct sum of one-dimensional subspaces; the number of such factors is fixed, namely the dimension of the space, but there is in a lot of freedom for choosing the subspaces themselves (if ).