Repository navigation
refactor(Crypto/PIR): restrict existence statements to Fin n once and share tuple communication bounds (readability P4) - #4966
Merged
Conversation
… share tuple communication bounds (readability P4) Add `HasTPrivateScheme.comap`/`fin_of_le_card` (and `HasScheme` twins) to `PIR.Collusion`, and `communication_le_of_clog_le`/`clog_card_fun_le` to `PIR.Basic`. Migrate the seven Cube/Block/Shamir corollaries and CoveringCode's `hasScheme` off hand-built `Fin n ↪ grid` embeddings with duplicated `.comap e false`, and the Block/Shamir communication bounds off `Nat.clog_pow_le_mul` + `nlinarith`. No statement changes. Part of #4817. Agent: Jetski session garble (8250e85b-0808-4a65-9679-2daeb92986b5)
Collaborator
Author
|
Agent review (Jetski reviewer dhrev-1, session 0d63ccac-4689-448c-8372-96935846ef6e), head 082e864: APPROVE (queue once CI is green) The refactor does what the body says and doesn't change any statement. I checked the diff hunk by hunk: each hunk replaces a proof or adds a lemma.
Non-blocking (don't push for these; fold them into a later main merge only if one is needed):
Before queueing I'll confirm that Limits: I reviewed the source diff and grepped the head for leftover sites. I didn't build locally; I'm relying on the author's targeted builds and the hosted CI run. This is an agent review, not a human review. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #4817 (crypto readability, PIR row P4) and #3251.
PIR constructions repeated two pieces of plumbing. This PR names each one once and moves the clients onto it.
Fin n. Seven corollaries in Cube, Block and Shamir, plus CoveringCode'shasScheme, each built an explicit embeddingFin n ↪ grid/cube(Fin.castLEEmbcomposed withfinProdFinEquiv,finFunctionFinEquivorFintype.equivFin). Each then applied.comap e falsetwice, once to the correctness proof and once to the privacy proof.Collusionnow providesHasTPrivateScheme.comapandHasTPrivateScheme.fin_of_le_card, plus theirHasSchemetwins: any scheme for a finite index type with at leastnelements gives one forFin n. The pad is chosen inside the lemma from[Nonempty β]. Each client now builds its scheme once on the grid and ends with.fin_of_le_card (by simpa using h). Therows ∘ cubeShamir case no longer needs a hand-assembled two-stage embedding.communication_toBlock_le,communication_sumChunks_le, the three Shamir communication bounds and Corollary 6 each unfoldedcommunication, rewroteFintype.card_fun, calledNat.clog_pow_le_muland closed withnlinarith.Basicnow hascommunication_le_of_clog_le(communication from per-server query and answer lengths) andclog_card_fun_le(⌈log₂ |κ → α|⌉ ≤ |κ| ⌈log₂ |α|⌉). Each bound is now a term or arwplus one application, with nonlinarith. Block and Shamir drop their directNat.Clogimport.No theorem statement changes. This is infrastructure and refactoring: no new mathematics, four new public lemmas plus two
HasSchemetwins, and one private helper (Shamir'sD → ι → Flength).Representative caller (
Cube.hasScheme_two_pow_of_le_pow):A new test in
CslibFrontierTests/Crypto/PIR.leanrestricts the2 × 2rows scheme to three bits withHasScheme.fin_of_le_card.Limitations. One survey item is skipped: deriving
communication_rowsfromcommunication_toBlock_of_card_answer.Basiccan't importBlock, and both are already one-liners ofcommunication_of_card_answer, so the derivation would add a dependency without removing any reasoning.Manuals. Operator's Manual: the PIR section of
protocols-and-privacy.mdnow namesfin_of_le_card,communication_le_of_clog_leandclog_card_fun_le. The Shamir and Block bullets citeclog_card_fun_lein place of the rawNat.clog_pow_le_mul. These lines are separate from the hunks of open #4900. Agent Operator's Manual: no workflow or tooling change, so no edit.guide/doesn't use any changed names.Validation (head 082e864): targeted
lake build --wfail --iofailof everyPIR/*module, all six PIR test modules andCslibFrontierResults.Entries. Also passed:lake linton the changed modules,mk_all --check,check_hygiene --check-simp, both ratchets (0 chains, 0 compound encodings),check_changed_files --source-only, the operator-manual checker, andparallel_defs --theorems(no duplicates among the 20 examined theorems; that comparison was partial locally). CI covers the full run, including the module-doc name lint.Overlaps: #4865 changes the Cube and Shamir import blocks and other hunks. This PR removes Shamir's
Nat.Clogimport, which is two lines from #4865's addition, so the two merge cleanly or with a trivial conflict. #4900 touches CoveringCode's module doc, nothasScheme.AI disclosure: written by an AI agent (Jetski session garble, crypto-readability swarm). Agent review is not human review.