Statistiques
| Révision :

root / CSL16 / bc-convergence.tex @ 70

Historique | Voir | Annoter | Télécharger (14,43 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

    
8

    
9

    
10
\subsection{Bellantoni-Cook programs}
11
%We first recall the notion of safe recursion on notation from BC. TODO
12
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.
13

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

    
16
\todo{reformulate below for binary words, not natural numbers?}
17

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

    
96

    
97

    
98
\anupam{simultaneous recursion?}
99

    
100
\anupam{also identity, hereditarily safe, expressions, etc.}
101

    
102

    
103
\begin{proposition}
104
[Properties of BC programs]
105
\label{prop:bc-properties}
106
We have the following properties:
107
\begin{enumerate}
108
\item Hereditarily safe expressions over BC programs are BC definable.
109
\item Can pass safe input to normal input.
110
\end{enumerate}
111

    
112
\todo{finish this, add properties as required.}
113
\end{proposition}
114

    
115
\subsection{Convergence in arithmetic}
116

    
117
%\begin{theorem}
118
%	[Convergence]
119
%	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))$.
120
%\end{theorem}
121

    
122
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.
123
\begin{theorem}
124
	[Convergence]
125
	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))$.
126
\end{theorem}
127
\begin{proof}
128
%	We write function symbols in $\arith$ with arguments delimited by $;$, as for BC-programs. 
129
	We show by induction on the structure of a BC-program for $f(\vec u ; \vec x)$ that:
130
	\begin{equation}
131
	\label{eqn:prv-cvg-ih}
132
	\Phi(f) \proves \ \forall \vec{u}^{!\nat} . \forall \vec{x}^\word . \word(f(\vec u ; \vec x))
133
	\end{equation}
134
	We give some key cases in what follows.
135
	
136
	Suppose $f$ is defined by PRN as:
137
	\[
138
	\begin{array}{rcl}
139
	f(0,\vec v ; \vec x) & = & g(\vec v ; \vec x) \\
140
	f(\succ_i u , \vec v; \vec x) & = & h_i (u, \vec v ; \vec x , f(u , \vec v ; \vec x))
141
	\end{array}
142
	\]
143
	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,
144
	\begin{equation}
145
% \forall u^{!\nat} .  (\nat(\vec x) \limp \nat(f(u , \vec v ; \vec x)  )
146
!\nat (u) , !\nat (\vec v) , \nat (\vec x) \seqar \nat ( f(u, \vec v ; \vec x) )
147
	\end{equation}
148
	by $\cax{\Sigma^N_1}{\pind}$ on $u$. After this the result will follow by $\forall$-introduction for $u, \vec v , \vec x$.
149
	
150
	In the base case we have the following proof,
151
	\[
152
%	\vlderivation{
153
%	\vlin{\rigrul{\limp}}{}{ \seqar \nat (\vec x) \limp \nat (f(\epsilon , \vec v ; \vec x )) }{
154
%		\vliq{\beta}{}{ \nat (\vec x) \seqar \nat ( f( \epsilon , \vec v ; \vec x) ) }{
155
%			\vliq{\alpha}{}{ \nat (\vec x) \seqar \nat ( g (\vec v ; \vec x) ) }{
156
%				\vltr{IH}{\seqar \forall v^{!\nat} . \forall x^\nat . \nat( g(\vec v ; \vec x) ) }{\vlhy{\quad}}{\vlhy{}}{\vlhy{\quad}}
157
%				}
158
%			}
159
%		}		
160
%		}
161
\vlderivation{
162
	\vliq{\beta}{}{!\nat(\vec v) , \nat (\vec x) \seqar \nat(f (\epsilon , \vec v ; \vec x)) }{
163
		\vliq{\alpha}{}{!\nat (\vec v) , \nat (\vec x) \seqar \nat (g (\vec v ; \vec x) ) }{
164
			\vltr{\IH}{\seqar \forall \vec v^{!\nat} . \forall \vec x^\nat . \nat (g (\vec v ; \vec x)) }{\vlhy{\quad}}{\vlhy{}}{\vlhy{\quad}}
165
			}
166
		}
167
	}
168
\]
169
where $\alpha$ is,
170
\[
171
\vlderivation{
172
%	\vliin{\cut}{}{ \nat (\vec x) \seqar \nat ( g (\vec v ; \vec x)) }{
173
%		\vlin{\rigrul{!}}{}{\seqar !\nat (v)}{
174
%			\vlin{assump}{}{\seqar \nat (\vec v)}{\vlhy{}}
175
%			}
176
%		}{
177
		\vliin{\cut}{}{ !\nat (\vec v ) , \nat (\vec x) \seqar \nat (g (\vec v ; \vec x )) }{
178
			\vlhy{\seqar \forall \vec v^{!\nat} . \forall \vec x^\nat . \nat (g (\vec v ; \vec x)) }
179
			}{
180
			\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 )) }{
181
				\vlin{\id}{}{\nat (g(\vec v ; \vec x )) \seqar \nat (g(\vec v ; \vec x ))}{\vlhy{}}
182
				}
183
			}
184
%		}
185
	}
