# Direct product

In mathematics, a direct product of objects already known can often be defined by giving a new one. That induces a structure on the Cartesian product of the underlying sets from that of the contributing objects. More abstractly, the product in category theory is mentioned, which formalizes those notions.
Examples are the product of sets, groups (described below), rings, and other algebraic structures. The product of topological spaces is another instance.
There is also the direct sum, which in some areas used interchangeably but in others is a different concept.

## Examples

* If $\mathbb {R}$ is thought of as the set of real numbers without further structure, the direct product $\mathbb {R} \times \mathbb {R}$ is just the Cartesian product $\{(x,y):x,y\in \mathbb {R} \}.$
* If $\mathbb {R}$ is thought of as the group of real numbers under addition, the direct product $\mathbb {R} \times \mathbb {R}$ still has $\{(x,y):x,y\in \mathbb {R} \}$ as its underlying set. The difference between this and the preceding examples is that $\mathbb {R} \times \mathbb {R}$ is now a group and so how to add their elements must also be stated. That is done by defining $(a,b)+(c,d)=(a+c,b+d).$
* If $\mathbb {R}$ is thought of as the ring of real numbers, the direct product $\mathbb {R} \times \mathbb {R}$ again has $\{(x,y):x,y\in \mathbb {R} \}$ as its underlying set. The ring structure consists of addition defined by $(a,b)+(c,d)=(a+c,b+d)$ and multiplication defined by $(a,b)(c,d)=(ac,bd).$
* Although the ring $\mathbb {R}$ is a field, $\mathbb {R} \times \mathbb {R}$ is not because the nonzero element $(1,0)$ does not have a multiplicative inverse.
In a similar manner, the direct product of finitely many algebraic structures can be talked about; for example, $\mathbb {R} \times \mathbb {R} \times \mathbb {R} \times \mathbb {R} .$ That relies on the direct product being associative up to isomorphism. That is, $(A\times B)\times C\cong A\times (B\times C)$ for any algebraic structures $A,$ $B,$ and $C$ of the same kind. The direct product is also commutative up to isomorphism; that is, $A\times B\cong B\times A$ for any algebraic structures $A$ and $B$ of the same kind. Even the direct product of infinitely many algebraic structures can be talked about; for example, the direct product of countably many copies of $\mathbb {R} ,$ is written as $\mathbb {R} \times \mathbb {R} \times \mathbb {R} \times \dotsb .$

## Direct product of groups

In group theory, define the direct product of two groups $(G,\circ )$ and $(H,\cdot ),$ can be denoted by $G\times H.$ For abelian groups that are written additively, it may also be called the direct sum of two groups, denoted by $G\oplus H.$
It is defined as follows:
* the set of the elements of the new group is the Cartesian product of the sets of elements of $G{\text{ and }}H,$ that is $\{(g,h):g\in G,h\in H\};$
* on tse elements put an operation, defined element-wise: $(g,h)\times \left(g',h'\right)=\left(g\circ g',h\cdot h'\right)$
Note that $(G,\circ )$ may be the same as $(H,\cdot ).$
The construction gives a new group, which has a normal subgroup that is isomorphic to $G$ (given by the elements of the form $(g,1)$) and one that is isomorphic to $H$ (comprising the elements $(1,h)$).
The reverse also holds in the recognition theorem. If a group $K$ contains two normal subgroups $G{\text{ and }}H,$ such that $K=GH$ and the intersection of $G{\text{ and }}H$ contains only the identity, $K$ is isomorphic to $G\times H.$ A relaxation of those conditions by requiring only one subgroup to be normal gives the semidirect product.
For example, $G{\text{ and }}H$ are taken as two copies of the unique (up to isomorphisms) group of order 2, $C^{2}:$ say $\{1,a\}{\text{ and }}\{1,b\}.$ Then, $C_{2}\times C_{2}=\{(1,1),(1,b),(a,1),(a,b)\},$ with the operation element by element. For instance, $(1,b)^{*}(a,1)=\left(1^{*}a,b^{*}1\right)=(a,b),$ and$(1,b)^{*}(1,b)=\left(1,b^{2}\right)=(1,1).$
With a direct product, some natural group homomorphisms are obtained for free: the projection maps defined by ${\begin{aligned}\pi _{1}:G\times H\to G,\ \ \pi _{1}(g,h)&=g\\\pi _{2}:G\times H\to H,\ \ \pi _{2}(g,h)&=h\end{aligned}}$ are called the coordinate functions.
Also, every homomorphism $f$ to the direct product is totally determined by its component functions $f_{i}=\pi _{i}\circ f.$
For any group $(G,\circ )$ and any integer $n\geq 0,$ repeated application of the direct product gives the group of all $n$-tuples $G^{n}$ (for $n=0,$ that is the trivial group); for example, $\mathbb {Z} ^{n}$ and $\mathbb {R} ^{n}.$

