In mathematics, almost periodicity is a property of dynamical systems that appear to retrace their paths through phase space, but not exactly. An example would be a planetary system, with planets in orbits moving with periods that are not commensurable (i.e., with a period vector that is not proportional to a vector of integers). A theorem of Kronecker from diophantine approximation can be used to show that any particular configuration that occurs once, will recur to within any specified acccuracy: if we wait long enough we can observe the planets all return to within a second of arc to the positions they once were in.
An almost periodic function is a complex-valued function of a real variable that has the properties expected of a function on a phase space describing the time evolution of such a system. There have in fact been a number of definitions given, beginning with that of Harald Bohr. His interest was initially in finite Dirichlet series. In fact by truncating the series for the Riemann zeta function ζ(s) to make it finite, one gets finite sums of terms of the type
with s written as the sum of its real part σ and imaginary part it. Fixing σ, so restricting attention to a single vertical line in the complex plane, we can see this also as
Taking a finite sum of such terms avoids difficulties of analytic continuation to the region σ < 1. Here the 'frequencies' log n will not all be commensurable (they are as linearly independent over the rational numbers as the integers n are multiplicatively independent _ which comes down to their prime factorizations).
With this initial motivation to consider types of trigonometric polynomial with independent frequencies, mathematical analysis was applied to discuss the closure of this set of basic functions, in various norms. Bohr himself defined the uniformly almost-periodic functions as the closure with respect to the uniform norm (on continuous functions on R). He proved that this definition was equivalent to the existence of ε almost-periods, for all ε > 0: that is, translations T(ε) = T of the variable t making
The theory was developed using other norms by Besicovitch, Stepanov, Weyl, von Neumann, Turing, Bochner and others in the 1920s and 1930s. With the advent of abstract methods (the Peter-Weyl theorem, Pontryagin duality and Banach algebras) a general theory became possible. The general idea of almost_periodicity in relation to a topological group G becomes that of a function F on G, such that its translates by G form a relatively compact set.