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 Th43:
  for s being State of SCMPDS,I being Program of SCMPDS,a,c being
  Int_position, i being Integer,n be Nat st s.DataLoc(s.a,i) <= 0
  holds IExec(for-down(a,i,n,I),P,Initialize s)
       = s +* Start-At((card I+3),SCMPDS)
proof
  let s be State of SCMPDS,I be Program of SCMPDS, a,c be Int_position, i be
  Integer,n be Nat;
  set d1=DataLoc(s.a,i);
  set FOR=for-down(a,i,n,I), pFOR=stop FOR,
  s3 = Initialize s, P3 = P +* pFOR,
  s4 = Comput(P3, s3,1), P4 = P3,
  i1=(a,i)<=0_goto (card I+3), i2= AddTo(a,i,-n),
  i3=goto -(card I+2);
  set SAl=Start-At((card I+3),SCMPDS);
A1: IC s3 = 0 by MEMSTR_0:def 11;
A2: not d1 in dom Start-At(0,SCMPDS) by SCMPDS_4:18;
A3: pFOR c= P4 by FUNCT_4:25;
  not a in dom Start-At(0,SCMPDS) by SCMPDS_4:18;
  then
A4: s3.DataLoc(s3.a,i)=s3.d1 by FUNCT_4:11
    .= s.d1 by A2,FUNCT_4:11;
A5: FOR = i1 ';' (I ';' i2 ';' i3) by Th2;
A6: Comput(P3, s3,(0 qua Nat)+1) =
Following(P3,Comput(P3,s3,0)) by EXTPRO_1:3
    .= Exec(i1,s3) by A5,SCMPDS_6:11;
  assume
  s.d1 <= 0;
  then
A7: IC s4 = ICplusConst(s3,(card I+3)) by A6,A4,SCMPDS_2:56
    .= ((0 qua Nat)+(card I+3)) by A1,SCMPDS_6:12;
A8: card FOR=card I+3 by Th39;
  then (card I+3) in dom pFOR by COMPOS_1:64;
  then P4.(card I+3) = pFOR.(card I+3) by A3,GRFUNC_1:2
    .=halt SCMPDS by A8,COMPOS_1:64;
  then
A9: CurInstr(P4,s4) = halt SCMPDS by A7,PBOOLE:143;
  then
A10: P3 halts_on s3 by EXTPRO_1:29;
A11: CurInstr(P3,s3) = i1 by A5,SCMPDS_6:11;
  now
    let l be Nat;
    assume
    l < (0 qua Nat)+1;
    then l=0 by NAT_1:13;
    hence CurInstr(P3,Comput(P3,s3,l)) <> halt SCMPDS by A11;
  end;
  then for l be Nat st CurInstr(P3,
  Comput(P3,s3,l)) = halt SCMPDS holds 1 <= l;
  then
A12: LifeSpan(P3,s3) = 1 by A9,A10,EXTPRO_1:def 15;
A13: now
    let x be object;
A14: dom SAl = {IC SCMPDS} by FUNCOP_1:13;
    assume
A15: x in dom IExec(FOR,P,Initialize s);
    per cases by A15,SCMPDS_4:6;
    suppose
A16:  x is Int_position;
      then x <> IC SCMPDS by SCMPDS_2:43;
      then
A17:  not x in dom SAl by A14,TARSKI:def 1;
A18:   not x in dom Start-At(0,SCMPDS) by A16,SCMPDS_4:18;
      thus IExec(FOR,P,Initialize s).x = s4.x by A12,A10,EXTPRO_1:23
        .= s3.x by A6,A16,SCMPDS_2:56
        .= s.x by A18,FUNCT_4:11
        .= (s +* SAl).x by A17,FUNCT_4:11;
    end;
    suppose
A19:  x = IC SCMPDS;
      thus IExec(FOR,P,Initialize s).x = (card I + 3)
       by A7,A12,A19,A10,EXTPRO_1:23
        .= (s +* SAl).x by A19,FUNCT_4:113;
    end;
  end;
  dom IExec(FOR,P,Initialize s) = the carrier of SCMPDS by PARTFUN1:def 2
    .= dom (s +* SAl) by PARTFUN1:def 2;
  hence thesis by A13,FUNCT_1:2;
end;
