reserve c, c1, d for Real,
  k for Nat,
  n, m, N, n1, N1, N2, N3, N4, N5, M for Element of NAT,
  x for set;

theorem Th27: :: Alternate Definition for Big_Theta (page 87)
  for f being eventually-nonnegative Real_Sequence holds Big_Theta
(f) = { t where t is Element of Funcs(NAT, REAL) : ex c,d,N st c > 0 & d > 0 &
  for n st n >= N holds d*f.n <= t.n & t.n <= c*f.n }
proof
  let f be eventually-nonnegative Real_Sequence;
  set BT = { t where t is Element of Funcs(NAT, REAL) : ex c,d,N st c > 0 & d
  > 0 & for n st n >= N holds d*f.n <= t.n & t.n <= c*f.n };
  now
    let x be object;
    hereby
      assume
A1:   x in Big_Theta(f);
      then x in Big_Oh(f) by XBOOLE_0:def 4;
      then consider t being Element of Funcs(NAT, REAL) such that
A2:   x = t and
A3:   ex c,N st c > 0 & for n st n >= N holds t.n <= c*f.n & t.n >= 0;
      x in Big_Omega(f) by A1,XBOOLE_0:def 4;
      then consider s being Element of Funcs(NAT, REAL) such that
A4:   x = s and
A5:   ex d,N st d > 0 & for n st n >= N holds s.n >= d*f.n & s.n >= 0;
      consider c,N such that
A6:   c > 0 and
A7:   for n st n >= N holds t.n <= c*f.n & t.n >= 0 by A3;
      consider d,N1 such that
A8:   d > 0 and
A9:   for n st n >= N1 holds s.n >= d*f.n & s.n >= 0 by A5;
      set a = max(N, N1);
A10:  a >= N & a >= N1 by XXREAL_0:25;
      now
        take a;
        let n;
        assume n >= a;
        then n >= N & n >= N1 by A10,XXREAL_0:2;
        hence d*f.n <= t.n & t.n <= c*f.n by A2,A4,A7,A9;
      end;
      hence x in BT by A2,A6,A8;
    end;
    assume x in BT;
    then consider t being Element of Funcs(NAT, REAL) such that
A11: x = t and
A12: ex c,d,N st c > 0 & d > 0 & for n st n >= N holds d*f.n <= t.n &
    t.n <= c*f.n;
    consider c,d,N such that
A13: c > 0 and
A14: d > 0 and
A15: for n st n >= N holds d*f.n <= t.n & t.n <= c*f.n by A12;
    consider N1 being Nat such that
A16: for n being Nat st n >= N1 holds f.n >= 0 by Def2;
    reconsider a = max( N, N1 ) as Element of NAT by ORDINAL1:def 12;
A17: a >= N1 by XXREAL_0:25;
A18: a >= N by XXREAL_0:25;
    now
      take a;
      let n;
      assume
A19:  n >= a;
      then
A20:  n >= N by A18,XXREAL_0:2;
      hence d*f.n <= t.n by A15;
      n >= N1 by A17,A19,XXREAL_0:2;
      then f.n >= 0 by A16;
      then d*f.n >= d*0 by A14;
      hence t.n >= 0 by A15,A20;
    end;
    then
A21: x in Big_Omega(f) by A11,A14;
    now
      take a;
      let n;
      assume
A22:  n >= a;
      then
A23:  n >= N by A18,XXREAL_0:2;
      hence t.n <= c*f.n by A15;
      n >= N1 by A17,A22,XXREAL_0:2;
      then f.n >= 0 by A16;
      then d*f.n >= d*0 by A14;
      hence t.n >= 0 by A15,A23;
    end;
    then x in Big_Oh(f) by A11,A13;
    hence x in Big_Theta(f) by A21,XBOOLE_0:def 4;
  end;
  hence thesis by TARSKI:2;
end;
