Random matrices: Law of the determinant

Abstract: Let $A_n$ be an $n$ by $n$ random matrix whose entries are independent real random variables with mean zero, variance one and with subexponential tail. We show that the logarithm of $|\det A_n|$ satisfies a central limit theorem. More precisely, \begin{eqnarray*}\sup_{x\in {\mathbf {R}}}\biggl|{\mathbf {P}}\biggl(\frac{\log(|\det A_n|)-({1}/{2})\log (n-1)!}{\sqrt{({1}/{2})\log n}}\le x\biggr)-{\mathbf {P}}\bigl(\mathbf {N}(0,1)\le x\bigr)\biggr|\\\qquad\le\log^{-{1}/{3}+o(1)}n.\end{eqnarray*}

\section{Introduction}\label{section:introduction}

Let $A_n$ be an $n$ by $n$ random matrix whose entries $a_{ij}, 1\le i,j\le n$, are independent real random variables of zero mean and unit variance.
We will refer to the entries $a_{ij}$ as the {\it atom} variables.

As  determinant is one of the most fundamental matrix functions,
it is a basic problem in the theory of random matrices to study the distribution
of $\det A_n$ and indeed this study  has a long and rich history.
The earliest paper we find on the subject is a paper of Szekeres and Tur\'an \cite{SzT} from 1937, in which they studied an extremal problem. In the 1950s, there is
a series of papers \cite{FT,NRR,Turan,Pre} devoted to the computation of  moments  of fixed orders of $\det A_n$ (see also \cite{Gbook}).  The explicit formula for higher moments get very complicated and in general not available, except in the case when the atom variables have some special distribution (see, for instance \cite{Dembo}).

One can use the estimate for the moments  and Markov inequality to obtain an upper bound on $|\det A_n |$. However, no lower bound was known for a long time. In particular, Erd\H{o}s asked  whether $\det A_n$ is non-zero with probability tending to one.  In 1967, Koml\'os  \cite{Kom, Kom1}  addressed this question, proving  that  almost surely $|\det A_n |  > 0$ for random Bernoulli matrices (where the atom variables are iid Bernoulli, taking values $\pm 1$ with probability $1/2$). His method also works for
much more general models.  Following \cite{Kom}, the upper  bound on the probability that
$\det A_n =0$ has been improved in \cite{KKS, TVdet, TVsing, BVW}. However, these results do not say  much about the value of $|\det A_n |$ itself.

In a recent paper \cite{TVdet}, Tao and the second author proved that for Bernoulli random matrices,
with probability tending to one (as $n$ tends to infinity)

\begin{equation} \label{TVlow}  \sqrt {n !}  \exp( -c  \sqrt { n \log n} ) \le |\det A_n | \le  \sqrt {n!} \omega(n)
\end{equation}

for any function $\omega(n)$ tending to infinity with $n$. This shows that almost surely,  $\log |\det A_n |$ is $ (\frac{1}{2} +o(1) )n \log n$, but does not provide any distributional information. For related works concerning other models of random matrices, we refer to \cite{Ro}.

In \cite{Goodman}, Goodman considered random gaussian matrices where the atom variables are iid standard gaussian variables. He noticed that in this case the determinant is a product of independent Chi-square variables. Therefore, its logarithm is the sum of independent variables and thus one expects
a central limit theorem to hold. In fact, using properties of Chi square distribution,  it is not very hard to prove

\begin{equation} \label{Girko} \frac{\log (|\det A_n|)- \frac{1}{2} \log(n-1)!}{\sqrt{\frac{1}{2} \log n}}  \rightarrow N(0,1). \end{equation}

In \cite{G2},  Girko stated that \eqref{Girko} holds
for general random matrices  under the additional assumption
that the fourth moment of the atom variables is 3.  Twenty years later,  he claimed a
much stronger result which replaced the above assumption by the assumption that the atom variables have bounded $(4 +\delta)$-th moment \cite{G}. However, there are points which are  not clear in these papers  and we have not found any researcher who can explain the whole proof to us.
 In our own attempt, we could not pass the proof of Theorem  2 in \cite{G}. In particular, definition (3.7) of this paper requires the matrix $\Xi {1 \choose k} $ to be invertible, but this assumption can easily fail.

In this paper, we provide a transparent proof for the central limit theorem of
 the log-determinant. The next question to consider, naturally, is the rate of convergence.
 We are able to obtain a rate which we believe to be
  near optimal.

We say that a random  variable $\xi$ satisfies  condition {\bf C0}  (with positive constants $C_1, C_2$) if

\begin{equation}\label{eqn:tailbound}
P(|\xi |\ge t) \le C_1\exp(-t^{C_2})
\end{equation}
for all $t>0$.

\vskip .1in

\begin{theorem}[Main theorem]\label{theorem:main}
Assume that all atom variables $a_{ij}$ satisfy condition {\bf C0} with some positive constants $C_1, C_2$. Then

\begin{equation}
\label{lim1}
\sup_{x\in \R}\Big|\P\big(\frac{\log (|\det A_n|)- \frac{1}{2} \log(n-1)!}{\sqrt{\frac{1}{2} \log n}}\le x\big) -\Phi(x)\Big|  \le \log^{-1/3 +o(1)} n.
\end{equation}
\end{theorem}

Here and later, $\Phi(x) = \P( \N(0,1) < x) = \frac{1}{\sqrt {2\pi}} \int_{-\infty}^x \exp(-t^2/2)  dt$.
In the remaining part of the paper, we will actually prove the following equivalent form,

\begin{equation} \label{lim2}
\sup_{x\in \R}\Big|\P\big(\frac{\log (\det A_n^2)- \log(n-1)!}{\sqrt{2\log n}}\le x\big) -\Phi(x)\Big| \le \log^{-1/3 +o(1)} n.
\end{equation}

To give some feeling about \eqref{lim2}, let us consider the case when $a_{ij}$ are iid standard gaussian. For $0\le i \le n-1$, let $V_i$ be the subspace generated by the first $i$ rows of $A_n$. Let $\Delta_{i+1}$ denote the distance from $\Ba_{i+1}$ to $V_{i}$, where $\Ba_{i+1}=(a_{i+1,1},\dots, a_{i+1,n})$ is the $(i+1)$-th row vector of $A_n$. Then, by the ''base times height" formula, we have

\begin{equation}\label{eqn:base-times-height}
\det A_n^2=\prod_{i=0}^{n-1}   \Delta_{i+1}^2.
\end{equation}

Therefore,

\begin{equation}\label{eqn:base-times-height1}
\log \det A_n^2=\sum_{i=0}^{n-1}  \log \Delta_{i+1}^2.
\end{equation}

As the $a_{ij}$ are iid standard gaussian,  $\Delta_{i+1}^2$ are independent Chi-square random variables of degree $n-i$.  Thus, the right hand side of \eqref{eqn:base-times-height1} is a sum of independent random variables. Notice that $\Delta^2_{i+1}$ has mean $n-i$ and variance $O(n-i)$ and is very strongly concentrated. Thus, with high probability $\log \Delta_{i+1}^2$ is roughly $\log ((n-i) + O(\sqrt {n-i}) )$ and so it is easy to show that $\log \Delta_{i+1}^2$ has mean close to $\log (n-i)$ and variance $O( \frac{1}{n-i})$. So the variance of $\sum_{i=0}^{n-1}  \log \Delta_{i+1}^2$ is $O(\log n)$. To get the precise  value $\sqrt {2 \log n}$ one needs to carry out some careful (but rather routine) calculation, which we leave as an exercise.

The reason for which we think that the rate $\log^{-1/3 +o(1)} n$ might be  near optimal is that
(as the reader will see though the proofs)
$2 \log n$ is only  an asymptotic value of the variance of $\log |\det A_n|$. This approximation has error term of order at least $\Omega (1)$ and since $\sqrt {2 \log n +\Omega (1)}$ $- \sqrt {2 \log n} =\Omega (\log^{-1/2} n)$, it seems  that one cannot have rate of convergence better than $\log^{-1/2 +o(1)} n $.  It is a quite interesting question whether one can  obtain a polynomial rate by replacing $\log (n-1)!$ and $2 \log n$ by other, relatively simple, functions of $n$.

Our arguments rely on recent developments in random matrix theory and look quite different from those in Girko's papers. In particular, we benefit from
the arguments developed in \cite{TVdet, TVhard, TVlocal}.
We also use Talagrand's famous concentration  inequality
frequently  to obtain  most of the large deviation results needed in this paper.

\begin{figure}[!ht]
\centering
\includegraphics[scale=0.50]{pic.png}
\caption{The plot compares the distributions of $(\log (\det A^2)-\log(n-1)!)/\sqrt{2\log n}$ for random Bernoulli matrices, random Gaussian matrices, and $\N(0,1)$. We sampled 1000 matrices of size 1000 by 1000 for each ensemble.}
\vskip .2in
\end{figure}

{\bf Notation.}
We say that an event $E$  holds almost surely if $\P(E)$ tends to one as $n$ tends to infinity.
For an event $A$, we use the subscript $\P_{\Bx}(A)$ to emphasize that the probability under consideration is taking according to the random vector $\Bx$.
For $1\le s \le n$, we denote by $\Be_s$ the unit vector $(0,\dots,0,1,0,\dots,0)$, where all but the $s$-th component are zero. All standard asymptotic notation such as $O, \Omega, o,...$ etc are used under the assumption that $n \rightarrow \infty$.

\section{Our approach and main lemmas}\label{section:approach}

We first make two extra assumptions about $A_n$. We assume that the entries $a_{ij}$ are bounded in absolute value by $\log^{\beta} n$ for some constant $\beta >0$ and $A_n$ has full rank with probability one.  We will prove Theorem \ref{theorem:main} under these two extra assumptions. In Appendix
\ref{appendix:model}, we will  explain why we can implement these assumptions
without violating the generality of Theorem \ref{theorem:main}.

\begin{theorem}[Main theorem with extra assumptions]\label{theorem:main1}
Assume that all atom variables $a_{ij}$ satisfy condition {\bf C0} and are bounded in absolute value by $\log^{\beta} n$ for some constant $\beta$. Assume furthermore that $A_n$ has full rank with probability one. Then

\begin{equation}
\label{lim1}
\sup_{x\in \R}\Big|\P\big(\frac{\log (|\det A_n|)- \frac{1}{2} \log(n-1)!}{\sqrt{\frac{1}{2} \log n}}\le x\big) -\Phi(x)\Big|  \le \log^{-1/3 +o(1)} n.
\end{equation}
\end{theorem}

In the first, and main, step of the proof, we prove the claim of Theorem \ref{theorem:main1}
but with the last $\log^{\alpha} n$ rows being replaced
by gaussian rows (for some properly chosen constant $\alpha$). We remark that the replacement trick was also used in \cite{G}, but for an entire different reason.  Our reason here is that for the last few rows, Lemma \ref{lemma:Talagrand} is not very effective.

\begin{theorem}\label{theorem:mainweak} For any constant $\beta >1$ the following holds for any sufficiently large constant $\alpha >0$.  Let $A_n$ be an $n$ by $n$ matrix whose entries $a_{ij}, i\le n_0, 1\le j \le n$, are independent real random variables of zero mean, unit variance and absolute values at most $\log^\beta n$. Assume furthermore that $A_n$ has full rank with probability one and the components of the last $\log^\alpha n$ rows of $A$ are independent standard  gaussian random variables. Then

\begin{equation}
\label{lim3}
\sup_{x\in \R}\Big|\P\big(\frac{\log (\det A_n^2)- \log(n-1)!}{\sqrt{2 \log n}}\le x\big) -\Phi(x)\Big| \le \log^{-1/3 +o(1)}n.
\end{equation}
\end{theorem}

In the second (and simpler) step of the proof, we carry out a replacement procedure, replacing the
gaussian rows by the original rows once at a time and show that the replacement does not effect the
central limit theorem. This step is motivated by the Lindeberg replacement
method used in \cite{TVlocal}.

We present the verification of Theorem \ref{theorem:main1} using Theorem \ref{theorem:mainweak} in Section
\ref{section:deduction}. In the rest of this section, we focus on the proof of Theorem \ref{theorem:mainweak}.

Notice that in the setting of this theorem, the variables $\Delta_i$ are no longer independent. However, with some work, we can make the RHS of \eqref{eqn:base-times-height1} into a sum of martingale differences
plus a negligible error, which lays ground for an application of a central limit theorem of martingales. (In \cite{G}, Girko also used the CLT for martingales via the base times height formula, but his analysis looks very different from ours.) We are going to use the following theorem, due to Machkouri and Ouchti \cite{MO}.

\begin{theorem}[Central limit theorem for martingales]\cite[Theorem 1]{MO}\label{theorem:martingale}
There exists an absolute constant $L$ such that the following holds.
Assume that $X_{1},\dots,X_{m}$ are martingale differences with respect to the nested $\sigma$-algebra $\CE_0,\CE_{1},\dots, \CE_{m-1}$. Let $v_m^2:= \sum_{i=0}^{m-1}\E(X_{i+1}^2|\CE_i)$, and $s_m^2:= \sum_{i=1}^{m}\E(X_{i}^2)$. Assume that $\E(|X_{i+1}^3||\CE_i) \le \gamma_i \E(X_{i+1}^2|\CE_i)$ with probability one for all $i$, where $(\gamma_i)_1^m$ is a sequence of positive real numbers. Then we have

$$\sup_{x\in \R}\Big|\P(\frac{\sum_{0\le i<m}X_{i+1}}{s_m} <x) - \Phi(x)\Big| \le L\Big(\frac{\max\{\gamma_0,\dots,\gamma_{m-1}\}\log m}{\min\{s_m,2^m\}} + \E^{1/3}(|\frac{v_m^2}{s_m^2}-1|)\Big).$$
\end{theorem}

To make use of this theorem, we need some preparation. Condition on the first $i$ rows
$\Ba_1,\dots, \Ba_{i}$, we can view $\Delta_{i+1}$ as the distance from a random vector to $V_i:= {\rm Span } \,
(\Ba_1, \dots, \Ba_i)$. Since $A_n$ has full rank with probability one, $\dim V_i =i$ with probability one for all $i$.
The following is a direct corollary of \cite[Lemma 43]{TVlocal}.

\begin{lemma}\label{lemma:Talagrand}
For any constant $\beta >0$ there
 is a constant $C_3 >0$ depending on  $\beta$  such that the following holds.
Assume that $V\subset \R^n$ is a subspace of dimension $\dim(V) \le n- 4$. Let $\Ba$ be a random vector whose components are independent variables of zero mean and unit variance
and absolute values at most $\log^{\beta} n$. Denote by $\Delta$ the distance from $\Ba$ to $V$. Then we have

$$\E(\Delta^2)=n-\dim(V) = n-i$$

and for any $t>0$

$$\P(|\Delta-\sqrt{n-\dim(V)}|\ge t) =O\big(\exp(-\frac{t^2}{\log^{C_3} n})\big).$$
\end{lemma}

Set

$$n_0 := n -\log^{\alpha} n,$$ where $\alpha$ is a sufficiently large constant (which may depend on
$\beta$).  We will use short hand $k_i$ to denote $n-i$, the co-dimension of
$V_i$ (and the expected value of $\Delta_i^2$).

We next consider each term of the right hand side of \eqref{eqn:base-times-height1} where $i<n_0$. Using Taylor expansion, we write

