reserve r1,r2,r3 for non negative Real;
reserve n,m1 for Nat;
reserve s for Real;
reserve cn,cd,i1,j1 for Integer;
reserve r for irrational Real;
reserve q for Rational;
reserve c0,c1,c2,u,a0,b0 for Real;
reserve a,b for Real;
reserve n for Integer;
reserve a1,a2,b1,b2,c1,c2 for Element of REAL;
reserve eps for positive Real;
reserve r1 for non negative Real;
reserve q,q1 for Element of RAT;

theorem Th46:
  |.a1*b2-a2*b1.|<>0 & a1/b1 is irrational implies
   ex x,y be Element of INT st
   |.LF(a1,b1,c1).(x,y).|*|.LF(a2,b2,c2).(x,y).|<|.a1*b2-a2*b1.|/4
   & |.LF(a1,b1,c1).(x,y).| < eps
   proof
     set Delta = |.a1*b2-a2*b1.|;
     assume that
A1:  |.a1*b2-a2*b1.|<>0 and
A2:  a1/b1 is irrational;
     reconsider t = -a1/b1 as Element of IRRAT by A2,BORSUK_5:17;
A4:  a2*b1-a1*b2 <> 0 by A1;
     reconsider r1=max(|.b1.|/(sqrt 5 *eps),|.b1*b2.|/Delta)
       as non negative Real by SQRT2,XXREAL_0:def 10;
     consider q1 be Element of RAT such that
A7:  denominator(q1) > [\r1/]+1 & q1 in HWZSet(t) &
     a2*denominator(q1)+b2*numerator(q1) <> 0 by A1,Th44;
     set n1 = numerator(q1);
     set d1 = denominator(q1);
A8:  d1 > r1 by A7,INT_1:29, XXREAL_0:2;
     |.b1.|/(sqrt 5 *eps) <= r1 by XXREAL_0:25; then
     |.b1.|/(sqrt 5 *eps) < 1*d1 by A8,XXREAL_0:2; then
     |.b1.|/d1 < 1*(sqrt 5 *eps) by SQRT2,XREAL_1:113; then
     (|.b1.|/d1)*1 < eps*sqrt 5; then
     (|.b1.|/d1)/sqrt 5 < eps/1 by SQRT2,XREAL_1:106; then
A11: |.b1.|/(d1*sqrt 5) < eps by XCMPLX_1:78;
     |.b1*b2.|/Delta <= r1 by XXREAL_0:25; then
     |.b1*b2.|/Delta < 1*d1 by A8,XXREAL_0:2; then
A13:  |.b1*b2.|/d1 < 1*Delta by XREAL_1:113,A1;
      d1+0 >= 1 by NAT_1:19; then
      1/d1 <= 1 by XREAL_1:183; then
A16: (|.b1*b2.|/d1)*(1/d1) <= |.b1*b2.|/d1 by XREAL_1:153;
      (|.b1*b2.|/d1)*(1/d1) = (|.b1*b2.|*1)/(d1*d1) by XCMPLX_1:76
   .= |.b1*b2.|/d1|^2 by WSIERP_1:1; then
A17:  |.b1*b2.|/d1|^2 < Delta by A13,A16,XXREAL_0:2;
      reconsider rh0=(d1*(c1*a2-c2*a1)+n1*(c1*b2-c2*b1))/(a2*b1-a1*b2)
        as Element of REAL by XREAL_0:def 1;
     d1,n1 are_coprime by WSIERP_1:22; then
     consider s,r be Element of INT such that
A19: |. d1*s - n1*r +rh0 .| <= 1/2 by Th16;
     set h=n1,k=d1;
     set a=(a1*r+b1*s+c1)/(a1*k+b1*h), b=(a2*r+b2*s+c2)/(a2*k+b2*h);
     consider u be Integer such that
A20:  |.a - u.| < 1 &
     (|.a - u.|*|.b - u.|<=1/4 or |.a-u.|*|.b-u.|<|.a-b.|/2) by Th41;
      set x = r-u*k, y = s-u*h;
      t in IRRAT by SUBSET_1:def 1; then
