# 组合数学 (Spring 2016)/The probabilistic method

## The Probabilistic Method

The probabilistic method provides another way of proving the existence of objects: instead of explicitly constructing an object, we define a probability space of objects in which the probability is positive that a randomly selected object has the required property.

The basic principle of the probabilistic method is very simple, and can be stated in intuitive ways:

• If an object chosen randomly from a universe satisfies a property with positive probability, then there must be an object in the universe that satisfies that property.
For example, for a ball(the object) randomly chosen from a box(the universe) of balls, if the probability that the chosen ball is blue(the property) is >0, then there must be a blue ball in the box.
• Any random variable assumes at least one value that is no smaller than its expectation, and at least one value that is no greater than the expectation.
For example, if we know the average height of the students in the class is ${\displaystyle \ell }$, then we know there is a students whose height is at least ${\displaystyle \ell }$, and there is a student whose height is at most ${\displaystyle \ell }$.

Although the idea of the probabilistic method is simple, it provides us a powerful tool for existential proof.

### Ramsey number

Recall the Ramsey theorem which states that in a meeting of at least six people, there are either three people knowing each other or three people not knowing each other. In graph theoretical terms, this means that no matter how we color the edges of ${\displaystyle K_{6}}$ (the complete graph on six vertices), there must be a monochromatic ${\displaystyle K_{3}}$ (a triangle whose edges have the same color).

Generally, the Ramsey number ${\displaystyle R(k,\ell )}$ is the smallest integer ${\displaystyle n}$ such that in any two-coloring of the edges of a complete graph on ${\displaystyle n}$ vertices ${\displaystyle K_{n}}$ by red and blue, either there is a red ${\displaystyle K_{k}}$ or there is a blue ${\displaystyle K_{\ell }}$.

Ramsey showed in 1929 that ${\displaystyle R(k,\ell )}$ is finite for any ${\displaystyle k}$ and ${\displaystyle \ell }$. It is extremely hard to compute the exact value of ${\displaystyle R(k,\ell )}$. Here we give a lower bound of ${\displaystyle R(k,k)}$ by the probabilistic method.

 Theorem (Erdős 1947) If ${\displaystyle {n \choose k}\cdot 2^{1-{k \choose 2}}<1}$ then it is possible to color the edges of ${\displaystyle K_{n}}$ with two colors so that there is no monochromatic ${\displaystyle K_{k}}$ subgraph.
Proof.
 Consider a random two-coloring of edges of ${\displaystyle K_{n}}$ obtained as follows: For each edge of ${\displaystyle K_{n}}$, independently flip a fair coin to decide the color of the edge. For any fixed set ${\displaystyle S}$ of ${\displaystyle k}$ vertices, let ${\displaystyle {\mathcal {E}}_{S}}$ be the event that the ${\displaystyle K_{k}}$ subgraph induced by ${\displaystyle S}$ is monochromatic. There are ${\displaystyle {k \choose 2}}$ many edges in ${\displaystyle K_{k}}$, therefore ${\displaystyle \Pr[{\mathcal {E}}_{S}]=2\cdot 2^{-{k \choose 2}}=2^{1-{k \choose 2}}.}$ Since there are ${\displaystyle {n \choose k}}$ possible choices of ${\displaystyle S}$, by the union bound ${\displaystyle \Pr[\exists S,{\mathcal {E}}_{S}]\leq {n \choose k}\cdot \Pr[{\mathcal {E}}_{S}]={n \choose k}\cdot 2^{1-{k \choose 2}}.}$ Due to the assumption, ${\displaystyle {n \choose k}\cdot 2^{1-{k \choose 2}}<1}$, thus there exists a two coloring that none of ${\displaystyle {\mathcal {E}}_{S}}$ occurs, which means there is no monochromatic ${\displaystyle K_{k}}$ subgraph.
${\displaystyle \square }$

For ${\displaystyle k\geq 3}$ and we take ${\displaystyle n=\lfloor 2^{k/2}\rfloor }$, then

{\displaystyle {\begin{aligned}{n \choose k}\cdot 2^{1-{k \choose 2}}&<{\frac {n^{k}}{k!}}\cdot {\frac {2^{1+{\frac {k}{2}}}}{2^{k^{2}/2}}}\\&\leq {\frac {2^{k^{2}/2}}{k!}}\cdot {\frac {2^{1+{\frac {k}{2}}}}{2^{k^{2}/2}}}\\&={\frac {2^{1+{\frac {k}{2}}}}{k!}}\\&<1.\end{aligned}}}

