Polynomial Analogue of Gandy’s Fixed Point Theorem

: The paper suggests a general method for proving the fact whether a certain set is p-computable or not. The method is based on a polynomial analogue of the classical Gandy’s ﬁxed point theorem. Classical Gandy’s theorem deals with the extension of a predicate through a special operator Γ Ω ∗ Φ ( x ) and states that the smallest ﬁxed point of this operator is a Σ -set. Our work uses a new type of operator which extends predicates so that the smallest ﬁxed point remains a p-computable set. Moreover, if in the classical Gandy’s ﬁxed point theorem, the special Σ -formula Φ ( x ) is used in the construction of the operator, then a new operator uses special generating families of formulas instead of a single formula. This work opens up broad prospects for the application of the polynomial analogue of Gandy’s theorem in the construction of new types of terms and formulas, in the construction of new data types and programs of polynomial computational complexity in Turing complete languages.


Introduction
In both mathematics and programming, we are increasingly confronted with inductively given constructs. These constructs can be, for example, new types of terms and formulas in logic or programs and new data types in high-level programming languages that are inductively defined using basic tools. All these inductively generated sets can be viewed as the smallest fixed points of a suitable operator. Classical Gandy's theorem [1,2] allows us to inductively define some abstract set through the special operator Γ Ω * Φ(x) [1] where the smallest fixed point will be a Σ-set. The Σ-set is most often not a computable set and, moreover, not a p-computable set. Therefore, the question arises of how to modify Gandy's theorem so that the smallest fixed point be a computable or a p-computable set. In this paper, we just talk about the construction of a ∆ p 0 -operator with the smallest fixed point being a p-computable set, which allows us to consider many inductive formulas definable constructions as some polynomially computable set.

P-Computability
Let Σ be a finite alphabet and A, B ⊆ Σ * where Σ * is the set of finite words over the alphabet Σ. We say that a function f : A → B is p-computable [3][4][5] if there exists a one-tape/multi-tapes deterministic Turing machine T over the alphabet Σ and numbers C, p ∈ N such that for all a from A the value of the function f (a) is computed on T in at most C · |a| p steps, where |a| ≥ 1. The set A is called p-computable if its characteristic function χ A : Σ * → {0, 1} is p-computable. The class P of problems which can be solved in polynomial time will often be denoted by ∆ p 0 (accepted notation for the polynomial hierarchy). Therefore, the notation ∆ p 0 -function for a p-computable function and ∆ p 0 -set for a p-computable set will also be used. A partial function f : A → B is called a partial p-computable function, if there exists a set D ⊆ A such that f : D → B is a p-computable function (the Turing machine which represents f computes f (a) and stops at the final state q 0 ) and f (a) is undefined (notation f (a) ↑ p or simple ↑ p ) if a ∈ A\D, while the Turing machine on the element a ∈ A\D stops at the final state q 1 and number of steps does not exceed C * |a| p steps. As we can see, the partial p-computable function is a p-computable function, but sometimes it is convenient to assume that the value of a p-computable function is undefined. We will also denote partial p-computable functions as ∆ p 0 -functions.

