The direct product is defined for a number of classes of algebraic objects, including sets, groups, rings, and modules. In each case, the direct product of an algebraic object is given by the Cartesian product of its elements, considered as sets, and its algebraic operations are defined componentwise. For instance, the direct product of two vector spaces of dimensions m and n is a vector space of dimension m + n.