reserve m,n for Nat;
reserve r for Real;
reserve c for Element of F_Complex;

theorem Th28:
  for f being non-zero INT -valued Polynomial of F_Real
  for a being irrational Element of F_Real st a is_a_root_of f
  ex A being positive Real st
  for p being Integer, q being positive Nat holds
  |. a-p/q .| > A/(q|^len f)
  proof
    let f be non-zero INT -valued Polynomial of FR;
    set n = len f;
    let a be irrational Element of FR;
    assume
A1: a is_a_root_of f;
    set X = [. a-1,a+1 .];
    set E = Eval(f);
    set F = E`| |X;
    set M1 = sup rng |.F.|;
A2: dom E = REAL by FUNCT_2:def 1;
A3: E is differentiable;
A4: dom(E`|) = REAL by FUNCT_2:def 1;
    then
A5: dom F = X by RELAT_1:62;
A6: dom |.F.| = dom F by VALUED_1:def 11;
    reconsider F as PartFunc of X,REAL by RELAT_1:185;
    F is bounded by A4,INTEGRA5:10;
    then rng |.F.| is real-bounded by INTEGRA1:15;
    then reconsider M1 as Element of REAL by XXREAL_2:16;
    set M = M1+1;
    consider Y being object such that
A7: Y in rng |.F.| by XBOOLE_0:def 1;
    reconsider Y as Real by A7;
    consider A being object such that
    A in dom |.F.| and
A8: |.F.|.A = Y by A7,FUNCT_1:def 3;
A9: |.F.|.A = |.F.A.| by VALUED_1:18;
    M1 is UpperBound of rng |.F.| by XXREAL_2:def 3;
    then
A10: Y <= M1 by A7,XXREAL_2:def 1;
A11: M1+0 <= M by XREAL_1:6;
    set RTS = Roots(f) \ {a};
    deffunc F(Real) = |.a-$1.|;
    set DIF = {F(b) where b is Element of FR : b in RTS};
A12: RTS is finite;
A13: DIF is finite from FRAENKEL:sch 21(A12);
    DIF c= REAL
    proof
      let x be object;
      assume x in DIF;
      then ex b being Element of FR st x = F(b) & b in RTS;
      hence thesis by XREAL_0:def 1;
    end;
    then reconsider DIF as finite Subset of REAL by A13;
    set MIN = {1,1/M} \/ DIF;
    MIN c= REAL by XREAL_0:def 1;
    then reconsider MIN as finite non empty Subset of REAL;
    for x being Real st x in MIN holds x > 0
    proof
      let x be Real;
      assume x in MIN;
      then x in {1,1/M} or x in DIF by XBOOLE_0:def 3;
      then per cases by TARSKI:def 2;
      suppose x = 1 or x = 1/M;
        hence thesis by A10,A9,A8;
      end;
      suppose ex b being Element of FR st x = F(b) & b in RTS;
        then consider b being Element of FR such that
A14:    x = F(b) and
A15:    b in RTS;
        a-b <> 0 by A15,ZFMISC_1:56;
        hence thesis by A14;
      end;
    end;
    then min MIN > 0 by XXREAL_2:def 5;
    then consider A being Real such that
A16: 0 < A and
A17: A < inf MIN by XREAL_1:5;
    reconsider A as positive Real by A16;
    take A;
    let p be Integer;
    let q be positive Nat;
    set qn = q|^n;
    reconsider qtn=qn as Element of FR by XREAL_0:def 1;
    assume
A18: |. a-p/q.| <= A/qn;
A19: |. a-p/q.| = |. p/q-a.| by COMPLEX1:60;
A20: E.a = 0.FR by A1,POLYNOM5:def 13;
    reconsider pq = p/q as Element of FR by XREAL_0:def 1;
    0+1 <= qn by NAT_1:13;
    then A/qn <= A/1 by XREAL_1:118;
    then |.a-p/q.| <= A by A18,XXREAL_0:2;
    then
