Statistiques
| Révision :

root / CSL16 / bc-convergence.tex @ 83

Historique | Voir | Annoter | Télécharger (13,67 ko)

1

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

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

    
6
In this section we show that $\arith$ proves the convergence of any equational specification induced by a BC program. Since BC programs can compute any polynomial-time function, we obtain a completeness result. In the next section we will show the converse, that any provably convergent function of $\arith$ is polynomial-time computable.
7

    
8
We will assume the formulation of BC programs with regular PRN, not simultaneous PRN.
9

    
10

    
11
%\subsection{Convergence in arithmetic}
12

    
13
%\begin{theorem}
14
%	[Convergence]
15
%	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))$.
16
%\end{theorem}
17

    
18
%We first want to show that the system ${\Sigma^{\word}_1}-{\pind}$ is expressive enough, that is to say that all polynomial-time functions can be represented by some equational specifications that are provably total. To do so   we consider equational specifications of BC-programs.
19
\begin{theorem}
20
%	[Convergence]
21
	If $\eqspec$ is a BC program defining a function $f$, then $\arith$ proves $\conv(f, \eqspec)$.
22
\end{theorem}
23

    
24
\anupam{Consider informalising some of these arguments under (some version of) the deduction theorem. Formal stuff can be put in an appendix. Maybe add a remark somewhere about arguing informally under deduction, taking care for non-modalised formulae.}
25

    
26
\begin{proof}
27
%	We write function symbols in $\arith$ with arguments delimited by $;$, as for BC-programs. 
28
	We appeal to Lemma~\ref{lemma:spec-norm-form} and show that $\closure{\eqspec} \cup \arith$ proves,
29
	\begin{equation}
30
	\label{eqn:prv-cvg-ih}
31
\forall \vec{u}^{!\word} . \forall \vec{x}^\word . \word(f(\vec u ; \vec x))
32
	\end{equation}
33
	We proceed by induction on the structure of a BC program for $f$.
34
%	We give some key cases in what follows.
35
	
36
	Suppose $f$ is defined by PRN as:
37
	\[
38
	\begin{array}{rcl}
39
	f(0,\vec v ; \vec x) & = & g(\vec v ; \vec x) \\
40
	f(\succ_i u , \vec v; \vec x) & = & h_i (u, \vec v ; \vec x , f(u , \vec v ; \vec x))
41
	\end{array}
42
	\]
43
	By the inductive hypothesis we already have \eqref{eqn:prv-cvg-ih} for $g,h_0,h_1$ in place of $f$. We construct the following proof:
44
	\begin{equation}
45
	\label{eqn:prn-cvg-base}
46
	\vlderivation{
47
			\vliq{\beta}{}{!\word(\vec v) , \word (\vec x) \seqar \word(f (\epsilon , \vec v ; \vec x)) }{
48
				\vliq{\alpha}{}{!\word (\vec v) , \word (\vec x) \seqar \word (g (\vec v ; \vec x) ) }{
49
					\vltr{\IH}{\seqar \forall \vec v^{!\word} . \forall \vec x^\word . \word (g (\vec v ; \vec x)) }{\vlhy{\quad}}{\vlhy{}}{\vlhy{\quad}}
50
					}
51
				}
52
			}
53
	\end{equation}
54
	where $\alpha$ is,
55
	\[
56
	\vlderivation{
57
	%	\vliin{\cut}{}{ \nat (\vec x) \seqar \nat ( g (\vec v ; \vec x)) }{
58
	%		\vlin{\rigrul{!}}{}{\seqar !\nat (v)}{
59
	%			\vlin{assump}{}{\seqar \nat (\vec v)}{\vlhy{}}
60
	%			}
61
	%		}{
62
			\vliin{\cut}{}{ !\word (\vec v ) , \word (\vec x) \seqar \word (g (\vec v ; \vec x )) }{
63
				\vlhy{\seqar \forall \vec v^{!\word} . \forall \vec x^\word . \word (g (\vec v ; \vec x)) }
64
				}{
65
				\vliq{\lefrul{\forall}}{  }{ !\word (\vec v) , \word (\vec x) , \forall \vec v^{!\word} . \forall \vec x^\word \nat (g(\vec v ; \vec x )) \seqar \word (g(\vec v ; \vec x )) }{
66
					\vlin{\id}{}{\word (g(\vec v ; \vec x )) \seqar \word (g(\vec v ; \vec x ))}{\vlhy{}}
67
					}
68
				}
69
	%		}
70
		}
71
	\]
