## Appendix A. Technical Lemmas

In this section we gather all technical lemmas needed to prove our main theorems.

**Lemma** **A1.** For any $d\ge 0$, let $\mathit{Q}={\left({q}_{i,j}\right)}_{i,j\in \left[d\right]\cup \left\{0\right\}}$ be the $(d+1)\times (d+1)$ matrix such that: (i) ${q}_{i,j}=\sqrt{d}$ if $i=j$; (ii) ${q}_{i,j}=1$ if either $i=0$, or $j=0$, with $(i,j)\ne (0,0)$; (iii) ${q}_{i,j}=0$ otherwise. We have that $\mathit{Q}$ is a positive-semidefinite matrix.

**Proof.** To show the claim, we resort to the Sylvester’s criterion, stating that a symmetric matrix ${M}$ is positive-semidefinite if and only if the determinant of each principal minor of ${M}$ (i.e., each upper upper left h-by-h corner of ${M}$) is non-negative. Let ${\mathit{A}}_{h,x}={\left({a}_{h,x,i,j}\right)}_{i,j\in \left[h\right]}$ be a $h\times h$ matrix such that: (i) ${a}_{h,x,i,j}=x$ if $i=j$; (ii) ${a}_{h,x,i,j}=1$ if $(i,j)\ne (1,1)$, and, either $i=1$, or $j=1$; (iii) ${a}_{h,x,i,j}=0$ otherwise. We have that each principal minor of matrix $\mathit{Q}$ is of type ${\mathit{A}}_{h,\sqrt{d}}$ for some $h\in [d+1]$. Thus, it is sufficient showing that the determinant of matrix ${\mathit{A}}_{h,\sqrt{d}}$, denoted as $Det\left({\mathit{A}}_{h,\sqrt{d}}\right)$, is non-negative for any $h\in [d+1]$.

We first show by induction on integers $h\ge 1$ that $Det\left({\mathit{A}}_{h,x}\right)={x}^{h}-(h-1)\xb7{x}^{h-2}$ for any fixed $x\in \mathbb{R}$. If $h=0$ we trivially get $Det\left({\mathit{A}}_{h,x}\right)=x={x}^{h}-(h-1)\xb7{x}^{h-2}$. Now, we assume that $Det\left({\mathit{A}}_{h,x}\right)={x}^{h}-(h-1){x}^{h-2}$ holds for some $h\ge 1$, and we show that $Det\left({\mathit{A}}_{h+1,x}\right)={x}^{h+1}-h\xb7{x}^{h-1}$. We get $Det\left({\mathit{A}}_{h+1,x}\right)=x\xb7Det\left({\mathit{A}}_{h,x}\right)-{x}^{h-1}=x({x}^{h}-(h-1){x}^{h-2})-{x}^{h-1}={x}^{h+1}-h\xb7{x}^{h-1}$, where the first equality comes from the Laplace expansion for computing the determinant, and the second equality comes from the inductive hypothesis.

By using the fact that $Det\left({\mathit{A}}_{h,x}\right)={x}^{h}-(h-1)\xb7{x}^{h-2}$ holds for any $x\in \mathbb{R}$ and any integer $h\ge 1$, we have that $Det\left({\mathit{A}}_{h,\sqrt{d}}\right)={\left(\sqrt{d}\right)}^{h}-(h-1){\left(\sqrt{d}\right)}^{h-2}\ge 0$ for any $h\in [d+1]$, where the last inequality holds since quantity ${x}^{h}-(h-1){x}^{h-1}$ is always non-negative for any $x\ge \sqrt{h-1}$ if $h\le d+1$. Thus each principal minor of $\mathit{Q}$ has a non-negative determinant, and the claim follows. □

**Lemma** **A2.** Let $\theta :{\mathbb{Z}}_{\ge 0}^{6}\to \mathbb{Q}$ be the function such that $\theta (a,b,c,d,e,f)=18{a}^{2}-a(b+c+51d-e-f)+50bf+50ce-34bc+119{d}^{2}-51d+e+f-238ef$. For any $(a,b,c,d,e,f)\in {\mathbb{Z}}_{\ge 0}^{6}$ such that $a\ge b+c$ and $d\ge e+f$, it holds that $\theta (a,b,c,d,e,f)\ge 0$.

**Proof.** At a first glance, in order to use standard arguments from calculus, we allow the 6-tuples $(a,b,c,d,e,f)$ to take values in the set of non-negative real numbers.

