reserve m, n for Nat,
  x for set,
  i for Instruction of SCM+FSA,
  I for Program of SCM+FSA,
  a for Int-Location,
  f for FinSeq-Location,
  l, l1 for Nat,
  s,s1,s2 for State of SCM+FSA,
  P,P1,P2 for Instruction-Sequence of SCM+FSA;

theorem Th11:
 for s being 0-started State of SCM+FSA
 for P being Instruction-Sequence of SCM+FSA
  for I being really-closed Program of SCM+FSA
   st P+*I halts_on s & Directed I c= P
 holds IC Comput(P,s,LifeSpan(P+*I,s) + 1) =  card I
proof
 let s be 0-started State of SCM+FSA;
 let P be Instruction-Sequence of SCM+FSA;
  let I be really-closed Program of SCM+FSA;
  assume that
A1: P+*I halts_on s and
A2: Directed I c= P;
A3: I c= P+*I by FUNCT_4:25;
  set s2 = s;
  set m = LifeSpan(P+*I,s);
  set l1 = IC Comput(P+*I,s,m);
A4: I c= P+*I by FUNCT_4:25;
    IC s = 0 by MEMSTR_0:def 11;
    then IC s in dom I by AFINSQ_1:65;
    then
A5: l1 in dom I by A4,AMISTD_1:21;
    set s1 = s;
A6:   P+*(I ";" I) = P+*(I +* (I ";" I)) by SCMFSA6A:18
     .= P+*I +* (I ";" I) by FUNCT_4:14;
 now
    let k be Nat;
    defpred X[Nat] means $1 <= k implies
     Comput(P+*(I ";" I),s1,$1) =  Comput(P+*Directed I,s2,$1);
    assume
A7: k <= m;
A8: for n being Nat st X[n] holds X[n+1]
    proof
      let n be Nat;
      assume
A9:  n <= k implies
       Comput(P+*(I ";" I),s1,n) =  Comput(P+*Directed I,s2,n);
A10:  Comput(P+*Directed I,s2,n+1) = Following(P+*Directed I,
Comput(P+*Directed I,s2,n)) by EXTPRO_1:3
        .= Exec(CurInstr(P+*Directed I,Comput(P+*Directed I,s2,n)),
        Comput(P+*Directed I,s2,n));
A11:  Comput(P+*(I ";" I),s1,n+1) = Following(P+*(I ";" I),
Comput(P+*(I ";" I),s1,n)) by EXTPRO_1:3
        .= Exec(CurInstr(P+*(I ";" I),Comput(P+*(I ";" I),s1,n)),
        Comput(P+*(I ";" I),s1,n));
A12:  n <= n + 1 by NAT_1:12;
      assume
A13:  n + 1 <= k;
     IC s = 0 by MEMSTR_0:def 11;
     then
A14:   IC s in dom I by AFINSQ_1:65;
      n <= k by A13,A12,XXREAL_0:2;
    then
   Comput(P+*I,s,n) =  Comput(P+*(I ";" I),s,n)
    by A3,Th10,A6,A1,A7,XXREAL_0:2;
      then IC Comput(P+*(I ";" I),s1,n) in dom I by A3,AMISTD_1:21,A14;
      then
A15:  IC Comput(P+*Directed I,s2,n) in dom Directed I
           by A13,A9,A12,FUNCT_4:99,XXREAL_0:2;
    dom(P+*Directed I) = NAT by PARTFUN1:def 2;
    then
A16:  (P+*Directed I)/.IC Comput(P+*Directed I,s2,n)
      = (P+*Directed I).IC Comput(P+*Directed I,s2,n) by PARTFUN1:def 6;
A17: dom(P+*(I ";" I)) = NAT by PARTFUN1:def 2;
  Directed I c= P+*Directed I by FUNCT_4:25;
  then
A18:  CurInstr(P+*Directed I,Comput(P+*Directed I,s2,n))
       = (Directed I).IC Comput(P+*Directed I,s2,n) by A15,A16,GRFUNC_1:2;
A19:    dom I c= dom (I ";" I) &
       CurInstr(P+*(I ";" I),
      Comput(P+*(I ";" I),s1,n)) = (P+*(I ";" I)).IC
      Comput(P+*(I ";" I),s1,n ) by A17,PARTFUN1:def 6,SCMFSA6A:17;
A20:     Directed I c= I ";" I by SCMFSA6A:16;
   I ";" I c= P+*(I ";" I) by FUNCT_4:25;
      then Directed I c= P+*(I ";" I) by A20,XBOOLE_1:1;
      hence thesis
       by A9,A13,A12,A18,A11,A10,A15,A19,GRFUNC_1:2,XXREAL_0:2;
    end;
A21: X[0];
    for n being Nat holds X[n] from NAT_1:sch 2(A21,A8);
    then Comput(P+*(I ";" I),s1,k) =  Comput(P+*Directed I,s2,k);
    hence  Comput(P+*I,s,k) =  Comput(P+*Directed I,s2,k)
      by A7,Th10,A6,A1,FUNCT_4:25;
  end;
  then
A22:  Comput(P+*I,s,m) =  Comput(P+*Directed I,s2,m);
A23: dom(P+*I) = NAT by PARTFUN1:def 2;
  I c= P+*I by FUNCT_4:25;
  then
A24: I.l1 = (P+*I).IC Comput(P+*I,s,m) by A5,GRFUNC_1:2
    .= CurInstr(P+*I,Comput(P+*I,s,m)) by A23,PARTFUN1:def 6
    .= halt SCM+FSA by A1,EXTPRO_1:def 15;
  IC Comput(P+*Directed I,s2,m) in dom Directed I by A5,A22,FUNCT_4:99;
  then
A25: (P +* Directed I).l1 = (Directed I).l1 by A22,FUNCT_4:13
    .= goto  card I by A5,A24,FUNCT_4:106;
A26:  P+*Directed I = P by A2,FUNCT_4:98;
A27:  dom(P+*Directed I) = NAT by PARTFUN1:def 2;
  Comput(P+*Directed I,s2,m+1)
     = Following(P+*Directed I,Comput(P+*Directed I,s2,m)) by EXTPRO_1:3
    .= Exec(goto card I, Comput(P+*Directed I,s2,m))
           by A27,A22,A25,PARTFUN1:def 6;
  hence IC Comput(P,s,LifeSpan(P+*I,s) + 1) =  card I
   by A26,SCMFSA_2:69;
end;
