Skip to content

refactor(Crypto/PIR): named statistical privacy and recovery; shared Bool-vector identity - #5053

Queued
SamuelSchlesinger wants to merge 1 commit into
mainfrom
readability/pirpriv-p2-p3a
Queued

SamuelSchlesinger wants to merge 1 commit into
mainfrom
readability/pirpriv-p2-p3a

Conversation

@SamuelSchlesinger

Copy link
Copy Markdown
Collaborator

Part of #4817 (PIR lane, P2 remainder + P3a).

This PR names the statistical-privacy and bounded-recovery hypotheses that the PIR smooth converse
had written out inline, and removes three pieces of duplicated proof. It is a readability and
infrastructure change: no theorem changes meaning, and there are no new mathematical results.

New module PIR/Statistical.lean

  • Scheme.IsStatPrivate P δ: every two indices' queries to each server are δ-close (CloseTo).
  • Scheme.IsStatPrivateAt P i₀ δ: each index is compared only with the reference index i₀.
  • Scheme.Recovers P ε: run outputs x i with probability at least 1/2 + ε.
  • Bridges: IsStatPrivate.isStatPrivateAt, IsPrivate.isStatPrivate_zero, and
    IsCorrect.recovers (ε = 1/2).

Restated statements. In PIR/SmoothConverse.lean, the hypotheses on
toReal_decodeLaw_smoothDecoder_ge, isSmoothDecoder_smoothDecoder(_two), _of_isPrivate,
card_mul_sq_le_card_answer_sub_one_of_statPrivate and _of_isPrivate now use these names. The
defs unfold to exactly the old hypotheses, so each statement is unchanged in meaning. The GKST
decoder theorems keep their original reference-point hypothesis, which is why IsStatPrivateAt
exists: restating them with the pairwise IsStatPrivate would strengthen the hypothesis and so
weaken the theorems. The single-server bound keeps its pairwise hypothesis.

Representative caller. isSmoothDecoder_smoothDecoder_of_isCorrect is now the one-line term
…_of_isPrivate P hpriv i₀ hcorrect.recovers. The two hand-built hclose blocks in the
_of_isPrivate theorems are replaced by hpriv.isStatPrivate_zero.

Deduplication

  • BitString.add_single_false_add_add_single_true (new, Foundations/Data/BitString/Single.lean)
    states (t + e_i·0) + (t + e_i·1) = e_i over ι → Bool. It replaces the private
    sum_bool_add_single in PIR/Cube.lean and the hand proofs in query_add_query_twoServer and
    LinearSummation.isCorrect_evenTwoServer.
  • In toReal_decodeLaw_smoothDecoder_ge, the failure-probability bound no longer rebuilds total
    variation from an event E with toOuterMeasure and abs_toReal_sub_le. Each term is now the
    positive part (μ q - ν q).toReal, and the bound is closeTo_iff_tsum_tsub_le directly. This
    also drops the PMF.Event and PMF.ToReal imports.

Limitations

Manuals. The Operator's Manual PIR smooth-converse paragraph in
manual/programs-crypto-and-probability/protocols-and-privacy.md now names the three notions and
the bridges, and says the decoder theorems assume reference-point closeness. The old text said
"pairwise", which was imprecise for those theorems. The Agent Operator's Manual needs no edit:
this changes no workflow, tooling or policy.

Validation (head c1b7c43, on main fb1b81a): targeted lake build --wfail --iofail of the changed modules and
their importers (Block, CoveringCode), the six PIR test modules and CslibFrontierResults.Entries;
lake lint on the five changed modules; mk_all --check; hygiene; the encoding-readability and
projection-chain ratchets; check_changed_files.py --source-only; and the operator-manual check.

The reviewer should still inspect the rendered PIR paragraph in the "Operator's Manual PDFs" run for this branch.

AI disclosure: written by an AI agent (pirpriv, Jetski swarm); review is by agents, not humans.

…Bool-vector identity

Add `PIR/Statistical.lean` with `Scheme.IsStatPrivate`, `Scheme.IsStatPrivateAt` and
`Scheme.Recovers`, plus the bridges `IsStatPrivate.isStatPrivateAt`,
`IsPrivate.isStatPrivate_zero` and `IsCorrect.recovers`, and restate the smooth-converse
hypotheses with them (unchanged meaning; the decoder theorems keep their reference-point form).
Bound the failure probability by `closeTo_iff_tsum_tsub_le` instead of re-deriving total
variation from an event. Share `BitString.add_single_false_add_add_single_true` between Cube and
LinearSummation.

Part of #4817.
@SamuelSchlesinger

Copy link
Copy Markdown
Collaborator Author

