Révision 257

CSL17/tech-report/appendix-arithmetic.tex (revision 257)
1
%\section{Appendix: remaining axioms of $\basic$}\label{appendix:arithmetic}
2
%
3
%We give here the  list of remaining  axioms of $\basic$, which are directly inspired by the $\basic$ theory of Buss's bounded arithmetic \cite{Buss86book}:
4
%%$\succ{0}(x)$ stand for $2\cdot x$ and $\succ{1}(x)$ stand for $\succ{}(2\cdot x)$,
5
% 
6
% 
CSL17/tech-report/completeness.tex (revision 257)
6 6
	\label{thm:completeness}
7 7
	For every $\mubci{i-1}$ program $f(\vec u ; \vec x)$ (which is in $\fphi i$), there is a $\Sigma^{\safe}_i$ formula $A_f(\vec u, \vec x)$ such that $\arith^i$ proves $\forall^{\normal} \vec u, \forall^{\safe} \vec x, \exists^{\safe} ! y. A_f(\vec u , \vec x , y )$ and $\Nat \models \forall \vec u , \vec x. A_f(\vec u , \vec x , f(\vec u ; \vec x))$.
8 8
\end{theorem}
9
\begin{proof}[Proof sketch]
10
 The proof proceeds by induction on the construction of $\mubci{i-1}$ program $f(\vec u ; \vec x)$ to construct a suitable formula $A_f(\vec u, \vec x)$ .  The case of initial functions is easy, by using the formulas we gave in Sect. \ref{sect:graphsbasicfunctions}. The case of safe composition is also simple, and makes use of the $\rais$ rule and simply combines previously defined graphs by \emph{modus ponens} (or, equivalently, $\cut$) and logical steps. 
11
 Naturally, the interesting cases are predicative recursion and predicative minimisation. 
12
 
13
 For predicative recursion, the basic idea is to follow the classical simulation of primitive recursion in arithmetic, adapted to recursion on notation, by encoding the sequence of recursive calls as an integer $w$. 
14
 The main technical difficulty is the representation of (de)coding functions $\beta (k, x)$ (``the $k$th element of the sequence $x$'') and $\langle x,y \rangle$ (``the pair $(x,y)$'').
15
 For this we represent instead the length-bounded variants of these functions given towards the end of Sect.~\ref{sect:prelims}, relying on the bounded minimisation and polychecking results, Lemmas~\ref{lem:bounded-minimisation} and \ref{lem:polychecking}, to find appropriate length bounds.
16
%  which is sorted in a suitable way so that the formula $A_f$  is in the same class $\Sigma^{\safe}_i$ as $A_g$,  $A_{h_0}$ and $A_{h_1}$.  This can be obtained by defining  the predicate $\beta (k, w, y)$ with $k$ in $\normal$ and $w$, $y$ in $\safe$.
9
%\begin{proof}[Proof sketch]
10
% The proof proceeds by induction on the construction of $\mubci{i-1}$ program $f(\vec u ; \vec x)$ to construct a suitable formula $A_f(\vec u, \vec x)$ .  The case of initial functions is easy, by using the formulas we gave in Sect. \ref{sect:graphsbasicfunctions}. The case of safe composition is also simple, and makes use of the $\rais$ rule and simply combines previously defined graphs by \emph{modus ponens} (or, equivalently, $\cut$) and logical steps. 
11
% Naturally, the interesting cases are predicative recursion and predicative minimisation. 
12
% 
13
% For predicative recursion, the basic idea is to follow the classical simulation of primitive recursion in arithmetic, adapted to recursion on notation, by encoding the sequence of recursive calls as an integer $w$. 
14
% The main technical difficulty is the representation of (de)coding functions $\beta (k, x)$ (``the $k$th element of the sequence $x$'') and $\langle x,y \rangle$ (``the pair $(x,y)$'').
15
% For this we represent instead the length-bounded variants of these functions given towards the end of Sect.~\ref{sect:prelims}, relying on the bounded minimisation and polychecking results, Lemmas~\ref{lem:bounded-minimisation} and \ref{lem:polychecking}, to find appropriate length bounds.
16
%%  which is sorted in a suitable way so that the formula $A_f$  is in the same class $\Sigma^{\safe}_i$ as $A_g$,  $A_{h_0}$ and $A_{h_1}$.  This can be obtained by defining  the predicate $\beta (k, w, y)$ with $k$ in $\normal$ and $w$, $y$ in $\safe$.
17
%
18
% 
19
% For predicative minimisation, assume $f$ is defined as  $\succ 1 \mu x .( g(\vec u ; \vec x , x) =_2 0)$ (or $0$ if no such $x$ exists).
20
%  By induction hypothesis we have a $\Sigma^{\safe}_{i-1}$ formula $A_g (\vec u , \vec x , x , y)$  satisfying the property. We then define $A_f(\vec u ; \vec x , z)$ as the following $\Sigma^{\safe}_{i}$ formula:
21
%\[
22
%\begin{array}{rl}
23
%&\left(
24
%z=0 \  \cand \ \forall x^\safe , y^\safe . (A_g (\vec u , \vec x , x, y) \cimp y=_2 1)
25
%\right) \\
26
%\cor & \left(
27
%\begin{array}{ll}
28
%z\neq 0 
29
%& \cand\   \forall y^\safe . (A_g (\vec u , \vec x , p z , y) \cimp y=_2 0 ) \\
30
%& \cand\ \forall x^\safe < p z . \forall y^\safe . (A_g (\vec u , \vec x , x , y) \cimp y=_2 1) 
31
%\end{array}
32
%\right)
33
%\end{array}
34
%\]
35
%As for the analogous bounded arithmetic theory $S^i_2$ (\cite{Buss86book}, Thm 20, p. 58),  $\arith^i$ can prove a \emph{minimisation} principle for $\Sigma^\safe_{i-1}$ formulas, allowing us to extract the \emph{least} witness of a safe existential, which we apply to $\exists x^\safe , y^\safe .  (A_g (\vec u ,\vec x , x , y) \cand y=_2 0)$. From here we are able to readily prove the totality of $A_f(\vec u ; \vec x , z)$, notably relying crucially on classical reasoning.
36
%\end{proof}
17 37

  
18
 
