\begin{theorem}\label{thm1}
There exists a constant $C>1$ such that
\begin{equation}\label{equnthm1}
C^{-1}\lambda^{d_S/2}\leq{N}(u)\leq C\lambda^{d_S/2}
\end{equation}
holds for any global Dirichlet or Neumann eigenfunction $u$  on $\mathcal {SG}$ with  eigenvalue $\lambda$, except for the first non-constant Neumann eigenfunction where $N(u)=0$.
\end{theorem}

\label{sec1}
The study of Laplacians on fractals and their spectral properties constitutes a cornerstone of analysis on fractals, a field largely pioneered by Kigami \cite{K2,K4}. Unlike their Euclidean counterparts, Laplacians on fractals exhibit a wealth of novel and unexpected phenomena, leading to a rich and distinct spectral theory \cite{FS, Ka1,Ka2,K3,KL, Sh, Sh2, T}. Among these phenomena, the intricate oscillatory behavior of eigenfunctions — such as the distribution and growth of their local extrema — remains a topic of profound interest.

In the classical setting of a smooth, compact Riemannian manifold (or a bounded Euclidean domain with suitable boundary conditions), the celebrated Courant nodal domain theorem \cite{CH} provides a fundamental upper bound on the number of nodal domains of an eigenfunction, which in turn implies an upper bound for its local extrema. Moreover, the Hörmander-type estimates \cite{Ho} show that the $L^\infty$-norm of an eigenfunction grows at most polynomially with the eigenvalue. These results paint a picture of eigenfunctions whose complexity increases in a controlled and predictable manner as the energy (eigenvalue) increases.

The landscape on fractals is quite different. The existence of pre-localized eigenfunctions — eigenfunctions that vanish identically on the boundary along with their normal derivatives — is a hallmark of fractals \cite{K3,K4}. Such eigenfunctions can be highly localized and give rise to  a cascade of new eigenfunctions through a localization process. This structure fundamentally alters the asymptotic distribution of eigenvalues and the qualitative behavior of eigenfunctions. Consequently, classical tools and intuition from elliptic PDEs often fail, necessitating new frameworks for understanding the fine properties of eigenfunctions on fractals.

\begin{figure}[h]
\begin{center}
\includegraphics[width=5.5cm]{SG2.pdf}
\caption{The Sierpinski gasket $\mathcal{SG}$.}
\label{figure1}
\end{center}
\end{figure}

This paper is devoted to a study of the oscillatory behavior of eigenfunctions on post-critically finite (p.c.f.) self-similar sets, among which the Sierpinski gasket ($\mathcal{SG}$, see Figure \ref{figure1}) serves as a typical  example. We introduce and investigate the extremum counting function
$N(x)$ for the Laplacian $-\Delta_\mu$ where $\mu$ is the reference measure. For an eigenfunction $u$ with eigenvalue $\lambda$, the count
$N(u)$ enumerates its distinct local maximum and minimum sets (formally defined in Definition \ref{def1}). The function $N(x)$ then captures the maximum of this number over all eigenfunctions with eigenvalues up to $x$:

$$N(x)=\sup\{N(u): u \text{ is a }\lambda \text{-eigenfunction with } 0\leq \lambda\leq x\}.$$

Our primary goal is to establish the asymptotic growth rate of $N(x)$ as $x\to \infty$, linking it directly to the spectral exponent $d_S$ of the fractal, which characterizes a sharp phase transition in the behavior of $N(x)$.

For the upper bound, we prove in Proposition \ref{prothm1} that under a natural condition (A) — namely, that eigenfunctions with sufficiently small eigenvalues possess at most one extreme set — the growth of $N(x)$ is at most of the order $x^{d_S/2}$:
$$\limsup_{x\to\infty} \frac{N(x)}{x^{d_S/2}}<\infty.$$
Condition (A) can be interpreted as a form of ``low-energy simplicity''. It is not universal for all fractals, as evidenced by the modified Koch curve \cite{M,Sh2}, where even low-energy eigenfunctions can have infinitely many extrema. Verifying its validity is therefore a key step in the analysis for a given fractal.

Conversely, for the lower bound, Proposition \ref{prothm2} shows that the existence of  a  pre-localized eigenfunction forces \( N(x) \) to grow at least polynomially. In the lattice case, this lower bound is sharp, matching the upper bound:
\[
\liminf_{x\to\infty}\frac{N(x)}{x^{d_S/2}}>0.
\]
The proof constructs sums of copies of a pre-localized eigenfunction over appropriately chosen cells — an inherently fractal method with no direct analogue in the smooth setting.

Our main result  is the following theorem, which gives a precise, uniform, two-sided estimate of $N(u)$ for eigenfunctions on the Sierpinski gasket $\mathcal{SG}$.

In the classical setting of a smooth, compact Riemannian manifold (or a bounded Euclidean domain with suitable boundary conditions), the celebrated Courant nodal domain theorem \cite{CH} provides a fundamental upper bound on the number of nodal domains of an eigenfunction, which in turn implies an upper bound for its local extrema. Moreover, the Hörmander-type estimates \cite{Ho} show that the $L^\infty$-norm of an eigenfunction grows at most polynomially with the eigenvalue. These results paint a picture of eigenfunctions whose complexity increases in a controlled and predictable manner as the energy (eigenvalue) increases.

\begin{figure}[h]
\begin{center}
\includegraphics[width=5.5cm]{SG2.pdf}
\caption{The Sierpinski gasket $\mathcal{SG}$.}
\label{figure1}
\end{center}
\end{figure}

This paper is devoted to a study of the oscillatory behavior of eigenfunctions on post-critically finite (p.c.f.) self-similar sets, among which the Sierpinski gasket ($\mathcal{SG}$, see Figure \ref{figure1}) serves as a typical example. We introduce and investigate the extremum counting function
$N(x)$ for the Laplacian $-\Delta_\mu$ where $\mu$ is the reference measure. For an eigenfunction $u$ with eigenvalue $\lambda$, the count
$N(u)$ enumerates its distinct local maximum and minimum sets (formally defined in Definition \ref{def1}). The function $N(x)$ then captures the maximum of this number over all eigenfunctions with eigenvalues up to $x$:

$$N(x)=\sup\{N(u): u \text{ is a }\lambda \text{-eigenfunction with } 0\leq \lambda\leq x\}.$$

Conversely, for the lower bound, Proposition \ref{prothm2} shows that the existence of a pre-localized eigenfunction forces \( N(x) \) to grow at least polynomially. In the lattice case, this lower bound is sharp, matching the upper bound:
\[
\liminf_{x\to\infty}\frac{N(x)}{x^{d_S/2}}>0.
\]
The proof constructs sums of copies of a pre-localized eigenfunction over appropriately chosen cells — an inherently fractal method with no direct analogue in the smooth setting.

Our main result is the following theorem, which gives a precise, uniform, two-sided estimate of $N(u)$ for eigenfunctions on the Sierpinski gasket $\mathcal{SG}$.

\begin{definition}\label{def1}

(a).
Let $u\in\mathscr{D}_\mu$, $\emptyset\neq A\subset K$ and $c\in\mathbb{R}$, we say that $u$ has a \textit{local maximum ({\rm resp.} minimum)} at $A$ with value $c$ if

(a-1). $A$ is a connected component of $u^{-1}(c)$;

(a-2). $A\cap V_0=\emptyset$;

(a-3). there exists $\delta>0$ such that $u(p)\leq c$ (resp. $u(p)\geq c$) for any $ p\in A_\delta$, where
$A_\delta$ is the $\delta$-neighborhood of $A$.

Call such a set $A$ a \textit{(local) extreme set} of $u$. Further, if $A$ is a singleton, call $A$ an {\it extreme point} of $u$.