A21: |.a-p/q.| < inf MIN by A17,XXREAL_0:2;
    then not |.a-p/q.| in MIN by XXREAL_2:3;
    then not |.a-p/q.| in DIF by XBOOLE_0:def 3;
    then not pq in RTS;
    then not p/q in Roots(f) by ZFMISC_1:56;
    then
A22: not pq is_a_root_of f by POLYNOM5:def 10;
A23: E.(p/q) = eval(f,pq) & E.(a) = eval(f,a) by POLYNOM5:def 13;
A24: a+0 <= a+1 by XREAL_1:6;
A25: 1 / (M*qn) = (1/M) * (1/qn) by XCMPLX_1:102;
    1/M in {1,1/M} by TARSKI:def 2;
    then 1/M in MIN by XBOOLE_0:def 3;
    then inf MIN <= 1/M by XXREAL_2:3;
    then A < 1/M by A17,XXREAL_0:2;
    then
A26: A*(1/qn) < (1/M)*(1/qn) by XREAL_1:68;
    1 in {1,1/M} by TARSKI:def 2;
    then 1 in MIN by XBOOLE_0:def 3;
    then inf MIN <= 1 by XXREAL_2:3;
    then
A27: |.a-p/q.| <= 1 by A21,XXREAL_0:2;
    consider EF being FinSequence of the carrier of FR such that
A28: E.(p/q) = Sum EF & len EF = len f & for n be Element of NAT st n in
    dom EF holds EF.n = f.(n-'1) * (power FR).(pq,n-'1) by POLYNOM4:def 2,A23;
    set G = qtn*EF;
    reconsider FF=EF as Element of (len EF)-tuples_on the carrier of F_Real
    by FINSEQ_2:92;
    set GG=qtn*FF;
    len GG = len EF by FINSEQ_2:132;
    then
A29: dom G = Seg (len EF) by FINSEQ_1:def 3 .= dom EF by FINSEQ_1:def 3;
    rng G c= INT
    proof
      let o be object;
      assume o in rng G;
      then consider b being object such that
A30:  b in dom G & o=G.b by FUNCT_1:def 3;
      reconsider b as Element of NAT by A30;
      b in Seg n by A30,A29,A28,FINSEQ_1:def 3;
      then 1 <= b & b <= n & b-'1 <= b by FINSEQ_1:1,NAT_D:35;
      then consider c being Nat such that
A31:  n = b-'1+c by NAT_1:10,XXREAL_0:2;
      rng EF c= the carrier of F_Real; then
      reconsider a9=EF.b as Element of F_Real by A30,A29,FUNCT_1:3;
      b in dom (qtn*EF) & a9 = EF.b implies (qtn*EF).b = qtn*a9
      by FVSUM_1:50;
      then
      G.b = qtn*(f.(b-'1) * (power F_Real).(pq,b-'1)) by A28,A30,A29
      .= f.(b-'1) * ((q|^n) * (power F_Real).(pq,b-'1))
      .= f.(b-'1) * ((q|^n) * ((p/q)|^(b-'1))) by NIVEN:7
      .= f.(b-'1) * ((q|^n) * ((p|^(b-'1))/(q|^(b-'1)))) by PREPOWER:8
      .= f.(b-'1) * (p|^(b-'1)) * ((q|^n)/(q|^(b-'1)))
      .= f.(b-'1) * (p|^(b-'1)) * ((q|^c)*(q|^(b-'1))/(q|^(b-'1)))
      by A31,NEWTON:8
      .= f.(b-'1) * (p|^(b-'1)) * ((q|^c)*((q|^(b-'1))/(q|^(b-'1))))
      .= f.(b-'1) * (p|^(b-'1)) * ((q|^c) * 1) by XCMPLX_1:60
      .= f.(b-'1) * (p|^(b-'1)) * (q|^c);
      hence o in INT by INT_1:def 2,A30;
    end;
    then reconsider G1=G as INT -valued FinSequence by RELAT_1:def 19;
    Sum G1 = Sum G by NIVEN:6;
    then reconsider SG=Sum G as Integer;
    Sum G = qtn*Sum EF by FVSUM_1:73
    .= qn*Sum EF;
    then |.SG.| = |.qn.| * |.Sum EF.| by COMPLEX1:65;
    then
