Correct bounded binary modular Frobenius #
For every nonzero runtime modulus, frobeniusBits a modulus count represents
ofBits a ^ (2 ^ count.length) %ₘ ofBits modulus. Its state always has exactly
significantLength modulus - 1 bits, independently of the exponent. This
includes high zero padding, empty dividends, and constant-one moduli.
For a zero modulus the result is explicitly empty. The nested pairing
pair (pair a modulus) count supplies all three runtime inputs. Malformed
inputs follow the total pairing projections and the same guarded algorithm.
The uniform FP certificate is in Complexitylib.Classes.P.BitPolynomial.Frobenius.
Every guarded square-and-remainder step has the modulus's fixed degree width.
Every state of the count-list fold has the modulus's fixed degree width.
Output length is bounded by the supplied modulus length for all inputs.
A zero modulus produces the empty list, independently of the dividend or count.
Decoding the nested pairing recovers the exact dividend, modulus, and count list.
Even malformed paired inputs produce at most their input length in bits.