76
1 1 Slides by Golan Weisz, Omer Ben Shalom Slides by Golan Weisz, Omer Ben Shalom Nir Ailon & Tal Moran Nir Ailon & Tal Moran Adapted from Oded Goldreich’s course lecture notes Adapted from Oded Goldreich’s course lecture notes by Moshe Lewenstien , Yehuda Lindell & Tamar Seeman by Moshe Lewenstien , Yehuda Lindell & Tamar Seeman

Slides by Golan Weisz, Omer Ben Shalom Nir Ailon & Tal Moran

Embed Size (px)

DESCRIPTION

P/Poly. Slides by Golan Weisz, Omer Ben Shalom Nir Ailon & Tal Moran Adapted from Oded Goldreich’s course lecture notes by Moshe Lewenstien , Yehuda Lindell & Tamar Seeman. In This Lecture. The non-uniform polynomial time class ( P/Poly ) The two equivalent definitions for the class - PowerPoint PPT Presentation

Citation preview

Page 1: Slides by Golan Weisz, Omer Ben Shalom Nir Ailon & Tal Moran

11

Slides by Golan Weisz, Omer Ben ShalomSlides by Golan Weisz, Omer Ben ShalomNir Ailon & Tal MoranNir Ailon & Tal Moran

Adapted from Oded Goldreich’s course lecture notes Adapted from Oded Goldreich’s course lecture notes by Moshe Lewenstien , Yehuda Lindell & Tamar by Moshe Lewenstien , Yehuda Lindell & Tamar SeemanSeeman

Page 2: Slides by Golan Weisz, Omer Ben Shalom Nir Ailon & Tal Moran

22

In This LectureIn This Lecture The non-uniform polynomial time The non-uniform polynomial time

class (class (P/PolyP/Poly))

The two equivalent definitions for The two equivalent definitions for the classthe class

The power of The power of P/PolyP/Poly BPPBPP is contained in is contained in P/PolyP/Poly P/PolyP/Poly includes non recursive includes non recursive

languageslanguages

Page 3: Slides by Golan Weisz, Omer Ben Shalom Nir Ailon & Tal Moran

33

What is What is P/PolyP/Poly? ?

P/PolyP/Poly comprise all languages comprise all languages accepted by TMs working with an accepted by TMs working with an external “advice” external “advice”

FormallyFormally - - LLP/PolyP/Poly if there exists if there exists a polynomial time two-input a polynomial time two-input machine machine MM and a sequence and a sequence {a{ann}} of “advice” strings of “advice” strings |a|ann||p(n)p(n) s.ts.t

8.18.1

, {0,1} : ( , ) ( )nn Ln x M a x x , {0,1} : ( , ) ( )nn Ln x M a x x

Page 4: Slides by Golan Weisz, Omer Ben Shalom Nir Ailon & Tal Moran

44

What is P/Poly?What is P/Poly?

TM MInput

Advice

If the advice were not If the advice were not polynomially bounded it polynomially bounded it

could have been a lookup could have been a lookup table for the language.table for the language.

Answer

Page 5: Slides by Golan Weisz, Omer Ben Shalom Nir Ailon & Tal Moran

55

An alternative An alternative defdef:: For For LL in in P/PolyP/Poly there is a sequence there is a sequence

of circuits of circuits {C{Cnn}},, where where CCnn has has nn inputs and inputs and 11 output, its size is output, its size is bounded by bounded by p(n)p(n),, and: and:

Referred to as a non-uniform family Referred to as a non-uniform family of circuits.of circuits.

P/Poly as Circuits ?P/Poly as Circuits ?

0,1 : )n

n Lx C x x 0,1 : )n

n Lx C x x

circuits for distinct n are not necessarily correlated

Page 6: Slides by Golan Weisz, Omer Ben Shalom Nir Ailon & Tal Moran

66

Circuit 1

Non-Uniform CircuitsNon-Uniform Circuits

Circuit 3

Circuit

2

A family of circuits {Cn} where circuit Cn has n inputs and 1 output.

Page 7: Slides by Golan Weisz, Omer Ben Shalom Nir Ailon & Tal Moran

77

Circuit Circuit TM w/advice TM w/advice a family of circuits a family of circuits {C{Cnn}} deciding deciding

LL s.t. s.t. |C|Cnn|| is poly-bounded. is poly-bounded.

For every For every nn, use a standard circuit , use a standard circuit encoding for encoding for CC|x||x| as advice as advice

Have a Have a TMTM simulate the circuit and simulate the circuit and accepts/rejects accordingly.accepts/rejects accordingly.

P/Poly def’s P/Poly def’s equivalentequivalent

8.1.18.1.1

Page 8: Slides by Golan Weisz, Omer Ben Shalom Nir Ailon & Tal Moran

88

P/Poly def’s equivalent P/Poly def’s equivalent (2)(2)

TM w/advice TM w/advice circuit circuit a a TMTM taking advice taking advice {a{ann}}

Construct, given Construct, given M(aM(ann,.),.) a circuit a circuit that, on input that, on input xx of length of length nn, , outputs outputs M(aM(ann,x),x)

Over all Over all nn’s we get a family of ’s we get a family of circuits, based on the advicescircuits, based on the advices

Page 9: Slides by Golan Weisz, Omer Ben Shalom Nir Ailon & Tal Moran

99

P/Poly and the P=NP ? P/Poly and the P=NP ? P P P/polyP/poly - empty advice- empty advice If we find a languageIf we find a language LLNPNP s.t.s.t.

LLP/PolyP/Poly we would provewe would prove PPNPNP P/PolyP/Poly andand NPNP both use an external both use an external

string for computation. How are they string for computation. How are they different?different?

8.1.28.1.2

P/poly uses a universal witness an for all inputs of size n, while for NP there may be different witnesses for inputs of same size.

For L in NP, any witness is rejected if xLFor P/poly, however, there can be bad advices!

Page 10: Slides by Golan Weisz, Omer Ben Shalom Nir Ailon & Tal Moran

1010

The power of The power of P/PolyP/Poly (1) (1)