By the above theorem, there exists a two-coloring of ${\displaystyle K_{n}}$ that there is no monochromatic ${\displaystyle K_{k}}$. Therefore, the Ramsey number ${\displaystyle R(k,k)>\lfloor 2^{k/2}\rfloor }$ for all ${\displaystyle k\geq 3}$.

### Tournament

A tournament (竞赛图) on a set ${\displaystyle V}$ of ${\displaystyle n}$ players is an orientation of the edges of the complete graph on the set of vertices ${\displaystyle V}$. Thus for every two distinct vertices ${\displaystyle u,v}$ in ${\displaystyle V}$, either ${\displaystyle (u,v)\in E}$ or ${\displaystyle (v,u)\in E}$, but not both.

We can think of the set ${\displaystyle V}$ as a set of ${\displaystyle n}$ players in which each pair participates in a single match, where ${\displaystyle (u,v)}$ is in the tournament iff player ${\displaystyle u}$ beats player ${\displaystyle v}$.

 Definition We say that a tournament has ${\displaystyle k}$-paradoxical if for every set of ${\displaystyle k}$ players there is a player who beats them all.

Is it true for every finite ${\displaystyle k}$, there is a ${\displaystyle k}$-paradoxical tournament (on more than ${\displaystyle k}$ vertices, of course)? This problem was first raised by Schütte, and as shown by Erdős, can be solved almost trivially by the probabilistic method.

 Theorem (Erdős 1963) If ${\displaystyle {n \choose k}\left(1-2^{-k}\right)^{n-k}<1}$ then there is a tournament on ${\displaystyle n}$ vertices that is ${\displaystyle k}$-paradoxical.
Proof.
 Consider a uniformly random tournament ${\displaystyle T}$ on the set ${\displaystyle V=[n]}$. For every fixed subset ${\displaystyle S\in {V \choose k}}$ of ${\displaystyle k}$ vertices, let ${\displaystyle A_{S}}$ be the event defined as follows ${\displaystyle A_{S}:\,}$ there is no vertex in ${\displaystyle V\setminus S}$ that beats all vertices in ${\displaystyle S}$. In a uniform random tournament, the orientations of edges are independent. For any ${\displaystyle u\in V\setminus S}$, ${\displaystyle \Pr[u{\mbox{ beats all }}v\in S]=2^{-k}}$. Therefore, ${\displaystyle \Pr[u{\mbox{ does not beats all }}v\in S]=1-2^{-k}}$ and ${\displaystyle \Pr[A_{S}]=\prod _{u\in V\setminus S}\Pr[u{\mbox{ does not beats all }}v\in S]=(1-2^{-k})^{n-k}}$. It follows that ${\displaystyle \Pr \left[\bigvee _{S\in {V \choose k}}A_{S}\right]\leq \sum _{S\in {V \choose k}}\Pr[A_{S}]={n \choose k}(1-2^{-k})^{n-k}<1.}$ Therefore, ${\displaystyle \Pr[\,T{\mbox{ is }}k{\mbox{-paradoxical }}]=\Pr \left[\bigwedge _{S\in {V \choose k}}{\overline {A_{S}}}\right]=1-\Pr \left[\bigvee _{S\in {V \choose k}}A_{S}\right]>0.}$ There is a ${\displaystyle k}$-paradoxical tournament.
${\displaystyle \square }$

### Linearity of expectation

Let ${\displaystyle X}$ be a discrete random variable. The expectation of ${\displaystyle X}$ is defined as follows.

 Definition (Expectation) The expectation of a discrete random variable ${\displaystyle X}$, denoted by ${\displaystyle \mathbf {E} [X]}$, is given by {\displaystyle {\begin{aligned}\mathbf {E} [X]&=\sum _{x}x\Pr[X=x],\end{aligned}}} where the summation is over all values ${\displaystyle x}$ in the range of ${\displaystyle X}$.

A fundamental fact regarding the expectation is its linearity.

 Theorem (Linearity of Expectations) For any discrete random variables ${\displaystyle X_{1},X_{2},\ldots ,X_{n}}$, and any real constants ${\displaystyle a_{1},a_{2},\ldots ,a_{n}}$, {\displaystyle {\begin{aligned}\mathbf {E} \left[\sum _{i=1}^{n}a_{i}X_{i}\right]&=\sum _{i=1}^{n}a_{i}\cdot \mathbf {E} [X_{i}].\end{aligned}}}
