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 Th17:
  for I being Program of SCMPDS,k be Nat st I
  is_closed_on s,P & I is_halting_on s,P &
    k < LifeSpan(P +* stop I,Initialize s)
  holds IC Comput(P +* stop I,Initialize s,k) in dom I
proof
  let I be Program of SCMPDS,k be Nat;
  set ss= Initialize s, PP = P +* stop I,
      m=LifeSpan(PP,ss), Sp =Stop SCMPDS;
  assume that
A1: I is_closed_on s,P and
A2: I is_halting_on s,P and
A3: k < m;
  set Sk= Comput(PP, ss,k), Ik=IC Sk;
A4: Ik in dom stop(I) by A1;
  reconsider n = Ik as Nat;
A5: stop I c= PP by FUNCT_4:25;
A6: PP halts_on ss by A2;
A7: now
A8: PP/.IC Sk = PP.IC Sk by PBOOLE:143;
    assume
A9: n = card I;
    CurInstr(PP,Sk) =PP.Ik by A8
      .=(stop I).(0+n) by A4,A5,GRFUNC_1:2
      .=halt SCMPDS by A9,Lm1,Lm2,AFINSQ_1:def 3;
    hence contradiction by A3,A6,EXTPRO_1:def 15;
  end;
  card stop I=card I + 1 by COMPOS_1:55;
  then n < card I + 1 by A4,AFINSQ_1:66;
  then n <= card I by INT_1:7;
  then n < card I by A7,XXREAL_0:1;
  hence thesis by AFINSQ_1:66;
end;
