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

theorem
  for s1,s2 being 0-started State of SCMPDS,I being Program of SCMPDS st I
  is_closed_on s1,P1 & I is_halting_on s1,P1 &
  stop I c= P1 & stop I c= P2 &
   ex k being Nat st
  Comput(P1,s1,k) =  s2
  holds  Result(P1,s1) =  Result(P2,s2)
proof
  let s1,s2 be 0-started State of SCMPDS,I be Program of SCMPDS;
  set pI =stop I;
  assume
A1: I is_closed_on s1,P1;
  assume
A2: I is_halting_on s1,P1;
  assume stop I c= P1;
  then
A3: P1 = P1 +* stop I by FUNCT_4:98;
  assume stop I c= P2;
   then
A4: P2 = P2 +* stop I by FUNCT_4:98;
A5: s1 = Initialize s1 by MEMSTR_0:44;
  then
A6: P1 halts_on s1 by A2,A3,SCMPDS_6:def 3;
  then consider n being Nat such that
A7: CurInstr(P1,Comput(P1,s1,n)) = halt SCMPDS;
A8: s2 = Initialize s2 by MEMSTR_0:44;
  given k being Nat such that
A9:  Comput(P1,s1,k) =  s2;
  set s3 = Comput(P1,s1,k), P3 = P1;
A10: IC SCMPDS in dom s3 by MEMSTR_0:2;
  IC s3 =  0 by A9,MEMSTR_0:def 11;
  then Start-At(0,SCMPDS) c= s3 by A10,FUNCOP_1:73;
  then
A11: s3 = Initialize s3 by FUNCT_4:98;
A12: now
    let n be Nat;
    IC Comput(P1,s3,n) = IC Comput(P1,s1,k+n) by EXTPRO_1:4;
    hence IC Comput(P3,s3,n) in dom pI
     by A1,A3,A5,SCMPDS_6:def 2;
  end;
  CurInstr(P3,Comput(P3,s3,n)) =
   CurInstr(P1,Comput(P1,s1,k+n)) by EXTPRO_1:4
    .= CurInstr(P1,Comput(P1,s1,n)) by A7,EXTPRO_1:5,NAT_1:11;
  then P3 halts_on s3 by A7,EXTPRO_1:29;
  then
A13: I is_halting_on s3,P3 by A11,A3,SCMPDS_6:def 3;
A14: DataPart s3 = DataPart s2 by A9;
  consider k being Nat such that
A15: CurInstr(P1,Comput(P1,s1,k))
 = halt SCMPDS by A6;
A16: P1.IC Comput(P1,s1,k) = halt SCMPDS by A15,PBOOLE:143;
  I is_closed_on s3,P3 by A11,A12,A3,SCMPDS_6:def 2;
  then  Result(P3,s3) =  Result(P2,s2) by A8,A14,A11,A13,Th9,A4,A3;
  hence thesis by A16,EXTPRO_1:8;
end;
