Oblivious-Sequence Resizable Word RAM Implementation Certificates #
Connects state-free oblivious-sequence specifications (Cslib.DataStructure.ObliviousSequenceSpec)
to randomized subroutines on the word-granular Resizable Word RAM
(Cslib.WordRAM.Resizable.ExecRCodeDist and ExecRProgramDist), accompanying the word-granular
resizable memory models of [LLYZ23a], Section 2.1, and
[KLZ26], Section 5.1, and adapting the bit-granular virtual-memory variant of
[LLYZ24], Section 3.2, at word granularity. Expected step times sum across
ops : List S.Op by linearity of expectation ([MU17], Section 2.1), tracking
trajectory-dependent resting (spaceBound : List S.Op → ℕ) and peak
(peakSpaceBound : List S.Op → S.Op → ℕ) word bounds while preserving caller memory [0, base).
Main definitions #
Randomized.LatentRState,Randomized.StepROutcome,Randomized.SeqROutcome: named state and transcript records overRData rfor multi-step distributional execution.Randomized.ObliviousPeakFits: trajectory-relative peak-frontier admissibility alongops.Randomized.ExecSteps,Randomized.ExecProgramSteps: structured (ExecRCodeDist) and compiled flat-program (ExecRProgramDist) multi-operation oblivious execution relations.Randomized.ObliviousSequenceImpl: Resizable Word RAM implementation certificate forS : ObliviousSequenceSpec.Randomized.StateTransitionImpl.toObliviousSequenceImpl,Randomized.StateTransitionImpl.toObliviousSequenceImplOfFn: canonical embeddings of relational and functionalResizable.Randomized.StateTransitionImplcertificates intoObliviousSequenceImplviaStateTransitionSpec.toObliviousSequenceSpec.
Main results #
Randomized.ExecSteps.bounded,Randomized.ExecSteps.frontier_le,Randomized.ExecSteps.caller_mem,Randomized.ExecSteps.mapSimulates: preservation ofRData.Bounded w, resting frontier bounds, caller prefix[0, base), and basis transport.Randomized.ObliviousSequenceImpl.mapSimulates,Randomized.ObliviousSequenceImpl.toStandard: basis transport fromBasis.exacttoBasis.standard.Randomized.ObliviousSequenceImpl.seq_expected,Randomized.ExecSteps.toExecRProgramDist,Randomized.ObliviousSequenceImpl.seq_toExecRProgramDist: end-to-end expected-time, resting/peak space, caller-prefix, andS.Contracttheorems onRCodeand compiled flatRProgram.Randomized.not_execProgramSteps_halt:.halt-rejection soundness check onExecProgramSteps.
References #
- [MU17] Michael Mitzenmacher and Eli Upfal, Probability and Computing, 2nd ed., Cambridge University Press, 2017, Section 2.1.
- [LLYZ23a] Tianxiao Li, Jingxun Liang, Huacheng Yu, and Renfei Zhou, Dynamic
"Succincter", FOCS 2023, pp. 1715–1733 (
arXiv:2309.12950v1, Section 2.1, PDF pp. 6–7 / printed pp. 5–6). - [LLYZ24] Tianxiao Li, Jingxun Liang, Huacheng Yu, and Renfei Zhou, Dynamic Dictionary
with Subconstant Wasted Bits per Key, SODA 2024 (
arXiv:2310.20536v1, Section 3.2, PDF pp. 9–10 / printed pp. 8–9). - [KLZ26] William Kuszmaul, Jingxun Liang, and Renfei Zhou, Succinct Dynamic
Rank/Select: Bypassing the Tree-Structure Bottleneck, SODA 2026 (
arXiv:2510.19175v1, Section 5.1, PDF pp. 16–20 / printed pp. 15–19).
Named state, outcome, and trajectory-fit bundles #
Coupled latent state and concrete Resizable Word RAM state RData r.
- latent : Latent
Internal latent state (such as a hash seed or coupled relational state).
- data : WordRAM.Resizable.RData r
Concrete Resizable Word RAM register, memory, and frontier state.
Outcome of a single oblivious subroutine operation step.
- latent : Latent
Updated internal latent state.
- data : WordRAM.Resizable.RData r
Updated concrete Resizable Word RAM state.
- result : α
Decoded observation returned by the operation.
Outcome of a multi-operation oblivious sequence.
- latent : Latent
Current internal latent state.
- data : WordRAM.Resizable.RData r
Current concrete Resizable Word RAM state.
Accumulated input-output transcript executed so far.
Initialize a SeqROutcome from a LatentRState with an empty transcript [].
Append a single operation outcome q : StepROutcome Latent (Result o) r to t.
Multi-operation distributional execution (ExecSteps and ExecProgramSteps) #
Multi-operation structured distributional execution across remaining operations remOps after
prefix prefOps: at each operation o, P.code executes under ExecRCodeDist within peak
frontier base + peakSpaceBound prefOps o, establishes resting frontier
base ≤ q.data.frontier ≤ base + spaceBound (prefOps ++ [o]) and q.data.regs P.baseReg = base,
decodes q.result, preserves caller memory [0, base), and appends ⟨o, q.result⟩.
- nil {B : WordRAM.Basis} {r_ds k_init : ℕ} {P : SubroutineCode B r_ds k_init} {S : ObliviousSequenceSpec} {Latent : Type z} {w base : ℕ} {spaceBound : List S.Op → ℕ} {peakSpaceBound : List S.Op → S.Op → ℕ} {encode : S.Op → Fin r_ds → ℕ} {decode : (o : S.Op) → (Fin r_ds → ℕ) → Option (S.Result o)} (prefOps : List S.Op) (ν : PMF (SeqROutcome Latent S.Result r_ds)) : ExecSteps P S Latent w base spaceBound peakSpaceBound encode decode prefOps [] ν ν 0
- cons {B : WordRAM.Basis} {r_ds k_init : ℕ} {P : SubroutineCode B r_ds k_init} {S : ObliviousSequenceSpec} {Latent : Type z} {w base : ℕ} {spaceBound : List S.Op → ℕ} {peakSpaceBound : List S.Op → S.Op → ℕ} {encode : S.Op → Fin r_ds → ℕ} {decode : (o : S.Op) → (Fin r_ds → ℕ) → Option (S.Result o)} {prefOps : List S.Op} {o : S.Op} {ops : List S.Op} {ν ν_final : PMF (SeqROutcome Latent S.Result r_ds)} {μ_step : SeqROutcome Latent S.Result r_ds → PMF (StepROutcome Latent (S.Result o) r_ds)} {T_step : SeqROutcome Latent S.Result r_ds → ENNReal} {T_rest : ENNReal} : (∀ t ∈ ν.support, WordRAM.Resizable.RData.Bounded w t.data ∧ (∀ (i : Fin r_ds), P.input i = true → WordRAM.Fits w (encode o i)) ∧ WordRAM.Resizable.RData.Bounded w (P.prepare encode o t.data) ∧ WordRAM.Resizable.ExecRCodeDist w P.code (P.prepare encode o t.data) (PMF.map StepROutcome.data (μ_step t)) (T_step t) (base + peakSpaceBound prefOps o) ∧ ∀ q ∈ (μ_step t).support, WordRAM.Resizable.RData.Bounded w q.data ∧ (base ≤ q.data.frontier ∧ q.data.frontier ≤ base + spaceBound (prefOps ++ [o]) ∧ q.data.regs P.baseReg = base) ∧ decode o q.data.regs = some q.result ∧ ∀ addr < base, q.data.mem addr = t.data.mem addr) → ExecSteps P S Latent w base spaceBound peakSpaceBound encode decode (prefOps ++ [o]) ops (ν.bind fun (t : SeqROutcome Latent S.Result r_ds) => PMF.map (t.appendStep o) (μ_step t)) ν_final T_rest → ExecSteps P S Latent w base spaceBound peakSpaceBound encode decode prefOps (o :: ops) ν ν_final (∑' (t : SeqROutcome Latent S.Result r_ds), ν t * T_step t + T_rest)
ExecSteps preserves RData.Bounded w across all support states.
ExecSteps establishes resting frontier bounds base ≤ t.data.frontier ≤ base + spaceBound (prefOps ++ remOps) and t.data.regs P.baseReg = base on ν_final.support.
ExecSteps preserves caller memory [0, base) across all support states.
Lift an ExecSteps derivation along a basis simulation φ : B.Simulates B'.
Multi-operation compiled flat-RProgram execution relation over ExecRProgramDist.
- nil {B : WordRAM.Basis} {r_ds k_init : ℕ} {P : SubroutineCode B r_ds k_init} {S : ObliviousSequenceSpec} {Latent : Type z} {w base : ℕ} {spaceBound : List S.Op → ℕ} {peakSpaceBound : List S.Op → S.Op → ℕ} {encode : S.Op → Fin r_ds → ℕ} {decode : (o : S.Op) → (Fin r_ds → ℕ) → Option (S.Result o)} {p_op : WordRAM.Resizable.RProgram B r_ds} {out : Fin r_ds} (prefOps : List S.Op) (ν : PMF (SeqROutcome Latent S.Result r_ds)) : ExecProgramSteps P S Latent w base spaceBound peakSpaceBound encode decode p_op out prefOps [] ν ν 0
- cons {B : WordRAM.Basis} {r_ds k_init : ℕ} {P : SubroutineCode B r_ds k_init} {S : ObliviousSequenceSpec} {Latent : Type z} {w base : ℕ} {spaceBound : List S.Op → ℕ} {peakSpaceBound : List S.Op → S.Op → ℕ} {encode : S.Op → Fin r_ds → ℕ} {decode : (o : S.Op) → (Fin r_ds → ℕ) → Option (S.Result o)} {p_op : WordRAM.Resizable.RProgram B r_ds} {out : Fin r_ds} {prefOps : List S.Op} {o : S.Op} {ops : List S.Op} {ν ν_final : PMF (SeqROutcome Latent S.Result r_ds)} {μ_step : SeqROutcome Latent S.Result r_ds → PMF (StepROutcome Latent (S.Result o) r_ds)} {T_step : SeqROutcome Latent S.Result r_ds → ENNReal} {T_rest : ENNReal} : (∀ t ∈ ν.support, WordRAM.Resizable.ExecRProgramDist w p_op out (P.prepare encode o t.data) (PMF.map StepROutcome.data (μ_step t)) (T_step t) (base + peakSpaceBound prefOps o) ∧ ∀ q ∈ (μ_step t).support, WordRAM.Resizable.RData.Bounded w q.data ∧ (base ≤ q.data.frontier ∧ q.data.frontier ≤ base + spaceBound (prefOps ++ [o]) ∧ q.data.regs P.baseReg = base) ∧ decode o q.data.regs = some q.result ∧ ∀ addr < base, q.data.mem addr = t.data.mem addr) → ExecProgramSteps P S Latent w base spaceBound peakSpaceBound encode decode p_op out (prefOps ++ [o]) ops (ν.bind fun (t : SeqROutcome Latent S.Result r_ds) => PMF.map (t.appendStep o) (μ_step t)) ν_final T_rest → ExecProgramSteps P S Latent w base spaceBound peakSpaceBound encode decode p_op out prefOps (o :: ops) ν ν_final (∑' (t : SeqROutcome Latent S.Result r_ds), ν t * T_step t + T_rest)
Compile a structured ExecSteps derivation to ExecProgramSteps ... (P.opProg out) out,
charging + 1 instruction per operation for the trailing halt out.
Every support state t ∈ ν.support extends to some final support state u ∈ ν_final.support
whose transcript has t.transcript as a prefix.
.halt-rejection soundness check (not_execProgramSteps_halt): a 1-instruction
[.halt out] stub cannot satisfy ExecProgramSteps on (o :: ops) whenever for some
t ∈ ν.support, no observation a decoded from P.prepare encode o t.data can appear at the next
position of ν_final's transcripts (or when P.prepare encode o t.data violates the post-step
frontier bound).
ObliviousSequenceImpl: Resizable Word RAM implementation for an ObliviousSequenceSpec #
Reusable Resizable Word RAM subroutine implementation certificate for a randomized data
structure P : SubroutineCode B r_ds k_init realizing an oblivious-sequence specification
S : DataStructure.ObliviousSequenceSpec at word width w, base address base, and runtime
parameters params, with trajectory-dependent resting (spaceBound : List S.Op → ℕ) and peak
(peakSpaceBound : List S.Op → S.Op → ℕ) word bounds.
- Latent : Type z
Internal latent state type (such as a hash seed or coupled relational trace).
Resting post-prefix word-footprint upper bound
x.frontier ≤ base + spaceBound prefOps.Peak intermediate word-footprint bound
y.frontier ≤ base + peakSpaceBound prefOps o.- initTime : ENNReal
Expected instruction bound for
P.initCode. - initPotential : ℕ
Upper bound on initial concrete potential (
0when unamortized). Per-operation instruction charge.
Distributional invariant on the initial coupled distribution produced by
P.initCode.Predicate under which
arguments_fitbounds encoded arguments (fun _ _ => Truedefault).Standalone register encoding for argument delivery.
Output decoder reading typed operation observations from final registers.
- bounded {ν : PMF (LatentRState self.Latent r_ds)} : self.initInv ν → ∀ t ∈ ν.support, WordRAM.Resizable.RData.Bounded w t.data
Initial distributions satisfying
initInvare supported on word-bounded states. - frontier_le {ν : PMF (LatentRState self.Latent r_ds)} : self.initInv ν → ∀ t ∈ ν.support, base ≤ t.data.frontier ∧ t.data.frontier ≤ base + self.spaceBound [] ∧ t.data.regs P.baseReg = base
Initial distributions satisfying
initInvestablish resting frontier bounds at[]. - arguments_fit {z : self.Latent} (o : S.Op) : self.validOp z o → ∀ (i : Fin r_ds), P.input i = true → WordRAM.Fits w (self.encode o i)
Standalone encoded arguments fit in
w-bit words on operations satisfyingvalidOp. - init_exec {x₀ : WordRAM.Resizable.RData r_ds} : WordRAM.Resizable.RData.Bounded w x₀ → x₀.frontier = base → (∀ (j : Fin k_init), x₀.regs (P.initParams j) = params j) → WordRAM.Fits w (base + self.spaceBound []) → ∃ (ν₀ : PMF (LatentRState self.Latent r_ds)), WordRAM.Resizable.ExecRCodeDist w P.initCode x₀ (PMF.map LatentRState.data ν₀) self.initTime (base + self.spaceBound []) ∧ self.initInv ν₀ ∧ ∀ t ∈ ν₀.support, ∀ addr < base, t.data.mem addr = x₀.mem addr
Distributional initialization of
P.initCodefromx₀.frontier = base, preserving caller memory[0, base). - steps_exec (ops : List S.Op) (ν₀ : PMF (LatentRState self.Latent r_ds)) : S.ValidOpSeq ops → ObliviousPeakFits w base self.peakSpaceBound [] ops → self.initInv ν₀ → ∃ (ν_final : PMF (SeqROutcome self.Latent S.Result r_ds)) (T_ops : ENNReal), ExecSteps P S self.Latent w base self.spaceBound self.peakSpaceBound self.encode self.decode [] ops (PMF.map SeqROutcome.ofLatentRState ν₀) ν_final T_ops ∧ S.Contract ops (PMF.map SeqROutcome.transcript ν_final) ∧ T_ops ≤ ↑self.initPotential + ↑(List.map self.charge ops).sum
Multi-operation execution across any admissible oblivious sequence
ops : List S.Opwhose trajectory peaks fit inw-bit words (ObliviousPeakFits w base peakSpaceBound [] ops).
Total operation charge summed across ops : List S.Op.
Specialization of ExecSteps from prefix [] to C : ObliviousSequenceImpl.
Specialization of ExecProgramSteps from prefix [] to C : ObliviousSequenceImpl.
Transport an ObliviousSequenceImpl certificate along φ : B.Simulates B'.
Lift an exact-basis ObliviousSequenceImpl certificate to Basis.standard.
End-to-end expected-time, trajectory-space, caller-prefix, and distributional correctness
theorem (seq_expected).
End-to-end compiled flat-RProgram expected-time theorem (seq_toExecRProgramDist).
Coupled latent seed, current abstract state, and accumulated relational transcript prefix for
embedding Cslib.DataStructure.WordRAM.Resizable.Randomized.StateTransitionImpl into
ObliviousSequenceImpl.
- seed : Seed
Latent random seed from the underlying
StateTransitionImpl. - state : D.State
Current abstract state of
D. - trace : D.Transcript
Relational execution transcript accumulated since
s₀.
For a functional specification ([D.HasStepFn stepFn]), ObliviousPeakFits along the
canonical state trajectory (D.run s₀ pref).1 agrees with PeakFitsHistory.
Canonical Embedding of StateTransitionImpl into ObliviousSequenceImpl #
Canonical embedding of any relational
Cslib.DataStructure.WordRAM.Resizable.Randomized.StateTransitionImpl certificate into
ObliviousSequenceImpl realizing D.toObliviousSequenceSpec s₀, given trajectory-indexed resting
and peak word bounds (seqSpaceBound, seqPeakSpaceBound) and a state-independent operation
charge opCharge : D.Op → ℕ.
Canonical embedding of any functional
Cslib.DataStructure.WordRAM.Resizable.Randomized.StateTransitionImpl certificate
([D.HasStepFn stepFn]) into ObliviousSequenceImpl using the exact canonical trajectory bounds
pref ↦ C.spaceBound (D.run s₀ pref).1 and (pref, o) ↦ C.peakSpaceBound (D.run s₀ pref).1 o.