Documentation

CslibFrontier.DataStructure.Dictionary.WordRAM.ResizableSuccinct.Migration.Exec.InitFirst

Empty-to-Active First-Epoch Initialization (initFirstEpochCode) #

Compiles the empty-to-active transition (n = 0 → n' = 1, N₁ = targetCap U 1) on insert u v into the parameter-free (¬ReadsWidth) native RCode .exact rResize subroutine initFirstEpochCode, proving its distributional O(1) execution bound initFirstEpochCode_execRCodeDist.

Main definitions #

Main results #

Parameter-free $O(1)$ expected amortized instruction charge for 0 → 1 first-epoch creation (initFirstEpochCode).

Empty-to-active epoch transition (n = 0 → n' = 1, N₁ = targetCap U 1) on insert u v: grows [base + 8, base + compactedEpochWords U V w N₁ 1), writes epoch parameters, samples a uniform QuotHashSeed U N₁, initializes metadata, and inserts (u, v) (¬ReadsWidth).

theorem Cslib.DataStructure.Dictionary.WordRAM.ResizableSuccinct.initFirstEpochCode_execRCodeDist {U V w base : ℕ} (u : Fin U) (v : ℕ) {x : WordRAM.Resizable.RData rResize} (hx : WordRAM.Resizable.RData.Bounded w x) (hfr : x.frontier = base + 8) (hhdr : RootHeaderValid U V w 0 0 0 base x.mem) (hv_lt : v < V) (hfit_peak : WordRAM.Fits w (base + compactedEpochWords U V w (targetCap U 1) 1)) (hbase : x.regs mBase = base) (hu_reg : x.regs mArgU = ↑u) (hv_reg : x.regs mArgV = v) :
have N₁ := targetCap U 1; have fr₁ := base + compactedEpochWords U V w N₁ 1; ∃ (zOf : Succinct.QuotHashSeed U N₁ → WordRAM.Resizable.RData rResize) (T_init : ENNReal), WordRAM.Resizable.ExecRCodeDist w initFirstEpochCode x (PMF.map zOf (Probability.PMF.uniformOfFintype (Succinct.QuotHashSeed U N₁))) T_init fr₁ ∧ (∀ (θ : Succinct.QuotHashSeed U N₁), WordRAM.Resizable.RData.Bounded w (zOf θ) ∧ (zOf θ).frontier = fr₁ ∧ CompactedSplitRep base (base + offCompItems U w N₁) U V w N₁ 1 1 θ (Function.update (empty U) u (some v)) { mem := (zOf θ).mem, frontier := (zOf θ).frontier } ∧ (zOf θ).regs mBase = base ∧ ∀ addr < base, (zOf θ).mem addr = x.mem addr) ∧ T_init + ∑' (θ : Succinct.QuotHashSeed U N₁), (Probability.PMF.uniformOfFintype (Succinct.QuotHashSeed U N₁)) θ * ↑(inEpochPotential U w N₁ base (zOf θ)) ≤ ↑initFirstCharge

Distributional 0 → 1 Epoch Creation (initFirstEpochCode_execRCodeDist): From the 8-word empty dictionary state (n = 0, N = 0) at base, initFirstEpochCode creates the first active epoch (N₁, 1, 1) (N₁ = targetCap U 1) containing (u, v) under a fresh uniform QuotHashSeed U N₁, never exceeding base + compactedEpochWords U V w N₁ 1 and bounding expected instructions plus post-step inEpochPotential by initFirstCharge.