ClaimClaim:: BPP BPP P/PolyP/Poly ProofProof:: By simple amplification onBy simple amplification on

BPPBPP we get that for anywe get that for any xx{0,1}{0,1}nn, , the probability forthe probability for MM to to err onerr on xx is is < 2< 2-2n-2n

8.2.48.2.4

Recall: In BPP, the computation uses a sequence r of poly(n) coin tosses.

Page 11: Slides by Golan Weisz, Omer Ben Shalom Nir Ailon & Tal Moran

1111

Apply Union BoundApply Union Bound Now, there are Now, there are 22nn xx’’s, s, for any for any xx the the

probability of a bad probability of a bad rr is at most is at most 22-2n-2n Therefore, there exists at least 1 Therefore, there exists at least 1 rr

which is good for all which is good for all xx’s.’s. To illustrate To illustrate ((n=2n=2))::

Boxes: x’s

Black area: the “bad” r’s

Overlapped, the black areas

do not cover everything

Therefore there are r’s

that are good for all x’s

The black areas cover

less than 1/4 of the boxes

Page 12: Slides by Golan Weisz, Omer Ben Shalom Nir Ailon & Tal Moran

1212

The Extreme Power of The Extreme Power of P/PolyP/Poly

In fact In fact P/PolyP/Poly is even much stronger is even much stronger classclass

P/PolyP/Poly includes non-recursive includes non-recursive languages!!!languages!!!

8.2.38.2.3

Page 13: Slides by Golan Weisz, Omer Ben Shalom Nir Ailon & Tal Moran

1313

The power of P/Poly (3)The power of P/Poly (3)

ExampleExample:: All unary languages (subsets ofAll unary languages (subsets of

{1}*{1}*)) are inare in P/PolyP/Poly:: the advice the advice string can be exactlystring can be exactly LL(1(1nn) ) and and the machine checks if the input the machine checks if the input is unary.is unary.

FactFact: : There are non-recursive There are non-recursive unary languages.unary languages.

Take {1index(x) | xL} where L is non-recursive

Page 14: Slides by Golan Weisz, Omer Ben Shalom Nir Ailon & Tal Moran

1414

Uniform Families of Uniform Families of CircuitsCircuits

P/Poly P/Poly includes non-recursive includes non-recursive languages due to it being non-languages due to it being non-uniform, hence, there is no uniform, hence, there is no guarantee the advice is even guarantee the advice is even computablecomputable

A more reasonable class of A more reasonable class of circuits is the uniform family of circuits is the uniform family of circuitscircuits

8.38.3

Page 15: Slides by Golan Weisz, Omer Ben Shalom Nir Ailon & Tal Moran

1515

Uniform AdviceUniform Advice

DefDef::A family of circuitsA family of circuits {C{Cnn} } isis uniformuniform if there exists a if there exists a poly-time poly-time TM TM MM that that generatesgenerates CCnn on inputon input 11nn

ThmThm::L L isis decided by a uniform decided by a uniform family of circuits ifffamily of circuits iff L L P P

Page 16: Slides by Golan Weisz, Omer Ben Shalom Nir Ailon & Tal Moran

1616

SimulationSimulation

ProofProof:: IfIf {C{Cnn}} is a uniform family of circuits is a uniform family of circuits

decidingdeciding LL andand MM is ais a TM TM as above,as above, then on inputthen on input xx RunRun MM to obtain to obtain CCnn Simulate Simulate CCnn on on xx and output the and output the

outcomeoutcome The algorithm’s running time is The algorithm’s running time is

polynomialpolynomial

Page 17: Slides by Golan Weisz, Omer Ben Shalom Nir Ailon & Tal Moran

1717

Uniform CircuitsUniform Circuits

ProofProof (other direction):(other direction): LL is a language in is a language in PP. So there is a . So there is a

poly-time machine poly-time machine MM deciding deciding LL.. As in the proof of Cook’s theorem, a As in the proof of Cook’s theorem, a

poly-time machine poly-time machine M’M’ , given input , given input 11nn can construct a poly-size circuit can construct a poly-size circuit simulating simulating MM on inputs of size on inputs of size nn..

The family of circuits generated by The family of circuits generated by M’M’ is uniform and decides is uniform and decides LL..

Page 18: Slides by Golan Weisz, Omer Ben Shalom Nir Ailon & Tal Moran

1818

Sparse languages (1)Sparse languages (1)

DefDef:: A languageA language SS is sparse if there exists is sparse if there exists a polynomiala polynomial P(.)P(.) s.t. for everys.t. for every n n

|S|S{0,1}{0,1}nn| | p(n) p(n)(That is, the language contains at most (That is, the language contains at most p(n)p(n) strings strings

of length of length nn))

ClaimClaim:: NPNPP/PolyP/Poly iff for everyiff for every LLNP, NP, LL is is

Cook reducible to a sparse Cook reducible to a sparse language language

8.48.4

Suffices to consider SAT as it is NP-complete

Page 19: Slides by Golan Weisz, Omer Ben Shalom Nir Ailon & Tal Moran

1919

Sparse languages (2)Sparse languages (2)ProofProof:: SATSATP/Poly P/Poly SATSAT is Cook reducible to a is Cook reducible to a

sparse language sparse language

FromFrom P/PolyP/Poly def, there exist a family of def, there exist a family of advice stringsadvice strings {a{ann}} s.t.s.t. n |an |ann| ≤ q(n)| ≤ q(n)

LetLet SSii

nn = 000…00011111…..1 = 000…00011111…..1

S = { 1S = { 1nn0S0Siinn | n>0 | n>0 and and i i ‘th‘th bitbit ofof a an n isis 1} 1}

SS is actually a list of unary pointers to is actually a list of unary pointers to positions ofpositions of “1”“1”s ins in {a{ann}}

S is sparse as n |S{0,1}n+q(n)+1| |an| q(n)

Page 20: Slides by Golan Weisz, Omer Ben Shalom Nir Ailon & Tal Moran

2020

Sparse languages (3)Sparse languages (3)The reductionThe reduction::

On inputOn input ,, reconstructreconstruct aann byby q(n)q(n) queries to an oracle forqueries to an oracle for S S of typeof type 11nn0S0Sii

