Finished rearranging section 2 for more continuity.

This commit is contained in:
Aaron Huber 2020-07-27 12:34:23 -04:00
parent 9cd95890f1
commit 1e6fda1b16

View file

@ -88,7 +88,7 @@ Note that \cref{lem:exp-poly-rpoly} shows that $\ex{\poly} = \rpoly(\prob_1,\ldo
\subsection{When $\poly$ is not in sum of monomials form}
\AH{\Large\bf This section has been largely rearranged since Atri's last pass. There are also some changes to arguments that he hasn't made a pass over.}
We would like to argue that in the general case there is no computation of expectation in linear time.
To this end, consider the following graph $G(V, E)$, where $|E| = m$, $|V| = \numTup$, and $i, j \in [\numTup]$. Consider the query $q_E(X_1,\ldots, X_\numTup) = \sum\limits_{(i, j) \in E} X_i \cdot X_j$.
@ -116,11 +116,13 @@ For any graph $G$, the following formulas compute $\numocc{G}{H}$ for their resp
&\numocc{G}{\twopathdis} + \numocc{G}{\threedis} = \sum_{(u, v) \in E} \binom{m - d_u - d_v + 1}{2}\label{eq:2pd-3d}
\end{align}
A quick argument to why \cref{eq:2pd-3d} is true. Note that for each edge connecting arbitrary vertices $u$ and $v$, we can get rid of all neighbors, and choose two distinct edges. The sum over all such edge combinations is precisely then $\numocc{G}{\twopathdis} + \numocc{G}{\threedis}$.
For the following discussion, set $\poly(\vct{X}) = \left(q_E(X_1,\ldots, X_\numTup)\right)^3$.
\begin{Lemma}\label{lem:qE3-exp}
When we expand $\poly(\wElem_1,\ldots, \wElem_N) = q_E(\wElem_1,\ldots, \wElem_\numTup)^3$ out and assign all exponents $e \geq 1$ a value of $1$, we have the following,
When we expand $\poly(\vct{X}) = q_E(X_1,\ldots, X_\numTup)^3$ out and assign all exponents $e \geq 1$ a value of $1$, we have the following,
\begin{align}
&\rpoly(\prob,\ldots, \prob) = \numocc{G}{\ed}\prob^2 + 6\numocc{G}{\twopath}\prob^3 + 6\numocc{G}{\twodis} + 6\numocc{G}{\tri}\prob^3 + 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{claim:four-one}
\end{align}
@ -128,106 +130,104 @@ When we expand $\poly(\wElem_1,\ldots, \wElem_N) = q_E(\wElem_1,\ldots, \wElem_\
\begin{proof}[Proof of \cref{lem:qE3-exp}]
By definition we have that
\[\poly(\wElem_1,\ldots, \wElem_\numTup) = \sum_{\substack{(i_1, j_1),\\ (i_2, j_2),\\ (i_3, j_3) \in E}} \prod_{\ell = 1}^{3}\wElem_{i_\ell}\wElem_{j_\ell}.\]
\[\poly(\vct{X}) = \sum_{\substack{(i_1, j_1),\\ (i_2, j_2),\\ (i_3, j_3) \in E}} \prod_{\ell = 1}^{3}X_{i_\ell}X_{j_\ell}.\]
Rather than list all the expressions in full detail, let us make some observations regarding the sum. Let $e_1 = (i_1, j_1), e_2 = (i_2, j_2), e_3 = (i_3, j_3)$. Notice that each expression in the sum consists of a triple $(e_1, e_2, e_3)$. There are three forms the triple $(e_1, e_2, e_3)$ can take.
\underline{case 1:} $e_1 = e_2 = e_3$, where all edges are the same. There are exactly $m$ such triples, each with a $\prob^2$ factor.
\textsc{case 1:} $e_1 = e_2 = e_3$, where all edges are the same. There are exactly $m$ such triples, each with a $\prob^2$ factor.
\underline{case 2:} This case occurs when there are two distinct edges of the three. All 6 combinations of two distinct values consist of the same monomial in $\rpoly$, i.e. $(e_1, e_1, e_2)$ is the same as $(e_2, e_1, e_2)$. This case produces the following edge patterns: $\twodis, \twopath$.
\textsc{case 2:} This case occurs when there are two distinct edges of the three, call them $e$ and $e'$. When there are two distinct edges, there is then the occurence when $2$ variables in the triple $(e_1, e_2, e_3)$ are bound to $e$. There are three combinations for this occurrence. It is the analogue for when there is only one occurrence of $e$, i.e. $2$ of the variables in $(e_1, e_2, e_3)$ are $e'$. Again, there are three combinations for this. All $3 + 3 = 6$ combinations of two distinct values consist of the same monomial in $\rpoly$, i.e. $(e_1, e_1, e_2)$ is the same as $(e_2, e_1, e_2)$. This case produces the following edge patterns: $\twodis, \twopath$.
\underline{case 3:} $e_1 \neq e_2 \neq e_3$, i.e., when all edges are distinct. This case consists of the following edge patterns: $\threedis, \twopathdis, \threepath, \oneint, \tri$.
\AH{{\Huge I left off here, 07242020.} Need to finish the proof for \cref{lem:qE3-exp}, discussing element notes for why all 2-distinct and 3-distinct patterns have a coefficient of 6. I \textit{think} that should complete the proof, but let's think about it to be sure. \newline
Next on the todo list for rearranging this section, is to state what is currently claim 2, prove that, and then comment out the warm up exercise, as well as any repitition of material that has been copied and pasted due to the rearranging.}
\textsc{case 3:} $e_1 \neq e_2 \neq e_3$, i.e., when all edges are distinct. For this case, we have $3! = 6$ permutations of $(e_1, e_2, e_3)$. This case consists of the following edge patterns: $\threedis, \twopathdis, \threepath, \oneint, \tri$.
\end{proof}
\qed
\begin{Lemma}\label{lem:const-p}
If we can compute $\poly(\vct{X})$ in T(m) time for $\wElem_1 =\cdots= \wElem_\numTup = \prob$, then we can count the number of triangles, 3-paths, and 3-matchings in $G$ in $T(m) + O(m)$ time.
\end{Lemma}
\begin{Claim}\label{claim:four-two}
If one can compute $\rpoly(\prob,\ldots, \prob)$ in time T(m), then we can compute the following in O(T(m) + m):
\[\numocc{G}{\tri} + \numocc{G}{\threepath} \cdot \prob - \numocc{G}{\threedis}\cdot(\prob^2 - \prob^3).\]
\end{Claim}
\begin{proof}[Proof of Claim \ref{claim:four-two}]
%We have shown that the following subgraph cardinalities can be computed in $O(m)$ time:
%\[\numocc{G}{\ed}, \numocc{G}{\twopath}, \numocc{G}{\twodis}, \numocc{G}{\oneint}, \numocc{G}{\twopathdis} + \numocc{G}{\threedis}.\]
It has already been shown previously that $\numocc{G}{\ed}, \numocc{G}{\twopath}, \numocc{G}{\twodis},$ and$\numocc{G}{\twopathdis} + \numocc{G}{\threedis}$ can be computed in O(m) time.
Using the result of \cref{lem:qE3-exp}, let us show a derivation to the identity of the consequent in \cref{claim:four-two}.
All of \cref{eq:1e}, \cref{eq:2p}, \cref{eq:2m}, \cref{eq:3s}, \cref{eq:2pd-3d} show that we can compute the respective edge patterns in $O(m)$ time. Rearrange $\rpoly$ with all linear time computations on one side, leaving only the hard computations,
\begin{align}
&\rpoly(\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 + 6\numocc{G}{\oneint}\prob^4 + 6\numocc{G}{\threepath}\prob^4 + 6\numocc{G}{\twopathdis}\prob^5 + 6\numocc{G}{\threedis}\prob^6\nonumber\\
&\rpoly(\prob,\ldots, \prob) - \numocc{G}{\ed}\prob^2 - 6\numocc{G}{\twopath}\prob^3 - 6\numocc{G}{\twodis}\prob^4 - 6\numocc{G}{\oneint}\prob^4 = 6\numocc{G}{\tri}\prob^3 + 6\numocc{G}{\threepath}\prob^4 + 6\numocc{G}{\twopathdis}\prob^5 + 6\numocc{G}{\threedis}\prob^6\label{eq:LS-rearrange}\\
&\frac{\rpoly(\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}{\tri} + \numocc{G}{\threepath}\prob + \numocc{G}{\twopathdis}\prob^2 + \numocc{G}{\threedis}\prob^3\label{eq:LS-reduce}\\
&\frac{\rpoly(\prob,\ldots, \prob)}{6\prob^3} - \frac{\numocc{G}{\ed}}{6\prob} - \numocc{G}{\twopath} - \numocc{G}{\twodis}\prob - \numocc{G}{\oneint}\prob - \big(\numocc{G}{\twopathdis} + \numocc{G}{\threedis}\big)\prob^2 = \numocc{G}{\tri} + \numocc{G}{\threepath}\prob - \numocc{G}{\threedis}\left(\prob^2 - \prob^3\right)\label{eq:LS-subtract}
\end{align}
\cref{eq:LS-rearrange} is the result of simply subtracting from both sides terms that have $O(m)$ complexity. Reducing all terms by the common factor of $6\prob^3$ gives \cref{eq:LS-reduce}. The final equation, \cref{eq:LS-subtract}, is the result of subtracting the term $\left(\numocc{G}{\twopathdis} + \numocc{G}{\threedis}\right)\prob^2$ from both sides.
The implication in \cref{claim:four-two} follows by the above and \cref{lem:qE3-exp}.
\end{proof}
\qed
\begin{Lemma}\label{lem:gen-p}
If we can compute $\poly(\vct{X})$ in $T(m)$ time for $O(1)$ distinct values of $\prob$ then we can count the number of triangles, 3-paths, and 3-matchings in $G$ in $T(m) + O(m)$ time.
\end{Lemma}
\AH{The warm-up below is fine for now, but will need to be removed for the final draft}
First, let us do a warm-up by computing $\rpoly(\wElem_1,\dots, \wElem_\numTup)$ when $\poly = q_E(\wElem_1,\ldots, \wElem_\numTup)$. Before doing so, we introduce a notation. Let $\numocc{G}{H}$ denote the number of occurrences that $H$ occurs in $G$. So, e.g., $\numocc{G}{\ed}$ is the number of edges ($m$) in $G$.
\AH{We need to make a decision on subgraph notation, and number of occurrences notation.}
\AH{UPDATE: I did a quick google, and it \textit{appears} that there is a bit of a learning curve to implement node/edge symbols in LaTeX. So, maybe, if time is of the essence, we go with another notation.}
\begin{Claim}
We can compute $\rpoly(\prob,\ldots, \prob)^2$ in O(m) time.
\end{Claim}
\begin{proof}
The proof basically follows by definition. When we expand $\poly^2$, and make all exponents $e = 1$, substituting $\prob$ for all $\wElem_i$ we get $\rpoly_2(\prob,\ldots, \prob) = \numocc{G}{\ed} \cdot \prob^2 + 2\cdot \numocc{G}{\twopath}\cdot \prob^3 + 2\cdot \numocc{G}{\twodis}\cdot \prob^4$.
\begin{enumerate}
\item First note that
\begin{align*}
\poly^2(\wVec) &= \sum_{(i, j) \in E} (\wElem_i\wElem_j)^2 + \sum_{(i, j), (k, \ell) \in E s.t. (i, j) \neq (k, \ell)} \wElem_i\wElem_j\wElem_k\wElem_\ell\\
&= \sum_{(i, j) \in E} (\wElem_i\wElem_j)^2 + \sum_{\substack{(i, j), (j, \ell) \in E\\s.t. i \neq \ell}}\wElem_i
\wElem_j^2\wElem_\ell + \sum_{\substack{(i, j), (k, \ell) \in E\\s.t. i \neq j \neq k \neq \ell}} \wElem_i\wElem_j\wElem_k\wElem_\ell\\
\end{align*}
By definition of $\rpoly$,
\begin{equation}
\rpoly^2(\wVec) = \sum_{(i, j) \in E} \wElem_i\wElem_j + \sum_{\substack{(i, j), (j, \ell) \in E\\s.t. i \neq \ell}}\wElem_i\wElem_j\wElem_\ell + \sum_{\substack{(i, j), (k, \ell) \in E\\s.t. i \neq j \neq k \neq \ell}} \wElem_i\wElem_j\wElem_k\wElem_\ell\label{eq:part-1}
\end{equation}
Notice that the first term is $\numocc{G}{\ed}\cdot \prob^2$, the second $\numocc{G}{\twopath}\cdot \prob^3$, and the third $\numocc{G}{\twodis}\cdot \prob^4.$
\item Note that
\AH{We need the correct formula for two-matchings below.}
\end{enumerate}
Thus, since each of the summations can be computed in O(m) time, this implies that by \cref{eq:part-1} $\rpoly(\prob,\ldots, \prob)$ can be computed in O(m) time.\qed
\end{proof}
\AH{END of the 'warm-up'}
We are now ready to state the claim we need to prove \cref{lem:const-p} and \cref{lem:gen-p}.
Let $\poly(\wVec) = q_E(\wVec)^3$.
\begin{Claim}\label{claim:four-two}
If one can compute $\rpoly(\prob,\ldots, \prob)$ in time T(m), then we can compute the following in O(T(m) + m):
\[\numocc{G}{\tri} + \numocc{G}{\threepath} \cdot \prob - \numocc{G}{\threedis}\cdot(\prob^2 - \prob^3).\]
\end{Claim}
\begin{proof}
We have either shown or will show that the following subgraph cardinalities can be computed in $O(m)$ time:
\[\numocc{G}{\ed}, \numocc{G}{\twopath}, \numocc{G}{\twodis}, \numocc{G}{\oneint}, \numocc{G}{\twopathdis} + \numocc{G}{\threedis}.\]
% By definition we have that
% \[\poly(\wElem_1,\ldots, \wElem_\numTup) = \sum_{\substack{(i_1, j_1),\\ (i_2, j_2),\\ (i_3, j_3) \in E}} \prod_{\ell = 1}^{3}\wElem_{i_\ell}\wElem_{j_\ell}.\]
% Rather than list all the expressions in full detail, let us make some observations regarding the sum. Let $e_1 = (i_1, j_1), e_2 = (i_2, j_2), e_3 = (i_3, j_3)$. Notice that each expression in the sum consists of a triple $(e_1, e_2, e_3)$. There are three forms the triple $(e_1, e_2, e_3)$ can take.
%
%\underline{case 1:} $e_1 = e_2 = e_3$, where all edges are the same. There are exactly $m$ such triples, each with a $\prob^2$ factor.
%
%\underline{case 2:} This case occurs when there are two distinct edges of the three. All 6 combinations of two distinct values consist of the same monomial in $\rpoly$, i.e. $(e_1, e_1, e_2)$ is the same as $(e_2, e_1, e_2)$. This case produces the following edge patterns: $\twodis, \twopath$.
%
%\underline{case 3:} $e_1 \neq e_2 \neq e_3$, i.e., when all edges are distinct. This case consists of the following edge patterns: $\threedis, \twopathdis, \threepath, \oneint, \tri$.
\AH{This proof I think could some reorganization. We really don't need the warm-up anymore, but we can use the formulas for case 1 and case 2.}
It has already been shown previously that $\numocc{G}{\ed}, \numocc{G}{\twopath}, \numocc{G}{\twodis}$ can be computed in O(m) time. Here are the arguments for the rest.
$\numocc{G}{\twopathdis} + \numocc{G}{\threedis} = $ the number of occurrences of three distinct edges with five or six vertices. This can be counted in the following manner. For every edge $(u, v) \in E$, throw away all neighbors of $u$ and $v$ and pick two more distinct edges.
The implication in \cref{claim:four-two} follows by the above and \cref{lem:qE3-exp}.
\AH{Justify the last sentence.}
\end{proof}
\qed
\begin{proof}[Proof of \cref{lem:gen-p}]
%\AR{Also you can modify the text of \textsc{Proof} by using the following latex command \texttt{\\begin\{proof\}[Proof of Lemma 2]} and Latex will typeset this as \textsc{Proof of Lemma 2}, which is what you really want.}
\cref{claim:four-two} says that if we know $\rpoly_3(\prob,\ldots, \prob)$, then we can know in O(m) additional time
\[\numocc{G}{\tri} + \numocc{G}{\threepath} \cdot \prob - \numocc{G}{\threedis}\cdot(\prob^2 - \prob^3).\] We can think of each term in the above equation as a variable, where one can solve a linear system given 3 distinct $\prob$ values, assuming independence of the three linear equations. In the worst case, without independence, 4 distince values of $\prob$ would suffice...because Atri said so, and I need to ask him for understanding why this is the case, of which I suspect that it has to do with basic result(s) in linear algebra.\AR{Follows from the fact that the corresponding coefficient matrix is the so called Vandermonde matrix, which has full rank.}
\AH{This Vandermonde matrix I need to research.}
\[\numocc{G}{\tri} + \numocc{G}{\threepath} \cdot \prob - \numocc{G}{\threedis}\cdot(\prob^2 - \prob^3).\] We can think of each term in the above equation as a variable, where one can solve a linear system given 3 distinct $\prob$ values, assuming independence of the three linear equations. In the worst case, without independence, 4 distinct values of $\prob$ would suffice. This follows from the fact that the corresponding coefficient matrix is the so called Vandermonde matrix, which has full rank
\end{proof}
\qed
\AH{{\Huge\bf Changes start here.}}
\AR{Follows from the fact that the corresponding coefficient matrix is the so called Vandermonde matrix, which has full rank.}
\AH{This Vandermonde matrix I need to research. Right now, the last sentences are just parrotting Atri.}
\begin{Lemma}\label{lem:const-p}
If we can compute $\poly(\vct{X})$ in T(m) time for $\wElem_1 =\cdots= \wElem_\numTup = \prob$, then we can count the number of triangles, 3-paths, and 3-matchings in $G$ in $T(m) + O(m)$ time.
\end{Lemma}
%-------------------------------------WARM-UP------------------------------
%\AH{The warm-up below is fine for now, but will need to be removed for the final draft}
%First, let us do a warm-up by computing $\rpoly(\wElem_1,\dots, \wElem_\numTup)$ when $\poly = q_E(\wElem_1,\ldots, \wElem_\numTup)$. Before doing so, we introduce a notation. Let $\numocc{G}{H}$ denote the number of occurrences that $H$ occurs in $G$. So, e.g., $\numocc{G}{\ed}$ is the number of edges ($m$) in $G$.
%
%\AH{We need to make a decision on subgraph notation, and number of occurrences notation.}
%\AH{UPDATE: I did a quick google, and it \textit{appears} that there is a bit of a learning curve to implement node/edge symbols in LaTeX. So, maybe, if time is of the essence, we go with another notation.}
%
%\begin{Claim}
%We can compute $\rpoly(\prob,\ldots, \prob)^2$ in O(m) time.
%\end{Claim}
% \begin{proof}
% The proof basically follows by definition. When we expand $\poly^2$, and make all exponents $e = 1$, substituting $\prob$ for all $\wElem_i$ we get $\rpoly_2(\prob,\ldots, \prob) = \numocc{G}{\ed} \cdot \prob^2 + 2\cdot \numocc{G}{\twopath}\cdot \prob^3 + 2\cdot \numocc{G}{\twodis}\cdot \prob^4$.
% \begin{enumerate}
% \item First note that
% \begin{align*}
% \poly^2(\wVec) &= \sum_{(i, j) \in E} (\wElem_i\wElem_j)^2 + \sum_{(i, j), (k, \ell) \in E s.t. (i, j) \neq (k, \ell)} \wElem_i\wElem_j\wElem_k\wElem_\ell\\
% &= \sum_{(i, j) \in E} (\wElem_i\wElem_j)^2 + \sum_{\substack{(i, j), (j, \ell) \in E\\s.t. i \neq \ell}}\wElem_i
% \wElem_j^2\wElem_\ell + \sum_{\substack{(i, j), (k, \ell) \in E\\s.t. i \neq j \neq k \neq \ell}} \wElem_i\wElem_j\wElem_k\wElem_\ell\\
% \end{align*}
% By definition of $\rpoly$,
% \begin{equation}
% \rpoly^2(\wVec) = \sum_{(i, j) \in E} \wElem_i\wElem_j + \sum_{\substack{(i, j), (j, \ell) \in E\\s.t. i \neq \ell}}\wElem_i\wElem_j\wElem_\ell + \sum_{\substack{(i, j), (k, \ell) \in E\\s.t. i \neq j \neq k \neq \ell}} \wElem_i\wElem_j\wElem_k\wElem_\ell\label{eq:part-1}
% \end{equation}
% Notice that the first term is $\numocc{G}{\ed}\cdot \prob^2$, the second $\numocc{G}{\twopath}\cdot \prob^3$, and the third $\numocc{G}{\twodis}\cdot \prob^4.$
% \item Note that
%\AH{We need the correct formula for two-matchings below.}
%
% \end{enumerate}
% Thus, since each of the summations can be computed in O(m) time, this implies that by \cref{eq:part-1} $\rpoly(\prob,\ldots, \prob)$ can be computed in O(m) time.\qed
% \end{proof}
%\AH{END of the 'warm-up'}
%We are now ready to state the claim we need to prove \cref{lem:const-p} and \cref{lem:gen-p}.
%
%Let $\poly(\wVec) = q_E(\wVec)^3$.
%----------------------------------------------------------------------------
\begin{proof}[Proof of \cref{lem:const-p}]
Here is the outline of the proof.
@ -273,6 +273,7 @@ Note that $f_k$ is properly defined. For any $S \in \binom{E_k}{3}$, $|f(S)| \l
% \item 3-matching ($\threedis$)--this subgraph is composed of three disjoint edges.
%\end{itemize}
\subsection{Three Matchings in $\graph{2}$}
\AH{\Large \bf The only changes in the next few subsections are regarding Atri's first pass comments. Atri has not yet made another pass after I implemented the changes.}
\begin{Lemma}\label{lem:3m-G2}
The number of $3$-matchings in graph $\graph{2}$ satisfies the following identity,
@ -418,19 +419,9 @@ The number of triangles in $\graph{k}$ for $k \geq 2$ will always be $0$ for the
\end{proof}
\qed
\AH{\LARGE \bf Newest material starts here.}
\AH{\LARGE \bf Newest material starts here. Atri has not made a pass on this yet.}
\subsection{Developing a Linear System}
In \cref{lem:qE3-exp} is the identity for $\rpoly(\prob,\ldots, \prob)$ when $\poly(\wElem_1,\ldots, \wElem_N) = q_E(\wElem_1,\ldots, \wElem_\numTup)^3$. (This lemma still needs a proof, but for now we will pretend the proof is there.)
All of \cref{eq:1e}, \cref{eq:2p}, \cref{eq:2m}, \cref{eq:3s}, \cref{eq:2pd-3d} show that we can compute the respective edge patterns in $O(m)$ time. Rearrange $\rpoly$ with all linear time computations on one side, leaving only the hard computations,
\begin{align}
&\rpoly(\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 + 6\numocc{G}{\oneint}\prob^4 + 6\numocc{G}{\threepath}\prob^4 + 6\numocc{G}{\twopathdis}\prob^5 + 6\numocc{G}{\threedis}\prob^6\nonumber\\
&\rpoly(\prob,\ldots, \prob) - \numocc{G}{\ed}\prob^2 - 6\numocc{G}{\twopath}\prob^3 - 6\numocc{G}{\twodis}\prob^4 - 6\numocc{G}{\oneint}\prob^4 = 6\numocc{G}{\tri}\prob^3 + 6\numocc{G}{\threepath}\prob^4 + 6\numocc{G}{\twopathdis}\prob^5 + 6\numocc{G}{\threedis}\prob^6\label{eq:LS-rearrange}\\
&\frac{\rpoly(\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}{\tri} + \numocc{G}{\threepath}\prob + \numocc{G}{\twopathdis}\prob^2 + \numocc{G}{\threedis}\prob^3\label{eq:LS-reduce}\\
&\frac{\rpoly(\prob,\ldots, \prob)}{6\prob^3} - \frac{\numocc{G}{\ed}}{6\prob} - \numocc{G}{\twopath} - \numocc{G}{\twodis}\prob - \numocc{G}{\oneint}\prob - \big(\numocc{G}{\twopathdis} + \numocc{G}{\threedis}\big)\prob^2 = \numocc{G}{\tri} + \numocc{G}{\threepath}\prob - \numocc{G}{\threedis}\left(\prob^2 - \prob^3\right)\label{eq:LS-subtract}
\end{align}
\cref{eq:LS-rearrange} is the result of simply subtracting from both sides terms that have $O(m)$ complexity. Reducing all terms by the common factor of $6\prob^3$ gives \cref{eq:LS-reduce}. The final equation, \cref{eq:LS-subtract}, is the result of subtracting the term $\left(\numocc{G}{\twopathdis} + \numocc{G}{\threedis}\right)\prob^2$ from both sides. Equation \ref{eq:LS-subtract} holds for $\rpoly$ over any graph $G$
In \cref{lem:qE3-exp} is the identity for $\rpoly(\prob,\ldots, \prob)$ when $\poly(\vct{X}) = q_E(X_1,\ldots, X_\numTup)^3$.
As previously outlined, assume graph $\graph{1}$ to be an arbitrary graph, with $\graph{2}, \graph{3}$ constructed from $\graph{1}$ as defined in \cref{def:Gk}.