Incorporated Virginia's 3-path observation into Lem 3.15.

master
Aaron Huber 2021-03-25 11:52:59 -04:00
parent 04108670e0
commit dcb42fe340
6 changed files with 207 additions and 389 deletions

View File

@ -177,14 +177,24 @@ For the sake of contradiction, let us assume we can solve our problem in $f(\kEl
which contradicts \Cref{thm:k-match-hard}.
\subsection{Proofs of~\cref{eq:1e}-\cref{eq:2pd-3d}}
\subsection{Proofs of~\cref{eq:1e}-\cref{eq:3p-3tri}}
\label{app:easy-counts}
\cref{eq:1e},~\cref{eq:2p} and~\cref{eq:3s} are immediate.
The proofs for \cref{eq:1e},~\cref{eq:2p} and~\cref{eq:3s} are immediate.
A quick argument to why \cref{eq:2m} is true. Note that for edge $(i, j)$ connecting arbitrary vertices $i$ and $j$, finding all other edges in $G$ disjoint to $(i, j)$ is equivalent to finding all edges that are not connected to either vertex $i$ or $j$. The number of such edges is $m - d_i - d_j + 1$, where we add $1$ since edge $(i, j)$ is removed twice when subtracting both $d_i$ and $d_j$. Since the summation is iterating over all edges such that a pair $\left((i, j), (k, \ell)\right)$ will also be counted as $\left((k, \ell), (i, j)\right)$, division by $2$ then eliminates this double counting.
\begin{proof}[Proof of \cref{eq:2m}]
For edge $(i, j)$ connecting arbitrary vertices $i$ and $j$, finding all other edges in $G$ disjoint to $(i, j)$ is equivalent to finding all edges that are not connected to either vertex $i$ or $j$. The number of such edges is $m - d_i - d_j + 1$, where we add $1$ since edge $(i, j)$ is removed twice when subtracting both $d_i$ and $d_j$. Since the summation is iterating over all edges such that a pair $\left((i, j), (k, \ell)\right)$ will also be counted as $\left((k, \ell), (i, j)\right)$, division by $2$ then eliminates this double counting.
\qed
\end{proof}
\cref{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 vertex will not be counted. The sum over all such edge combinations is precisely then $\numocc{G}{\twopathdis} + 3\numocc{G}{\threedis}$.
\begin{proof}[Proof of \cref{eq:2pd-3d}]
\Cref{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 vertex will not be counted. The sum over all such edge combinations is precisely then $\numocc{G}{\twopathdis} + 3\numocc{G}{\threedis}$.
\qed
\end{proof}
\begin{proof}[Proof of \cref{eq:3p-3tri}]
To compute $\numocc{G}{\threepath}$, note that for an arbitrary edge $(i, j)$, a 3-path exists for edge pair $(i, \ell)$ and $(j, k)$ where $i, j, k, \ell$ are distinct. (Note that by \cref{def:qk}, $i$ and $j$ are distinct from each other). If all outgoing edges $(i, \ell)$ from $i$ and $(j, k)$ from $j$ fulfill this criteria, then the number of 3-paths is exactly $(d_i - 1) \cdot (d_j - 1)$. However, for the case when $k = \ell$, the resulting subgraph is a triangle. Since \cref{eq:3p-3tri} is summing over all edges, each such triangle will be counted three times, once for each of its edges considered in the summation. Then subtracting $3\numocc{G}{\tri}$ from the summation gives us $\numocc{G}{\threepath}$. \Cref{eq:3p-3tri} then follows by adding $3\numocc{G}{\tri}$ to both sides.
\qed
\end{proof}
\subsection{Proofs for~\Cref{lem:3m-G2}-\Cref{lem:lin-sys}}\label{subsec:proofs-struc-lemmas}
Before proceeding, let us introduce a few more helpful definitions.
@ -192,7 +202,7 @@ Before proceeding, let us introduce a few more helpful definitions.
\begin{Definition}\label{def:ed-nota}
For the set of edges in $\graph{\ell}$ we write $E_\ell$. For any graph $\graph{\ell}$, its edges are denoted by the a pair $(e, b)$, such that $b \in \{0,\ldots, \ell-1\}$ and $e\in E_1$, where $(e,0),\dots,(e,\ell-1)$ is the $\ell$-path that replaces the edge $e$.
\end{Definition}
\color{red}I don't know that I feel comfortable with the notation following. What about $E_S^{(\ell)}$ or something similar? And maybe just $S$ for subgraph rather than $SG$.\color{black}
\begin{Definition}[$\eset{\ell}$]
Given an arbitrary subgraph $S\graph{1}$ of $\graph{1}$, let $\eset{1}$ denote the set of edges in $S\graph{1}$. Define then $\eset{\ell}$ for $\ell > 1$ as the set of edges in the generated subgraph $S\graph{\ell}$ (i.e. when we apply~\Cref{def:Gk} to $\graph{1}=S\graph{1}$.
\end{Definition}
@ -213,7 +223,7 @@ Let $f_\ell: \binom{E_\ell}{3} \mapsto \binom{E_1}{\leq3}$ be defined as follows
The inverse function $f_\ell^{-1}: \binom{E_1}{\leq 3}\mapsto 2^{\binom{E_\ell}{3}}$ takes an arbitrary subset $S\subseteq E_1$ of at most $3$ edges and outputs the set of all subsets of $\binom{\eset{\ell}}{3}$ such that each set $T\in f_\ell^{-1}(S)$ is mapped to the input set $S$ by $f_\ell$, i.e. $f_\ell(T) = S$. %The set returned by $f_\ell^{-1}$ is of size $h$, where $h$ depends on $\abs{s^{(1)}}$, such that $h \leq \binom{\abs{s^{(1)}} \cdot \ell}{3}$.
\end{Definition}
Note, importantly, that when we discuss $f_\ell^{-1}$, that each \textit{edge} present in $S$ must have an edge in $T\in f_\ell^{-1}(S)$ that `projects` down to it. In particular, if $|S| = 3$, then it must be the case that each $T\in f_\ell^{-1}(S)$ si given by $T=\{ (e_i, b), (e_j, b), (e_m, b) \}$ where $i,j$ and $m$ are distinct.
Note, importantly, that when we discuss $f_\ell^{-1}$, that each \textit{edge} present in $S$ must have an edge in $T\in f_\ell^{-1}(S)$ that `projects` down to it. In particular, if $|S| = 3$, then it must be the case that each $T\in f_\ell^{-1}(S)$ consists of the following set of edges: $\{ (e_i, b), (e_j, b), (e_m, b) \}$, where $i,j$ and $m$ are distinct.
We first note that $f_\ell$ is well-defined:
\begin{Lemma}\label{lem:fk-func}
@ -221,24 +231,23 @@ $f_\ell$ is a function.
\end{Lemma}
\subsubsection{Proof of~\cref{lem:fk-func}}\label{subsubsec:proof-fk}%[Proof of Lemma \ref{lem:fk-func}]
Note that $f_\ell$ is properly defined. For any $S \in \binom{E_\ell}{3}$, $|f(S)| \leq 3$, since it has to be the case that any subset of $3$ edges in $E_\ell$ will map to at most three edges in $E_1$. All mappings are in the required range. Then, since for any $b \in \{0,\ldots, \ell-1\}$ the map $(e, b) \mapsto e$ is a function, which %` mapping for which $(e, b)$ maps to no other edge than $e$, and this
implies that $f_\ell$ is a function.
\begin{proof}
Note that $f_\ell$ is properly defined. For any $S \in \binom{E_\ell}{3}$, $|f(S)| \leq 3$, since it has to be the case that any subset of $3$ edges in $E_\ell$ will map to at most three edges in $E_1$. All mappings are in the required range. Then, since for any $b \in \{0,\ldots, \ell-1\}$ the map $(e, b) \mapsto e$ is a function and has exactly one mapping, which %` mapping for which $(e, b)$ maps to no other edge than $e$, and this
implies that $f_\ell$ is a function.\qed
\end{proof}
We are now ready to prove the structural lemmas. Note that $f_\ell$ maps subsets of three edges in $\graph{\ell}$ to a subset of at most three edges in $E_1$. To prove the structural lemmas, we will use the map $f_\ell^{-1}$. In particular, to count the number of occurrences of $\tri,\threepath,\threedis$ in $\graph{\ell}$ we count for each $S\in\binom{E_1}{\le 3}$, how many of $\tri/\threepath/\threedis$ subgraphs appear in $f_\ell^{-1}(S)$.
\subsubsection{Proof of Lemma \ref{lem:3m-G2}}
For each subset $\eset{1}\in \binom{E_1}{\le 3}$, we count the number of $3$-matchings in the $3$-edge subgraphs of $\graph{2}$ in $f_2^{-1}(\eset{1})$. We first consider the case of $\eset{1} \in \binom{E_1}{3}$, where $\eset{1}$ is composed of the edges $e_1, e_2, e_3$ and $f_2^{-1}(\eset{1})$ is the set of all $3$-edge subsets of the set
\begin{equation*}
\{(e_1, 0), (e_1, 1), (e_2, 0), (e_2, 1), (e_3, 0), (e_3, 1)\}.
\end{equation*}
\begin{proof}[Proof of \Cref{lem:3m-G2}]
For each subset $\eset{1}\in \binom{E_1}{\le 3}$, we count the number of $3$-matchings in the $3$-edge subgraphs of $\graph{2}$ in $f_2^{-1}(\eset{1})$. We first consider the case of $\eset{1} \in \binom{E_1}{3}$, where $\eset{1}$ is composed of the edges $e_1, e_2, e_3$ and $f_2^{-1}(\eset{1})$ is the set of all $3$-edge subsets $s \in \{(e_1, 0), (e_1, 1), (e_2, 0), (e_2, 1),$ $(e_3, 0), (e_3, 1)\}$ such that $f_\ell(s) = \{e_1, e_2, e_3\}$.
We do a case analysis based on the `shape' of $\eset{1}$:
\begin{itemize}
\item $3$-matching ($\threedis$)
\end{itemize}
When $\eset{1} \equiv \threedis$, that edges in $\eset{2}$ are {\em not} disjoint only for the pairs $(e_i, 0), (e_i, 1)$ for $i\in \{1,2,3\}$. All choices for $b_1, b_2, b_3 \in \{0, 1\}$, $(e_1, b_1), (e_2, b_2), (e_3, b_3)$ will compose a 3-matching. One can see that we have a total of two possible choicesi for $b_i$ for each edge $e_i$ in $\graph{1}$ yielding $2^3 = 8$ possible 3-matchings in $f_2^{-1}(\eset{1})$.
When $\eset{1} \equiv \threedis$, that edges in $\eset{2}$ are {\em not} disjoint only for the pairs $(e_i, 0), (e_i, 1)$ for $i\in \{1,2,3\}$. All choices for $b_1, b_2, b_3 \in \{0, 1\}$, $(e_1, b_1), (e_2, b_2), (e_3, b_3)$ will compose a 3-matching. One can see that we have a total of two possible choices for $b_i$ for each edge $e_i$ in $\graph{1}$ yielding $2^3 = 8$ possible 3-matchings in $f_2^{-1}(\eset{1})$.
\begin{itemize}
\item Disjoint Two-Path ($\twopathdis$)
@ -247,132 +256,133 @@ For $\eset{1} \equiv \twopathdis$ edges $e_2, e_3$ form a $2$-path with $e_1$ be
\begin{equation*}
\pbrace{(e_2, 0), (e_3, 0)}, \pbrace{(e_2, 0), (e_3, 1)}, \pbrace{(e_2, 1), (e_3, 1)}.
\end{equation*}
Since these two selections can be made independently, there are $2 \cdot 3 = 6$ choices for $3$-matchings in $f_2^{-1}(\eset{1})$.
Since these two selections can be made independently, there are $2 \cdot 3 = 6$ \emph{distinct} $3$-matchings in $f_2^{-1}(\eset{1})$.
\begin{itemize}
\item $3$-star ($\oneint$)
\end{itemize}
When $\eset{1} \equiv \oneint$, the inner edges $(e_i, 1)$ of $\eset{2}$ are all connected, and the outer edges $(e_i, 0)$ are all disjoint. Note that for a valid 3 matching it must be the case that at most one inner edge can be part of the set of disjoint edges. When exactly one inner edge is chosen, there are 3 such possibilities. The remaining possible 3-matching occurs when all 3 outer edges are chosen. Thus, there are $3 + 1 = 4$ many 3-matchings in $f_2^{-1}(\eset{1})$.
When $\eset{1} \equiv \oneint$, the inner edges $(e_i, 1)$ of $\eset{2}$ are all connected, and the outer edges $(e_i, 0)$ are all disjoint. Note that for a valid 3 matching it must be the case that at most one inner edge can be part of the set of disjoint edges. When exactly one inner edge is chosen, there are 3 such possibilities. The remaining possible 3-matching occurs when all 3 outer edges are chosen. Thus, there are four 3-matchings in $f_2^{-1}(\eset{1})$.
\begin{itemize}
\item $3$-path ($\threepath$)
\end{itemize}
When $\eset{1} \equiv\threepath$ it is the case that all edges beginning with $e_1$ and ending with $e_3$ are successively connected. This means that the edges of $\eset{2}$ form a $6$-path in the edges of $f_2^{-1}(\eset{1})$, where all edges from $(e_1, 0),\ldots,(e_3, 1)$ are successively connected. For a $3$-matching to exist in $f_2^{-1}(\eset{1})$, we cannot pick both $(e_i,0)$ and $(e_i,1)$. % there must be at least one edge separating edges picked from a sequence.
There are four such possibilities: $\pbrace{(e_1, 0), (e_2, 0), (e_3, 0)}$, $\pbrace{(e_1, 0), (e_2, 0), (e_3, 1)}$, $\pbrace{(e_1, 0), (e_2, 1), (e_3, 1)},$ $\pbrace{(e_1, 1), (e_2, 1), (e_3, 1)}$ . Thus, there are four possible 3-matchings in $f_2^{-1}(\eset{1})$.
There are four such possibilities: $\pbrace{(e_1, 0), (e_2, 0), (e_3, 0)}$, $\pbrace{(e_1, 0), (e_2, 0), (e_3, 1)}$, $\pbrace{(e_1, 0), (e_2, 1), (e_3, 1)},$ $\pbrace{(e_1, 1), (e_2, 1), (e_3, 1)}$, a total of four 3-matchings in $f_2^{-1}(\eset{1})$.
\begin{itemize}
\item Triangle ($\tri$)
\end{itemize}
For $\eset{1} \equiv \tri$, note that it is the case that the edges in $\eset{2}$ are connected in a successive manner, but this time in a cycle, such that $(e_1, 0)$ and $(e_3, 1)$ are also connected. While this is similar to the discussion of the three path above, the first and last edges are not disjoint, since they are connected. This rules out both subsets of $(e_1, 0), (e_2, 0), (e_3, 1)$ and $(e_1, 0), (e_2, 1), (e_3, 1)$ leaving us with $2$ remaining edge combinations that produce a 3 matching.
For $\eset{1} \equiv \tri$, note that it is the case that the edges in $\eset{2}$ are connected in a successive manner, but this time in a cycle, such that $(e_1, 0)$ and $(e_3, 1)$ are also connected. While this is similar to the discussion of the three path above, the first and last edges are not disjoint, since they are connected. This rules out both subsets of $(e_1, 0), (e_2, 0), (e_3, 1)$ and $(e_1, 0), (e_2, 1), (e_3, 1)$, yielding two 3-matchings.
Let us now consider when $S \in \binom{E_1}{\leq 2}$, i.e. patterns among
\begin{itemize}
\item $2$-matching ($\twodis$), $2$-path ($\twopath$), $1$ edge ($\ed$)
\end{itemize}
When $|\eset{1}| = 2$, we can only pick one from each of two pairs, $\pbrace{(e_1, 0), (e_1, 1)}$ and $\pbrace{(e_2, 0), (e_2, 1)}$. This implies that a $3$-matching cannot exist in $f_2^{-1}(\eset{1})$. The same argument holds for $|\eset{1}| = 1$, where we can only pick one edge from the pair $\pbrace{(e_1, 0), (e_1, 1)}$, thus no $3$-matching exists in $f_2^{-1}(\eset{1})$.
When $|\eset{1}| = 2$, we can only pick one from each of two pairs, $\pbrace{(e_1, 0), (e_1, 1)}$ and $\pbrace{(e_2, 0), (e_2, 1)}$. This implies that a $3$-matching cannot exist in $f_2^{-1}(\eset{1})$. The same argument holds for $|\eset{1}| = 1$, where we can only pick one edge from the pair $\pbrace{(e_1, 0), (e_1, 1)}$. Trivially, no $3$-matching exists in $f_2^{-1}(\eset{1})$.
Observe that all of the arguments above focused solely on the shape/pattern of $S$. In other words, all $S$ of a given shape yield the same number of $3$-matchings in $f_2^{-1}(\eset{1})$, and this is why we get the required identity using the above case analysis.
\end{proof}
\subsubsection{Proof of~\cref{lem:3m-G3}}
For any $\eset{1} \in \binom{E_1}{\leq3}$, we again then count the number of $3$-matchings in $f_3^{-1}(\eset{1})$ via a case analysis:
\begin{itemize}
\item $1$ edge ($\ed$)
\end{itemize}
When $\eset{1} \equiv \ed$, $f_3^{-1}(\eset{1})$ has one subset, $(e_1, 0), (e_1, 1), (e_1, 2)$, which clearly does not contain a $3$-matching. Thus there are no $3$-matchings in $f_3^{-1}(\eset{1})$ for this case.
\begin{itemize}
\item $2$-path ($\twopath$)
\end{itemize}
When $\eset{1} \equiv \twopath$ and now we have all edges in $\eset{3}$ form a $6$-path, and similar to the discussion in the proof of \cref{lem:3m-G2} (when $\eset{1} \equiv \threepath$ in $\graph{2}$), this leads to four $3$-matchings in $f_3^{-1}(\eset{1})$.
\begin{itemize}
\item $2$-matching ($\twodis$)
\end{itemize}
For $\eset{1} \equiv \twodis$, all edges of $\eset{3}$ are predicated on the fact that $(e_i, b)$ is disjoint with $(e_j, b)$ for $i \neq j\in \{1,2\}$ and $b \in \{0, 1, 2\}$. Pick an aribitrary $e_i$ and note, that $(e_i, 0), (e_i, 2)$ is a $2$-matching, which can combine with any of the $3$ edges in $(e_j, 0), (e_j, 1), (e_j, 2)$ again for $i \neq j$. Since the selections are independent, it follows that there exist $2 \cdot 3 = 6$ many $3$-matchings in $f_3^{-1}(\eset{1})$.
Now, we consider the 3-edge subgraphs of $\graph{1}$, starting with $\eset{1} = \tri$.
\begin{itemize}
\item Triangle ($\tri$)
\end{itemize}
As discussed in proof of \cref{lem:3m-G2} for the case of $\tri$, the edges of $\eset{3}$ are a cyclic sequence, and we must be careful not to pair $(e_1, 0)$ with $(e_3, 2)$ in a $3$-matching. For any $T \in f_3^{-1}(\eset{1})$, $T$ is a $3$-matching when we have that for the edges $(e_1, b_1), (e_2, b_2), (e_3, b_3)$ where $b_1, b_2, b_3 \in \{0, 1, 2\}$, such that, for all $i \in [3]$ it is the case that if $b_i = 2$ then $b_{i \mod{3} + 1} \neq 0$. Iterating through all possible choices for $e_1$, we have
\begin{itemize}
\item For \textsc{$(e_1, 0)$}, there are five possibilities:
\begin{itemize}
\item $\pbrace{(e_1, 0), (e_2, 0), (e_3, 0)}$
\item $\pbrace{(e_1, 0), (e_2, 0), (e_3, 1)}$
\item $\pbrace{(e_1, 0), (e_2, 1), (e_3, 0)}$
\item $\pbrace{(e_1, 0), (e_2, 1), (e_3, 1)}$
\item $\pbrace{(e_1, 0), (e_2, 2), (e_3, 1)}$
\end{itemize}
\item For \textsc{$(e_1, 1)$}, there are eight possibilities:
\begin{itemize}
\item $\pbrace{(e_1, 1), (e_2, 0), (e_3, 0)}, \ldots\pbrace{(e_1, 1), (e_2, 1), (e_3, 2)}$
\item $\pbrace{(e_1, 1), (e_2, 2), (e_3, 1)}$
\item $\pbrace{(e_1, 1), (e_2, 2), (e_3, 2)}$
\end{itemize}
\item For \textsc{$(e_1, 2)$}, there are five possibilities:
\begin{itemize}
\item $\pbrace{(e_1, 2), (e_2, 1), (e_3, 0)}$
\item $\pbrace{(e_1, 2), (e_2, 1), (e_3, 1)}$
\item $\pbrace{(e_1, 2), (e_2, 1), (e_3, 2)}$
\item $\pbrace{(e_1, 2), (e_2, 2), (e_3, 1)}$
\item $\pbrace{(e_1, 2), (e_2, 2), (e_3, 2)}$
\end{itemize}
\end{itemize}
for a total of 18 many 3-matchings in $f_3^{-1}(\eset{1})$.
\begin{itemize}
\item $3$-path ($\threepath$)
\end{itemize}
When $\eset{1} \equiv \threepath$ and all edges in $\eset{3}$ are successively connected to form a $9$-path. Since $(e_1, 0)$ is disjoint to $(e_3, 2)$, both of these edges can exist in a $3$-matching. This relaxation yields 3 other 3-matchings that couldn't be counted in the case of the $\eset{1} = \tri$, namely
\begin{equation*}
\pbrace{(e_1, 0), (e_2, 0), (e_3, 2)},\pbrace{(e_1, 0), (e_2, 1), (e_3, 2)}, \pbrace{(e_1, 0), (e_2, 2), (e_3, 2)}.
\end{equation*}
There are therefore $18 + 3 = 21$ $3$-matchings in $f_3^{-1}(\eset{1})$.
\begin{itemize}
\item Disjoint Two-Path ($\twopathdis$)
\end{itemize}
Assume $\eset{1} = \twopathdis$, then the edges of $\eset{3}$ have successive connectivity from $(e_1, 0)$ through $(e_1, 2)$, and successive connectivity from $(e_2, 0)$ through $(e_3, 2)$. It is the case that the edges in $\eset{3}$ form a 6-path with a disjoint 3-path. There exist $8$ distinct two matchings (with at least one $(e_2,\cdot)$ and at least one $(e_3,\cdot)$ edge) in the $6$-path $(e_2, 0),\ldots, (e_3, 2)$ of the form
\begin{equation*}
\pbrace{(e_2, 0), (e_3, 0)},\ldots, \pbrace{(e_2, 1), (e_3, 2)}, \pbrace{(e_2, 2), (e_3, 1)}, \pbrace{(e_2, 2), (e_3, 2)}.
\end{equation*}
These matchings can be paired independently with either of the $3$ remaining edges of $(e_1, b)$, for a total of $8 \cdot 3 = 24$ many 3-matchings in $f_3^{-1}(\eset{1})$.
\begin{itemize}
\item $3$-star ($\oneint$)
\end{itemize}
When $\eset{1} \equiv \oneint$, the edges of $\eset{3}$ are restricted such that the outer edges $(e_i, 0)$ are disjoint from another, the middle edges $(e_i, 1)$ are also disjoint to each other, and only the inner edges $(e_i, 2)$ intersect with one another at exactly one common endpoint. To be precise, any outer edge $(e_i, 0)$ is disjoint to every middle edge $(e_j, 1)$ for $i \neq j$. As previously mentioned in the proof of \cref{lem:3m-G2}, at most one inner edge may appear in a $3$-matching. For arbitrary inner edge $(e_i, 2)$, we have $4$ combinations of the middle and outer edges of $e_j, e_m$, where $i \neq j \neq m$. These choices are independent and we have $4 \cdot 3 = 12$ many 3-matchings. We are not done yet, as we need to consider the middle and outer edge combinations. Notice that for each $e_i$, we have $2$ choices, i.e. a middle or outer edge, contributing $2^3 = 8$ additional $3$-matchings, for a total of $8 + 12 = 20$ many $3$-matchings in $f_3^{-1}(\eset{1})$.
\begin{itemize}
\item $3$-matching ($\threedis$)
\end{itemize}
When $\eset{1} \equiv \threedis$ subgraph, we have the case that all edges in $\eset{3}$ have the property that $(e_i, b_i)$ is disjoint to $(e_j, b_j)$ for $i \neq j$. For each $e_i$, there are then $3$ choices, independent of each other, and it results that there are $3^3 = 27$ many 3-matchings in $f_3^{-1}(\eset{1})$.
All of the observations above focused only on the shape of $\eset{1}$, and since we see that for fixed $\eset{1}$, we have a fixed number of $3$-matchings, this implies the identity.
\subsubsection{Proof of~\cref{lem:3p-G2}}
For $\mathcal{P} \in f_2^{-1}\inparen{ \eset{2}}$ such that $\mathcal{P} $ is a $3$-path, it \textit{must} be the case by definition of $f_2$ that (i)eall edges in $f_2(\mathcal{P} )$ have at least one mapping from an edge in $\mathcal{P} $ and recall that (ii) $\mathcal{P} $ is connected. These constraint rules out every pattern $\eset{1}$ consisting of $3$ edges (it can be verified that in each three-edge pattern at least one of (i) or (ii) is violated), as well as when $\eset{1} = \twodis$. For $\eset{1} = \ed$, note that $\eset{1}$ doesn't have enough edges to have any output in $f_2^{-1}(\eset{1})$, i.e., there exists no $\eset{1} \in \binom{E_2}{3}$ such that $f_2(\mathcal{P} ) = \eset{1}$. The only surviving pattern is $\eset{1} \equiv \twopath$, where the edges of $\eset{2}$ have successive connectivity from $(e_1, 0)$ to $(e_2, 1)$. There are then two $3$-paths sharing edges $e_1$ and $e_2$ in $f_2^{-1}(\eset{1}), \pbrace{(e_1, 0), (e_1, 1), (e_2, 0)} \text{ and }\{(e_1, 1)$,$ (e_2, 0), (e_2, 1)\}$.
All of the observations above focused only on the shape of $\eset{1}$, and since we see that for fixed $\eset{1}$, we have a fixed number of $3$-paths, this implies the identity.
\subsubsection{Proof of~\cref{lem:3p-G3}}
The argument follows along the same lines as in the proof of \cref{lem:3p-G2}. Given $\mathcal{P} \in f_3^{-1}\inparen{\eset{1}}$, it \textit{must} be that every edge in $f_3(\mathcal{P})$ has at least one edge in $\mathcal{P}$ mapped to it (and $\mathcal{P}$ is connected). Notice again that this cannot be the case for any $\eset{1} \in \binom{E_1}{3}$, nor is it the case when $\eset{1} = \twodis$. This leaves us with two patterns, $\eset{1} = \twopath$ and $\eset{1} = \ed$. For the former, it is the case that we have two $3$-paths across $e_1$ and $e_2$, $\pbrace{(e_1, 1), (e_1, 2), (e_2, 0)}$ and $\pbrace{(e_1, 2), (e_2, 0), (e_2, 1)}$. For the latter pattern $\ed$, it it trivial to see that an edge in $\graph{1}$ becomes a $3$-path in $\graph{3}$, and this proves the identity.
All of the observations above focused only on the shape of $\eset{1}$, and since we see that for fixed $\eset{1}$, we have a fixed number of $3$-paths, this implies the identity.
%
%\subsubsection{Proof of~\cref{lem:3m-G3}}
%
%For any $\eset{1} \in \binom{E_1}{\leq3}$, we again then count the number of $3$-matchings in $f_3^{-1}(\eset{1})$ via a case analysis:
%
%
%
%\begin{itemize}
% \item $1$ edge ($\ed$)
%\end{itemize}
%When $\eset{1} \equiv \ed$, $f_3^{-1}(\eset{1})$ has one subset, $(e_1, 0), (e_1, 1), (e_1, 2)$, which clearly does not contain a $3$-matching.
%\begin{itemize}
% \item $2$-path ($\twopath$)
%\end{itemize}
%When $\eset{1} \equiv \twopath$ and now we have all edges in $\eset{3}$ form a $6$-path, and similar to the discussion in the proof of \cref{lem:3m-G2} (when $\eset{1} \equiv \threepath$ in $\graph{2}$), this leads to four $3$-matchings in $f_3^{-1}(\eset{1})$.
%
%\begin{itemize}
% \item $2$-matching ($\twodis$)
%\end{itemize}
%For $\eset{1} \equiv \twodis$, all edges of $\eset{3}$ are predicated on the fact that $(e_i, b)$ is disjoint with $(e_j, b)$ for $i \neq j\in \{1,2\}$ and $b \in \{0, 1, 2\}$. Pick an aribitrary $e_i$ and note, that $(e_i, 0), (e_i, 2)$ is a $2$-matching, which can combine with any of the $3$ edges in $(e_j, 0), (e_j, 1), (e_j, 2)$ again for $i \neq j$. Since the selections are independent, it follows that there exist $2 \cdot 3 = 6$ $3$-matchings in $f_3^{-1}(\eset{1})$.
%
%Now, we consider the 3-edge subgraphs of $\graph{1}$, starting with $\eset{1} = \tri$.
%\begin{itemize}
% \item Triangle ($\tri$)
%\end{itemize}
%As discussed in proof of \cref{lem:3m-G2} for the case of $\tri$, the edges of $\eset{3}$ are a cyclic sequence, and we must be careful not to pair $(e_1, 0)$ with $(e_3, 2)$ in a $3$-matching. For any $T \in f_3^{-1}(\eset{1})$, $T$ is a $3$-matching when we have that for the edges $(e_1, b_1), (e_2, b_2), (e_3, b_3)$ where $b_1, b_2, b_3 \in \{0, 1, 2\}$, such that, for all $i \in [3]$ it is the case that if $b_i = 2$ then $b_{i \mod{3} + 1} \neq 0$. Iterating through all possible choices for $e_1$, we have
%\begin{itemize}
% \item For \textsc{$(e_1, 0)$}, there are five possibilities:
% \begin{itemize}
% \item $\pbrace{(e_1, 0), (e_2, 0), (e_3, 0)}$
% \item $\pbrace{(e_1, 0), (e_2, 0), (e_3, 1)}$
% \item $\pbrace{(e_1, 0), (e_2, 1), (e_3, 0)}$
% \item $\pbrace{(e_1, 0), (e_2, 1), (e_3, 1)}$
% \item $\pbrace{(e_1, 0), (e_2, 2), (e_3, 1)}$
% \end{itemize}
% \item For \textsc{$(e_1, 1)$}, there are eight possibilities:
% \begin{itemize}
% \item $\pbrace{(e_1, 1), (e_2, 0), (e_3, 0)}, \ldots\pbrace{(e_1, 1), (e_2, 1), (e_3, 2)}$
% \item $\pbrace{(e_1, 1), (e_2, 2), (e_3, 1)}$
% \item $\pbrace{(e_1, 1), (e_2, 2), (e_3, 2)}$
% \end{itemize}
% \item For \textsc{$(e_1, 2)$}, there are five possibilities:
% \begin{itemize}
% \item $\pbrace{(e_1, 2), (e_2, 1), (e_3, 0)}$
% \item $\pbrace{(e_1, 2), (e_2, 1), (e_3, 1)}$
% \item $\pbrace{(e_1, 2), (e_2, 1), (e_3, 2)}$
% \item $\pbrace{(e_1, 2), (e_2, 2), (e_3, 1)}$
% \item $\pbrace{(e_1, 2), (e_2, 2), (e_3, 2)}$
% \end{itemize}
%\end{itemize}
%for a total of $18$ $3$-matchings in $f_3^{-1}(\eset{1})$.
%
%\begin{itemize}
% \item $3$-path ($\threepath$)
%\end{itemize}
%When $\eset{1} \equiv \threepath$ and all edges in $\eset{3}$ are successively connected to form a $9$-path. Since $(e_1, 0)$ is disjoint to $(e_3, 2)$, both of these edges can exist in a $3$-matching. This relaxation yields 3 other 3-matchings that couldn't be counted in the case of the $\eset{1} = \tri$, namely
%\begin{equation*}
%\pbrace{(e_1, 0), (e_2, 0), (e_3, 2)},\pbrace{(e_1, 0), (e_2, 1), (e_3, 2)}, \pbrace{(e_1, 0), (e_2, 2), (e_3, 2)}.
%\end{equation*}
%There are therefore $18 + 3 = 21$ $3$-matchings in $f_3^{-1}(\eset{1})$.
%
%\begin{itemize}
% \item Disjoint Two-Path ($\twopathdis$)
%\end{itemize}
%Assume $\eset{1} = \twopathdis$, then the edges of $\eset{3}$ have successive connectivity from $(e_1, 0)$ through $(e_1, 2)$, and successive connectivity from $(e_2, 0)$ through $(e_3, 2)$. It is the case that the edges in $\eset{3}$ form a 6-path with a disjoint 3-path. There exist $8$ distinct two matchings (with at least one $(e_2,\cdot)$ and at least one $(e_3,\cdot)$ edge) in the $6$-path $(e_2, 0),\ldots, (e_3, 2)$ of the form
%\begin{equation*}
%\pbrace{(e_2, 0), (e_3, 0)},\ldots, \pbrace{(e_2, 1), (e_3, 2)}, \pbrace{(e_2, 2), (e_3, 1)}, \pbrace{(e_2, 2), (e_3, 2)}.
%\end{equation*}
%These matchings can be paired independently with either of the $3$ remaining edges of $(e_1, b)$, for a total of $8 \cdot 3 = 24$ many 3-matchings in $f_3^{-1}(\eset{1})$.
%
%\begin{itemize}
% \item $3$-star ($\oneint$)
%\end{itemize}
%When $\eset{1} \equiv \oneint$, the edges of $\eset{3}$ are restricted such that the outer edges $(e_i, 0)$ are disjoint from another, the middle edges $(e_i, 1)$ are also disjoint to each other, and only the inner edges $(e_i, 2)$ intersect with one another at exactly one common endpoint. To be precise, any outer edge $(e_i, 0)$ is disjoint to every middle edge $(e_j, 1)$ for $i \neq j$. As previously mentioned in the proof of \cref{lem:3m-G2}, at most one inner edge may appear in a $3$-matching. For arbitrary inner edge $(e_i, 2)$, we have $4$ combinations of the middle and outer edges of $e_j, e_m$, where $i \neq j \neq m$. These choices are independent and we have $4 \cdot 3 = 12$ many 3-matchings. We are not done yet, as we need to consider the middle and outer edge combinations. Notice that for each $e_i$, we have $2$ choices, i.e. a middle or outer edge, contributing $2^3 = 8$ additional $3$-matchings, for a total of $8 + 12 = 20$ many $3$-matchings in $f_3^{-1}(\eset{1})$.
%
%\begin{itemize}
% \item $3$-matching ($\threedis$)
%\end{itemize}
%When $\eset{1} \equiv \threedis$ subgraph, we have the case that all edges in $\eset{3}$ have the property that $(e_i, b_i)$ is disjoint to $(e_j, b_j)$ for $i \neq j$. For each $e_i$, there are then $3$ choices, independent of each other, and it results that there are $3^3 = 27$ many 3-matchings in $f_3^{-1}(\eset{1})$.
%
%All of the observations above focused only on the shape of $\eset{1}$, and since we see that for fixed $\eset{1}$, we have a fixed number of $3$-matchings, this implies the identity.
%
%\subsubsection{Proof of~\cref{lem:3p-G2}}
%
%For $\mathcal{P} \in f_2^{-1}\inparen{ \eset{2}}$ such that $\mathcal{P} $ is a $3$-path, it \textit{must} be the case by definition of $f_2$ that (i)eall edges in $f_2(\mathcal{P} )$ have at least one mapping from an edge in $\mathcal{P} $ and recall that (ii) $\mathcal{P} $ is connected. These constraint rules out every pattern $\eset{1}$ consisting of $3$ edges (it can be verified that in each three-edge pattern at least one of (i) or (ii) is violated), as well as when $\eset{1} = \twodis$. For $\eset{1} = \ed$, note that $\eset{1}$ doesn't have enough edges to have any output in $f_2^{-1}(\eset{1})$, i.e., there exists no $\eset{1} \in \binom{E_2}{3}$ such that $f_2(\mathcal{P} ) = \eset{1}$. The only surviving pattern is $\eset{1} \equiv \twopath$, where the edges of $\eset{2}$ have successive connectivity from $(e_1, 0)$ to $(e_2, 1)$. There are then two $3$-paths sharing edges $e_1$ and $e_2$ in $f_2^{-1}(\eset{1}), \pbrace{(e_1, 0), (e_1, 1), (e_2, 0)} \text{ and }\{(e_1, 1)$,$ (e_2, 0), (e_2, 1)\}$.
%
%All of the observations above focused only on the shape of $\eset{1}$, and since we see that for fixed $\eset{1}$, we have a fixed number of $3$-paths, this implies the identity.
%
%
%\subsubsection{Proof of~\cref{lem:3p-G3}}
%The argument follows along the same lines as in the proof of \cref{lem:3p-G2}. Given $\mathcal{P} \in f_3^{-1}\inparen{\eset{1}}$, it \textit{must} be that every edge in $f_3(\mathcal{P})$ has at least one edge in $\mathcal{P}$ mapped to it (and $\mathcal{P}$ is connected). Notice again that this cannot be the case for any $\eset{1} \in \binom{E_1}{3}$, nor is it the case when $\eset{1} = \twodis$. This leaves us with two patterns, $\eset{1} = \twopath$ and $\eset{1} = \ed$. For the former, it is the case that we have two $3$-paths across $e_1$ and $e_2$, $\pbrace{(e_1, 1), (e_1, 2), (e_2, 0)}$ and $\pbrace{(e_1, 2), (e_2, 0), (e_2, 1)}$. For the latter pattern $\ed$, it it trivial to see that an edge in $\graph{1}$ becomes a $3$-path in $\graph{3}$, and this proves the identity.
%
%All of the observations above focused only on the shape of $\eset{1}$, and since we see that for fixed $\eset{1}$, we have a fixed number of $3$-paths, this implies the identity.
\subsubsection{Proof of~\cref{lem:tri}}
\begin{proof}[Proof of \Cref{lem:tri}]
The number of triangles in $\graph{\ell}$ for $\ell \geq 2$ will always be $0$ for the simple fact that all cycles in $\graph{\ell}$ will have at least six edges.
\end{proof}
\input{lin_sys}

View File

@ -1,249 +1,65 @@
%root: main.tex
\subsubsection{Proof of~\cref{lem:lin-sys}}
\subsubsection{Proof of \Cref{lem:lin-sys}}
Note that our goal is to compute $\vct{b}[i]$ for $i\in [3]$ in $O(m)$such that
\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}
\label{eq:lin-eq-1}
&\numocc{G}{\tri} +\numocc{G}{\threepath}\cdot p - \numocc{G}{\threedis}\cdot (3p^2-p^3) =\vct{b}[1]\\
\label{eq:lin-eq-2}
&-2\numocc{G}{\tri}\cdot (3p^2-p^3) -4\numocc{G}{\threepath}\cdot (3p^2-p^3) \nonumber\\
&+ 10\cdot \numocc{G}{\threedis}\cdot (3p^2-p^3) =\vct{b}[2]\\
\label{eq:lin-eq-3}
&-18\numocc{G}{\tri}\cdot (3p^2-p^3) -21\numocc{G}{\threepath}\cdot (3p^2-p^3) \nonumber\\
&+45 \numocc{G}{\threedis}\cdot (3p^2-p^3) =\vct{b}[3]
\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.
%Our goal is to build a linear system $M \cdot (x~y~z)^T = \vct{b}$, such that, assuming an indexing starting at $1$, each $i^{th}$ row in $M$ corresponds to the RHS of ~\cref{eq:LS-subtract} for $\graph{i}$ \textit{in} terms of $\graph{1}$. The vector $\vct{b}$ analogously has the terms computable in $O(\numedge)$ time for each $\graph{i}$ at its corresponing $i^{th}$ entry for the LHS of ~\cref{eq:LS-subtract}. Lemma ~\ref{lem:qE3-exp} gives the identity for $\rpoly_{G}(\prob,\ldots, \prob)$ when $\poly_{G}(\vct{X}) = q_E(X_1,\ldots, X_\numvar)^3$, and using
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}.
Towards that end, we first state the values in $\vct{b}$ (where $\graph{1}=G$ while $\graph{2}$ and $\graph{3}$ follow from~\cref{def:Gk}):
\begin{align*}
&\vct{b}[1] = \frac{\rpoly_{\graph{1}}^3(\prob,\ldots, \prob)}{6\prob^3} - \frac{\numocc{\graph{\graph{1}}}{\ed}}{6\prob} - \numocc{\graph{1}}{\twopath} - \numocc{\graph{1}}{\twodis}\prob \nonumber\\
&- \numocc{\graph{1}}{\oneint}\prob - \big(\numocc{\graph{1}}{\twopathdis} + 3\numocc{\graph{1}}{\threedis}\big)\prob^2
\end{align*}
\begin{align*}
&\vct{b}[2] = \frac{\rpoly^3_{\graph{2}}(\prob,\ldots, \prob)}{6\prob^3} - \frac{\numocc{\graph{2}}{\ed}}{6\prob} - \numocc{\graph{2}}{\twopath} - \numocc{\graph{2}}{\twodis}\prob \nonumber\\
&- \numocc{\graph{2}}{\oneint}\prob- \left(\numocc{\graph{2}}{\twopathdis} + 3\numocc{\graph{2}}{\threedis}\right)\prob^2 \\
&- 2\cdot \numocc{\graph{1}}{\twopath}\prob+ \left(4\cdot\numocc{\graph{1}}{\oneint}+ 6\cdot\left(\numocc{\graph{1}}{\twopathdis}\right.\right.\nonumber\\
&\left.\left. + 3\cdot\numocc{\graph{1}}{\threedis}\right)\right)\left(3\prob^2 - \prob^3\right).
\end{align*}
\begin{align*}
&\vct{b}[3] = \frac{\rpoly^3_{\graph{3}}(\prob,\ldots, \prob)}{6\prob^3} - \frac{\numocc{\graph{3}}{\ed}}{6\prob} - \numocc{\graph{3}}{\twopath} - \numocc{\graph{3}}{\twodis}\prob \nonumber\\
& - \numocc{\graph{3}}{\oneint}\prob - \big(\numocc{\graph{3}}{\twopathdis} + 3\numocc{\graph{3}}{\threedis}\big)\prob^2\\
& - \pbrace{\numocc{\graph{1}}{\ed} + 2 \cdot \numocc{\graph{1}}{\twopath}}\prob + \left\{24 \cdot \left(\numocc{\graph{1}}{\twopathdis} \right. \right.\nonumber\\
&\left.\left.+ 3\numocc{\graph{1}}{\threedis}\right) + 20 \cdot \numocc{\graph{1}}{\oneint} + 4\cdot \numocc{\graph{1}}{\twopath}\right.\\
&\left.+ 6 \cdot \numocc{\graph{1}}{\twodis}\right\}\cdot\left(3\prob^2 - \prob^3\right)
\end{align*}
Further, note that by~\cref{eq:1e} to~\cref{eq:2pd-3d} (and the fact that each of those quantities can be computed in $O(m)$ time) means that $\vct{b}$ can be computed in $O(m)$ time as needed. We first verify that all of~\cref{eq:lin-eq-1} to~\cref{eq:lin-eq-3} indeed hold.
Note that~\cref{eq:lin-eq-1} follows from~\cref{lem:qE3-exp} and the definition of $\vct{b}$. Next, we derive~\cref{eq:lin-eq-2} and~\cref{eq:lin-eq-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}.
\paragraph*{Derivation of~\cref{eq:lin-eq-2}}
%Let us call the linear equation for graph $\graph{2}$ $\linsys{2}$. Using the hard to compute terms of the RHS in ~\cref{lem:qE3-exp}, let us consider the RHS,
Consider the following relations:
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}
& \numocc{\graph{2}}{\tri} + \numocc{\graph{2}}{\threepath}\prob - \numocc{\graph{2}}{\threedis}\left(3\prob^2 - \prob^3\right)\nonumber\\
= &\numocc{\graph{2}}{\threepath}\prob - \numocc{\graph{2}}{\threedis}\left(3\prob^2 - \prob^3\right)\label{eq:ls-2-1}\\
= &2 \cdot \numocc{\graph{1}}{\twopath}\prob - \left(8 \cdot \numocc{\graph{1}}{\threedis} + 6 \cdot \numocc{\graph{1}}{\twopathdis} \right.\nonumber\\
&\left.+ 4 \cdot \numocc{\graph{1}}{\oneint} + 4 \cdot \numocc{\graph{1}}{\threepath} + 2 \cdot \numocc{\graph{1}}{\tri}\right)\left(3\prob^2 - \prob^3\right)\label{eq:ls-2-2}\\
= &\left(-2\cdot\numocc{\graph{1}}{\tri} - 4\cdot\numocc{\graph{1}}{\threepath} - 8\cdot\numocc{\graph{1}}{\threedis}\right.\nonumber\\
&\left.- 6\cdot\numocc{\graph{1}}{\twopathdis}\right)\cdot\left(3\prob^2 - p^3\right) + 2\cdot\numocc{\graph{1}}{\twopath}\prob\nonumber \\
&- 4\cdot\numocc{\graph{1}}{\oneint}\cdot\left(3\prob^2 - \prob^3\right).\label{eq:ls-2-3}
\end{align}
%define $\linsys{2} = \numocc{\graph{2}}{\tri} + \numocc{\graph{2}}{\threepath}\prob - \numocc{\graph{2}}{\threedis}\left(3\prob^2 - \prob^3\right)$. By \cref{claim:four-two} we can compute $\linsys{2}$ in $O(T(\numedge) + \numedge)$ time with $\numedge = |E_2|$, and more generally, $\numedge = |E_k|$ for a graph $\graph{k}$.
In the above,~\cref{eq:ls-2-1} follows by \cref{lem:tri}. Similarly ~\cref{eq:ls-2-2} follows by both \cref{lem:3m-G2} and \cref{lem:3p-G2}. Finally, ~\cref{eq:ls-2-3} follows by a simple rearrangement of terms.
Now, rearranging the terms in the identity of~\cref{lem:qE3-exp} and recalling $\prob\ne 0$ we deduce the following identities:
\begin{align}
&\frac{\rpoly^3_{\graph{2}}(\prob,\ldots, \prob)}{6\prob^3} - \frac{\numocc{\graph{2}}{\ed}}{6\prob} - \numocc{\graph{2}}{\twopath} - \numocc{\graph{2}}{\twodis}\prob \nonumber\\
&- \numocc{\graph{2}}{\oneint}\prob - \big(\numocc{\graph{2}}{\twopathdis} + 3\numocc{\graph{2}}{\threedis}\big)\prob^2 \nonumber\\
&=\left(-2\cdot\numocc{\graph{1}}{\tri} - 4\cdot\numocc{\graph{1}}{\threepath}\right.\nonumber\\
&\left. - 8\cdot\numocc{\graph{1}}{\threedis} - 6\cdot\numocc{\graph{1}}{\twopathdis}\right)\cdot\left(3\prob^2 - p^3\right) + 2\cdot\numocc{\graph{1}}{\twopath}\prob\nonumber\\
&- 4\cdot\numocc{\graph{1}}{\oneint}\cdot\left(3\prob^2 - \prob^3\right)\label{eq:lem3-G2-1}\\
&\frac{\rpoly^3_{\graph{2}}(\prob,\ldots, \prob)}{6\prob^3} - \frac{\numocc{\graph{2}}{\ed}}{6\prob} - \numocc{\graph{2}}{\twopath} - \numocc{\graph{2}}{\twodis}\prob \nonumber\\
&- \numocc{\graph{2}}{\oneint}\prob- \big(\numocc{\graph{2}}{\twopathdis} + 3\numocc{\graph{2}}{\threedis}\big)\prob^2 \nonumber\\
&- 2\cdot\numocc{\graph{1}}{\twopath}\prob+ 4\cdot\numocc{\graph{1}}{\oneint}\left(3\prob^2 - \prob^3\right)\nonumber\\
&=\left(-2\cdot\numocc{\graph{1}}{\tri} - 4\cdot\numocc{\graph{1}}{\threepath} - 8\cdot\numocc{\graph{1}}{\threedis}\right. \nonumber\\
&\left.- 6\cdot\numocc{\graph{1}}{\twopathdis}\right)\cdot\left(3\prob^2 - p^3\right)\label{eq:lem3-G2-2}\\
&\frac{\rpoly^3_{\graph{2}}(\prob,\ldots, \prob)}{6\prob^3} - \frac{\numocc{\graph{2}}{\ed}}{6\prob} - \numocc{\graph{2}}{\twopath} - \numocc{\graph{2}}{\twodis}\prob\nonumber\\
&- \numocc{\graph{2}}{\oneint}\prob - \big(\numocc{\graph{2}}{\twopathdis} + 3\numocc{\graph{2}}{\threedis}\big)\prob^2\nonumber\\
&- 2\cdot\numocc{\graph{1}}{\twopath}\prob + \left(4\cdot\numocc{\graph{1}}{\oneint}+ 6\cdot\left(\numocc{\graph{1}}{\twopathdis}\right.\right. \nonumber\\
&\left.\left.+ 3\cdot\numocc{\graph{1}}{\threedis}\right)\right)\left(3\prob^2 - \prob^3\right)\nonumber\\
&=\left(-2\cdot\numocc{\graph{1}}{\tri} - 4\cdot\numocc{\graph{1}}{\threepath} + 10\cdot\numocc{\graph{1}}{\threedis}\right)\cdot\left(3\prob^2 - \prob^3\right)\label{eq:lem3-G2-3}
\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.
In the above,~\cref{eq:lem3-G2-1} follows by substituting ~\cref{eq:ls-2-3} in the RHS. We then arrive with ~\cref{eq:lem3-G2-2} by adding the inverse of the last 3 terms of ~\cref{eq:ls-2-3} to both sides. Finally, we arrive at ~\cref{eq:lem3-G2-3} by adding term $6\left(\cdot\numocc{\graph{1}}{\twopathdis} + 3\cdot\numocc{\graph{1}}{\threedis}\right)$ to both sides.
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.
Note that the LHS of~\cref{eq:lem3-G2-3} is $\vct{b}[2]$ and that~\cref{eq:lem3-G2-3} is the same as~\cref{eq:lin-eq-2}.
%Denote the matrix of the linear system as $\mtrix{\rpoly_{G}}$, where $\mtrix{\rpoly_{G}}[i]$ is the $i^{\text{th}}$ row of $\mtrix{\rpoly_{G}}$. From ~\cref{eq:lem3-G2-3} it follows that $\mtrix{\rpoly_{\graph{2}}}[2] = $
%\begin{equation*}
%\left(-2 \cdot \numocc{\graph{1}}{\tri} - 4 \cdot \numocc{\graph{1}}{\threepath} + 10 \cdot \numocc{\graph{1}}{\threedis}\right)\cdot \left(3\prob^2 - \prob^3\right)
%\end{equation*}
%and
To show that $\vct{M}$ indeed has full rank, we will show that $\dtrm{\vct{M}}\ne 0$ for every $\prob\in (0,1)$.
%By \cref{lem:tri}, the first term of $\linsys{2}$ is $0$, and then $\linsys{2} = \numocc{\graph{2}}{\threepath}\prob - \numocc{\graph{2}}{\threedis}\left(3\prob^2 - \prob^3\right)$.
%
%Replace the next term with the identity of \cref{lem:3p-G2} and the last term with the identity of \cref{lem:3m-G2},
%\begin{equation*}
%\linsys{2} = 2 \cdot \numocc{\graph{1}}{\twopath}\prob - \pbrace{8 \cdot \numocc{\graph{1}}{\threedis} + 6 \cdot \numocc{\graph{1}}{\twopathdis} + 4 \cdot \numocc{\graph{1}}{\oneint} + 4 \cdot \numocc{\graph{1}}{\threepath} + 2 \cdot \numocc{\graph{1}}{\tri}}\left(3\prob^2 - \prob^3\right).
%\end{equation*}
%Rearrange terms into groups of those patterns that are 'hard' to compute and those that can be computed in $O(\numedge)$,
%\begin{equation*}
%\linsys{2} = -\pbrace{2 \cdot \numocc{\graph{1}}{\tri} + 4 \cdot \numocc{\graph{1}}{\threepath} + \left(8 \cdot \numocc{\graph{1}}{\threedis} + 6 \cdot \numocc{\graph{1}}{\twopathdis}\right)}\left(3\prob^2 - \prob^3\right) + \pbrace{2 \cdot \numocc{\graph{1}}{\twopath}\prob - 4 \cdot \numocc{\graph{1}}{\oneint}\left(3\prob^2 - \prob^3\right)}.
%\end{equation*}
%
%Note that there are terms computable in $O(\numedge)$ time which can be subtracted from $\linsys{2}$ and added to the other side of \cref{eq:LS-subtract}, i.e., $\vct{b}[2]$. This leaves us with
%\begin{align}
%&\linsys{2} = \left(-2 \cdot \numocc{\graph{1}}{\tri} - 4 \cdot \numocc{\graph{1}}{\threepath} - 2 \cdot \numocc{\graph{1}}{\threedis} - 4\cdot \numocc{\graph{1}}{\twopathdis}\right) \cdot \left(3\prob^2 - \prob^3\right)\label{eq:LS-G2'}\\
%&\linsys{2} = \left(-2 \cdot \numocc{\graph{1}}{\tri} - 4 \cdot \numocc{\graph{1}}{\threepath} - 2 \cdot \numocc{\graph{1}}{\threedis} + 12 \cdot \numocc{\graph{1}}{\threedis}\right)\cdot \left(3\prob^2 - \prob^3\right)\label{eq:LS-G2'-1}\\
%&\linsys{2} = \left(-2 \cdot \numocc{\graph{1}}{\tri} - 4 \cdot \numocc{\graph{1}}{\threepath} + 10 \cdot \numocc{\graph{1}}{\threedis}\right)\cdot \left(3\prob^2 - \prob^3\right)\label{eq:LS-G2'-2}
%\end{align}
%
%Equation ~\ref{eq:LS-G2'} is the result of collecting $2\cdot\left(\numocc{\graph{1}}{\twopathdis} + 3\numocc{\graph{1}}{\threedis}\right)$ and moving them to the other side. Then ~\cref{eq:LS-G2'-1} results from adding $4\cdot\left(\numocc{\graph{1}}{\twopathdis} + 3\numocc{\graph{1}}{\threedis}\right)$ to both sides. Equation ~\ref{eq:LS-G2'-2} is the result of simplifying terms.
%
%For the left hand side, following the above steps, we obtain
%We now have a linear equation in terms of $\graph{1}$ for $\graph{2}$. Note that by ~\cref{eq:2pd-3d}, it is the case that any term of the form $x \cdot \left(\numocc{\graph{i}}{\twopathdis}\right.$ + $\left.3\cdot \numocc{\graph{i}}{\threedis}\right)$ is computable in linear time. By ~\cref{eq:1e}, ~\cref{eq:2p}, ~\cref{eq:2m}, and ~\cref{eq:3s} the same is true for $\numocc{\graph{i}}{\ed}$, $\numocc{\graph{i}}{\twopath}$, $\numocc{\graph{i}}{\twodis}$, and $\numocc{\graph{i}}{\oneint}$ respectively.
\paragraph*{Derivation of~\cref{eq:lin-eq-3}}
%Following the same reasoning for $\graph{3}$,
Using \cref{lem:3m-G3}, \cref{lem:3p-G3}, and \cref{lem:tri}, we derive % starting with the RHS of ~\cref{eq:LS-subtract}, we derive
\begin{align}
&\numocc{\graph{3}}{\tri} + \numocc{\graph{3}}{\threepath}\prob - \numocc{\graph{3}}{\threedis}\left(3\prob^2 - \prob^3\right)\nonumber\\
=& \pbrace{\numocc{\graph{1}}{\ed} + 2 \cdot \numocc{\graph{1}}{\twopath}}\prob - \left\{4 \cdot \numocc{\graph{1}}{\twopath} + 6 \cdot \numocc{\graph{1}}{\twodis}\right.\nonumber\\
&\left.+ 18 \cdot \numocc{\graph{1}}{\tri} + 21 \cdot \numocc{\graph{1}}{\threepath} + 24 \cdot \numocc{\graph{1}}{\twopathdis} +\right.\nonumber\\
&\left.20 \cdot \numocc{\graph{1}}{\oneint} + 27 \cdot \numocc{\graph{1}}{\threedis}\right\}\left(3\prob^2 - \prob^3\right)\label{eq:LS-G3-sub}\\
=&\left\{ -18\numocc{\graph{1}}{\tri} - 21 \cdot \numocc{\graph{1}}{\threepath} - 24 \cdot \numocc{\graph{1}}{\twopathdis}\right. \nonumber\\
&\qquad\left.- 27 \cdot \numocc{\graph{1}}{\threedis}\right\}\left(3\prob^2 - \prob^3\right) \nonumber\\
&+ \pbrace{-20 \cdot \numocc{\graph{1}}{\oneint} - 4\cdot \numocc{\graph{1}}{\twopath} - 6 \cdot \numocc{\graph{1}}{\twodis}}\left(3\prob^2 - \prob^3\right)\nonumber\\
&+ \numocc{\graph{1}}{\ed}\prob + 2 \cdot \numocc{\graph{1}}{\twopath}\prob. \label{eq:lem3-G3-1}
\end{align}
By the identity in~\cref{lem:qE3-exp} (along with the fact that $\prob\ne 0$), we get:
\begin{align}
&\frac{\rpoly_{\graph{3}}(\prob,\ldots, \prob)}{6\prob^3} - \frac{\numocc{\graph{3}}{\ed}}{6\prob} - \numocc{\graph{3}}{\twopath} - \numocc{\graph{3}}{\twodis}\prob \nonumber\\
& - \numocc{\graph{3}}{\oneint}\prob - \big(\numocc{\graph{3}}{\twopathdis} + 3\numocc{\graph{3}}{\threedis}\big)\prob^2\nonumber\\
&= \left\{ -18\numocc{\graph{1}}{\tri} - 21 \cdot \numocc{\graph{1}}{\threepath} - 24 \cdot \numocc{\graph{1}}{\twopathdis}\right. \nonumber\\
&\left.- 27 \cdot \numocc{\graph{1}}{\threedis}\right\}\left(3\prob^2 - \prob^3\right) \nonumber\\
&+ \pbrace{-20 \cdot \numocc{\graph{1}}{\oneint} - 4\cdot \numocc{\graph{1}}{\twopath} - 6 \cdot \numocc{\graph{1}}{\twodis}}\left(3\prob^2 - \prob^3\right)\nonumber\\
&+ \numocc{\graph{1}}{\ed}\prob + 2 \cdot \numocc{\graph{1}}{\twopath}\prob. \label{eq:lem3-G3-2}\\
&\frac{\rpoly_{\graph{3}}(\prob,\ldots, \prob)}{6\prob^3} - \frac{\numocc{\graph{3}}{\ed}}{6\prob} - \numocc{\graph{3}}{\twopath} - \numocc{\graph{3}}{\twodis}\prob \nonumber\\
&- \numocc{\graph{3}}{\oneint}\prob - \big(\numocc{\graph{3}}{\twopathdis} + 3\numocc{\graph{3}}{\threedis}\big)\prob^2 - \left(\numocc{\graph{1}}{\ed}\right.\nonumber\\
&\left.+ \numocc{\graph{1}}{\twopath}\right)\prob+ \left(24\left(\numocc{\graph{1}}{\twopathdis} + 3\cdot\numocc{\graph{1}}{\threedis}\right) \right.\nonumber\\
&\left.+ 20\cdot\numocc{\graph{1}}{\oneint} + 4\cdot\numocc{\graph{1}}{\twopath}+ 6\cdot\numocc{\graph{1}}{\twodis}\right)\left(3\prob^2 - \prob^3\right)\nonumber\\
&= \pbrace{- 18 \cdot \numocc{\graph{1}}{\tri} - 21 \cdot \numocc{\graph{1}}{\threepath} + 45 \cdot \numocc{\graph{1}}{\threedis}}\nonumber\\
&\cdot\left(3p^2 - p^3\right)\label{eq:lem3-G3-3}
\end{align}
%Equation ~\ref{eq:lem3-G3-2} follows from substituting ~\cref{eq:lem3-G3-2} in for the RHS of ~\cref{eq:LS-subtract}.
In the above,~\cref{eq:lem3-G3-3} follows by moving terms and adding the term $24\cdot\left(\numocc{\graph{1}}{\twopathdis} + \numocc{\graph{1}}{\threedis}\right)$ to both sides.
Note that the LHS of~\cref{eq:lem3-G3-3} is $\vct{b}[3]$ and that~\cref{eq:lem3-G3-3} is indeed~\cref{eq:lin-eq-3}.
%Equation \ref{eq:LS-G3-sub} follows from simple substitution of all lemma identities in ~\cref{lem:3m-G3}, ~\cref{lem:3p-G3}, and ~\cref{lem:tri}. We then get \cref{eq:LS-G3-rearrange} by simply rearranging the operands.
%It then follows that
%Removing $O(\numedge)$ computable terms to the other side of \cref{eq:LS-subtract}, we get
%\begin{align}
%&\mtrix{\rpoly_{G}}[3] = \pbrace{- 18 \cdot \numocc{\graph{1}}{\tri} - 21 \cdot \numocc{\graph{1}}{\threepath} + 45 \cdot \numocc{\graph{1}}{\threedis}}\nonumber\\
%&\cdot\left(3p^2 - p^3\right)\label{eq:LS-G3'}
%\end{align}
%and
%The same justification for the derivation of $\linsys{2}$ applies to the derivation above of $\linsys{3}$. To arrive at ~\cref{eq:LS-G3'}, we move $O(\numedge)$ computable terms to the left hand side. For the term $-24\cdot\numocc{\graph{1}}{\twopathdis}$ we need to add the inverse to both sides AND $72\cdot\numocc{\graph{1}}{\threedis}$ to both sides, in order to satisfy the constraint of $\cref{eq:2pd-3d}$.
%
%For the LHS we get
\paragraph*{Wrapping it up.}
%We now have a linear system consisting of three linear combinations, for $\graph{1}, \graph{2}, \graph{3}$ in terms of $\graph{1}$. Note that the constants for $\graph{1}$ follow the RHS of ~\cref{eq:LS-subtract}. To make it easier,
For notational convenience, define $x = \numocc{\graph{1}}{\tri}$, $y = \numocc{\graph{1}}{\threepath}, z = \numocc{\graph{1}}{\threedis}$.
% Using $\linsys{2}$ and $\linsys{3}$, the following matrix is obtained,
If we denote
\[ \mtrix{\rpoly} = \begin{pmatrix}
1 & \prob & -(3\prob^2 - \prob^3)\\
-2(3\prob^2 - \prob^3) & -4(3\prob^2 - \prob^3) & 10(3\prob^2 - \prob^3)\\
-18(3\prob^2 - \prob^3) & -21(3\prob^2 - \prob^3) & 45(3\prob^2 - \prob^3)
\end{pmatrix},\]
then~\cref{eq:lin-eq-1} to~\cref{eq:lin-eq-3} implies that
%and the following linear equation
\begin{equation}
\mtrix{\rpoly}\cdot (x~ y~ z~)^T = \vct{b}(\graph{1}),
\end{equation}
which proves the first part of the lemma.
%\AR{
%Also the top right entry should be $-(p^2-p^3)$-- the negative sign is missing. This changes the rest of the calculations and has to be propagated. If my calculations are correct the final polynomial should be $-30p^2(1-p)^2(1-p-p^2+p^3)$. This still has no root in $(0,1)$}
%\AH{While propagating changes in ~\cref{eq:2pd-3d}, I noticed and corrected some errors, most notably, that for pulling out the \textbf{$a^2$} factor as described next, I hadn't squared it. That has been addressed. 110220}
Note that if $\mtrix{\rpoly}$ has full rank then one can compute $x,y,z$ in $O(1)$ using Gaussian elimination.
%Now we seek to show that all rows of the system are indeed independent.
%
%The method of minors can be used to compute the determinant,
To show that $\mtrix{\rpoly}$ indeed has full rank, we will show that $\dtrm{\mtrix{\rpoly}}\ne 0$ for every $\prob\in (0,1)$. Towards that end, we will show that $\dtrm{\mtrix{\rpoly}}$ as a polynomial in $\prob$ does not have any root in $(0,1)$.
We also make use of the fact that for a matrix with entries $ab, ac, ad,$ and $ae$, the determinant is $a^2be - a^2cd = a^2\cdot\begin{vmatrix} b&c \\d &e\end{vmatrix}$. We have $\dtrm{\mtrix{\rpoly}}$ is
\begin{align*}
&\begin{vmatrix}
1 & \prob & -(3\prob^2 - \prob^3)\\
-2(3\prob^2 - \prob^3) & -4(3\prob^2 - \prob^3) & 10(3\prob^2 - \prob^3)\\
-18(3\prob^2 - \prob^3) & -21(3\prob^2 - \prob^3) & 45(3\prob^2 - \prob^3)
1 &-(3\prob^2 - \prob^3)\\
10(3\prob^2 - \prob^3) &10(3\prob^2 - \prob^3)
\end{vmatrix}
= \\
&(3\prob^2 - \prob^3)^2 \cdot
\begin{vmatrix}
-4 & 10\\
-21 & 45
\end{vmatrix}
- \prob(3\prob^2 - \prob^3)^2~ \cdot
\begin{vmatrix}
-2 & 10\\
-18 & 45
\end{vmatrix}\\
&+ \left(- ~(3\prob^2 - \prob^3)^3\right)~ \cdot
\begin{vmatrix}
-2 & -4\\
-18 & -21
\end{vmatrix}.
\end{align*}
Compute each RHS term starting with the left and working to the right,
\begin{align}
&(3\prob^2 - \prob^3)^2\cdot \left((-4 \cdot 45) - (-21 \cdot 10)\right) = (3\prob^2 - \prob^3)^2\cdot(-180 + 210)\nonumber\\
&= 30(3\prob^2 - \prob^3)^2.\label{eq:det-1}
\end{align}
The middle term then is
\begin{align}
&-\prob(3\prob^2 - \prob^3)^2 \cdot \left((-2 \cdot 45) - (-18 \cdot 10)\right) \nonumber\\
&= -\prob(3\prob^2 - \prob^3)^2 \cdot (-90 + 180) = -90\prob(3\prob^2 - \prob^3)^2.\label{eq:det-2}
\end{align}
Finally, the rightmost term,
\begin{align}
&-\left(3\prob^2 - \prob^3\right)^3 \cdot \left((-2 \cdot -21) - (-18 \cdot -4)\right) \nonumber\\
&= -\left(3\prob^2 - \prob^3\right)^3 \cdot (42 - 72) = 30\left(3\prob^2 - \prob^3\right)^3.\label{eq:det-3}
= (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}
Putting \cref{eq:det-1}, \cref{eq:det-2}, \cref{eq:det-3} together, we have,
\begin{align}
&\dtrm{\mtrix{\rpoly}} = 30(3\prob^2 - \prob^3)^2 - 90\prob(3\prob^2 - \prob^3)^2 +30(3\prob^2 - \prob^3)^3\nonumber\\
&= 30(3\prob^2 - \prob^3)^2\left(1 - 3\prob + (3\prob^2 - \prob^3)\right) \nonumber\\
&= 30\prob^4\left(3 - \prob\right)^2\left(-\prob^3 + 3\prob^2 - 3\prob + 1\right)\nonumber\\
&= 30\prob^4\left(3 - \prob\right)^2\left(1 - \prob\right)^3.\label{eq:det-final}
\end{align}
From ~\cref{eq:det-final} it can easily be seen that the roots of $\dtrm{\mtrix{\rpoly}}$ are $0, 1,$ and $3$. Hence there are no roots in $(0, 1)$ and ~\cref{lem:lin-sys} follows.
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

View File

@ -1 +1 @@
\contitem\title{Standard Operating Procedure in Bag PDBs Queries Considered Harmful}\author{Su Feng, Boris Glavic, Aaron Huber, Oliver Kennedy, and Atri Rudra}\page{23:1--23:50}
\contitem\title{Standard Operating Procedure in Bag PDBs Queries Considered Harmful}\author{Su Feng, Boris Glavic, Aaron Huber, Oliver Kennedy, and Atri Rudra}\page{23:1--23:45}

View File

@ -45,16 +45,16 @@ Consider the polynomial
\[\poly_{G}(\vct{X}) = \sum\limits_{(i, j) \in E} X_i \cdot X_j\]
The hard polynomial for our problem will be a suitable power $k\ge 3$ of the polynomial above, i.e.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{Definition}
\begin{Definition}\label{def:qk}
For any graph $G=([n],E)$ and $\kElem\ge 1$, define
\[\poly_{G}^\kElem(X_1,\dots,X_n) = \left(\sum\limits_{(i, j) \in E} X_i \cdot X_j\right)^\kElem\]
\end{Definition}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Our hardness results only need a \ti instance; We also consider the special case when all the tuple probabilities (probabilities assigned by to $X_i$ by $\probAllTup$) are the same value. Note that this polynomial can be encoded in an expression tree of size $\Theta(km)$.
Following on Example~\ref{ex:intro}, it is easy to see that $\poly_{G}^\kElem(\vct{X})$ is the query polynomial corresponding to the query:
\[\poly^k_G:- R(A_1),E(A_1,B_1),R(B_1),\dots,R(A_\kElem),E(A_\kElem,B_\kElem),R(B_\kElem)\]
where generalizaing the PDB instance in Example~\ref{ex:intro}, relation $R$ has $n$ tuples corresponding to each vertex in $V=[n]$ each with probability $\prob$ and $E(A,B)$ has tuples corresponding to the edges in $E$ (each with probability of $1$).\footnote{Technically, $\poly_{G}^\kElem(\vct{X})$ should have variables corresponding to tuples in $E$ as well, but since they always are present with probability $1$, we drop those. Our argument also works when all the tuples in $E$ also are present with probability $\prob$ but to simplify notation we assign probability $1$ to edges.}
Using the tables in \cref{fig:ex-shipping}, it is easy to see that $\poly_{G}^\kElem(\vct{X})$ can be constructed as follows:
\[\poly^k_G:- Loc(C_1),Route(C_1, C_1'),Loc(C_1'),\dots,Loc(C_\kElem),Route(C_\kElem,C_\kElem'),Loc(C_\kElem')\]
where generalizaing the PDB instance in \cref{fig:ex-shipping}, relation $Loc$ has $n$ tuples corresponding to each vertex in $V=[n]$ each with probability $\prob$ and $Route(\text{City}_1, \text{City}_2)$ has tuples corresponding to the edges $E$ (each with probability of $1$).\footnote{Technically, $\poly_{G}^\kElem(\vct{X})$ should have variables corresponding to tuples in $Route$ as well, but since they always are present with probability $1$, we drop those. Our argument also works when all the tuples in $Route$ also are present with probability $\prob$ but to simplify notation we assign probability $1$ to edges.}
Note that this imples that our hard query polynomial can be created from a project-join query -- by contrast our approximation algorithm in \Cref{sec:algo} can handle lineage polynomials generated by union of select-project-join (SPJU) queries. % (i.e. we do not need union or select operator to derive our hardness result).

View File

@ -4,23 +4,23 @@
\section{Background and Notation}\label{sec:background}
\subsection{Prelim: Superlinearity of Bag PDBs}\label{sec:suplin-bags}
Moving forward, we focus exclusively on bags. Consider the relations of \cref{fig:ex-shipping}, without the $\Phi_{set}$ attribute.
Consider the following product query, which can be thought of the set of all edge pairs.
Moving forward, we focus exclusively on bags. The bag relations of \cref{fig:ex-shipping} are the same relations without consideration of the $\Phi_{set}$ attribute.
Consider the following product query, which can be thought of the set of all route pairs.
\begin{equation*}
\poly_E():= Loc(\text{City}), Route(\text{City}_1, \text{City}_2), Loc(\text{City}'), Loc(\text{City}''), Route(\text{City}_1', \text{City}_2'), Loc(\text{City}''')
\poly^2_E():- Loc(\text{City}), Route(\text{City}_1, \text{City}_2), Loc(\text{City}'), Loc(\text{City}''), Route(\text{City}_1', \text{City}_2'), Loc(\text{City}''')
\end{equation*}
%For an arbitrary polynomial, it is known that there may exist equivalent compressed representations.
%One such compression is the factorized polynomial~\cite{factorized-db}, where the polynomial is broken up into separate factors.
%For example:
Consider the factorized representation of $\poly_E$:
\begin{equation*}
\poly_E = \left(L_aL_b + L_bL_d + L_bL_c\right) \cdot \left(L_aL_b + L_bL_d + L_bL_c\right)
\poly^2_E = \left(L_aL_b + L_bL_d + L_bL_c\right) \cdot \left(L_aL_b + L_bL_d + L_bL_c\right)
\end{equation*}
This equivalent SOP representation is
\begin{equation*}
L_a^2L_b^2 + L_b^2L_d^2 + L_b^2L_c^2 + 2L_aL_b^2L_d + 2L_aL_b^2L_c + 2L_b^2L_dL_c.
\end{equation*}
The expectation $\expct\pbox{\poly^2(W_a, W_b, W_c)}$ then is:
The expectation $\expct\pbox{\poly^2_E()}$ then is:
\begin{footnotesize}
\begin{equation*}
\expct\pbox{L_a^2}\expct\pbox{L_b^2} + \expct\pbox{L_b^2}\expct\pbox{L_d^2} + \expct\pbox{L_b^2}\expct\pbox{L_c^2} + 2\expct\pbox{L_a}\expct\pbox{L_b^2}\expct\pbox{L_d} + 2\expct\pbox{L_a}\expct\pbox{L_b^2}\expct\pbox{L_c} + 2\expct\pbox{L_b^2}\expct\pbox{L_d}\expct\pbox{L_c}
@ -33,12 +33,12 @@ This property leads us to consider a structure related to $\poly$.
\begin{Definition}\label{def:reduced-poly}
For any polynomial $\poly(\vct{X})$, define the \emph{reduced polynomial} $\rpoly(\vct{X})$ to be the polynomial obtained by setting all exponents $e > 1$ in $\poly(\vct{X})$ to $1$.
\end{Definition}
With $\poly_E$ as an example, we have:
With $\poly^2_E$ as an example, we have:
\begin{align*}
\rpoly^2(L_a, L_b, L_c, L_d)
\rpoly^2_E(L_a, L_b, L_c, L_d)
=&\; L_aL_b + L_bL_d + L_bW_c + 2L_aL_bL_d + 2L_aL_bL_c + 2L_bL_cL_d
\end{align*}
It can be verified that the reduced polynomial is a closed form of the expected count (i.e., $\expct\pbox{\poly_E} = \rpoly_E(\probOf\pbox{L_a=1}, \probOf\pbox{L_b=1}, \probOf\pbox{L_c=1}), \probOf\pbox{L_d=1})$).
It can be verified that the reduced polynomial is a closed form of the expected count (i.e., $\expct\pbox{\poly^2_E} = \rpoly_E(\probOf\pbox{L_a=1}, \probOf\pbox{L_b=1}, \probOf\pbox{L_c=1}), \probOf\pbox{L_d=1})$).
The reduced form of a lineage polynomial can be obtained but requires a linear scan over the clauses of an SOP encoding of the polynomial. Note that for a compressed representation, this scheme would require an exponential number of computations in the size of the compressed representation. In \Cref{sec:hard}, we use $\rpoly$ to prove our hardness results .
%In prior work on lineage-based Bag-PDBs~\cite{kennedy:2010:icde:pip,DBLP:conf/vldb/AgrawalBSHNSW06,yang:2015:pvldb:lenses} where this encoding is implicitly assumed, computing the expected count is linear in the size of the encoding.

View File

@ -63,16 +63,10 @@ For any graph $G$, the following formulas for $\numocc{G}{H}$ compute their resp
&\numocc{G}{\twopath} = \sum_{i \in V} \binom{d_i}{2} \label{eq:2p}\\
&\numocc{G}{\twodis} = \sum_{(i, j) \in E} \frac{\numedge - d_i - d_j + 1}{2}\label{eq:2m}\\%\binom{\numedge - d_i - d_j + 1}{2}\label{eq:2m}\\
&\numocc{G}{\oneint} = \sum_{i \in V} \binom{d_i}{3}\label{eq:3s}\\
&\numocc{G}{\twopathdis} + 3\numocc{G}{\threedis} = \sum_{(i, j) \in E} \binom{\numedge - d_i - d_j + 1}{2}\label{eq:2pd-3d}
&\numocc{G}{\twopathdis} + 3\numocc{G}{\threedis} = \sum_{(i, j) \in E} \binom{\numedge - d_i - d_j + 1}{2}\label{eq:2pd-3d}\\
&\numocc{G}{\threepath} + 3\numocc{G}{\tri} = \sum_{(i, j) \in E} (d_i - 1) \cdot (d_j - 1)\label{eq:3p-3tri}
\end{align}
%A quick argument to why \Cref{eq:2m} is true. Note that for edge $(i, j)$ connecting arbitrary vertices $i$ and $j$, finding all other edges in $G$ disjoint to $(i, j)$ is equivalent to finding all edges that are not connected to either vertex $i$ or $j$. The number of such edges is $m - d_i - d_j + 1$, where we add $1$ since edge $(i, j)$ is removed twice when subtracting both $d_i$ and $d_j$. Since the summation is iterating over all edges such that a pair $\left((i, j), (k, \ell)\right)$ will also be counted as $\left((k, \ell), (i, j)\right)$, division by $2$ then eliminates this double counting.
%\Cref{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 vertex will not be counted. The sum over all such edge combinations is precisely then $\numocc{G}{\twopathdis} + 3\numocc{G}{\threedis}$.
%Original lemma proving the exact coefficient terms in qE3
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsubsection{The proofs}
@ -101,7 +95,7 @@ We compute $\rpoly_{G}^3(\vct{X})$ by considering each of the three forms that t
This implies that all $3 + 3 = 6$ combinations of two distinct edges $e$ and $e'$ contribute to the same monomial in $\rpoly_{G}^3$. % 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)$.
Since $e\ne e'$, this case produces the following edge patterns: $\twopath, \twodis$, which contribute $6\prob^3$ and $6\prob^4$ respectively to $\rpoly_{G}^3\left(\prob,\ldots, \prob\right)$.
\textsc{case 3:} All $e_1,e_2$ and $e_3$ are distinct. For this case, we have $3! = 6$ permutations of $(e_1, e_2, e_3)$, each of which contribute to a different monomial in the SMP representation of $\poly_{G}^3(\vct{X})$. This case consists of the following edge patterns: $\tri, \oneint, \threepath, \twopathdis, \threedis$, which contribute $6\prob^3, 6\prob^4, 6\prob^4, 6\prob^5$ and $6\prob^6$ respectively to $\rpoly_{G}^3\left(\prob,\ldots, \prob\right)$.
\textsc{case 3:} All $e_1,e_2$ and $e_3$ are distinct. For this case, we have $3! = 6$ permutations of $(e_1, e_2, e_3)$, each of which contribute to a different monomial in the \smbOf representation of $\poly_{G}^3(\vct{X})$. This case consists of the following edge patterns: $\tri, \oneint, \threepath, \twopathdis, \threedis$, which contribute $6\prob^3, 6\prob^4, 6\prob^4, 6\prob^5$ and $6\prob^6$ respectively to $\rpoly_{G}^3\left(\prob,\ldots, \prob\right)$.
\end{proof}
\qed
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@ -109,7 +103,7 @@ Since $e\ne e'$, this case produces the following edge patterns: $\twopath, \two
Since $\prob$ is fixed, \Cref{lem:qE3-exp} gives us one linear equation in $\numocc{G}{\tri},$ $\numocc{G}{\threepath}$ and $\numocc{G}{\threedis}$ (we can handle the other counts due to \Cref{eq:1e}-\Cref{eq:2pd-3d}). However, we need to generate two more independent linear equations in these three variables. Towards, this end we generate more graphs that are related to $G$:
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{Definition}\label{def:Gk}
For $\ell > 1$, let graph $\graph{\ell}$ be a graph generated from an arbitrary graph $\graph{1}$, by replacing every edge $e$ of $\graph{1}$ with a $\ell$-path, such that all $\ell$-path replacement edges are disjoint. % in the sense that they only intersect at the original intersection endpoints as seen in $\graph{1}$.
For $\ell > 1$, let graph $\graph{\ell}$ be a graph generated from an arbitrary graph $\graph{1}$, by replacing every edge $e$ of $\graph{1}$ with a $\ell$-path, such that all inner vertexes of an $\ell$-path replacement edge are disjoint from the inner vertexes of any other $\ell$-path replacement edge. % in the sense that they only intersect at the original intersection endpoints as seen in $\graph{1}$.
\end{Definition}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@ -126,29 +120,29 @@ The $3$-matchings in graph $\graph{2}$ satisfy the identity:
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{Lemma}\label{lem:3m-G3}
The 3-matchings in $\graph{3}$ satisfy the identity:
\begin{align*}
\numocc{\graph{3}}{\threedis} &= 4\numocc{\graph{1}}{\twopath} + 6\numocc{\graph{1}}{\twodis} + 18\numocc{\graph{1}}{\tri}\\
&+ 21\numocc{\graph{1}}{\threepath}+ 24\numocc{\graph{1}}{\twopathdis} + 20\numocc{\graph{1}}{\oneint}\\
&+ 27\numocc{\graph{1}}{\threedis}.
\end{align*}
\end{Lemma}
%\begin{Lemma}\label{lem:3m-G3}
%The 3-matchings in $\graph{3}$ satisfy the identity:
%\begin{align*}
%\numocc{\graph{3}}{\threedis} &= 4\numocc{\graph{1}}{\twopath} + 6\numocc{\graph{1}}{\twodis} + 18\numocc{\graph{1}}{\tri}\\
%&+ 21\numocc{\graph{1}}{\threepath}+ 24\numocc{\graph{1}}{\twopathdis} + 20\numocc{\graph{1}}{\oneint}\\
%&+ 27\numocc{\graph{1}}{\threedis}.
%\end{align*}
%
%\end{Lemma}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{Lemma}\label{lem:3p-G2}
The $3$-paths in $\graph{2}$ satisfy the identity:
\[\numocc{\graph{2}}{\threepath} = 2 \cdot \numocc{\graph{1}}{\twopath}.\]
\end{Lemma}
%\begin{Lemma}\label{lem:3p-G2}
%The $3$-paths in $\graph{2}$ satisfy the identity:
%\[\numocc{\graph{2}}{\threepath} = 2 \cdot \numocc{\graph{1}}{\twopath}.\]
%\end{Lemma}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{Lemma}\label{lem:3p-G3}
The $3$-paths in $\graph{3}$ satisfy the identity:
\[\numocc{\graph{3}}{\threepath} = \numocc{\graph{1}}{\ed} + 2 \cdot \numocc{\graph{1}}{\twopath}.\]
\end{Lemma}
%\begin{Lemma}\label{lem:3p-G3}
%The $3$-paths in $\graph{3}$ satisfy the identity:
%\[\numocc{\graph{3}}{\threepath} = \numocc{\graph{1}}{\ed} + 2 \cdot \numocc{\graph{1}}{\twopath}.\]
%\end{Lemma}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@ -163,29 +157,27 @@ Using the results we have obtained so far, we will prove the following reduction
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{Lemma}\label{lem:lin-sys}
%Using the identities of lemmas [\ref{lem:3m-G2}, \ref{lem:3m-G3}, \ref{lem:3p-G2}, \ref{lem:3p-G3}, \ref{lem:tri}] to compute $\numocc{G}{\threedis}, \numocc{G}{\threepath}, \numocc{G}{\tri}$ for $G \in \{\graph{2}, \graph{3}\}$, there exists a linear system $\mtrix{\rpoly}\cdot (x~y~z~)^T = \vct{b}$ which can then be solved to determine the unknown quantities of $\numocc{\graph{1}}{\threedis}, \numocc{\graph{1}}{\threepath}$, and $\numocc{\graph{1}}{\tri}$.
Fix $\prob\in (0,1)$. Given $\rpoly_{\graph{\ell}}^3(\prob,\dots,\prob)$ for $\ell\in [3]$, we can compute in $O(m)$ time a vector $\vct{b}\in\mathbb{R}^3$ such that
Fix $\prob\in (0,1)$. Given $\rpoly_{\graph{\ell}}^3(\prob,\dots,\prob)$ for $\ell\in [2]$, we can compute in $O(m)$ time a vector $\vct{b}\in\mathbb{R}^3$ such that
\[ \begin{pmatrix}
1 & \prob & -(3\prob^2 - \prob^3)\\
-2(3\prob^2 - \prob^3) & -4(3\prob^2 - \prob^3) & 10(3\prob^2 - \prob^3)\\
-18(3\prob^2 - \prob^3) & -21(3\prob^2 - \prob^3) & 45(3\prob^2 - \prob^3)
1 - 3p & -(3\prob^2 - \prob^3)\\
10(3\prob^2 - \prob^3) & 10(3\prob^2 - \prob^3)
\end{pmatrix}
\cdot
\begin{pmatrix}
\numocc{G}{\tri}]\\
\numocc{G}{\threepath}\\
\numocc{G}{\threedis}
\end{pmatrix}
=\vct{b},
\]
giving $\numocc{G}{\tri}, \numocc{G}{\threepath}$ and $\numocc{G}{\threedis}$ in $O(1)$ time.
allowing us to compute $\numocc{G}{\tri}, \numocc{G}{\threepath}$ and $\numocc{G}{\threedis}$ in $O(1)$ time.
\end{Lemma}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Due to lack of space we defer the proof of the above results to \Cref{subsec:proofs-struc-lemmas}.
%
This result immediately implies \Cref{th:single-p-hard}:
This result immediately implies \Cref{th:single-p}:
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{proof}[Proof of \Cref{th:single-p-hard}]
\begin{proof}[Proof of \Cref{th:single-p}]
We can compute $\graph{2}$ and $\graph{3}$ from $\graph{1}=G$ in $O(m)$ time (also note that these graphs also have $O(m)$ edges). Thus,
in time $O(T(m))$, we have $\rpoly_{\graph{\ell}}^3(\prob,\dots,\prob)$ for $\ell\in [3]$ and \Cref{lem:lin-sys} completes the proof.
\end{proof}