reserve X for set;
reserve k,m,n for Nat;
reserve i for Integer;
reserve a,b,c,d,e,g,p,r,x,y for Real;
reserve z for Complex;

theorem Th16:
  dom tan = union the set of all ]. -PI/2+PI*i,PI/2+PI*i .[ where i is Integer
  proof
    set S = the set of all ]. -PI/2+PI*i,PI/2+PI*i .[ where i is Integer;
    set T = dom tan;
A1: dom sin = REAL & dom cos = REAL by FUNCT_2:def 1;
    then T = REAL/\(REAL\cos"{0}) by RFUNCT_1:def 1;
    then
A2: T = REAL \cos"{0} by XBOOLE_1:28;
    thus T c= union S
    proof
      let x be object;
      assume
A3:   x in T;
      then reconsider x as Element of REAL;
      not x in cos"{0} by A2,A3,XBOOLE_0:def 5;
      then not cos x in {0} by A1,FUNCT_1:def 7;
      then
A4:   cos x <> 0 by TARSKI:def 1;
      set xP = (x-PI/2)/PI,E = [\xP/];
A5:   ]. -PI/2+PI*(E+1),PI/2+PI*(E+1) .[ in S;
      xP*PI = x-PI/2 by XCMPLX_1:87;
      then
A6:   x = PI/2+xP*PI;
      then
A7:   E<>xP by Th14,A4;
      E <= xP < E+1 by INT_1:def 6,29;
      then E <xP <E+1 by A7,XXREAL_0:1;
      then E*PI < xP*PI < (E+1)*PI by XREAL_1:68;
      then PI/2 + E*PI < x < PI/2+(E+1)*PI  by A6,XREAL_1:6;
      then x in ]. -PI/2+PI*(E+1),PI/2+PI*(E+1) .[ by XXREAL_1:4;
      hence thesis by A5,TARSKI:def 4;
    end;
    for X being set st X in S holds X c= T
    proof
      let X be set;
      assume X in S;
      then consider i being Integer such that
A8:   X = ]. -PI/2+PI*i,PI/2+PI*i .[;
A9:   X /\ cos"{0} = {}
      proof
        assume X /\ cos"{0} <> {};
        then consider r being object such that
A10:    r in X /\ cos"{0} by XBOOLE_0:7;
        reconsider r as Element of REAL by A10;
        r in cos"{0} by A10,XBOOLE_0:def 4;
        then
A11:    cos.r in {0} by FUNCT_1:def 7;
        cos.r <> 0
        proof
A12:      r in X by A10,XBOOLE_0:def 4;
          then
A13:      -PI/2+PI*i < r < PI/2+PI*i by A8,XXREAL_1:4;
          per cases;
          suppose i is even;
            then consider j being Integer such that
A14:        i= 2*j by INT_1:def 3,ABIAN:def 1;
            -PI/2 < r-PI*i < PI/2 by A13,XREAL_1:19,20;
            then r-PI*i in ]. -PI/2,PI/2.[ by XXREAL_1:4;
            then cos (r+2*PI*(-j)) >0 by A14,COMPTRIG:11;
            then cos r >0 by  COMPLEX2:9;
            hence thesis;
          end;
          suppose i is odd;
            then consider j being Integer such that
A15:        i = 2*j+1 by ABIAN:1;
            -PI/2+PI+2*PI*j < r < PI/2+PI+2*PI* j by A12,A8,XXREAL_1:4,A15;
            then -PI/2+PI < r-2*PI*j < PI/2+PI by XREAL_1:19,20;
            then r-2*PI*j in ]. PI/2,3/2*PI.[ by XXREAL_1:4;
            then cos (r+2*PI*(-j)) <0  by COMPTRIG:13;
            then cos (r) <0  by COMPLEX2:9;
            hence thesis;
          end;
        end;
        hence contradiction by A11,TARSKI:def 1;
      end;
      X \ cos"{0} c= T by A8,A2,XBOOLE_1:33;
      hence thesis by A9,XBOOLE_0:def 7,XBOOLE_1:83;
    end;
    hence union S c= T by ZFMISC_1:76;
  end;