Hamiltonian paths

The following result of Szele in 1943 is often considered the first use of the probabilistic method.

 Theorem (Szele 1943) There is a tournament on ${\displaystyle n}$ players with at least ${\displaystyle n!2^{-(n-1)}}$ Hamiltonian paths.
Proof.
 Consider the uniform random tournament ${\displaystyle T}$ on ${\displaystyle [n]}$. For any permutation ${\displaystyle \pi }$ of ${\displaystyle [n]}$, let ${\displaystyle X_{\pi }}$ be the indicator random variable defined as ${\displaystyle X_{\pi }={\begin{cases}1&\forall i\in [n-1],(\pi _{i},\pi _{i+1})\in T,\\0&{\mbox{otherwise}}.\end{cases}}}$ In other words, ${\displaystyle X_{\pi }}$ indicates whether ${\displaystyle \pi _{0}\rightarrow \pi _{1}\rightarrow \pi _{2}\rightarrow \cdots \rightarrow \pi _{n-1}}$ gives a Hamiltonian path. It holds that ${\displaystyle \mathrm {E} [X_{\pi }]=1\cdot \Pr[X_{\pi }=1]+0\cdot \Pr[X_{\pi }=0]=\Pr[\forall i\in [n-1],(\pi _{i},\pi _{i+1})\in T]=2^{-(n-1)}.}$ Let ${\displaystyle X=\sum _{\pi :{\text{permutation of }}[n]}X_{\pi }\,}$. Clearly ${\displaystyle X}$ is the number of Hamiltonian paths in the tournament ${\displaystyle T}$. Due to the linearity of expectation, ${\displaystyle \mathrm {E} [X]=\mathrm {E} \left[\sum _{\pi :{\text{permutation of }}[n]}X_{\pi }\right]=\sum _{\pi :{\text{permutation of }}[n]}\mathrm {E} [X_{\pi }]=n!2^{-(n-1)}.}$ This is the average number of Hamiltonian paths in a tournament, where the average is taken over all tournaments. Thus some tournament has at least ${\displaystyle n!2^{-(n-1)}}$ Hamiltonian paths.
${\displaystyle \square }$

### Independent sets

An independent set of a graph is a set of vertices with no edges between them. The following theorem gives a lower bound on the size of the largest independent set.

 Theorem Let ${\displaystyle G(V,E)}$ be a graph on ${\displaystyle n}$ vertices with ${\displaystyle m}$ edges. Then ${\displaystyle G}$ has an independent set with at least ${\displaystyle {\frac {n^{2}}{4m}}}$ vertices.
Proof.
 Let ${\displaystyle S}$ be a set of vertices constructed as follows: For each vertex ${\displaystyle v\in V}$: ${\displaystyle v}$ is included in ${\displaystyle S}$ independently with probability ${\displaystyle p}$, ${\displaystyle p}$ to be determined. Let ${\displaystyle X=|S|}$. It is obvious that ${\displaystyle \mathbf {E} [X]=np}$. For each edge ${\displaystyle e\in E}$, let ${\displaystyle Y_{e}}$ be the random variable which indicates whether both endpoints of ${\displaystyle e=uv}$ are in ${\displaystyle S}$. ${\displaystyle \mathbf {E} [Y_{uv}]=\Pr[u\in S\wedge v\in S]=p^{2}.}$ Let ${\displaystyle Y}$ be the number of edges in the subgraph of ${\displaystyle G}$ induced by ${\displaystyle S}$. It holds that ${\displaystyle Y=\sum _{e\in E}Y_{e}}$. By linearity of expectation, ${\displaystyle \mathbf {E} [Y]=\sum _{e\in E}\mathbf {E} [Y_{e}]=mp^{2}}$. Note that although ${\displaystyle S}$ is not necessary an independent set, it can be modified to one if for each edge ${\displaystyle e}$ of the induced subgraph ${\displaystyle G(S)}$, we delete one of the endpoint of ${\displaystyle e}$ from ${\displaystyle S}$. Let ${\displaystyle S^{*}}$ be the resulting set. It is obvious that ${\displaystyle S^{*}}$ is an independent set since there is no edge left in the induced subgraph ${\displaystyle G(S^{*})}$. Since there are ${\displaystyle Y}$ edges in ${\displaystyle G(S)}$, there are at most ${\displaystyle Y}$ vertices in ${\displaystyle S}$ are deleted to make it become ${\displaystyle S^{*}}$. Therefore, ${\displaystyle |S^{*}|\geq X-Y}$. By linearity of expectation, ${\displaystyle \mathbf {E} [|S^{*}|]\geq \mathbf {E} [X-Y]=\mathbf {E} [X]-\mathbf {E} [Y]=np-mp^{2}.}$ The expectation is maximized when ${\displaystyle p={\frac {n}{2m}}}$, thus ${\displaystyle \mathbf {E} [|S^{*}|]\geq n\cdot {\frac {n}{2m}}-m\left({\frac {n}{2m}}\right)^{2}={\frac {n^{2}}{4m}}.}$ There exists an independent set which contains at least ${\displaystyle {\frac {n^{2}}{4m}}}$ vertices.
