高级算法 (Fall 2016)/Nonconstructive Proof of Lovász Local Lemma and 高级算法 (Fall 2016)/''Lovász'' Local Lemma: Difference between pages

From TCS Wiki
(Difference between pages)
Jump to navigation Jump to search
imported>Etone
No edit summary
 
imported>Etone
(Created page with "=Random Search for <math>k</math>-SAT= We start by giving the definition of <math>k</math>-CNF and <math>k</math>-SAT. {{Theorem|Definition (exact-<math>k</math>-CNF)| :A logi...")
 
Line 1: Line 1:
Given a sequence of events <math>A_1,A_2,\ldots,A_n</math>, we use the '''dependency graph''' to describe the dependencies between these events.
=Random Search for <math>k</math>-SAT=
We start by giving the definition of <math>k</math>-CNF and <math>k</math>-SAT.
{{Theorem|Definition (exact-<math>k</math>-CNF)|
:A logic expression <math>\phi</math> defined on <math>n</math> Boolean variables <math>x_1,x_2,\ldots,x_n\in\{\mathrm{true},\mathrm{false}\}</math> is said to be a '''conjunctive normal form (CNF)''' if <math>\phi</math> can be written as a conjunction(AND) of '''clauses''' as <math>\phi=C_1\wedge C_2\wedge\cdots\wedge C_m</math>, where each clause <math>C_i=\ell_{i_1}\vee \ell_{i_2}\vee\cdots\vee\ell_{i_k}</math> is a disjunction(OR) of '''literals''', where every literal <math>\ell_j</math> is either a variable <math>x_i</math> or the negation <math>\neg x_i</math> of a variable.
:*We call a CNF formula a '''exact-<math>k</math>-CNF''' if every clause consists of ''exact'' <math>k</math> ''distinct'' literals.
}}
For example:
:<math>
(x_1\vee \neg x_2 \vee \neg x_3)\wedge (\neg x_1\vee \neg x_3\vee x_4)\wedge (x_1\vee x_2\vee x_4)\wedge (x_2\vee x_3\vee \neg x_4)
</math>
is an exact-<math>3</math>-CNF formula.
 