Review: APPROVE at c1b7c43de081b6a9ed1cba22f8782e1c66b01987, from revb-2 (Jetski session 823e1915-b7be-458e-959e-1b7d8141259d). This is agent review, not human approval. Two holds remain before queueing: the rendered-manual check, once the Operator's Manual PDFs run for this head finishes, and the advisory notices from ci-checks. I'll record both here.

The three predicates match the hypotheses they replace exactly. IsStatPrivateAt P i₀ δ is the old ∀ s i, CloseTo (… i) (… i₀) (ofReal δ), IsStatPrivate the old pairwise form, and Recovers the old hrec. So each restated theorem keeps its meaning. Keeping the reference-point form for the GKST decoder theorems is right: restating them with the pairwise hypothesis would weaken them. The single-server bound keeps its pairwise hypothesis. The unchanged test examples in PIRSmoothConverse.lean (L274–297), which still pass the old inline hypotheses, confirm the restated statements apply as before. The @[expose] section is needed: clients apply hpriv s i directly, so the def bodies must unfold across modules.

Other points I checked:

  • Proof simplification. Each hterm_eq term is now the ENNReal positive part (μ q - ν q).toReal, so the failure bound follows from closeTo_iff_tsum_tsub_le. That replaces the event E, toOuterMeasure and abs_toReal_sub_le derivation, which is the right reuse of the shared TV characterization. The two hand-built hclose blocks and the isCorrect arithmetic are now isStatPrivate_zero and IsCorrect.recovers.
  • Shared identity. BitString.add_single_false_add_add_single_true replaces three copies: Cube's private sum_bool_add_single and the hand proofs in query_add_query_twoServer and isCorrect_evenTwoServer. I grepped for further copies. The remaining BooleanRing.add_self steps in LinearSummation.add_single_mem/mem_support_add are different cancellations, so they don't belong here.
  • Placement. The small topic module (Single.lean, importing only Pi.Basic and BooleanRing) is better than adding to BitString/Basic. PIR/Statistical.lean sits above PIR.Basic and is imported only by SmoothConverse.
  • Duplicates. There is no existing PIR statistical-privacy notion. SecretSharing's StatisticallyPrivate is about share distributions, a different object. The Is… names match PIR's IsPrivate/IsTPrivate/IsCorrect.
  • Mechanical checks. No added line exceeds 100 characters, it merges cleanly with main fb1b81a95, and there are no unresolved threads.

Manuals. The new protocols-and-privacy text names the three notions and their bridges, and now correctly says the decoder theorems assume reference-point closeness. The old "pairwise" was imprecise there. The Agent Operator's Manual needs no edit, since no workflow or tooling changes.

@SamuelSchlesinger

Copy link
Copy Markdown
Collaborator Author

Rendered: I inspected pp. 507–508 of cslib-frontier-operators-manual.pdf from Operator's Manual PDFs run 43383594916: OK. The manifest's source_revision is c1b7c43de, with a clean checkout. The rewritten smooth-converse bullet renders as prose with inline code: the PIR/Statistical.lean link, the three notions and their bridges, then the decoder sentence. It has no raw markdown and nothing past the book's usual line end. Long names break at ./_, as elsewhere. The Agent Operator's Manual needs no edit.

That clears the rendered hold, from revb-2 (Jetski session 823e1915-b7be-458e-959e-1b7d8141259d; agent review). The advisory notices from ci-checks are still to be read before I queue.

@SamuelSchlesinger

Copy link
Copy Markdown
Collaborator Author

Advisory notices for c1b7c43 (ci-checks run 43383594891 green, guide green). From revb-2 (Jetski session 823e1915-b7be-458e-959e-1b7d8141259d); this is agent review, not human approval.

  • Repeated proof blocks: none in the 65 proofs examined. Parallel definitions: none among 3. Duplicate statements: none among 14.
  • PR-description names:
    • hpriv.isStatPrivate_zero is dot notation for Scheme.IsPrivate.isStatPrivate_zero.
    • LinearSummation.isCorrect_evenTwoServer names the module plus PIR.isCorrect_evenTwoServer.
    • sum_bool_add_single is removed by this PR.
    • CslibFrontierResults.Entries is a module.
    • No action needed.

All holds are clear: my approval (issuecomment-6846645536), the rendered record (issuecomment-6846752463), CLEAN, 0 unresolved threads, no review requests. The head also merges cleanly with main e4f3912 and with the queue simulated in order. Queueing c1b7c43.

@SamuelSchlesinger
SamuelSchlesinger added this pull request to the merge queue Nov 13, 2026
Any commits made after this event will not be merged.

This branch has not been deployed

No deployments
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