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 s being 0-started State of SCMPDS,n be Nat
   holds IExec(sum(n),P,s).intpos 3 =n
proof
  let s be 0-started State of SCMPDS,n be Nat;
  set i1= GBP:=0, i2= (GBP,2):=n, i3= (GBP,3):=0, i4= AddTo(GBP,3,1), FD=
  for-down(GBP,2,1, Load i4), a = intpos 3, I2=i1 ';' i2,
  s1=IExec(I2,P,s), s2=
  Exec(i1, s), I3=I2 ';' i3, s3=IExec(I3,P,s), P3 = P;
A1: I3 is_closed_on s,P by SCMPDS_6:20;
A2: I3 is_halting_on s,P by SCMPDS_6:21;
A3: s2.GBP=0 by SCMPDS_2:45;
  then
A4: DataLoc(s2.GBP,2)=intpos((0 qua Nat)+2) by SCMP_GCD:1;
A5: s1.GBP=Exec(i2, s2).GBP by SCMPDS_5:42
    .=0 by A3,A4,AMI_3:10,SCMPDS_2:46;
  then
A6: DataLoc(s1.GBP,3)=intpos((0 qua Nat)+3) by SCMP_GCD:1;
A7: (Initialize s3).GBP=s3.GBP by SCMPDS_5:15;
A8: s3.GBP=Exec(i3,s1).GBP by SCMPDS_5:41
    .=0 by A5,A6,AMI_3:10,SCMPDS_2:46;
  then FD is_halting_on Initialize s3, P3 by Th48,A7;
  then
A9: FD is_halting_on s3,P3 by SCMPDS_6:126;
A10: s3.intpos 2=Exec(i3,s1).intpos 2 by SCMPDS_5:41
    .=s1.intpos 2 by A6,AMI_3:10,SCMPDS_2:46
    .=Exec(i2, s2).intpos 2 by SCMPDS_5:42
    .=n by A4,SCMPDS_2:46;
A11: s3.a=Exec(i3,s1).a by SCMPDS_5:41
    .=0 by A6,SCMPDS_2:46;
A12: (Initialize s3).intpos 2=s3.intpos 2 by SCMPDS_5:15;
A13: (Initialize s3).a=s3.a by SCMPDS_5:15;
A14: (Initialize s3).GBP=s3.GBP by SCMPDS_5:15;
  FD is_closed_on Initialize s3, P3 by A8,Th48,A14;
  then FD is_closed_on s3,P3 by SCMPDS_6:125;
  hence IExec(sum(n),P,s).a
      = IExec(FD,P3,Initialize s3).a by A1,A2,A9,Th28
    .= n by A11,A8,A10,Th49,A12,A13,A14;
end;
