# Empty product

(Redirected from 0!)

In mathematics, an empty product, or nullary product, is the result of multiplying no factors. It is by convention equal to the multiplicative identity 1 (assuming there is an identity for the multiplication operation in question), just as the empty sum—the result of adding no numbers—is by convention zero, or the additive identity.[1][2][3][4]

The term "empty product" is most often used in the above sense when discussing arithmetic operations. However, the term is sometimes employed when discussing set-theoretic intersections, categorical products, and products in computer programming; these are discussed below.

## Nullary arithmetic product

### Justification

Let a1, a2, a3,... be a sequence of numbers, and let

${\displaystyle P_{m}=\prod _{i=1}^{m}a_{i}=a_{1}\cdots a_{m}}$

be the product of the first m elements of the sequence. Then

${\displaystyle P_{m}=a_{m}\cdot P_{m-1}}$

for all m = 1,2,... provided that we use the following conventions: ${\displaystyle P_{1}=a_{1}}$ and ${\displaystyle P_{0}=1}$. In other words, a "product" ${\displaystyle P_{1}}$ with only one factor evaluates to that factor, while a "product" ${\displaystyle P_{0}}$ with no factors at all evaluates to 1. Allowing a "product" with only one or zero factors reduces the number of cases to be considered in many mathematical formulas, such "products" are natural starting points in induction proofs, as well as in algorithms. For these reasons, the "empty product is one" convention is common practice in mathematics and computer programming.

### Relevance of defining empty products

The notion of an empty product is useful for the same reason that the number zero and the empty set are useful: while they seem to represent quite uninteresting notions, their existence allows for a much shorter mathematical presentation of many subjects.

For example, the empty products 0! = 1 and x0 = 1 shorten Taylor series notation (see zero to the power of zero for a discussion when x=0). Likewise, if M is an n × n matrix then M0 is the n × n identity matrix, reflecting the fact that applying a linear map zero times has the same effect as applying the identity map.

As another example, the fundamental theorem of arithmetic says that every positive integer can be written uniquely as a product of primes. However, if we do not allow products with only 0 or 1 factors, then the theorem (and its proof) become longer.[5][6]

More examples of the use of the empty product in mathematics may be found in the binomial theorem (which assumes and implies that x0=1 for all x), Stirling number, König's theorem, binomial type, binomial series, difference operator and Pochhammer symbol.

### Logarithms

Since logarithms turn products into sums, they should map an empty product to an empty sum. So if we define the empty product to be 1, then the empty sum should be ${\displaystyle \ln(1)=0}$. Conversely, the exponential function turns sums into products, so if we define the empty sum to be 0, then the empty product should be ${\displaystyle e^{0}=1}$.

${\displaystyle \prod _{i}x_{i}=e^{\sum _{i}\ln x_{i}}}$

## Nullary Cartesian product

Consider the general definition of the Cartesian product:

${\displaystyle \prod _{i\in I}X_{i}=\{g:I\to \bigcup _{i\in I}X_{i}\ |\ \forall i\ g(i)\in X_{i}\}.}$

If I is empty, the only such g is the empty function ${\displaystyle f_{\varnothing }}$, which is the unique subset of ${\displaystyle \varnothing \times \varnothing }$ that is a function ${\displaystyle \varnothing \to \varnothing }$, namely the empty subset ${\displaystyle \varnothing }$ (the only subset that ${\displaystyle \varnothing \times \varnothing =\varnothing }$ has):

${\displaystyle \prod _{\varnothing }{}=\{f_{\varnothing }:\varnothing \to \varnothing \}=\{\varnothing \}.}$

Thus, the cardinality of the Cartesian product of no sets is 1.

Under the perhaps more familiar n-tuple interpretation,

${\displaystyle \prod _{\varnothing }{}=\{()\},}$

that is, the singleton set containing the empty tuple. Note that in both representations the empty product has cardinality 1.

## Nullary categorical product

In any category, the product of an empty family is a terminal object of that category. This can be demonstrated by using the limit definition of the product. An n-fold categorical product can be defined as the limit with respect to a diagram given by the discrete category with n objects. An empty product is then given by the limit with respect to the empty category, which is the terminal object of the category if it exists, this definition specializes to give results as above. For example, in the category of sets the categorical product is the usual Cartesian product, and the terminal object is a singleton set; in the category of groups the categorical product is the Cartesian product of groups, and the terminal object is a trivial group with one element. To obtain the usual arithmetic definition of the empty product we must take the decategorification of the empty product in the category of finite sets.

Dually, the coproduct of an empty family is an initial object. Nullary categorical products or coproducts may not exist in a given category; e.g. in the category of fields, neither exists.

## In logic

Classical logic defines the operation of conjunction, which is generalized to universal quantification in and predicate calculus, and is widely known as logical multiplication because we intuitively identify true with 1 and false with 0 and our conjunction behaves as ordinary multiplier. Multipliers can have arbitrary number of inputs; in case of 0 inputs, we have empty conjunction, which is identically equal to true.

This is related to another concept in logic, vacuous truth, which tells us that empty set of objects can have any property, it can be explained the way that the conjunction (as part of logic in general) deals with values less or equal 1. This means that longer is the conjunction, the higher is probability to end up with 0. Conjunction merely checks the propositions and returns 0 (or false) as soon as one of propositions evaluates to false. Reducing the number of conjoined propositions increases the chance to pass the check and stay with 1. Particularly, if there are 0 tests or members to check, none can fail so, by default, we must always succeed regardless of which propositions or member properties had to be tested.

## In computer programming

Many programming languages, such as Python, allow the direct expression of lists of numbers, and even functions that allow an arbitrary number of parameters. If such a language has a function that returns the product of all the numbers in a list, it usually works like this:

   listprod( [2,3,5] ) --> 30
listprod( [2,3] )   --> 6
listprod( [2] )     --> 2
listprod( [] )      --> 1


This convention helps avoid having to code special cases like "if length of list is 1" or "if length of list is zero" as special cases.

Multiplication is an infix operator and therefore a binary operator, complicating the notation of an empty product, some programming languages handle this by implementing variadic functions. For example, the fully parenthesized prefix notation of Lisp languages gives rise to a natural notation for nullary functions:

(* 2 2 2)   ; evaluates to 8
(* 2 2)     ; evaluates to 4
(* 2)       ; evaluates to 2
(*)         ; evaluates to 1