Skip to content

feat(quantum): prove masked-chain endpoint security with preprocessing - #1193

Open
alexanderlhicks wants to merge 4 commits into
feat/parallel-qrom-03-experimentsfrom
feat/parallel-qrom-04-masked-chain
Open

alexanderlhicks wants to merge 4 commits into
feat/parallel-qrom-03-experimentsfrom
feat/parallel-qrom-04-masked-chain

Conversation

@alexanderlhicks

@alexanderlhicks alexanderlhicks commented Nov 19, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Prove endpoint-recovery security for the idealized masked-chain puzzle, including query-bounded preprocessing with unrestricted retained classical and quantum memory. The named scheme experiment equals the endpoint game exactly.

For $N=|G|$, chain parameter $q$, at most $q$ online rounds and width $k$, the online bound is

$$\min\left(1,\frac{\binom{q+1}{2}}{N}+\left(N^{-1/2}+2\sum_{h<q}\sqrt{k(q-h)/N}\right)^2\right).$$

Only programmed input vertices contribute to the collision allowance. For the one-link puzzle ($q=0$) without preprocessing, the bound is exactly $1/N$. The collision allowance remains for longer chains, whose public masks can help even an adversary that makes zero queries. The online bound has order $kq^3/N$ for positive $k,q$; a smaller adversary round cap is currently admitted through monotonicity but does not sharpen the chain-dependent expression. Preprocessing uses both its round and total-point bounds.

Afshar et al. ePrint 2023/932, Lemma 5.5 already bounds the endpoint event. Their detailed Theorem 5.3 states order $\sqrt{kq^3/N}$. The root-accumulation bookkeeping here gives the smaller asymptotic expression when $kq^3&lt;N$, without a novelty or best-known-bound claim. The hidden tuple stays joint with the output throughout.

Base: #1191. The exact byte encoding #1194 is a separate child.

Suggested review order: #1188 → #1190 → #1192 first; then #1191 → #1193; then #1194 → #1195 → #1196.

Validation

Validated head: 55a2d15c3f85c4e55b7e4e91cfd106a4e457a546. All nine hosted check types and every recorded run passed.

Review response and reproducible checks · Review dispositions

The reproduction commands for this slice are:

lake build VCVio VCVioTest.Quantum.MaskedChain VCVioTest.Quantum.QueryBoundedPreprocessing VCVioTest.Quantum.MaskedChainRootBounds
lake build
lake exe axiomsweep --check
lake lint

The hosted matrix also runs the default executable/CSV suite, initializer checks, import and
isolation guards, documentation checks and downstream builds. The default axiom sweep covers
production roots; a fresh whole-test-library axiom sweep is not implied. Historical contract
comparison can be reproduced from the published baseline and committed capture tools as
specified in the integration review-response page.

@github-actions

github-actions Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

🤖 PR Summary

Mathematical Formalization

  • Masked-Chain Model (VCVio/Quantum/Oracle/MaskedChain/Model.lean): Defines the idealized endpoint recovery experiment. Key definitions: Puzzle (the chain data: group element G and q+1 vertices), OnlineAdversary (an oracle-independent initial state and a program taking a Puzzle), publicPuzzle (constructs the puzzle from an oracle H and q+2 vertices), recoveryLaw (the joint law of the experiment), and recoveryAdvantage (success probability). Theorems recoveryAdvantage_eq_sum (rewrites advantage as uniform averages) and recoveryAdvantage_le_one (probability ≤ 1).
  • Preprocessing Model (VCVio/Quantum/Oracle/MaskedChain/Preprocessing/Model.lean): Extends the model to a two-phase quantum adversary with oracle preprocessing. Defines PreprocessingAdversary, preprocessedRecoveryProgram, preprocessedRecoveryAdversary, preprocessedRecoveryLaw, and preprocessedRecoveryAdvantage. Theorems preprocessedRecoveryAdvantage_eq_sum and preprocessedRecoveryAdvantage_le_one mirror the no-preprocessing case.
  • Masked-Chain Puzzle Scheme (VCVio/Schemes/MaskedChainPuzzle.lean): Realizes the idealized construction as a concrete time-lock puzzle scheme (RoundComp, genWith, gen, solveFrom, solve, scheme) for a finite abelian group G. Establishes query bounds for honest generation and solving (isOnlineQueryBound_genWith, etc.) and correctness (simulateQ_genWith, simulateQ_solveFrom, simulateQ_solve_publicPuzzle). Includes an adversary adapter adversary that lifts a no-preprocessing online adversary to the two-phase setting, preserving query bounds. Core security theorems: qromDelayAdvantage_eq_recoveryAdvantage, qromDelayAdvantage_le, qromDelayAdvantage_le_root.
  • Preprocessing Security for the Puzzle (VCVio/Schemes/MaskedChainPuzzle/Preprocessing.lean): Connects the puzzle's quantum delay advantage to the preprocessed recovery advantage (qromDelayAdvantage_eq_preprocessedRecoveryAdvantage). Provides bounds using recovery bounds and preprocessing error (qromDelayAdvantage_le_of_preprocessing), strengthened by taking the minimum of rounds and points (qromDelayAdvantage_le_of_preprocessing_min), and a point-only bound (qromDelayAdvantage_le_of_preprocessing_points). Declares security (QROMDelaySecure) under various phase budgets (qromDelaySecure, qromDelaySecure_points, qromDelaySecure_root).

Proof Completion (sorries removed)

No sorry or admit placeholders were introduced or remain in any of the added files. The new theorems are fully proved.