We first show that, in such an extended scenario, $\theta $ attains its minimum for 6-tuples $(a,b,c,d,e,f)$ such that $b=c$ and $e=f$. Consider to this aim the 6-tuple $(a,b,b+h,d,e,e+k)$, where $h,k\in \mathbb{R}$. By definition of $\theta $, we get $\theta (a,b+\frac{h}{2},b+\frac{h}{2},d,e+\frac{k}{2},e+\frac{k}{2})=\theta (a,b,b+h,d,e,e+k)-\frac{17{h}^{2}-50hk+119{k}^{2}}{2}\le \theta (a,b,b+h,d,e,e+k)-\frac{{(4h-10k)}^{2}}{2}\le \theta (a,b,b+h,d,e,e+k).$

Hence, we do not lose in generality by restricting to 6-tuples of non-negative real values $(a,b,b,d,e,e)$ such that $a\ge 2b$ and $d\ge 2e$. In this case $\theta $ becomes $18{a}^{2}-a(2b+51d-2e)-34{b}^{2}+100be+119{d}^{2}-51d-238{e}^{2}+2e$. Consider the two partial derivatives $\frac{\delta \theta}{\delta b}=100e-2a-68b$ and $\frac{\delta \theta}{\delta e}=2(a+50b+1-238e)$. Since they are linear and decreasing in b and e, respectively, it follows that $\theta $ is minimized at one of the following four cases: $b=0\wedge e=0$, $b=0\wedge e=\frac{d}{2}$, $b=\frac{a}{2}\wedge e=0$ and $b=\frac{a}{2}\wedge e=\frac{d}{2}$.

In the first case, $\theta $ becomes $18{a}^{2}-51ad+119{d}^{2}-51d$. Since $\frac{\delta \theta}{\delta a}=36a-51d$, $\theta $ is minimized at $a=\frac{17d}{12}$. By substituting, $\theta $ becomes $\frac{1}{8}(663{d}^{2}-408d)$ which is always non-negative for any $d\in \mathbb{Z}$.

In the second case, $\theta $ becomes $36{a}^{2}-100ad+119{d}^{2}-100d$. Since $\frac{\delta \theta}{\delta a}=36a-50d$, $\theta $ is minimized at $a=\frac{25d}{18}$. By substituting, $\theta $ becomes $\frac{1}{9}(223{d}^{2}-450d)$ which is always non-negative for any $d\in \mathbb{Z}\backslash \{1,2\}$.

In the third case, $\theta $ becomes $\frac{17}{2}({a}^{2}-6ad+14{d}^{2}-6d)$. Since $\frac{\delta \theta}{\delta a}=17(a-3d)$, $\theta $ is minimized at $a=3d$. By substituting, $\theta $ becomes $\frac{17}{2}(5{d}^{2}-6d)$ which is always non-negative for any $d\in \mathbb{Z}\backslash \left\{1\right\}$.

In the fourth case, $\theta $ becomes $\frac{1}{2}(17{a}^{2}-50ad+119{d}^{2}-100d)$. Since $\frac{\delta \theta}{\delta a}=17a-25d$, $\theta $ is minimized at $a=\frac{25d}{17}$. By substituting, $\theta $ becomes $\frac{1}{17}(699{d}^{2}-850d)$ which is always non-negative for any $d\in \mathbb{Z}\backslash \left\{1\right\}$.

Hence, in order to complete the proof, we are left to settle the following cases: $(a,0,0,1,0,0)$, $(a,0,0,2,1,1)$, $(a,0,0,1,1,0)$, $(a,0,0,1,0,1)$, $(a,\frac{a}{2},\frac{a}{2},1,1,0)$, $(a,\frac{a}{2},\frac{a}{2},1,0,1)$ and $(a,\frac{a}{2},\frac{a}{2},1,0,0)$.

In the case $(a,0,0,1,0,0)$, $\theta $ becomes $18{a}^{2}-51a+68$ which is always non-negative for any $a\in \mathbb{R}$. In the case $(a,0,0,2,1,1)$, $\theta $ becomes $18{a}^{2}-100a+138$ which is always non-negative for any $a\in \mathbb{Z}$. In the cases $(a,0,0,1,1,0)$ and $(a,0,0,1,0,1)$, $\theta $ becomes $18{a}^{2}-50a+69$ which is always non-negative for any $a\in \mathbb{R}$. In the cases $(a,\frac{a}{2},\frac{a}{2},1,1,0)$ and $(a,\frac{a}{2},\frac{a}{2},1,0,1)$, $\theta $ becomes $\frac{17{a}^{2}-50a+138}{2}$ which is always non-negative for any $a\in \mathbb{R}$. Finally, in the case $(a,\frac{a}{2},\frac{a}{2},1,0,0)$, $\theta $ becomes $\frac{17}{2}({a}^{2}-6a+8)$ which is always non-negative for any $a\in \mathbb{Z}\backslash \left\{3\right\}$. Hence, we are only left to consider the case $(3,b,c,1,0,0)$ for which $\theta $ becomes $77-34bc-3(b+c)$. Since $b+c\le 3$, it holds that $77-34bc-3(b+c)\ge 68-34bc$ which is always non-negative since $bc\le 2$ for any $b,c\in {\mathbb{Z}}_{\ge 0}$ such that $b+c\le 3$. □