\begin{align*}
\log \frac{\Delta_{i+1}^2}{k_i} &= \log (1+\frac{\Delta_{i+1}^2-k_i}{k_i}) \\
&=  \frac{\Delta_{i+1}^2-k_i}{k_i}-\frac{1}{2}(\frac{\Delta_{i+1}^2-k_i}{k_i})^2+R_{i+1}\\
&:= X_{i+1}- \frac{X^2_{i+1}}{2}+R_{i+1},
\end{align*} where

$$X_{i+1} :=  \frac{\Delta_{i+1}^2-k_i}{k_i}, \mbox{ and }  R_{i+1} := \log (1+X_{i+1}) - (X_{i+1} -\frac{X_{i+1}^2}{2} ). $$

By Lemma \ref{lemma:Talagrand} and by choosing $\alpha$ sufficiently large, we have
 with probability at least $1-O(\exp(-\log^2 n))$ (the probability here is with respect to the random $(i+1)$-th row, fixing the first $i$ rows arbitrarily)

\begin{equation} \label{boundonX} |X_{i+1}|=O(k_i^{-3/8})=O((n-i)^{-3/8}) =o(1). \end{equation}

Thus, with probability  at least $1-O(\exp(-\log^2 n))$

$$|R_{i+1}|=O(|X_{i+1}|^3)=O((n-i)^{-9/8}).$$

Hence, by Bayes' formula, the following holds with probability at least $(1-O(\exp(-\log^2n)))^n=1-O(\exp(-\log^2n/2))$

$$\sum_{i<n_0}R_{i+1}=O(\sum_{i< n_0}(n-i)^{-9/8})=o(\log^{-2} n),$$   again by having
$\alpha$ sufficiently large.

We conclude that

\begin{lemma} \label{R} With probability at least $1-O(\exp(-\log^2n/2))$

$$\frac{\sum_{i< n_0} R_{i+1}}{\sqrt{2\log n} }= o(\frac{\log^{-2} n}{\sqrt{2\log n}}).$$

\end{lemma}

We will need three other lemmas

\begin{lemma}[Main contribution] \label{lemma:main1}
$$\sup_{x\in \R}\Big|\P\big(\frac{\sum_{i< n_0} X_{i+1}}{\sqrt{2\log n} }\le x\big) -\P(\BN(0,1)\le x)\Big| \le\log^{-1/3+o(1)} n.$$
\end{lemma}

\begin{lemma}[Quadratic terms] \label{lemma:main2}
$$\P\Big(\Big| \frac{ -\sum_{i< n_0} X_{i+1}^2/2 + \log n}{ \sqrt{2\log n}} \Big|  \ge \log^{-1/3+o(1)} n\Big) \le \log^{-1/3+o(1)}n .$$
\end{lemma}

\begin{lemma}[Last few rows] \label{lemma:main3}
For any constant $0 < c< 1/100$
$$\P\Big(\Big| \frac{\sum_{n_0\le i} \log \frac{\Delta_{i+1}^2}{n-i}} {\sqrt{2\log n} } \Big| \ge \log^{-1/2 +c} n \Big)=o (\exp(- \log^{c/2} n)).$$
\end{lemma}

Theorem \ref{theorem:mainweak} follows from the above four lemmas and the following trivial fact
(used repeatedly and with proper scaling)

$$ \P(A+B \le \sigma x) \le \P(A \le \sigma (x-\eps))
+ \P(B \le \sigma \eps). $$

The reader is invited to fill in the simple details.

We will prove Lemma \ref{lemma:main1} using Theorem \ref{theorem:martingale}. Lemma \ref{lemma:main2} will be verified by the moment method and Lemma \ref{lemma:main3} by
elementary properties of Chi-square variables. The key to the proof of Lemmas \ref{lemma:main1} and
\ref{lemma:main2} is an estimate on the entries of the projection matrix onto
the space $V_i^{\bot}$, presented in Section \ref{section:step2}.

\section{Proof of Lemma \ref{lemma:main1} and Lemma \ref{lemma:main2}: Opening}\label{section:step1}

Denote by $P_i=(p_{st}(i))_{s,t}$ the projection matrix onto
the orthogonal complement $V_i^\bot$.  A standard fact in linear algebra
is

\begin{equation}\label{eqn:P1}
\tr(P_i)= \sum_{s}p_{ss}(i)=k_i.
\end{equation}

Also, as  $P_i$ is a projection,  $P_i^2=P_i$. Comparing the traces we obtain

\begin{equation}\label{eqn:P2}
\sum_{s,t}p_{st}(i)^2 = \sum_s p_{ss}(i) = k_i.
\end{equation}

We now express $X_{i+1}$ using $P_i$,

$$X_{i+1}=\frac{\|P_i \Ba_{i+1}\|^2-k_i}{k_i}= \frac{\sum_{s,t}p_{st}(i)a_sa_t-k_i}{k_i} := \sum_{s,t}q_{st}(i)a_sa_t-1,$$

where $a_1=a_{i+1,1},\dots,a_n=a_{i+1,n}$ are the coordinates of the vector $\Ba_{i+1}$ and

$$q_{st}(i):=\frac{p_{st}(i)}{k_i}.$$

By \eqref{eqn:P1} and \eqref{eqn:P2} we have $\sum_{s} q_{ss}(i) =1$ and  $\sum_{s,t} q_{st}(i)^2 = \frac{1}{k_i}. $

Because $\E a_s=0$ and $\E a_s^2=1$, and the $a_s$ are mutually independent, we can show by using a routine calculation that  (see Section \ref{section:main2})

\begin{equation}\label{eqn:variance}
\E(X^2_{i+1}|\CE_i) =\frac{2}{k_i}-\sum_s {q_{ss}(i)}^2(3-\E{a_s}^4),
\end{equation}

where $\CE_i$ is the $\sigma$-algebra generated by the first $i$ rows of $A_n$.

Define

$$Y_{i+1} := -\frac{X_{i+1}^2} {2} +\frac{1}{k_i} -\frac{1}{2} \sum_s {q_{ss}(i)}^2(3-\E{a_s}^4)$$

and

$$Z_{i+1} := \frac{1}{2} \sum_s {q_{ss}(i)}^2(3-\E{a_s}^4). $$

The reason we split $-\frac{X_{i+1}^2} {2}+\frac{1}{k_i}$ into the sum of $Y_{i+1}$ and $Z_{i+1}$ is that $\E(Y_{i+1}|\CE_i)=0$ and its variance can be easily computed.

\begin{lemma}\label{lemma:main2'}
$$\P\big(|\frac{\sum_{i< n_0} Y_{i+1}}{\sqrt{2\log n}}| \ge \log^{-1/3+o(1)}\Big) \le \log^{-1/3+o(1)} n.$$
\end{lemma}

To complete the proof of Lemma \ref{lemma:main2}, we show  that the sum of the $Z_i$ is negligible

\begin{equation}\label{eqn:Z}
\P \Big(\frac{\sum_{i< n_0} Z_{i+1}}{\sqrt{2\log n}}=\Omega(\frac{\log \log n}{\sqrt{2\log n}}) \Big)=O(n^{-100}).
\end{equation}

Our main technical tool will be the following lemma.

\begin{lemma}\label{lemma:errorterm} With probability $1-O(n^{-100})$ we have
$$\sum_{i<n_0}\sum_s {q_{ss}(i)}^2=
O(\log \log n).$$
\end{lemma}

Notice that $\E a_s^4$ is uniformly bounded (by condition {\bf C0}), it follows that with probability $1- O(n^{-100})$,

$$\sum_{i<n_0}\sum_s q_{ss}(i)^2|3- \E a_s^4| =O(\log \log n), $$

proving \eqref{eqn:Z}.

\section{Proof of Lemma \ref{lemma:main1} and Lemma \ref{lemma:main2}: Mid game }\label{section:step2}

The key idea for proving Lemma \ref{lemma:errorterm} is to establish a good upper bound for $|q_{ss}(i)|$.
For this, we need some new tools. Our main ingredient is the following delocalization result, which is a variant of
a result from \cite{TVhard}, asserting that with high probability all unit vectors in the orthogonal complement of a random subspace with high dimension have small infinity norm.

\begin{lemma}\label{lemma:infinitynorm} For any constant $\beta >0$ the following holds for all sufficiently large constant $\alpha >0$.
Assume that the components of $\Ba_1,\dots, \Ba_{n_1}$, where $n_1:=n-n\log^{-4\alpha}n$, are independent random variables of mean zero, variance one and bounded in absolute value by $\log^{\beta} n$. Then with probability $1-O(n^{-100})$, the following holds for all unit vectors $\Bv$ of the space $V_{n_1}^\bot$

$$\|\Bv\|_\infty = O(\log^{-2\alpha}n).$$
\end{lemma}

\begin{proof} (of Lemma \ref{lemma:errorterm} assuming Lemma \ref{lemma:infinitynorm}) Write

\begin{align*}
S=\sum_{i\le n_1} \sum_s {q_{ss}(i)}^2 &+ \sum_{n_1  < i < n_0} \sum_s {q_{ss}(i)}^2\\
:=S_1&+S_2.
\end{align*}

Note that

$$\sum_s q_{ss}(i)^2 \le \sum_{s,t} q_{st}(i)^2 =\sum_{s,t} \frac{p_{st}(i)^2}{k_i^2} = \frac{1}{k_i}= \frac{1}{(n-i)}.$$

Hence,

$$S_1\le \sum_{i\le n_1} \sum_s  {q_{ss}(i)}^2 \le  \sum_{i\le n_1} \frac{1}{(n-i)} =O(\log \log n).$$

To bound $S_2$, note that

$$p_{ss}(i)=\Be_s^T P_i \Be_s = \|P_i\Be_s\|^2 = |\langle \Be_s,\Bv \rangle|^2$$

for some unit vector $\Bv\in V_i^\bot$.

Thus if $i> n_1$, then $V_i^\bot \subset V_{n_1}^\bot$, and hence by Lemma \ref{lemma:infinitynorm}

\begin{equation}\label{eqn:diagonal}
p_{ss}(i) \le \|\Bv\|^2_\infty = O(\log^{-4\alpha}n).
\end{equation}

It follows that

\begin{align*}
S_2&\le  \sum_{n_1 < i < n_0} \max_sp_{ss}(i) \sum_s
\frac{p_{ss}(i)}{(n-i)^2} \\
&= O(\log^{-4\alpha}n)\sum_{n_1 \le i < n_0} \frac{1}{(n-i)}=O (\log^{-4\alpha +1 }n),
\end{align*}

completing the proof of Lemma \ref{lemma:errorterm}.
\end{proof}

We now focus on the infinity norm of $\Bv$ and follow an argument from \cite{TVhard}.

\begin{proof}(of Lemma \ref{lemma:infinitynorm})
By the union bound, it suffices  to show that $|v_1|=O(\log^{-2\alpha}n)$ with probability at least $1-O(n^{-101})$, where $v_1$ is the first coordinate  of $\Bv$.

Let $B$ be the matrix formed by the first $n_1$ rows $\Ba_1,\dots, \Ba_{n_1}$ of $A$. Assume that $\Bv\in V_{n_1}^\bot$, then

$$B\Bv=0.$$

Let $\Bw$ be the first column of $B$, and $B'$ be the matrix obtained by deleting $\Bw$ from $B$. Clearly,

\begin{equation}\label{eqn:lemmas:1}
v_1\Bw=-B'\Bv',
\end{equation}

where $\Bv'$ is the vector obtained from $\Bv$ by deleting $v_1$.

We next invoke the following result, which is a variant of \cite[Lemma 4.1]{TVhard}.
This lemma was proved using a method of Guionet and Zeitouni \cite{GZ}, based on Talagrand's inequality.

\begin{lemma}[Concentration of singular values]\label{lemma:MPlaw} For any constant $\beta >0$ the following holds for all sufficiently large constant $\alpha >0$.
Let $A_n$ be a random matrix of size $n$ by $n$, where the entries $a_{ij}$ are independent random variables of mean zero, variance one and bounded in absolute value by $\log^{\beta } n$. Then for any $n/\log^\alpha n\le k\le n/2$, there exist $2k$ singular values of $M$ in the interval $[0,ck/\sqrt{n}]$, for some absolute constant $c$, with probability at least $1-O(n^{-101})$.
\end{lemma}

We can prove Lemma \ref{lemma:MPlaw} by following the arguments in \cite[Lemma 4.1]{TVhard} almost word by word.

By the interlacing law and Lemma \ref{lemma:MPlaw}, we conclude that $B'$ has $n-n_1$ singular values in the interval $[0,c(n-n_1)/\sqrt{n}]$ with probability $1-O(n^{-101})$.

Let $H$ be the space spanned by the left singular vectors of these singular values, and let $\pi$ be the orthogonal projection on to $H$. By definition, the spectral norm of $\pi B'$ is bounded,

$$\|\pi B'\| \le c(n-n_1)/\sqrt{n}.$$

Thus \eqref{eqn:lemmas:1} implies that

\begin{equation}\label{eqn:lemmas:2}
|v_1| \|\pi \Bw\| \le c(n-n_1)/\sqrt{n}.
\end{equation}

On the other hand, since the dimension of $H$ is $n-n_1$, Lemma \ref{lemma:Talagrand} implies that $\|\pi \Bw\| \ge \sqrt{n-n_1}/2$ with probability $1-4\exp(-(n-n_1)/16)=1-O(n^{-\omega(1)})$.

It thus follows from \eqref{eqn:lemmas:2} that

$$|v_1|=O(\log^{-2\alpha} n).$$
\end{proof}

\section{ Proof of Lemma \ref{lemma:main1}: End game}\label{section:main1}

Recall from Section \ref{section:approach} that conditioned on any first $i$ rows, $|X_i|=O(k_i^{-3/8})$ with probability $1-O(\exp(-\log^2n/2))$. So, by paying an extra term of $O(\exp(-\log^2n/2))$ in probability, it suffices to justify Lemma \ref{lemma:main1} for the sequence $X_i':=X_i \cdot \BI_{|X_i|=O(k_i^{-3/8})}$.

On the other hand, the sequence $X_{i+1}'$ is not  a  martingale difference sequence,  so
we slightly modify $X_{i+1}'$ to
$X_{i+1}'':=X_{i+1}' -\E(X_{i+1}'|\CE_i)$ and prove the claim for the sequence
$X_{i+1}'$. In order to show that this modification has no effect whatsoever, we first demonstrate
 that $\E(X_{i+1}'|\CE_i)$ is extremely small.

Recall that $X_{i+1}= \sum_{s,t}q_{st}(i)a_sa_t-1$. By Cauchy-Schwarz inequality
and the assumption that $a_s$ are bounded in absolute value by $\log^{O(1)} n$, we have with probability one

\begin{align}\label{bound:X}
|X_{i+1}|^2 &\le (1+\sum_{s,t}q_{st}(i)^2)(1+\sum_{s,t}a_s^2a_t^2) =(1+1/k_i) (1+\sum_{s,t}a_s^2a_t^2) \nonumber \\
&\le 2 (1+\sum_{s,t}a_s^2a_t^2)\le n^2 \log^{O(1)}n.
\end{align}

Thus  with probability one

\begin{equation}\label{eqn:expectation}
|\E(X_{i+1}'|\CE_i)| = |\E(X_{i+1}'|\CE_i) - \E(X_{i+1}|\CE_i)| \le \exp(-(\frac{1}{2}-o(1))\log^2 n).
\end{equation}

To justify Lemma \ref{lemma:main1} for the sequence $X_{i+1}''$, we  apply Theorem \ref{theorem:martingale}.

The key point here is that thanks to the indicator function in the definition of
$X_{i+1}'$ and the fact that the difference between $X_{i+1}^{''}$ and $X_{i+1}'$ is negligible,
  $X_{i+1}''$ is bounded by $O(k_i^{-3/8})$ with probability one,
so the conditions $\E(|X_{i+1}''|^3|\CE_i)\le \gamma_i \E({X_{i+1}''}^2|\CE_i)$ in Theorem
\ref{theorem:martingale}  are satisfied with

$$\gamma_i=O(k_i^{-3/8})= O(\log^{-3\alpha/8}n ).$$

We need to estimate $s_{n_0},v_{n_0}$ with respect to the sequence $X_{i+1}''$. However, thanks to
 the observations above $X_{i+1}$ and $X_{i+1}^{''}$ are very close, and so  it suffices to compute these values with respect to the sequence $X_{i+1}$.

Recall from \eqref{eqn:variance} that

$$\E(X^2_{i+1}|\CE_i) =\frac{2}{k_i}-\sum_s {q_{ss}(i)}^2(3-\E{a_s}^4).$$

Also, recall from Section \ref{section:step2} that with probability $1-O(n^{-100})$,

$$\sum_{i < n_0} \sum_s q_{ss}(i)^2 (3  - \E a_s^4) =O(\log \log n). $$

This bound, together with \eqref{eqn:variance} and \eqref{bound:X},  imply that with probability one

$$\E(\sum_{i < n_0} X_{i+1}^2| \CE_i ) = \sum_{i \le n_0} \frac{2} {k_i}   +O(\log \log n)
=2\log n +O(\log \log n),$$

which in turn implies that $v_{n_0}^2 = 2 \log n +O(\log \log n)$ with probability $1 - n^{-100}$.

Using \eqref{bound:X} again, because $n^{-100} n^2 \log^{O(1)} n =o(1)$, we deduce that

\begin{equation} \label{bound:s_m}
s_{n_0}^2 = 2\log n + O(\log \log n).
\end{equation}

With another application of \eqref{bound:X}, we obtain

$$ \E |\frac{v_{n_0}^2}{s_{n_0}^2}-1|  \le O(\frac{\log \log n}{\log n} ) + n^{-100} n^2 \log^{O(1)} n .$$

It follows that

$$ \E^{1/3} |\frac{v_{n_0}^2}{s_{n_0}^2}-1| \le \log^{-1/3+o(1)}n.$$

By the conclusion of Theorem \ref{theorem:martingale}  and setting $\alpha$ sufficiently large, we
conclude

\begin{align*}
\sup_{x\in \R}\Big|\P(\frac{\sum_{i<n_0}X_{i+1}''}{s_{n_0}} <x) - \Phi (x) \Big| &\le L \Big(\frac{\log^{-3\alpha/8}n  \times \log n_0}{s_{n_0}} + \E^{1/3}(|\frac{v_{n_0}^2}{s_{n_0}^2}-1|)\Big)\\
&\le  \log^{-1/3+o(1)} n,
\end{align*}

completing the proof of Lemma \ref{lemma:main1}.

\section{Proof of Lemma \ref{lemma:main2}: End Game}\label{section:main2}

Our goal is to justify Lemma \ref{lemma:main2'}, which together with \eqref{eqn:Z} verify
Lemma \ref{lemma:main2}.

We will show that the variance $\Var(\sum_{i<n_0}Y_{i+1})$ is small and then use Chebyshev's inequality.
The proof is based on a series of routine, but somewhat tedious calculations. We first show that the expectations of the $Y_{i+1}$'s  are zero, and so are the covariances $\E (Y_{i+1} Y_{j+1})$ by
an elementary manipulation.  The variances  $\Var (Y_{i+1})$ will be bounded from above by Cauchy-Schwarz inequality.

We start with the formula $X_{i+1}^2=(\sum_{s,t}q_{st}(i)a_sa_t)^2 -2 \sum_{s,t}q_{st}(i)a_sa_t +1$. Observe that

\begin{align*}
(\sum_{s,t}q_{st}(i)a_sa_t)^2&=(\sum_{s}q_{ss}(i)a_{s}^2 + \sum_{s\neq t}q_{st}(i)a_sa_t)^2 \nonumber \\
&=(\sum_{s}q_{ss}(i){a_s}^2)^2+(\sum_{s\neq t}q_{st}(i)a_sa_t)^2+ 2 (\sum_{s}q_{ss}(i)a_{s}^2)(\sum_{s\neq t}q_{st}(i)a_sa_t).
\end{align*}

Expand each term, using the fact that $\sum_{s}q_{ss}(i)=1$ and  $\sum_{s,t}q_{st}(i)^2 = \frac{1}{k_i}$, we have

\begin{align*}
(\sum_{s}q_{ss}(i){a_s}^2)^2&=(\sum_{s}q_{ss}(i))^2-\sum_sq_{ss}(i)^2(1-a_s^4)+2\sum_{s\neq t}q_{ss}(i)q_{tt}(i)(a_s^2a_t^2-1)\nonumber \\
&=1-\sum_sq_{ss}(i)^2(1-a_s^4)+2\sum_{s\neq t}q_{ss}(i)q_{tt}(i)(a_s^2a_t^2-1),
\end{align*}

and

\begin{align*}
&(\sum_{s\neq t}q_{st}(i)a_sa_t)^2 =2\sum_{s\neq t}q_{st}(i)^2 + 2\sum_{s\neq t}q_{st}(i)^2 (a_s^2a_t^2-1)+ 2\sum_{\scriptstyle s_1\neq t_1,s_2\neq t_2 \atop \scriptstyle \{s_1,t_1\}\neq \{s_2,t_2\}} q_{s_1t_1}(i)q_{s_2t_2}(i)a_{s_1}a_{t_1}a_{s_2}a_{t_2} \nonumber \\
&=\frac{2}{k_i} - 2\sum_{s} q_{ss}(i)^2 + 2\sum_{s\neq t}q_{st}(i)^2 (a_s^2a_t^2-1) + 2\sum_{\scriptstyle s_1\neq t_1,s_2\neq t_2 \atop \scriptstyle \{s_1,t_1\}\neq \{s_2,t_2\}} q_{s_1t_1}(i)q_{s_2t_2}(i)a_{s_1}a_{t_1}a_{s_2}a_{t_2}\big),
\end{align*}

as well as

\begin{align*}
2 (\sum_{s}q_{ss}(i)a_{s}^2)(\sum_{s\neq t}q_{st}(i)a_sa_t)= 2(\sum_{s}q_{ss}(i)(a_{s}^2-1))(\sum_{s\neq t}q_{st}(i)a_sa_t)+2 \sum_{s\neq t}q_{st}(i)a_sa_t .
\end{align*}

It follows that

\begin{align}\label{eqn:key}
&-2Y_{i+1}= X_{i+1}^2 -\frac{2}{k_i} + \sum_s {q_{ss}(i)}^2(3-\E{a_s}^4) =(\sum_{s,t} q_{st}(i)a_sa_t-1)^2 - \frac{2}{k_i} + \sum_s {q_{ss}(i)}^2(3-\E{a_s}^4)\nonumber \\
&=(\sum_{s,t}q_{st}(i)a_sa_t)^2-1-2\sum_{s}q_{ss}(i)(a_s^2-1)-2\sum_{s\neq t}q_{st}(i)a_sa_t - \frac{2}{k_i} + \sum_s {q_{ss}(i)}^2(3-\E{a_s}^4)\nonumber \\
&=-2\sum_{s}q_{ss}(i)(a_s^2-1) + \sum_s {q_{ss}(i)}^2(a_s^4-\E a_s^4)+2\sum_{s\neq t}q_{ss}(i)q_{tt}(i)(a_s^2a_t^2-1)+ 2\sum_{s\neq t}q_{st}(i)^2 (a_s^2a_t^2-1)\nonumber \\
&+ 2\sum_{\scriptstyle s_1\neq t_1,s_2\neq t_2 \atop \scriptstyle \{s_1,t_1\}\neq \{s_2,t_2\}} q_{s_1t_1}(i)q_{s_2t_2}(i)a_{s_1}a_{t_1}a_{s_2}a_{t_2} + 2 (\sum_{s}q_{ss}(i)(a_{s}^2-1))(\sum_{s\neq t}q_{st}(i)a_sa_t).
\end{align}

As $\E a_s=0, \E a_s^2=1$, and the $a_s$'s are mutually independent with each other and with every row of index at most $i$ (and in particular with $q_{st}(i)$'s), every term in the last formula is zero, and so we infer that $\E(Y_{i+1})=0$ and $\E (Y_{i+1}|\CE_i)=0$ , confirming \eqref{eqn:variance}. With the same reasoning, we
can also infer that the covariance $\E(Y_{i+1}Y_{j+1})=0$ for all $j<i$.