A32: |.E.(p/q).| >= 1/qn by A28,A22,A23,NAT_1:14,XREAL_1:79;
    per cases by XXREAL_0:1;
    suppose
A33:  p/q < a;
      E | [. p/q,a .] is continuous;
      then consider x0 being Real such that
A34:  x0 in ]. p/q,a .[ and
A35:  diff(E,x0) = (E.a-E.(p/q)) / (a-p/q) by A2,A3,A33,FDIFF_1:26,ROLLE:3;
A36:  |.E.a-E.(p/q).| = |.E.(p/q).| by A20,COMPLEX1:52;
A37:  a-p/q <> 0;
      then a-p/q = (E.a-E.(p/q)) / diff(E,x0) by A35,A1,A22,A23,XCMPLX_1:54;
      then
A38:  |.a-p/q.| = |.E.(p/q).| / |.diff(E,x0).| by A36,COMPLEX1:67;
      a-p/q <= 1 by A27,ABSVALUE:5;
      then a-p/q-a <= 1-a by XREAL_1:9;
      then -(-p/q) >= -(1-a) by XREAL_1:24;
      then
A39:  ]. p/q,a .[ c= X by A24,XXREAL_1:37;
      then
A40:  F.x0 = (E`|).x0 by A34,FUNCT_1:49
      .= diff(E,x0) by POLYDIFF:10;
      |.F.|.x0 = |.F.x0 .| by VALUED_1:18;
      then |.diff(E,x0).| in rng |.F.| by A5,A6,A34,A39,A40,FUNCT_1:def 3;
      then |.diff(E,x0).| <= M1 by XXREAL_2:4;
      then |.diff(E,x0).| <= M by A11,XXREAL_0:2;
      then 1 / |.diff(E,x0).| >= 1/M by A35,A1,A37,A22,A23,XREAL_1:118;
      then |.E.(p/q).| / |.diff(E,x0).| >= 1/(M*qn)
      by A10,A9,A8,A32,A25,XREAL_1:66;
      hence contradiction by A18,A38,A25,A26,XXREAL_0:2;
    end;
    suppose
A41:  a < p/q;
      E | [. a,p/q .] is continuous;
      then consider x0 being Real such that
A42:  x0 in ]. a,p/q .[ and
A43:  diff(E,x0) = (E.(p/q)-E.a) / (p/q-a) by A2,A3,A41,FDIFF_1:26,ROLLE:3;
A44:  p/q-a <> 0;
      then p/q-a = (E.(p/q)-E.a) / diff(E,x0) by A1,A22,A23,A43,XCMPLX_1:54;
      then
A45:  |.p/q-a.| = |.E.(p/q).| / |.diff(E,x0).| by A20,COMPLEX1:67;
A46:  a-1 < a-0 by XREAL_1:15;
      -1 <= a-p/q by A27,ABSVALUE:5;
      then -1-a <= a-p/q-a by XREAL_1:9;
      then -(-1-a) >= -(-p/q) by XREAL_1:24;
      then
A47:  ]. a,p/q .[ c= X by A46,XXREAL_1:37;
      then
A48:  F.x0 = (E`|).x0 by A42,FUNCT_1:49
      .= diff(E,x0) by POLYDIFF:10;
      |.F.|.x0 = |.F.x0 .| by VALUED_1:18;
      then |.diff(E,x0).| in rng |.F.| by A5,A6,A42,A47,A48,FUNCT_1:def 3;
      then |.diff(E,x0).| <= M1 by XXREAL_2:4;
      then |.diff(E,x0).| <= M by A11,XXREAL_0:2;
      then 1 / |.diff(E,x0).| >= 1/M by A43,A1,A22,A44,A23,XREAL_1:118;
      then |.E.(p/q).| / |.diff(E,x0).| >= 1/(M*qn)
      by A10,A9,A8,A25,A32,XREAL_1:66;
      hence contradiction by A18,A19,A45,A25,A26,XXREAL_0:2;
    end;
  end;
