Triangle inequality for pretentious distance (source code)

= Triangle inequality for pretentious distance

For <multiplicative functions> $f_1,f_2,g_1,g_2$ bounded in <modulus> by one, the <pretentious distance> satisfies
$$
\mathbb D(f_1f_2,g_1g_2;x)\leq\mathbb D(f_1,g_1;x)+\mathbb D(f_2,g_2;x).
$$
Here products mean <pointwise products of arithmetic functions>. For <complex numbers> $z,w$ of <modulus> at most one, write $a=\Re z$ and $b=\Re w$. The bounds $|\Im z|\leq\sqrt{2(1-a)}$ and $|\Im w|\leq\sqrt{2(1-b)}$ give
$$
1-\Re(zw)=(1-a)+(1-b)-(1-a)(1-b)+\Im z\Im w\leq\bigl(\sqrt{1-a}+\sqrt{1-b}\bigr)^2.
$$
Apply this with $z=f_1(p)\overline{g_1(p)}$ and $w=f_2(p)\overline{g_2(p)}$ at each <prime> $p\leq x$, divide by $p$, and use the <triangle inequality> for the resulting finite Euclidean <norm>. This proves the displayed product inequality.<Large Character Sums: Pretentious Characters and the Pólya-Vinogradov Theorem by Andrew Granville and K. Soundararajan>[§3, Lemma 3.1, p. 364: product triangle inequality]{ref}