72
	and $\beta$ is:
73
	\[
74
	\vlderivation{
75
		\vliin{\cut}{}{!\word (\vec v) , \word (\vec x) \seqar \word ( f ( \epsilon , \vec v ; \vec x ) ) }{
76
			\vlhy{!\word (\vec v) , \word (\vec x) \seqar \word (g (\vec v ; \vec x) ) }
77
			}{
78
			\vliin{\cut}{}{ \word (g (\vec v ; \vec x) ) \seqar \word (f (\epsilon, \vec v ; \vec x) ) }{
79
				\vlin{\closure{\eqspec}}{}{ \seqar f(\epsilon , \vec v ; \vec x) = g(\vec v ; \vec x) }{\vlhy{}}
80
				}{
81
				\vlin{=}{}{\word ( g(\vec v ; \vec x) ) , f(\epsilon , \vec v ; \vec x) = g(\vec v ; \vec x)  \seqar \word (f (\epsilon, \vec v ; \vec x) ) }{\vlhy{}}
82
				}
83
			}
84
		}
85
	\]
86
	
87
%	We first prove,
88
%	\begin{equation}
89
%	!\word (a) , !\word (\vec v) , \word (\vec x) \land \word (f( a , \vec v ; \vec x ) )
90
%	\seqar
91
%	\word (\vec x) \land \word (f( \succ_i a , \vec v ; \vec x ) )
92
%	\end{equation}
93
%	for $i=0,1$, whence we will apply $\ind$. We construct the following proofs:
94

    
95
We also construct, for $i=0,1$, the proofs,
96
	\begin{equation}
97
	\label{eqn:prn-cvg-ind}
98
	%\vlderivation{
99
	%	\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) ) }{
100
	%	\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) )   }{
101
	%		\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) )    }{
102
	%			\vlin{\id}{}{\nat(\vec x) \seqar \nat (\vec x) }{\vlhy{}}
103
	%			}{
104
	%			\vliq{\beta}{}{  \nat (\vec x) , \nat (f(u , \vec v ; \vec x) ) \seqar \nat ( f(\succ_i u , \vec v ; \vec x) ) }{
105
	%				\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 )) ) }{
106
	%					\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}}
107
	%					}
108
	%				}
109
	%			}
110
	%		}
111
	%	}
112
	%	}
113
	\vlderivation{
114
	\vlin{\lefrul{\land}}{}{ !\word (a) , !\word (\vec v) , \word (\vec x) \land \word (f( a , \vec v ; \vec x ) ) \seqar \word (\vec x) \land \word (f( \succ_i a , \vec v ; \vec x ) ) }{
115
	\vlin{\lefrul{\cntr}}{}{  !\word (a) , !\word (\vec v) , \word (\vec x) , \word (f( a , \vec v ; \vec x ) ) \seqar \word (\vec x) \land \word (f( \succ_i a , \vec v ; \vec x ) )}{
116
	\vliin{\rigrul{\land}}{}{   !\word (a) , !\word (\vec v) , \word(\vec x),  \word (\vec x) , \word (f( a , \vec v ; \vec x ) ) \seqar \word (\vec x) \land \word (f( \succ_i a , \vec v ; \vec x ) )}{
117
	\vlin{\id}{}{\word (\vec x) \seqar \word (\vec x)}{\vlhy{}}
118
	}{
119
		\vliq{\beta}{}{ !\word (u) , !\word(\vec v)  , \word (\vec x) , \word (f ( u , \vec v ; \vec x ) ) \seqar \word (f (\succ_i u , \vec{v} ; \vec x ) )  }{
120
				\vliq{\alpha}{}{  !\word (u) , !\word (\vec v)  , \word (\vec x) , \nat (f ( u , \vec v ; \vec x ) ) \seqar \word ( h_i ( u , \vec v ; \vec x , f( u , \vec v ; \vec x ) ) )   }{
121
					\vltr{\IH}{ \seqar \forall u^{!\word} , \vec v^{!\nat} . \forall \vec x^\word , y^\word  .  \word ( h_i ( u, \vec v ; \vec x, y ) ) }{ \vlhy{\quad} }{\vlhy{}}{\vlhy{\quad}}
122
				}
123
			}
124
			}
125
	}
126
	}
127
	}
