In mathematics and theoretical computer science, a semilinear set (also written semi-linear set) is a set of vectors of natural numbers or integers that can be built from finitely many linear sets, each generated by a base vector together with finitely many period vectors. Semilinear sets are a higher-dimensional analogue of an arithmetic progression: where a progression is generated by repeatedly adding one common difference, a linear set is generated by repeatedly adding any of several period vectors, in any combination and any number of times. Their importance rests on a series of equivalences established in the 1960s. The semilinear sets are exactly the sets definable in Presburger arithmetic, exactly the rational subsets of the commutative monoid ℕd, and exactly the sets arising as commutative images of context-free languages. They therefore serve as a finite, effective representation of certain infinite sets of integer vectors, and are used throughout formal language theory, verification and related areas.
Definition A subset L⊆ℕd is linear if it is of the form L={𝐛+∑i=1mki𝐩i:k1,…,km∈ℕ}, where m∈ℕ and 𝐛,𝐩1,…,𝐩m are fixed vectors in ℕd, called the base vector and the period vectors respectively. A subset of ℕd is semilinear if it is a finite union of linear sets. The number m of periods may be zero, so that every singleton is linear; the empty set is semilinear as the empty union. A pair consisting of a base vector and a finite set of period vectors is called a representation of the linear set it generates, and a finite collection of such pairs a representation of the semilinear set they generate; representations are not unique. A linear set with a single period vector 𝐩 is the set of terms of the arithmetic progression 𝐛,𝐛+𝐩,𝐛+2𝐩,…, and a general linear set is generated in the same way but from several common differences at once, applied in any combination and any number of times. The coefficients ki are unbounded, which distinguishes a linear set from a finite generalized arithmetic progression, where each coefficient is restricted to a bounded range.
Variants The same definition is used for subsets of ℤd, where the base and period vectors are allowed to have negative entries, while the coefficients ki still range over ℕ; in that setting the semilinear sets are the rational subsets of the group (ℤd,+). More generally, the definition makes sense in any finitely generated commutative monoid: a subset is linear if it has the form x+B⊕, where x is an element of the monoid and B⊕ is the submonoid generated by a finite set B, and semilinear if it is a finite union of such sets. Because of the equivalence with definability in Presburger arithmetic, semilinear sets are also called Presburger sets or Presburger-definable sets.
Examples Every finite subset of ℕd is semilinear: it is the union of one linear set per element, each with that element as base and no period vectors. The set of even natural numbers is the linear set with base 0 and single period 2, and more generally each arithmetic progression {b+kp∣k∈ℕ} is the linear set with base b and single period p. A linear set need not be an arithmetic progression. The linear set with base 0 and periods 3 and 5 is the numerical semigroup {3a+5b∣a,b∈ℕ}={0,3,5,6,8,9,10,…}, which omits 1,2,4 and 7; the largest omitted value is the Frobenius number 3⋅5−3−5=7. The same set also has a representation as a union of five linear sets, namely the singletons {0},{3},{5},{6} together with the set of base 8 and period 1, which illustrates that representations are not unique. In ℕ2, the set {(x,y)∣x=y} is linear, with base (0,0) and period (1,1); so is {(x,y)∣x≤y}, with base (0,0) and periods (1,1) and (0,1), its elements being the vectors (a,a+b) for a,b∈ℕ. The union of the two coordinate axes of ℕ2 is semilinear, being the union of the linear set with base (0,0) and period (1,0) and the linear set with base (0,0) and period (0,1). It is not itself linear: a linear set containing (1,0) and (0,1) has base (0,0) and both vectors among its periods, and therefore also contains (1,1). The set of powers of two is not semilinear, since the semilinear subsets of ℕ are exactly the ultimately periodic sets. For the same reason the set of primes and the set of squares are not semilinear. The integer points of a rational cone form a monoid generated by an integral Hilbert basis, which may properly contain the extreme rays. The set {(x,y)∣y≤x≤3y} of integer points of the cone generated by (1,1) and (3,1) is linear, with base (0,0) and periods (1,1), (2,1) and (3,1). The two generators alone do not suffice, since (2,1) lies in the cone but is not a non-negative integer combination of them. With all three periods, the elements with second coordinate k are exactly the pairs (x,k) with k≤x≤3k, because the sums of k values drawn from {1,2,3} are precisely the integers from k to 3k. Each row of the set is therefore an unbroken interval, three points wider at every step, and the rows continue upwards without bound:
Equivalent characterisations
Presburger arithmetic Seymour Ginsburg and Edwin Spanier proved that the semilinear sets coincide with the sets defined by Presburger formulas, so that every such set has both an "internal" description as a finite union of linear sets and an "external" description by a formula of Presburger arithmetic, each effectively obtainable from the other.
Rational sets Samuel Eilenberg and Marcel-Paul Schützenberger showed that the semilinear sets are precisely the rational subsets of the commutative monoid ℕd, that is, the sets obtainable from finite sets by union, elementwise addition and iteration.
Parikh images The Parikh image of a word over an alphabet of d letters is the vector in ℕd recording how many times each letter occurs; the Parikh image of a language is the set of images of its words. Parikh's theorem states that the Parikh image of every context-free language is semilinear; conversely every semilinear set is the Parikh image of a regular language, so that every context-free language has the same Parikh image as some regular language.
Solutions of linear systems The set of solutions in ℕd of a finite system of linear equalities and inequalities with integer coefficients is semilinear, since such a system is expressible as a quantifier-free Presburger formula; the same holds for finite unions of such solution sets.
… excerpt ends here. Continue reading the full article.