186
\]
187
and $\beta$ is:
188
\[
189
\vlderivation{
190
	\vliin{\cut}{}{!\nat (\vec v) , \nat (\vec x) \seqar \nat ( f ( \epsilon , \vec v ; \vec x ) ) }{
191
		\vlhy{!\nat (\vec v) , \nat (\vec x) \seqar \nat (g (\vec v ; \vec x) ) }
192
		}{
193
		\vliin{\cut}{}{ \nat (g (\vec v ; \vec x) ) \seqar \nat (f (\epsilon, \vec v ; \vec x) ) }{
194
			\vlin{\Phi}{}{ \seqar f(\epsilon , \vec v ; \vec x) = g(\vec v ; \vec x) }{\vlhy{}}
195
			}{
196
			\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{}}
197
			}
198
		}
199
	}
200
\]
201

    
202
For the inductive step, we suppose that $\nat (u)$ and the proof is as follows,
203
\[
204
%\vlderivation{
205
%	\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) ) }{
206
%	\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) )   }{
207
%		\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) )    }{
208
%			\vlin{\id}{}{\nat(\vec x) \seqar \nat (\vec x) }{\vlhy{}}
209
%			}{
210
%			\vliq{\beta}{}{  \nat (\vec x) , \nat (f(u , \vec v ; \vec x) ) \seqar \nat ( f(\succ_i u , \vec v ; \vec x) ) }{
211
%				\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 )) ) }{
212
%					\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}}
213
%					}
214
%				}
215
%			}
216
%		}
217
%	}
218
%	}
219
\vlderivation{
220
	\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 ) )  }{
221
		\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 ) ) )   }{
222
			\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}}
223
		}
224
	}
225
}
226
\]
227
where the steps indicated $\alpha$ and $\beta$ are analogous to those for the base case.
228
%, and $\gamma$ is an instance of the general scheme:
229
%\begin{equation}
230
%\label{eqn:nat-cntr-left-derivation}
231
%\vlderivation{
232
%	\vliin{\cut}{}{ \nat (t) , \Gamma \seqar \Delta }{
233
%		\vlin{\natcntr}{}{ \nat (t) \seqar \nat (t) \land \nat (t) }{\vlhy{}}
234
%		}{
235
%		\vlin{\lefrul{\land}}{}{\nat (t)  \land \nat (t) , \Gamma \seqar \Delta}{ \vlhy{\nat (t)  ,\nat (t) , \Gamma \seqar \Delta} }
236
%		}
237
%	}
238
%\end{equation}
239

    
240
%
241
%For the inductive step, we need to show that,
242
%\[
243
%\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) )   )
244
%\]
245
%so let us suppose that $N(x)$ and we give the following proof:
246
%\[
247
%\vlderivation{
248
%	\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)  ) }{
249
%		\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)  ) }{
250
%			\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) ) ) }{
251
%				\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 }}
252
%			}{
253
%			\vlhy{2}
254
%		}
255
%	}{
256
%	\vlhy{3}
257
%}
258
%}
259
%}
260
%\]
261
%TOFINISH
262

    
263
Suppose $f$ is defined by safe composition as follows:
264
\[
265
f( \vec u ; \vec x )
266
\quad = \quad
267
h( \vec g (\vec u ; )  ; \vec g' ( \vec u ; \vec x ) )
268
\]
269

    
270
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:
271
\[
272
\vlderivation{
273
	\vliq{\rigrul{\forall}}{}{ \seqar \forall\vec u^{!\nat} . \forall \vec x^\nat . \nat( f(\vec u ; \vec x ) ) }{
274
		\vliq{\beta}{}{ !\nat (\vec u) , \nat (\vec x) \seqar \nat ( f( \vec u ; \vec x ) ) }{
275
			\vliq{\cntr}{}{  !\nat (\vec u) , \nat (\vec x) \seqar \nat ( h( \vec g(\vec u ;) ; \vec g' ( \vec u ; \vec x )  ) )  }{
276
				\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 )  ) )   }{
277
					\vlhy{
278
						\left\{  
279
						\vlderivation{
280
							\vlin{\rigrul{!}}{}{ !\nat (\vec u) \seqar !\nat ( g_i (\vec u ;) ) }{
281
								\vliq{\alpha}{}{ !\nat (\vec u) \seqar \nat ( g_i (\vec u ;) }{
282
									\vltr{\IH}{ \forall \vec u^{!\nat} . \nat (g_i (\vec u ;) ) }{\vlhy{\quad}}{\vlhy{}}{\vlhy{\quad}}
283
									}
284
								}
285
							}
286
						\right\}_{i \leq |\vec g| }
287
						}
288
					}{
289
					\vlhy{
290
						\left\{
291
						\vlderivation{
292
							\vliq{\alpha}{}{ !\nat ( \vec u )  , \nat (\vec x) \seqar \nat  ( g_j' ( \vec u ; \vec x ) ) }{
293
								\vltr{\IH}{ \seqar \forall \vec u^{!\nat}. \forall \vec x^\nat . \nat ( g_j' (\vec u ; \vec x) ) }{\vlhy{\quad}}{\vlhy{}}{\vlhy{\quad}}
294
								}
295
							}
296
						\right\}_{j \leq |\vec g'|}
297
						}
298
					}{
299
					\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 )  )  ) ) }{
300
						\vltr{\IH}{ \seqar \forall \vec v^{!\nat} . \forall \vec y^\nat . \nat ( h( \vec v ; \vec y ) ) }{\vlhy{\quad}}{\vlhy{}}{\vlhy{\quad}}
301
						}
302
					}
303
				}
304
			}
305
		}
306
	}
