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 Th46:
  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 compell_ProjCo(z,p).P _EQ_ compell_ProjCo(z,p).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);
    A2: PP`1_3 = P`1_3 & PP`2_3 = P`2_3 & PP`3_3 = P`3_3 by A1,Th32;
    consider QQ be Element of ProjCo(GF(p)) such that
    A3: QQ = Q & QQ in EC_SetProjCo(a,b,p);
    A4: QQ`1_3 = Q`1_3 & QQ`2_3 = Q`2_3 & QQ`3_3 = Q`3_3 by A3,Th32;
    set CP = compell_ProjCo(z,p).P;
    consider CPP be Element of ProjCo(GF(p)) such that
    A5: CPP = CP & CPP in EC_SetProjCo(a,b,p);
    A6: CPP`1_3 = CP`1_3 & CPP`2_3 = CP`2_3 & CPP`3_3 = CP`3_3 by A5,Th32;
    set CQ = compell_ProjCo(z,p).Q;
    consider CQQ be Element of ProjCo(GF(p)) such that
    A7: CQQ = CQ & CQQ in EC_SetProjCo(a,b,p);
    A8: CQQ`1_3 = CQ`1_3 & CQQ`2_3 = CQ`2_3 & CQQ`3_3 = CQ`3_3 by A7,Th32;
    hereby
      assume A9: P _EQ_ Q;
      A10: rep_pt(P) = rep_pt(Q) by A9,Th39;
      per cases;
      suppose A11: P`3_3 = 0;
        PP`3_3 = 0 by A1,A11,Th32;
        then rep_pt(QQ) = [0, 1, 0] by A1,A3,A10,Def7;
        then (rep_pt(QQ))`3_3 = 0;
        then A12: Q`3_3 = 0 by A4,Th37;
        CP = [P`1_3, -P`2_3, 0] by A11,Def8;
        then A13: CPP`3_3 = 0 by A6,Def5;
        CQ = [Q`1_3, -Q`2_3, 0] by A12,Def8;
        then CQQ`3_3 = 0 by A8,Def5;
        then rep_pt(CQ) = [0, 1, 0] by A7,Def7
        .= rep_pt(CP) by A5,A13,Def7;
        hence compell_ProjCo(z,p).P _EQ_ compell_ProjCo(z,p).Q by Th39;
      end;
      suppose A14: P`3_3 <> 0;
        rep_pt(QQ) = [(PP`1_3)*(PP`3_3)", (PP`2_3)*(PP`3_3)", 1]
        by A1,A2,A3,A10,A14,Def7;
        then A15: (rep_pt(QQ))`3_3 <> 0;
        compell_ProjCo(z,p).(rep_pt(P)) = rep_pt(compell_ProjCo(z,p).Q)
        by A4,A10,A15,Th38,Th42;
        then rep_pt(compell_ProjCo(z,p).P) = rep_pt(compell_ProjCo(z,p).Q)
        by A14,Th42;
        hence compell_ProjCo(z,p).P _EQ_ compell_ProjCo(z,p).Q by Th39;
      end;
    end;
    assume A16: compell_ProjCo(z,p).P _EQ_ compell_ProjCo(z,p).Q;
    per cases;
      suppose A17: P`3_3 = 0;
        CP = [P`1_3, -P`2_3, 0] by A17,Def8;
        then CPP`3_3 = 0 by A6,Def5;
        then A18: rep_pt(CPP) = [0, 1, 0] by Def7;
        rep_pt(CQQ) = [0, 1, 0] by A5,A7,A16,A18,Th39;
        then (rep_pt(CQQ))`3_3 = 0;
        then A19: CQ`3_3 = 0 by A8,Th37;
        CQ = [Q`1_3, -Q`2_3, Q`3_3] by Def8;
        then Q`3_3 = 0 by A19,Def5;
        then A20: rep_pt(QQ) = [0, 1, 0] by A4,Def7;
        rep_pt(PP) = [0, 1, 0] by A2,A17,Def7;
        hence P _EQ_ Q by A1,A3,A20,Th39;
      end;
      suppose A21: P`3_3 <> 0;
        CP = [P`1_3, -P`2_3, P`3_3] by Def8;
        then A22: CPP`3_3 <> 0 by A6,A21,Def5;
        set RP = rep_pt(P);
        reconsider RP as Element of EC_SetProjCo(a,b,p) by Th36;
        set RQ = rep_pt(Q);
        reconsider RQ as Element of EC_SetProjCo(a,b,p) by Th36;
        A23: rep_pt(CP) = rep_pt(CQ) by A16,Th39;
        rep_pt(CPP) = [(CPP`1_3)*(CPP`3_3)", (CPP`2_3)*(CPP`3_3)", 1]
        by A22,Def7;
        then (rep_pt(CQQ))`3_3 <> 0 by A5,A7,A23;
        then A24: CQ`3_3 <> 0 by A8,Th38;
        CQ = [Q`1_3, -Q`2_3, Q`3_3] by Def8;
        then A25: Q`3_3 <> 0 by A24,Def5;
        A26: rep_pt(CP) = compell_ProjCo(z,p).RP by A21,Th42;
        rep_pt(CQ) = compell_ProjCo(z,p).RQ by A25,Th42;
        then RP = RQ by A23,A26,Th43;
        hence P _EQ_ Q by Th39;
      end;
  end;