**Lemma** **A3.** Let $\lambda :{\mathbb{Z}}_{\ge 0}^{2}\to \mathbb{Q}$ be the function such that $\lambda (a,d)={a}^{2}-3ad+5{d}^{2}-3d$. For any $(a,d)\in {\mathbb{Z}}_{\ge 0}^{2}$ such that $d\ne 1$, it holds that $\lambda (a,d)\ge 0$.

**Proof.** Since $\frac{\delta \lambda}{\delta a}=2a-3d$, $\lambda $ is minimized at $a=\frac{3}{2}d$. By substituting, we get $11{d}^{2}-12d$ which is non-negative for any $d\in \mathbb{Z}\backslash \left\{1\right\}$. □

**Lemma** **A4.** Let $\lambda :{\mathbb{Z}}_{\ge 0}^{2}\to \mathbb{Q}$ be the function such that $\lambda (a,d)={a}^{2}-6ad+14{d}^{2}-6d$. For any $(a,d)\in {\mathbb{Z}}_{\ge 0}^{2}$ such that $d\ne 1$, it holds that $\lambda (a,d)\ge 0$.

**Proof.** Since $\frac{\delta \lambda}{\delta a}=2a-6d$, $\lambda $ is minimized at $a=3d$. By substituting, we get $5{d}^{2}-6d$ which is non-negative for any $d\in \mathbb{Z}\backslash \left\{1\right\}$. □

**Lemma** **A5.** Let $\lambda :{\mathbb{Z}}_{\ge 0}^{2}\to \mathbb{Q}$ be the function such that $\lambda (a,d)=20{a}^{2}-84ad+259{d}^{2}-168d$. For any $(a,d)\in {\mathbb{Z}}_{\ge 0}^{2}$, it holds that $\lambda (a,d)\ge 0$.

**Proof.** Since $\frac{\delta \lambda}{\delta a}=40a-84d$, $\lambda $ is minimized at $a=\frac{21}{10}d$. By substituting, we get $61{d}^{2}-60d$ which is non-negative for any $d\in \mathbb{Z}$. □

**Lemma** **A6.** Let $\lambda :{\mathbb{Z}}_{\ge 0}^{2}\to \mathbb{Q}$ be the function such that $\lambda (a,d)=13{a}^{2}-21ad+35{d}^{2}-21d$. For any $(a,d)\in {\mathbb{Z}}_{\ge 0}^{2}$, it holds that $\lambda (a,d)\ge 0$.

**Proof.** Since $\frac{\delta \lambda}{\delta a}=26a-21d$, $\lambda $ is minimized at $a=\frac{21}{26}d$. By substituting, we get $197{d}^{2}-156d$ which is non-negative for any $d\in \mathbb{Z}$. □

**Lemma** **A7.** Let $\theta :{\mathbb{Z}}_{\ge 0}^{6}\to \mathbb{Q}$ be the function such that $\theta (a,b,c,d,e,f)=7{a}^{2}+3a(2b+2c-5d-2e-2f)+21bf+21ce-42bc+35{d}^{2}-15d-6e-6f$. For any $(a,b,c,d,e,f)\in {\mathbb{Z}}_{\ge 0}^{6}$ such that $a\ge b+c$ and $d\ge e+f$, it holds that $\theta (a,b,c,d,e,f)\ge 0$.

**Proof.** At a first glance, in order to use standard arguments from calculus, we allow the 6-tuples $(a,b,c,d,e,f)$ to take values in the set of non-negative real numbers. Since $\frac{\delta \theta}{\delta c}=3(2a-14b+7e)$ and $\frac{\delta \theta}{\delta f}=3(7b-2a-2)$, $\theta $ is minimized at one of the following four cases: $c=0\wedge f=0$, $c=0\wedge f=d-e$, $c=a-b\wedge f=0$ and $c=a-b\wedge f=d-e$.

