Statistiques
| Révision :

root / CSL16 / bc-convergence.tex @ 68

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

    
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
\subsection{Convergence in arithmetic}
101

    
102
%\begin{theorem}
103
%	[Convergence]
104
%	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))$.
105
%\end{theorem}
106

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

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

    
225
%
226
%For the inductive step, we need to show that,
227
%\[
228
%\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) )   )
229
%\]
230
%so let us suppose that $N(x)$ and we give the following proof:
231
%\[
232
%\vlderivation{
233
%	\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)  ) }{
234
%		\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)  ) }{
235
%			\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) ) ) }{
236
%				\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 }}
237
%			}{
238
%			\vlhy{2}
239
%		}
240
%	}{
241
%	\vlhy{3}
242
%}
243
%}
244
%}
245
%\]
246
%TOFINISH
247

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

    
255
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:
256
\[
257
\vlderivation{
258
	\vliq{\rigrul{\forall}}{}{ \seqar \forall\vec u^{!\nat} . \forall \vec x^\nat . \nat( f(\vec u ; \vec x ) ) }{
259
		\vliq{\beta}{}{ !\nat (\vec u) , \nat (\vec x) \seqar \nat ( f( \vec u ; \vec x ) ) }{
260
			\vliq{\cntr}{}{  !\nat (\vec u) , \nat (\vec x) \seqar \nat ( h( \vec g(\vec u ;) ; \vec g' ( \vec u ; \vec x )  ) )  }{
261
				\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 )  ) )   }{
262
					\vlhy{
263
						\left\{  
264
						\vlderivation{
265
							\vlin{\rigrul{!}}{}{ !\nat (\vec u) \seqar !\nat ( g_i (\vec u ;) ) }{
266
								\vliq{\alpha}{}{ !\nat (\vec u) \seqar \nat ( g_i (\vec u ;) }{
267
									\vltr{\IH}{ \forall \vec u^{!\nat} . \nat (g_i (\vec u ;) ) }{\vlhy{\quad}}{\vlhy{}}{\vlhy{\quad}}
268
									}
269
								}
270
							}
271
						\right\}_{i \leq |\vec g| }
272
						}
273
					}{
274
					\vlhy{
275
						\left\{
276
						\vlderivation{
277
							\vliq{\alpha}{}{ !\nat ( \vec u )  , \nat (\vec x) \seqar \nat  ( g_j' ( \vec u ; \vec x ) ) }{
278
								\vltr{\IH}{ \seqar \forall \vec u^{!\nat}. \forall \vec x^\nat . \nat ( g_j' (\vec u ; \vec x) ) }{\vlhy{\quad}}{\vlhy{}}{\vlhy{\quad}}
279
								}
280
							}
281
						\right\}_{j \leq |\vec g'|}
282
						}
283
					}{
284
					\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 )  )  ) ) }{
285
						\vltr{\IH}{ \seqar \forall \vec v^{!\nat} . \forall \vec y^\nat . \nat ( h( \vec v ; \vec y ) ) }{\vlhy{\quad}}{\vlhy{}}{\vlhy{\quad}}
286
						}
287
					}
288
				}
289
			}
290
		}
291
	}
292
\]
293
where $\alpha$ and $\beta$ are similar to before.
294

    
295
\todo{reformat a bit}
296

    
297
It remains to check the initial functions. 
298

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

    
342
Other initial functions are far simpler.
343

    
344
\end{proof}
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

    
384

    
385

    
386