reserve A for preIfWhileAlgebra,
  C,I,J for Element of A;
reserve S for non empty set,
  T for Subset of S,
  s for Element of S;
reserve f for ExecutionFunction of A,S,T;

theorem
  A is free & [s, while(C,I)] in TerminatingPrograms(A,S,T,f) & f.(s,C) in T
  implies [f.(s,C), I] in TerminatingPrograms(A,S,T,f)
proof
  set TP = TerminatingPrograms(A,S,T,f);
  set IJ = while(C,I);
  assume that
A1: A is free and
A2: [s, IJ] in TP and
A3: f.(s,C) in T;
  consider r being non empty FinSequence of S such that
A4: r.1 = f.(s,C) and
A5: r.len r nin T and
A6: for i being Nat st 1 <= i & i < len r
  holds r.i in T & [r.i, I\;C] in TP & r.(i+1) = f.(r.i, I\;C) by A1,A2,Th99;
  len r >= 1 by NAT_1:14;
  then 1 < len r by A3,A4,A5,XXREAL_0:1;
  then [r.1, I\;C] in TP by A6;
  hence thesis by A1,A4,Th97;
end;
