reserve x for Real;

theorem Th33:
  rng (cos|[.PI,2*PI.]) = [.-1,1 .]
proof
  set cos1 = cos|[.PI,2*PI.];
  now
    let y be object;
    thus y in [.-1,1 .] implies
ex x be object st x in dom cos1 & y = cos1.x
    proof
      2*PI in [.PI,2*PI.] by Lm3,XXREAL_1:1;
      then
A1:   cos1.(2*PI) = cos.(2*PI) by FUNCT_1:49;
      assume
A2:   y in [.-1,1 .];
      then reconsider y1=y as Real;
A3:   dom cos1 = [.PI,2*PI .] /\ REAL by RELAT_1:61,SIN_COS:24
        .= [.PI,2*PI .] by XBOOLE_1:28;
      PI in [.PI,2*PI.] by Lm3,XXREAL_1:1;
      then cos1.PI = cos.PI by FUNCT_1:49;
      then
      cos1|[.PI,2*PI.] is continuous & y1 in [.cos1.PI,cos1.(2*PI).] \/ [.
      cos1.(2* PI),cos1.PI.] by A2,A1,SIN_COS:76,XBOOLE_0:def 3;
      then consider x be Real such that
A4:   x in [.PI,2*PI.] and
A5:   y1 = cos1.x by A3,Lm3,FCONT_2:15;
      take x;
      x in REAL /\ [.PI,2*PI.] by A4,XBOOLE_0:def 4;
      hence thesis by A5,RELAT_1:61,SIN_COS:24;
    end;
    thus (ex x be object st x in dom cos1 & y = cos1.x)
implies y in [.-1,1 .]
    proof
      given x be object such that
A6:   x in dom cos1 and
A7:   y = cos1.x;
      dom cos1 c= dom cos by RELAT_1:60;
      then reconsider x1=x as Real by A6,SIN_COS:24;
      y = cos.x1 by A6,A7,FUNCT_1:47;
      hence thesis by Th27;
    end;
  end;
  hence thesis by FUNCT_1:def 3;
end;