## Direct product of modules

The direct product for modules (not to be confused with the tensor product) is very similar to the one that is defined for groups above by using the Cartesian product with the operation of addition being componentwise, and the scalar multiplication just distributing over all the components. Starting from $\mathbb {R}$, Euclidean space $\mathbb {R} ^{n}$ is gotten, the prototypical example of a real $n$-dimensional vector space. The direct product of $\mathbb {R} ^{m}$ and $\mathbb {R} ^{n}$ is $\mathbb {R} ^{m+n}.$
A direct product for a finite index ∏$_{i=1}$$^n$X$_i${\textstyle \prod _{i=1}^{n}X_{i}} is canonically isomorphic to the direct sum ⨁$_{i=1}$$^n$X$_i$.{\textstyle \bigoplus _{i=1}^{n}X_{i}.} The direct sum and the direct product are not isomorphic for infinite indices for which the elements of a direct sum are zero for all but for a finite number of entries. They are dual in the sense of category theory: the direct sum is the coproduct, and the direct product is the product.
For example, for X=∏$_{i=1}$$^∞$R{\textstyle X=\prod _{i=1}^{\infty }\mathbb {R} } and Y=⨁$_{i=1}$$^∞$R, {\textstyle Y=\bigoplus _{i=1}^{\infty }\mathbb {R} , } the infinite direct product and direct sum of the real numbers. Only sequences with a finite number of non-zero elements are in $Y.$ For example, $(1,0,0,0,\ldots )$ is in $Y$ but $(1,1,1,1,\ldots )$ is not. Both sequences are in the direct product $X;$ in fact, $Y$ is a proper subset of $X$ (that is, $Y\subset X$).

## Topological space direct product

The direct product for a collection of topological spaces $X_{i}$ for $i$ in $I,$ some index set, once again makes use of the Cartesian product $\prod _{i\in I}X_{i}.$
Defining the topology is a little tricky. For finitely many factors, it is the obvious and natural thing to do: simply take as a basis of open sets to be the collection of all Cartesian products of open subsets from each factor: ${\mathcal {B}}=\left\{U_{1}\times \cdots \times U_{n}\ :\ U_{i}\ \mathrm {open\ in} \ X_{i}\right\}.$
That topology is called the product topology. For example, by directly defining the product topology on $\mathbb {R} ^{2}$ by the open sets of $\mathbb {R}$ (disjoint unions of open intervals), the basis for that topology would consist of all disjoint unions of open rectangles in the plane (as it turns out, it coincides with the usual metric topology).
The product topology for infinite products has a twist, which has to do with being able to make all the projection maps continuous and to make all functions into the product continuous if and only if all its component functions are continuous (that is, to satisfy the categorical definition of product: the morphisms here are continuous functions). The basis of open sets is taken to be the collection of all Cartesian products of open subsets from each factor, as before, with the proviso that all but finitely many of the open subsets are the entire factor: ${\mathcal {B}}=\left\{\prod _{i\in I}U_{i}\ :\ (\exists j_{1},\ldots ,j_{n})(U_{j_{i}}\ \mathrm {open\ in} \ X_{j_{i}})\ \mathrm {and} \ (\forall i\neq j_{1},\ldots ,j_{n})(U_{i}=X_{i})\right\}.$
The more natural-sounding topology would be, in this case, to take products of infinitely many open subsets as before, which yields a somewhat interesting topology, the box topology. However, it is not too difficult to find an example of bunch of continuous component functions whose product function is not continuous (see the separate entry box topology for an example and more). The problem that makes the twist necessary is ultimately rooted in the fact that the intersection of open sets is guaranteed to be open only for finitely many sets in the definition of topology.
Products (with the product topology) are nice with respect to preserving properties of their factors; for example, the product of Hausdorff spaces is Hausdorff, the product of connected spaces is connected, and the product of compact spaces is compact. That last one, called Tychonoff's theorem, is yet another equivalence to the axiom of choice.
For more properties and equivalent formulations, see product topology.

