% -*- root: main.tex -*-
\pagebreak
\section{POS Queries}

The following lemma is used in subsequent proofs for bounding various queries. 
\begin{Lemma}\label{lem:exp-sine}
$\forall \wElem \in \wSet$,\newline
$\ex{\sine(\wElem)^i} = \begin{cases}
					0	&1 \leq i < \prodsize\\
					1	&\text{otherwise}.
				\end{cases}$
\end{Lemma}

\begin{proof}
Notice that, $\forall i \in [1, \prodsize - 1]$, $\ex{\sine(\wElem)^i} = \frac{\sum\limits_{\omega \in \Omega}\omega^i}{\prodsize} = \frac{\sum\limits_{l = 0}^{\prodsize - 1}(\omega^i)^l}{\prodsize}$.  To prove the lemma then, one needs only to prove that $\sum\limits_{l = 0}^{\prodsize - 1}\omega^i = \begin{cases}0&1 \leq i < \prodsize\\\prodsize&\text{otherwise}.\end{cases}$
For the case of $i = \prodsize$, 
\begin{equation}
\frac{\sum\limits_{l = 0}^{\prodsize - 1}(\omega^\prodsize)^l}{\prodsize} = \frac{\sum\limits_{l = 0}^{\prodsize - 1}1^l}{\prodsize} = \frac{\prodsize}{\prodsize} = 1.
\end{equation}
For $i \in [1, \prodsize - 1]$, we can show by geometric sum series that
\begin{equation}
\sum_{l = 0}^{\prodsize - 1}(\omega^i)^l = \frac{(\omega^i)^\prodsize - 1}{\omega^i - 1} = \frac{1 - 1}{\omega^i - 1} = 0.
\end{equation}
\qed
\end{proof}

