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 Th21:
  for I,J being Program of SCMPDS st I is_halting_on s,P & J
  is_closed_on IExec(I,P,Initialize s),P &
  J is_halting_on IExec(I,P,Initialize s),P
   holds J is_closed_on Comput(P +* stop I, Initialize s,
   LifeSpan(P +* stop I,Initialize s)), P +* stop I & J
  is_halting_on Comput(P +* stop I,
    Initialize s,
     LifeSpan(P +* stop I,Initialize s)), P +* stop I
proof
  let I,J be Program of SCMPDS;
  set s1= Initialize s, P1 = P +* stop I,
  sm = Comput(P1,s1,LifeSpan(
P1,s1)),
   sE = IExec(I,P,Initialize s);
  assume that
A1: I is_halting_on s,P and
A2: J is_closed_on sE,P and
A3: J is_halting_on sE,P;
A4: P1 halts_on s1 by A1,SCMPDS_6:def 3;
   DataPart sE = DataPart sm by A4,EXTPRO_1:23;
  hence thesis by A2,A3,SCMPDS_6:23;
end;
