Proofs: Index calculus
These are the human proofs of Index calculus, at full length.
Correctness of index calculus full
This proof shows: correctness, termination.
Let be prime, of order , and . Let be the generator of line L3 and the logarithm of to base , so . Let over the prime powers with . Since , every prime power satisfies , so . For termination we treat the exponents of lines L6 and L11 as independent and uniform on .
Lemma 1 (membership and the trivial target). Line L1 returns NONE exactly when , and line L2 is correct.
Proof. is cyclic, so its only subgroup of order is , which is . If , then .
From now on with , unique because has order , and , so .
Lemma 2 (relations). Every pair in satisfies .
Proof. Line L7 appends only if . Every is a prime below , so , and applying gives .
Lemma 3 (SOLVE). Let with prime. If SOLVE returns a vector , then for every .
Proof. By Lemma 2 the vector satisfies every row modulo , because . Lines L15 and L16 swap two rows, multiply a row by a unit modulo (an entry not divisible by is coprime to ), or subtract a multiple of one row from another. Each operation is invertible, so the set of solutions modulo of the system is unchanged, and is still a solution afterwards. After the column has been processed, row has a in column and every other row has there, and later steps keep this, since they add multiples of rows whose entry in column is . When all columns are processed, row reads . So the returned equals .
Lemma 4 (individual logarithms). After lines L9 and L12, for every , and of line L12 is the true for .
Proof. Line L9 is reached only when every SOLVE succeeded, so by Lemma 3, for each . These moduli are pairwise coprime, and the Chinese remainder theorem gives a unique residue modulo with these reductions, which is . At line L11, , so , and reducing modulo gives line L12.
Lemma 5 (conversion). With , the residue is for an integer coprime to , the residue is divisible by , and .
Proof. Since has order and has order , . For each prime with and , the -adic valuation of , taken as an integer in , is exactly , which is also the valuation of at ; and has no other prime factors, since has only primes dividing . Reducing modulo does not change the valuation at when it is below , so with prime to every , that is, coprime to . Next, gives , which is divisible by , and dividing by gives , that is, modulo . Multiplying by modulo gives .
Correctness. By Lemmas 4 and 5, line L14 returns . With Lemma 1, the algorithm returns if and NONE otherwise.
Termination. The descent of line L11 stops with probability : for each trial, is uniform in and equals , which is smooth, with probability . For the loop of lines L5 to L9, fix . Each trial has with probability , and then line L7 appends the row with , all other entries , and right side . With probability , every eventually contributes such a row. Once the relations include the unit vectors for all , every SOLVE succeeds: before column is processed, the row that started as the unit vector for column has been changed only by subtracting multiples of earlier pivot rows, which subtracts multiples of its entries in earlier columns, all , so it still has entry in column , which is a unit. The attempts at line L8 happen every new relations, so a successful attempt occurs. Hence the algorithm stops with probability .