128
\end{equation}
129
where $\alpha$ and $\beta$ are constructed similarly to before.
130
	
131
%%	so let us suppose that $\nat(\vec v)$ and prove,
132
%	\begin{equation}
133
%% \forall u^{!\nat} .  (\nat(\vec x) \limp \nat(f(u , \vec v ; \vec x)  )
134
%!\nat (u) , !\nat (\vec v) , \nat (\vec x) \seqar \nat ( f(u, \vec v ; \vec x) )
135
%	\end{equation}
136
%	by $\cax{\Sigma^N_1}{\pind}$ on $u$. After this the result will follow by $\forall$-introduction for $u, \vec v , \vec x$.
137
	
138
%	In the base case we have the following proof,
139
%	\[
140
%	\vlderivation{
141
%	\vlin{\rigrul{\limp}}{}{ \seqar \nat (\vec x) \limp \nat (f(\epsilon , \vec v ; \vec x )) }{
142
%		\vliq{\beta}{}{ \nat (\vec x) \seqar \nat ( f( \epsilon , \vec v ; \vec x) ) }{
143
%			\vliq{\alpha}{}{ \nat (\vec x) \seqar \nat ( g (\vec v ; \vec x) ) }{
144
%				\vltr{IH}{\seqar \forall v^{!\nat} . \forall x^\nat . \nat( g(\vec v ; \vec x) ) }{\vlhy{\quad}}{\vlhy{}}{\vlhy{\quad}}
145
%				}
146
%			}
147
%		}		
148
%		}
149

    
150

    
151
Finally we compose these proofs as follows:
152

    
153
\[
154
\vlderivation{
155
\vliq{\rigrul{\forall}}{}{ \seqar \forall u^{!\word} , \vec v^{!\word} . \forall \vec x^\word . \word ( f(u , \vec v ;\vec x)  ) }{
156
\vliq{\lefrul{\cntr}}{}{ !\word (u), !\word (\vec v) , \word (\vec x) \seqar  \word ( f(u , \vec v ;\vec x)  )  }
157
{
158
\vliin{\cut}{}{  !\word (u), !\word(\vec v), !\word (\vec v) , \word (\vec x) , \word (\vec x) \seqar  \word ( f(u , \vec v ;\vec x)  )   }{
159
\vltr{}{ !\word (\vec v) , \word (\vec x) \seqar \word ( f( \epsilon , \vec v ; \vec x ) ) }{\vlhy{\quad}}{\vlhy{}}{\vlhy{\quad}}
160
}
161
{
162
\vliq{\wk}{}{ !\word (u), !\word (\vec v) , \word (\vec x), \word ( f( \epsilon , \vec v ; \vec x ) ) \seqar \word ( f( u , \vec v ; \vec x ) ) }{
163
\vliq{\land\text{-}\mathit{inv}}{}{  !\word (u), !\word (\vec v) , \word (\vec x) ,\word ( f( \epsilon , \vec v ; \vec x ) ) \seqar \word (\vec x) \land \word ( f( u , \vec v ; \vec x ) )  }{
164
\vlin{\ind}{}{   !\word (u), !\word (\vec v) , \word (\vec x) \land \word ( f( \epsilon , \vec v ; \vec x ) ) \seqar \word (\vec x) \land \word ( f( u , \vec v ; \vec x ) )  }
165
{
166
\vlhy{
167
\left\{
168
\vltreeder{}{   !\word (a), !\word (\vec v) , \word (\vec x) \word ( f( a , \vec v ; \vec x ) ) \seqar \word (\vec x) \land \word ( f( \succ_i u , \vec v ; \vec x ) )  }{\quad}{}{}
169
\right\}_{i=0,1}
170
}
171
}
172
}
173
}
174
}
175
}
176
}
177
}
178
\]
179
where the steps \todo{minor steps}
180

    
181
%For the inductive step, we suppose that $\nat (u)$ and the proof is as follows,
182
%
183
%where the steps indicated $\alpha$ and $\beta$ are analogous to those for the base case.
184
%%, and $\gamma$ is an instance of the general scheme:
185
%%\begin{equation}
186
%%\label{eqn:nat-cntr-left-derivation}
187
%%\vlderivation{
188
%%	\vliin{\cut}{}{ \nat (t) , \Gamma \seqar \Delta }{
189
%%		\vlin{\natcntr}{}{ \nat (t) \seqar \nat (t) \land \nat (t) }{\vlhy{}}
190
%%		}{
191
%%		\vlin{\lefrul{\land}}{}{\nat (t)  \land \nat (t) , \Gamma \seqar \Delta}{ \vlhy{\nat (t)  ,\nat (t) , \Gamma \seqar \Delta} }
192
%%		}
193
%%	}
194
%%\end{equation}
195
%
196
%%
197
%%For the inductive step, we need to show that,
198
%%\[
199
%%\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) )   )
200
%%\]
201
%%so let us suppose that $N(x)$ and we give the following proof:
202
%%\[
203
%%\vlderivation{
204
%%	\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)  ) }{
205
%%		\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)  ) }{
206
%%			\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) ) ) }{
207
%%				\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 }}
208
%%			}{
209
%%			\vlhy{2}
210
%%		}
211
%%	}{
212
%%	\vlhy{3}
213
%%}
214
%%}
215
%%}
216
%%\]
217
%%TOFINISH
218

    
219
Suppose $f$ is defined by safe composition as follows:
220
\[
221
f( \vec u ; \vec x )
222
\quad = \quad
223
h( \vec g (\vec u ; )  ; \vec g' ( \vec u ; \vec x ) )
224
\]
225

    
226
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:
227
\[
228
\vlderivation{
229
	\vliq{\rigrul{\forall}}{}{ \seqar \forall\vec u^{!\nat} . \forall \vec x^\nat . \nat( f(\vec u ; \vec x ) ) }{
230
		\vliq{\beta}{}{ !\nat (\vec u) , \nat (\vec x) \seqar \nat ( f( \vec u ; \vec x ) ) }{
231
			\vliq{\cntr}{}{  !\nat (\vec u) , \nat (\vec x) \seqar \nat ( h( \vec g(\vec u ;) ; \vec g' ( \vec u ; \vec x )  ) )  }{
232
				\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 )  ) )   }{
233
					\vlhy{
234
						\left\{  
235
						\vlderivation{
236
							\vlin{\rigrul{!}}{}{ !\nat (\vec u) \seqar !\nat ( g_i (\vec u ;) ) }{
237
								\vliq{\alpha}{}{ !\nat (\vec u) \seqar \nat ( g_i (\vec u ;) }{
238
									\vltr{\IH}{ \forall \vec u^{!\nat} . \nat (g_i (\vec u ;) ) }{\vlhy{\quad}}{\vlhy{}}{\vlhy{\quad}}
239
									}
240
								}
241
							}
242
						\right\}_{i \leq |\vec g| }
243
						}
244
					}{
245
					\vlhy{
246
						\left\{
247
						\vlderivation{
248
							\vliq{\alpha}{}{ !\nat ( \vec u )  , \nat (\vec x) \seqar \nat  ( g_j' ( \vec u ; \vec x ) ) }{
249
								\vltr{\IH}{ \seqar \forall \vec u^{!\nat}. \forall \vec x^\nat . \nat ( g_j' (\vec u ; \vec x) ) }{\vlhy{\quad}}{\vlhy{}}{\vlhy{\quad}}
250
								}
251
							}
252
						\right\}_{j \leq |\vec g'|}
253
						}
254
					}{
255
					\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 )  )  ) ) }{
256
						\vltr{\IH}{ \seqar \forall \vec v^{!\nat} . \forall \vec y^\nat . \nat ( h( \vec v ; \vec y ) ) }{\vlhy{\quad}}{\vlhy{}}{\vlhy{\quad}}
257
						}
258
					}
259
				}
260
			}
261
		}
262
	}
