Documentation

CslibFrontier.Algorithms.WordRAM.TrimmedYates.TrieRep

Internal cell-footprint predicate for flat Word-RAM binary tries #

Internal TrieRep predicate and helper lemmas shared privately between Basic (defining unexposed HoldsTrie), Trie, InputTrie, Tabulate, and Stages; never re-exported through TrimmedYates or TrimmedYates.Basic.

Main definitions #

Main results #

TrieRep mem d node S fn: node is the root of a depth-d binary trie in mem with owned cell footprint S, representing the function fn : ℕ → ℕ on low-d-bit keys. node = 0 is the empty trie returning 0 everywhere. Every allocated node occupies {node, node + 1} with 0 < node.

theorem Cslib.Algorithms.WordRAM.TrimmedYates.TrieRep.congr_mem {mem mem' : ℕ → ℕ} {d node : ℕ} {S : Set ℕ} {fn : ℕ → ℕ} (h : TrieRep mem d node S fn) (heq : ∀ a ∈ S, mem' a = mem a) :
TrieRep mem' d node S fn

Memory writes outside S preserve TrieRep.

theorem Cslib.Algorithms.WordRAM.TrimmedYates.TrieRep.zero_root (mem : ℕ → ℕ) (d : ℕ) :
TrieRep mem d 0 ∅ fun (x : ℕ) => 0

Address 0 represents the identically zero trie with empty cell footprint.

theorem Cslib.Algorithms.WordRAM.TrimmedYates.TrieRep.fresh_node {mem : ℕ → ℕ} (d : ℕ) {node : ℕ} (hpos : 0 < node) (h0 : mem node = 0) (h1 : mem (node + 1) = 0) :
TrieRep mem d node {node, node + 1} fun (x : ℕ) => 0

Fresh zero-initialized two-word node represents the identically zero trie.