Introduction to clarithmetic I

"Clarithmetic" is a generic name for formal number theories similar to Peano arithmetic, but based on computability logic (see http://www.cis.upenn.edu/~giorgi/cl.html) instead of the more traditional classical or intuitionistic logics. Formulas of c…

Authors: Giorgi Japaridze

Computability logic (CoL), introduced in [13,17,26], is a semantical, mathematical and philosophical platform, and a long-term program, for redeveloping logic as a formal theory of computability, as opposed to the formal theory of truth which logic has more traditionally been. Under the approach of CoL, formulas represent computational problems, and their "truth" is seen as algorithmic solvability. In turn, computational problems -understood in their most general, interactive sense -are defined as games played by a machine against its environment, with "algorithmic solvability" meaning existence of a machine that wins the game against any possible behavior of the environment. And an open-ended collection of the most basic and natural operations on computational problems forms the logical vocabulary of the theory. With this semantics, CoL provides a systematic answer to the fundamental question "what can be computed?", just as classical logic is a systematic tool for telling what is true. Furthermore, as it turns out, in positive cases "what can be computed" always allows itself to be replaced by "how can be computed", which makes CoL of potential interest in not only theoretical computer science, but many applied areas as well, including interactive knowledge base systems, resource oriented systems for planning and action, or declarative programming languages. While potential applications have been repeatedly pointed out in earlier papers on CoL, so far all technical efforts had been mainly focused on finding axiomatizations for various fragments of this semantically conceived and inordinately expressive logic. Considerable advances have already been made in this direction ( [14]- [16], [18]- [29], [34]), and more results in the same style are probably still to come. It should be however remembered that the main value of CoL, or anything else claiming to be a "Logic" with a capital "L", will eventually be determined by whether and how it relates to the outside, extra-logical world. In this respect, unlike many other systems officially classified as "logics", the merits of classical logic are obvious, most eloquently demonstrated by the fact that applied formal theories, a model example of which is Peano arithmetic PA, can be and have been successfully based on it. Unlike pure logics with their meaningless symbols, such theories are direct tools for studying and navigating the real world with its non-man-made, meaningful objects, such as natural numbers in the case of arithmetic. To make this point more clear to a computer scientist, one could compare a pure logic with a programming language, and applied theories based on it with application programs written in that language. A programming language created for its own sake, mathematically or esthetically appealing but otherwise unusable as a general-purpose, comprehensive basis for application programs, would hardly be of much interest. So, in parallel with studying possible axiomatizations and various metaproperties of pure CoL, it would certainly be worthwhile to devote some efforts to justifying its right on existence through revealing its power and appeal as a basis for applied systems. First and so far the only concrete steps in this direction have been made very recently in [27], where a CoL-based system CLA1 of (Peano) arithmetic was constructed. 1Unlike its classical-logic-based counterpart PA, CLA1 is not merely about what arithmetical facts are true, but about what arithmetical problems can be actually computed or effectively solved. More precisely, every formula of the language of CLA1 expresses a number-theoretic computational problem (rather than just a true/false fact), every theorem expresses a problem that has an algorithmic solution, and every proof encodes such a solution. Does not this sound exactly like what the constructivists have been calling for? Unlike the mathematical or philosophical constructivism, however, and even unlike the early-day theory of computation, modern computer science has long understood that, what really matters, is not just computability, but rather efficient computability. So, the next natural step on the road of revealing the importance of CoL for computer science would be showing that it can be used for studying efficient computability just as successfully as for studying computability-in-principle. Anyone familiar with the earlier work on CoL could have found reasons for optimistic expectations here. Namely, every provable formula of any of the known sound axiomatizations of CoL happens to be a scheme of not only "always computable" problems, but "always efficiently computable" problems just as well, whatever efficiency exactly means in the context of interactive computation that CoL operates in. That is, at the level of pure logic, computability and efficient computability yield the same classes of valid principles. The study of logic abounds with phenomena in this style. One example would be the well known fact about classical logic, according to which validity with respect to all possible models is equivalent to validity with respect to just models with countable domains. At the level of reasonably expressive applied theories, however, one should certainly expect significant differences depending on whether the underlying concept of interest is efficient computability or computabilityin-principle. For instance, the earlier-mentioned system CLA1 proves formulas expressing computable but often intractable arithmetical problems. A purpose of the present paper is to construct a CoL-based system for arithmetic which, unlike CLA1, proves only efficiently -specifically, polynomial time -computable problems. The new applied formal theory CLA4 presented in Section 11 achieves this purpose. It is also a good starting point for exploring the wider class of systems under the generic name "clarithmetic"arithmetical theories based on CoL, with CLA4 being a model example of complexity-oriented versions of clarithmetic, a series of other variations of which, such as systems for polynomial space computability, primitive recursive computability, PA-provably recursive computability and so on, are still to come in the near future (see [30,31]). Among the main purposes of the present piece of writing is to introduce the promising world of clarithmetic to a relatively wide audience. This explains the semitutorial style in which the paper is written. It targets readers with no prior familiarity with CoL. Just like CLA1, our present system CLA4 is not only a cognitive, but also a problem-solving tool: in order to find a solution for a given problem, it would be sufficient to write the problem in the language of the system, and find a proof of it. An algorithmic solution for the problem then would automatically come together with such a proof. However, unlike the solutions extracted from CLA1-proofs, which might be intractable, the solutions extracted from CLA4-proofs would always be efficient. Furthermore, CLA4 turns out to be not only sound, but also complete in a certain reasonable sense that we call extensional completeness. According to the latter, every number-theoretic computational problem that has a polynomial time solution is represented by some theorem of CLA4. Taking into account that there are many ways to represent the same problem, extensional completeness is weaker than what can be called intensional completeness, according to which any formula representing an (efficiently) computable problem is provable. In these terms, Gödel's celebrated theorem, here with "truth"="computability", is about intensional rather than extensional incompleteness. In fact, extensional completeness is not at all interesting in the context of classical-logic-based theories such as PA. In such theories, unlike CoL-based theories, it is trivially achieved, as the provable formula ⊤ represents every true sentence. Syntactically, our CLA4 is an extension of PA, and the semantics of the former is a conservative generalization of the semantics of the latter. Namely, the formulas of PA, which form only a proper subclass of the formulas of CLA4, are seen as special, "moveless" sorts of problems/games, automatically solved/won when true and failed/lost when false. This makes the classical concept of truth just a special case of computability in our sense -it is nothing but computability restricted to (the problems represented by) the traditional sorts of formulas. And this means that Gödel's incompleteness theorems automatically extend from PA to CLA4, so that, unlike extensional completeness, intensional completeness in CLA4 or any other sufficiently expressive sound CoL-based applied theory is impossible to achieve in principle. As for CLA1, it turns out to be incomplete in both senses. Section 15 shows that any recursively axiomatizable, sufficiently expressive, sound system would be (not only intensionally but also) extensionally incomplete, as long as the semantics of the system is based on unrestricted (as opposed to, say, efficient) computability. Among the main moral merits of the present investigation and its contributions to the overall CoL project is an illustration of the fact that, in constructing CoL-based applied theories, successfully switching from computability to efficient computability is possible and even more than just possible. As noted, efficient computability, in fact, turns out to be much better behaved than computability-in-principle: the former allows us to achieve completeness in a sense in which the latter yields inherent incompleteness. An advanced reader will easily understand that the present paper, while focused on the system CLA4 of (cl)arithmetic, in fact is not only about arithmetic, but also just as much about CoL-based applied theories or knowledge base systems in general, with CLA4 only serving as a model example of such systems. Generally, the nonlogical axioms or the knowledge base of a CoL-based applied system would be any collection of (formulas expressing) problems whose algorithmic or efficient solutions are known. Sometimes, together with nonlogical axioms, we may also have nonlogical rules of inference, preserving the property of computability or efficient computability. Then, the soundness of the corresponding underlying axiomatization of CoL (in our present case, it is system CL12 studied in [27,29]) -which usually comes in the strong form called uniform-constructive soundness -guarantees that every theorem T of the theory also has an effective or efficient solution and that, furthermore, such a solution can be effectively or efficiently extracted from a proof of T . It is this fact that, as mentioned, makes CoL-based systems problem-solving tools. More specifically, efficiency-oriented systems in the above style and CLA4 in particular can be seen as programming languages, where "programming" simply means theorem-proving. The soundness of the underlying system guarantees that any proof that can be written will be translatable into a program that runs efficiently and indeed is a solution of the problem expressed by the target formula of the proof. Note that the problem of verifying whether a program meets its specification, which is generally undecidable, is fully neutralized here: the "specification" is nothing but the target formula of the proof, and the proof itself, while encoding an efficient program, also automatically serves as a verification of the correctness of that program. Furthermore, every step/formula of the proof can be viewed as its own (best possible) "comment". In a more ambitious and, at this point, somewhat fantastic perspective, after developing reasonable theorem-provers, CoL-based efficiency-oriented systems can be seen as declarative programming languages in an extreme sense, where human "programming" just means writing a formula expressing the problem whose efficient solution is sought for systematic usage in the future. That is, a program simply coincides with its specification. The compiler's job would be finding a proof (the hard part) and translating it into a machine-language code (the easy part). The process of compiling could thus take long but, once compiled, the program would run fast ever after. Various complexity-oriented systems have been studied in the literature ( [2,3,6,7,8,9,10,33,35] and more). A notable advantage of CoL-based complexity-oriented systems over the other systems with similar aspirations, which typically happen to be inherently weak systems, is having actually or potentially unlimited strength, with the latter including the full expressive and deductive power of classical logic and Peano arithmetic. In view of the above-outlined potential applications, the importance of this feature is obvious: the stronger a system, the better the chances that a proof/program will be found for a declarative, non-preprocessed, ad hoc specification of the goal. Among the other appealing features of clarithmetic is being semantically meaningful in the full generality of its language, scalable, and easy to understand in its own right. Syntactically it also tends to be remarkably simple. For instance, on top of the standard Peano axioms, our present system CLA4 only has two additional axioms ⊓x⊔y(y = x + 1) and ⊓x⊔y(y = 2x), one saying that the function x + 1 is (efficiently) computable, and the other saying the same about the function 2x. As will be seen later, from these two innocuous-looking axioms and one (also very simple) rule of induction called CLA4-Induction, via CoL, one can obtain "practically full" information about polynomial time computability of number-theoretic problems, in the same sense as PA, despite Gödel's incompleteness, allows us to obtain "practically full" information about arithmetical truth. To put it in other words, if a formula F is not provable in CLA4, it is unlikely that anyone would find a polynomial time algorithm solving the problem expressed by F : either such an algorithm does not exist, or (as will be seen from Theorem 16.2) showing its correctness requires going beyond ordinary combinatorial reasoning formalizable in PA. The closest ancestor of our present system CLA4 is Buss's bounded arithmetic for polynomial time. The similarity is related to the single yet important fact that the above-mentioned rule of CLA4-Induction is nothing but an adaptation of Buss's PIND ("Polynomial Induction") principle to the new semantical environment in which CLA4 operates. In this sense, CLA4 can be characterized as a "CoL-based bounded arithmetic", as opposed to Buss's original versions of bounded arithmetic that are based on classical ( [6]) or intuitionistic ( [7]) logics. The switch to CoL as the logical basis for such theories creates notable differences. Among the advantages offered by this switch is absolute flexibility (as long as certain minimum-strength requirements are satisfied) in selecting the underlying "purely arithmetical" axioms. Choosing the latter to be the kind old axioms of Peano, as done in CLA4, allows us to achieve dramatically greater (than in the case of Buss's systems) intensional strength. Furthermore, as shown in Section 16, replacing Peano axioms with stronger ones can take us arbitrarily close to intensional completeness. This is just as far as one can go in similar pursuits because, as already noted, in view of Gödel's incompleteness phenomenon, no particular recursively enumerable system can be intensionally complete. In contrast, even "slightly" increasing the strength of the underlying (carefully hand-picked and intensionally very weak) set of arithmetical axioms in classical-logic-based or intuitionistic-logic-based bounded arithmetic immediately results in loss of soundness. We will come back to this topic in Section 17. Introducing and justifying CoL in full generality is not among the goals of the present paper -this job has been done in [13,17,26]. We will reintroduce only as much of (the otherwise much wider) CoL as technically necessary for understanding the system CLA4 based on it. As noted, formulas in CoL represent computational problems. Such problems are understood as games between two players: ⊤, called Machine, and ⊥, called Environment (these names will not always be capitalized, and may take articles "a" or "the"). Machine is a mechanical device with fully determined, algorithmic behavior. On the other hand, there are no restrictions on the behavior of Environment. A given machine is considered to be solving a given problem iff it wins the corresponding game no matter how the environment acts. Standard atomic sentences, such as "0 = 0" or "Peggy is John's mother", are understood as special sorts of games, called elementary. There are no moves in elementary games, and they are automatically won or lost. Specifically, the elementary game represented by a true sentence is won (without making any moves) by Machine, and the elementary game represented by a false sentence is won by Environment. Logical operators are understood as operations on games/problems. One of the important groups of such operations, termed choice operations, comprises ⊓ , ⊔ , ⊓, ⊔. These are called choice conjunction, choice disjunction, choice universal quantifier and choice existential quantifier, respectively. A 0 ⊓ A 1 is a game where the first legal move ("choice"), which should be either 0 or 1, is by ⊥. After such a move/choice i is made, the play continues and the winner is determined according to the rules of A i ; if a choice is never made, ⊥ loses. A 0 ⊔ A 1 is defined in a symmetric way with the roles of ⊥ and ⊤ interchanged: here it is ⊤ who makes an initial choice and who loses if such a choice is not made. With the universe of discourse being {0, 1, 10, 11, 100, . . .} (natural numbers identified with their binary representations), the meanings of the quantifiers ⊓ and ⊔ can now be explained by is a game where the first move is by Environment. Such a move should consist in selecting a particular number n for x, intuitively amounting to asking whether n is prime or composite. This move brings the game down to (in the sense that the game continues as) Now Machine has to move, or else it loses. The move should consist in choosing one of the two disjuncts. Let us say the left disjunct is chosen, which further brings the game down to Prime(n). The latter is an elementary game, and here the interaction ends. Machine wins iff it has chosen a true disjunct. The choice of the left disjunct by Machine thus amounts to claiming/answering that n is prime. Overall, as we see, ⊓x Prime(x) ⊔ Composite(x) represents the problem of deciding the primality question. 2Similarly, is the problem of computing the product of any two numbers. Here the first two moves are by Environment, which selects some particular m = x and n = y, thus asking Machine to tell what the product of m and n is. Machine wins if and only if, in response, it selects a (the) number k for z such that k = m × n. Another group of game operations dealt with in this paper comprises ¬, ∧ , ∨ , → . Employing the classical symbols for these operations is no accident, as they are conservative generalizations of the corresponding Boolean operations from elementary games to all games. Negation ¬ is a role-switch operation: it turns ⊤'s moves and wins into ⊥'s moves and wins, and vice versa. Since elementary games have no moves, only the winners are switched there, so that, as noted, ¬ acts just as the ordinary classical negation when applied to such games. For instance, as ⊤ is the winner in 0 + 1 = 1, the winner in ¬0 + 1 = 1 will be ⊥. That is, ⊤ wins the negation ¬A of an elementary game A iff it loses A, i.e., if A is false. As for the meaning of negation when applied to nonelementary games, at this point it may be useful to observe that ¬ interacts with choice operations in the kind old DeMorgan fashion. For example, it would not be hard to see that The operations ∧ and ∨ are called parallel conjunction and parallel disjunction, respectively. Playing A 0 ∧ A 1 (resp. A 0 ∨ A 1 ) means playing the two games in parallel where, in order to win, ⊤ needs to win in both (resp. at least one) of the components A i . It is obvious that, just as in the case of negation, ∧ and ∨ act as classical conjunction and disjunction when applied to elementary games. For instance, 0 + 1 = 1 ∨ 0 × 1 = 1 is a game automatically won by Machine. There are no moves in it as there are no moves in either disjunct, and Machine is an automatic winner because it is so in the left disjunct. To appreciate the difference between the two -choice and parallel -groups of connectives, compare ⊓x Prime(x) ⊔ ¬Prime(x) and ⊓x Prime(x) ∨ ¬Prime(x) . The former is a computationally nontrivial problem, existence of an easy (polynomial time) solution for which had remained an open question until a few years ago. As for the latter, it is trivial, as Machine has nothing to do in it: the first (and only) move is by Environment, consisting in choosing a number n for x. Whatever n is chosen, Machine wins, as Prime(n) ∨ ¬Prime(n) is a true sentence and hence an automatically ⊤-won elementary game. The operation → , called strict reduction, is defined by Intuitively, this is indeed the problem of reducing B to A: solving A → B means solving B while having A as an external computational resource. Resources are symmetric to problems: what is a problem to solve for one player is a resource that the other player can use, and vice versa. Since A is negated in (¬A) ∨ B and negation means switching the roles, A appears as a resource rather than problem for ⊤ in A → B. Consider ⊓x⊔y(y = x 2 ). Anyone who knows the definition of x 2 in terms of × (but perhaps does not know the meaning of multiplication, or is unable to compute this function for whatever reason) would be able to solve the problem i.e., the problem as it is about reducing the consequent to the antecedent. A solution here goes like this. Wait till Environment specifies a value n for x, i.e. asks "what is the square of n?". Do not try to immediately answer this question, but rather specify the same value n for both z and u, thus asking the counterquestion: "what is n times n?". Environment will have to provide a correct answer m to this counterquestion (i.e., specify v as m where m = n × n), or else it loses. Then, specify y as m, and rest your case. Note that, in this solution, Machine did not have to compute multiplication, doing which had become Environment's responsibility. Machine only correctly reduced the problem of computing square to the problem of computing product, which made it the winner. Another group of operations that play an important role in CoL comprises ∀ and its dual ∃ (with ∃xA(x) = ¬∀x¬A(x)), called blind universal quantifier and blind existential quantifier, respectively. ∀xA(x) can be thought of as a "version" of ⊓xA(x) where the particular value of x that Environment selects is invisible to Machine, so that it has to play blindly in a way that guarantees success no matter what that value is. Compare the problems ⊓x Even(x) ⊔ Odd(x) and ∀x Even(x) ⊔ Odd(x) . Both of them are about telling whether a given number is even or odd; the difference is only in whether that "given number" is known to Machine or not. The first problem is an easy-to-win, two-move-deep game of a structure that we have already seen. The second game, on the other hand, is one-move deep with only Machine to make a move -select the "true" disjunct, which is hardly possible to do as the value of x remains unspecified. Just like all other operations for which we use classical symbols, the meanings of ∀ and ∃ are exactly classical when applied to elementary games. Having this full collection of classical operations makes CoL a generalization and conservative extension of classical logic. Going back to an earlier example, even though (1) expresses a "very easily solvable" problem, that formula is still not logically valid. Note that the success of the reduction strategy of the consequent to the antecedent that we provided for it relies on the nonlogical fact that x 2 = x × x. That strategy would fail in a general case where the meanings of x 2 and x × x may not necessarily be the same. On the other hand, the goal of CoL as a general-purpose problem-solving tool should be to allow us find purely logical solutions, i.e., solutions that do not require any special, domain-specific knowledge and (thus) would be good no matter what the particular predicate or function symbols of the formulas mean. Any knowledge that might be relevant should be explicitly stated and included either in the antecedent of a given formula or in the set of axioms ("implicit antecedents" for every potential formula) of a CoL-based theory. In our present case, formula (1) easily turns into a logically valid one by adding, to its antecedent, the definition of square in terms of multiplication: The strategy that we provided earlier for (1) is just as good for (2), with the difference that it is successful for (2) no matter what x 2 and z × u mean, whereas, in the case of (1), it was guaranteed to be successful only under the standard arithmetical interpretations of the square and product functions. Thus, our strategy for (2) is, in fact, a "purely logical" solution. The above examples should not suggest that blind quantifiers are meaningful or useful only when applied to elementary problems. The following is an example of a winnable nonelementary ∀-game: ∀y Even(y) ⊔ Odd(y) → ⊓x Even(x + y) ⊔ Odd(x + y) . (3) Solving this problem, which means reducing the consequent to the antecedent without knowing the value of y, is easy: ⊤ waits till ⊥ selects a value n for x, and also tells -by selecting a ⊔ -disjunct in the antecedent -whether y is even or odd. Then, if n and y are both even or both odd, ⊤ chooses the left ⊔ -disjunct in the consequent, otherwise it chooses the right ⊔ -disjunct. Replacing the ∀y prefix by ⊓y would significantly weaken the problem, obligating Environment to specify a value for y. Our strategy does not really need to know the exact value of y, as it only exploits the information about y's being even or odd, provided by the antecedent of the formula. Many more -natural, meaningful and useful -operations beyond the ones discussed in this section have been introduced and studied within the framework of CoL. Here we have only surveyed those that are relevant to our present investigation. Now we are getting down to formal definitions of the concepts informally explained in the previous section. To define games formally, we need certain technical terms and conventions. Let us agree that a move means any finite string over the standard keyboard alphabet. A labeled move (labmove) is a move prefixed with ⊤ or ⊥, with such a prefix (label) indicating which player has made the move. A run is a (finite or infinite) sequence of labmoves, and a position is a finite run. We will be exclusively using the letters Γ, ∆, Φ for runs, and α, β for moves. The letter ℘ will always be a variable for players, and ℘ will mean "℘'s adversary" ("the other player"). Runs will be often delimited by " " and " ", with thus denoting the empty run. The meaning of an expression such as Φ, ℘α, Γ must be clear: this is the result of appending to the position Φ the labmove ℘α and then the run Γ . The following is a formal definition of what we call constant games, combined with some less formal conventions regarding the usage of certain terminology. Definition 3.1 A constant game is a pair A = (Lr A , Wn A ), where: 1. Lr A is a set of runs satisfying the condition that a (finite or infinite) run is in Lr A iff all of its nonempty finite initial segments are in Lr A (notice that this implies ∈ Lr A ). The elements of Lr A are said to be legal runs of A, and all other runs are said to be illegal. We say that α is a legal move for ℘ in a position Φ of A iff Φ, ℘α ∈ Lr A ; otherwise α is illegal. When the last move of the shortest illegal initial segment of Γ is ℘-labeled, we say that Γ is a ℘-illegal run of A. 2. Wn A is a function that sends every run Γ to one of the players ⊤ or ⊥, satisfying the condition that if Γ is a ℘-illegal run of A, then Wn A Γ = ℘. When Wn A Γ = ℘, we say that Γ is a ℘-won (or won by ℘) run of A; otherwise Γ is lost by ℘. Thus, an illegal run is always lost by the player who has made the first illegal move in it. An important operation not explicitly mentioned in Section 2 is what is called prefixation. This operation takes two arguments: a constant game A and a position Φ that must be a legal position of A (otherwise the operation is undefined), and returns the game Φ A. Intuitively, Φ A is the game playing which means playing A starting (continuing) from position Φ. That is, Φ A is the game to which A evolves (will be "brought down") after the moves of Φ have been made. We have already used this intuition when explaining the meaning of choice operations in Section 2: we said that after ⊥ makes an initial move i ∈ {0, 1}, the game A 0 ⊓ A 1 continues as A i . What this meant was nothing but that ⊥i Here is a definition of prefixation: Definition 3.2 Let A be a constant game and Φ a legal position of A. The game Φ A is defined by: A terminological convention important to remember is that we often identify a legal position Φ of a game A with the game Φ A. So, for instance, we may say that the move 1 by ⊥ brings the game B 0 ⊓ B 1 down to the position B 1 . Strictly speaking, B 1 is not a position but a game, and what is a position is ⊥1 , which we here identified with the game B 1 = ⊥1 (B 0 ⊓ B 1 ). We say that a constant game A is finite-depth iff there is an integer d such that no legal run of A contains more than d labmoves. The smallest of such integers d is called the depth of A. "Elementary" means "of depth 0". This paper will exclusively deal with finite-depth games. This restriction of focus makes many definitions and proofs simpler. Namely, in order to define a finite-depth-preserving game operation O(A 1 , . . . , A n ) applied to such games, it suffices to specify the following: (i) Who wins O(A 1 , . . . , A n ) if no moves are made, i.e., the value of Wn O(A1,...,An) . (ii) What are the initial legal (lab)moves, i.e., the elements of {℘α | ℘α ∈ Lr O(A1,...,An) }, and to what game is the game O(A 1 , . . . , A n ) brought down after such an initial legal labmove ℘α is made. Recall that, by saying that a given labmove ℘α brings a given game A down to B, we mean that ℘α A = B. Then, the set of legal runs of O(A 1 , . . . , A n ) will be uniquely defined, and so will be the winner in every legal (and hence finite) run of the game. Below we define a number of operations for finite-depth games only. Each of these operations can be easily seen to preserve the finite-depth property. Of course, more general definitions of these operationsnot restricted to finite-depth games -do exist (see, e.g., [26]), but in this paper we are trying to keep things as simple as possible. Definition 3.3 Let A, B, A 0 , A 1 , . . . be finite-depth constant games, and n be a positive integer. 1. ¬A is defined by: (ii) ℘α ∈ Lr ¬A iff ℘α ∈ Lr A . Such an initial legal labmove ℘α brings the game down to ¬ ℘α A. 2. A 0 ⊓ . . . ⊓ A n is defined by: (ii) ℘α ∈ Lr A0 ⊓ ... ⊓ An iff ℘ = ⊥ and α = i ∈ {0, . . . , n}. 3 Such an initial legal labmove ⊥i brings the game down to A i . 3. A 0 ∧ . . . ∧ A n is defined by: (ii) ℘α ∈ Lr A0 ∧ ... ∧ An iff α = i.β, where i ∈ {0, . . . , n} and ℘β ∈ Lr Ai . Such an initial legal labmove ℘i.β brings the game down to 4. A 0 ⊔ . . . ⊔ A n and A 0 ∨ . . . ∨ A n are defined exactly as A 0 ⊓ . . . ⊓ A n and A 0 ∧ . . . ∧ A n , respectively, only with "⊤" and "⊥" interchanged. 5. The infinite ⊓ -conjunction A 0 ⊓ A 1 ⊓ . . . is defined exactly as A 0 ⊓ . . . ⊓ A n , only with "i ∈ {0, 1, . . .}" instead of "i ∈ {0, . . . , n}". Similarly for the infinite version of ⊔ . 6. In addition to the earlier-established meanings, the symbols ⊤ and ⊥ also denote two special -simplest -constant games, defined by Wn ⊤ = ⊤, Wn ⊥ = ⊥ and Lr ⊤ = Lr ⊥ = { }. A → B is treated as an abbreviation of (¬A) ∨ B. Example 3.4 The game (0 = 0 ⊓ 0 = 1) → (10 = 11 ⊓ 10 = 10), i.e. ¬(0 = 0 ⊓ 0 = 1) ∨ (10 = 11 ⊓ 10 = 10), has thirteen legal runs, which are: 1 . It is won by ⊤, because ⊤ is the winner in the right ∨ -disjunct (consequent). 2 ⊤0.0 . (The labmove of) this run brings the game down to ¬0 = 0 ∨ (10 = 11 ⊓ 10 = 10), and ⊤ is the winner for the same reason as in the previous case. 3 ⊤0.1 . It brings the game down to ¬0 = 1 ∨ (10 = 11 ⊓ 10 = 10), and ⊤ is the winner because it wins in both ∨ -disjuncts. 4 ⊥1.0 . It brings the game down to ¬(0 = 0 ⊓ 0 = 1) ∨ 10 = 11. ⊤ loses as it loses in both ∨ -disjuncts. 5 ⊥1.1 . It brings the game down to ¬(0 = 0 ⊓ 0 = 1) ∨ 10 = 10. ⊤ wins as it wins in the right ∨ -disjunct. 6-7 ⊤0.0, ⊥1.0 and ⊥1.0, ⊤0.0 . Both bring the game down to the false ¬0 = 0 ∨ 10 = 11, and both are lost by ⊤. 8-9 ⊤0.1, ⊥1.0 and ⊥1.0, ⊤0.1 . Both bring the game down to the true ¬0 = 1 ∨ 10 = 11, which makes ⊤ the winner. 10-11 ⊤0.0, ⊥1.1 and ⊥1.1, ⊤0.0 . Both bring the game down to the true ¬0 = 0 ∨ 10 = 10, so ⊤ wins. 12-13 ⊤0.1, ⊥1.1 and ⊥1.1, ⊤0.1 . Both bring the game down to the true ¬0 = 1 ∨ 10 = 10, so ⊤ wins. Constant games can be seen as generalized propositions: while propositions in classical logic are just elements of {⊤, ⊥}, constant games are functions from runs to {⊤, ⊥}. As we know, however, propositions only offer very limited expressive power, and classical logic needs to consider the more general concept of predicates, with propositions being nothing but special -constant -cases of predicates. The situation in CoL is similar. Our concept of a (simply) game generalizes that of a constant game in the same sense as the classical concept of a predicate generalizes that of a proposition. We fix an infinite set of expressions called variables, for which we will be using x, y, z, s, r, t, u, v, w as metavariables. An expression like x will usually stand for a finite sequence of variables. Similarly for later-defined objects such as constants or terms. We also fix another infinite set of expressions called constants: {ǫ, 1, 10, 11, 100, 101, 110, 111, 1000, . . .}. These are thus binary numerals -the strings matching the regular expression ǫ ∪ 1(0 ∪ 1) * , where ǫ is the empty string. We will be typically identifying such strings -by some rather innocent abuse of conceptswith the natural numbers represented by them in the standard binary notation, and vice versa. Note that ǫ represents 0. For this reason, following the many-century tradition, we shall usually write 0 instead of ǫ, keeping in mind that, in such contexts, the length |0| of the string 0 should be seen to be 0 rather than 1. We will be mostly using a, b, c, d as metavariables for constants. A universe (of discourse) is a pair (U, U ), where U is a nonempty set, and U , called the naming function of the universe, is a function that sends each constant c to an element c U of U . The intuitive meaning of c U = s is that c is a name of s. Both terminologically and notationally, we will typically identify each universe (U, U ) with its first component and, instead of "(U, U )", write simply "U ", keeping in mind that each such "universe" U comes with a fixed associated function U . A universe U = (U, U ) is said to be ideal iff U coincides with the above-fixed set of constants, and U is the identity function on that set. Note that, in a non-ideal universe, such as the set of all real numbers, some objects may have several names (e.g., 1/3, 2/6, 3/9 are different names of the same number), some have unique names (e.g. the famous number π), and some have no names at all. The same applies to the universe of astronomy, where some stars and planets have unique names, some have several names (Venus = Morning Star = Evening Star), and most have no names at all. On the other hand, the standard universe of arithmetic is ideal: every natural number has a unique name -the corresponding binary numeral -with which it can be identified. By a valuation on a universe U , or a U -valuation, we mean a mapping e that sends each variable x to an element e(x) of U . When a universe U is fixed, irrelevant or clear from the context, we may omit references to it and simply say "valuation". In these terms, a classical predicate p can be understood as a function that sends each valuation e to a proposition, i.e., to a constant predicate. Similarly, what we call a game sends valuations to constant games: Definition 4.1 Let U be a universe. A game on U is a function A from U -valuations to constant games. We write e[A] (rather than A(e)) to denote the constant game returned by A on valuation e. Such a constant game e[A] is said to be an instance of A. For readability, we usually write Lr A e and Wn A e instead of Lr e[A] and Wn e [A] . Just as this is the case with propositions versus predicates, constant games in the sense of Definition 3.1 will be thought of as special, constant cases of games in the sense of Definition 4.1. In particular, each constant game A ′ is the game A such that, for every valuation e, e[A] = A ′ . From now on we will no longer distinguish between such A and A ′ , so that, if A is a constant game, it is its own instance, with A = e[A] for every e. Where n is a natural number, we say that a game A is n-ary iff there are n variables such that, for any two valuations e 1 and e 2 that agree on all those variables, we have e 1 [A] = e 2 [A]. Generally, a game that is n-ary for some n, is said to be finitary. Our paper is going to exclusively deal with finitary games and, for this reason, we agree that, from now on, when we say "game", we usually mean "finitary game". For a variable x and valuations e 1 , e 2 , we write e 1 ≡ x e 2 to mean that the two valuations have the same universe and agree on all variables other than x. We say that a game A depends on a variable x iff there are two valuations e 1 , e 2 with e 1 ≡ x e 2 such that e 1 [A] = e 2 [A]. An n-ary game thus depends on at most n variables. And constant games are nothing but 0-ary games, i.e., games that do not depend on any variables. We say that a (not necessarily constant) game A is elementary iff so are all of its instances e[A]. And we say that A is finite-depth iff there is a (smallest) integer d, called the depth of A, such that the depth of no instance of A exceeds d. Just as constant games are generalized propositions, games can be treated as generalized predicates. Namely, we will see each predicate p of whatever arity as the same-arity elementary game such that, for every valuation e, Wn p e = ⊤ iff p is true at e. And vice versa: every elementary game p will be seen as the same-arity predicate which is true at a given valuation e iff Wn p e = ⊤. Thus, for us, "predicate" and "elementary game" are going to be synonyms. Accordingly, any standard terminological or notational conventions familiar from the literature for predicates also apply to them seen as elementary games. Just as the Boolean operations straightforwardly extend from propositions to all predicates, our operations ¬, ∧ , ∨ , → , ⊓ , ⊔ extend from constant games to all games. This is done by simply stipulating that e[. . .] commutes with all of those operations: ¬A is the game such that, for every valuation e, e[¬A] = ¬e[A]; A ⊓ B is the game such that, for every valuation e, e[A ⊓ B] = e[A] ⊓ e[B]; etc. So does the operation of prefixation: provided that Φ is a legal position of every instance of A, Φ A is understood as the unique game such that, for every valuation e, e[ Φ A] = Φ e[A]. Definition 4.2 Let A be a finite-depth game on a universe U , x 1 , . . . , x n be pairwise distinct variables, and c 1 , . . . , c n be constants. On the same universe, the game which we call the result of substituting x 1 , . . . , x n by c 1 , . . . , c n in A, denoted A(x 1 /c 1 , . . . , x n /c n ), is defined by stipulating that, for every valuation e on U , e[A(x 1 /c 1 , . . . , x n /c n )] = e ′ [A], where e ′ is the valuation on U that sends each x i to c i and agrees with e on all other variables. Following the standard readability-improving practice established in the literature for predicates, we will often fix pairwise distinct variables x 1 , . . . , x n for a game A and write A as A(x 1 , . . . , x n ). Representing A in this form sets a context in which we can write A(c 1 , . . . , c n ) to mean the same as the more clumsy expression A(x 1 /c 1 , . . . , x n /c n ). Definition 4.3 Let A(x) be a finite-depth game on a given universe. On the same universe, ⊓xA(x) and ⊔xA(x) are defined as the following two games, respectively: Thus, every initial legal move of ⊓xA(x) or ⊔xA(x) is a constant c ∈ {0, 1, 10, 11, 100, . . .}, which in our informal language we may refer to as "the constant chosen (by the corresponding player) for x". We will say that a game A is unistructural iff, for any two valuations e 1 and e 2 , Lr A e1 = Lr A e2 . Of course, all constant or elementary games are unistructural. It can also be easily seen that all our game operations preserve the unistructural property of games. For the purposes of the present paper, considering only unistructural games would be sufficient. We define the remaining operations ∀ and ∃ only for unistructural games: Definition 4.4 Below A(x) is an arbitrary finite-depth unistructural game on a universe U . On the same universe: 1. The game ∀xA(x) is defined by stipulating that, for every U -valuation e, player ℘ and move α, we have: (i) Wn ∀xA(x) e = ⊤ iff, for every valuation g with g ≡ x e, Wn A(x) g = ⊤. (ii) ℘α ∈ Lr ∀xA(x) e iff ℘α ∈ Lr A(x) e . Such an initial legal labmove ℘α brings the game e[∀xA(x)] down to e[∀x ℘α A(x)]. 2. The game ∃xA(x) is defined in exactly the same way, only with ⊤ and ⊥ interchanged. The play hits (ends as) the true proposition ∀y Even(y) → Odd(11 + y) and hence is won by ⊤. Before closing this section, we want to make the rather straightforward observation that the DeMorgan dualities hold for all of our sorts of conjunctions, disjunctions and quantifiers, and so does the double negation principle. That is, we always have: In traditional game-semantical approaches, including Blass's [4,5] approach which is the closest precursor of ours, player's strategies are understood as functions -typically as functions from interaction histories (positions) to moves, or sometimes ( [1]) as functions that only look at the latest move of the history. This strategies-as-functions approach, however, is inapplicable in the context of CoL, whose relaxed semantics, in striving to get rid of "bureaucratic pollutants" and only deal with the remaining true essence of games, does not impose any regulations on which player can or should move in a given situation. Here, in many cases, either player may have (legal) moves, and then it is unclear whether the next move should be the one prescribed by ⊤'s strategy function or the one prescribed by the strategy function of ⊥. For a game semantics whose ambition is to provide a comprehensive, natural and direct tool for modeling interaction, the strategies-as-functions approach would be less than adequate, even if technically possible. This is so for the simple reason that the strategies that real computers follow are not functions. If the strategy of your personal computer was a function from the history of interaction with you, then its performance would keep noticeably worsening due to the need to read the continuously lengthening -and, in fact, practically infinite -interaction history every time before responding. Fully ignoring that history and looking only at your latest keystroke in the spirit of [1] is also not what your computer does, either. In CoL, (⊤'s effective) strategies are defined in terms of interactive machines, where computation is one continuous process interspersed with -and influenced by -multiple "input" (environment's moves) and "output" (machine's moves) events. Of several, seemingly rather different yet equivalent, machine models of interactive computation studied in CoL, here we will employ the most basic, HPM ("Hard-Play Machine") model. An HPM is nothing but a Turing machine with the additional capability of making moves. The adversary can also move at any time, with such moves being the only nondeterministic events from the machine's perspective. Along with the ordinary work tape, the machine has an additional tape called the run tape. The latter, serving as a dynamic input, at any time spells the "current position" of the play. Its role is to make the run fully visible to the machine. In these terms, an algorithmic solution (⊤'s winning strategy) for a given constant game A is understood as an HPM M such that, no matter how the environment acts during its interaction with M (what moves it makes and when), the run incrementally spelled on the run tape is a ⊤-won run of A. As for ⊥'s strategies, there is no need to define them: all possible behaviors by ⊥ are accounted for by the different possible nondeterministic updates of the run tape of an HPM. In the above outline, we described HPMs in a relaxed fashion, without being specific about technical details such as, say, how, exactly, moves are made by the machine, how many moves either player can make at once, what happens if both players attempt to move "simultaneously", etc. As it turns out, all reasonable design choices yield the same class of winnable games as long as we consider a certain natural subclass of games called static. Such games are obtained by imposing a certain simple formal condition on games (see, e.g., Section 5 of [26]), which we do not reproduce here as nothing in this paper relies on it. We shall only point out that, intuitively, static games are interactive tasks where the relative speeds of the players are irrelevant, as it never hurts a player to postpone making moves. In other words, static games are games that are contests of intellect rather than contests of speed. And one of the theses that CoL philosophically relies on is that static games present an adequate formal counterpart of our intuitive concept of "pure", speed-independent interactive computational problems. Correspondingly, CoL restricts its attention (more specifically, possible interpretations of the atoms of its formal language) to static games. All elementary games turn out to be trivially static, and the class of static games turns out to be closed under all game operations studied in CoL. More specifically, all games expressible in the language of the later-defined logic CL12, or theory CLA4, are static, as well as constant, finitary and finite-depth. Accordingly, we agree that, in this paper, we shall use the term "computational problem", or simply "problem", as a synonym of "constant, finitary, finite-depth, static game". As noted, computability of static games is rather robust with respect to the technical details of the underlying model of interaction. And the loose description of HPMs that we gave in the previous section would be sufficient for most purposes, just as mankind had been rather comfortably studying and using algorithms long before the Church-Turing thesis in its precise form came around. Namely, relying on just the intuitive concept of algorithmic strategies (believed in CoL to be adequately captured by the HPM model) would be sufficient if we only needed to show existence of such strategies for various games. As it happens, however, later sections of this paper need to arithmetize such strategies in order to prove the promised extensional completeness of CLA4. The complexity-theoretic concepts defined in the next section also require certain more specific details about HPMs, and in this section we provide such details. It should be pointed out again that most -if not all -of such details are "negotiable", as different reasonable arrangements would yield equivalent models. Just like an ordinary Turing machine, an HPM has a finite set of states, one of which has the special status of being the start state. There are no accept, reject, or halt states, but there are specially designated states called move states. It is assumed that the start state is not among the move states. As noted earlier, this is a two-tape machine, with a read-write work tape and read-only run tape. Each tape has a beginning but no end, and is divided into infinitely many cells, arranged in the left-to-right order: cell #0, cell #1, cell #2, etc. At any time, each cell will contain one symbol from a certain fixed finite set of tape symbols. The blank symbol, as well as ⊤ and ⊥, are among the tape symbols. We also assume that these three symbols are not among the symbols that any (legal or illegal) move can ever contain. Either tape has its own scanning head, at any given time looking (located) at one of the cells of the tape. A transition from one computation step ("clock cycle") to another happens according to the fixed transition function of the machine. The latter, depending on the current state, and the symbols seen by the two heads on the corresponding tapes, deterministically prescribes the next state, the tape symbol by which the old symbol should be overwritten in the current cell (the cell currently scanned by the head) of the work tape, and, for each head, the direction -one cell left or one cell right -in which the head should move. A constraint here is that the blank symbol, ⊤ or ⊥ can never be written by the machine on the work tape. An attempt to move left when the head of a given tape is looking at the leftmost cell results in staying put. So does an attempt to move right when the head is looking at the blank symbol. When the machine starts working, it is in its start state, both scanning heads are looking at the leftmost cells of the corresponding tapes, and (all cells of) both tapes are blank (i.e., contain the blank symbol). Whenever the machine enters a move state, the string α spelled by (the contents of) its work tape cells, starting from cell #0 and ending with the cell immediately left to the work-tape scanning head, will be automatically appended -at the beginning of the next clock cycle -to the contents of the run tape in the ⊤-prefixed form ⊤α. And, on every transition, whether the machine is in a move state or not, any finite sequence ⊥β 1 , . . . , ⊥β m of ⊥-labeled moves may be nondeterministically appended to the contents of the run tape. If the above two events happen on the same clock cycle, then the moves will be appended to the contents of the run tape in the following order: ⊤α⊥β 1 . . . ⊥β m (note the technicality that labmoves are listed on the run tape without blanks or commas between them). With each labmove that emerges on the run tape, we associate its timestamp, which is the number of the clock cycle immediately preceding the cycle on which the move first emerged on the run tape. Intuitively, the timestamp indicates on which cycle the move was made rather than appeared on the run tape: a move made during cycle #i appears on the run tape on cycle #i + 1 rather than #i. Also, we agree that the count of clock cycles, just like the count of cells, starts from 0, meaning that the very first clock cycle is cycle #0 rather than #1. A configuration of a given HPM M is a full description of the contents of the two tapes, the locations of the two scanning heads, and the state of the machine at the beginning of some ("current") clock cycle. A computation branch of M is an infinite sequence C 0 , C 1 , C 2 , . . . of configurations of M, where C 0 is the initial configuration (as explained earlier), and every C i + 1 is a configuration that could have legally followed (again, in the sense explained earlier) C i . For a computation branch B, the run spelled by B is the run Γ incrementally spelled on the run tape in the corresponding scenario of interaction. We say that such a Γ is a run generated by the machine. We say that a given HPM M wins (computes, solves) a given constant game A -and write M |= A -iff every run Γ generated by M is a ⊤-won run of A. We say that A is computable iff there is an HPM M such that M |= A; such an HPM is said to be an (algorithmic) solution, or winning strategy, for A. The size of a move α means the length of α as a string. In the context of a given computation branch of a given HPM M, by the background of a clock cycle c we mean the greatest of the sizes of Environment's moves made by (before) time c, or 0 if there are no such moves. If M makes a move on cycle c, then the background of that move4 means the background of c. Next, whenever M makes a move on cycle c, by the timecost of that move we mean c -d, where d is the greatest cycle with d < c on which a move was made by either player, or is 0 if there is no such cycle. Throughout this paper, an n-ary arithmetical function means a function from n-tuples of natural numbers to natural numbers. As always, "unary" means "1-ary". Definition 7.1 Let h be a unary arithmetical function, and M an HPM. 1. We say that M runs in time h, or that M is an h time machine, or that h is a bound for the time complexity of M, iff, in every play (computation branch), for any clock cycle c on which M makes a move, neither the timecost nor the size of that move exceeds h(ℓ), where ℓ is the background of c. 2. We say that M runs in space h, or that M is an h space machine, or that h is a bound for the space complexity of M, iff, in every play (computation branch), for any clock cycle c, the number of cells ever visited by the work-tape head of M by time c does not exceed h(ℓ), where ℓ is the background of c. Our time complexity concept can be seen to be in the spirit of what is usually called response time. The latter generally does not and should not depend on the length of the preceding interaction history. On the other hand, it is not and should not be merely a function of the adversary's last move, either. A similar characterization applies to our concept of space complexity. Both complexity measures are equally meaningful whether it be in the context of "short-lasting" games (such as the ones represented by the formulas of the later-defined logic CL12) or the context of games that may have "very long" and even infinitely long legal runs. Let A be a constant game, h a unary arithmetical function, and M an HPM. We say that M wins (computes, solves) A in time h, or that M is an h time solution for A, iff M is an h time machine with M |= A. We say that A is computable (winnable, solvable) in time h iff it has an h time solution. Similarly for "space" instead of "time". When we say polynomial time, it is to be understood as "time h for some polynomial function h". Similarly for polynomial space. Many concepts introduced within the framework of CoL are generalizations -for the interactive context -of ordinary and well-studied concepts of the traditional theory of computation. The above-defined time and space complexities are among such concepts. Let us focus on polynomial time for the rest of this section, and look at the traditional notion of polynomial time computability of a function f (x) for instance. With a moment's thought, it can be seen to be equivalent to polynomial time computability (in our sense) of the problem ⊓x⊔y y = f (x) . Similarly, polynomial time decidability of a predicate p(x) means the same as polynomial time computability of the problem ⊓x ¬p(x) ⊔ p(x) . Further, what is traditionally called (mapping) polynomial time reducibility of a predicate p(x) to a predicate q(x) can be seen to mean nothing but polynomial time computability of the problem ⊓x⊔y p(x) ↔ q(y) , where E ↔ F is an abbreviation of (E → F ) ∧ (F → E). If we want to say that a particular function f (x) is a polynomial time reduction of p(x) to q(x), then we can write ⊓x⊔y y = f (x) ∧ ∀x p x ↔ q f (x) . And so on. Our formalism can be used for systematically defining and studying an infinite variety of meaningful complexity-theoretic properties, relations and operations, only some of which (as the above ones) may have established names in the literature. Consider, for instance, the problem It expresses (its polynomial time computability means, that is) a sort of polynomial time reducibility of p(x) to q(x). This reducibility can be seen to be strictly weaker than the traditional sort of polynomial time reducibility captured by the earlier mentioned ⊓x⊔y y = f (x) . For instance, every predicate p(x) is reducible to its complement ¬p(x) in the sense of (4). Namely, a polynomial time strategy for ⊓x p(x) ⊔ ¬p(x) → ⊓x ¬p(x) ⊔ p(x) goes as follows. Wait till a value n for x is specified in the consequent. Then specify the same value for x in the antecedent. Further wait till a ⊔ -disjunct is selected in the antecedent. If the first (resp. second) disjunct is selected there, select the second (resp. first) ⊔ -disjunct in the consequent, and celebrate victory. On the other hand, we cannot say that every predicate p(x) is also polynomial time reducible -in the sense of ⊓x⊔y y = f (x) -to its complement. Take p(x) to be any coNP-complete predicate. If it was polynomial time reducible to its complement, then we would have NP=coNP. 8 The language of logic CL12 and its semantics Logic CL12 will be axiomatically constructed in Section 9. The present section is merely devoted to its language. The building blocks of the formulas of the latter are: • Nonlogical predicate letters, for which we use p, q as metavariables. With each predicate letter is associated a fixed nonnegative integer called its arity. We assume that, for any n, there are infinitely many n-ary predicate letters. • Function letters, for which we use f, g as metavariables. Again, each function letter comes with a fixed arity, and we assume that, for any n, there are infinitely many n-ary function letters. • The binary logical predicate letter = . • Infinitely many variables and constants. These are the same as the ones fixed in Section 4. Terms, for which we use τ, ψ, ξ, χ, θ, η as metavariables, are built from variables, constants and function letters in the standard way. An atomic formula is p(τ 1 , . . . , τ n ), where p is an n-ary predicate letter and the τ i are terms. When p is 0-ary, we write p instead of p(). Also, we write τ 1 = τ 2 instead of = (τ 1 , τ 2 ), and τ 1 = τ 2 instead of ¬(τ 1 = τ 2 ). Formulas are built from atomic formulas, propositional connectives ⊤, ⊥ (0-ary), ¬ (1-ary), ∧ , ∨ , ⊓ , ⊔ (2-ary), variables and quantifiers ∀, ∃, ⊓, ⊔ in the standard way, with the exception that, officially, ¬ is only allowed to be applied to atomic formulas. The definitions of free and bound occurrences of variables are also standard (with ⊓, ⊔ acting as quantifiers along with ∀, ∃). A formula with no free occurrences of variables is said to be closed. Note that, terminologically, ⊤ and ⊥ do not count as atoms. For us, atoms are formulas containing no logical operators. The formulas ⊤ and ⊥ do not qualify because they are (0-ary) logical operators themselves. ¬E, where E is not atomic, will be understood as a standard abbreviation: And E → F will be understood as an abbreviation of ¬E ∨ F . Parentheses will often be omitted -as we just did -if there is no danger of ambiguity. When omitting parentheses, we assume that ¬ and the quantifiers have the highest precedence, and → has the lowest precedence. An expression E 1 ∧ . . . ∧ E n , where n ≥ 2, is to be understood as Sometimes we can write this expression for an unspecified n ≥ 0 (rather than n ≥ 2). Such a formula, in the case of n = 1, should be understood as simply E 1 . Similarly for ∨ , ⊓ , ⊔ . As for the case of n = 0, ∧ and ⊓ should be understood as ⊤ while ∨ and ⊔ as ⊥. Sometimes a formula F will be represented as F (s 1 , . . . , s n ), where the s i are variables. When doing so, we do not necessarily mean that each s i has a free occurrence in F , or that every variable occurring free in F is among s 1 , . . . , s n . However, it will always be assumed (usually only implicitly) that the s i are pairwise distinct, and have no bound occurrences in F . In the context set by the above representation, F (τ 1 , . . . , τ n ) will mean the result of replacing, in F , each occurrence of each s i by term τ i . When writing F (τ 1 , . . . , τ n ), it will always be assumed (again, usually only implicitly) that the terms τ 1 , . . . , τ n contain no variables that have bound occurrences in F , so that there are no unpleasant collisions of variables when doing replacements. Similar -well established in the literature -notational conventions apply to terms. A sequent is an expression E 1 , . . . , E n • -F , where E 1 , . . . , E n (n ≥ 0) and F are formulas. Here E 1 , . . . , E n is said to be the antecedent of the sequent, and F said to be the succedent. By a free (resp. bound) variable of a sequent we shall mean a variable that has a free (resp. bound) occurrence in one of the formulas of the sequent. For safety and simplicity, throughout the rest of this paper we assume that the sets of all free and bound variables of any formula or sequent that we ever considerunless strictly implied otherwise by the context -are disjoint. This restriction, of course, does not yield any loss of expressive power, as variables can always be renamed so as to satisfy this condition. An interpretation is a pair (U, * ), where U = (U, U ) is a universe and * is a function that sends: • every n-ary function letter f to a function f * : U n → U ; • every nonlogical n-ary predicate letter p to an n-ary predicate (elementary game) p * (s 1 , . . . , s n ) on U which does not depend on any variables other than s 1 , . . . , s n . The above uniquely extends to a mapping that sends each term τ to a function τ * , and each formula F to a game F * , by stipulating that: 2. s * = s (any variable s). Where f is an n-ary function letter and τ 1 , . . . , τ n are terms, Where τ 1 and τ 2 are terms, (τ 5. Where p is an n-ary nonlogical predicate letter and τ 1 , . . . , τ n are terms, p(τ 1 , . . . , τ n ) * = p * (τ * 1 , . . . , τ * n ). 6. * commutes with all logical operators, seeing them as the corresponding game operations: While an interpretation is a pair (U, * ), terminologically and notationally we will usually identify it with its second component and write * instead of (U, * ), keeping in mind that every such "interpretation" * comes with a fixed universe U , said to be the universe of * . When O is a function letter, a predicate letter, a constant or a formula, and O * = W , we say that * interprets O as W . We can also refer to such a W as "O under interpretation * ". When a given formula is represented as F (x 1 , . . . , x n ), we will typically write F * (x 1 , . . . , x n ) instead of F (x 1 , . . . , x n ) * . A similar practice will be used for terms as well. We agree that, for a formula F , an interpretation * and an HPM M, whenever we say that M is a solution of F * or write M |= F * , we mean that M is a solution of the (constant) game ⊓x 1 . . . ⊓x n (F * ), where x 1 , . . . , x n are exactly the free variables of F , listed according to their lexicographic order. We call the above game the ⊓-closure of F * , and denote it by ⊓F * . The ∀-closure ∀F * is defined similarly. The same notational convention extends from games to formulas. Note that, for any given formula F , the Lr component of the game ⊓F * does not depend on the interpretation * . Hence we can safely say "legal run of ⊓F " without indicating an interpretation applied to the formula. Our formulations rely on some terminology and notation, explained below. A formula not containing any choice operators ⊓ , ⊔ , ⊓, ⊔ -i.e., a formula of the language of classical first order logic -is said to be elementary. A sequent is elementary iff all of its formulas are so. The elementarization F of a formula F is the result of replacing in F all ⊔ -and ⊔-subformulas by ⊥, and all ⊓ -and ⊓-subformulas A sequent is said to be stable iff its elementarization is classically valid. By "classical validity", in view of Gödel's completeness theorem, we mean provability in some standard classical first-order calculus with constants, function letters and = , where = is treated as the logical identity predicate (so that, say, x = x, x = y → (E(x) → E(y)), etc. are provable). A surface occurrence of a subformula is an occurrence that is not in the scope of any choice operators. We will be using the notation to mean a formula F together with some (single) fixed surface occurrence of a subformula E. Using this notation sets a context, in which F [H] will mean the result of replacing in F [E] the (fixed) occurrence of E by H. Note that here we are talking about some occurrence of E. Only that occurrence gets replaced when moving from F [E] to F [H], even if the formula also had some other occurrences of E. By a rule (of inference) in this section we mean a binary relation YRX, where Y = Y 1 , . . . , Y n is a finite sequence of sequents and X is a sequent. Instances of such a relation are schematically written as where Y 1 , . . . , Y n are called the premises, and X is called the conclusion. Whenever YRX holds, we say that X follows from Y by R. Expressions such as G, K, . . . will usually stand for finite sequences of formulas. The standard meaning of an expression such as G, F, K should also be clear. CL12 has the six rules listed below, with the following additional conditions/explanations: 1. In ⊔ -Choose and ⊓ -Choose, i ∈ {0, 1}. 2. In ⊔-Choose and ⊓-Choose, t is either a constant or a variable with no bound occurrences in the premise, and H(t) is the result of replacing by t all free occurrences of x in H(x) (rather than vice versa). , where all of the following five conditions are satisfied: X Here and below, H(y) is the result of replacing by y all free occurrences of x in H(x) (rather than vice versa). 5. Stability Condition: X is stable. A CL12-proof of a sequent X is a sequence X 1 , . . . , X n of sequents, with X n = X, such that, each X i follows by one of the rules of CL12 from some (possibly empty in the case of Wait, and certainly empty in the case of i = 1) set P of premises such that P ⊆ {X 1 , . . . , X i-1 }. When a CL12-proof of X exists, we say that X is provable in CL12, and write CL12 ⊢ X. A CL12-proof of a formula F will be understood as a CL12-proof of the empty-antecedent sequent CL12 is a conservative extension of classical logic (see [27]). Namely, an elementary sequent It is also a conservative extension of the earlier known logic CL3 studied in [18]. 5 The latter is nothing but the empty-antecedent fragment of CL12 without function letters and identity. Example 9.1 In this example, × is a binary function letter and 3 is a unary function letter. We write x × y and x 3 instead of × (x, y) and 3 (x), respectively. The following sequence of sequents is a CL12-proof (of its last sequent): The latter, in turn, follows by Wait from the empty set of premises. On the other hand, the formula ⊓xp(x) → ∀xp(x), i.e. ⊔x¬p(x) ∨ ∀xp(x), in not provable. Indeed, its elementarization is ⊥ ∨ ∀xp(x), which is not classically valid. Hence ⊔x¬p(x) ∨ ∀xp(x) cannot be derived by Wait. Replicate can also be dismissed for obvious reasons. This leaves us with ⊔-Choose. But if ⊔x¬p(x) ∨ ∀xp(x) is derived by ⊔-Choose, then the premise should be ¬p(t) ∨ ∀xp(x) for some variable or constant t. The latter, however, is a classically non-valid elementary formula and hence unprovable. On the other hand, the formula ⊔y⊓x p(x) → p(y) can be seen to be unprovable, even though its classical counterpart ∃y∀x p(x) → p(y) is a classically valid elementary formula and hence provable in CL12. Example 9.4 While the formula ∀x∃y y = f (x) is classically valid and hence provable in CL12, its constructive counterpart ⊓x⊔y y = f (x) can be easily seen to be unprovable. This is no surprise. In view of the expected soundness of CL12, provability of ⊓x⊔y y = f (x) would imply that every function f is computable, which, of course, is not the case. Exercise 9.5 To see the resource-consciousness of CL12, show that it does not prove p ⊓ q → (p ⊓ q) ∧ (p ⊓ q), even though this formula has the form F → F ∧ F of a classical tautology. Then show that, in contrast, CL12 proves the sequent p ⊓ q • -(p ⊓ q) ∧ (p ⊓ q) because, unlike the antecedent of a → -combination, the antecedent of a • --combination is reusable (trough Replicate). Exercise 9.6 Show that CL12 ⊢ ⊔x⊓y p(x, y) • -⊔x ⊓y p(x, y) ∧ ⊓y p(x, y) . Then observe that, on the other hand, CL12 does not prove any of the formulas ⊔x⊓y p(x, y) → ⊔x ⊓y p(x, y) ∧ ⊓y p(x, y) ; ⊔x⊓y p(x, y) ∧ ⊔x⊓y p(x, y) → ⊔x ⊓y p(x, y) ∧ ⊓y p(x, y) ; ⊔x⊓y p(x, y) ∧ ⊔x⊓y p(x, y) ∧ ⊔x⊓y p(x, y) → ⊔x ⊓y p(x, y) ∧ ⊓y p(x, y) ; . . . Logical Consequence (LC) is the following rule, with both the premises and the conclusion being formulas: From E 1 , . . . , E n conclude F , as long as CL12 proves E 1 , . . . , E n • -F . When F follows from E 1 , . . . , E n by this rule, i.e., when CL12 ⊢ E 1 , . . . , E n • -F , we say that F is a logical consequence of E 1 , . . . , E n . The official terms of the language of CL12, identified with their parse trees, are tree-style structures, so let us call them tree-terms. A more general and economical way to represent terms, however, is to allow merging some or all identical-content nodes in such trees, thus turning them into (directed, acyclic, rooted, edge-ordered multi-) graphs. Let us call these unofficial sorts of terms graph-terms. The idea of representing linguistic objects in the form of graphs rather than trees is central in the approach called cirquent calculus ( [16,23]), and has already proven its worth. We once again find the usefulness of that idea in our present, complexity-sensitive context. Figure 1 illustrates two terms representing the same polynomial function y 8 , with the term on the right being a tree-term and the term on the left being a graph-term. As this example suggests, graph-terms are generally exponentially smaller than the corresponding tree-terms, which explains our interest in the former. Figure 1 also makes it unnecessary to formally define graph-terms, as their meaning must be perfectly clear after looking at this single example. A graph-term and the corresponding tree-term By a polynomial graph-term τ we shall mean a graph-term not containing (at its leaves) any constants other than 0, and not containing (at its internal nodes) any function letters other than ′ (unary), + (binary) and × (binary). The total number k of the variables y 1 , . . . , y k occurring in (at the leaves of) τ is said to be the arity of τ . Subsequently we shall only be interested in unary (1-ary) polynomial graph-terms, and will typically omit the word "unary". Terminologically and notationally we shall usually identify such a term τ with the unary polynomial arithmetical function represented by it under the standard arithmetical interpretation (x ′ means x + 1). So, for instance, either term of Figure 1 is a polynomial graph-term, representing -and identified with -the function y 8 . We generalize the above concept of a (unary) polynomial graph-term τ to that of a (1, n)-ary explicit polynomial functional by allowing the term τ to contain, on top of variables and 0, ′ , + , × , additional n (n ≥ 0) unary function letters f 1 , . . . , f n , semantically treated as placeholders for unary arithmetical functions. We say that such a τ depends on f 1 , . . . , f n . Replacing f 1 , . . . , f n by names g 1 , . . . , g n of some particular unary arithmetical functions turns τ into the corresponding unary arithmetical function, which we shall denote by τ (g 1 , . . . , g n ). For instance, the term of Figure 2 is a (1, 2)-ary explicit polynomial functional. Let us denote it by τ . Then, if g means "square" and h means "cube", τ (g, h) is the unary arithmetical function (y We further generalize the concept of a (unary) polynomial graph-term τ to that of a (unary) explicit polynomial function. The latter is defined as a nonempty sequence τ f1 , . . . , τ f k of explicit polynomial functionals indexed by (associated with) pairwise distinct unary function letters f 1 , . . . , f k , where each τ fi does not depend on any function letters that are not among f 1 , . . . , f i-1 . Note that this condition makes τ f1 simply a polynomial graph-term, i.e., a (1, 0)-ary explicit polynomial functional. (Meta)semantically, each index f i here is a name of (represents) a unary arithmetical function, and the corresponding τ fi is a definition of that function in terms of 0, ′ , + , × and some earlier-defined functions; then τ itself is stipulated to represent the same function as f k does. Again, a single example would be sufficient to fully clarify the denotation of each explicit polynomial function. Consider the explicit polynomial function τ = τ f1 , τ f1 , τ f3 , where τ f1 and τ f2 are the (1, 0)-ary explicit polynomial functionals of Figure 1, and τ f3 is the (1, 2)-ary explicit polynomial functional of Figure 2. Thus, both f 1 and f 2 represent the same unary polynomial function y 8 , and f 3 , i.e. τ itself, represents the unary polynomial function (y 8 + y 8 ) 8 . Of course, every explicit polynomial function can be translated into an equivalent polynomial graph-term, but such a translation can increase the size exponentially. For our purposes, polynomial graph-terms (let alone tree-terms) are too inefficient means of representing polynomial functions. This explains our preference for explicit polynomial functions as a standard way of writing (in our metalanguage) polynomial terms. As in the case of polynomial graph-terms, terminologically and notationally we shall usually identify an explicit polynomial function τ with the unary arithmetical function represented by it. When τ is an explicit polynomial function and M is a τ time (resp. space) machine, we say that τ is an explicit polynomial bound for the time (resp. space) complexity of M. Another auxiliary concept that we are going to rely on in this section and later is that of a generalized HPM (GHPM). For a natural number n, an n-ary GHPM is defined in the same way as an HPM, with the difference that the former takes n natural numbers as inputs (say, provided on a separate, read-only input tape); such inputs are present at the very beginning of the work of the machine and remain unchanged throughout it. An ordinary HPM is thus nothing but a 0-ary GHPM. When M is an n-ary GHPM and c 1 , . . . , c n are natural numbers, M(c 1 , . . . , c n ) denotes the HPM that works just like M in the scenario where the latter has received c 1 , . . . , c n as inputs. We will assume that some reasonable encoding (through natural numbers) of GHPMs is fixed. When M is a GHPM, M denotes its code. The paper [29] established the soundness of CL12 in the following strong sense: 1. There is an efficient6 procedure that takes an arbitrary CL12-proof of an arbitrary sequent E 1 , . . . , E n • -F and constructs a n-ary GHPM M, together with a (1, n)-ary explicit polynomial functional τ , such that, for any interpretation * , any n-ary GHPMs N 1 , . . . , N n and any unary arithmetical functions 2. The same holds for "space" instead of "time". Among the corollaries of the above theorem is that LC preserves both polynomial time and polynomial space computabilities, as well as Ω-time and Ω-space computabilities for any class Ω of functions containing all polynomial functions and closed under composition (such as, say, the class of all primitive recursive functions). Indeed, to see that LC preserves (for instance) polynomial time computability, assume F is a logical consequence of E 1 , . . . , E n , and the HPMs N 1 , . . . , N n are polynomial time solutions of E 1 , . . . , E n . Of course, every such HPM N i can as well be seen as an n-ary GHPM which simply ignores its inputs. So, each N i ( N 1 , . . . , N n ) solves E i . Then, according to Theorem 10.1, we can construct a polynomial time solution M( N 1 , . . . , N n ) of F . Furthermore, such a solution, together with an explicit polynomial bound for its time complexity, can be efficiently extracted from N 1 , . . . , N n , explicit polynomial bounds for their time complexities, and the CL12-proof of E 1 , . . . , E n • -F . Remember that, philosophically speaking, computational resources are symmetric to computational problems: what is a problem for one player to solve is a resource that the other player can use. Namely, having a problem A as a computational resource intuitively means having the ability to successfully solve/win A. For instance, as a resource, ⊓x⊔y(y = x 2 ) means the ability to tell the square of any number. Together with soundness, [29] also established the completeness of CL12. While in the present paper we treat •merely as a syntactic expression separating the two parts of a sequent, in [29] it is seen as an operation on games, called ultimate reduction. For simplicity considerations, we do not want to reproduce the definition of •here, which would be necessary to precisely state the completeness result for CL12. We shall only point out that, intuitively, A 1 , . . . , A n • -B is (indeed) the problem of reducing B to A 1 , . . . , A n in the most general intuitive sense. It is similar to A 1 ∧ . . . ∧ A n → B, but with the difference that, during playing this game, in the former ⊤ can use any of the antecedental resources A i repeatedly, while in the latter at most once. The A i s, as resources, are "recyclable", that is. Furthermore, they are "recyclable" in the strongest sense possible. Namely, it is not necessary to restart A i from the beginning every time it is reused. ⊤ may as well choose to continue A i -in a new way -from any of the previously reached positions. This corresponds to the way of reusage any purely software resource would offer in the presence of an advanced operating system and unlimited memory: one can start running process A i , then fork it at any stage thus creating two copies (branches) with a common past but possibly diverging futures, then fork any of the new branches again at any time, and so on. See [26] or [29] for more details and explanations. Anyway, the completeness result of [29] for CL12 says that, if there is an HPM that solves the problem E * 1 , . . . , E * n • -F * for any interpretation * -such an * -independent HPM is said to be a logical solution of the sequent E 1 , . . . , E n • -F -then CL12 ⊢ E 1 , . . . , E n • -F . Furthermore, the same has been shown to hold even if HPMs are no longer required to follow algorithmic (let alone efficient) strategies -for instance, if they are allowed to use oracles for whatever functions. This result, in view of the intuitions captured by the operation • -, eventually translates in [29] into the following thesis relevant to our further purposes: Thesis 10.2 ( [29]) Assume E 1 , . . . , E n , F are formulas such that there is a * -independent (whatever interpretation * ) intuitive description and justification of a winning strategy for F * , which relies on the availability and "recyclability" -in the strongest sense possible -of E * 1 , . . . , E * n as computational resources. Then F is a logical consequence of E 1 , . . . , E n . The above means that the rule of Logical Consequence lives up to its name, and that we can always reliably use intuition on games and strategies when reasoning about them in CL12-based systems (where LC is a rule of inference) such as CLA4. Namely, once a formula E is proven in such a system, it can be treated as a recyclable resource whose unlimited availability can be safely assumed for any new strategies that we construct. More precisely, a new strategy may assume that there is an (external) provider of the resource E (call it an oracle for E if you prefer), capable of successfully playing E for (against) us any time and in any number of sessions, whether we choose those sessions to evolve in a parallel or a branched/forked fashion. Example 10.3 Imagine a CL12-based applied formal theory, in which we have already proven two facts: ∀x x 3 = (x × x) × x (the meaning of "cube" in terms of multiplication) and ⊓x⊓y⊔z(z = x × y) (the computability of multiplication), and now we want to derive ⊓x⊔y(y = x 3 ) (the computability of "cube"). This is how we can reason to justify ⊓x⊔y(y = x 3 ): Consider any s (selected by Environment for x in ⊓x⊔y(y = x 3 )). We need to find s 3 . Using the resource ⊓x⊓y⊔z(z = x × y) twice, we first find the value t of s × s, and then the value r of t × s. According to ∀x(x 3 = (x × x) × x), such an r is the sought s 3 . Thesis 10.2 promises that the above intuitive argument will be translatable into a CL12-proof of ∀x x 3 = (x × x) × x , ⊓x⊓y⊔z(z = x × y) • -⊓x⊔y(y = x 3 ) (and hence the succedent will be derivable in the theory by LC as the formulas of the antecedent are already proven). Such a proof indeed exists -see Example 9.1. CL12 -more precisely, the associated rule of LC -is adequate because, on one hand, by Theorem 10.1, it is sound for a wide spectrum of applied theories, including -but not limited to -polynomialtime-oriented ones, and, on the other hand, by Thesis 10.2, it is as strong as a logical rule of inference could possibly be. The language of CLA4, whose formulas more specifically can be referred to as CLA4-formulas, is obtained from the language of CL12 by removing all nonlogical predicate letters (thus only leaving the logical predicate letter = ), removing all constants but 0, and removing all but three function letters, which are: • successor, unary. We will write τ ′ for successor(τ ). • sum, binary. We will write τ 1 + τ 2 for sum(τ 1 , τ 2 ). • product, binary. We will write τ 1 × τ 2 for product(τ 1 , τ 2 ). Thus, the language of CLA4 extends that of Peano arithmetic PA (see, for example, [11]) through adding to it ⊓ , ⊔ , ⊔, ⊓. Formulas that have no free occurrences of variables are said to be sentences. The concept of an interpretation explained earlier can now be restricted to interpretations that are only defined on ′ , + and × , as the present language has no other nonlogical function or predicate letters. Of such interpretations, the standard interpretation † is the one whose universe is the ideal universe {0, 1, 10, 11, 100, . . .}, with its elements identified with the corresponding natural numbers, and which interprets ′ as the standard successor (x + 1) function, interprets + as the sum function, and interprets × as the product function. For a CLA4-formula F , the standard interpretation of F is the game F † , which we typically write simply as F unless doing so may cause ambiguity. Where τ is a term, we will be using τ 0 and τ 1 as abbreviations for the terms 0 ′ ′ × τ and (0 ′ ′ × τ ) ′ , respectively. The choice of this notation is related to the fact that, given any natural number a, the binary representation of 0 ′ ′ × a (i.e., of 2a) is nothing but the binary representation of a with a "0" added on its right. Similarly, the binary representation of (0 ′ ′ × a) ′ is nothing but the binary representation of a with a "1" added to it. Of course, here an exception is the case a = 0. It can be made an ordinary case by assuming that adding any number of 0s at the beginning of a binary numeral b results in a legitimate numeral representing the same number as b does. The number a0 (i.e. 2a) will be said to be the binary 0-successor of a, and a1 (i.e. 2a + 1) said to be the binary 1-successor of a; in turn, we can refer to a as the binary predecessor of a0 and a1. As for a ′ , we can refer to it as the unary successor of a, and refer to a as the unary predecessor of a ′ . Every number has a binary predecessor, and every number except 0 has a unary predecessor. Note that the binary predecessor of a number is the result of deleting the last digit (if present) in its binary representation. Remember that the string 0 for us is just another name of the empty string ǫ representing the number zero. So, 0 and 1 are no exceptions to the above rule: deleting the last (and only) digit of 1 results in ǫ; and "deleting the last digit" in 0, i.e. in ǫ, again results in ǫ, as there is no digit to delete. The language of PA is known to be very expressive, despite its nonlogical vocabulary officially being limited to only 0, ′ , + , × . Specifically, it allows us to express, in a certain standard way, all recursive functions and relations, and beyond. Relying on the common knowledge of the power of the language of PA, we will be using standard expressions such as x ≤ y, y > x, etc. in formulas as abbreviations of the corresponding proper expressions of the language. In our metalanguage, |x| will refer to the length of the binary numeral for the number represented by x. In other words, |x| = ⌈log 2 (x + 1)⌉ (⌈y⌉ means the smallest integer z with y ≤ z). Expressions like |x| we refer to as pseudoterms -officially they are not terms of the object language, but in many contexts still can be treated as such. Another example of a pseudoterm is 2 x with its standard meaning. So, when we write, say, "|x| ≤ y", it is officially to be understood as an abbreviation of a standard formula of PA saying that |x| does not exceed y. For a variable x, by a polynomial sizebound for x we shall mean a standard formula of the language of PA saying that |x| ≤ τ (|y 1 |, . . . , |y n |), where y 1 , . . . , y n are any variables different from x, and τ (|y 1 |, . . . , |y n |) is any (0, ′ , + , × )-combination of |y 1 |, . . . , |y n |. For instance, |x| ≤ |y| + |z| is a polynomial sizebound for x, which is a formula of PA saying that the size of x does not exceed the sum of the sizes of y and z. Now, we say that a CLA4-formula F is polynomially bounded iff: • Whenever ⊓xG(x) is a subformula of F , G(x) has the form S(x) → H(x), where S(x) is a polynomial sizebound for x. • Whenever ⊔xG(x) is a subformula of F , G(x) has the form S(x) ∧ H(x), where S(x) is a polynomial sizebound for x. Remember that, where F is a formula, ∀F means the ∀-closure of F , i.e., ∀x 1 . . . ∀x n F , where x 1 , . . . , x n are the free variables of F . Similarly for ∃F , ⊓F , ⊔F . The axioms of CLA4 are: Axiom 8: ⊓x⊔y(y = x ′ ) Axiom 9: ⊓x⊔y(y = x0) All of the above are thus nonlogical axioms (CLA4 has no logical axioms). Note that the overall number of axioms is infinite rather than nine, because Axiom 7 is not a particular sentence but a scheme of sentences. Axioms 1-7 are nothing but Peano axioms -the nonlogical axioms of PA. CLA4 thus only has two extra-Peano axioms: Axiom 8 and Axiom 9. In view of the forthcoming soundness theorem for CLA4, Axiom 8 says that the unary successor function is polynomial time computable, and Axiom 9 says the same about the binary 0-successor function. As for the rules of inference, CLA4 has a single logical rule, which is our old friend Logical Consequence, and a single nonlogical rule, which we call CLA4-Induction. The latter is , where F (x) is any polynomially bounded formula. Here we shall say that ⊓ F (0) is the basis of induction, ⊓ F (x) → F (x0) is the left inductive step, and ⊓ F (x) → F (x1) is the right inductive step. The variable x has a special status here, and we say that the conclusion follows from the premises by CLA4-Induction on x. A reader familiar with Buss's [6] bounded arithmetic will notice a resemblance between the PIND axiom scheme of the latter and our CLA4-Induction rule, even though the two beasts operate in very different environments, of course. A sentence F is considered provable in CLA4 iff there is a sequence of sentences, called a CLA4-proof of F , where each sentence is either an axiom, or follows from some previous sentences by one of the two rules of inference, and where the last sentence is F . An extended CLA4-proof is defined in the same way, only, with the additional requirement that each application of LC should come together with an attached CL12-proof of the corresponding sequent. With some fixed, effective, sound and complete axiomatization L of classical first order logic in mind, a superextended CLA4-proof is an extended CLA4-proof with the additional requirement that every application of Wait in the justification of a CL12-derivation in it comes with an L-proof of the elementarization of the conclusion. Note that the property of being a superextended proof is (efficiently) decidable, while the properties of being an extended proof or just a proof are only recursively enumerable. We write CLA4 ⊢ F to say that F is provable (has a proof) in CLA4, and CLA4 ⊢ F to say the opposite. Generally, as in the above definition of provability and proofs, in CLA4 we will only be interested in proving sentences. 7 So, for technical convenience, we agree that, from now on, whenever we write CLA4 ⊢ F (or say "F is provable") for a non-sentence F , it simply means that CLA4 ⊢ ⊓F . Similarly, when we say that a given strategy solves F , it is to be understood as that the strategy solves ⊓F . Similarly, when we say that F is a logical consequence of E 1 , . . . , E n , what we typically mean is that ⊓F is a logical consequence of ⊓E 1 , . . . , ⊓E n . To summarize, in the context of CLA4, any formula with free variables should be understood as its ⊓-closure. An exception is when F (x 1 , . . . , x n ) is an elementary formula and we say that F (c 1 , . . . , c n ) is true (whatever constants c 1 , . . . , c n ). This is to be understood as that the ∀-closure ∀F (c 1 , . . . , c n ) of F (c 1 , . . . , c n ) is true (in the standard model), for "truth" is only meaningful for elementary formulas (which ⊓F generally would not be). An important fact on which we will often rely yet only implicitly so, is that the sentence ∀F → ⊓F or the closed sequent ∀F • -⊓F is (always) CL12-provable. In view of the soundness of CL12, this means that whenever (F is elementary and) ∀F is true, ⊓F is automatically won by a strategy that does nothing. 1. t = r ′ , r = s0 •t = (s0) ′ Wait: 2. t = r ′ , r = s0 • -⊔y y = (s0) ′ ⊔-Choose: 1 3. ⊔y(y = r ′ ), r = s0 • -⊔y y = (s0) ′ Wait: 2 4. ⊓x⊔y(y = x ′ ), r = s0 • -⊔y y = (s0) ′ ⊓-Choose: 3 5. ⊓x⊔y(y = x ′ ), ⊔y(y = s0) • -⊔y y = (s0) ′ Wait: 4 6. ⊓x⊔y(y = x ′ ), ⊓x⊔y(y = x0) • -⊔y y = (s0) ′ ⊓-Choose: 5 7. ⊓x⊔y(y = x ′ ), ⊓x⊔y(y = x0) • -⊓x⊔y y = (x0) ′ Wait: As we just saw, (additionally) justifying an application of LC takes more space than the (non-extended) proof itself. And this would be a typical case for CLA4-proofs. Luckily, however, there is no real need to formally justify LC. Firstly, this is so because CL12 is an analytic system, and proof-search in it is a routine (even if sometimes long) syntactic exercise. Secondly, in view of Thesis 10.2, there is no need to generate formal CL12-proofs anyway: instead, we can use intuition on games and strategies. In the present case, the whole (III+7)-step extended formal proof can be replaced by a short intuitive argument in the following style: Consider any s chosen by Environment for x. We need to compute (s0) ′ . Using Axiom 9, we find the value r of s0. Then, using Axiom 8, we find the value t of r ′ . Such a t is what we are looking for. Furthermore, as we agreed to understand a proof of a non-sentence F as a proof of its ⊓-closure ⊓F , the above argument can be shortened by considering simply ⊔y(y = x1) instead of ⊓x⊔y(y = x1). This would allow us to skip the phrase "Consider any s chosen by Environment for x" and the necessity to introduce the new name/variable s. Instead, we can simply say "Consider any x", implicitly letting x itself serve as a variable for the value chosen by Environment for x when playing the ⊓-closure of the game. Sometimes we can go even lazier and skip the phrase "Consider any x" altogether. In view of the following fact, an alternative way to present CLA4 would be to delete Axioms 1-7 and, instead, declare all (closed) theorems of PA to be axioms of CLA4 along with Axioms 8 and 9: Fact 11.2 Every (elementary CLA4-) sentence provable in PA is also provable in CLA4. Proof. Suppose (the classical-logic-based) PA proves F . By the deduction theorem for classical logic this means that, for some nonlogical axioms H 1 , . . . , H n of PA, the formula H 1 ∧ . . . ∧ H n → F is provable in classical first order logic. Hence H 1 ∧ . . . ∧ H n • -F is provable in CL12 by Wait from the empty set of premises. Hence F is a logical consequence of the Peano axioms H 1 , . . . , H n of CLA4 and, as such, is provable by LC. The above fact, on which we will be implicitly relying in the sequel, allows us to construct "lazy" CLA4proofs where some steps can be justified by simply indicating their provability in PA. That is, we will treat theorems of PA as if they were axioms of CLA4. As PA is well known and well studied, we safely assume that the reader has a good feel for what it can prove, so we do not usually further justify PA-provability claims that we make. A reader less familiar with PA, can take it as a rule of thumb that, despite Gödel's incompleteness theorems, PA proves every true number-theoretic fact that a contemporary high school student can establish, or that mankind was or could be aware of before 1931. The following sequence is a lazy proof of ⊓x(x = 0 ⊔ x = 0) -the formula saying that the "zeroness" predicate is decidable: An extended version of the above proof will include the following three additional justifications (CL12proofs): A justification for Step I: A justification for Step VI: But, again, in the sequel we will not generate formal (even if lazy) proofs in the above style but, instead, limit ourselves to informal arguments within CLA4. Below we illustrate such an argument for the present case. Further, as explained in the previous example, we prefer to deal with x = 0 ⊔ x = 0 rather than ⊓x(x = 0 ⊔ x = 0), and do not explicitly say "consider any value x chosen for the variable x by Environment". We prove x = 0 ⊔ x = 0 by CL12-Induction on x. The Basis 0 = 0 ⊔ 0 = 0 of induction is straightforward: it is solved by choosing the left ⊔ -disjunct. Solving the left inductive step x = 0 ⊔ x = 0 → x0 = 0 ⊔ x0 = 0 means solving the consequent using a single copy of the antecedent as a resource. From PA, we know that x0 = 0 iff x = 0. And whether x = 0 or not we can find out using the resource x = 0 ⊔ x = 0. So, we can tell whether x0 = 0 or ( ⊔ ) x0 = 0, as desired. The right inductive step x = 0 ⊔ x = 0 → x1 = 0 ⊔ x1 = 0 is solved by simply choosing the right ⊔ -disjunct in the consequent which, by PA, is true. In the future, our reliance on PA may not always be explicit as it was in the above informal argument. Further, as we advance, our reliance on some basic nonelementary facts such as the just-proven ⊓x(x = 0 ⊔ x = 0) may increasingly become only implicit. Why did not we use the following, much simpler intuitive argument instead of the above one? To solve x = 0 ⊔ x = 0, see if x (the constant chosen by Environment for x) is 0 or not. If yes, choose the left ⊔ -disjunct; otherwise choose the right ⊔ -disjunct. The above argument is not valid, in the sense that it is not "purely logical", and hence Thesis 10.2 does not guarantee that it will be translatable into a formal proof. Namely, in being confident that the above strategy wins the game, we rely on the extra-logical knowledge of the fact that different constants are names of different objects. This is indeed so for the standard model of arithmetic. But in some other models it is quite possible that, say, both constants 0 and 10 are names for the same object of the universe. Then, the above strategy prescribes to choose the false 10 = 0 in the corresponding scenario. Thus, ⊓x(x = 0 ⊔ x = 0), while provable in CLA4, is not logically valid, that is, is not provable in CL12. The same applies to the more general principle ⊓x⊓y(x = y ⊔ x = y), whose CLA4-provability is shown later in Section 12. When a formula F (x 1 , . . . , x n ) is a standard (in whatever informal sense) representation of an n-ary predicate p and CLA4 ⊢ ⊓ F (x 1 , . . . , x n ) ⊔ ¬F (x 1 , . . . , x n ) , we say that p is CLA4-provably decidable. Similarly, when F (y, x 1 , . . . , x n ) is a standard representation of the graph of an n-ary function f and CLA4 ⊢ ⊓⊔yF (y, x 1 , . . . , x n ), we say that f is CLA4-provably computable. Since CLA4 is the only system of clarithmetic dealt with in this paper, the prefix "CLA4" before "provably" can be safely omitted. So, for instance, Example 11.3 established the provable decidability of the "zeroness" predicate, and Example 11.1 established the provable computability of the binary 1-successor function. The same terminology extends to partially defined functions as well. For instance, the later-proven Fact 12.3 shows that CLA4 ⊢ ⊓x x = 0 → ⊔y(x = y ′ ) . We understand this as the provable computability of the (partial) unary predecessor function. Exercise 11.4 Let Even(x) be an abbreviation of ∃z(x = z + z), and Odd(x) be an abbreviation of ¬Even(x). Find a lazy CLA4-proof of ∀x Even(x) ⊔ Odd(x) → ⊓y Even(x + y) ⊔ Odd(x + y) . Hint: Relying on the PA-provable fact that x0 is always even and x1 is always odd, by CLA4-Induction prove ⊓x Even(x) ⊔ Odd(x) . The target sentence is a logical consequence of the latter and the PA-provable fact that the sum of two numbers is even iff both numbers are even or both are odd. By an arithmetical problem in this paper we mean a game A such that, for some sentence F of the language of CLA4, A = F † (remember that † is the standard interpretation). Such a sentence F is said a representation of A. We say that an arithmetical problem A is provable in CLA4 iff it has a CLA4-provable representation. In these terms, a central result of the present paper sounds as follows: Theorem 11.5 An arithmetical problem has a polynomial time solution iff it is provable in CLA4. Furthermore, there is an efficient procedure that takes an arbitrary extended CLA4-proof of an arbitrary sentence X and constructs a solution of X (of X † , that is) together with an explicit polynomial bound for its time complexity. Proof. The soundness ("if") part of this theorem will be proven in Section 13, and the completeness ("only if") part in Section 14. 12 Some more taste of CLA4 In this section we establish several CLA4-provability facts. In view of the soundness of CLA4, each such fact tells us about the efficient solvability of the associated number-theoretic computational problem. As mentioned, the present work has been written not merely as a research paper but also as an advanced tutorial on CoL-based applied theories. The series of proofs given in this section can be treated as exercises aimed at developing the reader's feel for CoL-based systems and CLA4 in particular. But these proofs also provide certain necessary results relied upon later, in our proof of the extensional completeness of CLA4. As noted earlier, we shall exclusively rely on informal reasoning in CLA4, remembering that behind every such piece of reasoning is a formal CLA4-proof. our whether x = 0 or not. If x = 0, then (we know from PA that) |x0| = 0, so we win the game by selecting 0 for y in the consequent. Now suppose x = 0. We wait till Environment selects a constant a for y in the antecedent8 (if this does not happen, we win). Then, using Axiom 8, we compute the value (constant) b with b = a ′ , and choose b for y in the consequent. We win because, from PA, we know that when x is not 0, the resulting position (whatever the value of x is) is true. The right inductive step is similar but simpler, as we do not need to separately consider the case of x = 0. So, we know how to win (the ⊓-closure of) ⊔y(|y| ≤ |x| ∧ y = |x|). But then, of course, ignoring the |y| ≤ |x| conjunct, we also know how to win (the ⊓-closure of the weaker) ⊔y(y = |x|). Putting it in precise terms, ⊓x⊔y(y = |x|) is an (easy) logical consequence of ⊓x⊔y(|y| Compare the ⊓-closures of the following formulas: All four sentences "say the same" about the arbitrary (⊓) number represented by x, but in different ways. (5) is the weakest, least informative, of the four. It says that x has a binary predecessor y, and that x is even (i.e., is the binary 0-successor of its binary predecessor) or odd (i.e., is the binary 1-successor of its binary predecessor). This is an almost trivial piece of information. ( 6) and ( 7) carry stronger information. According to (6), x not just merely has a binary predecessor y, but such a predecessor can be actually and efficiently found. (7) strengthens ( 5) in another way. It says that x can be efficiently determined to be even or odd. As for (8), it is the strongest. It carries two pieces of good news at once: we can efficiently find the binary predecessor y of x and, simultaneously, tell whether x is even or odd. According to the following fact, ( 8) is provable. As we may guess, so are the weaker ( 7), ( 6), (5). Fact 12.2 CLA4 ⊢ ⊔y(x = y0 ⊔ x = y1). Proof. Argue in CLA4. By CLA4-Induction on x, we first want to prove ⊔y |y| ≤ |x| ∧ (x = y0 ⊔ x = y1) . The basis ⊔y |y| ≤ |0| ∧ (0 = y0 ⊔ 0 = y1) is obviously solved by selecting 0 for y and then choosing the left ⊔ -disjunct, which results in the true (according to PA) sentence |0| ≤ |0| ∧ 0 = 00. The left inductive ) is solved by selecting for y the same constant as the one selected by Environment for x, and then choosing the left ⊔ -disjunct. Similarly, the right inductive step ) is solved by selecting for y the same constant as the one selected by Environment for x, and then choosing the right ⊔ -disjunct. The preceding fact established the provable computability of binary predecessor. The following fact does the same for unary predecessor: Proof. Argue in CLA4. By CLA4-Induction on x, we want to prove x = 0 → ⊔y(|y| ≤ |x| ∧ x = y ′ ), from which the target x = 0 → ⊔y(x = y ′ ) follows immediately by LC. The basis 0 = 0 → ⊔y(|y| ≤ |0| ∧ 0 = y ′ ) is solved trivially by a strategy that does nothing. A win is guaranteed because the antecedent is false. The left inductive step is if not, we win the game), then -according to PA -x = 0. So, Environment will have to choose a constant a for y in the antecedent, or else it loses. We may assume that a is (indeed) the unary predecessor of x, or else, again, having chosen a wrong a, Environment loses. We know from PA that then the unary predecessor b of x0 equals a1, and that |b| ≤ |x0|. This b can be computed using (the resource provided by) Example 11.1. We choose b for y in the consequent and win. The right inductive step x = 0 → ⊔y(|y| Proof. Argue in CLA4. By CLA4-Induction on x, we want to prove from which, together with the PA-provable fact ∀y(|y| ≤ |y|), the target ⊔z(z = x + y) follows by LC. The basis is ⊓y |y| ≤ |t| → ⊔z(|z| ≤ |0| + |y| ∧ z = 0 + y) , which (as always) we prefer to simply write as It is won by selecting (the value of) y for z, because we know, from PA, In inductive steps, we will rely on the fact that PA proves (the ∀-closures of) the following formulas: s0 + r0 = (s + r)0, i.e., 2s + 2r = 2(s + r); (9) s0 + r1 = (s + r)1, i.e., 2s + (2r + 1) = 2(s + r) + 1; (10) s1 + r1 = (s + r)1 ′ , i.e., (2s + 1) The left inductive step is To solve it, we wait till Environment chooses a constant a for y in the consequent, after which (13) will be brought down to Using Fact 12.2, we find the binary predecessor b of a, for which we will also know whether a = b0 or ("or" in the strong sense of ⊔ ) a = b1. We specify y as b in the antecedent of ( 14), and wait till Environment selects a value c for z there. If a = b0, the game by now will be brought down to Using Axiom 9, we compute the value d of c0, and specify z as d in the consequent. The resulting position in view of ( 9) (and certain additional, straightforward PA-provable facts), is true, so we win. Quite similarly, if a = b1, the game by now will be brought down to Using Example 11.1, we compute the value d of c1, and specify z as d in the consequent. The resulting position in view of (10), is true, so we win. The right inductive step will be handled in a similar way, only relying on ( 11) and ( 12) instead of ( 9) and ( 10). Fact 12.5 CLA4 ⊢ ⊔z(z = x × y). Proof. The general scheme of proof here is very similar to the one employed in the proof of Fact 12.4, and details are left as an exercise to the reader. Here we shall only point out that, the four basic PA-provable facts that play the same role here as facts ( 9)- (12) in the proof of Fact 12.4 are the following: s0 × r0 = (s × r)00, i.e., 2s × 2r = 4(s × r); s0 × r1 = (s × r)00 + s0, i.e., 2s × (2r + 1) = 4(s × r) + 2s; s1 × r0 = (s × r)00 + r0, i.e., (2s + 1) × 2r = 4(s × r) + 2r; Also, where the previous proof relied on Axiom 9 and Example 11.1, the present proof, in addition, will rely on Fact 12.4. The following fact establishes the provable computability of all (polynomial) functions represented through terms: Fact 12.6 For any term τ (not containing z), CLA4 ⊢ ⊔z(z = τ ). Proof. We prove this fact by (meta)induction on the complexity of τ . The base cases are those of τ being the constant 0 or a variable x. Both of the corresponding sentences ⊔z(z = 0) and ⊓x⊔z(z = x) are provable in CL12 and hence also in CLA4. Next, assume τ is θ ′ . By the induction hypothesis, CLA4 proves ⊔z(z = θ). CLA4 also proves ⊔y(y = x ′ ) (Axiom 8). The desired ⊔z(z = θ ′ ) is a logical consequence of these two. The remaining cases of τ being θ 1 + θ 2 or θ 1 × θ 2 are handled in a similar way, relying on Facts 12.4 and 12.5, respectively. The formula of the following fact, as a computational problem, is about finding the (nonnegative) difference z between any two numbers x and y and then telling whether this difference is x -y or y -x. Fact 12.7 CLA4 ⊢ ⊔z(x = y + z ⊔ y = x + z). Proof. Argue in CLA4. By CLA4-Induction on x, we want to show The basis |y| ≤ |t| → ⊔z |z| ≤ |0| + |y| ∧ (0 = y + z ⊔ y = 0 + z) is obviously 9 solved by the strategy that chooses the value of y for the variable z and then selects the right ⊔ -disjunct. To solve the left inductive step we wait till Environment specifies a constant a for y in the consequent. Then, using Fact 12.2, we compute the binary predecessor b of a, and also figure out whether a = b0 or ( ⊔ ) a = b1. Case 1: a = b0. We specify y as b in the antecedent of ( 16), this way forcing Environment to choose a constant c for z there (unless |b| ≤ |t| is false, in which case |a| ≤ |t| is also false and we win), and also choose one of the disjuncts of x = b + c ⊔ b = x + c. Using Axiom 9, we calculate the value d of c0, and specify z as d in the consequent of (16). Further, if Environment has chosen x = b + c in the antecedent, we choose the left ⊔ -disjunct in the consequent. This means that, by now, ( 16) is brought down to From PA, the above is true, so we win. Similarly, if Environment has chosen b = x + c in the antecedent of ( 16), then we choose the right ⊔ -disjunct in the consequent, and again win. Case 2: a = b1. Again, we specify y as b in the antecedent of ( 16), this way forcing Environment to choose a constant c for z there, and also to choose one of the disjuncts of Subcase 2.1: b = x + c is chosen. Using Example 11.1, we calculate the value d of c1, specify z as d in the consequent of (16), and choose the right ⊔ -disjunct there. By now, ( 16) is brought down to According to PA, the above is true, so we win. Subcase 2.2: x = b + c is chosen. First, using Example 11.3, we figure our whether c = 0 or ( ⊔ ) c = 0. Subsubcase 2.2.1: c = 0. Using Axiom 8, we calculate the value d of 0 ′ , specify z as d in the consequent of ( 16), and choose the right ⊔ -disjunct there. This means that, by now, ( 16) is brought down to which, by PA, is true, so we win. Subsubcase 2.2.2: c = 0. Using Axiom 9 and Fact 12.3, we calculate d with c0 = d ′ , i.e. d = c0 -1, specify z as d in the consequent of ( 16), and choose the left ⊔ -disjunct there. This means that, by now, ( 16) is brought down to the following true (by PA) position, so we win: The right inductive step is handled in a rather similar way, and it is left as an exercise. Thus, we have proven (15). Now, the target sentence ⊓x⊓y⊔z(x = y + z ⊔ y = x + z) can be easily seen to be a logical consequence of (15) and the PA-provable fact ∀y(|y| ≤ |y|). Fact 12.8 CLA4 ⊢ x = y ⊔ x = y. 9 Here and often elsewhere implicitly relying on PA. Proof. Argue in CLA4. In order to solve x = y ⊔ x = y, using Fact 12.7, we find the difference a between x and y. Further, using Example 11.3, we figure out whether a = 0 or a = 0. If a = 0, we choose the left ⊔ -disjunct, otherwise we choose the right ⊔ -disjunct. For natural numbers n and i -as always identified with the corresponding binary numerals -such that i < |n|, in our metalanguage, we let [n] i mean bit #i of n, where the count of the bits of n starts from 0 rather than 1, and proceeds from left to right. So, for instance, if n = 100, then 1 is its bit #0, and the 0s are its bits #1 and #2. We treat [n] i as a pseudoterm just like |x|, meaning that we can feel free to write expressions such as [x] y = z, understood as abbreviations, in formulas of CLA4. Fact 12.9 CLA4 ⊢ y < |x| → ⊔z(z = [x] y ). Proof. Argue in CLA4. By induction on x, we want to show The basis is obviously solved by a strategy that makes no moves. To solve the left inductive step we wait till Environment selects a value a for y in the consequent. Using Facts 12.1 and 12.8, we figure out whether a = |x| or not. If yes, we select 0 for z in the consequent. If not, we choose a for y in the antecedent and wait till Environment responds by selecting a constant b for z there, after which we choose the same constant b for z in the consequent. With a little thought, this strategy can be seen to win. The right inductive step has a similar strategy, with the difference that, if a = |x|, it chooses the value of 0 ′ (found using Axiom 8) for z in the consequent. Now, the target y < |x| → ⊔z(z = [x] y ) can be seen to be a logical consequence of ( 17) and the PA-provable The exponentiation function 2 x increases the size of its argument exponentially and hence, in view of the soundness of CLA4, cannot be provably computable. According to the following fact, however, the same is not the case for a limited version of the function: Fact 12.10 CLA4 proves both of the following: x ≤ |z| → ⊔y(y = 2 x ); (18) ⊔y(y = 2 |r| ). (19) Proof. Argue in CLA4. By CLA4-induction on x, we want to prove x ≤ |z| → ⊔y(|y| ≤ |z| ′ ∧ y = 2 x ), from which (18) immediately follows by LC. The basis 0 ≤ |z| → ⊔y(|y| ≤ |z| ′ ∧ y = 2 0 ) is obviously solved by choosing the value a of 0 ′ for y. Such an a can be found using Axiom 8. The left inductive step is To solve it, we wait till Environment chooses a value for y in the antecedent. If such a value is never chosen, Environment loses unless x ≤ |z| is false. But, if x ≤ |z| is false, then so is x0 ≤ |z|, and we win. So, assume a is the constant chosen by Environment in the antecedent for y. Using Fact 12.5, we compute b with b = a 2 , and choose b for y in the consequent. We win because the game will have evolved to which, by PA, is true. The right inductive step is similar, with the difference that here we shall choose b to be 2a 2 rather than a 2 , computing which will take Axiom 9 in addition to Fact 12.5. Thus, (18) is proven. Now we solve (19), i.e. ⊔y(y = 2 |r| ), as follows. First, using Fact 12.1, we find the value a of |r|. Next, using (18) -namely, specifying its z and x as r and a, respectively -we compute the value b with b = 2 a , i.e. b = 2 |r| , and choose that b for y in ⊔y(y = 2 |r| ). We generalize the earlier notation [x] y to [x] z y , additionally to y < |x| requiring that y + z ≤ |x|. It means "the substring of x of length z which starts at the yth bit". For instance, if x = 111010, then [x] 3 2 = 101, [x] 6 0 = x and, for each i ∈ {0, . . . , 5}, [x] 0 i = 0. As always, we identify the bit string [x] z y with the number it represents in the binary notation. Note that the old [x] y is the special case of [x] z y with z = 1. The following fact states the provable computability of the function [x] z y . Proof. Argue in CLA4. First, by CLA4-induction on r, we want to prove The basis y ) is solved straightforwardly by choosing 0 for t. That is because 0 stands for the empty bit string, and so does [x] |0| y for whatever x, y with y < |x|. The right inductive step is Assume y < |x| ∧ y + |r1| ≤ |x|. Then we also have |r| y . Using Facts 12.1, 12.4 and 12.9, we further find b with b = [x] y+|r| . Now the sought value of t is the value of a0 + b, which we compute using Axiom 9 and Fact 12.4. To solve the left inductive step, first we figure out (using Example 11.3) whether r = 0 or not. If r = 0, we ignore the antecedent and act in the consequent as the strategy for the basis of induction did. Otherwise, we act as the strategy for the right inductive step did. 13 The soundness of CLA4 This section is devoted to proving the soundness part of Theorem 11.5. It means showing that any CLA4provable sentence X (as always, identified with its standard interpretation X † ) has a polynomial time solution, and that, furthermore, such a solution for X, together with an explicit polynomial bound τ for its time complexity, can be efficiently extracted from any extended CLA4-proof of X. Consider any sentence X with a fixed CLA4-proof. For presentational considerations, by induction on the length of the proof of X, we will first simply show that a polynomial time solution of X exists. Only after that, at the end of this section, we will show that such a solution, together with an explicit polynomial bound for its time complexity, is or can be constructed efficiently. Assume X is an axiom of CLA4. If X is a Peano axiom, then it is a true elementary sentence and therefore is won by a machine that makes no moves. If X is ⊓x⊔y(y = x ′ ) (Axiom 8), then it is won by a machine that (for the constant x chosen by Environment for the variable x) computes the value a of x + 1, and makes a as its only move in the play. Similarly, if X is ⊓x⊔y(y = x0) (Axiom 9), it is won by a machine that computes the value a of 2x, and makes a as its only move in the play. Needless to point out that all of the above machines run in polynomial time. Next, suppose X is obtained from premises Y 1 , . . . , Y n by LC. By the induction hypothesis, for each i ∈ {1, . . . , n}, we already have a solution (HPM) N i of Y i together with an explicit polynomial bound ξ i for the time complexity of N i . Of course, every such HPM N i can as well be seen as an n-ary GHPM that simply ignores its inputs. Then, by Theorem 10.1, we can (efficiently) construct an n-ary GHPM M, together with an explicit polynomial bound τ (ξ 1 , . . . , ξ n ) for the time complexity of the HPM M( N 1 , . . . , N n ) such that the latter solves X. Finally, suppose X is (the ⊓-closure of) F (x), where F (x) is a polynomially bounded formula, and X is obtained by CLA4-Induction on x. So, the premises are (the ⊓-closures of) F (0), F (x) → F (x0) and F (x) → F (x1). By the induction hypothesis, there are HPMs N , K 0 ,K 1 -with explicit polynomial bounds ξ, ζ 0 , ζ 1 for their time complexities, respectively -that solve these three premises, respectively. Fix them. We need certain auxiliary concepts. Consider any polynomially bounded formula H, any legal position Φ of ⊓H, and any legal move α (by whichever player ℘) in position Φ. In this context, we say that α is unreasonable if it signifies a choice of a constant c for a variable y in a ⊔y S(y, z) ∧ G or ⊓y S(y, z) → G (depending on whether ℘ = ⊤ or ℘ = ⊥) subcomponent of H, such that c violates the conditions on its size imposed by the sizebound S(y, z). Rather than trying to turn this otherwise clear intuitive explanation into a strict definition, providing an example would be sufficient. Let H be the formula 0 = 0 ∧ ⊔y(|y| ≤ |z| ′ ∧ z = y0). Then the move 1.1111 is unreasonable in position ⊥11 . That is because this move signifies choosing the constant 1111 for y. And the move ⊥11 of the position has set the value of z to 11 and hence the value of |z| to 2. So, the condition |y| ≤ |z| ′ , i.e. |1111| ≤ |11| ′ , is violated. Any other move 1.n with |n| > 3, such as 1.1000 or 1.111111111, would also be unreasonable in that position. We replace N by its "reasonable counterpart" N ′ -HPM which never makes unreasonable moves but otherwise is essentially the same as N . Namely, N ′ is a machine that works just like N , with the difference that, every time N makes an unreasonable move that chooses some (offensively long) constant c for a variable bound by a (bounded) quantifier of F (0), N ′ chooses (the always safe) 0 instead. Note that this does not decrease the chances of the machine to win, as unreasonable moves always result in the corresponding subgames' being lost, anyway. Obviously N ′ can be efficiently constructed from N . Further, the corresponding explicit polynomial bound ξ ′ can also be efficiently indicated (the latter will depend on ξ and the sizebounds of the ⊔-bound variables of F (0)). In a similar fashion, we replace K 0 ,K 1 by their "reasonable counterparts" K ′ 0 ,K ′ 1 and the corresponding explicit polynomial bounds ζ ′ 0 , ζ ′ 1 for their time complexities. For simplicity, we further replace the three bounds ξ 1 for the time complexities of all three machines N ′ , K ′ 0 and K ′ 1 . We now describe an HPM M that solves the conclusion F (x). In this description, we use the term "synchronizing" to mean applying copycat between two (sub)games of the form A and ¬A. This means copying one player's moves in A as the other player's moves in ¬A, and vice versa. The effect achieved this way is that the games to which A and ¬A eventually evolve (the final positions hit by them, that is) will be of the form A ′ and ¬A ′ , that is, one will remain the negation of the other, so that one will be won by a given player iff the other is lost by the same player. Moderated synchronization means the same, with the only difference that, whenever a player makes an unreasonable move by choosing an (offensively long) constant c for a variable bound by a bounded quantifier, the move is copied by the synchronizer with c replaced by 0. Throughout our description and analysis of the work of M, we assume that its adversary never makes illegal moves, for otherwise M easily detects illegal behavior and retires with victory. At the beginning, M waits for Environment to choose constants for the free variables of F (x). Assume k is the length of the constant chosen for the variable x, and the bits of that constant, in the left-to-right order, are b 1 , b 2 , . . . b k . We shall also assume here that k = 0, for otherwise the case is straightforward. Let d 0 be the constant 0 and, for each i ∈ {1, . . . , k}, let d i be the constant b 1 . . . b i . So, the constant chosen by Environment for x is d k . For each i ∈ {1, . . . , k}, let K ′ bi stand for K ′ 0 if b i = 0, and for After Environment chooses constants for all free variables of F (x), the work of M consists in continuously polling its run tape to see if Environment has made any new moves, combined with simulating, in parallel, one play of ⊓ F (0) by N ′ and -for each i ∈ {1, . . . , k} -one play of ⊓ F (x) → F (xb i ) by K ′ bi . In the simulation of N ′ , M lets the imaginary adversary of N ′ choose, at the very beginning of the play, the same constants for the free variables of F (0) as M's adversary chose for those variables in the real play. In the simulation of each K ′ bi , M lets the imaginary adversary of K ′ bi choose, at the very beginning of the play, the constant d i-1 for x and the same constants for all other free variables of F (x) → F (xb i ) as M's adversary chose for those variables in the real play. Let F ′ (x) be the result of substituting (see Definition 4.2) in F (x) each free variable of F (x) other than x by the constant chosen by (the real) Environment for that variable. Thus, after Environment's initial moves, ⊓ F (x) has been brought down to F ′ (d k ). Similarly, after the initial moves by the imaginary adversary of N ′ , ⊓ F (0) will be brought down to F ′ (0). And similarly, for each i ∈ {1, . . . , k}, after the initial moves by the imaginary adversary of K ′ bi , ⊓ F (x) → F (xb i ) will be brought down to What M does after the above initial moves in the real and simulated plays is that it synchronizes k + 1 pairs of (sub)games, real or imaginary. Namely: • It synchronizes -in the moderated sense -the consequent of the imaginary play of by K ′ b k with the real play of F ′ (d k ). • For each i ∈ {1, . . . , k -1}, it synchronizes the consequent of the imaginary play of F ′ (d i-1 ) → F ′ (d i ) by K ′ bi with the antecedent of the imaginary play of • It synchronizes the imaginary play of F ′ (0) (i.e. of F ′ (d 0 )) by N ′ with the antecedent of the imaginary play of Below is an illustration of such synchronization arrangements -indicated by arcs -for the case d k = d 4 = 1001: machine: status: game: This completes our description of M. Remembering our assumption that (N , K 0 , K 1 and hence) N ′ , K ′ 0 , K ′ 1 win the corresponding games, with a little thought it can be seen that M wins F ′ (d k ) and hence ⊓ F (x) , as desired. It now remains to show that the time complexity of M is also as desired. Remembering that the machines N ′ , K ′ 0 , K ′ 1 are "reasonable" and that the synchronization between the real play of F ′ (d k ) and the consequent of F ′ (d k-1 ) → F ′ (d k ) is moderated, one can easily write a term η(ℓ) with a single variable ℓ such that, if ℓ is greater than or equal to the size of any of the constants chosen by Environment for the free variables of F (x), the sizes of no moves ever made by M or the simulated where G is elementary, then η(ℓ) can be taken to be ℓ × ℓ + ℓ + 0 ′ ′ ′ ′ (here 0 ′ ′ ′ ′ is to account for the size of the prefix ".", "1." or "0.1." that any legal move by ⊤ in any of the plays that we consider would take). For the rest of this proof, pick and fix an arbitrary play (computation branch) of M, and an arbitrary clock cycle c on which M makes a move α in the real play of F (x). Let and ℓ the timecost and the background (see Section 7) of this move, respectively. Let d 0 , . . . , d k be as in the description of the work of M. Note that ℓ is not smaller than the size of the greatest of the constants chosen by Environment for the free variables of F (x). Hence, where η is as in the previous paragraph, we have: The sizes of no moves ever made by M or the simulated The polling, simulation and copycat performed by M do impose some time overhead. But the latter is only (fixed) polynomial and, in our subsequent analysis, can be safely ignored. Namely, for the sake of simplicity, we are going to pretend that M copies moves in its copycat routine instantaneously (as soon as detected), and that the times that M ever spends "thinking" about what move to make are the times during which it is waiting for simulated machines to make one or several moves. Furthermore, we will pretend that the polling and the several simulations happen in a truly parallel fashion, in the sense that M spends a single clock cycle on tracing a single computation step of all k + 1 machines simultaneously, as well as on checking out its run tape to see if Environment has made a new move. Let β 1 , . . . , β m be the moves by simulated machines that M detects by time c, arranged according to the times t 1 ≤ . . . ≤ t m of their detections (which, by our simplifying assumptions, coincide with the timestamps of those moves in the corresponding simulated plays). Let d = c -. Let j be the smallest integer among 1, . . . , m such that t j ≥ d. Since each simulated machine runs in time φ, in view of (22) it is clear that t j -d does not exceed φ(η(ℓ)). Nor does t i -t i-1 for any i with j < i ≤ m. Therefore t m -d ≤ (m -j + 1) × φ(η(ℓ)). Since m, j ≥ 1, let us be generous and simply say that t m -d ≤ m × φ(η(ℓ)). But notice that β m is a move made by K ′ b k in the consequent of F ′ (d k-1 ) → F (d k ), immediately (by our simplifying assumptions) copied by M in the real play when it made its move α. In other words, c = t m . And c -d = . So, does not exceed m × φ(η(ℓ)). And, by (22), the size of α does not exceed m × φ(η(ℓ)), either. But observe that k ≤ ℓ, and that m cannot exceed k + 1 times the depth (see Section 4) d of F (0); therefore, m ≤ d × (ℓ + 1). Thus, (as long as we pretend that there is no polling/simulation/copycat overhead) neither the timecost nor the size of α exceed d × (ℓ + 1) × φ(η(ℓ)). An upper bound for the above function d × (ℓ + 1) × φ(η(ℓ)), even after "correcting" the latter so as to precisely account for the so far suppressed polling/simulation/copycat overhead, can be written as an explicit polynomial function τ . The latter expresses the sought polynomial bound for the time complexity of M. Thus, we have shown how to construct, from a proof of X, an HPM M and an explicit polynomial function τ such that M solves X in time τ . Obviously our construction is effective. It remains to see that it also is -or, at least, can be made -efficient. Of course, at every step of our inductive construction (for each sentence of the proof, that is), the solution M of the step and its time complexity bound τ is obtained efficiently from previously constructed Ms and τ s. This, however, does not guarantee that the entire construction will be efficient as well. For instance, if the proof has n steps and the size of each HPM M that we construct for each step is twice the size of the previously constructed HPMs, then the size of the eventual HPM will exceed 2 n and thus the construction will not be efficient, even if each of the n steps of it is so. A trick that we can use to avoid an exponential growth of the sizes of the machines that we construct and thus achieve the efficiency of the entire construction is to deal with GHPMs instead of HPMs. Namely, assume the proof of X is the sequence X 1 , . . . , X n of sentences, with X = X n . Let M 1 , . . . , M n be the HPMs constructed as we constructed Ms earlier at the corresponding steps of our induction. Remember that each such M i was defined in terms of M j1 , . . . , M j k for some j 1 , . . . , j k < i. For simplicity and uniformity, we may just as well say that each M i was defined in terms of all M 1 , . . . , M n , with those M j s that were not among M j1 , . . . , M j k simply ignored in the description of the work of M i . Now, for each such M i , let M ′ i be the n-ary GHPM whose description is obtained from that of M i by replacing each reference to (any previously constructed) M j by "M ′ j ( M ′ 1 , . . . , M ′ n ) where, for each e ∈ {1, . . . , n}, M ′ e is the machine encoded by the eth input". 10 As it is easy to see by induction on i, M i and M ′ i ( M ′ 1 , . . . , M ′ n ) are essentially the same, in the sense that our earlier analysis of the play and time complexity of the former applies to the latter just as well. So, M ′ n ( M ′ 1 , . . . , M ′ n ) wins X n , i.e. X. At the same time, note that the size of each GHPM M ′ i is independent of the sizes of the other (previously constructed) GHPMs. Based on this fact, with some analysis, one can see that then the HPM M ′ n ( M ′ 1 , . . . , M ′ n ) is indeed constructed efficiently. As for the explicit polynomial bounds τ 1 , . . . , τ n for the time complexities of the n HPMs M , their sizes can be easily seen to be polynomial in the size of the proof. That is because, for each i ∈ {1, . . . , n}, the size of τ i only increases the sizes of the earlier constructed τ j s by adding (rather than multiplying by) a certain polynomial quantity. 11 Thus, the explicit bound τ n for the time complexity of the eventual HPM M ′ n ( M 1 , . . . , M n ) is indeed constructed efficiently. This section is devoted to proving the completeness part of Theorem 11.5. It means showing that, for any arithmetical problem A that has a polynomial time solution, there is a theorem of CLA4 which, under the standard interpretation, equals ("expresses") A. 14.1 X, X and χ So, let us pick an arbitrary polynomial-time-solvable arithmetical problem A. By definition, A is an arithmetical problem because, for some sentence X of the language of CLA4, A = X † . For the rest of this section, we fix such a sentence X, and fix X as an HPM that solves A (and hence X † ) in polynomial time. Specifically, we assume that X runs in time χ, where χ, which we also fix for the rest of this section, is a single-variable term of the language of PA -and hence can as well be seen/written as an explicit polynomial function -with χ(x) ≥ x for all x. For readability, we also agree that, throughout the rest of this section, "formula" exclusively means a subformula of X, in which some variables may be renamed. X may not necessarily be provable in CLA4, and our goal is to construct another sentence X for which, just like for X, we have A = X † and which, perhaps unlike X, is provable in CLA4. Remember our convention about identifying formulas of the language of CLA4 with (the games that are) their standard interpretations. So, in the sequel, just as we have done so far, we shall typically write E, F, . . . to mean either E, F, . . . or E † , F † , . . .. Similar conventions apply to terms as well. In fact, we have already used this convention when saying that X runs in time χ. What was really meant was that it runs in time χ † . Our proof is a little long and, in the process of going through it, it is easy to get lost in the forest and stop seeing it for the trees. Therefore, it might be worthwhile to try to get some preliminary insights into the basic idea behind this proof before venturing into its details. Let us consider the simplest nontrivial special case where X is for some elementary formulas Y (x) and Z(x) (perhaps Z(x) is ¬Y (x), in which case X expresses an ordinary decision problem -the problem of deciding the predicate Y (x)). The assertion "X does not win X in time χ" can be formalized in the language of PA through as a certain sentence L. Then we let the earlier mentioned X be the sentence Since X does win the game X in time χ, L is false. Hence Y (x) ∨ L is equivalent to Y (x), and Z(x) ∨ L is equivalent to Z(x). This means that X and X, as games, are the same, that is, X † = X † . It now remains to understand why CLA4 ⊢ X. A central lemma here is one establishing that the work of X is "provably traceable". Roughly, in our present case this means the provability of the fact that, for any (⊓) value chosen for x by Environmentlet us continue referring to that value as x -we can tell (⊔) the configuration of X in the corresponding play of X at any given time t. Letting X work for χ(x) steps, one of the following four eventual scenarios should take place, and the provable traceability of the work of X can be shown to imply that CLA4 proves the ⊔ -disjunction of sentences describing those scenarios: Scenario 1: X makes the move 0 (and no other moves). Scenario 2: X makes the move 1 (and no other moves). Scenario 3: X does not make any moves. Scenario 4: X makes an illegal move (perhaps after first making a legal move 0 or 1). In the case of Scenario 1, the play over X hits Y (x) ∨ L. And CLA4 -in fact, PA -proves that, in this case, Y (x) ∨ L is true. The truth of Y (x) ∨ L is indeed very easily established: if it was false, then Y (x) should be false, but then the play of X over X hits the false Y (x) and hence is lost, but then L is true, but then H • i (u, y, s) true -we can choose u to be the result of appending such a labmove ⊥α to the run tape content of the deterministic successor of configuration z. After properly formalizing encoding for configurations, this argument can be reproduced in CLA4. For clause (b), assume E • (z, s). We can trace, within CLA4, the work of X for "sufficiently many"namely, χ(|z|) -steps in the scenario where Environment does not move. If X does not move during those χ(|z|) steps either, then E • • (z, s) is true and we can choose it in the consequent of (25). Suppose now X makes a move α within χ(|z|) steps. If α is illegal, then L is true, and we choose the latter in the consequent of (25). Otherwise, if α is a legal move, then it brings E( s) down to one of (the instances of) its (⊤, y)-developments H i (y, s) for a certain value of y. We choose the corresponding ⊔ -disjunct in the consequent of (25); further, by tracing the work of X , we will be able to compute the value of the configuration u in which X made the above move, as well the above-mentioned "certain value of y". By choosing values for the variables u and y in ⊔u⊔yH • 1 (u, y, s), we win the game. Again, after properly formalizing encoding for configurations, the entire argument can be reproduced in CLA4. Lemma 14.7 Assume E( s) is a formula all of whose free variables are among s. Then CLA4 proves E • (z, s) → E( s). Proof. We prove this lemma by (meta)induction on the complexity of E( s). By the induction hypothesis, for any (⊥, y)-or (⊤, y)-development H i (y, s) of E( s) (if there are any), CLA4 proves Argue in CLA4 to justify E • (z, s) → E( s). Consider any values (constants) b and a chosen by Environment for z and s, respectively.12 Assume E • (b, a) is true (if not, we win). Our goal is to show how to win E( a). From clause (b) of Lemma 14.6, the resource (25) with b, a plugged for z, s is at our disposal. Since the antecedent of the latter is true, the provider of (25) will have to choose one of the ⊔ -disjuncts in the consequent Case 1: L is chosen in (27). It has to be true, or else the provider loses. By Lemma 14.3, we also have the resource L → ∀E( s). Since its antecedent L is true, we know how to win the consequent ∀E( s). But a strategy that wins the latter, of course, also wins our target E( a). Case 2: One of ⊔u⊔yH • i (u, y, a) is chosen in (27). This should be followed by a further choice of some constants c and d for u and y, yielding H • i (c, d, a). Plugging a, c and d for s, u and y in (26), we get . We may assume that the antecedent of the latter is true, or else the provider of ( 27) lied when bringing the latter down to H • i (c, d, a). Thus, the consequental resource H i (d, a) is at our disposal. But, remembering that the formula H i (y, s) is a (⊤, y)-development of the formula E( s), we can now win E( a) by making a move α that brings the latter down to H i (d, a), which we already know how to win. For example, imagine d,a). Then the above move α will be "1.d". It indeed brings Y ( a) → ⊔wZ(w, a) down to Y ( a) → Z(d, a). • (b, a) is chosen in (27). It has to be true, or else the provider loses. Subcase 3.1: . By Lemma 14.5, we also have ∃E • • (z, s) → ∀E( s). So, we have a strategy that wins ∀E( s). Of course, the same strategy also wins E( a). Subcase 3.2: The formula E( s) is not critical. By Lemma 14.4, we find that the elementarization of E( a) is true. This obviously means that if Environment does not move in E( a), we win the latter. So, assume Environment makes a move α in E( a). The move should be legal, or else we win. Of course, the same move is a legal move of E( a) and, for one of the (⊥, y)-developments H i (y, s) of the formula E( s) and some constant c, it brings E( a) down to H i (c, a) as well as E( a) down to H i (c, a). For example, if E( s) is Y ( s) → Z( s) ⊓ T ( s), α could be the move "1.0", which brings is F 0 ∧ F 1 . By the induction hypothesis, CLA4 proves both ∀(F 0 ∧ ¬L → F 0 ) and ∀(F 1 ∧ ¬L → F 1 ). These two, by LC, imply ∀ (F 0 ∧ F 1 ) ∧ ¬L → F 0 ∧ F 1 . And the latter is nothing but the desired ∀(E ∧ ¬L → E). The remaining cases where E is F 0 ∨ F 1 , F 0 ⊓ F 1 , F 0 ⊔ F 1 , ⊓xF (x), ⊔xF (x), ∀xF (x) or ∃xF (x) are handled in a similar way. ( 28) is thus proven. (28) implies that CLA4 proves X ∧ ¬L → X. As established in Section 14, CLA4 also proves X. From these two, by LC, CLA4 proves ¬L → X, as desired. Remember that, in Section 14, X was an arbitrary CLA4-sentence assumed to have a polynomial time solution under the standard interpretation † . And ¬L was a certain true sentence of the language of classical Peano arithmetic. We showed in that section that CLA4 proved a certain sentence X with X † = X † . That is, we showed that X was "extensionally provable". According to our present Theorem 16.1, in order to make X also provable in the intensional sense, all we need is to add to the axioms of CLA4 the true elementary sentence ¬L. In philosophical terms, the import of Theorem 16.1 is that the culprit of the intensional incompleteness of CLA4 is the (Gödel's) incompleteness of its classical, elementary part. Otherwise, the "nonelementary rest" of CLA4 -the two extra-Peano axioms and the CLA4-Induction rule -as a bridge from classical arithmetic to polynomial-time-computability-oriented clarithmetic, is complete in a certain very strong and natural sense. Namely, it guarantees not only extensional but also intensional provability of every polynomial time computable problem as long as all necessary true elementary sentences are taken care of. This means that if, instead of PA, we take the truth arithmetic Th(N) (the set of all true sentences of the language of PA) as the base arithmetical theory, the corresponding version of CLA4 will be not only extensionally, but also intensionally complete. Unfortunately, however, such a system will no longer be recursively axiomatizable. To summarize, in order to make CLA4 intensionally stronger, it would be sufficient to add to it new true elementary (classical) sentences only. Note that this sort of an extension, even if in a language more expressive than that of PA, would automatically remain sound and extensionally complete: virtually nothing in this paper relies on the fact that PA is not stronger than it really is. Thus, basing applied theories on CoL allows us to construct ever more expressive and intensionally strong theories without worrying about how to preserve soundness and extensional completeness. Among the main goals of this paper was to illustrate the scalability of CoL rather than the virtues of the particular system CLA4 based on it. The latter is in a sense arbitrary, as is PA itself: in the role of the classical part of CLA4, we could have chosen not only any true extension of PA, but certain weaker-than-PA theories as well, for our proof of the extensional completeness of CLA4 does not require the full strength of PA. The reason for not having done so is purely "pedagogical": PA is the simplest and best known arithmetical theory, and reasoning in it is much more relaxed, easy and safe than in weaker versions. CLA4 is thus the simplest and nicest representative of the wide class of clarithmetical theories for polynomial time computability, all enjoying the same relevant properties as CLA4 does. As pointed out in Section 1, among the potential applications of CLA4-style systems is using them as formal tools (say, after developing reasonable theorem-provers) for systematically finding efficient solutions for problems, and the stronger such a system is, the better the chances that a solution for a given problem will be found. Of course, what matters in this context is intensional rather than extensional strength. So, perfect strength is not achievable, but we can keep moving ever closer to it. One may ask why not think of simply using PA (or even, say, ZFC) instead of CLA4 for the same purposes: after all, PA is strong enough to allow us reason about polynomial time computability. This is true, but PA is far from being a reasonable alternative to CLA4. First of all, as a tool for finding solutions, PA is very indirect and hence hopelessly inefficient. Pick any of the basic functions of Section 12 and try to generate, in PA, a full formal proof of the fact that the function is polynomial-time computable (or even just express this fact) to understand the difference. Such a proof would have to proceed by clumsy reasoning about non-number objects such as Turing machines and computations, which, only by good luck, happen to be amenable to being understood as numbers through encoding. In contrast, reasoning in CLA4 is directly about numbers and their properties, without having to encode any foreign (metaarithmetical or complexitytheoretical) beasts and then try to reason about them as if they were just kind and innocent natural numbers. Secondly, even if an unimaginably strong theorem-prover succeeded in finding such a proof, there would be no direct use of it because, from a proof of the existence of a solution we cannot directly extract a solution. Furthermore, even knowing that a given HPM X solves the problem in some polynomial time χ, would have no practical significance without knowing what particular polynomial χ is, in order to assess whether it is reasonable for our purposes, or takes us beyond the number of nanoseconds in the lifespan of the universe (after all, ℓ 999 999 is also a polynomial function!). In order to actually obtain a solution and a polynomial bound for it, one would need a constructive proof, that is, not just a proof that a polynomial function χ and a χ-time solution exist, but a proof of the fact that certain particular numbers a and b are (the codes of) a polynomial term χ and a χ-time solution X . Otherwise, a theorem-prover would have to be used not just once for a single target formula, but an indefinite (intractably many) number of times, once per each possible pair of values of a, b until the "right" values are encountered. To summarize, PA does not provide any reasonable mechanism for handling queries in the style "find a polynomial time solution for problem A": in its standard form, PA is merely a YES/NO kind of a "device". The above dark picture can be somewhat brightened by switching from PA to Heyting's arithmetic HA -the version of PA based on intuitionistic logic instead of classical logic, which is known allow us to directly extract, from a proof of a formula ∃xF (x), a particular value of x for which F (x) is true. But the question is why intuitionistic logic and not CoL? Both claim to be "constructive logics", but the constructivistic claims of CoL have a clear semantical meaning and justification, while intuitionistic logic is essentially an ad hoc invention whose constructivistic claims are mainly based on certain syntactic and hence circular considerations, 13 without being supported by a convincing and complete formal constructive semantics. And, while HA is immune to the second one of the two problems pointed out in the previous paragraph, it still suffers from the first problem. At the same time, as a reasoning tool, HA is inferior to PA, for it is intensionally weaker and, from the point of view of the philosophy of CoL, is so for no good reasons. As a simple example, consider the function f defined by "f (x) = x if PA is either consistent or inconsistent, and f (x) = 2x otherwise". This is a legitimately defined function, and we all -just as PA -know that extensionally it is the same as the identity function f (x) = x. Yet, HA can be seen to fail to prove -in the intensional sense -its computability. Despite its name, intuitionistic logic is not so "intuitive" after all! A natural question to ask is: Is there a sentence X of the language of CLA4 whose polynomial time computability is constructively provable in PA yet X is not provable in CLA4? Remember that, as we agreed just a while ago, by constructive provability of the polynomial time computability of X in PA we mean that, for some particular HPM X and a particular polynomial (term) χ, PA proves that X is a χ-time solution of X. If the answer to this question was positive, then PA, while indirect and inefficient, would still have at least something to say in its defense when competing with CLA4 as a problem-solving tool. But, as seen from the following theorem, the answer to the question is negative: Theorem 16.2 Let X be any sentence of the language of CLA4 such that PA constructively proves (in the above sense) the polynomial time computability of X. Then CLA4 ⊢ X. Proof. Consider any sentence X of the language of CLA4. Assume PA constructively proves the polynomial time computability of X, meaning that, for a certain HPM X and a certain term χ, PA proves that X solves X in time χ. But this is exactly what the sentence L of Section 14 denies. So, PA ⊢ ¬L. But, by Theorem 16.1, we also have CLA4 ⊢ ¬L → X. Consequently, CLA4 ⊢ X. An import of the above theorem is that, if we tried to add to CLA4 some new nonelementary axioms in order to achieve a properly greater intensional strength, the fact that such axioms are computable in time χ for some particular polynomial χ would have to be unprovable in PA, and hence would have to be "very nontrivial". The same applies to attempts to extend CLA4 through some new rules of inference. Beginning from Buss's seminal work [6], many complexity-sensitive or complexity-oriented arithmetical and logical systems have been developed by various authors ([3, 7, 8, 9, 10, 33, 35] and more). Most of those 13 What creates circularity is the common-sense fact that syntax is merely to serve a meaningful semantics, rather than vice versa. It is hard not to remember the following words from [26] here: "The reason for the failure of P ⊔ ¬P in CoL is not that this principle . . . is not included in its axioms. Rather, the failure of this principle is exactly the reason why this principle, or anything else entailing it, would not be among the axioms of a sound system for CoL". achieve control over complexity in ways very different from ours, such as by type information rather than by explicit bounds on quantifiers, for which reason we do not attempt any direct comparison here. As pointed out in Section 1, Buss's [6] original work on bounded arithmetic is closest to -and the most immediate precursor of -our approach. In fact, in a broad sense, CLA4 is a system of bounded arithmetic, only based on CoL instead of classical logic or intuitionistic logic on which the other systems of bounded arithmetic have been traditionally based. The main relevant results in the studies of classical-logic-based bounded arithmetic, extensive surveys of which can be found in [11,32], can be summarized saying that, by appropriately weakening the induction axiom of PA and restricting it to bounded formulas of certain forms, and correspondingly readjusting the nonlogical vocabulary and axioms of PA, certain soundness and completeness for the resulting system(s) S can be achieved. Such soundness results typically read like "If S proves a formula of the form ∀x∃yF (x, y), where F satisfies such and such constraints, then there is function of such and such computational complexity which, for each a, returns a b with F (a, b)". And completeness results typically read like "For any function f of such and such computational complexity, there is an S-provable formula of the form ∀x∃yF (x, y) such that, for any a and b, F (a, b) is true iff b = f (a)". Among the characteristics that make our approach very different from the above (as well as any other complexity-oriented systems of arithmetic known to the author), one should point out that it extends rather than restricts the language and the deductive power of PA. Restricting PA can be seen as throwing out the baby with the bath water. Not only does it expel from the system many complexity-theoretically unsound yet otherwise meaningful and useful theorems, but it also reduces -even if only in the intensional rather than extensional sense -the class of complexity-theoretically correct provable principles. This is a necessary sacrifice, related to the inability of the underlying classical logic to clearly differentiate between constructive ( ⊓ , ⊔ , ⊓, ⊔) and "ordinary", non-constructive versions ( ∧ , ∨ , ∀, ∃) of operators. The inadequacy of classical logic as a basis for constructive systems also shows itself in the fact that the above-mentioned soundness and completeness results are only partial. The above problem of partiality is partially overcome when one bases a complexity-oriented arithmetic on intuitionistic logic ( [7,35]) instead of classical logic. In this case, soundness/completeness extends to all formulas of the form ∀x∃yF (x, y), without the "F satisfies such and such constraints" condition (the reason why we still consider this sort of soundness/completeness partial is that it remains limited to formulas of the form ∀x∃yF (x, y), i.e. functions, which, for us, are only special cases of computational problems). However, for reasons pointed out in the previous section, switching to intuitionistic logic signifies throwing out even more of the "baby" from the bath tub, further decreasing the intensional strength of the theory and probably losing its intuitive clarity or appeal in the eyes of the classically-minded majority. Both classical-logic-based and intuitionistic-logic-based systems of bounded arithmetic happen to be inherently weak theories, as opposed to our CoL-based version, which is as strong as Gödel's incompleteness phenomenon permits, and which can be indefinitely strengthened without losing computational soundness. We owe this achievement to the fact that CoL gives Caesar what belongs to Caesar, and God what belongs to God. As we had a chance to see throughout this paper, classical ( ∧ , ∨ , ∀, ∃) and constructive ( ⊓ , ⊔ , ⊓, ⊔) logical constructs can peacefully coexist and complement each other in one natural system that seamlessly extends the classical, constructive, resource-and complexity-conscious visions and concepts, and does so not by mechanically putting things together, but rather on the basis of one natural, all-unifying, complete game semantics. Unlike most other approaches where only few, special-form expressions (if any) have clear computational interpretations, in our case every formula is a meaningful computational problem. Further, we can capture not only computational problems in the traditional sense, but also problems in the more general -interactive -sense. Classical logic and classical arithmetic, so close (unlike, say, intuitionistic logic or HA) to the heart and mind of all of us, do not at all need to be rejected or tampered with in order to achieve constructive heights. Just the opposite, they can be put in faithful and useful service to this noble goal. Our heavy reliance on reasoning in PA throughout this paper is an eloquent illustration of it. Overall, the present work can be seen as an illustration of the fruitfulness of two independently conceived lines of thought -bounded arithmetic and computability logic -through a successful marriage between them. The forthcoming paper [30] constructs three new, incrementally strong systems of clarithmetic, named CLA5, CLA6 and CLA7. In the same sense as CLA4 is sound and complete with respect to polynomial time computability, these systems are shown to be sound and complete with respect to polynomial space computability, elementary recursive time computability and primitive recursive time computability, respectively (as for elementary recursive space and primitive recursive space, they simply coincide with elementary recursive time and primitive recursive time). The simplicity and elegance of those systems serves as additional empirical evidence for the naturalness of basing applied theories on CoL instead of the more traditional alternatives, and for the flexibility and scalability of our approach. All three systems, on top of Axioms 1-7, have Axiom 8 as the only extra-Peano axiom (Axiom 9 simply becomes derivable and hence redundant due to the presence of a stronger induction rule). CL12 continues to serve as the logical basis for these systems, and what varies is only the induction rule. The induction rule of CLA5 differs from that of CLA4 in that, while the (two) inductive steps of the latter are based on binary successors, the (single) inductive step of the former is based on unary successor, i.e., is the kind old F (x) → F (x ′ ), with F (x) still required to be a polynomially bounded formula. The system CLA6 is obtained from CLA5 by relaxing this requirement in the induction rule and, instead, requiring that F (x) be exponentially bounded. And the system CLA7 is obtained from CLA6 by removing all conditions on F (x) whatsoever, thus leaving the realm of bounded arithmetic. The earlier mentioned system CLA1 of [27] further strengthens the above series. Its logical basis, just like that of all clarithmetical theories we have seen, is CL12. And the nonlogical axioms, just as in the case of CLA5, CLA6 and CLA7, are Axioms 1-8 of Section 11. As we may guess, the only difference between CLA1 and the weaker systems CLA4-CLA7 is (again) related to how the induction rule operates. Here the difference is of a qualitative character due to the fact that CLA1, unlike CLA4-CLA7, is a natural deduction system. Namely, while an inductive step of CLA7 is a formula F (x) → F (x ′ ), the corresponding inductive step in CLA1 is a derivation of F (x ′ ) from F (x). In classical systems, according to the deduction theorem, a formula E is derivable from a formula G iff the formula G → F is provable, so switching to natural deduction in the style of CLA1 would create no difference. The situation, however, is very different in (the resource-conscious) CoL-based systems, where deriving E from G is generally easier than proving G → E. This is so because a derivation may "recycle" its premises while, on the other hand, the antecedent of a →combination may be "unrecyclable". For instance, E ∧ E is always derivable from E but, as we had a chance to see from Exercise 9.5, E → E ∧ E is not always provable (and/or valid). While derivability of F (x ′ ) from F (x) thus does not generally imply provability of F (x) → F (x ′ ), the latter does always imply the former. Consequently, CLA1 is at least as strong as CLA7, meaning that CLA1, just like CLA7, can extensionally prove all primitive recursive time (and/or space) computable problems. A natural expectation here is that, at the same time, CLA1 takes us "far beyond" primitive recursive time (and/or space) computability, even though exactly how far still remains to be understood. Throughout the rest of this appendix, the sole purpose of which is to prove Lemma 14.6, X, X and χ are as in Section 14. The terms "configuration", "state", "tape symbol" etc. exclusively refer to ones of X . We assume that 0 and 1 are among the tape symbols. blank will stand for the blank tape symbol. The proofs given in this appendix will heavily and repeatedly rely on PA and the results of Section 12. It is important to note that, almost always, this reliance will be only implicit. In order to prove Lemma 14.6, we need to introduce a system of encoding for various objects of relevance. Whenever O is such an object, O will stand for its code. Let A be the set consisting of all states (of X ), and four versions â, ǎ, â, ǎ of every tape symbol a. As opposed to tape symbols, we refer to the elements of A (simply) as symbols. As we are going to see shortly, in our encoding of configurations, â (resp. ǎ) means the tape symbol a written on the work (resp. run) tape, and the presence (resp. absence) of an underline indicates that the head of the corresponding tape is (resp. is not) currently looking at the cell containing a. We extend the ˆ,ˇnotation from tape symbols to strings of tape symbols. Namely, for any such string α, α means the result of replacing every symbol a by â in α. Similarly for α. We pick and fix a sufficiently large integer k and, with K standing for 2 k throughout the rest of this paper, encode each symbol a as a natural number a with | a | = K. As practiced earlier, terminologically and notationally we identify such an a with the corresponding binary numeral. Thus, the codes of symbols are bit strings, all of length K and none starting with a 0. Needless to mention that different symbols are required to have different codes. Further, where a 1 , . . . , a k is a sequence of symbols, we encode it as the binary numeral -again, identified with the corresponding number -a 1 . . . a k . We will not always be careful about differentiating objects from their codes, and may say something like "the symbol b" where, strictly speaking, the code of that symbol is meant, or vice versa. We need to make clear what, exactly, is meant by a configuration. According to our earlier informal explanation, this is a full description of some "current" situation in X , namely, a list indicating the state of X , the locations of its two scanning heads, and the contents of its two tapes. The tapes, however, are infinite, and we need to agree on how to represent their contents by finite means. Remember our convention that a head of an HPM can never move past the leftmost blank cell of the corresponding tape, and that the work-tape head can never write the blank symbol. This means that every cell to the left of a blank cell will also be blank and, accordingly, when describing a configuration, it would be sufficient to describe the contents of its tapes up to (including) the leftmost blank cells. Precisely, we agree to understand each configuration C as the following sequence of symbols: a, b0 , . . . bi-1 , bi , bi+1 , . . . , bm , č0 , . . . čj-1 , čj , čj+1 , . . . čn (29) where, in the context of C, a is the ("current") state of X , b 0 . . . b m (resp. c 0 . . . c n ) are the contents of cells #0 through #m (resp. #n) of the work (resp. run) tape, and i (resp. j) is the cell # of the cell scanned by the head of the work (resp. run) tape. In addition, both b m = c n = blank while no other b k or c k is blank. We encode the above configuration as any other sequence of symbols, i.e., as the binary numeral a b0 . . . bi-1 bi bi+1 . . . bm č0 . . . čj-1 čj čj+1 . . . čn . In the sequel, we will be using the pseudoterm x • y and several elementary formulas with special names, each one being a natural arithmetization of the corresponding predicate shown below: • N(x, y) says "if x is b1 , . . . , bk for some symbols b 1 , . . . , b k (k ≥ 0), then y is b1 , . . . , bk ." So, for instance, D( 1,., 0 , 1,., 0 ) is true. • C(x) says "x is the code of a configuration". • I(x, y) says "x is the code of a configuration of the form (29), and i = y". • J(x, y) says "x is the code of a configuration of the form (29), and j = y". • M(x, y) says "x is the code of a configuration of the form (29), and m = y". • E(x, y) says "y is the code of the sequence of symbols resulting from changing every 0 to 0 and every 1 to 1 in the binary numeral representing number x". So, for instance, E(101, 1, 0, 1 ) is true. • D(x, y) says "x is b1 , . . . , bk for some bits b 1 , . . . , b k (k ≥ 0) where b 1 (if present) is 1, and y is the number represented by the numeral b 1 . . . b k ". So, for instance, D( 1, 0, 1 , 101) is true. • S(x, y) says "x is the code of a configuration and y is the code of the deterministic successor (see Section 14.5) of that configuration". • A(z, x, y) says "z is the code of a legitimate configuration C (see Section 14.5), x is the code of the yth deterministic successor of C, and, for any i with 0 ≤ i ≤ y, the state of the ith deterministic successor of C is not a move state". A(z, x, y) thus asserts that, after the (legitimate) configuration z, if Environment does not move, X reaches the configuration x within y (y ≥ 0) steps, and it does not move during those steps, either. • A ′ (z, y) abbreviates ∃xA(z, x, y). A ′ (z, y) thus says that, after reaching the (legitimate) configuration z, during the subsequent y (including 0) steps, if Environment does not move, neither does X . The paper[36] (in Chinese) is apparently another exception, focused on applications of CoL in AI. For simplicity, here we treat "Composite" as the complement of "Prime", even though, strictly speaking, this is not quite so: the numbers 0 and 1 are neither prime nor composite. Writing "Nonprime" instead of "Composite" would easily correct this minor inaccuracy. Here the number i is identified with the standard bit string representing it in the binary notation. The same applies to the other clauses of this definition. As easily understood, here and in similar contexts, "move" means a move not as a string, but as an event, namely, the event of M making a move at time c. An essentially the same logic, under the name L, was in fact known as early as in[12]. Here and later in similar metacontexts, "efficient" means "polynomial time". In case we do not insist that every formula in an CLA4-proof be a sentence, one could show that, if F is not a sentence, it is provable (in this relaxed sense) if and only if its ⊓ -closure is so, anyway. In informal arguments like this, we usually do not try to be consistent in using different metavariables for constants and variables. Notice that the status of x in the present informal argument is also "constant" (chosen by Environment for the variable x) just like the status of a but we, out of reluctance to introduce new names, continue using the expression "x" for it, even though in earlier sections we tried to reserve the metanames x, y, z, . . . (as opposed to a, b, c, . . .) for variables rather than constants. For simplicity, here we assume that every number is a code of some n-ary GHPM; alternatively, M ′ i can be defined so that it does nothing if any of its relevant inputs is not the code of some n-ary GHPM. The fact that we represent complexity bounds as explicit polynomial functions rather than polynomial tree-terms or even graph-terms is relevant here. Here, unlike the earlier followed practice, for safety, we are reluctant to use the names z and s for those constants.

Original Paper

Loading high-quality paper...

Comments & Academic Discussion

Loading comments...

Leave a Comment