Documentation

Complexitylib.Encoding.BitPolynomial.Remainder

Correct binary-polynomial remainder with a runtime modulus #

ofBits_remainderBits identifies the concrete list algorithm with polynomial remainder over ZMod 2 for every dividend and modulus. High zero padding does not change the modulus. A zero modulus returns the original dividend, while a constant-one modulus produces the empty coefficient list.

The high-to-low scan stores exactly the modulus degree in bits. Its width is bounded by the supplied modulus length, and the total evaluator's output is bounded by the larger input length. The uniform polynomial-time certificate is in Complexitylib.Classes.P.BitPolynomial.Remainder.

The significant coefficient width never exceeds the input length.

Significant width zero means exactly that all represented coefficients are zero.

For a nonzero polynomial, significant width is one past its degree.

theorem Complexity.BitPolynomial.remainderStep_length (modulus : List Bool) (bit : Bool) (state : List Bool) :
(remainderStep modulus bit state).length = significantLength modulus - 1

Every cancellation step restores the fixed width, including width zero.

Every intermediate scan state has the fixed remainder width.

Exact output length, with the unchanged-dividend convention for a zero modulus.

The output length is bounded by the larger operand length.

The total bit-list algorithm computes polynomial remainder for every modulus.

The evaluator reads its dividend and modulus from the standard pairing codec.