reserve x,y for object,X for set,
  f for Function,
  R,S for Relation;
reserve e1,e2 for ExtReal;
reserve s,s1,s2,s3 for sequence of X;
reserve XX for non empty set,
        ss,ss1,ss2,ss3 for sequence of XX;
reserve X,Y for non empty set,
  Z for set;
reserve s,s1 for sequence of X,
  h,h1 for PartFunc of X,Y,
  h2 for PartFunc of Y ,Z,
  x for Element of X,
  N for increasing sequence of NAT;
reserve i,j for Nat;

theorem
  (for i holds s.i = s.(i+1)) implies s is constant
proof
  assume
A1: for i holds s.i = s.(i+1);
  now
    let i,j;
A2: now
      let i,j such that
A3:   i <= j;
      defpred P[Nat] means i <= $1 implies s.i = s.$1;
A4:   for j being Nat st P[j] holds P[j+1]
      proof
        let j being Nat such that
A5:     P[j];
        assume i <= j+1;
        then i < j+1 or i = j+1 by XXREAL_0:1;
        hence thesis by A1,A5,NAT_1:13;
      end;
A6:   P[0] by NAT_1:3;
      for j being Nat holds P[j] from NAT_1:sch 2(A6,A4);
      hence s.i = s.j by A3;
    end;
    i <= j or j <= i;
    hence s.i = s.j by A2;
  end;
  hence thesis;
end;
