reserve m,n for Nat,
  a for Int_position,
  i,j for Instruction of SCMPDS,
  s,s1,s2 for State of SCMPDS,
  k1 for Integer,
  loc for Nat,
  I,J,K for Program of SCMPDS;
reserve P,P1,P2 for Instruction-Sequence of SCMPDS;

theorem Th20:
  for I being halt-free Program of SCMPDS,s being State of
  SCMPDS st I is_closed_on s,P & I is_halting_on s,P
  holds IC Comput(P +* stop I, Initialize s,
    LifeSpan(P +* stop I,Initialize s)) =  card I
proof
  let I be halt-free Program of SCMPDS,s be State of SCMPDS;
  set s1=Initialize s, P1 = P +* stop I;
  assume that
A1: I is_closed_on s,P and
A2: I is_halting_on s,P;
  set Css= Comput(P1, s1,LifeSpan(P1,s1));
  reconsider n = IC Css as Nat;
A3: stop I c= P1 by FUNCT_4:25;
   I c= stop I by AFINSQ_1:74;
   then
A4: I c= P1 by A3,XBOOLE_1:1;
A5: P1 halts_on s1 by A2;
  now
A6: P1/.IC Css = P1.IC Css by PBOOLE:143;
    assume
A7: IC Css in dom I;
    then I.IC Css=P1.IC Css by A4,GRFUNC_1:2
      .=CurInstr(P1,Css) by A6
      .=halt SCMPDS by A5,EXTPRO_1:def 15;
    hence contradiction by A7,COMPOS_1:def 27;
  end;
  then
A8: n >= card I by AFINSQ_1:66;
A9: card stop I =card I + 1 by COMPOS_1:55;
  IC Css in dom stop(I) by A1;
  then n < card I + 1 by A9,AFINSQ_1:66;
  then n <= card I by NAT_1:13;
  then IC Comput(P1, s1,LifeSpan(P1,s1)) = card I by A8,XXREAL_0:1;
  hence thesis;
end;
