reserve x for Int_position,
  n,p0 for Nat;
reserve P,Q,U,V for Instruction-Sequence of SCMPDS;

theorem Th12:
  for s being 0-started State of SCMPDS,I being halt-free shiftable
Program of SCMPDS, a,x,y be Int_position, i,c be Integer,n be Nat st
n > 0 & s.x >= s.y +c & s.DataLoc(s.a,i) > 0 &
for t be 0-started State of SCMPDS,Q st t.x
>= t.y +c & t.a=s.a & t.DataLoc(s.a,i) > 0
 holds IExec(I ';' AddTo(a,i,-n),Q,t).a
  =t.a & IExec(I ';' AddTo(a,i,-n),Q,t).DataLoc(s.a,i)
  =t.DataLoc(s.a,i)-n & I
  is_closed_on t,Q & I is_halting_on t,Q
   & IExec(I ';' AddTo(a,i,-n),Q,t).x>=IExec(I
';' AddTo(a,i,-n),Q,t).y+c
holds IExec(for-down(a,i,n,I),P,s) = IExec(for-down(a,i,
  n,I),P,Initialize IExec(I ';' AddTo(a,i,-n),P,s))
proof
  let s be 0-started State of SCMPDS,
      I be halt-free shiftable Program of SCMPDS, a,x,y
  be Int_position, i,c be Integer,n be Nat;
  set b=DataLoc(s.a,i), J=I ';' AddTo(a,i,-n);
  assume
A1: n > 0;
  defpred P[set] means ex t be State of SCMPDS st t=$1 & t.x>=t.y+c;
  assume
A2: s.x >= s.y +c;
A3: P[s] by A2;
  assume
A4: s.b > 0;
  assume
A5: for t be 0-started State of SCMPDS,Q
    st t.x >= t.y +c & t.a=s.a & t.b > 0 holds
IExec(J,Q,t).a=t.a & IExec(J,Q,t).b=t.b-n &
 I is_closed_on t,Q & I is_halting_on t,Q & IExec(J,Q,t).x>=IExec(J,Q,t).y+c;
A6: now
    let t be 0-started State of SCMPDS, Q;
    assume that
A7: P[t] and
A8: t.a=s.a & t.b > 0;
    consider v be State of SCMPDS such that
A9: v= t and
A10: v.x>=v.y+c by A7;
    thus IExec(J,Q,t).a=t.a & IExec(J,Q,t).b=t.b-n &
    I is_closed_on t,Q & I is_halting_on t,Q by A5,A8,A9,A10;
    thus P[Initialize IExec(J,Q,t) ]
    proof
      take v=Initialize IExec(J,Q,t);
      thus v=Initialize IExec(J,Q,t);
      v.x=IExec(J,Q,t).x by SCMPDS_5:15;
      then v.x>=IExec(J,Q,t).y+c by A5,A8,A9,A10;
      hence thesis by SCMPDS_5:15;
    end;
  end;
  IExec(for-down(a,i,n,I),P,s)
   = IExec(for-down(a,i,n,I),P,
        Initialize IExec(I ';' AddTo(a,i,-n),P,s))
    from ForDownExec(A1,A4,A3,A6);
  hence thesis;
end;
