Rationally almost periodic sequences, polynomial multiple recurrence and symbolic dynamics

Similar documents
arxiv: v2 [math.ds] 9 Feb 2018

ERGODIC AVERAGES FOR INDEPENDENT POLYNOMIALS AND APPLICATIONS

CONVERGENCE OF POLYNOMIAL ERGODIC AVERAGES

Ergodic methods in additive combinatorics

BERNARD HOST AND BRYNA KRA

Dept of Math., SCU+USTC

CONVERGENCE OF MULTIPLE ERGODIC AVERAGES FOR SOME COMMUTING TRANSFORMATIONS

VARIATIONS ON TOPOLOGICAL RECURRENCE

arxiv: v2 [math.ds] 24 Apr 2018

AVERAGING ALONG CUBES

DYNAMICAL CUBES AND A CRITERIA FOR SYSTEMS HAVING PRODUCT EXTENSIONS

Rudiments of Ergodic Theory

Bare-bones outline of eigenvalue theory and the Jordan canonical form

arxiv: v4 [math.ds] 15 Jun 2017

Roth s Theorem on 3-term Arithmetic Progressions

Ergodic theorem involving additive and multiplicative groups of a field and

Large Sets in Boolean and Non-Boolean Groups and Topology

Metric Spaces and Topology

Part V. 17 Introduction: What are measures and why measurable sets. Lebesgue Integration Theory

1 Basic Combinatorics

Nonconventional ergodic averages and nilmanifolds

arxiv: v3 [math.ds] 28 Oct 2015

Week 2: Sequences and Series

Measurable functions are approximately nice, even if look terrible.

ALGEBRA I (LECTURE NOTES 2017/2018) LECTURE 9 - CYCLIC GROUPS AND EULER S FUNCTION

II - REAL ANALYSIS. This property gives us a way to extend the notion of content to finite unions of rectangles: we define

Manfred Einsiedler Thomas Ward. Ergodic Theory. with a view towards Number Theory. ^ Springer

Some Results Concerning Uniqueness of Triangle Sequences

= 1 2x. x 2 a ) 0 (mod p n ), (x 2 + 2a + a2. x a ) 2

POINCARÉ RECURRENCE AND NUMBER THEORY: THIRTY YEARS LATER

5 Set Operations, Functions, and Counting

METRIC HEIGHTS ON AN ABELIAN GROUP

CHAPTER 6. Prime Numbers. Definition and Fundamental Results

1 Topology Definition of a topology Basis (Base) of a topology The subspace topology & the product topology on X Y 3

ANALYSIS OF TWO STEP NILSEQUENCES

Maths 212: Homework Solutions

Formal Groups. Niki Myrto Mavraki

arxiv: v2 [math.ds] 19 Jul 2012

4 Countability axioms

INITIAL POWERS OF STURMIAN SEQUENCES

Mix-Automatic Sequences

Chapter One. The Real Number System

Roth s Theorem on Arithmetic Progressions

From combinatorics to ergodic theory and back again

OPTIMAL LOWER BOUNDS FOR MULTIPLE RECURRENCE

