Documentation

CslibFrontier.Computability.Machines.Turing.MultiTape.Complexity.PolyTime.Nat.PadicVal

Polynomial-time 2-adic valuation on unary naturals #

Repeated division by two while the current value is positive and even counts the binary trailing zeros padicValNat 2 n in at most n unary steps, keeping the encoded (value, count) pair linearly bounded.

Main results #

The 2-adic valuation padicValNat 2 is polynomial-time with both input and output in unary.