Correctness of the function field sieve full
This proof shows: correctness, termination.
Let p be prime, let F1 and F2 be monic polynomials over Fp, and let f be monic irreducible of degree n≥2 with f∣F2(F1(t))−t. Then K=Fp[t]/(f) is the field with pn elements and K∗ is cyclic of order N=pn−1. Let g∈K∗ have order r and let h∈K∗. Let γ be the generator of line L3 and L(z)∈Z/NZ the logarithm of z∈K∗ to base γ, so L(z1z2)=L(z1)+L(z2). Let φ1:Fp[x]→K be the ring map with x↦t and φ2:Fp[y]→K the ring map with y↦F1(t). For s∈S1 write L(s) for L(φ1s), and for s∈S2 write L(s) for L(φ2s); the two bases give separate unknowns. Let ℓ=∏qe over the prime powers qe∥N with q∣r; then r∣ℓ∣N. For termination we treat the exponents m of lines L9 and L13 and the index j of line L9 as independent and uniform.
Lemma 1 (membership and the trivial target). Line L1 returns NONE exactly when h∈/⟨g⟩, and line L2 is correct.
Proof. K∗ is cyclic, so its only subgroup of order r is {z:zr=1}, which is ⟨g⟩. If h=1, then x=0. □
From now on h=gx∗ with 0≤x∗<r, unique because g has order r, and h=1, so r≥2.
Lemma 2 (constants). Let ω=γN/(p−1). Then ω generates Fp∗⊂K∗, and L(ωi)=iN/(p−1).
Proof. ω has order p−1, and Fp∗ is the unique subgroup of K∗ of order p−1, so ω is a constant and generates Fp∗. The formula follows from ωi=γiN/(p−1). □
Lemma 3 (the commutative diagram). For all A,B∈Fp[x] and G=A(x)+B(x)y, with ψ1(G)=A(x)+B(x)F1(x) and ψ2(G)=A(F2(y))+B(F2(y))y, we have φ1(ψ1(G))=φ2(ψ2(G)).
Proof. φ1(ψ1(G))=A(t)+B(t)F1(t) in K. Since φ2 is a ring map, φ2(ψ2(G))=A(F2(F1(t)))+B(F2(F1(t)))F1(t). Since f∣F2(F1(t))−t, we have F2(F1(t))=t in K, and the two sides agree. □
Lemma 4 (relations). Every row (a,−b;k) of R satisfies ∑s∈S1asL(s)−∑s∈S2bsL(s)≡k(modN).
Proof. Every s∈S1 has degree at most D≤n−1, so φ1(s)=0. Every s∈S2 has φ2(s)=0 by line L4. So all the L(s) are defined. A row from line L7 comes from G with f∤ψ1(G), so z=φ1(ψ1(G))=0, and z=φ2(ψ2(G)) by Lemma 3. With ψ1(G)=c1∏sas and ψ2(G)=c2∏sbs, applying L to the two expressions for z gives L(c1)+∑asL(s)=L(c2)+∑bsL(s), which is the row, with L(c1) and L(c2) given by Lemma 2. A row from line L10 has γmφ2(sj)=c∏s∈S1φ1(s)as in K, where the factor φ2(sj) is absent if j is none. Applying L gives m+L(sj)=L(c)+∑asL(s), which is the row with −1 in column j and right side m−L(c). □
Lemma 5 (SOLVE). Let M=qe with q prime and M∣N. If SOLVE(R,q,M) returns a vector λ, then λs≡L(s)(modM) for every unknown s.
Proof. By Lemma 4, the vector X=(L(s)modM)s satisfies every row modulo M, because M∣N. Lines L19 and L20 swap two rows, multiply a row by a unit modulo M (an entry not divisible by q is coprime to M), or subtract a multiple of one row from another. Each operation is invertible, so the set of solutions modulo M is unchanged, and X is still a solution afterwards. After column j has been processed, row j has a 1 in column j and every other row has 0 there, and later steps keep this, since they add multiples of rows whose entry in column j is 0. When all columns are processed, row j reads Xj≡ (right side of row j) (modM), so the returned λj equals Xj. □
Lemma 6 (scale). After line L11, λs≡L(s)(modℓ) for every unknown s.
Proof. Line L11 is passed only when every SOLVE succeeded, so by Lemma 5, λs(q)≡L(s)(modqe) for each qe∥ℓ. These moduli are pairwise coprime, and the Chinese remainder theorem gives a unique residue modulo ℓ with these reductions, which is L(s)modℓ. □
Lemma 7 (medium polynomials). If line L14 assigns a value to L(Gi), the value is the true L(φ1Gi)modℓ.
Proof. Every Gi has degree at most min(2D,n−1)<n, so φ1(Gi)=0 and its logarithm is defined. Line L14 accepts G only if f∤ψ1(G), ψ1(G)=Giac1∏S1sas with gcd(a,ℓ)=1, and ψ2(G)=c2∏S2sbs. By Lemma 3 and the argument of Lemma 4, aL(Gi)+L(c1)+∑asL(s)≡L(c2)+∑bsL(s)(modN), and so modulo ℓ. Since a is a unit modulo ℓ, L(Gi)≡(L(c2)+∑bsL(s)−L(c1)−∑asL(s))a−1(modℓ), and by Lemma 6 the λs may replace the L(s). □
Lemma 8 (individual logarithms). For y∈{g,h}, the value of line L16 is the true L(y)modℓ.
Proof. Line L15 is passed only when z=yγmmodf equals c∏S1sds∏Giui in Fp[x] and every Gi got a value. Applying φ1 and L gives L(y)+m≡L(c)+∑sdsL(s)+∑iuiL(Gi)(modN). Reducing modulo ℓ and using Lemmas 2, 6 and 7 gives line L16. □
Lemma 9 (conversion). With c=ℓ/r, the residue L(g)modℓ is cu for an integer u coprime to r, the residue L(h)modℓ is divisible by c, and (L(h)/c)u−1≡x∗(modr).
Proof. Since g has order r and γ has order N, gcd(L(g),N)=N/r. For each prime q∣r with qa∥r and qe∥N, the q-adic valuation of L(g), taken as an integer in [0,N−1], is exactly e−a, which is also the valuation of c at q; and c has no other prime factors, since ℓ has only primes dividing r. Reducing modulo ℓ does not change the valuation at q when it is below e, so L(g)modℓ=cu with u prime to every q∣r, that is, coprime to r. Next, h=gx∗ gives L(h)≡x∗cu(modℓ), which is divisible by c, and dividing by c gives L(h)/c≡x∗u(modℓ/c), that is, modulo r. Multiplying by u−1 modulo r gives x∗. □
Correctness. By Lemmas 8 and 9, line L18 returns x∗modr=x∗. With Lemma 1, the algorithm returns x∗ if h∈⟨g⟩ and NONE otherwise.
Termination. The loop of lines L5 to L7 runs over a finite set of pairs. For the loop of lines L8 to L11, fix an unknown. For s∈S1, each trial has j = none and γm=φ1(s) with positive probability, and then line L10 appends the row with 1 in the column of s, 0 elsewhere, and right side L(s). For sj∈S2, each trial picks this j and has γm=φ2(sj)−1 with positive probability; then z=1, which is the empty product with c=1, and line L10 appends the row with −1 in the column of sj, 0 elsewhere, and right side m. With probability 1, every unknown eventually gets such a row, and R eventually has at least t+10 rows. Once the rows include these rows for all unknowns, every SOLVE succeeds. Indeed, the row that has its only nonzero entry, ±1, in column j has entry 0 in every earlier column, so it is never chosen as a pivot for an earlier column and is never changed by the clearing steps, which subtract a multiple of a pivot row only from rows with a nonzero entry in the pivot column. A swap at column j′<j moves only rows at positions at least j′, so this row stays at a position at least j until column j is processed, and then its entry ±1 is a unit pivot. The implementation retries SOLVE after each new row of line L10, so a successful attempt occurs. For the loop of lines L13 to L15, each trial has z=1 with probability 1/N; then there are no Gi, and line L15 is passed. Each search of line L14 is over a finite set. Hence the algorithm stops with probability 1. ■