;Remark
:The notion of exact-<math>k</math>-CNF is slightly more restrictive than the <math>k</math>-CNF, where each clause consists of ''at most'' <math>k</math> variables. The discussion of the subtle differences between these two definitions can be found [https://en.wikipedia.org/wiki/Boolean_satisfiability_problem#3-satisfiability here].
 
A logic expression <math>\phi</math> is said to be '''satisfiable''' if there is an assignment of values of true or false to the variables <math>\boldsymbol{x}=(x_1,x_2,\ldots,x_n)</math> so that <math>\phi(\boldsymbol{x})</math> is true. For a CNF <math>\phi</math>, this mean that there is a truth assignment that satisfies all clauses in <math>\phi</math> simultaneously.
 
The '''exact-<math>k</math>-satisfiability (exact-<math>k</math>-SAT)''' problem is that given as input an exact-<math>k</math>-CNF formula <math>\phi</math> decide whether <math>\phi</math> is satisfiable.
{{Theorem|exact-<math>k</math>-SAT|
:'''Input:''' an exact-<math>k</math>-CNF formula <math>\phi</math>.
:'''Output:''' whether <math>\phi</math> is satisfiable.
}}
It is well known that <math>k</math>-SAT is '''NP-complete''' for any <math>k\ge 3</math>. The same also holds for the exact-<math>k</math>-SAT.
 
== Satisfiability of exact-<math>k</math>-CNF==
Inspired by the Lovasz local lemma, we now consider the dependencies between clauses in a CNF formula.
 
Given a CNF formula <math>\phi</math> defined over Boolean variables <math>\mathcal{X}=\{x_1,x_2,\ldots,x_n\}</math> and a clause <math>C</math> in <math>\phi</math>, we use <math>\mathsf{vbl}(C)\subseteq\mathcal{X}</math> to denote the set of variables that appear in <math>C</math>.
For a clause <math>C</math> in a CNF formula <math>\phi</math>, its '''degree''' <math>d(C)=|\{D\neq C\mid \mathsf{D}\cap\mathsf{C}\neq\emptyset\}|</math> is the number of other clauses in <math>\phi</math> that share variables with <math>C</math>. The '''maximum degree''' <math>d</math> of a CNF formula <math>\phi</math> is <math>d=\max_{C\text{ in }\phi}d(C)</math>.


{{Theorem
By the Lovasz local lemma, we almost immediately have the following theorem for the satisfiability of exact-<math>k</math>-CNF with bounded degree.
|Definition|
{{Theorem|Theorem|
:Let <math>A_1,A_2,\ldots,A_n</math> be a sequence of events. A graph <math>D=(V,E)</math> on the set of vertices <math>V=\{1,2,\ldots,n\}</math> is called a '''dependency graph''' for the events <math>A_1,\ldots,A_n</math> if for each <math>i</math>, <math>1\le i\le n</math>, the event <math>A_i</math> is mutually independent of all the events <math>\{A_j\mid (i,j)\not\in E\}</math>.
:Let <math>\phi</math> be an exact-<math>k</math>-CNF formula with maximum degree <math>d</math>. If <math>d+1\le 2^{k}/\mathrm{e}</math> then <math>\phi</math> is always satisfiable.
}}
}}
{{Proof|
Let <math>X_1,X_2,\ldots,X_n</math> be Boolean random variables sampled uniformly and independently from <math>\{\text{true},\text{false}\}</math>. We are going to show that <math>\phi</math> is satisfied by this random assignment with positive probability. Due to the probabilistic method, this will prove the existence of a satisfying assignment for <math>\phi</math>.


The notion of mutual independence between an event and a set of events is formally defined as follows.
Suppose there are <math>m</math> clauses <math>C_1,C_2,\ldots,C_m</math> in <math>\phi</math>. Let <math>A_i</math> denote the bad event that <math>C_i</math> is not satisfied by the random assignment <math>X_1,X_2,\ldots,X_n</math>. Clearly, each <math>A_i</math> is dependent with at most <math>d</math> other <math>A_j</math>'s. And our goal is to show that
{{Theorem|Definition|
:<math>\Pr\left[\bigwedge_{i=1}^m\overline{A_i}\right]>0</math>.
:An event <math>A</math> is said to be '''mutually independent''' of events <math>B_1,B_2,\ldots, B_k</math>, if for any disjoint <math>I^+,I^-\subseteq\{1,2,lots,k\}</math>, it holds that
 
::<math>\Pr\left[A \mid \left(\bigwedge_{i\in I^+}B_i\right) \wedge \left(\bigwedge_{i\in I^-}\overline{B_i}\right)\right]=\Pr[A]</math>.
Recall that in an exact-<math>k</math>-CNF, every clause <math>C_i</math> consists of exact <math>k</math> variable, and is violated by precisely one local assignment among all <math>2^k</math> possibilities. Thus the probability that <math>C_i</math> is not satisfied is <math>\Pr[A_i]=2^{-k}</math>.
 
Assuming that <math>d+1\le 2^{k}/\mathrm{e}</math>, i.e. <math>\mathrm{e}(d+1)2^{-k}\le 1</math>, by the Lovasz local lemma (symmetric case), we have
:<math>\Pr\left[\bigwedge_{i=1}^m\overline{A_i}\right]>0</math>.
}}
}}


;Example
== The random search algorithm ==
:Let <math>X_1,X_2,\ldots,X_m</math> be a set of ''mutually independent'' random variables. Each event <math>A_i</math> is a predicate defined on a number of variables among <math>X_1,X_2,\ldots,X_m</math>. Let <math>v(A_i)</math> be the unique smallest set of variables which determine <math>A_i</math>. The dependency graph <math>D=(V,E)</math> is defined by
The above theorem basically says that for a CNF if every individual clause is easy to satisfy and is dependent with few other clauses then the CNF should be always satisfiable. However, the theorem only states the existence of a satisfying solution, but does not specify a way to find this solution. Next we give a simple randomized algorithm and prove it can find the satisfying solution efficiently under a slightly stronger assumption than the Lovasz local lemma.  
:::<math>(i,j)\in E</math> iff <math>v(A_i)\cap v(A_j)\neq \emptyset</math>.


The following lemma, known as the Lovász local lemma, first proved by Erdős and Lovász in 1975, is an extremely powerful tool, as it supplies a way for dealing with rare events.
Given as input a CNF formula <math>\phi</math> defined on Boolean variables <math>\mathcal{X}=\{x_1,x_2,\ldots,x_n\}</math>, recall that for a clause <math>C</math> in a CNF <math>\phi</math>, we use <math>\mathsf{vbl}(C)\subseteq\mathcal{X}</math> to denote the set of variables on which <math>C</math> is defined.
 
The following algorithm is due to Moser in 2009. The algorithm consists of two components: the main function ''Solve''() and a sub-routine ''Fix''().


{{Theorem
{{Theorem
|Lovász Local Lemma (symmetric case)|
|Solve(CNF <math>\phi</math>)|
:Let <math>A_1,A_2,\ldots,A_n</math> be a set of events, and assume that the following hold:
:Pick values of <math>x_1,x_2\ldots,x_n</math> uniformly and independently at random;
:#for all <math>1\le i\le n</math>, <math>\Pr[A_i]\le p</math>;
:While there is an unsatisfied clause <math>C</math> in <math>\phi</math>
:#the maximum degree of the dependency graph for the events <math>A_1,A_2,\ldots,A_n</math> is <math>d</math>, and
:: '''Fix'''(<math>C</math>);
:::<math>ep(d+1)\le 1</math>.
:Then
::<math>\Pr\left[\bigwedge_{i=1}^n\overline{A_i}\right]>0</math>.
}}
}}


We will prove a general version of the local lemma, where the events <math>A_i</math> are not symmetric. This generalization is due to Spencer.
The sub-routine '''Fix()''' is a recursive procedure:
{{Theorem
{{Theorem
|Lovász Local Lemma (general case)|
|Fix(Clause <math>C</math>)|
:Let <math>D=(V,E)</math> be the dependency graph of events <math>A_1,A_2,\ldots,A_n</math>. Suppose there exist real numbers <math>x_1,x_2,\ldots, x_n</math> such that <math>0\le x_i<1</math> and for all <math>1\le i\le n</math>,
:Replace the values of variables in <math>\mathsf{vbl}(C)</math> with new uniform and independent random values;
::<math>\Pr[A_i]\le x_i\prod_{(i,j)\in E}(1-x_j)</math>.
:While there is ''unsatisfied'' clause <math>D</math> (including <math>C</math> itself) that <math>\mathsf{vbl}(C)\cap \mathsf{vbl}(D)\neq \emptyset</math>
:Then
:: '''Fix'''(<math>D</math>);
::<math>\Pr\left[\bigwedge_{i=1}^n\overline{A_i}\right]\ge\prod_{i=1}^n(1-x_i)</math>.
}}
}}


To see that the general LLL implies symmetric LLL, we set <math>x_i=\frac{1}{d+1}</math> for all <math>i=1,2,\ldots,n</math>. Then we have <math>\left(1-\frac{1}{d+1}\right)^d>\frac{1}{\mathrm{e}}</math>.
It is an amazing discovery that this simple algorithm works well as long as the condition of Lovasz local lemma is satisfied. Here we prove a slightly weaker statement for the convenience of analysis.


Assume the condition in the symmetric LLL:
{{Theorem|Theorem|
:#for all <math>1\le i\le n</math>, <math>\Pr[A_i]\le p</math>;
:Let <math>\phi</math> be an exact-<math>k</math>-CNF formula with maximum degree <math>d</math>.
:#<math>ep(d+1)\le 1</math>;
:There is a <math>d_0=\Theta(2^{k})</math> such that if <math>d+1< d_0</math> then the algorithm ''Solve''(<math>\phi</math>) finds a satisfying assignment for <math>\phi</math> in time <math>O(n+km\log m)</math> with high probability.
then it is easy to verify that for all <math>1\le i\le n</math>,
}}
:<math>\Pr[A_i]\le p\le\frac{1}{e(d+1)}<\frac{1}{d+1}\left(1-\frac{1}{d+1}\right)^d\le x_i\prod_{(i,j)\in E}(1-x_j)</math>.
Note that in the Lovasz local lemma, the above <math>d_0</math> is <math>d_0=2^{k}/\mathrm{e}</math>. So this theorem archives asymptotically the same bound as the Lovasz local lemma.
Due to the general LLL, we have
 
:<math>\Pr\left[\bigwedge_{i=1}^n\overline{A_i}\right]\ge\prod_{i=1}^n(1-x_i)=\left(1-\frac{1}{d+1}\right)^n>0</math>.
The analysis is based on a technique called '''''entropy compression'''''. This is a very clever idea and may be very different from what you might have seen so far about algorithm analysis.
This proves the symmetric LLL.
We first give a high-level description of this idea:
* We use <math>\mathsf{Alg}(r, \phi)</math> to abstractly denote an algorithm <math>\mathsf{Alg}</math> running on an input <math>\phi</math> with random bits <math>r\in\{0,1\}^*</math>. For an algorithm with no access to the random bits <math>r</math>, once the input <math>\phi</math> is fixed, the behavior of the algorithm as well as its output is ''deterministic''. But for ''randomized'' algorithms, the behavior of <math>\mathsf{Alg}(r, \phi)</math> is a random variable even when the input <math>\phi</math> is fixed.
* Fix an arbitrary (worst-case) input <math>\phi</math>. We try to construct a ''succinct representation'' <math>c</math> of the behavior of <math>\mathsf{Alg}(r, \phi)</math> in such a manner that the random bits <math>r</math> can always be fully recovered from this succinct representation <math>c</math>. In other words, <math>\mathsf{Alg}(r, \phi)</math> gives an encoding (a 1-1 mapping) of the random bits <math>r</math> to a succinct representation <math>c</math>.
* It is a fundamental law that random bits cannot be compressed significantly by any encoding. Therefore if a longer running time of <math>\mathsf{Alg}(r, \phi)</math> would imply that the random bits <math>r</math> can be encoded to a succinct representation <math>c</math> which is much shorter than <math>r</math>, then we prove the running time of the algorithm <math>\mathsf{Alg}(r, \phi)</math> cannot be too long.
:* A natural way to reach this last contradiction is to have the following situation: As the running time of <math>\mathsf{Alg}(r, \phi)</math> grows, naturally both lengths of random bits <math>r</math> and the succinct representation <math>c</math> of the behavior of <math>\mathsf{Alg}(r, \phi)</math> grow. So if the former grows much faster than the latter as the running time grows, then a large running time may cause the length of <math>r</math> significantly greater than the length of <math>c</math>.
 
---------
We now proceed to the analysis of <math>\text{Solve}(\phi)</math> and prove the above theorem.
 
From now on we assume that the input instance <math>\phi</math> is an arbitrarily fixed exact-<math>k</math>-CNF formula with maximum degree <math>d</math>:
*Let <math>T</math> denote the total number of time the function <math>\text{Fix}()</math> is being called (including both the calls in <math>\text{Solve}(\phi)</math> and the recursive calls).
*Let <math>t=\min\{T,2^m\}</math>.
Note that <math>T</math> and <math>t</math> are random variables which depend solely on the random bits used by the algorithm (after the input <math>\phi</math> being fixed).
We are going to show that <math>t=O(m\log m)</math> with high probability, which means <math>T=O(m\log m)</math> with high probability.
 
The reason we consider <math>t=\min\{T,2^m\}</math> is that we are not sure whether <math>T</math> is finite or infinite, so we "truncate" <math>T</math> if it becomes too large. This truncation threshold is quite arbitrary as long as it is significantly  greater than <math>m\log m</math>.


Now we prove the general LLL by the original induction proof.
We start by making the following simple observations:
{{Proof|
*A clause <math>C</math> in <math>\phi</math> will be satisfied after  '''Fix'''(<math>C</math>) returned and will remain as being satisfied afterwards.  
First, apply the chain rule. We have
*At the moment a '''Fix'''(<math>C</math>) being called, the clause  <math>C</math> must be unsatisfied.
:<math>\Pr\left[\bigwedge_{i=1}^n\overline{A_i}\right]=\prod_{i=1}^n\Pr\left[\overline{A_i}\mid \bigwedge_{j=1}^{i-1}\overline{A_{j}}\right]=\prod_{i=1}^n\left(1-\Pr\left[{A_i}\mid \bigwedge_{j=1}^{i-1}\overline{A_{j}}\right]\right)</math>.


Next we prove by induction on <math>m</math> that for any set of <math>m</math> events <math>i_1,\ldots,i_m</math>,
{{Theorem|Proposition|
:<math>\Pr\left[A_{i_1}\mid \bigwedge_{j=2}^m\overline{A_{i_j}}\right]\le x_{i_1}</math>.
# There are at most <math>m</math> top-level callings to  '''Fix'''(), where <math>m</math> is the total number of clauses in <math>\phi</math>.
The local lemma follows immediately by the above chain rule.
# If a '''Fix'''(<math>C</math>) is being called, the values of variables in <math>C</math> are uniquely determined.
}}


For <math>m=1</math>, this is obvious because
:<math>\Pr[A_{i_1}]\le x_{i_1}\prod_{(i_1,j)\in E}(1-x_j)\le x_{i_1}</math>.


For general <math>m</math>, let <math>i_2,\ldots,i_k</math> be the set of vertices adjacent to  <math>i_1</math> in the dependency graph, i.e. event <math>A_{i_1}</math> is mutually independent of <math>A_{i_{k+1}},A_{i_{k+2}},\ldots, A_{i_{m}}</math>.
----------
We consider a restrictive case.


By conditional probability, we have
Let <math>X_1,X_2,\ldots,X_m\in\{\mathrm{true},\mathrm{false}\}</math> be a set of ''mutually independent'' random variables which assume boolean values. Each event <math>A_i</math> is an AND of at most <math>k</math> literals (<math>X_i</math> or <math>\neg X_i</math>). Let <math>v(A_i)</math> be the set of the <math>k</math> variables that <math>A_i</math> depends on. The probability that none of the bad events occurs is
:<math>
:<math>
\Pr\left[A_{i_1}\mid \bigwedge_{j=2}^m\overline{A_{i_j}}\right]
\Pr\left[\bigwedge_{i=1}^n \overline{A_i}\right].
=\frac{\Pr\left[ A_i\wedge \bigwedge_{j=2}^k\overline{A_{i_j}}\mid \bigwedge_{j=k+1}^m\overline{A_{i_j}}\right]}
{\Pr\left[\bigwedge_{j=2}^k\overline{A_{i_j}}\mid \bigwedge_{j=k+1}^m\overline{A_{i_j}}\right]}
</math>.
First, we bound the numerator. Due to that <math>A_{i_1}</math> is mutually independent of <math>A_{i_{k+1}},A_{i_{k+2}},\ldots, A_{i_{m}}</math>, we have
:<math>
\begin{align}
\Pr\left[ A_{i_1}\wedge \bigwedge_{j=2}^k\overline{A_{i_j}}\mid \bigwedge_{j=k+1}^m\overline{A_{i_j}}\right]
&\le\Pr\left[ A_{i_1}\mid \bigwedge_{j=k+1}^m\overline{A_{i_j}}\right]\\
&=\Pr[A_{i_1}]\\
&\le x_{i_1}\prod_{(i_1,j)\in E}(1-x_j).
\end{align}
</math>
</math>
In this particular model, the dependency graph <math>D=(V,E)</math> is defined as that <math>(i,j)\in E</math> iff <math>v(A_i)\cap v(A_j)\neq \emptyset</math>.


Next, we bound the denominator. Applying the chain rule, we have
Observe that <math>\overline{A_i}</math> is a clause (OR of literals). Thus, <math>\bigwedge_{i=1}^n \overline{A_i}</math> is a '''<math>k</math>-CNF''', the CNF that each clause depends on <math>k</math> variables.
The probability
:<math>
:<math>
\Pr\left[\bigwedge_{j=2}^k\overline{A_{i_j}}\mid \bigwedge_{j=k+1}^m\overline{A_{i_j}}\right]
\bigwedge_{i=1}^n \overline{A_i}>0
=\prod_{j=2}^k\Pr\left[\overline{A_{i_j}}\mid \bigwedge_{\ell=j+1}^m\overline{A_{i_\ell}}\right]
</math>
</math>
which by the induction hypothesis, is at least  
means that the the <math>k</math>-CNF <math>\bigwedge_{i=1}^n \overline{A_i}</math> is satisfiable.
 
The satisfiability of <math>k</math>-CNF is a hard problem. In particular, 3SAT (the satisfiability of 3-CNF) is the first '''NP-complete''' problem (the Cook-Levin theorem). Given the current suspect on '''NP''' vs '''P''', we do not expect to solve this problem generally.
 
However, the condition of the Lovasz local lemma has an extra assumption on the degree of dependency graph. In our model, this means that each clause shares variables with at most <math>d</math> other clauses. We call a <math>k</math>-CNF with this property a <math>k</math>-CNF with bounded degree <math>d</math>.
 
Therefore, proving the Lovasz local lemma on the restricted forms of events as described above, can be reduced to the following problem:
;Problem
:Find a condition on <math>k</math> and <math>d</math>, such that any <math>k</math>-CNF with bounded degree <math>d</math> is satisfiable.
 
In 2009, Moser comes up with the following procedure solving the problem. He later generalizes the procedure to general forms of events. This not only gives a beautiful constructive proof to the Lovasz local lemma, but also provides an efficient randomized algorithm for finding a satisfiable assignment for a number of events with bounded dependencies.
 
Let <math>\phi</math> be a <math>k</math>-CNF of <math>n</math> clauses with bounded degree <math>d</math>,  defined on variables <math>X_1,\ldots,X_m</math>. The following procedure find a satisfiable assignment for <math>\phi</math>.
 
{{Theorem
|Solve(<math>\phi</math>)|
:Pick a random assignment of <math>X_1,\ldots,X_m</math>.
:While there is an unsatisfied clause <math>C</math> in <math>\phi</math>
:: '''Fix'''(<math>C</math>).
}}
 
The sub-routine '''Fix''' is defined as follows:
{{Theorem
|Fix(<math>C</math>)|
:Replace the variables in <math>v(C)</math> with new random values.
:While there is unsatisfied clause <math>D</math> that <math>v(C)\cap v(D)\neq \emptyset</math>
:: '''Fix'''(<math>D</math>).
}}
 
The procedure looks very simple. It just recursively fixes the unsatisfied clauses by randomly replacing the assignment to the variables.
 
We then prove it works.
 
===Number of top-level callings of Fix ===
In '''Solve'''(<math>\phi</math>), the subroutine '''Fix'''(<math>C</math>) is called. We now upper bound the number of times it is called (not including the recursive calls).
 
Assume '''Fix'''(<math>C</math>) always terminates.
:;Observation
::Every clause that was satisfied before '''Fix'''(<math>C</math>) was called will still remain satisfied and <math>C</math> will also be satisfied after '''Fix'''(<math>C</math>) returns.
 
The observation can be proved by induction on the structure of recursion.  Since there are <math>n</math> clauses, '''Solve'''(<math>\phi</math>) makes at most <math>n</math> calls to '''Fix'''.
 
We then prove that '''Fix'''(<math>C</math>) terminates.
 
=== Termination of Fix ===
The idea of the proof is to '''reconstruct''' a random string.
 
Suppose that during the running of '''Solve'''(<math>\phi</math>), the '''Fix''' subroutine is called for <math>t</math> times (including all the recursive calls).
 
Let <math>s</math> be the sequence of the random bits used by '''Solve'''(<math>\phi</math>). It is easy to see that the length of <math>s</math> is <math>|s|=m+tk</math>, because the initial random assignment of <math>m</math> variables takes <math>m</math> bits, and each time of calling '''Fix''' takes <math>k</math> bits.
 
We then reconstruct <math>s</math> in an alternative way.
 
Recall that '''Solve'''(<math>\phi</math>) calls '''Fix'''(<math>C</math>) at top-level for at most <math>n</math> times. Each calling of '''Fix'''(<math>C</math>) defines a recursion tree, rooted at clause <math>C</math>, and each node corresponds to a clause (not necessarily distinct, since a clause might be fixed for several times). Therefore, the entire running history of '''Solve'''(<math>\phi</math>) can be described by at most <math>n</math> recursion trees.
 
:;Observation 1
::Fix a <math>\phi</math>. The <math>n</math> recursion trees which capture the total running history of '''Solve'''(<math>\phi</math>) can be encoded in <math>n\log n+t(\log d+O(1))</math> bits.
Each root node corresponds to a clause. There are <math>n</math> clauses in <math>\phi</math>. The <math>n</math> root nodes can be represented in <math>n\log n</math> bits.
 
The smart part is how to encode the branches of the tree. Note that '''Fix'''(<math>C</math>) will call '''Fix'''(<math>D</math>) only for the <math>D</math> that shares variables with <math>C</math>. For a k-CNF with bounded degree <math>d</math>, each clause <math>C</math> can share variables with at most <math>d</math> many other clauses. Thus, each branch in the recursion tree can be represented  in <math>\log d</math> bits. There are extra <math>O(1)</math> bits needed to denote whether the recursion ends. So totally  <math>n\log n+t(\log d+O(1))</math> bits are sufficient to encode all <math>n</math> recursion trees.
 
:;Observation 2
::The random sequence <math>s</math> can be encoded in <math>m+n\log n+t(\log d+O(1))</math> bits.
 
With <math>n\log n+t(\log d+O(1))</math> bits, the structure of all the recursion trees can be encoded. With extra <math>m</math> bits, the final assignment of the <math>m</math>
variables is stored.
 
We then observe that with these information, the sequence of the random bits <math>s</math> can be reconstructed from backwards from the final assignment.
 
The key step is that a clause <math>C</math> is only fixed when it is unsatisfied (obvious), and an unsatisfied clause <math>C</math> must have exact one assignment (a clause is OR of literals, thus has exact one unsatisfied assignment). Thus, each node in the recursion tree tells the <math>k</math> random bits in the random sequence <math>s</math> used in the call of the Fix corresponding to the node. Therefore, <math>s</math> can be reconstructed from the final assignment plus at most <math>n</math> recursion trees, which can be encoded in at most <math>m+n\log n+t(\log d+O(1))</math> bits.
 
The following theorem lies in the heart of the '''Kolmogorov complexity'''. The theorem states that random sequence is '''incompressible'''.
{{Theorem
|Theorem (Kolmogorov)|
:For any encoding scheme , with high probability, a random sequence <math>s</math> is encoded in at least <math>|s|</math> bits.
}}
 
Applying the theorem, we have that with high probability,
:<math>m+n\log n+t(\log d+O(1))\ge |s|=m+tk</math>.
Therefore,
:<math>
:<math>
\prod_{j=2}^k(1-x_{i_j})=\prod_{\{i_1,i_j\}\in E}(1-x_j)
t(k-O(1)-\log d)\le n\log n.
</math>
</math>
where <math>E</math> is the set of edges in the dependency graph.
In order to bound <math>t</math>, we need
:<math>k-O(1)-\log d>0</math>,
which hold for <math>d< 2^{k-\alpha}</math> for some constant <math>\alpha>0</math>. In fact, in this case, <math>t=O(n\log n)</math>, the running time of the procedure is bounded by a polynomial!
 
=== Back to the local lemma ===
We showed that for <math>d<2^{k-O(1)}</math>, any <math>k</math>-CNF with bounded degree <math>d</math> is satisfiable, and the satisfied assignment can be found within polynomial time with high probability. Now we interprete this in a language of the local lemma.


Altogether, we prove the induction hypothesis
Recall that the symmetric version of the local lemma:
{{Theorem
|Theorem (The local lemma: symmetric case)|
:Let <math>A_1,A_2,\ldots,A_n</math> be a set of events, and assume that the following hold:
:#for all <math>1\le i\le n</math>, <math>\Pr[A_i]\le p</math>;
:#the maximum degree of the dependency graph for the events <math>A_1,A_2,\ldots,A_n</math> is <math>d</math>, and
:::<math>ep(d+1)\le 1</math>.
:Then
::<math>\Pr\left[\bigwedge_{i=1}^n\overline{A_i}\right]>0</math>.
}}
Suppose the underlying probability space is a number of mutually independent uniform random boolean variables, and the evens <math>\overline{A_i}</math> are clauses defined on <math>k</math> variables. Then,
:<math>
:<math>
\Pr\left[A_{i_1}\mid \bigwedge_{j=2}^m\overline{A_{i_j}}\right]
p=2^{-k}
\le\frac{x_{i_1}\prod_{(i_1,j)\in E}(1-x_j)}{\prod_{\{i_1,i_j\}\in E}(1-x_j)}\le x_{i_1}.
</math>
</math>
 
thus, the condition <math>ep(d+1)\le 1</math> means that  
Due to the chain rule, it holds that
:<math>
:<math>
\begin{align}
d<2^{k}/e
\Pr\left[\bigwedge_{i=1}^n\overline{A_i}\right]
&=\prod_{i=1}^n\Pr\left[\overline{A_i}\mid \bigwedge_{j=1}^{i-1}\overline{A_{j}}\right]\\
&=\prod_{i=1}^n\left(1-\Pr\left[A_i\mid \bigwedge_{j=1}^{i-1}\overline{A_{j}}\right]\right)\\
&\ge\prod_{i=1}^n\left(1-x_i\right).
\end{align}
</math>
</math>
}}
which means the Moser's procedure is asymptotically optimal on the degree of dependency.

Revision as of 10:01, 3 October 2016

Random Search for [math]\displaystyle{ k }[/math]-SAT

We start by giving the definition of [math]\displaystyle{ k }[/math]-CNF and [math]\displaystyle{ k }[/math]-SAT.

Definition (exact-[math]\displaystyle{ k }[/math]-CNF)
A logic expression [math]\displaystyle{ \phi }[/math] defined on [math]\displaystyle{ n }[/math] Boolean variables [math]\displaystyle{ x_1,x_2,\ldots,x_n\in\{\mathrm{true},\mathrm{false}\} }[/math] is said to be a conjunctive normal form (CNF) if [math]\displaystyle{ \phi }[/math] can be written as a conjunction(AND) of clauses as [math]\displaystyle{ \phi=C_1\wedge C_2\wedge\cdots\wedge C_m }[/math], where each clause [math]\displaystyle{ C_i=\ell_{i_1}\vee \ell_{i_2}\vee\cdots\vee\ell_{i_k} }[/math] is a disjunction(OR) of literals, where every literal [math]\displaystyle{ \ell_j }[/math] is either a variable [math]\displaystyle{ x_i }[/math] or the negation [math]\displaystyle{ \neg x_i }[/math] of a variable.
  • We call a CNF formula a exact-[math]\displaystyle{ k }[/math]-CNF if every clause consists of exact [math]\displaystyle{ k }[/math] distinct literals.

For example:

[math]\displaystyle{ (x_1\vee \neg x_2 \vee \neg x_3)\wedge (\neg x_1\vee \neg x_3\vee x_4)\wedge (x_1\vee x_2\vee x_4)\wedge (x_2\vee x_3\vee \neg x_4) }[/math]

is an exact-[math]\displaystyle{ 3 }[/math]-CNF formula.

Remark
The notion of exact-[math]\displaystyle{ k }[/math]-CNF is slightly more restrictive than the [math]\displaystyle{ k }[/math]-CNF, where each clause consists of at most [math]\displaystyle{ k }[/math] variables. The discussion of the subtle differences between these two definitions can be found here.

A logic expression [math]\displaystyle{ \phi }[/math] is said to be satisfiable if there is an assignment of values of true or false to the variables [math]\displaystyle{ \boldsymbol{x}=(x_1,x_2,\ldots,x_n) }[/math] so that [math]\displaystyle{ \phi(\boldsymbol{x}) }[/math] is true. For a CNF [math]\displaystyle{ \phi }[/math], this mean that there is a truth assignment that satisfies all clauses in [math]\displaystyle{ \phi }[/math] simultaneously.

The exact-[math]\displaystyle{ k }[/math]-satisfiability (exact-[math]\displaystyle{ k }[/math]-SAT) problem is that given as input an exact-[math]\displaystyle{ k }[/math]-CNF formula [math]\displaystyle{ \phi }[/math] decide whether [math]\displaystyle{ \phi }[/math] is satisfiable.

exact-[math]\displaystyle{ k }[/math]-SAT
Input: an exact-[math]\displaystyle{ k }[/math]-CNF formula [math]\displaystyle{ \phi }[/math].
Output: whether [math]\displaystyle{ \phi }[/math] is satisfiable.

It is well known that [math]\displaystyle{ k }[/math]-SAT is NP-complete for any [math]\displaystyle{ k\ge 3 }[/math]. The same also holds for the exact-[math]\displaystyle{ k }[/math]-SAT.

Satisfiability of exact-[math]\displaystyle{ k }[/math]-CNF

Inspired by the Lovasz local lemma, we now consider the dependencies between clauses in a CNF formula.

Given a CNF formula [math]\displaystyle{ \phi }[/math] defined over Boolean variables [math]\displaystyle{ \mathcal{X}=\{x_1,x_2,\ldots,x_n\} }[/math] and a clause [math]\displaystyle{ C }[/math] in [math]\displaystyle{ \phi }[/math], we use [math]\displaystyle{ \mathsf{vbl}(C)\subseteq\mathcal{X} }[/math] to denote the set of variables that appear in [math]\displaystyle{ C }[/math]. For a clause [math]\displaystyle{ C }[/math] in a CNF formula [math]\displaystyle{ \phi }[/math], its degree [math]\displaystyle{ d(C)=|\{D\neq C\mid \mathsf{D}\cap\mathsf{C}\neq\emptyset\}| }[/math] is the number of other clauses in [math]\displaystyle{ \phi }[/math] that share variables with [math]\displaystyle{ C }[/math]. The maximum degree [math]\displaystyle{ d }[/math] of a CNF formula [math]\displaystyle{ \phi }[/math] is [math]\displaystyle{ d=\max_{C\text{ in }\phi}d(C) }[/math].

By the Lovasz local lemma, we almost immediately have the following theorem for the satisfiability of exact-[math]\displaystyle{ k }[/math]-CNF with bounded degree.

Theorem
Let [math]\displaystyle{ \phi }[/math] be an exact-[math]\displaystyle{ k }[/math]-CNF formula with maximum degree [math]\displaystyle{ d }[/math]. If [math]\displaystyle{ d+1\le 2^{k}/\mathrm{e} }[/math] then [math]\displaystyle{ \phi }[/math] is always satisfiable.
Proof.

Let [math]\displaystyle{ X_1,X_2,\ldots,X_n }[/math] be Boolean random variables sampled uniformly and independently from [math]\displaystyle{ \{\text{true},\text{false}\} }[/math]. We are going to show that [math]\displaystyle{ \phi }[/math] is satisfied by this random assignment with positive probability. Due to the probabilistic method, this will prove the existence of a satisfying assignment for [math]\displaystyle{ \phi }[/math].

Suppose there are [math]\displaystyle{ m }[/math] clauses [math]\displaystyle{ C_1,C_2,\ldots,C_m }[/math] in [math]\displaystyle{ \phi }[/math]. Let [math]\displaystyle{ A_i }[/math] denote the bad event that [math]\displaystyle{ C_i }[/math] is not satisfied by the random assignment [math]\displaystyle{ X_1,X_2,\ldots,X_n }[/math]. Clearly, each [math]\displaystyle{ A_i }[/math] is dependent with at most [math]\displaystyle{ d }[/math] other [math]\displaystyle{ A_j }[/math]'s. And our goal is to show that

[math]\displaystyle{ \Pr\left[\bigwedge_{i=1}^m\overline{A_i}\right]\gt 0 }[/math].

Recall that in an exact-[math]\displaystyle{ k }[/math]-CNF, every clause [math]\displaystyle{ C_i }[/math] consists of exact [math]\displaystyle{ k }[/math] variable, and is violated by precisely one local assignment among all [math]\displaystyle{ 2^k }[/math] possibilities. Thus the probability that [math]\displaystyle{ C_i }[/math] is not satisfied is [math]\displaystyle{ \Pr[A_i]=2^{-k} }[/math].

Assuming that [math]\displaystyle{ d+1\le 2^{k}/\mathrm{e} }[/math], i.e. [math]\displaystyle{ \mathrm{e}(d+1)2^{-k}\le 1 }[/math], by the Lovasz local lemma (symmetric case), we have

[math]\displaystyle{ \Pr\left[\bigwedge_{i=1}^m\overline{A_i}\right]\gt 0 }[/math].
[math]\displaystyle{ \square }[/math]

The random search algorithm

The above theorem basically says that for a CNF if every individual clause is easy to satisfy and is dependent with few other clauses then the CNF should be always satisfiable. However, the theorem only states the existence of a satisfying solution, but does not specify a way to find this solution. Next we give a simple randomized algorithm and prove it can find the satisfying solution efficiently under a slightly stronger assumption than the Lovasz local lemma.

Given as input a CNF formula [math]\displaystyle{ \phi }[/math] defined on Boolean variables [math]\displaystyle{ \mathcal{X}=\{x_1,x_2,\ldots,x_n\} }[/math], recall that for a clause [math]\displaystyle{ C }[/math] in a CNF [math]\displaystyle{ \phi }[/math], we use [math]\displaystyle{ \mathsf{vbl}(C)\subseteq\mathcal{X} }[/math] to denote the set of variables on which [math]\displaystyle{ C }[/math] is defined.

The following algorithm is due to Moser in 2009. The algorithm consists of two components: the main function Solve() and a sub-routine Fix().

Solve(CNF [math]\displaystyle{ \phi }[/math])
Pick values of [math]\displaystyle{ x_1,x_2\ldots,x_n }[/math] uniformly and independently at random;
While there is an unsatisfied clause [math]\displaystyle{ C }[/math] in [math]\displaystyle{ \phi }[/math]
Fix([math]\displaystyle{ C }[/math]);

The sub-routine Fix() is a recursive procedure:

Fix(Clause [math]\displaystyle{ C }[/math])
Replace the values of variables in [math]\displaystyle{ \mathsf{vbl}(C) }[/math] with new uniform and independent random values;
While there is unsatisfied clause [math]\displaystyle{ D }[/math] (including [math]\displaystyle{ C }[/math] itself) that [math]\displaystyle{ \mathsf{vbl}(C)\cap \mathsf{vbl}(D)\neq \emptyset }[/math]
Fix([math]\displaystyle{ D }[/math]);

It is an amazing discovery that this simple algorithm works well as long as the condition of Lovasz local lemma is satisfied. Here we prove a slightly weaker statement for the convenience of analysis.

Theorem
Let [math]\displaystyle{ \phi }[/math] be an exact-[math]\displaystyle{ k }[/math]-CNF formula with maximum degree [math]\displaystyle{ d }[/math].
There is a [math]\displaystyle{ d_0=\Theta(2^{k}) }[/math] such that if [math]\displaystyle{ d+1\lt d_0 }[/math] then the algorithm Solve([math]\displaystyle{ \phi }[/math]) finds a satisfying assignment for [math]\displaystyle{ \phi }[/math] in time [math]\displaystyle{ O(n+km\log m) }[/math] with high probability.

Note that in the Lovasz local lemma, the above [math]\displaystyle{ d_0 }[/math] is [math]\displaystyle{ d_0=2^{k}/\mathrm{e} }[/math]. So this theorem archives asymptotically the same bound as the Lovasz local lemma.

The analysis is based on a technique called entropy compression. This is a very clever idea and may be very different from what you might have seen so far about algorithm analysis. We first give a high-level description of this idea:

  • We use [math]\displaystyle{ \mathsf{Alg}(r, \phi) }[/math] to abstractly denote an algorithm [math]\displaystyle{ \mathsf{Alg} }[/math] running on an input [math]\displaystyle{ \phi }[/math] with random bits [math]\displaystyle{ r\in\{0,1\}^* }[/math]. For an algorithm with no access to the random bits [math]\displaystyle{ r }[/math], once the input [math]\displaystyle{ \phi }[/math] is fixed, the behavior of the algorithm as well as its output is deterministic. But for randomized algorithms, the behavior of [math]\displaystyle{ \mathsf{Alg}(r, \phi) }[/math] is a random variable even when the input [math]\displaystyle{ \phi }[/math] is fixed.
  • Fix an arbitrary (worst-case) input [math]\displaystyle{ \phi }[/math]. We try to construct a succinct representation [math]\displaystyle{ c }[/math] of the behavior of [math]\displaystyle{ \mathsf{Alg}(r, \phi) }[/math] in such a manner that the random bits [math]\displaystyle{ r }[/math] can always be fully recovered from this succinct representation [math]\displaystyle{ c }[/math]. In other words, [math]\displaystyle{ \mathsf{Alg}(r, \phi) }[/math] gives an encoding (a 1-1 mapping) of the random bits [math]\displaystyle{ r }[/math] to a succinct representation [math]\displaystyle{ c }[/math].
  • It is a fundamental law that random bits cannot be compressed significantly by any encoding. Therefore if a longer running time of [math]\displaystyle{ \mathsf{Alg}(r, \phi) }[/math] would imply that the random bits [math]\displaystyle{ r }[/math] can be encoded to a succinct representation [math]\displaystyle{ c }[/math] which is much shorter than [math]\displaystyle{ r }[/math], then we prove the running time of the algorithm [math]\displaystyle{ \mathsf{Alg}(r, \phi) }[/math] cannot be too long.
  • A natural way to reach this last contradiction is to have the following situation: As the running time of [math]\displaystyle{ \mathsf{Alg}(r, \phi) }[/math] grows, naturally both lengths of random bits [math]\displaystyle{ r }[/math] and the succinct representation [math]\displaystyle{ c }[/math] of the behavior of [math]\displaystyle{ \mathsf{Alg}(r, \phi) }[/math] grow. So if the former grows much faster than the latter as the running time grows, then a large running time may cause the length of [math]\displaystyle{ r }[/math] significantly greater than the length of [math]\displaystyle{ c }[/math].

We now proceed to the analysis of [math]\displaystyle{ \text{Solve}(\phi) }[/math] and prove the above theorem.

From now on we assume that the input instance [math]\displaystyle{ \phi }[/math] is an arbitrarily fixed exact-[math]\displaystyle{ k }[/math]-CNF formula with maximum degree [math]\displaystyle{ d }[/math]:

  • Let [math]\displaystyle{ T }[/math] denote the total number of time the function [math]\displaystyle{ \text{Fix}() }[/math] is being called (including both the calls in [math]\displaystyle{ \text{Solve}(\phi) }[/math] and the recursive calls).
  • Let [math]\displaystyle{ t=\min\{T,2^m\} }[/math].

Note that [math]\displaystyle{ T }[/math] and [math]\displaystyle{ t }[/math] are random variables which depend solely on the random bits used by the algorithm (after the input [math]\displaystyle{ \phi }[/math] being fixed). We are going to show that [math]\displaystyle{ t=O(m\log m) }[/math] with high probability, which means [math]\displaystyle{ T=O(m\log m) }[/math] with high probability.

The reason we consider [math]\displaystyle{ t=\min\{T,2^m\} }[/math] is that we are not sure whether [math]\displaystyle{ T }[/math] is finite or infinite, so we "truncate" [math]\displaystyle{ T }[/math] if it becomes too large. This truncation threshold is quite arbitrary as long as it is significantly greater than [math]\displaystyle{ m\log m }[/math].

We start by making the following simple observations:

  • A clause [math]\displaystyle{ C }[/math] in [math]\displaystyle{ \phi }[/math] will be satisfied after Fix([math]\displaystyle{ C }[/math]) returned and will remain as being satisfied afterwards.
  • At the moment a Fix([math]\displaystyle{ C }[/math]) being called, the clause [math]\displaystyle{ C }[/math] must be unsatisfied.
Proposition
  1. There are at most [math]\displaystyle{ m }[/math] top-level callings to Fix(), where [math]\displaystyle{ m }[/math] is the total number of clauses in [math]\displaystyle{ \phi }[/math].
  2. If a Fix([math]\displaystyle{ C }[/math]) is being called, the values of variables in [math]\displaystyle{ C }[/math] are uniquely determined.



We consider a restrictive case.

Let [math]\displaystyle{ X_1,X_2,\ldots,X_m\in\{\mathrm{true},\mathrm{false}\} }[/math] be a set of mutually independent random variables which assume boolean values. Each event [math]\displaystyle{ A_i }[/math] is an AND of at most [math]\displaystyle{ k }[/math] literals ([math]\displaystyle{ X_i }[/math] or [math]\displaystyle{ \neg X_i }[/math]). Let [math]\displaystyle{ v(A_i) }[/math] be the set of the [math]\displaystyle{ k }[/math] variables that [math]\displaystyle{ A_i }[/math] depends on. The probability that none of the bad events occurs is

[math]\displaystyle{ \Pr\left[\bigwedge_{i=1}^n \overline{A_i}\right]. }[/math]

In this particular model, the dependency graph [math]\displaystyle{ D=(V,E) }[/math] is defined as that [math]\displaystyle{ (i,j)\in E }[/math] iff [math]\displaystyle{ v(A_i)\cap v(A_j)\neq \emptyset }[/math].

Observe that [math]\displaystyle{ \overline{A_i} }[/math] is a clause (OR of literals). Thus, [math]\displaystyle{ \bigwedge_{i=1}^n \overline{A_i} }[/math] is a [math]\displaystyle{ k }[/math]-CNF, the CNF that each clause depends on [math]\displaystyle{ k }[/math] variables. The probability

[math]\displaystyle{ \bigwedge_{i=1}^n \overline{A_i}\gt 0 }[/math]

means that the the [math]\displaystyle{ k }[/math]-CNF [math]\displaystyle{ \bigwedge_{i=1}^n \overline{A_i} }[/math] is satisfiable.

The satisfiability of [math]\displaystyle{ k }[/math]-CNF is a hard problem. In particular, 3SAT (the satisfiability of 3-CNF) is the first NP-complete problem (the Cook-Levin theorem). Given the current suspect on NP vs P, we do not expect to solve this problem generally.

However, the condition of the Lovasz local lemma has an extra assumption on the degree of dependency graph. In our model, this means that each clause shares variables with at most [math]\displaystyle{ d }[/math] other clauses. We call a [math]\displaystyle{ k }[/math]-CNF with this property a [math]\displaystyle{ k }[/math]-CNF with bounded degree [math]\displaystyle{ d }[/math].

Therefore, proving the Lovasz local lemma on the restricted forms of events as described above, can be reduced to the following problem:

Problem
Find a condition on [math]\displaystyle{ k }[/math] and [math]\displaystyle{ d }[/math], such that any [math]\displaystyle{ k }[/math]-CNF with bounded degree [math]\displaystyle{ d }[/math] is satisfiable.

In 2009, Moser comes up with the following procedure solving the problem. He later generalizes the procedure to general forms of events. This not only gives a beautiful constructive proof to the Lovasz local lemma, but also provides an efficient randomized algorithm for finding a satisfiable assignment for a number of events with bounded dependencies.

Let [math]\displaystyle{ \phi }[/math] be a [math]\displaystyle{ k }[/math]-CNF of [math]\displaystyle{ n }[/math] clauses with bounded degree [math]\displaystyle{ d }[/math], defined on variables [math]\displaystyle{ X_1,\ldots,X_m }[/math]. The following procedure find a satisfiable assignment for [math]\displaystyle{ \phi }[/math].

Solve([math]\displaystyle{ \phi }[/math])
Pick a random assignment of [math]\displaystyle{ X_1,\ldots,X_m }[/math].
While there is an unsatisfied clause [math]\displaystyle{ C }[/math] in [math]\displaystyle{ \phi }[/math]
Fix([math]\displaystyle{ C }[/math]).

The sub-routine Fix is defined as follows:

Fix([math]\displaystyle{ C }[/math])
Replace the variables in [math]\displaystyle{ v(C) }[/math] with new random values.
While there is unsatisfied clause [math]\displaystyle{ D }[/math] that [math]\displaystyle{ v(C)\cap v(D)\neq \emptyset }[/math]
Fix([math]\displaystyle{ D }[/math]).

The procedure looks very simple. It just recursively fixes the unsatisfied clauses by randomly replacing the assignment to the variables.

We then prove it works.

Number of top-level callings of Fix

In Solve([math]\displaystyle{ \phi }[/math]), the subroutine Fix([math]\displaystyle{ C }[/math]) is called. We now upper bound the number of times it is called (not including the recursive calls).

Assume Fix([math]\displaystyle{ C }[/math]) always terminates.

Observation
Every clause that was satisfied before Fix([math]\displaystyle{ C }[/math]) was called will still remain satisfied and [math]\displaystyle{ C }[/math] will also be satisfied after Fix([math]\displaystyle{ C }[/math]) returns.

The observation can be proved by induction on the structure of recursion. Since there are [math]\displaystyle{ n }[/math] clauses, Solve([math]\displaystyle{ \phi }[/math]) makes at most [math]\displaystyle{ n }[/math] calls to Fix.

We then prove that Fix([math]\displaystyle{ C }[/math]) terminates.

Termination of Fix

The idea of the proof is to reconstruct a random string.

Suppose that during the running of Solve([math]\displaystyle{ \phi }[/math]), the Fix subroutine is called for [math]\displaystyle{ t }[/math] times (including all the recursive calls).

Let [math]\displaystyle{ s }[/math] be the sequence of the random bits used by Solve([math]\displaystyle{ \phi }[/math]). It is easy to see that the length of [math]\displaystyle{ s }[/math] is [math]\displaystyle{ |s|=m+tk }[/math], because the initial random assignment of [math]\displaystyle{ m }[/math] variables takes [math]\displaystyle{ m }[/math] bits, and each time of calling Fix takes [math]\displaystyle{ k }[/math] bits.

We then reconstruct [math]\displaystyle{ s }[/math] in an alternative way.

Recall that Solve([math]\displaystyle{ \phi }[/math]) calls Fix([math]\displaystyle{ C }[/math]) at top-level for at most [math]\displaystyle{ n }[/math] times. Each calling of Fix([math]\displaystyle{ C }[/math]) defines a recursion tree, rooted at clause [math]\displaystyle{ C }[/math], and each node corresponds to a clause (not necessarily distinct, since a clause might be fixed for several times). Therefore, the entire running history of Solve([math]\displaystyle{ \phi }[/math]) can be described by at most [math]\displaystyle{ n }[/math] recursion trees.

Observation 1
Fix a [math]\displaystyle{ \phi }[/math]. The [math]\displaystyle{ n }[/math] recursion trees which capture the total running history of Solve([math]\displaystyle{ \phi }[/math]) can be encoded in [math]\displaystyle{ n\log n+t(\log d+O(1)) }[/math] bits.

Each root node corresponds to a clause. There are [math]\displaystyle{ n }[/math] clauses in [math]\displaystyle{ \phi }[/math]. The [math]\displaystyle{ n }[/math] root nodes can be represented in [math]\displaystyle{ n\log n }[/math] bits.

The smart part is how to encode the branches of the tree. Note that Fix([math]\displaystyle{ C }[/math]) will call Fix([math]\displaystyle{ D }[/math]) only for the [math]\displaystyle{ D }[/math] that shares variables with [math]\displaystyle{ C }[/math]. For a k-CNF with bounded degree [math]\displaystyle{ d }[/math], each clause [math]\displaystyle{ C }[/math] can share variables with at most [math]\displaystyle{ d }[/math] many other clauses. Thus, each branch in the recursion tree can be represented in [math]\displaystyle{ \log d }[/math] bits. There are extra [math]\displaystyle{ O(1) }[/math] bits needed to denote whether the recursion ends. So totally [math]\displaystyle{ n\log n+t(\log d+O(1)) }[/math] bits are sufficient to encode all [math]\displaystyle{ n }[/math] recursion trees.

Observation 2
The random sequence [math]\displaystyle{ s }[/math] can be encoded in [math]\displaystyle{ m+n\log n+t(\log d+O(1)) }[/math] bits.

With [math]\displaystyle{ n\log n+t(\log d+O(1)) }[/math] bits, the structure of all the recursion trees can be encoded. With extra [math]\displaystyle{ m }[/math] bits, the final assignment of the [math]\displaystyle{ m }[/math] variables is stored.

We then observe that with these information, the sequence of the random bits [math]\displaystyle{ s }[/math] can be reconstructed from backwards from the final assignment.

The key step is that a clause [math]\displaystyle{ C }[/math] is only fixed when it is unsatisfied (obvious), and an unsatisfied clause [math]\displaystyle{ C }[/math] must have exact one assignment (a clause is OR of literals, thus has exact one unsatisfied assignment). Thus, each node in the recursion tree tells the [math]\displaystyle{ k }[/math] random bits in the random sequence [math]\displaystyle{ s }[/math] used in the call of the Fix corresponding to the node. Therefore, [math]\displaystyle{ s }[/math] can be reconstructed from the final assignment plus at most [math]\displaystyle{ n }[/math] recursion trees, which can be encoded in at most [math]\displaystyle{ m+n\log n+t(\log d+O(1)) }[/math] bits.

The following theorem lies in the heart of the Kolmogorov complexity. The theorem states that random sequence is incompressible.

Theorem (Kolmogorov)
For any encoding scheme , with high probability, a random sequence [math]\displaystyle{ s }[/math] is encoded in at least [math]\displaystyle{ |s| }[/math] bits.

Applying the theorem, we have that with high probability,

[math]\displaystyle{ m+n\log n+t(\log d+O(1))\ge |s|=m+tk }[/math].

Therefore,

[math]\displaystyle{ t(k-O(1)-\log d)\le n\log n. }[/math]

In order to bound [math]\displaystyle{ t }[/math], we need

[math]\displaystyle{ k-O(1)-\log d\gt 0 }[/math],

which hold for [math]\displaystyle{ d\lt 2^{k-\alpha} }[/math] for some constant [math]\displaystyle{ \alpha\gt 0 }[/math]. In fact, in this case, [math]\displaystyle{ t=O(n\log n) }[/math], the running time of the procedure is bounded by a polynomial!

Back to the local lemma

We showed that for [math]\displaystyle{ d\lt 2^{k-O(1)} }[/math], any [math]\displaystyle{ k }[/math]-CNF with bounded degree [math]\displaystyle{ d }[/math] is satisfiable, and the satisfied assignment can be found within polynomial time with high probability. Now we interprete this in a language of the local lemma.

Recall that the symmetric version of the local lemma:

Theorem (The local lemma: symmetric case)
Let [math]\displaystyle{ A_1,A_2,\ldots,A_n }[/math] be a set of events, and assume that the following hold:
  1. for all [math]\displaystyle{ 1\le i\le n }[/math], [math]\displaystyle{ \Pr[A_i]\le p }[/math];
  2. the maximum degree of the dependency graph for the events [math]\displaystyle{ A_1,A_2,\ldots,A_n }[/math] is [math]\displaystyle{ d }[/math], and
[math]\displaystyle{ ep(d+1)\le 1 }[/math].
Then
[math]\displaystyle{ \Pr\left[\bigwedge_{i=1}^n\overline{A_i}\right]\gt 0 }[/math].

Suppose the underlying probability space is a number of mutually independent uniform random boolean variables, and the evens [math]\displaystyle{ \overline{A_i} }[/math] are clauses defined on [math]\displaystyle{ k }[/math] variables. Then,

[math]\displaystyle{ p=2^{-k} }[/math]

thus, the condition [math]\displaystyle{ ep(d+1)\le 1 }[/math] means that

[math]\displaystyle{ d\lt 2^{k}/e }[/math]

which means the Moser's procedure is asymptotically optimal on the degree of dependency.