It is thus enough to work with the diagonal terms $\Var(Y_{i+1})$. We have

\begin{align*}
\Var(Y_{i+1})=\E \Big[&-\sum_{s}q_{ss}(i)(a_s^2-1) +\frac{1}{2} \sum_s {q_{ss}(i)}^2(a_s^4-\E a_s^4)\\
&+\sum_{s\neq t}q_{ss}(i)q_{tt}(i)(a_s^2a_t^2-1)+ \sum_{s\neq t}q_{st}(i)^2 (a_s^2a_t^2-1)\\
&+ \sum_{\scriptstyle s_1\neq t_1,s_2\neq t_2 \atop \scriptstyle \{s_1,t_1\}\neq \{s_2,t_2\}} q_{s_1t_1}(i)q_{s_2t_2}(i)a_{s_1}a_{t_1}a_{s_2}a_{t_2}+ (\sum_{s}q_{ss}(i)(a_{s}^2-1))(\sum_{s\neq t}q_{st}(i)a_sa_t)\Big]^2.
\end{align*}

After a series of cancellation, and because of Condition {\bf C0}, we have

\begin{align*}
\Var(Y_{i+1}) &\le O \Big(\E\Big[\sum_s q_{ss}(i)^2+ \sum_s q_{ss}(i)^4 +\sum_{s \neq t_1, s\neq t_2}q_{ss}(i)^2 q_{t_1t_1}(i)q_{t_2t_2}(i)\\
&+\sum_{s\neq t_1, s\neq t_2} q_{st_1}(i)^2q_{st_2}(i)^2+ \sum_{s_1 \neq t_1,s_2 \neq t_2}|q_{s_1t_1}(i)q_{s_1t_2}(i)q_{s_2t_1}(i)q_{s_2t_2}(i)|+ \sum_{s,t}q_{ss}(i)q_{tt}(i)q_{st}(i)^2\\
&+\sum_sq_{ss}(i)^3+ \sum_{s,t}q_{ss}(i)^2 q_{tt}(i)+ \sum_{s,t}q_{ss}(i) q_{st}(i)^2+\sum_{s,t}|q_{ss}(i)q_{tt}(i)q_{st}(i)|\\
&+\sum_{s,t}q_{ss}(i)^3q_{tt}(i) +\sum_{s\neq t} q_{ss}(i)^2 q_{st}(i)^2+\sum_{s,t}|q_{ss}(i)^2q_{tt}(i)q_{st}(i)| \\
&+\sum_{s,t}q_{ss}(i)q_{tt}(i)q_{st}(i)^2+\sum_{s\neq t}|q_{ss}(i)^2 q_{tt}(i)q_{st}(i)|\\
&+\sum_{s,t}|q_{st}(i)^3q_{ss}(i)|\\
&+\sum_{s \neq t_1,s\neq t_2, t_1\neq t_2}|q_{ss}(i)q_{st_1}(i)q_{st_2}(i)q_{t_1t_2}(i)|\Big]\Big),
\end{align*}

where the first two rows consist of the squares of the terms appearing in $Y_{i+1}$ (after deleting several sums of zero expected value), and each of the following rows was obtained by expanding the product of each term with the rest in the order of their appearance.

Because $\sum_{s,t}q_{st}(i)^2 = \frac{1}{k_i}$, one has $\max_{s,t}|q_{st}(i)|\le \frac{1}{\sqrt{k_i}}$ for all $s,t$. Recall furthermore that $\sum_{s}q_{ss}(i)=1$ and $0\le q_{ss}(i)$ for all $s$. We next estimate the terms under consideration one by one as follows.

Firstly, the sums $ \sum_s q_{ss}^3(i), \sum_s q_{ss}(i)^4$, $\sum_{s,t}q_{ss}(i) q_{st}(i)^2, \sum_{s,t} q_{ss}(i)^2 q_{st}(i)^2$, $\sum_{s,t}q_{ss}(i)q_{tt}(i)q_{st}(i)^2$, and $\sum_{s,t}|q_{st}(i)^3q_{ss}(i)|$ can be bounded by $\max_{s,t}|q_{st}(i)|\sum_{s,t} q_{st}^2(i)$, and so by $k_i^{-3/2}$.

Secondly, by applying Cauchy-Schwarz inequality if needed, one can bound the sums \\ $\sum_{s,t_1,t_2} q_{st_1}(i)^2q_{st_2}(i)^2$, $\sum_{s_1,t_1,s_2,t_2}|q_{s_1t_1}(i)q_{s_1t_2}(i)q_{s_2t_1}(i)q_{s_2t_2}(i)|$, and $\sum_{s,t_1,t_2}|q_{ss}(i)q_{st_1}(i)q_{st_2}(i)q_{t_1t_2}(i)|$ by $2 (\sum_{s,t}q_{st}^2(i))^2$, and so by $2k_i^{-2}$.

We bound the remaining terms as follows.

\begin{itemize}
\item $\sum_{s,t_1, t_2}q_{ss}(i)^2 q_{t_1t_1}(i)q_{t_2t_2}(i)= (\sum_sq_{ss}(i)^2) (\sum_t q_{tt}(i))^2 = \sum_sq_{ss}(i)^2.$
\vskip .3in
\item $\sum_{s,t}q_{ss}(i)^2 q_{tt}(i)+ \sum_{s,t}q_{ss}(i)^3q_{tt}(i) \le 2 (\sum_sq_{ss}(i)^2)(\sum_{t}q_{tt}(i))=2  \sum_sq_{ss}(i)^2 .$
\vskip .3in
\item $\sum_{s,t}|q_{ss}(i)q_{tt}(i)q_{st}(i)|\le \sum_{s,t}q_{ss}(i)(q_{tt}(i)^2 + q_{st}(i)^2) \le \sum_{t}q_{tt}(i)^2+ \max_{s}q_{ss}(i)\sum_{s,t}q_{st}(i)^2 $ $\le  \sum_{t}q_{tt}(i)^2 + k_i^{-3/2}.$
\vskip .3in
\item $\sum_{s,t}|q_{ss}(i)^2 q_{tt}(i)q_{st}(i)| \le \sup_{s,t}|q_{st}(i)|\sum_{s,t}q_{ss}(i)^2q_{tt}(i) \le \sum_{s}q_{ss}(i)^2/\sqrt{k_i}$.
\end{itemize}

Putting all bounds together we have

\begin{align}\label{eqn:last}
\Var(\sum_{i<n_0}Y_{i+1})=\sum_{i<n_0}\Var(Y_{i+1})&=O\Big(\E(\sum_{i<n_0} \sum_sq_{ss}(i)^2 + \sum_{i<n_0}k_i^{-3/2})\Big)\nonumber \\
&=O(\log \log n).
\end{align}

where we applied Lemma \ref{lemma:errorterm} in the last estimate.

To complete the proof, we note from the estimate of $s_{n_0}^2$ of Section \ref{section:main1}  and from Lemma \ref{lemma:errorterm} that $|\sum_{i<n_0}\E Y_{i+1}|=O(\log \log n)$. Thus by Chebyshev's inequality