${\displaystyle \square }$

### Coloring large-girth graphs

The girth of a graph is the length of the shortest cycle of the graph.

 Definition Let ${\displaystyle G(V,E)}$ be an undirected graph. A cycle of length ${\displaystyle k}$ in ${\displaystyle G}$ is a sequence of distinct vertices ${\displaystyle v_{1},v_{2},\ldots ,v_{k}}$ such that ${\displaystyle v_{i}v_{i+1}\in E}$ for all ${\displaystyle i=1,2,\ldots ,k-1}$ and ${\displaystyle v_{k}v_{1}\in E}$. The girth of ${\displaystyle G}$, dented ${\displaystyle g(G)}$, is the length of the shortest cycle in ${\displaystyle G}$.

The chromatic number of a graph is the minimum number of colors with which the graph can be properly colored.

 Definition (chromatic number) The chromatic number of ${\displaystyle G}$, denoted ${\displaystyle \chi (G)}$, is the minimal number of colors which we need to color the vertices of ${\displaystyle G}$ so that no two adjacent vertices have the same color. Formally, ${\displaystyle \chi (G)=\min\{C\in \mathbb {N} \mid \exists f:V\rightarrow [C]{\mbox{ such that }}\forall uv\in E,f(u)\neq f(v)\}}$.

In 1959, Erdős proved the following theorem: for any fixed ${\displaystyle k}$ and ${\displaystyle \ell }$, there exists a finite graph with girth at least ${\displaystyle k}$ and chromatic number at least ${\displaystyle \ell }$. This is considered a striking example of the probabilistic method. The statement of the theorem itself calls for nothing about probability or randomness. And the result is highly contra-intuitive: if the girth is large there is no simple reason why the graph could not be colored with a few colors. We can always "locally" color a cycle with 2 or 3 colors. Erdős' result shows that there are "global" restrictions for coloring, and although such configurations are very difficult to explicitly construct, with the probabilistic method, we know that they commonly exist.

 Theorem (Erdős 1959) For all ${\displaystyle k,\ell }$ there exists a graph ${\displaystyle G}$ with ${\displaystyle g(G)>\ell }$ and ${\displaystyle \chi (G)>k\,}$.

It is very hard to directly analyze the chromatic number of a graph. We find that the chromatic number can be related to the size of the maximum independent set.

 Definition (independence number) The independence number of ${\displaystyle G}$, denoted ${\displaystyle \alpha (G)}$, is the size of the largest independent set in ${\displaystyle G}$. Formally, ${\displaystyle \alpha (G)=\max\{|S|\mid S\subseteq V{\mbox{ and }}\forall u,v\in S,uv\not \in E\}}$.

We observe the following relationship between the chromatic number and the independence number.

 Lemma For any ${\displaystyle n}$-vertex graph, ${\displaystyle \chi (G)\geq {\frac {n}{\alpha (G)}}}$.
Proof.
 In the optimal coloring, ${\displaystyle n}$ vertices are partitioned into ${\displaystyle \chi (G)}$ color classes according to the vertex color. Every color class is an independent set, or otherwise there exist two adjacent vertice with the same color. By the pigeonhole principle, there is a color class (hence an independent set) of size ${\displaystyle {\frac {n}{\chi (G)}}}$. Therefore, ${\displaystyle \alpha (G)\geq {\frac {n}{\chi (G)}}}$. The lemma follows.
${\displaystyle \square }$

Therefore, it is sufficient to prove that ${\displaystyle \alpha (G)\leq {\frac {n}{k}}}$ and ${\displaystyle g(G)>\ell }$.

