Lexicographic comparison of bit strings in polynomial time #
Mathlib's lexicographic order on List Bool (false < true, and a proper prefix comes first) is
decidable in polynomial time on raw bit strings (encBits): find the first position where the
strings differ, and compare there, or compare the lengths if there is none.
Main results #
Turing.MultiTapeTM.ComputableInPolyTime.bits_lex_le:decide (x ≤ y)for the lexicographic order on bit strings is polynomial-time.