reserve P,Q for Instruction-Sequence of SCM+FSA;
reserve m, n for Nat;
reserve f for FinSeq-Location,
  c for Int-Location;
reserve s for State of SCM+FSA,
  I for MacroInstruction of SCM+FSA,
  a for read-write Int-Location;
reserve i,k,m,n for Nat;

theorem Th14:
  for a being Int-Location, I being really-closed MacroInstruction of SCM+FSA,
      s being State of SCM+FSA st I is_halting_on s,P &
  IC Comput(P +* while>0(a,I), Initialize s,1 + LifeSpan(P +* I,Initialize s))
    = IC Comput(P +* I,Initialize s,LifeSpan(P +* I,Initialize s) ) + 3
 holds CurInstr(P +* while>0(a,I),
   Comput(P +* while>0(a,I),Initialize s,
  (1 + LifeSpan(P +* I,Initialize s)))) = goto 0
proof
  set J3= Goto  0 ";" Stop SCM+FSA;
  set J = Stop SCM+FSA;
  let a be Int-Location;
  let I be really-closed MacroInstruction of SCM+FSA;
  let s be State of SCM+FSA;
  set s1 = Initialize s,
      P1 = P +* while>0(a,I);
  set sI = Initialize s,
      PI = P +* I;
A1: I c= PI by FUNCT_4:25;
  set life=LifeSpan(P +* I,Initialize s);
  set sK1= Comput(P1, s1,1+life);
  set sK2= Comput(PI, sI,life);
  set I1= I ';' goto  0;
  set i = a >0_goto 3;
  reconsider n = IC sK2 as Element of NAT;
  set Mi= i ";" Goto  (card I1 + 1);
  set J2= I1 ";" Stop SCM+FSA;
A2: I c= PI by FUNCT_4:25;
  IC sI = 0 by MEMSTR_0:def 11;
  then IC sI in dom I by AFINSQ_1:65;
  then
A3:  n in dom I by AMISTD_1:21,A2;
  then n < card I by AFINSQ_1:66;
  then
A4: n+3 < card I+ 5 by XREAL_1:8;
  assume I is_halting_on s,P;
  then
A5: PI halts_on sI by SCMFSA7B:def 7;
A6:  (PI)/.IC sK2 = PI.IC sK2 by PBOOLE:143;
A7:  (P1)/.IC sK1 = P1.IC sK1 by PBOOLE:143;
  assume
A8: IC sK1 = IC sK2 + 3;
  CurInstr(PI,sK2) = I. n by A3,A1,GRFUNC_1:2,A6;
  then
A9: I.IC sK2 = halt SCM+FSA by A5,EXTPRO_1:def 15;
    IC sK2 = LastLoc I by A3,A9,COMPOS_1:def 15
       .= card I - 1 by AFINSQ_1:91;
    then
A10:  IC sK2 + 3 = card I + 2;
  card while>0(a,I) = card I + 5 by SCMFSA_X:4;
  then
A11: n+3 in dom while>0(a,I) by A4,AFINSQ_1:66;
A12: n+3 in dom if>0(a,I1) by A11,FUNCT_7:30;
  P1. (n+3) = (while>0(a,I)). (n+3) by FUNCT_4:13,A11
    .= (while>0(a,I)).(card I + 2) by A10
    .= goto 0 by FUNCT_7:31,A10,A12;
 hence thesis by A8,A7;
end;
