reserve c, c1, c2, d, d1, d2, e, y for Real,
  k, n, m, N, n1, N0, N1, N2, N3, M for Element of NAT,
  x for set;

theorem
  for f being Real_Sequence st (for n holds f.n = 3*(10 to_power 6) - 18
  *(10 to_power 3)*n + 27*n^2) holds f in Big_Oh(seq_n^(2))
proof
  set g = seq_n^(2);
  consider t1 being Element of NAT such that
A1: t1 = 10*10*10;
  consider t2 being Element of NAT such that
A2: t2 = t1*t1;
  t1 = 10*10^2 by A1;
  then t1 = 10*(10 to_power 2) by POWER:46;
  then t1 = (10 to_power 1)*(10 to_power 2) by POWER:25;
  then
A3: t1 = 10 to_power (1+2) by POWER:27;
  then
A4: t2 = 10 to_power (3+3) by A2,POWER:27
    .= 10 to_power 6;
A5: 10 to_power 3 = 10 to_power (2+1)
    .= (10 to_power 2)*(10 to_power 1) by POWER:27
    .= (10 to_power 2)*10 by POWER:25
    .= (10^2)*10 by POWER:46
    .= 1000;
A6: for n st n >= 400 holds 18*t1*n - 3*t2 < 27*n^2
  proof
    defpred P[Nat] means 18*t1*$1 - 3*t2 < 27*$1^2;
A7: for k be Nat st k >= 400 & P[k] holds P[k+1]
    proof
      let k be Nat such that
A8:   k >= 400 and
A9:   18*t1*k - 3*t2 < 27*k^2;
      54*400 <= 54*k by A8,XREAL_1:64;
      then
A10:  18*t1 < 54*k by A3,A5,XXREAL_0:2;
      54*k + 0 <= 54*k + 27 by XREAL_1:7;
      then 18*t1 < 54*k + 27 by A10,XXREAL_0:2;
      then
A11:  27*k^2 + 18*t1 < 27*k^2 + (54*k + 27) by XREAL_1:6;
      18*t1*(k+1) - 3*t2 = (18*t1*k - 3*t2) + 18*t1;
      then 18*t1*(k+1) - 3*t2 < 27*k^2 + 18*t1 by A9,XREAL_1:6;
      hence thesis by A11,XXREAL_0:2;
    end;
A12: P[400] by A2,A3,A5;
    for n be Nat st n >= 400 holds P[n]from NAT_1:sch 8(A12, A7);
    hence thesis;
  end;
  let f be Real_Sequence such that
A13: for n holds f.n = 3*(10 to_power 6) - 18*(10 to_power 3)*n + 27*n^2;
A14: for n st n >= 400 holds f.n <= 27*n^2
  proof
    let n such that
A15: n >= 400;
    now
      assume f.n > 27*n^2;
      then 3*t2 - 18*(10 to_power 3)*n + 27*n^2 > 27*n^2 by A13,A4;
      then 3*t2 + -18*t1*n > 27*n^2 - 27*n^2 by A3,XREAL_1:19;
      then 3*t2 - 18*t1*n > 0;
      then
A16:  3*t2 > 0 + 18*t1*n by XREAL_1:20;
      (18*t1)*n >= (18*t1)*400 by A15,XREAL_1:64;
      then 3*(10 to_power (3+3)) > t1*7200 by A4,A16,XXREAL_0:2;
      then 3*((10 to_power 3)*(10 to_power 3)) > t1*7200 by POWER:27;
      hence contradiction by A3,A5;
    end;
    hence thesis;
  end;
A17: now
    let n;
    assume
A18: n >= 400;
    then f.n <= 27*n^2 by A14;
    then f.n <= 27*(n to_power 2) by POWER:46;
    hence f.n <= 27*g.n by A18,Def3;
    0 + (18*t1*n - 3*t2) < 27*n^2 by A6,A18;
    then 0 < 27*n^2 - (18*t1*n - 3*t2) by XREAL_1:20;
    then 0 < 3*(10 to_power 6) - 18*t1*n + 27*n^2 by A4;
    hence f.n >= 0 by A13,A3;
  end;
  f is Element of Funcs(NAT, REAL) by FUNCT_2:8;
  hence thesis by A17;
end;
