Triangle counting with one box-uniform pair and constant opposite degree (source code)

= Triangle counting with one box-uniform pair and constant opposite degree

Let a <tripartite graph> have nonempty parts $X,Y,Z$, pair <edge density of a bipartite graph> values $\alpha,\beta,\gamma$ on $XY,YZ,XZ$, and $\|G(X,Y)-\alpha\|_{\square}\leq c$. If every $z\in Z$ has exactly $\beta|Y|$ neighbors in $Y$, its normalized <triangle count> $\tau$ obeys
$$
|\tau-\alpha\beta\gamma|\leq c\sqrt{\beta\gamma}.
$$
The constant-degree assumption makes the contribution of the constant $\alpha$ exactly $\alpha\beta\gamma$. For each fixed $z$, apply the <bilinear correlation bound for the box norm> to the <indicator functions> of its two <vertex neighbourhoods>. Their squared $L^2$ <norms> are $\beta$ and the relative $X$-degree of $z$. Average over $z$ and use the <Cauchy-Schwarz inequality> to bound the mean square root of that degree by $\sqrt\gamma$.