Documentation

CslibFrontier.Computability.WordRAM.Word

Truncation of Natural Numbers to w-Bit Words #

Computable truncation Cslib.WordRAM.wordOfNat w v : Fin (2 ^ w) mapping a natural number v below 2 ^ w (Fits w v) to ⟨v, _⟩ and defaulting out-of-range values to 0, shared between Word-RAM table-extraction and cell-probe simulation layers.

Main definitions #

Main results #

def Cslib.WordRAM.wordOfNat (w v : ℕ) :
Fin (2 ^ w)

Truncate a natural number v into a w-bit word Fin (2 ^ w), defaulting to 0 out of range.

@[simp]
theorem Cslib.WordRAM.wordOfNat_val_of_lt {w v : ℕ} (hv : v < 2 ^ w) :
↑(wordOfNat w v) = v
@[simp]
theorem Cslib.WordRAM.wordOfNat_unifFin (w : ℕ) (k : Fin (2 ^ w - 1 + 1)) :
wordOfNat w ↑k = (finCongr ⋯) k