A22:  b1 <> 0;
A23:  a1*k + b1*h <>0
      proof
        assume a1*k + b1*h = 0; then
        (-n1)*b1 = a1*d1; then
        (-n1)/d1 = a1/b1 by A22,XCMPLX_1:94;
        hence contradiction by A2;
      end;
A26:  a-u = (a1*x+b1*y+c1)/(a1*k+b1*h)+u*(a1*k+b1*h)/(a1*k+b1*h)-u
    .= (a1*x+b1*y+c1)/(a1*k+b1*h)+u*1-u by A23,XCMPLX_1:89
    .= (a1*x+b1*y+c1)/(a1*k+b1*h); then
A27:   |.(a1*x+b1*y+c1).|/|.(a1*k+b1*h).| < 1 by A20,COMPLEX1:67;
      (|.(a1*x+b1*y+c1).|/|.(a1*k+b1*h).|)*|.(a1*k+b1*h).|
     = |.(a1*x+b1*y+c1).|*(1/|.(a1*k+b1*h).|)*|.(a1*k+b1*h).|
    .= |.(a1*x+b1*y+c1).| by A23,XCMPLX_1:109; then
A30:  |.(a1*x+b1*y+c1).|<1*|.(a1*k+b1*h).| by XREAL_1:68,A27,A23;
       consider q be Rational such that
A32:   q1 = q and
A33:   |. t - q .| < 1/(sqrt 5 * denominator(q)|^2) by A7;
       |. t - q .| = |.-(a1/b1 +q1).| by A32
    .= |. a1/b1 + q1.| by COMPLEX1:52 .= |. a1/b1 + n1/d1.| by RAT_1:15
    .= |.( a1*d1+n1*b1)/(b1*d1) .| by A22,XCMPLX_1:116
    .= |.( a1*d1+n1*b1).|/|.(b1*d1).| by COMPLEX1:67; then
A36:  |.( a1*d1+n1*b1).|/1 <(1/(sqrt 5 * d1|^2))* |.(b1*d1).|
        by A32,A33,A22,XREAL_1:113;
    set S1 = 1/sqrt 5;
A37:   (1/(sqrt 5 * d1|^2)) = S1*(1/d1|^2) by XCMPLX_1:102
     .=S1*(1/(d1*d1)) by WSIERP_1:1
     .=S1*((1/d1)*(1/d1)) by XCMPLX_1:102 .=S1*(1/d1)*(1/d1);
     |.(b1*d1).| = |.d1.|*|.b1.| by COMPLEX1:65   .= d1*|.b1.|; then
A39: (1/(sqrt 5 * d1|^2))* |.(b1*d1).|
     =S1*(1/d1)*((1/d1)*d1)*|.b1.| by A37
    .=S1*(1/d1)*1*|.b1.| by XCMPLX_1:106
    .=(1/(sqrt 5 *d1))*|.b1.| by XCMPLX_1:102
    .=|.b1.|/(d1*sqrt 5); then
A40:  |.(a1*d1+b1*n1).| < eps by A36,A11,XXREAL_0:2;
A41:  b-u = (a2*x+b2*y+c2)/(a2*k+b2*h)+u*(a2*k+b2*h)/(a2*k+b2*h)-u
    .=(a2*x+b2*y+c2)/(a2*k+b2*h)+u*1-u by A7,XCMPLX_1:89
    .=(a2*x+b2*y+c2)/(a2*k+b2*h);
    set u1 = a1*x+b1*y+c1, u2 = a2*x+b2*y+c2,
        v1 = a1*k+b1*h, v2 = a2*k+b2*h;
A42: |.a-u.|*|.b-u.|=(|.u1.|/|.v1.|)*|.u2/v2.| by COMPLEX1:67,A41,A26
   .=(|.u1.|/|.v1.|)*(|.u2.|/|.v2.|) by COMPLEX1:67
   .=(|.u1.|*|.u2.|)/(|.v1.|*|.v2.|) by XCMPLX_1:76;
A43: |.t - q.| = |.-(a1/b1 +q1).| by A32
    .=|. a1/b1 + q1.| by COMPLEX1:52 .= |. a1/b1 + n1/d1.| by RAT_1:15;
      consider d be Real such that
