\sum_{y \in [M]}\sum_x f(x)\phi_1(x-qy^2) \phi_2(x-qy^2 + y)\right|}\\
&  {\leqslant}M {\left| \sum_x f(x)\tilde{\phi}_1(x) \tilde{\phi}_2(x)\right|},\end{aligned}$$ where both $\tilde{\phi}_i$ are 1-bounded local functions of resolution $\gg (\delta/q)^{O(1)}N^{1/2}$ and moduli $qq_i$ for some $q_i\ll \delta^{-O(1)}$.

A weak regularity lemma
=======================

Much of the material is this section is standard, and closely follows the expositions in Green [@GreenMontreal] and Green–Tao [@GreenTaoNewII]. To simplify the exposition of later arguments, while the factors in [@GreenMontreal] and [@GreenTaoNewII] are $\sigma$-algebras, our factors will be the set of atoms of certain $\sigma$-algebras (which can obviously be recovered by taking the $\sigma$-algebra generated by the set of atoms).

We define a *factor* $\mathcal{B}$ of $[N]$ to be a partition of $[N]$, so that $[N] = \sqcup_{B \in \mathcal{B}} B$. We say that a factor $\mathcal{B}'$ *refines* $\mathcal{B}$ if every element of $\mathcal{B}$ is a union of elements of $\mathcal{B}'$. The *join* $\mathcal{B}_1\vee\dots\vee\mathcal{B}_d$ of factors $\mathcal{B}_1, \dots, \mathcal{B}_d$ is the factor formed by taking the $d$-fold intersections of the elements of $\mathcal{B}_1$, …, $\mathcal{B}_d$, that is, $$\mathcal{B}_1\vee\dots\vee\mathcal{B}_d:=\{B_1\cap\dots\cap B_d:B_i\in\mathcal{B}_i\text{ for }i=1,\dots,d\}.$$

Given a factor $\mathcal{B}$, we say that a function $f : [N] \to {\mathbb{C}}$ is *$\mathcal{B}$-measurable* if it is constant on the elements of $\mathcal{B}$.

Define the *projection* of any function 