In the first case, we get $\theta =7{a}^{2}+3a(2b-5d-2e)+35{d}^{2}-15d-6e$. Since $\frac{\delta \theta}{\delta b}=6a$, $\theta $ is minimized at $b=0$ which yields $\theta =7{a}^{2}-3a(5d+2e)+35{d}^{2}-15d-6e$. Since $\frac{\delta \theta}{\delta e}=-6(a+1)$, $\theta $ is minimized at $e=d$ which yields $\theta =7({a}^{2}-3ad+5{d}^{2}-3d)$. The claim then follows for any $d\ne 1$ by applying Lemma A3. For the leftover tuples of the form $(a,0,0,1,1,0)$, we get $\theta =7({a}^{2}-3a+2)$ which is always non-negative for any $a\in \mathbb{Z}$.

In the second case, we get $\theta =7{a}^{2}+3a(2b-7d)+7(3b(d-e)+5{d}^{2}-3d)$. Since $\frac{\delta \theta}{\delta b}=3(2a+7(d-e))$, $\theta $ is minimized at $b=0$, which yields $\theta =7({a}^{2}-3ad+5{d}^{2}-3d)$. The claim then follows for any $d\ne 1$ by applying Lemma A3. For the leftover tuples of the form $(a,0,0,1,e,1-e)$, we get $\theta =7({a}^{2}-3a+2)$ which is always non-negative for any $a\in \mathbb{Z}$.

In the third case, we get $\theta =13{a}^{2}-3a(14b+5(d-e))+42{b}^{2}-21be+35{d}^{2}-15d-6e$. Since $\frac{\delta \theta}{\delta e}=3(5a-7b-2)$, $\theta $ is minimized at either $e=0$ or $e=d$. For $e=d$, we get $\theta =13{a}^{2}-42ab+42{b}^{2}-21bd+35{d}^{2}-21d$. Since $\frac{\delta \theta}{\delta b}=-21(2a-4b+d)$, $\theta $ is minimized at $b=\frac{2a+d}{4}$. This yields $\theta =20{a}^{2}-84ad+259{d}^{2}-168d$ and the claim then follows by applying Lemma A5. For $e=0$, we get $\theta =13{a}^{2}-3a(14b+5d)+42{b}^{2}+35{d}^{2}-15d$. Since $\frac{\delta \theta}{\delta b}=42(2b-a)$, $\theta $ is minimized at $b=\frac{a}{2}$ which yields $\theta =5({a}^{2}-6ad+14{d}^{2}-6d)$ and the claim then follows for any $d\ne 1$ by applying Lemma A4. For the leftover tuples of the form $(a,\frac{a}{2},\frac{a}{2},1,0,0)$, we get $\theta =\frac{5}{2}({a}^{2}-6a+8)$ which is always non-negative for any $a\in \mathbb{Z}\backslash \left\{3\right\}$. Hence, we are still left to prove what happens for the tuples of the form $(3,b,3-b,1,0,0)$. In this case, we get $\theta =42{b}^{2}-126b+92$ which is always non-negative for any $b\in \mathbb{Z}$.

In the fourth case, we get $\theta =13{a}^{2}-21a(2b+d-e)+7(6{b}^{2}+3b(d-2e)+5{d}^{2}-3d)$. Since $\frac{\delta \theta}{\delta e}=21(a-2b)$, $\theta $ is minimized at either $e=0$ or $e=d$. For $e=0$, we get $\theta =13{a}^{2}-21a(2b+d)+7(6{b}^{2}+3bd+5{d}^{2}-3d)$. Since $\frac{\delta \theta}{\delta b}=-21(2a-4b-d)$, $\theta $ is minimized at either $b=0$ or $b=\frac{2a-d}{4}$. The first case yields $\theta =13{a}^{2}-21ad+35{d}^{2}-21d$ and the claim then follows by applying Lemma A6, while the second one yields $\theta =\frac{20{a}^{2}-84ad+259{d}^{2}-168d}{8}$ and the claim then follows by applying Lemma A5. For $e=d$, we get $\theta =13{a}^{2}-41ab+7(6{b}^{2}-3bd+5{d}^{2}-3d)$. Since $\frac{\delta \theta}{\delta b}=-21(2a-4b+d)$, $\theta $ is minimized at $b=\frac{2a+d}{4}$ which yields $\theta =\frac{20{a}^{2}-84ad+259{d}^{2}-168d}{8}$ and the claim then follows by applying Lemma A5. □