## Direct product of binary relations

On the Cartesian product of two sets with binary relations $R{\text{ and }}S,$ define $(a,b)T(c,d)$ as $aRc{\text{ and }}bSd.$ If $R{\text{ and }}S$ are both reflexive, irreflexive, transitive, symmetric, or antisymmetric, then $T$ will be also. Similarly, totality of $T$ is inherited from $R{\text{ and }}S.$ If the properties are combined, that also applies for being a preorder and being an equivalence relation. However, if $R{\text{ and }}S$ are connected relations, $T$ need not be connected; for example, the direct product of $\,\leq \,$ on $\mathbb {N}$ with itself does not relate $(1,2){\text{ and }}(2,1).$

## Direct product in universal algebra

If $\Sigma$ is a fixed signature, $I$ is an arbitrary (possibly infinite) index set, and $\left(\mathbf {A} _{i}\right)_{i\in I}$ is an indexed family of $\Sigma$ algebras, the direct product A=∏$_{i∈I}$A$_i${\textstyle \mathbf {A} =\prod _{i\in I}\mathbf {A} _{i}} is a $\Sigma$ algebra defined as follows:
* The universe set $A$ of $\mathbf {A}$ is the Cartesian product of the universe sets $A_{i}$ of $\mathbf {A} _{i},$ formally: A=∏$_{i∈I}$A$_i$.{\textstyle A=\prod _{i\in I}A_{i}.}
* For each $n$ and each $n$-ary operation symbol $f\in \Sigma ,$ its interpretation $f^{\mathbf {A} }$ in $\mathbf {A}$ is defined componentwise, formally. For all $a_{1},\dotsc ,a_{n}\in A$ and each $i\in I,$ the $i$th component of $f^{\mathbf {A} }\!\left(a_{1},\dotsc ,a_{n}\right)$ is defined as $f^{\mathbf {A} _{i}}\!\left(a_{1}(i),\dotsc ,a_{n}(i)\right).$
For each $i\in I,$ the $i$th projection $\pi _{i}:A\to A_{i}$ is defined by $\pi _{i}(a)=a(i).$ It is a surjective homomorphism between the $\Sigma$ algebras $\mathbf {A} {\text{ and }}\mathbf {A} _{i}.$
As a special case, if the index set $I=\{1,2\},$ the direct product of two $\Sigma$ algebras $\mathbf {A} _{1}{\text{ and }}\mathbf {A} _{2}$ is obtained, written as $\mathbf {A} =\mathbf {A} _{1}\times \mathbf {A} _{2}.$ If $\Sigma$ contains only one binary operation $f,$ the above definition of the direct product of groups is obtained by using the notation $A_{1}=G,A_{2}=H,$ $f^{A_{1}}=\circ ,\ f^{A_{2}}=\cdot ,\ {\text{ and }}f^{A}=\times .$ Similarly, the definition of the direct product of modules is subsumed here.

## Categorical product

The direct product can be abstracted to an arbitrary category. In a category, given a collection of objects $(A_{i})_{i\in I}$ indexed by a set $I$, a product of those objects is an object $A$ together with morphisms $p_{i}\colon A\to A_{i}$ for all $i\in I$, such that if $B$ is any other object with morphisms $f_{i}\colon B\to A_{i}$ for all $i\in I$, there is a unique morphism $B\to A$ whose composition with $p_{i}$ equals $f_{i}$ for every $i$.
Such $A$ and $(p_{i})_{i\in I}$ do not always exist. If they exist, then $(A,(p_{i})_{i\in I})$ is unique up to isomorphism, and $A$ is denoted $\prod _{i\in I}A_{i}$.
In the special case of the category of groups, a product always exists. The underlying set of $\prod _{i\in I}A_{i}$ is the Cartesian product of the underlying sets of the $A_{i}$, the group operation is componentwise multiplication, and the (homo)morphism $p_{i}\colon A\to A_{i}$ is the projection sending each tuple to its $i$th coordinate.

## Internal and external direct product

Some authors draw a distinction between an internal direct product and an external direct product. For example, if $A$ and $B$ are subgroups of an additive abelian group $G$ such that $A+B=G$ and $A\cap B=\{0\}$, $A\times B\cong G,$ and it is said that $G$ is the internal direct product of $A$ and $B$. To avoid ambiguity, the set $\{\,(a,b)\mid a\in A,\,b\in B\,\}$ can be referred to as the external direct product of $A$ and $B$.