Proof of Erdős theorem
 Fix ${\displaystyle \theta <{\frac {1}{\ell }}}$. Let ${\displaystyle G}$ be ${\displaystyle G(n,p)}$ with ${\displaystyle p=n^{\theta -1}}$. For any length-${\displaystyle i}$ simple cycle ${\displaystyle \sigma }$, let ${\displaystyle X_{\sigma }}$ be the indicator random variable such that ${\displaystyle X_{\sigma }={\begin{cases}1&\sigma {\mbox{ is a cycle in }}G,\\0&{\mbox{otherwise}}.\end{cases}}}$ The number of cycles of length at most ${\displaystyle \ell }$ in graph ${\displaystyle G}$ is ${\displaystyle X=\sum _{i=3}^{\ell }\sum _{\sigma :i{\text{-cycle}}}X_{\sigma }}$. For any particular length-${\displaystyle i}$ simple cycle ${\displaystyle \sigma }$, ${\displaystyle \mathbf {E} [X_{\sigma }]=\Pr[X_{\sigma }=1]=\Pr[\sigma {\mbox{ is a cycle in }}G]=p^{i}=n^{\theta i-i}}$. For any ${\displaystyle 3\leq i\leq n}$, the number of length-${\displaystyle i}$ simple cycle is ${\displaystyle {\frac {n(n-1)\cdots (n-i+1)}{2i}}}$. By the linearity of expectation, ${\displaystyle \mathbf {E} [X]=\sum _{i=3}^{\ell }\sum _{\sigma :i{\text{-cycle}}}\mathbf {E} [X_{\sigma }]=\sum _{i=3}^{\ell }{\frac {n(n-1)\cdots (n-i+1)}{2i}}n^{\theta i-i}\leq \sum _{i=3}^{\ell }{\frac {n^{\theta i}}{2i}}=o(n)}$. Applying Markov's inequality, ${\displaystyle \Pr \left[X\geq {\frac {n}{2}}\right]\leq {\frac {\mathbf {E} [X]}{n/2}}=o(1).}$ Therefore, with high probability the random graph has less than ${\displaystyle n/2}$ short cycles. Now we proceed to analyze the independence number. Let ${\displaystyle m=\left\lceil {\frac {3\ln n}{p}}\right\rceil }$, so that {\displaystyle {\begin{aligned}\Pr[\alpha (G)\geq m]&\leq \Pr \left[\exists S\in {V \choose m}\forall \{u,v\}\in {S \choose 2},uv\not \in G\right]\\&\leq {n \choose m}(1-p)^{m \choose 2}\\& The probability that either of the above events occurs is {\displaystyle {\begin{aligned}\Pr \left[X\geq {\frac {n}{2}}\vee \alpha (G)\geq m\right]\leq \Pr \left[X\geq {\frac {n}{2}}\right]+\Pr \left[\alpha (G)\geq m\right]=o(1).\end{aligned}}} Therefore, there exists a graph ${\displaystyle G}$ with less than ${\displaystyle n/2}$ "short" cycles, i.e., cycles of length at most ${\displaystyle \ell }$, and with ${\displaystyle \alpha (G). Take each "short" cycle in ${\displaystyle G}$ and remove a vertex from the cycle (and also remove all adjacent edges to the removed vertex). This gives a graph ${\displaystyle G'}$ which has no short cycles, hence the girth ${\displaystyle g(G')\geq \ell }$. And ${\displaystyle G'}$ has at least ${\displaystyle n/2}$ vertices, because at most ${\displaystyle n/2}$ vertices are removed. Notice that removing vertices cannot makes ${\displaystyle \alpha (G)}$ grow. It holds that ${\displaystyle \alpha (G')\leq \alpha (G)}$. Thus ${\displaystyle \chi (G')\geq {\frac {n/2}{\alpha (G')}}\geq {\frac {n}{2m}}\geq {\frac {n^{\theta }}{6\ln n}}}$. The theorem is proved by taking ${\displaystyle n}$ sufficiently large so that this value is greater than ${\displaystyle k}$.
${\displaystyle \square }$

The proof contains a very simple procedure which for any ${\displaystyle k}$ and ${\displaystyle \ell }$ generates such a graph ${\displaystyle G}$ with ${\displaystyle g(G)>\ell }$ and ${\displaystyle \chi (G)>k}$. The procedure is as such:

• Fix some ${\displaystyle \theta <{\frac {1}{\ell }}}$. Choose sufficiently large ${\displaystyle n}$ with ${\displaystyle {\frac {n^{\theta }}{6\ln n}}>k}$, and let ${\displaystyle p=n^{\theta -1}}$.
• Generate a random graph ${\displaystyle G}$ as ${\displaystyle G(n,p)}$.
• For each cycle of length at most ${\displaystyle \ell }$ in ${\displaystyle G}$, remove a vertex from the cycle.

The resulting graph ${\displaystyle G'}$ satisfying that ${\displaystyle g(G)>\ell }$ and ${\displaystyle \chi (G)>k}$ with high probability.

## Lovász Local Lemma

Consider a set of "bad" events ${\displaystyle A_{1},A_{2},\ldots ,A_{n}}$. Suppose that ${\displaystyle \Pr[A_{i}]\leq p}$ for all ${\displaystyle 1\leq i\leq n}$. We want to show that there is a situation that none of the bad events occurs. Due to the probabilistic method, we need to prove that

${\displaystyle \Pr \left[\bigwedge _{i=1}^{n}{\overline {A_{i}}}\right]>0.}$
Case 1: mutually independent events.

If all the bad events ${\displaystyle A_{1},A_{2},\ldots ,A_{n}}$ are mutually independent, then

${\displaystyle \Pr \left[\bigwedge _{i=1}^{n}{\overline {A_{i}}}\right]\geq (1-p)^{n}>0,}$

for any ${\displaystyle p<1}$.

Case 2: arbitrarily dependent events.

On the other hand, if we put no assumption on the dependencies between the events, then by the union bound (which holds unconditionally),

${\displaystyle \Pr \left[\bigwedge _{i=1}^{n}{\overline {A_{i}}}\right]=1-\Pr \left[\bigvee _{i=1}^{n}A_{i}\right]\geq 1-np,}$

which is not an interesting bound for ${\displaystyle p\geq {\frac {1}{n}}}$. We cannot improve bound without further information regarding the dependencies between the events.

We would like to know what is going on between the two extreme cases: mutually independent events, and arbitrarily dependent events. The Lovász local lemma provides such a tool.

The local lemma is powerful tool for showing the possibility of rare event under limited dependencies. The structure of dependencies between a set of events is described by a dependency graph.

 Definition Let ${\displaystyle A_{1},A_{2},\ldots ,A_{n}}$ be a set of events. A graph ${\displaystyle D=(V,E)}$ on the set of vertices ${\displaystyle V=\{1,2,\ldots ,n\}}$ is called a dependency graph for the events ${\displaystyle A_{1},\ldots ,A_{n}}$ if for each ${\displaystyle i}$, ${\displaystyle 1\leq i\leq n}$, the event ${\displaystyle A_{i}}$ is mutually independent of all the events ${\displaystyle \{A_{j}\mid (i,j)\not \in E\}}$.
Example
Let ${\displaystyle X_{1},X_{2},\ldots ,X_{m}}$ be a set of mutually independent random variables. Each event ${\displaystyle A_{i}}$ is a predicate defined on a number of variables among ${\displaystyle X_{1},X_{2},\ldots ,X_{m}}$. Let ${\displaystyle v(A_{i})}$ be the unique smallest set of variables which determine ${\displaystyle A_{i}}$. The dependency graph ${\displaystyle D=(V,E)}$ is defined by
${\displaystyle (i,j)\in E}$ iff ${\displaystyle v(A_{i})\cap v(A_{j})\neq \emptyset }$.

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.

 Lovász Local Lemma (symmetric case) Let ${\displaystyle A_{1},A_{2},\ldots ,A_{n}}$ be a set of events, and assume that the following hold: for all ${\displaystyle 1\leq i\leq n}$, ${\displaystyle \Pr[A_{i}]\leq p}$; the maximum degree of the dependency graph for the events ${\displaystyle A_{1},A_{2},\ldots ,A_{n}}$ is ${\displaystyle d}$, and ${\displaystyle ep(d+1)\leq 1}$. Then ${\displaystyle \Pr \left[\bigwedge _{i=1}^{n}{\overline {A_{i}}}\right]>0}$.

We will prove a general version of the local lemma, where the events ${\displaystyle A_{i}}$ are not symmetric. This generalization is due to Spencer.

 Lovász Local Lemma (general case) Let ${\displaystyle D=(V,E)}$ be the dependency graph of events ${\displaystyle A_{1},A_{2},\ldots ,A_{n}}$. Suppose there exist real numbers ${\displaystyle x_{1},x_{2},\ldots ,x_{n}}$ such that ${\displaystyle 0\leq x_{i}<1}$ and for all ${\displaystyle 1\leq i\leq n}$, ${\displaystyle \Pr[A_{i}]\leq x_{i}\prod _{(i,j)\in E}(1-x_{j})}$. Then ${\displaystyle \Pr \left[\bigwedge _{i=1}^{n}{\overline {A_{i}}}\right]\geq \prod _{i=1}^{n}(1-x_{i})}$.
Proof.

We can use the following probability identity to compute the probability of the intersection of events:

 Lemma 1 ${\displaystyle \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]}$.
Proof.
 By definition of conditional probability, ${\displaystyle \Pr \left[{\overline {A_{n}}}\mid \bigwedge _{i=1}^{n-1}{\overline {A_{i}}}\right]={\frac {\Pr \left[\bigwedge _{i=1}^{n}{\overline {A_{i}}}\right]}{\Pr \left[\bigwedge _{i=1}^{n-1}{\overline {A_{i}}}\right]}}}$, so we have ${\displaystyle \Pr \left[\bigwedge _{i=1}^{n}{\overline {A_{i}}}\right]=\Pr \left[\bigwedge _{i=1}^{n-1}{\overline {A_{i}}}\right]\Pr \left[{\overline {A_{n}}}\mid \bigwedge _{i=1}^{n-1}{\overline {A_{i}}}\right]}$. The lemma is proved by recursively applying this equation.
${\displaystyle \square }$

Next we prove by induction on ${\displaystyle m}$ that for any set of ${\displaystyle m}$ events ${\displaystyle i_{1},\ldots ,i_{m}}$,

${\displaystyle \Pr \left[A_{i_{1}}\mid \bigwedge _{j=2}^{m}{\overline {A_{i_{j}}}}\right]\leq x_{i_{1}}}$.

The local lemma is a direct consequence of this by applying Lemma 1.

For ${\displaystyle m=1}$, this is obvious. For general ${\displaystyle m}$, let ${\displaystyle i_{2},\ldots ,i_{k}}$ be the set of vertices adjacent to ${\displaystyle i_{1}}$ in the dependency graph. Clearly ${\displaystyle k-1\leq d}$. And it holds that

${\displaystyle \Pr \left[A_{i_{1}}\mid \bigwedge _{j=2}^{m}{\overline {A_{i_{j}}}}\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]}}}$,

which is due to the basic conditional probability identity

${\displaystyle \Pr[A\mid BC]={\frac {\Pr[AB\mid C]}{\Pr[B\mid C]}}}$.

We bound the numerator

{\displaystyle {\begin{aligned}\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]&\leq \Pr \left[A_{i_{1}}\mid \bigwedge _{j=k+1}^{m}{\overline {A_{i_{j}}}}\right]\\&=\Pr[A_{i_{1}}]\\&\leq x_{i_{1}}\prod _{(i_{1},j)\in E}(1-x_{j}).\end{aligned}}}

The equation is due to the independence between ${\displaystyle A_{i_{1}}}$ and ${\displaystyle A_{i_{k}+1},\ldots ,A_{i_{m}}}$.

The denominator can be expanded using Lemma 1 as

${\displaystyle \Pr \left[\bigwedge _{j=2}^{k}{\overline {A_{i_{j}}}}\mid \bigwedge _{j=k+1}^{m}{\overline {A_{i_{j}}}}\right]=\prod _{j=2}^{k}\Pr \left[{\overline {A_{i_{j}}}}\mid \bigwedge _{\ell =j+1}^{m}{\overline {A_{i_{\ell }}}}\right]}$

which by the induction hypothesis, is at least

${\displaystyle \prod _{j=2}^{k}(1-x_{i_{j}})=\prod _{\{i_{1},i_{j}\}\in E}(1-x_{j})}$

where ${\displaystyle E}$ is the edge set of the dependency graph.

Therefore,

${\displaystyle \Pr \left[A_{i_{1}}\mid \bigwedge _{j=2}^{m}{\overline {A_{i_{j}}}}\right]\leq {\frac {x_{i_{1}}\prod _{(i_{1},j)\in E}(1-x_{j})}{\prod _{\{i_{1},i_{j}\}\in E}(1-x_{j})}}\leq x_{i_{1}}.}$

Applying Lemma 1,

{\displaystyle {\begin{aligned}\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)\\&\geq \prod _{i=1}^{n}\left(1-x_{i}\right).\end{aligned}}}
${\displaystyle \square }$

To prove the symmetric case. Let ${\displaystyle x_{i}={\frac {1}{d+1}}}$ for all ${\displaystyle i=1,2,\ldots ,n}$. Note that ${\displaystyle \left(1-{\frac {1}{d+1}}\right)^{d}>{\frac {1}{\mathrm {e} }}}$.

If the following conditions are satisfied:

1. for all ${\displaystyle 1\leq i\leq n}$, ${\displaystyle \Pr[A_{i}]\leq p}$;
2. ${\displaystyle ep(d+1)\leq 1}$;

then for all ${\displaystyle 1\leq i\leq n}$,

${\displaystyle \Pr[A_{i}]\leq p\leq {\frac {1}{e(d+1)}}<{\frac {1}{d+1}}\left(1-{\frac {1}{d+1}}\right)^{d}\leq x_{i}\prod _{(i,j)\in E}(1-x_{j})}$.

Due to the local lemma for general cases, this implies that

${\displaystyle \Pr \left[\bigwedge _{i=1}^{n}{\overline {A_{i}}}\right]\geq \prod _{i=1}^{n}(1-x_{i})=\left(1-{\frac {1}{d+1}}\right)^{n}>0}$.

This gives the symmetric version of local lemma.

### Ramsey number, revisited

 Ramsey number Let ${\displaystyle k,\ell }$ be positive integers. The Ramsey number ${\displaystyle R(k,\ell )}$ is defined as the smallest integer satisfying: If ${\displaystyle n\geq R(k,\ell )}$, for any coloring of edges of ${\displaystyle K_{n}}$ with two colors red and blue, there exists a red ${\displaystyle K_{k}}$ or a blue ${\displaystyle K_{\ell }}$.

The Ramsey theorem says that for any ${\displaystyle k,\ell }$, ${\displaystyle R(k,\ell )}$ is finite. The actual value of ${\displaystyle R(k,\ell )}$ is extremely difficult to compute. We can use the local lemma to prove a lower bound for the diagonal Ramsey number.

 Theorem ${\displaystyle R(k,k)\geq Ck2^{k/2}}$ for some constant ${\displaystyle C>0}$.
Proof.
 To prove a lower bound ${\displaystyle R(k,k)>n}$, it is sufficient to show that there exists a 2-coloring of ${\displaystyle K_{n}}$ without a monochromatic ${\displaystyle K_{k}}$. We prove this by the probabilistic method. Pick a random 2-coloring of ${\displaystyle K_{n}}$ by coloring each edge uniformly and independently with one of the two colors. For any set ${\displaystyle S}$ of ${\displaystyle k}$ vertices, let ${\displaystyle A_{S}}$ denote the event that ${\displaystyle S}$ forms a monochromatic ${\displaystyle K_{k}}$. It is easy to see that ${\displaystyle \Pr[A_{s}]=2^{1-{k \choose 2}}=p}$. For any ${\displaystyle k}$-subset ${\displaystyle T}$ of vertices, ${\displaystyle A_{S}}$ and ${\displaystyle A_{T}}$ are dependent if and only if ${\displaystyle |S\cap T|\geq 2}$. For each ${\displaystyle S}$, the number of ${\displaystyle T}$ that ${\displaystyle |S\cap T|\geq 2}$ is at most ${\displaystyle {k \choose 2}{n \choose k-2}}$, so the max degree of the dependency graph is ${\displaystyle d\leq {k \choose 2}{n \choose k-2}}$. Take ${\displaystyle n=Ck2^{k/2}}$ for some appropriate constant ${\displaystyle C>0}$. {\displaystyle {\begin{aligned}\mathrm {e} p(d+1)&\leq \mathrm {e} 2^{1-{k \choose 2}}\left({k \choose 2}{n \choose k-2}+1\right)\\&\leq 2^{3-{k \choose 2}}{k \choose 2}{n \choose k-2}\\&\leq 1\end{aligned}}} Applying the local lemma, the probability that there is no monochromatic ${\displaystyle K_{k}}$ is ${\displaystyle \Pr \left[\bigwedge _{S\in {[n] \choose k}}{\overline {A_{S}}}\right]>0}$. Therefore, there exists a 2-coloring of ${\displaystyle K_{n}}$ which has no monochromatic ${\displaystyle K_{k}}$, which means ${\displaystyle R(k,k)>n=Ck2^{k/2}}$.
${\displaystyle \square }$