19
 For predicative minimisation, assume $f$ is defined as  $\succ 1 \mu x .( g(\vec u ; \vec x , x) =_2 0)$ (or $0$ if no such $x$ exists).
20
  By induction hypothesis we have a $\Sigma^{\safe}_{i-1}$ formula $A_g (\vec u , \vec x , x , y)$  satisfying the property. We then define $A_f(\vec u ; \vec x , z)$ as the following $\Sigma^{\safe}_{i}$ formula:
21
\[
22
\begin{array}{rl}
23
&\left(
24
z=0 \  \cand \ \forall x^\safe , y^\safe . (A_g (\vec u , \vec x , x, y) \cimp y=_2 1)
25
\right) \\
26
\cor & \left(
27
\begin{array}{ll}
28
z\neq 0 
29
& \cand\   \forall y^\safe . (A_g (\vec u , \vec x , p z , y) \cimp y=_2 0 ) \\
30
& \cand\ \forall x^\safe < p z . \forall y^\safe . (A_g (\vec u , \vec x , x , y) \cimp y=_2 1) 
31
\end{array}
32
\right)
33
\end{array}
34
\]
35
As for the analogous bounded arithmetic theory $S^i_2$ (\cite{Buss86book}, Thm 20, p. 58),  $\arith^i$ can prove a \emph{minimisation} principle for $\Sigma^\safe_{i-1}$ formulas, allowing us to extract the \emph{least} witness of a safe existential, which we apply to $\exists x^\safe , y^\safe .  (A_g (\vec u ,\vec x , x , y) \cand y=_2 0)$. From here we are able to readily prove the totality of $A_f(\vec u ; \vec x , z)$, notably relying crucially on classical reasoning.
38
\begin{proof}
39
	We proceed by structural induction on a $\mubc^{i-1} $ program, dealing with each case in the proceeding paragraphs.
40
	
41
	The property is easily verified for the class of initial functions of  $\mubci{i-1}$: constant, projections, (binary) successors, predecessor, conditional, as already shown in Sect. \ref{sect:graphsbasicfunctions}. Now let us examine the three constructions: predicative minimisation, predicative (safe) recursion and composition. 
42
	\paragraph*{Predicative minimisation}
43
	Suppose $f(\vec u ; \vec x)$ is defined by predicative minimisation from $g$ (we then denote $f$ as as $\mu x^{+1} . g(\vec u ; \vec x , x) =_2 0$). 
44
	By definition $g$ is in $\mubci{i-2}$, and so by the inductive hypothesis there is a $\Sigma^{\safe}_{i-1}$ formula $A_g (\vec u , \vec x , x , y)$ computing the graph of $g$ such that,
45
	\[
46
	\arith^i \proves \forall \vec u^\normal . \forall \vec x^\safe , x^\safe . \exists ! y^\safe . A_g(\vec u , \vec x , x , y)
47
	\]
48
	Let us define $A_f(\vec u ; \vec x , z)$ as:
49
	\[
50
	\begin{array}{rl}
51
	&\left(
52
	z=0 \  \cand \ \forall x^\safe , y^\safe . (A_g (\vec u , \vec x , x, y) \cimp y=_2 1)
53
	\right) \\
54
	\cor & \left(
55
	\begin{array}{ll}
56
	z\neq 0 
57
	& \cand\   \forall y^\safe . (A_g (\vec u , \vec x , p z , y) \cimp y=_2 0 ) \\
58
	& \cand\ \forall x^\safe < p z . \forall y^\safe . (A_g (\vec u , \vec x , x , y) \cimp y=_2 1) 
59
	\end{array}
60
	\right)
61
	\end{array}
62
	\]
