reserve x for set;
reserve i,j for Integer;
reserve n,n1,n2,n3 for Nat;
reserve K,K1,K2,K3 for Field;
reserve SK1,SK2 for Subfield of K;
reserve ek,ek1,ek2 for Element of K;
reserve p for Prime;
reserve a,b,c for Element of GF(p);
reserve F for FinSequence of GF(p);
reserve Px,Py,Pz for Element of GF(p);

theorem Th58:
  for p be Prime, a, b,d be Element of GF(p), F,G be set st
  p > 3 & Disc(a,b,p) <> 0.GF(p)
  & F = {Y where Y is Element of GF(p) : Y|^2= d|^3 + a*d + b} & F <> {}
  & G = {Class(R_EllCur(a,b,p),[d,Y,1])
  where Y is Element of GF(p) : [d,Y,1] in EC_SetProjCo(a,b,p) } holds
  ex I be Function of F,G st I is onto & I is one-to-one
  proof
    let p be Prime, a, b,d be Element of GF(p), F,G be set;
    assume A1:
    p > 3 & Disc(a,b,p) <> 0.GF(p)
    & F = {Y where Y is Element of GF(p) : Y|^2= d|^3 + a*d + b} & F <> {}
    & G = {Class(R_EllCur(a,b,p),[d,P,1]) where P is Element of GF(p)
    : [d,P,1] in EC_SetProjCo(a,b,p) };
    consider z be object such that
A2: z in F by A1,XBOOLE_0:def 1;
    consider W be Element of GF(p)
    such that A3: z=W & W|^2= d|^3 + a*d + b by A1,A2;
    [d,W,1] is Element of EC_SetProjCo(a,b,p) by A3,Th43; then
    A4: Class(R_EllCur(a,b,p),[d,W,1]) in G by A1;
    deffunc FG(object) = Class(R_EllCur(a,b,p),[d,$1,1]);
    A5: for x be object st x in F holds FG(x) in G
    proof
      let x be object;
      assume x in F; then
      consider Y be Element of GF(p)
      such that A6:x=Y & Y|^2= d|^3 + a*d + b by A1;
      [d,Y,1] is Element of EC_SetProjCo(a,b,p) by A6,Th43;
      hence FG(x) in G by A1,A6;
    end;
    consider I be Function of F,G such that
A7: for x be object st x in F holds I.x = FG(x) from FUNCT_2:sch 2(A5);
    take I;
    now let y be object;
      assume y in G; then
      consider P be Element of GF(p)
      such that A8: y= Class(R_EllCur(a,b,p),[d,P,1])
      & [d,P,1] in EC_SetProjCo(a,b,p) by A1;
      P|^2= d|^3 + a*d + b by A8,Th43; then
      A9: P in F by A1; then
      y=I.P by A7,A8;
      hence y in rng I by A9,A4,FUNCT_2:112;
    end; then
    G c= rng I; then
    G = rng I by XBOOLE_0:def 10;
    hence I is onto by FUNCT_2:def 3;
      now let x1,x2 be object
        such that A10: x1 in dom I & x2 in dom I & I.x1 = I.x2;
    A11: x1 in F & x2 in F by A10; then
        consider Y1 be Element of GF(p)
        such that A12:x1=Y1 & Y1|^2= d|^3 + a*d + b by A1;
        consider Y2 be Element of GF(p)
        such that A13:x2=Y2 & Y2|^2= d|^3 + a*d + b by A1,A11;
   A14: I.x1 = Class(R_EllCur(a,b,p),[d,x1,1]) by A10,A7;
   A15: Class(R_EllCur(a,b,p),[d,x1,1])
        = Class(R_EllCur(a,b,p),[d,x2,1]) by A10,A7,A14;
   A16: [d,Y2,1] is Element of EC_SetProjCo(a,b,p) by Th43,A13;
        [d,Y1,1] is Element of EC_SetProjCo(a,b,p) by Th43,A12;
        hence x1=x2 by A1,A12,A13,A15,A16,Th52;
      end;
      hence I is one-to-one by FUNCT_1:def 4;
  end;