nn RunRun M(aM(ann,,)) thereby solvingthereby solving SATSAT in in polynomial timepolynomial time

We showed a polynomial-time We showed a polynomial-time solution forsolution for SATSAT using anusing an SS-oracle-oracle therefore it is Cook reducible to the therefore it is Cook reducible to the sparse languagesparse language SS

Page 21: Slides by Golan Weisz, Omer Ben Shalom Nir Ailon & Tal Moran

2121

Sparse languages (4)Sparse languages (4)ProofProof of other direction: of other direction: SATSAT is Cook reducible to a sparse is Cook reducible to a sparse

language implieslanguage implies SATSATP/PolyP/Poly an oracle machinean oracle machine MMSS which decideswhich decides SATSAT in in

poly-timepoly-time t(.)t(.) MM makes at mostmakes at most t(|x|)t(|x|) oracle queries of sizeoracle queries of size t(|x|) t(|x|)

ConstructConstruct aann by concatenating all the strings by concatenating all the strings of lengthof length t(n) t(n) inin SS into a ‘table’, Sinceinto a ‘table’, Since SS is is sparse the total length ofsparse the total length of aann isis poly(n)poly(n)..

The “advice machine” will takeThe “advice machine” will take aann as advice as advice and use it to simulate the oracle.and use it to simulate the oracle.

Page 22: Slides by Golan Weisz, Omer Ben Shalom Nir Ailon & Tal Moran

2222

Sparse, Karp and P vs Sparse, Karp and P vs NPNP

ClaimClaim:: P=NPP=NP iff every languageiff every language LL inin NP NP is Karp-is Karp-

reducible to a sparse languagereducible to a sparse language

ProofProof:: P=NP P=NP Any Any LL in in NPNP is Karp-reducible to a is Karp-reducible to a

sparse languagesparse languageTrivially Karp-reduce a language Trivially Karp-reduce a language LL in in NP(=NP(=

P)P) to to the sparse language the sparse language {0,1} {0,1} usingusing

8.4.98.4.9

otherwise

Lxxf

0

