Index: CSL16/feas-arith-wfm.tex
===================================================================
--- CSL16/feas-arith-wfm.tex	(revision 42)
+++ CSL16/feas-arith-wfm.tex	(revision 43)
@@ -880,9 +880,9 @@
 	Notice that the case above for $!$ is somewhat odd, but makes sense once we realise that no formula of the form $!(A\lor B)$ will occur in a free-cut free proof of a convergence statement. On the other hand, the equivalence $!(A\land B) \cong !A \land !B$ follows since we are working in the affine setting.
 	\end{remark}
 	
+	\anupam{A potential problem that $!(A\lor B) \ncong\  !A \lor !B$. Need concatenation?}
+	\anupam{Can again rely on free-cut elimination if necessary!}
 	
-	
-	
 	\newcommand{\witness}[2]{\mathit{Witness}^{#1}_{#2}}
 	\begin{definition}
 		[Witness predicate]
@@ -1128,7 +1128,9 @@
 
 \anupam{Is this not using a simultaneous version of PRN? Might need concatenation of words/basic coding to deal with this.}
 
+\anupam{Simultaneous PRN is discussed in Bellantoni's thesis. It is fine to add this to the BC-framework.}
 
+
 \end{definition}
 
 \newcommand{\concat}{\mathit{concat}}
Index: CSL16/introduction.tex
===================================================================
--- CSL16/introduction.tex	(revision 42)
+++ CSL16/introduction.tex	(revision 43)
@@ -1,3 +1,29 @@
 \section{Introduction}
 
-\todo{words or integers?}
\ No newline at end of file
+\todo{words or integers?}
+
+
+
+
+
+
+
+
+% % % % % % % % % % Bullet points % % % % % % %
+
+Some points, either here or in body of paper:
+
+\begin{itemize}
+\item Application of free-cut elimination to witnessing arguments: proof of concept.
+\item Examine differences between our arithmetic and Bellantoni and Hofmann: (a) our induction rule, is it equivalent? Maybe not. (b) point about their surjectivity axiom: we do not think it works unless they add another axiom, like Leivant's, for the completeness in the conditional case. We can remark that linear logic solves this problem neatly by use of the additives.
+\item Point about contraction on right: this is what free-cut elimination + linear logic adequately restricts. This is a problem for any classical theory that uses equational specifications.
+\item Regarding Leivant's intrinsic theories: his result about polynomial-time functions being exactly the provably convergent functions of positive existential induction is necessarily in intuitionistic logic. In classical logic he cannot avoid contraction on the right without the linear logic refinement that we have. \anupam{This can be seen as another contribution of our work?}
+\item On the other hand, our completeness argument can be seen as more-or-less what he had in mind, refined to linear logic.
+\item Discuss different approaches to arithmetics for complexity/witnessing. Namely:
+\begin{itemize}
+\item Programs: terms of combinatory logic vs. formulae of arithmetic vs. equational specifications.
+\item Convergence: N predicate vs. $\Pi^0_2$ sentence.
+\end{itemize}
+Remark: use of equational specifications necessitates N predicate. Hence contraction problems present, no problem for first two types of programs since there is a notion of execution (either via a well-typing or by seeing formula as a circuit), and so closed programs can be run and we can conduct equality tests for right-contraction steps.
+\item We should mention future line of work in bounded-arithmetic style, i.e. using formulas as programs.
+\end{itemize}
\ No newline at end of file
Index: CSL16/arithmetic.tex
===================================================================
--- CSL16/arithmetic.tex	(revision 42)
+++ CSL16/arithmetic.tex	(revision 43)
@@ -90,8 +90,15 @@
 %\todo{in existential above, is there a prenexing problem?}
 
 
-\anupam{witnessing functions for above.}
+\anupam{
+NEW INDUCTION STEP:
+\[
+\vliiinf{\pind}{}{!\Gamma, !\nat(t) , \nat (\vec x) \seqar A(t, \vec x) }{!\Gamma , \nat (\vec x) \seqar A(\epsilon, \vec x) }{ !\Gamma, !\nat (a) , \nat (\vec x) , A(a, \vec x) \seqar A(\succ_i a, \vec x) }{!\Gamma, !\nat (a) , \nat (\vec x) , A(a, \vec x) \seqar A(\succ_i a, \vec x)}
+\]
 
+Need to examine strength of this: somewhat weaker since needs actual premiss for base case (only significant because of linear logic), but somewhat stronger because of use of $\nat(\vec x)$ on the left in context.
+}
+
 \end{definition}
 
 \subsection{$\nat$-hierarchy}
Index: CSL16/wfm.tex
===================================================================
--- CSL16/wfm.tex	(revision 42)
+++ CSL16/wfm.tex	(revision 43)
@@ -17,88 +17,42 @@
 \newcommand{\norm}{\nu}
 \newcommand{\safe}{\sigma}
 
-\subsection{Witness/realisability predicate}
 
-\begin{definition}
-	[Typing]
-	To each $\Sigma^\nat_1$-formula $A$ we associate a sorted tuple of variables $\type (A)$, intended to range over $\Nat$, as follows:
-	\[
-	\begin{array}{rcll}
-	\type (\nat (t)) & := & (;x^{\nat (t)} ) & \\
-	\type(s = t) & := & ( ; x^{s = t}) & \\
-	\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)$.} \\
-	\type (A \land B)  & : = & (\vec u , \vec v ; \vec x , \vec y) & \text{if $\type(A) = (\vec u ; \vec x)$ and $\type(B) = (\vec v ; \vec y)$.} \\
-	\type (! A) & : = & ( \vec u ,\vec x  ; ) & \text{if $\type(A) = (\vec u ; \vec x )$.} \\
-	\type (\exists x^\nat . A) & := & (\vec u ; \vec x , y) & \text{if $\type (A) = (\vec u ; \vec x)$.}
-	%	\type (\forall x^N . A) & := & \Nat \to \type(A)
-	\end{array}
-	\]
-	%	where $\nu$ designates that the inputs are normal.
-\end{definition}
-
-
-\anupam{need to account for normality and safety somewhere. Attempting inlined and leaving types without this decoration.}
-
-\begin{remark}
-	[Distribution of $!$]
-	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.
-	
-	On the other hand, since we are working in affine logic, we do in general have $!(A \land B) \cong !A \land !B$.
-\end{remark}
-
-	
-		\newcommand{\witness}[2]{\mathit{Witness}^{#1}_{#2}}
+		
+		\subsection{The translation}
+		
 		\begin{definition}
-			[Witness predicate]
-			We define the following `witness' predicate for $\Sigma^\nat_1$-formulae $A$ with free variables amongst $\vec a$:
+			[Typing]
+			To each $\Sigma^\nat_1$-formula $A$ we associate a sorted tuple of variables $\type (A)$, intended to range over $\Nat$, as follows:
 			\[
 			\begin{array}{rcll}
-			\witness{\vec a}{A} (w, \vec b) & := & w = t(\vec b) & \text{if $A(\vec a)$ is $\nat (t(\vec a))$.} \\
-			\witness{\vec a}{A} (w, \vec b) & := & s(\vec b) = t(\vec b) & \text{if $A(\vec a)$ is $s(\vec a) = t (\vec a)$.} \\
-			\witness{\vec a}{A \lor B} ( \vec w^1 , \vec w^2, \vec b ) & := &  \witness{\vec a}{A} (\vec w^1 , \vec b) \cor \witness{\vec a}{B} (\vec w^2 , \vec b) & 
-			%			\text{for $\star \in \{ \land, \lor, \laand , \laor\}$.} 
-			\\
-			\witness{\vec a}{A \land B} ( \vec w^1 , \vec w^2, \vec b ) & := &  \witness{\vec a}{A} (\vec w^1 , \vec b) \cand \witness{\vec a}{B} (\vec w^2 , \vec b) & 
-			%			\text{for $\star \in \{ \land, \lor, \laand , \laor\}$.} 
-			\\
-			\witness{\vec a}{\exists x^\nat . A(x)} ( w, \vec w  , \vec b) & := & \witness{\vec{a}, a}{A(a)}(\vec w , \vec b, w ) & \\
+			\type (\nat (t)) & := & (;x^{\nat (t)} ) & \\
+			\type(s = t) & := & ( ; x^{s = t}) & \\
+			\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)$.} \\
+			\type (A \land B)  & : = & (\vec u , \vec v ; \vec x , \vec y) & \text{if $\type(A) = (\vec u ; \vec x)$ and $\type(B) = (\vec v ; \vec y)$.} \\
+			\type (! A) & : = & ( \vec u ,\vec x  ; ) & \text{if $\type(A) = (\vec u ; \vec x )$.} \\
+			\type (\exists x^\nat . A) & := & (\vec u ; \vec x , y) & \text{if $\type (A) = (\vec u ; \vec x)$.}
+			%	\type (\forall x^N . A) & := & \Nat \to \type(A)
 			\end{array}
 			\]
-			where $|\vec w^1| = |\type (A)|$ and $|\vec w^2| = |\type (B)| $.
+			%	where $\nu$ designates that the inputs are normal.
 		\end{definition}
-		%	\todo{problem: what about complexity of checking equality? }
 		
-		\todo{Reformulate above later if necessary.}
 		
-		%	\todo{What about $\nat (t)$? What does it mean? Replace with true?}
+		\anupam{need to account for normality and safety somewhere. Attempting inlined and leaving types without this decoration.}
 		
-		%	\todo{either use the witness predicate above, or use realizability predicate at meta-level and a model theory, like BH.}
+		\begin{remark}
+			[Distribution of $!$]
+			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.
+			
+			On the other hand, since we are working in affine logic, we do in general have $!(A \land B) \cong !A \land !B$.
+		\end{remark}
 		
-		%	\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.}
-		
-		\anupam{to consider/remark: formally, is witness predicate checked in model or some logical theory?}
-		
-		\subsection{The translation}
-		
 		\begin{definition}
 			[Translation]
-			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 b) \implies \witness{\vec a}{\bigparr \Delta } (\vec f^\pi(\vec w , \vec b), \vec b)
-			\]
+			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)|$.
 			
-			\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?}
-			
-			%	\anupam{for moment try ignore decoration on right? what about negation?}
-			
-			
-			
 			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.
 			
 			If $\pi$ is simply an axiom, we construct $\vec f^\pi$ as follows:
@@ -389,6 +343,101 @@
 
 \end{definition}
 
+\subsection{Witness predicate and extensional equivalence of functions}
+
+Now that we have defined how to extract a function from a proof, we need to show that the function satisfies the appropriate semantic properties.
+
+For this we work in a quantifier-free logic whose atoms are equations between terms of our arithmetic and whose (sound) rules are simply the axioms of our arithmetic.
+
+(This is similar to the role of PV in the witnessing argument for $S^1_2$ and system $T$ for witnessing $I\Sigma_1$.)
+
+	
+		\newcommand{\witness}[2]{\mathit{Witness}^{#1}_{#2}}
+		\begin{definition}
+			[Witness predicate]
+			We define the following `witness' predicate for $\Sigma^\nat_1$-formulae $A$ with free variables amongst $\vec a$:
+			\[
+			\begin{array}{rcll}
+			\witness{\vec a}{A} (w, \vec b) & := & w = t(\vec b) & \text{if $A(\vec a)$ is $\nat (t(\vec a))$.} \\
+			\witness{\vec a}{A} (w, \vec b) & := & s(\vec b) = t(\vec b) & \text{if $A(\vec a)$ is $s(\vec a) = t (\vec a)$.} \\
+			\witness{\vec a}{A \lor B} ( \vec w^1 , \vec w^2, \vec b ) & := &  \witness{\vec a}{A} (\vec w^1 , \vec b) \cor \witness{\vec a}{B} (\vec w^2 , \vec b) & 
+			%			\text{for $\star \in \{ \land, \lor, \laand , \laor\}$.} 
+			\\
+			\witness{\vec a}{A \land B} ( \vec w^1 , \vec w^2, \vec b ) & := &  \witness{\vec a}{A} (\vec w^1 , \vec b) \cand \witness{\vec a}{B} (\vec w^2 , \vec b) & 
+			%			\text{for $\star \in \{ \land, \lor, \laand , \laor\}$.} 
+			\\
+			\witness{\vec a}{\exists x^\nat . A(x)} ( w, \vec w  , \vec b) & := & \witness{\vec{a}, a}{A(a)}(\vec w , \vec b, w ) & \\
+			\end{array}
+			\]
+			where $|\vec w^1| = |\type (A)|$ and $|\vec w^2| = |\type (B)| $.
+		\end{definition}
+		%	\todo{problem: what about complexity of checking equality? }
+		
+		\todo{Reformulate above later if necessary.}
+		
+		%	\todo{What about $\nat (t)$? What does it mean? Replace with true?}
+		
+		%	\todo{either use the witness predicate above, or use realizability predicate at meta-level and a model theory, like BH.}
+		
+		%	\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.}
+		
+		\anupam{to consider/remark: formally, is witness predicate checked in model or some logical theory?}
+
+
+
+
+\begin{lemma}
+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:
+	\[
+			\witness{\vec a}{\bigotimes \Gamma} (\vec w , \vec b) \implies \witness{\vec a}{\bigparr \Delta } (\vec f^\pi(\vec w , \vec b), \vec b)
+			\]
+\end{lemma}
+		
+			
+			\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?}
+			
+			%	\anupam{for moment try ignore decoration on right? what about negation?}
+	
+	
+	\begin{proof}
+	By structural induction on $\pi$, again, following the definition of $\vec f^\pi$.
+	\todo{}
+	\end{proof}	
+		
+		\begin{theorem}
+		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:
+		\begin{equation}
+		\label{eqn:spec-implies-program}
+\Phi(f) \implies f (\vec x) = \mathbf{f} (\vec x)
+		\end{equation}
+		\begin{equation}
+		\label{eqn:program-satisfies-spec}
+		\Phi(\mathbf f)
+		\end{equation}
+		\end{theorem}
+			\begin{proof}
+			Notice that a convergence statement has the following form:
+			\[
+			!\Phi(f) , !\nat(\vec a) \seqar \nat(f (\vec a) )
+			\]
+			By the lemma above, and by inspection of the definition of the witness predicate, this means we have that,
+			\[
+			(\Phi(f) \cand \vec x = \vec a ) \implies \mathbf f (\vec x) = f(\vec a)
+			\]
+			whence we arrive at \eqref{eqn:spec-implies-program}.
+			
+			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.
+			\end{proof}
+			
+			\anupam{rephrase above proof to make more sense.}
+			
+
 \newcommand{\concat}{\mathit{concat}}
 \paragraph{Some points on concatenation \anupam{if necessary}}
 We can define the concatenation operation by PRN:
