Minor tweaks to SampMon runtime proof.

This commit is contained in:
Aaron Huber 2021-02-24 12:04:34 -05:00
parent ff1431a195
commit 4eb9dd7352

View file

@ -716,12 +716,12 @@ Let \cost be a function that models an upper bound on the number of gates that c
First note that \cost is indeed a correct upper bound. When \sampmon visits a gate such that \circuit.\type $ =\circmult$, line ~\ref{alg:sample-times-for-loop} visits each input of \circuit. For the case when \circuit.\type $= \circplus$, line ~\ref{alg:sample-plus-bsamp} visits exactly one of the input gates. Finally, it is trivial to see that when \circuit.\type $\in \{\var, \tnum\}$, i.e., a source gate, that only one gate is visited.
We prove an upper bound of $O\left(k \cdot \depth(\circuit)\right) \geq \cost(\circuit)$ on the number of gates traversed in \sampmon using induction over $\depth(\circuit) = d$. %of \circuit, where $\degree(\circuit) = k$, and $\size(\circuit) = \ell$.
For the base case $\depth(\circuit) = 0$, $\cost(\circuit) = 1$, and it is trivial to see that $\degree(\circuit) = k = 1$, $\depth(\circuit) = 1$, which imples that $\cost(\circuit) \leq O(k \cdot d)$, and the bound trivially holds.
For the base case $\depth(\circuit) = 0$, $\cost(\circuit) = 1$, and it is trivial to see that $\degree(\circuit) = k = 1$, $\depth(\circuit) = 1$, which imples that $O(k \cdot d) \geq \cost(\circuit)$, and the bound trivially holds.
For the inductive hypothesis, we assume the bound holds for a circuit of depth $d \leq \ell \geq 0$.
Now consider the case when \sampmon has an arbitrary circuit \circuit input with $d + 1 \leq \ell + 1$. By the hypothesis, we know all inputs of the sink gate \circuit uphold the bound. It is true then that $\depth(\circuit_\rinput) \leq d \geq \depth(\circuit_\linput)$ where at least one of the inequalities is a strict equality. Fix $\degree(\circuit_\linput) = k'$ and $\degree(\circuit_\rinput) = k''$. If \circuit.\type $= \circplus$, then $\degree(\circuit) = k = max(k', k'')$. Otherwise \circuit.\type = $\circmult$ and $\degree(\circuit) = k' + k''$.
If \circuit.\type $= \circmult$, we have already seen that \sampmon visits all inputs of \circuit. Then \sampmon visits $\cost(\circuit) = 1 + \cost(\circuit_\linput) + \cost(\circuit_\rinput)$ gates. Since we have that $O\left(k' \cdot (d - 1)\right) \geq \cost(\circuit_\linput)$ gates were traversed in $\circuit_\linput$ and $O\left(k'' \cdot (d - 1)\right) \geq \cost(\circuit_\rinput)$ gates in $\circuit_\rinput$, then we have for \circuit that $O\left((k' + k'')\cdot(d - 1)\right) + 1 = O(\left(k \cdot(d - 1)\right) + 1$ gates have been traversed. It is trivial to see that the sink gate \circuit has $\leq k$ gates, thus holding the $O(k\cdot d)\geq\cost(\circuit)$ bound.
If \circuit.\type $= \circmult$, we have already seen that \sampmon visits all inputs of \circuit. Then \sampmon visits at most $\cost(\circuit) = 1 + \cost(\circuit_\linput) + \cost(\circuit_\rinput)$ gates. Since we have that $O\left(k' \cdot (d - 1)\right) \geq \cost(\circuit_\linput)$ gates were traversed in $\circuit_\linput$ and $O\left(k'' \cdot (d - 1)\right) \geq \cost(\circuit_\rinput)$ gates in $\circuit_\rinput$, then we have for \circuit that $O\left((k' + k'')\cdot(d - 1)\right) + 1 = O(\left(k \cdot(d - 1)\right) + 1$ gates have been traversed. It is trivial to see that the sink gate \circuit has $\leq k$ gates, thus holding the $O(k\cdot d)\geq\cost(\circuit)$ bound.
If \circuit.\type $= \circplus$, then \sampmon samples exactly one of its inputs. Then it follows that $\cost(\circuit) = 1 + max\left(\cost(\circuit_\linput), \cost(\circuit_\rinput)\right)$. Suppose that $max\left(\cost(\circuit_\linput), \cost(\circuit_\rinput)\right) = \circuit_\linput$, then it is the case that $k \geq k'$, with a bound $O(k' \cdot d - 1)\geq \cost(\circuit_\linput)$ on $\circuit_\linput$, and this implies a bound of $O\left(k \cdot d\right)\geq \cost(\circuit)$ on \circuit since sink gate \circuit has $\leq k$ nodes.
}