Table Of ContentTEXTS IN COMPUTER SCIENCE
Editors
David Gries
Fred B. Schneider
TEXTS IN COMPUTER SCIENCE
Apt and Olderog, Verification of Sequential and Concurrent
Programs, Second Edition
Alagar and Periyasamy, Specification of Software Systems
Back and von Wright, Refinement Calculus: A Systematic
Introduction
Beidler, Data Structures and Algorithms: An Object-
Oriented Approach Using Ada 95
Bergin, Data Structures Programming: With the Standard
Template Library in C++
Brooks, C Programming: The Essentials for Engineers and
Scientists
Brooks, Problem Solving with Fortran 90: For Scientists and
Engineers
Dandamudi, Fundamentals of Computer Organization and
Design
Dandamudi, Introduction to Assembly Language
Programming: For Pentium and RISC Processors, Second
Edition
Dandamudi, Introduction to Assembly Language
Programming: From 8086 to Pentium Processors
Fitting, First-Order Logic and Automated Theorem Proving,
Second Edition
Grillmeyer, Exploring Computer Science with Scheme
Homer and Selman, Computability and Complexity Theory
(continued after index)
Dexter C. Kozen
Theory of Computation
With 75 Illustrations
Dexter C.Kozen
Department of Computer Science
Upson Hall
Cornell University
Ithaca,NY 14853-7501,USA
[email protected]
Series Editors:
David Gries Fred B.Schneider
Department of Computer Science Department of Computer Science
Upson Hall Upson Hall
Cornell University Cornell University
Ithaca,NY 14853-7501,USA Ithaca,NY 14853-7501,USA
British Library Cataloguing in Publication Data
A catalogue record for this book is available from the British Library
Library ofCongress Control Number:2005937504
ISBN-10:1-84628-297-7 Printed on acid-free paper
ISBN-13:978-1-84628-297-3
© Springer-Verlag London Limited 2006
Apart from any fair dealing for the purposes ofresearch or private study,or criticism or review,as permitted under the
Copyright,Designs and Patents Act 1988,this publication may only be reproduced,stored or transmitted,in any form
or by any means,with the prior permission in writing ofthe publishers,or in the case ofreprographic reproduction in
accordance with the terms of licences issued by the Copyright Licensing Agency.Enquiries concerning reproduction
outside those terms should be sent to the publishers.
The use ofregistered names,trademarks,etc.in this publication does not imply,even in the absence ofa specific state-
ment,that such names are exempt from the relevant laws and regulations and therefore free for general use.
The publisher makes no representation,express or implied,with regard to the accuracy ofthe information contained in
this book and cannot accept any legal responsibility or liability for any errors or omissions that may be made.
Printed in the United States ofAmerica (HAM)
9 8 7 6 5 4 3 2 1
Springer Science+Business Media
springer.com
To Frances
Preface
These are my lecture notes from CS682: Theory of Computation, a one-
semestercourseforfirst-yeargraduatestudentsincomputerscienceatCor-
nell,whichIhavetaughtoffandonformanyyears.Itookthecoursemyself
as a PhD student at Cornell from Juris Hartmanis, and his influence can
be seen in the presentation and selection of topics.
Overview and Goals
The course serves a dual purpose: to cover core material in the founda-
tions of computing for graduate students in computer science preparing
for their PhD qualifying exams, and to provide an introduction to some
more advanced topics in the theory of computational complexity for those
intending topursuefurtherstudy inthearea.Thecourseisthusamixture
of core and advanced material.
Most of the course is concerned with computational complexity, or the
classificationofcomputationalproblemsintermsoftheirinherentcomplex-
ity.Thisusuallyreferstotimeorspaceusageonaparticularcomputational
model,butmayincludeothercomplexitymeasuresaswell,suchasrandom-
ness,numberofalternations,orcircuitsizeordepth.Weincludearigorous
treatment of computationalmodels, including deterministic, nondetermin-
istic, and alternating Turing machines, circuits,probabilistic machines,in-
teractive proof systems, automata on infinite objects, and various logical
formalisms. Also included are various approximationand inapproximation
resultsandsomelowerbounds.Accordingtomosttreatments,thecomplex-
ity universe stops at polynomial space, but we also look at higher levels of
viii Preface
complexityallthewayupthroughtheprimitiverecursivefunctions,partial
recursive functions, and the arithmetic and analytic hierarchies.
Despite the title of this book, there are many beautiful areas of theo-
retical computer science that I could not cover for lack of time and space.
Intended Audience
The course is aimed at an audience of advanced undergraduates and first-
yeargraduatestudentsincomputerscienceormathematicswithaninterest
inthetheoryofcomputationandcomputationalcomplexity.Itmayalsobe
ofinterestto computerprofessionalsandotherscientistswhowouldlike to
learnmoreabouttheclassicalfoundationsofcomputingandcontemporary
research trends.
Familiaritywiththecontentofstandardundergraduatecoursesinalgo-
rithms andthe theoryofcomputationarehelpfulprerequisites.Inparticu-
lar,wemakefreeuseofdiscretemathematicalstructures,includinggraphs,
trees,anddags;O()ando()notation;finiteautomata,regularexpressions,
pushdown automata, and context-free languages; and Turing machines,
computability, undecidability, and diagonalization. There are many good
undergraduate texts that cover this material, for example, [61, 76, 113].
Organization and Features
The courseconsistsof41 primarylecturesanda handful ofsupplementary
lecturescoveringmorespecializedoradvancedtopics.Inmyprevioustexts
[75, 76], the basic unit is a lecture, which is a more or less self-contained
chunk of 4–7 pages. I have received much positive feedback regarding this
organization,soIhavestuckwithithere.Inadditionto the lectures,there
are12homeworksetsandseveralmiscellaneoushomeworkexercisesofvary-
ing levels of difficulty, many with hints and complete solutions.
Acknowledgments
Many people havecontributedin manywaysto this work,andthere is not
enough I can ever say in thanks. First and foremost, I owe an incalculable
debt of gratitude to my wife, Frances, for her constant love, patience, and
forbearance.
My administrative assistants, Rosemary Adessa, Beth Howard, and
Kelly Patwell, deserve special thanks for making sure that the real world
did not escape my attention for too long a period.
TheprofessionalstaffatSpringer,CatherineBrett,ValerieGreco,Nata-
chaMenar,andWayneWheeler,havebeenmostaccommodatingthrough-
Preface ix
out the entire production process. It has been a pleasure working with
them.
There are many students who over the years have contributed to these
notesandkeptmehonest.Inparticular,IwouldliketothankKamalAboul-
Hosn, Adam Arbree, Adam Barth, Yuri Berkovich, Chavdar Botev, Greg
Bronevetsky, Walter Chen, Pablo Fierens, Suman Ganguli, Dan Gross-
man, Vincent Gu, Milos Hasan, Yannet Interian-Fernandez, Aaron Kauf-
man, Omar H. Khan, L(cid:3) ucja Kot, Brian Kulis, Milind Kulkarni, Ashwin
Machanavajjhala, David Martin, Wojtek Moczydlowski, Antonio Montal-
ban, Jonathan Moon, BryanRenne, Andrew Scukanec, Alexa Sharp, Zoya
Svitkina, and Ryan Williams.
I am especially indebted to my teaching assistants Suresh Chari, Reba
Schuller, and Chaitanya Swamy for their help with proofreading, prepara-
tion of solution sets, and occasionallecturing.
IamgratefultomycolleaguesJin-YiCai,RobertConstable,UrielFeige,
John Hopcroft, Jon Kleinberg, Bakhadyr Khoussainov,Stephen Mahaney,
Anil Nerode, Christos Papadimitriou, Ronitt Rubinfeld, Erik Meineche
Schmidt, Bart Selman, Richard Shore, Michael Sipser, and E´va Tardos
for their interestin this projectand for valuable comments andinteresting
exercises. Uriel’s and Ronitt’s notes on probabilistically checkable proofs
were an especially useful source. Finally, I wish to express my sincerest
gratitude to Juris Hartmanis, who has taught the course many times, and
who is always an inspiration.
I would be most grateful for suggestions or criticism from readers.
Cornell University Dexter Kozen
Ithaca, New York October 2005
Contents
Preface vii
Lectures 1
1 The Complexity of Computations ......................... 3
2 Time and Space Complexity Classes and Savitch’s Theorem . 11
3 Separation Results ..................................... 17
4 The Immerman–Szelepcs´enyiTheorem.................... 22
5 Logspace Computability ................................ 25
6 The Circuit Value Problem.............................. 30
A The Knaster–TarskiTheorem ........................... 35
7 Alternation ........................................... 44
8 Problems Complete for PSPACE ........................ 51
9 The Polynomial-Time Hierarchy ......................... 57
10 More on the Polynomial-Time Hierarchy.................. 62
11 Parallel Complexity .................................... 66
12 Relation of NC to Time-Space Classes.................... 70
13 Probabilistic Complexity................................ 74
14 BPP ⊆ Σp ∩Πp ...................................... 82
2 2
B Chinese Remaindering.................................. 86
C Complexity of Primality Testing ......................... 90
D Berlekamp’s Algorithm ................................. 95
15 Interactive Proofs...................................... 99
16 PSPACE ⊆ IP....................................... 103
17 IP ⊆ PSPACE....................................... 109
18 Probabilistically Checkable Proofs ...................... 113
19 NP ⊆ PCP(n3,1) .................................... 119