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 Th6:
  for s1,s2 being State of SCMPDS,I being Program of SCMPDS
   st I is_closed_on s1,P1 & DataPart s1 = DataPart s2
 for k being Nat
  holds
   Comput(P1 +* stop I,Initialize s1,k)
  =  Comput(P2 +* stop I,Initialize s2,k) &
  CurInstr(P1 +* stop I,Comput(P1 +* stop I,Initialize s1,k)) =
  CurInstr(P2 +* stop I,Comput(P2 +* stop I,Initialize s2,k))
proof
  let s1,s2 be State of SCMPDS,I be Program of SCMPDS;
  assume
A1: I is_closed_on s1,P1;
  set pI = stop I;
  set ss1 = Initialize s1, PP1 = P1 +* stop I;
  set ss2 = Initialize s2, PP2 = P2 +* stop I;
A2: pI c= PP2 by FUNCT_4:25;
A3: pI c= PP1 by FUNCT_4:25;
  assume
A4: DataPart s1 = DataPart s2;
    let k be Nat;
A5: IC Comput(PP1,ss1,k) in dom pI by A1,SCMPDS_6:def 2;
A6: I is_closed_on s2,P2 by A1,A4,SCMPDS_6:22;
    then
A7: for m st m < k holds IC Comput(PP2,ss2,m) in dom pI by SCMPDS_6:def 2;
     ss1 =  ss2 by A4,MEMSTR_0:80;
    hence
A8:   Comput(PP1,ss1,k) =  Comput(PP2,ss2,k)
     by A3,A2,A7,SCMPDS_4:21;
A9: IC Comput(PP2,ss2,k) in dom pI by A6,SCMPDS_6:def 2;
    thus CurInstr(PP2,Comput(PP2,ss2,k))
     = PP2.IC Comput(PP2,ss2,k) by PBOOLE:143
      .= pI.IC Comput(PP2,ss2,k) by A2,A9,GRFUNC_1:2
      .= PP1.IC Comput(PP1,ss1,k) by A3,A8,A5,GRFUNC_1:2
      .= CurInstr(PP1,Comput(PP1,ss1,k)) by PBOOLE:143;
end;
