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 Th44:
  for p be 5_or_greater Prime, z be Element of EC_WParam p,
  P be Element of EC_SetProjCo(z`1,z`2,p) st P`3_3 <> 0 holds
  P _EQ_ compell_ProjCo(z,p).P iff P`2_3 = 0
  proof
    let p be 5_or_greater Prime, z be Element of EC_WParam p,
    P be Element of EC_SetProjCo(z`1,z`2,p) such that
    A1: P`3_3 <> 0;
    set a = z`1;
    set b = z`2;
    consider PP be Element of ProjCo(GF(p)) such that
    A2: PP = P & PP in EC_SetProjCo(a,b,p);
    A3: PP`1_3 = P`1_3 & PP`2_3 = P`2_3 & PP`3_3 = P`3_3 by A2,Th32;
    set CP = compell_ProjCo(z,p).P;
    CP = [P`1_3, -P`2_3, P`3_3] by Def8;
    then
A4: CP`1_3 = P`1_3 & CP`2_3 = -P`2_3 & CP`3_3 = P`3_3 by Def3,Def4,Def5;
    set RP = rep_pt(PP);
    reconsider RP as Element of EC_SetProjCo(a,b,p) by A2,Th36;
    RP = [(P`1_3)*(P`3_3)", (P`2_3)*(P`3_3)", 1] by A1,A3,Def7;
    then A5: RP`2_3 = (P`2_3)*(P`3_3)" by Def4;
    consider CPP be Element of ProjCo(GF(p)) such that
    A6: CPP = CP & CPP in EC_SetProjCo(a,b,p);
    A7: CPP`1_3 = P`1_3 & CPP`2_3 = -P`2_3 & CPP`3_3 = P`3_3 by A4,A6,Th32;
    set RCP = rep_pt(CPP);
    reconsider RCP as Element of EC_SetProjCo(a,b,p) by A6,Th36;
    A8: RCP = [(P`1_3)*(P`3_3)", (-P`2_3)*(P`3_3)", 1] by A1,A7,Def7;
    hereby
      assume A9: P _EQ_ compell_ProjCo(z,p).P;
      P`3_3 <> 0.GF(p) by A1,EC_PF_1:11;
      then A10: (P`3_3)" <> 0.GF(p) by VECTSP_1:25;
      A11: p > 2 by Th30,XXREAL_0:2;
      RP = [(P`1_3)*(P`3_3)", (-P`2_3)*(P`3_3)", 1]
           by A2,A6,A8,A9,Th39;
      then (P`2_3)*(P`3_3)" = (P`3_3)"*(-P`2_3) by A5,Def4;
      then P`2_3 = -P`2_3 by A10,VECTSP_1:5;
      then P`2_3 + P`2_3 = 0.GF(p) by VECTSP_1:19;
      then P`2_3 = 0.GF(p) by A11,EC_PF_1:27;
      hence P`2_3 = 0 by EC_PF_1:11;
    end;
    assume A12: P`2_3 = 0;
    then P`2_3 = 0.GF(p) by EC_PF_1:11;
    then -P`2_3 = 0.GF(p) by VECTSP_2:3;
    then CPP`1_3 = P`1_3 & CPP`2_3 = 0 & CPP`3_3 = P`3_3 by A7,EC_PF_1:11;
    hence P _EQ_ compell_ProjCo(z,p).P by A6,A12,Th32;
  end;
