\documentclass[11pt]{amsart} \usepackage{amsmath,amssymb,amsthm} \usepackage{booktabs} \usepackage{microtype} \usepackage[margin=1.2in]{geometry} \usepackage{xcolor} \usepackage[colorlinks=true,linkcolor=blue!60!black,citecolor=blue!60!black,urlcolor=blue!60!black]{hyperref} \newtheorem{theorem}{Theorem}[section] \newtheorem{lemma}[theorem]{Lemma} \newtheorem{proposition}[theorem]{Proposition} \newtheorem{conjecture}[theorem]{Conjecture} \newtheorem{question}[theorem]{Question} \theoremstyle{remark} \newtheorem{remark}[theorem]{Remark} \newcommand{\F}{\mathbb{F}} \newcommand{\Q}{\mathbb{Q}} \DeclareMathOperator{\VC}{VCdim} \newcommand{\Leg}{\mathrm{Leg}} \newcommand{\eps}{\varepsilon} \newcommand{\leg}[2]{\left(\frac{#1}{#2}\right)} \title[VC-dimension of quadratic residues]{The VC-dimension of quadratic residues:\texorpdfstring{\\}{ }beyond the constant \texorpdfstring{$1/2$}{1/2}} \author{Xiaoyu Li} \address{University of New South Wales} \email{xiaoyulics@gmail.com} \date{30 November 2026} \begin{document} \begin{abstract} We prove that the translates of the nonzero squares in $\F_q$ have VC-dimension at least $\log_3 q - O(\log\log q) = (\log_3 2 - o(1))\log_2 q$, where $\log_3 2 = 0.6309\ldots$, breaking the classical $1/2$-barrier established by McDonald, Sahay and Wyman. More strongly, every subset of $\F_q$ of size roughly $0.84\log_2 q$ contains a shattered subset of three-quarters of its size. The proof is short and conceptual: a second-moment estimate via the Weil bound controls the number of \emph{omitted} sign patterns, and the Sauer--Shelah lemma converts the resulting abundance of realised patterns into a large shattered coordinate set. Replacing the Weil bound by the generalised Riemann hypothesis for real Dirichlet $L$-functions yields the analogous bound $\log_3 N - O(\log\log N)$ for the family of Legendre symbols $n \mapsto \leg{n}{p}$ indexed by odd primes $p \le N$, together with an explicit version valid for all $N \ge 2^{45}$. \end{abstract} \maketitle \section{Introduction} Let $q$ be an odd prime power and let $S_q \subseteq \F_q$ be the set of nonzero squares. A subset $Y \subseteq \F_q$ is \emph{shattered} by the translates of $S_q$ if every subset $A \subseteq Y$ arises as $A = Y \cap (S_q + x)$ for some $x \in \F_q$. The VC-dimension $\VC(S_q)$ is the maximum cardinality of a shattered subset of $\F_q$---equivalently, the VC-dimension of the neighbourhood system of the Paley (di)graph on $\F_q$. Counting translates gives the immediate upper bound $\VC(S_q) \le \log_2 q$. In the other direction, McDonald, Sahay and Wyman~\cite{MSW} showed that for every $\delta > 0$ and all sufficiently large $q$, \emph{every} subset of $\F_q$ of size at most $(1/2 - \delta)\log_2 q$ is shattered. In particular, \begin{equation}\label{eq:msw} \VC(S_q) \ge \Bigl(\tfrac12 - o(1)\Bigr)\log_2 q. \end{equation} For $q \equiv 1 \pmod 4$, this universal shattering property is the classical existentially closed property of Paley graphs, established by the same character-sum argument~\cite{BEH,BT}. McDonald, Sahay and Wyman conjectured that $\VC(S_q) = (1 + o(1))\log_2 q$, remarking that ``breaking the $1/2$-barrier here would require new insights''~\cite{MSW}. The constant $1/2$ has remained the best lower bound in subsequent work~\cite{RS,BBC}. Our main result breaks this barrier and raises the constant from $1/2$ to $\log_3 2 \approx 0.6309$. \begin{theorem}\label{thm:main} For every odd prime power $q \ge 2^{40}$, \[ \VC(S_q) \ge \log_3 q - 3\log_3\log_2 q - 4. \] More precisely, let $k = \lfloor(\log_2 q - 3\log_2\log_2 q - 5)/c_0\rfloor$ with $c_0 = \tfrac34\log_2 3$. Then \emph{every} $k$-element subset of $\F_q$ contains a shattered subset of size $\lceil 3k/4\rceil$, which is at least the right-hand side above. In particular, $\VC(S_q) \ge (\log_3 2 - o(1))\log_2 q$. \end{theorem} Here $k \approx 0.84\log_2 q$. Theorem~\ref{thm:main} is a quantitative consequence of a sharp finite-field criterion (Theorem~\ref{thm:finite}) that works on any prescribed $k$-element subset $Y \subseteq \F_q$. Both Theorem~\ref{thm:finite} and Theorem~\ref{thm:grh} below stem from a single combinatorial principle (Proposition~\ref{prop:abstract}): if every nontrivial Fourier coefficient of a measure on $\{\pm 1\}^k$ is small, then its high-mass support shatters a large set of coordinates. The same method governs the dual setting in which the modulus varies. For $N \ge 3$, consider the family of functions on the positive integers \[ \Leg_N = \Bigl\{\, n \mapsto \leg{n}{p} : p \text{ an odd prime},\ p \le N \Bigr\}. \] A finite set of positive integers is shattered by $\Leg_N$ if every assignment of signs $\pm 1$ on it occurs as the restriction of some member of $\Leg_N$. Trivially $\VC(\Leg_N) \le \log_2 \pi(N)$. Under the generalised Riemann hypothesis (GRH), the $1/2$-barrier $\VC(\Leg_N) \ge (\tfrac12 - o(1))\log_2 N$ follows from conditional bounds of Lamzouri, Li and Soundararajan~\cite[Theorem~1.4]{LLS} on the least prime in a coset of a subgroup of index $2^k$ in $(\mathbb{Z}/r\mathbb{Z})^*$ (with $r = 8\,l_2\cdots l_k$; for the constant pattern see also~\cite{Sch,PS}). Our method lifts this constant to $\log_3 2$ as well. \begin{theorem}\label{thm:grh} Assume the generalised Riemann hypothesis for the $L$-functions of all primitive real Dirichlet characters. Then, as $N \to \infty$, \[ \VC(\Leg_N) \ge \log_3 N - O(\log\log N), \] and a shattered set of this size lies among the first $\lfloor \log_2 N\rfloor$ primes. \end{theorem} In Section~4 we also establish an explicit version (Theorem~\ref{thm:explicit}): assuming the Riemann hypothesis for the Dedekind zeta functions of all real quadratic fields, $\VC(\Leg_N) \ge \log_3 N - 6\log_3\log_2 N - 1$ for every $N \ge 2^{45}$. A distinctive feature of Theorem~\ref{thm:grh} relative to Theorem~\ref{thm:main} is the scale of the conductors: the character sums over primes $p \le N$ involve real characters of conductor up to $N^{\Theta(\log\log N)}$, vastly exceeding the length of the sum. Accordingly, the GRH estimate for $\sum_{p \le x}\xi(p)$ is required uniformly in the conductor (Lemma~\ref{lem:grh}). The resulting logarithmic losses enter only into the secondary term $O(\log\log N)$. \begin{remark}[Status of GRH]\label{rem:status} Theorem~\ref{thm:grh} uses GRH only for the quadratic Dirichlet characters $\leg{D}{\cdot}$ attached to positive fundamental discriminants $D$. Recently, proofs of GRH for all Dirichlet $L$-functions (formalised in Lean~4)~\cite{Alp1,Alp2} and for the Dedekind zeta functions of totally real and CM fields~\cite{AxM} have been announced. Since $\zeta_{\Q(\sqrt{d})}(s) = \zeta(s) L(s, \leg{D}{\cdot})$ for squarefree $d > 1$, either result encompasses the hypotheses of Theorems~\ref{thm:grh} and~\ref{thm:explicit}. Pending independent refereeing and verification of these announcements, we state both theorems conditionally; once confirmed, they hold unconditionally and yield an affirmative answer to Question~\ref{q:uncond}. \end{remark} \subsection*{The mechanism} Fix $k$ points in $\F_q$ and consider the $2^k$ sign patterns $\eps \in \{\pm 1\}^k$ of the quadratic character on them. Expanding the count $N(\eps)$ of translates realising $\eps$ in characters yields $N(\eps) = q/2^k + \text{(error)}$, where the Weil bound controls each error term pointwise by roughly $k\sqrt{q}$. To guarantee that \emph{every} pattern is realised requires $q/2^k > k\sqrt{q}$, forcing $k < \tfrac12\log_2 q$; this pointwise threshold is the origin of the constant $1/2$ in~\cite{BEH,BT,MSW}. Yet the error terms are much smaller on average. By Parseval's identity---the $L^2$ form of the small-bias principle~\cite{AGHP}---the sum of squared deviations across all $2^k$ patterns is at most $k^2 q$, so at most roughly $k^2 4^k / q$ patterns can be omitted. Throughout the range $\tfrac12\log_2 q < k < \log_2 q$, this omitted set is a vanishing fraction of $\{\pm 1\}^k$. While an almost-full family on $k$ coordinates need not shatter all $k$ coordinates, the Sauer--Shelah lemma guarantees that it shatters some $d$-element subset as soon as the number of omitted patterns falls below $\sum_{i=d}^k \binom{k}{i}$. Pushing $k$ upward buys room at the cost of more omitted patterns; optimising $d/k$ selects the proportion $d = 3k/4$ and delivers $d \approx \log_3 q$. \subsection*{Context and related notions} The threshold $\tfrac12\log_2 q$ governs \emph{universal} shattering: the largest $m$ such that \emph{every} $m$-element set is shattered. This invariant is the \emph{family complexity} of Ahlswede, Khachatrian, Mauduit and S\'ark\"ozy~\cite{AKMS}, and coincides with the $m$-existentially-closed property for Paley graphs~\cite{BEH,BT}. For families generated by Legendre symbols of polynomial values modulo a fixed prime, the known lower bounds on family complexity likewise stand at half the trivial upper bound~\cite{Gy}, and indeed $1/2$ may be sharp for universal shattering of $S_q$~\cite[Section~5.1]{MSW}. VC-dimension relaxes universality to existence, asking merely for \emph{some} shattered set of large size. Mauduit and S\'ark\"ozy~\cite{MS} highlighted the potential gap between family complexity and VC-dimension for abstract and random set systems; for genuinely random subsets of a finite group, Rodgers and Sahay~\cite{RS} have determined the VC-dimension asymptotically. Theorem~\ref{thm:main} shows that for the translates of $S_q$, VC-dimension strictly exceeds the known lower bound for family complexity by the factor $2\log_3 2 \approx 1.262$---and indeed every subset of size $0.84\log_2 q$ already harbours a shattered subset of three-quarters of its size. Crucially, the argument exploits square-root cancellation in character sums with polynomial arguments via the Weil bound, achieving far stronger shattering than is available for general pseudorandom graphs~\cite{PSTN}. \subsection*{Notation} We write $\log_b$ for the base-$b$ logarithm and $\ln$ for the natural logarithm. The binary entropy function is $H(x) = -x\log_2 x - (1-x)\log_2(1-x)$, and we set \[ c_0 := 2 - H(3/4) = \tfrac34\log_2 3 = 1.18872\ldots\,. \] For $\eps \in \{\pm 1\}^k$ and $T \subseteq [k] = \{1,\dots,k\}$, we put $\eps_T = \prod_{i \in T}\eps_i$. A family $F \subseteq \{\pm 1\}^k$ \emph{shatters} $I \subseteq [k]$ if the projection of $F$ onto the coordinates in $I$ is all of $\{\pm 1\}^I$. \section{From small bias to shattering} This section isolates the abstract combinatorial mechanism underlying all of our theorems. \begin{lemma}[Small bias leaves few patterns omitted]\label{lem:count} Let $k \ge 1$ and $\nu \colon \{\pm 1\}^k \to \mathbb{R}$. For $T \subseteq [k]$, set $S_T = \sum_{\eps \in \{\pm 1\}^k} \eps_T\,\nu(\eps)$. Suppose that $S_\emptyset = m > 0$ and $|S_T| \le B$ for all nonempty $T \subseteq [k]$. Then \[ \#\bigl\{\eps \in \{\pm 1\}^k : \nu(\eps) \le m/2^{k+1}\bigr\} \le \frac{4^{k+1} B^2}{m^2}. \] \end{lemma} \begin{proof} Fourier inversion gives $\nu(\eps) = 2^{-k}\sum_{T \subseteq [k]} \eps_T S_T$. By orthogonality of the characters $\eps \mapsto \eps_T$, \[ \sum_{\eps \in \{\pm 1\}^k} \Bigl(\nu(\eps) - \frac{m}{2^k}\Bigr)^2 = 2^{-k}\sum_{T \neq \emptyset} S_T^2 \le B^2. \] Every $\eps$ with $\nu(\eps) \le m/2^{k+1}$ contributes at least $(m/2^{k+1})^2$ to the left-hand side, and the bound follows. \end{proof} \begin{lemma}[Almost-full families shatter large coordinate sets]\label{lem:shatter} Let $F \subseteq \{\pm 1\}^k$ and let $M = 2^k - |F|$ be the number of omitted patterns. \begin{enumerate} \item If $0 \le d \le k$ and $M < \sum_{i=d}^k \binom{k}{i}$, then $F$ shatters some $I \subseteq [k]$ with $|I| = d$. \item If $k \ge 8$ and $M < 2^{H(3/4)k - 2.81}/(k+1)$, then $F$ shatters some $I \subseteq [k]$ with $|I| = \lceil 3k/4\rceil$. \end{enumerate} \end{lemma} \begin{proof} (1) By the Sauer--Shelah lemma~\cite{Sa,Sh,VC}, any family shattering no $d$-element coordinate set has cardinality at most $\sum_{i=0}^{d-1} \binom{k}{i}$. Since $|F| = 2^k - M > \sum_{i=0}^{d-1} \binom{k}{i}$, some $d$-element set must be shattered. (2) Let $d = \lceil 3k/4\rceil$ and $x = d/k$, so that $3/4 \le x < 3/4 + 1/k \le 7/8$. The $k+1$ probabilities $\binom{k}{j} x^j (1-x)^{k-j}$ sum to $1$ and attain their maximum at $j = d$, whence $\binom{k}{d} \ge 2^{kH(x)}/(k+1)$. Because $H$ is concave and its derivative $H'(t) = \log_2((1-t)/t)$ satisfies $H'(t) \ge \log_2(1/7) > -2.81$ on $[3/4, 7/8]$, we obtain \[ H(x) \ge H(3/4) + (x - 3/4)H'(x) \ge H(3/4) - \frac{2.81}{k}. \] Consequently $\sum_{i=d}^k \binom{k}{i} \ge \binom{k}{d} \ge 2^{H(3/4)k - 2.81}/(k+1) > M$, and part~(1) applies. \end{proof} Combining the two lemmas yields the unifying criterion used throughout the paper. \begin{proposition}\label{prop:abstract} Let $k \ge 1$, let $\nu \colon \{\pm 1\}^k \to \mathbb{R}$, and let $S_T$, $m > 0$ and $B$ be as in Lemma~\ref{lem:count}. Set $F = \{\eps \in \{\pm 1\}^k : \nu(\eps) > m/2^{k+1}\}$. \begin{enumerate} \item If $0 \le d \le k$ satisfies \[ \sum_{i=d}^k \binom{k}{i} > \frac{4^{k+1} B^2}{m^2}, \] then $F$ shatters some $I \subseteq [k]$ with $|I| = d$. \item If $k \ge 8$ and \[ \frac{2^{H(3/4)k - 2.81}}{k+1} > \frac{4^{k+1} B^2}{m^2}, \] then $F$ shatters some $I \subseteq [k]$ with $|I| = \lceil 3k/4\rceil$. \end{enumerate} \end{proposition} \begin{proof} By Lemma~\ref{lem:count}, $F$ omits at most $4^{k+1} B^2 / m^2$ patterns, so Lemma~\ref{lem:shatter}(1) and~(2) apply directly. \end{proof} When $\nu/m$ is a probability distribution, $B/m$ is an upper bound on its bias in the sense of~\cite{AGHP}. \begin{remark}[Sharpness and the origin of $\log_3 2$]\label{rem:opt} Lemma~\ref{lem:shatter}(1) is best possible: the Hamming ball of vectors with fewer than $d$ entries equal to $-1$ omits exactly $\sum_{i=d}^k \binom{k}{i}$ patterns and shatters no set of size $d$. Thus the cardinality of the omitted set alone cannot force a larger shattered set. When $M \approx 4^k / q$ and $d = xk$ with $x \in [1/2, 1]$, the condition $M < \sum_{i=d}^k \binom{k}{i}$ asymptotically becomes $k(2 - H(x)) < \log_2 q$, giving \[ d \approx \frac{x}{2 - H(x)}\,\log_2 q. \] The function $x \mapsto x/(2 - H(x))$ equals $1/2$ at both endpoints $x = 1/2$ and $x = 1$, and its derivative has the sign of $2 + \log_2(1-x)$. Hence it has a unique critical point on $[1/2, 1]$, located at $x = 3/4$, where it attains its maximum $1/\log_2 3 = \log_3 2$. \end{remark} \section{Quadratic residues in finite fields} Let $q$ be an odd prime power and let $\chi$ be the quadratic character of $\F_q$, with $\chi(0) = 0$. Call a $k$-element subset $Y = \{y_1,\dots,y_k\} \subseteq \F_q$ \emph{strongly shattered} if for every $\eps \in \{\pm 1\}^k$ there exists $x \in \F_q \setminus Y$ such that $\chi(y_i - x) = \eps_i$ for all $i \in [k]$. For such $x$ none of the differences $y_i - x$ vanishes, so $Y \cap (S_q + x) = \{y_i : \eps_i = +1\}$; a strongly shattered set is therefore shattered by $S_q$ as well as by $S_q \cup \{0\}$. (This matches the convention of~\cite{MSW}.) \begin{theorem}\label{thm:finite} Let $Y \subseteq \F_q$ be a subset of size $k \ge 1$ with $k 2^k \le q$. If $0 \le d \le k$ is an integer satisfying \begin{equation}\label{eq:star} \sum_{i=d}^k \binom{k}{i} > \frac{4(k-1)^2 4^k}{q}, \end{equation} then some $d$-element subset of $Y$ is strongly shattered. \end{theorem} \begin{proof} Write $Y = \{y_1,\dots,y_k\}$. For $\eps \in \{\pm 1\}^k$, define \[ N(\eps) = \#\bigl\{x \in \F_q \setminus Y : \chi(y_i - x) = \eps_i \text{ for all } i\bigr\}, \qquad \tilde N(\eps) = \sum_{x \in \F_q} \prod_{i=1}^k \frac{1 + \eps_i \chi(y_i - x)}{2}. \] For $x \notin Y$ the product is the indicator of the event counted by $N(\eps)$; for $x = y_j$, the $j$-th factor is $1/2$ while every other factor is $0$ or $1$. Hence \begin{equation}\label{eq:tilde} N(\eps) \le \tilde N(\eps) \le N(\eps) + \frac{k}{2}. \end{equation} Expanding the product gives $\tilde N(\eps) = 2^{-k} \sum_{T \subseteq [k]} \eps_T S_T$, where \[ S_T = \sum_{x \in \F_q} \chi\bigl(f_T(x)\bigr), \qquad f_T(x) = \prod_{i \in T} (y_i - x), \qquad S_\emptyset = q. \] For every nonempty $T \subseteq [k]$, the polynomial $f_T$ is squarefree of degree $|T|$ with $|T|$ distinct roots in $\F_q$, and in particular is not a scalar multiple of a square. The Weil bound~\cite[Theorem~5.41]{LN} therefore yields $|S_T| \le (|T| - 1)\sqrt{q} \le (k - 1)\sqrt{q}$. Applying Proposition~\ref{prop:abstract}(1) to $\nu = \tilde N$ with $m = q$ and $B = (k - 1)\sqrt{q}$, hypothesis~\eqref{eq:star} shows that the family $F = \{\eps \in \{\pm 1\}^k : \tilde N(\eps) > q/2^{k+1}\}$ shatters some $I \subseteq [k]$ of size $d$. For every $\eps \in F$, it follows from~\eqref{eq:tilde} and $k 2^k \le q$ that $N(\eps) \ge \tilde N(\eps) - k/2 > q/2^{k+1} - k/2 \ge 0$, so $N(\eps) \ge 1$. Thus the subset $Y' = \{y_i : i \in I\}$ is strongly shattered: every sign pattern on $Y'$ extends to some $\eps \in F$, and any $x$ counted by $N(\eps)$ lies outside $Y \supseteq Y'$. \end{proof} \begin{proof}[Proof of Theorem~\ref{thm:main}] Let $L = \log_2 q \ge 40$, set $k = \lfloor (L - 3\log_2 L - 5)/c_0\rfloor$ and $d = \lceil 3k/4\rceil$, and let $Y \subseteq \F_q$ be any $k$-element subset. The function $L - 3\log_2 L - 5$ increases for $L \ge 5$ and exceeds $19.03$ at $L = 40$, so $k \ge 16$. Moreover $k \le L/c_0 < L$ and $2^k \le q^{1/c_0} \le q^{0.8413}$, while $L \le 2^{0.1587 L}$ for $L \ge 40$; hence $k 2^k \le q$. To verify~\eqref{eq:star}, recall from the proof of Lemma~\ref{lem:shatter}(2) that its left-hand side is at least $2^{H(3/4)k - 2.81}/(k+1)$, whereas its right-hand side is strictly less than $2^{2 + 2k - L} k^2$. Condition~\eqref{eq:star} therefore holds whenever \[ L > c_0 k + 4.81 + \log_2\bigl((k+1)k^2\bigr). \] Since $k \le L/c_0$ and $L \ge 40 > c_0/(c_0 - 1)$, we have $k + 1 \le L$, so $(k+1)k^2 \le L^3$ and \[ c_0 k + 4.81 + \log_2\bigl((k+1)k^2\bigr) \le (L - 3\log_2 L - 5) + 4.81 + 3\log_2 L = L - 0.19 < L. \] Theorem~\ref{thm:finite} now guarantees a strongly shattered subset of $Y$ of size $d$, and \[ \VC(S_q) \ge d \ge \frac{3}{4}k \ge \frac{3}{4}\Bigl(\frac{L - 3\log_2 L - 5}{c_0} - 1\Bigr) = \log_3 q - 3\log_3\log_2 q - \frac{5}{\log_2 3} - \frac{3}{4}. \] Since $5/\log_2 3 + 3/4 < 3.91 < 4$, the theorem follows. \end{proof} \begin{remark}[Small $q$ and crossover thresholds] The inequality of Theorem~\ref{thm:main} in fact holds for \emph{every} odd prime power $q$. For $\log_2 q < 19.1$ its right-hand side is negative. For $18.92 \le \log_2 q < 40$, the integer $k$ above takes the values $1,\dots,16$; since $k 2^k \le q$ and~\eqref{eq:star} are monotone in $q$, evaluating the exact binomial tails at the left endpoint of each of these sixteen intervals verifies $q \ge 2^{17} k 2^k$ and shows that the left-hand side of~\eqref{eq:star} exceeds the right-hand side by a factor of at least $2^8$, while the final chain of inequalities in the proof requires no lower bound on $q$. Table~\ref{tab:compare} compares Theorem~\ref{thm:finite} and Theorem~\ref{thm:main} with the pointwise Weil bound $k_0(q)$, defined as the largest $k$ such that $q > \bigl((k-2)2^{k-1} + 1\bigr)\sqrt{q} + k 2^{k-1}$ (the range in which the pointwise character-sum argument proves universal shattering). Across $\log_2 q \le 400$, Theorem~\ref{thm:finite} with optimal $(k, d)$ surpasses $k_0(q)$ from $q \approx 2^{49}$ onwards; the closed-form bound of Theorem~\ref{thm:main} surpasses $k_0(q)$ from $q \approx 2^{91}$ and exceeds $\tfrac12\log_2 q$ from $q \approx 2^{132}$. \end{remark} \begin{table}[ht] \centering \begin{tabular}{lrrrrrrr} \toprule $\log_2 q$ & $40$ & $60$ & $80$ & $100$ & $150$ & $200$ & $300$ \\ \midrule $k_0(q)$ (pointwise Weil bound, universal) & $17$ & $26$ & $35$ & $45$ & $69$ & $94$ & $143$ \\ Theorem~\ref{thm:finite} (optimal $k, d$) & $17$ & $28$ & $40$ & $52$ & $82$ & $113$ & $175$ \\ Theorem~\ref{thm:main} (rounded up) & $12$ & $23$ & $35$ & $47$ & $77$ & $108$ & $170$ \\ $\tfrac12\log_2 q$ & $20$ & $30$ & $40$ & $50$ & $75$ & $100$ & $150$ \\ \bottomrule \end{tabular} \vspace{0.5em} \caption{Lower bounds for $\VC(S_q)$ evaluated at $q = 2^L$ (the bounds depend only on the size of $q$). Here $k_0(q)$ is the largest integer $k$ satisfying $q > ((k-2)2^{k-1}+1)\sqrt{q} + k 2^{k-1}$.} \label{tab:compare} \end{table} \section{Legendre symbols with varying modulus} We require the classical GRH bound for character sums over primes in its conductor-uniform form. \begin{lemma}\label{lem:grh} Let $\xi$ be a primitive Dirichlet character modulo $r > 1$ and assume GRH for $L(s,\xi)$. Then for all $x \ge 2$, \[ \Bigl|\sum_{p \le x} \xi(p)\Bigr| \ll \sqrt{x}\,\ln^2(rx), \] with an absolute implied constant and no restriction on $r$ relative to $x$. \end{lemma} \begin{proof} Under GRH, $\psi(x,\xi) := \sum_{n \le x}\Lambda(n)\xi(n) \ll \sqrt{x}\,\ln^2(rx)$ uniformly for all $x \ge 2$ and $r > 1$~\cite[Chapter~20]{Dav}; see also~\cite[Theorem~5.15]{IK} (for $\ln r \ge \sqrt{x}$ the estimate is immediate from the trivial bound $\psi(x) \ll x$). Prime powers contribute $O(\sqrt{x})$, so the same bound holds for $\theta(x,\xi) := \sum_{p \le x}\xi(p)\ln p$. Partial summation then gives \[ \sum_{p \le x} \xi(p) = \frac{\theta(x,\xi)}{\ln x} + \int_2^x \frac{\theta(t,\xi)}{t\ln^2 t}\,dt \ll \sqrt{x}\,\ln^2(rx), \] since $\ln^2(rt) \le \ln^2(rx)$ on $[2,x]$ and $\int_2^x t^{-1/2}\ln^{-2} t\,dt \ll \sqrt{x}$. \end{proof} \begin{proof}[Proof of Theorem~\ref{thm:grh}] Let $l_1 < l_2 < \cdots$ denote the primes, let $8 \le k \le \log_2 N$, and consider the primes $p$ in the interval $(l_k, N]$. For $\eps \in \{\pm 1\}^k$, put \[ N(\eps) = \#\Bigl\{l_k < p \le N : \leg{l_i}{p} = \eps_i \text{ for all } i\Bigr\} = 2^{-k}\sum_{T \subseteq [k]} \eps_T S_T, \qquad S_T = \sum_{l_k < p \le N} \leg{d_T}{p}, \] where $d_T = \prod_{i \in T} l_i$. Thus $m := S_\emptyset = \pi(N) - k \ge N/(2\ln N)$ for all sufficiently large $N$. Let $T \subseteq [k]$ be nonempty, so that $d_T > 1$ is squarefree. Let $D_T > 1$ be the discriminant of the real quadratic field $\Q(\sqrt{d_T})$, namely $D_T = d_T$ if $d_T \equiv 1 \pmod 4$ and $D_T = 4 d_T$ otherwise. The Kronecker symbol $\leg{D_T}{\cdot}$ is a primitive non-principal real Dirichlet character modulo $D_T$, and $\leg{D_T}{p} = \leg{d_T}{p}$ for every odd prime $p \nmid d_T$. Setting $Q := 4\,l_1\cdots l_k$, we have $D_T \le Q$ and \[ \ln Q = \ln 4 + \sum_{i=1}^k \ln l_i \ll k\ln k \ll \ln N\,\ln\ln N. \] Since $S_T$ differs from $\sum_{p \le N}\leg{D_T}{p}$ in at most $k$ terms, Lemma~\ref{lem:grh} gives \[ |S_T| \le B := A\sqrt{N}\,(\ln N\,\ln\ln N)^2 \qquad (T \neq \emptyset) \] for an absolute constant $A > 0$. Consequently, \[ \frac{4^{k+1} B^2}{m^2} \le 16 A^2\,\frac{4^k (\ln N)^6 (\ln\ln N)^4}{N}. \] By Proposition~\ref{prop:abstract}(2), the family $\{\eps : N(\eps) > m/2^{k+1}\}$ (and hence the family of realised patterns) shatters a set of $\lceil 3k/4\rceil$ coordinates as soon as \[ \log_2 N > c_0 k + \log_2(k+1) + 6\log_2\ln N + 4\log_2\ln\ln N + C_1 \] for a suitable absolute constant $C_1$. Since $k + 1 \le 2\log_2 N$, the right-hand side is strictly bounded above by $c_0 k + 8\log_2\log_2 N + C_2$ for an absolute constant $C_2$ and all large $N$. Choosing $k = \lfloor(\log_2 N - 8\log_2\log_2 N - C_2)/c_0\rfloor$ ensures $8 \le k \le \log_2 N$ for large $N$ and yields a subset of $\{l_1,\dots,l_k\}$ of size $\lceil 3k/4\rceil \ge \log_3 N - O(\log\log N)$ shattered by primes $p \in (l_k, N]$. \end{proof} \begin{remark} The conductors $D_T$ arising above reach $Q = N^{\Theta(\log\log N)}$, well beyond the length $N$ of the prime sum. This large-conductor regime is precisely why Lemma~\ref{lem:grh} is required uniformly in $r$, and it is also the principal obstruction to an unconditional proof. \end{remark} \subsection*{An explicit bound} Weighting primes by $\ln p$ avoids partial summation and, combined with explicit GRH prime ideal estimates, yields an effective version of Theorem~\ref{thm:grh}. Write $\theta(x) = \sum_{p \le x}\ln p$ and $\psi(x) = \sum_{n \le x}\Lambda(n)$; for a number field $K$, write $\psi_K(x) = \sum_{\mathrm{N}\mathfrak{p}^j \le x} \ln\mathrm{N}\mathfrak{p}$, summed over prime ideal powers of $K$. \begin{lemma}\label{lem:explicit} \begin{enumerate} \item \cite[Corollary~1.2]{GM} Let $K$ be a number field of degree $n_K$ and absolute discriminant $\Delta_K$, and assume the Riemann hypothesis for $\zeta_K$. Then for all $x \ge 100$, \[ |\psi_K(x) - x| \le \sqrt{x}\left[\Bigl(\frac{\ln x}{2\pi} + 2\Bigr)\ln\Delta_K + \Bigl(\frac{\ln^2 x}{8\pi} + 2\Bigr) n_K\right]. \] \item \cite[(3.32) and (3.13)]{RoSc} For all $x > 0$ we have $\theta(x) < 1.01624\,x$, and for every $k \ge 6$ the $k$-th prime satisfies $l_k < k(\ln k + \ln\ln k)$. \end{enumerate} \end{lemma} \begin{theorem}\label{thm:explicit} Assume the Riemann hypothesis for the Dedekind zeta functions of all real quadratic fields. Then for every $N \ge 2^{45}$, \[ \VC(\Leg_N) \ge \log_3 N - 6\log_3\log_2 N - 1, \] and a shattered set of this size lies among the first $\lfloor 0.85\log_2 N\rfloor$ primes. \end{theorem} \begin{proof} Let $L = \log_2 N \ge 45$ and $\lambda = \ln N = L\ln 2$. Set $k = \lfloor (L - 6\log_2 L)/c_0\rfloor$ and $d = \lceil 3k/4\rceil$. The function $L - 6\log_2 L$ increases for $L \ge 9$ and exceeds $12$ at $L = 45$, so $k \ge 10$. Moreover $k \le L/c_0 < 0.8413\,L$ and $k + 1 \le L$. \emph{Step 1: the small primes.} Since $t(\ln t + \ln\ln t)$ is increasing and $\ln\ln L \le (\ln L)/e$, Lemma~\ref{lem:explicit}(2) gives \[ l_k < 0.8413\,L(\ln L + \ln\ln L) \le 1.151\,L\ln L, \qquad \theta(l_k) < 1.17\,L\ln L. \] With $Q = 4\,l_1\cdots l_k$ as before, $\ln Q = \ln 4 + \theta(l_k) \le 1.18\,L\ln L \le 0.82\,L\log_2 L$. \emph{Step 2: the weighted counts.} For $\eps \in \{\pm 1\}^k$, define \[ \nu(\eps) = \sum_{\substack{l_k < p \le N \\ \leg{l_i}{p} = \eps_i\ \forall i}} \ln p = 2^{-k}\sum_{T \subseteq [k]} \eps_T S_T, \qquad S_T = \sum_{l_k < p \le N} \leg{d_T}{p}\ln p, \] so that $m := S_\emptyset = \theta(N) - \theta(l_k)$. \emph{Step 3: the character sums.} Let $T \subseteq [k]$ be nonempty, put $\xi = \leg{D_T}{\cdot}$ and $K = \Q(\sqrt{d_T})$. Since $\zeta_K(s) = \zeta(s) L(s,\xi)$ with $L(s,\xi)$ entire, the hypothesis implies the Riemann hypothesis for $\zeta$ as well, and $\psi_K(x) = \psi(x) + \psi(x,\xi)$. Applying Lemma~\ref{lem:explicit}(1) to $K$ ($n_K = 2$, $\Delta_K = D_T \le Q$) and to $\Q$ ($n_\Q = 1$, $\Delta_\Q = 1$) gives \[ |\psi(N,\xi)| \le |\psi_K(N) - N| + |\psi(N) - N| \le \sqrt{N}\left[\Bigl(\frac{\lambda}{2\pi} + 2\Bigr)\ln Q + \frac{3\lambda^2}{8\pi} + 6\right]. \] By Lemma~\ref{lem:explicit}(2), the prime powers $p^j$ with $j \ge 2$ contribute at most \[ \psi(N) - \theta(N) = \sum_{j=2}^{\lfloor L\rfloor} \theta(N^{1/j}) < 1.01624\bigl(N^{1/2} + N^{1/3} + L N^{1/4}\bigr) \le 2\sqrt{N}. \] Because $\xi(p) = \leg{d_T}{p}$ for $p > l_k$ and the primes $p \le l_k$ contribute at most $\theta(l_k)$, we obtain \[ |S_T| \le B := \sqrt{N}\left[\Bigl(\frac{\lambda}{2\pi} + 2\Bigr)\ln Q + \frac{3\lambda^2}{8\pi} + 8\right] + \theta(l_k). \] Using $\lambda/(2\pi) < 0.1104\,L$, $3\lambda^2/(8\pi) < 0.0574\,L^2$, $\theta(l_k) \le \sqrt{N}$ and Step~1, \[ \frac{B}{\sqrt{N}} \le L^2 \log_2 L\left(0.0906 + \frac{1.64}{L} + \frac{0.0574}{\log_2 L} + \frac{9}{L^2\log_2 L}\right) \le \frac{L^2\log_2 L}{7}, \] since the bracketed factor decreases with $L$ and is less than $0.139$ at $L = 45$. \emph{Step 4: the main term.} Applying Lemma~\ref{lem:explicit}(1) to $\Q$ together with the bound on $\psi(N) - \theta(N)$ yields \[ m \ge N - \sqrt{N}\Bigl(\frac{\lambda^2}{8\pi} + 4\Bigr) - \theta(l_k) \ge 0.999\,N. \] \emph{Step 5: conclusion.} By Steps~3 and~4 and the inequality $(\log_2 L)^2 \le L$ (valid for $L \ge 45$), \[ \frac{4^{k+1} B^2}{m^2} \le \frac{4^{k+1} L^4 (\log_2 L)^2}{49 \cdot 0.998\,N} < \frac{4^k L^5}{12\,N}. \] On the other hand, since $k + 1 \le L$ and $\log_2 12 > 2.81$, \[ c_0 k \le L - 6\log_2 L < L - 5\log_2 L - \log_2(k+1) + \log_2 12 - 2.81, \] which rearranges to $4^k L^5 / (12 N) < 2^{H(3/4)k - 2.81}/(k+1)$. Proposition~\ref{prop:abstract}(2) therefore shows that the family $\{\eps : \nu(\eps) > m/2^{k+1}\}$---every member of which is realised by some prime $p \in (l_k, N]$---shatters a coordinate set of size $d$. Hence $\{l_1,\dots,l_k\}$ contains a subset shattered by $\Leg_N$ of cardinality \[ d \ge \frac{3}{4}k \ge \frac{3}{4}\Bigl(\frac{L - 6\log_2 L}{c_0} - 1\Bigr) = \log_3 N - 6\log_3\log_2 N - \frac{3}{4}.\qedhere \] \end{proof} \begin{remark} The bound of Theorem~\ref{thm:explicit} surpasses $\tfrac12\log_2 N$ from about $N = 2^{236}$ onwards. \end{remark} \section{Limits of the method and open problems} \subsection{Beyond \texorpdfstring{$\log_3 2$}{log\_3 2}} By Remark~\ref{rem:opt}, $\log_3 2$ is the exact limit of any argument that feeds an omitted-pattern bound of the form $M \le k^{O(1)} 4^k / q$ into the Sauer--Shelah lemma. Passing $\log_3 2$ therefore requires either a sharper bound on the number of omitted patterns or structural information about \emph{which} patterns are omitted. The former offers a concrete benchmark. In a random sample of $q$ patterns from $\{\pm 1\}^k$, the expected number of omitted patterns is roughly $2^k\exp(-q/2^k)$, vastly smaller than $4^k/q$ throughout $k \le 0.95\log_2 q$. Repeating the optimisation of Remark~\ref{rem:opt} with $4^k$ replaced by $2^{(2-\delta)k}$ shows that a bound $M \le k^{O(1)} 2^{(2-\delta)k}/q$ for some fixed $\delta \in (0, 0.1]$ (valid for at least one $k$-set $Y \subseteq \F_q$ at each $k \le 0.95\log_2 q$) would immediately improve the constant from $\log_3 2$ to $1/\log_2(2^{2-\delta} - 1) > \log_3 2$. Such a saving cannot be extracted from individual bounds on the character sums $S_T$: these sums genuinely reach order $\sqrt{q}$---indeed, the Weil bound is attained by $Y = \{0, 1, -1\} \subseteq \F_{p^2}$ for $p \equiv 3 \pmod 4$, where $S_Y = 2p = 2\sqrt{q}$ because the elliptic curve $y^2 = x^3 - x$ is supersingular---and Lemma~\ref{lem:count} then yields nothing beyond $4^k/q$. Progress must therefore exploit cancellation \emph{across} subsets $T$, for instance through higher moments of $N(\eps) - q/2^k$, or a carefully chosen ground set $Y$. \begin{question} Does $\VC(S_q) \ge (c - o(1))\log_2 q$ hold for some constant $c > \log_3 2$? In particular, is there a $\delta > 0$ such that for all large $q$ and all $k \le 0.95\log_2 q$, some $k$-element subset $Y \subseteq \F_q$ omits at most $2^{(2-\delta)k}/q$ sign patterns? \end{question} \subsection{The Legendre family} Random models predict that $\VC(\Leg_N)$ attains the trivial upper bound asymptotically. \begin{conjecture}\label{conj:leg} $\VC(\Leg_N) = (1 + o(1))\log_2 N$. \end{conjecture} For $N \le 10^8$, Table~\ref{tab:legendre} records the largest integer $k^*(N)$ such that all $2^k$ sign patterns on the first $k$ primes are realised by primes $97 < p \le N$ (the lower cutoff $p > 97$ ensures that $p$ exceeds the first $25$ primes, so all symbols take values in $\{\pm 1\}$). The computation is exhaustive over all primes up to $10^8$, using quadratic reciprocity. \begin{table}[ht] \centering \begin{tabular}{lrrrrrr} \toprule $N$ & $10^3$ & $10^4$ & $10^5$ & $10^6$ & $10^7$ & $10^8$ \\ \midrule $k^*(N)$ & $5$ & $7$ & $10$ & $12$ & $15$ & $18$ \\ $\tfrac12\log_2 N$ & $4.98$ & $6.64$ & $8.30$ & $9.97$ & $11.63$ & $13.29$ \\ $\log_2 N$ & $9.97$ & $13.29$ & $16.61$ & $19.93$ & $23.25$ & $26.58$ \\ \bottomrule \end{tabular} \vspace{0.5em} \caption{Exhaustive values of $k^*(N) \le \VC(\Leg_N)$, the largest $k$ such that all $2^k$ sign patterns on the first $k$ primes are realised by primes $97 < p \le N$.} \label{tab:legendre} \end{table} The ratio $k^*(N)/\log_2 N$ rises from $0.50$ at $N = 10^3$ to $0.68$ at $N = 10^8$, matching the coupon-collector heuristic $k^*(N) \approx \log_2 \pi(N) - \log_2\ln N$. Notably, $k^*(N)$ already tests a single prescribed set; proving $k^*(N) > (\tfrac12 + \delta)\log_2 N$ remains open even under GRH. \begin{question}\label{q:uncond} Is there an unconditional lower bound $\VC(\Leg_N) \ge c\log N$ for some absolute constant $c > 0$? \end{question} Aside from the conditional route noted in Remark~\ref{rem:status}, the best unconditional bound comes from a result of Lamzouri~\cite[Lemma~6.2]{Lam}: for a small absolute constant $c > 0$, every sign pattern on the primes up to $c\log N$ is realised by primes $p \le N$ (even within a fixed residue class modulo $4$), giving $\VC(\Leg_N) \gg \log N / \log\log N$. Overcoming the conductor barrier $Q = N^{\Theta(\log\log N)}$ unconditionally appears to require substantially new analytic input. \subsection{Further families} \begin{question} Does the method of Theorem~\ref{thm:finite} improve the known lower bounds on the VC-dimension of \begin{enumerate} \item[(a)] the translates of the subgroup of $r$-th powers in $\F_q$ for fixed $r \ge 3$~\cite{MSW,RS}, and \item[(b)] the families of Legendre-symbol sequences $n \mapsto \leg{f(n)}{p}$ indexed by polynomials $f$ of bounded degree~\cite{Gy,MS}? \end{enumerate} \end{question} In case~(a), McDonald, Sahay and Wyman~\cite{MSW} proved that every set of size at most $(1/2 - \delta)\log_r q$ is shattered by translates of the $r$-th powers, and conjectured that the VC-dimension is again $(1 + o(1))\log_2 q$. In both settings the Weil bound supplies an $L^2$ bound on deviations from the expected counts. For $r$-th powers with $r \ge 3$, however, the indicator is biased with density $1/r$, so passing from few omitted patterns to a large shattered set calls for an asymmetric analogue of Lemma~\ref{lem:shatter} weighted by the $1/r$-product measure; determining the resulting constant is an inviting problem. \begin{thebibliography}{99} \bibitem{AKMS} R.~Ahlswede, L.~H.~Khachatrian, C.~Mauduit and A.~S\'ark\"ozy, A complexity measure for families of binary sequences, \emph{Period.\ Math.\ Hungar.}\ \textbf{46} (2003), no.~2, 107--118. \bibitem{AGHP} N.~Alon, O.~Goldreich, J.~H\aa stad and R.~Peralta, Simple constructions of almost $k$-wise independent random variables, \emph{Random Structures Algorithms} \textbf{3} (1992), no.~3, 289--304. \bibitem{Alp1} L.~Alp\"oge, A remark on the Riemann hypothesis, preprint and Lean~4 formalization, 2026, \url{https://alpo.ge/remark.pdf}. \bibitem{Alp2} L.~Alp\"oge, with Claude, The Generalized Riemann Hypothesis for Dirichlet $L$-functions, in Lean~4, readable edition, 2026, \url{https://github.com/lsernau/grh-lean}. \bibitem{AxM} Axiom Math, Report: The extended Riemann hypothesis for Dedekind zeta functions of totally real fields, Hexagon preprint 2611.01389v1, 2026. \bibitem{BEH} A.~Blass, G.~Exoo and F.~Harary, Paley graphs satisfy all first-order adjacency axioms, \emph{J.\ Graph Theory} \textbf{5} (1981), no.~4, 435--439. \bibitem{BT} B.~Bollob\'as and A.~Thomason, Graphs which contain all small graphs, \emph{European J.\ Combin.}\ \textbf{2} (1981), no.~1, 13--15. \bibitem{BBC} I.~Byrne, J.~Byrne and S.~M.~Cioab\u{a}, The VC-dimension of strongly regular graphs, preprint, arXiv:2609.10330. \bibitem{Dav} H.~Davenport, \emph{Multiplicative Number Theory}, 3rd ed., revised and with a preface by H.~L.~Montgomery, Graduate Texts in Mathematics 74, Springer, New York, 2000. \bibitem{GM} L.~Greni\'e and G.~Molteni, Explicit versions of the prime ideal theorem for Dedekind zeta functions under GRH, \emph{Math.\ Comp.}\ \textbf{85} (2016), no.~298, 889--906; arXiv:1312.4463. \bibitem{Gy} K.~Gyarmati, On the complexity of a family related to the Legendre symbol, \emph{Period.\ Math.\ Hungar.}\ \textbf{58} (2009), no.~2, 209--215. \bibitem{IK} H.~Iwaniec and E.~Kowalski, \emph{Analytic Number Theory}, Amer.\ Math.\ Soc.\ Colloquium Publications 53, Amer.\ Math.\ Soc., Providence, RI, 2004. \bibitem{Lam} Y.~Lamzouri, The distribution of large quadratic character sums and applications, \emph{Algebra Number Theory} \textbf{18} (2024), no.~11, 2091--2131; arXiv:2212.03227. \bibitem{LLS} Y.~Lamzouri, X.~Li and K.~Soundararajan, Conditional bounds for the least quadratic non-residue and related problems, \emph{Math.\ Comp.}\ \textbf{84} (2015), no.~295, 2391--2412; corrigendum, \emph{Math.\ Comp.}\ \textbf{86} (2017), no.~307, 2551--2554; arXiv:1309.3595. \bibitem{LN} R.~Lidl and H.~Niederreiter, \emph{Finite Fields}, 2nd ed., Encyclopedia of Mathematics and its Applications 20, Cambridge Univ.\ Press, 1996. \bibitem{MS} C.~Mauduit and A.~S\'ark\"ozy, Family complexity and VC-dimension, in \emph{Information Theory, Combinatorics, and Search Theory}, Lecture Notes in Comput.\ Sci.\ 7777, Springer, Berlin, 2013, 346--363. \bibitem{MSW} B.~McDonald, A.~Sahay and E.~L.~Wyman, The VC dimension of quadratic residues in finite fields, \emph{Discrete Math.}\ \textbf{348} (2025), no.~1, Paper No.~114192; arXiv:2210.03789. \bibitem{PSTN} T.~Pham, S.~Senger, M.~Tait and Nguyen Thu-Huyen, VC-dimension and pseudo-random graphs, \emph{Discrete Appl.\ Math.}\ \textbf{365} (2025), 231--246; arXiv:2303.07878. \bibitem{PS} C.~Pomerance and I.~E.~Shparlinski, On pseudosquares and pseudopowers, in \emph{Combinatorial Number Theory} (Proc.\ Integers Conference 2007), Walter de Gruyter, Berlin, 2009, 171--184; arXiv:0712.1081. \bibitem{RS} B.~Rodgers and A.~Sahay, The VC-dimension of random subsets of finite groups, \emph{Random Structures Algorithms} \textbf{69} (2026), no.~1, e70089; arXiv:2506.14219. \bibitem{RoSc} J.~B.~Rosser and L.~Schoenfeld, Approximate formulas for some functions of prime numbers, \emph{Illinois J.\ Math.}\ \textbf{6} (1962), 64--94. \bibitem{Sa} N.~Sauer, On the density of families of sets, \emph{J.\ Combin.\ Theory Ser.~A} \textbf{13} (1972), no.~1, 145--147. \bibitem{Sch} A.~Schinzel, On pseudosquares, in \emph{Analytic and Probabilistic Methods in Number Theory} (Palanga, 1996), New Trends Probab.\ Stat.\ 4, VSP, Utrecht / TEV, Vilnius, 1997, 213--220. \bibitem{Sh} S.~Shelah, A combinatorial problem; stability and order for models and theories in infinitary languages, \emph{Pacific J.\ Math.}\ \textbf{41} (1972), no.~1, 247--261. \bibitem{VC} V.~N.~Vapnik and A.~Ya.~Chervonenkis, On the uniform convergence of relative frequencies of events to their probabilities, \emph{Theory Probab.\ Appl.}\ \textbf{16} (1971), no.~2, 264--280. \end{thebibliography} \end{document}