Statistiques
| Révision :

root / CSL17 / tech-report / soundness.tex @ 270

Historique | Voir | Annoter | Télécharger (20,24 ko)

1 251 adas
\section{Soundness}
2 251 adas
\label{sect:soundness}
3 251 adas
In this section we show that the representable functions of our theories $\arith^i$ are in $\fphi i$ (`soundness').
4 251 adas
The main result is the following:
5 251 adas
6 251 adas
\begin{theorem}
7 251 adas
	\label{thm:soundness}
8 268 adas
	If $\arith^i$ proves $\forall \vec u^\normal  . \exists y^\safe . A(\vec u ;  y)$ then there is a $\mubci{i-1}$ program $f(\vec u ; )$ such that $\Nat \models A(\vec u ;  f(\vec u ; ))$.
9 251 adas
\end{theorem}
10 251 adas
11 251 adas
12 251 adas
13 251 adas
The problem for soundness is that we have predicates, for example equality, that take safe arguments in our theory but do not formally satisfy the polychecking lemma for $\mubc$ functions, Lemma~\ref{lem:polychecking}.
14 251 adas
For this we will use \emph{length-bounded} witnessing argument, borrowing a similar idea from Bellantoni's work \cite{Bellantoni95}.
15 251 adas
16 251 adas
17 251 adas
\begin{definition}
18 251 adas
[Length bounded (in)equality]
19 251 adas
%We define \emph{length-bounded equality}, $\eq(l;x,y)$ as the characteristic function of the predicate:
20 251 adas
%\[
21 251 adas
%x \mode l = y \mode l
22 251 adas
%\]
23 251 adas
%which is definable by safe recursion on $l$:
24 251 adas
%\[
25 251 adas
%\begin{array}{rcl}
26 251 adas
%\eq (0 ; x,y) & \dfn & \equivfn (;\bit (0;x),\bit(0;y) ) \\
27 251 adas
%\eq (\succ i l; x,y) & \dfn & \cond (; \eq ( u;x,y ) , 0, \equivfn (; \bit (\succ i u ; x ) , \bit (\succ i l ; y ))  )
28 251 adas
%\end{array}
29 251 adas
%\]
30 251 adas
We define \emph{length-bounded inequality} as:
31 251 adas
\[
32 251 adas
\begin{array}{rcl}
33 251 adas
\leqfn (0 ; x ,y) & \dfn & \cond(; \bit (0;x), 1, \bit (0;y) ) \\
34 251 adas
\leqfn (\succ i l ; x,y) & \dfn & \orfn ( ; \cond(;\bit (\succ i l ; x) , \bit(\succ i l ; y),0 ) , \andfn (; \equivfn (\bit (\succ i l ; x) , \bit(\succ i l ; y)) , \leqfn (l;x,y ) ) )
35 251 adas
\end{array}
36 251 adas
\]
37 251 adas
\end{definition}
38 251 adas
39 251 adas
Notice that $\leqfn (l; x,y) = 1$ just if $x \mode l \leq y \mode l$.
40 262 adas
We can also define $\eq( l; x,y)$ as $\andfn (;\leqfn(l;x,y),\leqfn(l;y,x))$.
41 251 adas
42 251 adas
%\anupam{Do we need the general form of length-boundedness? E.g. the $*$ functions from Bellantoni's paper? Put above if necessary. Otherwise just add sequence manipulation functions as necessary.}
43 251 adas
%
44 251 adas
%Notice that $\eq$ is a polymax bounded polyomial checking function on its normal input, and so can be added to $\mubc$ without problems.
45 251 adas
46 251 adas
47 251 adas
In the presence of a compatible sorting, we may easily define functions that \emph{evaluate} safe formulae in $\mubc$:
48 251 adas
49 251 adas
50 254 adas
\begin{definition}
51 254 adas
	[Length bounded characteristic functions]
52 254 adas
	We define $\mubci{}$ programs $\charfn{}{A} (l , \vec u; \vec x)$, parametrised by a formula $A$ and a compatible typing $(\vec u ; \vec x)$ of its varables, as follows.
53 254 adas
	%	If $A$ is a $\Pi_{i}$ formula then:
54 254 adas
	\[
55 254 adas
	\begin{array}{rcl}
56 254 adas
	\charfn{\vec u ; \vec x}{s\leq t} (l, \vec u ; \vec x) & \dfn & \leqfn(l;s,t) \\
57 254 adas
	\smallskip
58 254 adas
	%	\charfn{}{s=t} (l, \vec u ; \vec x) & \dfn & \eq(l;s,t) \\
59 254 adas
	%	\smallskip
60 254 adas
	\charfn{\vec u ; \vec x}{\neg A} (l, \vec u ; \vec x) & \dfn & \notfn (;\charfn{\vec u ; \vec x}{A}(l , \vec u ; \vec x)) \\
61 254 adas
	\smallskip
62 254 adas
	\charfn{\vec u ; \vec x}{A\cor B} (l, \vec u ; \vec x ) & \dfn & \orfn(; \charfn{\vec u ; \vec x}{A} (l, \vec u ; \vec x , w), \charfn{\vec u ; \vec x}{B} (\vec u ;\vec x) ) \\
63 254 adas
	\smallskip
64 254 adas
	\charfn{\vec u ; \vec x}{A\cand B} (l, \vec u ; \vec x ) & \dfn & \andfn(; \charfn{\vec u ; \vec x}{A} (l, \vec u ; \vec x , w), \charfn{\vec u ; \vec x}{B} (\vec u ;\vec x) )
65 254 adas
	%	\end{array}
66 254 adas
	%	\quad
67 254 adas
	%	\begin{array}{rcl}
68 254 adas
	\\	\smallskip
69 254 adas
	\charfn{\vec u ; \vec x}{\exists x^\safe . A(x)} (l, \vec u ;\vec x) & \dfn & \begin{cases}
70 254 adas
	1 & \exists x^\safe . \charfn{}{A(x)} (l, \vec u ;\vec x , x) = 1 \\
71 254 adas
	0 & \text{otherwise}
72 254 adas
	\end{cases} \\
73 254 adas
	\smallskip
74 254 adas
	\charfn{\vec u ; \vec x}{\forall x^\safe . A(x)} (l, \vec u ;\vec x ) & \dfn &
75 254 adas
	\begin{cases}
76 254 adas
	0 & \exists x^\sigma. \charfn{\vec u ; \vec x}{ A(x)} (l, \vec u; \vec x , x) = 0 \\
77 254 adas
	1 & \text{otherwise}
78 254 adas
	\end{cases}
79 254 adas
	\end{array}
80 254 adas
	\]
81 254 adas
\end{definition}
82 251 adas
83 254 adas
84 267 adas
\begin{proposition}
85 267 adas
Given a $\Sigma^\safe_i$ formula $A$ and compatible sorting $(\vec u; \vec x)$ of its variables,
86 267 adas
$\charfn{\vec u ;\vec x}{A} (l, \vec u ; \vec x)$ is in $\mubci{i}$ and computes the characteristic function of $A (\vec u \mode l ; \vec x \mode l)$.
87 267 adas
\end{proposition}
88 267 adas
89 267 adas
90 267 adas
91 251 adas
We will use the programs $\charfn{}{}$ in the witness functions we define below.
92 251 adas
Let us write $\charfn{}{i}$ to denote the class of functions $\charfn{}{A}$ for $A \in \Sigma^\safe_{i}$.
93 251 adas
For the notion of bounding polynomial below we are a little informal with bounds, using `big-oh' notation, since it will suffice just to be `sufficiently large'.
94 251 adas
Notice that, while we refer to $b_A(l), p(l)$ etc.\ below as a `polynomial', we really mean a \emph{quasipolynomial} (which may also contain $\smsh$), i.e.\ a polynomial in the \emph{length} of $l$, as a slight abuse of notation.
95 251 adas
96 251 adas
97 251 adas
\begin{definition}
98 251 adas
	[Length bounded witness function]
99 251 adas
	For a $\Sigma^\safe_{i}$ formula $A$ with a compatible sorting $(\vec u ; \vec x)$, we define the \emph{length-bounded witness function} $\wit{\vec u ; \vec x}{A} (l, \vec u ; \vec x , w)$ in $\bc (\charfn{}{i-1})$ and its \emph{bounding polynomial} $b_A (l)$ as follows:
100 251 adas
	\begin{itemize}
101 251 adas
		\item If $A$ is $\Pi^\safe_{i-1}$ then $\wit{\vec u ; \vec x}{A} (l, \vec u ; \vec x , w) \dfn \charfn{\vec u ; \vec x}{A} (l, \vec u ; \vec x )$ and we set $b_A (l) = 1$.
102 267 adas
		\item If $A$ is $B \cor C$ then we may set $|b_A| = O(|b_B| + |b_C|)$ and define $		\wit{\vec u ; \vec x}{A} (l, \vec u ;\vec x , w) \dfn		\orfn ( ; \wit{\vec u ; \vec x}{B} (l, \vec u ; \vec x , \beta (b_B (l) , 0 ; w ) ) , \wit{\vec u ; \vec x}{C} (l, \vec u ; \vec x , \beta (b_C (l) , 0 ; w ) )  )$.
103 251 adas
%		\[
104 251 adas
%		\wit{\vec u ; \vec x}{A} (l, \vec u ;\vec x , w)
105 251 adas
%		\quad \dfn \quad
106 251 adas
%		\orfn ( ; \wit{\vec u ; \vec x}{B} (l, \vec u ; \vec x , \beta (b_B (l) , 0 ; w ) ) , \wit{\vec u ; \vec x}{C} (l, \vec u ; \vec x , \beta (b_C (l) , 0 ; w ) )  )
107 251 adas
%		\]
108 251 adas
%		and we may set $b_A = O(b_B + b_C)$.
109 251 adas
		\item Similarly if $A $ is $B \cand C$, but with $\andfn$ in place of $\orfn$.
110 251 adas
%		\item If $A$ is $B \cand C$ then
111 251 adas
%			\[
112 251 adas
%			\wit{\vec u ; \vec x}{A} (l, \vec u ;\vec x , w)
113 251 adas
%			\quad \dfn \quad
114 251 adas
%			\andfn ( ; \wit{\vec u ; \vec x}{B} (l, \vec u ; \vec x , \beta (b_B (l) , 0 ; w ) ) , \wit{\vec u ; \vec x}{C} (l, \vec u ; \vec x , \beta (b_C (l) , 0 ; w ) )  )
115 251 adas
%			\]
116 251 adas
%			and we may set $b_A = O(b_B + b_C)$.
117 251 adas
		\item If $A$ is $\forall u \leq |t(\vec u;)| . B(u)$ we appeal to sharply bounded closure, Lemma~\ref{lem:sharply-bounded-recursion}, to define
118 251 adas
		\(
119 251 adas
		\wit{\vec u ; \vec x}{A}
120 251 adas
		 \dfn
121 251 adas
		\forall u \leq |t|.
122 251 adas
		\wit{u, \vec u ; \vec x}{B(u)} (l, u, \vec u ; \vec x , \beta( b_{B(t)} (l) , u ; w ) )
123 251 adas
		\)
124 251 adas
		%appealing to Lemma~\ref{lem:sharply-bounded-recursion},
125 251 adas
		and
126 251 adas
		we set
127 267 adas
		$|b_A| = O(|b_{B(t)}|^2 )$.
128 251 adas
		\item Similarly if $A$ is $\exists u^\normal \leq |t(\vec u;)|. A'(u)$, but with $\exists u \leq |t|$ in place of $\forall u \leq |t|$.
129 251 adas
		\item If $A$ is $\exists x^\safe . B(x) $ then
130 251 adas
		\(
131 251 adas
		\wit{\vec u ; \vec x}{A}
132 251 adas
		\dfn
133 251 adas
		\wit{\vec u ; \vec x , x}{B(x)} ( l, \vec u ; \vec x , \beta( b_{B} (l) , 0;w ) , \beta (q(l) , 1 ;w ))
134 251 adas
		\)
135 267 adas
		where $q$ is obtained by the polychecking and bounded minimisation properties,\footnote{Here let us assume that $q$ is formulated as a corresponding quasipolynomial in $l$ as opposed to a polynomial in $|l|$, as in Lemma~\ref{lem:bounded-minimisation}.} Lemmas~\ref{lem:polychecking} and \ref{lem:bounded-minimisation}, for $\wit{\vec u ; \vec x , x}{B(x)}$.
136 267 adas
		We may set $|b_A| = O(|b_B | + |q|)$.
137 251 adas
	\end{itemize}
138 251 adas
%	\[
139 251 adas
%	\begin{array}{rcl}
140 251 adas
%	\wit{\vec u ; \vec x}{A} (l, \vec u ; \vec x , w) & \dfn & \charfn{}{A} (l, \vec u ; \vec x)  \text{ if $A$ is $\Pi_i$} \\
141 251 adas
%	\smallskip
142 251 adas
%	\wit{\vec u ; \vec x}{A \cor B} (l,\vec u ; \vec x , \vec w^A , \vec w^B) & \dfn & \cor ( ; \wit{\vec u ; \vec x}{A} (l,\vec u ; \vec x , \vec w^A) ,\wit{\vec u ; \vec x}{B} (l,\vec u ; \vec x , \vec w^B)  )  \\
143 251 adas
%	\smallskip
144 251 adas
%	\wit{\vec u ; \vec x}{A \cand B} (l,\vec u ; \vec x , \vec w^A , \vec w^B) & \dfn & \cand ( ; \wit{\vec u ; \vec x}{A} (l,\vec u ; \vec x , \vec w^A) ,\wit{\vec u ; \vec x}{B} (l,\vec u ; \vec x , \vec w^B)  )  \\
145 251 adas
%	\smallskip
146 251 adas
%	\wit{\vec u ; \vec x}{\exists x^\safe . A(x)} (l,\vec u ; \vec x , \vec w , w) & \dfn & \wit{\vec u ; \vec x , x}{A(x)} ( l,\vec u ; \vec x , w , \vec w )
147 251 adas
%	\\
148 251 adas
%	\smallskip
149 251 adas
%	\wit{\vec u ; \vec x}{\forall u \leq |t(\vec u;)| . A(x)} (l , \vec u ; \vec x, w) & \dfn &
150 251 adas
%	\forall u \leq |t(\vec u;)| . \wit{u , \vec u ; \vec x}{A(u)} (l, u , \vec u ; \vec x, \beta(u;w) )
151 251 adas
%	\end{array}
152 251 adas
%	\]
153 251 adas
%	\anupam{need length bounding for sharply bounded quantifiers}
154 251 adas
\end{definition}
155 251 adas
156 251 adas
157 267 adas
From Lemmas~\ref{lem:polychecking} and \ref{lem:bounded-minimisation} we have:
158 251 adas
\begin{proposition}
159 251 adas
	\label{prop:wit-rfn}
160 251 adas
	If, for some $w$, $\wit{\vec u ; \vec x}{A} (l, \vec u ; \vec x,w) =1$, then $A (\vec u \mode l ; \vec x \mode l)$ is true.
161 251 adas
Conversely, if $A (\vec u \mode l ; \vec x \mode l)$ is true then there is some $w \leq b_A(l)$ such that $\wit{\vec u ; \vec x}{A} (l, \vec u ; \vec x,w) =1$.
162 251 adas
\end{proposition}
163 251 adas
164 251 adas
165 251 adas
In order to prove Thm.~\ref{thm:soundness} we need the following lemma, essentially giving an interpretation of $\arith^i$ proofs into $\mubci{i-1}$.
166 251 adas
167 251 adas
168 251 adas
\begin{lemma}
169 251 adas
		[Proof interpretation]
170 251 adas
		\label{lem:proof-interp}
171 251 adas
	From a typed-variable normal form $\arith^i$ proof $\pi$ of a $\Sigma^\safe_i$ sequent $\normal(\vec u), \safe(\vec x) , \Gamma  \seqar \Delta$
172 265 adas
	there are $\bc (\charfn{}{i-1})$ functions $ f^\pi_B (\vec u ; \vec x , \vec w)$ for $B\in\Delta$ such that
173 251 adas
	% such that, for any $l, \vec u ; \vec x  , w$, we have:
174 251 adas
	\[
175 251 adas
%	\vec a^\nu = \vec u ,
176 251 adas
%	\vec b^\sigma = \vec u,
177 251 adas
%	\bigwedge\limits_{A \in \Gamma} \wit{\vec u ; \vec x}{ A} (l, \vec u ; \vec x , w_A) =1
178 251 adas
%	\ \implies \
179 251 adas
%	\bigvee\limits_{B\in \Delta} \wit{\vec u ; \vec x}{B} (l, \vec u ; \vec x , f^\pi_B((\vec u ; \vec x )\mode l, \vec w \mode p(l))) = 1
180 251 adas
	\begin{array}{rl}
181 268 adas
&	\bigwedge\limits_{A \in \Gamma} \wit{\vec u ; \vec x}{ A} (l, \vec u ; \vec x , w_A
182 268 adas
%\mode b_A(l)
183 268 adas
) =1 \\
184 251 adas
\noalign{\medskip}
185 268 adas
\implies & 	\bigvee\limits_{B\in \Delta} \wit{\vec u ; \vec x}{B} (l, \vec u ; \vec x , f^\pi_B(l,
186 268 adas
(
187 268 adas
\vec u ; \vec x
188 268 adas
)	\mode l
189 268 adas
, \vec w \mode p^\pi(l))) = 1
190 251 adas
	\end{array}
191 251 adas
	\]
192 267 adas
	for some polynomial $p^\pi$.
193 251 adas
%	\anupam{Need $\vec w \mode p(l)$ for some $p$.}
194 251 adas
%	\anupam{$l$ may occur freely in the programs $f^\pi_B$}
195 251 adas
\end{lemma}
196 251 adas
197 251 adas
198 251 adas
199 268 adas
For the implication above, let us simply refer to the LHS as $\Wit{\vec u ; \vec x}{\Gamma} (l , \vec u ; \vec x , \vec w)$ and the RHS as $\Wit{\vec u ; \vec x}{ \Delta} (l, \vec u ; \vec x , \vec f^\pi (
200 268 adas
l,(
201 268 adas
\vec u ; \vec x
202 268 adas
)\mode l
203 268 adas
, \vec w \mode p^\pi(l))  )$, which is a slight abuse of notation: we assume that LHS and RHS are clear from context.
204 267 adas
Also let us call $p^\pi$ the \emph{modulus} of $f^\pi$ with respect to $l$.
205 251 adas
206 268 adas
\begin{proof}[Proof sketch]
207 254 adas
	Since the proof is in typed variable normal form we have that each line of the proof is of the same form, i.e.\ $\normal (\vec u), \safe (\vec x) , \Gamma \seqar \Delta$ over free variables $\vec u ; \vec x$.
208 268 adas
	We define the function $f^\pi$ inductively, by considering the various final rules of $\pi$.
209 254 adas
210 254 adas
211 254 adas
	\paragraph*{Negation}
212 265 adas
Suppose $\pi$ ends with a right negation step:
213 265 adas
\[
214 265 adas
\vlinf{\rigrul{\cnot}}{}{\normal (\vec u) , \safe (\vec x) , \Gamma \seqar \cnot A , \Delta }{\normal (\vec u) , \safe (\vec x) , \Gamma , A\seqar  \Delta}
215 265 adas
\]
216 265 adas
Notice that, since $\pi$ is in De Morgan form, we have that $A$ is atomic ($s\leq t$) and so, in particular, $\Pi^\safe_{i-1}$.
217 265 adas
So we can simply set the witness for both $A$ and $\cnot A$ to $0$.
218 268 adas
Namely, if $\vec f (l,\vec u ; \vec x , \vec w , w )$ is obtained by the inductive hypothesis, then we may set $f^\pi_B (l, \vec u ; \vec x , \vec w) \dfn f_B (l,\vec u ;\vec x , \vec w , 0)$ for $B\in \Delta$, and $f^\pi_A (\vec u ; \vec x , \vec w) \dfn 0$.
219 267 adas
The modulus $p^\pi$ remains the same as that of the inductive hypothesis.
220 267 adas
221 267 adas
Left negation is similar, relying on a dummy argument.
222 254 adas
223 254 adas
	\paragraph*{Logical rules}
224 267 adas
%	Pairing, depairing. Need length-boundedness.
225 267 adas
	Suppose $\pi$ ends with a
226 267 adas
	left conjunction step:
227 254 adas
	\[
228 254 adas
	\vlinf{\lefrul{\cand}}{}{ \normal (\vec u ), \safe (\vec x) , A\cand B , \Gamma \seqar \Delta }{ \normal (\vec u ), \safe (\vec x) , A, B , \Gamma \seqar \Delta}
229 254 adas
	\]
230 268 adas
	By inductive hypothesis we have functions $\vec f (l,\vec u ; \vec x , w_A , w_B , \vec w)$ such that,
231 254 adas
	\[
232 254 adas
	\Wit{\vec u ; \vec x}{\Gamma} (l, \vec u ; \vec x , w_A , w_B , \vec w)
233 254 adas
	\quad \implies \quad
234 268 adas
	\Wit{\vec u ; \vec x}{\Delta} (l, \vec u ; \vec x , \vec f (
235 268 adas
	l, (
236 268 adas
	\vec u ; \vec x
237 268 adas
	) \mode l
238 268 adas
	, (w_A , w_B , \vec w) \mode p(l) ))
239 254 adas
	\]
240 254 adas
	for some polynomial $p$.
241 254 adas
	%
242 268 adas
	We define $\vec f^\pi (l,\vec u ; \vec x , w , \vec w) \dfn \vec f (l,\vec u ; \vec x , \beta (p(l),0; w) , \beta(p(l),1;w),\vec w )$ and, by the bounding polynomial for pairing, it suffices to set $|p^\pi| = O(|p|)$.
243 254 adas
244 268 adas
	Suppose $\pi$ ends with a right disjunction step:
245 267 adas
		\[
246 267 adas
		\vlinf{\rigrul{\cor}}{}{ \normal (\vec u ), \safe (\vec x) , \Gamma \seqar \Delta , A \cor B}{ \normal (\vec u ), \safe (\vec x) , \Gamma \seqar \Delta, A, B }
247 267 adas
		\]
248 267 adas
		$\vec f^\pi_\Delta$ remains the same as that of premiss.
249 268 adas
		Let $\vec f , f_A, f_B$ be obtained by the inductive hypothesis so that:
250 267 adas
		\[
251 267 adas
		\Wit{\vec u ; \vec x}{\Gamma} (l, \vec u ; \vec x , \vec w)
252 267 adas
		\quad \implies \quad
253 268 adas
		\Wit{\vec u ; \vec x}{\Delta} (l, \vec u ; \vec x , (\vec f , f_A , f_B) (
254 268 adas
		l,(
255 268 adas
		\vec u ; \vec x
256 268 adas
		) \mode l
257 268 adas
		, \vec w \mode p(l) ))
258 267 adas
		\]
259 268 adas
		$\vec f^\pi_\Delta$ is defined the same as $\vec f$.
260 268 adas
		Let $q(l)$ be an upper bound for $f_A , f_B$  and define $f^\pi_{A\cor B} (\vec u ; \vec x, \vec w) \dfn \pair{q(l)}{f_A ((\vec u ; \vec x, \vec w))}{f_B ((\vec u ; \vec x, \vec w))}$.
261 268 adas
		$p^\pi$ is obtained from $p$, $q$ and the bounding polynomial for pairing.
262 254 adas
263 267 adas
	The other logical cases use a similar argument.
264 267 adas
265 267 adas
266 254 adas
	\paragraph*{Quantifiers}
267 268 adas
	Sharply bounded quantifier steps use a similar argument to the logical rules above, only requiring a larger modulus.
268 254 adas
269 254 adas
270 268 adas
%	If $\pi$ ends with a sharply bounded quantifier step, then we use a similar argument to that for logical rules.
271 268 adas
%	For instance, suppose $\pi$ ends with a $\rigrul{|\forall|}$:
272 268 adas
%	\[
273 268 adas
%	\vlinf{\rigrul{|\forall|}}{}{\normal (\vec u) , \safe (\vec x) , \Gamma \seqar  \Delta , \forall u^\normal \leq |t(\vec u;)| . A(u) }{ \normal(u) , \normal (\vec u) , \safe (\vec x) , u \leq |t(\vec u;)| , \Gamma \seqar  \Delta, A(u)  }
274 268 adas
%	\]
275 268 adas
%	By the inductive hypothesis we have functions $\vec f(u , \vec u ; \vec x , w , \vec w)$ such that:
276 268 adas
%	\[
277 268 adas
%	\Wit{u ,\vec u ; \vec x}{\lhs} ( u , \vec u ;\vec x , w , \vec w )
278 268 adas
%	\quad \implies \quad
279 268 adas
%	\Wit{u , \vec u ; \vec x}{\rhs} (u, \vec u ; \vec x , \vec f ((\vec u ; \vec x) \mode l , \vec w \mode p(l) ) )
280 268 adas
%	\]
281 268 adas
%	with $|f|\leq q(|l|)$.
282 268 adas
%
283 268 adas
%	By Lemma~\ref{lem:sequence-creation}, we have a function $F (l , u , \vec u ; \vec x , w , \vec w) $ such that....
284 268 adas
%
285 268 adas
%	We set $f^\pi_{\forall u^\normal \leq t . A} (\vec u ; \vec x , \vec w) \dfn F(q(|l|), t(\vec u;), \vec u ; \vec x , 0, \vec w  )$.
286 268 adas
%
287 268 adas
%		\anupam{Do $\exists$-right and $\forall$-right, left rules are symmetric.}
288 254 adas
289 268 adas
Suppose $\pi$ ends with a right existential step:\footnote{	Here we assume the variables of $t$ are amongst $(\vec u ; \vec x)$, since we are in typed variable normal form.}
290 254 adas
	\[
291 268 adas
	\vlinf{\rigrul{\exists}}{}{\normal(\vec u ) , \safe (\vec x) , \Gamma \seqar \Delta , \exists x . A(x)}{\normal(\vec u ) , \safe (\vec x) , \Gamma \seqar \Delta , A(t (\vec u ; \vec x))}
292 254 adas
	\]
293 268 adas
By the inductive hypothesis we have functions $\vec f , f$ such that:
294 268 adas
\[
295 268 adas
\Wit{\vec u ;\vec x}{\Gamma} ( l , \vec u ; \vec x , \vec w )
296 268 adas
\quad \implies \quad
297 268 adas
\Wit{\vec u ; \vec x}{\Delta, A(t)} ( l, \vec u ; \vec x , (\vec f , f) (l, (\vec u ; \vec x) \mode l , \vec w \mode p(l) ) )
298 268 adas
\]
299 268 adas
We let $\vec f^\pi_\Delta \dfn \vec f$ and define $f^\pi_{\exists x . A } ( l, \vec u ; \vec x , \vec w ) \dfn \pair{p(l) + t(\vec l ; \vec l)}{f(l, \vec u ; \vec x , \vec w)}{t(\vec u ; \vec x)}$.
300 268 adas
$p^\pi$ is hence obtained from $t$, $p$ and the bounding polynomial for pairing.
301 254 adas
302 268 adas
	Other quantifier steps are routine.
303 254 adas
304 254 adas
	\paragraph*{Contraction}
305 267 adas
	Left contraction simply duplicates an argument,\footnote{We ignore here the cases when contraction is on a $\normal (u) $ or $\safe (x)$ formula, treating these formulae form as forming a set rather than a multiset.} whereas right contraction requires a conditional on a $\Sigma^\safe_i$ formula.
306 267 adas
	This is the reason why we need to the witness function encoded itself into $\mubc$ rather than simply using a predicate.
307 268 adas
	Suppose $\pi$ ends with a right contraction step:
308 254 adas
	\[
309 254 adas
	\vlinf{\cntr}{}{\normal (\vec u) , \safe (\vec x) , \Gamma \seqar \Delta , A }{\normal (\vec u) , \safe (\vec x) , \Gamma \seqar \Delta , A , A}
310 254 adas
	\]
311 267 adas
	By the inductive hypothesis we have functions $\vec f_\Delta , f_0, f_1$ corresponding to the RHS $\Delta , A ,A$.
312 267 adas
	We may define $\vec f^\pi_\Delta = \vec f_\Delta$ and:
313 254 adas
	\[
314 268 adas
	f^\pi_A (l, \vec u ; \vec x , \vec w  )
315 254 adas
	\quad \dfn \quad
316 268 adas
	\cond (; \wit{\vec u ; \vec x}{A} ( l , \vec u ; \vec x , f_0(l,\vec u ; \vec x , \vec w) ) , f_1(l,\vec u ; \vec x , \vec w) , f_0(\vec u ; \vec x , \vec w)  )
317 254 adas
	\]
318 254 adas
319 254 adas
320 268 adas
%	\anupam{For $\normal (\vec u), \safe (\vec x)$ in antecedent, we always consider as a set, so do not display explicitly contraction rules. }
321 254 adas
	\paragraph*{Induction}
322 268 adas
Suppose $\pi$ ends with a polynomial induction step:
323 254 adas
	\[
324 254 adas
	\vlinf{\pind}{}{ \normal (\vec u), \safe (\vec x) , \Gamma, A(0) \seqar A(t(\vec u ;)) , \Delta}{ \left\{\normal (u) , \normal (\vec u) , \safe (\vec x) , \Gamma,  A(u) \seqar A(\succ i u ) , \Delta \right\}_{i=0,1} }
325 254 adas
	\]
326 268 adas
%	\anupam{need to say in normal form part that can assume induction of this form}
327 268 adas
	For simplicity we will assume $\Delta $ is empty.\footnote{Note that a proof can always be put into this form by the right disjunction rules. The criterion on logical complexity for typed variable normal form proofs is preserved due to free-cut freeness.}
328 268 adas
	%
329 254 adas
	Now, by the inductive hypothesis, we have functions $h_i$ such that:
330 254 adas
	\[
331 268 adas
	\Wit{u , \vec u ; \vec x}{\Gamma, A(0)} (l , u , \vec u ; \vec x ,  \vec w , w)
332 254 adas
	\quad \implies \quad
333 268 adas
	\Wit{u , \vec u ; \vec x}{A(\succ i u)} (l , u , \vec u ; \vec x ,  h_i (l,(u , \vec u ; \vec x ) \mode l , (\vec w , w) \mode p(l) ) )
334 254 adas
	\]
335 268 adas
	First let us define $ f$ by safe recursion as follows:
336 254 adas
	\[
337 254 adas
	\begin{array}{rcl}
338 268 adas
	f (l,0 , \vec u ; \vec x, \vec w,  w ) & \dfn &  w\\
339 268 adas
	f(l, \succ i u , \vec u ; \vec x , \vec w, w) & \dfn &
340 268 adas
	h_i (l,u , \vec u ; \vec x , \vec w , f(l,u , \vec u ; \vec x , \vec w , w ))
341 254 adas
	\end{array}
342 254 adas
	\]
343 268 adas
%	where $\vec w$ corresponds to $\Gamma $ and $w$ corresponds to $A(0)$.
344 268 adas
%	\anupam{Wait, should $\normal (t)$ have a witness? Also there is a problem like Patrick said for formulae like: $\forall x^\safe . \exists y^\safe. (\normal (z) \cor \cnot \normal (z))$, where $z$ is $y$ or otherwise.}
345 254 adas
	Now we let $f^\pi (\vec u ; \vec x , \vec w) \dfn f(t(\vec u ; ) , \vec u ; \vec x , \vec w)$.
346 268 adas
	It suffices to let $|p^\pi| = O(|p|^2)$.
347 254 adas
348 254 adas
	\paragraph*{Cut}
349 268 adas
	If $\pi$ ends with a cut on an induction formula, which is $\Sigma^\safe_i$, then $f^\pi$ is obtained from the inductive hypothesis by simply substituting already defined functions into a safe position.
350 268 adas
	The other possibility is that $\pi$ ends with a `raisecut':
351 254 adas
	\[
352 254 adas
	\vliinf{\rais\cut}{}{\normal (\vec u ) , \normal (\vec v) , \safe (\vec x) ,\Gamma \seqar \Delta }{ \normal (\vec u) \seqar \exists x^\safe  . A(x) }{ \normal (u)  , \normal (\vec v) , \safe (\vec x) , A(u), \Gamma \seqar \Delta }
353 254 adas
	\]
354 268 adas
	In this case, by the inductive hypothesis, we have functions $f(l,\vec u ; )$ from the left premiss and $\vec g (l,u, \vec v ; \vec x , w , \vec w )$ from the right premiss, so we may define:
355 254 adas
	\[
356 268 adas
	\vec f^\pi ( l ,  \vec u , \vec v ; \vec x , \vec w )
357 254 adas
	\quad \dfn \quad
358 268 adas
	\vec g ( l, \beta (1 ; f(l,\vec u ;) ) , \vec v ; \vec x , \beta(0;f(l,\vec u ;)) , \vec w )
359 254 adas
	\]
360 268 adas
	Again, $p^\pi$ is obtained from $p$ and the bounding polynomial for pairing.
361 254 adas
\end{proof}
362 254 adas
363 254 adas
364 254 adas
365 254 adas
366 254 adas
367 254 adas
368 251 adas
Now we can prove the soundness result:
369 251 adas
370 251 adas
	\begin{proof}
371 251 adas
		[Proof sketch of Thm.~\ref{thm:soundness} from Lemma~\ref{lem:proof-interp}]
372 251 adas
		Suppose $\arith^i \proves \forall \vec u^\normal . \exists x^\safe . A(\vec u ; x)$. By inversion and Thm.~\ref{thm:normal-form} there is a $\arith^i$ proof $\pi$ of $\normal (\vec u ) \seqar \exists x^\safe. A(\vec u ; x )$ in typed variable normal form.
373 268 adas
By Lemma~\ref{lem:proof-interp}, we have a $\mubci{i-1}$ function $f^\pi$ with $\wit{\vec u ;}{\exists x^\safe . A} (l, \vec u ; f^\pi(l,\vec u \mode l;)) =1$.
374 268 adas
By the definition of $\wit{}{}$ and Prop.~\ref{prop:wit-rfn} we have that $\exists x . A(\vec u \mode l; x)$ is true just if $A(\vec u \mode l ; \beta (q(l), 1 ; f(l, \vec u \mode l;) ))$ is true, where $q(l)$ is an upper bound for $f^\pi (l, \vec u \mode l ; )$.
375 268 adas
Now, since all $\vec u$ are normal, we may simply set $l$ to have a longer length than all of these arguments, so the function $f(\vec u;) \dfn \beta (q(\sum \vec u), 1 ; f(\vec u \mode \sum \vec u;) ))$ indeed witnesses the required existential.
376 251 adas
	\end{proof}