# Empty product

> Mediated Wiki article. Canonical URL: https://mediated.wiki/source/Empty_product
> Markdown URL: https://mediated.wiki/source/Empty_product.md
> Source: https://en.wikipedia.org/wiki/Empty_product
> Source revision: 1333938240
> License: Creative Commons Attribution-ShareAlike 4.0 International (https://creativecommons.org/licenses/by-sa/4.0/)

{{Short description|Result from multiplying no factors}}
{{use dmy dates|date=September 2025}}
{{for|the non-empty product that equals to zero|zero-product property}}
In [mathematics](/source/mathematics), an '''empty product''', or '''nullary product''' or '''vacuous product''', is the result of [multiplying](/source/multiplication) no factors. It is by convention equal to the [multiplicative identity](/source/multiplicative_identity) (assuming there is an identity for the multiplication operation in question; when numbers are implied, it becomes [one](/source/one)), just as the [empty sum](/source/empty_sum) &mdash; the result of [adding](/source/addition) no numbers &mdash; is by convention equal to the [additive identity](/source/additive_identity) ([zero](/source/zero)).<ref>{{cite book|first1=Jaroslav |last1=Nešetřil|author1-link=Jaroslav Nešetřil|first2=Jiří |last2=Matoušek|author2-link=Jiří Matoušek (mathematician)|title=Invitation to Discrete Mathematics |publisher=Oxford University Press |year=1998 |isbn=0-19-850207-9 |pages=12}}</ref><ref>{{cite book |first1=A. E. |last1=Ingham|first2=R. C.|last2=Vaughan|title=The Distribution of Prime Numbers |publisher=Cambridge University Press |year=1990 |isbn=0-521-39789-8 |pages=1}}</ref><ref>{{Lang Algebra|edition=3r|page=9}}</ref><ref>{{cite book |last=Bloom|first=David M.|title=Linear Algebra and Geometry |url=https://archive.org/details/linearalgebrageo0000bloo |url-access=registration |year=1979 |isbn=0521293243 |pages=[https://archive.org/details/linearalgebrageo0000bloo/page/45 45]|publisher=CUP Archive }}</ref>

The term ''empty product'' is most often used in the above sense when discussing [arithmetic](/source/arithmetic) operations. However, the term is sometimes employed when discussing [set-theoretic](/source/Set_theory) intersections, categorical products, and products in [computer programming](/source/computer_programming).

== Nullary arithmetic product ==
===Definition===

Let ''a''<sub>1</sub>, ''a''<sub>2</sub>, ''a''<sub>3</sub>, ... be a sequence of numbers, and let

:<math>P_m = \prod_{i=1}^m a_i = a_1 \cdots  a_m </math>

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

:<math>P_m = P_{m-1} a_m</math>

for all ''m'' = 1, 2, ... provided that we use the convention <math>P_0 = 1</math>. In other words, a "product" with no factors at all evaluates to 1.
Allowing a "product" with zero factors reduces the number of cases to be considered in many [mathematical formulas](/source/Formula). Such a "product" is a natural starting point in [induction proofs](/source/mathematical_induction), as well as in [algorithms](/source/Algorithm). 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](/source/0) and the [empty set](/source/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!&nbsp;=&nbsp;1 (the [factorial](/source/factorial) of zero) and ''x''<sup>0</sup>&nbsp;=&nbsp;1 shorten [Taylor series notation](/source/Taylor_series) (see [zero to the power of zero](/source/zero_to_the_power_of_zero) for a discussion of when ''x''&nbsp;=&nbsp;0). Likewise, if ''M'' is an ''n''&nbsp;×&nbsp;''n'' matrix, then ''M''<sup>0</sup> is the ''n''&nbsp;×&nbsp;''n'' [identity matrix](/source/identity_matrix), reflecting the fact that applying a [linear map](/source/linear_map) zero times has the same effect as applying the [identity map](/source/identity_function).

As another example, the [fundamental theorem of arithmetic](/source/fundamental_theorem_of_arithmetic) says that every positive [integer](/source/integer) greater than 1 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.<ref>{{cite web |url=http://www.cs.utexas.edu/users/EWD/transcriptions/EWD10xx/EWD1073.html |title=How Computing Science created a new mathematical style |last=Dijkstra|first= Edsger Wybe|author-link=Edsger Wybe Dijkstra |date=1990-03-04 |work=EWD |access-date=2010-01-20 | quote=Hardy and Wright: 'Every positive integer, except 1, is a product of primes', Harold M. Stark: 'If ''n'' is an integer greater than 1, then either ''n'' is prime or ''n'' is a finite product of primes'. These examples — which I owe to A. J. M. van Gasteren — both reject the empty product, the last one also rejects the product with a single factor.}}</ref><ref>{{cite web|last=Dijkstra|first= Edsger Wybe|author-link=Edsger Wybe Dijkstra |url=https://www.cs.utexas.edu/users/EWD/transcriptions/EWD09xx/EWD993.html |title=The nature of my research and why I do it |date=1986-11-14 |work=EWD |access-date=2024-03-22 |quote=But also 0 is certainly finite and by defining the product of 0 factors — how else? — to be equal to 1 we can do away with the exception: 'If ''n'' is a positive integer, then ''n'' is a finite product of primes.' }}</ref>

More examples of the use of the empty product in mathematics may be found in the [binomial theorem](/source/binomial_theorem) (which assumes and implies that ''x''<sup>0</sup> = 1 for all ''x''), [Stirling number](/source/Stirling_number), [König's theorem](/source/K%C3%B6nig's_theorem_(set_theory)), [binomial type](/source/binomial_type), [binomial series](/source/binomial_series), [difference operator](/source/difference_operator) and [Pochhammer symbol](/source/Pochhammer_symbol).

===Logarithms and exponentials===

Since logarithms map products to sums:

: <math>\ln \prod_i x_i = \sum_i \ln x_i</math>

they map an empty product to an [empty sum](/source/empty_sum).

Conversely, the exponential function maps sums into products:

: <math>e^{\sum_i x_i} = \prod_i e^{x_i}</math>

and maps an empty sum to an empty product.

== Nullary Cartesian product ==
Consider the general definition of the [Cartesian product](/source/Cartesian_product):

:<math>\prod_{i \in I} X_i = \left\{ g : I \to \bigcup_{i \in I} X_i \mid \forall i\ g(i) \in X_i \right\}.</math>

If ''I'' is empty, the only such ''g'' is the [empty function](/source/empty_function) <math>f_\varnothing</math>, which is the unique subset of <math>\varnothing\times\varnothing</math> that is a function <math>\varnothing \to \varnothing</math>, namely the empty subset <math>\varnothing</math> (the only subset that <math>\varnothing\times\varnothing = \varnothing</math> has):

:<math>\prod_\varnothing{} = \left\{ f_\varnothing: \varnothing \to \varnothing \right\} = \{\varnothing\}.</math>

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

Under the perhaps more familiar ''n''-[tuple](/source/tuple) interpretation,

:<math>\prod_\varnothing{} = \{ ( ) \},</math>

that is, the [singleton set](/source/singleton_set) containing the [empty tuple](/source/empty_tuple). Note that in both representations the empty product has [cardinality](/source/cardinality) 1 &ndash; the number of all ways to produce 0 outputs from 0 inputs is 1.

== Nullary categorical product ==
In any [category](/source/category_(category_theory)), the [product](/source/product_(category_theory)) of an empty family is a [terminal object](/source/terminal_object) of that category. This can be demonstrated by using the [limit](/source/limit_(category_theory)) definition of the product. An ''n''-fold categorical product can be defined as the limit with respect to a [diagram](/source/diagram_(category_theory)) given by the [discrete category](/source/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](/source/category_of_sets) the categorical product is the usual Cartesian product, and the terminal object is a singleton set. In the [category of groups](/source/category_of_groups) the categorical product is the Cartesian product of groups, and the terminal object is a [trivial group](/source/trivial_group) with one element. To obtain the usual arithmetic definition of the empty product we must take the [decategorification](/source/decategorification) of the empty product in the category of finite sets.

[Dually](/source/Dual_(category_theory)), the [coproduct](/source/coproduct) of an empty family is an [initial object](/source/initial_object).
Nullary categorical products or coproducts may not exist in a given category; e.g. in the [category of fields](/source/category_of_fields), neither exists.

== In logic ==
[Classical logic](/source/Classical_logic) defines the operation of [conjunction](/source/Logical_conjunction), which is generalized to [universal quantification](/source/universal_quantification) in [predicate calculus](/source/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](/source/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 the longer the conjunction, the higher the probability of ending 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 were to be tested.

== In computer programming ==
Many programming languages, such as [Python](/source/Python_(programming_language)), 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:
<syntaxhighlight lang="pycon">
>>> math.prod([2, 3, 5])
30
>>> math.prod([2, 3])
6
>>> math.prod([2])
2
>>> math.prod([])
1
</syntaxhighlight>
(Please note: <code>prod</code> is not available in the <code>math</code> module prior to version 3.8.)

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

Multiplication is an [infix](/source/infix_notation) operator and therefore a binary operator, complicating the notation of an empty product. Some programming languages handle this by implementing [variadic function](/source/variadic_function)s. For example, the [fully parenthesized prefix notation](/source/S-expression) of [Lisp languages](/source/Lisp_programming_language) gives rise to a natural notation for [nullary](/source/nullary) functions:

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

==See also==
*[Iterated binary operation](/source/Iterated_binary_operation)
*[Empty function](/source/Empty_function)

==References==
<references/>

== External links ==
* [https://web.archive.org/web/20150217225003/http://planetmath.org/emptyproduct PlanetMath article on the empty product]

{{DEFAULTSORT:Empty Product}}
Category:Multiplication
Category:1 (number)

---
Adapted from the Wikipedia article [Empty product](https://en.wikipedia.org/wiki/Empty_product) by Wikipedia contributors ([contributor history](https://en.wikipedia.org/wiki/Empty_product?action=history)). Available under [Creative Commons Attribution-ShareAlike 4.0 International](https://creativecommons.org/licenses/by-sa/4.0/). Changes may have been made.