$$\P\Big(|\frac{\sum_{i<n_0}Y_{i+1}}{\sqrt{2\log n}}| \ge \log^{-1/3+o(1)} n\Big) =\log^{-1/3+o(1)}n.$$

\section{Proof of Lemma \ref{lemma:main3}}\label{section:main3}

Let us first consider the lower tail; it suffices  to show

\begin{equation}\label{eqn:largeindex}
\P\big(\sum_{n_0\le i} \frac{\log \frac{\Delta_{i+1}^2}{n-i}}{\sqrt{2\log n}}< -  \log^{-1/2 +c} n \big) =o( \exp(-\log^{c/2} n))
\end{equation} for any  constant $0<c<1/100$.

By properties of the normal distribution, it  is easy to show that $\Delta_n^2$ and  $\Delta_{n-1}^2$ are at least  $\exp(-\frac{\sqrt{2}}{4}\log^{c} n)$ with probability  $1-\exp(-\Omega (\log^c n ))$, so we can omit these terms from the sum. It now suffices to show that

\begin{equation}\label{eqn:largeindex2}
\P\big(\sum_{n_0\le i \le n-3} \frac{\log \frac{\Delta_{i+1}^2}{n-i}}{\sqrt{2\log n}}< -  \frac{1}{2}  \log^{-1/2 +c} n \big) =o( \exp(-\log^{c/2} n))
\end{equation} for any small constant $0<c<1/100$.

Flipping the inequality inside the probability (by changing the sign of the RHS and swapping the denominators and numerators in the logarithms of the LHS)  and using the Laplace transform trick (based on the fact that the $\Delta^2_i$ are independent), we see that the probability in question is at most

$$ \frac{ \E \prod_{i=n_0}^{n-3}  \frac{n-i}{ \Delta_{i+1}^2 } }{ \exp( \frac{1}{\sqrt{2}} \log ^c n) }=
 \frac{  \prod_{i=n_0}^{n-3} \E  \frac{n-i}{ \Delta_{i+1}^2 } }{ \exp( \frac{1}{\sqrt{2}} \log ^c n )}.$$

Recall that $\Delta_{i+1}^2$ is a Chi-square random variable with degree of freedom $n-i$, so
$\E \frac{1}{ \Delta^2_{i+1} } = \frac{1}{ n-i-2}$.  Therefore, the numerator in the previous
formula is $\frac{(n-n_0)(n-n_0-1)}{2} \le \log^{2 \alpha} n $.

Because

$$\frac{\log^{2 \alpha} n }{ \exp( \frac{1}{\sqrt{2}} \log ^c n )} =o(\exp(-\log^{c/2} n)),$$

the desired bound follows.

The proof for the upper tail is similar (in fact simpler as we do not need to treat the first two terms
separately) and we omit the details.

\section{Deduction of Theorem \ref{theorem:main1} from Theorem \ref{theorem:mainweak}}\label{section:deduction}

Our plan is to replace one by one the last $n-n_0$
gaussian  rows of $A_n$ by vectors of components having zero mean, unit variance, and satisfying Condition {\bf C0}. Our key tool here is the classical Berry-Eseen inequality. In order to apply this lemma, we will make
a crucial use of Lemma \ref{lemma:infinitynorm}.

\begin{lemma}\cite[Berry-Esseen inequality]{B}\label{lemma:B-E}
Assume that $\Bv=(v_1,\dots,v_n)$ is a unit vector. Assume that $b_1,\dots, b_n$ are independent random variables of mean zero, variance one and satisfying condition {\bf C0}. Then we have

$$\sup_x|\P(v_1b_1+\dots+v_nb_n\le x)-\P(\BN(0,1)\le x)|\le c \|\Bv\|_\infty,$$
where $c$ is an absolute constant depending on the parameters  appearing in \eqref{eqn:tailbound}.
\end{lemma}

We remark that in the original setting of Berry and Esseen, it suffices  to assume finite third moment.

In application, $\Bv$ plays the role of the normal vector of the hyperplane spanned by the remaining $n-1$ rows of $A$, and $\Delta_n=|v_1b_1+\dots +v_nb_n|$, where $(b_1,\dots,b_n)=\Bb$ is the vector to be replaced.

For the deduction, it is enough to show the following.

\begin{lemma}\label{lemma:replacement} Let $A_n$ be a random matrix with
atom variables satisfying condition {\bf C0} and
non-singular with probability one. Assume furthermore that $A_n$ has at least one and at most
$\log^{\alpha} n$ gaussian rows. Let  $B_n$ be the random  matrix obtained from $A_n$ by replacing a gaussian row vector $\Ba$  of $A_n$ by a  random vector $\Bb=(b_1,\dots,b_n)$ whose coordinates are independent atom variables satisfying condition {\bf C0} such that  the resulting matrix is non-singular with probability one. Then

$$\sup_x \Big|\P_{B_n} \Big(\frac{\log (\det B_n^2)-\log(n-1)!}{\sqrt{2\log n}} \le x \Big) - \P_{A_n} \Big(\frac{\log (\det {A_n}^2)-\log(n-1)!}{\sqrt{2\log n}}\le x \Big)\Big|$$
\begin{equation}\label{eqn:replacement}
  \le O(\log^{-2\alpha}n).
\end{equation}

\end{lemma}

Clearly, Theorem \ref{theorem:main} follows from Theorem \ref{theorem:mainweak} by applying Lemma \ref{lemma:replacement} $\log^{\alpha}n$ times.

\begin{proof}(Proof of Lemma \ref{lemma:replacement})
Without loss of generality, we can assume that $B_n$ is obtained from $A_n$ by replacing the last row $\Ba_n$. As $A_n$ is non-singular,  $\dim(V_{n-1})=n-1$.

By Lemma \ref{lemma:infinitynorm}, by paying an extra term of $O(n^{-100})$ in probability (which will be absorbed by the eventual bound $\log^{-2\alpha}n$), we may also assume that the normal vector $\Bv$ of $V_{n-1}$ satisfies

$$\|\Bv\|_\infty=O(\log^{-2\alpha} n).$$

Next, observe that

$$\frac{\log (\det A^2)-\log (n-1)!}{\sqrt{2\log n}} = \frac{\sum_{i=0}^{n-2} \log(\Delta_{i+1}^2/(n-i)) + \log n}{\sqrt{2\log n}} + \frac{\log \Delta_n^2}{\sqrt{2\log n}} $$

and

