Generalized arithmetic progression

In mathematics, a generalized arithmetic progression (or multiple arithmetic progression) is a generalization of an arithmetic progression equipped with multiple common differences – whereas an arithmetic progression is generated by a single common difference, a generalized arithmetic progression can be generated by multiple common differences. For example, the sequence $$17, 20, 22, 23, 25, 26, 27, 28, 29, \dots$$ is not an arithmetic progression, but is instead generated by starting with 17 and adding either 3 or 5, thus allowing multiple common differences to generate it. A semilinear set generalizes this idea to multiple dimensions -- it is a set of vectors of integers, rather than a set of integers.

Finite generalized arithmetic progression
A finite generalized arithmetic progression, or sometimes just generalized arithmetic progression (GAP), of dimension d is defined to be a set of the form
 * $$\{ x_0 + \ell_1x_1 + \cdots + \ell_dx_d : 0 \le \ell_1< L_1, \ldots, 0 \le \ell_d < L_d \}$$

where $$x_0,x_1,\dots,x_d,L_1,\dots,L_d\in\mathbb{Z}$$. The product $$L_1L_2\cdots L_d$$ is called the size of the generalized arithmetic progression; the cardinality of the set can differ from the size if some elements of the set have multiple representations. If the cardinality equals the size, the progression is called proper. Generalized arithmetic progressions can be thought of as a projection of a higher dimensional grid into $$\mathbb{Z}$$. This projection is injective if and only if the generalized arithmetic progression is proper.

Semilinear sets
Formally, an arithmetic progression of $$\mathbb{N}^d$$ is an infinite sequence of the form $$\mathbf{v},\mathbf{v} + \mathbf{v}',\mathbf{v} + 2\mathbf{v}',\mathbf{v} + 3\mathbf{v}',\ldots$$, where $$\mathbf{v}$$ and $$\mathbf{v}'$$ are fixed vectors in $$\mathbb{N}^d$$, called the initial vector and common difference respectively. A subset of $$\mathbb{N}^d$$ is said to be linear if it is of the form
 * $$\left\{\mathbf{v} + \sum_{i=1}^m k_i\mathbf{v}_i \,\colon\, k_1,\dots,k_m\in \mathbb{N}\right\},$$

where $$m$$ is some integer and $$\mathbf{v},\mathbf{v}_1,\dots,\mathbf{v}_m$$ are fixed vectors in $$\mathbb{N}^d$$. A subset of $$\mathbb{N}^d$$ is said to be semilinear if it is a finite union of linear sets.

The semilinear sets are exactly the sets definable in Presburger arithmetic.