begin
:: deftheorem PFDef2 defines Subfield EC_PF_1:def 1 :
for K, b2 being Field holds
( b2 is Subfield of K iff ( the carrier of b2 c= the carrier of K & the addF of b2 = the addF of K || the carrier of b2 & the multF of b2 = the multF of K || the carrier of b2 & 1. b2 = 1. K & 0. b2 = 0. K ) );
theorem PF1:
theorem PF2:
theorem PF4:
theorem PF5:
theorem
theorem PF7:
theorem PF8:
theorem PF9:
theorem
theorem
:: deftheorem PFDef3 defines prime EC_PF_1:def 2 :
for IT being Field holds
( IT is prime iff for K1 being Field st K1 is strict Subfield of IT holds
K1 = IT );
begin
EXLm1:
for M being non empty multMagma
for a being Element of M
for n being Nat holds (power M) . (a,n) is Element of M
theorem XLm2:
theorem XLm3:
theorem GF1:
theorem GF2:
theorem GF3:
theorem GF4:
theorem
theorem GF6:
theorem
theorem GF8:
theorem EX1:
EXLm3:
for p being Prime
for a being Element of (GF p) holds (power (GF p)) . (a,1) = a
EXLm4:
for p being Prime
for a being Element of (GF p) holds (power (GF p)) . (a,2) = a * a
theorem
theorem EX4:
theorem EX5:
theorem EX6:
theorem EX7:
theorem EX8:
theorem EX9:
theorem EX10:
theorem EX11:
theorem EX12:
theorem LMCycle4:
theorem LMCycle5:
begin
:: deftheorem QRDef1 defines quadratic_residue EC_PF_1:def 3 :
for p being Prime
for a being Element of (GF p) holds
( a is quadratic_residue iff ( a <> 0 & ex x being Element of (GF p) st x |^ 2 = a ) );
:: deftheorem QRDef2 defines not_quadratic_residue EC_PF_1:def 4 :
for p being Prime
for a being Element of (GF p) holds
( a is not_quadratic_residue iff ( a <> 0 & ( for x being Element of (GF p) holds not x |^ 2 = a ) ) );
theorem QR1:
:: deftheorem QRDef3 defines Lege_p EC_PF_1:def 5 :
for p being Prime
for a being Element of (GF p) holds
( ( a = 0 implies Lege_p a = 0 ) & ( a is quadratic_residue implies Lege_p a = 1 ) & ( not a = 0 & not a is quadratic_residue implies Lege_p a = - 1 ) );
theorem QR10:
theorem QR11:
theorem QR12:
theorem
theorem QR14:
theorem QR15:
theorem
theorem QRRT1:
begin
definition
let K be
Field;
func ProjCo K -> non
empty Subset of
[: the carrier of K, the carrier of K, the carrier of K:] equals
[: the carrier of K, the carrier of K, the carrier of K:] \ {[(0. K),(0. K),(0. K)]};
correctness
coherence
[: the carrier of K, the carrier of K, the carrier of K:] \ {[(0. K),(0. K),(0. K)]} is non empty Subset of [: the carrier of K, the carrier of K, the carrier of K:];
end;
:: deftheorem defines ProjCo EC_PF_1:def 6 :
for K being Field holds ProjCo K = [: the carrier of K, the carrier of K, the carrier of K:] \ {[(0. K),(0. K),(0. K)]};
theorem GFProjCo:
:: deftheorem defines Disc EC_PF_1:def 7 :
for p being Prime
for a, b, b4 being Element of (GF p) holds
( b4 = Disc (a,b,p) iff for g4, g27 being Element of (GF p) st g4 = 4 mod p & g27 = 27 mod p holds
b4 = (g4 * (a |^ 2)) + (g27 * (b |^ 3)) );
definition
let p be
Prime;
let a,
b be
Element of
(GF p);
func EC_WEqProjCo (
a,
b,
p)
-> Function of
[: the carrier of (GF p), the carrier of (GF p), the carrier of (GF p):],
(GF p) means :
ECDefEQ:
for
P being
Element of
[: the carrier of (GF p), the carrier of (GF p), the carrier of (GF p):] holds
it . P = (((P `2) |^ 2) * (P `3)) - ((((P `1) |^ 3) + ((a * (P `1)) * ((P `3) |^ 2))) + (b * ((P `3) |^ 3)));
existence
ex b1 being Function of [: the carrier of (GF p), the carrier of (GF p), the carrier of (GF p):],(GF p) st
for P being Element of [: the carrier of (GF p), the carrier of (GF p), the carrier of (GF p):] holds b1 . P = (((P `2) |^ 2) * (P `3)) - ((((P `1) |^ 3) + ((a * (P `1)) * ((P `3) |^ 2))) + (b * ((P `3) |^ 3)))
uniqueness
for b1, b2 being Function of [: the carrier of (GF p), the carrier of (GF p), the carrier of (GF p):],(GF p) st ( for P being Element of [: the carrier of (GF p), the carrier of (GF p), the carrier of (GF p):] holds b1 . P = (((P `2) |^ 2) * (P `3)) - ((((P `1) |^ 3) + ((a * (P `1)) * ((P `3) |^ 2))) + (b * ((P `3) |^ 3))) ) & ( for P being Element of [: the carrier of (GF p), the carrier of (GF p), the carrier of (GF p):] holds b2 . P = (((P `2) |^ 2) * (P `3)) - ((((P `1) |^ 3) + ((a * (P `1)) * ((P `3) |^ 2))) + (b * ((P `3) |^ 3))) ) holds
b1 = b2
end;
:: deftheorem ECDefEQ defines EC_WEqProjCo EC_PF_1:def 8 :
for p being Prime
for a, b being Element of (GF p)
for b4 being Function of [: the carrier of (GF p), the carrier of (GF p), the carrier of (GF p):],(GF p) holds
( b4 = EC_WEqProjCo (a,b,p) iff for P being Element of [: the carrier of (GF p), the carrier of (GF p), the carrier of (GF p):] holds b4 . P = (((P `2) |^ 2) * (P `3)) - ((((P `1) |^ 3) + ((a * (P `1)) * ((P `3) |^ 2))) + (b * ((P `3) |^ 3))) );
theorem LmECDefEQ:
LML:
for p being Prime
for a, b being Element of (GF p) holds
( [0,1,0] is Element of ProjCo (GF p) & (EC_WEqProjCo (a,b,p)) . [0,1,0] = 0. (GF p) )
:: deftheorem defines EC_SetProjCo EC_PF_1:def 9 :
for p being Prime
for a, b being Element of (GF p) holds EC_SetProjCo (a,b,p) = { P where P is Element of ProjCo (GF p) : (EC_WEqProjCo (a,b,p)) . P = 0. (GF p) } ;
LMNGA0:
for p being Prime
for d, Y being Element of (GF p) holds [d,Y,1] is Element of ProjCo (GF p)
theorem ECZERO:
theorem ECAFF:
:: deftheorem DefEQV defines _EQ_ EC_PF_1:def 10 :
for p being Prime
for P, Q being Element of ProjCo (GF p) holds
( P _EQ_ Q iff ex a being Element of (GF p) st
( a <> 0. (GF p) & P `1 = a * (Q `1) & P `2 = a * (Q `2) & P `3 = a * (Q `3) ) );
theorem LmEQV3:
theorem LmEQV4:
for
p being
Prime for
a,
b being
Element of
(GF p) for
P,
Q being
Element of
[: the carrier of (GF p), the carrier of (GF p), the carrier of (GF p):] for
d being
Element of
(GF p) st
p > 3 &
Disc (
a,
b,
p)
<> 0. (GF p) &
P in EC_SetProjCo (
a,
b,
p) &
d <> 0. (GF p) &
Q `1 = d * (P `1) &
Q `2 = d * (P `2) &
Q `3 = d * (P `3) holds
Q in EC_SetProjCo (
a,
b,
p)
:: deftheorem defines R_ProjCo EC_PF_1:def 11 :
for p being Prime holds R_ProjCo p = { [P,Q] where P, Q is Element of ProjCo (GF p) : P _EQ_ Q } ;
theorem LmDefREQ:
definition
let p be
Prime;
let a,
b be
Element of
(GF p);
func R_EllCur (
a,
b,
p)
-> Equivalence_Relation of
(EC_SetProjCo (a,b,p)) equals
(R_ProjCo p) /\ (nabla (EC_SetProjCo (a,b,p)));
correctness
coherence
(R_ProjCo p) /\ (nabla (EC_SetProjCo (a,b,p))) is Equivalence_Relation of (EC_SetProjCo (a,b,p));
end;
:: deftheorem defines R_EllCur EC_PF_1:def 12 :
for p being Prime
for a, b being Element of (GF p) holds R_EllCur (a,b,p) = (R_ProjCo p) /\ (nabla (EC_SetProjCo (a,b,p)));
theorem LmDefREQ0:
for
p being
Prime for
a,
b being
Element of
(GF p) for
P,
Q being
Element of
ProjCo (GF p) st
Disc (
a,
b,
p)
<> 0. (GF p) &
P in EC_SetProjCo (
a,
b,
p) &
Q in EC_SetProjCo (
a,
b,
p) holds
(
P _EQ_ Q iff
[P,Q] in R_EllCur (
a,
b,
p) )
theorem LmDefREQ1:
theorem LmDefREQ2:
theorem LmDefREQ3:
for
p being
Prime for
a,
b being
Element of
(GF p) for
x being
set st
p > 3 &
Disc (
a,
b,
p)
<> 0. (GF p) &
x in Class (R_EllCur (a,b,p)) & ( for
P being
Element of
ProjCo (GF p) holds
( not
P in EC_SetProjCo (
a,
b,
p) or not
P = [0,1,0] or not
x = Class (
(R_EllCur (a,b,p)),
P) ) ) holds
ex
P being
Element of
ProjCo (GF p) ex
X,
Y being
Element of
(GF p) st
(
P in EC_SetProjCo (
a,
b,
p) &
P = [X,Y,1] &
x = Class (
(R_EllCur (a,b,p)),
P) )
theorem LmDefREQ4:
for
p being
Prime for
a,
b being
Element of
(GF p) st
p > 3 &
Disc (
a,
b,
p)
<> 0. (GF p) holds
Class (R_EllCur (a,b,p)) = {(Class ((R_EllCur (a,b,p)),[0,1,0]))} \/ { (Class ((R_EllCur (a,b,p)),P)) where P is Element of ProjCo (GF p) : ( P in EC_SetProjCo (a,b,p) & ex X, Y being Element of (GF p) st P = [X,Y,1] ) }
theorem LMNGA2:
for
p being
Prime for
a,
b,
d1,
Y1,
d2,
Y2 being
Element of
(GF p) st
p > 3 &
Disc (
a,
b,
p)
<> 0. (GF p) &
[d1,Y1,1] in EC_SetProjCo (
a,
b,
p) &
[d2,Y2,1] in EC_SetProjCo (
a,
b,
p) holds
(
Class (
(R_EllCur (a,b,p)),
[d1,Y1,1])
= Class (
(R_EllCur (a,b,p)),
[d2,Y2,1]) iff (
d1 = d2 &
Y1 = Y2 ) )
theorem MIS:
for
p being
Prime for
a,
b being
Element of
(GF p) for
F1,
F2 being
set st
p > 3 &
Disc (
a,
b,
p)
<> 0. (GF p) &
F1 = {(Class ((R_EllCur (a,b,p)),[0,1,0]))} &
F2 = { (Class ((R_EllCur (a,b,p)),P)) where P is Element of ProjCo (GF p) : ( P in EC_SetProjCo (a,b,p) & ex X, Y being Element of (GF p) st P = [X,Y,1] ) } holds
F1 misses F2
theorem LmDefREQ42:
theorem LmDefREQ43:
theorem LmDefREQ44:
theorem
theorem LmCardA:
for
p being
Prime for
a,
b,
d being
Element of
(GF p) for
F,
G being
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 being
Function of
F,
G st
(
I is
onto &
I is
one-to-one )
theorem LmECPFCardB:
for
p being
Prime for
a,
b,
d being
Element of
(GF p) st
p > 3 &
Disc (
a,
b,
p)
<> 0. (GF p) holds
card { (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) } = 1
+ (Lege_p (((d |^ 3) + (a * d)) + b))
LMNG:
for p being Prime
for n being Nat st n in Seg p holds
n - 1 is Element of (GF p)
LmECPFCardC:
for p being Prime
for a, b, c, d being Element of (GF p) st p > 3 & Disc (a,b,p) <> 0. (GF p) holds
ex S being Function st
( dom S = Seg p & ( for n being Nat st n in dom S holds
S . n = { (Class ((R_EllCur (a,b,p)),[(n - 1),Y,1])) where Y is Element of (GF p) : [(n - 1),Y,1] in EC_SetProjCo (a,b,p) } ) & S is disjoint_valued & ( for n being Nat st n in dom S holds
S . n is finite ) & union (rng S) = { (Class ((R_EllCur (a,b,p)),P)) where P is Element of ProjCo (GF p) : ( P in EC_SetProjCo (a,b,p) & ex X, Y being Element of (GF p) st P = [X,Y,1] ) } )
theorem LmECPFCardY:
for
p being
Prime for
a,
b being
Element of
(GF p) st
p > 3 &
Disc (
a,
b,
p)
<> 0. (GF p) holds
ex
F being
FinSequence of
NAT st
(
len F = p & ( for
n being
Nat st
n in Seg p holds
ex
d being
Element of
(GF p) st
(
d = n - 1 &
F . n = 1
+ (Lege_p (((d |^ 3) + (a * d)) + b)) ) ) &
card { (Class ((R_EllCur (a,b,p)),P)) where P is Element of ProjCo (GF p) : ( P in EC_SetProjCo (a,b,p) & ex X, Y being Element of (GF p) st P = [X,Y,1] ) } = Sum F )
theorem