Proofs: Quasi-polynomial discrete logarithm algorithm
These are the human proofs of Quasi-polynomial discrete logarithm algorithm, at full length.
Correctness of the quasi-polynomial discrete logarithm algorithm (toy version) full
This proof shows: correctness, termination.
We prove the version of the main pseudocode. Let be an odd prime power, with and a product of linear factors, and a monic irreducible factor of degree of . Let , a field with elements, and , cyclic of order . Let have order and let . Let be the generator of line L3 and the logarithm of to base . Let over the prime powers with ; then . For termination we treat the exponents of lines L9 and L13 as independent and uniform in .
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 (the systematic congruence). Let with , and . Then and every with are nonzero polynomials of degree at most , a polynomial of degree among them is a nonzero constant, and in
where both sides are nonzero.
Proof. In any commutative ring of characteristic containing , holds in , since both sides are monic of degree and vanish at the elements of . Homogenizing gives in : for this is the identity above, both sides are homogeneous of degree , and both have the coefficient at . Substitute and . Since the characteristic divides , , and in we have because divides . So and in , and multiplying the identity by gives the congruence. If as a polynomial, then and ; if , then . Both are excluded, so all factors are nonzero, and a factor of degree is a nonzero constant. A nonzero polynomial of degree at most is a nonzero element of . Also in : otherwise , then , against . So the left side is a product of nonzero elements of the field , and it is nonzero; hence so is .
The matrices of line L5 have : for with the determinant is , and for with and it is .
Lemma 3 (relations). Every row of satisfies . For every key of with , is a nonzero element of and .
Proof. The constants: has order and lies in , the only subgroup of of that order, so it generates and ; the table of the implementation holds these values modulo . Write each factor of degree in Lemma 2 as with , so , and each constant factor has . Taking of the congruence of Lemma 2 gives, modulo ,
For a row of line L7, as polynomials, so . Moving the constants to the right gives the row of line L7, which holds modulo and so modulo . For line L8, with monic, irreducible and of degree . Since in , its factor is nonzero in , and . With built as in line L7 from the other factors, this reads . A row of line L10 comes from , so .
Lemma 4 (SOLVE). Let with prime and . If SOLVE returns a vector , then for every .
Proof. By Lemma 3 the true vector modulo satisfies every row, because . Lines L18 and L19 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 solution set modulo does not change, and the true vector stays a solution. After column is processed, row has in column and every other row has there, and later steps keep this. At the end row reads its right side, so the returned value is the true one.
Lemma 5 (scale). After line L11, for every .
Proof. Line L11 is passed only when every SOLVE succeeded, so Lemma 4 applies to every . The moduli are pairwise coprime, and the Chinese remainder theorem gives a unique residue modulo with these reductions.
Lemma 6 (individual logarithms). For , the value of line L15 is .
Proof. Line L14 is passed only when equals as a polynomial and every is a key of . Then, modulo , . Reducing modulo , and replacing by (Lemma 5) and by (Lemmas 3 and 5), gives line L15.
Lemma 7 (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 in , is exactly , which is the valuation of at , and has no other prime factors. Reducing modulo does not change a valuation below , so with coprime to . Next, gives , so , and multiplying by gives .
Correctness. By Lemmas 6 and 7, line L17 returns . With Lemma 1, the algorithm returns if and NONE otherwise.
Termination. Lines L5 to L8 run over a finite list. In the loop of lines L9 to L11, for each the draw , which has probability in each trial, gives and the row with in column , elsewhere, and right side . With probability every column eventually has such a unit row. Once these rows are present, every SOLVE succeeds: the unit row of column has in every earlier column, so it is never chosen as a pivot for an earlier column and the clearing steps never change it, since they change only rows with a nonzero entry in the pivot column; a swap at column moves it only to a position at least , so it is still available at column , where its entry is a unit pivot. The implementation tries SOLVE each time the number of rows reaches a threshold that grows by a fixed amount after each failure, and rows keep being added, so it tries SOLVE infinitely often and the first try after all unit rows are present succeeds. In the loop of lines L13 and L14, the draw gives , which splits with no , so each loop ends with probability . Hence the algorithm stops with probability .