Statistiques
| Révision :

root / CSL16 / wfm.tex @ 107

Historique | Voir | Annoter | Télécharger (26,99 ko)

1 33 adas
\section{Witness function method}
2 88 adas
\label{sect:wfm}
3 57 adas
We now prove the converse to the last section: any provably convergent function in $\arith$ is polynomial-time computable.
4 89 adas
To this end we use the \emph{witness function method} (WFM), a common technique in {bounded arithmetic} \cite{Buss86book}.
5 33 adas
6 89 adas
The WFM differs from realisability and Dialectica style witnessing arguments mainly since it does not require functionals at higher type. Instead a translation is conducted directly from a proof in De Morgan normal form, i.e.\ with negation pushed to the atoms, relying on classical logic.
7 89 adas
Free-cut elimination is employed to control the quantifer complexity of formulae occurring in a proof, although here we furthermore use it to control the presence of \emph{contraction} in a proof, to which we have access via the modalities of linear logic.
8 89 adas
%Free-cut elimination is employed to control the logical complexity of formulae occurring in a proof, and a formal `witness' predicate plays a similar role to the realisability predicate.
9 57 adas
10 90 adas
The combination of De Morgan normalisation and free-cut elimination plays a similar role to the double negation translation, and this is even more evident in our setting where the transformation of a classical proof to anchored form can be seen to be a partial `constructivisation' of the proof. As well as eliminating the (nonconstructive) occurrences of the $\forall$-right rule, as usual for the WFM, the linear logic refinement of the logical connectives means that right-contraction steps is also eliminated. This is important due to the fact that we are in a setting where programs are equational specifications, not formulae (as in bounded arithmetic) or combinatory terms (as in applicative theories), so we cannot in general decide atomic formulae.
11 33 adas
12 58 adas
%Some key features of this method are the following:
13 58 adas
%\begin{itemize}
14 58 adas
%	\item T
15 58 adas
%\end{itemize}
16 58 adas
%
17 58 adas
%Key features/differences from realisability:
18 58 adas
%\begin{itemize}
19 58 adas
%	\item De Morgan normal form: reduces type level to $0$, complementary to double-negation translation that \emph{increases} type level.
20 58 adas
%	\item Free-cut elimination: allows us to handles formulae of fixed logical complexity throughout the proof.
21 58 adas
%	\item Respects logical properties of formulae, e.g.\ quantifier complexity, exponential complexity.
22 58 adas
%\end{itemize}
23 58 adas
%
24 58 adas
%\todo{say some more here}
25 58 adas
%
26 58 adas
%\todo{compare with applicative theories}
27 58 adas
%
28 58 adas
%\anupam{in particular, need to point out that this argument is actually something in between, since usually the WFM requires programs to be defined by formulae, not equational specifications.}
29 33 adas
30 33 adas
\newcommand{\type}{\mathtt{t}}
31 33 adas
\newcommand{\norm}{\nu}
32 33 adas
\newcommand{\safe}{\sigma}
33 33 adas
34 33 adas
35 43 adas
36 43 adas
		\subsection{The translation}
37 43 adas
38 89 adas
We will associate to each (free-cut free) proof of a convergence statement in $\arith$ a function on $\Word$ defined by a BC program. In the next section we will show that this function satisfies the equational specification of the convergence statement, hence showing that any provably convergent function of $\arith$ is polynomial-time computable.\footnote{Strictly speaking, we will also require the equational specification at hand to be coherent, cf.\ Prop.~\ref{prop:eq-spec-model}.}
39 59 adas
40 33 adas
		\begin{definition}
41 43 adas
			[Typing]
42 89 adas
			To each $(\forall, ?)$-free $\word^+$-formula $A$ we associate a sorted tuple of variables $\type (A)$, intended to range over $\Word$, as follows:
43 33 adas
			\[
44 33 adas
			\begin{array}{rcll}
45 89 adas
			\type (\word (t)) & := & (;x^{\word (t)} ) & \\
46 43 adas
			\type(s = t) & := & ( ; x^{s = t}) & \\
47 89 adas
			\type (s \neq t) & := & ( ;x^{s\neq t} )\\
48 89 adas
%			\type (A \lor B)  & : = & (\vec u , \vec v ; \vec x , \vec y) & \text{if $\type(A) = (\vec u ; \vec x)$ and $\type(B) = (\vec v ; \vec y)$.} \\
49 89 adas
			\type (A \star B)  & : = & (\vec u , \vec v ; \vec x , \vec y) & \text{if $\type(A) = (\vec u ; \vec x)$, $\type(B) = (\vec v ; \vec y)$ and $\star \in \{ \lor, \land, \laor, \laand \}$.} \\
50 43 adas
			\type (! A) & : = & ( \vec u ,\vec x  ; ) & \text{if $\type(A) = (\vec u ; \vec x )$.} \\
51 89 adas
			\type (\exists x^\word . A) & := & (\vec u ; \vec x , y) & \text{if $\type (A) = (\vec u ; \vec x)$.}
52 43 adas
			%	\type (\forall x^N . A) & := & \Nat \to \type(A)
53 33 adas
			\end{array}
54 33 adas
			\]
