Flattening lexicographically numbered tuples #
An outer coordinate j followed by an inner coordinate i becomes coordinate j * k + i.
The first coordinate remains most significant: ranking the inner tuples in base n and then
the outer tuple in base n ^ k gives exactly the rank of the flattened base-n tuple.
Main definitions #
Cslib.Logic.FO.Ordered.flattenTuple: outer-then-inner coordinate flattening.
Main results #
Cslib.Logic.FO.Ordered.flattenTuple_finProdFinEquiv: flattening the blocks of a tuple recovers it.Cslib.Logic.FO.Ordered.lexRank_flattenTuple: exact preservation of numeric rank.
References #
- N. Immerman, Descriptive Complexity, Proposition 1.28 and Remark 1.32.
theorem Cslib.Logic.FO.Ordered.flattenTuple_finProdFinEquiv {α : Type u_1} {k l : ℕ} (x : Fin (l * k) → α) :
Flattening the blocks of a tuple recovers it.