63
	Notice that $A_f$ is $\Pi^{\safe}_{i-1}$, since $A_g$ is $\Sigma^{\safe}_{i-1}$ and occurs only in negative context above, with additional safe universal quantifiers occurring in positive context.
64
	In particular this means $A_f$ is $\Sigma^{\safe}_i$.
65
	
66
	Now, to prove totality of $A_f$, we rely on $\Sigma^\safe_{i-1}$-minimisation, which is a consequence of $\cpind{\Sigma^\safe_i}$:
67
	
68
	\begin{lemma}
69
		[Minimisation]
70
		$\arith^i \proves \cmin{\Sigma^\safe_{i-1}}$.	
71
	\end{lemma}
72
	% see Thm 20 p. 58 in Buss' book.
73
	%\begin{proof}
74
	%\end{proof}
75
	\begin{proof}
76
		This Lemma is proved by using the same method as for the proof of the analogous result in the bounded arithmetic $S_2^{i}$ (see \cite{Buss86book}, Thm 20, p. 58).
77
		
78
		Let $A(x)$ be a  $\Sigma^\safe_{i-1}$ formula, with $x$ in $\safe$. We define the formula $B(a,b,c)$ as:
79
		$$ \forall x^{\safe}. (x < |a| \moins b \cimp \zerobit(x,c)) \cand \forall y^{\safe}<c. \neg A(y) \cand \exists y^{\safe} < 2^{|a|\moins b}.A(c+y)$$
80
		where $a$ is in $\normal$, $b$ in $\normal$ and $c$ in $\safe$.  $B(a,b,c)$ is in $\Sigma^\safe_{i}$.
81
		
82
		The intuitive idea of the proof is to observe that, if $A(a)$ is true for $a\neq 0$, then  $\exists x^{\safe}\leq a. B(a,b,x)$ holds for $b=0$, and to try to prove it for $b=|a|$, by using a length induction on $b$.
83
		
84
		First, one can prove:
85
		$$ (A(a) \cand a \neq 0) \cimp B(a,0,0).$$ 
86
		And thus:
87
		$$ (A(a) \cand a \neq 0) \cimp \exists x^{\safe}\leq a .B(a,0,x).$$ 
88
		We then can check that the two following statements are provable:
89
		$$
90
		\begin{array}{rcl}
91
		(b<|a| \cand B(a,b,c)\cand \exists y^{\safe}<2^{|a| \moins (b+1)}.A(c+y)) &\cimp& B(a,\succ{} b,c)\\
92
		(b<|a| \cand B(a,b,c)\cand \forall y^{\safe}<2^{|a| \moins(b+1)}.  A(c+y)) &\cimp & B(a,\succ{} b, c+2^{|a| \moins (b+1)})
93
		\end{array}
94
		$$
95
		Moreover we have: $A(a) \cand B(a,b,c) \cimp c\leq a$.
96
		From these three statements we deduce:
97
		$$(A(a) \cand a \neq 0 \cand b<|a| \cand \exists x^{\safe} \leq a. B(a,b,x)) \cimp \exists x^{\safe } \leq a.B(a,\succ{} b,x).$$
98
		Note that here we have used the fact that we are in classical logic.
99
		
100
		The formula $\exists x\leq a. B(a,b,c)$ is in $\Sigma^{\safe}_{i}$, so by $\Sigma^{\safe}_{i}$-LIND on the formula $\exists x\leq a. B(a,b,c)$, with the variable $b$ which is in $\normal$,  we obtain:
101
		$$(A(a) \cand a \neq 0 ) \cimp \exists x^{\safe } \leq a.B(a,|a|,x).$$
102
		But $B(a,|a|,x)$ implies $(\forall y^{\safe}<x. \neg A(y))\cand A(x)$, so we have proven:
103
		$$(A(a) \cand a \neq 0 ) \cimp (\exists x^{\safe } \leq a. (\forall y^{\safe}<x. \neg A(y))\cand A(x))$$
104
		which is the $\Sigma_{i-1}^{\safe}$ axiom for $A$.
105
	\end{proof}
106
	
107
	Now, working in $\arith^i$, let $\vec u \in \normal , \vec x \in \safe$ and let us prove:
108
	\[
109
	\exists !z^\safe  . A_f(\vec u ; \vec x , z)
110
	\]
111
	Suppose that $\exists x^\safe , y^\safe .  (A_g (\vec u ,\vec x , x , y) \cand y=_2 0)$.
112
	We can apply minimisation due to the lemma above to find the least $x\in \safe$ such that $\exists y^\safe .  (A_g (\vec u ,\vec x , x , y) \cand y=_2 0)$, and we set $z = \succ 1 x$. So $x= p z$. 
113
	%\todo{verify $z\neq 0$ disjunct.} 
114
	Then $z \neq 0$ holds. Moreover we had  $\exists ! y^\safe . A_g(\vec u , \vec x , x , y)$. So we deduce that
115
	$\forall y^\safe . (A_g (\vec u , \vec x , p z , y) \cimp y=_2 0 ) $. Finally, as $p z$ is the least element such that
