reserve n for Element of NAT,
  i for Integer,
  a, b, r for Real,
  x for Point of TOP-REAL n;

theorem Th38:
  for A being Subset of R^1, f being Function of R^1|A,
  Tunit_circle(2) st [.0,1.[ c= A & f = CircleMap | A holds f is onto
proof
  let A be Subset of R^1, f be Function of R^1|A, Tunit_circle(2) such that
A1: [.0,1.[ c= A and
A2: f = CircleMap | A;
A3: dom f = A by A2,Lm18,RELAT_1:62,TOPMETR:17;
  thus rng f c= cS1;
  let y be object;
  assume
A4: y in cS1;
  then reconsider z = y as Point of TOP-REAL 2 by PRE_TOPC:25;
  set z1 = z`1, z2 = z`2;
A5: z1 <= 1 by A4,Th13;
  set x = arccos z1/(2*PI);
A6: -1 <= z1 by A4,Th13;
  then
A7: 0 <= x by A5,Lm22;
  x <= 1/2 by A6,A5,Lm22;
  then
A8: x < 1 by XXREAL_0:2;
A9: z1^2 + z2^2 = |. z .|^2 by JGRAPH_1:29;
A10: |. z .| = 1 by A4,Th12;
  per cases;
  suppose
A11: z2 < 0;
    now
      assume x = 0;
      then arccos z1 = 0;
      then z1 = 1 by A6,A5,SIN_COS6:96;
      hence contradiction by A10,A9,A11;
    end;
    then
A12: 1-0 > 1-x by A7,XREAL_1:15;
    1-x > 1-1 by A8,XREAL_1:15;
    then
A13: 1-x in [.0,1.[ by A12,XXREAL_1:3;
    then f.(1-x) = CircleMap.(-x+1) by A1,A2,FUNCT_1:49
      .= CircleMap.-x by Th31
      .= |[cos(-2*PI*x), sin(2*PI*(-x))]| by Def11
      .= |[cos(2*PI*x), sin(2*PI*(-x))]| by SIN_COS:31
      .= |[cos arccos z1, sin(-2*PI*x)]| by XCMPLX_1:87
      .= |[cos arccos z1, -sin(2*PI*x)]| by SIN_COS:31
      .= |[cos arccos z1, -sin arccos z1]| by XCMPLX_1:87
      .= |[z1, -sin arccos z1]| by A6,A5,SIN_COS6:91
      .= |[z1, --z2]| by A10,A9,A11,SIN_COS6:103
      .= y by EUCLID:53;
    hence thesis by A1,A3,A13,FUNCT_1:def 3;
  end;
  suppose
A14: z2 >= 0;
A15: x in [.0,1.[ by A7,A8,XXREAL_1:3;
    then f.x = CircleMap.x by A1,A2,FUNCT_1:49
      .= |[cos(2*PI*x), sin(2*PI*x)]| by Def11
      .= |[cos arccos z1, sin(2*PI*x)]| by XCMPLX_1:87
      .= |[cos arccos z1, sin arccos z1]| by XCMPLX_1:87
      .= |[z1, sin arccos z1]| by A6,A5,SIN_COS6:91
      .= |[z1, z2]| by A10,A9,A14,SIN_COS6:102
      .= y by EUCLID:53;
    hence thesis by A1,A3,A15,FUNCT_1:def 3;
  end;
end;