**Lemma** **A8.** Let $\lambda :{\mathbb{Z}}_{\ge 0}^{2}\to \mathbb{Q}$ be the function such that $\lambda (a,d)=\frac{3-\sqrt{7}}{2}{a}^{2}+(1+\sqrt{7}-2d)a+(3+\sqrt{7})(\frac{{d}^{2}}{2}-d)$. For any $(a,d)\in {\mathbb{Z}}_{\ge 0}^{2}\backslash \{(0,1),(1,1),(1,2)\}$, it holds that $\lambda (a,d)\ge 0$.

**Proof.** Since $\frac{\delta \lambda}{\delta a}=(3+\sqrt{7})a-2d+1+\sqrt{7}$, $\lambda $ is minimized at either $a=0$ or $a=\frac{2d-1-\sqrt{7}}{3+\sqrt{7}}$.

In the first case, $\lambda $ becomes $\frac{3-\sqrt{7}}{2}d(d-2)$ which is always non-negative for any $d\in {\mathbb{Z}}_{\ge 0}\backslash \left\{1\right\}$.

In the second case, $\lambda $ becomes $\frac{1}{2}(3(\sqrt{7}-1){d}^{2}+2d(\sqrt{7}-7)+\sqrt{7}-5)$ which is always non-negative for any $d\in {\mathbb{Z}}_{\ge 0}\backslash \{1,2\}$. For the leftover case $d=2$, $\lambda $ becomes $\frac{3-\sqrt{7}}{2}{a}^{2}+(\sqrt{7}-3)a$ which is always non-negative for any $a\in \mathbb{Z}\backslash \left\{1\right\}$. For the other case $d=1$, $\lambda $ becomes $\frac{3-\sqrt{7}}{2}{a}^{2}+(\sqrt{7}-1)a-\frac{3+\sqrt{7}}{2}$ which is always non-negative for any $a\in \mathbb{Z}\backslash \{0,1\}$. □

**Lemma** **A9.** Let $\theta :{\mathbb{Z}}_{\ge 0}^{6}\to \mathbb{Q}$ be the function such that $\theta (a,b,c,d,e,f)={a}^{2}(3-\sqrt{7})-a(2d-1-\sqrt{7})+2bc(\sqrt{7}-3)+2(bf+ce)+({d}^{2}-d)(3+\sqrt{7})-2(3+\sqrt{7})ef$. For any $(a,b,c,d,e,f)\in {\mathbb{Z}}_{\ge 0}^{6}$ such that $a\ge b+c$ and $d\ge e+f$, it holds that $\theta (a,b,c,d,e,f)\ge 0$.

**Proof.** Note first, that for 6-tuples of the form $(0,b,c,1,e,f)$, it holds that $\theta =0$, since $a=0\Rightarrow b=c=0$ and $d=1\Rightarrow ef=0$, for 6-tuples of the form $(1,b,c,1,e,f)$, it holds that $\theta =2(1+bf+ce)>0$, since $a=d=1\Rightarrow bc=ef=0$, and for 6-tuples of the form $(1,b,c,2,e,f)$, it holds that $\theta =2bf+2ce-2(3+\sqrt{7})ef+2(3+\sqrt{7})\ge 0$, since $d=2\Rightarrow ef\le 1$. Hence, in the sequel of the proof, we avoid to consider the cases $a=0\wedge d=1$, $a=d=1$ and $a=1\wedge d=2$.

At a first glance, in order to use standard arguments from calculus, we allow the 6-tuples $(a,b,c,d,e,f)$ to take values in the set of non-negative real numbers. Since it holds that $\frac{\delta \theta}{\delta c}=2(b(\sqrt{7}-3)+e)$ and $\frac{\delta \theta}{\delta f}=2(b-(\sqrt{7}+3)e)$, $\theta $ is minimized at one of the following four cases: $c=0\wedge f=0$, $c=0\wedge f=d-e$, $c=a-b\wedge f=0$ and $c=a-b\wedge f=d-e$.

In the first case, we get $\theta =(3-\sqrt{7}){a}^{2}+(\sqrt{7}+1-2d)a+(3+\sqrt{7})({d}^{2}-d)$. The claim follows by applying Lemma A8, since $\theta \ge \lambda $.