116
	$\exists y^\safe .  (A_g (\vec u ,\vec x , p z , y) \cand y=_2 0)$, we deduce 
117
	$\ \forall x^\safe < p z . \forall y^\safe . (A_g (\vec u , \vec x , x , y) \cimp y=_2 1) $. We conclude that the second member of the disjunction
118
	$A_f(\vec u ; \vec x , z)$ is proven.  
119
	
120
	Otherwise, we have that $\forall x^\safe , y^\safe . (A_g (\vec u , \vec x , x, y) \cimp y=_2 1)$, so we can set $z=0$ and the first member of the disjunction $A_f(\vec u ; \vec x , z)$ is proven.  
121
	
122
	So we have proven $\exists z^\safe  . A_f(\vec u ; \vec x , z)$, and unicity can be easily verified.
123
	
124
	\paragraph*{Predicative recursion on notation}
125
	
126
	\anupam{Assume access to the following predicates (makes completeness easier, soundness will be okay):
127
		\begin{itemize}
128
			%	\item $\pair x y z $ . ``$z$ is the sequence that appends $y$ to the sequence $x$''
129
			\item $\pair x y z$. ``$z$ is the sequence that prepends $x$ to the sequence $y$''
130
			\item $\beta (i; x ,y)$. ``The $i$th element of the sequence $x$ is $y$.''
131
		\end{itemize}
132
	}