We target the specific query where it is optimal to push down projections below join operators.  Such a query is a product of sums ($\pos$).  To show that our scheme works in this setting, we first compute the expectation of a $\pos$~ query over sketch annotations, i.e. $\pos$ = $\sum_{\buck = 1}^{\sketchCols}\left(\sum_{i \in \kvec'}\sk^{\vect_i}\left[\buck\right]\right) \left(\sum_{i' \in \kvec''}\sk^{\vect_{i'}}\left[\buck\right]\right)$, for the set of matching projected tuples from each input, denoted $\prodsize', \prodsize''$.  Note that we denote the $i^{th}$ vector as $\vect_i$ and the sketch of the $i^{th}$ vector $\sk^{\vect_i}$.

\begin{align}
&\ex{\sum_{\buck = 1}^{\sketchCols}\left(\sum_{i \in \kvec'}\sk^{\vect_i}\left[\buck\right]\right) \left(\sum_{i' \in \kvec''}\sk^{\vect_{i'}}\left[\buck\right]\right)}\nonumber\\
=&\ex{\sum_{\buck = 1}^{\sketchCols}\left(\sum_{i \in \kvec'}\sum_{\wElem \in \wSet}\vect_i(\wElem)\ind{\hfunc(\wElem) = \buck}\sine(\wElem)\right) \left(\sum_{i' \in \kvec''}\sum_{\wElem' \in \wSet}\vect_{i'}(\wElem')\ind{\hfunc(\wElem) = \buck}\sine(\wElem')\right)}\label{eq:exp-pos1}\\
=&\ex{\sum_{\buck = 1}^{\sketchCols}\left(\sum_{\wElem \in \wSet}\ind{\hfunc(\wElem) = \buck}\left(\sum_{i \in \kvec'}\vect_i(\wElem)\right)\sine(\wElem)\right) \left(\sum_{\wElem' \in \wSet}\ind{\hfunc(\wElem') = j}\left(\sum_{i' \in \kvec''}\vect_{i'}(\wElem')\right)\sine(\wElem')\right)}\label{eq:exp-pos2}\\
=&\ex{\sum_{\buck = 1}^{\sketchCols} \left(\sum_{\wElem \in \wSet}\ind{\hfunc(\wElem) = \buck} \left(\sum_{i \in \prodsize'}\vect_i(\wElem)\right)\left(\sum_{i' \in \prodsize''}\vect_{i'}(\wElem)\right)\sine(\wElem)^{2 = \prodsize}\right) + \left(\sum_{\substack{\wElem, \wElem' \in \wSet,\\\wElem \neq \wElem'}}\ind{\hfunc(\wElem) = j}\ind{\hfunc(\wElem') = j}\left(\left(\sum_{i \in \prodsize'}\vect_i(\wElem)\right)\sine(\wElem)\right)\left(\sum_{i' \in \prodsize''}\vect_{i'}(\wElem')\right)\sine(\wElem')\right)}\label{eq:exp-pos3}\\
=& \sum_{\buck = 1}^{\sketchCols}\sum_{\wElem \in \wSet}\ind{\hfunc(\wElem) = \buck}\left(\sum_{i \in \prodsize'}\vect_i(\wElem)\right)\left(\sum_{i' \in \prodsize''}\vect_{i'}(\wElem)\right)\label{eq:exp-pos4}\\
=& \sum_{\wElem \in \wSet}\left(\sum_{i \in \prodsize'}\vect_i(\wElem)\right)\left(\sum_{i' \in \prodsize''}\vect_{i'}(\wElem)\right)\label{eq:exp-pos5}
\end{align}
\qed\newline
Equation \eqref{eq:exp-pos1} follows from expanding the definitions of $\sk^{v_i}$.  Equation \eqref{eq:exp-pos2} follows from the associative property of addition and the distributive property of addition over multiplication.  Equation \eqref{eq:exp-pos3} also uses the associative and distributive properties to rearrange the $\pos$.  Equation \eqref{eq:exp-pos4} results from Lemma \ref{lem:exp-sine}, where it can be seen that $\ex{\sine(\wElem)\sine(\wElem')} = 0$, thus eliminating the right hand term.  The left hand operand stays, since by Lemma \ref{lem:exp-sine} we know that $\ex{\sine(\wElem)^\prodsize} = 1$.  Finally, equation \eqref{eq:exp-pos4} follows from the construction of $\sk$.

We now move to computing the variance of a $\pos$~ query.  Note, that the use of complex numbers requires the variance formula $\var = \ex{\pos \cdot\conj{\pos}} - \ex{\pos}\ex{\conj{\pos}}$.

To make this easier to present and digest, we start by turning our focus on the first term, $T_1 = \ex{\pos \cdot \conj{\pos}}$.
\begin{align}
&\ex{\sum_{\buck = 1}^{\sketchCols}\left(\sum_{i_1 \in \prodsize'}\sk^{\vect_{i_1}}[\buck]\right)\left(\sum_{i_1' \in \prodsize''}\sk^{\vect_{i_1'}}[\buck]\right) \cdot
\conj{\sum_{\buck' = 1}^{\sketchCols}\left(\sum_{i_2 \in \prodsize'}\sk^{\vect_{i_2}}[\buck]\right)\left(\sum_{i_2' \in \prodsize''}\sk^{\vect_{i_2'}}[\buck]\right)}}\\
&=\ex{\sum_{\buck = 1}^{\sketchCols}\left(\sum_{i_1 \in \prodsize'}\sum_{\wElem_1 \in \wSet}\ind{\hfunc(\wElem_1) = \buck}\vect_{i_1}(\wElem_1)\sine(\wElem_1)\sum_{i_1' \in \prodsize''}\sum_{\wElem_1' \in \wSet}\ind{\hfunc(\wElem_1') = \buck}\vect_{i_1'}(\wElem_1')\sine(\wElem_1')\right)
\conj{\sum_{\buck' = 1}^{\sketchCols}\left(\sum_{i_2 \in \prodsize'}\sum_{\wElem_2 \in \wSet}\ind{\hfunc(\wElem_2) = \buck'}\vect_{i_2}(\wElem_2)\conj{\sine(\wElem_2)}\sum_{i_2' \in \prodsize''}\sum_{\wElem_2' \in \wSet}\ind{\hfunc(\wElem_2') = \buck'}\vect_{i_2'}(\wElem_2')\conj{\sine(\wElem_2')}\right)}}\label{eq:var-pos1}\\
&=\ex{\sum_{\buck = 1}^{\sketchCols}\left(\sum_{i_1 \in \prodsize'}\sum_{\wElem_1 \in \wSet}\ind{\hfunc(\wElem_1) = \buck}\vect_{i_1}(\wElem_1)\sine(\wElem_1)\sum_{i_1' \in \prodsize''}\sum_{\wElem_1' \in \wSet}\ind{\hfunc(\wElem_1') = \buck}\vect_{i_1'}(\wElem_1')\sine(\wElem_1')\right)
\sum_{\buck' = 1}^{\sketchCols}\left(\sum_{i_2 \in \prodsize'}\sum_{\wElem_2 \in \wSet}\ind{\hfunc(\wElem_2) = \buck'}\vect_{i_2}(\wElem_2)\conj{\sine(\wElem_2)}\sum_{i_2' \in \prodsize''}\sum_{\wElem_2' \in \wSet}\ind{\hfunc(\wElem_2') = \buck'}\vect_{i_2'}(\wElem_2')\conj{\sine(\wElem_2')}\right)}\label{eq:var-pos2}\\
%
&=\mathbb{E}\left[\sum_{\buck = 1}^{\sketchCols}\left(\sum_{\wElem_1 \in \wSet}\ind{\hfunc(\wElem_1) = \buck}\left(\sum_{i_1 \in \prodsize'}\vect_{i_1}(\wElem_1)\right)\sine(\wElem_1)\right)\left(\sum_{\wElem_1' \in \wSet}\ind{\hfunc(\wElem_1') = \buck}\left(\sum_{i_1' \in \prodsize''}\vect_{i_1'}(\wElem_1')\right)\sine(\wElem_1')\right)\right.\nonumber\\
&\left.\qquad\qquad\qquad\sum_{\buck' = 1}^{\sketchCols}\left(\sum_{\wElem_2 \in \wSet}\ind{\hfunc(\wElem_2) = \buck'}\left(\sum_{i_2 \in \prodsize'}\vect_{i_2}(\wElem_2)\right)\conj{\sine(\wElem_2)}\right)\left(\sum_{\wElem_2' \in \wSet}\ind{\hfunc(\wElem_2') = \buck'}\left(\sum_{i_2' \in \prodsize''}\vect_{i_2'}(\wElem_2')\right)\conj{\sine(\wElem_2')}\right)\right]\label{eq:var-pos3}\\
%
&=\ex{\sum_{\buck = 1}^{\sketchCols}\sum_{\wElem_1, \wElem_1' \in \wSet}\ind{\hfunc(\wElem_1) = \buck}\ind{\hfunc(\wElem_1') = \buck}\left(\sum_{i_1 \in \prodsize'}\vect_{i_1}(\wElem_1)\right)\sine(\wElem_1)\left(\sum_{i_1' \in \prodsize''}\vect_{i_1'}(\wElem_1')\right)\sine(\wElem_1')\cdot
\sum_{\buck' = 1}^{\sketchCols}\sum_{\wElem_2, \wElem_2' \in \wSet}\ind{\hfunc(\wElem_2) = \buck'}\ind{\hfunc(\wElem_2') = \buck'}\left(\sum_{i_2 \in \prodsize'}\vect_{i_2}(\wElem_2)\right)\conj{\sine(\wElem_2)}\left(\sum_{i_2' \in \prodsize''}\vect_{i_2'}(\wElem_2')\right)\conj{\sine(\wElem_2')}}\label{eq:var-pos4}\\
%
&=\ex{\sum_{\buck, \buck' \in [\sketchCols]}\sum_{\substack{\wElem_1, \wElem_1',\\ \wElem_2, \wElem_2'\\ \in \wSet}}\ind{\hfunc(\wElem_1) = \buck}\ind{\hfunc(\wElem_1') = \buck}\ind{\hfunc(\wElem_2) = \buck'}\ind{\hfunc(\wElem_2') = \buck'}\left(\sum_{i_1 \in \prodsize'}\vect_{i_1}(\wElem_1)\right)\sine(\wElem_1)\left(\sum_{i_1' \in \prodsize''}\vect_{i_1'}(\wElem_1')\right)\sine(\wElem_1')\left(\sum_{i_2 \in \prodsize'}\vect_{i_2}(\wElem_2)\right)\conj{\sine(\wElem_2)}\left(\sum_{i_2' \in \prodsize''}\vect_{i_2'}(\wElem_2')\right)\conj{\sine(\wElem_2')}}\label{eq:var-pos5}\\
%
&=\sum_{\buck, \buck' \in [\sketchCols]}\sum_{\substack{\wElem_1, \wElem_1',\\ \wElem_2, \wElem_2'\\ \in \wSet}}\sum_{\substack{i_1, i_2 \in \prodsize',\\i_1', i_2' \in \prodsize''}}\vect_{i_1}(\wElem_1)\vect_{i_1'}(\wElem_1')\vect_{i_2}(\wElem_2)\vect_{i_2'}(\wElem_2')\ex{\ind{\hfunc(\wElem_1) = \buck}\ind{\hfunc(\wElem_1') = \buck}\ind{\hfunc(\wElem_2) = \buck'}\ind{\hfunc(\wElem_2') = \buck'}\sine(\wElem_1)\sine(\wElem_1')\conj{\sine(\wElem_2)}\conj{\sine(\wElem_2')}}\label{eq:var-pos6}
%--Below is part of the derivation without using the indicator variables.  Only saving for short term...
%&=\ex{\sum_{\buck = 1}^{\sketchCols}\left(\sum_{\wElem_1 \in \wSet_j}\left(\sum_{i \in \kvec'}\vect_i(\wElem_1)\right)\sine(\wElem_1)\right) \left(\sum_{\wElem_2 \in \wSet_j}\left(\sum_{i' \in \kvec''}\vect_{i'}(\wElem_2)\right)\conj{\sine(\wElem_2)}\right) \cdot \sum_{\buck' = 1}^{\sketchCols}\left(\sum_{\wElem_3 \in \wSet_{j'}}\left(\sum_{i \in \kvec'}\vect_i(\wElem_3)\right)\conj{\sine(\wElem_3)}\right) \left(\sum_{\wElem_4 \in \wSet_{j'}}\left(\sum_{i' \in \kvec''}\vect_{i'}(\wElem_4)\right)\conj{\sine(\wElem_4)}\right)}\label{eq:var-pos1}\\
%=&\ex{\sum_{\buck, \buck' \in \sketchCols}\left(\sum_{\wElem_1 \in \wSet_j}\left(\sum_{i \in \kvec'}\vect_i(\wElem_1)\right)\sine(\wElem_1)\right) \left(\sum_{\wElem_2 \in \wSet_j}\left(\sum_{i' \in \kvec''}\vect_{i'}(\wElem_2)\right)\conj{\sine(\wElem_2)}\right) \cdot \left(\sum_{\wElem_3 \in \wSet_{j'}}\left(\sum_{i \in \kvec'}\vect_i(\wElem_3)\right)\conj{\sine(\wElem_3)}\right) \left(\sum_{\wElem_4 \in \wSet_{j'}}\left(\sum_{i' \in \kvec''}\vect_{i'}(\wElem_4)\right)\conj{\sine(\wElem_4)}\right)}\label{eq:var-pos2}\\
%=&\sum_{\buck, \buck' \in \sketchCols}\sum_{\wElem_1 \in \wSet_j}\left(\sum_{i \in \kvec'}\vect_i(\wElem_1)\right)\sum_{\wElem_2 \in \wSet_j}\left(\sum_{i' \in \kvec''}\vect_{i'}(\wElem_2)\right) \sum_{\wElem_3 \in \wSet_{j'}}\left(\sum_{i \in \kvec'}\vect_i(\wElem_3)\right) \sum_{\wElem_4 \in \wSet_{j'}}\left(\sum_{i' \in \kvec''}\vect_{i'}(\wElem_4)\right)\ex{\sine(\wElem_1)\cdot \conj{\sine(\wElem_2)}\cdot\conj{\sine(\wElem_3)}\cdot \conj{\sine(\wElem_4)}}\label{eq:var-pos3}
\end{align}
Equation \eqref{eq:var-pos1} follows from expanding the definition of a sketch $\sk$.
Equation \eqref{eq:var-pos2} uses the fact that the sum (product) of conjugates is equal to the conjugate of the sum (product).  
Equation \eqref{eq:var-pos3} results from rewriting the summations using the law of associativity, and then applying the law of distributivity of addition over multiplication to the rewrite.
Equations \eqref{eq:var-pos4}, \eqref{eq:var-pos5} again rewrite the summation(s) using the law of distributivity of addition over multiplication.
Equation \eqref{eq:var-pos6} is the result of factoring out non-random terms from the expectation.\newline

When considering the terms that survive the expecation in \eqref{eq:var-pos6}, recall that it is a known fact when working with $\prodsize^{th}$ roots of unity ($R^\prodsize$) in the complex numbers that a complex number times its conjugate has a product of one, formally:
\begin{equation*}
\forall c \in \mathbb{C} \text{ s.t. } c \in R^\prodsize, c \cdot \conj{c}= 1.
\end{equation*}
Combining this result with Lemma \eqref{lem:exp-sine} one can see that only two possible cases of terms survive the expectation in \eqref{eq:var-pos6}.

First by Lemma \eqref{lem:exp-sine},
%labels not compiling
\begin{align}
&\emph{case 1}\nonumber\\
&\qquad\text{a: }w_1 = w_1' =w_2 = w_2'\label{this-1}\\%\label{var:pos-case-1a}
&\qquad\text{b: }w_1 = w_1' \neq w_2 = w_2'\label{this-2}%\label{var:pos-case-1b}
\end{align}
Second, by the law of conjugates, 
\begin{align}
&\emph{case 2}\nonumber\\
&\qquad\text{a: }w_1 = w_2 \neq w_1' = w_2'\label{joe-a}\\%\label{var:pos-Case-2a}
&\qquad\text{b: }w_1 = w_2' \neq w_1' = w_2\label{joe-b}%\label{var:pos-Case-2b}
\end{align}




Next, we show that the second term, $T_2 = \ex{\pos}\ex{\conj{\pos}}$, has the same term as $T_1$ factor out of the expectations.

\begin{align}
&\ex{\sum_{\buck = 1}^{\sketchCols}\left(\sum_{i_1 \in \prodsize'}\sk^{\vect_{i_1}}[\buck]\right)\left(\sum_{i_1' \in \prodsize''}\sk^{\vect_{i_1'}}[\buck]\right)}
\ex{\conj{\sum_{\buck' = 1}^{\sketchCols}\left(\sum_{i_2 \in \prodsize'}\sk^{\vect_{i_2}}[\buck]\right)\left(\sum_{i_2' \in \prodsize''}\sk^{\vect_{i_2'}}[\buck]\right)}}\label{eq:var-t2-pos1}\\
%
&\ex{\sum_{\buck = 1}^{\sketchCols}\left(\sum_{i_1 \in \prodsize'}\sum_{\wElem_1 \in \wSet}\ind{\hfunc(\wElem_1) = \buck}\vect_{i_1}(\wElem_1)\sine(\wElem_1)\right)\left(\sum_{i_1' \in \prodsize''}\sum_{\wElem_1' \in \wSet}\ind{\hfunc(\wElem_1') = \buck}\vect_{i_1'}(\wElem_1')\sine(\wElem_1')\right)}\ex{\sum_{\buck' = 1}^{\sketchCols}\left(\sum_{i_2 \in \prodsize'}\sum_{\wElem_2 \in \wSet}\ind{\hfunc(\wElem_2) = \buck'}\vect_{i_2}(\wElem_2)\conj{\sine(\wElem_2)}\right)\left(\sum_{i_2' \in \prodsize''}\sum_{\wElem_2' \in \wSet}\ind{\hfunc(\wElem_2') = \buck'}\vect_{i_2'}(\wElem_2')\conj{\sine(\wElem_2')}\right)}\label{eq:var-t2-pos2}\\
%
&\ex{\sum_{\buck = 1}^{\sketchCols}\left(\sum_{\wElem_1 \in \wSet}\ind{\hfunc(\wElem_1) = \buck}\left(\sum_{i_1 \in \prodsize'}\vect_{i_1}(\wElem_1)\right)\sine(\wElem_1)\right)\left(\sum_{\wElem_1' \in \wSet}\ind{\hfunc(\wElem_1') = \buck}\left(\sum_{i_1' \in \prodsize''}\vect_{i_1'}(\wElem_1')\right)\sine(\wElem_1')\right)}\nonumber\\
&\qquad\qquad\qquad\ex{\sum_{\buck' = 1}^{\sketchCols}\left(\sum_{\wElem_2 \in \wSet}\ind{\hfunc(\wElem_2) = \buck'}\left(\sum_{i_2 \in \prodsize'}\vect_{i_2}(\wElem_2)\right)\conj{\sine(\wElem_2)}\right)\left(\sum_{\wElem_2' \in \wSet}\ind{\hfunc(\wElem_2') = \buck'}\left(\sum_{i_2' \in \prodsize''}\vect_{i_2'}(\wElem_2')\right)\conj{\sine(\wElem_2')}\right)}\label{eq:var-t2-pos3}\\
%
&\ex{\sum_{\buck = 1}^{\sketchCols}\sum_{\wElem_1, \wElem_1' \in \wSet}\ind{\hfunc(\wElem_1) = \buck}\ind{\hfunc(\wElem_1') = \buck}\left(\sum_{i_1 \in \prodsize'}\vect_{i_1}(\wElem_1)\right)\sine(\wElem_1)\left(\sum_{i_1' \in \prodsize''}\vect_{i_1'}(\wElem_1')\right)\sine(\wElem_1')}\ex{\sum_{\buck' = 1}^{\sketchCols}\sum_{\wElem_2, \wElem_2' \in \wSet}\ind{\hfunc(\wElem_2) = \buck'}\ind{\hfunc(\wElem_2') = \buck'}\left(\sum_{i_2 \in \prodsize'}\vect_{i_2}(\wElem_2)\right)\conj{\sine(\wElem_2)}\left(\sum_{i_2' \in \prodsize''}\vect_{i_2'}(\wElem_2')\right)\conj{\sine(\wElem_2')}}\label{eq:var-t2-pos4} \\
%
&\sum_{\buck = 1}^{\sketchCols}\sum_{\wElem_1, \wElem_1' \in \wSet}\left(\sum_{i_1 \in \prodsize'}\vect_{i_1}(\wElem_1)\right)\left(\sum_{i_1' \in \prodsize''}\vect_{i_1'}(\wElem_1')\right)\ex{\ind{\hfunc(\wElem_1) = \buck}\ind{\hfunc(\wElem_1') = \buck}\sine(\wElem_1)\sine(\wElem_1')}\sum_{\buck' = 1}^{\sketchCols}\sum_{\wElem_2, \wElem_2' \in \wSet}\left(\sum_{i_2 \in \prodsize'}\vect_{i_2}(\wElem_2)\right)\left(\sum_{i_2' \in \prodsize''}\vect_{i_2'}(\wElem_2')\right)\ex{\ind{\hfunc(\wElem_2) = \buck'}\ind{\hfunc(\wElem_2') = \buck'}\conj{\sine(\wElem_2)}\conj{\sine(\wElem_2')}}\label{eq:var-t2-pos5} \\
%
&\sum_{\buck, \buck' \in [\sketchCols]}\sum_{\substack{\wElem_1, \wElem_1',\\\wElem_2, \wElem_2' \in \wSet}}\left(\sum_{\substack{i_1, i_2 \in \prodsize',\\i_1', i_2' \in \prodsize''}}\vect_{i_1}(\wElem_1)\vect_{i_1'}(\wElem_1')\vect_{i_2}(\wElem_2)\vect_{i_2'}(\wElem_2')\right)\left(\ex{\ind{\hfunc(\wElem_1) = \buck}\ind{\hfunc(\wElem_1') = \buck}\sine(\wElem_1)\sine(\wElem_1')}\ex{\ind{\hfunc(\wElem_2) = \buck'}\ind{\hfunc(\wElem_2') = \buck'}\conj{\sine(\wElem_2)}\conj{\sine(\wElem_2')}}\right)\label{eq:var-t2-pos5}
%
%&\ex{\sum_{\buck = 1}^{\sketchCols}\left(\sum_{\wElem_1 \in \wSet_j}\left(\sum_{i \in \kvec'}\vect_i(\wElem_1)\right)\sine(\wElem_1)\right) \left(\sum_{\wElem_2 \in \wSet_j}\left(\sum_{i' \in \kvec''}\vect_{i'}(\wElem_2)\right)\conj{\sine(\wElem_2)}\right)} \cdot \ex{\sum_{\buck' = 1}^{\sketchCols}\left(\sum_{\wElem_3 \in \wSet_{j'}}\left(\sum_{i \in \kvec'}\vect_i(\wElem_3)\right)\conj{\sine(\wElem_3)}\right) \left(\sum_{\wElem_4 \in \wSet_{j'}}\left(\sum_{i' \in \kvec''}\vect_{i'}(\wElem_4)\right)\conj{\sine(\wElem_4)}\right)}\label{eq:var-t2-pos1}\\
%=&\sum_{\buck, \buck' \in \sketchCols}\sum_{\wElem_1 \in \wSet_j}\left(\sum_{i \in \kvec'}\vect_i(\wElem_1)\right)\sum_{\wElem_2 \in \wSet_j}\left(\sum_{i' \in \kvec''}\vect_{i'}(\wElem_2)\right) \sum_{\wElem_3 \in \wSet_{j'}}\left(\sum_{i \in \kvec'}\vect_i(\wElem_3)\right) \sum_{\wElem_4 \in \wSet_{j'}}\left(\sum_{i' \in \kvec''}\vect_{i'}(\wElem_4)\right)\ex{\sine(\wElem_1)\cdot \conj{\sine(\wElem_2)}}\ex{\cdot\conj{\sine(\wElem_3)}\cdot \conj{\sine(\wElem_4)}}\label{eq:var-t2-pos2}
\end{align}
The justification of steps is almost identical to the justification used in $T_1$ derivation.
Equation\eqref{eq:var-t2-pos1} expands out the definition of $\sk$, and also uses the fact that the sum (product) of conjugates is equal to the conjugate of the sum (product).
Equations \eqref{eq:var-t2-pos2} and \eqref{eq:var-t2-pos3} rely on the associativity and distributivity properties of addition. 
Equation \eqref{eq:var-t2-pos4} factors out non-random terms from the expectations.
Equation \eqref{eq:var-t2-pos5} uses the distributive property of addition over multiplication, along with the commutative and associativity of multiplication.

Notice that both $T_1$ and $T_2$ have the same left side factor, so the $\var$ can be written as
\begin{align}
&\sum_{\buck, \buck' \in [\sketchCols]}\sum_{\substack{\wElem_1, \wElem_1',\\\wElem_2, \wElem_2' \in \wSet}}\left(\sum_{\substack{i_1, i_2 \in \prodsize',\\i_1', i_2' \in \prodsize''}}\vect_{i_1}(\wElem_1)\vect_{i_1'}(\wElem_1')\vect_{i_2}(\wElem_2)\vect_{i_2'}(\wElem_2')\right)\left(\ex{\ind{\hfunc(\wElem_1) = \buck}\ind{\hfunc(\wElem_1') = \buck}\ind{\hfunc(\wElem_2) = \buck'}\ind{\hfunc(\wElem_2') = \buck'}\sine(\wElem_1)\sine(\wElem_1')\conj{\sine(\wElem_2)}\conj{\sine(\wElem_2')}}\right.\nonumber\\
&\left.\qquad\qquad\qquad - \ex{\ind{\hfunc(\wElem_1) = \buck}\ind{\hfunc(\wElem_1') = \buck}\sine(\wElem_1)\sine(\wElem_1')}\ex{\ind{\hfunc(\wElem_2) = \buck'}\ind{\hfunc(\wElem_2') = \buck'}\conj{\sine(\wElem_2)}\conj{\sine(\wElem_2')}}\right)\\\label{eq:var-t1-t2}
\end{align} 

Notice that the expectation terms coming from $T_2$ cancel out case 1 leaving the two possibilities of case 2, \eqref{joe-a} and \eqref{joe-b} as surviving terms in $\var$.  Note that both \eqref{joe-a} and \eqref{joe-b} have all their variables coming from the same $\buck^{th}$ bucket because of equality amongst cross terms.  The equalities also have the added effect of setting two of the four indicator variables to 1.

Thus,
\begin{equation}
\var\left[\pos\right] = \sum_j\sum_{\wElem, \wElem'}\frac{1}{\sketchCols^2}\left(\sum_{\substack{i \in \prodsize',\\i' \in \prodsize''}}\vect_i(\wElem)^2\vect_{i'}(\wElem')^2 + \vect_i(\wElem)\vect_{i'}(\wElem)\vect_i(\wElem')\vect_{i'}(\wElem')\right)  
\end{equation}

%Putting things together we have,
%\begin{align}
%&\sum_{\buck, \buck' \in \sketchCols}\sum_{\wElem_1 \in \wSet_j}\left(\sum_{i \in \kvec'}\vect_i(\wElem_1)\right)\sum_{\wElem_2 \in \wSet_j}\left(\sum_{i' \in \kvec''}\vect_{i'}(\wElem_2)\right) \sum_{\wElem_3 \in \wSet_{j'}}\left(\sum_{i \in \kvec'}\vect_i(\wElem_3)\right) \sum_{\wElem_4 \in \wSet_{j'}}\left(\sum_{i' \in \kvec''}\vect_{i'}(\wElem_4)\right)\left(\ex{\sine(\wElem_1) \conj{\sine(\wElem_2)}\conj{\sine(\wElem_3)}\cdot \conj{\sine(\wElem_4)}}-\ex{\sine(\wElem_1) \conj{\sine(\wElem_2)}}\ex{\conj{\sine(\wElem_3)}\cdot \conj{\sine(\wElem_4)}}\right)\label{eq:var-both-pos1}\\
%=&\sum_{\buck}\sum_{\wElem \neq \wElem' \in \wSet}\left(\sum_{i \in \prodsize'}\vect_i(\wElem)\right)^2\left(\sum_{i' \in \prodsize''}\vect_{i'}(\wElem')\right)^2 + \left(\sum_{i \in \prodsize'}\vect_i(\wElem)\right)\left(\sum_{i' \in \prodsize''}\vect_{i'}(\wElem)\right)\left(\sum_{i' \in \prodsize''}\vect_{i'}(\wElem')\right) \left(\sum_{i \in \prodsize'}\vect_i(\wElem')\right)\label{eq:var-both-pos2}\\
%\leq&\norm{\sum_{i \in \prodsize'}\vect_i}_2^2\cdot\norm{\sum_{i' \in \prodsize''}\vect_{i'}}_2^2 + \norm{\sum_{i \in \prodsize'}\vect_i \had \sum_{i' \in \prodsize''}\vect_{i'}}_2^2\label{eq:var-both-pos3}
%\end{align}
%\qed
%
%Equation \eqref{eq:var-both-pos2} relies on the fact that the difference in expectation will only be non-zero when $\wElem_1 = \wElem_3 \neq \wElem_2 = \wElem_4$ or $\wElem_1 = \wElem_4 \neq \wElem_2 = \wElem_3$.