Protocols / Soundness

  • Coupling Framework (VCVio/Quantum/Oracle/MaskedChain/Coupling.lean): Introduces head-priority patching (patch, patchEquiv, patchPrefix) and additive mask reparameterization (maskEquiv, oracleMasks). Key theorems: map_uniform_patch, lintegral_uniform_patch (uniformity preserved under patching), oracleMasks_patch_of_injective, oracleMasks_patch_of_input_injective (masks coincide with independent programming for injective inputs), and real_le_patched_add_collision, real_le_maskFirst_add_collision (real oracle-derived-mask experiment bounded by independent masking plus input-collision probability).
  • Homogeneous Bounds (VCVio/Quantum/Oracle/MaskedChain/Homogeneous.lean): Defines patchedRecoveryBound (noncomputable Rℕ₀₈ bound excluding classical collision error). Theorems recoveryBound_eq_patchedRecoveryBound_add_collision (full bound = patched bound + birthday term) and averageHybridSuccess_zero_le_mul_mass (mask-first success ≤ initial mass × patched bound).
  • Hybrid Oracle (VCVio/Quantum/Oracle/MaskedChain/Hybrid.lean): Defines maskValues, prefixOracle, fullOracle, hybridSchedule. Key theorems: prefixOracle_congr, hybridSchedule_eq_off_cutoff, fullOracle_eq_prefixOracle_of_not_mem_tailInputs, queryWeight_hybridSchedule_eq_of_vertices_prefix, run_parallelScheduledRuntime_eq_of_prefix, run_parallelScheduledRuntime_const, evalDistMap_parallelScheduledRuntime_const, rpow_inv_two_evalDistMap_hybridSchedule_le (square-root comparison for adjacent hybrids), evalDistMap_hybridSchedule_le (event comparison), run_hybridSchedule_last_update (final hybrid independent of endpoint vertex).
  • Root-Accumulated Bounds (VCVio/Quantum/Oracle/MaskedChain/RootBounds.lean): Defines rootPatchedRecoveryBound and rootRecoveryBound. Theorems sqrt_sum_evalDistMap_resampleFutureVertices_le, sqrt_averageHybridSuccess_le_succ, sqrt_averageHybridSuccess_zero_le, averageHybridSuccess_zero_le_root, averageHybridSuccess_zero_le_root_mul_mass, and recoveryAdvantage_le_root. The final theorem bounds the endpoint recovery probability by a root-accumulated expression plus a collision allowance.
  • Preprocessing Normalization (VCVio/Quantum/Oracle/MaskedChain/Preprocessing/DropEmpty.lean): Defines dropEmptyPreprocessing to remove empty preprocessing batches. Theorems isPointBound_dropEmptyPreprocessing, isTotalQueryBound_dropEmptyPreprocessing_of_isPointBound, isTotalQueryBound_dropEmptyPreprocessing, run_preprocessedRecoveryProgram_dropEmptyPreprocessing, and preprocessedRecoveryAdvantage_dropEmptyPreprocessing_eq justify dropping zero-width rounds without affecting guarantees, allowing point budgets to bound non-empty rounds directly.

Documentation

  • docs/design/quantum-layer.md: Adds Sections 14 and 15 detailing the no-preprocessing and preprocessing security bounds, linking to the main theorems (recoveryAdvantage_le_root, preprocessedRecoveryAdvantage_le_root, qromDelaySecure_root) and source files.
  • docs/quantum/guide/5-qrom.md: Introduces the endpoint recovery experiment and the bound recoveryAdvantage_le_root, explaining the joint-distribution proof technique.
  • docs/quantum/guide/7-time-lock-puzzles.md: (Summary unavailable.) Likely extended with the masked-chain puzzle definitions and security theorems.
  • docs/quantum/guide/README.md: Updated table of contents and summary to reference the new masked-chain endpoint recovery content.
  • docs/quantum/reference/literature.md: Adds five reference entries linking formal Lean theorems to Afshar et al. (ePrint 2023/932) and clarifies that the root-accumulated bound yields order kq³/N vs. the published order √(kq³/N), with no novelty or best-known-bound claim.

Infrastructure / CI

  • VCVio.lean: Public imports for the new VCVio.Quantum.Oracle.MaskedChain family of modules and VCVio.Schemes.MaskedChainPuzzle with its Preprocessing submodule.
  • VCVioTest.lean: Public imports for three new test modules: VCVioTest.Quantum.MaskedChain, VCVioTest.Quantum.MaskedChainRootBounds, and VCVioTest.Quantum.QueryBoundedPreprocessing.
  • Test files:
    • VCVioTest/Quantum/MaskedChain.lean: Demonstrates patch behavior under repeated inputs, includes root_inv_256 (ENNReal identity), oneRound_recoveryAdvantage_le (bound 33/128), recoveryAdvantage_zero (zero mass → zero advantage), and integration examples.
    • VCVioTest/Quantum/MaskedChainRootBounds.lean: Tests a trivial adversary guessFirst, verifies concrete root bound values for specific parameters (q=0, q=1) including capped bounds.
    • VCVioTest/Quantum/QueryBoundedPreprocessing.lean: Constructs tableAdversary (preprocessing reads full oracle table), proves recovery_with_table, verifies query bounds, and tests dropEmptyPreprocessing.

The core proof concentration is in Oracle/MaskedChain/ (model, coupling, hybrid, root bounds, homogeneous bounds) and Schemes/MaskedChainPuzzle/ (scheme definitions and security transfer). The documentation and test files are supporting material.


Statistics

Metric Count
📝 Files Changed 21
✅ Lines Added 3369
❌ Lines Removed 4

Lean Declarations

✏️ Added: 182 declaration(s)

