Testing generators of prime fields at the first counting function level #
generatorTest (p, g) accepts exactly a prime modulus p and a positive canonical representative
g < p of a primitive root. It is total on every pair of binary naturals. Primality is checked
by universally testing possible divisors, and generator status by universally testing the
smaller positive exponents. One bitstring of width Nat.size p supplies either candidate.
Thus the evaluator is polynomial-time, though its domain can be exponential, and one application
of short-index universal quantification places the test in F_1. No primality or discrete-log
oracle is assumed. Modular exponentiation uses the existing certified square-and-multiply API.
A single universal short-index check puts the complete generator test in F_1. All arithmetic and prime-divisor tests are performed by its one polynomial-time evaluator.
The total binary test recognizes precisely canonical primitive roots of prime fields. In particular the two-element field accepts its generator one, while all malformed moduli are rejected. This characterization has no computational assumptions.