The ring of integers Zis the main example of a ring with unique factorization of elements into primes.Another most important example of such rings is the ring of polynomials overa ﬁeld. In this chapter we shall consider other examples of commutative ringswith unique factorization, such as Euclidean rings and principal ideal domains.Our main goal will be to describe ﬁnitely generated modules over principal idealdomains. Specializing the principal ideal domain to be Z, we shall also obtainthe main structure theorem for ﬁnitely generated Abelian groups, and, hence, forﬁnite Abelian groups.The central concept of the axiomatic development of linear algebra is a vectorspace over a ﬁeld. A central problem of linear algebra is the study of lineartransformations in a ﬁnite dimensional vector space over a ﬁeld. For the givenlinear transformation A in a vector space V over a ﬁeld K we can use A to makeV into a module over the polynomial ring K[x] in one variable x. The study of thismodule leads to the theory of canonical forms of matrices of a linear transformationand to the solution of the similarity problem of matrices. In the last section weapply the structure theorem of ﬁnitely generated modules over a PID to obtain thedecomposition of ﬁnitely generated modules over the polynomial ring K[x] and,hence, canonical forms for square matrices.All the rings considered in this chapter will be commutative with identity1 != 0. Denote by N the set of all natural numbers, i.e., the set of all (strictly)positive integers, and by A∗ the set of all units (=invertible elements) of a ring A.