Index: CSL16/feas-arith-wfm.tex
===================================================================
--- CSL16/feas-arith-wfm.tex	(revision 22)
+++ CSL16/feas-arith-wfm.tex	(revision 23)
@@ -684,6 +684,51 @@
 \subsection{Bellantoni-Cook programs}
 We first recall the notion of safe recursion on notation from BC. TODO
 
+\anupam{Do we need simultaneous PRN? cf.\ Bellantoni's thesis.}
+
+\todo{reformulate below for binary words, not natural numbers?}
+
+\begin{definition}
+	[BC functions]
+	BC is the set of functions generated by the following initial functions and closure schemes.
+	
+%	\paragraph{Initial functions}
+	There are the following initial functions:
+	\begin{enumerate}
+		\item The constant function $0$ which takes no arguments and outputs $0 \in \Nat$.
+		\item The projection functions $\pi^{m,n}_k ( x_1 , \dots , x_m ; x_{m+1} , \dots, x_{m+n} )  := x_k$ for $n,m \in \Nat$ and $1 \leq k \leq m+n$.
+		\item The successor functions $\succ_i ( ; x) := xi$ for $i = 0,1$.
+		\item The predecessor function $\pred (; x) := \begin{cases}
+		0 & x = 0 \\
+		x' & x = x'i
+		\end{cases}$.
+		\item The conditional function $\cond (;x,y,z) := \begin{cases}
+		y & x \mod{2} = 0 \\
+		z & \text{otherwise}
+		\end{cases}$.
+	\end{enumerate}
+	
+	There are the following closure properties.
+	\begin{enumerate}
+	\setcounter{enumi}{5}
+	\item Predicative recursion on notation. If $g, h_0, h_1 $ are in BC then so is the function $f$ defined by,
+	\[
+	\begin{array}{rcl}
+	f(0, \vec v ; \vec x) & := & g(\vec v ; \vec x) \\
+	f (\succ_i u , \vec v ; \vec x ) & := & h_i ( u , \vec v ; \vec x , f (u , \vec v ; \vec x) )
+	\end{array}
+	\]
+	for $i = 0,1$, so long as the expressions are well-formed (i.e.\ in number/sort of arguments).
+	\item Safe composition. If $g, \vec h, \vec h'$ are in BC then so is $f$ defined by,
+	\[
+	f (\vec u ; \vec x) \quad := \quad g ( \vec h(\vec u ; ) ; \vec h' (\vec u ; \vec x) )
+	\]
+	so long as the expression is well-formed.
+	\end{enumerate}
+	\end{definition}
+
+
+
 \subsection{Convergence in arithmetic}
 \begin{theorem}
 	[Convergence]
@@ -804,16 +849,18 @@
 	\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.}
 	
 	\subsection{The translation}
-	Need witness predicate so that we know what is being preserved.
 
 \begin{definition}
 	[Translation]
-	We give a translation of proofs $\pi$ of sequents $\Gamma(\vec a) \seqar \Delta(\vec a)$ to BC-programs for a vector of functions $\vec f^\pi : \type(\bigotimes\Gamma) \times \Nat^{|\vec a|} \to \type(\bigparr\Delta)$ such that:
+	We give a translation of free-cut free $\Sigma^\nat_1$-$\pind$ proofs $\pi$ of sequents $\Gamma(\vec a) \seqar \Delta(\vec a)$ to BC-programs for a vector of functions $\vec f^\pi$ with argument of type $\type \left(\bigotimes\Gamma\right)$ such that $|\vec f^\pi | = | \type\left(\bigparr\Delta\right)|$ and:
 	\[
 	\witness{\vec a}{\bigotimes \Gamma} (\vec w , \vec a) \implies \witness{\vec a}{\bigparr \Delta } (\vec f(\vec w , \vec a), \vec a)
 	\]
-	We will be explicit about normal and safe inputs when necessary, for the most part we will simply rearrange inputs into lists $(\vec x; \vec a)$ as in BC framework.
 	
+	\anupam{to consider: do we need parameters $\vec a$ in argument of $f$? Or does $\nat$ predicate take care of this?}
+	
+%	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.
+	
 	We often suppress the parameters $\vec a$ when it is not important.	
 	
 	\anupam{Is this implication provable in Bellantoni's version of PV based on BC?}
@@ -822,6 +869,9 @@
 	
 
 	
+	The translation is by induction on the size of a free-cut free proof, so we proceed by analysis of the final step of a proof.
+	
+	Suppose $\pi$ ends with a $\rigrul{\land}$ step:
 	\[
 	\vlderivation{
 		\vliin{\land}{}{ \Gamma, \Sigma \seqar \Delta, \Pi, A\land B }{
@@ -831,14 +881,26 @@
 			}
 		}
 	\]
-	
-	So we have $\vec f^{1} (\vec x ; \vec a)$ and $\vec f^2 (\vec y ; \vec b)$ for $\pi_1 $ and $\pi_2$ respectively, by the inductive hypothesis. We simply construct $\vec f^\pi$ by rearranging these functions:
+	By the inductive hypothesis let us suppose we have functions $\vec g (\vec u; \vec x)$ and $\vec h (\vec v ; \vec y)$ from $\pi_1$ and $\pi_2$ respectively, where $\type\left( \bigotimes\Gamma \right) = (\vec u; \vec x)$ and $\type \left( \bigotimes \Sigma \right) = (\vec v ; \vec y)$. Let us write $\vec g = (\vec g^\Delta , \vec g^A)$ and $\vec h = (\vec h^\Pi , \vec h^B)$, to denote the $\Delta$ and $A$ parts of $\vec g$ and the $\Pi$ and $B$ parts of $\vec h$.
+%	So we have $\vec f^{1} (\vec x ; \vec a)$ and $\vec f^2 (\vec y ; \vec b)$ for $\pi_1 $ and $\pi_2$ respectively, by the inductive hypothesis. 
+	We simply construct $\vec f^\pi$ by rearranging these tuples of functions:
 	\[
-	\vec f^\pi (\vec x , \vec y ; \vec a , \vec b) \quad := \quad ( f^1_1 (\vec x ; \vec a) , \dots , f^1_{|\Delta|} (\vec x ; \vec a) , f^2_1 (\vec y; \vec b) , \dots , f^2_{|\Pi|} (\vec y ; \vec b) , f^1_{|\Delta|+1} (\vec x ; \vec a ) , f^2_{|\Pi|+1} (\vec y ; \vec b)
+	\vec f^\pi (\vec u , \vec v ; \vec x , \vec y)
+	\quad := \quad
+	\left(
+	\vec g^\Delta (\vec u ; \vec x) , \vec h^\Pi (\vec v ; \vec y)  , \vec g^A (\vec u ; \vec x) , \vec h^B (\vec v ; \vec y)
+	\right)
 	\] 
 	
-	\anupam{bad notation since need to include free variables of sequent too. (also of theory.) Reconsider.}
+	We will continue with a similar notational convention as above in the remainder of this argument.
 	
+%	\anupam{bad notation since need to include free variables of sequent too. (also of theory.) Reconsider.}
+	
+	The case when $\pi$ ends with a $\lefrul{\lor}$ step is analogous to the $\rigrul{\land}$ case above.
+	
+	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'}$.
+	
+	Suppose $\pi$ ends with a $\lefrul{\cntr}$ step,
 	\[
 	\vlderivation{
 		\vlin{\lefrul{\cntr}}{}{ !A , \Gamma \seqar \Delta }{
@@ -846,42 +908,55 @@
 			}
 		}
 	\]
-	Have $\vec f' (x_1 , x_2 , \vec y ; \vec a)$ for $\pi'$. Define
+	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'$, respectively, and $\type (\Gamma) = (\vec v; \vec x)$. (Recall that the typing corresponding to $!$ means that all inputs for each $!A$ are normal). We define $\vec f^\pi$ as expected, duplicating the arguments for $!A$:
 	\[
-	\vec f (x_1 , \vec y ; \vec a) \quad := \quad \vec f'(x_1 , x_1 , \vec y ; \vec a)
+	\vec f^\pi (\vec u , \vec v ; \vec x)
+	\quad := \quad
+	\vec f (\vec u, \vec u , \vec v ; \vec x)
 	\]
-	\[
-	\vlderivation{
-	\vlin{\rigrul{\cntr}}{}{\Gamma \seqar \Delta, ?A}{
-	\vltr{\pi'}{  \Gamma \seqar \Delta, ?A, ?A}{\vlhy{\quad }}{\vlhy{ }}{\vlhy{\quad }}
-	}
-	}
-	\]
-	(need test function against witness predicate?)
+	(Notice that this is obtainable in BC by a trivial instance of safe composition.)
 	
-	\anupam{problem: how to test even equality of two terms? Maybe treat $?$ as $!$ on left?}
 	
-	\anupam{Not a problem by free-cut elimination! Can assume there are no $?$ in the proof! Is this equivalent to treaing $?$ as $!$ on left?}
+%	cntr right
+%	\[
+%	\vlderivation{
+%	\vlin{\rigrul{\cntr}}{}{\Gamma \seqar \Delta, ?A}{
+%	\vltr{\pi'}{  \Gamma \seqar \Delta, ?A, ?A}{\vlhy{\quad }}{\vlhy{ }}{\vlhy{\quad }}
+%	}
+%	}
+%	\]
+%	(need test function against witness predicate?)
+%	
+%	\anupam{problem: how to test even equality of two terms? Maybe treat $?$ as $!$ on left?}
+%	
+%	\anupam{Not a problem by free-cut elimination! Can assume there are no $?$ in the proof! Is this equivalent to treaing $?$ as $!$ on left?}
+%	
+%	\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.}
+%	
+%	\anupam{this is actually the main point.}
+
+For $\rigrul{\cntr}$, notice that no $?$-symbol occurs in a convergence statement, an initial step or an induction formula, so a free-cut free proof is free of $\rigrul{\cntr}$-steps.
+
+\anupam{This is important, so expand on this here or in a remark before/after.}
 	
-	\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.}
 	
-	\anupam{this is actually the main point.}
-	
-	
-	\[
-	\vlderivation{
-	\vliin{\rigrul{\laand}}{}{\Gamma \seqar \Delta, A \laand B}{
-	\vltr{\pi_1}{  \Gamma \seqar \Delta, A}{\vlhy{\quad }}{\vlhy{ }}{\vlhy{\quad }}
-	}{
-	\vltr{\pi_2}{  \Gamma \seqar \Delta, B}{\vlhy{\quad }}{\vlhy{ }}{\vlhy{\quad }}
-	}
-	}
-	\]
-	
-	Suppose we have $\vec f^i (\vec x , \vec a ; \vec y , \vec b)$ from $\pi_i$.
-	
-	\anupam{problem: does this require many tests, just like for contraction? Can we isolate a different complexity class? e.g.\ PH or Grzegorzyck?}
-	\anupam{skip this case and consider later.}
+%	\[
+%	\vlderivation{
+%	\vliin{\rigrul{\laand}}{}{\Gamma \seqar \Delta, A \laand B}{
+%	\vltr{\pi_1}{  \Gamma \seqar \Delta, A}{\vlhy{\quad }}{\vlhy{ }}{\vlhy{\quad }}
+%	}{
+%	\vltr{\pi_2}{  \Gamma \seqar \Delta, B}{\vlhy{\quad }}{\vlhy{ }}{\vlhy{\quad }}
+%	}
+%	}
+%	\]
+%	
+%	Suppose we have $\vec f^i (\vec x , \vec a ; \vec y , \vec b)$ from $\pi_i$.
+%	
+%	\anupam{problem: does this require many tests, just like for contraction? Can we isolate a different complexity class? e.g.\ PH or Grzegorzyck?}
+%	\anupam{skip this case and consider later.}
+
+\anupam{commented stuff on additives. To remark later perhaps.}
+
 \[
 \vlderivation{
 \vliin{\cut}{}{\Gamma , \Sigma \seqar \Delta , \Pi}{
