%root: main.tex

\subsubsection{Proof of \Cref{lem:lin-sys}}

\begin{proof}[Proof of \Cref{lem:lin-sys}]
The proof consists of two parts.  First we need to show that such a vector $\vct{b}$ satisfying the linear system exists and further can be computed in $O(m)$ time.  Second we need to show that $\numocc{G}{\tri}, \numocc{G}{\threedis}$ can indeed be computed in time $O(1)$.

The lemma claims that for $\vct{M} = 
\begin{pmatrix}
1 - 3p                                     &       -(3\prob^2 - \prob^3)\\
10(3\prob^2 - \prob^3)		&       10(3\prob^2 - \prob^3)
\end{pmatrix}$, $\vct{x} = 
\begin{pmatrix}
\numocc{G}{\tri}]\\
\numocc{G}{\threedis}
\end{pmatrix}$
that the system $\vct{M} \cdot \vct{x} = \vct{b}$.

To prove the first step, we use \cref{lem:qE3-exp} to derive the following equality (dropping the superscript and referring to $G^{(1)}$ as $G$:
\begin{align}
\rpoly_{G}^3(\prob,\ldots, \prob) &= \numocc{G}{\ed}\prob^2 + 6\numocc{G}{\twopath}\prob^3 + 6\numocc{G}		{\twodis}\prob^4 + 6\numocc{G}{\tri}\prob^3\nonumber\\
&+ 6\numocc{G}{\oneint}\prob^4 + 6\numocc{G}{\threepath}\prob^4 + 6\numocc{G}{\twopathdis}\prob^5 + 			6\numocc{G}{\threedis}\prob^6.\label{eq:lem-qE3-exp}\\
\frac{\rpoly_{G}^3(\prob,\ldots, \prob)}{6\prob^3} &- \frac{\numocc{G}{\ed}}{6\prob} - \numocc{G}{\twopath}-\numocc{G}{\twodis}\prob-\numocc{G}{\oneint}\prob\nonumber\\
&=\numocc{G}{\tri}+\numocc{G}{\threepath}\prob+\numocc{G}{\twopathdis}\prob^2+\numocc{G}{\threedis}\prob^3.\label{eq:b1-alg-1}\\
\frac{\rpoly_{G}^3(\prob,\ldots, \prob)}{6\prob^3} &- \frac{\numocc{G}{\ed}}{6\prob} - \numocc{G}{\twopath}-\numocc{G}{\twodis}\prob-\numocc{G}{\oneint}\prob-\numocc{G}{\threepath}\prob\nonumber\\
&-3\numocc{G}{\tri}\prob-\numocc{G}{\twopathdis}\prob^2-3\numocc{G}{\threedis}\prob^2\nonumber\\
&=\numocc{G}{\tri}(1-3p) - \numocc{G}{\threedis}(3\prob^2 -\prob^3).\label{eq:b1-alg-2}
\end{align}
\Cref{eq:lem-qE3-exp} is the result of \cref{lem:qE3-exp}.  We obtain the remaining equations through standard algebraic manipulations.  

Note that the RHS of \Cref{eq:b1-alg-2} is indeed the product $\vct{M}[1] \cdot \vct{x}[1]$.  Further note that this product is equal to the LHS of \Cref{eq:b1-alg-2}, where every term is computable in $O(m)$ time (by equations~\ref{eq:1e}-~\ref{eq:3p-3tri}).  We set $\vct{b}[1]$ to the RHS of \Cref{eq:b1-alg-2}.

We follow the same process in deriving an equality for $G^{(2)}$.  Replacing occurrences of $G$ with $G^{(2)}$, we obtain \Cref{eq:b1-alg-2} for $G^{(2)}$.  Substituting identities from \cref{lem:3m-G2} and \cref{lem:tri} we obtain
\begin{align}
\frac{\rpoly_{\graph{2}}^3(\prob,\ldots, \prob)}{6\prob^3} &- \frac{\numocc{\graph{2}}{\ed}}{6\prob} - \numocc{\graph{2}}{\twopath}-\numocc{\graph{2}}{\twodis}\prob-\numocc{\graph{2}}{\oneint}\prob-\numocc{\graph{2}}{\threepath}\prob\nonumber\\
-3\numocc{\graph{2}}{\tri}\prob&-\numocc{\graph{2}}{\twopathdis}\prob^2-3\numocc{\graph{2}}{\threedis}\prob^2\nonumber\\
&=0-\left(8\numocc{G}{\threedis}+6\numocc{G}{\twopathdis}+4\numocc{G}{\oneint}+4\numocc{G}{\threepath}+2\numocc{G}{\tri}(3\prob^2 -\prob^3)\right)\label{eq:b2-sub-lem}\\
\frac{\rpoly_{\graph{2}}^3(\prob,\ldots, \prob)}{6\prob^3} &- \frac{\numocc{\graph{2}}{\ed}}{6\prob} - \numocc{\graph{2}}{\twopath}-\numocc{\graph{2}}{\twodis}\prob-\numocc{\graph{2}}{\oneint}\prob-\numocc{\graph{2}}{\threepath}\prob\nonumber\\
-3\numocc{\graph{2}}{\tri}\prob&-\numocc{\graph{2}}{\twopathdis}\prob^2-3\numocc{\graph{2}}{\threedis}\prob^2+\left(4\numocc{G}{\oneint}+6\numocc{G}{\twopathdis}+18\numocc{G}{\threedis}\right.\nonumber\\
+4\numocc{G}{\threepath}&\left.+12\numocc{G}{\tri}\right)(3\prob^2 - \prob^3)\nonumber\\
&=(10\numocc{G}{\tri} + 10{G}{\threedis})(3\prob^2 -\prob^3)\label{eq:b2-final}
\end{align}
\end{proof}
As in the previous equality derivation for $G$, note that the RHS of \Cref{eq:b2-final} is the same as $\vct{M}[2]\cdot \vct{x}[2]$.  The RHS of \Cref{eq:b2-final} has terms all computable (by equations~\ref{eq:1e}-~\ref{eq:3p-3tri}) in $O(m)$ time.  Setting $\vct{b}[2]$ to the RHS then completes the proof of step 1.

Note that if $\vct{M}$ has full rank then one can compute $\numocc{G}{\tri}$ and $\numocc{G}{\threedis}$ in $O(1)$ using Gaussian elimination.

To show that $\vct{M}$ indeed has full rank, we will show that $\dtrm{\vct{M}}\ne 0$ for every $\prob\in (0,1)$.


\begin{align}
&\begin{vmatrix}
1						&-(3\prob^2 - \prob^3)\\
10(3\prob^2 - \prob^3) 	&10(3\prob^2 - \prob^3)
\end{vmatrix}
= (1-3\prob)\cdot 10(3\prob^2-\prob^3) - 10(3\prob^2-\prob^3)\cdot(-3\prob^2 + \prob^3)\nonumber\\
&=10(3\prob^2-\prob^3)\cdot(1-3\prob -3\prob^2-\prob^3) = 10(3\prob^2-\prob^3)\cdot(-\prob^3-3\prob^2-3\prob + 1)\nonumber\\
&=10\prob^2(3 - \prob)\cdot(1-\prob)^3\label{eq:det-final}
\end{align}


From ~\cref{eq:det-final} it can easily be seen that the roots of $\dtrm{\vct{M}}$ are $0, 1,$ and $3$.  Hence there are no roots in $(0, 1)$ and ~\cref{lem:lin-sys} follows.
%\end{proof}

%\qed
%\begin{proof}[Proof of \cref{th:single-p}]
%The proof follows by ~\cref{lem:lin-sys}.
%\end{proof}
%\qed

%\begin{Corollary}\label{cor:single-p-gen-k}
%For every value $\kElem \geq 3$, there exists a query with $\kElem$ product width that is hard.
%\end{Corollary}
%\begin{proof}[Proof of Corollary ~\ref{cor:single-p-gen-k}]
%Consider $\poly^3_{G}$ and $\poly' = 1$ such that $\poly'' = \poly^3_{G} \cdot \poly'$.  By ~\cref{th:single-p}, query $\poly''$ with $\kElem = 4$ has $\Omega(\numvar^{\frac{4}{3}})$ complexity.
%\end{proof}

%\qed