A44:  n1/d1 = -a1/b1 + d/d1|^2 and
A45:  |.d.| < S1 by A33,A32,A43,Th45;
      b1/b1 = 1 by A22,XCMPLX_1:60; then
A51:  |.a2+b2*(-a1/b1).|=|.a2*(b1/b1)-b2*a1*(1/b1).|
         .=|.-(a1*b2-a2*b1)/b1.|
         .=|.(a1*b2-a2*b1)/b1.| by COMPLEX1:52
         .=Delta/|.b1.| by COMPLEX1:67;
A52:  (|.b1.|/(d1*sqrt 5))*|.v2.|=|.b1.|*(1/(d1*sqrt 5))*|.a2*d1+b2*n1.|
         .=|.b1.|*((1/d1)*(1/sqrt 5))*|.a2*d1+b2*n1.| by XCMPLX_1:102
         .=|.b1.|*S1*(|.(1/d1).|*|.a2*d1+b2*n1.|)
         .=|.b1.|*S1*|.(1/d1)*(a2*d1+b2*n1).| by COMPLEX1:65
         .=|.b1.|*S1*|.(a2*d1)*(1/d1)+(b2*n1)*(1/d1).|
         .=|.b1.|*S1*|.a2+b2*(n1/d1).| by XCMPLX_1:107
         .=|.b1.|*S1*|.a2+b2*(-a1/b1)+ b2*(d/d1|^2).| by A44;
A54:  |.b1.|*S1*Delta/|.b1.|=|.b1.|*(1/|.b1.|)*(1/sqrt 5)*Delta
         .= Delta/sqrt 5 by A22,XCMPLX_1:106;
A55:  |.b1.|*S1*|.b2*(d/d1|^2).|=S1*(|.b1.|*|.b2*(d/d1|^2).|)
         .=S1*|.b1*(b2*(d/d1|^2)).| by COMPLEX1:65
         .=S1*(|.d*((b1*b2)/(d1|^2)).|)
         .=S1*(|.d.|*|.((b1*b2)/(d1|^2)).|) by COMPLEX1:65
         .=S1*(|.d.|*(|.(b1*b2).|/|.(d1|^2).|)) by COMPLEX1:67
         .=S1*|.d.|*(|.b1*b2.|/d1|^2);
A49:  |.v1.|*|.v2.|<=(|.b1.|/(d1*sqrt 5))*|.v2.| by A36,A39,XREAL_1:64;
A57:  |.b1.|*S1*|.b2*(d/d1|^2).|<=Delta*((1/sqrt 5)*|.d.|)
           by A55,A17,SQRT2,XREAL_1:64;
      |.b1.|*(1/sqrt 5)*(Delta/|.b1.|+|.b2*(d/d1|^2).|)
          =Delta/sqrt 5 + |.b1.|*(1/sqrt 5)*|.b2*(d/d1|^2).| by A54; then
A59:  (|.b1.|/(d1*sqrt 5))*|.v2.| <=
           Delta/sqrt 5 + |.b1.|*(1/sqrt 5)*|.b2*(d/d1|^2).|
           by A52,SQRT2,A51,COMPLEX1:56,XREAL_1:64;
A60:  Delta/sqrt 5 + |.b1.|*(1/sqrt 5)*|.b2*(d/d1|^2).| <=
           Delta/sqrt 5 + Delta*((1/sqrt 5)*|.d.|) by XREAL_1:6,A57;
A61:  (|.b1.|/(d1*sqrt 5))*|.v2.|
           <=Delta*((1/sqrt 5)+(1/sqrt 5)*|.d.|) by A59,A60,XXREAL_0:2;
      (1/sqrt 5)*(1/sqrt 5)
            =1/(sqrt 5)^2 by XCMPLX_1:102.= 1/5 by SQUARE_1:def 2; then
      S1*|.d.| < 1/5 by A45,XREAL_1:68; then
      S1 + S1*|.d.| < 1/5 +1/2 by SQRT3,XREAL_1:8; then
      S1 + S1*|.d.| < 1 by XXREAL_0:2; then
      (S1+S1*|.d.|)*Delta<1*Delta by A1,XREAL_1:68; then
