← Ideas & learning Ideas & learning · Challenging English

Lambek–Moser theorem

On integer partitions from monotonic functions

6 min
estimated reading
9
complete sections
11.54
algorithmic grade estimate

Before you read

Use the article and the local dictionary together

The complexity label is calculated from sentence length and syllable estimates; it is guidance, not an assessment of you. Open any highlighted word below for its full local dictionary page.

Words
1279
Native text
10390 characters
Dictionary match
81%
Revision
1343341670 · 2026-03-13T18:03:27Z
Key vocabulary

Words to check before reading

Overview

The Lambek–Moser theorem is a mathematical description of the partitions of 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 any two non-decreasing 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 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.

It is named for Joachim Lambek and Leo Moser, who published it in 1954, and should be distinguished from an unrelated theorem of Lambek and Moser, later strengthened by Roy 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

The graphs of any two inverse functions on the positive real numbers are reflections of each other across the diagonal line x=y . For integer functions, it is possible to define an analogue of the inverse function, and a curve analogous to the graph of a function, called in this article a histogram, for which the same reflection property holds. In more detail, let f be any function from positive integers to non-negative integers that is both non-decreasing (each value in the sequence f(1),f(2),f(3),\dots is at least as large as the preceding value) and unbounded (it eventually increases past any fixed value). Define the histogram of f to be a piecewise-linear curve through the points (0,0) , (i-1,f(i)) , and (i,f(i)) for each positive integer i . It alternates between horizontal and vertical line segments.

It is not the graph of a function, because of the vertical segments; however, if only the horizontal segments and their right endpoints are included, the result is the graph of f(\lceil x\rceil) , the function that rounds x up to an integer and then applies f . The vertical segments connect these horizontal segments into a single continuous curve. Define a non-decreasing and unbounded integer function f^* that is as close as possible to the inverse in the sense that, for all positive integers n , f\bigl(f^*(n)\bigr) Equivalently, f^*(n) may be defined as the number of values x for which f(x) . It follows from either of these definitions that f^* ^*=f . As an example of the construction of a partition from a function, let f(n)=n^2 , the function that squares its argument.

Then its inverse is the square root function, whose closest integer approximation (in the sense used for the Lambek–Moser theorem) is f^*(n)=\lfloor\sqrt n-1 \rfloor . These two functions give F(n)=n^2+n and F^*(n)=\lfloor\sqrt n-1 \rfloor+n. For n=1,2,3,\dots the values of F are the pronic numbers :2, 6, 12, 20, 30, 42, 56, 72, 90, 110, ... while the values of F^* are :1, 3, 4, 5, 7, 8, 9, 10, 11, 13, 14, .... These two sequences are complementary: each positive integer belongs to exactly one of them. The Lambek–Moser theorem states this phenomenon is not specific to pronic numbers, but rather it arises for any choice of f with the appropriate properties.

From partitions to functions

(2, 3, 5, 7, ...) and non-primes (1, 4, 6, 8, ...). Each blue arrow passes from a number n through s_n to f(n)=s_n-n , and each red arrow passes from a number n through s^*_n to f^*(n)=s^*_n-n . Visualization based on a method of Angel. The second part of the Lambek–Moser theorem states this construction of partitions from inverse functions is universal, in the sense it can explain any partition of positive integers into two infinite parts. If S=s_1,s_2,\dots and S^*=s^*_1,s^*_2,\dots are any two complementary increasing sequences of integers, one may construct a pair of functions f and f^* from which this partition may be derived using the Lambek–Moser theorem. To do so, define f(n)=s_n-n and f^*(n)=s^*_n-n . One of the simplest examples to which this could be applied is the partition of positive integers into even and odd numbers.

The functions F(n) and F^*(n) should give the even or odd number, respectively, so F(n)=2n and F^*(n)=2n-1 . From these are derived the two functions f(n)=F(n)-n=n and f^*(n)=F^*(n)-n=n-1 . They form an inverse pair, and the partition generated via the Lambek–Moser theorem from this pair is just the partition of the positive integers into even and odd numbers. Another integer partition, into evil numbers and odious numbers (by the parity of the binary representation) uses almost the same functions, adjusted by the values of the Thue–Morse sequence.

Limit formula

In the same work in which they proved the Lambek–Moser theorem, Lambek and Moser provided a method of going directly the function giving the member of a set of positive integers, the function giving the non-member, without going through f Let F^ \# (n) denote the number of values of x for which F(x)\le n ; this is an approximation to the inverse function but (because it uses \le in place offset by one from the type of inverse used to define f^* Then, for F^*(n) is the limit of the sequence n, n+F^ \# (n), n+F^ \# \bigl(n+F^ \# (n)\bigr), \dots, meaning that, after a certain point, all successive values in this sequence become equal to each other, and the resulting value Lambek and Moser used prime numbers as an example, following earlier work by Viggo Brun and D. H. Lehmer.