55 89 adas
			For a sorted tuple $(u_1 , \dots u_m ; x_1 , \dots ,x_n )$ we write $|(\vec u ; \vec x)|$ to denote its length, i.e.\ $m+n$.
56 43 adas
			%	where $\nu$ designates that the inputs are normal.
57 33 adas
		\end{definition}
58 33 adas
59 33 adas
60 59 adas
%		\anupam{need to account for normality and safety somewhere. Attempting inlined and leaving types without this decoration.}
61 59 adas
%
62 59 adas
%		\begin{remark}
63 59 adas
%			[Distribution of $!$]
64 59 adas
%			There is a potential issue that the $!$ contains $\lor$ symbols in its scope, whence we do not in general have $!(A \lor B) \cong !A \lor !B$. However this will not be a problem here by inspection of a convergence statement: there are no $\lor$ symbols in the scope of a $!$. Therefore, after free-cut elimination, no formula in the proof will have this property either.
65 59 adas
%
66 59 adas
%			On the other hand, since we are working in affine logic, we do in general have $!(A \land B) \cong !A \land !B$.
67 59 adas
%		\end{remark}
68 33 adas
69 89 adas
		This sorted tuple corresponds to the input variables, normal and safe respectively, for the BC programs that we will define.
70 89 adas
%		\footnote{It becomes important here that we are considering proofs of a convergence statement, since a free-cut free $\arith$-proof of a convergence statement cannot contain any $\lor$ symbols in the scope of a $!$. This could cause an issue in the above definition since we do not in general have the equivalence $!(A \lor B) \equiv !A \lor !B$. On the other hand, the equivalence $!(A\land B) \equiv !A \land !B$ follows since we are in the affine setting.}
71 33 adas
72 60 adas
73 89 adas
		Let us fix a particular (coherent) equational specification $\eqspec(f)$. Rather than directly considering $\arith$-proofs of $\conv ( f , \eqspec )$, we will consider a $\closure{\eqspec} \cup \arith $ sequent proof of $!\word (\vec x) \seqar \word (f (\vec x) )$, under Lemma~\ref{lemma:spec-norm-form}.
74 90 adas
%
75 64 adas
		Our crucial use of free-cut elimination is in the following result, which yields strong regularity properties:
76 59 adas
77 64 adas
		\begin{proposition}
78 64 adas
			[Freedom]
79 89 adas
			\label{prop:freedom}
80 89 adas
	A free-cut free $\closure{\eqspec} \cup \arith $ sequent proof of $!\word (\vec x) \seqar \word (f (\vec x) )$ is:
81 64 adas
	\begin{enumerate}
82 89 adas
		\item\label{item:no-neg-word} Free of any negative occurrences of $\word$.
83 89 adas
		\item\label{item:no-forall} Free of any $\forall$ symbols.
84 89 adas
		\item\label{item:no-quest} Free of any $?$ symbols.
85 89 adas
				\item\label{item:no-laor-step} Free of any $\laor$ or $\laand$ steps.\footnote{Because of the $\surj$ rule, the proof may still contain $\laor$ symbols, but these must be direct ancestors of some cut-step by free-cut freeness.}
86 64 adas
	\end{enumerate}
87 64 adas
		\end{proposition}
88 64 adas
89 64 adas
90 64 adas
		For this reason we can assume that $\type$ is well-defined for all formulae occurring in a free-cut free proof of convergence, and so we can proceed with the translation from proofs to BC programs.
91 64 adas
92 33 adas
		\begin{definition}
93 33 adas
			[Translation]
94 89 adas
			We give a translation from a free-cut free $\closure{\eqspec} \cup \arith $ proof $\pi$, satisfying properties \ref{item:no-neg-word}, \ref{item:no-forall}, \ref{item:no-quest}, \ref{item:no-laor-step} of Prop.~\ref{prop:freedom} above, of a sequent $\Gamma \seqar \Delta$ to BC programs for a tuple of functions $\vec f^\pi$ with arguments $\type \left(\bigotimes\Gamma\right)$ such that $|\vec f^\pi | = | \type\left(\bigparr\Delta\right)|$.
95 33 adas
96 33 adas
97 89 adas
			The translation is by induction on the size of $\pi$, so we proceed by inspection of its final step.
98 33 adas
99 89 adas
			If $\pi$ is an instance of the initial rules $\geneps, \sepeps^0 , \sepeps^1, \sepzer, \sepone$ or $\inj$ then $\vec f^\pi$ is simply the constant function $\epsilon$ (possibly with dummy inputs as required by $\type$).\footnote{This is because proofs of (in)equalities can be seen to carry no computational content.}
100 107 adas
			If $\pi$ is an $\closure{\eqspec}$ or $=$ initial step it is also translated simply to $\epsilon$.
