Fixed-Capacity Leaf Minimap #
This file formalizes the pure fixed-capacity minimap representation of Tianxiao Li, Jingxun Liang,
Huacheng Yu, and Renfei Zhou, Dynamic Dictionary with Subconstant Wasted Bits per Key
([LiLiangYuZhou2024, Section 3.4, Lemma 3.7 at r = 1, and Section 5.2];
arXiv:2310.20536v1, PDF pp. 11–12 / printed pp. 10–11 and PDF
pp. 27–28 / printed pp. 26–27).
Given key-ID universe Fin U', slot capacity n' (1 ≤ n' ≤ U'), and payload universe Fin X
(1 ≤ X), a minimap represents a map of m ≤ n' active keys (m = n' at fixed leaf capacity in
Section 5.2) by separating metadata (header) from payload slots (slots):
- Each payload
v < Xis split viaSpillover.encode n'(r_sp = n', [Patrascu2008, Lemma 3]; [LiLiangYuZhou2024, Lemma 3.8]) into a spillover valuek ∈ Fin K(K = Spillover.spillUniv X n' ≤ 2 * n') and anM-bit slot wordmem ∈ Fin (2 ^ M)(M = Spillover.memBits X n'). - The active key set
S ⊆ Fin U'(S.card = m) together with the tuple of spillover valuesFin m → Fin Klisted in increasing order of key inSis bijected computably onto a single metadata indexheader : Fin (U'.choose m * K ^ m)viaCslib.BitString.subsetEquiv,finFunctionFinEquiv, andfinProdFinEquiv. - Under a dynamic matching scheme
h : DynamicMatching.Scheme U' n'([LiLiangYuZhou2024, Lemma 3.2]), each active keyu ∈ Sstores itsM-bit wordmemin slotmatching h S hm ⟨u, hu⟩ : Fin n'.
At fixed leaf capacity m = n' (FixedEncoded U' n' X), bitWidth_le_infoBits_add_two proves that
the total fixed bit budget ⌈log₂(C(U', n') * K ^ n')⌉ + n' * M exceeds the information-theoretic
benchmark ⌈log₂(C(U', n') * X ^ n')⌉ by at most 2 bits, lookupHeader specifies the shared
metadata-only lookup table of size U' * C(U', n') * K ^ n' ≤ U' * C(U', n') * (2 * n') ^ n' so
query inspects at most one payload slot, and insert / delete / replace relocate O(T) slots
(O(log (max n' 2)) in expectation under uniform permutations).
Scope note #
This module supplies the pure mathematical leaf-minimap specification for the
large-parameter-regime dynamic dictionary of [LiLiangYuZhou2024, Section 5]. Word-RAM precomputed
lookup-table and bit-packed M-bit slot evaluation, variable-length r > 1 outer-spillover
minimaps inside adapter trees (Section 4), strong history independence, dynamic resizing, and
super-polynomial key universes are not formalized here.
Main definitions #
Cslib.DataStructure.Dictionary.Minimap.headerEquiv: computable header bijection ontoFin (U'.choose m * K ^ m)viaCslib.BitString.subsetEquiv.Cslib.DataStructure.Dictionary.Minimap.headerUniv,headerBits,bitWidth,infoBits: bit-budget and universe parameters.Cslib.DataStructure.Dictionary.Minimap.Encoded,FixedEncoded,BoundedEncoded: size-indexed, fixed-capacity leaf, and bounded-capacity (0 ≤ m ≤ n') minimap states.Cslib.DataStructure.Dictionary.Minimap.activeSet,lookupHeader,queryFin,query,decode,encode,empty,insertNew,overwrite,deleteMem,replace,slotDiff: active-key set, metadata lookup, encoding, updates, and slot-relocation distance.
Main results #
bitWidth_le_infoBits_add_two,queryTableSize_le: fixed leaf bit-redundancy (≤ 2bits) and shared lookup-table size bound ([LiLiangYuZhou2024, Lemma 3.7]).query_encode,decode_encode,query_insertNew,query_overwrite,query_deleteMem,query_replace,BoundedEncoded.query_insert,BoundedEncoded.query_delete,BoundedEncoded.activeSet_delete: exact lookup, active-set, and update semantics.wellFormed_encode,wellFormed_replace,unusedSlotsZero_insertNew,unusedSlotsZero_overwrite,unusedSlotsZero_deleteMem,eq_of_query_eq,eq_of_query_eq_fixed: invariant preservation and canonical (history-independent) uniqueness ofEncoded/FixedEncodedfromquery.slotDiff_insertNew_le,slotDiff_overwrite_le,slotDiff_deleteMem_le,slotDiff_replace_le,expect_slotDiff_insertNew_le,expect_slotDiff_insertNew_encode_le,expect_slotDiff_deleteMem_le,expect_slotDiff_deleteMem_encode_le,expect_slotDiff_replace_le,expect_slotDiff_replace_encode_le: deterministicO(T)and expectedO(log (max n' 2))slot-relocation bounds.
References #
Header bijection, bit-budget parameters, and minimap state #
Bit-budget parameters, minimap state, and shared lookup table #
Metadata universe size C(U', m) * K ^ m for m active keys.
Fixed bit width ⌈log₂(C(U', m) * K ^ m)⌉ of the metadata header.
Total fixed bit width ⌈log₂(C(U', n') * K ^ n')⌉ + n' * M of a full-capacity leaf minimap
(Section 5.2).
Exact ceiling ⌈log₂(C(U', n') * X ^ n')⌉ of the information-theoretic leaf bit benchmark.
Size bound on the shared metadata lookup table ([LiLiangYuZhou2024, Section 3.4, Lemma 3.7]):
U' * headerUniv U' n' X n' ≤ U' * C(U', n') * (2 * n') ^ n'.
Minimap state with m active keys in Fin U', n' memory slots, and payload bound X.
- header : Fin (headerUniv U' n' X m)
Packed subset-plus-spillover metadata index.
Fixed array of
n'memory-word slots ofSpillover.memBits X n'bits each.
Full-capacity leaf minimap (m = n', Section 5.2 of Li–Liang–Yu–Zhou 2024).
Shared metadata-only lookup function (Lemma 3.7 first lookup table, Section 5.6 metadata
probe): given scheme h, header hdr, and queried key u, returns some (k_u, slotIdx) if u
is active and matched, or none otherwise, without inspecting any payload slots.
Look up u : Fin U' in e as an Option (Fin X), reading e.header via lookupHeader and
at most one slot e.slots b.
Look up u : Fin U' in e as an Option ℕ (Dictionary.State U' convention).
Decode e to an abstract Dictionary.State U'.
Well-formedness of an encoded minimap state: every active key's (spillover, slot) pair lies in
the valid range < X of Spillover.decodeVal.
Canonical packing, encoding, and dynamic update operations #
Encode an abstract Dictionary.State U' of cardinality m ≤ n' with values < X.
Empty 0-key minimap on n' slots.
Overwrite the value of u with v < X in place when u ∈ activeSet e; an absent key
u ∉ activeSet e is never inserted, leaving activeSet and all queries unchanged.
Atomic fixed-capacity leaf key replacement (Section 5.2 leaf minimap update): removes
x_old ∈ activeSet e and inserts (x_new, v_new) (x_new ∉ (activeSet e).erase x_old, covering
both fresh x_new ∉ activeSet e and in-place x_new = x_old) at fixed capacity n'.
Empty bounded-capacity minimap (0 active keys).
Encode an abstract Dictionary.State U' of size ≤ n' with values < X.
Look up u : Fin U' in a BoundedEncoded minimap.
Decode b to an abstract Dictionary.State U'.
Insert or overwrite (u, v) in b (b.size.val < n' ∨ u ∈ activeSet b.encoded, v < X).
Invariant stating that every slot b : Fin n' not matched to an active key holds 0. Holds
automatically for empty, encode, insertNew, overwrite, deleteMem, and replace, is
preserved by BoundedEncoded.delete, and holds unconditionally for every full-capacity leaf state
e : FixedEncoded U' n' X (unusedSlotsZero_fixed).
Every full-capacity leaf minimap e : FixedEncoded U' n' X (m = n') satisfies
UnusedSlotsZero h e unconditionally because matching is a bijection onto Fin n'.
Well-formedness of a bounded-capacity minimap state.
Canonical representation (history independence) of Encoded: for a fixed matching scheme h,
any two well-formed minimap states with zeroed unused slots that induce the same query map are
identical (header and slots agree bit-for-bit).
Canonicality of well-formed full-capacity leaf states FixedEncoded U' n' X (m = n'),
without an explicit UnusedSlotsZero hypothesis.
Deterministic O(T) slot-relocation bound for inserting a fresh key (Lemma 3.7 and
Lemma 3.2): slotDiff ≤ 4 * (rounds h (activeSet e) + 1).
overwrite changes at most 2 slots (at most u's matched slot when u ∈ activeSet e, and no
slots when u ∉ activeSet e, since an absent key is never inserted).
Deterministic O(T) slot-relocation bound for deleting an active key:
slotDiff ≤ 4 * (rounds h (activeSet e) + 1).
Deterministic O(T) slot-relocation bound for atomic leaf replacement on FixedEncoded
(requires no UnusedSlotsZero hypothesis, since unusedSlotsZero_fixed holds automatically):
slotDiff ≤ 8 * rounds h (activeSet e) + 14.
Expected O(log (max n' 2)) slot-relocation bound for fresh-key insertion (Lemma 3.7) across
any scheme-indexed family e with fixed active key set S.
Expected O(log (max n' 2)) slot-relocation bound for inserting a fresh key (u, v) into the
canonical encoding encode _ h s hb hs of any fixed dictionary s (Lemma 3.7).
Expected O(log (max n' 2)) slot-relocation bound for active-key deletion (Lemma 3.7) across
any scheme-indexed family e with fixed active key set S.
Expected O(log (max n' 2)) slot-relocation bound for deleting an active key u from the
canonical encoding encode hm' h s hb hs of any fixed dictionary s (Lemma 3.7).
Expected O(log (max n' 2)) slot-relocation bound for atomic leaf replacement (Section 5.2)
across any scheme-indexed full-capacity family e with fixed active key set S.
Expected O(log (max n' 2)) slot-relocation bound for atomic leaf replacement (Section 5.2)
on the canonical encoding encode le_rfl h s hb hs of any fixed n'-key dictionary s.