If \pi(n) is the prime-counting function (the number of primes less than or equal then the non-prime (1 or a composite number) is given by the limit of the sequence: n+\left\lfloor\sqrt k n + \lfloor\sqrt k n \rfloor \right\rfloor.

History and proofs

The theorem was discovered by Leo Moser and Joachim Lambek, who published it in 1954. Moser and Lambek cite the previous work of Samuel Beatty on Beatty sequences as their inspiration, and also cite the work of Viggo Brun and D. H. Lehmer from the early 1930s on methods related to their limiting formula for F^* . and non-triangular numbers (blue and yellow rectangles, respectively) Edsger W. Dijkstra has provided a visual "proof" of the result (scare quotes as given by Dijkstra), and later a more rigorous proof based on algorithmic reasoning. The first of these two proofs represents an integer partition geometrically, as an arrangement of rectangles in the plane. These rectangles have dimensions 1\times n_i (unit width) for numbers n_i that belong to the first set of the partition, and n^*_i\times 1 (unit height) for numbers n^*_i in the second set.

They are placed so that the bottom left corner of each rectangle lies on the diagonal line x+y=-2 , and so that they together cover the integer squares of the half-plane above this line. The first rectangle, a unit square, is placed with its top right corner at the origin. The rectangles are then added one by one in order by their areas; each vertical rectangle is added to the left of the previous rectangles, with its bottom left corner on this diagonal line, while each horizontal rectangle is added above the previous rectangles, again with its bottom left corner on this diagonal line. Then the functions f(i) and F(i) of the theorem can be read off from this packing as the heights that the vertical rectangle rises above the x -axis or its bottom edge, respectively.

Similarly, the functions f^*(i) and F^*(i) can be read off as the amount that the horizontal rectangle extends to the right of the y -axis or its left edge, respectively. Conversely, any two functions f and f^* or F and F^* meeting the conditions of the theorem give rise to a rectangle packing of this type, from which the values of F and F^* can be seen to be a partition of the integers. Yuval Ginosar has provided an intuitive proof based on an analogy of two athletes running in opposite directions, at varying speeds, around a circular racetrack. Each time one of the athletes crosses a fixed mark on the track, they report the number of times they have met the other athlete (counting the start of the race as a meeting). Because they cross paths a countable number of times, the mark can be placed at a point on the track where they never meet.

Then, between each two consecutive times the athletes meet, they will together cover each point on the track once, so during this time exactly one of them will cross the mark and report their number of meetings. Therefore, the sets of numbers reported by each athlete form a partition of the positive integers. From this setup Ginosar derives the remaining properties of the Lambek–Moser theorem.

For non-negative integers

As stated above, the Lambek–Moser theorem applies to partitions of the positive integers. A variation of the theorem applies instead to partitions of non-negative integers, including zero. For this variation, every partition corresponds to a Galois connection of the ordered non-negative integers to themselves. This is a pair of non-decreasing functions (f,f^*) with the property that, for all x and y , f(x)\le y if and only if x\le f(y) . The corresponding functions F and F^* are defined slightly less symmetrically by F(n)=f(n)+n and F^*(n)=f^*(n)+n+1 . For functions defined in this way, the values of F and F^* (for non-negative arguments, rather than positive arguments) form a partition of the non-negative integers, and every partition can be constructed in this way.

Rayleigh's theorem

Rayleigh's theorem states that for two positive irrational numbers both greater than one, with the two sequences \lfloor i\cdot r\rfloor and \lfloor i\cdot s\rfloor obtained by rounding down to an integer the multiples of are complementary. It can be seen as an instance of the Lambek–Moser theorem with f(n)=\lfloor rn\rfloor-n and The condition that be greater than one implies these two functions are non-decreasing; the derived functions are F(n)=\lfloor rn\rfloor and The sequences of values of F and F^* forming the derived partition are known as Beatty sequences, after Samuel Beatty's 1926 rediscovery of Rayleigh's theorem.

See also

*Hofstadter Figure-Figure sequences, another pair of complementary sequences to which the Lambek–Moser theorem can be applied

References

* * *; Solutions by Beatty, A. Ostrowski, J. Hyslop, and A. C. Aitken, vol. 34 (1927), pp. 159–160, * *, as cited by * * * * * * * * * * * * * *

Ideas & learning

Continue with related local reading