VCVio/Quantum/Oracle/MaskedChain/Bounds.lean (17)

  • def resampleFutureVertices {q : ℕ} (h : ℕ) (a b : Fin (q + 2) → G) : Fin (q + 2) → G
  • noncomputable def averageHybridSuccess {q : ℕ} (I : L.Interp) (adv : OnlineAdversary L G q)
  • noncomputable def hybridSuccess {q : ℕ} (I : L.Interp) (adv : OnlineAdversary L G q)
  • noncomputable def recoveryBound (G : Type) [Fintype G] (q k : ℕ) : ℝ≥0∞
  • private theorem average_eq_lintegral {Ω : Type*} [MeasurableSpace Ω]
  • private theorem four_rpow_inv_two : (4 : ℝ≥0∞) ^ (2⁻¹ : ℝ) = 2
  • private theorem freshCoordinateGuess
  • private theorem le_last_add_sum (p c : ℕ → ℝ≥0∞) (n : ℕ)
  • theorem averageHybridSuccess_last_le {q : ℕ} (I : L.Interp) (adv : OnlineAdversary L G q)
  • theorem averageHybridSuccess_le_last {q : ℕ} (I : L.Interp)
  • theorem averageHybridSuccess_le_succ {q : ℕ} (I : L.Interp) (adv : OnlineAdversary L G q)
  • theorem queryWeight_resampleFutureVertices {q : ℕ} (I : L.Interp) (H : G → G)
  • theorem recoveryAdvantage_le {q k : ℕ} (I : L.Interp) (adv : OnlineAdversary L G q)
  • theorem recoveryAdvantage_le_of_patched_bound {q : ℕ} (I : L.Interp)
  • theorem sum_evalDistMap_resampleFutureVertices_le {q : ℕ} (I : L.Interp) (H : G → G)
  • theorem sum_queryWeight_resampleFutureVertices_le {q : ℕ} (I : L.Interp) (H : G → G)
  • theorem tailInputs_resampleFutureVertices {q : ℕ} (h : ℕ) (a b : Fin (q + 2) → G) :