5 Measure theory II. (or. lim. Prove the proposition. 5. For fixed F A and φ M define the restriction of φ on F by writing.

MATH 117 LECTURE NOTES

COMPLEXITY OF SHORT RECTANGLES AND PERIODICITY

Stanford Mathematics Department Math 205A Lecture Supplement #4 Borel Regular & Radon Measures

Part III. 10 Topological Space Basics. Topological Spaces

CONSTRUCTION OF THE REAL NUMBERS.

Combinatorics in Banach space theory Lecture 12

Part II. Number Theory. Year

Lecture Notes Introduction to Ergodic Theory

Chapter 1. Measure Spaces. 1.1 Algebras and σ algebras of sets Notation and preliminaries

n [ F (b j ) F (a j ) ], n j=1(a j, b j ] E (4.1)

Notes for Math 290 using Introduction to Mathematical Proofs by Charles E. Roberts, Jr.

An integer p is prime if p > 1 and p has exactly two positive divisors, 1 and p.

Course 311: Michaelmas Term 2005 Part III: Topics in Commutative Algebra

SARNAK S CONJECTURE FOR SOME AUTOMATIC SEQUENCES. S. Ferenczi, J. Ku laga-przymus, M. Lemańczyk, C. Mauduit

REAL AND COMPLEX ANALYSIS

MATH41011/MATH61011: FOURIER SERIES AND LEBESGUE INTEGRATION. Extra Reading Material for Level 4 and Level 6

ECEN 5022 Cryptography

Dynamical Systems 2, MA 761

THE CONLEY ATTRACTORS OF AN ITERATED FUNCTION SYSTEM

LECTURE 4: CHINESE REMAINDER THEOREM AND MULTIPLICATIVE FUNCTIONS

P-adic Functions - Part 1

Chapter 1 The Real Numbers

Mathematical Reasoning & Proofs

Definitions. Notations. Injective, Surjective and Bijective. Divides. Cartesian Product. Relations. Equivalence Relations

G δ ideals of compact sets

Definition 6.1 (p.277) A positive integer n is prime when n > 1 and the only positive divisors are 1 and n. Alternatively

RESEARCH STATEMENT WENBO SUN

Introduction to Abstract Mathematics

Chapter 8. P-adic numbers. 8.1 Absolute values

Notions such as convergent sequence and Cauchy sequence make sense for any metric space. Convergent Sequences are Cauchy

Möbius Randomness and Dynamics

Problem List MATH 5143 Fall, 2013

Measures. Chapter Some prerequisites. 1.2 Introduction

Dynkin (λ-) and π-systems; monotone classes of sets, and of functions with some examples of application (mainly of a probabilistic flavor)

Games derived from a generalized Thue-Morse word

THESIS. Presented in Partial Fulfillment of the Requirements for the Degree Master of Science in the Graduate School of The Ohio State University

Recall that if X is a compact metric space, C(X), the space of continuous (real-valued) functions on X, is a Banach space with the norm

VC-DENSITY FOR TREES

Chapter 4. Measure Theory. 1. Measure Spaces

COBHAM S THEOREM AND SUBSTITUTION SUBSHIFTS

Primes in arithmetic progressions

ON THE DEFINITION OF RELATIVE PRESSURE FOR FACTOR MAPS ON SHIFTS OF FINITE TYPE. 1. Introduction

MAT 544 Problem Set 2 Solutions

Standard forms for writing numbers

Remarks on a Ramsey theory for trees

The primitive root theorem

NATIONAL BOARD FOR HIGHER MATHEMATICS. Research Scholarships Screening Test. Saturday, January 20, Time Allowed: 150 Minutes Maximum Marks: 40

Infinite-Dimensional Triangularization

Lebesgue Measure. Dung Le 1

To hand in: (a) Prove that a group G is abelian (= commutative) if and only if (xy) 2 = x 2 y 2 for all x, y G.

Hierarchy among Automata on Linear Orderings

A connection between number theory and linear algebra

On the Average Complexity of Brzozowski s Algorithm for Deterministic Automata with a Small Number of Final States

LECTURE 15: COMPLETENESS AND CONVEXITY

Transcription:

Ergod. Th. & Dynam. Sys. (First published online 208), page of 52 doi:0.07/etds.207.30 c Cambridge University Press, 208 Provisional final page numbers to be inserted when paper edition is published Rationally almost periodic sequences, polynomial multiple recurrence and symbolic dynamics V. BERGELSO, J. KUŁAGA-PRZYMUS, M. LEMAŃCZYK and F. K. RICHTER Department of Mathematics, Ohio State University, Columbus, OH 4320, USA (e-mail: vitaly@math.ohio-state.edu, richter.09@osu.edu) Faculty of Mathematics and Computer Science, icolaus Copernicus University, Chopina 2/8, 87-00 Toruń, Poland (e-mail: joanna.kulaga@gmail.com, mlem@mat.umk.pl) (Received 23 ovember 206 and accepted in revised form 3 September 207) Abstract. A set R is called rational if it is well approximable by finite unions of arithmetic progressions, meaning that for every ɛ > 0 there exists a set B = r i= a i + b i, where a,..., a r, b,..., b r, such that d(r B) := sup (R B) {,..., } Examples of rational sets include many classical sets of number-theoretical origin such as the set of squarefree numbers, the set of abundant numbers, or sets of the form x := {n : ϕ(n)/n < x}, where x [0, ] and ϕ is Euler s totient function. We investigate the combinatorial and dynamical properties of rational sets and obtain new results in ergodic Ramsey theory. Among other things, we show that if R is a rational set with d(r) > 0, then the following are equivalent: (a) R is divisible, i.e. d(r u) > 0 for all u ; (b) R is an averaging set of polynomial single recurrence; (c) R is an averaging set of polynomial multiple recurrence. As an application, we show that if R is rational and divisible, then for any set E with d(e) > 0 and any polynomials p i Q[t], i =,..., l, which satisfy p i (Z) Z and p i (0) = 0 for all i {,..., l}, there exists β > 0 such that the set < ɛ. {n R : d(e (E p (n)) (E p l (n))) > β} has positive lower density. Ramsey-theoretical applications naturally lead to problems in symbolic dynamics, which involve rationally almost periodic sequences (sequences whose level-sets are

2 V. Bergelson et al rational). We prove that if A is a finite alphabet, η A is rationally almost periodic, S denotes the left-shift on A Z and X := {y A Z : each word appearing in y appears in η}, then η is a generic point for an S-invariant probability measure ν on X such that the measure-preserving system (X, ν, S) is ergodic and has rational discrete spectrum. Contents Introduction 2 2 Rationality and recurrence 7 2. Rational sequences are good weights for polynomial multiple convergence 7 2.2 Averaging single recurrence 9 2.3 Averaging multiple recurrence 2 2.4 Inner regular sets, W-rational sets and B-free numbers 5 3 Rational dynamical systems 2 3. Definition and examples of rational subshifts 2 3.2 Rationality along subsequences 25 3.3 Generalizing Theorem.7 26 3.4 Revisiting Theorem.4 33 4 Applications to combinatorics 38 5 Rational sequences and Sarnak s conjecture 40 5. Synchronized automata and substitutions 40 5.2 Orthogonality of RAP and WRAP sequences to the Möbius function 4 Acknowledgements 46 A Appendix. Uniformity of polynomial multiple recurrence 46 References 50. Introduction The celebrated Szemerédi theorem on arithmetic progressions [58] states that any set S having positive upper density d(s) = sup S {,..., } / > 0 contains arbitrarily long arithmetic progressions. A (one-dimensional special case of a) polynomial generalization of Szemerédi s theorem proved in [2] states that for any S with d(s) > 0 and any polynomials p i Q[t], i =,..., l, which satisfy p i (Z) Z and p i (0) = 0 for all i {,..., l}, the set S contains (many) polynomial progressions of the form {a, a + p (n),..., a + p l (n)}. The proof of the polynomial extension of Szemerédi s theorem given in [2] is obtained with the help of an ergodic approach introduced by Furstenberg (see [32, 33]). In particular, the one-dimensional polynomial Szemerédi theorem formulated above follows from the fact that for any probability space (X, B, µ), any invertible measure-preserving transformation T : X X, any A B with µ(a) > 0 and any l polynomials p i Q[t] satisfying p i (Z) Z and p i (0) = 0, i {,..., l},

Rationally almost periodic sequences 3 there exist arbitrarily large n such that µ(a T p (n) A T p l(n) A) > 0. As a matter of fact, one can show that µ(a T p(n) A T pl(n) A) > 0. (.) n= One of the goals of this paper is to refine (.) by considering multiple ergodic averages of the from R [, ] R (n)µ(a T p(n) A T pl(n) A), (.2) n= for certain sets R of arithmetic origin called rational sets, which were introduced in [3] (see Definition. below). We show that for any rational set R the it in (.2) exists. Furthermore, we give necessary and sufficient conditions on R for this it to be positive. This, in turn, allows us to obtain new refinements of the polynomial Szemerédi theorem, some of which we state at the end of this introduction. To present the main results of our paper we need to introduce some definitions first. Definition.. (Rationally almost periodic sequences and rational sets) Let A be a finite set. We endow the space A with the Besicovitch pseudo-metric d B (cf. [5, 6]), d B (x, y) := sup { n : x(n) = y(n)}. (.3) A sequence x A is called (Besicovitch) rationally almost periodic (RAP) if for every ε > 0 there exists a periodic sequence y A such that d B (x, y) < ε. (A more general definition of the Besicovitch pseudo-metric d B and of rationally almost periodic sequences will be introduced in 2. (see p. 7) and in 3.2 (see Definition 3.7).) A set R is called rational if the sequence R (viewed as a sequence in {0, } ) is RAP; see [3, Definition 2.]. Here are some examples of rational sets: the set Q of squarefree numbers (see [3, Lemma 2.7]); the set A of abundant numbers and the set D of deficient numbers (see Corollary 2.7); for any x [0, ], the set x := {n : ϕ(n)/n < x}, where ϕ is Euler s totient function (see also Corollary 2.7). We remark that the original proof in [2] established only that inf µ(a T p (n) A T p l (n) A) > 0, n= whereas the existence of the it in (.) was obtained later; see [38, 45]. Let σ (n) = d n d denote the classical sum of divisors function. The set of abundant numbers and the set of deficient numbers are defined, respectively, as A := {n : σ (n) > 2n} and D := {n : σ (n) < 2n}. (The classical set of perfect numbers is defined as P := {n : σ (n) = 2n}.)

4 V. Bergelson et al The above examples are special cases of sets of multiples and sets of B-free numbers. For B \ {} the corresponding sets of multiples and B-free numbers are defined as M B := b B b and F B := \ M B, respectively. The abundant numbers (as well as the union of the abundant and perfect numbers) form a set of multiples, the deficient numbers yield an example of a B-free set and x is a set of multiples. In 2.4 we show that for B \ {} the set F B is a rational set if and only if the density d(f B ) := (/) F B [, ] exists (see Corollary 2.6). A natural way of obtaining rational sets is via level-sets of RAP sequences: if A = {a, a 2,..., a r } is a finite set and x A is an RAP sequence then the sets {n : x(n) = a },..., {n : x(n) = a r } are rational. As a matter of fact, x A Z is RAP if and only if all its level-sets are rational. Examples of RAP sequences include regular Toeplitz sequences, or, more generally, Weyl rationally almost periodic sequences (for definitions see 3.). In particular, paperfolding sequences as well as automatic sequences coming from synchronized automata are RAP sequences (see 3. and 5 for definitions and more details). Definition.2. (Cf. [0, Definition.5]) We say that R is an averaging set of polynomial multiple recurrence if for any invertible measure-preserving system (X, B, µ, T ), A B with µ(a) > 0, l and any polynomials p i Q[t], i =,..., l, with p i (Z) Z and p i (0) = 0 for all i {,..., l}, the it in (.2) exists and is positive. If l = then we speak of an averaging set of polynomial single recurrence. An averaging set of (single or multiple) polynomial recurrence R must also be a set of recurrence, i.e. for each measure-preserving system (X, B, µ, T ) and each A B with µ(a) > 0 there exists n R such that µ(a T n A) > 0. If we assume that the density d(r) = (/) R [, ] exists and is positive then it follows by considering cyclic rotations on finitely many points that the density of R u also exists and is positive for any positive integer u. This divisibility property is a rather trivial but necessary condition for a positive density set to be good for averaging recurrence. This leads to the following definition. Definition.3. Let R. We say that R is divisible if d(r u) exists and is positive for all u. ote that for rational sets the existence of d(r) and d(r u) is automatic (cf. Lemma 3.4 below). Therefore, to verify divisibility, it suffices to check the positivity of d(r u) for all u. One of our main theorems asserts that for rational sets divisibility is not only a necessary but also a sufficient condition for averaging recurrence. THEOREM.4. Let R be a rational set and assume d(r) > 0. The following are equivalent: (a) R is divisible; Given an infinite binary sequence i {0, }, we inductively define the paperfolding sequence t {0, } with folding instructions i(), i(2), i(3),... as follows: set t() := i() and, whenever t(n) has already been defined for n {, 2,..., 2 k }, define t(n) for n {2 k, 2 k +,..., 2 k+ } as t(2 k ) := i(k) and t(n) := t(2 k+ n) for 2 k < n < 2 k+. For more information on paperfolding sequences, see [, 22].

Rationally almost periodic sequences 5 (b) (c) R is an averaging set of polynomial single recurrence; R is an averaging set of polynomial multiple recurrence. It was proved in [3] that every self-shift of the set Q of squarefree numbers, i.e. any set of the form Q r for r Q, is divisible and hence satisfies the hypothesis of Theorem.4. Moreover, it follows from [3] that a shift Q r for r is divisible if and only if r Q. The following theorem establishes a result of similar nature for sets of B-free numbers. THEOREM.5. Let B \ {} and assume that d(f B ) exists and is positive. Then there exists a set D F B with d(f B \ D) = 0 such that the set F B r is an averaging set of polynomial multiple recurrence if and only if r D. Remark.6. A detailed discussion of criteria for the existence of d(f B ) will be provided in 2.4; see Definition 2.4 and Theorem 2.5. In 3.4 we obtain a version of Theorem.5 for the case where d(f B ) does not necessarily exist; see Theorem 3.27. In 2.4 we also show that in Theorem.5 one has D = F B if and only if the set B is taut; see Definition 2.9 and Theorem 2.26. Theorem.4 motivates closer interest in RAP sequences as independent objects. In 3 we take a dynamical approach to study RAP sequences more closely. To formulate our results in this direction, let us first recall some basic notions of symbolic dynamics. As before, let A be a finite set (alphabet) and let S : A Z A Z denote the left-shift on A Z, i.e. Sx = y where x A Z and y(n) = x(n + ) for all n Z. For x A Z (or x A ) and n < m we call x[n, m] = (x(n), x(n + ),..., x(m)) a word appearing in x. Given η A, let X η := {x A Z : ( n < m)( k ) x[n, m] = η[k, k + m n ]} = {x A Z : each word appearing in x appears in η}. Clearly, X η is a closed and S-invariant subset of A Z (usually referred to as the subshift determined by η). A sequence η A is called generic for an S-invariant Borel probability measure µ on A Z if n=0 f (S n η) = f dµ A Z for all continuous functions f C(A Z ), where η A Z denotes any two-sided sequence extending η A. ote that the above definition does not depend on the choice of the two-sided extension η of η. For an RAP sequence η A we call the corresponding symbolic dynamical system (X η, S) a rational subshift. We show in 3 that any rational sequence η is generic for an ergodic measure ν such that (X η, ν, S) has rational discrete spectrum (i.e. the span of all eigenfunctions of T is dense in L 2 (X, B, µ) and all the corresponding eigenvalues are roots of unity), a result which we believe is of independent interest. that the of has When η is (topologically) recurrent, that is, any finite word appearing in η reappears infinitely often, then there is η A Z such that η[, ) = η and X η = {S k η : k Z} (cf. [25, pp. 89 90]). ote, however, that not all RAP sequences are recurrent.

6 V. Bergelson et al THEOREM.7. Let η A be RAP. Then there exists an S-invariant Borel probability measure ν on X η such that η is generic for ν and the measure-preserving system (X η, ν, S) is ergodic and has rational discrete spectrum. In light of Theorem.7, the following result (obtained in 3.4) can be viewed as a dynamical generalization of Theorem.4. THEOREM.8. Let R with d(r) > 0 and suppose η := R is generic for a Borel probability measure ν on X η {0, } Z such that (X η, ν, S) has rational discrete spectrum. Then there exists an increasing sequence of natural numbers ( k ) k such that the following are equivalent. (A) R is divisible along ( k ) k, that is, for all u, (B) d (k) R u {,..., k } (R u) := > 0. k R is an averaging set of polynomial multiple recurrence along ( k ) k, that is, for all invertible measure-preserving systems (X, B, µ, T ), l, A B with µ(a) > 0 and for all polynomials p i Q[t], i =,..., l, with p i (Z) Z and p i (0) = 0 for i {,..., l}, k k R (n)µ(a T p(n) A T pl(n) A) > 0. n= In 2.4 and 3.4 we give various examples of (classes of) rational sets for which Theorems.4 and.8 hold. With the help of Furstenberg s correspondence principle (see Proposition 4.) we have the following combinatorial corollary of Theorem.4. THEOREM.9. Let R be rational and divisible. Then for any set E with d(e) > 0 and any polynomials p i Q[t], i =,..., l, which satisfy p i (Z) Z and p i (0) = 0 for all i {,..., l}, there exists β > 0 such that the set has positive lower density. {n R : d(e (E p (n)) (E p l (n))) > β} We note that Theorem.5 also yields combinatorial corollaries in the spirit of Theorem.9, which are formulated and proved in 4. We conclude this introduction by stating an amplified version of Theorem.9, a proof of which is also contained in 4. THEOREM.0. Let R be rational and divisible. Then for any E with d(e) > 0 and any polynomials p i Q[t], i =,..., l, which satisfy p i (Z) Z and p i (0) = 0, for all i {,..., l}, there exists a subset R R satisfying d(r ) > 0 and such that for any finite subset F R, ( ) d (E (E p (n)) (E p l (n))) > 0. n F

Rationally almost periodic sequences 7 Structure of the paper. Section 2 is divided into four subsections. In 2. we show that RAP sequences are good weights for polynomial multiple convergence. In 2.2, we prove the equivalence (a) (b) of Theorem.4. In 2.3 we give a proof of the equivalence (a) (c). Finally, in 2.4, we provide more examples of rational sets, and discuss some of their properties. This includes a discourse on B-free numbers and a proof of Theorem.5. In 3 we define rational subshifts and study their dynamical properties. In particular, 3 contains a proof of Theorem.7. In 3.4 we give a proof of a strengthening of Theorem.4, and in 4 we provide various combinatorial applications of it via Furstenberg s correspondence principle. In 5 we prove that systems generated by Weyl rationally almost periodic sequences (see p. 23 for the definition) satisfy Sarnak s conjecture. Finally, in the appendix we establish a uniform version of the polynomial multiple recurrence theorem obtained in [2], which is needed for the proof of Theorem.4. 2. Rationality and recurrence 2.. Rational sequences are good weights for polynomial multiple convergence. The purpose of this subsection is to show that for rational sets R with d(r) > 0, the it in (.2) always exists. First, we make the following observation. If d(r) exists and is positive then the it in (.2) exists and is positive if and only if the it R (n)µ(a T p(n) A T pl(n) A) (2.) n= exists and is positive. Since throughout this paper we mostly consider sets R for which d(r) exists (except in 3.4) and is positive, it suffices to study the ergodic averages given by (2.) instead of (.2). For the special case where l = and p (t) = t, the existence of the it in (2.) follows from the work of Bellow and Losert in [6]. To better describe what is known in this case, we need to introduce first the following extended form of Definition.. Definition 2.. Given x, y : C, we define d B (x, y) := sup x(n) y(n). (2.2) A sequence x : C is called Besicovitch almost periodic (BAP) [5, 6] if for every ε > 0 there exists a trigonometric polynomial P(t) = M j= c j e 2πiλ j t with c,..., c M C and λ,..., λ M R such that d B (x, P) = d B ((x(n)) n, (P(n)) n ) < ε. If, for each ε > 0, one can choose λ,..., λ M Q which is equivalent to the assertion that the sequence ( P(n)) is periodic then we call x (Besicovitch) rationally almost periodic, or RAP. In particular, RAP sequences are a special type of BAP sequences. It is shown in [6, 3] that for any bounded BAP sequence x : C, the ergodic averages x(n)t n f n= n=

8 V. Bergelson et al converge almost everywhere for any function f L (X, B, µ). From this, the existence of the it in (2.) for l = and p (t) = t follows immediately. Definition 2.2. A sequence x {0, } is called a good weight for polynomial multiple convergence if for every invertible measure-preserving system (X, B, µ, T ), for all f,..., f l L (X, µ) and for all polynomials p i Q[t], p i (Z) Z, i {,..., l}, the it exists in L 2 (X, B, µ). x(n) n= l T p i (n) f i (2.3) The following proposition shows that the it in (2.) exists in general. PROPOSITIO 2.3. Let x {0, } be RAP. Then x is a good weight for polynomial multiple convergence. Proof. It follows from the results of Host and Kra [38] and Leibman [45] that the sequence i= T q(n) f... T ql(n) f l,, n= converges in L 2, for any q i Q[t], q i (Z) Z, i =,..., l. In particular, given arbitrary a, b Z, the averages T p(an+b) f... T pl(an+b) f l n= converge in L 2 as. Equivalently, the it a+b (n)t p(n) f... T pl(n) f l (2.4) n= exists. Observe that any periodic sequence can be written as a finite linear combination of infinite arithmetic progressions a+b. Therefore, it follows from (2.4) that for any periodic sequence y {0, } the it y(n)t p(n) f... T pl(n) f l n= also exists in L 2. Since any RAP sequence x can be approximated by periodic sequences, we can find periodic sequences y m, m, satisfying d B (y m, x) 0 as m. Define Then L m := y m (n)t p(n) f... T pl(n) f l. n= L m L m2 L 2 d B (y m, y m2 ) f L... f l L,

Rationally almost periodic sequences 9 which shows that (L m ) is a Cauchy sequence, whence the it L := m L m exists. Moreover, sup L m L x(n)t p(n) f... T pl(n) f l 2 n= can be bounded from above by d B (x, y m ) f L f l L, which converges to zero as m. Therefore, the it in (2.3) exists and equals L. 2.2. Averaging single recurrence. In this subsection we provide a proof of the equivalence (a) (b) in Theorem.4. Of course, this equivalence is a special case of the more general equivalence (a) (c). We include a separate proof of this simpler case because, on the one hand, this proof is more elementary and self-contained and, on the other hand, it contains in embryonic form the ideas needed for the proof of the general case. Let us state the non-trivial implication, namely (a) (b), as an independent theorem. THEOREM 2.4. Assume that R is rational and divisible. Then R is an averaging set of polynomial single recurrence. The proof of Theorem 2.4 is comprised of two parts. First, we prove the assertion for totally ergodic systems. Recall that (X, B, µ, T ) is called totally ergodic if T m is ergodic for all m. Equivalently, T is ergodic and the spectrum of the unitary operator associated with T contains no non-trivial roots of unity. Lemma 2.5 below, which is the second ingredient in the proof of Theorem 2.4, allows us to reduce the case of general ergodic systems to those which are totally ergodic. This is done by replacing T p(n) with T p(un) for a highly divisible natural number u. Since p(0) = 0, this allows us to identify T p(un) with T q(n) for some other polynomial q. This procedure annihilates the rational part of the spectrum in the sense that will be made precise below. In the following, we use K rat to denote the rational Kronecker factor of (X, B, µ, T ), which is defined as the smallest sub-σ -algebra of B for which all eigenfunctions with roots of unity as eigenvalues are measurable. Equivalently, the rational Kronecker factor is the largest factor of T which has rational discrete spectrum. It is also a characteristic factor for ergodic averages along polynomials. This means that for any function f L 2 and any polynomial p Q[t], p(z) Z, (T p(n) f T p(n) E( f K rat )) = 0, (2.5) L 2 n= where E( f K rat ) denotes the conditional expectation of f with respect to K rat, i.e. the unique function in L 2 (X, B, µ) such that E( f K rat ) is K rat -measurable and A E( f K rat) dµ = A f dµ for all A K rat. A proof of (2.5) can be found in [9, 2]. LEMMA 2.5. Let (X, B, µ, T ) be an invertible measure-preserving system and let R with d(r) > 0. Also, let p Q[t] satisfy p(z) Z and p(0) = 0. Assume that for each real-valued g L 2 (X, B, µ) with E(g K rat ) = g dµ > 0 there exists some δ > 0 such that d(d δ (g) u) > 0 for all u, (2.6)

0 V. Bergelson et al where D δ (g) := {n R : T p(n) g, g > δ}. Then for all non-negative f L 2 (X, B, µ) with X f dµ > 0, sup R (n) T p(n) f, f > 0. (2.7) n= Proof. Fix f L 2 (X, B, µ), f 0 with X f dµ > 0. Then the function g () := f E( f K rat ) + f dµ is real-valued and satisfies E(g () K rat ) = X g() dµ > 0. Therefore, we can find some δ > 0 such that (2.6) holds for g = g (). Pick 0 < ɛ < δ. Let K u stand for the factor of K rat that is generated by eigenfunctions corresponding to eigenvalues which are roots of unity of degree at most u. ote that K! K 2! K 3!... and K rat = m K m!. X Hence, using Doob s martingale convergence theorem (see [54, 3.4]), we can find m such that E( f K rat ) E( f K m! ) L 2 < ɛ. Take u = m! Define g (2) = E( f K u ) f dµ, g (3) = E( f K rat ) E( f K u ), so that f = g () + g (2) + g (3). A simple calculation shows that It follows that T n g (i), g ( j) = 0 for all i, j {, 2, 3} with i = j and for all n Z. T p(n) f, f = T p(n) (g () + g (2) + g (3) ), g () + g (2) + g (3) X = T p(n) g (), g () + T p(n) g (2), g (2) + T p(n) g (3), g (3). Then, using T p(n) g (2) = g (2) for all n u and g (3) L 2 < ε, we get that for every n D δ (g () ) u, T p(n) f, f = T p(n) g (), g () + T p(n) g (2), g (2) + T p(n) g (3), g (3) T p(n) g (), g () + g (2), g (2) ε 2 δ ε 2 > 0. To complete the proof, it suffices to notice that sup n= R (n) T p(n) f, f sup n D δ (g () ) u {,...,} (δ ε 2 ) d(d δ (g () ) u) R (n) T p(n) f, f and apply (2.6) for g ().

Rationally almost periodic sequences Proof of Theorem 2.4. Suppose R with d(r) > 0 is both rational and divisible. We want to show that R is a set of averaging polynomial single recurrence, i.e. we want to show that for any invertible measure-preserving system (X, B, µ, T ), p Q[t], p(z) Z, with p(0) = 0 and A B with µ(a) > 0, the it R (n)µ(a T p(n) A) (2.8) n= is positive. ote that the it in (2.8) exists by Proposition 2.3. In view of Lemma 2.5, to show that (2.8) is positive it suffices to show that (2.6) holds for all real-valued g L 2 (X, B, µ) with E(g K rat ) = X g dµ > 0. However, for any such g, it follows from (2.5) that ( T q(n) g, g = n= X ) 2 g dµ for all polynomials q Q[t], q(z) Z. In particular, we can pick q(n) = p(u(an + b)) and obtain ( T p(u(an+b)) g, g = n= This can be rewritten as a+b (n) T p(un) g, g = ( a n= X g dµ) 2 for all a, u, b {0}. X g dµ) 2 for all a, u, b {0}. (2.9) ow, if E is a finite union of infinite arithmetic progressions then E can be written as a finite linear combination of functions of the form a+b and it follows from (2.9) that for any such set E, n= ( 2 E (n) T p(un) g, g = d(e) g dµ). X Finally, since R u is rational for all u and every rational set can be approximated by finite unions of infinite arithmetic progressions, we deduce that n= ( 2 R u (n) T p(un) g, g = d(r u) g dµ) for all u. (2.0) X Choose δ > 0 so that δ( + g 2 L 2 ) < ( X g dµ)2. It is now an immediate consequence of (2.0) that d({n R u : T p(n) g, g > δ}) d(r u)δ. From this it follows that (2.6) holds.

2 V. Bergelson et al 2.3. Averaging multiple recurrence. In this subsection we prove (a) (c) in Theorem.4. Since (c) (a) is trivial, this will complete the proof of Theorem.4. Let us state the implication that we want to prove as a separate theorem. THEOREM 2.6. Assume R is rational and divisible. Then R is an averaging set of polynomial multiple recurrence. For the proof of Theorem 2.6, we rely on a series of known results. We recall first some fundamental properties of nilsystems. Let G be a nilpotent Lie group and let Ɣ be a uniform and discrete subgroup of G. The compact manifold X := G/ Ɣ is called a nilmanifold. G acts naturally on X. More precisely, if g, y G and x = yɣ X then T g x is defined as (gy)ɣ. For a fixed g G the topological dynamical system (X, T g ) is called a nilsystem. Every nilmanifold X = G/ Ɣ possesses a unique G-invariant probability measure µ X, called the Haar measure of X. A bounded function φ : C is called a basic nilsequence if there exist a nilmanifold X = G/ Ɣ, a point x X, an element g G and a continuous function f C(X) such that φ(n) = f (Tg nx) for all n. Here, T g nx coincides with T gn x. A function ψ : C is called a nilsequence if for each ε > 0 there exists a basic nilsequence (φ(n)) such that ψ(n) φ(n) < ε for all n. An important tool in the proof of Theorem 2.6 is a theorem of Leibman that allows us to replace multiple ergodic averages along polynomials with Birkhoff sums of nilsequences. THEOREM 2.7. (Cf. [47, Theorem 4.] and [46, Proposition 3.4]) Assume that (X, B, µ, T ) is an invertible measure-preserving system, let f,..., f l L (X, B, µ), p,..., p l Q[t] (p i (Z) Z for i =,..., l) and set ϕ(n) := X T p (n) f T p l(n) f l dµ, n Z. Then there exists a nilsequence (ψ(n)) such that sup M In particular, d B (ϕ, ψ) = 0. M n=m ϕ(n) ψ(n) = 0. If (x n ) n is a sequence of points from a nilmanifold X = G/ Ɣ such that n= f (x n ) = X f dµ X for all continuous functions f C(X), then we call such a sequence uniformly distributed. If (x n ) n has the property that (x an+b ) n is uniformly distributed for all a, b, then we call this sequence totally equidistributed. It is well known that for any nilsystem (X, T g ) the following are equivalent (see, for instance, [3, 52] in the case of connected G and [46] in the general case): the sequence (Tg nx) n is totally equidistributed for all x X; the system (X, µ X, T g ) is totally ergodic. Any nilmanifold has finitely many connected components (and each such component is a sub-nilmanifold). Moreover, since any ergodic nilrotation T g permutes these components in a cyclical fashion, we deduce that for some u the nilrotation T g u fixes each

Rationally almost periodic sequences 3 connected component. The next proposition asserts that in this case the action of T g u on each of these connected components is totally ergodic. PROPOSITIO 2.8. (See [29, Proposition 2.]) Let X = G/ Ɣ be a nilmanifold, g G and assume that the nilrotation T g is ergodic. Fix x X and let Y denote the connected component of X containing x. Then there exists u such that Y is T g u -invariant and (Y, µ Y, T g u ) is totally ergodic. The next lemma is important for the proof of Theorem.4 and asserts that linear sequences coming from totally ergodic nilrotations (or equivalently, totally equidistributed sequences) do not correlate with RAP sequences. LEMMA 2.9. Suppose R is rational and T g is a totally ergodic nilrotation on a nilmanifold X = G/ Ɣ. Then, for all x X and f C(X), R (n) f (Tg n x) = d(r) f dµ X. n= Proof. Since T g is totally ergodic, we deduce that the sequence (Tg nx) n is totally equidistributed for each x X. Therefore, for all a and b {0}, we obtain f (Tg an+b x) = f dµ X. This can be rewritten as n= a+b (n) f (Tg n x) = a n= X X X f dµ X. (2.) If E is a finite union of infinite arithmetic progressions then E can be written as a finite linear combination of functions of the form a+b. It now follows directly from (2.) that for any such set E, E (n) f (Tg n x) = d(e) n= X f dµ X. (2.2) Finally, since R is rational, it can be approximated in the d B pseudo-metric by finite unions of infinite arithmetic progressions and so, using (2.2), we obtain R (n) f (Tg n x) = d(r) f dµ X. n= Proof of Theorem 2.6. Let (X, B, µ, T ) be an invertible measure-preserving system and assume that R is rational and divisible. Take any A B with µ(a) > 0 and let p,..., p l Q[t] with p i (Z) Z, p i (0) = 0, i =,..., l, be arbitrary. We will show that R (n)ϕ(n) > 0, (2.3) n= where ϕ(n) = µ(a T p(n) A T pl(n) A). This, in view of (2.), suffices to conclude that R is an averaging set of polynomial multiple recurrence. The existence X

4 V. Bergelson et al of the it in (2.3) follows immediately from Proposition 2.3, hence it only remains to show its positivity. By Theorem A.2, there exists δ > 0 such that ϕ(un) > δ for all u. (2.4) n= Using Theorem 2.7, we can find a nilsequence (ψ(n)) such that (2.3) holds if and only if R (n)ψ(n) > 0. (2.5) n= Moreover, since d B (ϕ, ψ) = 0, it follows from (2.4) that ψ(un) > δ for all u. (2.6) n= By definition, every nilsequence can be uniformly approximated by basic nilsequences. For us this means that there exist a nilpotent Lie group G, a uniform and discrete subgroup Ɣ, x X = G/ Ɣ and f C(X) such that ψ(n) f (Tg n x) δ/4 for all n. We can assume without loss of generality that T g is ergodic and, since ϕ(n) [0, ] and d B (ϕ, ψ) = 0, that 0 f. It follows from (2.6) and the inequalities ψ(n) f (Tg n x) δ/4, n, that n= f (T un g 3δ x) > 4 for all u. (2.7) Using Proposition 2.8, we can find u and a sub-nilmanifold Y X containing x such that (Y, µ Y, T g u ) is totally ergodic. In the following, we identify f with f Y. Since R is rational, it is straightforward that the set R/u := {n : nu R} is also rational. Thus, we can invoke Lemma 2.9 and obtain R/u (n) f (Tg n u x) = d(r/u) n= Y f dµ Y. (2.8) Finally, combining (2.8) with (2.7) (together with the ergodic theorem) and the fact that ψ(un) f (Tg n u x) δ/4 for all n, we obtain n= This completes the proof. R (n)ψ(n) = u u u ( ( R u (n)ψ(n) n= n= ) R/u (n)ψ(un) R/u (n) f (Tg n u x) δ ) 4 d(r/u) n= ( 3δ 4 d(r/u) δ 4 d(r/u) ) > 0.

Rationally almost periodic sequences 5 We would like to pose the following question describing one possible way of extending Theorem.4 to a more general version involving several commuting measure-preserving transformations. Question 2.0. Assume R is rational and d(r) > 0. Are the following equivalent? (α) R is divisible. (β) For all probability spaces (X, B, µ), all l, all l-tuples of commuting invertible measure-preserving transformations T,..., T l on (X, B, µ), all A B with µ(a) > 0 and for all polynomials p i Q[t], i =,..., l, with p i (Z) Z and p i (0) = 0, n= R (n)µ(a T p (n) A T p l(n) l A) > 0. 2.4. Inner regular sets, W-rational sets and B-free numbers. The set Q of squarefree numbers is rational (see Corollary 2.6 below) but it is not divisible, as Q p 2 = for all primes p. In particular, Q is not a set of recurrence. However, as was mentioned in, it follows from results obtained in [3] that Q r is divisible (and hence by virtue of Theorem.4 an averaging set of polynomial multiple recurrence) if and only if r Q. This raises the question whether every rational set can be shifted to become divisible. In general, the answer to this question is negative. For example, one can show that for a carefully chosen increasing sequence a 0, a, a 2,..., the set S = \ n 0 (a n + n) is rational. On the other hand, for any integer n 0, one has (S n) a n = (cf. [36, Theorem.6] and [5, Theorem 2.20]). We will now introduce a rather natural family of rational sets with the property that for any set in this family there is a shift that is divisible. Definition 2.. We define the Weyl pseudo-metric d W on {0, } as d W (x, y) = sup sup l {l n l + : x(n) = y(n)}. (2.9) A set R is called W-rational if R {0, } can be approximated by periodic sequences in the d W pseudo-metric. ote that every W-rational set is a rational set. In 3. below we will extend the definition of the d W pseudo-metric from {0, } to A for arbitrary finite subsets A and we also introduce the related notion of Weyl rationally almost periodic sequences (see page 23). PROPOSITIO 2.2. Suppose D is W-rational and d(d) > 0. There exists a shift of D which is divisible. Proof. Assume that no translation of D is divisible. Hence, for each n 0, there exists w n such that if C n := {s : n + sw n D c } then d(c n ) =. (2.20)

6 V. Bergelson et al Fix K. Then by (2.20), also d({s 0 : n + sw w K D c for each n = 0,,..., K }) =. It follows that for every K there exists s such that D (n + sw w K ) = 0 for each n = 0,,..., K. In other words, in the sequence D there appear arbitrarily long blocks of consecutive zeros. This implies that the only periodic sequence that approximates D in the d W pseudo-metric is the sequence (0, 0, 0,...), which contradicts d(d) > 0. In order to give more examples of rational sets that possess shifts that are divisible, we will now recall the notion of inner regular sets (see [3, Definition 2.3]). A subset R is called inner regular if for each ε > 0 there exists m such that for each a {0} the intersection R (mz + a) is either empty or has lower density greater than ( ε)/m. It follows immediately that every inner regular set is rational. Also, it is shown in [3, Lemma 2.7] that the set of squarefree numbers Q is inner regular. PROPOSITIO 2.3. Assume that = R is inner regular. Then, for each r R, the set R r is divisible. Proof. Suppose u is arbitrary. Fix ε > 0 with ε < /u. We can find m so that for every a {0} the intersection R (mz + a) is either empty or has lower density greater than ( ε)/m. Since r R, the intersection R (mz + r) is not empty. This means that the set {k : mk + r R} = {k : mk R r} has lower density greater than ε. Since ε < /u, the set {k : mk R r} u has positive lower density. This means the set (R r) um has positive lower density and the assertion follows. We move the discussion now on to sets of B-free numbers. The purpose of the remainder of this section is to prove a general form of Theorem.5 formulated in. Given B \ {}, we consider its set of multiples M B := b B b and the corresponding set of B-free numbers F B := \ M B, i.e. the set of integers without a divisor in B. Without loss of generality, we can assume that B is primitive, i.e. no b divides b for distinct b, b B. Indeed, for a general set B one can find a primitive subset B 0 B such that M B = M B0 and F B = F B0 (cf. [35, Ch. 0]). ote that if we take B = {p 2 : p is prime}, then the set of B-free numbers equals the set Q of squarefree numbers. Sets of B-free numbers make good candidates for rational sets. Unfortunately, not every set of B-free numbers is a rational set, since the density d(f B ) of F B need not exist. An example of a set B for which the density of M B and F B does not exist was given by Besicovitch in [5]. This leads to the following definition. Definition 2.4. (Cf. [35]) We say that B is Besicovitch if d(m B ) exists. (This is equivalent to the existence of d(f B ).) Davenport and Erdős proved that the logarithmic density δ(m B ) := log n= n M B (n)

Rationally almost periodic sequences 7 exists for all B = {b, b 2,...} \ {}. This, of course, implies that the logarithmic density δ(f B ) exists. For m, consider the sets B(m) = {b, b 2,..., b m } and let M B(m) and F B(m) denote the corresponding set of multiples of B(m) and set of B(m)- free numbers, respectively. THEOREM 2.5. (See [20, 2]) For each B \ {}, the logarithmic density δ(m B ) of M B exists. Moreover, δ(m B ) = d(m B ) = m d(m B(m)). In particular, if B is Besicovitch then d(m B ) = m d(m B(m) ). Analogous results hold for F B instead of M B. From Theorem 2.5, we obtain two useful corollaries. COROLLARY 2.6. Let B \ {}. Then M B and F B are rational if and only if B is Besicovitch. Proof. ote that for any m, the sequence MB(m) is periodic. Hence if B \ {} is Besicovitch, then by Theorem 2.5 the sequence MB can be approximated in the d B - pseudo-metric by MB(m) as m, which proves that M B is rational. An analogous argument applies to F B. On the other hand, if M B is rational then the density of M B exists and hence, by definition, the set B is Besicovitch. In the following, let A denote the set of abundant numbers, P the set of perfect numbers and D the set of deficient numbers (for definitions, see footnote on page 3). COROLLARY 2.7. Let A \ {}. Suppose A satisfies the following two conditions: () d(a) exists, and (2) n A A for all n. Then A is a rational set. In particular, the set of abundant numbers A, the set of deficient numbers D and, for any x [0, ], the set x := {n : ϕ(n)/n < x} are rational sets. Proof. Set B := A. It follows from property (2) that M B = A. Also, B is Besicovitch because d(m B ) = d(a) exists according to property (). Hence, in view of Corollary 2.6, the set A = M B is rational. We now turn our attention to the set of abundant numbers. First, note that na A for all n. Also, the fact that d(a ) exists was proven by Davenport in [9]. Therefore A is rational. Moreover, since = A P D and d(p) = 0 (cf. [37]), we conclude that D is also rational. Finally, for any x [0, ], the set x := {n : ϕ(n)/n < x} satisfies n x x and it was first shown in [57] that d( x ) exists. Hence x is rational. As mentioned above, a shift of the set of squarefree numbers, Q r, is an averaging set of polynomial multiple recurrence if and only if r Q. Our next goal is to show that a similar result holds for other sets of B-free numbers. ote that if r / F B, i.e. r M B, then F B r is not a set of recurrence. Indeed, if it were a set of recurrence then, by

8 V. Bergelson et al considering the cyclic rotation on r points, for some u we would have ur F B r and therefore (u + )r F B, which is a contradiction. Hence, r F B is a necessary condition for F B r to be good for recurrence. As for the other direction, we have the following result. THEOREM 2.8. Suppose B \ {} is Besicovitch. Then almost every self-shift of F B is an averaging set of polynomial multiple recurrence. More precisely, there exists a set D F B with d(f B \ D) = 0 such that for all r the following are equivalent: r D; F B r is divisible; F B r is an averaging set of polynomial multiple recurrence. ote that Theorem.5 is now an immediate consequence of Theorem 2.8. We give a proof of Theorem 2.8 at the end of this subsection. Let us remark that in most cases one can actually take D = F B. To distinguish between sets of B-free numbers for which D = F B and for which D F B, we introduce the following notions. Definition 2.9. (Cf. [35]) Let B \ {}. We call B Behrend if δ(m B ) = (this is equivalent to the existence of the density of M B with d(m B ) = ). We call B taut if for every b B, one has δ(m B ) > δ(m B\{b} ). If B is Behrend then D =, because in this case F B (and each of its translations) has zero density. Behrend sets are not taut (see Lemma 2.20 below) and it will be clear from the proof of Theorem 2.8 that in the statement of Theorem 2.8 one can take D = F B if and only if B is taut (see Theorem 2.26 below). The remainder of this subsection is dedicated to proving Theorem 2.8. We start with a series of lemmas. LEMMA 2.20. [35, Corollary 0.4] A B is Behrend if and only if at least one of A and B is Behrend. In particular, Behrend sets are not taut. LEMMA 2.2. [35, Corollary 0.9] B is taut if and only if it is primitive and does not contain a set of the form ca, where c and A \ {} is Behrend. LEMMA 2.22. (Cf. the proof of [4, Lemma 6.5]) Let C. For any u and a {0} the logarithmic densities of M C (u + a) and F C (u + a) exist and satisfy δ(m C (u + a)) = d(m C (u + a)) = m d(m C (m) (u + a)), δ(f C (u + a)) = d(f C (u + a)) = m d(f C (m) (u + a)). Proof. The assertion concerning M C (u + a) was covered in the proof of [4, Lemma 6.5]. The remaining part follows immediately, as F C = \ M C. LEMMA 2.23. Let C \ {} and let a {0}. If u is coprime to each element of C then δ(f C (u + a)) = u δ(f C ).

Rationally almost periodic sequences 9 Proof. Suppose C = {b, b 2,...} and let C (m) := {b,..., b m }. The assertion of the lemma is clearly equivalent to δ(m C (u + a)) = (/u) δ(m C ). Since u is coprime to each element of C, it follows by the Chinese remainder theorem that for any m and r {0} there exists r {0} such that In particular, It follows that (lcm(b,..., b m ) + r) (u + a) = u lcm(b,..., b m ) + r. d((lcm(b,..., b m ) + r) (u + a)) = u lcm(b,..., b m ). d(m C (m) (u + a)) = u d(m C (m)) (2.2) since M C (m) is periodic with period lcm(b,..., b m ). Using Lemma 2.22, (2.2) and Theorem 2.5, we obtain which completes the proof. δ(m C (u + a)) = m d(m C (m) (u + a)) = m u d(m C (m)) = u δ(m C ), LEMMA 2.24. Suppose C \ {} is taut. If a F C then, for every u, one has δ((f C a)/u) > 0. Proof. Define otice that { C (a) := Moreover, M C (a) M C, whence b gcd(b, a) : b C }. gcd(a, c) = for each c C (a). (2.22) F C (a) F C. (2.23) Since gcd(b, a) takes only finitely many values as b C varies, C (a) = { } b : b C, gcd(b, a) = d. d d a Suppose that C (a). Then for some b C, gcd(b, a) = b, whence a M C, a contradiction. It follows that / C (a). (2.24) Suppose that C (a) is Behrend. Then, by Lemma 2.20, for some d 0 a, the set A := {b/d 0 : b C, gcd(b, a) = d 0 } is Behrend and we have d 0 A C. However, this and (2.24), in view of Lemma 2.2, contradict the tautness of C. Therefore, C (a) cannot be Behrend, i.e. c := δ(f C (a)) > 0. We will use this constant to prove that δ((f C a)/u) > c for all u.

20 V. Bergelson et al By Lemma 2.22 and (2.23), δ((f C a)/u) = u δ((f C a) u) u δ((f C (a) a) u) Hence, it suffices to show that = u δ(f C (a) (u + a)). δ(f C (a) (u + a)) u δ(f C (a)). In order to verify this last claim, let us divide C (a) into two pieces: We claim that C (a, u) := {c C (a) : gcd(u, c) > }, C 2 (a, u) := {c C (a) : gcd(u, c) = }. F C (a,u) (u + a) = u + a. (2.25) Indeed, take any c C (a, u). Then gcd(u, c) > and since (2.22) holds, gcd(u, c) does not divide a. Hence c (u + a) =. It follows that M C (a,u) (u + a) = and (2.25) follows. Therefore, using (2.25) and additionally Lemma 2.23, we obtain δ(f C (a) (u + a)) = δ(f C 2 (a) (u + a)) = u δ(f C 2 (a) ) u δ(f C (a)) and the result follows. Before we present the proof of Theorem 2.8, one more theorem needs to be quoted. THEOREM 2.25. [4, Theorem 4.5 and the proof of Lemma 4.] Let B \ {}. Then there exists a taut set C \ {} such that F C F B and δ(f C ) = δ(f B ). Moreover, if B is Besicovitch, then C is Besicovitch. Proof of Theorem 2.8. Let B \ {} be Besicovitch. If B is Behrend then F B has zero density and so no shift of F B is divisible or good for averaging polynomial recurrence. In this case we can put D = and we are done. Thus, let us assume that B is not Behrend. In view of Theorem.4, it suffices to find a set D F B with d(f B \ D) = 0 and such that F B r is divisible if and only if r D. Pick C \ {} taut with F C F B and d(f C ) = d(f B ); the existence of C is guaranteed by Theorem 2.25. We make the claim that one can choose D := F C. In particular, if B is taut then one can choose D = F B. To verify this claim, we invoke Lemma 2.24, which tells us that δ((f C r)/u) > 0 if and only if r F C. Since C is Besicovitch, we can replace logarithmic density with density and conclude that F C r is divisible if and only if r F C. Finally, to finish the proof, we observe that d(f B \ F C ) = 0 and therefore F B r is divisible if and only if r F C. THEOREM 2.26. (Corollary of the proof of Theorem 2.8) In the statement of Theorem 2.8 one has D = F B if and only if B is taut.

Rationally almost periodic sequences 2 FIGURE. Logical connections between statements (a) (f) in Remark 2.27. Dashed arrows: trivial implications which hold for any B \ {}. Dotted arrow: this implication was explained in the paragraph before Theorem 2.8. Short plain arrow: implication follows from [4]. Thick arrow: this implication follows from Theorem.4. Double arrow: implication proved in Lemma 2.24. Remark 2.27. Let B \ {} be Besicovitch and taut (hence d(f B ) > 0). Here is a summary of equivalent conditions that we obtained in this section. (a) a F B. (b) d(m B a) > d(m B ). (c) F B a is divisible. (d) (F B a) u = for all u. (e) F B a is an averaging set of polynomial multiple recurrence. (f) F B a is an averaging set of polynomial single recurrence. Figure describes the logical connections between the above statements. 3. Rational dynamical systems The purpose of this section is to give a proof of (slightly more general versions of) Theorems.7 and.8. In 3. we define rational and W-rational subshifts and we give a variety of examples. In 3.2 we extend the notion of rational subshifts to the notion of rational subshifts along increasing subsequences. Finally, in 3.3 and 3.4, we formulate and prove extensions of Theorems.7 and.8. 3.. Definition and examples of rational subshifts. In this section we define and give examples of symbolic dynamical systems determined by RAP sequences. We will refer to such systems as rational subshifts. Consider the product space A Z, where A is a finite set (alphabet). We endow A with the discrete metric ρ and A Z with the product topology induced by (A, ρ); in particular, A Z is compact and metrizable. Let S : A Z A Z be the left shift, i.e. S((x(n)) n Z ) = (y(n)) n Z, where y(n) = x(n + ) for each n Z. Recall that for any closed and S-invariant subset X A Z, the system (X, S) is called a subshift of (A Z, S). Recall that for x A Z (or x A ) and n < m, x[n, m] = (x(n), x(n + ),..., x(m)) is said to be a word appearing in x. Given η A, the set X η := {x A Z : ( n < m)( k ) x[n, m] = η[k, k + m n ]} is closed and S-invariant. It is the subshift determined by η.

22 V. Bergelson et al Recall that in Definition. we introduced the Besicovitch pseudo-metric, d B (x, y) := sup ρ(x(n), y(n)) (3.) and defined rationally almost periodic sequences, which are sequences that can be approximated in the d B -pseudo-metric by periodic sequences. Definition 3.. A subshift (X, S) of (A Z, S) is called rational if there exists an RAP sequence η A such that X = X η. n= We now present some examples of rational subshifts. The squarefree subshift. Consider the set Q of squarefree numbers and let X Q := X Q {0, } Z. The resulting topological dynamical system (X Q, S) is called the squarefree subshift and has been studied in [7, 53, 56]. aturally, many combinatorial properties of Q are encoded in the dynamics of (X Q, S), which further motivates the study of this system. This line of investigation is related to Sarnak s conjecture; see [27, 56] and 5.2. B-free subshifts. For B \ {} let F B denote the set of B-free numbers and let X FB := X FB {0, } Z. The system (X FB, S) is called the B-free subshift. Such subshifts have recently been studied in [4, 28, 43]. If the set B is Besicovitch (see Definition 2.4) then it follows from Corollary 2.6 that (X FB, S) is a rational subshift. ote that the squarefree subshift (X Q, S) is an example of a B-free subshift. Toeplitz systems. Following [40], a sequence η A is called Toeplitz, if for each n 0 there is p such that η(n) = η(n + sp) for all s. (3.2) In this case the subshift (X η, S) is called a Toeplitz system. In [24], Downarowicz characterized Toeplitz dynamical systems as being exactly all symbolic, minimal and almost one-to-one extensions of odometers. If additionally sup p d({n : η(n) = η(n + sp) for all s }) = (3.3) then the Toeplitz sequence η is called regular. It follows from (3.3) that any regular Toeplitz sequence is RAP (in fact, it is straightforward to check that a Toeplitz sequence is regular if and only if it is RAP). Therefore Toeplitz systems coming from regular Toeplitz sequences are rational subshifts. Weyl almost periodic sequences and Weyl rational subshifts. the Weyl pseudo-metric d W (see Definition 2.), d W (x, y) = sup sup l {l n l + : x(n) = y(n)}. We recall the definition of

Rationally almost periodic sequences 23 Any d W -it of periodic sequences is called a Weyl rationally almost periodic sequence (WRAP). The subshift (X η, S) determined by a WRAP sequence η A is called W- rational. Each WRAP sequence is RAP and hence any W-rational subshift is a rational subshift. ote that the reverse implication does not hold. For example, the indicator function Q of the squarefree numbers Q is a sequence that is RAP but not WRAP. It should also be mentioned that any regular Toeplitz sequence is WRAP, which can be shown easily using the definition of regular Toeplitz sequences. Sequences generated by synchronized automata. Paperfolding sequences, which were introduced in (see footnote on page 4), provide examples of rational sequences generated by so-called synchronized automata. Let k, let B := {0,,..., k }, let A be a finite alphabet, let Q := {q 0,..., q r } be a finite set, let τ : Q A and let δ : Q B Q. The quintuple M = (Q, B, δ, q 0, τ) is called a complete deterministic finite automaton with set of states Q, input alphabet B, output alphabet A, transition function δ, initial state q 0 and output mapping τ. Let B denote the collection of all finite words in letters from B. There is a natural way of extending δ : Q B Q to δ : Q B Q: for the empty word ɛ B we define δ(q, ɛ) := q, q Q, and for a non-empty word w = w... w n B we define recursively δ(q, w... w n ) := δ(δ(q, w... w n ), w n ), q Q. This way, we can associate to each word w B an element a A via a = τ(δ(q 0, w)). For more details on deterministic finite automata, see [2, 4.]. Given n, we consider its expansion in base k, i.e. n = j 0 ε j k j where ε j B, j 0. In this representation ε j = 0 for all but finitely many j 0. Let j n be the largest index such that ε jn = 0. We then set [n] k := (ε jn, ε jn,..., ε 0 ); note that [n] k B for all n. Definition 3.2. Following [55], we say that a sequence a A is automatic if there exists a complete deterministic finite automaton M as above such that a(n) = τ(δ(q 0, [n] k )) for all n. Definition 3.3. Following [4, Part 4], an automaton M = (Q, B, δ, q 0, τ) is called synchronized if there exists a word w B such that δ(q, w) = δ(q 0, w) for all q Q. In this case, the word w is called a synchronizing word. While not every automatic sequence is RAP, any automatic sequence coming from a synchronized automaton is not only RAP but also WRAP. This result, which we state as a proposition below, has been shown implicitly in [23]. For the sake of completeness, we give a proof of it in 5. W-rational subshifts are a special kind of Weyl almost periodic systems; see [26, 39]. The Thue Morse sequence (which was independently discovered by Thue [59, 60] and Morse [50, 5]) is known to be automatic (see [2]), but it is not RAP as it is a generic point for a measure such that the corresponding dynamical system has no purely discrete spectrum [4]; see Theorem.7 above.