In the second case, we get $\theta =(3-\sqrt{7}){a}^{2}+(\sqrt{7}+1-2d)a+(3+\sqrt{7})({d}^{2}-d)+2(d-e)(b-(3+\sqrt{7})e)$. Since $\frac{\delta \theta}{\delta b}=2(d-e)$, $\theta $ is minimized at $b=0$, which yields $\theta =(3-\sqrt{7}){a}^{2}+(\sqrt{7}+1-2d)a+(3+\sqrt{7})({d}^{2}-d)-2(d-e)(3+\sqrt{7})e$. Since $\frac{\delta \theta}{\delta e}=4(3+\sqrt{7})e-2d(3+\sqrt{7})$, $\theta $ is minimized for $e=\frac{d}{2}$. In this case, $\theta $ becomes $(3-\sqrt{7}){a}^{2}+(\sqrt{7}+1-2d)a+(3+\sqrt{7})(\frac{{d}^{2}}{2}-d)$. The claim follows by applying Lemma A8, since $\theta \ge \lambda $.

In the third case, we get $\theta =(3-\sqrt{7}){a}^{2}+(\sqrt{7}+1+2e-2d)a+(3+\sqrt{7})({d}^{2}-d)+2{b}^{2}(3-\sqrt{7})+2b((\sqrt{7}-3)a-e)$. Since $\frac{\delta \theta}{\delta e}=2(a-b)$, $\theta $ is minimized for $e=0$, which yields $\theta =(3-\sqrt{7}){a}^{2}+(\sqrt{7}+1-2d)a+(3+\sqrt{7})({d}^{2}-d)+2{b}^{2}(3-\sqrt{7})+2ab(\sqrt{7}-3)$. Since $\frac{\delta \theta}{\delta b}=4(3-\sqrt{7})b-2a(3-\sqrt{7})$, $\theta $ is minimized for $b=\frac{a}{2}$. In this case, $\theta $ becomes $\frac{3-\sqrt{7}}{2}{a}^{2}+(\sqrt{7}+1-2d)a+(3+\sqrt{7})({d}^{2}-d)$. The claim follows by applying Lemma A8, since $\theta \ge \lambda $.

In the fourth case, we get $\theta =(3-\sqrt{7}){a}^{2}+(\sqrt{7}+1+2e-2d)a+(3+\sqrt{7})({d}^{2}-d)+2{b}^{2}(3-\sqrt{7})+2(\sqrt{7}-3)ab+2bd-4be+2(3+\sqrt{7}){e}^{2}$. Since $\frac{\delta \theta}{\delta b}=4(3-\sqrt{7})b+2(\sqrt{7}-3)a+2d-4e$, $\theta $ is minimized at either $b=0$ or $b=\frac{(3-\sqrt{7})a+2e-d}{2(3-\sqrt{7})}$. For $b=0$, $\theta $ becomes $(3-\sqrt{7}){a}^{2}+(\sqrt{7}+1+2e-2d)a+(3+\sqrt{7})({d}^{2}-d)+2(3+\sqrt{7}){e}^{2}$. Since $\frac{\delta \theta}{\delta e}=2a-2(3+\sqrt{7})d+4(3+\sqrt{7})e$, $\theta $ is minimized at either $e=0$ or $e=\frac{(3+\sqrt{7})d-a}{2(3+\sqrt{7})}$. In these two cases, $\theta $ becomes, respectively, $(3-\sqrt{7}){a}^{2}+(\sqrt{7}+1-2d)a+(3+\sqrt{7})({d}^{2}-d)$ and $\frac{3}{4}(3-\sqrt{7}){a}^{2}+(\sqrt{7}+1-d)a+(3+\sqrt{7})(\frac{{d}^{2}}{2}-d)$ which are always non-negative because of Lemma A8 and the fact that $\theta \ge \lambda $. For $b=\frac{(3-\sqrt{7})a+2e-d}{2(3-\sqrt{7})}$, $\theta $ becomes $\frac{3-\sqrt{7}}{2}{a}^{2}+(\sqrt{7}+1-d)a+(3+\sqrt{7})(\frac{3{d}^{2}}{4}-d)-(3+\sqrt{7})de+(3+\sqrt{7}){e}^{2}$. Since $\frac{\delta \theta}{\delta e}=(3+\sqrt{7})(2e-d)$, $\theta $ is minimized at either $e=0$ or $e=\frac{d}{2}$. In these two cases, $\theta $ becomes, respectively, $\frac{3-\sqrt{7}}{2}{a}^{2}+(\sqrt{7}+1-d)a+(3+\sqrt{7})(\frac{3{d}^{2}}{4}-d)$ and $\frac{3-\sqrt{7}}{2}{a}^{2}+(\sqrt{7}+1-d)a+(3+\sqrt{7})(\frac{{d}^{2}}{2}-d)$ which are always non-negative because of Lemma A8 and the fact that $\theta \ge \lambda $. □