VCVio/Quantum/Oracle/MaskedChain/Coupling.lean (25)

  • def maskEquiv {n : ℕ} (xs : Fin (n + 1) → G) : (Fin n → G) ≃ (Fin n → G) where
  • def oracleMasks {n : ℕ} (H : G → G) (xs : Fin (n + 1) → G) : Fin n → G
  • def patch : (n : ℕ) → (Fin n → X) → (X → Y) → (Fin n → Y) → X → Y
  • def patchEquiv : (n : ℕ) → (xs : Fin n → X) →
  • def patchPrefix : {n : ℕ} → (X → Y) → (Fin n → X) → (Fin n → Y) → ℕ → X → Y
  • def swapCoordinate (x : X) : ((X → Y) × Y) ≃ ((X → Y) × Y) where
  • def tailInputs {n : ℕ} (xs : Fin n → X) (m : ℕ) : Set X
  • private theorem lintegral_le_add_of_eq_off {A : Type*} [Finite A]
  • theorem future_hit_sum_le (q h : ℕ) (hh : h ≤ q) (z : R) :
  • theorem lintegral_maskEquiv [Finite G] {n : ℕ} (xs : Fin (n + 1) → G)
  • theorem lintegral_uniform_patch (n : ℕ) (xs : Fin n → X) (f : (X → Y) → ENNReal) :
  • theorem map_uniform_patch (n : ℕ) (xs : Fin n → X) :
  • theorem oracleMasks_patch_of_injective [DecidableEq G] (n : ℕ) (H : G → G)
  • theorem oracleMasks_patch_of_input_injective [DecidableEq G] (n : ℕ) (H : G → G)
  • theorem patchEquiv_fst (n : ℕ) (xs : Fin n → X) (H : X → Y) (ys : Fin n → Y) :
  • theorem patchPrefix_congr {n : ℕ} (H : X → Y) {xs xs' : Fin n → X}
  • theorem patchPrefix_full (n : ℕ) (H : X → Y) (xs : Fin n → X) (ys : Fin n → Y) :
  • theorem patchPrefix_succ {n : ℕ} (H : X → Y) (xs : Fin (n + 1) → X)
  • theorem patchPrefix_zero {n : ℕ} (H : X → Y) (xs : Fin n → X) (ys : Fin n → Y) :
  • theorem patch_eq_at_injective (n : ℕ) (xs : Fin n → X) (H : X → Y)
  • theorem patch_eq_of_avoids (n : ℕ) (xs : Fin n → X) (H : X → Y)
  • theorem patch_eq_patchPrefix_of_not_mem_tailInputs (n : ℕ) (H : X → Y) (xs : Fin n → X)
  • theorem real_le_maskFirst_add_collision [Fintype G] (n : ℕ)
  • theorem real_le_patched_add_collision [Fintype G] (n : ℕ)
  • theorem uniform_input_collision_le [Fintype G] (n : ℕ) :

VCVio/Quantum/Oracle/MaskedChain/Homogeneous.lean (3)

  • noncomputable def patchedRecoveryBound (G : Type) [Fintype G] (q k : ℕ) : ℝ≥0∞
  • theorem averageHybridSuccess_zero_le_mul_mass {q : ℕ} (I : L.Interp)
  • theorem recoveryBound_eq_patchedRecoveryBound_add_collision (G : Type) [Fintype G]

VCVio/Quantum/Oracle/MaskedChain/Hybrid.lean (14)

  • def fullOracle {q : ℕ} (H : G → G) (vertices : Fin (q + 2) → G)
  • def hybridSchedule {q : ℕ} (H : G → G) (vertices : Fin (q + 2) → G)
  • def maskValues {q : ℕ} (masks : Fin (q + 1) → G) (vertices : Fin (q + 2) → G) :
  • def prefixOracle {q : ℕ} (H : G → G) (vertices : Fin (q + 2) → G)
  • theorem evalDistMap_hybridSchedule_le {q : ℕ} (I : L.Interp)
  • theorem evalDistMap_parallelScheduledRuntime_const (I : L.Interp) (H : G → G)
  • theorem fullOracle_eq_prefixOracle_of_not_mem_tailInputs {q : ℕ} (H : G → G)
  • theorem hybridSchedule_eq_off_cutoff {q : ℕ} (H : G → G)
  • theorem prefixOracle_congr {q : ℕ} (H : G → G) (masks : Fin (q + 1) → G)
  • theorem queryWeight_hybridSchedule_eq_of_vertices_prefix [Fintype G] {q : ℕ}
  • theorem rpow_inv_two_evalDistMap_hybridSchedule_le {q : ℕ} (I : L.Interp)
  • theorem run_hybridSchedule_last_update {q : ℕ} (I : L.Interp)
  • theorem run_parallelScheduledRuntime_const (I : L.Interp) (H : G → G)
  • theorem run_parallelScheduledRuntime_eq_of_prefix (I : L.Interp)

VCVio/Quantum/Oracle/MaskedChain/Model.lean (8)

  • abbrev Puzzle (G : Type) (q : ℕ)
  • def OnlineAdversary.IsQueryBound {L : LocalSig.{u, v}} {q : ℕ}
  • def publicPuzzle {q : ℕ} (H : G → G) (vertices : Fin (q + 2) → G) : Puzzle G q
  • noncomputable def recoveryAdvantage {L : LocalSig.{u, v}} {q : ℕ}
  • noncomputable def recoveryLaw {L : LocalSig.{u, v}} {q : ℕ}
  • private theorem sum_average_le {Ω : Type*} [Fintype Ω] [Nonempty Ω]
  • theorem recoveryAdvantage_eq_sum {q : ℕ} (I : L.Interp) (adv : OnlineAdversary L G q) :
  • theorem recoveryAdvantage_le_one {q : ℕ} (I : L.Interp) (adv : OnlineAdversary L G q) :

VCVio/Quantum/Oracle/MaskedChain/Preprocessing.lean (18)

  • noncomputable def preprocessingError (G : Type) [Fintype G] (q r Q : ℕ) : ℝ≥0∞
  • noncomputable def rootPreprocessedRecoveryBound (G : Type) [Fintype G]
  • private noncomputable def referenceSuccess {q : ℕ} (H : G → G) (adv : PreprocessingAdversary G q)
  • private theorem all_input_hit_sum_le (q : ℕ) (z : G) :
  • private theorem averageHybridSuccess_preprocessing_le {q k r Q : ℕ}
  • private theorem averageHybridSuccess_preprocessing_le_root {q k r Q : ℕ}
  • private theorem averageHybridSuccess_zero_eq_sum {q : ℕ}
  • private theorem evalDistMap_bind_observed {q : ℕ} (H₀ H₁ : G → G)
  • private theorem evalDistMap_bind_same_observed {q : ℕ} (H : G → G)
  • private theorem referenceSuccess_le {q k : ℕ} (H : G → G) (adv : PreprocessingAdversary G q)
  • private theorem referenceSuccess_le_root {q k : ℕ} (H : G → G)
  • private theorem sum_reducedPost_mass_le_one {q : ℕ} (H : G → G)
  • theorem preprocessedRecoveryAdvantage_le {q k r Q : ℕ}
  • theorem preprocessedRecoveryAdvantage_le_min {q k r Q : ℕ}
  • theorem preprocessedRecoveryAdvantage_le_points {q k Q : ℕ}
  • theorem preprocessedRecoveryAdvantage_le_root {q k r Q : ℕ}
  • theorem preprocessedRecoveryAdvantage_le_root_min {q k r Q : ℕ}
  • theorem preprocessingError_self (G : Type) [Fintype G] (q Q : ℕ) :

VCVio/Quantum/Oracle/MaskedChain/Preprocessing/DropEmpty.lean (6)

  • noncomputable def dropEmptyPreprocessing {q : ℕ} (adv : PreprocessingAdversary G q) :
  • theorem isPointBound_dropEmptyPreprocessing {q Q : ℕ} (adv : PreprocessingAdversary G q)
  • theorem isTotalQueryBound_dropEmptyPreprocessing {q r : ℕ}
  • theorem isTotalQueryBound_dropEmptyPreprocessing_of_isPointBound {q Q : ℕ}
  • theorem preprocessedRecoveryAdvantage_dropEmptyPreprocessing_eq {q : ℕ}
  • theorem run_preprocessedRecoveryProgram_dropEmptyPreprocessing {q : ℕ}

VCVio/Quantum/Oracle/MaskedChain/Preprocessing/Model.lean (7)

  • abbrev PreprocessingAdversary (G : Type) [Fintype G] [DecidableEq G] (q : ℕ)
  • noncomputable def preprocessedRecoveryAdvantage {q : ℕ} (adv : PreprocessingAdversary G q) :
  • noncomputable def preprocessedRecoveryAdversary {q : ℕ} (adv : PreprocessingAdversary G q) :
  • noncomputable def preprocessedRecoveryLaw {q : ℕ} (adv : PreprocessingAdversary G q) :
  • noncomputable def preprocessedRecoveryProgram {q : ℕ} (adv : PreprocessingAdversary G q)
  • theorem preprocessedRecoveryAdvantage_eq_sum {q : ℕ} (adv : PreprocessingAdversary G q) :
  • theorem preprocessedRecoveryAdvantage_le_one {q : ℕ} (adv : PreprocessingAdversary G q) :

VCVio/Quantum/Oracle/MaskedChain/RootBounds.lean (11)

  • noncomputable def rootPatchedRecoveryBound (G : Type) [Fintype G] (q k : ℕ) : ℝ≥0∞
  • noncomputable def rootRecoveryBound (G : Type) [Fintype G] (q k : ℕ) : ℝ≥0∞
  • private theorem four_rpow_inv_two : (4 : ℝ≥0∞) ^ (2⁻¹ : ℝ) = 2
  • private theorem le_last_add_sum (p e : ℕ → ℝ≥0∞) (q : ℕ)
  • private theorem uniform_average_const {Ω : Type*} [Fintype Ω] [Nonempty Ω] (a : ℝ≥0∞) :
  • theorem averageHybridSuccess_zero_le_root {q : ℕ} (I : L.Interp)
  • theorem averageHybridSuccess_zero_le_root_mul_mass {q : ℕ} (I : L.Interp)
  • theorem recoveryAdvantage_le_root {q k : ℕ} (I : L.Interp)
  • theorem sqrt_averageHybridSuccess_le_succ {q : ℕ} (I : L.Interp)
  • theorem sqrt_averageHybridSuccess_zero_le {q : ℕ} (I : L.Interp)
  • theorem sqrt_sum_evalDistMap_resampleFutureVertices_le {q : ℕ} (I : L.Interp) (H : G → G)

VCVio/Schemes/MaskedChainPuzzle.lean (24)

  • abbrev RoundComp (G : Type)
  • def genWith {q : ℕ} (vertices : Fin (q + 2) → G) :
  • def solve {q : ℕ} (puzzle : Quantum.MaskedChain.Puzzle G q) : RoundComp G (Option G)
  • def solveFrom : {n : ℕ} → (Fin n → G) → G → RoundComp G G
  • noncomputable def adversary {q : ℕ}
  • noncomputable def gen [Fintype G] (q : ℕ) :
  • noncomputable def scheme [Fintype G] [DecidableEq G] (q : ℕ) :
  • private theorem evalDistMap_endpoint_decide (H : G → G) {A : QReg}
  • private theorem simulateQ_liftProb {α : Type} (H : G → G) (oa : ProbComp α) :
  • theorem adversary_isQueryBound {q k : ℕ}
  • theorem evalDist_scheme_solve_publicPuzzle [MeasurableSpace (Option G)] {q : ℕ}
  • theorem isOnlineQueryBound_gen [Fintype G] (q : ℕ) :
  • theorem isOnlineQueryBound_genWith {q : ℕ} (vertices : Fin (q + 2) → G) :
  • theorem isOnlineQueryBound_solve {q : ℕ} (puzzle : Quantum.MaskedChain.Puzzle G q) :
  • theorem isOnlineQueryBound_solveFrom (n : ℕ) (masks : Fin n → G) (x : G) :
  • theorem qromDelayAdvantage_eq_recoveryAdvantage {q : ℕ}
  • theorem qromDelayAdvantage_le {q k : ℕ}
  • theorem qromDelayAdvantage_le_root {q k : ℕ}
  • theorem scheme_gen_queryBound (q : ℕ) :
  • theorem scheme_solve_queryBound {q : ℕ} (puzzle : Quantum.MaskedChain.Puzzle G q) :
  • theorem simulateQ_genWith {q : ℕ} (H : G → G) (vertices : Fin (q + 2) → G) :
  • theorem simulateQ_solveFrom (H : G → G) (n : ℕ) (vertices : Fin (n + 1) → G) :
  • theorem simulateQ_solve_publicPuzzle {q : ℕ} (H : G → G) (vertices : Fin (q + 2) → G) :
  • theorem tsum_gen_mul (q : ℕ) (H : G → G)

VCVio/Schemes/MaskedChainPuzzle/Preprocessing.lean (8)

  • theorem qromDelayAdvantage_eq_preprocessedRecoveryAdvantage {q : ℕ}
  • theorem qromDelayAdvantage_le_of_preprocessing {q k r Q : ℕ}
  • theorem qromDelayAdvantage_le_of_preprocessing_min {q k r Q : ℕ}
  • theorem qromDelayAdvantage_le_of_preprocessing_points {q k Q : ℕ}
  • theorem qromDelayAdvantage_le_of_preprocessing_root {q k r Q : ℕ}
  • theorem qromDelaySecure {q : ℕ} (b : Quantum.TimeLockPuzzle.DelayBudget)
  • theorem qromDelaySecure_points {q : ℕ} (b : Quantum.TimeLockPuzzle.DelayBudget)
  • theorem qromDelaySecure_root {q : ℕ} (b : Quantum.TimeLockPuzzle.DelayBudget)

VCVioTest/Quantum/MaskedChain.lean (16)

  • def answers : Fin 4 → ZMod 3
  • def repeated : Fin 4 → ZMod 3
  • example (I : L.Interp) (adv : OnlineAdversary L (ZMod 256) 0)
  • example (adv : OnlineAdversary LocalSig.instruments (ZMod 256) 1)
  • example : (Finset.univ.filter fun p : (ZMod 2 → ZMod 2) × (Fin 2 → ZMod 2) ↦
  • example : oracleMasks (patch 2 (![0, 0] : Fin 2 → ZMod 3) (fun _ ↦ 0) ![1, 2])
  • example : patch 4 repeated (fun _ ↦ 0) answers 0 = 1
  • example : patch 4 repeated (fun _ ↦ 0) answers 1 = 2
  • example : patch 4 repeated (fun _ ↦ 0) answers 2 = 0

…and 32 more not listed.


sorry Tracking

  • No sorrys were added, removed, or affected.

📋 **Additional Analysis**

No findings.


📄 **Per-File Summaries**
  • VCVio.lean: Added public imports for the new VCVio.Quantum.Oracle.MaskedChain family of modules (Bounds, Coupling, Homogeneous, Hybrid, Model, Preprocessing, Preprocessing.DropEmpty, Preprocessing.Model, RootBounds) as well as VCVio.Schemes.MaskedChainPuzzle and its Preprocessing submodule, making the definitions, theorems, and APIs from these files globally accessible. This introduces a new MaskedChain abstraction (likely a cryptographic construction or quantum oracle model) and the corresponding MaskedChainPuzzle scheme into the project's namespace.
  • VCVio/Quantum/Oracle/MaskedChain/Bounds.lean: Summary unavailable — AI generation failed.
  • VCVio/Quantum/Oracle/MaskedChain/Coupling.lean: This new file introduces the coupling framework for masked chains in the quantum oracle model. It defines head-priority patching (patch, patchEquiv, patchPrefix) and additive mask reparameterization (maskEquiv), together with the oracle-mask function (oracleMasks). Key theorems prove that a uniform table remains uniform after patching (map_uniform_patch, lintegral_uniform_patch), that masks coincide with independent programming values when inputs are injective (oracleMasks_patch_of_injective, oracleMasks_patch_of_input_injective), and that the real oracle-derived-mask experiment is bounded by the independently masked experiment plus an input-collision probability (real_le_patched_add_collision, real_le_maskFirst_add_collision). No sorry or admit appear.
  • VCVio/Quantum/Oracle/MaskedChain/Homogeneous.lean: This new file VCVio/Quantum/Oracle/MaskedChain/Homogeneous.lean introduces the noncomputable definition patchedRecoveryBound (a ℝ≥0∞ bound excluding the classical collision error) and two theorems: recoveryBound_eq_patchedRecoveryBound_add_collision, which equates the full recoveryBound to patchedRecoveryBound plus a birthday-collision term, and averageHybridSuccess_zero_le_mul_mass, which bounds the mask-first success probability by the product of the initial state mass and patchedRecoveryBound. The latter theorem supports branchwise analysis of query-bounded preprocessing by scaling the bound by the input trace mass.
  • VCVio/Quantum/Oracle/MaskedChain/Hybrid.lean: This file introduces the masked-chain hybrid oracle framework for the VCVio project. It defines maskValues, prefixOracle, fullOracle, and hybridSchedule functions, along with several key theorems: prefixOracle_congr (prefix depends only on vertices with index ≤ m), hybridSchedule_eq_off_cutoff (adjacent hybrids differ only at the cutoff call), fullOracle_eq_prefixOracle_of_not_mem_tailInputs, queryWeight_hybridSchedule_eq_of_vertices_prefix (pre-query weight is unchanged when vertices beyond h are replaced), run_parallelScheduledRuntime_eq_of_prefix, run_parallelScheduledRuntime_const, evalDistMap_parallelScheduledRuntime_const, rpow_inv_two_evalDistMap_hybridSchedule_le (square-root comparison for adjacent hybrids), evalDistMap_hybridSchedule_le (event comparison for adjacent hybrids), and run_hybridSchedule_last_update (the final hybrid's run does not depend on the endpoint vertex). No sorry or admit appears in the diff.
  • VCVio/Quantum/Oracle/MaskedChain/Model.lean: Added VCVio/Quantum/Oracle/MaskedChain/Model.lean, which models endpoint recovery for idealized masked hash chains. The file defines the Puzzle abbreviation (G × (Fin (q+1) → G)), the OnlineAdversary structure (with an oracle-independent initial register/state and a program that takes a Puzzle), the publicPuzzle construction (producing the puzzle from an oracle H and q+2 vertices), and the recoveryLaw and recoveryAdvantage measures for the no-preprocessing experiment. It also provides recoveryAdvantage_eq_sum, rewriting the advantage as uniform averages over oracles and vertex tuples, and recoveryAdvantage_le_one, proving that endpoint success probability is at most 1.
  • VCVio/Quantum/Oracle/MaskedChain/Preprocessing.lean: Summary unavailable — AI generation failed.
  • VCVio/Quantum/Oracle/MaskedChain/Preprocessing/DropEmpty.lean: This new file introduces dropEmptyPreprocessing, which normalizes a PreprocessingAdversary G q by removing all empty preprocessing batches using dropEmptyBatches. It provides five theorems: isPointBound_dropEmptyPreprocessing and isTotalQueryBound_dropEmptyPreprocessing_of_isPointBound show that the point bound is preserved and implies a total query bound; isTotalQueryBound_dropEmptyPreprocessing retains any existing total query bound; run_preprocessedRecoveryProgram_dropEmptyPreprocessing proves that the full fixed-function parallel oracle run is unchanged; and preprocessedRecoveryAdvantage_dropEmptyPreprocessing_eq establishes that the preprocessing recovery advantage is identical. Together these results justify removing zero-width preprocessing rounds without affecting the final recovery guarantee, allowing point budgets to directly bound the number of non-empty rounds.
  • VCVio/Quantum/Oracle/MaskedChain/Preprocessing/Model.lean: This file defines the model for a two-phase quantum endpoint adversary with oracle preprocessing in the masked-chain setting. The main definitions are: PreprocessingAdversary (an alias for a time-lock puzzle adversary), preprocessedRecoveryProgram (the concatenation of preprocessing and online recovery against a given puzzle), preprocessedRecoveryAdversary (the complete family of programs as an OnlineAdversary), preprocessedRecoveryLaw (the joint endpoint law), and preprocessedRecoveryAdvantage (the unconditional success probability). Two theorems are proved: preprocessedRecoveryAdvantage_eq_sum expands the advantage as an average over oracles and vertex tuples, and preprocessedRecoveryAdvantage_le_one bounds it by 1. The file also includes a module docstring explaining the two-phase adversarial model and the equivalence of sampling the vertex tuple outside or between phases.
  • VCVio/Quantum/Oracle/MaskedChain/RootBounds.lean: This file introduces and proves root-accumulated recovery bounds for the masked-chain oracle in the quantum verification project. It defines rootPatchedRecoveryBound and rootRecoveryBound, and proves theorems including sqrt_sum_evalDistMap_resampleFutureVertices_le, sqrt_averageHybridSuccess_le_succ, sqrt_averageHybridSuccess_zero_le, averageHybridSuccess_zero_le_root, averageHybridSuccess_zero_le_root_mul_mass, and recoveryAdvantage_le_root. The material establishes that the square root of hybrid success probabilities accumulates per-round errors before a final squaring, and that the conditioned bound scales with input mass, culminating in the endpoint recovery bound with an external collision allowance. No sorry or admit statements appear in the diff.
  • VCVio/Schemes/MaskedChainPuzzle.lean: Added a new file MaskedChainPuzzle.lean defining the idealized masked-chain time-lock puzzle scheme (RoundComp, genWith, gen, solveFrom, solve, scheme) for a group G. Establishes that honest generation uses one oracle round and q+1 points, honest solving uses q+1 sequential rounds and points (isOnlineQueryBound_genWith, isOnlineQueryBound_gen, isOnlineQueryBound_solveFrom, isOnlineQueryBound_solve, scheme_gen_queryBound, scheme_solve_queryBound). Proves correctness: under any fixed-oracle function H, genWith produces the expected public puzzle and endpoint (simulateQ_genWith), solveFrom recovers the final masked vertex (simulateQ_solveFrom), and solve returns some (vertices (Fin.last (q+1))) with certainty (simulateQ_solve_publicPuzzle, evalDist_scheme_solve_publicPuzzle). Provides an adversary adapter (adversary) that lifts an online without-preprocessing family to the two-phase experiment, along with its query-bound preservation (adversary_isQueryBound). The main security theorems (qromDelayAdvantage_eq_recoveryAdvantage, qromDelayAdvantage_le, qromDelayAdvantage_le_root) show that the scheme's quantum delay advantage equals the masked-chain recovery advantage and is bounded by the appropriate root bounds. No sorry or admit appear.
  • VCVio/Schemes/MaskedChainPuzzle/Preprocessing.lean: This new file, VCVio/Schemes/MaskedChainPuzzle/Preprocessing.lean, introduces a suite of theorems that connect the quantum delay advantage of the masked-chain puzzle to the preprocessed recovery advantage, and then bound that advantage in terms of preprocessing round and point budgets. Key theorems include: qromDelayAdvantage_eq_preprocessedRecoveryAdvantage, which proves equality between the named puzzle's delay advantage and the preprocessed recovery advantage for any adversary; qromDelayAdvantage_le_of_preprocessing, providing a bound using recovery bound and preprocessing error; qromDelayAdvantage_le_of_preprocessing_min, which strengthens the bound by taking the minimum of rounds and points; qromDelayAdvantage_le_of_preprocessing_points, giving a point-only bound with a linear error term; and the corresponding security theorems qromDelaySecure, qromDelaySecure_points, qromDelaySecure_root, which assert QROMDelaySecure for the scheme under various phase budgets. The file also contains qromDelayAdvantage_le_of_preprocessing_root and qromDelaySecure_root, which use a root-accumulated recovery bound. All theorems assume a finite abelian group G and a preprocessing adversary. No sorry or admit appear in the file.
  • VCVioTest.lean: Added public imports for three new modules: VCVioTest.Quantum.MaskedChain, VCVioTest.Quantum.MaskedChainRootBounds, and VCVioTest.Quantum.QueryBoundedPreprocessing, which extend the exported API of the VCVioTest project.
  • VCVioTest/Quantum/MaskedChain.lean: This new file VCVioTest/Quantum/MaskedChain.lean defines the test module VCVioTest.QuantumMaskedChain, which provides definitions repeated and answers (functions Fin 4 → ZMod 3) and several example proofs that demonstrate the behavior of patch under repeated inputs, including priority of the first programmed value, intact distinct cells, and disagreement between oracle-derived and independently programmed masks. It also introduces three theorems: root_inv_256 (a private ENNReal exponent identity), oneRound_recoveryAdvantage_le (a bound of 33/128 for one-round recovery advantage), and recoveryAdvantage_zero (zero initial adversary mass yields zero recovery advantage). Finally, it contains five examples that integrate the named masked-chain puzzle experiments, covering the nonbinary solver, the honest quantum solver's success with two rounds, inheritance of the unsaturated endpoint bound, and the impact of zero initial mass on the experiment.
  • VCVioTest/Quantum/MaskedChainRootBounds.lean: This new file defines a trivial public-puzzle adversary guessFirst that makes no oracle calls, proves that its recovery advantage equals ρ.mass / 16 (the input mass divided by the vertex-space size), and provides concrete examples verifying that for a half-mass input the advantage is 1/32. It also establishes numeric values of the root-accumulated recovery bounds for two specific parameter sets: for the one-link puzzle (q=0, width 7) both the patched and unpatched bounds equal 1/16, and for q=1, width 1 (sixteen vertices, one round of width one) the capped root bound is 5/8 while the event-error bound is capped at 1.
  • VCVioTest/Quantum/QueryBoundedPreprocessing.lean: This new file adds regression tests and utility definitions for query-bounded preprocessing in the masked-chain puzzle scheme. It defines readTable as a quantum round that reads the complete two-point Z/2 oracle in one parallel call, and constructs tableAdversary as a preprocessing adversary whose state stores the oracle table and whose online program recovers the puzzle answer using the stored table without further oracle calls. It proves recovery_with_table that the preprocessed recovery advantage equals the input mass whenever the full oracle table is read during preprocessing. Additional examples verify that tableAdversary satisfies the query bound ⟨1,2,0,0,0⟩, that a half-mass input yields advantage 1/2, and that an ‘emptyAdversary’ spending a round without points is distinguished from a zero-round bound; the file also shows that dropEmptyPreprocessing preserves the three-phase advantage.
  • docs/design/quantum-layer.md: The document gains two new subsections (14 and 15) that detail security bounds for masked-chain quantum queries. Section 14 (“Idealized endpoint-only sequentiality”) describes the no-preprocessing recovery experiment defined in Oracle/MaskedChain/Model.lean, introduces the theorem Quantum.MaskedChain.recoveryAdvantage_le_root that bounds adaptive online success by a root-accumulated expression, and links it to the named puzzle in Schemes/MaskedChainPuzzle.lean via MaskedChainPuzzle.qromDelayAdvantage_eq_recoveryAdvantage and qromDelayAdvantage_le_root. Section 15 (“Query-bounded preprocessing”) covers Oracle/MaskedChain/Preprocessing.lean's combination of online and preprocessing root errors, proving preprocessedRecoveryAdvantage_le_root and preprocessedRecoveryAdvantage_le_root_min, and transfers these to the three-phase experiment in Schemes/MaskedChainPuzzle/Preprocessing.lean with MaskedChainPuzzle.qromDelaySecure_root. These additions substantially expand the security analysis of the masked-chain construction.
  • docs/quantum/guide/5-qrom.md: This documentation addition describes Quantum.MaskedChain.recoveryLaw, a formal experiment in which an online adversary receives public masks from a uniform hash function and must recover the final vertex of an idealized chain over a finite abelian group. It introduces the theorem Quantum.MaskedChain.recoveryAdvantage_le_root, which bounds the success probability by a root-accumulated expression (Quantum.MaskedChain.rootRecoveryBound) combining collision allowance, guessing baseline, and per-round query errors, and notes that for q=0 this reduces to 1/N. The section explains the joint-distribution proof technique (classical coupling, Minkowski inequality, hybrid argument) and cross-references the source files Oracle/MaskedChain/Model.lean and Oracle/MaskedChain/RootBounds.lean, as well as the accompanying puzzle definitions in 7-time-lock-puzzles.md (MaskedChainPuzzle.qromDelayAdvantage_eq_recoveryAdvantage and MaskedChainPuzzle.qromDelayAdvantage_le_root).
  • docs/quantum/guide/7-time-lock-puzzles.md: Summary unavailable — AI generation failed.
  • docs/quantum/guide/README.md: The README table of contents and summary paragraph for the quantum guide were updated to mention the addition of 'idealized masked-chain endpoint recovery' (in the 5-qrom topic list) and 'idealized masked-chain endpoint security with query-bounded preprocessing' (in the overall summary), reflecting new content in the corresponding documentation file.
  • docs/quantum/reference/literature.md: Adds five new entries to the reference table for definitions and lemmas from Afshar et al. (ePrint 2023/932), linking Quantum.MaskedChain.recoveryAdvantage_le, Quantum.MaskedChain.recoveryAdvantage_le_root, Quantum.MaskedChain.preprocessedRecoveryAdvantage_le, Quantum.MaskedChain.preprocessedRecoveryAdvantage_le_root, and preprocessedRecoveryAdvantage_le_root_min to their paper sources. The diff also includes a prose paragraph clarifying that the formal Lean proofs for these entries retain the full endpoint tuple from the paper’s hybrid structure, that the root-accumulated bound yields order kq³/N (compared to the published order sqrt(kq³/N)), and that no novelty or best-known-bound claim is made for these formalizations.

Last updated: 2026-11-21 15:28 UTC.

@github-actions

github-actions Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

Build Timing Report

  • Source: 022a9b8
  • Message: Merge 55a2d15 into 2d52cea
  • Ref: feat/parallel-qrom-04-masked-chain
  • Build cache: restored the build of 7c167e8; Lake rebuilt only modules whose source or imports differ from it.
  • Commands: library build lake build ToMathlib VCVio LatticeCrypto Extern HashSig Examples; smoke test lake env lean VCVioTest/Smoke.lean.
Measurement Wall (s) CPU work (s) Status
Library build 1227.75 4652.65 ok
Smoke test 4.01 2.60 ok

CPU work is user + sys. Wall time depends on which modules this run had to rebuild, so compare it across runs only together with the module section below.

Rebuilt Modules

Rebuilt 1549 modules (57 without an earlier time). The 1492 with an earlier time took 5897s here against 6482s when last built (-585s (-9.0%)).

Estimated clean-build compile time, summed over all 1753 modules: 7054s before, 6682s after (-372s (-5.3%)).

Per-module times are wall-clock under whatever parallel load the run had, so treat small differences as noise; a large change on one module is the signal.

Showing 20 slowest of 1549 rebuilt modules.

Current (s) Earlier (s) Delta (s) Path
33 34 -1 VCVioTest/Quantum/Oracle.lean
30 33 -3 VCVioTest/Quantum/Emulated.lean
27 24 +3 VCVioTest/Quantum/VCOffline.lean
26 26 +0 VCVio/Schemes/PointerChainPuzzle/HidingNonce.lean
24 29 -5 VCVio/Quantum/Oracle/Compressed/CollisionRuntime.lean
23 21 +2 VCVio/OracleComp/Coercions/Add/Basic.lean
23 23 +0 VCVioTest/Quantum/CheckedRead.lean
21 23 -2 VCVio/Schemes/PointerChainPuzzle/HidingIdeal.lean
21 23 -2 LatticeCrypto/Falcon/Concrete/NTT.lean
21 27 -6 VCVioTest/Quantum/Basic.lean
20 18 +2 VCVio/Quantum/Oracle/ClassicalRepeatability.lean
20 21 -1 VCVio/Quantum/VC/Proof/OnlineSecurity.lean
19 20 -1 VCVio/CryptoFoundations/FiatShamir/WithAbort/Security/HopLemmas.lean
19 20 -1 HashSig/SLHDSA/SHAKE128s/Proof/CarrierTailRecordings.lean
19 27 -8 HashSig/SLHDSA/Security/BoundCertificates.lean
18 19 -1 HashSig/SLHDSA/SHAKE128s/Proof/RecordedStripping.lean
18 17 +1 VCVioTest/CryptoFoundations/FiatShamirWithAbortCanary.lean
17 19 -2 VCVio/Quantum/Oracle/Compressed/CommutatorSharp.lean
17 19 -2 VCVio/CryptoFoundations/FiatShamir/Sigma/Stateful/Compatibility.lean
17 16 +1 HashSig/SLHDSA/SHAKE128s/Proof/WarmedSplit.lean

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant