Index: CSL16/free-cut-elim.tex
===================================================================
--- CSL16/free-cut-elim.tex	(revision 78)
+++ CSL16/free-cut-elim.tex	(revision 79)
@@ -49,18 +49,45 @@
 %  a rule $\rigrul{\lor}$ and a rule $\lefrul{\lor}$ is not.
    
    A cut which is not anchored will also be called a \textit{free-cut}.
+   
+   Let us first prove a key lemma on hereditarily principal formulas:
+   \begin{lemma}\label{lem:hereditaryprincipalnonlogical}
+   A formula occurrence $A$ on the l.h.s. (resp. r.h.s.) of a sequent and hereditarily principal for a non-logical rule (R) 
+   cannot be of the form $A=?A'$ (resp. $A=!A'$).
+   \end{lemma}
+   \begin{proof}
+   Assume that $A$ is an occurrence of formula on the l.h.s. of the sequent and hereditarily principal for a non-logical rule (R), then a direct ancestor of this formula is principal for (R) and thus by condition 4. $A$ cannot be of the form $?A'$. The other case is identical.
+   \end{proof}
+   
    Now we can state the main result of this section:
    \begin{theorem}
    \label{thm:free-cut-elim}[Free-cut elimination]
     Given a theory  $\mathcal{T}$, any  $\mathcal T$-proof $\pi$ can be transformed into a $\mathcal T$-proof $\pi'$ with same conclusion sequent and without any free-cut.
    \end{theorem}
-   \begin{proof}
+    The proof will be given below. It will proceed in a way similar to the classical proof of cut elimination for linear logic, but here for eliminating only free-cuts, and we will have to check that all steps of the reasoning are compatible with the fact that the proof here also contains $\mathcal{T}$ rules. Actually the most important part of the proof will be the handling of the commutation steps, since this is where the new non-logical rules could raise some problems.
      
-    The proof will proceed in a way similar to the classical proof of cut elimination for linear logic, but here for eliminating only free-cuts, and we will have to check that all steps of the reasoning are compatible with the fact that the proof here also contains $\mathcal{T}$ rules. Actually the most important part of the proof will be the handling of the commutation steps, since this is where the new rules and axioms could raise some problems.
-     
-     First, observe that the only rules in which there is a condition on the context are the following ones: $(\rigrul{\forall})$, $(\lefrul{\exists})$, $(\rigrul{!})$, $(\lefrul{?})$, $(R)$. These are thus the rules for which the commutation steps are not straightforward.
-     
-    
+     First, observe that the only rules in which there is a condition on the context are the following ones: $(\rigrul{\forall})$, $(\lefrul{\exists})$, $(\rigrul{!})$, $(\lefrul{?})$, $(R)$. These are thus the rules for which the commutation with cut steps are not straightforward. Commutations with rules  $(\rigrul{\forall})$, $(\lefrul{\exists})$ are done in the standard way, by using renaming of eigenvariables if necessary. In the following we will have to be careful about rules $(\rigrul{!})$, $(\lefrul{?})$, $(R)$. For that we establish our second key lemma:
+  
+  \begin{lemma}[Key commutations]\label{lem:keycommutations}
+     A cut of the following form, where $?A$ is non principal for $(R)$, can be commuted with the $(R)$ rule:
+ \[
+     \vliinf{cut}{}{ !\Gamma', \Gamma,  \Sigma'   \seqar \Delta', ?A, ?\Pi, ?\Pi'}
+                    { \vlinf{(R)}{}{!\Gamma, \Sigma'  \seqar \Delta', ?A, ?\Pi}{  \{ !\Gamma, \Sigma_i  \seqar \Delta_i, ?A, ?\Pi \}_{i\in I} } }
+                    {  \vlinf{}{}{?A, !\Gamma' \seqar  ?\Pi'}{} } 
+\]
+    Similarly if $(R)$ is replaced with $(\rigrul{!})$, with $?A$ in its r.h.s. context. Similarly also for the symmetric situations:
+    cut on the l.h.s. of the conclusion of an $(R)$ or a $(\lefrul{?})$ rule on a (non-principal) formula $!A$, with a sequent $!\Gamma' \seqar  ?\Pi', !A$.
+  \end{lemma}  
+     \begin{proof}
+     The first subderivation can be replaced by:
+      \[
+     \vlinf{(R)}{}{ !\Gamma', !\Gamma,  \Sigma'   \seqar \Delta', ?\Pi, ?\Pi'}
+                                 { \vliinf{cut}{}{\{!\Gamma', !\Gamma, \Sigma_i  \seqar \Delta_i, ?\Pi,?\Pi' \}_{i\in I}} { \vlinf{}{}{ !\Gamma, \Sigma_i  \seqar \Delta_i, ?A, ?\Pi}{}} {  \vlinf{}{}{?A, !\Gamma' \seqar  ?\Pi'}{} } }
+                                 \]
+     Similarly  for the symmetric derivation with a   cut on the l.h.s. of the conclusion of an $(R)$ on a formula $!A$.
+     The analogous situations with rules  $(\rigrul{!})$ and $(\lefrul{?})$ are handled in the same way, and were already known in linear logic.
+     \end{proof}
+    \begin{proof} (of Thm  \ref{thm:free-cut-elim})
     Given a cut rule $c$ in a proof $\pi$, we call  \emph{degree} $\deg( c)$  the number of logical connectives or quantifiers in its cut-formula. Now the \emph{degree} of the proof $\deg( \pi)$ is the multiset of the degrees of its non-anchored formulas. The degrees will be compared with the multiset ordering.
     
     The demonstration will proceed by induction on the degree  $\deg( \pi)$.  For a given degree we will proceed with a sub-induction on the \textit{height} $\height{\pi}$ of the proof.
@@ -78,7 +105,7 @@
 \item Consider first the situation where $(S_1)$ is not one of the rules $(\rigrul{!})$, $(\lefrul{?})$, $(R)$.
 
 In this case the commutation of $c$ with $(S_1)$ can be done in the usual way. Let us handle as an example the case where $(S_1)=(\rigrul{\laand})$.
-
+{\small
 \[
 \vlderivation{
 \vliin{c}{}{ \Gamma, \Sigma \seqar B_1\vlan B_2, \Delta, \Pi }{ \vliin{S_1=\rigrul{\vlan}}{}{\Gamma  \seqar B_1\vlan B_2, \Delta, A}{ \vlhy{\Gamma  \seqar B_1, \Delta, A} }{\vlhy{\Gamma  \seqar  B_2,\Delta, A}}}{ \vlhy{ \Sigma, A \seqar  \Pi} }
@@ -92,7 +119,7 @@
 }
 }
 \]
-
+}
 %\vlderivation{
 %\vliin{\vlan}{}{\Gamma,\Delta,A\vlan B }{
 %\vliin{c_1}{}{\Gamma,\Delta,A }{ \vlhy{\Gamma,A,C} }{ \vlhy{ \Delta,C^\bot } }
@@ -105,28 +132,23 @@
 
 Observe that here $c$ is replaced by two cuts $c_1$ and $c_2$. Call $\pi_i$ the sub-derivation of last rule $c_i$, for $i=1,2$. As for $i=1, 2$ we have
 $\deg{\pi_i}\leq \deg{\pi}$ and $\height{\pi_i}< \height{\pi}$ we can apply the induction hypothesis, and reduce $\pi_i$ to a proof $\pi'_i$ of same conclusion and with
-$\deg{\pi'_i}\leq \deg{\pi_i}$. Therefore $\pi'_i$ has non-anchored cuts of degree strictly lower than $\deg(c)$, and thus by replacing $\pi_i$ by $\pi'_i$ for $i=1, 2$ we obtain a proof $\pi'$ such that $\deg{\pi'}<\deg{\pi}$.  
+$\deg{\pi'_i} < \deg{\pi_i}$. Therefore  by replacing $\pi_i$ by $\pi'_i$ for $i=1, 2$ we obtain a proof $\pi'$ such that $\deg{\pi'}<\deg{\pi}$.  
 
 The case (S)=($\lefrul{\laor}$) is identical, and the other cases are similar (see the Appendix for more examples). 
 
 \item Consider now the case where $(S_1)$ is equal to $(\rigrul{!})$, $(\lefrul{?})$ or $(R)$. Let us also assume that the cut-formula is hereditarily principal in its r.h.s. premise, because if this does not hold we can move to the second case below. 
 
-First consider  $(S_1)=(\rigrul{!})$. As $A$ is not principal in the conclusion of $(\rigrul{!})$ it is of the form $A=?A'$. We know that  $A=?A'$ is principal in the conclusion of $(S_2)$: the rule $(S_2)$ thus cannot be a rule $(R)$ because of the condition 2. on $(R)$ rules; therefore the only possibility is that 
- $(S_2)$ is an  $(\lefrul{?})$ rule. So the r.h.s. premise is of the shape $?A',!\Gamma \seqar ?\Delta$ and the commutation on the l.h.s. is possible. We can conclude as previously. The case where  $(S_1)=(\lefrul{?})$ is the same.
+First consider  $(S_1)=(\rigrul{!})$. As $A$ is not principal in the conclusion of $(\rigrul{!})$ it is of the form $A=?A'$. By assumption we know that  $A=?A'$ in the conclusion of $(S_2)$ is hereditarily principal on the l.h.s., so by Lemma \ref{lem:hereditaryprincipalnonlogical} it cannot be hereditarily principal for a non-logical rule, so by definition of hereditarily principal we deduce that $(S_2)$ is not an $(R)$ rule. It cannot be an  $(\rigrul{!})$ rule either because then $?A'$ could not be a principal formula in its conclusion. Therefore the only possibility is that 
+ $(S_2)$ is an  $(\lefrul{?})$ rule. So the r.h.s. premise is of the shape $?A',!\Gamma' \seqar ?\Pi'$ and by Lemma \ref{lem:keycommutations} the commutation on the l.h.s. is possible. We can conclude as previously. The case where  $(S_1)=(\lefrul{?})$ is the same.
  
- Now consider the case where $(S_1)=(R)$.  As $A$ is not principal in the conclusion of $(R)$, here again it is of the form $A=?A'$. So as before we deduce that   $(S_2)=(\lefrul{?})$, and  so the r.h.s. premise is of the shape $?A',!\Gamma \seqar ?\Delta$. We can rename the free variables in the premise sequents of $(S_1)$ such that none of them belongs to $FV(!\Gamma \seqar ?\Delta)$. Then the commutation on the left-hand-side is possible, because we "enlarge" the contexts with formulas starting with a $!$ (on the l.h.s. of $\seqar$) or a $?$  (on the r.h.s. of $\seqar$). The new occurrence of $(R)$ does satisfy conditions 1. and 2.
- 
- \patrick{TODO: I will picture this case} 
- 
-\end{itemize}
-
-%\patrick{Check that all cases are ok, taking into account constraints due to: contexts of $\rigrul{!}$, contexts of $\mathcal{T}$ rules (R), condition on free variables of (R).}
+ Now consider the case where $(S_1)=(R)$.  As $A$ is not hereditarily principal in the conclusion of $(R)$, it is a context formula and it is on the r.h.s., so by definition of $(R)$ rules it is  the form $A=?A'$. So as before by Lemma \ref{lem:hereditaryprincipalnonlogical} we deduce that   $(S_2)=(\lefrul{?})$, and  so the r.h.s. premise is of the shape $?A',!\Gamma' \seqar ?\Pi'$.  By Lemma \ref{lem:keycommutations} the commutation on the l.h.s. is possible, and so again we conclude as previously.
+ \end{itemize}
     \item \textbf{Second case}: the cut-formulas on the l.h.s. and r.h.s. of  $c$ are both non hereditarily principal. 
     
    After the first case we are here left with the situation where  $(S_1)$ is equal to $(\rigrul{!})$, $(\lefrul{?})$ or $(R)$.
    \begin{itemize}
     \item Consider the case where  $(S_1)$=$(\rigrul{!})$, $(\lefrul{?})$, so $A$ is of the form $A=?A'$. All cases of commutation of $c$ with $(S_2)$ are as in standard linear logic, except if $(S_2)=(R)$. In this case though we cannot have $A=?A'$ because of the shape of rule $(R)$. So we are done. 
-    \item Consider  $(S_1)=(R)$. Again as $A$ is not principal on the l.h.s. it is of the form  $A=?A'$. As $?A'$ is not principal on the r.h.s., $(S_2)$ is not a rule $(R)$. So $(S_2)$ is a logical rule, and so it admits commutation with the cut $c$. 
+    \item Consider  $(S_1)=(R)$. Again as $A$ is not principal in the conclusion of $(S_1)$ and on the r.h.s. of the sequent it is a context formula, and thus of the form  $A=?A'$. As $?A'$ is not principal in the conclusion of $(S_2)$, it is thus a context formula on the l.h.s. of sequent, and therefore $(S_2)$ is not a rule $(R)$. So $(S_2)$ is a logical rule. If it is not an $(\rigrul{!})$ or an $(\lefrul{?})$ it admits commutation with the cut, and we are done. If it is equal to $(\rigrul{!})$ or $(\lefrul{?})$ it cannot have $?A'$ as a context formula in the l.h.s. of its conclusion, so these subcases do not occur.  
    \end{itemize}
  
    
