A small modulus of large order #
The AKS algorithm needs a modulus r of size polynomial in log n such that the multiplicative
order of n modulo r exceeds log₂² n. With c = ⌈log₂ n⌉, some r ≤ 4 c⁵ has order above
c² (Cslib.AKS.exists_lt_orderOf), so r ≤ 128 log₂⁵ n and the order exceeds log₂² n
(Cslib.AKS.exists_lt_orderOf_logb). This is Agrawal, Kayal, Saxena, Lemma 4.3 up to
the constant: they prove r ≤ max(3, ⌈log₂⁵ n⌉) using Nair's bound lcm(1, …, m) ≥ 2^m, while this
file uses the weaker bound C(2m, m) ≥ 4^m / (2m + 1) for numbers divisible by 1, …, 2m
(Cslib.AKS.centralBinom_dvd_of_forall_dvd).
The proof takes the least s not dividing X = n^K ∏_{i = 1}^{c²} (n^i - 1), where
K = ⌊log₂ (4c⁵)⌋; it exists since C(4c⁵, 2c⁵) > X. Such an s is coprime to n: a prime
p ∣ gcd(s, n) would give s = p^v s' with p^v ∣ n^K and s' < s, so s ∣ X. If the order o
of n modulo s were at most c², then s ∣ n^o - 1 ∣ X. The published proof passes from s
to s / gcd(s, n); here the factor n^K in X and the minimality of s give coprimality
directly.
Main results #
Cslib.AKS.centralBinom_dvd_of_forall_dvd:C(2m, m)divides every number divisible by1, …, 2m.Cslib.AKS.exists_lt_orderOf: somer ≤ 4 ⌈log₂ n⌉⁵hasord_r(n) > ⌈log₂ n⌉².Cslib.AKS.exists_lt_orderOf_logb: somer ≤ 128 log₂⁵ nhasord_r(n) > log₂² n.
References #
A small modulus of large order, with logarithms: for n ≥ 2, some 2 ≤ r ≤ 128 log₂⁵ n
has ord_r(n) > log₂² n Agrawal, Kayal, Saxena, Lemma 4.3, up to the constant.