A66:  (|.b1.|/(d1*sqrt 5))*|.v2.| < Delta by A61,XXREAL_0:2;
A71:  a-b=((a1*r+b1*s+c1)*(a2*k+b2*h)-(a2*r+b2*s+c2)*(a1*k+b1*h))
           /((a1*k+b1*h)*(a2*k+b2*h)) by XCMPLX_1:130,A7,A23;
      (a1*r+b1*s+c1)*(a2*k+b2*h)-(a2*r+b2*s+c2)*(a1*k+b1*h)
         = (a1*b2-a2*b1)*(r*h-s*k)+(k*(c1*a2-c2*a1)+h*(c1*b2-c2*b1))*1
        .= (a1*b2-a2*b1)*(r*h-s*k)+(k*(c1*a2-c2*a1)+h*(c1*b2-c2*b1))
           *((1/(a2*b1-a1*b2))*(a2*b1-a1*b2)) by A4,XCMPLX_1:106
        .=(a2*b1-a1*b2)*(k*s-h*r + rh0); then
      |.a-b.| = |.-(a1*b2-a2*b1)*(k*s-h*r + rh0).|/|.(v1*v2).|
          by COMPLEX1:67,A71
        .= |.(a1*b2-a2*b1)*(k*s-h*r + rh0).|/|.(v1*v2).| by COMPLEX1:52
        .= |.(a1*b2-a2*b1).|*|.(k*s-h*r + rh0).|/|.(v1*v2).| by COMPLEX1:65
        .= Delta*|.(k*s-h*r + rh0).|/(|.v1.|*|.v2.|) by COMPLEX1:65; then
A73:  (1/2)*|.a-b.|*(|.v1.|*|.v2.|)
          =(1/2)*Delta*|.(k*s-h*r + rh0).|/(|.v1.|*|.v2.|)*(|.v1.|*|.v2.|)
         .=(1/2)*Delta*|.(k*s-h*r + rh0).| by XCMPLX_1:87,A23,A7;
A75:  (1/2)*Delta*|.(k*s-h*r+rh0).|<=(1/2)*Delta*(1/2) by A19,XREAL_1:64;
A46:  |.u1.|*|.u2.| < Delta/4
      proof
       per cases by A20;
         suppose |.a-u.|*|.b-u.|<=1/4; then
          (|.u1.|*|.u2.|)*(1/(|.v1.|*|.v2.|))*(|.v1.|*|.v2.|)
           <=(1/4)*(|.v1.|*|.v2.|) by A42,XREAL_1:64; then
A48:      (|.u1.|*|.u2.|)<=(1/4)*(|.v1.|*|.v2.|) by XCMPLX_1:109,A23,A7;
           (|.v1.|*|.v2.|)*(1/4)<=((|.b1.|/(d1*sqrt 5))*|.v2.|)*(1/4)
             by XREAL_1:64,A49; then
A67:      (|.u1.|*|.u2.|)<=((|.b1.|/(d1*sqrt 5))*|.v2.|)*(1/4)
             by A48,XXREAL_0:2;
          ((|.b1.|/(d1*sqrt 5))*|.v2.|)*(1/4)<Delta*(1/4) by XREAL_1:68,A66;
          hence thesis by A67,XXREAL_0:2;
         end;
         suppose |.a-u.|*|.b-u.|<|.a-b.|/2; then
         (|.u1.|*|.u2.|)*(1/(|.v1.|*|.v2.|))*(|.v1.|*|.v2.|)
           <(|.a-b.|/2)*(|.v1.|*|.v2.|) by A23,A7,A42,XREAL_1:68; then
         (|.u1.|*|.u2.|) < (1/2)*Delta*|.(k*s-h*r + rh0).|
            by XCMPLX_1:109,A23,A7,A73;
         hence thesis by A75,XXREAL_0:2;
       end;
      end;
I:    x in INT & y in INT by INT_1:def 2;
A77:  LF(a1,b1,c1).(x,y) = u1 & LF(a2,b2,c2).(x,y) = u2 by Def4;
      |. u1 .| < eps by A30,A40,XXREAL_0:2;
      hence thesis by I,A77,A46;
   end;
