reserve x,a for Int_position,
  s for State of SCMPDS;
reserve P,Q for Instruction-Sequence of SCMPDS;

theorem Th25:
  for s being 0-started State of SCMPDS,I being halt-free shiftable
Program of SCMPDS, a be Int_position, i,c be Integer,X,Y be set st
  (for x st x in X holds s.x >= c+s.DataLoc(s.a,i)) &
   (for t be 0-started State of SCMPDS,Q
st (for x st x in X holds t.x >= c+t.DataLoc(s.a,i)) &
  (for x st x in Y holds t.x=s.x) & t.a=s.a & t.DataLoc(s.a,i) > 0
   holds IExec(I,Q,t).a=t.a & I
is_closed_on t,Q & I is_halting_on t,Q
 & IExec(I,Q,t).DataLoc(s.a,i) < t.DataLoc(s.a,
i) & (for x st x in X holds IExec(I,Q,t).x >=
c+IExec(I,Q,t).DataLoc(s.a,i))
 & for x st x in Y holds IExec(I,Q,t).x=t.x)
   holds while>0(a,i,I) is_closed_on s, P &
while>0(a,i,I) is_halting_on s, P &
 (s.DataLoc(s.a,i) > 0 implies IExec(while>0(a,i,I),P,s)
   =IExec(while>0(a,i,I),P,Initialize IExec(I,P,s)))
proof
  let s be 0-started State of SCMPDS,
      I be halt-free shiftable Program of SCMPDS, a be
  Int_position, i,c be Integer,X,Y be set;
  set b=DataLoc(s.a,i);
  defpred P[State of SCMPDS] means (for x st x in X holds $1.x >= c+$1.b) & (
  for x st x in Y holds $1.x=s.x);
  consider f be Function of product the_Values_of SCMPDS,NAT such that
A1: for s holds (s.b <= 0 implies f.s =0) & (s.b > 0 implies f.s=s.b) by Th3;
  deffunc F(State of SCMPDS) = f.$1;
A2: for t be 0-started State of SCMPDS st P[t] & F(t)=0
     holds t.b <= 0 by A1;
  assume
A3: for x st x in X holds s.x >= c+s.b;
A4: P[s] by A3;
  assume
A5: for t be 0-started State of SCMPDS,Q
  st (for x st x in X holds t.x >= c+t.b) & (
  for x st x in Y holds t.x=s.x) & t.a=s.a & t.b > 0
   holds IExec(I,Q,t).a=t.a & I
  is_closed_on t,Q & I is_halting_on t,Q & IExec(I,Q,t).b < t.b
   & (for x st x in X
holds IExec(I,Q,t).x >= c+IExec(I,Q,t).b)
 & for x st x in Y holds IExec(I,Q,t).x=t.x;
A6: now
    let t be 0-started State of SCMPDS, Q;
    assume that
A7: P[t] and
A8: t.a=s.a and
A9: t.b > 0;
    set It=IExec(I,Q,t), t2=Initialize It, t1=t;
    consider v be State of SCMPDS such that
A10: v=t and
A11: for x st x in X holds v.x >= c+v.b and
A12: for x st x in Y holds v.x=s.x by A7;
    thus
    IExec(I,Q,t).a=t.a & I is_closed_on t,Q & I is_halting_on t,Q
     by A5,A8,A9,A10,A12,A11;
    thus F(t2) < F(t1)
    proof
A13:  F(t1)=t1.b by A1,A9;
      assume
A14:  F(t2) >= F(t1);
      F(t2)=t2.b by A1,A9,A13,A14
        .=It.b by SCMPDS_5:15;
      hence contradiction by A5,A8,A9,A7,A14,A13;
    end;
    thus P[Initialize It]
    proof
      set v=Initialize It;
      hereby
        let x;
        assume x in X;
        then It.x >= c+It.b by A5,A8,A9,A7;
        then v.x >= c+It.b by SCMPDS_5:15;
        hence v.x >= c+v.b by SCMPDS_5:15;
      end;
      hereby
        let x;
        assume
A15:    x in Y;
        then It.x=t.x by A5,A8,A9,A7;
        then v.x=t.x by SCMPDS_5:15;
        hence v.x=s.x by A10,A12,A15;
      end;
    end;
  end;
  while>0(a,i,I) is_closed_on s, P & while>0(a,i,I)
  is_halting_on s, P from WhileGHalt(A2,A4,A6);
  hence while>0(a,i,I) is_closed_on s, P & while>0(a,i,I) is_halting_on s, P;
  assume
A16: s.b > 0;
  IExec(while>0(a,i,I),P,s) =IExec(while>0(a,i,I),P,
  Initialize IExec(I,P,s)) from WhileGExec(A16,A2,A4,A6);
  hence thesis;
end;