Word Splitting
Now let Σ 0 be some finite alphabet and Σ = Σ 0 ∪ {<, >} ∪ {, } is a new alphabet obtained by adding new symbols (brackets and comma) to Σ 0 . Word splitting is the following partial function R : Σ * → (Σ ∪ {#}) * such that: (2) w i starts with a left bracket and the number of left brackets in the word is equal to the number of right brackets, while for any initial subword α i such that w i = α i β i it is not implemented, where the word w i can be represented as some concatenation of the words α i , β i ∈ Σ * and |α i | ≥ 1.

Proposition 1.
The word splitting is unique.
Proof. Prove by contradiction. Let there be two different splittings R(w) = w 1 # . . . #w n and R(w) = l 1 # . . . #l k such that w =< w 1 , . . . , w n > and w =< l 1 , . . . , l k >. Then, by definition, either w 1 , l 1 ∈ Σ * 0 , or w 1 and l 1 start with a left bracket and the number of right and left brackets for each word is the same. In the first case, w 1 and l 1 are the same. In the second case, w 1 is the subword of l 1 or l 1 is the subword of w 1 . Then, by definition, no proper subword starting with a left bracket can have an equal number of right and left brackets. Equality of words was also obtained. Further, in a similar way, we show that the remaining w i = l i and at the same time n = k.
Proof. Consider a Turing machine T with two semi-tapes (hereafter called tapes) over the alphabet Σ ∪ {1, B, #} where B is an empty symbol: (1) The 1st tape: we will store the word w.
(2) The 2nd tape: we will store the difference between the number of left and right brackets of the word w. Algorithm of the multi-tapes machine: (1) If the first symbol on the first tape is not a left bracket, then T stops the work in the final state q 1 . Otherwise, T replaces it on B symbol and goes on to the next steps.
(2) If the second symbol in the word w is from Σ 0 , then T reads the word w until it meets a symbol, not from Σ 0 . If it is not a comma or a right bracket then T stops the work in state q 1 .
(3) If the second symbol is not from Σ 0 and is not a left bracket, then T stops the work in the state q 1 . (4) When T reads the left bracket of the word w, then T adds 1 on the second tape and shifts the head of the second tape to the right and when T reads the right bracket of the word w, then T replaces symbol 1 with B of the second tape and shifts the head of the second tape to the left. (5) If there are no more symbols 1 on the second tape when T reads the right bracket from the first tape, then the machine replaces the right bracket with B on the first tape. If there are no other symbols from Σ after this right bracket, then the machine stops work in the final state q 0 , otherwise, in the final state q 1 . (6) If T meets a comma on the first tape and there are no symbols 1 on the second tape, then T replaces this comma with # symbol.

Computational complexity R(w):
(1) T reads the word w on the first tape periodically replacing the comma or brackets with symbol #. The number of such steps does not exceed |w|.
(2) On the second tape T writes or erases symbols 1. The number of such additions and removals does not exceed |w|. (3) Steps from (1) and (2) taken simultaneously. It turns out that the computational complexity t(R(w)) ≤ |w|.
Inductively define the notion rank of element r(w) for w ∈ Σ * :

Generating Formulas and Families. False Element
Let M be a model of signature σ = {c 1 , . . . , c r , f 1 , . . . , P (1) n } with the basic set M ⊆ Σ * 0 , where c l is constant symbols (l ∈ [1, . . . , r]), f i is functional symbols (i ∈ [1, . . . , s]), R j is predicate symbols (j ∈ [1, . . . , t]), P k is unary predicate symbols, k ∈ [1, . . . , n]. P(Σ * ) is the set of all subsets of the set Σ * . F P + 1 , . . . , F P + n is families(generating families) positive quantifier-free formulas (hereafter called generating formulas) of signature σ which can include unary predicates P 1 ,. . . ,P n with inputs of the form P j (x i ). Moreover, we require that for any free variable x i in the formula ϕ m ∈ F P + k there should be no occurrences of the form P j (x i ) and P h (x i ) for each x i , where j = h. This property will be called predicate separability.
The idea is to generate new elements in the form of lists < a 1 , . . . , a n m > obtained from a 1 , . . . , a n m ∈ M such that M |= ϕ m (a 1 , . . . , a n m ) and then add this set of elements Q i to the main set of the model where: . . , a n m > | M |= ϕ m (a 1 , . . . , a n m )} If we are to extend the main set of elements M of the model M to this new set of elements Q i , then we need to redefine the functions on these new elements and redefine the truth of the predicates. It is clear that the functions on new elements will not be defined, so we will expand the basic set of elements M of the M model of signature σ with a special f alse-element to M ∪ { f alse}. Next, we define the semantic meaning of terms and formulas in the M f alse model for all elements from Σ * ∪ { f alse} and not only for M ∪ { f alse}.
Since everywhere below only positive quantifier-free formulas with a positive occurrence in the form of P i (x j ) for some P i and x j appear, then for these formulas on the model M f alse we inductively define the values of functions and the truth of predicates as well as the truth of positive quantifier-free formulas ϕ i , i ∈ I: . . , t n (a)) equal f alse if at least the value of one of the terms t j (a) equals f alse. (4) the formulas of the form f alse = t(a 1 , . . . , a n ) including f alse = f alse will be considered false. (5) the formulas of the form a = a will be considered true for a ∈ M and false otherwise. (6) the formulas of the form R i (t 1 (a), . . . , t n i (a)) will be considered false if at least one of the terms t j (a) has value f alse. (2) All predicates R i (t 1 , . . . , t n i ) remain unchanged if the values of the terms t 1 , . . . , t n i are from M and are f alse otherwise.
(3) All predicates P j (a) remain unchanged if a ∈ M and P j (a) are f alse otherwise. (4) All functions f i (a 1 , . . . , a n ) remain unchanged for a 1 , . . . , a n ∈ M and have a f alse value otherwise.
Denote the expression < M f alse , Q, P i > it is < M f alse , Q > enrichment at which the truth set of the predicate P i is extended to P M f alse i ∪ Q.

Fixed Points of Monotone Locally Finite Operators
Let M f alse be a model of signature σ and Q = ( Then we introduce the notation: M which transfers n-th sets (Q 1 , . . . , Q n ) to n-th sets (Q 1 , . . . , Q n ) according to the following f alse is built on the model M f alse of signature σ in the following way: We fix a partial order ≤ n : Let us denote projection onto the j-th coordinate by I j (Γ k ) = Q j .
,...,F P + n (X 1 , . . . , X n )). We get that w is a finite list made up of a finite number of elements from M ∪ X 1 ∪ · · · ∪ X n . Mark all the elements involved in constructing w from X j as C j for all j ∈ [1, . . . , n]. Note that all sets C j are finite and C j ⊆ X j . Therefore, narrowing our sets X i to C i we get w ∈ I j (Γ M

Formulas Families
Further, we will consider generating families of formulas of the form Let be a string of symbols above the alphabet {0, 1} length n m . Then the formula ϕ m (x 1 , . . . , x n m ) is obtained from ϕ m (x 1 , ..., x n m ) replacing all occurrences of the form P j (x i ) on i-th symbol in word . The number of free variables in this formula may be less, nevertheless we leave their number in the notation for ϕ m as before. Define a potentially generating formula as a formula ϕ m (x 1 , . . . , x k ) potentially generating an element l ∈ Σ * such that R(l) = l 1 # . . . #l k and the following holds: M f alse |= ϕ m (l 1 , . . . , l k ) for some signification . If for any l ∈ Σ * there is only one potentially generating formula in the family, then we can define a partial function γ i : Σ * → Ω * that constructs from an element l ∈ Σ * its potentially generating formula ϕ m (x 1 , . . . , x k ) if such a formula exists and is undefined otherwise γ i (l) ↑. In the next chapter we will require for functions γ i to be p-computable. (2) predicate separability, quantifier-free and positivity: each family F P + 1 , . . . , F P + n is either a finite or countable family of formulas, all formulas ϕ j ∈ F P + i are positive, quantifier-free, predicate-separable.

∆
(3) uniqueness of the generating formula: for any two formulas ϕ 1 (x 1 , . . . , x k ), ϕ 2 (x 1 , . . . , x k ) ∈ F P + i with the same number of free variables and for any signification E : P j (x i ) → {0, 1}, i ∈ [1, . . . , k], j ∈ [1, . . . , n] it is not true that there exists such significations as 1 and 2 consistent with E such that: there exists l 1 , . . . , l k from M such that M f alse |= ϕ 1 1 (l 1 , . . . , l k )&ϕ 2 2 (l 1 , . . . , l k ) (4) p-computability of element: we also require that all functions γ i should be C-(p-1)-∆ p 0functions and families F * Note that the ∆ p 0 -operator thus defined retains all the original properties: it is monotone, has a fixed point property and is locally finite, and therefore the smallest fixed point of the operator is reached in w steps.
We say that the smallest fixed point Γ w = (P 1 , . . . , P n ) will be ∆ p 0 -set if any P i is a ∆ Proof. Consider the Turing machine T over Ω alphabet consisting of five semi-tapes (hereafter called tapes): (1) the 1st tape: the formula ϕ m (x 1 , . . . , x k ) is written out.
(2) the 2nd tape: the word of length k is written out.
Let the formula ϕ m (x 1 , . . . , x k ) be written out on the first tape and the second tape should contain the word . The machine T starts to work in the extreme left position and reads the formula from the first tape. As soon as T reaches the word of the form P j (x i ), T begins to read this word and writes out in parallel symbol 1 on the fourth tape for each symbol of P j (x i ) and symbol 1 for each symbol v of P j (x i ) on the third tape, moving in parallel, the machine head on the second tape containing the word with a single delay. When all the symbols v...v (x i ) are read, the head on the second tape will observe symbol i 1 which must be substituted for the word P j (x i ). Since the head position of the first tape is recorded on the fourth tape, T starts to overwrite on the first tape the word P j (x i ) on symbols # and reduce in parallel the number of symbols 1 on the fourth tape. One as soon as there are no one-symbols left on the fourth tape, then T write the symbol i 1 to the first tape. Then T returns the heads of second, third and fourth tapes to the extreme left position and continue to sequentially find and replace the remaining occurrences of the form P j (x r ) on the first tape and replace them with symbols # and r . After all the replacements T must return the head of the first tape to the extreme left position and starts copying the formula of the first tape to the fifth tape while skipping the symbols #.
Calculate the total operating time of such a machine T: (1) The machine T works with the formula ϕ m (x 1 , . . . , x n m ) on the first tape which includes words such as P j (x i ). The length of this formula does not exceed C · |l| p−1 . In total, the number of steps does not exceed three lengths of ϕ m (x 1 , . . . , x n m ).
(2) On the second tape, the machine does not change the word , simply reads it in parallel with the symbols v from the first tape and periodically returns the head to the extreme left position. The total number of shifts to the right of the machine head of the second tape does not exceed the length of the word on the first tape. The same goes for the number of the machine head shifts to the left. Therefore, on this tape, there will be no more than 2 · C · |l| p−1 steps.
(3) On the third tape, the last monitored variable is written out. The number of the machine head shifts to the right and to the left does not exceed 2 · C · |l| p−1 on this tape. (4) For the fourth tape it is also does not exceed 2 · C · |l| p−1 . (5) To copy the final word from the first tape to the fifth and taking into account the preliminary setting of the head of the first tape to the extreme left position, it will also take no more than 2 · C · |l| p−1 .
Let ϕ m (x 1 , . . . , x k ) ∈ F P + i be potentially generative formula for an element l.
Proof. Consider a Turing machine T over alphabet Ω that also consists of three semi-tapes (hereafter called tapes): (1) the 1st tape: the formula ϕ m (x 1 , . . . , x k ) is written out, where the length of the formula does not exceed C · |l| p−1 .
(2) the second tape: the word w 2 = #R(l) = #l 1 # . . . #l k written out, where the length of the word does not exceeding |l|.
The machine starts to work with the formula of the first tape, if necessary simultaneously copying the result to the third tape. If the machine T on the first tape reads a symbol that is not v, then T copies it to the third tape. If T reads the symbol v on the first tape, then T starts the process of finding the corresponding l i for replacement. When the machine T reads the i-th symbol v successively from the first tape, T transfers the machine head of second tape to the i-th symbol # that comes before the corresponding l i . When T reads all symbols v successively from first tape, then the machine will write the corresponding l s from second tape to the third tape. By repeating this algorithm on the third tape the word ϕ m (l 1 , . . . , l k ) will eventually be written.
Calculate the total operating time of such a machine T: (1) the machine T reads a word from the first tape or just stands and waits for further reading. The number of movements to the right does not exceed C · |l| p−1 (2) on the second tape, the machine head moves both to the right and to the left, but again only reading. Therefore, the number of steps does not exceed C · |l| p−1 × 2 · |l| ≤ 2 · C · |l| p .
(3) the third tape: the number of steps does not exceed C · |l| p−1 .

A Polynomial Analogue of Gandy's Theorem
Let Γ w from equality (2) be the smallest fixed point of ∆ Proof. The main idea of the proof is to show that the time for checking the truth of the formula P i (l) on M Γ w f alse does not exceed the time k · C · r(l) · |l| p , where k and C are fixed constants and r(l) is the rank of the element l and r(l) ≥ 1, i ∈ [1, . . . , n]. Since the rank r(l) < |l|, we get that for any l the complexity does not exceed k · C · |l| p+1 .
Without loss of generality, we show this for P 1 (l), assuming in the induction step that this estimate is true for all P i (l j ), where r(l j ) < r(l) and i ∈ [1, . . . , n]. Using the induction by complexity r(l) we show that t(P 1 (l)) ≤ 25 · C · r(l) · |l| p , where the constant C is the maximum for all constants that participate in the splitting function R(l), in functions γ i and in the algorithm for checking the truth of the formula ϕ m (l 1 , . . . , l n m ).
Induction base r(l) = 1: Case 1: γ i (l) ↑ p , then the formula P 1 (l) is false. Case2: γ i (l) = ϕ m (x 1 , . . . , x k ), then R(l) = l 1 # . . . #l k and all elements of l i (where i ∈ [1, . . . , k]) are either elements of the base set M or elements from Σ * for which R(l i ) ↑ p . Given all P i (l j ) are false on M Γ w f alse , we can create ϕ m (x 1 , . . . , x k ) from the potentially generating formula ϕ m (x 1 , . . . , x k ) for element l, where = 0 . . . 0 and | | = k. We get: The time required to construct a potentially generating formula ϕ m (x 1 , . . . , x k ) using l does not exceed C · |l| p−1 . Next, we build ϕ m (x 1 , . . . , x k ) and ϕ m (l 1 , . . . , l k ). The time required for this does not exceed 12 * C * |l| p−1 and 4 * C * |l| p (Lemmas 1 and 2). Verifying the truth of the last formula for M f alse does not exceed C * |l| p . Summing everything up, we get that the verification time does not exceed 25 * C * r(l) * |l| p .
The induction step: let our assumption be true for r(l) = s. We will show this for s + 1: Case 1: γ i (l) ↑ p , then the formula P 1 (l) is false. We get it in time: where string of symbols i such that i = 1 if formula P j (l i ) is true on M Γ w f alse and 0 otherwise.
Let's calculate the time spent on all transitions: (1) constructing a potentially generating formula ϕ m (x 1 , . . . , x k ) using l in time C · |l| p−1 (2) determining the truth of all predicates P i 1 (l 1 ), . . . , P i k (l k ) which are included in the formula. By the induction hypothesis, we obtain: ∑ k j=1 t(P i j (l j )) ≤ ∑ k j=1 25 · C · r(l j ) · |l j | p ≤ 25 · C · (r(l) − 1) · |l| p . (3) further, we fix the signification : P i j (x i ) → {0, 1} considering whether the predicate P i j (l i ) is true or false, if the formula does not include any of the predicates P j i for the variable x i , then we determine the truth for P 1 (x i ) by default. (4) By the formula ϕ m (x 1 , . . . , x k ) and by the signification we construct ϕ m (x 1 , . . . , x k ). The time required for this does not exceed 12 · |l| p−1 ≤ 12 · |l| p . (5) By the formula ϕ m (x 1 , . . . , x k ) and l we construct ϕ m (l 1 , . . . , l k ). The time required for this does not exceed 4 · C · |l| p .
If we sum up all the time of calculations, then we get the following: We have shown that for any element l of rank r(l) in time 25 · C · r(l) · |l| p we determine the fact whether it belongs to the predicate P 1 . Since r(l) is always less than |l|, we can write the following: t(P 1 (l)) ≤ 25 · C · r(l) · |l| p ≤ 25 · C · |l| p+1 .

Corollaries and Applications
For the ∆ p 0 -model M as an application of the polynomial analogue of Gandy's theorem, we present several corollaries. Some of these corollaries have already been proven earlier by other authors using other methods, some are presented for the first time.
Let the model M have a one-place predicate U that selects the elements of the main set M and a distinguished one-place predicate List = ∅ (a predicate that will select list elements), then we will show how easy it is to prove the following statement on hereditarily finite lists HW(M) which was already proven earlier in [8] but using a different technique:

Proof.
A countable generating family of formulas F List + is as follows: , n ∈ N This family of formulas is predicate-separable, all formulas are positive quantifier-free, and the predicate List is included in formulas positively. We can easily see that the operator Let the signature σ have the form: }. Consider the model N with the basic set of elements N and signatures σ = {1, s (1) }. The interpretation of the constant 1 will be 1 and s-the standard successor function. Further, an entry of the form n + 1 will mean a term of the form n-fold application of the function s to 1.
Proof. This is where the approach gets more interesting. We need to simultaneously generate both conditional terms and formulas containing these conditional terms. Therefore, we construct two generating families: F TCond + , F FCond + . In addition to generating formulas for standard terms in F TCond + , we add countably many generating formulas for conditional terms: &FCond(x 2i+1 ))&TCond(x 2k+2 ), k ∈ N. The family F FCond + is defined by the same generating formulas as the family F D0 + , with the only difference that the predicates Term must be replaced with TCond everywhere.

Conclusions
This work is a starting point for building a methodology for developing fast and reliable software. In this work, we study sufficient conditions for the ∆ p 0 -operator under which the smallest fixed point remains a ∆ p 0 -set. This allows us to create new elements and data types. Moreover, there are polynomial algorithms for checking the fact whether a certain element belongs to a given data type or not. The question of programming methodology is also of interest: which constructs can be used and which not for creating programs, if we want our programs to be polynomially computable. With the help of the main theorem of our paper and the theorems from the works [8][9][10][11][12][13][14] it is already possible to develop logical programming languages, with programs being of polynomial computational complexity.