1)(

otherwise

Lxxf

0

1)(

f is poly-time computable if P=NP

Page 23: Slides by Golan Weisz, Omer Ben Shalom Nir Ailon & Tal Moran

2323

Sparse, Karp and P vs NP Sparse, Karp and P vs NP (2)(2)

ProofProof of other direction: of other direction:

SATSAT is Karp-reducible to a sparse langis Karp-reducible to a sparse lang P=NPP=NP

DefDef of a guarded sparse language: of a guarded sparse language: SS is is guarded sparseguarded sparse ifif GG s.ts.t GG is a is a

sparse language insparse language in P P andand SSG.G.

RemarkRemark:: Any unary language is guarded Any unary language is guarded by the languageby the language {1{1n n |n>=0}|n>=0} (sparse and (sparse and in in PP))

guardedguarded

(a weaker version)(a weaker version)

Page 24: Slides by Golan Weisz, Omer Ben Shalom Nir Ailon & Tal Moran

2424

Sparse, Karp and P vs Sparse, Karp and P vs NP(3)NP(3)

Let Let ff be the Karp-reduction of be the Karp-reduction of SATSAT to to a guarded sparse language a guarded sparse language SS..

InputInput: A Boolean formula : A Boolean formula ==(x(x11,,…,x…,xnn))

The strategy will be to compute The strategy will be to compute with a with a DFSDFS on the tree of all possible on the tree of all possible assignments of assignments of ’s variables.’s variables.

Page 25: Slides by Golan Weisz, Omer Ben Shalom Nir Ailon & Tal Moran

2525

Sparse, Karp and P vs NP Sparse, Karp and P vs NP (4)(4)

LetLet::

We construct a tree with the We construct a tree with the ’s as ’s as nodes. Each node nodes. Each node has two has two children, children, 00 and and 11. The root is the . The root is the empty assignment empty assignment , and the leaves , and the leaves have a Boolean constant value.have a Boolean constant value.

iniini xxxx }1,0{),,,,(:),,( 111 iniini xxxx }1,0{),,,,(:),,( 111

))(: SxSAT( fx

Page 26: Slides by Golan Weisz, Omer Ben Shalom Nir Ailon & Tal Moran

2626

Sparse, Karp and P vs NP Sparse, Karp and P vs NP (5)(5)

1

00

0

01 10 11

0= (0,x2,…,xn) 1= (1,x2,…,xn)

00

Page 27: Slides by Golan Weisz, Omer Ben Shalom Nir Ailon & Tal Moran

2727

P=NP using the Karp-P=NP using the Karp-reduction(5)reduction(5)

The algorithm will perform a The algorithm will perform a DFSDFS on the on the tree.tree.

At each node At each node it will calculate it will calculate xx The algorithm will backtrack from a node The algorithm will backtrack from a node

if either:if either: xxG (G ( x xS S SAT)SAT)

It backtracked from both child. of It backtracked from both child. of ..

Can be computedin poly-time because

G is in P.

In this casewe add x tothe set BG-S- x- xB (B ( x xG-S G-S SAT)SAT)

Page 28: Slides by Golan Weisz, Omer Ben Shalom Nir Ailon & Tal Moran

2828

P=NP using the Karp-P=NP using the Karp-reduction(6)reduction(6)

The algorithm stops and accept if it The algorithm stops and accept if it reaches a leaf and verifies that the reaches a leaf and verifies that the assignment satisfies assignment satisfies

The algorithm stops and rejects if it The algorithm stops and rejects if it backtracks from both children of the backtracks from both children of the root node.root node.

Complexity analysis:Complexity analysis: Call a node “bad” if it does not lead to Call a node “bad” if it does not lead to

a satisfying assignment, but the a satisfying assignment, but the algorithm proceeds to its descendantsalgorithm proceeds to its descendants

Page 29: Slides by Golan Weisz, Omer Ben Shalom Nir Ailon & Tal Moran

2929

Sparse, Karp and P vs NP Sparse, Karp and P vs NP (7)(7)

The point is that by keeping the The point is that by keeping the data structure data structure BB, we make sure , we make sure that there is no more than a that there is no more than a polynomial number of bad polynomial number of bad nodes: that number cannot nodes: that number cannot exceed exceed |G-S||G-S| which is polynomial which is polynomial due to due to GG’s sparseness’s sparseness

Page 30: Slides by Golan Weisz, Omer Ben Shalom Nir Ailon & Tal Moran

3030

The DFS AlgorithmThe DFS AlgorithmStart:B<-Tree-Search()In case the above call was not halted, reject.

Tree-Search():

if ||=n /* Leaf */if True

halt and acceptelse return

compute x=f() /* case not at a leaf */

if xG return

if xB return

Tree-Search(0)Tree-Search(1)add x to B /* in case we return from the recursions */

return

Page 31: Slides by Golan Weisz, Omer Ben Shalom Nir Ailon & Tal Moran

3131

Slides by Golan Weisz && Omer Ben Shalom.Slides by Golan Weisz && Omer Ben Shalom.

Adapted from Oded Goldreich’s course Adapted from Oded Goldreich’s course lecture notes by Ronen Mizrahi lecture notes by Ronen Mizrahi

Page 32: Slides by Golan Weisz, Omer Ben Shalom Nir Ailon & Tal Moran

3232

IntroductionIntroduction

The Polynomial-time Hierarchy is an The Polynomial-time Hierarchy is an extension of the classes extension of the classes P/NPP/NP..

Two ways to define the class:Two ways to define the class: By generalizing the notion of Cook By generalizing the notion of Cook

reduction.reduction. By using logical quantifiers.By using logical quantifiers.

We show that this class also upper We show that this class also upper bounds the notion of ‘efficient bounds the notion of ‘efficient computation’.computation’.

We find conditions for the hierarchy to We find conditions for the hierarchy to collapse.collapse.

Page 33: Slides by Golan Weisz, Omer Ben Shalom Nir Ailon & Tal Moran

3333

PH def - by oracle machines (1)PH def - by oracle machines (1)Basic definitionsBasic definitions

MMAA - - TMTM with oraclewith oracle AAL(ML(MAA)) - - the language of inputs accepted bythe language of inputs accepted by

MMAA

MMAA(x)(x) – – the output ofthe output of MMAA on inputon input xx L(ML(MCC ) ) is defined as the set of languages is defined as the set of languages

accepted byaccepted by MM with access to oraclewith access to oracle AA of classof class C.C.

9.1.19.1.1

Page 34: Slides by Golan Weisz, Omer Ben Shalom Nir Ailon & Tal Moran

3434

PH def - by oracle machines PH def - by oracle machines (2)(2)

LLCC11C2C2 There exists aThere exists a TMTM of classof class CC11

with access to an oracle in classwith access to an oracle in class CC22 that that acceptsaccepts LL

ExamplesExamples::PPCC = = Languages accepted by Languages accepted by DTMDTM with access to with access to

an oracle an oracle AA in class in class CC..NPNPCC = = Languages accepted byLanguages accepted by NTMNTM with access to with access to

an oraclean oracle AA in classin class CCBPPBPPCC ==Languages accepted by a probabilisticLanguages accepted by a probabilistic TMTM

with access to an oraclewith access to an oracle AA inin CC..

Page 35: Slides by Golan Weisz, Omer Ben Shalom Nir Ailon & Tal Moran

3535

PH def - by oracle machines PH def - by oracle machines (3)(3)

We define by induction:We define by induction:11 := NP := NPi+1i+1 := NP := NP

ii

ii := := CoCoii

i+1i+1:= P:= Pii

1

:i

iPH

Page 36: Slides by Golan Weisz, Omer Ben Shalom Nir Ailon & Tal Moran

3636

PH def - by oracle machines PH def - by oracle machines (4)(4) PropositionProposition::

iiii i+1 i+1 i+1i+1i+1 i+1

ProofProof::

ii ii i+1i+1=p=pii ( ( for example for example NPNPcoNP coNP p pNPNP==22))

We have an oracle for We have an oracle for L L ii

Ask the oracle and return answer for Ask the oracle and return answer for ii

Ask the oracle and return the opposite for Ask the oracle and return the opposite for ii

(which is (which is co-co-ii).).

Page 37: Slides by Golan Weisz, Omer Ben Shalom Nir Ailon & Tal Moran

3737

PH def - by oracle machines PH def - by oracle machines (5)(5)

ppi i i+1i+1i+1 i+1

ppi i NP NPi i = = i+1i+1 as anas an NPNP TM TM can can compute anything acompute anything a PP TM TM machine machine cancan

AsAs ppii is closed under is closed under complementation (any reply of the complementation (any reply of the oracle can be reversed) then:oracle can be reversed) then:

LL ppi i & & ppi i i+1i+1 L Li+1 i+1

-

Page 38: Slides by Golan Weisz, Omer Ben Shalom Nir Ailon & Tal Moran

3838

PH def - by quantifiers (1)PH def - by quantifiers (1)We are building on one of the basic NP We are building on one of the basic NP

definitiondefinition

A A kk-ary relation -ary relation RR is polynomially is polynomially bounded if exists a polynomial bounded if exists a polynomial P(.)P(.) s.t. s.t.(x(x11,x,x22,….,x,….,xkk)) [(x [(x11,x,x22….,x….,xkk))R R i |xi |xii| | p(|x p(|x11|)|)

Note that the polynomial condition Note that the polynomial condition here is that all variables are bounded here is that all variables are bounded by theby the x x11 which we define as the inputwhich we define as the input

->9.1.2->9.1.2

Page 39: Slides by Golan Weisz, Omer Ben Shalom Nir Ailon & Tal Moran

3939

PH def - by quantifiers (2)PH def - by quantifiers (2)

Recall the Quantifier definition Recall the Quantifier definition of of NPNP:: LLNPNP if there exists a if there exists a polynomially bounded relation polynomially bounded relation RRLL, recognizable in poly-time, , recognizable in poly-time, s.t s.t xxL iff L iff y s.t (x,y) y s.t (x,y) R RLL

Page 40: Slides by Golan Weisz, Omer Ben Shalom Nir Ailon & Tal Moran

4040

PH def - by quantifiers (3)PH def - by quantifiers (3)

One can nowOne can now define define 22ii::

LL22ii ifif exists a polynomially exists a polynomially

bounded, polynomial time bounded, polynomial time recognizable, (recognizable, (i+1i+1)-ary )-ary relation relation RRLL s.t s.t xxL iff L iff yy11yy22yy3..3..QQiiyyii s.t (x,y s.t (x,y11,,…,y…,yii))RRLL

QQii isis ““” if ” if ii is even and “ is even and “” if ” if oddodd

Page 41: Slides by Golan Weisz, Omer Ben Shalom Nir Ailon & Tal Moran

4141

PH def equivalent (side 1)PH def equivalent (side 1)

We proveWe prove 22ii 11

ii by induction by induction(base) For (base) For i=1i=1 both are both are NPNP..Assume Assume 22

ii 11ii, prove , prove 22

i+1i+1 11i+1i+1::

The The i+1i+1stst quantifiers can be viewed quantifiers can be viewed as (as (yy11)+ the last )+ the last ii quantifiers quantifiers

(*) we write: (*) we write: xxL iff L iff yy11 s.t. (x,y s.t. (x,y11))LLii

where:where:(x’,y’)(x’,y’)LLii iff iff yy22…Q…Qi+1i+1yyi+1i+1::(x’,y’,y(x’,y’,y22…,y…,yi+1i+1))RRLL

->9.1.3->9.1.3

Page 42: Slides by Golan Weisz, Omer Ben Shalom Nir Ailon & Tal Moran

4242

PH def equivalence: PH def equivalence: LLii11ii

RRLLii is polynomially bounded and is polynomially bounded and polynomial-time recognizable (as polynomial-time recognizable (as RRLL is) is)

xxLLii iff iff yy11…Q…Qi+1i+1yyii:(x,y:(x,y11…,y…,yii))RRllii

xxco-Lco-Lii iff iff yy11…Q…Qiiyyii:(x,y:(x,y11…,y…,yii))RRLLii

Therefore, Therefore, co-Lco-Lii22ii, so, so LLii22

ii

By the inductive hypothesis, By the inductive hypothesis, 22

ii11ii so we have so we have LLii11

ii

Page 43: Slides by Golan Weisz, Omer Ben Shalom Nir Ailon & Tal Moran

4343

PH def equivalence: PH def equivalence: LL11i+1i+1

A A TMTM MM in in NPNPii can check can check the claim (*) by guessing the claim (*) by guessing the value of the value of yy11 and using and using the oracle for the oracle for LLii

Therefore Therefore LL11i+1i+1

Page 44: Slides by Golan Weisz, Omer Ben Shalom Nir Ailon & Tal Moran

4444

PH def equivalent (side 2)PH def equivalent (side 2)

We prove We prove 11ii 22

ii by by

inductioninduction

Base as before on Base as before on NPNP with with same hypothesissame hypothesis

LL11i+1i+1

a NTM a NTM MM s.t. s.t. LLL(ML(Mii)) which means which meansL’L’11

ii s.t. s.t. L=L(ML=L(ML’L’))

Page 45: Slides by Golan Weisz, Omer Ben Shalom Nir Ailon & Tal Moran

4545

PH def equivalent (3)PH def equivalent (3)

L=L(ML=L(ML’L’)) means that: means that:

xxL iff L iff yy11,q,q11,a,a11,…,q,…,qtt,a,att s.t s.tthe TM the TM MM accepts accepts xx with withnon-deterministic choices non-deterministic choices yy

receiving receiving aaii to oracle query to oracle query qqii:: (a(ajj=1) =1) q qjjL’L’ (a(ajj=0) =0) q qjjL’L’

Page 46: Slides by Golan Weisz, Omer Ben Shalom Nir Ailon & Tal Moran

4646

PH def equivalent (4)PH def equivalent (4)

““yy11” is a polynomial-time ” is a polynomial-time predicatepredicate

We assume We assume L’L’ii11 and by induction and by induction

11ii22

ii L’ L’22ii.. Therefore for each Therefore for each

question/answer we can write a question/answer we can write a relation relation RRL’L’ s.t:s.t:(a(ajj=1) =1) yy11

(j,1)(j,1)yy22(j,1)(j,1)…Q…Qiiyyii

(j,1)(j,1)

s.ts.t (q (qjj,y,y11(j,1)(j,1),…,y,…,yii

(j,1)(j,1)) ) R RL’L’

(a(ajj=0) =0) yy11(j,2) (j,2) yy22

(j,2)(j,2)…Q…Qi+1i+1yyii(j,2)(j,2)

s.ts.t (q (qjj,y,y11(j,2)(j,2),…,y,…,yii

(j,2)(j,2)) ) Co-R Co-RL’L’

Page 47: Slides by Golan Weisz, Omer Ben Shalom Nir Ailon & Tal Moran

4747

PH def equivalent (5)PH def equivalent (5)

Let Let jj1111,…,j,…,j11kk

be the indices for be the indices for which which aajj=1=1

DefDef::ww11:=y q:=y q11 a a11…q…qii a aii y y11

(j(j1111,1),1)…y…y11(j(j11kk,1),1)

ww22:=y:=y11(j(j0011,2),2)…y…y11

(j(j00i-ki-k,2) ,2) yy22(j(j1111,1),1)…y…y22

(j(j11kk,1),1)

wwii:=y:=yi-1i-1(j(j0011,2),2)…y…yi-1i-1

(j(j00i-ki-k,2) ,2) yyii(j(j1111,1),1)…y…yii

(j(j11kk,1),1)

wwi+1i+1:= y:= yi i (j(j0011,2),2)…y…yi i

(j(j00i-ki-k,2),2)

Page 48: Slides by Golan Weisz, Omer Ben Shalom Nir Ailon & Tal Moran

4848

PH def equivalent (?)PH def equivalent (?)

We can now define We can now define RRLL to be to be the (i+1)-ary relation the (i+1)-ary relation (w(w11,,…,w…,wi+1i+1))RRLL iff for all iff for all jj(a(ajj=1)=1)(q(qjj,y,y11

(j,1)(j,1),…,y,…,yii(j,1)(j,1)))RRL’L’

(a(ajj=0)=0)(q(qjj,y,y11(j,2)(j,2),…,y,…,yii

(j,2)(j,2)))Co-RCo-RL’L’

Page 49: Slides by Golan Weisz, Omer Ben Shalom Nir Ailon & Tal Moran

4949

PH def equivalent (6)PH def equivalent (6)Since both Since both RRL’L’ and its and its complement are polynomially complement are polynomially bounded and polynomial-time bounded and polynomial-time recognized we have: recognized we have:

xxL iff L iff WW11WW22…Q…Qi+1i+1WWi+1i+1 s.ts.t (w(w11,w,w22,…,w,…,wi+1i+1))RRLL which is the definition of which is the definition of 22

i+1i+1

Page 50: Slides by Golan Weisz, Omer Ben Shalom Nir Ailon & Tal Moran

5050

ThmThm: PH : PH PSPACE PSPACE

ProofProof::From the definition with From the definition with

quantifiers we get that quantifiers we get that xxL iffL iff

yy11yy22yy3..3..QQiiyyii (x,y (x,y11,,…,y…,yii))RRLL

Given Given xx we can use we can use ii variables variables to try all combinations of to try all combinations of assignments for assignments for yy11…y…yii

->9.2.1->9.2.1

Page 51: Slides by Golan Weisz, Omer Ben Shalom Nir Ailon & Tal Moran

5151

PH PH PSPACE PSPACE (2) (2)

Since Since RRLL is polynomially is polynomially bounded we have a bound on bounded we have a bound on the length of each the length of each yyii and the and the number of variables is constant number of variables is constant (for a given language)(for a given language)

So we have a So we have a PSPACEPSPACE deterministic TM that decides deterministic TM that decides LL

Page 52: Slides by Golan Weisz, Omer Ben Shalom Nir Ailon & Tal Moran

5252

NP=CoNP NP=CoNP PH=NP PH=NP (Intuition)(Intuition)

Intuition - The “rungs” of the Intuition - The “rungs” of the polynomial hierarchy’s “ladder” polynomial hierarchy’s “ladder” are NP Cook reductions, whose are NP Cook reductions, whose extra power over the Karp extra power over the Karp reduction lies in the fact that reduction lies in the fact that we can complement the we can complement the oracle’s answeroracle’s answer

If this power is meaningless the If this power is meaningless the whole hierarchy collapses!whole hierarchy collapses!

Page 53: Slides by Golan Weisz, Omer Ben Shalom Nir Ailon & Tal Moran

5353

NP=CoNP NP=CoNP PH=NP PH=NP (Proof) (Proof)

Proof (induction) - for all Proof (induction) - for all i i ii=NP=NP Assume Assume ii=NP=NP. . To prove for To prove for i+1i+1 we need to show we need to show

NPNPNPNP=NP=NP. One side is trivial . One side is trivial Let Let LLNPNPNPNP; we need to show ; we need to show LLNPNP By definition, there exist an NTM By definition, there exist an NTM

MM and a language and a language AANPNP s.t. s.t. L=L(ML=L(MAA)) (Since (Since NP=CoNPNP=CoNP also also Co-Co-AANPNP))

Page 54: Slides by Golan Weisz, Omer Ben Shalom Nir Ailon & Tal Moran

5454

NP=CoNP NP=CoNP PH=NP PH=NP (Proof)(Proof)

We will simulate We will simulate MMAA using an NTM using an NTM M’M’ (without oracle access):(without oracle access):

M’M’ guesses the non-deterministic guesses the non-deterministic choices for choices for MMAA. For each question . For each question MMAA asks the oracle asks the oracle M’M’ guesses the guesses the oracle’s answer.oracle’s answer. For “true”, For “true”, M’M’ runs a simulator for runs a simulator for AA

(and makes sure the answer (and makes sure the answer isis “true”) “true”) For “false”, For “false”, M’M’ runs a simulator for runs a simulator for Co-ACo-A

(and makes sure the answer (and makes sure the answer isis “true”) “true”)

Page 55: Slides by Golan Weisz, Omer Ben Shalom Nir Ailon & Tal Moran

5555

NP=CoNP NP=CoNP PH=NP PH=NP (Proof)(Proof)

Exactly one of Exactly one of AA or or Co-ACo-A must return must return “true”. Since both “true”. Since both AANPNP and and Co-Co-AANPNP, The simulator will run in , The simulator will run in polynomial time for at least one of polynomial time for at least one of them.them.

MM runs in polynomial time, so at most runs in polynomial time, so at most a polynomial number of calls are a polynomial number of calls are made to the oracle. made to the oracle.

Page 56: Slides by Golan Weisz, Omer Ben Shalom Nir Ailon & Tal Moran

5656

NP=CoNP NP=CoNP PH=NP PH=NP (Proof)(Proof)

We have found an NTM We have found an NTM M’M’ that that runs in polynomial time and runs in polynomial time and accepts accepts LL..

By definition, therefore, By definition, therefore, LLNPNP

Page 57: Slides by Golan Weisz, Omer Ben Shalom Nir Ailon & Tal Moran

5757

Generalization: Generalization: ii==i i PH=PH=ii

The previous proof can be The previous proof can be generalized to:generalized to:for every for every K>1K>1 if if ii==ii then the then the PHPH collapses from that point on and collapses from that point on and PH=PH=ii

This relation will come in handy This relation will come in handy in the next proofs in the next proofs

Page 58: Slides by Golan Weisz, Omer Ben Shalom Nir Ailon & Tal Moran

5858

ThmThm: BPP : BPP PH (Overview) PH (Overview) It is unknown whether It is unknown whether BPP BPP NP NP

nevertheless we can prove nevertheless we can prove BPP BPP 22

We show a We show a 22 algorithm that shifts the algorithm that shifts the gap between the success probability for gap between the success probability for ‘good’ inputs and ‘bad’ ones:‘good’ inputs and ‘bad’ ones: In the ‘good’ case - where the probability is In the ‘good’ case - where the probability is

high for a random string to succeed – that high for a random string to succeed – that probability becomes probability becomes =1=1

The probability of success in the bad case The probability of success in the bad case <1<1

At that point, At that point, xxLL iff for iff for everyevery random random string our test succeeds.string our test succeeds.

->9.3->9.3

Page 59: Slides by Golan Weisz, Omer Ben Shalom Nir Ailon & Tal Moran

5959

xLAlgorithm

errs

Algorithm is correct

xL

1-1/Poly

1/Poly

Normally, error probability Normally, error probability is polynomially smallis polynomially small

Page 60: Slides by Golan Weisz, Omer Ben Shalom Nir Ailon & Tal Moran

6060

xLAlgorithm

errs

Algorithm is correct

xL xL xL

how to shift the errorhow to shift the error

The algorithm will only make The algorithm will only make mistakes when the input is “bad”mistakes when the input is “bad”

Page 61: Slides by Golan Weisz, Omer Ben Shalom Nir Ailon & Tal Moran

6161

For a ‘Good’ input:all random strings become accepting

Page 62: Slides by Golan Weisz, Omer Ben Shalom Nir Ailon & Tal Moran

6262

For a ‘Bad’ input:some random strings must remain non-

accepting

Page 63: Slides by Golan Weisz, Omer Ben Shalom Nir Ailon & Tal Moran

6363

BPP BPP PH (Proof Start) PH (Proof Start)

Use a version of Use a version of BPPBPP where for some polynomial where for some polynomial p(.)p(.) prediction error is polynomially bounded prediction error is polynomially bounded in the length of the random stringin the length of the random string

xx{0,1}{0,1}nn PRPRrrR{0,1}R{0,1}

p(n)p(n)[A(x,r) [A(x,r) LL(x)] < (x)] < 11//(3*p(n))(3*p(n))

(where (where LL(x) = 1(x) = 1 if if xxLL and and LL(x) = 0(x) = 0 if if xxLL))

note - The error probability here depends on the note - The error probability here depends on the randomness complexity of the algorithm, with randomness complexity of the algorithm, with a large enough (a large enough (log nlog n) number of tries this ) number of tries this can be achievedcan be achieved

->9.3->9.3

Page 64: Slides by Golan Weisz, Omer Ben Shalom Nir Ailon & Tal Moran

6464

BPP BPP PH (Claim 1) PH (Claim 1)

for every for every xxLL{0,1}{0,1}nn there exist a set of there exist a set of elements elements SS11,…,S,…,Smm{0,1}{0,1}mm where where m=p(n)m=p(n) s.t.s.t. rr{0,1}{0,1}mm , , ii{1..m}{1..m}A(x,rA(x,rSSii) = 1) = 1

That is, there is a polynomially That is, there is a polynomially bounded list of elements so that for bounded list of elements so that for every selection of every selection of rr, at least one , at least one element, when XOR’ed with element, when XOR’ed with rr, causes , causes the algorithm to give the correct the algorithm to give the correct answer (if used as the random string).answer (if used as the random string).

Page 65: Slides by Golan Weisz, Omer Ben Shalom Nir Ailon & Tal Moran

6565

BPP BPP PH (Claim 1: Proof PH (Claim 1: Proof Overview)Overview)

Apply a probabilistic argument:Apply a probabilistic argument:To prove there exist such sequence, To prove there exist such sequence,

we prove a random sequence has we prove a random sequence has positive probability of being sopositive probability of being so

We’ll actually upper-bound the We’ll actually upper-bound the probability that a random sequence probability that a random sequence {s{sii}} does not satisfy the claim does not satisfy the claim

This is equal to the probability that This is equal to the probability that for for xxLL rr s.t. for every s.t. for every {s{sii}} the the algorithm rejects algorithm rejects rrssii

Page 66: Slides by Golan Weisz, Omer Ben Shalom Nir Ailon & Tal Moran

6666

BPP BPP PH (Claim 1: Proof) PH (Claim 1: Proof)This probability: This probability:

PrPrss11,…,s,…,smmR{0,1}R{0,1}mm[[rr{0,1}{0,1}mm::{i=1…m}{i=1…m}(A(x,r(A(x,rssii)=0)])=0)]can be writtencan be written

PrPrss11,…,s,…,smmR{0,1}R{0,1}mm[[{r{r{0,1}{0,1}mm}}(({i=1…m}{i=1…m}(A(x,r(A(x,rssii)=0))] )=0))]

{r{r{0,1}{0,1}mm}}((PrPrss11,…,s,…,smmR{0,1}R{0,1}mm[[{i=1…m}{i=1…m}(A(x,r(A(x,rssii)=0)])=0)])) = =

{r{r{0,1}{0,1}mm}}(({i=1…m}{i=1…m}((PrPrssiiR{0,1}R{0,1}mm[A(x,r[A(x,rssii)=0])=0]))))Since Since rrssii’s are uniformly distributed:’s are uniformly distributed:

PrPrssiiR{0,1}R{0,1}mm[A(x,r[A(x,rssii)=0] )=0] ( (11//3m3m))Therefore:Therefore:

P P 2 2mm((11//3m3m))m m 1 1

Since si’s arechosen

independently

The sum of eventProbabilities is

greater thanthe probabilityof their union

Page 67: Slides by Golan Weisz, Omer Ben Shalom Nir Ailon & Tal Moran

6767

BPP BPP PH (Claim 2) PH (Claim 2)

For every input For every input xxLL and for every and for every choice of choice of ssii there exists there exists rr{0,1}{0,1}mm s.t no s.t no rrssii is acceptedis accepted

Page 68: Slides by Golan Weisz, Omer Ben Shalom Nir Ailon & Tal Moran

6868

BPP BPP PH (Claim 2: Proof PH (Claim 2: Proof Overview)Overview)

The probability that all are not accepted The probability that all are not accepted is is 1-{1-{the probability one is acceptedthe probability one is accepted}} but but from the first claim, that probability is from the first claim, that probability is bounded by bounded by 11//(3m)(3m)

Therefore the probability for any Therefore the probability for any rr{0,1}{0,1}mm

that onethat one of the possibleof the possible rrssii accepts isaccepts is the sum of the probabilities on each the sum of the probabilities on each length of length of rr and that equals and that equals m(m(11//3m3m)=1/3)=1/3

The probability that for any The probability that for any rr all all SSii do not do not accept is accept is 2/3 2/3 and there exist many and there exist manysuch such r r

Page 69: Slides by Golan Weisz, Omer Ben Shalom Nir Ailon & Tal Moran

6969

BPP BPP PH (Proof Conclusion) PH (Proof Conclusion)

Combining the two claims we get Combining the two claims we get xxL iff L iff ss11,…,s,…,smm{0,1}{0,1}m m rr{0,1}{0,1}mm {1..m}{1..m}

A(x,rA(x,rssii)=1)=1as we proved both directionsas we proved both directions

This provesThis provesL L 22 as requested, since the as requested, since the statement above is in statement above is in 22

Page 70: Slides by Golan Weisz, Omer Ben Shalom Nir Ailon & Tal Moran

7070

If NP has small circuits PH If NP has small circuits PH collapsescollapses

(Overview)(Overview)We show another collapse We show another collapse

claim for claim for PHPH - if - if NPNPP/PolyP/Poly then then PHPH collapses, this was collapses, this was suggested by Karp and Liptonsuggested by Karp and Lipton

We show that if We show that if NPNPP/PolyP/Poly then then 22==22, this is enough to prove , this is enough to prove the claim; and to prove that it the claim; and to prove that it is enough to show is enough to show 2222

->9.4->9.4

Page 71: Slides by Golan Weisz, Omer Ben Shalom Nir Ailon & Tal Moran

7171

If NP has small circuits PH If NP has small circuits PH collapsescollapses(Proof)(Proof)

If If LL22 then from then from 22 definition exists definition exists a polynomially bounded a polynomially bounded RRLL s.t s.t xxL iff L iff yyzz s.t. s.t. (x,y,z)(x,y,z)RRLL

we reduce one quantifier and define we reduce one quantifier and define a a coNPcoNP statement on an statement on an NPNP language language L’L’ L’ =L’ =defdef {(x,y) | {(x,y) | zz s.t. s.t. (x,y,z) (x,y,z) R RLL}}

It follows that It follows that xxLL iff iff y, (x,y) y, (x,y) L’L’

Page 72: Slides by Golan Weisz, Omer Ben Shalom Nir Ailon & Tal Moran

7272

If NP has small circuits PH If NP has small circuits PH collapsescollapses

(Proof Cont.)(Proof Cont.)As As L’L’ is in is in NPNP there is a Karp there is a Karp

reduction function for it to reduction function for it to 3SAT3SAT..

From our assumption From our assumption NPNPP/PolyP/Poly we get that we get that 3SAT3SAT can be computed by a family of can be computed by a family of circuits circuits {C{Cmm}} of length of length mm polynomial in input lengthpolynomial in input length

Page 73: Slides by Golan Weisz, Omer Ben Shalom Nir Ailon & Tal Moran

7373

If NP has small circuits PH If NP has small circuits PH collapsescollapses

(Proof Cont.2)(Proof Cont.2)We reconstruct membership in We reconstruct membership in

L’L’ to claim: to claim:Such a family of circuits Such a family of circuits existsexistsThey are polynomially They are polynomially

bounded in length bounded in length They correctly calculate They correctly calculate 3SAT3SAT

– (this is the problematic – (this is the problematic statement)statement)

Page 74: Slides by Golan Weisz, Omer Ben Shalom Nir Ailon & Tal Moran

7474

If NP has small circuits PH If NP has small circuits PH collapsescollapses

(Proof Cont.3)(Proof Cont.3)We can guess the family of circuits We can guess the family of circuits

and ensure they compute SAT:and ensure they compute SAT:11,,22,…,,…,nn, , [[2..n 2..n C’C’ii((ii)=(C’)=(C’i-1i-1((’’ii) ) C’ C’i-1i-1((’’’’ii) ) C’C’1 1 is OK]is OK]

where where ii is any is any SATSAT formula over formula over ii variables and variables and ’’ii and and ’’’’ii are the are the same formula with the last variable same formula with the last variable being set to being set to 00 and and 11 respectively. respectively.

Page 75: Slides by Golan Weisz, Omer Ben Shalom Nir Ailon & Tal Moran

7575

If NP has small circuits PH If NP has small circuits PH collapsescollapses

(Proof Cont.4)(Proof Cont.4) The statement can be tested and The statement can be tested and

proved recursively in polynomial proved recursively in polynomial time:time: For For 11 variable the check is handled by variable the check is handled by

C’C’1 1 which is the most basic circuit. which is the most basic circuit. any circuit of length any circuit of length i+1i+1 can be can be

validated using a circuit validated using a circuit 11 variable variable smaller by checking substitution of smaller by checking substitution of both options for the extra variable both options for the extra variable and using the already proven and using the already proven ii variable circuit.variable circuit.

Page 76: Slides by Golan Weisz, Omer Ben Shalom Nir Ailon & Tal Moran

7676

If NP has small circuits PH If NP has small circuits PH collapsescollapses

(Proof Cont.5)(Proof Cont.5) The algorithm computes The algorithm computes f(x,y),f(x,y), determines determines ’’ii and and ’’’’ii for all for all ii and evaluates the circuits and evaluates the circuits on the given input, all of which is polynomial on the given input, all of which is polynomial time, therefore our claim is proven. time, therefore our claim is proven.

we can therefore get :we can therefore get :xxL iff L iff (C’(C’11,…,C’,…,C’nn) ) s.t.s.t. y,(y,(11,,22,…,,…,nn),),(x,(C’(x,(C’11,…,C’,…,C’nn),(y,),(y,11,,22,…,,…,nn)) )) R RLL

where where nn is is #var(f(x,y))#var(f(x,y))

This statement is in This statement is in 22 therefore therefore LL22 and and 2222