1. Introduction
Given a finite set
$\Omega$, a (two-)coloring of
$\Omega$ is a map
$\chi : \Omega \to \{1, -1\}$, and a partial coloring is a map
$\chi : \Omega \to \{-1, 0, 1\}$. For
$A\subseteq \Omega$, let
$\chi (A) = \sum _{x\in A}\chi (x)$. For a family
$\mathcal {A}$ of subsets of
$\Omega$, the discrepancy of
$\mathcal {A}$ is defined to be
where the minimum is over all colorings of
$\Omega$. The discrepancy measures the guaranteed irregularity of colorings with respect to a set system. Discrepancy theory is a rich area of study, see the books [Reference Alon and SpencerAS16, Reference Beck and ChenBC87, Reference ChazelleCha00, Reference Chen, Srivastav and TravagliniCST14, Reference MatoušekMat99].
In particular, the study of discrepancy of arithmetic progressions has a long history, including notable results of Weyl from 1916 [Reference WeylWey16] and Roth from 1964 [Reference RothRot64]. Let
$[n]:= \{1,2,3,\ldots,n\}$ and
$\mathcal {A}$ be the set of arithmetic progressions in
$[n]$. Using Fourier analysis, Roth [Reference RothRot64] proved that there is an absolute constant
$c > 0$ such that
The exponent
$1/4$ was unexpected, as random colorings suggest that the best exponent might be
$1/2$. Later, improving on a result of Montgomery and Sárközy (see Problem 10 in [Reference Erdös and SárközyES78]), Beck [Reference BeckBec81] proved that Roth's lower bound is sharp up to a polylogarithmic factor. It was a big challenge to remove the polylogarithmic factor and show that Roth's bound is sharp up to a constant factor, and it was finally done by Matoušek and Spencer [Reference Matoušek and SpencerMS96] via entropy and partial coloring methods.
The modular variant is also a very natural problem to study. For a positive integer
$n$, an arithmetic progression in
$\mathbb {Z}_n$ is a set of the form
$\{a + kd: 0\leq k < l\}$ for any
$a, d\in \mathbb {Z}_n$ and
$l\geq 0$. To avoid repeated elements in the set, we may assume that
$l \leq {n}/{\gcd (n, d)}$. Let
$\mathcal {A}_n$ be the set of all arithmetic progressions in
$\mathbb {Z}_n$. The quantity we are interested in is
In the case where
$n=p$ is a prime, the following lower and upper bounds are proved by Hebbinghaus and Srivastav [Reference Hebbinghaus and SrivastavHS14] and Alon and Spencer (Theorem 13.1.1 in [Reference Alon and SpencerAS16]), respectively. There exist positive constants
$c_1, c_2$ such that
Hebbinghaus and Srivastav [Reference Hebbinghaus and SrivastavHS14] wrote that it seemed to be a difficult open problem to close the
$O(\sqrt {\log p})$ multiplicative gap between the upper and lower bounds. As part of our results, we remove the
$\sqrt {\log p}$ factor in the upper bound and resolve the problem of determining
$\operatorname {disc}(\mathcal {A}_p)$ up to a constant factor.
The problem for general
$\mathbb {Z}_n$ is more challenging and interesting. Note that any arithmetic progression in
$[n]$ is also an arithmetic progression in
$\mathbb {Z}_n$, so Roth's lower bound from the integer case also applies. As the number of sets in
$\mathcal {A}_n$ is polynomial in
$n$, considering a random coloring gives the following upper bound (see Theorem 13.1.1 in [Reference Alon and SpencerAS16]). Thus, there are
$c_1,c_2 >0$ such that
Our main theorem asymptotically determines the logarithm of
$\operatorname {disc}(\mathcal {A}_n)$. It shows that
$\operatorname {disc}(\mathcal {A}_n)$ depends heavily on the arithmetic structure of
$n$, and neither of the above bounds are sharp.
Let
$\omega (n)$ be the number of distinct prime factors of
$n$ and
$d(n)$ be the number of divisors of
$n$.
Theorem 1.1 There exists an absolute constant
$c > 0$ such that for any positive integer
$n$,
Note that we have
$2^{\omega (r)}\leq 2^{\omega (n)} \leq d(n) = n^{o(1)}$ (see [Reference Hardy and WrightHW08]). This implies that
where
$x \geq 0$ is the largest real number such that there is no factor of
$n$ in the range
$(n^{ {2}/{3}-x}, n^{{2}/{3} +2x})$. Thus, our results determine the correct exponent of
$n$ for
$\operatorname {disc}(\mathcal {A}_n)$ up to
$o(1)$.
Note that when
$n$ has a bounded number of factors, Theorem 1.1 determines
$\operatorname {disc}(\mathcal {A}_n)$ up to a constant factor. In particular, when
$n$ is prime, we have
$\operatorname {disc}(\mathcal {A}_n) = \Theta (n^{1/2})$, and this solves the problem of Hebbinghaus and Srivastav [Reference Hebbinghaus and SrivastavHS14] discussed earlier.
We actually prove slightly stronger bounds, but we choose the formulation in Theorem 1.1 for simplicity. These stronger bounds give the following sharp bound for
$\operatorname {disc}(\mathcal {A}_n)$ when
$n$ is a prime power.
Theorem 1.2 If
$n = p^k$ for prime
$p$ and positive integer
$k$, then
where
$r_k \in \{0,1,2\}$ is the remainder when
$k$ is divided by
$3$.
Remark 1.3 It is also natural to study the discrepancy problem in the case where the coloring function
$\chi$ is allowed to take any value in the unit circle in the complex plane
$\{z\in \mathbb {C}: |z| = 1\}$. For example, this choice of coloring functions is studied in Tao's [Reference TaoTao16] remarkable solution to the Erdös discrepancy problem. By comparing the definitions of the coloring functions, we know that the discrepancy under the more general choice of
$\chi$ is at most as large as the discrepancy under the choice
$\chi : \mathbb {Z}_n \to \{1,-1\}$. We remark that our proof is robust enough to give the same lower bound on discrepancy when
$\chi$ is under the above choice. See Remark 4.8 for details on how to extend the proof of the lower bound to the more general setting.
Notation 1 Throughout the paper, all logarithms are base
$e$ unless specified otherwise.
We use symbols
$c, c_0, c_1, c_2$, etc. to denote absolute constants. To avoid using too many symbols in different parts of the paper, we reuse these symbols to denote different constants. We make no attempt to optimize constant factors in our results.
We treat elements in
$\mathbb {Z}_n$ as if they are in
$\mathbb {Z}$ in the following ways. For an element
$r\in \mathbb {Z}_n$ and integers
$a, b\in \mathbb {Z}$, we say
$a\leq r \leq b$ if there exists an element
$r'\in \mathbb {Z}$ such that
$a\leq r' \leq b$ and
$r' \equiv r\ (\mathrm {mod}\,n)$. The notation is similar if either
$\leq$ is replaced with <. We typically use it when
$0\leq a \leq b < n$, so this notation should not cause any confusion. For any
$a\in \mathbb {Z}_n$, we may also define
$\gcd (a, n) = \gcd (a', n)$ for any
$a'\in \mathbb {Z}$ with
$a' \equiv a\ (\mathrm {mod}\,n)$. For two nonnegative integers
$a$ and
$b$, we write
$a|b$ if
$a$ divides
$b$. For any factor
$r$ of
$n$ and
$a\in \mathbb {Z}_n$, we say that
$r|a$ if
$r|\gcd (a, n)$.
Organization
In § 2, we derive our first upper bound on
$\operatorname {disc}(\mathcal {A}_n)$ (see Corollary 2.3). The upper bounds in Theorems 1.1 and 1.2 are proved in § 3 (see Theorem 3.1). In § 4, we prove the lower bounds in Theorem 1.1 (Corollary 4.9) and Theorem 1.2 (Corollary 4.10). We end with some concluding remarks and open problems in § 5.
2. The first step towards the upper bounds
We use the following version of a lemma of Matoušek and Spencer [Reference Matoušek and SpencerMS96] to show there is a partial coloring that colors a constant fraction of the elements of a set system with low discrepancy. The proof of this lemma uses the entropy method.
Lemma 2.1 (Section 4.6 [Reference MatoušekMat99])
Let
$(V, C)$ be a set system on
$n$ elements, and let a number
$\Delta _S \geq 2\sqrt {|S|}$ be given for each set
$S\in C$. If
\begin{equation} \sum_{S\in C:S\ne \emptyset} \exp\bigg(-\frac{\Delta_S^2}{4|S|}\bigg) \leq \frac{n}{50}, \end{equation}
then there is a partial coloring
$\chi$ that assigns
$\pm 1$ to at least
$n/10$ variables (and
$0$ to the rest) satisfying
$|\chi (S)| \leq \Delta _S$ for each
$S\in C$.
The following lemma shows that there is a partial coloring of a constant fraction of any subset
$X$ of
$\mathbb {Z}_n$ such that modular arithmetic progressions have low discrepancy. The proof utilizes the previous lemma applied to a special family of intersections of
$X$ with modular arithmetic progressions. Each set in this special family has size a power of two. We show that any set which is an intersection of
$X$ with a modular arithmetic progression can be written as the union of two sets, and each of them is a set difference of two sets that each has a canonical decomposition into sets of different sizes from this special family. We obtain the lemma by putting these together and using the triangle inequality.
Lemma 2.2 Let
$X\subseteq \mathbb {Z}_n$ be a set of size
$m > 0$. There exists a partial coloring
$\chi : X\to \{-1, 0, 1\}$ that assigns
${\pm }1$ to at least
$m/10$ elements in
$X$ such that
\[ \max_{A\in \mathcal{A}_n}|\chi(A\cap X)| \leq 200m^{1/2}\bigg(\log \frac{en}{m}\bigg)^{{1}/{2}}. \]
Proof. Let
$\operatorname {AP}_n(a, d, i, j) := \{a+kd: i\leq k \leq j\}$ where
$a, d\in \mathbb {Z}_n$ and
$i, j\in \mathbb {Z}$. By definition,
Consider the following decomposition of sets in
$\mathcal {A}_n$. Let
Now we show that any set
$A\in \mathcal {A}_n$ can be written as the disjoint union of at most two sets in
$C_1$. For any set
$A = \operatorname {AP}_n(a, d, 0, l-1)$ with
$a, d\in \mathbb {Z}_n$ and
$0\leq l \leq {n}/{\gcd (n, d)}$, we may assume that
$l > 0$, or otherwise it is an empty set. If
$d = 0$, then the set is the singleton
$\{a\}$, which is also
$\operatorname {AP}_n(0, 1, a, a)\in C_1$ by choosing
$i, j$ to be the integer representative of
$a$ in the range
$[0, n)$. Now we may assume
$1 \leq d < n$. Note that
$\{kd: 0\leq k < {n}/{\gcd (n, d)}\}$ splits
$\mathbb {Z}_n$ into
${n}/{\gcd (n, d)}$ equal-sized intervals, so there is some
$0\leq k < {n}/{\gcd (n, d)}$ such that
$0\leq a - kd < \gcd (n, d)$. Define
$a' = a - kd$, and we have
Moreover, we have
$k < {n}/{\gcd (n, d)}$ and
$l -1 < {n}/{\gcd (n, d)}$, so
$0\leq k+l-1 < 2( {n}/{\gcd (n, d)})$. If
$k+l-1 < {n}/{\gcd (n, d)}$, then
$\operatorname {AP}_n(a', d, k, k+l-1)\in C_1$. If
$k + l-1\geq {n}/{\gcd (n, d)}$, then we may write
Hence, we know that for any partial coloring
$\chi : \mathbb {Z}_n \to \{-1, 0, 1\}$, we always have
Now we study the sets in
$C_X := \{A\cap X: A\in C_1\}$. By definition, we have
For each
$1\leq d < n$ and
$0\leq a < \gcd (n, d)$, we define
$A_{d, a} = \{a+kd: 0\leq k < {n}/{\gcd (d, n)}\}$, and define
$X_{d, a} = A_{d, a}\cap X$. As each element
$x$ in
$X_{d, a}$ is associated with an integer
$0\leq k < {n}/{\gcd (d, n)}$ via the relation
$x = a+kd$, we may order elements in
$X_{d, a}$ in ascending order of
$k$. We write
$X_{d, a} = \{x_{d, a}^{(1)}, \ldots, x_{d, a}^{(l_{d, a})}\}$, where
$l_{d, a} = |X_{d, a}|$. For integers
$i$ and
$j$, we define
$X_{d, a}(i, j) = \{x_{d, a}^{(t)}: i \leq t \leq j\}$.
For each
$d\in \mathbb {Z}_n$, because each element of
$\mathbb {Z}_n$ is in exactly one
$A_{d, a}$ for
$0\leq a < \gcd (d, n)$, we have
\begin{equation} \sum_{a = 0}^{\gcd(d, n) - 1}l_{d, a} = \sum_{a = 0}^{\gcd(d, n) - 1}|X\cap A_{d, a}| = |X| = m. \end{equation} For
$A = \operatorname {AP}_n(a, d, i, j)$, if we take
$i'$ to be the smallest index such that
$x_{d, a}^{(i')} = a + k_1d$ with
$k_1 \geq i$ (or
$l_{d, a}+1$ if no such index with
$0\leq k_1 < {n}/{\gcd (d, n)}$ exists), and
$j'$ to be the largest index such that
$x_{d, a}^{(j')} = a+k_2d$ with
$k_2 \leq j$ (or
$0$ if no such index with
$0\leq k_2 < {n}/{\gcd (d, n)}$ exists), then we have
$A\cap X = X_{d, a}(i', j')$. Hence, each nonempty set in
$C_X$ is of the form
$X_{d, a}(i, j)$ with
$1\leq i \leq j \leq l_{d, a}$. Therefore, we may write
Now we further decompose sets in
$C_X$ into canonical sets. Formally,
Note that each set
$S\in C_X$ can be written as
$U\setminus V$ with
$V\subseteq U$ where both
$U$ and
$V$ can be written as the disjoint union of sets in
$C_2$ of different sizes. This is trivially true for the empty set. For
$S = X_{d, a}(i, j)$, we may take
$U = X_{d, a}(1, j)$ and
$V = X_{d, a}(1, i-1)$. If we write
$j$ in binary form
$2^{b_1} + 2^{b_2} + \cdots + 2^{b_s}$ for
$b_1 > b_2 > \cdots > b_s$, then
$U$ is the disjoint union of sets of the form
$X_{d, a}(1+\sum _{k = 1}^{h-1}2^{b_k}, \sum _{k = 1}^{h}2^{b_k})$ for
$h = 1, \ldots, s$. We can decompose
$V$ similarly.
Note that sets in
$C_2$ are all of size
$2^i$ for
$2^i \leq m$. If
$\chi : X\to \{-1, 0, 1\}$ is such that for all
$0\leq i\leq \log _2 m$ we have
$\chi (S) \leq \Delta _i$ for any set
$S\in C_2$ of size
$2^i$, then by using the decomposition property above we have
For each
$i$, we upper bound the number of sets in
$C_2$ of size
$2^i$ as following. For each
$1\leq d < n$ and
$0\leq a < \gcd (d, n)$, the number of choices of
$t$ in (2.5) is
$\lfloor {l_{d, a}}/{2^i}\rfloor$. By (2.4) the number of such sets is at most
\begin{equation} \sum_{d=1}^{n-1}\sum_{a = 0}^{\gcd(d, n) - 1} \bigg\lfloor\frac{l_{d, a}}{2^i}\bigg\rfloor \leq \sum_{d=1}^{n-1}\sum_{a = 0}^{\gcd(d, n) - 1} \frac{l_{d, a}}{2^i} = \frac{(n-1)m}{2^i}. \end{equation} Now we define
$b(0) = 0$ and for
$0 < s \leq n$,
\begin{equation} b(s) = 5\sqrt{s} \bigg(\log \frac{en}{s}\bigg)^{1/2}. \end{equation}
From the definition, we know that
$b(s) \geq 2\sqrt {s}$ for all
$s\in \mathbb {N}$. We want to show that there exists a partial coloring
$\chi$ that colors at least
$m/10$ elements in
$X$, and for any
$S\in C_2$,
In order to apply Lemma 2.1 to
$X$ and
$C = C_2$, it remains to check that
\begin{equation} \sum_{S\in C_2} \exp\bigg(-\frac{b(|S|)^2}{4|S|}\bigg) \leq m/50. \end{equation}
From the definition of
$b(\cdot )$ in (2.8), we know that
\begin{equation} \sum_{S\in C_2} \exp\bigg(-\frac{b(|S|)^2}{4|S|}\bigg) = \sum_{S\in C_2}e^{-{25}/{4}}\cdot \bigg(\frac{|S|}{n}\bigg)^{{25}/{4}} \leq e^{-6}\cdot\sum_{S\in C_2}\bigg(\frac{|S|}{n}\bigg)^2. \end{equation}Using the bound in (2.7), we have
\[ \sum_{S\in C_2} \bigg(\frac{|S|}{n}\bigg)^{2} \leq \sum_{0\leq i \leq \log_2 m} \frac{(n-1)m}{2^i} \bigg(\frac{2^i}{n}\bigg)^2 \leq 2m. \]
Put this into (2.11). We obtain
\[ \sum_{S\in C_2} \exp\bigg(-\frac{b(|S|)^2}{4|S|}\bigg) \leq e^{-6}\cdot 2m \leq m/50. \]
This shows that (2.10) holds. By Lemma 2.1, we conclude that there exists a partial coloring
$\chi : X\to \{-1, 0, 1\}$ that assigns
$\pm 1$ to at least
$m/10$ elements, and (2.9) holds for any
$S\in C_2$. Thus, in (2.6) we may take
$\Delta _i = b(2^i)$ for
$0\leq i \leq \log _2 m$.
It remains to show that
$\chi$ satisfies the desired property. By (2.2), (2.3), and (2.6),
\[ \max_{A\in \mathcal{A}_n}|\chi(A\cap X)| \leq 4\sum_{0\leq i\leq \log_2 m}b(2^i) = 20 \sum_{i = 0}^{\lfloor{\log_2 m}\rfloor} 2^{i/2}\bigg(\log \frac{en}{2^i}\bigg)^{1/2} \leq 200\cdot \sqrt{m}\bigg(\log \frac{en}{m}\bigg)^{1/2}. \]
To obtain the last inequality, observe that the sum is roughly a geometric series with ratio
$2^{1/2}$ (although there is an extra logarithmic factor that slightly complicates this) and can be bounded by a constant factor times the largest term. A careful analysis gives the claimed bound.
Hence, the partial coloring
$\chi$ satisfies the desired inequality.
Corollary 2.3 Let
$X\subseteq \mathbb {Z}_n$ be a set of size
$m > 0$. There exists an absolute constant
$c$ such that there is a coloring
$\chi : X\to \{-1, 1\}$ satisfying
\[ \max_{A\in \mathcal{A}_n}|\chi(A\cap X)| \leq cm^{1/2}\bigg(\log \frac{en}{m}\bigg)^{ 1/2}. \]
In particular, for
$X= \mathbb {Z}_n$, we have
Proof. The main idea is to iteratively apply Lemma 2.2 to the set of uncolored elements of
$X$ until all elements of
$X$ are colored.
Start with
$X_0 = X$. For each
$i\geq 0$, we apply Lemma 2.2 to
$X_i$ to get a partial coloring
$\chi _i: X_i \to \{-1, 0, 1\}$, and we let
$X_{i+1} = \chi _i^{-1}(0) \subseteq X_i$ to be the set of uncolored elements in
$i$th iteration. We continue this process until the
$k$th iteration where all elements are colored (i.e.
$X_{k+1} = \emptyset$). Let
$\chi$ be the final coloring given by
$\chi (x_i) = \chi _i(x_i)$ if
$x_i\in X_i\setminus X_{i+1}$ for
$0\leq i\leq k$. We know that
$|X_i| \leq 0.9|X_{i-1}|$ for all
$1\leq i\leq k$, so
$|X_i| \leq (0.9)^i|X_0| = (0.9)^im$. Moreover, we know that for any
$A\in \mathcal {A}_n$, noting that
$x^{1/2}\cdot (\log {en}/{x})^{1/2}$ is monotonically increasing for real number
$x \in (0, n]$,
\begin{align*} |\chi(A\cap X)| &= \bigg|\sum_{i=0}^k \chi_i(X_i\cap A)\bigg| \leq \sum_{i=0}^k |\chi_i(X_i\cap A)| < \sum_{i=0}^k 200\cdot |X_i|^{1/2}\bigg(\log\frac{n}{e|X_i|}\bigg)^{1/2} \\ &\leq 200m^{1/2}\cdot \sum_{i=0}^k (0.9)^{i/2} \bigg(\log\frac{en}{(0.9)^im}\bigg)^{ 1/2} < cm^{1/2}\bigg(\log\frac{en}{m}\bigg)^{1/2} \end{align*}
for some appropriate choice of the absolute constant
$c$.
3. Upper bounds
By Corollary 2.3, we have
$\operatorname {disc}(\mathcal {A}_n) = O(\sqrt {n})$. In this section, we prove the following upper bound on the same quantity, which shows that the previous bound is not always tight, and that
$\operatorname {disc}(\mathcal {A}_n)$ depends on the factorization of
$n$. Recall that
$\omega (r)$ denotes the number of distinct prime factors of
$r$.
Theorem 3.1 There exists an absolute constant
$c> 0$ such that for any positive integer
$n$, we have
The proof of Theorem 3.1 consists of two steps. The first key step is to establish an upper bound on
$\operatorname {disc}(\mathcal {A}_n)$ using a coloring of
$\mathbb {Z}_r$ where
$r$ divides
$n$ that simultaneously has low discrepancy with respect to two particular families of arithmetic progressions in
$\mathbb {Z}_r$. This is achieved by Lemma 3.2. To accomplish this, we need to introduce a special type of arithmetic progression in
$\mathbb {Z}_n$. Recall that
$\mathcal {A}_n$ is the set of all arithmetic progressions in
$\mathbb {Z}_n$. We define
$\mathcal {A}_n^0$ to be the set of all congruence classes of
$\mathbb {Z}_n$. Formally, for any
$r, i\in \mathbb {Z}_n$, let
and
In particular, we know that
$\mathcal {A}_n^0 \subseteq \mathcal {A}_n$. In Lemma 3.2 we obtain an upper bound on
$\operatorname {disc}(\mathcal {A}_n)$ if there is an
$r$ that divides
$n$ and a coloring
$\chi$ of
$\mathbb {Z}_r$ that has low discrepancy over both
$\mathcal {A}_r$ and
$\mathcal {A}_r^0$.
The second step is to find a coloring of
$\mathbb {Z}_r$ which has nearly optimal discrepancy over
$\mathcal {A}_r$ and
$\mathcal {A}_r^{0}$ simultaneously. Finally, we complete the proof by applying Lemma 3.2 with this coloring of
$\mathbb {Z}_r$.
Lemma 3.2 Let
$n$ be a positive integer and
$r$ be a positive factor of
$n$. For any
$\chi : \mathbb {Z}_r\to \{1, -1\}$,
Proof. Let
$m = n/r$. For the subgroup
$(m) \subseteq \mathbb {Z}_n$, we have a quotient map
$\tau : \mathbb {Z}_n \to \mathbb {Z}_n/(m) = \mathbb {Z}_r$ given by
$\tau (x)= \overline {x} = x+(m)$. Suppose we are given an arbitrary
$\chi : \mathbb {Z}_r \to \{1, -1\}$. Now we define
$\chi ' = \chi \circ \tau : \mathbb {Z}_n\to \{1, -1\}$. It suffices to show
Let
$A' = \{a + kd: 0\leq k < L\}$ for some
$a, d\in \mathbb {Z}_{n}$ be an arithmetic progression in
$\mathbb {Z}_{n}$ of length
$L$. We may assume that
$L \leq n/{\gcd (d, n)}$ so that there is no repeated element in
$A'$.
Let
$L_0 = r/\gcd (r, \overline {d})$ where
$\overline {d} = \tau (d)$. For any integer
$t > 0$, we know that
$\{\overline {a} + k\overline {d}: t \leq k < t+L_0\}$ is a set of size
$L_0$ in
$\mathcal {A}^0_r$, as it covers each element in the congruence class exactly once. For any
$0\leq l < L_0$, as the set
$\{\overline {a} + k\overline {d}: t \leq k < t+l\}$ has no repeated element, it is a set of size
$l$ in
$\mathcal {A}_r$.
Now we may write
$L = qL_0 + r$ for some integers
$q$ and
$0\leq r < L_0$. We know that
Applying the triangle inequality, we obtain
\begin{align*} |\chi'(A')| &= \bigg|\sum_{k = 0}^{L-1}\chi'(a+kd)\bigg| = \bigg|\sum_{k = 0}^{L-1}\chi(\overline{a}+k\overline{d})\bigg| = \bigg|\sum_{t = 0}^{q-1}\sum_{k = tL_0}^{(t+1)L_0-1}\chi(\overline{a}+k\overline{d}) + \sum_{k = qL_0}^{qL_0 + r-1}\chi(\overline{a}+k\overline{d})\bigg| \\ &\leq \sum_{t = 0}^{q-1}\bigg|\sum_{k = tL_0}^{(t+1)L_0-1}\chi(\overline{a}+k\overline{d})\bigg| + \bigg|\sum_{k = qL_0}^{qL_0 + r-1}\chi(\overline{a}+k\overline{d})\bigg| \\ &\leq q \cdot \max_{A_0\in \mathcal{A}_r^0}|\chi(A_0)| + \max_{A\in \mathcal{A}_r}|\chi(A)| \leq m\cdot \max_{A_0\in \mathcal{A}_r^0}|\chi(A_0)| + \max_{A\in \mathcal{A}_r}|\chi(A)|. \end{align*}
As the bound is uniform for all
$A'\in \mathcal {A}_{n}$, we conclude that (3.1) holds.
After the described deduction, the second step is to find a coloring
$\chi : \mathbb {Z}_n \to \{1, -1\}$ that has nearly optimal discrepancy over
$\mathcal {A}_n$ and
$\mathcal {A}_n^0$ simultaneously. Formally, we have the following statement.
Lemma 3.3 There exists an absolute constant
$c > 0$ such that the following holds. Suppose that
$n$ is a positive integer with
$k$ distinct prime factors. Then there exists
$\chi : \mathbb {Z}_n \to \{1, -1\}$ such that
We can now deduce Theorem 3.1 from the above two steps.
Proof Proof of Theorem 3.1 assuming Lemma 3.3
For any positive factor
$r$ of
$n$, by Lemma 3.3, there is a coloring
$\chi$ of
$\mathbb {Z}_r$ such that
where
$c$ is an absolute constant. Then applying Lemma 3.2, we conclude that
As this holds for all positive factors
$r$ of
$n$, the desired result follows.
It remains to prove Lemma 3.3. We first present a proof of the case that
$n$ is a prime power. The proof of this case is simpler and illustrates the main ideas in the proof of Lemma 3.3.
Lemma 3.4 There exists absolute constant
$c > 0$ such that the following holds. Let
$n = p^\alpha$ for some prime
$p$ and positive integer
$\alpha$. Then there exists
$\chi : \mathbb {Z}_n \to \{1, -1\}$ such that
To find a coloring with low discrepancy over
$\mathcal {A}_n^{0}$, the main idea is to color simultaneously two disjoint subsets
$S_1$ and
$S_2$ of
$\mathbb {Z}_n$ that are translations of each other, and we hope that
$\chi (S_1\cap A_0)$ and
$\chi (S_2\cap A_0)$ cancel out for many
$A_0\in \mathcal {A}_n^0$. The
$c\sqrt {n}$ upper bound on the discrepancy over
$\mathcal {A}_n$ in Lemma 3.4 is achieved via Corollary 2.3. We first derive the following lemma that gives a desired coloring for a subset
$X$ of
$\mathbb {Z}_n$, provided that
$X$ is an initial interval of some special length.
Lemma 3.5 There exists absolute constant
$c > 0$ such that the following holds. Let
$n = p^\alpha$ for some prime
$p$ and positive integer
$\alpha$. Suppose that
$X = \{0, \dots, m-1\}\subseteq \mathbb {Z}_n$ for some
$m\leq n$ satisfies that
$m = sp^\beta$ with
$s$ even and
$\beta$ being a nonnegative integer. Then there exists
$\chi : X\to \{1,-1\}$ such that
\[ \max_{A\in \mathcal{A}_n}|\chi(A\cap X)| \leq c\sqrt{m}\bigg(\log\frac{en}{m}\bigg)^{1/2}, \]
and for any
$w\in \mathbb {Z}_n$ and
$r = p^\gamma$ with
$0\leq \gamma \leq \beta$,
Proof. Let
$S = \{0, \ldots, m/2-1\}$. By Corollary 2.3, there is
$\chi _0:X\to \{1, -1\}$ such that
\[ |\chi_0(A\cap S)| \leq c_0\sqrt{\frac{m}{2}}\bigg(\log \frac{2en}{m}\bigg)^{ 1/2}, \]
holds for any
$A\in \mathcal {A}_n$, where
$c_0$ is an absolute constant. We know that
$X$ is the disjoint union of
$S$ and
$S+{m}/{2}$, i.e. each element
$x\in X$ is of the form
$x = s + v({m}/{2})$ for some
$s\in S$ and
$v\in \{0, 1\}$. We define
$\chi : X \to \{1, -1\}$ given by
$\chi (s+v ({m}/{2})) = (-1)^v\cdot \chi _0(s)$ for any
$s\in S$ and
$v\in \{0, 1\}$.
For any
$A\in \mathcal {A}_n$, noting that
$A - {m}/{2}$ is also an arithmetic progression,
\begin{align*} |\chi(A\cap X)| &=
|\chi(A\cap S) + \chi(A\cap (S+m/2))| = |\chi_0(A\cap S) +
(-1)\cdot \chi_0((A-m/2)\cap S)|\\ &\leq |\chi_0(A\cap S)|
\,{+}\, |\chi_0((A-m/2)\cap S)| \,{\leq}\, 2\cdot c_0
\sqrt{\frac{m}{2}}\bigg(\log \frac{2en}{m}\bigg)^{1/2} \,{\leq}\, c\sqrt{m}\bigg(\log \frac{en}{m}\bigg)^{1/2},
\end{align*}
where
$c$ is an absolute constant. Next we verify that for any
$r = p^{\gamma }$ with
$\gamma \leq \beta$ and any
$w\in \mathbb {Z}_n$,
$\chi (C(r, w) \cap X) = 0$. Note that
$m/2$ is a multiple of
$r$, so
$C(r, w) - m/2 = C(r, w)$. Hence, we have
We have thus shown the existence of such a coloring
$\chi$ with the desired properties.
In the case
$n = p^{\alpha }$, we partition
$\mathbb {Z}_n$ into a few sets, each being an interval of
$\mathbb {Z}_n$ of length an even number times a power of
$p$ as in Lemma 3.5.
Proof of Lemma 3.4 Note that for any
$C(r, w)\in \mathcal {A}_n^0$, we have
$C(r, w) = C(\gcd (r, n), w)$. Hence, it suffices to check
$|\chi (C(r, w))| \leq 1$ where
$r$ divides
$n = p^\alpha$, i.e.
$r = p^\gamma$ for some nonnegative
$\gamma \leq \alpha$.
Let
$c_0$ be the constant in Lemma 3.5.
If
$p = 2$, we can take
$m = n = 2\cdot 2^{\alpha -1}$ in Lemma 3.5. Thus, there exists
$\chi : \mathbb {Z}_n\to \{1, -1\}$ such that
and that for any
$w\in \mathbb {Z}_n$ and any
$r = 2^{\gamma }$ with
$\gamma \leq \alpha -1$,
$\chi (C(r, w)) = 0$. This means that, for any
$r = 2^\gamma$, if
$\gamma \leq \alpha -1$, then
$\chi (C(r, w)) = 0$; if
$\gamma = \alpha$, then
$C(r, w)$ contains a single element
$w$, so
$|\chi (C(r, w))| = 1$ in this case. We conclude that
If
$p > 2$ is an odd prime, then we partition
$\mathbb {Z}_n$ into a few intervals:
$X_0 = \{0\}, X_i = \{x: p^{i-1} \leq x < p^i\}$ for
$1\leq i\leq \alpha$. Note that for each
$i\geq 1$,
$X_i$ is an interval of length
$(p-1)\cdot p^{i-1}$. We would like to apply Lemma 3.5 to each
$X_i$ for
$i\geq 1$. It is applicable because the property is maintained by translation. Therefore, for each
$1\leq i\leq \alpha$ there is a coloring
$\chi _i: X_i\to \{1, -1\}$ such that
\[ \max_{A\in \mathcal{A}_n} |\chi_i(A\cap X_i)| \leq c_0\sqrt{(p-1)\cdot p^{i-1}} \bigg(1 + \log\frac{p^\alpha}{(p-1)\cdot p^{i-1}}\bigg)^{{1}/{2}}, \]
and for each
$w\in \mathbb {Z}_n$ and
$r = p^\gamma$ with
$\gamma \leq i-1$, we have
$\chi _i(C(r, w)\cap X_i) = 0$.
For
$X_0$ we may take any arbitrary
$\chi _0: X_0 \to \{1, -1\}$. Note that
$X_0 = \{0\}$ contains only one element, so
$|\chi _0(A\cap X_0)| \leq 1$ for all
$A\subseteq \mathbb {Z}_n$.
As
$\mathbb {Z}_n = \coprod _{i = 0}^{\alpha }X_i$, we define
$\chi : \mathbb {Z}_n\to \{1, -1\}$ such that
$\chi (x_i) = \chi _i(x_i)$ for all
$0\leq i\leq \alpha$ and
$x_i\in X_i$. Consequently, we know that for each
$A \in \mathcal {A}_n$,
\[ |\chi(A)| \le \sum_{i = 0}^\alpha |\chi_i(A\cap X_i)| \leq 1 + \sum_{i = 1}^\alpha c_0\sqrt{(p-1)\cdot p^{i-1}} \bigg(1 + \log\frac{p^\alpha}{(p-1)\cdot p^{i-1}}\bigg)^{{1}/{2}} \leq c\sqrt{n} \]
for some appropriate constant
$c$. Moreover, for each
$C(r, w) \in \mathcal {A}_n^0$, we may assume that
$r = p^\gamma$ for some
$0\leq \gamma \leq \alpha$ and it gives that
\[ \chi(C(r, w)) = \chi\bigg(C(r, w) \cap \bigg(\bigcup_{i=0}^{\gamma} X_i\bigg)\bigg) + \sum_{i = \gamma+1}^{\alpha}\chi_i(C(r, w)\cap X_i). \]
Now, for each
$i \geq \gamma +1$, i.e.
$\gamma \leq i-1$, we have
$\chi _i(C(r, w)\cap X_i) = 0$. In addition, note that
$\bigcup _{i=0}^{\gamma } X_i$ is
$\{x: 0\leq x < p^\gamma \}$, so there is exactly one element of
$C(r, w)$ in it. Hence,
\[ |\chi(C(r, w))| = \bigg|\chi\bigg(C(r, w) \cap \bigg(\bigcup_{i=0}^{\gamma} X_i\bigg)\bigg)\bigg| = 1. \]
Thus, we may conclude that
Hence, for both
$p = 2$ and
$p$ is odd, we can always find such a coloring
$\chi$.
Finally, we extend the argument to arbitrary
$n$ using the Chinese remainder theorem.
Notation 2 Suppose that number
$n$ has prime factorization
$n = p_1^{\alpha _1}\cdots p_k^{\alpha _k}$. By Chinese remainder theorem, we have an isomorphism
Again, we first show the following analogue of Lemma 3.5. This shows that if
$X\subseteq \mathbb {Z}_n$ has some special structure, then we have a coloring of
$X$ with low discrepancy with respect to both
$\mathcal {A}_n$ and
$\mathcal {A}_n^0$.
Lemma 3.6 Let
$n$ be a positive integer with prime factorization
$n = p_1^{\alpha _1}\cdots p_k^{\alpha _k}$. For each
$1\leq i\leq k$, let
$T_i \leq p_i^{\alpha _i}$ be a positive integer. Let
$X = \{\psi _n(t_1, \ldots, t_k): 0\leq t_i < T_i\ \mathrm {for\ all}\ 1\leq i\leq k\}$. Then
$X\subseteq \mathbb {Z}_n$ is a set of
$m = \prod _{i=1}^k T_i$ elements. Suppose that
$I\subseteq [k]$ is a subset of indices and
$(\beta _i)_{i\in I}$ is a sequence of nonnegative integers, such that for each
$i\in I$,
$T_i = s_ip_i^{\beta _i}$ for some even number
$s_i$. Then there exists a coloring
$\chi : X\to \{-1, 1\}$ such that the following holds. Its discrepancy over
$\mathcal {A}_n$ satisfies that
\begin{equation} \max_{A\in \mathcal{A}_n} |\chi(A\cap X)| \leq c2^{{|I|}/{2}}\cdot \sqrt{m}\bigg(|I|+1+\log\frac{n}{m}\bigg)^{{1}/{2}}, \end{equation}
and for any
$w\in \mathbb {Z}_n$ and any
$i\in I$,
Proof. Let
$L = |I|$. Let
$S_i = T_i/2$ if
$i\in I$, and
$S_i = T_i$ otherwise. For each
$i\in I$, from the condition that
$T_i/p_i^{\beta _i}$ is even, we know that
$S_i$ is a multiple of
$p_i^{\beta _i}$. We define
We know that
$X_0\subseteq \mathbb {Z}_n$ is a set of size
$m/2^L$. Next we apply Corollary 2.3 to get the constant
$c_0>0$ and a partial coloring of
$\chi _0: X_0 \to \{-1, 1\}$ such that
\[ \max_{A\in \mathcal{A}_n} |\chi_0(X_0\cap A)| \leq c_0\sqrt{\frac{m}{2^{L}}} \bigg(1+\log\frac{2^{L}n}{m}\bigg)^{1/2} \leq c\sqrt{\frac{m}{2^{L}}} \bigg(L+1+\log\frac{n}{m}\bigg)^{1/2}, \]
where
$c$ is another absolute constant.
For each
$v = (v_i)_{i\in I} \in \{0, 1\}^{I}$ (binary tuples of length
$L$ indexed by
$I$), we define
$\operatorname {sgn}(v) = (-1)^{\sum _{i\in I}v_i}$, and let
$u_v\in \mathbb {Z}_n$ be the unique element, by the Chinese remainder theorem, such that
Thus, we have the decomposition of
$X$ into disjoint copies of translations of
$X_0$:
This implies that each
$x\in X$ can be written in the form
$x = u_v + x_0$ for some
$v\in \{0, 1\}^I$ and
$x_0\in X_0$. Now we define
$\chi : X\to \{1, -1\}$ by
$\chi (u_v+x_0) = \operatorname {sgn}(v)\cdot \chi (x_0)$ for all
$v\in \{0, 1\}^I, x_0\in X_0$. For any
$A\in \mathcal {A}_n$, noting that
$A- u_v$ is also in
$\mathcal {A}_n$, so
\begin{align*} |\chi(X\cap A)| &= \bigg|\sum_{v\in \{0, 1\}^I} \chi(X_v\cap A)\bigg| = \bigg|\sum_{v\in \{0, 1\}^I} \operatorname{sgn}(v)\cdot \chi_0(X_v\cap A - u_v)\bigg| \\ &\leq \sum_{v\in \{0, 1\}^I} |\chi_0(X_0\cap (A - u_v))| \leq 2^L\max_{A\in \mathcal{A}_n} |\chi_0(X_0\cap A)| \\ &\leq 2^L \cdot c\sqrt{\frac{m}{2^L}} \bigg(L+1+\log\frac{n}{m}\bigg)^{1/2} = c2^{{L}/{2}}\cdot \sqrt{m}\bigg(L+1+\log\frac{n}{m}\bigg)^{{1}/{2}}. \end{align*}
This shows that the coloring
$\chi$ satisfies the condition (3.2) on the discrepancy over
$\mathcal {A}_n$.
It remains to show (3.3). For each
$i\in I$, let
$r_i = n/p_i^{\alpha _i - \beta _i} = p_1^{\alpha _1}\cdots p_i^{\beta _i} \cdots p_k^{\alpha _k}$. For any
$i\in I$ and any
$w\in \mathbb {Z}_n$, we know that
$C(r_i, w)$ contains
$p^{\alpha _i - \beta _i}$ elements. If
$C(r_i, w)\cap X = \emptyset$, then (3.3) trivially holds. It suffices to check
$\chi (C(r_i, w)\cap X) = 0$ for
$w = \psi _n(t_1,\ldots, t_k)\in X_v$ for some
$v\in \{0, 1\}^I$. As
$p_j^{\alpha _j}$ divides
$r_i$, each element in
$C(r_i, w)$ is congruent to
$t_j$ mod
$p_j^{\alpha _j}$ for
$j\ne i$. This implies that
$C(r_i, w)$ only has nonempty intersection with
$X_v$ and
$X_{v'}$ where
$v, v'\in \{0, 1\}^I$ differ only at the entry indexed by
$i$. Moreover, by the definition of
$u$,
$u_v - u_{v'}$ is congruent to
$0$ mod
$p_j^{\alpha _j}$ for all
$j\ne i$, and is congruent to
$\pm ({s_i}/{2})p_i^{\beta _i}$ mod
$p_i^{\alpha _i}$. Thus,
$u_v - u_{v'}$ is a multiple of
$r_i$, which implies
$C(r_i, w) = C(r_i, w) + (u_v - u_{v'})$ or, equivalently
$C(r_i, w) - u_v = C(r_i, w) - u_{v'}$. Therefore, we have
This is true for all
$i\in I$ and
$w\in \mathbb {Z}_n$, and thus we conclude that
$\chi$ satisfies (3.3) as well.
We are now ready to prove Lemma 3.3. The idea is that we partition
$\mathbb {Z}_n$ into a few subsets, one for each factor
$r$ of
$n$, and for each of them we use Lemma 3.6 to get a coloring of this subset with low discrepancy over
$\mathcal {A}_n$ and nearly optimal discrepancy over
$\mathcal {A}_n^0$. Finally we show that the full coloring we get from combining these subset colorings satisfies the properties.
Proof of Lemma 3.3 Suppose that
$n$ has prime factorization
$n = p_1^{\alpha _1}\cdots p_k^{\alpha _k}$. For each
$1\leq i\leq k$, we partition
$\mathbb {Z}_{p_i^{\alpha _i}}$ into
$\alpha _i+1$ intervals
$(S^{(t)}_{i})_{t=0}^{\alpha _i}$ in the following way. If
$p_i = 2$, then we set
$S_i^{(\alpha _i)} = \mathbb {Z}_{p_i^{\alpha _i}}$ and
$S_i^{(t)} = \emptyset$ for all
$0\leq t < \alpha _i$. If
$p_i > 2$, then we set
$S_i^{(0)} = \{0\}\subseteq \mathbb {Z}_{p_i^{\alpha _i}}$ and
$S_i^{(t)} = \{x:p_i^{t-1}\leq x < p_i^t\}$ for
$1\leq t\leq \alpha _i$. In particular, we have
$|S^{(t)}_i| \leq p_i^{t}$ for all
$i$ and
$t$. Moreover, for each
$i$ and
$t > 0$,
$S_i^{(t)}$ is always an interval of length
$s_ip_i^{t-1}$ in
$\mathbb {Z}_{p_i^{\alpha _i}}$ for some even
$s_i$.
For each factor
$r = p_1^{\delta _1}\cdots p_k^{\delta _k}$ of
$n$, we define
$Y_r = S_1^{(\delta _1)}\times \cdots \times S_k^{(\delta _k)}\subseteq \mathbb {Z}_{p_1^{\alpha _1}}\times \cdots \times \mathbb {Z}_{p_k^{\alpha _k}}$ and
$X_r = \psi _n(Y_r) \subseteq \mathbb {Z}_n$. As each
$\mathbb {Z}_{p_i^{\alpha _i}}$ is partitioned into
$S_i^{(t)}$ for
$0\leq t \leq \alpha _i$, their product is partitioned into
$Y_r$ as
$r$ ranges over all positive divisors of
$n$, so
$\mathbb {Z}_n$ is partitioned into
$X_r$ as
$r$ ranges over all positive divisors of
$n$. Because
$|S^{(t)}_i| \leq p_i^{t}$ for all
$i$ and
$t$,
\begin{equation} |X_r| = |Y_r| = \prod_{i = 1}^k |S_i^{(\delta_i)}| \leq \prod_{i = 1}^k p_i^{\delta_i} = r. \end{equation}
For each nonempty
$X_r$ with
$r = p_1^{\delta _1}\cdots p_k^{\delta _k}$, we would like to apply Lemma 3.6 to get a coloring of
$X_r$ with bounded discrepancy. Note that we can translate
$Y_r$ so that all intervals
$S_j^{(\delta _j)}$ for
$1\leq j\leq k$ start at
$0$, and note those properties from Lemma 3.6 are invariant under translation, so it is applicable to
$X_r$. Let
$I_r = \{i\in [k]: \delta _i > 0\}\subseteq [k]$. We have that for each
$i\in I_r$,
$S_i^{(\delta _i)}$ is an interval of length
$s_ip_i^{\beta _i}$ for some even
$s_i$ and
$\beta _i = \delta _i - 1$. This implies that we can find a partial coloring
$\chi _r: X_r\to \{-1, 1\}$ such that
\begin{equation} \max_{A\in \mathcal{A}_n}|\chi_r(A\cap X_r)| \leq c_02^{{|I_r|}/{2}}\sqrt{|X_r|} \bigg(|I_r| + 1 + \log\frac{n}{|X_r|}\bigg)^{{1}/{2}}, \end{equation}
and for any
$i\in I_r$ and any
$w\in \mathbb {Z}_n$,
Having defined
$\chi _r$ as above for each nonempty
$X_r$, we now construct
$\chi$ by setting
$\chi (x_r) = \chi _r(x_r)$ for each
$x_r\in X_r$ for all
$r$ that divides
$n$. We first show that
$\chi$ has low discrepancy over
$\mathcal {A}_n$. By (3.4) we have
$|X_r| \leq r$. By definition we have
$|I_r| \leq k$. In addition, note that
$x^{1/2}\cdot (k+1+\log ({n}/{x}))^{ {1}/{2}}$ is increasing for
$x\in (0, n]$. Combining these together, we know that for any nonempty
$X_r$,
\begin{align} 2^{{|I_r|}/{2}}\sqrt{|X_r|}\bigg(|I_r| + 1 + \log\frac{n}{|X_r|}\bigg)^{{1}/{2}} &\leq 2^{{k}/{2}}\sqrt{r}\bigg(k+ 1 + \log\frac{n}{r}\bigg)^{{1}/{2}} \nonumber\\ &\leq 2^{k2}/(k+1)^{1/2} \sqrt{r}\bigg(\log\frac{en}{r}\bigg)^{ 1/2}. \end{align}
Combining (3.5) and (3.7), there exists an absolute constant
$c_1$ such that for each nonempty
$X_r$,
\begin{equation} \max_{A\in \mathcal{A}_n}|\chi_r(A\cap X_r)| \leq c_02^{{k}/{2}}(k+1)^{1/2}\cdot \sqrt{r}\bigg(\log\frac{en}{r}\bigg)^{{1}/{2}} \leq c_12^{({3}/{4})k}\cdot \sqrt{r}\bigg(1 + \log\frac{n}{r}\bigg)^{{1}/{2}}. \end{equation}
This is also true for
$X_r = \emptyset$. Moreover, we know that for any
$r = p_1^{\delta _1}\cdots p_k^{\delta _k}$,
\[ \sqrt{r}\bigg(1 + \log\frac{n}{r}\bigg)^{{1}/{2}} \leq \prod_{i = 1}^k p_i^{\delta_i/2} \bigg(1 + \log\frac{p_i^{\alpha_i}}{p_i^{\delta_i}}\bigg)^{{1}/{2}} = \sqrt{n} \prod_{i = 1}^k p_i^{-(\alpha_i - \delta_i)/2} (1 + (\alpha_i - \delta_i)\log p_i)^{{1}/{2}}. \]
Summing this over all factors
$r = p_1^{\delta _1}\cdots p_k^{\delta _k}$ for
$0 \leq \delta _i\leq \alpha _i$, we have that if we set
$t_i = \alpha _i - \delta _i$,
\begin{align*} \sum_{r|n}\sqrt{r}\bigg(1 + \log\frac{n}{r}\bigg)^{{1}/{2}} &\leq \sqrt{n} \cdot \sum_{\delta_1 = 0}^{\alpha_1}\cdots \sum_{\delta_k = 0}^{\alpha_k}\prod_{i = 1}^k p_i^{-(\alpha_i - \delta_i)/2} (1 + (\alpha_i - \delta_i)\log p_i)^{{1}/{2}} \\ &= \sqrt{n} \prod_{i = 1}^k \Bigg(\sum_{t_i = 0}^{\alpha_i}p_i^{-t_i/2}(1+t_i\log p_i)^{1/2}\Bigg)\\ &\leq \sqrt{n} \prod_{i = 1}^k \Bigg(\sum_{t_i = 0}^{\infty}p_i^{-t_i/2}(1+t_i\log p_i)^{1/2}\Bigg). \end{align*}
Note that for
$p \geq 2$,
\[ f(p) := \sum_{t = 0}^{\infty}p^{-t/2}(1+t\log p)^{1/2} \]
is well-defined and tends to
$1$ as
$p \to \infty$. Thus, there exists an absolute constant
$P > 0$ such that if
$p \geq P$, then
$f(p) < 2^{{1}/{4}}$. As there are only finitely many prime numbers less than
$P$, we conclude that there exists an absolute constant
$c_2$ such that
\[ \prod_{i = 1}^k \bigg(\sum_{t_i = 0}^{\infty}p_i^{-t_i/2}(1+t_i\log p_i)^{{1}/{2}}\bigg) = \prod_{i = 1}^k f(p_i) \leq c_2 \cdot 2^{{k}/{4}}. \]
Thus, we have
\begin{equation} \sum_{r|n}\sqrt{r}\bigg(1 + \log\frac{n}{r}\bigg)^{{1}/{2}} \leq \sqrt{n}\prod_{i = 1}^k \bigg(\sum_{t_i = 0}^{\infty}p_i^{-t_i/2}(1+t_i\log p_i)^{{1}/{2}}\bigg) \leq c_22^{{k}/{4}}\sqrt{n}. \end{equation}
Thus, for any
$A\in \mathcal {A}_n$, by (3.8) and (3.9),
\[ |\chi(A)| = \bigg|\sum_{r|n}\chi_r(A\cap X_r)\bigg| \leq \sum_{r|n}c_12^{{3}/{4}k}\cdot \sqrt{r}\bigg(1 + \log\frac{n}{r}\bigg)^{{1}/{2}} \leq c_1c_22^{k}\sqrt{n}. \]
Here we set
$c = c_1c_2$ to obtain the desired bound on the discrepancy over
$\mathcal {A}_n$.
Now we study the discrepancy of
$\chi$ over
$\mathcal {A}_n^0$. Note that
$C(r', w) = C(\gcd (r', n), w)$. We may only consider the set of
$C(r', w) \in \mathcal {A}_n^0$ for which
$r' = p_1^{\gamma _1}\cdots p_k^{\gamma _k}$ is a factor of
$n$. By the definition of
$\chi$, we have the relation that
If
$r'$ is not a multiple of
$r = p_1^{\delta _1}\cdots p_k^{\delta _k}$, then we know that there exists some
$1\leq i\leq k$ for which
$\gamma _i \leq \delta _i - 1$. It follows that
$\delta _i > 0$, and
$i\in I_r$. As
$r'$ is a factor of
$n$ and
$\gamma _i \leq \delta _i - 1$, it is a factor of
$n/p_i^{\alpha _i - \delta _i + 1}$. Consequently, the congruence class
$C(r', w)$ can be partitioned into congruence classes of the form
$C(n/p_i^{\alpha _i - \delta _i + 1}, w')$. Noting that (3.6) holds for any
$w'\in \mathbb {Z}_n$, we know that if
$r$ is not a factor of
$r'$, then
$\chi _r(C(r', w)\cap X_r) = 0$. Thus, we can remove all summands on the right-hand side of (3.10) except those
$r$ that divides
$r'$. We obtain
\[ \chi(C(r', w)) = \sum_{r|r'}\chi_r(C(r', w)\cap X_r) = \chi\bigg(C(r', w) \cap \bigg(\bigcup_{r|r'}X_r\bigg)\bigg). \]
Note that we are taking union over all
$r = p_1^{\delta _1}\cdots p_k^{\delta _k}$ for which
$0\leq \delta _i \leq \gamma _i$ for all
$1\leq i\leq k$. We have
\begin{align*} \bigcup_{r|r'}X_r &= \psi_n\bigg(\bigcup_{r|r'}Y_r\bigg)\\ &= \psi_n\bigg(\bigcup_{\delta_1 = 0}^{\gamma_1} \cdots \bigcup_{\delta_k = 0}^{\gamma_k} S_1^{(\delta_1)}\times \cdots \times S_k^{(\delta_k)}\bigg)\\ &= \psi_n\bigg(\prod_{i = 1}^n \bigg(\bigcup_{\delta_i = 0}^{\gamma_i} S_i^{(\delta_i)}\bigg)\bigg). \end{align*}
From our construction, we know that
$\bigcup _{\delta _i = 0}^{\gamma _i} S_i^{(\delta _i)} = \emptyset$ if
$p_i = 2$ and
$\gamma _i < \alpha _i$, and otherwise
\[ \bigcup_{\delta_i = 0}^{\gamma_i} S_i^{(\delta_i)} = \{x: 0\leq x < p_i^{\gamma_i}\} \subseteq \mathbb{Z}_{p_i^{\alpha_i}}. \]
Thus, we may conclude that
Let
$Z_{r'}$ be the set on the right-hand side of (3.11). Any two distinct elements of
$Z_{r'}$ differ on some
$t_i$ for
$1\leq i\leq k$, i.e. they have different remainders when divided by
$p_i^{\gamma _i}$ for some
$i$. Therefore, their difference is not divisible by
$r'$. Hence, there is at most one element of
$C(r', w)$ in
$\bigcup _{r|r'}X_r \subseteq Z_{r'}$ for any
$w\in \mathbb {Z}_n$. We conclude that for any
$r'$ that divides
$n$ and any
$w\in \mathbb {Z}_n$,
\[ |\chi(C(r', w))| = \bigg|\chi\bigg(C(r', w) \cap \bigg(\bigcup_{r|r'}X_r\bigg)\bigg)\bigg| \leq 1. \]
This finishes our proof.
Remark 3.7 By being a little more careful with bounds in the above proof, we may improve the latter inequality in Lemma 3.3 to
where the
$o(1)$ term tends to zero as
$k \to \infty$. This, in turn, improves the bound on
$\operatorname {disc}(\mathcal {A}_n)$ to
$\min _{r|n}({n}/{r} + \sqrt {r}\cdot 2^{({1}/{2} + o(1))\omega (r)})$ in Theorem 3.1, where the
$o(1)$ term goes to zero as
$\omega (r) \to \infty$.
4. Lower bounds
In this section, we prove the lower bounds in Theorems 1.1 and 1.2. These proofs use Fourier analysis. We first set up helpful notation and prove a consequence of the Plancherel theorem in Lemma 4.1.
Notation 3 Let
$f: \mathbb {Z}_n \to \mathbb {C}$. Any coloring
$\chi : \mathbb {Z}_n \to \{1, -1\}$ is a special case. In this section, all summations are over
$\mathbb {Z}_n$ unless otherwise specified.
We define the Fourier transform
$\widehat f: \mathbb {Z}_n \to \mathbb {C}$ by
$\widehat f(r) = \sum _{x\in \mathbb {Z}_n}f(x)e^{- ({2\pi i}/{n})xr}$.
For two functions
$f_1, f_2: \mathbb {Z}_n\to \mathbb {C}$, their convolution
$f_1*f_2: \mathbb {Z}_n \to \mathbb {C}$ is given by
$f_1*f_2(a) = \sum _x f_1(x)f_2(a-x)$. We have the convolution identity
$\widehat {f_1*f_2} = \widehat {f_1} \cdot \widehat f_2$.
For any
$r\in \mathbb {N}$ that divides
$n$, we say that
$x \equiv y\ (\mathrm {mod}\,r)$ for
$x, y\in \mathbb {Z}_n$ if
$x = y + kr$ for some
$k\in \mathbb {Z}_n$. We define, for any
$r \in \mathbb {N}$ that divides
$n$ and
$a\in \mathbb {Z}_n$,
\[ g_f(a, r) := \sum_{x\in \mathbb{Z}_n: x\equiv a\, (\mathrm{mod}\,r)} f(x) \quad \mathrm{and} \quad G_f(r) := \sum_{a=0}^{r-1} |g_f(a, r)|^2. \]
We see that
$g_f(a, r) = g_f(a+kr, r)$, so
$g_f(\cdot, r)$ can be treated as a function on
$\mathbb {Z}_r$.
Let
$M$ be a set or a multiset of elements in
$\mathbb {Z}_n$. For
$a, r\in \mathbb {Z}_n$, we define
$rM$ to be the multiset
$\{rx: x\in M\}$, and
$a+M$ to be the multiset
$\{a+x: x\in M\}$. We define
$m_M$ to be the multiplicity function, i.e.
$m_M(x)$ is the multiplicity of
$x$ in
$M$. In particular, when
$M$ is a set,
$m_M = 1_M$ is the indicator function. We also define
Lemma 4.1 For any
$f: \mathbb {Z}_n \to \mathbb {C}$, let
$\widehat f$ be its Fourier transform. Let
$r\in \mathbb {N}$ be a factor of
$n$. Then
\[ \sum_{k = 0}^{r-1} \bigg|\widehat f\bigg(k\cdot \frac{n}{r}\bigg)\bigg|^2 = rG_f(r). \]
Proof. Let
$t = n/r$. For each
$0\leq k\leq r-1$, we know that by definition
\[ \widehat f(kt) = \sum_{x = 0}^{n-1} f(x)e^{-({2\pi i}/{n})x\cdot kt} = \sum_{x = 0}^{tr-1} f(x)e^{-({2\pi i}/{r})xk} = \sum_{a = 0}^{r-1}g_f(a, r)e^{-({2\pi i}/{r})ak}. \]
Hence, for
$g: \mathbb {Z}_r\to \mathbb {C}$ defined by
$g(a) := g_f(a, r)$, its Fourier transform is
$\widehat g(k) = \widehat f(kt)$. By the Plancherel theorem we have
\[ \sum_{k = 0}^{r-1} \bigg|\widehat f\bigg(k\cdot \frac{n}{r}\bigg)\bigg|^2 = \sum_{k = 0}^{r-1} |\widehat g(k)|^2 = r \sum_{a = 0}^{r-1} |g(a)|^2 = rG_f(r). \]
In Lemmas 4.2 and 4.3, we prove lower and upper bounds on the same quantity respectively. Combining them we obtain Corollary 4.4. This corollary lower bounds the discrepancy of a function
$f$ over arithmetic progressions in
$\mathbb {Z}_n$ by the Fourier coefficients of
$f$.
The next lemma lower bounds the quantity by a weighted
$L^{2}$ sum of Fourier coefficients
$\widehat f$. The weights depend on the arithmetic structure of
$n$.
Lemma 4.2 Let
$f: \mathbb {Z}_n \to \mathbb {C}$,
$1\leq m\leq n$ be an integer, and
$M:= \{0, 1 \dots, m-1\} \subseteq \mathbb {Z}_n$. Then
\begin{equation} \sum_{a\in \mathbb{Z}_n}\sum_{b\in \mathbb{Z}_n} |f(a+bM)|^2 \geq \sum_{r\in \mathbb{Z}_n} |\widehat f(r)|^2 \cdot \max\bigg(\frac{m^2\cdot \gcd(r, n)}{n}, m\bigg). \end{equation}Proof. We show some properties about the multiplicity function. For the set
$M$, we have
For any
$u, v\in \mathbb {Z}_n$, we have
Applying (4.3) twice we have
$\widehat {m_{-uM}}(v) = \widehat {m_{-vM}}(u).$ We have
\begin{align} \sum_{a}\sum_{b} |f(a+bM)|^2 &= \sum_{b} \sum_a |f * m_{-bM}(a)|^2 = \sum_b \frac{1}{n} \sum_r |\widehat{f * m_{-bM}}(r)|^2 \nonumber\\ &= \frac{1}{n}\sum_b \sum_r |\widehat f(r)|^2\cdot |\widehat {m_{-bM}}(r)|^2 = \frac{1}{n}\sum_b \sum_r |\widehat f(r)|^2 |\widehat {m_{-rM}}(b)|^2 \nonumber\\ &= \sum_r |\widehat f(r)|^2 \cdot \bigg(\frac{1}{n}\sum_b |\widehat {m_{-rM}}(b)|^2\bigg) = \sum_r |\widehat f(r)|^2 \cdot \sum_s |m_{-rM}(s)|^2, \end{align}
where the first equality uses (4.2), the second uses the Plancherel theorem, the third uses the Fourier identity of convolution, the fourth uses (4.3) twice, and the last uses the Plancherel theorem. Now we evaluate
$\sum _s |m_{-rM}(s)|^2$. Let
$k = \gcd (r, n)$. When
$km \leq n$, we know that
$rM$ contains
$m$ elements with multiplicity 1. Thus, in this case we have
Otherwise, when
$km > n$, we know that
$rM$ contains elements that are multiples of
$k$. There are
$n/k$ such elements in
$\mathbb {Z}_n$. Therefore, by the Cauchy–Schwarz inequality, we have
\[ \sum_s |m_{-rM}(s)|^2 = \sum_{t = 0}^{{n}/{k} - 1} |m_{-rM}(tk)|^2 \geq \frac{\big(\sum_{t = 0}^{{n}/{k} - 1} |m_{-rM}(tk)|\big)^2}{n/k} = \frac{m^2k}{n}. \]
Hence, we may conclude that for any
$r \in \mathbb {Z}_n$,
\begin{equation} \sum_s |m_{-rM}(s)|^2 \geq \max\bigg(\frac{m^2\cdot \gcd(r, n)}{n}, m\bigg). \end{equation} The next lemma gives an upper bound on the quantity above. The upper bound involves the discrepancy of
$f$ over
$\mathcal {A}_n$ and some arithmetic sums of
$f$. Let
$\phi (\cdot )$ be Euler's totient function.
Lemma 4.3 Let
$f: \mathbb {Z}_n \to \mathbb {C}$. Suppose that
Let
$m\leq n$ be a positive integer, and
$M:= \{0, 1, \ldots, m-1\} \subseteq \mathbb {Z}_n$. Then we have
\begin{equation} \sum_{a\in \mathbb{Z}_n}\sum_{b\in \mathbb{Z}_n} |f(a+bM)|^2 \leq n^2 T_f^2 + \sum_{0\leq k < m: k|n} m^2\frac{\phi(k)}{k}G_f(n/k). \end{equation}Proof. For each fixed
$b\in \mathbb {Z}_n$, we analyze the summation
$\sum _a |f(a+bM)|^2$. Let
$r = \gcd (b, n)$ and
$k = n/r$. There are two possibilities:
$rm \leq n$ or
$rm > n$.
If
$rm \leq n$, then each element in
$bM$ has multiplicity
$1$. Therefore,
$a + bM$ is a set for all
$a\in \mathbb {Z}_n$. Moreover, from our definition of
$M = \{0, 1, \ldots, m-1\}$, we know that
$a+bM\in \mathcal {A}_n$ is an arithmetic progression in
$\mathbb {Z}_n$. In this case, for any
$a$,
$|f(a+bM)| \leq T_f$, so
If
$rm > n$, i.e.
$m > k$, then some elements in
$bM$ have multiplicity greater than
$1$. The bound in (4.7) no longer applies. Let
$K = \{0, 1, \ldots, k-1\}$ and it follows that each element in
$bK$ has multiplicity
$1$. Moreover, it covers each multiple of
$r$ in
$\mathbb {Z}_n$ exactly once. Hence,
\[ f(a+bK) = \sum_{t= 0}^{k-1} f(a+bt) = g_f(a, r). \]
Suppose that
$m = qk+s$ for integers
$q$ and
$0\leq s < k$. Then we may write
$m_M = m_{S} + \sum _{j = 0}^{q-1} m_{s+jk+K}$ where
$S = \{0, 1, \dots, s-1\}$. Thus, for any
$a\in \mathbb {Z}_n$, we have
\begin{align} f(a + bM) &= f(a + bS) + \sum_{j = 0}^{q-1}f(a+b\cdot (s+jk) + bK) \nonumber\\ &= f(a+bS) + \sum_{j = 0}^{q-1}g_f(a+b\cdot (s+jk), r) = f(a+bS) + q\cdot g_f(a, r). \end{align}
In the last step, we use the fact that
$b\cdot (s+jk)$ is a multiple of
$r$.
As
$s < k$, each element in
$bS$ has multiplicity at most
$1$, and further
$a+bS\in \mathcal {A}_n$ for all
$a$. Thus,
We now partition
$a\in \mathbb {Z}_n$ into congruence classes mod
$r$. In particular, we have
\begin{equation} \sum_{a}|f(a+bM)|^2 = \sum_{i = 0}^{r-1} \sum_{a\equiv i\, (\mathrm{mod}\,r)} |f(a+bM)|^2. \end{equation}
For each
$a'\equiv i\ (\mathrm {mod}\,r)$, there are exactly
$s$ choices of
$a\equiv i\ (\mathrm {mod}\,r)$ such that
$a'\in a+bS$. Thus,
\begin{equation} \sum_{j = 0}^{k-1} f(i+jr+bS) =\sum_{a\equiv i\, (\mathrm{mod}\,r)} f(a+bS) = s\cdot g_f(i, r). \end{equation}Consequently, we have
\begin{align*} \sum_{a\equiv i\, (\mathrm{mod}\,r)}
|f(a+bM)|^2 &= \sum_{j = 0}^{k-1} |f(i+jr+bM)|^2 \\
[\textrm{by (4.8)}]\quad &= \sum_{j =
0}^{k-1} |f(i+jr+bS) + q\cdot g_f(i, r)|^2 \\ &= \sum_{j =
0}^{k-1} (|f(i+jr+bS)|^2 + 2 \operatorname{Re}(q\cdot
f(i+jr+bS)\overline{g_f(i, r)}) + q^2|g_f(i, r)|^2) \\
[\textrm{by (4.9)}]\quad &\leq kT_f^2 +
kq^2|g_f(i, r)|^2 +
2q\operatorname{Re}\bigg(\overline{g_f(i, r)}\sum_{j =
0}^{k-1} f(i+jr+bS)\bigg) \\ [\textrm{by (4.11)
}]\quad &= kT_f^2 + kq^2|g_f(i, r)|^2
+ 2qs|g_f(i, r)|^2 \\ &\leq kT_f^2 + |g_f(i, r)|^2\cdot
\frac{k^2q^2 + 2kqs + s^2}{k} \\ [\textrm{by }m=kq+s]\quad
& = kT_f^2 + \frac{m^2}{k}|g_f(i, r)|^2.
\end{align*}
Put this into (4.10). We know that in the second case where
$rm > n$, i.e.
$k < m$,
\begin{align} \sum_{a}|f(a+bM)|^2 =\sum_{i = 0}^{r-1} \sum_{a\equiv i\,(\mathrm{mod}\,r)} |f(a+bM)|^2 \leq nT_f^2 + \frac{m^2}{k}G_f(r) = nT_f^2 + \frac{m^2}{k}G_f(n/k). \end{align}
The second case happens exactly when
$\gcd (b, n) = n/k$ for some
$k < m$ which divides
$n$. The number of such choices of
$b$ is exactly
$\phi (k)$ for any fixed
$k$. Hence, combining (4.7) and (4.12), we obtain (4.6).
Combining Lemmas 4.2 and 4.3, we deduce the following general lower bounds.
Corollary 4.4 Let
$f: \mathbb {Z}_n \to \mathbb {C}$ and
$\widehat f$ be its Fourier transform. Suppose that
For any positive integer
$m \leq n$, we have
\begin{equation} n^2T_f^2 + \sum_{1\leq k < m: k|n} \frac{m^2\phi(k)}{k}G_f(n/k) \geq \sum_{r\in \mathbb{Z}_n} |\widehat f(r)|^2 \cdot \max\bigg(\frac{m^2\cdot \gcd(r, n)}{n}, m\bigg). \end{equation} In Corollary 4.4, the inequality involves
$G_f$ and
$\widehat f$ in addition to
$T_f$. We aim to get a lower bound on
$\operatorname {disc}(\mathcal {A}_n)$ that only depends on arithmetic structure of
$n$ (Proposition 4.7). To achieve that, we need two lemmas (Lemmas 4.5 and 4.6) to remove the dependency on
$\widehat f$ and
$G_f$.
Lemma 4.5 Let
$f: \mathbb {Z}_n \to \mathbb {C}$ and
$\widehat f$ be its Fourier transform and
$m\leq n$ be a positive integer. Then
\[ \sum_{1\leq k \leq n: k|n} \frac{m^2\phi(k)}{k}G_f(n/k) = \sum_{r\in \mathbb{Z}_n} |\widehat f(r)|^2 \cdot \frac{m^2\cdot \gcd(r, n)}{n}. \]
Proof. By Lemma 4.1, we know that
Thus, we have (noting that
$\sum _{k|l}\phi (k) = l$ for any positive integer
$l$)
\begin{align*} \sum_{1\leq k \leq n: k|n} \frac{m^2\phi(k)}{k}G_f(n/k) &= \sum_{1\leq k \leq n: k|n} \frac{m^2\phi(k)}{n}\sum_{r\in \mathbb{Z}_n: k|r}|\widehat f(r)|^2 = \sum_{r\in \mathbb{Z}_n}|\widehat f(r)|^2\cdot \frac{m^2}{n} \sum_{1\leq k\leq n: k|n, k|r}\phi(k)\\ &= \sum_{r\in \mathbb{Z}_n}|\widehat f(r)|^2\cdot \frac{m^2}{n} \sum_{1\leq k\leq n: k|\gcd(n, r)}\phi(k) = \sum_{r\in \mathbb{Z}_n}|\widehat f(r)|^2\cdot \frac{m^2}{n}\gcd(r,n). \end{align*}
Hence, we have the desired equality.
Lemma 4.6 Let
$f: \mathbb {Z}_n \to \mathbb {C}$ and
$\widehat f$ be its Fourier transform. Let
$m,l \leq n$ be positive integers. Then
\begin{equation} \sum_{r\in \mathbb{Z}_n} |\widehat f(r)|^2 \cdot \min\bigg(\frac{m^2\cdot \gcd(r, n)}{n}, m\bigg) \leq \sum_{1\leq k \leq l: k|n}\frac{m^2\phi(k)}{k}G_f(n/k) + \sum_{l < k \leq n: k|n}\frac{mn}{k}G_f(n/k). \end{equation}Proof. It suffices to compare the coefficient of each
$|\widehat f(r)|^2$ on both sides after expanding all terms of
$G_f$ on the right-hand side (4.14) using Lemma 4.1. By Lemma 4.1, for any
$k$ that divides
$n$,
For each
$r\in \mathbb {Z}_n$, the coefficient
$t_r$ of
$|\widehat f(r)|^2$ on the right-hand side of (4.14) is given by
\[ t_r = \sum_{1\leq k \leq l: k|\gcd(r, n)}\frac{m^2\phi(k)}{n} + \sum_{l < k \leq n: k|\gcd(r, n)}m = \frac{m^2}{n}\sum_{1\leq k\leq l: k|\gcd(r, n)} \phi(k)+ m\sum_{l < k \leq n: k|\gcd(r, n)}1. \]
If
$\gcd (r, n) \leq l$, then we know that the first summation sums over all factors of
$\gcd (r, n)$, and the second summation is zero. Hence, we know that in this case,
If
$\gcd (r, n) > l$, then in particular the second summation contains at least one term
$k = \gcd (r, n)$, and the first summation is nonnegative. Hence, in this case,
We may conclude that
$t_r \geq \min ({m^2\cdot \gcd (r, n)}/{n}, m)$ for all
$r\in \mathbb {Z}_n$. This yields (4.14).
Using these lemmas, we prove a lower bound on
$\operatorname {disc}(\mathcal {A}_n)$ which depends only on the arithmetic structure of
$n$.
Proposition 4.7 For any positive integers
$n$ and
$l\leq n$,
\[ \frac{1}{(\operatorname{disc}(\mathcal{A}_n))^2} \leq \frac{8}{n}\sum_{1\leq k\leq l: k|n} \phi(k) + 2\sum_{l < k \leq n: k|n}\frac{1}{k^2}. \]
Proof. For simplicity, let us denote
\[ S_1 := \sum_{1\leq k\leq l: k|n} \phi(k) \quad \mathrm{and} \quad S_2 := \sum_{l < k \leq n: k|n}\frac{1}{k^2}. \]
We aim to show
Because we always have
$\operatorname {disc}(\mathcal {A}_n) \geq 1$, we may assume that
$S_1 < {n}/{8}$.
Let
$\chi : \mathbb {Z}_n \to \{1, -1\}$ be any coloring of
$\mathbb {Z}_n$, and let
$T_\chi := \max _{A\in \mathcal {A}_n} |\chi (A)|.$ Let
$m \leq n$ be a positive integer to be determined later. By Corollary 4.4, we know that
\begin{equation} n^2T_\chi^2 + \sum_{1\leq k < m: k|n} \frac{m^2\phi(k)}{k}G_\chi(n/k) \geq \sum_{r\in \mathbb{Z}_n} |\widehat \chi(r)|^2 \cdot \max\bigg(\frac{m^2\cdot \gcd(r, n)}{n}, m\bigg). \end{equation}By Lemma 4.5, we know that
\[ \sum_{1\leq k \leq n: k|n} \frac{m^2\phi(k)}{k}G_\chi(n/k) = \sum_{r\in \mathbb{Z}_n} |\widehat \chi(r)|^2 \cdot \frac{m^2\cdot \gcd(r, n)}{n}. \]
Subtract both sides from (4.16). We obtain
\begin{align} n^2T_\chi^2 + \sum_{r\in \mathbb{Z}_n} |\widehat \chi(r)|^2 \cdot \min\bigg(\frac{m^2\cdot \gcd(r, n)}{n}, m\bigg) \geq \sum_{r\in \mathbb{Z}_n} |\widehat \chi(r)|^2\cdot m + \sum_{m\leq k \leq n: k|n} \frac{m^2\phi(k)}{k}G_\chi(n/k). \end{align}
As
$\chi$ takes values in
$\{-1, 1\}$, we know that
Note that each
$G_\chi (\cdot )$ is nonnegative. By (4.18), the right-hand side of (4.17) is lower bounded by
\begin{equation} \sum_{r\in \mathbb{Z}_n} |\widehat \chi(r)|^2\cdot m + \sum_{m\leq k \leq n: k|n} \frac{m^2\phi(k)}{k}G_\chi(n/k) \geq n^2m. \end{equation}
For the left-hand side of (4.17), we apply Lemma 4.6 for
$m$ and
$l$ and obtain
\begin{equation} \sum_{r\in \mathbb{Z}_n} |\widehat \chi(r)|^2 \cdot \min\bigg(\frac{m^2\cdot \gcd(r, n)}{n}, m\bigg) \leq \sum_{1\leq k\leq l:k|n}\frac{m^2\phi(k)}{k}G_{\chi}(n/k) + \sum_{l < k \leq n: k|n} \frac{mn}{k}G_\chi(n/k). \end{equation} Note that, by definition, each single
$g_\chi (a, n/k)$ is the sum of
$k$ values of
$\chi$. Because
$\chi$ takes value in
$\{-1, 1\}$, we have
Moreover, each
$g_\chi (a, n/k)$ is
$\chi (A)$ for some
$A\in \mathcal {A}_n$, so
$|g_\chi (a, n/k)| \leq T_\chi$. This means that for all
$k$,
We bound the first term on the right-hand side of (4.20) using (4.21) and obtain
\begin{equation} \sum_{1\leq k\leq l:k|n}\frac{m^2\phi(k)}{k}G_{\chi}(n/k) \leq m^2n \sum_{1\leq k\leq l:k|n} \phi(k) = nm^2\cdot S_1. \end{equation}On the other hand, we bound the second term on the right-hand side of (4.20) using (4.22) and obtain
\begin{equation} \sum_{l < k \leq n: k|n} \frac{mn}{k}G_\chi(n/k) \leq \sum_{l < k \leq n: k|n} \frac{mn^2}{k^2}T_\chi^2 = n^2mT_\chi^2\cdot S_2. \end{equation}Put (4.23) and (4.24) into (4.20). We obtain
\begin{equation} \sum_{r\in \mathbb{Z}_n} |\widehat \chi(r)|^2 \cdot \min\bigg(\frac{m^2\cdot \gcd(r, n)}{n}, m\bigg) \leq nm^2 \cdot S_1 + T_\chi^2n^2mS_2. \end{equation}Finally, we put (4.19) and (4.25) into (4.17). We obtain
Dividing both sides by
$n^2m$, we obtain
Now we pick
$m = \lfloor n/(2S_1)\rfloor$. Note that
$S_1 < n/8$ from our assumption, so
$m \geq {n}/{4S_1}$. Therefore,
Put them into (4.26). We conclude that
As this bound applies to all
$T_\chi ^2$, it also applies to
$(\operatorname {disc}(\mathcal {A}_n))^2 = \min _{\chi }T_\chi ^2$. Hence, we have (4.15).
Remark 4.8 As mentioned earlier in Remark 1.3, the proof above also applies to the case where
$\chi$ takes value in the unit circle on the complex plane
$\{z\in \mathbb {C}: |z| = 1\}$ (instead of
$\{1, -1\}$). Just note that (4.18) and (4.21) hold in this more general case as well, and all other steps are identical.
Now we prove two corollaries. The first shows that the upper bound in Theorem 3.1 is tight up to an
$n^{o(1)}$ factor.
Corollary 4.9 (Lower bound in Theorem 1.1)
There exists an absolute constant
$c > 0$ such that, for any positive integer
$n$,
where
$d(n)$ is the number of factors of
$n$.
Proof. Let
$t_1$ be the minimum factor of
$n$ that is at least
$n^{ 2/3}$, and let
$t_2$ be the maximum factor of
$n$ less than
$n^{ 2/3}$. As
it suffices to show that
Now we apply Proposition 4.7 to
$n$ and
$l = {n}/{t_1}$. We bound the two summations as follows. We have
Note that
$t_2$ is the largest factor of
$n$ less than
$t_1$, so the minimum
$k$ in
$\{{n}/{t_1} < k \leq n: k|n\}$ is
$n/t_2$. Thus, we have
\begin{equation} \sum_{{n}/{t_1} < k \leq n: k|n} \frac{1}{k^2} \leq \sum_{{n}/{t_2} \leq k \leq n: k|n} \frac{1}{k^2} \leq \frac{t_2^2}{n^2}\cdot d(n). \end{equation}Using above two bounds, we obtain
This is equivalent to (4.27), so we have the expected inequality.
The second corollary proves the lower bound in Theorem 1.2. The main observation is that the factor
$d(n)$ can be removed in (4.28) and (4.29) when
$n$ is a prime power.
Corollary 4.10 (Lower bound in Theorem 1.2)
Let
$p$ be a prime number, and
$k$ be a positive integer. Then for
$n = p^k$,
Proof. In Proposition 4.7, we pick
$l = p^t$ for some
$1\leq t < n$ to be determined later. Note that the factors of
$n$ between
$1$ and
$l$ are given by
$s = p^i$ for
$0\leq i\leq t$, which are all factors of
$l$. Hence, we have
All factors of
$n$ larger than
$l$ are given by
$s = p^{i}$ for
$t+1\leq i \leq k$. Thus,
\[ \sum_{l < s \leq n: s|n}\frac{1}{s^2} = \sum_{i = t+1}^k p^{-2i} \leq p^{-2t-2}\cdot \bigg(1 + \frac{1}{p^2} + \frac{1}{p^{4}}+ \cdots\bigg) \leq 2p^{-2t-2}. \]
Therefore, by Proposition 4.7 we obtain
We pick
$t = \lfloor {k/3}\rfloor$ to get (4.30).
5. Concluding remarks
In Theorem 1.1, the upper and lower bounds are off by a factor of
$O(d(n)^{3/2})$. We were not able to close this gap, and it seems that major improvement of either bound would require new observations.
Problem 5.1 Determine
$\operatorname {disc}(\mathcal {A}_n)$ up to a constant factor for all
$n$.
It is worth noting that the proof of the upper bound presented here is not algorithmic, but one can show that there exists a randomized polynomial time algorithm that gives a coloring that achieves the upper bound up to a constant factor, with positive constant success probability. This can be done by replacing Lemma 2.1 with Theorem 2.1 in [Reference Lovett and MekaLM15].
There are other notions of discrepancy in addition to that studied in this paper. Among them there is the hereditary discrepancy, defined for a system
$(\Omega, \mathcal {A})$ as
where
$\mathcal {A}|_X = \{A\cap X: A\in \mathcal {A}\}$. Clearly
$\operatorname {disc}(\mathcal {A}) \leq \operatorname {herdisc}(\mathcal {A})$. For the set
$\mathcal {A}$ of arithmetic progressions in
$[n]$, Matoušek and Spencer [Reference Matoušek and SpencerMS96] proved a stronger statement that
$\operatorname {herdisc}(\mathcal {A}) = O(n^{ 1/4})$. This is because their partial coloring method works not just for
$\mathcal {A}$, but also for
$\mathcal {A}|_X$ for any
$X\subseteq [n]$.
In contrast, our construction of the coloring in § 3 is only valid for coloring the whole set
$\mathbb {Z}_n$. Although it can be adapted so that the same upper bound (possibly with a larger constant factor) applies to some special subsets of
$\mathbb {Z}_n$, it does not work for all subsets
$X\subseteq \mathbb {Z}_n$.
Problem 5.2 Estimate the hereditary discrepancy of
$\mathcal {A}_n$.
By Corollary 2.3 we have
$\operatorname {herdisc}(\mathcal {A}_n) = O(n^{ 1/2})$. The method used in § 2 can be adapted to give the following slightly stronger statement. Let
$\phi (\cdot )$ be Euler's totient function.
Theorem 5.1 There exists a constant
$c$ such that for all positive integers
$n$, we have
\[ \operatorname{herdisc}(\mathcal{A}_n) \le c \phi(n)^{{1}/{2}}\bigg(\log \frac{en}{\phi(n)}\bigg)^{{3}/{2}}. \]
We leave the proof of this theorem to Appendix A. It shows that the upper bound
$O(n^{ 1/2})$ is not always tight. It would be interesting to determine whether there is a matching lower bound of the form
$n^{ 1/2 - o(1)}$.
Acknowledgements
We thank the anonymous referees for helpful comments and suggestions.
Appendix A. Improved bound for hereditary discrepancy
In this appendix, we prove Theorem 5.1, an improved upper bound on the hereditary discrepancy of modular arithmetic progressions. We need the following lemma which gives a partial coloring bound.
Lemma A.1 Let
$X\subseteq \mathbb {Z}_n$ be a set of size
$m > 0$. There exists an absolute constant
$c$ such that there is a partial coloring
$\chi : X\to \{-1, 0, 1\}$ that assigns
$\pm 1$ to at least
$m/10$ elements in
$X$ such that
\[ \max_{A\in \mathcal{A}_n}|\chi(A\cap X)| \leq c\phi(n)^{1/2}\bigg(\log\frac{en}{\phi(n)}\bigg)^{1/2}. \]
Assuming this lemma, we may now prove Theorem 5.1.
Proof Proof of Theorem 5.1 assuming Lemma A.1
Let
$X\subseteq \mathbb {Z}_n$ be a set of size
$m$. We show that there exists a coloring
$\chi : X\to \{1, -1\}$ such that, for some absolute constant
$c$,
\begin{equation} \max_{A\in \mathcal{A}_n}|\chi(A\cap X)| \leq c \phi(n)^{{1}/{2}} \bigg(\log \frac{en}{\phi(n)}\bigg)^{{3}/{2}}. \end{equation} The idea is that we iteratively apply Lemma A.1 to the set of uncolored elements until there are at most
$\phi (n)$ elements left, and then apply Corollary 2.3 to color the remaining elements. Let
$c_0, c_1$ be the constants in Lemma A.1 and Corollary 2.3.
Start with
$X_0 = X$. For each
$i\geq 0$, we apply Lemma A.1 to
$X_i$ to get a partial coloring
$\chi _i: X_i \to \{-1, 0, 1\}$, and we let
$X_{i+1} = \chi _i^{-1}(0) \subseteq X_i$ to be the set of uncolored elements in
$i$th iteration. We continue this process until the
$(k-1)$th iteration where there are at most
$\phi (n)$ elements left (i.e.
$|X_{k}| \leq \phi (n)$). Then we apply Corollary 2.3 to get a coloring
$\chi _{k}: X_{k}\to \{-1, 1\}$. Let
$\chi$ be the final coloring given by
$\chi (x_i) = \chi _i(x_i)$ if
$x_i\in X_i\setminus X_{i+1}$ for
$0\leq i\leq k-1$, and
$\chi (x_{k}) = \chi _{k}(x_{k})$. We know that
$|X_i| \leq 0.9|X_{i-1}|$ for all
$1\leq i\leq k$, so
$|X_k| \leq (0.9)^k|X_0| = (0.9)^km \leq (0.9)^kn$. Because we stop when there are at most
$\phi (n)$ elements left, we shall see that
$k \leq 1 + \log _{0.9} ({m}/{n}) \leq 10\log ({en}/{m})$.
Applying the bounds on the discrepancy of
$\chi _i$ from Lemma A.1 and Corollary 2.3, we conclude that for any
$A\in \mathcal {A}_n$,
\begin{align*} |\chi(A\cap X)| &=
\bigg|\sum_{i=0}^k \chi_i(X_i\cap A)\bigg| \leq
\sum_{i=0}^{k-1} |\chi_i(X_i\cap A)| + |\chi_k(X_k\cap
A)| \\ &\leq k\cdot
c_0\phi(n)^{1/2}\bigg(\log\frac{en}{\phi(n)}\bigg)^{1/2}
+ c_1|X_k|^{1/2}
\bigg(\log\frac{en}{|X_k|}\bigg)^{1/2}\\ &<
10c_0\phi(n)^{1/2}\bigg(\log\frac{en}{m}\bigg)^{3/2}
+
c_1\phi(n)^{1/2}\bigg(\log\frac{en}{m}\bigg)^{1/2}
\leq
c\phi(n)^{1/2}\bigg(\log\frac{en}{m}\bigg)^{3/2}
\end{align*}
for
$c = 10c_0+c_1$ being an absolute constant. As it holds for all
$A\in \mathcal {A}_n$, we have (A.1).
We are left to prove Lemma A.1. We first need a slight generalization of the partial coloring lemma in Lemma 2.1. In Lemma 2.1 we require
$\Delta _S \geq 2\sqrt {|S|}$. Here we allow
$\Delta _S$ to take any positive value.
Lemma A.2 (Section 4.6 [Reference MatoušekMat99])
Let
$(V, C)$ be a set system on
$n$ elements, and let a number
$\Delta _S > 0$ be given for each set
$S\in C$. Suppose that
\begin{equation} \sum_{S\in C:S\ne \emptyset}g\bigg(\frac{\Delta_S}{\sqrt{|S|}}\bigg) \leq \frac{n}{5}, \end{equation}where
\begin{equation} g(\lambda) = \begin{cases} 10e^{-\lambda^2/4} & \textrm{if }\lambda \geq 2, \\ 10\log(1 + 2\lambda^{-1}) & \textrm{if } 0 < \lambda < 2. \end{cases} \end{equation}
Then there exists a partial coloring
$\chi$ that assigns
$\pm 1$ to at least
$n/10$ variables (and
$0$ to the rest), satisfying
$|\chi (S)| \leq \Delta _S$ for each
$S\in C$.
We now prove Lemma A.1.
Proof of Lemma A.1 We use the same decomposition as in Lemma 2.2 to get the family
$C_2$ of nonempty subsets of
$X$. From the argument in Lemma 2.2, we know that sets in
$C_2$ are of size
$2^i$ for
$2^i \leq m$. If
$\chi : X\to \{-1, 0, 1\}$ is such that for all
$0\leq i\leq \log _2 m$ we have
$\chi (S) \leq \Delta _i$ for any set
$S\in C_2$ of size
$2^i$, then
Then we apply a better bound on the number of sets in
$C_2$ of size
$2^i$, which we shall denote as
$f_i$. The notation here is the same as in Lemma 2.2. For each
$1\leq d < n$ and
$0\leq a < \gcd (d, n)$, the number of choices of
$t$ in (2.5) is
$\lfloor l_{d, a}/2^i\rfloor$. Yet note that
$l_{d, a} \leq {n}/{\gcd (d, n)}$. Hence, if
$\gcd (d, n) > {n}/{2^i}$, then there are no such sets included in the set
$X_{d, a}$. Therefore, we have the following better bound on
$f_i$:
\[ f_i \leq \sum_{1\leq d \leq n-1: \gcd(d, n) \leq {n}/{2^i}}\sum_{a=0}^{\gcd(d, n) - 1}\bigg\lfloor\frac{l_{d, a}}{2^i}\bigg\rfloor = \sum_{1\leq d \leq n-1: \gcd(d, n) \leq {n}/{2^i}}\frac{m}{2^i} \leq \sum_{1\leq l \leq {n}/{2^i}:l|n}\phi(n/l)\cdot \frac{m}{2^i}. \]
Because
$\phi (ab) \geq \phi (a)\phi (b)$ for all
$a, b\in \mathbb {N}$, we know that
$\phi (n/l) \leq \phi (n)/\phi (l)$ for all
$l$ that divides
$n$. Also note that
$0 < \phi (n)/\phi (l)$ for all
$l$ that does not divide
$n$. By Landau [Reference LandauLan00, p. 184], for any
$x\geq 1$,
$\sum _{l \leq x}1/\phi (l) \leq c_0\log ex$ for some absolute constant
$c_0$. Hence, we have
\begin{equation} f_i \leq \frac{m}{2^i}\sum_{1\leq l\leq {n}/{2^i}: l|n}\phi(n/l) \leq \frac{m}{2^i}\phi(n)\sum_{1\leq l\leq {n}/{2^i}}\frac{1}{\phi(l)} \leq c_0\frac{m}{2^i}\phi(n)\log\frac{en}{2^i}. \end{equation} For simplicity, we denote
$M = \phi (n)\log ({en}/{\phi (n)})$. We define
$b: (0, n] \to \mathbb {R}$, given by
\begin{equation} b(s) = \begin{cases}
c_1\sqrt{s}\cdot \bigg(\dfrac{s}{M}\bigg)^{-1} & \textrm{if
} s \geq M, \\ c_1\sqrt{s}\cdot
\bigg(\dfrac{s}{M}\bigg)^{-0.1} & \textrm{if } s < M,
\end{cases} \end{equation}
where
$c_1 > 2$ is an absolute constant to be determined later. We would like to show that there exists a partial coloring that colors at least
$m/10$ elements in
$X$, such that for any
$S\in C_2$,
In order to apply Lemma A.2, it suffices to verify that
\begin{equation} \sum_{S\in C_2}g\bigg(\frac{b(s)}{\sqrt{|S|}}\bigg) = \sum_{i = 0}^{\lfloor\log_2 m\rfloor}f_i\cdot g(b(2^i)2^{-i/2}) \leq m/5. \end{equation}
For fixed
$i$, we denote
$\tau = 2^i/M$, so
$2^i = \tau M \geq \tau \phi (n)$. Observe that
When
$\tau < 1$, we have
$b(2^i)2^{-i/2} = c_1\tau ^{-0.1}$ and
When
$\tau \geq 1$, we have
$b(2^i)2^{-i/2} = c_1\tau ^{-1}$ and
Therefore, if we write the summation in (A.8) in terms of
$\tau$, we have
\begin{equation} \sum_{i = 0}^{\lfloor\log_2 m\rfloor}f_i\cdot g(b(2^i)2^{-i/2}) = c_0m\bigg(\sum_{\tau \geq 1}\tau^{-1}g(c_1\tau^{-1}) + \sum_{\tau < 1}\tau^{-1}(1+\log \tau^{-1})g(c_1\tau^{-0.1})\bigg), \end{equation}
where the summation of
$\tau$ is over a geometric sequence with ratio
$2$. By the definition of
$g$ in (A.3),
$g$ is monotonically decreasing. Let
$T$ be a large absolute constant to be determined later. We have
As
$\sum _{\tau \geq 1}\tau ^{-1}\cdot 10\log (1+\tau )$ converges, there exists sufficiently large constant
$T$ satisfying
\begin{equation} \sum_{\tau \geq T}\tau^{-1}g(c_1\tau^{-1}) \leq \frac{1}{20c_0}. \end{equation}We bound the second term on the right-hand side of (A.9) similarly. We have
\begin{align*} \sum_{\tau < T^{-1}}\tau^{-1}(1+\log \tau^{-1})g(c_1\tau^{-0.1}) &\leq \sum_{\tau < T^{-1}} \tau^{-1}(1+\log \tau^{-1})g(2\tau^{-0.1})\\ &=\sum_{\tau < T^{-1}} \tau^{-1}(1+\log \tau^{-1})\cdot 10e^{-\tau^{-0.2}}. \end{align*}
As
$\sum _{\tau < 1} \tau ^{-1}(1+\log \tau ^{-1})\cdot 10e^{-\tau ^{-0.2}}$ converges, there exists sufficiently large constant
$T$ satisfying
\begin{equation} \sum_{\tau < T^{-1}}\tau^{-1}(1+\log \tau^{-1})g(c_1\tau^{-0.1}) \leq \frac{1}{20c_0}. \end{equation}
Hence, there exists constant
$T$ such that whenever
$c_1 > 2$, (A.10) and (A.11) hold. Note that there are at most
$(1+\log _2T)$ terms in each of the ranges
$1\leq \tau < T$ and
$T^{-1} \leq \tau < 1$, and that
$g(x)$ is monotonically decreasing and tends to zero as
$x$ goes to infinity. We can choose
$c_1 > 2$ sufficiently large so that
\begin{equation} \sum_{1\leq \tau < T}\tau^{-1}g(c_1\tau^{-1}) \leq (1+\log_2T)\cdot g(c_1T^{-1}) \leq \frac{1}{20c_0} \end{equation}and
\begin{equation} \sum_{T^{-1} \leq \tau < 1}\tau^{-1}(1+\log \tau^{-1})g(c_1\tau^{-0.1}) \leq (1+\log_2T)\cdot T(1+\log T)g(c_1) \leq \frac{1}{20c_0}. \end{equation} Combining inequalities (A.10), (A.11), (A.12), and (A.13), there exists a constant
$c_1$ such that
\begin{equation} \sum_{\tau \geq 1}\tau^{-1}(1+\log\tau)g(c_1\tau^{-1}) + \sum_{\tau < 1}\tau^{-1}g(c_1\tau^{-0.1}) \leq \frac{1}{5c_0}. \end{equation}
We use this constant
$c_1$ to define the function
$b(\cdot )$ in (A.6). Combining (A.9) and (A.14), we have
\[ \sum_{i = 0}^{\lfloor\log_2 m\rfloor}f_i\cdot g(b(2^i)2^{-i/2}) \leq c_0m \cdot \frac{1}{5c_0} = \frac{m}{5}. \]
Therefore, (A.8) holds. By Lemma A.2, there exists a partial coloring
$\chi : X\to \{-1, 0, 1\}$ that assigns
${\pm }1$ to at least
$m/10$ elements in
$X$ such that (A.7) holds. For this coloring
$\chi$, we may choose
$\Delta _i = b(2^i)$ in (A.4). Again we denote
$\tau = 2^i/M$, or equivalently
$2^i = \tau M$. We have
\[ \Delta_i = b(2^i) = \begin{cases} c_1\sqrt{M}\cdot \tau^{-0.5} & \textrm{if } \tau \geq 1, \\ c_1\sqrt{M}\cdot \tau^{0.4} & \textrm{if } \tau < 1. \end{cases} \]
Put this in (A.4). We know that
$\chi$ satisfies that
\[ \max_{A\in \mathcal{A}_n}|\chi(A\cap X)| \leq 4\sum_{0\leq i\leq \log_2m} \Delta_i = 4c_1\sqrt{M}\bigg(\sum_{\tau \geq 1}\tau^{-0.5} + \sum_{\tau < 1}\tau^{0.4}\bigg). \]
Note that summation of
$\tau$ is over a geometric sequence with ratio
$2$. Hence, we have
\[ \sum_{\tau \geq 1}\tau^{-0.5} \leq \frac{1}{1-2^{-0.5}} \quad \mathrm{and} \quad \sum_{\tau < 1}\tau^{0.4}\leq \frac{1}{1-2^{-0.4}}. \]
Therefore, we conclude that we can find
$\chi$ that assigns
$\pm 1$ to at least
$m/10$ elements in
$X$ and satisfies
\[ \max_{A\in \mathcal{A}_n}|\chi(A\cap X)| \leq 4c_1\sqrt{M}\bigg(\frac{1}{1-2^{-0.5}} + \frac{1}{1-2^{-0.4}}\bigg) \leq c\sqrt{M} = c\phi(n)^{1/2} \bigg(\log\frac{en}{\phi(n)}\bigg)^{1/2} \]
for some appropriate absolute constant
$c$.












