Documentation

CslibFrontier.Foundations.Data.BitString.Lex

Lexicographic order on fixed-width bit strings #

Cslib.BitString.lexSwap tells a caller whether to swap two strings to put them in lexicographic order. It can also be used to permute data associated with the coordinates.

def Cslib.BitString.lexSwap {n : ℕ} (a b : Fin n → Bool) :

Whether lexicographic sorting interchanges a and b. Ties preserve input order.

@[simp]

The all-false string comes first in lexicographic order, including at a tie.

theorem Cslib.BitString.lexSwap_reverse {n : ℕ} {a b : Fin n → Bool} (h : a ≠ b) :

Reversing distinct inputs reverses the sorting decision.