The Lambek–Moser theorem is a mathematical description of partitions of the
natural numbers into two
complementary sets. For instance, it applies to the partition of numbers into
even and
odd, or into
prime and non-prime (one and the
composite numbers). There are two parts to the Lambek–Moser theorem. One part states that any two
non-decreasing
In mathematics, a sequence is an enumerated collection of objects in which repetitions are allowed and order matters. Like a set, it contains members (also called ''elements'', or ''terms''). The number of elements (possibly infinite) is called t ...
integer functions that are inverse, in a certain sense, can be used to split the natural numbers into two complementary subsets, and the other part states that every complementary partition can be constructed in this way. When a formula is known for the natural number in a set, the Lambek–Moser theorem can be used to obtain a formula for the number not in the set.
The Lambek–Moser theorem belongs to
combinatorial number theory
Number theory (or arithmetic or higher arithmetic in older usage) is a branch of pure mathematics devoted primarily to the study of the integers and integer-valued functions. German mathematician Carl Friedrich Gauss (1777–1855) said, "Math ...
. It is named for
Joachim Lambek and
Leo Moser
Leo Moser (11 April 1921, Vienna – 9 February 1970, Edmonton) was an Austrian-Canadian mathematician, best known for his polygon notation.
A native of Vienna, Leo Moser immigrated with his parents to Canada at the age of three. He received his ...
, who published it in 1954, and should be distinguished from an unrelated theorem of Lambek and Moser, later strengthened by Wild, on the number of
primitive Pythagorean triples. It extends Rayleigh's theorem, which describes complementary pairs of
Beatty sequences, the sequences of rounded multiples of irrational numbers.
From functions to partitions

Let
be any function from positive
integers to non-negative integers that is both
non-decreasing
In mathematics, a sequence is an enumerated collection of objects in which repetitions are allowed and order matters. Like a set, it contains members (also called ''elements'', or ''terms''). The number of elements (possibly infinite) is called t ...
(each value in the sequence
is at least as large as any earlier value) and
unbounded (it eventually increases past any fixed value).
The sequence of its values may skip some numbers, so it might not have an
inverse function with the same properties. Instead, define a non-decreasing and unbounded integer function
that is as close as possible to the inverse in the sense that, for all positive integers
,
Equivalently,
may be defined as the number of values
for which