$$\frac{\log (\det {B}^2)-\log (n-1)!}{\sqrt{2\log n}} = \frac{\sum_{i=0}^{n-2} \log(\Delta_{i+1}^2/(n-i)) + \log n}{\sqrt{2\log n}} + \frac{\log {\Delta_n'}^2}{\sqrt{2\log n}} $$

where $\Delta_n$ and $\Delta'_n$ are the distance from $\Ba_n$ and $\Bb_n$ to $V_{n-1}$ respectively.

By Lemma \ref{lemma:B-E}, it is yielded that

$$\sup_x|\P_{\Ba_n}(\Delta_n^2 \le x)-\P_{\Bb_{n}}({\Delta_n'}^2\le x)|\le c\|\Bv\|_\infty = O(\log^{-2\alpha}n).$$

Hence

$$\sup_x |\P_{\Ba_n}\Big(\frac{\log (\det A^2)-\log(n-1)!}{\sqrt{2\log n}} \le x \Big) - \P_{\Bb_n}\Big(\frac{\log (\det {B}^2)-\log(n-1)!}{\sqrt{2\log n}} \le x \Big)$$
$$
= O(\log^{-2\alpha}n),$$

completing the proof of Lemma \ref{lemma:replacement}.

\end{proof}

Random matrices: Law of the determinant


Squares in Polynomial Product Sequences

Abstract: Let F(n) be a polynomial of degree at least 2 with integer coefficients. We consider the products N_x=\prod_{1 \le n \le x} F(n) and show that N_x should only rarely be a perfect power. In particular, the number of x \le X for which N_x is a perfect power is O(X^c) for some explicit c<1. For certain F(n) we also prove that for only finitely many x will N_x be squarefull and, in the case of monic irreducible quadratic F(n), provide an explicit bound on the largest x for which N_x is squarefull.

\section{Introduction}

Several papers have recently been published concerning how often $$ N_x =\prod_{n\le x} F(n) $$ can be a perfect square, given an irreducible polynomial $F(n)$ with integer coefficients.  Cilleruelo proved in \cite{Cil} that if $F(n) = n^2+1$ then $N_x$ is a perfect square only when $x=3$.  Fang, using Cilleruelo's method, proved in \cite{Fang} that if $F(n) = 4n^2 +1$ or $F(n) = 2n(n-1) + 1$ then $N_x$ is never a perfect square, and G\"{u}rel and \"{O}zg\"{u}r Ki\c{s}isel proved in \cite{G} that if $F(n)=n^3+1$ then $N_x$ is never squarefull.  Conjectures regarding these products were initially put forth in \cite{Amd}, as they related to studying arithmetical properties of the arctangent function.

Cilleruelo, et al., in \cite{Cil2}, later showed that if $F(n)$ is an irreducible polynomial of degree at least $2$, then the number of times $N_x/d$ is a perfect square for $x$ in the interval $[M,M+N]$ is $$\ll N^{11/12} \left(\log{N}\right)^{1/3}$$ uniformly over all positive square-free integers $d$ and all positive integers $M$.

In this paper, we examine how often $ N_x =\prod_{n\le x} F(n) $ will be a perfect power or squarefull for more general $F(n)$.

If $F(n)$ is an irreducible monic quadratic, then we can provide an explicit bound on the largest $x$ for which $N_x$ can be squarefull.

We will also show that if $F(n)$ can be factored into linear and quadratic terms and given some conditions on the leading coefficient of the linear terms and discriminant of the quadratic terms, then $N_x$ will be squarefull for only finitely many $x$.  These conditions are general enough to cover some large collections of polynomials $F(n)$, such as all $F(n)$ that are the product of two or three distinct irreducible quadratics.  However, these proofs are not strong enough to provide explicit bounds.

More generally, we can show that if $F(n)$ is not of the form $s G(n)^p$ where $s$ is a rational number and $G(n)\in \mathbb{Z}[n]$, then $N_x$ is a perfect $p^{th}$ power for at most $O(X^{c_p})$ of the $x < X$ for some explicit $c_p < 1$.

In this paper, all polynomials denoted by lower-case letters are assumed to be irreducible over the rationals and have integer coefficients.  We denote the discriminant of a quadratic polynomial $f_i(n)$ by $D_i$.  Also, we assume $x \ge 1$ is integer-valued.

\section{The case $F(n) = n^2 +D$}
We wish to find an upper bound on those $x > 0$ for which
$$N_x := \prod_{n \leq x} \left(n^2 + D \right)$$
is squarefull.  Here, $D$ is a positive integer.  In particular, we will show that the bound $e^{C \cdot D}$ works, where $C$ is a constant that is effectively computable.
We start with the following proposition.
\begin{prop}\label{p:mainlemma}
If $a$ and $q$ are coprime natural numbers and $z$ a positive real number, then
$$S(z;q,a) := \left| \sum_{\substack{p \leq z \\ p \equiv a (q)}} \frac{\log p}{p} - \frac{1}{\phi(q)}\log z \right| = O(1),$$
where the constant implied by the Big-Oh expression can be effectively computed and is independent of $a$ and $q$.
\end{prop}

\begin{pf}
Here we use a method of proof similar to that employed by Pomerance in \cite{PomAmicable}.

Suppose that $z \geq e^{q^{2/3}}$.  Define
$$\theta(z;q,a) := \sum_{\substack{p \leq z \\ p \equiv a (q)}} \log p.$$
Now,
\begin{eqnarray*}
\sum_{\substack{p \leq z \\ p \equiv a (q)}} \frac{\log p}{p} &=& \frac{1}{z} \theta(z;q,a) - \frac{1}{2} \theta(z;q,a) + \int_2^z \frac{\theta(t;q,a)}{t^2} dt \\
&\leq& \frac{1}{z} \theta(z;q,a) + \left( \int_2^{q} + \int_{q}^{e^{q^{1/2}}} + \int_{e^{q^{1/2}}}^{e^{q^{2/3}}} + \int_{e^{q^{2/3}}}^z \right) \frac{\theta(t;q,a)}{t^2} dt. \\
\end{eqnarray*}
To bound the first term, we use the bound $\theta(z) \leq 2z\log 2$.  This follows from the inequality $\prod_{p \leq n} p \leq 4^n$ (see for example \cite{Rose}).  Hence
$$\frac{1}{z} \theta(z;q,a) \leq \frac{1}{z}\theta(z) \leq 2\log 2.$$
For the first of the four integrals, we note that each of
$$\sum_{\substack{p \leq q \\ p \equiv a (q)}} \frac{\log p}{p} \text{  and  } \frac{1}{q} \sum_{\substack{p \leq q \\ p \equiv a (q)}} \log p $$
is bounded by $1$, so by partial summation
$$\int_2^{q} \frac{\theta(t;q,a)}{t^2} dt \leq 3.$$
Since $\theta(z;a,q) \leq (1+z/q) \log{z} \leq \frac{2z \log z}{q}$ when $z \geq q$,
$$ \int_{q}^{e^{q^{1/2}}} \frac{\theta(t;q,a)}{t^2} dt \leq \int_{q}^{e^{q^{1/2}}} \frac{2\log t}{q t} dt \leq 1.$$
Now, the Brun-Titchmarsh theorem in the form of Montgomery and Vaughan (see \cite{MontgomeryVaughan}) gives us that
$$\pi(z;q,a) \leq \frac{2z}{\phi(q)\log (z/q)}$$
for $z>q$.  So for $z> e^{q^{1/2}}$,
$$\theta(z;a,q) \leq \frac{2z}{\phi(q)}\left( \frac{1}{1 - \frac{\log q}{\log z}} \right) \leq \frac{8z}{\phi(q)},$$
using elementary calculus.  Hence
$$\int_{e^{q^{1/2}}}^{e^{q^{2/3}}} \frac{\theta(t;q,a)}{t^2}dt \leq \frac{8}{\phi(q)} \int_{e^{q^{1/2}}}^{e^{q^{2/3}}} \frac{dt}{t} \leq \frac{8q^{2/3}}{\phi(q)}.$$
If $z \geq e^{q^{2/3}}$ then by the prime number theorem for arithmetic progressions (see \cite{Davenport} p. 123),
$$\left| \theta(z;q,a) - \frac{z}{\phi(q)} \right| \leq Aze^{-c(\log z )^{1/8}} $$
where $A$ and $c$ are positive absolute constants.  Then since
$$\int_{e^{q^{2/3}}}^z \frac{1}{\phi(q) t} dt = \frac{1}{\phi(q)} \log z - \frac{q^{2/3}}{\phi(q)},$$
and since $Ae^{-c(\log z )^{1/8}} \leq \frac{A'}{(\log z)^2}$ for some $A'$ depending on $A$ and $c$, we have
\begin{eqnarray*}
\left| \int_{e^{q^{2/3}}}^z \frac{\theta(t;q,a)}{t^2} dt - \frac{1}{\phi(q)}\log z \right| &\leq& \frac{q^{2/3}}{\phi(q)} + \int_{e^{q^{2/3}}}^z \frac{Ae^{-c(\log t)^{1/2}}}{t} dt \\
&\leq& \frac{q^{2/3}}{\phi(q)} + \int_{e^{q^{2/3}}}^z \frac{A'}{t \log^2 t} dt \\
&\leq& \frac{q^{2/3}}{\phi(q)} + \frac{A'}{q^{2/3}}
\end{eqnarray*}
Thus
\begin{eqnarray*}
S(x;q;a) &=& \left| \sum_{\substack{p \leq z \\ p \equiv a (q)}} \frac{\log p}{p} - \frac{1}{\phi(q)}\log z \right| \\
&\leq& 4 + 2 \log 2 + \frac{9q^{2/3}}{\phi(q)} + \frac{A'}{\phi(q)}.
\end{eqnarray*}
Since $q^{2/3}/\phi(q)$ can be effectively bounded, this completes the proof of the proposition for $z > e^{q^{2/3}}$.  For smaller values of $z$, one can simply truncate the expansion of
$$\sum_{\substack{p \leq z \\ p \equiv a (q)}} \frac{\log p}{p}$$
as a sum of integrals at the appropriate place to obtain a similar bound. $\Box$ \end{pf}

\begin{rem}
Using the Brun-Titchmarsh estimate we can show that
$$\frac{1}{z} \theta(z;q,a)  = \frac{\log{p(q;a)}}{p(q;a)} + O\left(\frac{\log q}{q}\right)$$
where $p(q;a)$ denotes the first prime $p \equiv a \Mod q$ and that, after a suitable adjustment to the bounds of integration, the remaining terms are $O(q^{-1/3})$.  One obtains the result
$$S(z;q,a) = \frac{\log{p(q;a)}}{p(q;a)} + O(q^{-1/3})$$
for $x>e^{q^{2/3}}$, where the implied constant is independent of $a$ and $q$.
\end{rem}

We have that if $E$ is a set of residue classes mod $q$, then
$$\left| \sum_{\substack{p \leq x \\ p \in E}} \left( \frac{\log p}{p-1} - \frac{\log p}{p} \right) \right| \leq 1. $$
Thus as a corollary to Proposition \ref{p:mainlemma} we have that for some constant $C_0$
\begin{equation}\label{eq:firstcorollary}
\sum_{\substack{p \leq x \\ p \in E}} \frac{\log p}{p-1} \leq \frac{|E|}{\phi(q)} \log x +  |E|C_0
\end{equation}

\begin{prop}\label{p:littleLemma}
The number $N_x$ satisfies
$$\log N_x \geq 2x \log x - 2x.$$
\end{prop}
\begin{pf}
Note that $e^x \geq \frac{x^x}{x!}$ by Taylor series, so $x! \geq \left( \frac{x}{e} \right)^x$, hence
$$\sum_{n \leq x} \log{n} \geq x\log{x} - x.$$
Then since $\log(x^2 + D) \geq 2 \log x$, we have
$$\log N_x \geq 2 \sum_{n \leq x} \log n  \geq  2x \log x - 2x.$$ $\Box$ \end{pf}

\begin{prop}
There is a prime factor $p_x$ of $N_x$ satisfying $p_x> \frac{1}{72}x\log x$ for all $x$ larger than $C_1e^{C_2 D} = \exp \{(\frac{8}{5}((4C_0+8)D+2)\}$, where $C_0$ is the constant defined in ~(\ref{eq:firstcorollary}).
\end{prop}
\begin{pf}
Let $k = \frac{1}{72}$.  For a given $x$, let $\alpha_p$ be defined for each prime $p$ so that $N_x = \prod_p p^{\alpha_p}$.  Now, $p|N_x$ only when $p|D$, or when $p\nmid D$ and $-D$ is a quadratic residue mod $p$.  The latter occurs only for a particular set $S$ of residue classes mod $4D$ with $2\left| S \right| = \phi(4D)$.  Hence
$$N_x = \prod_{p|D} p^{\alpha_p} \prod_{p \in S} p^{\alpha_p}$$
where by a slight abuse of notation we take $p \in S$ to mean $p \Mod {4D} \in S$.  Now, if $p \nmid D$, then each interval of length $p^j$ contains at most $2$ solutions of $n^2+D \equiv 0 \Mod {p^j}$.  So
\begin{eqnarray}
\alpha_p &\leq& \sum_{j \leq \frac{\log (x^2 + D)}{\log p}} 2 \lceil x/p^j \rceil \label{eq:alphaNotD}\\
&\leq& 2x \sum_{j \leq \frac{\log (x^2+D)}{\log p}} \frac{1}{p^j} + 2\frac{\log (x^2 + D)}{\log p } \nonumber \\
&\leq& \frac{2x}{p-1} + 2\frac{\log (x^2 + D)}{\log p } \nonumber
\end{eqnarray}
On the other hand, if $p|D$, we write $D = p^{e_0}D'$, with $p \nmid D'$.  Then as a result of Huxley (see \cite{Huxley}) we have that $n^2 + D \equiv 0 \Mod {p^j}$ has at most $2p^{e_0}$ solutions.  By an argument similar to that in~(\ref{eq:alphaNotD}) we have
\begin{equation}\label{eq:alphaD}
\alpha_p \leq \frac{2p^{e_0}x}{p-1} + 2p^{e_0}\frac{\log (x^2 + D)}{\log p }.
\end{equation}
If the claim in the proposition does not hold, then there is an $x > C_1 e^{C_2 D}$ such that
$$N_x = \prod_{\substack{p \leq kx \log x \\ p|D}} p^{\alpha_p} \prod_{\substack{p\leq kx \log x \\ p \in S}} p^{\alpha_p}.$$
To estimate $\log N_x$ with $N_x$ in this form, we use Chebyshev's inequality $\pi(x) < 2 \frac{x}{\log x}$ as given in \cite{CrandalPomerance}.  Also, note that for $x$ in the prescribed range
\begin{equation}\label{eq:log}
\log(x^2 + D) \leq 3 \log x.
\end{equation}
Since $k > x^{-1/3}$ we have $\log(kx\log x) \geq \frac{2}{3}\log x$, so
\begin{equation}\label{eq:piPoly}
\pi(kx \log x) \log( x^2 + D)\leq 6 \frac{k x \log^2 x}{\log(kx \log x )} \leq \frac{1}{8}x \log x.
\end{equation}
Now, certainly we have that $kx\log x > D$ for $x > C_1 e^{C_2 D}$, so by ~(\ref{eq:alphaD}) and ~(\ref{eq:log})
\begin{eqnarray*}
\sum_{\substack{p \leq kx \log x \\ p|D}} \alpha_p \log p &\leq& 2x \sum_{p|D}p^{e_0} \frac{\log p}{p-1} + 2  \sum_{p|D} p^{e_0} \frac{\log (x^2 + D)}{\log p }\\
&\leq& 2x \sum_{p|D}p^{e_0} + 2 \log(x^2 + D) \sum_{p|D}p^{e_0} \\
&\leq& 2x \prod_{p|D}p^{e_0} + 2 \left( 3 \log{x} \right) \prod_{p|D}p^{e_0} \\
&\leq& 8Dx.
\end{eqnarray*}
Now, if $x$ is in the prescribed range then $\log x \leq x^{1/8}$, so by ~(\ref{eq:alphaNotD}), ~(\ref{eq:piPoly}) and ~(\ref{eq:firstcorollary}) we have
\begin{eqnarray*}
\sum_{\substack{p \leq kx \log x \\ p \in S}} \alpha_p \log p &\leq& 2x \sum_{\substack{p \leq kx \log x \\ p \in S}} \frac{\log p}{p-1} + 2 \log(x^2+D) \sum_{\substack{p \leq kx \log x \\ p \in S}} 1\\
&\leq& 2x \left( \frac{|S|}{\phi(4D)}\log(kx \log x) +|S|C_0 \right) + 2 \pi(kx \log x) \log(x^2+D)\\
&\leq& x \log(k x^{9/8}) + \phi(4D)C_0x + \frac{1}{4} x \log x \\
&\leq& \frac{11}{8} x \log x + 4 C_0 D x.
\end{eqnarray*}
So
\begin{eqnarray*}
\log N_x &=& \sum_{\substack{p \leq kx \log x \\ p|D}} \alpha_p \log p + \sum_{\substack{p \leq kx \log x \\ p \in S}} \alpha_p \log p\\
&\leq& \frac{11}{8} x \log x + 4 C_0 D x + 8 D x
\end{eqnarray*}
Thus by Proposition \ref{p:mainlemma} we have
$$\frac{5}{8} x \log x \leq (4 C_0 D +8D + 2) x $$
hence $x \leq e^{8((4C_0 + 8)D + 2)/5}$.  This is a contradiction to our earlier assumtion that $x > C_1 e^{C_2 D}$. $\Box$ \end{pf}
\begin{thm}\label{th:theorem}
For any $x$ larger than $C_1 e^{C_2 D}$ the number $N_x$ is not squarefull.
\end{thm}
\begin{pf}
If $N_x$ is squarefull and $p|N_x$, then either $p^2|n^2+D$ for some positive integer $n \leq x$ or $p|n^2+D$ and $p|m^2+D$ for some distinct positive integers $n,m \leq x$.  In the first case, we have
$$p\leq \sqrt{x^2+D} \leq x + D \leq 2x$$
since $x>D$.  In the second case, we have that $p$ divides $n^2 - m^2 = (n-m)(n+m)$, so $p \leq 2x$.  If $x$ is in the range given in the theorem, then
$$2x < k x \log x < p_x$$
for some $p_x$ dividing $N_x$, a contradiction. $\Box$ \end{pf}

\begin{rem}
If we take $F(n)$ to be any irreducible monic quadratic, we can apply the above technique to $|N_x|$ to obtain similar results.  Write $F(n) = (n - \alpha)^2 +D$; there is a constant $C_f < 0$ such that
$$\log \left|1- \frac{2 \alpha}{n} + \frac{\alpha^2 + D}{n^2} \right| > C_f.$$
Modifying Proposition ~\ref{p:littleLemma} we get
\begin{eqnarray*}
\log |N_x| &\geq& 2 \sum_{n \leq x} \log{n} + C_f x \\
&\geq& 2x \log{x} - 2x + C_f x.
\end{eqnarray*}
The rest of the proof of Theorem ~\ref{th:theorem} holds with only slight modification.  One obtains the result that $N_x$ is not squarefull for any $x$ larger than $\exp\{\frac{8}{5}(2 - C_f +4C_0 D + 8D) \}$.
\end{rem}

\section{Products of quadratics}

The main result of this section relies on the following theorem, proved in two separate cases by Duke, Friedlander, and Iwaniec in \cite{DFI} and T{\'o}th in \cite{Toth}.

\begin{thm}\label{DFIT}

If  $f(n)$ be an irreducible quadratic polynomial with integer coefficients, and $0 \le \alpha < \beta \le 1$, then $$K_x= \# \left\{ (p,v) | 0 \le v < p \le x, f(v) \equiv 0 \pmod{p},\alpha \le \frac{v}{p} < \beta \right\} \sim (\beta - \alpha)\pi (x)$$ where $v \in \mathbb{Z}$, $p$ prime, and the asymptotic relation holds as $x \to \infty$.

\end{thm}

We begin by presenting two lemmas derived from this result, which we will often refer to as the DFIT result, after its various authors.

\begin{lem}\label{DFITlem}
Let $f(n)=n^2+bn+c$ be a monic quadratic polynomial, and let $\epsilon > 0$.  Then there exists $\delta=\delta(\epsilon)$ and $x_0$ such that for all $x > x_0$, at least $(\frac{1}{2}-\epsilon)(\pi(2x)-\pi((2-\delta)x))$ of the primes between $(2-\delta)x$ and $2x$ divide $N_x=\prod_{n\le x} f(n)$ exactly one time.

\end{lem}

\begin{pf}

In particular we will choose $\delta$ such that $1/2+\epsilon /2 > 1/(2-\delta)$.

We first note that for all sufficiently large $x$, $(2-\delta)^2 x^2 > f(x)$, so any prime $p \in \left[(2-\delta)x, 2x\right]$ can only divide any given $f(n)$ at most one time.  Thus the number of times $p$ divides $N_x$ equals the number of $n \le x$ for which $f(n) \equiv 0 \pmod{p}$.

We rewrite this last condition as $$\left( n+\frac{b}{2} \right)^2 \equiv \frac{b^2 - 4 c}{4} \pmod{p}$$ and then write $b/2$ in reduced terms as $B/A$ and first handle the case where $A=1$.

Then if we use the interval $$\left( \frac{1}{2-\delta}+\frac{\epsilon}{4} , 1-\frac{\epsilon}{4} \right)$$ and the polynomial $\overline{f}(n)=(2n)^2-(b^2-4c)$ in the DFIT result, we see that the number of pairs $(v,p)$, for which $0 \le v < p$, $(2-\delta)x < p < 2x$, $p | \overline{f}(v)$ and $$\frac{v}{p} \in \left( \frac{1}{2-\delta}+\frac{\epsilon}{4}, 1-\frac{\epsilon}{4} \right),$$ tends asymptotically to $\delta (1-\frac{\epsilon}{2} - \frac{1}{2-\delta}) \frac{x}{\log{x}}$, as $K_{2x} \sim 2 (1-\frac{\epsilon}{2} - \frac{1}{2-\delta}) \frac{x}{\log{x}}$ and $K_{(2-\delta)x} \sim (2-\delta) (1-\frac{\epsilon}{2} - \frac{1}{2-\delta}) \frac{x}{\log{x}}$.

If $\overline{f}(v) \equiv 0 (\textrm{mod} \quad p)$, then $v^2 \equiv (b^2 - 4 c)/4$.  If we set $n=v-B$, this gives us a solution to $f(n)\equiv 0 (\textrm{mod} \quad p)$.   We can pick $x$ to be large enough so that $B/p < \epsilon / 20$.  So, $$\frac{n}{p} \in  \left( \frac{1}{2-\delta}+\frac{\epsilon}{5}, 1-\frac{\epsilon}{5} \right)$$ with $0 < n < p$.  This implies that $$n > p \left(\frac{1}{2-\delta}+\frac{\epsilon}{5}\right)> (2-\delta)x \left(\frac{1}{2-\delta}+\frac{\epsilon}{5}\right) > x + \frac{\epsilon}{5}.$$  So this particular $p$ can only divide $N_x$ at most once.

Moreover, each pair $(v,p)$ corresponds in a one to one ratio with pairs $(p-v,p)$, with $0 \le p-v < p$, $(2-\delta)x < p < 2x$, $p | \overline{f}(p-v)$ and $$\frac{v}{p} \in \left( \frac{1}{2-\delta}+\frac{\epsilon}{4}, 1-\frac{\epsilon}{4} \right),$$ which is the same thing as $$\frac{p-v}{p} \in \left( \frac{\epsilon}{4}, 1-\frac{1}{2-\delta}-\frac{\epsilon}{4} \right).$$  Again setting $n=p-v-B$ and extending the bounds to allow $$\frac{n}{p} \in \left( \frac{\epsilon}{5}, 1-\frac{1}{2-\delta}-\frac{\epsilon}{5} \right),$$ we can see that $$n < p (1-\frac{1}{2-\delta}-\frac{\epsilon}{5}) < 2x (1-\frac{1}{2-\delta}-\frac{\epsilon}{5} ) < x,$$ so that this $p$ must divide $N_x$ at least once, and hence, by the last paragraph, exactly once.

As there are asymptotically $\delta \frac{x}{\log{x}}$ primes in the interval $(2-\delta)x $ to $ 2x$, and our choice of $\delta$ implies $$1-\frac{\epsilon}{2} - \frac{1}{2-\delta} > \frac{1}{2} - \epsilon,$$ we have proved the lemma in this case.

For the case $A=2$, we need to consider how $B/A$ acts modulo $p$.  For all odd primes, $1/2 \equiv (p+1)/2$.  Since $p$ is odd, $(p+1)/2$ is an integer so this represents a solution to $1/2 \pmod{p}$.  Therefore $B/2 \equiv B (p+1)/2$.  If we call this latter integer $k$, $0 \le k < p$, then note that $k/p$ tends towards $1/2$ as $p$ grows since $B$ is a fixed odd number.

From here, the proof of the second case proceeds identically to that of the first case, except that we use the interval $$\left( \frac{1}{2-\delta} -\frac{1}{2}+\frac{\epsilon}{4}, \frac{1}{2}-\frac{\epsilon}{4}  \right)$$ in the DFIT result and set $n=v-k$ or $n=p-v-k$ as appropriate. $\Box$ \end{pf}

\begin{rem}
Clearly the previous proof also works if $f(n)=an^2+bn+c$, where $a|b$ or $2a|b$.  In general though, the $b/2a$ term is only well-behaved over primes of a specific congruence class, and the DFIT result does not address the equidistribution of $v/p$ for primes $p$ of a specific congruence class, so we do not yet know how to extend the above lemma.
\end{rem}

\begin{lem}\label{oneprime}

Let $f(n)$ be an irreducible monic quadratic polynomial with integer coefficients, and $2 < a < b$.  Then for all sufficiently large $x$, there exists a prime $p$, $ax < p < bx$, such that $p | \prod_{n \le x} f(n)$.

\end{lem}

\begin{pf}

Consider pairs $(p,v)$ for which p divides $f(v)$, with $ax \le p \le bx$, and $0 \le v/p \le 1/b$. By DFIT, the number of such pairs is asymptotically $(1-a/b) x/\log{x}$. In particular, there is always such a pair once $x$ is sufficiently large. But for this pair, we have $v \le p/b \le x$, so that $p$ divides $f(v)$, which itself divides $\prod_{n \leq x} f(n).$ $\Box$ \end{pf}

Cilleruelo, in his proof, used the fact that if $N_x$ is a perfect square, then all primes dividing it must be less than $2x$, so the previous lemma provides an alternative proof that $\prod_{n \le x} (n^2+1)$ is not infinitely often a square.  We can generalize this idea a little further with the help of the following lemmas.

\begin{lem}

If $f_1(n) = a_1 n^2 + b_1 n + c_1$ and $f_2(n) = a_2 n^2 + b_2 n + c_2$ are two distinct quadratic polynomials such that $D_1 D_2$ is a square, then the largest prime $p$ that can divide both $N_x = \prod_{n \le x} f_1(n)$ and $M_x = \prod_{n \le x} f_2(n)$ is bounded by $cx$ for some positive constant $c$ and sufficiently large $x$

\end{lem}

\begin{pf}

We can rewrite $f_1(n) = a_1(n+(b_1/2a_1))^2 - (b_1^2 - 4a_1 c_1)/4 a_1$ and $f_2(n)= a_2(n+(b_2/2a_2))^2 - (b_2^2 - 4a_2 c_2)/4 a_2$.  Thus writing $d=\sqrt{D_1D_2}$, we have that \begin{align*}
&4a_1 D_2 f_1(n) - 4a_2 D_1 f_2(m) \\
&= 4a_1^2 D_2 \left(n+\frac{b_1}{2 a_1}\right)^2 -4a_2^2 D_1\left(m+\frac{b_2}{2 a_2}\right)^2\\
&= \frac{1}{D_1} \left( D_1D_2 \left(2a_1  \left(n+\frac{b_1}{2 a_1}\right)\right)^2 -\left(2a_2 D_1 \left(m+\frac{b_2}{2 a_2}\right)\right)^2 \right)\\
&=\frac{1}{D_1} \left( d  \left(2a_1n+b_1\right) - D_1\left( 2a_2m+b_2\right) \right) \left( d  \left(2a_1n+b_1\right) + D_1\left( 2a_2m+b_2\right) \right).
\end{align*} So if $p|f_1(n)$ and $p|f_2(m)$, then $p$ must divide the second or third factor of the above equation.  Since $n,m \le x$ by assumption, this implies that $p$ must be less than $\left|d  (2a_1x+b_1)\right| + \left|D_1( 2a_2x+b_2)\right| < (2|a_1 d| + 2|a_2 D_1| +1) x$ for sufficiently large $x$. $\Box$ \end{pf}

\begin{lem}

If $f(n) = n^2 + b n + c$ is a quadratic polynomial and for a prime $p$, $p^2 | \prod_{n \le x} f(n)$, then $p < (2+|b|+|c|)x$.

\end{lem}

\begin{pf}

If $p^2 | f(n)$ for some $n \le x$, then $p^2 \le n^2 + bn + c \le x^2 + |b|x+|c| < (1+|b|+|c|) x^2$, which implies that $p \le x\sqrt{1+|b|+|c|}$.

If $p | f(n)$ and $p | f(m)$ for some $n,m \le x$, then $p | n^2 + bn + c - m^2 - bm - c = (n-m)(n+m) + b(n-m) = (n-m)(n+m+b)$.  Since $p$ is prime, this implies $p | (n-m)$ or $p | (n+m+b)$.  Either way this implies that $p < (2+|b|)x$.  So the lemma holds. $\Box$ \end{pf}

Thus we have the following result using our variant method of Cilleruelo.

\begin{thm}\label{ThmWeak}

Let $f_i(n)$, $1 \le i \le I$, be some sequence of monic irreducible polynomials.  If $D_1 D_i$ is a perfect square for all $1 \le i \le I$, then $$N_x = \prod_{n \le x} \prod_{i=1}^I f_i(n)$$ cannot be squarefull for infinitely many $x$.

\end{thm}

\begin{pf}

First, suppose $N_x$ is squarefull, so for all primes $p$ such that $p$ divides $N_x$, $p^2|N_x$.

If $I=1$ then by the previous lemma, there exists some constant $c$ independent of our choice of $x$, for which $p < cx$ for all primes dividing $N_x$.

If $I > 1$, then for each prime $p | N_x$, either for some $i$, $p^2 | \prod_{n\le x} f_i(n)$, or else for some $i$ and $i'$, $p | \prod_{n\le x} f_i(n)$ and $p | \prod_{n \le x} f_{i'}(n)$.  Regardless of which case we fall into, the previous two lemmas tell us that there exists some constant $c$, dependent only on the $f_i$'s for which $p < cx$ for all sufficiently large $x$.

But again, Lemma \ref{oneprime} shows that $\prod_{n \le x} f_1(n)$ will eventually be divisible by at least one prime in the range $cx$ to $(c+1)x$.  Thus our assumption that $N_x$ could be squarefull for any of these large $x$ must be false. $\Box$ \end{pf}

We can replace the condition that requires $D_1 D_i$ to be a perfect square through the use of the following lemma.

\begin{lem}\label{congruence}

If $f_i(n)$, $1 \le i \le I$, is some sequence of distinct irreducible polynomials, with $$J_f :=  1+ \sum_{\substack{ \varnothing \neq J \subset \{1,2,3,\ldots,I\} \\ \prod_{j \in J} D_j \textrm{square}}}  (-1)^{|J\setminus \{1\}|} > 0,$$ then there exists some residue class $k$ modulo $\prod_{i=1}^I D_i$, such that all sufficiently large primes congruent to $k \pmod{\prod_{i=1}^I D_i}$ cannot divide any term of the form $f_i(n)$ for $1 < i \le I$, but will divide some term of the form $f_1(n)$.

\end{lem}

\begin{pf}

Once again, a given prime $p$ will divide $f_i(n) = a_i n^2 + b_i n + c_i$ if $$(n+\frac{b_i}{2a_i})^2 + \frac{4a_i c_i - b_i^2}{4a_i^2} \equiv 0 \pmod{p},$$ which makes sense provided $p$ is larger than $a_i$.

Thus $p$ will divide $f_i(n)$ for some $n$ if and only if $D_i$ is a quadratic residue modulo $p$.  To estimate the number of primes up to $z$, which can divide $f_1(n)$ for some $n$ but can never divide $f_i(m)$ for $i \neq 1$, we use the formula $$\sum_{D < p \le z} \left( \frac{1+\left( \frac{D_1}{p} \right)}{2} \prod_{2 \le i \le I} (-1) \frac{-1+\left( \frac{D_i}{p} \right)}{2} \right).$$

Here, $D$ is some constant larger than all the $D_i$.  But this sum equals \begin{align*}
&(-1)^{|I|-1} \frac{1}{2^{I}} \sum_{D < p \le z} \sum_{J \subset \{1,2,3,\ldots,I\}} (-1)^{|I|-|J\backslash \{1\}|-1} \left( \frac{\prod_{j \in J} D_j}{p} \right)\\
&= \frac{1}{2^{I}} \sum_{J \subset \{1,2,3,\ldots,I\}} \sum_{D < p \le z}  (-1)^{|J\backslash \{1\}|} \left( \frac{\prod_{j \in J} D_j}{p} \right) \end{align*}

If $\prod_{j \in J} D_j$ is a square, then $$\sum_{D < p \le z} \left( \frac{\prod_{j \in J} D_j}{p} \right) $$ will be asymptotic to $\pi (z).$  Otherwise, the sum will be $o(\pi (z))$ (in fact, it is $O(1)$).  Thus the sum above equals $$\frac{\pi (z)}{2^{I}} \left( 1 + \sum_{\substack{\varnothing \neq J \subset \{1,2,3,\ldots,I\} \\ \prod_{j \in J} D_j \textrm{square}}}  (-1)^{|J\backslash \{1\}|} + o(1)\right) $$ which will represent a non-trivial proportion of the primes provided $ J_f > 0$. $\Box$ \end{pf}

We can now combine this with Lemma \ref{DFITlem}, assuming $f_1$ is monic.  If we pick $\epsilon < 1/\phi (D)$, then Lemma \ref{DFITlem} says that for all sufficiently large $x$ there exists a prime congruent to $k \pmod{\prod_{i=1}^I D_i}$ that must divide $\prod_{n\le x} f_1(n)$ exactly once. And since it cannot divide $f_i(n)$ for $1 < i \le I$, we have proved the following theorem.

\begin{thm}\label{NotSquarefull}

Suppose that we have a set of $I$ distinct irreducible quadratic polynomials $f_i(n)=a_i n^2+b_i n+c_i$ with $f_1$ monic.  Furthermore, suppose that $J_f > 0$

Then for sufficiently large $x$ the number $$ N_x = \prod_{n \le x} f_1(n) $$ is not squarefull.  Moreover, $N_x$ cannot be made a squarefull by multiplying $N_x$ with terms of the form $f_i(n)$ with $i \neq 1$, $n \in \mathbb{N}_{>0}$.

\end{thm}

\begin{cor}\label{ThmStrong}

Suppose that we have a set of $I$ distinct irreducible quadratic polynomials $f_i$ with $f_1$ monic.  Furthermore, suppose that $J_f > 0.$

Then the number

$$ N_x = \prod_{n \le x} \prod_{i=1}^I f_i(n) $$
cannot be infinitely often a squarefull.

\end{cor}

While the conditions of the previous theorems have been somewhat complex, we can combine them to prove the following - much simpler - theorem.

\begin{cor}

Suppose we have $k$ distinct monic quadratic polynomials $f_i$.  Then

$$N_x = \prod_{n \le x} \prod_{1 \le i \le k} f_i(n)$$

cannot be infinitely often squarefull if $k=2$ or $3$.

\end{cor}

\begin{pf}

If any $D_i$ is a perfect square, then $f_i$ is reducible, so none of the $D_i$ can be a perfect square.

In the case $k=2$, we therefore have only two cases to consider: either $D_1D_2$ is a perfect square or it is not.

If $D_1D_2$ is a perfect square, then we apply Theorem \ref{ThmWeak}.

If $D_1D_2$ is not a perfect square, then we apply Theorem \ref{ThmStrong} as $J_f = 1$ in this case.

In the case $k=3$ we again have multiple sub-cases.

First, if no product of $D_1,D_2,D_3$ is ever a square, we may again apply Theorem \ref{ThmStrong} as $J_f = 1$ in this case.

Suppose that exactly one product of two of the discriminants is a square, and that the product of all three is not.  By reindexing we can let $D_2D_3$ be the square.  Then we again apply Theorem \ref{ThmStrong} as $J_f = 2$ in this case.

Note that it is impossible to have just two products of two discriminants being square, as if $D_1 D_2$ and $D_1 D_3$ are square, then so is $(D_1 D_2)(D_1 D_3)/D_1^2 = D_2 D_3$.

So suppose that all three products of two of the discriminants is a square, and that the product of all three is not.  Here we can apply Theorem \ref{ThmWeak}.

Suppose that the only square can be formed by multiplying all three discriminants together, i.e. $D_1 D_2 D_3$ is a square, then we apply Theorem \ref{ThmStrong} as $J_f = 2$ in this case.

Finally assume that some product of two discriminants and the product of all three discriminants are squares, say $D_1 D_2$ and $D_1D_2D_3$ are both squares.  Then $(D_1D_2D_3)/(D_1 D_2)=D_3$ must also be a square contrary to the irreducibility of $f_3$. $\Box$ \end{pf}

These techniques are not sufficient to generalize to higher $k$.  In particular there are two problem cases with $k=4$, the case where $D_1 D_2 D_3 D_4$ is the only square and the case where $D_1 D_2 D_3 D_4$, $D_1 D_2$, and $D_3 D_4$ are the only squares.

\begin{rem}

Suppose $F(n)$ is the product of distinct irreducible quadratic polynomials $f_i$.  Roughly, we expect that the large primes factors of $\prod_{n \le x} f_i(n)$ should be rather sparse and should not overlap much with the large prime factors of $\prod_{n \le x} f_j(n)$.

By interpreting the DFIT result - incorrectly - as a statement of probability, one can refine this heuristic argument to estimate that the squarefree part of $N_x$ should tend towards $N_x^{1/2 + o(1)}$ as $x$ tends to infinity.  We cannot yet prove such a statement, and so leave it here as a conjecture.

\end{rem}

\section{Quadratic and Linear Terms}

Now suppose we wish to extend our results still farther, to consider products of the form $$ N_x = \prod_{n \le x} \left( \prod_{i=1}^I f_i(n) \right) \left( \prod_{k=1}^K g_k(n) \right)$$ where the $f_i$ are quadratic and the $g_k$ are linear.  Under what conditions for the $f_i,g_k$ will $N_x$ again be only finitely often a square?

We will assume, as we did with the $f_i$, that $g_k(n) \neq 0$ for any $n \ge 1$.

If the $f_i$ satisfy the conditions of Corollary \ref{ThmStrong} and $g_i(n)=n+b_i$ for all $i$ then the conclusion still holds, as under these conditions only a finite number (independent of $x$) of primes larger than $x$ could divide any of the terms $\prod_{n \le x} g_k(n)$.

\begin{thm}

Suppose that we have a set of $I$ distinct quadratic polynomials $f_i(n)$ with $f_1$ monic such that $J_f > 0.$ Suppose we also have a set of $K$ distinct linear polynomials $g_k(n)=a_k n + b_k$, where each $a_k\ge 2$ is relatively prime to each $D_i$ and to every other $a_k \ge 2$

Then the number $$ N_x = \prod_{n \le x} \left( \prod_{i=1}^I f_i(n) \right) \left( \prod_{i=1}^K g_i(n) \right)$$ cannot be infinitely often a squarefull.

\end{thm}

\begin{pf}

A prime $p > (2-\delta)x$ divides the term $g_k(n)$ when the following congruence holds
$$a_k n + b_k \equiv 0 (\textrm{mod} p)$$
$$n \equiv \frac{-b_k}{a_k} (\textrm{mod} p)$$

We can solve this explicitly since $n \le x < p$ implies that $n$ will equal $(kp-b_i)/a_i$ where $k$ is the smallest positive integer for which $jp-b_i$ is divisible by $a_i$.  However, we need $n \le x$, while $p > (2-\delta)x$ so this means that we would need to have $$\frac{j(2-\delta)x-b_i}{a_i} < \frac{jp-b_i}{a_i} \le x$$  $$ j-\frac{b_i}{(2-\delta)x} < \frac{a_i}{(2-\delta)}$$

Since $j$ is discrete, we can pick $x$ large enough so that the term $\frac{b_i}{2x}< 1/5$ and pick $\delta$ small enough so that $|a_i/(2-\delta) - a_i/2| < 1/5$ as well.  Then we get $$ j \le \frac{a_i}{2}+ \frac{2}{5}$$ or, in other words, that only half of the congruence classes modulo $a_i$ can contain primes larger than $(2-\delta)x$ which divide $\prod_{n \le x} g_i(n)$.

By Lemma \ref{congruence}, there must be a congruence class $k' \pmod{\prod D_i}$ for which primes congruent to $k' \pmod{\prod D_i}$ can, and eventually will, divide $\prod_{n\le x} f_1(n)$ but will never divide any other $\prod_{n \le x} f_i(n)$.  Provided $a_i$ is relatively prime to $\prod D_i$ the associated congruence classes modulo $a_i$ coming from $0 \le j \le \frac{a_i}{2}$ cannot cover the congruence class $k' \pmod{\prod D_i}$ completely.  So there exists some congruence class modulo $a_i D$ such that all sufficiently large primes in that congruence class eventually must divide $\prod_{n\le x} f_1(n)$ as $x$ grows, but which will never divide $\prod_{n \le x} g_k(n)$.

Since $a_j \neq a_i$ is relatively prime to $a_i \prod D_i$ we can repeat this process, and continue repeating through all of the $a_k$'s until we have found a congruence class $k'' \pmod{\prod a_k \prod D_i}$ such that all sufficiently large primes in that congruence class will eventually divide $\prod_{n\le x} f_1(n)$ but cannot divide $N_x / \prod_{n \le x} f_1(n)$.

Then, as in the proof of Theorem \ref{NotSquarefull}, for sufficiently large $x$, some of these primes can only divide $N_x$ precisely one time, and thus $N_x$ cannot be squarefull. $\Box$ \end{pf}

\begin{rem} We can, without difficulty, allow two linear terms with the same leading coefficient, say $a n+b ,a n+b'$ provided $a$ is prime (and as before relatively prime to all other $a_k$'s)  and $b \neq -b' \pmod{a}$.  This last condition will ensure that there is still some congruence class modulo $a$, such that primes from that congruence class can never divide $\prod_{n \le x} (an+b)(an+b')$. \end{rem}

Using slightly different techniques, we can prove the following theorem.

\begin{thm}

Let $f_i(n)$, $i \in \{1, 2, \ldots , I\}$, be distinct quadratic polynomials, and $g_k(n)=a_k n + b_k$, $ k \in \{1, 2, \ldots , K\}$, be distinct linear polynomials with non-zero, relatively prime coefficients, such that
\begin{enumerate}
\item $$J'_f := 1+ \sum_{\varnothing \neq J \subset \{1,2,3,\ldots,I\}, \prod_{j \in J} D_j \textrm{square}}  (-1)^{|J|} \neq 0$$
\item $a_1$ is positive and $a_1 \ge |a_k|$ for all $1 < k \le K$.
\item $a_1$ is relatively prime to $\prod_{i \le I} D_i$
\item For all $k$ such that $a_1 = |a_k|$, we have that $b_1 \neq b_k \pmod{a_1}$.
\end{enumerate}
Then $$ N_x = \prod_{n \le x} \left( \prod_{i=1}^I f_i(n) \right) \left( \prod_{k=1}^K g_k(n) \right)$$ can only be a perfect square finitely many times.

\end{thm}

\begin{pf}

Let us write $g_1(n)=an+b$.  Clearly all primes congruent to $b$ modulo $a$ less than $ax+b$ but larger than $a+b$ divide $\prod_{n \le x} g_1(n)$. Moreover, each prime of this congruence class that exists between $(a-\frac{1}{2})x$ and $ax+b$ divides $\prod_{n \le x} g_1(n)$ exactly once for sufficiently large $x$.  To see this, suppose $p$ is a prime congruent to $b \pmod{a}$ in the range $((a-\frac{1}{2})x,ax+b)$, and let $n'=(p-b)/a$.  Then clearly the first time $g_1(n)$ is divisible by $p$ is when $n = n'$.  The next time it happens is when $n = n' + p > p  \ge (a-\frac{1}{2})x > x$ which means $p$ divides $\prod_{n \le x} g_1(n)$ exactly one time.

In fact, these primes can only divide $\prod_{n \le x} \left( \prod_{k=1}^K g_k(n) \right)$ once for large enough $x$.  Every $g_k$ with $|a_k| < a_1$ can only contribute primes smaller than $(a-\frac{1}{2})x$.  By assumption, every $g_k$ with the same leading coefficient as $g_1$ is of the form $an+b'$ where $b' \neq b \pmod{a}$.  Thus the first time a prime $p>(a-\frac{1}{2})x$ congruent to $b \pmod{a}$ divides $g_k(n)$ is at the earliest when $n = (2p-b')/a > ((2a-1)x-b')/a >x $ once $x$ is large enough.

So in order for $N_x$ to be a square, each of the primes congruent to $b \pmod{a}$ in the range $((a-\frac{1}{2})x,ax+b)$ must divide $\prod_{n \le x} \left( \prod_{i=1}^I f_i(n) \right)$.  However, by a similar argument to Lemma \label{congruence}, the proportion of the primes that can never divide any of these terms is $$\left| \sum_{D < p \le z} \prod_{1 \le i \le I} (-1) \frac{-1+\left( \frac{D_i}{p} \right)}{2} \right|,$$ which will be asymptotic to a non-zero proportion of $\pi(z)$ whenever $J'_f \neq 0$.

These correspond to a proportion of residue classes modulo $\prod_{i\le I} D_i$.  Since $a$ is relatively prime to $\prod_{i\le I} D_i$, there must exist residue classes modulo $a \prod_{i\le I} D_i$ such that they reduce to $b \pmod{a}$ and yet primes in these residue classes can never divide $\prod_{n \le x} \left( \prod_{i=1}^I f_i(n) \right)$.  Now, if we pick $x$ to be large enough, then there must exist a prime congruent to $b$ modulo $a$ in the region $((a-1/2)x,ax+b)$, which cannot divide $\prod_{n \le x} \left( \prod_{i=1}^I f_i(n) \right)$ yet must divide $\prod_{n \le x} \left( \prod_{k=1}^K g_k(n) \right)$ precisely once.

Thus $N_x$ cannot be infinitely often a square. $\Box$ \end{pf}

\section{More general F(n)}

In the case of still more general $F(n)$ we cannot yet obtain any theorems which say that $N_x$ will only be finitely often a square or finitely often squarefull, yet we can obtain a small density result.

Here, given a function $F(n) \in \mathbb{Z}[n]$, let $d_F$ be the positive integer such that there is some element of the Galois group of $F$ which fixes precisely $d_F$ roots of $F(n)$ and any element which fixes less than $d_F$ roots of $F(n)$ will fix none of the roots.  $d_F$ exists since the Galois group contains the trivial element which will fix all the roots of $F$, which also implies that $d_F \le \deg{F}$.

We denote the size of the Galois group of $F$ by $g_F$.

\begin{thm}\label{pth}

Suppose $F(n) \in \mathbb{Z}[n]$ is not of the form $s (G(n))^p$ for some rational number $s$ and some polynomial $G(n) \in \mathbb{Z}[n]$.  Then $$\# \{x \le X | N_x \text{is a perfect $p^{th}$ power}\} = O\left( X^{\log{(d_F+1)}/\log{\lceil p/d_F \rceil}} \right)$$ and, more generally, $$\# \{x \le X | N_x \text{is a perfect $p^{th}$ power}\} = O\left( X^{24/25}\right)$$

\end{thm}

We note that this generalizes the results of Cilleruelo, et al., in \cite{Cil2}.

To begin, we need the following lemma.

\begin{lem}\label{primeseq}

There exists a sequence of primes $q_1, q_2, q_3, \ldots$, such that $$\lceil p/d \rceil q_i \left(1-g_F \frac{\log{q_i}}{q_i}\right) \le q_{i+1} \le \lceil p/d_F \rceil q_i$$ and $F(n)$ has $d_F$ roots modulo $q_i$.

\end{lem}

\begin{pf} If $f(n)$ is some irreducible polynomial, then the way that $f$ factors when taken modulo some prime $p$ is determined completely by the way the Frobenius automorphism acts on the roots of $f$.  Taken modulo $p$, the Frobenius automorphism maps the set of roots of $f$ bijectively onto the roots of $f$.  If it maps an element onto itself, this corresponds to a linear factor of $f$ modulo $p$.  If it maps one element onto a second element, and the second element back onto the first (i.e. a 2-cycle), then this corresponds to a quadratic factor of $f$ modulo $p$, and so on.

Thus if the cycle structure of the Frobenius automorphism acting on the roots of $f$ is $(m_1,m_2,\ldots,m_r)$, then $$f(n) \equiv \prod_{i=1}^r g_i(n) \pmod{p}$$ where $\deg{g_i} = m_i$ and each $g_i$ is irreducible modulo $p$.

A similar result holds even if our function is reducible.  In particular, let $F(n) = \prod f_i(n)^{e_i}$ for distinct irreducibles $f_i$.  We can still consider the Galois group of $F$ as the compositum of all the Galois groups of the $f_i$'s; this is also the splitting field for $F$.  The Frobenius automorphism for a given prime $p$ is again an element of the Galois group of $F$ and it will map roots of $F$ bijectively onto roots of $F$, and will actually map roots of $f_i$ bijectively onto roots of $f_i$.  Thus if the cycle structure of the Frobenius automorphism acting on the roots of $F$ is $(m_1,m_2,\ldots,m_r)$, then $$F(n) \equiv \prod_{i=1}^r g_i(n) \pmod{p}$$ where $\deg{g_i} = m_i$ and each $g_i$ is irreducible modulo $p$.

In particular, this tells us that $F(n)$ has $d$ roots modulo $p$ precisely when the Frobenius automorphism fixes exactly $d$ of the roots of $F(n)$.

The Chebotarev Density theorem (see \cite{IK}, page 143) says that there exists a natural density of primes $p$ for which the cycle structure of the Frobenius Automorphism of $p$ acting on the roots of $F$ is $(m_1,m_2,\ldots,m_r)$.  In particular this density is the number of elements of the Galois group which produce this cycle structure when they act on the roots of $F$ divided by the total number of elements in the Galois group.

Since we know, by definition, that there exists some element of the Galois group that fixes precisely $d_F$ roots of $F$, there must be a positive density $c$ of primes $p$ for which $F$ has precisely $d_F$ roots modulo $p$.

Thus, if we let $\epsilon(X)=g_F \log{X}/X$ and let $\pi_{d_F} (X)$ denote the number of primes less than $X$ for which $F$ has $d_F$ roots, then \begin{align*}
&\pi_{d_F} (X) -\pi_{d_F} (X(1-\epsilon(X))) \\
&\sim c \frac{X}{\log{X}} - c \frac{X(1-\epsilon(X))}{\log{X}} \\
&=c\epsilon(X) \frac{X}{\log{X}}\\
&=cg_F \ge 1
\end{align*} since $c \ge 1/g_F$.

Thus we can find a prime $q_{i+1}$ which is between $\lceil p/d_F \rceil q_i(1 - g_F \log{q_i}/q_i)$ and $\lceil p/d \rceil q_i$ and for which $F$ has $d_F$ roots modulo $q_{i+1}$, provided we start this sequence with a sufficiently large prime $q_1$.  $\Box$ \end{pf}

Here, if $F(n)=s f_1(n)^{e_1} \cdots f_k(n)^{e_k}$ for some $s \in \mathbb{Q}$ and for distinct irreducible polynomials $f_i$, we let $\text{sdisc}(F)$ denote the discriminant of $\prod_{i=1}^k f_i(n)$.

Recall that if $F(n)$ has $k$ roots modulo $p$, then it also has $k$ roots modulo $p^i$ provided $p$ does not divide $\text{sdisc}(F)$.  This is true because if $p$ does not divide the discriminant of $f_i$ then the roots of $f_i$ modulo $p$ are distinct, and we can then apply Hensel's lemma to see that these roots extend to distinct roots modulo $p^i$.

Now consider any of the primes $q_i$.  Let $a_i(x)$ represent the number of times $q_i$ divides $N_x$.

By our construction of the $q_i$, we know that $F(n)$ has $d_F$ roots modulo $q_i$.  Thus, $a_i(x+q_i)-a_i(x) \ge d_F$.

At the same time we know that $F(n)$ has $d_F$ roots modulo $q_i^2$, so $a_i(x+j+1)-a_i(x+j)>1$ for at most $d_F$ values of $j$, with $0\le j \le q_i^2-1$.

Let us further assume that if $p|a_i(x)$, then $x$ belongs to an interval of length $q_i$ on which $a_i$ is constant, and suppose these intervals are distinct; this will overestimate how often $p|a_i(x)$ but still give us our big-Oh bounds.  Now, we will estimate how close two successive intervals can be on average.  Let $I_1$, $I_2$ be the two intervals in question, with $I_1 = [x_1,x_1+q_i-1]$ and $I_2 = [x_2,x_2+q_i-1]$.  If for all $x_1 \le x < x_2$, we have that $a_i(x+1)-a_i(x)\le 1$, so then for all $x_1 \le x \le x_2 -q_i +1$ we have that $a_i(x+q_i)-a_i(x) = d_F$.  Thus $a_i(x_2)-a_i(x_1)\le d_F \lceil (x_2-x_1)/q_i \rceil$ and at the same time $a_i(x_2) - a_i(x_1)= p$.  Thus, $x_2-x_1 \ge \lfloor p/d_F \rfloor q_i$.

However, we also know that over an interval of $x$'s of length $q_i^2$, $a_i$ will jump by more than one exactly $d_F$ times.  Thus it is possible that we could have two sub-intervals $I_1 = [x_1,x_1+q_i-1]$ and $I_2 = [x_2,x_2+q_i-1]$ of the type discussed in the previous paragraph with $x_2 = x_1 + q_i$, but this could only occur at most $d_F$ times over the full interval.  Each other pair of successive intervals must be separated as in the previous paragraph.

Thus we see that if we have an interval of length $q_{i+1}$, which is slightly smaller than $\lceil p/d_F \rceil q_i$, then it can contain at most $d_F+1$ sub-intervals of length $q_i$ of values of $x$ for which $p|a_i(x)$; consequently, if $X>q_{i+1}$ at most $$2X \frac{(d_F+1)q_i}{q_{i+1}}$$ of the numbers $x$ up to $X$, will have $N_x$ be a perfect $p^{th}$ power.  (Here the $2$ is a fudge factor since $X$ will likely not be a multiple of $q_{i+1}$.)

If we look at an interval of length $q_{i+2}$ then it can contain at most $d_F+1$ intervals of length $q_{i+1}$ of values of $x$ for which $p|a_{i+1}(x)$, which themselves can contain at most $d_F+1$ intervals of length $q_i$ of values of $x$ for which $p|a_i(x)$; consequently, at most $$2X \frac{(d_F+1)q_i}{q_{i+1}} \frac{(d_F+1)q_{i+1}}{q_{i+2}}$$ of the numbers $x$ up to $X$, if $X>q_{i+2}$, will have $N_x$ be a perfect $p^{th}$ power.  And so on.

Now suppose $q_i \le X < q_{i+1}$ then we have that there are at most $$2 X \left(\frac{d_F+1}{\lceil p/d \rceil}\right)^{i-1} (1-\epsilon(q_1))^{-1}(1-\epsilon(q_2))^{-1}\cdots (1-\epsilon(q_{i-1}))^{-1}$$ $x$ less than $X$ for which $N_x$ is a perfect $p^{th}$ power.

Note that $i-1 > \log_{\lceil p/d_F \rceil}{(X/q_1)}$, so \begin{align*}
&\left(\frac{d_f+1}{\lceil p/d_F \rceil}\right)^{i-1} \\
&< \left(\frac{d_F+1}{\lceil p/d_F \rceil}\right)^{\log_{\lceil p/d_F \rceil}{(X/q_1)}} \\
&= \exp{\left( \frac{\log{X}-\log{q_1}}{\log{\lceil p/d_F \rceil}} \log{\frac{d_F+1}{\lceil p/d_F \rceil}} \right)} \\
&= X^{(\log{(d_F+1)}/\log{\lceil p/d_F \rceil} -1)} \left(\frac{\lceil p/d_F \rceil}{d_F+1} \right)^{\log{q_1}/\log{\lceil p/d_F \rceil}}
\end{align*}

Furthermore, note that \begin{align*}
&\epsilon(q_i)= \frac{g_F\log{q_i}}{q_i} \\
&= O\left(\frac{g_F\log{(q_1\lceil p/d_F \rceil^{i-1})}}{(q_1\lfloor p/d_F \rfloor^{i-1})}\right) \\
&= O\left(\frac{i}{\lfloor p/d_F \rfloor^{(i-1)}}\right)
\end{align*}

Thus \begin{align*}
&(1-\epsilon(q_1))^{-1}(1-\epsilon(q_2))^{-1}\cdots (1-\epsilon(q_{i-1}))^{-1} \\
&\le \exp{\left(\sum_{n=1}^{i-1}  \epsilon(q_i) \right)} = \exp{\left(O\left(\sum_{n=1}^{\infty}  \frac{n}{\lfloor p/d_F \rfloor^{n-1}} \right)\right)} \\
&=\exp{\left(O\left(\left(\sum_{n=1}^{\infty}  \frac{1}{\lfloor p/d_F \rfloor^{n-1}}\right)^2 \right)\right)} = \exp{\left(O\left(\left(\frac{1}{1-\frac{1}{\lfloor p/d_F \rfloor}}\right)^2 \right)\right)}
\end{align*} which is clearly bounded.

Together these estimates prove the first part of Theorem \ref{pth}; however this result is only interesting when $p^2 > d_F$, for smaller $p$ we will use a variation of the Tur\'{a}n sieve (following the method of \cite{Coj}).

For the Tur\'{a}n sieve, let $\mathcal{A}$ be an arbitrary finite set, $\mathcal{P}$ be some set of primes, and to each prime $p \in \mathcal{P}$ associate a set $\mathcal{A}_p \subset \mathcal{A}$, and let $\mathcal{A}_{p,q} \: = \mathcal{A}_p \cap \mathcal{A}_q$.  Now suppose $$\# \mathcal{A}_p = \delta_p X+ R_p$$ and $$\# \mathcal{A}_{p,q}= \delta_p \delta_q X+ R_{p,q}$$ where $X= \# \mathcal{A}$, then we have the following result.

\begin{thm}

With all notation as in the previous paragraph, let $$U(z)\: = \sum_{\substack{p \in \mathcal{P} \\ p \le z}} \delta_p$$ then $$\# \left( \mathcal{A} \setminus \bigcup_{p \in \mathcal{P}} \mathcal{A}_p \right) \le \frac{X}{U(z)} + \frac{2}{U(z)} \sum_{\substack{p \in \mathcal{P} \\ p \le z}} \left| R_p \right| + \frac{1}{U(z)^2} \sum_{\substack{p,q \in \mathcal{P} \\ p,q \le z}} \left| R_{p,q} \right|$$

\end{thm}

We also need the following result.  Here we use the shorthand $F_k(n):=F(n)F(n+1)\cdots F(n+k)$.

\begin{lem}

Suppose $F(n) \in \mathbb{Z}[n]$ is not of the form $s G(n)^p$ for some $s \in \mathbb{Q}$ and $G(n) \in \mathbb{Z}[n]$.  Then for any prime $q$ which does not divide $\text{sdisc}(F)$ and is larger than $\deg{(F)} k$, we have that $F_k(n)$ taken modulo $q$ is not equivalent to $s G(n)^p$ for any $G(n) \in \mathbb{Z}_q [n]$, $s \in \mathbb{Z}_q$.

\end{lem}

\begin{pf}

If $q \nmid \text{sdisc}(F)$, then the factors of $f_i$ modulo $q$ must be distinct from the factors of $f_j$ modulo $q$ if $i \neq j$, and the factors of $f_i$ modulo $q$ are themselves distinct from each other.  Thus if not every $f_i$ divides $F(n)$ with a $p$-multiple multiplicity, then not every irreducible modulo $q$ divides $F(n)$ with a $p$-multiple multiplicity.

Moreover, $g(n)$ is irreducible (over $\mathbb{Z}$ or $\mathbb{Z}_q$) if and only if $g(n+1)$ is also irreducible, and $g(n)^m|F(n)$ if and only if $g(n+1)^m | F(n+1)$.  If $g(n)=n^l+a_{l-1} n^{l-1} + \cdots + a_0$ then $g(n+i) = n^l + (il+ a_{l-1}) n^{l-1} + \cdots$ so these will be distinct modulo $q$ if $il \neq 0 \pmod{q}$.

Now, consider $F_k(n)$ and suppose that all irreducibles divide $F_k(n)$ with a $p$-multiple multiplicity when we reduce $F_k(n)$ modulo $q$.  By the work above we know that there exists some irreducible over $\mathbb{Z}_q [n]$, let us call it $g_1(n)$, that does not divide $F(n)$ with a $p$-multiple multiplicity, but it does divide $F_k(n)$ with a $p$-multiple multiplicity, therefore there must be some other irreducible $g_2(n)$ such that $g_2(n)|F(n)$ and $g_2(n+i)\equiv g_1(n) \pmod{q}$ with $1 \le i \le k$; however, we can assume that $g_2(n)$ does not divide $F(n)$ a multiple of $p$ times, so we can find a $g_3,g_4,\ldots$ in this fashion.  However, $F(n)$ has finite degree, so this sequence of $g_i$'s must eventually repeat itself.  Suppose, without loss of generality, that $g_1(n) = g_j(n)$ with $j$ minimal, then we have that $g_1(n + i) \equiv g_j(n) \pmod{q}$ for $j-1 \le i \le k(j-1)$.  By the previous paragraph, that implies $i \equiv 0 \pmod{q}$ but $i > 0 $ and $i \le k(j-1) < \deg{(F)} k$, since $F$ can have at most $\deg{(F)}$ irreducible factors.  So since $q > \deg{(F)} k$, $F_k(n)$ cannot be of the form $s G(n)^p$ for any $G(n) \in \mathbb{Z}_q [n]$, $s \in \mathbb{Z}_q$, as desired. $\Box$ \end{pf}

In our case, let $$\mathcal{A}\: = \{n \le X\},$$ and for each prime $q \nmid \text{sdisc}(F_k)$, let $$\mathcal{A}_q \: = \{n \le X | F_k(n) \text{is not a perfect $p^{th}$ power modulo $q$}\}.$$  Note that $\text{sdisc}(F_k) = \text{sdisc}(F)$, since $\text{disc}(f_i(n))=\text{disc}(f_i(n+1))$.

By \cite{Li}, page 94, we have that $$\left| \sum_{a \mod{q}} \chi_p \left( F_k(a) \right) \right| \le (\deg{F_k}-1)\sqrt{q}$$ if $\chi_p$ is a non-trivial multiplicative character of order $p$ and $F_k$ has some root modulo $q$ whose multiplicity is not a $p$-multiple.  By the previous lemma, this latter requirement is satisfied.

Let $S_k$ denote the number of $n$ modulo $q$ for which $F_k(n)$ is $p^{th}$ power modulo $q$, then supposing there exist non-trivial characters, we have \begin{align*} &|p S_k - q| = \left|\sum_{\chi_p \neq 1} \sum_{a\pmod{q}} \chi_p \left( \frac{F_k(a)}{q} \right)\right| \\
&\le (p-1)(\deg{F_k}-1)\sqrt{q}
\end{align*}

Thus $S_k = q/p+O((\deg{F_k})\sqrt{q})$.

Thus \begin{align*}\# \mathcal{A}_q &= \left(\frac{X}{q}+O(1)\right) \left( \frac{q(p-1)}{p} + O((\deg{F_k})\sqrt{q})\right) \\
&= \frac{X(p-1)}{p}+O\left(\deg{F_k}\frac{X}{\sqrt{q}} + q\deg{F_k}\right)\end{align*} and similarly, given distinct primes $q_1,q_2$ we have \begin{align*} \# \mathcal{A}_{q_1,q_2} &= \left(\frac{X}{q_1 q_2}+O(1)\right) \left( \frac{q_1 q_2 (p-1)^2}{p^2} +  O((\deg{F_k})^2(\sqrt{q_1}q_2 + \sqrt{q_2}q_1))\right)\\
&= \frac{X(p-1)^2}{p^2} +  O\left((\deg{F_k}^2)\left(\frac{X}{\sqrt{q_1}} + \frac{X}{\sqrt{q_2}} + q_1 q_2 \right)\right) \end{align*}

For our set of primes $\mathcal{P}$ we want the set of all primes $q$ between $z$ and $2z$, such that $q$ does not divide $\text{sdisc}(F_k)$ and $q \equiv 1 \pmod{p}$ (so that there will exist non-trivial characters).  We will determine $z$ later.

Then by the Tur\'{a}n sieve, the number of $n \le X$ for which $F_k(n)$ is a perfect $p^{th}$ power is $$\ll X\frac{\log{z}}{z} + (\deg{F_k})\frac{X}{\sqrt{z}} + (\deg{F_k})z + (\deg{F_k})^2\frac{X}{\sqrt{z}} + (\deg{F_k})^2 z^2$$ and the implied constant is independent of our choice for $k$.

We now use the following lemma to see how frequently $N_x, N_{x+k}$ can be both a $p^{th}$ power, with $k$ small.

\begin{lem}

Let $S(X)$ be some subset of the natural numbers $\{1,2,\ldots,X\}$, and suppose $|S(X)|> X/K(X)$ for some function $K(X)< X$.

Let $S(X)_k$ denote those $s \in S(X)$ such that $s+k \in S(X)$ and $s+i \in X \setminus S(X)$ for $1 \le i < k$.

Then there exists some integer $k \le K(X)$ such that $\left| S(X)_k \right| \ge 2X/K(X)^3.$

\end{lem}

\begin{pf}

Suppose to the contrary that for all $k \le K(X)$ there are less than $2X/K(X)^3$ elements in $S(X)_k$.  Let us consider the most number of elements that could be in $S(X)$ under these conditions.  In particular we want to have as small a gap between successive elements as possible.  So let us assume that for all $k \le K(X)$ there are at most $2X/K(X)^3-1 $ distinct $s \in S(X)$ for which $s+k \in S(X)$ and $s+i \in X \setminus S(X)$ for $1 \le i < k$.  The number of integers in the union $$\bigcup_{k \le K(X)} \bigcup_{s\in S(X)_k} \{s,s+1,\ldots,s+k-1\}$$ is then at most $$\frac{K(X)(K(X)+1)}{2} \lceil \frac{2X}{K(X)^3}-1 \rceil)= \frac{X(K(X)+1)}{K(X)^2}-\frac{K(X)(K(X)+1)}{2} $$

Then let us also suppose, in order to maximize the number of elements in $S(X)$, that for each remaining $s \in S(X)$, the first element in $S(X)$ after $s$ is $s+K(X)+1$.

Thus the total number of elements in $S(X)$ is, at most, \begin{align*} &K(X) \left( \frac{2X}{K(X)^3}-1 \right) + (X-\frac{X(K(X)+1)}{K(X)^2}+\frac{K(X)(K(X)+1)}{2})\frac{1}{K(X)+1}+1\\
&= \frac{2X}{K(X)^2} - K(X) + \frac{X}{K(X)+1} -\frac{X}{K(X)^2} + \frac{K(X)}{2}+1\\
&=\frac{X}{K(X)^2} - \frac{K(X)}{2} + \frac{X}{K(X)+1}+1
\end{align*} which is smaller than $X/K(X)$, since \begin{align*} \frac{X}{K(X)}-\frac{X}{K(X)+1} &=\frac{X}{K(X)}\left( 1-\frac{1}{1+\frac{1}{K(X)}}\right) \\
&=\frac{X}{K(X)}\left( \frac{1}{K(X)}-\frac{1}{K(X)^2}+\cdots\right) \\
&<\frac{X}{K(X)^2} \end{align*}

$\Box$

\end{pf}

Now we consider $F(n)$ again.  Suppose that $N_x$ is a perfect $p^{th}$ power for at least $X/K(x)$ of the $x \le X$.  Then the lemma above implies that there must be some $k < K(X)$ for which there are at least $2X/K(X)^3$  of the $x \le X$ such that $N_x,N_{x+k}$ are both perfect $p^{th}$ powers and there are no such powers between them.  Since $N_x,N_{x+k}$ are both perfect $p^{th}$ powers, so must $F_k(x)=F(x+1)F(x+2)\ldots F(x+k)$ be a perfect $p^{th}$ power.

According to the above work $F_k(n)$ is a perfect $p^{th}$ power $$\ll X\frac{\log{z}}{z} + (\deg{F_k})\frac{X}{\sqrt{z}} + (\deg{F_k})z + (\deg{F_k})^2\frac{X}{\sqrt{z}} + (\deg{F_k})^2 z^2$$ times which is \begin{align*}&\ll_F X\frac{\log{z}}{z} + k\frac{X}{\sqrt{z}} + kz + k^2\frac{X}{\sqrt{z}} +k^2 z^2 \\
&\ll_F K(X)^2\frac{X}{\sqrt{z}} +K(X)^2 z^2\end{align*}
but by assumption $F_k(n)$ is a perfect $p^{th}$ power at least $2X/K(X)^3$ times.  Putting these together we see that $K(X)$ must satisfy $$X \ll  K(X)^5 \frac{X}{\sqrt{z}} +K(X)^5 z^2$$ for any choice of $z$.

Setting $z=X^{2/5}$ we see that $K(X)$ cannot have smaller magnitude than $$X^{1/25}.$$  Thus we have proved the second part of Theorem \ref{pth}.

\section{Acknowledgements}

The authors acknowledge support from National Science Foundation grant DMS 08-38434 ``EMSW21-MCTP: Research Experience for Graduate Students''.

The authors also wish to thank Paul Pollack for his numerous suggestions and assistance.

\section{References}
\bibliographystyle{elsarticle-num}

Squares in Polynomial Product Sequences