Let c = c(\boldsymbol \Psi) be a sufficiently small, positive constant, and put \eta = c {\varepsilon} {\delta}.
By replacing \mathcal F(x) by \max \{ \mathcal F(y): 1 \leqslant y \leqslant x \}, we may assume that \mathcal F is non-decreasing and defined on [1, \infty). Define, for x \in \mathbb N,
\begin{aligned}
\mathcal F_0(x) &=
\mathcal F(\eta ^{-4}x^{2}), \\
\mathcal F_j(x) &= \mathcal F \Bigl(
\eta ^{-4}x^{2} \Bigl(\sum_{i=0}^{j-1}\mathcal F_{0}(x)\cdots \mathcal F_i(x)\Bigr)^{2}\Bigr) \qquad (1 \leqslant j \leqslant Jx),
\\
\mathcal F_*(x) &= \mathcal F_{Jx}(x).
\end{aligned}
We apply Lemma 2.5 to the function g \coloneq 1_{\mathcal A}, with \Phi = \mathbb T\textnormal{-span}(\boldsymbol \Psi), growth function \mathcal F_* and approximation parameter \eta > 0. This yields positive integers d, \tilde d \ll_{\mathcal F,{\varepsilon},{\delta},\boldsymbol \Psi} 1, as well as {\boldsymbol{{\alpha}}}^{(j)} \in \mathbb T^d and \tilde {\boldsymbol{{\alpha}}}^{(j)} \in \mathbb T^{\tilde d} such that
\phi \coloneq {\boldsymbol{{\alpha}}}^{(1)} \Psi_1 + \cdots + {\boldsymbol{{\alpha}}}^{(J)} \Psi_J,
\qquad
\tilde \phi \coloneq
\tilde {\boldsymbol{{\alpha}}}^{(1)}\Psi_1 + \cdots + \tilde {\boldsymbol{{\alpha}}}^{(J)} \Psi_J
satisfy
\| g - g_{\phi, \tilde \phi} \|_{\Phi} \leqslant N/\mathcal F_*(d), \qquad
\| g_{\phi, \tilde \phi} - g_{\phi} \|_2 \leqslant \eta \sqrt N.
Define f, f_{{\mathrm{unf}}}, g_{{\mathrm{str}}}, g_{{\mathrm{sml}}}: [N] \to [-1,1] by
\begin{gathered}
f = g_{\phi,\tilde \phi}, \qquad
f_{\mathrm{unf}} = g - f, \\
g_{\mathrm{str}} = g_{\phi}, \qquad
g_{\mathrm{sml}} = f - g_{\mathrm{str}}.
\end{gathered}
Then we have
\begin{gathered}
f \geqslant 0, \qquad
\| f_{\mathrm{unf}} \|_{\Phi} \leqslant N/\mathcal F_*(d), \\
\sum_{n \in [N]} g_{\mathrm{str}}(n) \geqslant {\delta} N, \qquad
\sum_{n \in [N]} |g_{\mathrm{sml}}(n)|^2 \leqslant \eta^2 N.
\end{gathered}
Moreover, Lemma 2.7 provides a 4-Lipschitz function G: \mathbb T^d \to [0,1] such that
g_{{\mathrm{str}}}(n) = G(\phi(n)) \qquad (1 \leqslant n \leqslant N).
Next, we apply Lemma 2.9 with
M_n = \mathcal F_n(d)
\quad (0 \leqslant n \leqslant D), \qquad
D = Jd.
Thus there is 0\leqslant n \leqslant D and decompositions
{\boldsymbol{{\alpha}}}^{(j)} = \mathbf a^{(j)}/q + {\boldsymbol{\beta}}^{(j)}/N^{k_j} + L_j {\boldsymbol{\theta}}^{(j)}
\qquad (1 \leqslant j \leqslant J),
such that on setting
Q =
\begin{cases}
1,& \text{if } n = 0, \\
\sum_{i=0}^{n-1} \mathcal F_0(d)\cdots \mathcal F_i(d),&\text{if } n \ne 0,
\end{cases}
we have:
q \in \mathbb N with q \leqslant Q
\mathbf a^{(j)} \in \mathbb Z^d
{\boldsymbol{\beta}}^{(j)} \in \mathbb R^d with \| {\boldsymbol{\beta}}^{(j)} \|_1 \leqslant Q
{\boldsymbol{\theta}}^{(j)} is (\mathcal F_n(d), N^{k_j})-irrational with {\boldsymbol{\theta}}^{(j)} \in \mathbb T^{c_j} for some c_j \leqslant d
L_j is a d \times c_j integer matrix whose rows and columns are bounded in L^1 by Q.
We partition [N] into O(qQ/\eta) many arithmetic progressions of common difference q and diameter at most \eta N / Q. By Lemma 2.10, there exists an arithmetic progression \mathcal P \subseteq [N] of common difference q such that
\begin{aligned}
|\mathcal P| &\gg {\delta} \eta N / (qQ), \\
\sum_{n \in \mathcal P} g_{\mathrm{str}}(n) &\gg {\delta} |\mathcal P|, \\
\sum_{n \in \mathcal P} |g_{\mathrm{sml}}(n)|^2 &\ll {\delta}^{-1} \eta^2 |\mathcal P|.
\end{aligned}
Fix b \in \mathcal P arbitrarily, and define \tilde G: \mathbb T^{c_1} \times \cdots \times \mathbb T^{c_J}
\to [0,1] by
\tilde G ({\boldsymbol{{\gamma}}}^{(1)}, \cdots, {\boldsymbol{{\gamma}}}^{(J)}) =
G \Bigl(
\sum_{j \in [J]}
(\mathbf a^{(j)} \Psi_j(b)/q + {\boldsymbol{\beta}}^{(j)} \Psi_j(b)/N^{k_j} + L_j {\boldsymbol{{\gamma}}}^{(j)})
\Bigr).
Recall that G is 4-Lipschitz so, for n \in \mathcal P,
\begin{aligned}
g_{\mathrm{str}}(n) &=
G \Bigl(
\sum_{j \in [J]}
(\mathbf a^{(j)} \Psi_j(n)/q + {\boldsymbol{\beta}}^{(j)} \Psi_j(n)/N^{k_j} + \Psi_j(n) L_j {\boldsymbol{\theta}}^{(j)})
\Bigr)
\\
&= G \Bigl(
\sum_{j \in [J]}
(\mathbf a^{(j)} \Psi_j(b)/q + {\boldsymbol{\beta}}^{(j)} \Psi_j(n)/N^{k_j} + \Psi_j(n) L_j {\boldsymbol{\theta}}^{(j)})
\Bigr)
\\
&= \tilde G ({\boldsymbol{\theta}}^{(1)} \Psi_1(n), \ldots, {\boldsymbol{\theta}}^{(J)} \Psi_J(n))
+ O_{\boldsymbol \Psi}(\eta).
\end{aligned}
Moreover \tilde G is 4Q-Lipschitz so, by Lemma 2.8, there exists a trigonometric polynomial
F: \mathbb T^{c_1} \times \cdots \times \mathbb T^{c_J} \to [0,1]
of degree O(Q^2 (Jd)^2 \eta^{-3}) such that \| \tilde G - F \|_\infty \leqslant \eta. We define, for n \in \mathcal P,
\begin{aligned}
f_{\mathrm{str}}(n) &=
F({\boldsymbol{\theta}}^{(1)} \Psi_1(n), \ldots, {\boldsymbol{\theta}}^{(J)} \Psi_J(n)),
\\
f_{\mathrm{sml}}(n) &=
(g_{\mathrm{sml}} + g_{\mathrm{str}} - f_{\mathrm{str}})(n).
\end{aligned}
Next, we verify the first list of assertions.
These hold with the choice M = \lfloor Q^{2} d^2\eta^{-4} \rfloor.
This holds because \mathcal F_n(d) \geqslant \mathcal F(M).
This holds because |\mathcal P| \gg {\delta} \eta N / (qQ) and c is sufficiently small.
The two equations hold by construction.
Finally, we verify the second list of assertions.
We have already observed this.
This holds because \mathcal F_*(d)\geqslant \mathcal F_n(d) \geqslant \mathcal F(M).
As \| f_{\mathrm{sml}} - g_{\mathrm{sml}} \|_{L^\infty(\mathcal P)} \ll_{\boldsymbol \Psi} \eta and \| g_{\mathrm{sml}} 1_{\mathcal P} \|_2 \ll {\delta}^{-1/2} \eta \| 1_\mathcal P \|_2, the triangle inequality implies \| f_{\mathrm{sml}} \|_2 \ll {\delta}^{-1/2} \eta \| 1_{\mathcal P} \|_2. Since c is small and {\delta} \leqslant 1, it follows that \|f_{\mathrm{sml}}\|_2 \leqslant {\varepsilon} \| 1_{\mathcal P} \|_2.
As \|f_{\mathrm{str}} - g_{\mathrm{str}}\|_{L^\infty(\mathcal P)} \ll_{\boldsymbol \Psi} \eta and \| g_{\mathrm{str}} 1_{\mathcal P} \|_1 \gg {\delta} |\mathcal P|, the triangle inequality gives \| f_{\mathrm{str}} \|_1 \gg {\delta} |\mathcal P|.
The degree is bounded by M because c is sufficiently small.