133
	\patrick{I also assume access to the following predicates:
134
		\begin{itemize}
135
			%   \item $\zerobit (u,k)$ (resp. $\onebit(u,k)$). " The $k$th bit of $u$ is 0 (resp. 1)"
136
			%   \item $\pref(k,x,y)$. "The prefix of $x$ (as a binary string) of length $k$ is $y$" 
137
			\item $\addtosequence(w,y,w')$. "$w'$ represents the sequence obtained by adding $y$ at the end of the sequence represented by $w$". Here we are referring to sequences which can be decoded with predicate $\beta$.
138
		\end{itemize}}
139
		In the following we will use the predicates $\zerobit (u,k)$, $\onebit(u,k)$, $\pref(k,x,y)$ which have been defined in Sect. \ref{sect:graphsbasicfunctions}.
140
		
141
		Suppose that $f$ is defined by predicative recursion on notation:
142
		\[
143
		\begin{array}{rcl}
144
		f(0 , \vec u ; \vec x) & \dfn & g(\vec u ; \vec x) \\
145
		f(\succ i u, \vec u ; \vec x) & \dfn & h_i( u , \vec u ; \vec x , f(u , \vec u ; \vec x))
146
		\end{array}
147
		\]
148
		
149
		\anupam{using $\beta(i,x,y)$ predicate for sequences: ``$i$th element of $x$ is $y$''. Provably total in $\arith^1$.}
150
		
151
		Suppose we have $\Sigma^\safe_i$ formulae $A_g (\vec u ; \vec x,y)$ and $A_{h_i} (u , \vec u ; \vec x , y , z)$ computing the graphs of $g$ and $h_i$ respectively, provably total in $\arith^i$.
152
		We define $A_f (u ,\vec u ; \vec x , y)$ as,
153
		\[
154
		\exists w^\safe . \left(
155
		\begin{array}{ll}
156
		& 
157
		%Seq(z) \cand 
158
		\exists^{\safe} y_0 . ( A_g (\vec u , \vec x , y_0) \cand \beta(0, w , y_0) ) \cand \beta(|u|, w,y ) \\
159
		%\cand & \forall k < |u| . \exists y_k , y_{k+1} . ( \beta (k, w, y_k) \cand \beta (k+1 ,w, y_{k+1})  \cand A_{h_i} (u , \vec u ; \vec x , y_k , y_{k+1}) )\\
160
		\cand & \forall^{\normal}  k < |u| . \exists^{\safe} y_k , y_{k+1} . ( \beta (k, w, y_k) \cand \beta (k+1 ,w, y_{k+1})  \cand B (u , \vec u ; \vec x , y_k , y_{k+1}) )
161
		\end{array}
162
		\right)
163
		\]
164
		where 
165
		\[
166
		B (u , \vec u ; \vec x , y_k , y_{k+1}) = \left(
167
		\begin{array}{ll}
168
		& \zerobit(u,k+1) \cimp  \exists v .(\pref(k,u,v)  \cand A_{h_0}(v,\vec u ; \vec x, y_k, y_{k+1}) )\\
169
		\cand &  \onebit(u,k+1) \cimp  \exists v .(\pref(k,u,v)  \cand A_{h_1}(v,\vec u ; \vec x, y_k, y_{k+1}) )
170
		\end{array}
171
		\right)
172
		\]
173
		
174
		%which is $\Sigma^\safe_i$ by inspection, and indeed defines the graph of $f$.
175
		
176
		To show totality, let $\vec u \in \normal, \vec x \in \safe$ and proceed by induction on $u \in \normal$.
177
		The base case, when $u=0$, is immediate from the totality of $A_g$, so for the inductive case we need to show:
178
		\[
179
		\exists y^\safe . A_f (u , \vec u ; \vec x , y) 
180
		\quad \seqar \quad
181
		\exists z^\safe . A_f (s_i u, \vec u ; \vec x , z)
182
		\]
183
		
184
		So let us assume $\exists y^\safe . A_f (u , \vec u ; \vec x , y) $. Then there exists $w$ such that $\safe(w)$ and 
185
		$A_f (u , \vec u ; \vec x , w) $.
186
		
187
		We know that there exists a $z$ such that $A_{h_i}(u,\vec u ; \vec x, y, z)$. Let then $w'$ be such that
188
		$\addtosequence(w,z,w')$. Observe also that we have $\pref(|u|,s_i u,u)$
189
		
190
		So we have, for $k=|u|$:
191
		
192
		$$  \beta (k, w', y) \cand \beta (k+1 ,w', z)  \cand B (u , \vec u ; \vec x , y , z).$$
193
		
194
		and we can conclude that
195
		\[
196
		\exists w'^\safe . \left(
197
		\begin{array}{ll}
198
		& 
199
		%Seq(z) \cand 
200
		\exists y_0 . ( A_g (\vec u , \vec x , y_0) \cand \beta(0, w' , y_0) ) \cand \beta(|u|+1, w',z ) \\
201
		\cand & \forall k < |u|+1 . \exists y_k , y_{k+1} . ( \beta (k, w, y_k) \cand \beta (k+1 ,w, y_{k+1})  \cand B (u , \vec u ; \vec x , y_k , y_{k+1}) )
202
		\end{array}
203
		\right)
204
		\]
205
		So $\exists z^{\safe} . A_f (s_i u, \vec u ; \vec x , z)$ has been proven. So by induction we have proven $\forall^{\normal} u,  
206
		\forall^{\normal} \vec u, \exists^{\safe} y. A_f (u ,\vec u ; \vec x , y)$. Moreover one can also check the unicity of $y$, and so we have proved the required formula. 
207
		
208
		\anupam{here need to `add' element to the computation sequence. Need to do this earlier in the paper.}
209
		
210
		\anupam{for inductive cases, need $u\neq 0$ for $\succ 0$ case.}
211
		
212
		\paragraph*{Safe composition}
213
		Now suppose that $f$ is defined by safe composition:
214
		\[
215
		f(\vec u ; \vec x) \quad \dfn \quad g( \vec h(\vec u;) ; \vec h' (\vec u ; \vec x) )
216
		\]
217
		
218
		By the inductive hypothesis, let us suppose that we have $\Sigma^\safe_i $ definitions $A_g , A_{h_i} , A_{h_j'} $ of the graphs of $g , h_i , h_j'$ respectively, which are provably total etc.
219
		In particular, by Raising, we have that $\forall \vec u^\normal . \exists v^\normal . A_{h_i} (\vec u , v)$.
220
		
221
		We define $A_f (\vec u , \vec x , z)$ defining the graph of $f$ as follows:
222
		\[
223
		\exists \vec v^\normal . \exists \vec y^\safe .  
224
		\left(  
225
		\bigwedge\limits_i A_{h_i} (\vec u , v_i)
226
		\wedge
227
		\bigwedge\limits_j A_{h_j'} (\vec u ; \vec x , y_j)
228
		\wedge
229
		A_g ( \vec v , \vec y , z ) 
230
		\right)
231
		\]
232
		The provable totality of $A_f$ follows from simple first-order reasoning, mostly cuts and basic quantifier manipulations.
233
		
234
		\todo{elaborate}
235
		
236
		The proof of Thm \ref{thm:completeness} is thus completed.
36 237
\end{proof}
37 238

  
38 239

  
CSL17/tech-report/main.tex (revision 257)
57 57

  
58 58
%% Either use bibtex (recommended), 
59 59

  
60
\newpage
60
%\newpage
61 61
\bibliographystyle{alpha}
62 62
\bibliography{ph-biblio}
63 63

  
CSL17/tech-report/appendix-completeness.tex (revision 257)
1 1
\section{Proof of completeness}\label{appendix:completeness}
2 2

  
3 3
The rest of this section is devoted to a proof of this theorem.
4
We proceed by structural induction on a $\mubc^{i-1} $ program, dealing with each case in the proceeding paragraphs.
5

  
6
The property is easily verified for the class of initial functions of  $\mubci{i-1}$: constant, projections, (binary) successors, predecessor, conditional, as already shown in Sect. \ref{sect:graphsbasicfunctions}. Now let us examine the three constructions: predicative minimisation, predicative (safe) recursion and composition. 
7
\paragraph*{Predicative minimisation}
8
Suppose $f(\vec u ; \vec x)$ is defined by predicative minimisation from $g$ (we then denote $f$ as as $\mu x^{+1} . g(\vec u ; \vec x , x) =_2 0$). 
9
By definition $g$ is in $\mubci{i-2}$, and so by the inductive hypothesis there is a $\Sigma^{\safe}_{i-1}$ formula $A_g (\vec u , \vec x , x , y)$ computing the graph of $g$ such that,
10
\[
11
\arith^i \proves \forall \vec u^\normal . \forall \vec x^\safe , x^\safe . \exists ! y^\safe . A_g(\vec u , \vec x , x , y)
12
\]
13
Let us define $A_f(\vec u ; \vec x , z)$ as:
14
\[
15
\begin{array}{rl}
16
&\left(
17
z=0 \  \cand \ \forall x^\safe , y^\safe . (A_g (\vec u , \vec x , x, y) \cimp y=_2 1)
18
\right) \\
19
\cor & \left(
20
\begin{array}{ll}
21
z\neq 0 
22
& \cand\   \forall y^\safe . (A_g (\vec u , \vec x , p z , y) \cimp y=_2 0 ) \\
23
& \cand\ \forall x^\safe < p z . \forall y^\safe . (A_g (\vec u , \vec x , x , y) \cimp y=_2 1) 
24
\end{array}
25
\right)
26
\end{array}
27
\]
28
Notice that $A_f$ is $\Pi^{\safe}_{i-1}$, since $A_g$ is $\Sigma^{\safe}_{i-1}$ and occurs only in negative context above, with additional safe universal quantifiers occurring in positive context.
29
In particular this means $A_f$ is $\Sigma^{\safe}_i$.
30

  
31
Now, to prove totality of $A_f$, we rely on $\Sigma^\safe_{i-1}$-minimisation, which is a consequence of $\cpind{\Sigma^\safe_i}$:
32

  
33
\begin{lemma}
34
	[Minimisation]
35
	$\arith^i \proves \cmin{\Sigma^\safe_{i-1}}$.	
36
	\end{lemma}
37
	% see Thm 20 p. 58 in Buss' book.
38
	%\begin{proof}
39
	%\end{proof}
40
	\begin{proof}
41
	This Lemma is proved by using the same method as for the proof of the analogous result in the bounded arithmetic $S_2^{i}$ (see \cite{Buss86book}, Thm 20, p. 58).
42
	
43
	Let $A(x)$ be a  $\Sigma^\safe_{i-1}$ formula, with $x$ in $\safe$. We define the formula $B(a,b,c)$ as:
44
	$$ \forall x^{\safe}. (x < |a| \moins b \cimp \zerobit(x,c)) \cand \forall y^{\safe}<c. \neg A(y) \cand \exists y^{\safe} < 2^{|a|\moins b}.A(c+y)$$
45
	where $a$ is in $\normal$, $b$ in $\normal$ and $c$ in $\safe$.  $B(a,b,c)$ is in $\Sigma^\safe_{i}$.
46
	
47
	The intuitive idea of the proof is to observe that, if $A(a)$ is true for $a\neq 0$, then  $\exists x^{\safe}\leq a. B(a,b,x)$ holds for $b=0$, and to try to prove it for $b=|a|$, by using a length induction on $b$.
48
	
49
	First, one can prove:
50
	$$ (A(a) \cand a \neq 0) \cimp B(a,0,0).$$ 
51
	And thus:
52
	$$ (A(a) \cand a \neq 0) \cimp \exists x^{\safe}\leq a .B(a,0,x).$$ 
53
	We then can check that the two following statements are provable:
54
	$$
55
	\begin{array}{rcl}
56
	(b<|a| \cand B(a,b,c)\cand \exists y^{\safe}<2^{|a| \moins (b+1)}.A(c+y)) &\cimp& B(a,\succ{} b,c)\\
57
	(b<|a| \cand B(a,b,c)\cand \forall y^{\safe}<2^{|a| \moins(b+1)}.  A(c+y)) &\cimp & B(a,\succ{} b, c+2^{|a| \moins (b+1)})
58
        \end{array}
59
$$
60
Moreover we have: $A(a) \cand B(a,b,c) \cimp c\leq a$.
61
From these three statements we deduce:
62
$$(A(a) \cand a \neq 0 \cand b<|a| \cand \exists x^{\safe} \leq a. B(a,b,x)) \cimp \exists x^{\safe } \leq a.B(a,\succ{} b,x).$$
63
Note that here we have used the fact that we are in classical logic.
64

  
65
The formula $\exists x\leq a. B(a,b,c)$ is in $\Sigma^{\safe}_{i}$, so by $\Sigma^{\safe}_{i}$-LIND on the formula $\exists x\leq a. B(a,b,c)$, with the variable $b$ which is in $\normal$,  we obtain:
66
$$(A(a) \cand a \neq 0 ) \cimp \exists x^{\safe } \leq a.B(a,|a|,x).$$
67
But $B(a,|a|,x)$ implies $(\forall y^{\safe}<x. \neg A(y))\cand A(x)$, so we have proven:
68
$$(A(a) \cand a \neq 0 ) \cimp (\exists x^{\safe } \leq a. (\forall y^{\safe}<x. \neg A(y))\cand A(x))$$
69
which is the $\Sigma_{i-1}^{\safe}$ axiom for $A$.
70
	\end{proof}
71
	
72
	Now, working in $\arith^i$, let $\vec u \in \normal , \vec x \in \safe$ and let us prove:
73
	\[
74
	\exists !z^\safe  . A_f(\vec u ; \vec x , z)
75
	\]
76
	Suppose that $\exists x^\safe , y^\safe .  (A_g (\vec u ,\vec x , x , y) \cand y=_2 0)$.
77
	We can apply minimisation due to the lemma above to find the least $x\in \safe$ such that $\exists y^\safe .  (A_g (\vec u ,\vec x , x , y) \cand y=_2 0)$, and we set $z = \succ 1 x$. So $x= p z$. 
78
	%\todo{verify $z\neq 0$ disjunct.} 
79
	Then $z \neq 0$ holds. Moreover we had  $\exists ! y^\safe . A_g(\vec u , \vec x , x , y)$. So we deduce that
80
	$\forall y^\safe . (A_g (\vec u , \vec x , p z , y) \cimp y=_2 0 ) $. Finally, as $p z$ is the least element such that
81
	$\exists y^\safe .  (A_g (\vec u ,\vec x , p z , y) \cand y=_2 0)$, we deduce 
82
	$\ \forall x^\safe < p z . \forall y^\safe . (A_g (\vec u , \vec x , x , y) \cimp y=_2 1) $. We conclude that the second member of the disjunction
83
	$A_f(\vec u ; \vec x , z)$ is proven.  
84
	
85
	Otherwise, we have that $\forall x^\safe , y^\safe . (A_g (\vec u , \vec x , x, y) \cimp y=_2 1)$, so we can set $z=0$ and the first member of the disjunction $A_f(\vec u ; \vec x , z)$ is proven.  
86
	
87
	So we have proven $\exists z^\safe  . A_f(\vec u ; \vec x , z)$, and unicity can be easily verified.
88
	
89
	\paragraph*{Predicative recursion on notation}
90
	
91
	\anupam{Assume access to the following predicates (makes completeness easier, soundness will be okay):
92
		\begin{itemize}
93
			%	\item $\pair x y z $ . ``$z$ is the sequence that appends $y$ to the sequence $x$''
94
			\item $\pair x y z$. ``$z$ is the sequence that prepends $x$ to the sequence $y$''
95
			\item $\beta (i; x ,y)$. ``The $i$th element of the sequence $x$ is $y$.''
96
			\end{itemize}
97
			}
98
			\patrick{I also assume access to the following predicates:
99
				\begin{itemize}
100
					%   \item $\zerobit (u,k)$ (resp. $\onebit(u,k)$). " The $k$th bit of $u$ is 0 (resp. 1)"
101
					%   \item $\pref(k,x,y)$. "The prefix of $x$ (as a binary string) of length $k$ is $y$" 
102
					\item $\addtosequence(w,y,w')$. "$w'$ represents the sequence obtained by adding $y$ at the end of the sequence represented by $w$". Here we are referring to sequences which can be decoded with predicate $\beta$.
103
					\end{itemize}}
104
					In the following we will use the predicates $\zerobit (u,k)$, $\onebit(u,k)$, $\pref(k,x,y)$ which have been defined in Sect. \ref{sect:graphsbasicfunctions}.
105
					
106
					Suppose that $f$ is defined by predicative recursion on notation:
107
					\[
108
					\begin{array}{rcl}
109
					f(0 , \vec u ; \vec x) & \dfn & g(\vec u ; \vec x) \\
110
					f(\succ i u, \vec u ; \vec x) & \dfn & h_i( u , \vec u ; \vec x , f(u , \vec u ; \vec x))
111
					\end{array}
112
					\]
113
					
114
					\anupam{using $\beta(i,x,y)$ predicate for sequences: ``$i$th element of $x$ is $y$''. Provably total in $\arith^1$.}
115
					
116
					Suppose we have $\Sigma^\safe_i$ formulae $A_g (\vec u ; \vec x,y)$ and $A_{h_i} (u , \vec u ; \vec x , y , z)$ computing the graphs of $g$ and $h_i$ respectively, provably total in $\arith^i$.
117
					We define $A_f (u ,\vec u ; \vec x , y)$ as,
118
					\[
119
					\exists w^\safe . \left(
120
					\begin{array}{ll}
121
					& 
122
					%Seq(z) \cand 
123
					\exists^{\safe} y_0 . ( A_g (\vec u , \vec x , y_0) \cand \beta(0, w , y_0) ) \cand \beta(|u|, w,y ) \\
124
					%\cand & \forall k < |u| . \exists y_k , y_{k+1} . ( \beta (k, w, y_k) \cand \beta (k+1 ,w, y_{k+1})  \cand A_{h_i} (u , \vec u ; \vec x , y_k , y_{k+1}) )\\
125
					\cand & \forall^{\normal}  k < |u| . \exists^{\safe} y_k , y_{k+1} . ( \beta (k, w, y_k) \cand \beta (k+1 ,w, y_{k+1})  \cand B (u , \vec u ; \vec x , y_k , y_{k+1}) )
126
					\end{array}
127
					\right)
128
					\]
129
					where 
130
					\[
131
					B (u , \vec u ; \vec x , y_k , y_{k+1}) = \left(
132
					\begin{array}{ll}
133
					& \zerobit(u,k+1) \cimp  \exists v .(\pref(k,u,v)  \cand A_{h_0}(v,\vec u ; \vec x, y_k, y_{k+1}) )\\
134
					\cand &  \onebit(u,k+1) \cimp  \exists v .(\pref(k,u,v)  \cand A_{h_1}(v,\vec u ; \vec x, y_k, y_{k+1}) )
135
					\end{array}
136
					\right)
137
					\]
138
					
139
					%which is $\Sigma^\safe_i$ by inspection, and indeed defines the graph of $f$.
140
					
141
					To show totality, let $\vec u \in \normal, \vec x \in \safe$ and proceed by induction on $u \in \normal$.
142
					The base case, when $u=0$, is immediate from the totality of $A_g$, so for the inductive case we need to show:
143
					\[
144
					\exists y^\safe . A_f (u , \vec u ; \vec x , y) 
145
					\quad \seqar \quad
146
					\exists z^\safe . A_f (s_i u, \vec u ; \vec x , z)
147
					\]
148
					
149
					So let us assume $\exists y^\safe . A_f (u , \vec u ; \vec x , y) $. Then there exists $w$ such that $\safe(w)$ and 
150
					$A_f (u , \vec u ; \vec x , w) $.
151
					
152
					We know that there exists a $z$ such that $A_{h_i}(u,\vec u ; \vec x, y, z)$. Let then $w'$ be such that
153
					$\addtosequence(w,z,w')$. Observe also that we have $\pref(|u|,s_i u,u)$
154
					
155
					So we have, for $k=|u|$:
156
					
157
					$$  \beta (k, w', y) \cand \beta (k+1 ,w', z)  \cand B (u , \vec u ; \vec x , y , z).$$
158
					
159
					and we can conclude that
160
					\[
161
					\exists w'^\safe . \left(
162
					\begin{array}{ll}
163
					& 
164
					%Seq(z) \cand 
165
					\exists y_0 . ( A_g (\vec u , \vec x , y_0) \cand \beta(0, w' , y_0) ) \cand \beta(|u|+1, w',z ) \\
166
					\cand & \forall k < |u|+1 . \exists y_k , y_{k+1} . ( \beta (k, w, y_k) \cand \beta (k+1 ,w, y_{k+1})  \cand B (u , \vec u ; \vec x , y_k , y_{k+1}) )
167
					\end{array}
168
					\right)
169
					\]
170
					So $\exists z^{\safe} . A_f (s_i u, \vec u ; \vec x , z)$ has been proven. So by induction we have proven $\forall^{\normal} u,  
171
					\forall^{\normal} \vec u, \exists^{\safe} y. A_f (u ,\vec u ; \vec x , y)$. Moreover one can also check the unicity of $y$, and so we have proved the required formula. 
172
					
173
					\anupam{here need to `add' element to the computation sequence. Need to do this earlier in the paper.}
174
					
175
					\anupam{for inductive cases, need $u\neq 0$ for $\succ 0$ case.}
176
					
177
					\paragraph*{Safe composition}
178
					Now suppose that $f$ is defined by safe composition:
179
					\[
180
					f(\vec u ; \vec x) \quad \dfn \quad g( \vec h(\vec u;) ; \vec h' (\vec u ; \vec x) )
181
					\]
182
					
183
					By the inductive hypothesis, let us suppose that we have $\Sigma^\safe_i $ definitions $A_g , A_{h_i} , A_{h_j'} $ of the graphs of $g , h_i , h_j'$ respectively, which are provably total etc.
184
					In particular, by Raising, we have that $\forall \vec u^\normal . \exists v^\normal . A_{h_i} (\vec u , v)$.
185
					
186
					We define $A_f (\vec u , \vec x , z)$ defining the graph of $f$ as follows:
187
					\[
188
					\exists \vec v^\normal . \exists \vec y^\safe .  
189
					\left(  
190
					\bigwedge\limits_i A_{h_i} (\vec u , v_i)
191
					\wedge
192
					\bigwedge\limits_j A_{h_j'} (\vec u ; \vec x , y_j)
193
					\wedge
194
					A_g ( \vec v , \vec y , z ) 
195
					\right)
196
					\]
197
					The provable totality of $A_f$ follows from simple first-order reasoning, mostly cuts and basic quantifier manipulations.
198
					
199
					\todo{elaborate}
200
					
201
					The proof of Thm \ref{thm:completeness} is thus completed.

Formats disponibles : Unified diff