Statistiques
| Révision :

root / CSL16 / bc-convergence.tex @ 57

Historique | Voir | Annoter | Télécharger (14,05 ko)

1

    
2
\section{Convergence of Bellantoni-Cook programs}
3

    
4
\anupam{In this section, use whatever form of the deduction theorem is necessary and reverse engineer precise statement later.}
5

    
6

    
7
\subsection{Bellantoni-Cook programs}
8
%We first recall the notion of safe recursion on notation from BC. TODO
9
We recall the Bellantoni-Cook  algebra BC of programs defined by safe recursion on notation. These will be employed for proving both the completeness   (all polynomial time functions are provably total) and the soundness result (all provably total functions are polynomial time) of our system.
10

    
11
\anupam{Do we need simultaneous PRN? cf.\ Bellantoni's thesis.}
12

    
13
\todo{reformulate below for binary words, not natural numbers?}
14

    
15
\begin{definition}
16
	[BC functions]
17
	BC is the set of functions over $\Word$ generated by the following initial functions and closure schemes.
18
	
19
%	\paragraph{Initial functions}
20
	There are the following initial functions:
21
	\begin{enumerate}
22
		\item The constant function $\epsilon$ which takes no arguments and outputs $\epsilon \in \Word$.
23
		\item The projection functions $\pi^{m,n}_k ( x_1 , \dots , x_m ; x_{m+1} , \dots, x_{m+n} )  := x_k$ for $n,m \in \Word$ and $1 \leq k \leq m+n$.
24
		\item The successor functions $\succ_i ( ; x) := xi$ for $i = 0,1$.
25
		\item The predecessor function $\pred (; x) := \begin{cases}
26
		\epsilon &  \mbox{ if }  x = \epsilon \\
27
		x' &  \mbox{ if }  x = x'i
28
		\end{cases}$.
29
		\item The conditional function $\cond (;x,y,z) := \begin{cases}
30
		y & \mbox{ if } x=x' 0 \\
31
		z & \text{otherwise}
32
		\end{cases}$.
33
	\end{enumerate}
34
	
35
	There are the following closure properties.
36
	\begin{enumerate}
37
	\setcounter{enumi}{5}
38
	\item Predicative recursion on notation (PRN). If $g, h_0, h_1 $ are in BC then so is the function $f$ defined by,
39
	\[
40
	\begin{array}{rcl}
41
	f(0, \vec v ; \vec x) & := & g(\vec v ; \vec x) \\
42
	f (\succ_i u , \vec v ; \vec x ) & := & h_i ( u , \vec v ; \vec x , f (u , \vec v ; \vec x) )
43
	\end{array}
44
	\]
45
	for $i = 0,1$, so long as the expressions are well-formed (i.e.\ in number/sort of arguments).
46
	\item Safe composition. If $g, \vec h, \vec h'$ are in BC then so is $f$ defined by,
47
	\[
48
	f (\vec u ; \vec x) \quad := \quad g ( \vec h(\vec u ; ) ; \vec h' (\vec u ; \vec x) )
49
	\]
50
	so long as the expression is well-formed.
51
	\end{enumerate}
52
	\end{definition}
53
	
54
%	\begin{definition}        %% former definition of BC over integers
55
%	[BC functions]
56
%	BC is the set of functions generated by the following initial functions and closure schemes.
57
%	
58
%%	\paragraph{Initial functions}
59
%	There are the following initial functions:
60
%	\begin{enumerate}
61
%		\item The constant function $0$ which takes no arguments and outputs $0 \in \Nat$.
62
%		\item The projection functions $\pi^{m,n}_k ( x_1 , \dots , x_m ; x_{m+1} , \dots, x_{m+n} )  := x_k$ for $n,m \in \Nat$ and $1 \leq k \leq m+n$.
63
%		\item The successor functions $\succ_i ( ; x) := xi$ for $i = 0,1$.
64
%		\item The predecessor function $\pred (; x) := \begin{cases}
65
%		0 & x = 0 \\
66
%		x' & x = x'i
67
%		\end{cases}$.
68
%		\item The conditional function $\cond (;x,y,z) := \begin{cases}
69
%		y & x \mod{2} = 0 \\
70
%		z & \text{otherwise}
71
%		\end{cases}$.
72
%	\end{enumerate}
73
%	
74
%	There are the following closure properties.
75
%	\begin{enumerate}
76
%	\setcounter{enumi}{5}
77
%	\item Predicative recursion on notation. If $g, h_0, h_1 $ are in BC then so is the function $f$ defined by,
78
%	\[
79
%	\begin{array}{rcl}
80
%	f(0, \vec v ; \vec x) & := & g(\vec v ; \vec x) \\
81
%	f (\succ_i u , \vec v ; \vec x ) & := & h_i ( u , \vec v ; \vec x , f (u , \vec v ; \vec x) )
82
%	\end{array}
83
%	\]
84
%	for $i = 0,1$, so long as the expressions are well-formed (i.e.\ in number/sort of arguments).
85
%	\item Safe composition. If $g, \vec h, \vec h'$ are in BC then so is $f$ defined by,
86
%	\[
87
%	f (\vec u ; \vec x) \quad := \quad g ( \vec h(\vec u ; ) ; \vec h' (\vec u ; \vec x) )
88
%	\]
89
%	so long as the expression is well-formed.
90
%	\end{enumerate}
91
%	\end{definition}
92

    
93

    
94

    
95
\anupam{simultaneous recursion?}
96

    
97
\subsection{Convergence in arithmetic}
98

    
99
%\begin{theorem}
100
%	[Convergence]
101
%	If $\Phi(f)$ is an equational specification corresponding to a BC-program defining $f$, then $\cax{\Sigma^N_1}{\pind} \proves  \ !\Phi(f) \limp \forall \vec{x}^{!N} . N(f(\vec x))$.
102
%\end{theorem}
103

    
104
We first want to show that the system ${\Sigma^{\word}_1}-{\pind}$ is expressive enough, that is to say that all poynomial-time functions can be represented by some equational specifications that are provably total. To do so   we consider equational specifications of BC-programs.
105
\begin{theorem}
106
	[Convergence]
107
	If $\Phi(f)$ is an equational specification corresponding to a BC-program defining $f$, then $\cax{\Sigma^{\word}_1}{\pind} \proves  \ !\Phi(f) \limp \forall \vec{x}^{!\word} . \word(f(\vec x))$.
108
\end{theorem}
109
\begin{proof}
110
%	We write function symbols in $\arith$ with arguments delimited by $;$, as for BC-programs. 
111
	We show by induction on the structure of a BC-program for $f(\vec u ; \vec x)$ that:
112
	\begin{equation}
113
	\label{eqn:prv-cvg-ih}
114
	\Phi(f) \proves \ \forall \vec{u}^{!\nat} . \forall \vec{x}^\word . \word(f(\vec u ; \vec x))
115
	\end{equation}
116
	We give some key cases in what follows.
117
	
118
	Suppose $f$ is defined by PRN as:
119
	\[
120
	\begin{array}{rcl}
121
	f(0,\vec v ; \vec x) & = & g(\vec v ; \vec x) \\
122
	f(\succ_i u , \vec v; \vec x) & = & h_i (u, \vec v ; \vec x , f(u , \vec v ; \vec x))
123
	\end{array}
124
	\]
125
	By the inductive hypothesis we already have \eqref{eqn:prv-cvg-ih} for $g,h_0,h_1$ in place of $f$, so let us suppose that $\nat(\vec v)$ and prove,
126
	\begin{equation}
127
% \forall u^{!\nat} .  (\nat(\vec x) \limp \nat(f(u , \vec v ; \vec x)  )
128
!\nat (u) , !\nat (\vec v) , \nat (\vec x) \seqar \nat ( f(u, \vec v ; \vec x) )
129
	\end{equation}
130
	by $\cax{\Sigma^N_1}{\pind}$ on $u$. After this the result will follow by $\forall$-introduction for $u, \vec v , \vec x$.
131
	
132
	In the base case we have the following proof,
133
	\[
134
%	\vlderivation{
135
%	\vlin{\rigrul{\limp}}{}{ \seqar \nat (\vec x) \limp \nat (f(\epsilon , \vec v ; \vec x )) }{
136
%		\vliq{\beta}{}{ \nat (\vec x) \seqar \nat ( f( \epsilon , \vec v ; \vec x) ) }{
137
%			\vliq{\alpha}{}{ \nat (\vec x) \seqar \nat ( g (\vec v ; \vec x) ) }{
138
%				\vltr{IH}{\seqar \forall v^{!\nat} . \forall x^\nat . \nat( g(\vec v ; \vec x) ) }{\vlhy{\quad}}{\vlhy{}}{\vlhy{\quad}}
139
%				}
140
%			}
141
%		}		
142
%		}
143
\vlderivation{
144
	\vliq{\beta}{}{!\nat(\vec v) , \nat (\vec x) \seqar \nat(f (\epsilon , \vec v ; \vec x)) }{
145
		\vliq{\alpha}{}{!\nat (\vec v) , \nat (\vec x) \seqar \nat (g (\vec v ; \vec x) ) }{
146
			\vltr{\IH}{\seqar \forall \vec v^{!\nat} . \forall \vec x^\nat . \nat (g (\vec v ; \vec x)) }{\vlhy{\quad}}{\vlhy{}}{\vlhy{\quad}}
147
			}
148
		}
149
	}
150
\]
151
where $\alpha$ is,
152
\[
153
\vlderivation{
154
%	\vliin{\cut}{}{ \nat (\vec x) \seqar \nat ( g (\vec v ; \vec x)) }{
155
%		\vlin{\rigrul{!}}{}{\seqar !\nat (v)}{
156
%			\vlin{assump}{}{\seqar \nat (\vec v)}{\vlhy{}}
157
%			}
158
%		}{
159
		\vliin{\cut}{}{ !\nat (\vec v ) , \nat (\vec x) \seqar \nat (g (\vec v ; \vec x )) }{
160
			\vlhy{\seqar \forall \vec v^{!\nat} . \forall \vec x^\nat . \nat (g (\vec v ; \vec x)) }
161
			}{
162
			\vliq{\lefrul{\forall}}{  }{ !\nat (\vec v) , \nat (\vec x) , \forall \vec v^{!\nat} . \forall \vec x^\nat \nat (g(\vec v ; \vec x )) \seqar \nat (g(\vec v ; \vec x )) }{
163
				\vlin{\id}{}{\nat (g(\vec v ; \vec x )) \seqar \nat (g(\vec v ; \vec x ))}{\vlhy{}}
164
				}
165
			}
166
%		}
167
	}
168
\]
169
and $\beta$ is:
170
\[
171
\vlderivation{
172
	\vliin{\cut}{}{!\nat (\vec v) , \nat (\vec x) \seqar \nat ( f ( \epsilon , \vec v ; \vec x ) ) }{
173
		\vlhy{!\nat (\vec v) , \nat (\vec x) \seqar \nat (g (\vec v ; \vec x) ) }
174
		}{
175
		\vliin{\cut}{}{ \nat (g (\vec v ; \vec x) ) \seqar \nat (f (\epsilon, \vec v ; \vec x) ) }{
176
			\vlin{\Phi}{}{ \seqar f(\epsilon , \vec v ; \vec x) = g(\vec v ; \vec x) }{\vlhy{}}
177
			}{
178
			\vlin{=}{}{\nat ( g(\vec v ; \vec x) ) , f(\epsilon , \vec v ; \vec x) = g(\vec v ; \vec x)  \seqar \nat (f (\epsilon, \vec v ; \vec x) ) }{\vlhy{}}
179
			}
180
		}
181
	}
182
\]
183

    
184
For the inductive step, we suppose that $\nat (u)$ and the proof is as follows,
185
\[
186
%\vlderivation{
187
%	\vlin{\rigrul{\limp}}{}{ \nat(\vec x) \limp \nat ( f(u, \vec v ; \vec x) )  \seqar \nat (\vec x) \limp \nat( f(\succ_i u , \vec v ; \vec x) ) }{
188
%	\vliq{\gamma}{}{\nat(\vec x), \nat(\vec x) \limp \nat ( f(u, \vec v ; \vec x) )  \seqar \nat( f(\succ_i u , \vec v ; \vec x) )   }{
189
%		\vliin{\lefrul{\limp}}{}{\nat(\vec x), \nat(\vec x), \nat(\vec x) \limp \nat ( f(u, \vec v ; \vec x) )  \seqar \nat( f(\succ_i u , \vec v ; \vec x) )    }{
190
%			\vlin{\id}{}{\nat(\vec x) \seqar \nat (\vec x) }{\vlhy{}}
191
%			}{
192
%			\vliq{\beta}{}{  \nat (\vec x) , \nat (f(u , \vec v ; \vec x) ) \seqar \nat ( f(\succ_i u , \vec v ; \vec x) ) }{
193
%				\vliq{\alpha}{}{ \nat (\vec x) , \nat (f(u , \vec v ; \vec x) ) \seqar \nat ( h_i( u , \vec v ; \vec x , f( u, \vec v ; \vec x )) ) }{
194
%					\vltr{IH}{ \seqar \forall  u^{!\nat}, \vec v^{!\nat} . \forall \vec x^\nat , y^\nat . \nat( h_i (u, \vec v ; \vec x, y) ) }{\vlhy{\quad}}{\vlhy{}}{\vlhy{\quad}}
195
%					}
196
%				}
197
%			}
198
%		}
199
%	}
200
%	}
201
\vlderivation{
202
	\vliq{\beta}{}{ !\nat (u) , !\nat (\vec v)  , \nat (\vec x) , \nat (f ( u , \vec v ; \vec x ) ) \seqar \nat (f (\succ_i u , \vec{v} ; \vec x ) )  }{
203
		\vliq{\alpha}{}{  !\nat (u) , !\nat (\vec v)  , \nat (\vec x) , \nat (f ( u , \vec v ; \vec x ) ) \seqar \nat ( h_i ( u , \vec v ; \vec x , f( u , \vec v ; \vec x ) ) )   }{
204
			\vltr{\IH}{ \seqar \forall u^{!\nat} , \vec v^{!\nat} . \forall \vec x^\nat , y^\nat  .  \nat ( h_i ( u, \vec v ; \vec x, y ) ) }{ \vlhy{\quad} }{\vlhy{}}{\vlhy{\quad}}
205
		}
206
	}
207
}
208
\]
209
where the steps indicated $\alpha$ and $\beta$ are analogous to those for the base case.
210
%, and $\gamma$ is an instance of the general scheme:
211
%\begin{equation}
212
%\label{eqn:nat-cntr-left-derivation}
213
%\vlderivation{
214
%	\vliin{\cut}{}{ \nat (t) , \Gamma \seqar \Delta }{
215
%		\vlin{\natcntr}{}{ \nat (t) \seqar \nat (t) \land \nat (t) }{\vlhy{}}
216
%		}{
217
%		\vlin{\lefrul{\land}}{}{\nat (t)  \land \nat (t) , \Gamma \seqar \Delta}{ \vlhy{\nat (t)  ,\nat (t) , \Gamma \seqar \Delta} }
218
%		}
219
%	}
220
%\end{equation}
221

    
222
%
223
%For the inductive step, we need to show that,
224
%\[
225
%\forall x^{!N} . (( N(\vec y) \limp N( f(x, \vec x ; \vec y) ) ) \limp N(\vec y) \limp N(f(\succ_i x , \vec x ; \vec y) )   )
226
%\]
227
%so let us suppose that $N(x)$ and we give the following proof:
228
%\[
229
%\vlderivation{
230
%	\vlin{N\cntr}{}{N(y) \limp ( N(y ) \limp N(f( x , \vec x ; \vec y ) ) ) \limp N(f (\succ_i x , \vec x ; \vec y)  ) }{
231
%		\vliin{}{}{N(y) \limp N(y) \limp ( N(y ) \limp N(f( x , \vec x ; \vec y ) ) ) \limp N(f (\succ_i x , \vec x ; \vec y)  ) }{
232
%			\vliin{}{}{ N(y) \limp N(y) \limp ( N(y) \limp N( f(x, \vec x ; \vec y) ) ) \limp N( h_i (x , \vec x ; \vec y , f(x , \vec x ; \vec y) ) ) }{
233
%				\vltr{MLL}{( N(\vec y) \limp (N (\vec y) \limp N(f(x, \vec x ; \vec y) )) \limp N(f(x, \vec x ; \vec y)) }{\vlhy{\quad }}{\vlhy{\ }}{\vlhy{\quad }}
234
%			}{
235
%			\vlhy{2}
236
%		}
237
%	}{
238
%	\vlhy{3}
239
%}
240
%}
241
%}
242
%\]
243
%TOFINISH
244

    
245
Suppose $f$ is defined by safe composition as follows:
246
\[
247
f( \vec u ; \vec x )
248
\quad = \quad
249
h( \vec g (\vec u ; )  ; \vec g' ( \vec u ; \vec x ) )
250
\]
251

    
252
By the inductive hypothesis we already have \eqref{eqn:prv-cvg-ih} for $h$ and each $g_i$ and $g_j'$ in place of $f$. We construct the required proof as follows:
253
\[
254
\vlderivation{
255
	\vliq{\rigrul{\forall}}{}{ \seqar \forall\vec u^{!\nat} . \forall \vec x^\nat . \nat( f(\vec u ; \vec x ) ) }{
256
		\vliq{\beta}{}{ !\nat (\vec u) , \nat (\vec x) \seqar \nat ( f( \vec u ; \vec x ) ) }{
257
			\vliq{\cntr}{}{  !\nat (\vec u) , \nat (\vec x) \seqar \nat ( h( \vec g(\vec u ;) ; \vec g' ( \vec u ; \vec x )  ) )  }{
258
				\vliiiq{\cut}{}{!\nat (\vec u) , \dots ,  !\nat (\vec u) , \nat (\vec x) , \dots , \nat (\vec x) \seqar \nat ( h( \vec g(\vec u ;) ; \vec g' ( \vec u ; \vec x )  ) )   }{
259
					\vlhy{
260
						\left\{  
261
						\vlderivation{
262
							\vlin{\rigrul{!}}{}{ !\nat (\vec u) \seqar !\nat ( g_i (\vec u ;) ) }{
263
								\vliq{\alpha}{}{ !\nat (\vec u) \seqar \nat ( g_i (\vec u ;) }{
264
									\vltr{\IH}{ \forall \vec u^{!\nat} . \nat (g_i (\vec u ;) ) }{\vlhy{\quad}}{\vlhy{}}{\vlhy{\quad}}
265
									}
266
								}
267
							}
268
						\right\}_{i \leq |\vec g| }
269
						}
270
					}{
271
					\vlhy{
272
						\left\{
273
						\vlderivation{
274
							\vliq{\alpha}{}{ !\nat ( \vec u )  , \nat (\vec x) \seqar \nat  ( g_j' ( \vec u ; \vec x ) ) }{
275
								\vltr{\IH}{ \seqar \forall \vec u^{!\nat}. \forall \vec x^\nat . \nat ( g_j' (\vec u ; \vec x) ) }{\vlhy{\quad}}{\vlhy{}}{\vlhy{\quad}}
276
								}
277
							}
278
						\right\}_{j \leq |\vec g'|}
279
						}
280
					}{
281
					\vliq{\alpha}{}{ !\nat ( \vec g (\vec u ;) ) , \nat ( \vec g ' ( \vec u ; \vec x ) ) \seqar \nat ( h( \vec g(\vec u ;) ; \vec g' ( \vec u ; \vec x )  )  ) ) }{
282
						\vltr{\IH}{ \seqar \forall \vec v^{!\nat} . \forall \vec y^\nat . \nat ( h( \vec v ; \vec y ) ) }{\vlhy{\quad}}{\vlhy{}}{\vlhy{\quad}}
283
						}
284
					}
285
				}
286
			}
287
		}
288
	}
289
\]
290
where $\alpha$ and $\beta$ are similar to before.
291

    
292
\todo{reformat a bit}
293

    
294
It remains to check the initial functions. 
295

    
296
Consider the conditional function, defined equationally as:
297
\[
298
\begin{array}{rcl}
299
C (; \epsilon, y_\epsilon , y_0, y_1  ) & = & y_\epsilon \\
300
C(; \succ_0 x , y_\epsilon , y_0, y_1) & = & y_0 \\
301
C(; \succ_1 x , y_\epsilon , y_0, y_1) & = & y_1 
302
\end{array}
303
\]
304
Let $\vec y = ( y_\epsilon , y_0, y_1 )$ and construct the required proof as follows:
305
\[
306
\vlderivation{
307
\vliq{}{}{ \nat (x) , \nat (\vec y) \seqar \nat ( C(; x ,\vec y) )}{
308
\vliin{2\cdot \laor}{}{ x = \epsilon \laor \exists z^\nat . x = \succ_0 z \laor \exists z^\nat x = \succ_1 z , \nat (\vec y) \seqar \nat ( C(;x \vec y) ) }{
309
\vliq{}{}{ x = \epsilon , \nat (\vec y) \seqar \nat ( C(; x , \vec y) ) }{
310
\vliq{}{}{ \nat (\vec y) \seqar \nat ( C( ; \epsilon , \vec y ) ) }{
311
\vlin{\wk}{}{ \nat (\vec y) \seqar \nat (y_\epsilon) }{ 
312
\vlin{\id}{}{\nat (y_\epsilon) \seqar \nat ( y_\epsilon )}{\vlhy{}}
313
}
314
}
315
}
316
}{
317
\vlhy{
318
\left\{ 
319
\vlderivation{
320
\vlin{\lefrul{\exists}}{}{ \exists z^\nat . x = \succ_i z , \nat (\vec y) \seqar \nat ( C(;x , \vec y) ) }{
321
\vliq{}{}{ x = \succ_i a , \nat (\vec y ) \seqar \nat (C(; x ,\vec y)) }{
322
\vliq{}{}{ \nat (\vec y) \seqar \nat ( C(; \succ_i a , \vec y ) ) }{
323
\vlin{\wk}{}{ \nat (\vec y) \seqar \nat (y_i) }{
324
\vlin{\id}{}{\nat (y_i) \seqar \nat (y_i)}{\vlhy{}}
325
}
326
}
327
}
328
}
329
}
330
\right\}_{i = 0,1}
331
}
332
}
333
}
334
}
335
\]
336
whence the result follows by $\forall$-introduction.
337
\todo{reformat a bit}
338

    
339
Other initial functions are far simpler.
340

    
341
\end{proof}
342

    
343

    
344

    
345

    
346

    
347

    
348

    
349

    
350

    
351

    
352

    
353

    
354

    
355

    
356

    
357

    
358

    
359

    
360

    
361

    
362

    
363

    
364

    
365

    
366

    
367

    
368

    
369

    
370

    
371

    
372

    
373

    
374

    
375

    
376

    
377

    
378

    
379

    
380

    
381

    
382

    
383