reserve x for set;
reserve i,j for Integer;
reserve n,n1,n2,n3 for Nat;
reserve p for Prime;
reserve a,b,c,d for Element of GF(p);
reserve K for Ring;
reserve a1,a2,a3,a4,a5,a6 for Element of K;
reserve px,py,pz for object;
reserve Px,Py,Pz for Element of GF(p);
reserve P for Element of ProjCo(GF(p));
reserve O for Element of EC_SetProjCo(a,b,p);

theorem Th39:
  for p be 5_or_greater Prime, z be Element of EC_WParam p,
  P, Q be Element of EC_SetProjCo(z`1,z`2,p)
  holds P _EQ_ Q iff rep_pt(P) = rep_pt(Q)
  proof
    let p be 5_or_greater Prime, z be Element of EC_WParam p,
    P, Q be Element of EC_SetProjCo(z`1,z`2,p);
    set a = z`1;
    set b = z`2;
    consider PP be Element of ProjCo(GF(p)) such that
    A1: PP = P & PP in EC_SetProjCo(a,b,p);
    consider QQ be Element of ProjCo(GF(p)) such that
    A2: QQ = Q & QQ in EC_SetProjCo(a,b,p);
    set RP = rep_pt(PP);
    set RQ = rep_pt(QQ);
    hereby
      assume A3: P _EQ_ Q;
      RP _EQ_ P by A1,Th36;
      then A4: RP _EQ_ Q by A3,EC_PF_1:44;
      RQ _EQ_ Q by A2,Th36;
      then RP _EQ_ RQ by A4,EC_PF_1:44; then
      consider a be Element of GF(p) such that
      A5: a <> 0.GF(p) and
A6: RP`1_3 = a*(RQ`1_3) & RP`2_3 = a*(RQ`2_3) & RP`3_3 = a*(RQ`3_3)
                by EC_PF_1:def 10;
      per cases;
      suppose A7: PP`3_3 = 0;
        then RP = [0, 1, 0] by Def7;
        then RP`3_3 = 0.GF(p) by EC_PF_1:11;
        then RQ`3_3 = 0.GF(p) by A5,A6,VECTSP_1:12
        .= 0 by EC_PF_1:11;
        then RQ = [0, 1, 0] by Th37;
        hence rep_pt(P) = rep_pt(Q) by A1,A2,A7,Def7;
      end;
      suppose PP`3_3 <> 0;
        then RP = [(PP`1_3)*(PP`3_3)", (PP`2_3)*(PP`3_3)", 1] by Def7;
        then A8: RP`3_3 = 1.GF(p) by EC_PF_1:12;
        then RQ`3_3 <> 0.GF(p) by A6;
        then RQ`3_3 <> 0 by EC_PF_1:11;
        then RQ = [(QQ`1_3)*(QQ`3_3)", (QQ`2_3)*(QQ`3_3)", 1] by Th38;
        then RQ`3_3 = 1.GF(p) by EC_PF_1:12;
        then a = 1.GF(p) by A6,A8;
        then RP`1_3 = RQ`1_3 & RP`2_3 = RQ`2_3 & RP`3_3 = RQ`3_3
               by A6;
        then RP = [RQ`1_3, RQ`2_3, RQ`3_3] by AA
        .= RQ by AA;
        hence rep_pt(P) = rep_pt(Q) by A1,A2;
      end;
    end;
    assume A9: rep_pt(P) = rep_pt(Q);
    A10: RQ _EQ_ P by A2,A9,Th36;
    RQ _EQ_ Q by A2,Th36;
    hence thesis by A10,EC_PF_1:44;
  end;