263
\]
264
where $\alpha$ and $\beta$ are similar to before.
265

    
266
\todo{reformat a bit}
267

    
268
It remains to check the initial functions. 
269

    
270
Consider the conditional function, defined equationally as:
271
\[
272
\begin{array}{rcl}
273
C (; \epsilon, y_\epsilon , y_0, y_1  ) & = & y_\epsilon \\
274
C(; \succ_0 x , y_\epsilon , y_0, y_1) & = & y_0 \\
275
C(; \succ_1 x , y_\epsilon , y_0, y_1) & = & y_1 
276
\end{array}
277
\]
278
Let $\vec y = ( y_\epsilon , y_0, y_1 )$ and construct the required proof as follows:
279
\[
280
\vlderivation{
281
\vliq{}{}{ \nat (x) , \nat (\vec y) \seqar \nat ( C(; x ,\vec y) )}{
282
\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) ) }{
283
\vliq{}{}{ x = \epsilon , \nat (\vec y) \seqar \nat ( C(; x , \vec y) ) }{
284
\vliq{}{}{ \nat (\vec y) \seqar \nat ( C( ; \epsilon , \vec y ) ) }{
285
\vlin{\wk}{}{ \nat (\vec y) \seqar \nat (y_\epsilon) }{ 
286
\vlin{\id}{}{\nat (y_\epsilon) \seqar \nat ( y_\epsilon )}{\vlhy{}}
287
}
288
}
289
}
290
}{
291
\vlhy{
292
\left\{ 
293
\vlderivation{
294
\vlin{\lefrul{\exists}}{}{ \exists z^\nat . x = \succ_i z , \nat (\vec y) \seqar \nat ( C(;x , \vec y) ) }{
295
\vliq{}{}{ x = \succ_i a , \nat (\vec y ) \seqar \nat (C(; x ,\vec y)) }{
296
\vliq{}{}{ \nat (\vec y) \seqar \nat ( C(; \succ_i a , \vec y ) ) }{
297
\vlin{\wk}{}{ \nat (\vec y) \seqar \nat (y_i) }{
298
\vlin{\id}{}{\nat (y_i) \seqar \nat (y_i)}{\vlhy{}}
299
}
300
}
301
}
302
}
303
}
304
\right\}_{i = 0,1}
305
}
306
}
307
}
308
}
309
\]
310
whence the result follows by $\forall$-introduction.
311
\todo{reformat a bit}
312

    
313
Other initial functions are far simpler.
314

    
315
\end{proof}
316

    
317

    
318

    
319

    
320

    
321

    
322

    
323

    
324

    
325

    
326

    
327

    
328

    
329

    
330

    
331

    
332

    
333

    
334

    
335

    
336

    
337

    
338

    
339

    
340

    
341

    
342

    
343

    
344

    
345

    
346

    
347

    
348

    
349

    
350

    
351

    
352

    
353

    
354

    
355

    
356

    
357