**Lemma** **A10.** Let $\lambda :{\mathbb{Z}}_{\ge 0}^{2}\to \mathbb{Q}$ be the function such that $\lambda (a,d)=49{a}^{2}+a(81-130d)+211{d}^{2}-211d$. For any $(a,d)\in {\mathbb{Z}}_{\ge 0}^{2}$, it holds that $\lambda (a,d)\ge 0$.

**Proof.** Since $\frac{\delta \lambda}{\delta a}=98a-130d+81$, $\lambda $ is minimized at either $a=0$ or $a=\frac{130d-81}{98}$.

In the first case, $\lambda $ becomes $d(d-1)$ which is always non-negative for any $d\in \mathbb{Z}$.

In the second case, $\lambda $ becomes $d(3057d-2537)-\frac{6561}{8}$ which is always non-negative for any $d\in \mathbb{Z}\backslash \{0,1\}$. For the leftover case $d=0$, $\lambda $ becomes $49{a}^{2}+81a$, which is non-negative for any $a\in \mathbb{R}$. For the other case of $d=1$, $\lambda $ becomes $a(a-1)$ which is non-negative for any $a\in \mathbb{Z}$. □

**Lemma** **A11.** Let $\lambda :{\mathbb{Z}}_{\ge 0}^{2}\to \mathbb{Q}$ be the function such that $\lambda (a,d)=11{a}^{2}+a(81-68d)+422{d}^{2}-298d$. For any $(a,d)\in {\mathbb{Z}}_{\ge 0}^{2}$, it holds that $\lambda (a,d)\ge 0$.

**Proof.** Since $\frac{\delta \lambda}{\delta a}=222a-2(68d-81)$, $\lambda $ is minimized at either $a=0$ or $a=\frac{68d-81}{11}$.

In the first case, $\lambda $ becomes $d(211d-149)$ which is always non-negative for any $d\in \mathbb{Z}$.

In the second case, $\lambda $ becomes $d(9d+3869)-\frac{6561}{2}$ which is always non-negative for any $d\in {\mathbb{Z}}_{\ge 0}\backslash \left\{0\right\}$. For the leftover case of $d=0$, $\lambda $ becomes $11{a}^{2}+162a$ which is non-negative for any $a\in \mathbb{R}$. □

**Lemma** **A12.** Let $\lambda :{\mathbb{Z}}_{\ge 0}^{2}\to \mathbb{Q}$ be the function such that $\lambda (a,d)=2321{a}^{2}+422a(81-65d)+84817{d}^{2}-89042d$. For any $(a,d)\in {\mathbb{Z}}_{\ge 0}^{2}\backslash \left\{(0,1)\right\}$, it holds that $\lambda (a,d)\ge 0$.

**Proof.** Since $\frac{\delta \lambda}{\delta a}=4642a-422(65d-81)$, $\lambda $ is minimized at either $a=0$ or $a=\frac{65d-81}{11}$.

In the first case, $\lambda $ becomes $84817{d}^{2}-89042d$ which is always non-negative for any $d\in \mathbb{Z}\backslash \left\{1\right\}$.

In the second case, $\lambda $ becomes $d(5189d+155296)-\frac{1384371}{8}$ which is always non-negative for any $d\in {\mathbb{Z}}_{\ge 0}\backslash \{0,1\}$. For the leftover case $d=0$, $\lambda $ becomes $11{a}^{2}+162a$, which is non-negative for any $a\in \mathbb{R}$. For the other case of $d=1$, $\lambda $ becomes $a(11a+32)-\frac{4225}{211}$ which is non-negative for any $a\in {\mathbb{Z}}_{\ge 0}\backslash \left\{0\right\}$. □

**Lemma** **A13.** Let $\theta :{\mathbb{Z}}_{\ge 0}^{6}\to \mathbb{Q}$ be the function such that $\theta (a,b,c,d,e,f)=49{a}^{2}+a(62b+62c-68d-62e-62f+81)+130bf+130ce-422bc+211{d}^{2}-149d+162ef-62e-62f$. For any $(a,b,c,d,e,f)\in {\mathbb{Z}}_{\ge 0}^{6}$ such that $a\ge b+c$ and $d\ge e+f$, it holds that $\theta (a,b,c,d,e,f)\ge 0$.

**Proof.** At a first glance, in order to use standard arguments from calculus, we allow the 6-tuples $(a,b,c,d,e,f)$ to take values in the set of non-negative real numbers. Since it holds that $\frac{\delta \theta}{\delta c}=62a-42b+130e$ and $\frac{\delta \theta}{\delta f}=-2(31a-65b-81e+31)$, $\theta $ is minimized at one of the following four cases: $c=0\wedge f=0$, $c=0\wedge f=d-e$, $c=a-b\wedge f=0$ and $c=a-b\wedge f=d-e$.

In the first case, we get $\theta =49{a}^{2}+a(62b-68d-62e+81)+211{d}^{2}-149d-62e$. Since $\frac{\delta \theta}{\delta e}=-62(a+1)$, $\theta $ is minimized at $e=d$, which yields $\theta =49{a}^{2}+a(62b-130d+81)+211{d}^{2}-211d$. Since $\frac{\delta \theta}{\delta b}=62a$, $\theta $ is minimized for $b=0$. In this case, $\theta $ becomes $49{a}^{2}+a(81-130d)+211{d}^{2}-211d$. The claim follows by applying Lemma A10.

In the second case, we get $\theta =49{a}^{2}+a(62b-130d+81)+130b(d-e)+211{d}^{2}+d(162e-211)-162{e}^{2}$. Since $\frac{\delta \theta}{\delta b}=62a+130(d-e)$, $\theta $ is minimized at $b=0$, which yields $\theta =49{a}^{2}+a(81-130d)+211{d}^{2}+d(162e-211)-162{e}^{2}$. Since $\frac{\delta \theta}{\delta e}=162d-324e$, $\theta $ is minimized at either $e=0$ and $e=d$. In both cases $\theta $ becomes $49{a}^{2}+a(81-130d)+211{d}^{2}-211d$ and the claim follows by applying Lemma A10.

In the third case, we get $\theta =111{a}^{2}-a(422b+68d-68e-81)+422{b}^{2}-130be+211{d}^{2}-149d-62e$. Since $\frac{\delta \theta}{\delta b}=-422a+844b-130e$, $\theta $ is minimized at $b=\frac{211a+65e}{422}$, which yields $\theta =2321{a}^{2}+422a(3e+81-68d)+89042{d}^{2}-62878d-4225{e}^{2}-26164e$. Since $\frac{\delta \theta}{\delta e}=1266a-8450e-26164$, $\theta $ is minimized at either $e=0$ or $e=d$. For $e=$, $\theta $ becomes $11{a}^{2}+2a(81-68d)+422{d}^{2}-298d$ and the claim follows by applying Lemma A11. For $e=d$, $\theta $ becomes $2321{a}^{2}+422a(81-65d)+84817{d}^{2}-89042d$ and the claim follows for any 6-tuple $(a,b,c,d,e,f)$ such that $(a,d)\ne (0,1)$ by applying Lemma A12. Hence, we are left to consider the 6-tuples of the form $(0,0,0,1,e,0)$. In this case $\theta $ becomes $62(1-e)$ which is always non-negative since $e\in \{0,1\}$.

In the fourth case, we get $\theta =111{a}^{2}-a(422b+130d-130e-81)+422{b}^{2}+130b(d-2e)+211{d}^{2}+d(162e-211)-162{e}^{2}$. Since $\frac{\delta \theta}{\delta b}=-422a+844b+130(d-2e)$, $\theta $ is minimized at either $b=0$ or $b=\frac{211a-65(d-2e)}{422}$. For $b=0$, $\theta $ becomes $111{a}^{2}-a(130d-130e-81)+211{d}^{2}+d(162e-211)-162{e}^{2}$. Since $\frac{\delta \theta}{\delta e}=130a+162d-324e$, $\theta $ is minimized at either $e=0$ or $e=d$. In these two cases, $\theta $ becomes, respectively, $111{a}^{2}+a(81-130d)+211{d}^{2}-211d$ and $111{a}^{2}+81a+211{d}^{2}-211d$ which are always non-negative because of Lemma A10 and the fact the $\theta \ge \lambda $. For $b=\frac{211a-65(d-2e)}{422}$, $\theta $ becomes $2321{a}^{2}+422a(81-65d)+84817{d}^{2}+2d(42632e-44521)-85264{e}^{2}$. Since $\frac{\delta \theta}{\delta e}=85264d-170528e$, $\theta $ is minimized at either $e=0$ or $e=d$. In both cases, $\theta $ becomes $2321{a}^{2}+422a(81-65d)+84817{d}^{2}-89042d$ and the claim follows for any 6-tuple $(a,b,c,d,e,f)$ such that $(a,d)\ne (0,1)$ by applying Lemma A12. Hence, we are left to consider the 6-tuples of the form $(0,0,0,1,e,1-e)$. In this case, $\theta $ becomes $162(1-e)$ which is always non-negative since $e\in \{0,1\}$. □