101 107 adas
102 107 adas
			The initial steps $\genzer, \genone , \surj$ and $\wordcntr$ are translated to $\succ_0( ; x) , \succ_1 (; x), ( \epsilon , \pred ( ;x) , \pred (; x) )$ and $(\id (;x) , \id(;x))$ respectively.
103 89 adas
104 89 adas
		Finally, suppose $\pi$ is a logical initial step. If $\pi $ is an instance of $\id$, i.e.\ $p \seqar p$, then we translate it to $\id$. Notice that, if $\pi$ is an instance of $\lefrul{\bot}$ (i.e.\ $p, p^\bot \seqar $ ) or $\rigrul{\bot}$ (i.e.\ $\seqar p, p^\bot$) then $p$ must be an equality $s=t$ for some terms $s,t$, since $p$ must be atomic and, by assumption, $\word$ does not occur negatively. Therefore $\pi$ is translated to tuples of $\epsilon$ as appropriate.
105 39 adas
106 64 adas
107 42 adas
108 42 adas
109 64 adas
			Now we consider the inductive cases.
110 107 adas
%
111 107 adas
%		We will continue with similar notational conventions in the remainder of this argument.
112 107 adas
%
113 107 adas
%		%	\anupam{bad notation since need to include free variables of sequent too. (also of theory.) Reconsider.}
114 107 adas
%
115 107 adas
If $\pi$ ends with a $\rigrul{\land}$ or $\lefrul{\lor}$ step then we just rearrange the tuple of functions obtained from the inductive hypothesis.
116 107 adas
%		The case when $\pi$ ends with a $\lefrul{\lor}$ step is analogous to the $\rigrul{\land}$ case above.
117 33 adas
		If $\pi$ consists of a subproof $\pi'$ ending with a $\lefrul{\land}$ or $\rigrul{\lor}$-step, then $\vec f^\pi$ is exactly $\vec f^{\pi'}$.
118 107 adas
			By assumption, there are no $\laor$, $\laand$, $?$ or $\forall$ steps occurring in $\pi$, and if $\pi$ consists of a subproof $\pi'$ followed by a $\lefrul{\exists}$ step then $\vec f^\pi$ is exactly the same as $\vec f^{\pi'}$, under possible reordering of the tuple.
119 33 adas
120 69 adas
			Suppose $\pi$ ends with a $\rigrul{\exists}$ step,
121 69 adas
				\[
122 69 adas
				\vlderivation{
123 93 adas
					\vlin{\rigrul{\exists}}{}{ \Gamma, \word(t) \seqar \Delta , \exists x^\word . A(x) }{
124 69 adas
						\vltr{\pi'}{ \Gamma \seqar \Delta , A(t) }{\vlhy{\quad }}{\vlhy{ }}{\vlhy{\quad }}
125 69 adas
					}
126 69 adas
				}
127 69 adas
				\]
128 69 adas
				so by the inductive hypothesis we have functions $\vec f^\Delta , \vec f^{A(t)}$ with arguments $(\vec u ; \vec x )= \type(\bigotimes \Gamma)$. We define $\vec f^\pi$ as follows:
129 69 adas
				\[
130 69 adas
				\vec f^\pi (\vec u ; \vec x , y)
131 69 adas
				\quad := \quad
132 69 adas
				\left(
133 69 adas
				\vec f^\Delta (\vec u ; \vec x) ,
134 69 adas
				{\id (;y)},
135 69 adas
				\vec f^{A(t)} (\vec u; \vec x)
136 69 adas
				\right)
137 69 adas
				\]
138 69 adas
		%		(The identity function on $y$ is defined from successor, predecessor and safe composition).
139 69 adas
140 69 adas
141 69 adas
				%Suppose we have functions $\vec f^X (\vec x ; \vec y)$ from $\pi'$ for $X = \Delta$ or $ X=A$.
142 69 adas
				%\[
143 69 adas
				%\vec f(\vec x ; \vec y , z) \quad := \quad ( \vec f^\Delta (\vec x ; \vec y)   ,  z , \vec f^A ( \vec x ; \vec y ) )
144 69 adas
				%\]
145 69 adas
146 69 adas
147 107 adas
148 69 adas
				%
149 69 adas
				%Suppose we have functions $\vec f' (\vec u , \vec v ; x , \vec y , \vec z)$ from $\pi'$ with $(\vec u ; \vec x )$ corresponding to $\Gamma$, $(;x)$ corresponding to $N(a)$ and $(\vec v ; \vec z)$ corresponding to $A(a)$. We define:
150 69 adas
				%\[
151 69 adas
				%\vec f ( \vec u , \vec v ;  )
152 69 adas
				%\]
153 69 adas
154 69 adas
%				\anupam{should just be same? Consider variable naming, just in case.}
155 69 adas
%				\anupam{This is probably where the consideration for free variables is.}
156 69 adas
157 93 adas
				%Suppose we have functions $\vec g (\vec v  , \vec w ; \vec x , y , \vec z)$ where $(\vec v ; \vec x) $ corresponds to $\Gamma$, $y$ corresponds to $\word(a)$ and $(\vec w ; \vec z) $ corresponds to $A(a)$. Then we define:
158 69 adas
				%\[
159 69 adas
				%\vec f ( \vec v , \vec w ; \vec x , y , \vec z )
160 69 adas
				%\]
161 69 adas
162 69 adas
163 69 adas
164 69 adas
					%	\[
165 69 adas
					%	\vlderivation{
166 69 adas
					%	\vliin{\rigrul{\laand}}{}{\Gamma \seqar \Delta, A \laand B}{
167 69 adas
					%	\vltr{\pi_1}{  \Gamma \seqar \Delta, A}{\vlhy{\quad }}{\vlhy{ }}{\vlhy{\quad }}
168 69 adas
					%	}{
169 69 adas
					%	\vltr{\pi_2}{  \Gamma \seqar \Delta, B}{\vlhy{\quad }}{\vlhy{ }}{\vlhy{\quad }}
170 69 adas
					%	}
171 69 adas
					%	}
172 69 adas
					%	\]
173 69 adas
					%
174 69 adas
					%	Suppose we have $\vec f^i (\vec x , \vec a ; \vec y , \vec b)$ from $\pi_i$.
175 69 adas
					%
176 69 adas
					%	\anupam{problem: does this require many tests, just like for contraction? Can we isolate a different complexity class? e.g.\ PH or Grzegorzyck?}
177 69 adas
					%	\anupam{skip this case and consider later.}
178 69 adas
179 69 adas
			%		\anupam{commented stuff on additives. To remark later perhaps.}
180 69 adas
181 69 adas
182 69 adas
			If $\pi$ consists of a subproof $\pi'$ followed by a $\rigrul{!}$ step then $\vec f^\pi$ is exactly the same as $\vec f^{\pi'}$. If $\pi$ ends with a $\lefrul{!}$ step then we just appeal to Prop.~\ref{prop:bc-properties} to turn a safe input into a normal input.
183 69 adas
184 107 adas
			Since there are no $?$ symbols in $\pi$, we can assume also that there are no $\rigrul{\cntr}$ steps in $\pi$.\footnote{Again, this is crucially important, since we cannot test the equality between arbitrary terms in the presence of nonlogical function symbols.}
185 69 adas
186 69 adas
		%		\anupam{This is important, so expand on this here or in a remark before/after.}
187 69 adas
188 33 adas
		Suppose $\pi$ ends with a $\lefrul{\cntr}$ step,
189 33 adas
		\[
190 33 adas
		\vlderivation{
191 33 adas
			\vlin{\lefrul{\cntr}}{}{ !A , \Gamma \seqar \Delta }{
192 33 adas
				\vltr{\pi'}{  !A, !A , \Gamma \seqar \Delta}{\vlhy{\quad }}{\vlhy{ }}{\vlhy{\quad }}
193 33 adas
			}
194 33 adas
		}
195 33 adas
		\]
196 69 adas
		so we have functions $\vec f' ( \vec u^1, \vec u^2 , \vec v ; \vec x)$, with $\vec u^1$ and $\vec u^2$ corresponding to the two copies of $!A$ in the conclusion of $\pi'$ and $\type (\Gamma) = (\vec v; \vec x)$.
197 67 adas
%		(Recall that the typing corresponding to $!$ means that all inputs for each $!A$ are normal).
198 67 adas
		We define $\vec f^\pi$ by duplicating the arguments for $!A$:
199 33 adas
		\[
200 33 adas
		\vec f^\pi (\vec u , \vec v ; \vec x)
201 33 adas
		\quad := \quad
202 67 adas
		\vec f' (\vec u, \vec u , \vec v ; \vec x)
203 33 adas
		\]
204 67 adas
%		(Notice that this is obtainable in BC by a trivial instance of safe composition.)
205 33 adas
206 33 adas
207 33 adas
		%	cntr right
208 33 adas
		%	\[
209 33 adas
		%	\vlderivation{
210 33 adas
		%	\vlin{\rigrul{\cntr}}{}{\Gamma \seqar \Delta, ?A}{
211 33 adas
		%	\vltr{\pi'}{  \Gamma \seqar \Delta, ?A, ?A}{\vlhy{\quad }}{\vlhy{ }}{\vlhy{\quad }}
212 33 adas
		%	}
213 33 adas
		%	}
214 33 adas
		%	\]
215 33 adas
		%	(need test function against witness predicate?)
216 33 adas
		%
217 33 adas
		%	\anupam{problem: how to test even equality of two terms? Maybe treat $?$ as $!$ on left?}
218 33 adas
		%
219 33 adas
		%	\anupam{Not a problem by free-cut elimination! Can assume there are no $?$ in the proof! Is this equivalent to treaing $?$ as $!$ on left?}
220 33 adas
		%
221 33 adas
		%	\anupam{Yes I think so. We can work in a left-sided calculus. only problem is for induction. But this can never be a problem for modalities since induction formulae are modality-free.}
222 33 adas
		%
223 33 adas
		%	\anupam{this is actually the main point.}
224 33 adas
225 69 adas
226 107 adas
		If $\pi$ ends with a $\cut$ step whose cut-formula is free of modalities, then it can be directly translated to a safe composition of functions obtained by the inductive hypothesis, by relying on Prop.~\ref{prop:bc-properties}. Otherwise, the cut-formula must be of the form $!\word (t)$ since it must directly descend from the left-hand side of an induction step, by free-cut freeness.
227 93 adas
%	 or axiom on one side. The only such occurrence of a modality is in the conclusion of an induction step, whence such a formula has the form $!\word (t)$.
228 107 adas
	 Since the cut is anchored, we can also assume that the cut formula is principal on the other side, i.e.\ $\pi$ is of the form:
229 69 adas
%	\anupam{need to check this assumption against free-cut elimination conditions. To discuss.}
230 36 adas
\[
231 36 adas
\vlderivation{
232 89 adas
	\vliin{\cut}{}{!\Gamma , \Sigma  \seqar \Delta }{
233 93 adas
		\vlin{\rigrul{!}}{}{!\Gamma \seqar  !\word(t)}{
234 93 adas
			\vltr{\pi_1'}{!\Gamma \seqar  \word(t)}{\vlhy{\quad}}{\vlhy{}}{\vlhy{\quad}}
235 69 adas
			}
236 36 adas
		}{
237 93 adas
		\vltr{\pi_2}{ !\word(t), \Sigma\seqar \Delta}{\vlhy{\quad}}{\vlhy{}}{\vlhy{\quad}}
238 36 adas
		}
239 36 adas
	}
240 36 adas
\]
241 89 adas
 where
242 89 adas
% $\pi_2$ ends with a $\ind$ step for which  $A(x)$ is the induction formula, and
243 93 adas
 we assume there are no side-formulae on the right of the end-sequent of $\pi_1$ for the same reason as $\rigrul{\cntr}$: $\pi$ does not contain any occurrences of $?$. By the inductive hypothesis we have functions $ g( \vec u ; )$ and $\vec h (  v , \vec w ; \vec x)$ from $\pi_1'$ and $\pi_2$ respectively, where $\vec u$, $ v$ and $(\vec w ; \vec x)$ correspond to $!\Gamma$,  $!\word(t)$ and $\Sigma$ respectively. We construct the functions $\vec f^\pi $ as follows:
244 36 adas
\[
245 89 adas
\vec f^\pi (\vec u , \vec w ; \vec x)
246 36 adas
\quad := \quad
247 89 adas
\vec h (   g(\vec u ; ), \vec w  ; \vec x)
248 36 adas
\]
249 69 adas
Notice, again, that all safe inputs on the left occur hereditarily safe on the right, and so these expressions are definable in BC by Prop.~\ref{prop:bc-properties}.
250 69 adas
251 69 adas
252 33 adas
253 69 adas
%	Suppose $\pi$ ends with a $\lefrul{!}$ step:
254 69 adas
%	\[
255 69 adas
%	\vlderivation{
256 69 adas
%		\vlin{!}{}{\Gamma, !A \seqar \Delta}{
257 69 adas
%			\vltr{\pi'}{ \Gamma , A \seqar \Delta  }{\vlhy{\quad }}{\vlhy{ }}{\vlhy{\quad }}
258 69 adas
%		}
259 69 adas
%	}
260 69 adas
%	\]
261 69 adas
%	\todo{finish this case, just passing a safe input to a normal input.}
262 69 adas
%
263 69 adas
%
264 69 adas
%	Suppose $\pi$ ends with a $\rigrul{!}$ step:
265 69 adas
%
266 69 adas
%	\todo{finish this case, should not change function at all, but maybe there is a consideration.}
267 33 adas
268 69 adas
	If $\pi$ ends with a $\rigrul{\wk}$ step then we just add a tuple of constant functions $\vec \epsilon$ of appropriate length as dummy functions. If $\pi$ ends with a $\lefrul{\wk}$ step then we just add dummy inputs of appropriate length.
269 33 adas
270 69 adas
%	Suppose $\pi$ ends with a $\lefrul{\wk}$ step:
271 69 adas
%
272 69 adas
%	\todo{finish this case, just add a dummy input.}
273 69 adas
%
274 69 adas
%	Suppose $\pi$ ends with a $\rigrul{\wk}$ step:
275 69 adas
%
276 69 adas
%	\todo{finish this case, just add a dummy function.}
277 69 adas
%
278 33 adas
279 33 adas
280 89 adas
	Finally, suppose $\pi$ ends with an $\ind$ step. Since there are no occurrences of $?$ in $\pi$ we can again assume that there are no side formulae on the right of any induction step. Thus $\pi$ is of the form:
281 33 adas
	\[
282 33 adas
	\vlderivation{
283 93 adas
		\vliin{\ind}{}{ !\word (t), !\Gamma  ,  A(\epsilon) \seqar A(t) }{
284 93 adas
			\vltr{\pi_0}{!\word(a) , !\Gamma ,  A(a) \seqar A(\succ_0 a)}{\vlhy{\quad }}{\vlhy{ }}{\vlhy{\quad }}
285 33 adas
		}{
286 93 adas
		\vltr{\pi_1}{!\word(a), !\Gamma ,  A(a)\seqar A(\succ_1 a) }{\vlhy{\quad }}{\vlhy{ }}{\vlhy{\quad }}
287 33 adas
	}
288 33 adas
}
289 33 adas
\]
290 69 adas
%\anupam{is this better with a premiss for the base case?}
291 33 adas
292 93 adas
By the inductive hypothesis we have functions $\vec g^0 (u , \vec v ; \vec x)$ and $\vec g^1 (u , \vec v ; \vec x)$ with $u$, $\vec v$ and $\vec x$ corresponding to $!\word(a)$, $!\Gamma$ and $A(a)$ respectively. We define $\vec f^\pi$ by simultaneous predicative recursion on notation as follows:
293 33 adas
\[
294 37 adas
\begin{array}{rcll}
295 37 adas
\vec f^\pi ( \epsilon, \vec v ; \vec x ) & := & \vec x & \\
296 37 adas
\vec f^\pi ( \succ_i u , \vec v ; \vec x) & := & \vec g^i ( u, \vec v ; \vec f^\pi ( u, \vec v ; \vec x ) )
297 33 adas
\end{array}
298 33 adas
\]
299 33 adas
300 69 adas
%\anupam{check this}
301 69 adas
%
302 69 adas
%\todo{simultaneous PRN.}
303 33 adas
304 33 adas
305 33 adas
\end{definition}
306 33 adas
307 69 adas
The induction step above is the reason why we enrich the usual BC framework with a simultaneous version of PRN.
308 69 adas
309 90 adas
\newcommand{\qfindth}{\mathit{IQF}}
310 90 adas
311 43 adas
\subsection{Witness predicate and extensional equivalence of functions}
312 43 adas
313 90 adas
%\anupam{need to mention that this predicate is similar to realisability predicate in absence, and indeed is presented like that for applicative theories, which also rely on free-cut elimination.}
314 83 adas
315 90 adas
Now that we have seen how to extract BC functions from proofs, we show that these functions satisfy the appropriate semantic properties, namely the equational program $\eqspec$ we started with. For this we turn to a quantifier-free classical theory, in a similar fashion to $\mathit{PV}$ for $S^1_2$ in \cite{Buss86book} or system $T$ in G\"odel's Dialectica interpretation. This is adequate since we only care about extensional properties of extracted functions at this stage, the complexity properties already handled by the BC programs we just constructed.
316 43 adas
317 90 adas
We point out that we could equally use a realisability approach, as done in e.g.\ \cite{Cantini02} and other works in applicative theories, since the formulae we deal with are essentially positive and so there is not much difference between the two approaches. Indeed here the witness predicate plays the same role as the realisability predicate in other works.
318 43 adas
319 90 adas
%The witness predicate of the WFM is similar to the realisability predicate, and this is even more true in out setting
320 43 adas
321 90 adas
Let $\qfindth$ be the classical theory over the language $\{ \epsilon, \succ_0, \succ_1 , (f^k_i )\}$ obtained from the axioms $\sepeps, \sepzer, \sepone, \inj, \surj$ and $\ind$ by dropping all relativisations to $\word$ (or $!\word$), replacing all linear connectives by their classical counterparts, and restricting induction to only quantifier-free formulae.
322 90 adas
323 90 adas
%For this we work in a quantifier-free classical logic whose atoms are equations between terms of our arithmetic and whose (sound) rules are simply the axioms of our arithmetic.
324 90 adas
%
325 90 adas
%(This is similar to the role of PV in the witnessing argument for $S^1_2$ and system $T$ for witnessing $I\Sigma_1$.)
326 90 adas
327 43 adas
328 90 adas
%	\todo{add cases for $\laor$ and $\neq$.}
329 83 adas
330 43 adas
		\newcommand{\witness}[2]{\mathit{Witness}^{#1}_{#2}}
331 43 adas
		\begin{definition}
332 43 adas
			[Witness predicate]
333 90 adas
			For formulae $A, B$ satisfying properties \ref{item:no-neg-word}, \ref{item:no-forall}, \ref{item:no-quest} of Prop.~\ref{prop:freedom}, we define the following `witness' predicate as a quantifier-free formula of $\qfindth$:
334 90 adas
%			 $A$ with free variables amongst $\vec a$:
335 90 adas
336 90 adas
		\renewcommand{\sigma}{a}
337 43 adas
			\[
338 43 adas
			\begin{array}{rcll}
339 90 adas
			\witness{}{A} (\sigma) & := & \sigma = t & \text{if $A$ is $\word (t)$.} \\
340 90 adas
			\witness{}{A} (\sigma) & := & s=t & \text{if $A$ is $s=t$.} \\
341 90 adas
						\witness{}{A} (\sigma) & := & s\neq t & \text{if $A$ is $s\neq t$.} \\
342 90 adas
			\witness{}{A \star B} ( \vec \sigma^A , \vec \sigma^B) & := &  \witness{}{A} (\vec \sigma^A) \cor \witness{}{B} (\vec \sigma^B) &
343 90 adas
						\text{for $\star \in \{ \lor,\laor\}$.}
344 43 adas
			\\
345 90 adas
			\witness{}{A \star B} ( \vec \sigma^A , \vec \sigma^B) & := &  \witness{}{A} (\vec \sigma^A ) \cand \witness{}{B} (\vec \sigma^B ) &
346 90 adas
						\text{for $\star \in \{ \land, \laand \}$.}
347 43 adas
			\\
348 90 adas
			\witness{}{\exists x^\word A} ( \sigma, \vec \sigma^A  ) & := & \witness{}{A}(\vec \sigma^A , \sigma ) & \\
349 90 adas
			\witness{}{!A} (\vec \sigma^A) & := & \witness{}{A} (\vec \sigma^A)
350 43 adas
			\end{array}
351 43 adas
			\]
352 90 adas
			where $|\vec \sigma^A| = |\type (A)|$ and $|\vec \sigma^B| = |\type (B)| $.
353 43 adas
		\end{definition}
354 43 adas
		%	\todo{problem: what about complexity of checking equality? }
355 43 adas
356 90 adas
		\begin{remark}
357 90 adas
		Notice that, unlike in the bounded arithmetic setting where the $\word$ predicate is redundant (since variables are tacitly assumed to range over $\word$), we do not parametrise the witness predicate by an assignment to the free variables of a formula. Instead these dependencies are taken care of by the explicit occurrences of the $\word$ predicate in $\arith$.
358 90 adas
		\end{remark}
359 43 adas
360 90 adas
%		\todo{Reformulate above later if necessary.}
361 90 adas
362 43 adas
		%	\todo{What about $\nat (t)$? What does it mean? Replace with true?}
363 43 adas
364 43 adas
		%	\todo{either use the witness predicate above, or use realizability predicate at meta-level and a model theory, like BH.}
365 43 adas
366 43 adas
		%	\anupam{Need to check above properly. $N(t)$ should be witnessed by the value of $t $ in the model. For equality of terms the witness should not do anything.}
367 43 adas
368 90 adas
%		\anupam{to consider/remark: formally, is witness predicate checked in model or some logical theory?}
369 43 adas
370 43 adas
371 43 adas
372 43 adas
373 43 adas
\begin{lemma}
374 90 adas
\label{lemma:witness-invariant}
375 90 adas
Let $\pi$ be a free-cut free proof in $\closure{\eqspec}\cup \arith$, satisfying properties \ref{item:no-neg-word}, \ref{item:no-forall}, \ref{item:no-quest}, \ref{item:no-laor-step} of Prop.~\ref{prop:freedom}, of a sequent $\Gamma \seqar \Delta $. Let $\eqspec^\pi$ denote the equational specification induced by the BC program for $\vec f^\pi$.\footnote{We assume that the function symbols occurring in $\eqspec^\pi$ are distinct from those occurring in $\eqspec$.} Then $\qfindth$ proves:
376 90 adas
\[
377 90 adas
\left(\forall \eqspec \cand \forall \eqspec^\pi \cand \witness{}{\bigotimes \Gamma} (\vec a)\right) \cimp \witness{}{\bigparr \Delta } (\vec f^\pi(\vec a))
378 90 adas
\]
379 90 adas
where $\forall \eqspec$ and $\forall \eqspec^\pi$ denote the universal closures of $\eqspec$ and $\eqspec^\pi$ respectively.
380 90 adas
%Suppose $\pi$ is a free-cut free $\Sigma^\nat_1$-$\pind$ proof of a sequent $\Gamma (\vec a) \seqar \Delta (\vec a)$, with $\vec f^\pi$ defined as above. Then:
381 90 adas
%	\[
382 90 adas
%			\witness{\vec a}{\bigotimes \Gamma} (\vec w , \vec b) \implies \witness{\vec a}{\bigparr \Delta } (\vec f^\pi(\vec w , \vec b), \vec b)
383 90 adas
%			\]
384 43 adas
\end{lemma}
385 43 adas
386 43 adas
387 90 adas
%			\anupam{to consider: do we need parameters $\vec a$ in argument of $f$? Or does $\nat$ predicate take care of this?}
388 90 adas
%
389 90 adas
%			%	We will be explicit about normal and safe inputs when necessary, for the most part we will simply rearrange inputs into lists $(\vec u; \vec a)$ as in BC framework.
390 90 adas
%
391 90 adas
%%			We often suppress the parameters $\vec a$ when it is not important.
392 90 adas
%
393 90 adas
%			\anupam{Is this implication provable in Bellantoni's version of PV based on BC?}
394 43 adas
395 43 adas
			%	\anupam{for moment try ignore decoration on right? what about negation?}
396 43 adas
397 43 adas
398 90 adas
	\begin{proof}[Proof sketch]
399 90 adas
	By structural induction on $\pi$, again, following the definition of $\vec f^\pi$.
400 43 adas
	\end{proof}
401 90 adas
	Notice that, since we are in a classical theory, the proof of the above lemma can be carried out in an arbitrary model, by the completeness theorem, greatly easing the exposition.
402 90 adas
403 90 adas
	Finally, we arrive at our main result, providing a converse to Thm.~\ref{thm:arith-proves-bc-conv}.
404 43 adas
405 43 adas
		\begin{theorem}
406 90 adas
		\label{thm:main-result}
407 90 adas
		For any coherent equational specification $\eqspec$, if $\arith $ proves $\conv (f , \eqspec)$ then there is a polynomial-time function $g $ on $\Word$ (of same arity as $f$) such that $\eqspec [  g/ f ]$.
408 90 adas
409 90 adas
%		If we can prove a convergence statement for a function $f$ under a specification $\Phi(f)$ then there is a BC-program for a function $\mathbf f$ such that:
410 90 adas
%		\begin{equation}
411 90 adas
%		\label{eqn:spec-implies-program}
412 90 adas
%\Phi(f) \implies f (\vec x) = \mathbf{f} (\vec x)
413 90 adas
%		\end{equation}
414 90 adas
%		\begin{equation}
415 90 adas
%		\label{eqn:program-satisfies-spec}
416 90 adas
%		\Phi(\mathbf f)
417 90 adas
%		\end{equation}
418 43 adas
		\end{theorem}
419 90 adas
		\begin{proof}
420 90 adas
%		[Proof sketch]
421 90 adas
		By Thm.~\ref{thm:free-cut-elim} and Lemma~\ref{lemma:spec-norm-form} we have a free-cut free proof $\pi$ in $\closure{\eqspec} \cup \arith$ of $!\word (\vec x ) \seqar \word (f (\vec x))$. By Lemma~\ref{lemma:witness-invariant} above this means that $\vec a = \vec x \cimp f^\pi (\vec a) = f(\vec x)$ is true in any model of $\qfindth$ satisfying $\eqspec$ and $\eqspec^\pi$.
422 90 adas
%		Since some model must exist by coherence (cf.\ Prop.~\ref{prop:eq-spec-model}), we have that
423 90 adas
		Using the fact that $\eqspec \cup \eqspec^\pi$ is coherent we can construct such a model, similarly to Prop.~\ref{prop:eq-spec-model}, which will contain $\Word$ as an initial segment, in which we must have $f^\pi (\vec x) = f (\vec x)$ for every $\vec x \in \Word$, as required.\todo{polish}
424 90 adas
		\end{proof}
425 90 adas
426 90 adas
%			\begin{proof}
427 90 adas
%			Notice that a convergence statement has the following form:
428 90 adas
%			\[
429 90 adas
%			!\Phi(f) , !\nat(\vec a) \seqar \nat(f (\vec a) )
430 90 adas
%			\]
431 90 adas
%			By the lemma above, and by inspection of the definition of the witness predicate, this means we have that,
432 90 adas
%			\[
433 90 adas
%			(\Phi(f) \cand \vec x = \vec a ) \implies \mathbf f (\vec x) = f(\vec a)
434 90 adas
%			\]
435 90 adas
%			whence we arrive at \eqref{eqn:spec-implies-program}.
436 90 adas
%
437 90 adas
%			Finally, notice that $\Phi(f)$ has \emph{some} model, since it is a monotone inductive definition so some fixed point must exist. Therefore we obtain \eqref{eqn:program-satisfies-spec} as well.
438 90 adas
%			\end{proof}
439 90 adas
%
440 90 adas
%			\anupam{rephrase above proof to make more sense.}
441 90 adas
%
442 90 adas
%%
443 47 adas
%\newcommand{\concat}{\mathit{concat}}
444 47 adas
%\paragraph{Some points on concatenation \anupam{if necessary}}
445 47 adas
%We can define the concatenation operation by PRN:
446 47 adas
%\[
447 47 adas
%\begin{array}{rcl}
448 47 adas
%\concat (\epsilon ; y) & : = & x \\
449 47 adas
%\concat (\succ_i x ; y) & := & \succ_i \concat (x ; y)
450 47 adas
%\end{array}
451 47 adas
%\]
452 47 adas
%
453 47 adas
%From here we can define iterated concatenation:
454 47 adas
%\[
455 47 adas
%\concat (x_1 , \dots x_n ; y) \quad := \quad \concat (x_n ; \concat (x_{n-1} ; \vldots \concat (x_1 ; y) \vldots ) )
456 47 adas
%\]
457 47 adas
%
458 47 adas
%(notice all safe inputs are hereditarily to the right of $;$ so this is definable by safe composition and projection.)