307
\]
308
where $\alpha$ and $\beta$ are similar to before.
309

    
310
\todo{reformat a bit}
311

    
312
It remains to check the initial functions. 
313

    
314
Consider the conditional function, defined equationally as:
315
\[
316
\begin{array}{rcl}
317
C (; \epsilon, y_\epsilon , y_0, y_1  ) & = & y_\epsilon \\
318
C(; \succ_0 x , y_\epsilon , y_0, y_1) & = & y_0 \\
319
C(; \succ_1 x , y_\epsilon , y_0, y_1) & = & y_1 
320
\end{array}
321
\]
322
Let $\vec y = ( y_\epsilon , y_0, y_1 )$ and construct the required proof as follows:
323
\[
324
\vlderivation{
325
\vliq{}{}{ \nat (x) , \nat (\vec y) \seqar \nat ( C(; x ,\vec y) )}{
326
\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) ) }{
327
\vliq{}{}{ x = \epsilon , \nat (\vec y) \seqar \nat ( C(; x , \vec y) ) }{
328
\vliq{}{}{ \nat (\vec y) \seqar \nat ( C( ; \epsilon , \vec y ) ) }{
329
\vlin{\wk}{}{ \nat (\vec y) \seqar \nat (y_\epsilon) }{ 
330
\vlin{\id}{}{\nat (y_\epsilon) \seqar \nat ( y_\epsilon )}{\vlhy{}}
331
}
332
}
333
}
334
}{
335
\vlhy{
336
\left\{ 
337
\vlderivation{
338
\vlin{\lefrul{\exists}}{}{ \exists z^\nat . x = \succ_i z , \nat (\vec y) \seqar \nat ( C(;x , \vec y) ) }{
339
\vliq{}{}{ x = \succ_i a , \nat (\vec y ) \seqar \nat (C(; x ,\vec y)) }{
340
\vliq{}{}{ \nat (\vec y) \seqar \nat ( C(; \succ_i a , \vec y ) ) }{
341
\vlin{\wk}{}{ \nat (\vec y) \seqar \nat (y_i) }{
342
\vlin{\id}{}{\nat (y_i) \seqar \nat (y_i)}{\vlhy{}}
343
}
344
}
345
}
346
}
347
}
348
\right\}_{i = 0,1}
349
}
350
}
351
}
352
}
353
\]
354
whence the result follows by $\forall$-introduction.
355
\todo{reformat a bit}
356

    
357
Other initial functions are far simpler.
358

    
359
\end{proof}
360

    
361

    
362

    
363

    
364

    
365

    
366

    
367

    
368

    
369

    
370

    
371

    
372

    
373

    
374

    
375

    
376

    
377

    
378

    
379

    
380

    
381

    
382

    
383

    
384

    
385

    
386

    
387

    
388

    
389

    
390

    
391

    
392

    
393

    
394

    
395

    
396

    
397

    
398

    
399

    
400

    
401