Rewrote lemmas involving q_E^k.

This commit is contained in:
Aaron Huber 2020-11-30 11:33:02 -05:00
parent 46cff2029a
commit ea5f4ccd05
2 changed files with 99 additions and 52 deletions

View file

View file

@ -136,71 +136,118 @@ A quick argument to why \cref{eq:2m} is true. Note that for edge $(i, j)$ conne
Equation ~\ref{eq:2pd-3d} is true for similar reasons. For edge $(i, j)$, it is necessary to find two additional edges, disjoint or connected. As in ~\cref{eq:2m}, once the number of edges disjoint to $(i, j)$ have been computed, then we only need to consider all possible combinations of two edges from the set of disjoint edges, since it doesn't matter if the two edges are connected or not. Note, the factor $3$ of $\threedis$ is necessary to account for the triple counting of $3$-matchings. It is also the case that, since the two path in $\twopathdis$ is connected, that there will be no double counting by the fact that the summation automatically 'disconnects' the current edge, meaning that a two matching at the current edge will not be counted. The sum over all such edge combinations is precisely then $\numocc{G}{\twopathdis} + 3\numocc{G}{\threedis}$.
Now consider the query $q_E(X_1,\ldots, X_\numvar) = \sum\limits_{(i, j) \in E} X_i \cdot X_j$. For the following discussion, set $\poly_{G}(\vct{X}) = \left(q_E(X_1,\ldots, X_\numvar)\right)^3$.
Now consider the query $\poly_{G}(\vct{X}) = q_E(X_1,\ldots, X_\numvar) = \sum\limits_{(i, j) \in E} X_i \cdot X_j$. For the following discussion, set $\poly_{G}^3(\vct{X}) = \left(q_E(X_1,\ldots, X_\numvar)\right)^3$.
\begin{Lemma}\label{lem:qE3-exp}
When we expand $\poly_{G}(\vct{X}) = \left(q_E(X_1,\ldots, X_\numvar)\right)^3$ out and assign all exponents $e \geq 1$ a value of $1$, we have the following,
\begin{align}
&\rpoly_{G}(\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}
%Original lemma proving the exact coefficient terms in qE3
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%\begin{Lemma}\label{lem:qE3-exp}
%When we expand $\poly_{G}(\vct{X}) = \left(q_E(X_1,\ldots, X_\numvar)\right)^3$ out and assign all exponents $e \geq 1$ a value of $1$, we have the following,
% \begin{align}
% &\rpoly_{G}(\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}
%\end{Lemma}
%
%\begin{proof}[Proof of \cref{lem:qE3-exp}]
%By definition we have that
% \[\poly_{G}(\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.
%
%\textsc{case 1:} $e_1 = e_2 = e_3$, where all edges are the same. There are exactly $\numedge$ such triples, each with a $\prob^2$ factor in $\rpoly_{G}\left(\prob_1,\ldots, \prob_\numvar\right)$.
%
%\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: $\twopath, \twodis$.
%
%\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: $\tri, \oneint, \threepath, \twopathdis, \threedis$.
%\end{proof}
%\qed
\begin{Lemma}\label{lem:alt-qE3-exp}
Given polynomial $\poly_{G}(\prob,\ldots, \prob) = \sum\limits_{i = 0}^6 c_i \cdot \prob^i$ for some fixed terms $\vct{c}$ and seven distinct $\prob$ values, one can compute each $c_i$ in $\vct{c}$ exactly.
\end{Lemma}
\begin{proof}[Proof of \cref{lem:qE3-exp}]
By definition we have that
\[\poly_{G}(\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.
\begin{proof}[Proof of ~\cref{lem:alt-qE3-exp} Alternate Version]
By defintion we know that a polynomial consists of coefficient terms being multiplied to variables. In our case, one can readily expand the cubed expression by performing the necessary $27$ product operations, yielding the polynomial in the sum of products form in the lemma statement. Further, that the number of terms in the sum is no greater than $7$, can be easily justified by the fact that each edge has two endpoints, and the most endpoints occur when we have $3$ distinct edges, with non-intersecting points.
\textsc{case 1:} $e_1 = e_2 = e_3$, where all edges are the same. There are exactly $\numedge$ such triples, each with a $\prob^2$ factor in $\rpoly_{G}\left(\prob_1,\ldots, \prob_\numvar\right)$.
\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: $\twopath, \twodis$.
\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: $\tri, \oneint, \threepath, \twopathdis, \threedis$.
Given that we have at least $7$ distinct values of $\prob$ by the lemma statement, it follows that we then have $7$ linear equations which are distinct. Further, by definition of the summation, these seven equations put together form the Vandermonde matrix, from which it follows that we have a matrix with full rank, and we can solve the linear system to determine $\vct{c}$ exactly.
\end{proof}
\qed
Notice that ~\cref{lem:qE3-exp} is an example of a query that reduces to the hard problems in graph theory of counting triangles, three-matchings, three-paths, etc. Thus, in general, computing $\expct_{\wVec}\pbox{\poly(\wVec)} = \rpoly\left(\prob_1,\ldots, \prob_\numvar\right)$ is a hard problem.
\begin{Claim}\label{claim:four-two}
If one can compute $\rpoly_{G}(\prob,\ldots, \prob)$ in time T(\numedge), then we can compute the following in O(T(\numedge) + \numedge):
\[\numocc{G}{\tri} + \numocc{G}{\threepath} \cdot \prob - \numocc{G}{\threedis}\cdot(3\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(\numedge)$ 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} + 3\numocc{G}{\threedis}$ can be computed in $O(\numedge)$ 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(\numedge)$ time. Rearrange ~\cref{claim:four-one}, $\rpoly_{G}$, with all linear time computations on one side, leaving only the hard computations,
\begin{align}
&\rpoly_{G}(\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\nonumber\\
&\rpoly_{G}(\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_{G}(\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_{G}(\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} + 3\numocc{G}{\threedis}\big)\prob^2 = \numocc{G}{\tri} + \numocc{G}{\threepath}\prob - \numocc{G}{\threedis}\left(3\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(\numedge)$ complexity. Dividing all terms by the common factor of $6\prob^3$ gives \cref{eq:LS-reduce}. Equation ~\ref{eq:LS-subtract}, is the result of subtracting the $O(\numedge)$ computable term $\left(\numocc{G}{\twopathdis} + 3\numocc{G}{\threedis}\right)\prob^2$ from both sides.
%\begin{equation}
%\frac{\rpoly_{G}(\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} + 3\numocc{G}{\threedis}\big)\prob^2 = \numocc{G}{\tri} + \numocc{G}{\threepath}\prob - \numocc{G}{\threedis}\left(3\prob^2 - \prob^3\right)
%\end{equation}
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 $\rpoly_{G}(\vct{X})$ in $T(\numedge)$ time for $O(1)$ distinct values $\vct{\prob}$ such that all $\prob_i = \prob$ for all $i \in [\numvar], \prob_i \in \vct{\prob}$, then we can count the number of triangles, 3-paths, and 3-matchings in $G$ in $T(\numedge) + O(\numedge)$ time.
\begin{Lemma}\label{lem:alt-qE3-exp-3-match}
The number of $3$-matchings in $\poly_{G}(\vct{X})$ is exactly $6\cdot\numocc{G}{\threedis}$.
\end{Lemma}
\begin{proof}[Proof of \cref{lem:gen-p}]
\begin{proof}
A $3$-matching occurs when there are $3$ edges, $e_1, e_2, e_3$, such that all of them are disjoint, i.e., $e_1 \neq e_2 \neq e_3$. In $\poly_{G}(\vct{X})$ there are $3$ choices from the first factor to select an edge of a given three matching. In the second factor, only $2$ choices, and so on, yielding $3! = 6$ terms in the expansion of $\poly_{G}(\vct{X})$ of the arbitrary $3-matching$.
\cref{claim:four-two} says that if we know $\rpoly_{G}(\prob,\ldots, \prob)$, then we can know in O(\numedge) additional time
\[\numocc{G}{\tri} + \numocc{G}{\threepath} \cdot \prob - \numocc{G}{\threedis}\cdot(3\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
Thus, the product $6\cdot\numocc{G}{\threedis}$ is the exact number of $3$-matchings in $\poly_{G}(\vct{X})$.
\end{proof}
\qed
\begin{Corollary}\label{cor:lem-alt-qE3}
One can comute $\numocc{G}{\threedis}$ in $\query_{G}(\vct{X})$ exactly.
\end{Corollary}
\begin{proof}[Proof for Corollary ~\ref{cor:lem-alt-qE3}]
By ~\cref{lem:alt-qE3-exp}, the term $c_6$ can be exactly computed. By ~\cref{lem:alt-qE3-exp-3-match}, we know that $c_6$ can be broken into two factors, and by dividing $c_6$ by the factor $6$, it follows that the resulting value is indeed $\numocc{G}{\threedis}$.
\end{proof}
\qed
\begin{Lemma}\label{lem:alt-qEk}
Given $k$ distinct $\prob$ values and $\poly_{G}^k(\prob,\ldots, \prob)$, one can solve the number of $3$-matchings exactly.
\end{Lemma}
\begin{proof}[Proof for Lemma ~\ref{lem:alt-qEk}]
By the same logic as ~\cref{lem:alt-qE3-exp} it is the case that there are $k$ $\prob^i$ values for $i$ in $[0, k - 1]$. This, combined with $k$ distinct $\prob$ values yields the Vandermonde matrix with full rank, and thus the all values $c_i$ in $\vct{c}$ can be computed exactly. Finally, by ~\cref{lem:alt-qE3-exp-3-match}, dividing by $6$ yields the desired result, $\numocc{G}{\threedis}$.
\end{proof}
\qed
%Notice that ~\cref{lem:qE3-exp} is an example of a query that reduces to the hard problems in graph theory of counting triangles, three-matchings, three-paths, etc. Thus, in general, computing $\expct_{\wVec}\pbox{\poly(\wVec)} = \rpoly\left(\prob_1,\ldots, \prob_\numvar\right)$ is a hard problem.
%
%\begin{Claim}\label{claim:four-two}
% If one can compute $\rpoly_{G}(\prob,\ldots, \prob)$ in time T(\numedge), then we can compute the following in O(T(\numedge) + \numedge):
%\[\numocc{G}{\tri} + \numocc{G}{\threepath} \cdot \prob - \numocc{G}{\threedis}\cdot(3\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(\numedge)$ 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} + 3\numocc{G}{\threedis}$ can be computed in $O(\numedge)$ 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(\numedge)$ time. Rearrange ~\cref{claim:four-one}, $\rpoly_{G}$, with all linear time computations on one side, leaving only the hard computations,
%\begin{align}
%&\rpoly_{G}(\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\nonumber\\
%&\rpoly_{G}(\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_{G}(\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_{G}(\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} + 3\numocc{G}{\threedis}\big)\prob^2 = \numocc{G}{\tri} + \numocc{G}{\threepath}\prob - \numocc{G}{\threedis}\left(3\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(\numedge)$ complexity. Dividing all terms by the common factor of $6\prob^3$ gives \cref{eq:LS-reduce}. Equation ~\ref{eq:LS-subtract}, is the result of subtracting the $O(\numedge)$ computable term $\left(\numocc{G}{\twopathdis} + 3\numocc{G}{\threedis}\right)\prob^2$ from both sides.
%
%%\begin{equation}
%%\frac{\rpoly_{G}(\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} + 3\numocc{G}{\threedis}\big)\prob^2 = \numocc{G}{\tri} + \numocc{G}{\threepath}\prob - \numocc{G}{\threedis}\left(3\prob^2 - \prob^3\right)
%%\end{equation}
%
%
%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 $\rpoly_{G}(\vct{X})$ in $T(\numedge)$ time for $O(1)$ distinct values $\vct{\prob}$ such that all $\prob_i = \prob$ for all $i \in [\numvar], \prob_i \in \vct{\prob}$, then we can count the number of triangles, 3-paths, and 3-matchings in $G$ in $T(\numedge) + O(\numedge)$ time.
%\end{Lemma}
%
%\begin{proof}[Proof of \cref{lem:gen-p}]
%
%\cref{claim:four-two} says that if we know $\rpoly_{G}(\prob,\ldots, \prob)$, then we can know in O(\numedge) additional time
%\[\numocc{G}{\tri} + \numocc{G}{\threepath} \cdot \prob - \numocc{G}{\threedis}\cdot(3\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
\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.}