(b). For $u\in\mathscr{D}_\mu$, denote
\[{N}(u)=\#\{A\subset K: A \text{ is an extreme set of } u\}.\]
For $x>0$, define
\[N(x)=\sup\{{N}(u): u \text { is a $\lambda$-eigenfunction with}\ 0\leq \lambda\leq x\},\]
and call it \textit{the extremum counting function} of $-\Delta_\mu$.
\end{definition}

\begin{proposition}\label{prothm2}
If there exists a pre-localized eigenfunction, then
\begin{equation*}
\liminf_{x\to\infty}\frac{\log N(x)}{\log x}\geq\kappa
\end{equation*}
for some $0<\kappa\leq d_S/2$.
In particular, for the lattice case (see the exact meaning in Section \ref{sec2}),
\begin{equation*}
\liminf_{x\to\infty}\frac{N(x)}{x^{d_S/2}}>0.
\end{equation*}
\end{proposition}

\noindent{\bf Remark.}
For a $\lambda$-eigenfunction with $\lambda>0$, the values of its local maxima (resp. minima) are positive (resp. negative).
Indeed, suppose that $u$ has a local maximum at $A$ with value $c\leq 0$. Since $u$ is a $\lambda$-eigenfunction, there exists $\delta>0$ such that $u\leq c\leq 0$ and $\Delta_\mu u=-\lambda u\geq 0$ on $A_\delta$. Moreover, $u$ is non-constant on $A_\delta$. Let $h$ be the harmonic function satisfying $h|_{\partial A_\delta}=u|_{\partial A_\delta}$, and denote by $g(\cdot,\cdot)$ the Green function for $-\Delta_\mu$ on $A_\delta$. It is known that $g(p,q)>0$ for all $p,q\in A_\delta$. Then, for $p\in A$, we have
\begin{equation*}
u(p)=\int_{A_\delta}g(p,q)\lambda u(q)\mathrm{d}\mu(q)+h(p)<h(p)\leq \max u|_{\partial A_{\delta}},
\end{equation*}
which yields a contradiction.

\noindent{\bf Remark.} By Lemma \ref{pro1}-(a), $\mathbf{A}_\lambda$ and $\mathbf{B}_\lambda^1$ are cones, i.e. if $\mathbf{a}\in \mathbf{A}_\lambda\ (\text{or }\mathbf{B}_\lambda^1)$, then $k\mathbf{a}\in \mathbf{A}_\lambda \ (\text{or }\mathbf{B}_\lambda^1)$ for any $k\neq 0$. Let $\pi:\mathbb{R}^L\setminus\{\mathbf{0}\}\to\mathbb{R}\mathrm{P}^{L-1}$ be the canonical projection that sends each point to the line through the origin it generates.
For $\mathbf{a},\mathbf{b}\in\mathbb{R}^L$, define $\mathbf{a}\sim\mathbf{b}$ if there exists $k\in\mathbb{R}\setminus\{0\}$ such that $\mathbf{a}=k\mathbf{b}$, then $\pi$ can be regarded as a bijection from $(\mathbb{R}^L\setminus\{\mathbf{0}\})/\sim$ to $\mathbb{R}\mathrm{P}^{L-1}$.
Write \[\mathcal{A}_\lambda=\pi(\mathbf{A}_\lambda),\quad \mathcal{B}_\lambda^1=\pi(\mathbf{B}_\lambda^1),\] and define
\begin{equation}\label{defabT}
\mathcal{T}_\lambda^i:\mathbb{R}\mathrm{P}^{L-1}\to\mathbb{R}\mathrm{P}^{L-1} \quad \text{by}\quad \mathcal{T}_\lambda^i=\pi\circ T_\lambda^i\circ\pi^{-1}.
\end{equation}
Then the condition (\ref{eq1}) is equivalent to
\begin{equation}\tag{\ref{eq1}*}\label{eq2}
\begin{aligned}
&\mathcal{A}_\lambda=\big(\bigcup_{i\in S}(\mathcal{T}_\lambda^i)^{-1}(\mathcal{A}_{\gamma^2_i\lambda})\big)\cup\mathcal{B}^1_\lambda,\quad\text{with}\\
(\mathcal{T}_\lambda^i&)^{-1}(\mathcal{A}_{\gamma^2_i\lambda}),\ i\in S\text{ and }\mathcal{B}^1_\lambda\text{ pairwise disjoint.}
\end{aligned}
\end{equation}
Consequently, condition (A) is equivalent to \eqref{eq2}.

First we prove \eqref{exC}, i.e. $\mathcal{C}_{\lambda}=\mathcal{D}_{\lambda_0}$. Noticing that for any $\mathbf{b}\in\mathbb{R}^3\setminus\{{\bf 0}\}$, by \eqref{eq4.4}, we have
\begin{equation}\label{pixxi}
\pi(\{\mathbf{x}\in\mathbb{R}^3\setminus\{{\bf 0}\}:\mathbf{b}^\mathrm{t}\mathbf{x}=0\})=\Big\{\boldsymbol{\xi}\in\mathbb{R}\mathrm{P}^2:\ \mathbf{b}^\mathrm{t}(\mathbf{1},Q)^{-\mathrm{t}}\begin{pmatrix}1\\ \boldsymbol{\xi}\end{pmatrix}=0\Big\},
\end{equation}
and a direct calculation gives
\begin{equation*}
(4-\lambda_0,-2,-2)(\mathbf{1},Q)^{-\mathrm{t}}=\frac{1}{3}\big(-\lambda_0,0,2(6-\lambda_0)\big).
\end{equation*}
So by Lemma \ref{pro43}, we have
\begin{equation*}
\begin{aligned}
&\pi\circ\tau_\lambda^D\circ(\tau_\lambda^N)^{-1}\Big(\{(x^{(1)},x^{(2)},x^{(3)})^\mathrm{t}\in\mathbb{R}^3\setminus\{{\bf 0}\}:x^{(1)}=0\}\Big)\\
=&\Big\{\boldsymbol{\xi}\in\mathbb{R}\mathrm{P}^2:\ \big(-\lambda_0,0,2(6-\lambda_0)\big)\begin{pmatrix}1\\ \boldsymbol{\xi}\end{pmatrix}=0\Big\}\\
=&\Big\{(\xi^{(1)},\xi^{(2)})^\mathrm{t}\in\mathbb{R}^2:\ \xi^{(2)}-\frac{\lambda_0}{2(6-\lambda_0)}=0\Big\}\cup\{[(1,0)^\mathrm{t}]_\infty\}.
\end{aligned}
\end{equation*}
Similarly, $(-2,4-\lambda_0,-2)(\mathbf{1},Q)^{-\mathrm{t}}=\frac{1}{3}\big(-\lambda_0,-\sqrt{3}(6-\lambda_0),-(6-\lambda_0)\big)$ gives
\begin{equation*}
\begin{aligned}
&\pi\circ\tau_\lambda^D\circ(\tau_\lambda^N)^{-1}\Big(\{(x^{(1)},x^{(2)},x^{(3)})^\mathrm{t}\in\mathbb{R}^3\setminus\{{\bf 0}\}:x^{(2)}=0\}\Big)\\
=&\{(\xi^{(1)},\xi^{(2)})^\mathrm{t}\in\mathbb{R}^2:\ \sqrt{3}\xi^{(1)}+\xi^{(2)}+\frac{\lambda_0}{6-\lambda_0}=0\}\cup\{[(1,-\sqrt{3})^\mathrm{t}]_\infty\},
\end{aligned}
\end{equation*}
and $(-2,-2,4-\lambda_0)(\mathbf{1},Q)^{-\mathrm{t}}=\frac{1}{3}\big(-\lambda_0,\sqrt{3}(6-\lambda_0),-(6-\lambda_0)\big)$ gives
\begin{equation*}
\begin{aligned}
&\pi\circ\tau_\lambda^D\circ(\tau_\lambda^N)^{-1}\Big(\{(x^{(1)},x^{(2)},x^{(3)})^\mathrm{t}\in\mathbb{R}^3\setminus\{{\bf 0}\}:x^{(3)}=0\}\Big)\\
=&\{(\xi^{(1)},\xi^{(2)})^\mathrm{t}\in\mathbb{R}^2:\ -\sqrt{3}\xi^{(1)}+\xi^{(2)}+\frac{\lambda_0}{6-\lambda_0}=0\}\cup\{[(1,\sqrt{3})^\mathrm{t}]_\infty\}.
\end{aligned}
\end{equation*}
Recall that $\mathbf{C}=\{(a_1,a_2,a_3)\in\mathbb{R}^3:\text{either }a_i>0\text{ for all }i, \text{ or }a_i<0\text{ for all }i\}$ and $\mathcal{C}_\lambda=\pi\circ\tau_\lambda^D\circ(\tau_\lambda^N)^{-1}(\mathbf{C})$. By the symmetry of $\mathcal{SG}$, we have $\boldsymbol{\theta}\in\mathcal{C}_\lambda$. So the above calculation gives
$\mathcal{C}_{\lambda}=\mathcal{D}_{\lambda_0}$.

(b). For $5^{-m}\lambda<\lambda_1^D$ with $m\geq 1$, it is easy to see that
$\lambda_{m}=\psi^{-1}(5^{-m}\lambda)\in(0,6)$ by Remark \ref{re33}. Considering the function $v=u\circ F_2F_3^{m-1}$, by (\ref{gamma-delta01pre}), (\ref{gamma-delta02pre}) and $p_{23}=F_2F_3^{m-1}p_3\in A$, we see
\begin{equation}\label{gamma-delta0102r}
\begin{aligned}
&2v(p_1)+2v(p_2)-(4-\lambda_m)v(p_3)=0,\\
&\big(v(p_{3})-v(p_2)\big)\big(v(p_{3})-v(p_1)\big)\geq 0.
\end{aligned}
\end{equation}
Using (\ref{pixxi}) we find that
\begin{equation*}
\begin{aligned}
&\tau(v)\in\pi\circ\tau_\lambda^D\Big(\big\{v\in E(5^{-m}\lambda)\setminus\{0\}: v\text{ satisfies (\ref{gamma-delta0102r})}\big\}\Big)\\
=&\ \big\{(\xi^{(1)},\xi^{(2)})\in\mathbb{R}^2:\xi^{(2)}=\sqrt{3}\xi^{(1)}-\frac{\lambda_m}{6-\lambda_m},\ 0\leq\xi^{(1)}\leq\frac{\sqrt{3}\lambda_m}{2(6-\lambda_m)}\big\}\\
=&\ \mathcal{I}_{\lambda_m,3}\cup\{\boldsymbol{\zeta}_{\lambda_m,23}\}\cup\{\boldsymbol{\zeta}_{\lambda_m,31}\},
\end{aligned}
\end{equation*}
since
\begin{equation*}
\begin{aligned}
&(2,2,-(4-\lambda_m))(\mathbf{1},Q)^{-\mathrm{t}}=\frac{1}{3}\big(\lambda_m,-\sqrt{3}(6-\lambda_m),6-\lambda_m\big),\\
&(0,-1,1)(\mathbf{1},Q)^{-\mathrm{t}}=\frac{1}{3}\big(0,2\sqrt{3},0\big),\\
&(-1,0,1)(\mathbf{1},Q)^{-\mathrm{t}}=\frac{1}{3}\big(0,\sqrt{3},-3\big),
\end{aligned}
\end{equation*}
and $\pi\circ \tau_\lambda^D(v')=\frac{\lambda_m}{4(6-\lambda_m)}(\sqrt{3},-1)^\mathrm{t}\in\mathcal{I}_{\lambda_m,3}$ for a function $v'\in E(5^{-m}\lambda)$ satisfying (\ref{gamma-delta0102r}) with $v'(p_1)=v'(p_2)=4-\lambda_m$ and $v'(p_3)=4$.

(b). for $u$ in the (D5) or (N5) case, there exists a constant $c_5>1$ such that
\begin{equation}\label{esti5}
c_5^{-1}\lambda^{d_S/2}\leq N(u)\leq c_5\lambda^{d_S/2};
\end{equation}

\begin{lemma}\label{lm62}
Let $u\in E_D(\lambda)\setminus\{0\}$ or $E_N(\lambda)\setminus\{0\}$ with $\mathrm{supp}\,u=\mathcal{SG}$. For $u$ in the (D6) or (N6) case and $\eps=\varnothing$, we have
\begin{equation}\label{esti6}
c_6^{-1}\lambda^{d_S/2}\leq N(u)\leq c_6\lambda^{d_S/2}
\end{equation}
for some constant $c_6>1$.
\end{lemma}
\begin{proof}
For $u$ in the (D6) or (N6) case, we have $\lambda_m=3$, $\lambda_{m-1}=6$ and $\lambda=5^m\psi(3)$. Now we consider $u\circ F_{w'}$ for each $w'\in W_{m-2}$. Since $-\Delta_{m-1}u|_{V_{m-1}}=\lambda_{m-1}u|_{V_{m-1}}$, for distinct $i,j,k\in S$ we have
\begin{equation*}
\begin{aligned}
-2u(p_{ij}^{w'})=u(p_{i}^{w'})+u(p_{j}^{w'})+u(p_{ki}^{w'})+u(p_{jk}^{w'}),
\end{aligned}
\end{equation*}
and solving the above equations gives $u(p_i^{w'})=-u(p_{ki}^{w'})-u(p_{ij}^{w'})$. Without loss of generality, we assume $u(p_{23}^{w'})\leq u(p_{31}^{w'})\leq u(p_{12}^{w'})$, then

The result demonstrates the highly regular behavior of  $\mathcal{SG}$, where eigenfunction complexity — quantified by the count of local extrema — grows  precisely as the  power law  $d_S/2$. The proof relies on a detail analysis on the eigenfunction decimation, originated developed by Rammal and Toulouse \cite{RT} and later rigorously established by Shima and Fukushima \cite{Sh, FS}.

In the classical setting, the number of critical points of an eigenfunction on an $n$-dimensional manifold is generally expected to grow linearly with $\lambda^{(n-1)/2}$, a rate related to the wave propagation and the Bohr-Sommerfeld quantization. However, in highly  symmetric setting such as $n$-dimensional rectangles or balls — where eigenfunctions can oscillate at high frequencies independently along different directions — this order improves to $\lambda^{n/2}$.

On fractals, as shown  in Theorem \ref{thm1} and Propositions \ref{prothm1} and \ref{prothm2}, the growth is governed by the spectral exponent $d_S$, which takes the role played by the geometric Hausdorff dimension $n$ in the Euclidean setting. The observed order $d_S/2$ for $\mathcal{SG}$ suggests that its high symmetry is a key factor in realizing this maximal growth rate. We therefore conjecture that for a broader class of p.c.f. self-similar sets, the growth order of local extrema is at most $d_S/2$, with this upper bound being attained only in highly symmetric cases  — such as nested fractals, or even beyond the p.c.f. setting, as exemplified by the  Sierpinski carpet — and strictly smaller in the presence of lower symmetry.

\subsection{Notation and Propositions \ref{prothm1} and \ref{prothm2}}Before ending this section, let us introduce the exact definition of   $N(u)$ and $N(x)$  on a p.c.f. self-similar set $K$, which is always assumed to be  connected.

Let $V_0$ denote the boundary of $K$, and $\mathscr{D}_\mu$ denote the domain of $\Delta_\mu$. For a function $u\in \mathscr{D}_\mu$ and $p\in V_0$, denote by $(du)_p$ the normal derivative of $u$ at $p$.
For $\lambda\geq 0$, call a non-trivial  function $u\in\mathscr{D}_\mu$ satisfying $-\Delta_\mu u=\lambda u$ on $K\setminus V_0$ a {\it $\lambda$-eigenfunction} of $-\Delta_\mu$.  Say an eigenfunction $u$ a \textit{Dirichlet (Neumann) eigenfunction} if  $u|_{V_0}=0$ ($du|_{V_0}=0$). In particular, say $u$ a \textit{pre-localized eigenfunction}  if  both $u|_{V_0}=0$ and $du|_{V_0}=0$ hold; and a \textit{global eigenfunction} if $\mathrm{supp}\,u=K$.

\begin{definition}\label{def1}

(a).
Let $u\in\mathscr{D}_\mu$, $\emptyset\neq A\subset K$ and $c\in\mathbb{R}$, we say that $u$ has a \textit{local maximum ({\rm resp.} minimum)} at $A$ with value $c$ if

(a-1). $A$ is a connected component of $u^{-1}(c)$;

(a-2). $A\cap V_0=\emptyset$;

(a-3). there exists $\delta>0$ such that $u(p)\leq c$ (resp. $u(p)\geq c$) for any $ p\in A_\delta$, where
$A_\delta$ is the $\delta$-neighborhood of $A$.

Call such a set $A$ a \textit{(local) extreme set} of $u$. Further, if $A$ is a singleton, call $A$ an {\it extreme point} of $u$.

(b). For $u\in\mathscr{D}_\mu$, denote
\[{N}(u)=\#\{A\subset K: A \text{ is an extreme set of } u\}.\]
For $x>0$, define
\[N(x)=\sup\{{N}(u): u \text { is a $\lambda$-eigenfunction with}\ 0\leq \lambda\leq x\},\]
and call it \textit{the extremum counting function} of $-\Delta_\mu$.
\end{definition}

\noindent{\bf Remark.}
For a $\lambda$-eigenfunction with $\lambda>0$, the values of its local maxima (resp. minima) are positive (resp. negative).
Indeed, suppose that $u$ has a local maximum at $A$ with value $c\leq 0$. Since $u$ is a $\lambda$-eigenfunction, there exists $\delta>0$ such that $u\leq c\leq 0$ and $\Delta_\mu u=-\lambda u\geq 0$ on $A_\delta$. Moreover, $u$ is non-constant on $A_\delta$. Let $h$ be the harmonic function satisfying $h|_{\partial A_\delta}=u|_{\partial A_\delta}$, and denote by $g(\cdot,\cdot)$ the Green function for $-\Delta_\mu$ on $A_\delta$. It is known that $g(p,q)>0$ for all $p,q\in A_\delta$. Then, for $p\in A$, we have
\begin{equation*}
u(p)=\int_{A_\delta}g(p,q)\lambda u(q)\mathrm{d}\mu(q)+h(p)<h(p)\leq \max u|_{\partial A_{\delta}},
\end{equation*}
which yields a contradiction.

We have certain asymptotic estimates of $N(x)$ as $x\to \infty$.

\noindent{\bf(A)}: there exists $\lambda_0>0$ such that ${N}(u)\leq 1$ for any $\lambda$-eigenfunction $u$ with $0\leq\lambda<\lambda_0$.

\begin{proposition}\label{prothm1}
If condition (A) holds, then
\begin{equation*}
\limsup_{x\to\infty}\frac{N(x)}{x^{d_S/2}}< \infty.
\end{equation*}
\end{proposition}

\begin{proposition}\label{prothm2}
If there exists a pre-localized eigenfunction, then
\begin{equation*}
\liminf_{x\to\infty}\frac{\log N(x)}{\log x}\geq\kappa
\end{equation*}
for some $0<\kappa\leq d_S/2$.
In particular, for the lattice case (see the exact meaning in Section \ref{sec2}),
\begin{equation*}
\liminf_{x\to\infty}\frac{N(x)}{x^{d_S/2}}>0.
\end{equation*}
\end{proposition}

We structure the paper as follows.

In Section \ref{sec2}, we present the proofs of  Propositions \ref{prothm1} and \ref{prothm2}, and provide an equivalent characterization of condition (A).

Beginning in Section \ref{sec3}, we focus on the canonic Laplacian on the Sierpinski gasket $\mathcal{SG}$. There, we recall the spectral decimation method and state two key preparatory theorems — Theorems \ref{thm4} and \ref{thm5}.  The former confirms the validity of condition (A), while the later establishes two-sided estimate of $N(u)$ for a special class of eigenfunctions.

The proof of  Theorem \ref{thm4} is given in Section \ref{sec4},  followed by the proof of Theorem \ref{thm5} in Section \ref{sec5}. We conclude in Section \ref{sec6} with the proof of Theorem \ref{equnthm1}.

The post-theorem introduction says that the proof of Theorem~\ref{thm1} “relies on a detail analysis on the eigenfunction decimation,” i.e. the spectral (eigenfunction) decimation method “originated developed by Rammal and Toulouse \cite{RT} and later rigorously established by Shima and Fukushima \cite{Sh, FS}.” It further indicates the overall organization supporting Theorem~\ref{thm1}: in Section~\ref{sec3} the paper “recall[s] the spectral decimation method” and states “two key preparatory theorems — Theorems~\ref{thm4} and \ref{thm5},” where “\ref{thm4} confirms the validity of condition (A), while the later establishes two-sided estimate of $N(u)$ for a special class of eigenfunctions,” and then “conclude[s] in Section~\ref{sec6} with the proof” of the main estimate \eqref{equnthm1} (i.e. Theorem~\ref{thm1}).

The post-theorem introduction says that the proof of the main theorem “relies on a detail analysis on the eigenfunction decimation,” i.e. the spectral (eigenfunction) decimation method “originated developed by Rammal and Toulouse \cite{RT} and later rigorously established by Shima and Fukushima \cite{Sh, FS}.” It further indicates the overall organization supporting the main theorem: next the paper “recall[s] the spectral decimation method” and states “two key preparatory theorems.” We first record the following theorem.

\begin{theorem}\label{thm4}
For $0<\lambda<\lambda_1^D$, we have
\begin{equation}\label{eq3}
\begin{aligned}
\mathcal{A}_\lambda=\ & \mathcal{C}_\lambda=\mathcal{D}_{\psi^{-1}(\lambda)},\quad \mathcal{B}_\lambda^1=\big(\bigcup_{ij\in S_1}\mathcal{L}_{\psi^{-1}(\lambda),ij}\big)\cup\{\boldsymbol{\theta}\},\quad\text{and}\\
&(\mathcal{T}_\lambda^i)^{-1}(\mathcal{A}_{5^{-1}\lambda})=
\mathcal{G}_{\psi^{-1}(\lambda),i}\quad\text{for }i\in S.
\end{aligned}
\end{equation}
In particular, condition (A) holds.
\end{theorem}

The introduction then points to the later preparatory result
\begin{theorem}\label{thm5}
For  $\eps\in\{-1,1\}^n$ of length $n\geq 1$ with $\eps_n=1$, we have
\begin{equation}\label{equn}
c^{-1}(\lambda^{\eps})^{d_S/2}\leq N(u^{\eps})\leq c(\lambda^{\eps})^{d_S/2}
\end{equation}
with some constant $c>1$ independent of $\lambda_0$, $\mathbf a$ and $\eps$.
\end{theorem}

and finally says it “conclude[s] later with the proof” of the main estimate
\begin{equation}\label{equnthm1}
C^{-1}\lambda^{d_S/2}\leq{N}(u)\leq C\lambda^{d_S/2}
\end{equation}
(i.e. the main theorem).

Question: On the Sierpiński gasket \(\mathcal{SG}\), let \(N(u)\) denote the number of extreme sets of a function \(u\), where an extreme set is a connected component \(A\) of a level set \(u^{-1}(c)\), disjoint from the boundary vertex set \(V_0\), such that for some \(\delta>0\) the function is everywhere \(\le c\) on the \(\delta\)-neighborhood of \(A\) (local maximum case) or everywhere \(\ge c\) there (local minimum case). Let \(d_S\) be the spectral dimension of \(\mathcal{SG}\). A global Dirichlet or Neumann eigenfunction means an eigenfunction of the Laplacian on all of \(\mathcal{SG}\) satisfying Dirichlet or Neumann boundary conditions on \(V_0\). Which uniform estimate holds for such eigenfunctions?

There exists a constant \(C>1\) such that for every global Dirichlet or Neumann eigenfunction \(u\) on \(\mathcal{SG}\) with eigenvalue \(\lambda\), one has \(C^{-1}\lambda^{d_S/2}\le N(u)\le C\lambda^{d_S/2}\), except for the first non-constant Neumann eigenfunction, for which \(N(u)=0\).

Choices:
B. There exists a constant \(C>1\) such that for every global Dirichlet or Neumann eigenfunction \(u\) on \(\mathcal{SG}\) with eigenvalue \(\lambda\), one has \(C^{-1}\lambda^{d_S/2}\le N(u)\le C\lambda^{d_S/2}\), with no exceptional Neumann eigenfunction.
C. There exists a constant \(C>1\) such that for every global Dirichlet or Neumann eigenfunction \(u\) on \(\mathcal{SG}\) with eigenvalue \(\lambda\), one has \(N(u)\le C\lambda^{d_S/2}\).
D. For every global Dirichlet or Neumann eigenfunction \(u\) on \(\mathcal{SG}\) with eigenvalue \(\lambda\), there exists a constant \(C=C(u)>1\) such that \(C^{-1}\lambda^{d_S/2}\le N(u)\le C\lambda^{d_S/2}\), except for the first non-constant Neumann eigenfunction where \(N(u)=0\).
E. There exists a constant \(C>1\) such that for every global Dirichlet or Neumann eigenfunction \(u\) on \(\mathcal{SG}\) with eigenvalue \(\lambda\), one has \(C^{-1}\lambda^{d_S/2}\le N(u)\le C\lambda\), except for the first non-constant Neumann eigenfunction, for which \(N(u)=0\).


\label{sc:proof-thm}

Fix some $\e>0$, and an integer $l>5\e^{-1}$.
Let $d$ be sufficiently large in terms of $l$, and let
$X=5\log d$. Recall $R(x)=P_{d+1}(x)/x$.
Proposition~\ref{pr:number-roots-ra

\begin{align}\label{eq:PIT}
\{\text{number of distinct irreducible} &\text{ factors of $P$}\}\nonumber\\
&\approx \E_q[\text{number of roots of $P$ in $\F_q$}],
\end{align}
where $P$ is a fixed polynomial and the averaging is over a random prime $q$.

If we take a random polynomial $P$, and show that it has on average
$1$ root in $\F_q$, now $P$ and $q$ are both random, then it follows
that $P$ is a power of a single irreducible polynomial with high probability.
To show this, we fix a prime $q$ and a residue $a\in\F_q$, and show that the
value $P(a)$ is equidistributed in $\F_q$ for our random $P$.
In particular, $P(a)=0\in\F_q$ will occur with probability approximately $1/q$.
Summing this up for $a$ and averaging over $q$ will give the required result.

In the setting of \cite{BV19}, the equidistribution of $P(a)$ in $\F_q$
is related to a Markov chain introduced by Chung, Diaconis and Graham \cite{CDG87}.
Due to the dependence of the coefficients, the equidistribution problem
cannot be described by a Markov chain in our setup.

Proving equidistribution is the main new contribution of our paper. We do this by conditioning on the values of the coefficients $X_p$ for primes $p<d/2$, and use that the coefficients corresponding to the
remaining primes are indepenedent from each other and from the coefficients
whose values are influenced by the smaller primes.
We build on \cite{Kon} (also used in \cite{BV19})
to prove equidistribution of
\[
\sum_{p\ge d/2\text{ prime}} X_p a^{p-1}.
\]
The key difference is that we are summing over the primes, and the argument
in \cite{BV19} requires an arithmetic progression.
We bypass this issue by finding many disjoint short arithmetic progressions
in the primes using known results from \cite{GT}, \cite{TZ}, \cite{Sha}
and then apply a version of the argument in \cite{BV19} for these.
This idea has been inspired by \cite{Bou}.

This allows us to prove equidistribution of $P(a)$ for most values of $a$.
For some of the remaining values, equidistribution may fail.
It certainly does for $a=-1,0,1$ and possibly also for some other low degree
roots of unity.
For the exceptional residues, we only prove an upper bound of the form
$\P[P(a)=0]\le C d^{-1/2+\e}$ using a classical Littlewood-Offord type bound.
This is where the error term in Theorem \ref{thm: random} comes from.
Here a more precise analysis may yield a better bound giving a more precise
estimate for the probability that $P$ is reducible.
It may be possible to adapt the arguments in \cite{BV19} to give stronger
estimates for most of the exceptional residues, and the error term
may potentially be dominated by the probability that $P$ is divisible by $x-1$
or $x+1$.
We do not pursue this question.

After this, it remains to show that $P$ is not a proper power of an irreducible
polynomial with high probability.
We have not been able to adapt the corresponding argument in \cite{BV19}
to our setting.
Instead, we extend the equidistribution result to the pair
$(P(a),P'(a))$.
This allows us to show that $P$ has very few
double roots in $\F_q$ on average (much less than $1$),
and then the main argument can
be used to rule out repeated factors of $P$ in $\Z[x]$.

\subsection{Organization of the paper}

In Section \ref{sc:PIT}, we formulate a statement that makes \eqref{eq:PIT}
precise.
This is a straightforward adaptation of \cite{BV19}, but the result formulated
in \cite{BV19} cannot be applied as a black box.
Section \ref{sc:equidistribution} contains our equidistribution estimate for
random walks with steps $\pm a^i$ where $i$ runs through an index set
that contains sufficiently many disjoint arithmetic progressions.
We use these estimates to derive bounds for the expected number of roots
of $P$ in a finite field in Section \ref{sc:number-of-roots}.
We finish the paper by completing the proofs of the main results in Sections
\ref{sc:proof-thm} and \ref{sc:proof-cor}.

\subsection{Notation}
The letters $c$ and $C$ denote positive constants whose values may change
from one occurrence to the other.

\subsection{Acknowledgement}
We would like to thank Jacob Fox,  Julian Sahasrabudhe, Peter Sarnak and Joni Ter\"av\"ainen for helpful discussions on the subject of this paper. Part of the work was done during several visits of MWX at Cambridge University, and the warm hospitality is greatly appreciated.

\section{Expected number of roots of a polynomial in a random finite field}
\label{sc:PIT}

Given a number field $K$, we denote by $\cO_K$ its ring of integers and
write $\zeta_K$ for its Dedekind zeta function.
We write $A_K(n)$ for the number of prime ideals $\mathfrak{p}\subset\cO_K$
with norm $N_{K/\Q}(\mathfrak{p})=n$.

For a number $X>1$, we write
\[
h_X(u)=
\begin{cases}
2\exp(-X) & \text{if $u\in(X-\log 2,X]$,}\\
0 &\text{otherwise}.
\end{cases}
\]

Given a polynomial $P\in\Z[x]$ and a rational prime $q$,
we write $B_P(q)$ for the number of distinct roots of $P$
in $\F_q$.
We write $\wt P$ for the product of the irreducible factors
of $P$ in $\Z[x]$, and we write $\Delta_P$ for the discriminant of $P$.
Given an irreducible polynomial $Q\in\Z[x]$, we write $K_Q=\Q(\a)$,
where $\a$ is a root of $Q$.

The purpose of this section is to prove the following result.

\begin{proposition}\label{pr:number-distinct-factors}
Let $d,M\in\Z_{\ge 1}$.
Let $P\in\Z[x]$ be a polynomial of degree at most $d$
with coefficients of absolute value at most $M$.
Suppose that for every irreducible factor $Q$ of $P$,
RH holds for $\zeta_{K_Q}$.
Let $X\ge 1$.
Then
\begin{align*}
\sum_{\text{$q$ prime}} B_P(q)\log(q)h_X(\log q)
&=|\{\text{distinct irreducible factors of $P$}\}|\\
&\phantom{=}+ O(d^2 X^2\log (dM)\exp(-X/2)).
\end{align*}
The implied constant is absolute.
\end{proposition}

The proof of this follows \cite{BV19}*{Proposition 19}.
We begin by recalling a quantitative version of the prime ideal theorem under
the Riemann hypothesis.
This is standard, and this precise formulation can be found in
\cite{BV19}*{Proposition 9}.

\begin{proposition}\label{pr:prime-number-theorem}
Let $K$ be a number field with discriminant $\Delta$, and suppose
RH holds for $\zeta_K$.
Let $X>1$.
Then
\[
\sum_{\text{$q$ prime}} A_K(q)\log(q) h_X(\log q)
=1+O(X^2\log|\Delta|\exp(-X/2)),
\]
where the implied constant is absolute.
\end{proposition}

\begin{lemma}\label{lm:A-B}
Let $P\in\Z[x]$, and let $q$ be a rational prime with $q\nmid\Delta_{\wt P}$.
Then
\begin{equation}\label{eq:A-B}
B_P(q)=\sum_{\text{$Q|P$ irreducible}} A_{K_Q}(q).
\end{equation}
\end{lemma}

This lemma is standard.
It is closely related to the $m=1$ case of \cite{BV19}*{Proposition 16}.
The difference compared to that result is that there the roots of certain
exceptional polynomials are not counted in $B_P(p)$ and they are also not
counted on the right hand side of \eqref{eq:A-B}.
While this is not formally permitted in \cite{BV19}, the proof works verbatim
if we take the empty set for the exceptional polynomials.

\begin{proof}[Proof of Proposition \ref{pr:number-distinct-factors}]
We first estimate $\Delta_P$.
It is represented by a determinant of size $2d-1$ with entries bounded by $dM$
(divided by the leading coefficient).
Therefore,
\[
|\Delta_P|\le (2d-1)^{2d-1} (dM)^{2d-1}\le (2d)^{4d} M^{2d}.
\]
This is also an upper bound for $\Delta_{\wt P}$ and
the discriminants for all the number fields that
we may obtain by adjoining a root of $P$ to $\Q$.

If $q\nmid \Delta_{\wt P}$ is a prime, then
\[
B_P(q)=\sum_{\text{$Q|P$ irreducible}} A_{K_Q}(q)
\]
by Lemma \ref{lm:A-B}.
If $q|\Delta_{\wt P}$, then we just use the trivial bounds $0 \le B_P(q) \le d$, and $0\le \sum_{\text{$Q|P$ irreducible}} A_{K_Q}(q) \le d$ to deduce that
\[
\Big|B_P(q)-\sum_{\text{$Q|P$ irreducible}} A_{K_Q}(q)\Big|\le d,
\]
and we have at most
\[
\frac{\log |\Delta_{\wt P}|}{X-\log 2}\le \frac{10 d(\log dM)}{X}
\]
number of primes $q$ for which this holds.

Therefore,
\[
\sum_{\text{$q$ prime}}\Big|B_P(q)-\sum_{\text{$Q|P$ irreducible}} A_{K_Q}(q)\Big|
\log (q) h_X(\log q)
\le \frac{C d^2(\log dM)}{\exp(X)}
\]
for an absolute constant $C$.

Using Proposition \ref{pr:prime-number-theorem} to estimate the sums of $A_{K_Q}(q)$,
we get
\begin{align*}
\Big|\sum_{\text{$q$ is prime}} &B_P(q)\log(q)h_X(\log q)
-|\{\text{distinct irreducible factors of $P$}\}|\Big|\\
&\le Cd X^2\log((2d)^{4d}M^{2d})\exp(-X/2)+Cd^2(\log dM)\exp(-X)\\
&\le C d^2 X^2\log (dM)\exp(-X/2).
\end{align*}
\end{proof}

\section{Equidistribution estimate}
\label{sc:equidistribution}

We denote by $M(P)$ the Mahler measure of a polynomial $P\in\Z[x]$.
Let $l\in\Z_{\ge 1}$ and let $q$ be a prime.
We say that a polynomial $P$ is $(l,q)$-exceptional if $\deg(P)\le l$ and $M(P)\le q^{1/(l+1)^2}$.
If $q$ is a prime, then an element of $\F_q$ is $l$-exceptional if it
is the root of an $(l,q)$-exceptional polynomial.

The purpose of this section is to prove the following result and a weaker
estimate that is valid for all non-zero residues, which we formulate at the
end of the section.

\begin{proposition}\label{pr:unexceptional}
Let $l,d\in\Z_{\ge 3}$ and let $q$ be a prime that is suitably large in
terms of $l$.
Let $K\in\Z_{\ge1}$.
Let $a\in\F_q$ be an element such that $a^k$
is not $l$-exceptional for any $k=1,\ldots,K$.
Let $I\subset [0,\ldots,d]$ be a set that contains $q^{5/(l+1)}$ pairwise disjoint
arithmetic progressions of length $3l^3$ with common difference at most $K$.
Let $X_i$ be independent uniform $\pm1$ valued random variables, and
let
\[
Y=\sum_{i\in I}X_i(a^i,ia^{i-1})
\]
be a random element of $\F_q^2$.
Then
\[
\Big|\P[Y=x]-\frac{1}{q^2}\Big|< q^{-10}
\]
for all $x\in\F_q^2$.
\end{proposition}

The strategy of the proof is to estimate the Fourier coefficients
of $Y$.
For an element $x\in\F_q$, we write $|x|$ for the smallest absolute
value of an integer in the residue class of $x$.
We will show that if $a^k$ is not an exceptional residue and
$(\xi_1,\xi_2)\in\F_q^2\backslash(0,0)$, then
$|\xi_1 a^j+\xi_2 j a^{j-1}|$ cannot be small for all values of $j$
in a suitably long arithmetic progression of step size $k$.
This is the content of the next lemma.
Once we have this, we may use the assumption that $I$ contains
many disjoint arithmetic progressions to find many indices $j$ for which
$|\xi_1 a^j+\xi_2 j a^{j-1}|$ is not small.
This will allow us to estimate the Fourier transform using a product
formula that follows from the independence of $X_j$.

\begin{lemma}\label{lm:large-element}
	Let $q$ be a prime, let $a\in\F_q$, and let $(\xi_1,\xi_2)\in\F_q^2\backslash(0,0)$.
	Let $l\in\Z_{\ge 3}$, let $r>l^2$ be a prime, and let $k\in\Z_{> 0}$.
	Suppose that we have
	\[
	|\xi_1 a^{jk+j_0}+\xi_2(jk+j_0)a^{jk+j_0-1}|<\frac{q^{1-2/(l+1)}}{l+1}
	\]
	for all $j=0,\ldots, l(r+1)$.
	Then $a^k$ is an $l$-exceptional residue.
\end{lemma}

The proof of this lemma follows an argument of Konyagin \cite{Kon}.
Writing $b_j$ for the integer with the smallest absolute value
in the residue class of $\xi_1 a^{jk+j_0}+\xi_2(jk+j_0)a^{jk+j_0-1}$,
we will show that under the assumption of the lemma, $b_j$ satisfies
two linear recurrence relations.
We will use this to show that $b_j$ also satisfies the linear recurrence
corresponding to the greatest common divisor of the polynomials associated
to the original recurrences, and hence
$a$ is a root of this polynomial.
One of the polynomials will be used to control the degree, while the other will be
used to control the Mahler measure of the greatest common divisor.

The following simple lemma will be used to construct polynomials such that
$b_j$ satisfies the corresponding linear recurrences $\mod q$, and also at the
end of the proof to conclude that $a$ is a root of the greatest common divisor.

\begin{lemma}\label{lm:recurrence}
Let $a\in\F_q$
and let $\a_0,\ldots,\a_l\in\F_q$.
Consider the equations
\begin{equation}\label{eq:recurrence}
\sum_{j=0}^{l}\a_j(\xi_1 a^{j+j_0}+\xi_2(j+j_0)a^{j+j_0-1} )=0,
\end{equation}
where $\xi_1,\xi_2\in\F_q$
for $j_0\in\Z_{\ge 0}$ with the conventions $0\cdot 0^{-1}=0$ and $0^0=1$.

Then the following hold.
\begin{enumerate}
	\item If equation \eqref{eq:recurrence} holds for $j_0=0$ and $j_0=1$ and
	$(\xi_1,\xi_2)\neq(0,0)$, then $a$ is a root of the polynomial $\a_0+\a_1 x+\ldots +\a_l x^l$.
	\item If $a$ is a double root of the polynomial $\a_0+\a_1 x+\ldots +\a_l x^l$, then
	equation \eqref{eq:recurrence} holds for all $j_0\in\Z_{\ge 0}$ and all $\xi_1,\xi_2\in \F_q$.
\end{enumerate}
\end{lemma}

\begin{proof}
We begin with the first claim.
If $\xi_2\neq 0$, we subtract $a$ times equation \eqref{eq:recurrence} for
$j_0=0$ from the same equation for $j_0=1$.
We get
\[
\sum_{j=0}^l\a_j(\xi_1(a^{j+1}-a^{j+1})+\xi_2((j+1)a^j-ja^j))=0,
\]
which reduces to
\[
\sum_{j=0}^l\a_j\xi_2a^j=0,
\]
and proves the claim upon dividing the equation by $\xi_2$.

If $\xi_2=0$ and then necessarily $\xi_1\neq 0$, we get the claim if we divide
\eqref{eq:recurrence} for $j_0=0$ by $\xi_1$.
This proves the first claim.

Next, we turn to the second claim.
Using that $a$ is a root of the polynomial $x^{j_0}(\a_0+\ldots+\a_lx^l)$ and of its derivative,
we get the equations
\begin{align*}
\sum_{j=j_0}^l\a_j a^{j+j_0}&=0,\\
\sum_{j=j_0}^l(j+j_0)\a_j a^{j+j_0-1}&=0.
\end{align*}
Taking a linear combination of these equations with coefficients
$\xi_1, \xi_2$, we get \eqref{eq:recurrence}.
This proves the second claim.
\end{proof}

Let $X=(x_0,\ldots,x_N)$ be a sequence of integers.
We write $\Lambda(X)$ for the set of polynomials $P(x)=\a_0+\ldots+\a_d x^d$
of degree $d$ for some $d\le N$ such that
\[
\sum_{j=0}^d \a_j x_{j+j_0}=0
\]
for all $j_0=0,\ldots, N-d$.

The next lemma, which we quote from \cite{Kon}*{Lemma 5}, will be used to show that
the sequence $b_j$ satisfies the linear recurrence relation corresponding
to the greatest common divisor of the two polynomials that we will construct.

\begin{lemma}\label{lm:Konyagin}
Let $X=(x_0,\ldots,x_N)$ be an integer sequence.
Suppose $P_1,P_2\in\Lambda(X)$ and $\deg(P_1)+\deg(P_2)\le N$
then we have $\gcd(P_1,P_2)\in\Lambda(X)$.
\end{lemma}

One of the polynomials that we will construct will be a polynomial in $x^r$
for a suitable number $r$.
The next lemma gives an estimate for the Mahler measures of low degree
divisors of such a polynomial.
This result is standard, but we include the proof for the sake of completeness.

\begin{lemma}\label{lm:Mahler}
Let $P_1,P_2\in\Z[x]$ be non-zero polynomials and let $r>\deg(P_1)^2$ be a prime
and suppose $P_1(x)|P_2(x^r)$.
Then $M(P_1)^r\le M(P_2)$
\end{lemma}

\begin{proof}
Let $\zeta$ be a primitive $r$'th root of unity.
For each root $\a$ of $P_1$, $\a\zeta^j$ is a root of $P_2(x^r)$ for all
$j=0,\ldots,r-1$ with the same multiplicity as $\a$ is a root of $P_1$.
Moreover, these are distinct numbers because $\deg(\a/\a')< \deg(P_1)^2$
for any two roots $\a,\a'$ of $P_1$ and $\deg(\zeta^j)\ge r-1$ for
$j=1,\ldots,r-1$.

Therefore, denoting the places of $\Q$ by $M(\Q)$, we have
\begin{align*}
M(P_2)&=\prod_{v\in M(\Q)}\prod_{\a\in\overline{\Q_v}:P_2(\a)=0} \max(1,|\a|_v)\\
&\ge \prod_{v\in M(\Q)}\prod_{\a\in\overline{\Q_v}:P_1(\a)=0}
\prod_{j=0}^{r-1} \max(1,|\a\zeta^j|_v)\\
&=M(P_1)^r.
\end{align*}
\end{proof}

\begin{proof}[Proof of Lemma \ref{lm:large-element}]
If $a=0$, the conclusion holds, so we assume that $a\neq 0$.
We observe that
\begin{align*}
\xi_1 a^{jk+j_0}+\xi_2(jk+j_0)a^{jk+j_0-1}
&= \xi_1a^{j_0}(a^k)^j+\xi_2(jk+j_0)a^{j_0-1}(a^k)^{j}\\
&=(\xi_1 a^{j_0}+\xi_2 j_0 a^{j_0-1})(a^k)^j
+\xi_2k a^{k+j_0-1}j(a^k)^{j-1}.
\end{align*}
If we replace $a$ by $a^k$, $\xi_1$ by $\xi_1 a^{j_0}+\xi_2 j_0 a^{j_0-1}$
and $\xi_2$ by $\xi_2k a^{k+j_0-1}$,
this reduces the lemma to the case $j_0=0$ and $k=1$, so we will only consider that case.
It is easy to check that the new values of $\xi_1$ and $\xi_2$ are
not both $0$ if the original values were not.

Let $b_j$ be the smallest integer in absolute value  in the residue
class of $\xi_1a^j+\xi_2ja^{j-1}$ for $j\in\Z_{\ge 0}$.
By assumption, we have
\[|b_j|<\frac{q^{1-2/(l+1)}}{l+1}\]
for all $j=0,\ldots, l(r+1)$.

Let $\a_0,\ldots,\a_l, \b_0,\ldots,\b_l\in\Z$
with $|\a_j|,|\b_j|<q^{2/(l+1)}$ for all $j$ be
such that
$a$ is a double root of both polynomials
$P_1(x)=\a_0+\ldots+\a_l x^l$ and $P_2(x)=\b_0+\b_1 x^r+\ldots+\b_l x^{rl}$,
and both $P_1$ and $P_2$ are non-zero.
Such coefficients exist by the pigeon-hole principle.
This is a finite field version of Siegel's lemma.

We assume, as we may, that $\a_l$ and $\b_l$ are both non-zero, for otherwise we
could multiply $P_1$ or $P_2$ by suitable powers of $x$.

Now by Lemma \ref{lm:recurrence}, it follows that
\begin{equation}\label{eq:cong1}
\sum_{j=0}^{l}\a_j b_{j+j_0}\equiv 0\mod q
\end{equation}
for all $j_0=0,\ldots, lr$
and
\begin{equation}\label{eq:cong2}
\sum_{j=0}^{l}\b_j b_{jr+j_0}\equiv 0\mod q
\end{equation}
for all $j_0=0,\ldots,l$.
For the second claim, we use the lemma for a coefficient sequence of length
$lr+1$ with $r-1$ zeroes inserted between consecutive $\beta_j$.

By the triangle inequality and the upper bounds on the $\a_j$, $\b_j$ and $b_j$, we
have that the left hand sides of \eqref{eq:cong1} and \eqref{eq:cong2}
are less than
\[
(l+1)\frac{q^{1-2/(l+1)}}{l+1}q^{2/(l+1)}=q
\]
in absolute value, hence they are $0$.
Therefore, $P_1,P_2\in \Lambda(b_0,\ldots,b_{l(r+1)})$.

By Lemma~\ref{lm:Konyagin}, we have $\gcd(P_1,P_2)\in\Lambda(b_0,\ldots, b_{l(r+1)})$.
By Lemma~\ref{lm:recurrence}, $a$ is then a root of $\gcd(P_1,P_2)$.
We clearly have $\deg(\gcd(P_1,P_2))\le\deg(P_1)\le l$ and
\[
M(\gcd(P_1,P_2))\le M(P_2)^{1/r}\le ((l+1)q^{2/(l+1)})^{1/r}\le q^{1/(l+1)^2}
\]
by Lemma \ref{lm:Mahler} and $l\ge 3$, provided $q$ is sufficiently large in terms of $l$.
Therefore, $P: = \gcd(P_1,P_2)$ is an $(l,q)$-exceptional polynomial
and $a$ is an $l$-exceptional residue.
\end{proof}

\begin{proof}[Proof of Proposition \ref{pr:unexceptional}]
We consider the Fourier transform of the distribution of $Y$, which we
compute as
\begin{align*}
\wh Y(\xi_1,\xi_2)&=\E[\exp(2\pi i(\xi_1,\xi_2)\cdot Y/q)]\\
&=\prod_{j\in I}\E[\exp(2\pi iX_j(\xi_1 a^j+\xi_2 j a^{j-1})/q)]\\
&=\prod_{j\in I}\cos(2\pi(\xi_1 a^j+\xi_2 j a^{j-1})/q).
\end{align*}

We note the elementary inequality
\[
\cos(2\pi b/q)\le \exp(-(\pi^2/2)(|2b|/q)^2).
\]
Suppose $(\xi_1,\xi_2)\neq(0,0)$.
We apply Lemma \ref{lm:large-element} with a prime $r\in[l^2, 2l^2]$ and conclude that
every arithmetic progression in $\Z_{\ge 0}$
of length
\[
l(r+1)+1\le l(2l^2+1)\le 3l^3
\]
with common difference at most $K$
contains an element $j$ such that
\[
|2\xi_1 a^j+2\xi_2 j a^{j-1}|\ge\frac{q^{1-2/(l+1)}}{l+1},
\]
and hence
\[
\cos(2\pi(\xi_1 a^j+\xi_2 j a^{j-1})/q)\le \exp(-(\pi^2/2)q^{-4/(l+1)}/(l+1)^2).
\]

Since there are more than
\[
q^{5/(l+1)}\ge 10\log q\cdot (2/\pi^2) q^{4/(l+1)}(l+1)^2
\]
disjoint arithmetic progressions in $I$, we have
\[
|\wh Y(\xi_1,\xi_2)|\le q^{-10}
\]
provided $(\xi_1,\xi_2)\neq(0,0)$.

Using the Fourier inversion formula
\[
\P[Y=x]=\frac{1}{q^2}\sum_{\xi_1,\xi_2\in\F_q}
\exp(-2\pi i(\xi_1,\xi_2)\cdot x)\wh Y(\xi_1,\xi_2)
\]
and $\wh Y(0,0)=1$, we conclude
\[
\Big|\P[Y=x]-\frac{1}{q^2}\Big|\le q^{-10}
\]
as required.
\end{proof}

We finish this section by recording a classical Littlewood-Offord type
bound that shows that the random walk spreads out substantially even when
$a$ is an exceptional residue.
In the case $a=1$, the result is essentially sharp.

\begin{proposition}\label{pr:exceptional}
Let $q$ be an odd prime, and let $a\in\F_q^\times$.
Let $I$ be a set of positive integers with $|I|\le q$.
Let $X_i$ be independent uniform $\pm1$ valued random variables for $i\in I$, and let
\[
Y=\sum_{i\in I} X_i a^i
\]
be a random element of $\F_q$.
Then
\[
\P[Y=x]\le 129 |I|^{-1/2}.
\]
for all $x\in \F_q$.
\end{proposition}

\begin{proof}
	Let $\wt X_i$ for $i\in I$ be a sequence of independent random variables
	taking the value $0$ with probability $3/4$ and each of $\pm 1$ with
	probability $1/8$.

	By \cite{CJMS}*{Lemma 12} applied with $\mu=1/4$, we have
	\[
	\P\Big[\sum_{i\in I} \wt X_i a^i =x\Big]\le 64(|I|/4)^{-1/2}+q^{-1}
	\le 129 |I|^{-1/2}
	\]
	for all $x\in \F_q$.

	By \cite{TV-book}*{Corollary 7.12} applied with $\mu'=1$ and $\mu=1/4$, we have
	\[
	\P\Big[\sum_{i\in I} X_i a^i =x\Big]\le \P\Big[\sum_{i\in I} \wt X_i a^i =0\Big]
	\le 129 |I|^{-1/2}
	\]
	for all $x\in \F_q$.
\end{proof}

\section{Expected number of roots of a random polynomial in a finite field}
\label{sc:number-of-roots}

Recall that $X_j$ for $j\in\Z_{\ge 0}$ is a random multiplicative sequence.
To simplify notation, we introduce the random polynomial
\[R(x): =
P_{d+1}(x)/x=X_1+X_2x+\ldots+X_{d+1} x^d.
\]
Recall also that $B_Q(q)$ is the number of distinct roots of a polynomial $Q$
in the finite field $\F_q$.

The purpose of this section is to deduce the following estimates for the expected number of roots and double roots of $R$.

\begin{proposition}\label{pr:number-roots-random-poly}
Fix $l\in\Z_{>0}$ and $\e>0$.
Let $q$ be an odd prime and $d\in\Z_{>0}$ that are both sufficiently
large in terms of $l$ and such that $l\ge \e^{-1}\log q/\log d$ and $q>d$.
Then
\begin{align*}
|\E[B_R(q)]-1|&<d^{-1/2+\e},\\
\E[|\{a\in\F_q: \text{$a$ is a double root of $R$}\}|]&<d^{-1/2+\e}.
\end{align*}
\end{proposition}

We comment on the role of the parameter $l$ in the above statement and in the proof.
We will need to apply this proposition such that $q$ is a sufficiently large
power of $d$ so that the error term in the prime ideal theorem
(or in Proposition \ref{pr:number-distinct-factors} to be precise)
is smaller than our claimed estimate in the main theorem.
In fact, $q> d^5$ will be sufficient for this purpose.
We can then set $l$ depending on $\e$ and $\log q/\log d$.
For the proposition to hold, we need that $d$ and $q$ is large enough depending on $l$.
This is because $l$ ultimately controls the length of the arithmetic progressions
we need in the set $I$, so we need $d$ to be large enough to satisfy
the condition of the Green Tao theorem.

The proof follows easily from Propositions \ref{pr:unexceptional}
and \ref{pr:exceptional} and the
Theorem of Green and Tao \cite{GT} that the primes contain arbitrarily long arithmetic
progressions.
We will use the following version that provides control for the step size
of the progressions, which we recall from \cite{TZ}*{Theorem 5} and
\cite{Sha}*{Theorem 1.3}.

\begin{theorem}\label{th:Green-Tao}
For every $L\in\Z_{>0}$, there is a constant $C=C(L)$ such that the following
holds for all $d\in\Z_{>0}$ that is sufficiently large in terms of $L$.
Let $A$ be a subset of the primes in $[1,d]$ with $|A|>d/10\log d$.
Then $A$ contains an arithmetic progression of length $L$ with common difference
less than $C(\log d)^C$.
\end{theorem}

We also need the following simple lemma to count the number of exceptional residues
for which Proposition \ref{pr:exceptional} will be applied.

\begin{lemma}\label{lm:number-exceptional}
For every $l$, there is a constant $C=C(l)$ such that the number of
$(l,q)$-exceptional polynomials is at most
$Cq^{1/(l+1)}$.
\end{lemma}

\begin{proof}
The coefficients of a polynomial $Q\in\Z[x]$
of degree at most $l$
are bounded by $C M(Q)$ for some constant $C$ depending only on $l$.
Therefore, an $(l,q)$-exceptional polynomial has coefficients bounded by
$Cq^{1/(l+1)^2}$ due to the definition of being $(l, q)$-exceptional. The claim follows by raising this bound to the power $l+1$.
\end{proof}

\begin{proof}[Proof of Proposition \ref{pr:number-roots-random-poly}]
Let $K=C_1(\log d)^{C_1}$,
where $C_1$ is the constant $C$
in Theorem \ref{th:Green-Tao}
applied with $L=3l^3$.
We first consider the probability that some $a\in\F_q$
is a root or a double root of $R$
under the condition that $a^k$ is not $l$-exceptional for any $1\le k\le K$.
To this end, we will apply Proposition \ref{pr:unexceptional} with the set of
primes in $[d/2,d]$ in the role of $I$.

We first show that $I$ contains the required number of arithmetic progressions.
We apply Theorem \ref{th:Green-Tao} repeatedly to find arithmetic progressions
of length $3l^3$ with common difference at most $K$.
We start this with all primes in $[d/2,d]$ in the role of $A$ at first, then
we remove from $A$ all arithmetic progressions that we find to apply
Theorem \ref{th:Green-Tao} again for this reduced set.

This process can be run more than $d/(10\log(d) l^3)$ times before the number
of elements in $A$ falls below the threshold in the theorem, so
we find at least this many arithmetic progressions.
Since $l\ge 5\log q/\log d$,
\[
q^{5/(l+1)}\le \frac{d}{10\log(d) l^3},
\]
and we have enough arithmetic progressions to apply Proposition~\ref{pr:unexceptional}.

Next we write
\[
(R(a),R'(a))= Y+Z,
\]
where
\[
Y=\sum_{i\in I}X_{i}(a^{i-1},(i-1)a^{i-2})
\]
and
\[
Z=\sum_{i\in [1,d+1]\backslash I}X_{i}(a^{i-1},(i-1)a^{i-2}).
\]
We observe that $Y$ and $Z$ are independent. So, conditioning on the value of $Z$, we can write
\[
\Big|\P[R(a)=x_1,R'(a)=x_2]-\frac{1}{q^2}\Big|
\le \max_{z\in\F_q^2}\Big|\P[Y=(x_1,x_2)-z]-\frac{1}{q^2}\Big|
< q^{-10}
\]
for all $x_1,x_2\in\F_q$, where we applied Proposition~\ref{pr:unexceptional}.
We conclude
\begin{align}
\Big|\P[R(a)=0]-\frac{1}{q}\Big|&\le q^{-9}\label{eq:unexceptional1}\\
\P[\text{$a$ is a double root of $R$}]\le \frac{2}{q^2}.\label{eq:unexceptional2}
\end{align}

\begin{equation}\label{eq:weights}
\sum_{\text{$q$ prime}} \log (q) h_X(\log q)= 1+ O(X^2\exp(-X/2))
\end{equation}
Summing up \eqref{eq:BPq}, we get
\begin{align*}
\sum_{\text{$q$ prime}} B_R(q)\log(q) h_X(\log q)
&=1+O(X^2\exp(-X/2))+O(d^{-1/2+\e})\\
&=1+O(d^{-1/2+\e}).
\end{align*}

Now we apply Proposition \ref{pr:number-distinct-factors} with $M=1$
and get
\begin{align*}
\E[|\{\text{distinct} &\text{ irreducible factors of $R$}\}|]\\
&=1+O(d^{-1/2+\e})+ O(d^2 X^2\log(d)\exp(-X/2))\\
&=1+O(d^{-1/2+\e}).
\end{align*}
Since $R$ has always at least $1$ irreducible factor, Markov's inequality
implies that the probability that it has more than $1$ is less than
$C d^{-1/2+\e}$.

It remains to prove that $R$ is not a proper power of a single irreducible polynomial
with high probability.
Write $\wt B_R(q)$ for the number of elements of $\F_q$ that are roots of
$R$ with multiplicity at least $2$.
When $R$ is a proper power, $B_R(q)=\wt B_R(q)$.

Using that $R$ always has at least one irreducible factor, it follows
from Proposition \ref{pr:number-distinct-factors} that
\[
\sum_{\text{$q$ prime}} B_R(q)\log(q)h_X(\log q) \ge 1/2
\]
for all $R$.
Therefore,
\[
\sum_{\text{$q$ prime}} \E[\wt B_R(q)]\log(g)h_X(\log q)
\ge\P[\text{$R$ is a proper power}]/2.
\]
Using Proposition \ref{pr:number-roots-random-poly} and \eqref{eq:weights},
we get
\[
2 d^{-1/2+\e}>\P[\text{$R$ is a proper power}]/2,
\]
as required.

\section{Proof of Corollary~\ref{cr:pd}}
\label{sc:proof-cor}

We deduce the corollary from the main theorem and the following result
about the distribution of Legendre symbols due to Granville and Soundararajan.

\begin{theorem}[\cite{GS}*{Proposition 9.1}]\label{th:GS}
Suppose the Riemann hypothesis holds for all Dirichlet $L$-functions.
Let $x,d\in\Z_{>0}$.
Let $\omega_r=\pm1$ for each prime $r\le d$, and let
$\cP(x,\{\omega_r\})$ denote the set of primes $p\le x$ such that
$\big(\frac{r}{p}\big)=\omega_r$ for each $r\le d$.
Then for $d\le x^{1/2}$, we have
\[
\sum_{p\in\cP(x,\{\omega_r\})}\log p = \frac{x}{2^{\pi(d)}}+O(x^{1/2}(d+\log x)^2).
\]
\end{theorem}

\begin{proof}[Proof of Corollary \ref{cr:pd}]
In the statement of the corollary, the prime $p$ is selected from $[d+1,f(d)]$
uniformly.
We modify the distribution of $p$ in such a way that $p$ is selected from
$[1,f(d)]$ with probability
\begin{equation}\label{eq:modified-distribution}
\frac{\log p}{\sum_{p\in[1,f(d)]}\log p}\le C \frac{\log p}{f(d)}.
\end{equation}

The question of how likely it is that a random polynomial in $\mathbb Z[x]$
is irreducible has a long history.
The first studied model was where the degree of the polynomials is a fixed
number and the coefficients are sampled independently and uniformly from
growing intervals.
The is less relevant to our paper, and we only refer to the recent
breakthrough \cite{Bha} and its references.

Another setting that has gained momentum more recently is where the
coefficients are sampled independently from a fixed law and the degree
of the polynomials is growing.
A sequence of papers \cite{BSK}, \cite{BSKK}, \cite{Baz} established that such random polynomials are irreducible
with probability tending to $1$ if the common law of the coefficients
is uniform enough modulo $4$ primes, in particular when the coefficients are
uniformly distributed on $35$ consecutive elements.
See also \cite{BSHKP} for results about $\pm1$ coefficients and special degrees.
Using a different method, and assuming the Riemann hypothesis for Dedekind zeta
functions, \cite{BV19} proved that the probability that a random polynomial is
irreducible tends to $1$ requiring only the necessary condition that the constant
coefficient is not $0$.
This conditionally solved a conjecture of Odlyzko and Poonen \cite{OP93} and the method also yields better estimates for the probability that the
random polynomial is reducible.

In another direction, \cite{Ebe} and \cite{FJSS} proved irreducibility of the characteristic polynomial of random matrices with high probability.

In this paper, we consider other models where the coefficients of the random polynomial are not independent.
We define a sequence $X_n$ of $\pm1$ valued random variables for $n\in\Z_{\ge1}$
as follows. We let $X_1=1$ with probability $1$.
For primes $p$, we let $X_p$ be independent uniform random variables taking
$\pm1$ values. We consider two models. One is that for
 $n\in\Z_{\ge 2}$ we let $X_n=X_{p_1}\cdots X_{p_k}$, where
$n=p_1\cdots p_k$ is the prime factorization of $n$.
The other model is that $X_n$ is supported only on square-free integers $n$
defined in the same way,
and if $n$ is not square-free, we set $X_n=0$.
For $d\in\Z_{\ge 0}$, and $\{X_n\}_{1\le n \le d}$ being either one of the above two models,
we define a random polynomial with multiplicative coefficients as
\[
P_d(X)=X_1x+X_2 x^{2}+\ldots+ X_{d} x^{d}.
\]

The main result of the paper is the following.

\begin{abstract}
 Assume that the Riemann hypothesis holds for Dedekind zeta functions.
Under this assumption,
we prove that a degree $d$ polynomial with random multiplicative $\pm1$ coefficients is
irreducible in $\Z[x]$ with probability $1-O(d^{-1/2+\e})$.
 \end{abstract}
 \maketitle

Another setting that has gained momentum more recently is where the
coefficients are sampled independently from a fixed law and the degree
of the polynomials is growing.
A sequence of papers \cite{BSK}, \cite{BSKK}, \cite{Baz} established that such random polynomials are irreducible
with probability tending to $1$ if the common law of the coefficients
is uniform enough modulo $4$ primes, in particular when the coefficients are
uniformly distributed on $35$ consecutive elements.
See also \cite{BSHKP} for results about $\pm1$ coefficients and special degrees.
Using a different method, and assuming the Riemann hypothesis for Dedekind zeta
functions, \cite{BV19} proved that the probability that a random polynomial is
irreducible tends to $1$ requiring only the necessary condition that the constant
coefficient is not $0$.
This conditionally solved a conjecture of Odlyzko and Poonen \cite{OP93} and the method also yields better estimates for the probability that the
random polynomial is reducible.

The main result of the paper is the following.

Polynomials with multiplicative coefficients are of great interest in number theory.
The study of their values on the unit circle has a vast literature. See \cite{BNR} and \cite{Har} for recent work in the setting of polynomials with
random multiplicative coefficients.

\begin{corollary}\label{cr:pd}
 Let $F_{d, f}(t)$ be defined as in \eqref{eq:Fekete-def}
 and suppose $f(d)>2^{2\pi(d)}d^4$.
 Suppose that the Riemann hypothesis holds for Dedekind zeta functions
 of all number fields.
 Then for all $\e>0$, there is $C=C(\e)$ such that
 \[
 \P[{F_{d,f}(x)/x}~\text{is irreducible over $\Z$}]
 \ge 1 - C d^{-1/2+\e}.
 \]
\end{corollary}

The proof of Theorem \ref{thm: random} follows the strategy of \cite{BV19}, which
we briefly recall.
Fix a polynomial $P$, and chose a random prime $q$ with a suitably chosen
probability distribution.
It is a consequence of the prime ideal theorem that if $P$ is irreducible, then
it has on average $1$ root in $\F_q$.
For different irreducible polynomials these roots rarely coincide, so we can
deduce that
\begin{align}\label{eq:PIT}
\{\text{number of distinct irreducible} &\text{ factors of $P$}\}\nonumber\\
&\approx \E_q[\text{number of roots of $P$ in $\F_q$}],
\end{align}
where $P$ is a fixed polynomial and the averaging is over a random prime $q$.

\begin{proposition}\label{pr:number-distinct-factors}
Let $d,M\in\Z_{\ge 1}$.
Let $P\in\Z[x]$ be a polynomial of degree at most $d$
with coefficients of absolute value at most $M$.
Suppose that for every irreducible factor $Q$ of $P$,
RH holds for $\zeta_{K_Q}$.
Let $X\ge 1$.
Then
\begin{align*}
\sum_{\text{$q$ prime}} B_P(q)\log(q)h_X(\log q)
&=|\{\text{distinct irreducible factors of $P$}\}|\\
&\phantom{=}+ O(d^2 X^2\log (dM)\exp(-X/2)).
\end{align*}
The implied constant is absolute.
\end{proposition}

\begin{proposition}\label{pr:prime-number-theorem}
Let $K$ be a number field with discriminant $\Delta$, and suppose
RH holds for $\zeta_K$.
Let $X>1$.
Then
\[
\sum_{\text{$q$ prime}} A_K(q)\log(q) h_X(\log q)
=1+O(X^2\log|\Delta|\exp(-X/2)),
\]
where the implied constant is absolute.
\end{proposition}

\begin{equation}\label{eq:Fekete-def}
F_{d,f}(x)= \sum_{a=1}^{d} \Big(\frac{a}{p}\Big) x^a
\end{equation}

\begin{theorem} \label{thm: random}
	Suppose that the Riemann hypothesis holds for the Dedekind zeta functions
	of all number fields.
	Then for every $\e>0$, there is a constant $C=C(\e)$ such that
	\[\P[P_d(x)/x~\text{is irreducible over $\Z$}  ] \ge 1- C d^{-1/2+\e}. \]
\end{theorem}

We remark that in the model where $X_n$ is supported on square-free $n$, our bound is close to be sharp, as it is proved in \cite{AACKX25} that $x=1$ is a root with probability at least $Cd^{-1/2-\varepsilon}$.

Polynomials with multiplicative coefficients are of great interest in number theory.
The study of their values on the unit circle has a vast literature. See \cite{BNR} and \cite{Har} for recent work in the setting of polynomials with
random multiplicative coefficients.

The question of irreducibility was recently studied in the setting of
Fekete polynomials in \cite{MNT23} and \cite{MNT24}.
For a prime $p$, the Fekete polynomial $F_p$ is defined
as
\[
F_p(x)=\sum_{a=1}^{p-1}\Big(\frac{a}{p}\Big) x^a,
\]
where $\big(\frac{a}{p}\big)$ denotes the Legendre symbol.
The authors of \cite{MNT23} have made the conjecture that $F_p(x)$
is a product of linear factors corresponding to possible roots at $-1,0,1$
and an irreducible polynomial for all $p$.

Motivated by this, we pose the following problem.
\begin{problem}
Let $f:\Z_{>0}\to \Z_{>0}$ be a function such that for all $d$, there is at least
one prime with $d<p\le f(d)$.
For $d\in\Z_{>0}$, let $p$ be a random prime in $(d,f(d)]$ sampled uniformly
and let
\begin{equation}\label{eq:Fekete-def}
F_{d,f}(x)= \sum_{a=1}^{d} \Big(\frac{a}{p}\Big) x^a
\end{equation}
be a random polynomial.
What is the asymptotic behaviour of the probability that $F_{d,f}$ is irreducible
after removing possible linear factors?
\end{problem}

The conjecture in \cite{MNT23} predicts that the probability in question is
$1$ when $d+1$ is a prime and $f(d)=d+1$.
If we allow $f(d)>2^{2\pi(d)}d^4$, then it is an immediate consequence of our
main result and known results about the distribution of the  Legendre symbol
that under the Riemann hypothesis for Dedekind zeta functions,
$F_{d,f}$ is irreducible with high probability.

\begin{corollary}\label{cr:pd}
	Let $F_{d, f}(t)$ be defined as in \eqref{eq:Fekete-def}
	and suppose $f(d)>2^{2\pi(d)}d^4$.
	Suppose that the Riemann hypothesis holds for Dedekind zeta functions
	of all number fields.
	Then for all $\varepsilon>0$, there is $C=C(\varepsilon)$ such that
	\[
	\mathbb P[{F_{d,f}(x)/x}~\text{is irreducible over $\mathbb Z$}]
	\ge 1 - C d^{-1/2+\varepsilon}.
	\]
\end{corollary}

It would be interesting to see what the behaviour is when the range from which
the prime is sampled is shorter.

\subsection{Outline of the proof}

The proof of Theorem \ref{thm: random} follows the strategy of \cite{BV19}, which
we briefly recall.
Fix a polynomial $P$, and chose a random prime $q$ with a suitably chosen
probability distribution.
It is a consequence of the prime ideal theorem that if $P$ is irreducible, then
it has on average $1$ root in $\F_q$.
For different irreducible polynomials these roots rarely coincide, so we can
deduce that
\begin{align}\label{eq:PIT}
\{\text{number of distinct irreducible} &\text{ factors of $P$}\}\nonumber\\
&\approx \E_q[\text{number of roots of $P$ in $\F_q$}],
\end{align}
where $P$ is a fixed polynomial and the averaging is over a random prime $q$.

If we take a random polynomial $P$, and show that it has on average
$1$ root in $\F_q$, now $P$ and $q$ are both random, then it follows
that $P$ is a power of a single irreducible polynomial with high probability.
To show this, we fix a prime $q$ and a residue $a\in\F_q$, and show that the
value $P(a)$ is equidistributed in $\F_q$ for our random $P$.
In particular, $P(a)=0\in\F_q$ will occur with probability approximately $1/q$.
Summing this up for $a$ and averaging over $q$ will give the required result.

In the setting of \cite{BV19}, the equidistribution of $P(a)$ in $\F_q$
is related to a Markov chain introduced by Chung, Diaconis and Graham \cite{CDG87}.
Due to the dependence of the coefficients, the equidistribution problem
cannot be described by a Markov chain in our setup.

Proving equidistribution is the main new contribution of our paper. We do this by conditioning on the values of the coefficients $X_p$ for primes $p<d/2$, and use that the coefficients corresponding to the
remaining primes are indepenedent from each other and from the coefficients
whose values are influenced by the smaller primes.
We build on \cite{Kon} (also used in \cite{BV19})
to prove equidistribution of
\[
\sum_{p\ge d/2\text{ prime}} X_p a^{p-1}.
\]
The key difference is that we are summing over the primes, and the argument
in \cite{BV19} requires an arithmetic progression.
We bypass this issue by finding many disjoint short arithmetic progressions
in the primes using known results from \cite{GT}, \cite{TZ}, \cite{Sha}
and then apply a version of the argument in \cite{BV19} for these.
This idea has been inspired by \cite{Bou}.

This allows us to prove equidistribution of $P(a)$ for most values of $a$.
For some of the remaining values, equidistribution may fail.
It certainly does for $a=-1,0,1$ and possibly also for some other low degree
roots of unity.
For the exceptional residues, we only prove an upper bound of the form
$\mathbb P[P(a)=0]\le C d^{-1/2+\varepsilon}$ using a classical Littlewood-Offord type bound.
This is where the error term in Theorem \ref{thm: random} comes from.
Here a more precise analysis may yield a better bound giving a more precise
estimate for the probability that $P$ is reducible.
It may be possible to adapt the arguments in \cite{BV19} to give stronger
estimates for most of the exceptional residues, and the error term
may potentially be dominated by the probability that $P$ is divisible by $x-1$
or $x+1$.
We do not pursue this question.

After this, it remains to show that $P$ is not a proper power of an irreducible
polynomial with high probability.
We have not been able to adapt the corresponding argument in \cite{BV19}
to our setting.
Instead, we extend the equidistribution result to the pair
$(P(a),P'(a))$.
This allows us to show that $P$ has very few
double roots in $\F_q$ on average (much less than $1$),
and then the main argument can
be used to rule out repeated factors of $P$ in $\mathbb Z[x]$.

\subsection{Organization of the paper}

In Section \ref{sc:PIT}, we formulate a statement that makes \eqref{eq:PIT}
precise.
This is a straightforward adaptation of \cite{BV19}, but the result formulated
in \cite{BV19} cannot be applied as a black box.
Section \ref{sc:equidistribution} contains our equidistribution estimate for
random walks with steps $\pm a^i$ where $i$ runs through an index set
that contains sufficiently many disjoint arithmetic progressions.
We use these estimates to derive bounds for the expected number of roots
of $P$ in a finite field in Section \ref{sc:number-of-roots}.
We finish the paper by completing the proofs of the main results in Sections
\ref{sc:proof-thm} and \ref{sc:proof-cor}.

\subsection{Notation}
The letters $c$ and $C$ denote positive constants whose values may change
from one occurrence to the other.

\subsection{Acknowledgement}
We would like to thank Jacob Fox,  Julian Sahasrabudhe, Peter Sarnak and Joni Ter\"av\"ainen for helpful discussions on the subject of this paper. Part of the work was done during several visits of MWX at Cambridge University, and the warm hospitality is greatly appreciated.

The proof of Theorem \ref{thm: random} follows the strategy of \cite{BV19}. One “chose a random prime $q$ with a suitably chosen probability distribution” and uses the prime ideal theorem: if a fixed polynomial $P$ is irreducible, then “it has on average $1$ root in $\F_q$,” and since “for different irreducible polynomials these roots rarely coincide,” one deduces the heuristic relation
\[
\{\text{number of distinct irreducible factors of $P$}\}\approx \E_q[\text{number of roots of $P$ in $\F_q$}].
\]
Then, for random $P$, if one can show it “has on average $1$ root in $\F_q$” (with both $P$ and $q$ random), it “follows that $P$ is a power of a single irreducible polynomial with high probability.”

To get this average root count, they “fix a prime $q$ and a residue $a\in\F_q$, and show that the value $P(a)$ is equidistributed in $\F_q$,” so in particular “$P(a)=0\in\F_q$ will occur with probability approximately $1/q$.” “Summing this up for $a$ and averaging over $q$” gives the needed estimate.

The “main new contribution” is proving this equidistribution despite dependent coefficients: they condition “on the values of the coefficients $X_p$ for primes $p<d/2$,” and use that the remaining prime-indexed coefficients are “indepenen[d] from each other” and from those influenced by smaller primes. Building on \cite{Kon}, they prove equidistribution of
\[
\sum_{p\ge d/2\text{ prime}} X_p a^{p-1}.
\]
Because the sum is over primes (not an arithmetic progression), they “bypass this issue by finding many disjoint short arithmetic progressions in the primes” (using \cite{GT}, \cite{TZ}, \cite{Sha}) and then apply a version of the \cite{BV19} argument “for these” (an idea “inspired by \cite{Bou}”).

This yields equidistribution of $P(a)$ “for most values of $a$.” For “exceptional residues” (certainly $a=-1,0,1$ and possibly other low-degree roots of unity) they only prove an upper bound “$\mathbb P[P(a)=0]\le C d^{-1/2+\varepsilon}$” via a “classical Littlewood-Offord type bound,” and they state: “This is where the error term in Theorem \ref{thm: random} comes from.”

Finally, to rule out that $P$ is a proper power, they extend equidistribution to the pair “$(P(a),P'(a))$,” which shows $P$ has “very few double roots in $\F_q$ on average (much less than $1$),” and then the main argument “can be used to rule out repeated factors of $P$ in $\mathbb Z[x]$.”

The proof of the main theorem follows the strategy of \cite{BV19}. One “chose a random prime $q$ with a suitably chosen probability distribution” and uses the prime ideal theorem: if a fixed polynomial $P$ is irreducible, then “it has on average $1$ root in $\F_q$,” and since “for different irreducible polynomials these roots rarely coincide,” one deduces the heuristic relation
\[
\{\text{number of distinct irreducible factors of $P$}\}\approx \E_q[\text{number of roots of $P$ in $\F_q$}].
\]
Then, for random $P$, if one can show it “has on average $1$ root in $\F_q$” (with both $P$ and $q$ random), it “follows that $P$ is a power of a single irreducible polynomial with high probability.”

To get this average root count, they “fix a prime $q$ and a residue $a\in\F_q$, and show that the value $P(a)$ is equidistributed in $\F_q$,” so in particular “$P(a)=0\in\F_q$ will occur with probability approximately $1/q$.” “Summing this up for $a$ and averaging over $q$” gives the needed estimate.

The “main new contribution” is proving this equidistribution despite dependent coefficients: they condition “on the values of the coefficients $X_p$ for primes $p<d/2$,” and use that the remaining prime-indexed coefficients are “indepenen[d] from each other” and from those influenced by smaller primes. Building on \cite{Kon}, they prove equidistribution of
\[
\sum_{p\ge d/2\text{ prime}} X_p a^{p-1}.
\]
Because the sum is over primes (not an arithmetic progression), they “bypass this issue by finding many disjoint short arithmetic progressions in the primes” (using \cite{GT}, \cite{TZ}, \cite{Sha}) and then apply a version of the \cite{BV19} argument “for these” (an idea “inspired by \cite{Bou}”).

This yields equidistribution of $P(a)$ “for most values of $a$.” For “exceptional residues” (certainly $a=-1,0,1$ and possibly other low-degree roots of unity) they only prove an upper bound “$\mathbb P[P(a)=0]\le C d^{-1/2+\varepsilon}$” via a “classical Littlewood-Offord type bound,” and they state: “This is where the error term in the main theorem comes from.”

Finally, to rule out that $P$ is a proper power, they extend equidistribution to the pair “$(P(a),P'(a))$,” which shows $P$ has “very few double roots in $\F_q$ on average (much less than $1$),” and then the main argument “can be used to rule out repeated factors of $P$ in $\mathbb Z[x]$.”

\label{thm: random}
	Suppose that the Riemann hypothesis holds for the Dedekind zeta functions
	of all number fields.
	Then for every $\varepsilon>0$, there is a constant $C=C(\varepsilon)$ such that
	\[\mathbb P[P_d(x)/x~\text{is irreducible over $\mathbb Z$}  ] \ge 1- C d^{-1/2+\varepsilon}. \],

Question:
Let \(\{X_n\}_{n\ge 1}\) be a random sequence defined in either of the following two ways: (i) \(X_1=1\), the variables \(X_p\) for primes \(p\) are independent and uniformly distributed on \(\{\pm1\}\), and for each \(n\ge 2\) with prime factorization \(n=p_1\cdots p_k\), set \(X_n=X_{p_1}\cdots X_{p_k}\); or (ii) the same definition on square-free integers, but \(X_n=0\) whenever \(n\) is not square-free. For \(d\ge 1\), define
\[
P_d(x)=X_1x+X_2x^2+\cdots+X_dx^d.
\]
Assume that the Riemann hypothesis holds for the Dedekind zeta functions of all number fields. Which statement holds?

For every \(\varepsilon>0\), there exists a constant \(C=C(\varepsilon)\) such that for every integer \(d\ge 1\),
\[
\mathbb P\big[P_d(x)/x\text{ is irreducible over }\mathbb Z\big]\ge 1-Cd^{-1/2+\varepsilon}.
\]

Choices:
B.
For every \(\varepsilon>0\), there exists a constant \(C=C(\varepsilon)\) such that for every integer \(d\ge 1\),
\[
\mathbb P\big[P_d(x)/x\text{ is irreducible over }\mathbb Z\big]\ge 1-Cd^{-1+\varepsilon}.
\]
C. The probability that \(P_d(x)/x\) is irreducible over \(\mathbb Z\) tends to \(1\) as \(d\to\infty\).
D.
There exists an absolute constant \(C>0\) such that for every \(\varepsilon>0\) and every integer \(d\ge 1\),
\[
\mathbb P\big[P_d(x)/x\text{ is irreducible over }\mathbb Z\big]\ge 1-Cd^{-1/2+\varepsilon}.
\]
E.
For every \(\varepsilon>0\), there exists a constant \(C=C(\varepsilon)\) such that for every integer \(d\ge 1\),
\[
\mathbb P\big[P_d(x)/x\text{ is irreducible over }\mathbb Z\big]= 1-Cd^{-1/2+\varepsilon}.
\]

error-term exponent from exceptional residues and Littlewood-Offord bound

dropped the quantitative rate and constant dependence on \(\varepsilon\)

dependence of the constant on \(\varepsilon\)

probabilistic lower bound replaced by exact asymptotic identity