p versus np over various structuresjanos/public/usa-2015/sc-logic-seminar.pdf · sc logic seminar,...

60
SC Logic Seminar, February 2015 P = NP and Logic P versus NP over various structures: The millennium question over R, C and other first order structures. Part of a Course given at ESSLLI 2014, T¨ ubingen, Germany Johann A. Makowsky * and K. Meer ** * Faculty of Computer Science, Technion - Israel Institute of Technology, Haifa, Israel [email protected] ** Computer Science Institute Brandenburg University of Technology, Cottbus, Germany [email protected] Offering large sums of money for solutions of outstanding mathematical problems only increaes the number of false solutions. File:sc-title 1

Upload: others

Post on 04-Feb-2021

0 views

Category:

Documents


0 download

TRANSCRIPT

  • SC Logic Seminar, February 2015 P = NP and Logic

    P versus NP over various structures:

    The millennium question over R,C and other first order structures.

    Part of a Course given at ESSLLI 2014, Tübingen, Germany

    Johann A. Makowsky∗ and K. Meer∗∗

    ∗ Faculty of Computer Science,Technion - Israel Institute of Technology, Haifa, Israel

    [email protected]

    ∗∗Computer Science InstituteBrandenburg University of Technology, Cottbus, Germany

    [email protected]

    Offering large sums of money for solutions of outstandingmathematical problems only increaes the number of false solutions.

    File:sc-title 1

  • SC Logic Seminar, February 2015 P = NP and Logic

    The Logical Content of the P = NP-Problem

    J.A. Makowsky

    SC LECTURE: Introduction INTRO (5 slides)Turing machines over relational structures, NEWBSS, (19 slides)Short quantifier elimination. SHORTQE (16 slides)Comparing Poizat’s Theorem with descriptive complexity FAGIN (20 slides)

    File:sc-overview 2

  • SC Logic Seminar, February 2015 P = NP and Logic

    Is P = NP

    in the Turing model of computation?

    P: Polynomial time computable problems

    NP: Problems computable innon-determinsitic polynomial time

    Theorem:(Cook and Levine, 1971/73)There are NP-complete problems

    Problem:Show that P 6= NP !

    Stephen Cook Leonid Levin

    ***********************

    This is one of the Millenium Problems:

    Both a positive and a negative solution will earn you

    1 Million US Dollars

    File:sc-intro 3

  • SC Logic Seminar, February 2015 P = NP and Logic

    Computability over a fixed first order structure A

    The origins of studying

    computability over a fixed first order structure A

    go back into the late 1960ties. At that time they were not concerned with

    complexity theory.

    E. Engeler, Algebraic properties of structures,Mathematical Systems Theory, 1:183-195 (1967)

    H. Friedman, Algebraic procedures, generalizedTuring algorithms, and elementary recursion theory,In: Logic Colloquium ’69, North Holland 1971,pp. 361-389

    Erwin Engeler Harvey Friedman

    File:sc-intro 4

  • SC Logic Seminar, February 2015 P = NP and Logic

    The BSS-model of computation over A

    The complexity classes PA and NPA were introduced in 1989:

    From left to right:Michael ShubLeonore BlumFelipe CuckerStephen Smale

    A is some algebraic structure such as

    • A reduct of the reals R as an ordered real-closed field.

    • An (ordered) ring R.

    • An (ordered) abelian group G.

    L. Blum, M. Shub and S. Smale,On a theory of computation and complexity over the real numbers: NP-completeness, re-cursive functions and unviversal machines, BAMS 21:1-46 (1989)

    L. Blum, F. Cucker, M. Shub and S. Smale,

    Complexity and Real Computation, Springer 1998

    File:sc-intro 5

  • SC Logic Seminar, February 2015 P = NP and Logic

    Two more Millenium Problems:

    PR 6=? NPR and PC 6=? NPC

    Let R be the ordered field of real numbers,and C the field of complex numbers without order.

    Answering any of the two questions

    PR 6=? NPR and PC 6=? NPC

    also earns you 1 million US Dollars!

    • How does it relate to the classical P 6=? NP?

    • Is it more/less difficult?

    • For which structures A can we prove PA 6= NPA ?

    • Are there structures A for which we can prove PA = NPA ?

    File:sc-intro 6

  • SC Logic Seminar, February 2015 P = NP and Logic

    What you will learn (hopefully)

    We put the P = NP question in logical context by defining itfor arbitrary first order structures A.

    We show that solving it for specific A depends on our understanding A.This may involve

    • basic logic

    • model theory

    • algebra

    • number theory

    • complexity theory, or

    • an exciting blend of all of the above.

    Back to overview

    File:sc-intro 7

  • SC Logic Seminar, February 2015 P = NP and Logic

    Turing machines over τ-structures

    This presentation is inspired from presentationsby B. Poizat and M. Prunescu:

    @bookpoizat:95,AUTHOR = B. Poizat,TITLE = Les Petits Cailloux,PUBLISHER = Aléas, Lyon,SERIES = Nur Al-Mantiq War-Ma’rifah,NUMBER = 3,YEAR = 1995

    @inproceedingsprunescu:06,AUTHOR = Mihai Prunescu,TITLE = Fast Quantifier Elimination Means P = NP,BOOKTITLE = CiE,YEAR = 2006,PAGES = 459-470

    File:sc-bss 8

  • SC Logic Seminar, February 2015 P = NP and Logic

    First order structures A over a vocabulary τ

    • A vocabulary is a set of function symbols, relation symbols and constantsymbols of arity rf(i), rr(i) ∈ N.

    • Constant symbols: ci of arity 0Relation symbols: Ri,rr(i) of arity rr(i) ≥ 1.Function symbols: Fi,rf(i) of arity rf(i) ≥ 1.Vocabulary: τ ⊆ {ci : i ∈ N} ∪ {Ri,rr(i) :∈ N} ∪ {Fi,rr(i) :∈ N}

    • A τ-structure A is an interpretation of a vocabulary.The universe of A is a non-empty set A.The interpretation of ci is an element cAi ∈ A.The interpretation of Ri,rr(i) is a relation R

    Ai,rr(i) ⊆ A

    rr(i).

    The interpretation of Fi,rf(i) is a function FAi,rf(i) : A

    rf(i) → A.

    Unless otherwise stated, vocabularies are finite.

    File:sc-bss 9

  • SC Logic Seminar, February 2015 P = NP and Logic

    Turing machines for τ-structures, I

    In τ-structures A we omit the superscript, when the context is clear, and donot distinguish between symbols and their interpretation. We also assumethat each element of its universe A has a unique name.

    The Turing machine Mτ works as follows:

    • M is a multi-tape machine with finitely tapes and states.The number of tapes as it least maxi,j{rr(i), rf(j) : i, j ∈ N}.

    • Tape number i consists of cells indexed by Z and has a head Hi.

    • Each cell of M contains either a name of an element a ∈ Aor the symbol 2 for blank.

    • Let xi be the content of a cell on tape i with head position Hi.

    • M is initialized with the input data.

    File:sc-bss 10

  • SC Logic Seminar, February 2015 P = NP and Logic

    Turing machines for τ-structures, II

    The following program steps may occur:

    • stop, the halting instruction;

    • Hi+ or Hi−: Moving the head on tape i;

    • xi := xj, where xj is the content of cell j at head position Hj.

    • xi := Fi,rf(i)(xj1, . . . , xjrf(i)), with xj` as above.

    • If Ri,rf(i)(xj1, . . . , xjrf(i)), goto state q, else goto q′ with xj` as above.

    • If Hi = 2 goto q else to q′.

    Each such step is performed in one unit of time.

    File:sc-bss 11

  • SC Logic Seminar, February 2015 P = NP and Logic

    Decision problems and functions for M.

    Let A? =⊔i∈NA

    n.

    Elements of A? are finite words over A, considered as an alphabet.

    • A problem P is a subset of A?.

    • M decides P if for all x ∈ A? the machine halts in an accepting state ifx ∈ P , and halts in a rejecting state if x 6∈ P .

    • M computes a function f : A? → A if M halts on input a ∈ A? with f(a)in the output cell.

    • Given a machine M, halting sets are the sets

    Halt+(M) = {a ∈ A? : M halts and accepts input a}Halt−(M) = {a ∈ A? : M halts and rejects input a}

    Halt(M) = Halt+(M) ∪Halt−(M) = {a ∈ A? : M halts on input a}

    File:sc-bss 12

  • SC Logic Seminar, February 2015 P = NP and Logic

    Determinsitic complexity classes over A

    • A problem P (a function f) is in the class CompA (FCompA ) if thereexists a machine M over A which decides P (computes f).

    • Let t : N→ N be a function.‘A problem P (a function f) is in the class CompA(t) (FCompA(t)) if thereexists a machine M over A which decides P (computes f) in time t(n)for input of size n.

    • A problem P is in the class PA if the there a a machine M over A whichdecides P in polynomial time (in unit cost).

    • A function f is in the class FPA if the there a a machine M over A whichcomputes f in polynomial time (in unit cost).

    • Other deterministic complexity classes are defined similarly.Say exponential time and its variations.

    File:sc-bss 13

  • SC Logic Seminar, February 2015 P = NP and Logic

    Examples over the ordered field of realsRofield = 〈R,+,×,≤,0,1〉

    • Input a matrix m ∈ Rn×n. Compute the determinant det(m).This is in FPRofield.

    • Input a matrix m ∈ Rn×n. Compute the permanent per(m).This is in exponential time but not known to be in FPRofield.

    • The problem Pinteger = {a ∈ R : a ∈ Z} is in CompRofield.For positive input x we subtract 1 till the results is smaller than −x. If we passedthrough 0 we accept, else we reject. For negative input we first put y := −x and testfor y.

    • There is no function t(n) such that Pinteger ∈ CompRofield(t).To see this we first note that all inputs are of size 1.So a machine deciding Pinteger uses time bounded by a constant.

    We shall see in lectures SHORTQE and TABLE that this contradictsthe characterization of halting sets.

    File:sc-bss 14

  • SC Logic Seminar, February 2015 P = NP and Logic

    Pinteger is NOT computable without order

    Let A(ā) be a program with machine constants ā which decides N over R.

    Let c ∈ R be non-algebraic over Q[ā]. So A(ā) rejects c.

    In particular, all tests of A(ā) test whether c 6= t(ā) where t(ā) is a rationalfunction.

    But there are only finitely many such tests in A(ā).

    Therefore, there is n0 ∈ N with the same test results.

    This n0 is rejected by A(ā), a contradiction! 2

    Why does this argument not work in the presence of order?

    File:sc-bss 15

  • SC Logic Seminar, February 2015 P = NP and Logic

    Non-deterministic complexity classes

    In Turing machines using binary strings there are two definitions of

    non-determinism for polynomial time computations:

    Let p(x) ∈ Z[x] be a polynomial with p(a) ∈ N for a ∈ N.

    Coin tosses: On input of size n we are allowed p(n) coin tosses and use theirresults in the machine.

    This defines the non-deterministic complexity class NPbinary.

    Guesses: On input of size n we are allowed to guess p(n) values in {0,1}and use their results in the machine.

    This defines the non-deterministic complexity class NPguess.

    Theorem 1 (Folklore)For Turing machines using binary strings the two classes coincide:

    NPbinary = NPguess

    File:sc-bss 16

  • SC Logic Seminar, February 2015 P = NP and Logic

    Infinite guess space

    If A is infinite the two definitions differ:

    • NPbinaryA gives 2p(n) choices for coin tosses on input of size n,which is finite.

    • NPguessA allows for infinitely many guesses, even on fixed input size.

    It follows that

    • Problems P ∈ NPbinaryA are always decidable in exponential time,hence P ∈ CompA.

    • Problems P ∈ NPguessA are not always decidable,hence it is not obvious that P ∈ CompA.

    File:sc-bss 17

  • SC Logic Seminar, February 2015 P = NP and Logic

    Typical problems in NPRofield

    HN(R): (Hilbert’s Nullstellensatz): Given the coefficients in R of a finite setF of polynomials withF ∈ R[x1, . . . , xn] for each f ∈ F , decide whether there is ā ∈ Rn such thatfor each f ∈ F we have f(ā) = 0.

    4-FEAS(R): Given one polynomial F ∈ R[x1, . . . , xn] of degree ≤ 4, is thereF ∈ R[x1, . . . , xn] such that f(ā) = 0.

    LPF(R): (Linear programming feasibility): Given a set of m inequalties in nvariables

    Ai · x =∑j

    ai,j · xj ≥ bi, i = 1, . . . ,m

    with ai,j ∈ R, decide whether there is c ∈ Rn such that Ai · c ≥ bi for alli = 1, . . . ,m.

    File:sc-bss 18

  • SC Logic Seminar, February 2015 P = NP and Logic

    Is every problem P ∈ NPA also in CompA?

    For coin tossing we always have P ∈ NPbinaryA implies CompA.

    For guessing, whether P ∈ NPguessA implies CompA.is not obvious at all.

    • For the ring of integers Zring the problem HN(Zring) is not in CompZring.This is due to the undecidability of existential formulas in Zring by theDavis-Putnam-Robinson-Matyasevich (DPRM) Theorem.

    • For the ordered field of reals Rofield the problem HN(Rofield) is in CompRfield.This is due to the decidability of the theory of real closed fields by theTarski-Seidenberg Theorem.

    Both are highly non-trivial results.

    File:sc-bss 19

  • SC Logic Seminar, February 2015 P = NP and Logic

    Polynomial time Turing reducibility

    We want to introduce oracle calls or, less mystic, subroutine calls.

    Let P be a problem.

    Let Oracle(P ) be a device (oracle, subroutine call) which on input x1, . . . , xnsolves problem P at unit cost.

    We are not too precise here: We have to define an oracle machine M(P ).

    • It has an oracle-input tape.

    • It has an oracle call instruction, which reads the input from the oracle-input tape and returns 1 if the input is accepted by P , and 0 otherwise.

    • Now the result of an oracle call can be used in the test.

    Given to problems P1 and P2 we say that P1 ispolynomial time Turing reducible to P2 and write P1

  • SC Logic Seminar, February 2015 P = NP and Logic

    NPA-complete problems

    HN(R): (Hilbert’s Nullstellensatz): Given the coefficients in R of a finite setF of polynomials with F ∈ R[x1, . . . , xn] for each f ∈ F , decide whetherthere is ā ∈ Rn such that for each f ∈ F we have f(ā) = 0.

    4-FEAS(R): Given one polynomial F ∈ R[x1, . . . , xn] of degree ≤ 4, is thereF ∈ R[x1, . . . , xn] such that f(ā) = 0.

    CSAT: The satisfiability problem for τ-circuits (to be defined below).

    FSAT: The satisfiability problem for τ-formulas (to be defined below).

    The following is not known to be in PA, nor NPA-complete:

    LPF(R): (Linear programming feasibility): Given a set of m inequalties in nvariables Ai ·x =

    ∑j ai,j ·xj ≥ bi, i = 1, . . . ,m with ai,j ∈ R, decide whether

    there is c ∈ Rn such that Ai · c ≥ bi for all i = 1, . . . ,m.

    File:sc-bss 21

  • SC Logic Seminar, February 2015 P = NP and Logic

    τ-circuits, I

    Let τ have at least two constant symbols 0 and 1.A τ-circuit C is a finite labeled directed acyclic graph (DAG).

    • The vertices of C are called gates.

    • The directed edges of C are called arrows.

    • There are input, output gates and selection gates.There are constant, function and relation gates.

    • The gates input and output elements of a τ-structure A.

    • There is at least one input gate and one output gate.

    • The in-degree (fan-in) and out-degree (fan-out) of the gatesare finite and bounded by the maximal arities ofrelation and function symbols in τ .

    File:sc-bss 22

  • SC Logic Seminar, February 2015 P = NP and Logic

    τ-circuits, II

    • An input gate has fan-in 1. It copies the input element and sends it alongthe arrows.

    • A constant gate has fan-in 0. It sends its constant along the arrows.

    • The relation and function gates have fan-in given by the correspondingarities.The relation gate outputs the truth value of its relation, i.e., 0 (false) or1 (true).The function gates outputs the value of its function.

    • The selection gate has fan-in 3 and computes the selection functions(x, y, z) with (s(0, y, z) = y, (s(1, y, z) = z and s(x, y, z) = x otherwise.

    • Decision circuits have one output gate which outputs x ∈ {0,1}.

    The complexity measure of a circuit C is the number of gates.

    File:sc-bss 23

  • SC Logic Seminar, February 2015 P = NP and Logic

    Algebraic vs branching circuits

    • τ-circuits, as defined here, are branching circuits.

    • Algebraic circuits have only function gates anddo not allow selection gates, tests and case distinctions.

    The theory of algebraic circuits is well developedand was initiated by L. Valiant (born 1948) in 1992.

    L. G. Valiant. Why is Boolean complexity theory difficult?

    Proceedings of the London Mathematical Society symposiumon Boolean function complexity, pp. 8494, 1992.

    File:sc-bss 24

  • SC Logic Seminar, February 2015 P = NP and Logic

    Poizat’s Theorem

    Let Mτ be a machine over A with k tapes working in time bounded by t(n), where t(n) : N→ Nis a function of the input size n with t(n) ≥ n.

    Theorem 2 (B. Poizat, 1995)There is a recursive sequence of circuits Cn(x1, . . . , xn) of size ≤ t(n)k+1and a polynomial p(x) ∈ Z[x] with p(n) ∈ N for n ∈ N, such that

    (i) for an input a ∈ A? of size n both the machine Mτ and Cn(x1, . . . , xn)gives the same result, and

    (ii) the circuits Cn (encoded as a binary string) are uniformly constructed bya classical Turing machine from (an encoding of) Mτ and n in time p(n).

    Proof sketch:

    • The computation of Mτ on input of size n can represented by an execution graph Gnwith cycles.

    • To get Cn unwind the execution graph of the machine Mτ and turn it into a DAG.

    • To compute the sequence Cn uniformly note that both Gn and hence Cn can be com-puted uniformy in polynomial time.

    2

    File:sc-bss 25

  • SC Logic Seminar, February 2015 P = NP and Logic

    C-Sat

    C− SATA is the following problem:

    Input w(C)a ∈ A?, with w(C) a binary encoding of a circuit C(x, y).

    Problem Is there b ∈ A? such that

    〈A, a, b〉 |= C(a, b)

    Theorem 3For every τ-structure A the problem C− SATA is NPA-complete.

    Proof: Clearly C− SATA ∈ NPA.

    Conversely, let P ∈ NPA. Using Theorem 2, there are τ-circuits CPn solving Pfor inputs of size n.Let w(CPn ) be the binary string encoding C

    Pn . 2

    Back to overview

    File:sc-bss 26

  • SC Logic Seminar, February 2015 P = NP and Logic

    Enter first order logic

    • We now establish the connection to first order logic

    • We define vocabularies as set of function, relation and constant symbols.

    • We define structures and formulas.

    • We introduce quantifier elimination.

    File:sc-formulas 27

  • SC Logic Seminar, February 2015 P = NP and Logic

    First order structures A over a vocabulary τ (reminder)

    • A vocabulary is a set of function symbols, relation symbols and constantsymbols of arity rf(i), rr(i) ∈ N.

    • Constant symbols: ci of arity 0Relation symbols: Ri,rr(i) of arity rr(i) ≥ 1.Function symbols: Fi,rf(i) of arity rf(i) ≥ 1.Vocabulary: τ ⊆ {ci : i ∈ N} ∪ {Ri,rr(i) :∈ N} ∪ {Fi,rr(i) :∈ N}

    • A τ-structure A is an interpretation of a vocabulary.The universe of A is a non-empty set A.The interpretation of ci is an element cAi ∈ A.The interpretation of Ri,rr(i) is a relation R

    Ai,rr(i) ⊆ A

    rr(i).

    The interpretation of Fi,rf(i) is a function FAi,rf(i) : A

    rf(i) → A.

    Unless otherwise stated, vocabularies are finite.

    File:sc-formulas 28

  • SC Logic Seminar, February 2015 P = NP and Logic

    The set of τ-formulas FOL(τ)

    Let τ be a set of function and relation symbols.

    • Variables are v0, v1, . . . , vi, . . . for i ∈ N

    • Terms are either variables, constant symbols, or of the form F (t1, . . . , trf(F )) for termsti and F ∈ τ .

    • Atomic formulas are ti ≈ tj or of the form R(t1, . . . , trf(F )) for terms ti and R ∈ τ .

    • Quantifier-free formulas are boolean combinations of atomic formulas.

    • existential formulas are of the form ∃v1, . . . ∃v`φ with φ a quantifier-free formula.

    • τ-formulas are closed under boolean combinations and quantifcation of free variables.

    The size of a τ-formula is the number of connectives and quantifiers occuring in it.

    File:sc-formulas 29

  • SC Logic Seminar, February 2015 P = NP and Logic

    Accepting sets for circuits

    Let Mτ be a non-deterministic τ-machine on A with running time t(n).For b ∈ Am let Accn(M, b) be the set

    Accn(M, b) = {a ∈ An : M accepts input a with guess b ∈ Am}and NAccn(M) be the set

    NAccn(M) = {a ∈ An : there is a guess b ∈ Am s.t. M accepts input a}

    Theorem 4(i) Accn(M, b) is definable by a

    quantifier-free τ-formula with equality φ(v1, . . . , vn, u1, . . . , um).

    (ii) NAccn(M) is definable by theexistential τ-formula ∃u1, . . . , umφ(v1, . . . , vn, u1, . . . , um).

    Both formulas are of size polynomial in t(n).

    Proof sketch: Induction using Theorem 2. We replace M for input of size n by its circuit.

    • Single gates: write down the input/output relation.

    • Use induction over the depth of the DAG.

    2

    File:sc-formulas 30

  • SC Logic Seminar, February 2015 P = NP and Logic

    From τ-formulas to τ-circuits

    Let C = C(a, b) be a τ-circuit for input a and guess b.Accn(C, b) and NAccn(C) are defined as for τ-machines.

    Proposition 5Let φ(a, b) be a quantifier-free τ-formula of size s(n) in n variables.There exists a τ-circuit C(a, b) such that

    • The size of C(a, b) is polynomial in the size s(n),

    • Accn(C, b) is the formula φ(a, b).

    • NAccn(C) is the formula ∃bφ(a, b).

    Proof: We have to implement the gates of the boolean operations of truth values 0,1 using

    explicit truthtables and use relation gates for testing equality and the relations.

    Then we follow the tree presentation of φ. 2

    File:sc-formulas 31

  • SC Logic Seminar, February 2015 P = NP and Logic

    All quantifier-free formulas occur

    as descriptions of accepting sets

    Lemma 6Let φ(a, b) be a quantifier free formula with input a of size n guess b.

    There are τ-machines MD and MN solving PD ∈ PA and PN ∈ NPA such that

    • Accn(MD, b) is the formula φ(a, b).

    • NAccn(MN) is the formula ∃bφ(a, b).

    File:sc-formulas 32

  • SC Logic Seminar, February 2015 P = NP and Logic

    FSAT

    FSATA is the following problem:

    Input w(φ)a ∈ A?, with w(φ) a binary encoding of a quantifier-free formulaφ.

    Problem (q) Is there b ∈ A? such that

    〈A, a, b〉 |= φ(a, b)

    Problem (e) Is it true that

    〈A, a〉 |= ∃bφ(a, b)

    Clearly the two problems are equivalent.

    Theorem 7For every τ-structure A the problem FSATA is NPA-complete.

    File:sc-formulas 33

  • SC Logic Seminar, February 2015 P = NP and Logic

    Proof of Theorem 7

    Clearly FSATA ∈ NPA.

    Conversely, we interpret CSAT in FSAT.Let w(C(x, y)), a ∈ A? be an instance of CSAT.

    For a gate γ in C of in-degree k let γ1, . . . , γk the predecessor gates of γ. Foreach gate γ in C which is not an input gate, a constant gate or an outputgate let zγ be a new variable and z be the sequence of all these.

    Consider the quantifier-free formula

    φC =

    (∧γ

    zγ ≈ γ(γ1, . . . , γk)

    )∧ γoutput ≈ 1

    φC is of size polynomial in the size of C.

    Now ∃y(C(a, y) = 1 iff ∃y∃z̄φC(y, z) which is of the form of Problem (e). 2

    File:sc-formulas 34

  • SC Logic Seminar, February 2015 P = NP and Logic

    Quantifier elimination over A

    Let A be a τ-structure and

    Th(A) = {θ ∈ FOL(τ) : A |= θ where θ has no free variables}

    Let φ and ψ vary over τ-formulas with free variables x1, . . . , xn. We say that A allows

    • Elimination of quantifiers (QE(A)) if for every φ there is a quantifier-freeψ such that

    Th(A) |= ∀x(φ⇔ ψ)

    • Elimination of existential quantifiers (EQE(A)) if for every existential φthere is such a quantifier-free ψ.

    • Short elimination of quantifiers (SQE(A)) if for every existential φ thereis such a quantifier-free ψ whose size is polynomial in the size of φ.

    • Fast elimination of quantifiers (FQE(A)) if there is a polynomial timealgorithm giving the result of SQE(A).

    File:sc-formulas 35

  • SC Logic Seminar, February 2015 P = NP and Logic

    Quantifier elimination

    • Clearly we have

    FQE(A)⇒ SQE(A)⇒ EQE(A)⇒ QE(A)

    • There are quite a few τ-strutures A with QE(A):– Infinite set (with τ = ∅).– The field of complex numbers and the ordered field of real numbers.– Dense linear orders with prescribed extreme elements (4 cases)

    • Every finite τ-structure F has EQE(F) but SQE(F) isequivalent to P = NP in the Turing model of computation.

    • M. Prunescu showed that there is an infinite structure Awith FQE(A).

    File:sc-formulas 36

  • SC Logic Seminar, February 2015 P = NP and Logic

    Poizat’s fast QE Theorem

    Theorem 8 (Poizat)

    Let A be a τ-structure.

    The following are equivalent.

    • PA = NPA

    • A allows fast quantifier elimination (FQE).

    • A allows short quantifier elimination (SQE).

    File:sc-formulas 37

  • SC Logic Seminar, February 2015 P = NP and Logic

    (i): PA = NPA implies SQE(A)

    • Let ∃bφ(x, b) be an existential formula with n free variables.By Lemma 6 there is a polynomial time non-deterministic machine MNsuch that

    ∃bφ(x, b) describes NAccn(MN)

    • As PA = NPA there is a polynomial time deterministic machine MD whichaccepts the same inputs as MN .

    • Let ψ(x) be a quantifier-free formula which describes Accn(MD).

    • ψ(x) is of size polynomial in n and is equivalent to ∃bφ(x, b), which provesSQE(A).

    2

    File:sc-formulas 38

  • SC Logic Seminar, February 2015 P = NP and Logic

    (ii): PA = NPA implies FQE(A)

    • By PA = NPA we have also F− SATA ∈ PA.

    • We use Poizat’s Theorem (Theorem 2) from lecture NEWBSS.

    • Let Cn be the polynomial time computable family of circuits which solvesF− SATA, and (∃bφ(a, b), a) be an instance.

    • Let w = w(∃bφ(a, b)) be the code of ∃bφ(a, b). w ∈ {0,1}?, and Cwthe circuit obtained from Cn by replacing the input gates for w by thecorrecponding constants of w. Cw is a circuit wich accepts a iff Cn acceptswa.

    • So a ∈ Accn(M) iff 〈A, a, b〉 |= ∃bφ(a, b).

    • Finally the quantifier-free formula ψ(a) describing Accn(M) is the requiredformula.

    2

    File:sc-formulas 39

  • SC Logic Seminar, February 2015 P = NP and Logic

    (iii): SQE(A) implies PA = NPA

    • It suffices to show that F− SATA ∈ PA.

    • Let (∃bφ(x, b), a) be an instance of F− SATA.By SQE(A) there is a polynomial size quantifier-free formula ψ(x) equiv-alent to ∃bφ(x, b).

    • Evaluation of quantifier-free can be done in polynomial time.

    2

    To prove the theorem we need (ii) and (iii) and FQE(A)⇒ SQE(A).

    (i) and (iii) give SQE(A) iff PA = NPA

    File:sc-formulas 40

  • SC Logic Seminar, February 2015 P = NP and Logic

    The true challenge!

    • For τ-structures A with QE(A):Find lower and upper bounds for the length of the quantifier eliminatingformulas.

    • The Million Dollar Problems:Prove or disprove SQE(A) for A

    any finite structurethe field of complex numbers

    the ordered field of real numbers

    Note: The field of the real numbers without order has no QE.

    Back to overview

    File:sc-formulas 41

  • SC Logic Seminar, February 2015 P = NP and Logic

    Two logical approaches to the

    classical P = NP problem

    In this lecture we want to compare

    • Poizat’s Fast QE Theoremdealing with PA = NPA for fixed finite τ-structures, and quantifier elimi-nation in the first order theory of A.

    • Fagin’s Theoremdealing with classes of finite τ-structures definable in fragments of secondorder logic SOL(τ).

    File:sc-fagin 42

  • SC Logic Seminar, February 2015 P = NP and Logic

    Poizat’s fast QE Theorem

    Theorem 9 (Poizat, see lecture 1)

    Let A be a τ-structure.A can be finite or infinite, ordered or without order.

    The following are equivalent.

    • PA = NPA

    • A allows fast quantifier elimination (FQE).

    • A allows short quantifier elimination (SQE).

    File:sc-fagin 43

  • SC Logic Seminar, February 2015 P = NP and Logic

    Poizat’s Theorem for A = Z2, I

    We look at binary words w ∈ {0,1}∗.

    • Let w = 0m1m of size n = 2m. This is accepted or rejected in polynomialtime machine M0m1m.

    • How does the accepting formula look like ?For fixed n it must be a formula φn(v1, . . . , vn) in n free variables.

    • For n = 2m+ 1 odd φn is unsatisfiable.

    • For n = 2m even we can write

    φn(v1, . . . , vn) =

    m∧i=1

    vi = 0 ∧2m∧

    i=m+1

    vi = 1

    File:sc-fagin 44

  • SC Logic Seminar, February 2015 P = NP and Logic

    Poizat’s Theorem for A = Z2, II

    • Let L1 ⊆ {0,1}∗ be a regular language.To construct the accepting formula for input size n we use theMyhill-Nerode Theorem to construct φn inductively.

    More on the blackboard.

    • Let L2 be the set of words w of size 2m with an equal number of 0’s and1’s.Given w ∈ L2 we can re-order the letters to get a word w′ = 0m1m.This can be expressed as

    φn(v1, . . . , vn) = ∃u1, . . . , un

    n∧i=1

    ui = vi ∧m∧i=1

    ui = 0 ∧2m∧

    i=m+1

    ui = 1

    How does the quantifier-free formula look like which is equivalent to φn and of size

    polynomial in n?

    File:sc-fagin 45

  • SC Logic Seminar, February 2015 P = NP and Logic

    Words in A and words as τword-structures

    In this course, so far, we have looked at words w ∈ A? for a fixed τ-structureA.

    Now we shall look at words w ∈ A? of length n as τAword-structures with universe[n] = {0,1, . . . , n− 1}.

    • τAword consists of a binary relation

  • SC Logic Seminar, February 2015 P = NP and Logic

    Second order logic SOL(τ)

    Second order logic SOL(τ) is defined like first order logic FOL(τ), with ad-ditional quantification rules:

    • First order variables vi, i ∈ N, and second order variables Ui,r, i, r ∈ N.

    • τ-terms and atomic τ-formulas are as in FOL(τ);

    • Additionally, Ui,r(t1, . . . , tr) are atomic formulas, where t1, . . . , tr are terms.

    • SOL(τ) is closed under boolean operations and first order quantificationrules;

    • Additionally, we have existential and universal quantification for secondorder variables.

    ∀Ui,r and ∃Ui,r

    The semantics is defined in the natural way, where an assignment z assigns

    elements of [n] to first order variables, and z(Ui,r) ⊆ [n]r.

    File:sc-fagin 47

  • SC Logic Seminar, February 2015 P = NP and Logic

    Examples

    • A word w = aa∗b ∗ b is characterized by:“there is a position i such that all positions j < i contain the letter a andall positions j ≥ i contain the letter b”This can be expressed as

    ∃i((∀j(j < i→ Pa(j)) ∧ (∀j(j ≥ i→ Pb(j)))

    • A word w = (ab+)+a is characterized by“there is a set U ⊂ [n] of positions, including the first and last position,holding the letter a, such that all positions j 6∈ U hold the letter b”This can be expressed as

    ∃U1,1(U1,1(cfirst) ∧ U1,1(cloast) ∧ (∀jU1,1(j)→ Pa(j)) ∧ (∀j¬U1,1(j)→ Pb(j)))

    File:sc-fagin 48

  • SC Logic Seminar, February 2015 P = NP and Logic

    The Büchi-Elgot-Trakhtenbrot (BET) Theorem

    Monadic second order logic MSOL(τ) is like SOL(τ) but with second ordervariables restricted to unary variables Ui,1.

    Existential second order logic ESOL(τ) consists of existential formulasof the form ∃U1,r1, . . . , Um,rmφwhere φ ∈ FOL(τ) is a first order formula.

    A language L is a set of words, L ⊂ A∗.

    A language is regular if it is recognizable by a finite automaton.

    Theorem 10 (BET, ca. 1960)

    A language L ⊆ A∗ is regular iff the set of finite τA-structures

    {Aw : w ∈ L}is definable by a monadic second order formula ΦL ∈MSOL(τ), i.e.

    w ∈ L iff Aw |= ΦL

    File:sc-fagin 49

  • SC Logic Seminar, February 2015 P = NP and Logic

    Ordered finite structures

    For some of the theorems we need that finite τ structures have a predicateexpressing that the universe is linearly orderd.

    • We therefore assume that the universe is a set [n] = {0,1, . . . , n− 1} andthe ordering is the natural order on [n].

    • Expressing that [n] is odd over the empty vocabulary is NOT possible inMSOL.

    • In the presence of the ordering this is possible by saying that the lastelement is reachable by jumps of two along the order.

    In fact we need the order to express this, but any other order on [n]would serve the same purpose.

    File:sc-fagin 50

  • SC Logic Seminar, February 2015 P = NP and Logic

    Some classes of graphs definable in SOL(τgraph)

    • Graphs of even cardinality, of even degree. order is needed !

    • regular graphs, and regular graphs of degree d.

    • Connected graphs

    • Eulerian graphs

    • 3-colorable graphs

    • Hamiltonian graphs

    To be discussed on the blackboard.

    File:sc-fagin 51

  • SC Logic Seminar, February 2015 P = NP and Logic

    Coding finite τ-structures as words

    Let w(A) denote a fixed coding of the structure A

    • Let Lτ be the language which consists of all the words coding some finiteτ-structure, i.e.,

    Lτ = {w(A) : A is is a τ − structure}

    • We assume that Lτ ∈ P.

    • We also assume that given a word w ∈ Lτ we can find in polynomial timea τ-structure A such that w(A) = w.

    To make this more precise, we assume that the universe A of A is A = [n] for some

    n ∈ N. The structure is given if we can determine in polynomial time whether a tuplek1, . . . , kr is in the relation R of arity r.

    File:sc-fagin 52

  • SC Logic Seminar, February 2015 P = NP and Logic

    Defining P and NP for classes of structures

    Let w(A) denote the coding of the structure A as a word.

    • A class of finite τ-structures C is said to be in P if the language LC is inP.

    • A class of finite τ-structures C is said to be in NP if the language LC isin NP.

    File:sc-fagin 53

  • SC Logic Seminar, February 2015 P = NP and Logic

    Some classes of graphs and their complexity

    In P:

    • Graphs of even cardinality, of even degree. order is needed !

    • regular graphs, and regular graphs of degree d.

    • Connected graphs

    • Eulerian graphs

    NP-complete:

    • 3-colorable graphs

    • Hamiltonian graphs

    To be discussed on the blackboard.File:sc-fagin 54

  • SC Logic Seminar, February 2015 P = NP and Logic

    Fagin’s Theorem

    Let τ be a relational vocabulary(possibly without a binary relation for the ordering of the universe).

    Theorem 11 (Fagin 1975)

    Let C be a set of finite τ-structures. The following are equivalent:

    • C ∈ NP;

    • there is a τ-formula φ ∈ ESOL(τ) such that

    A ∈ C iff A |= φ

    File:sc-fagin 55

  • SC Logic Seminar, February 2015 P = NP and Logic

    The fragment HornESOL(τ).

    • A quantifier-free τ-formula is a Horn clause if it is a disjunction of atomicor negated atomic formulas where at most one is not negated.

    ¬α1 ∨ ¬α2 ∨ . . . ∨ ¬αn ∨ βwhere αi, β are atomic.

    • A quantifier-free τ-formula is a Horn formula if it is a conjunction of Hornclauses.

    • A formula φ ∈ SOL(τ) is in HSOL(τ) of it is of the form

    ∃U1,r1, U2,r2, . . . , Uk,rk∀v1, . . . , vmH(v1, . . . , vm, U1,r1, U2,r2, . . . , Uk,rk)where H is a Horn formula and vi are first order variables.

    File:sc-fagin 56

  • SC Logic Seminar, February 2015 P = NP and Logic

    Some classes of graphs definable in HornESOL(τgraph)

    • Graphs of even cardinality, of even degree. order is needed !

    • regular graphs, and regular graphs of degree d.

    • Connected graphs

    • Eulerian graphs

    To be discussed on the blackboard.

    File:sc-fagin 57

  • SC Logic Seminar, February 2015 P = NP and Logic

    The Immerman-Vardi-Grädel Theorem (IVG)

    Let τ be a relational vocabulary with a binary relationfor the ordering of the universe.

    Theorem 12 (Immermann, Vardi, Graedel 1980-4)

    Let C be a set of finite τ-structures. The following are equivalent:

    • C ∈ P;

    • there is a τ-formula φ ∈ HornESOL(τ) such that A ∈ C iff A |= φ.

    Here the presence of the ordering is crucial:

    Without it the class of structures for the empty vocabulary of even cardinality

    is in P, but not definable in HornESOL.

    File:sc-fagin 58

  • SC Logic Seminar, February 2015 P = NP and Logic

    Conclusion: The logical equivalent to P = NP

    Let τ be a relational vocabulary which containsa binary relation for the ordering of the universe.

    The following are equivalent:

    • P = NP in the classical framework.

    • There is a finite τ-structure A such thatthe first order theory Th(A) has fast (short) QE.

    • For every finite τ-structure Athe first order theory Th(A) has fast (short) QE.

    • Every ESOL(τ)-formula is equivalent over finite ordered τ-structures tosome HornESOL(τ)-formula.

    File:sc-fagin 59

  • SC Logic Seminar, February 2015 P = NP and Logic

    Thank you all !

    Homepage: www.cs.technion.ac.il/∼janos

    e-mail: [email protected]

    The complete slides are posted on my homepage as

    ESSLLI-2014-Lectures

    http://www.cs.technion.ac.il/ janos/COURSES/ESSLLI-2014

    Check regularly.

    File:sc-fagin 60