Repository navigation
Conversation
🤖 PR Summary
The PR adds a new Statistics
Lean Declarations ✏️ Added: 116 declaration(s)
📋 **Additional Analysis**The diff introduces a new 📄 **Per-File Summaries**
Last updated: 2026-11-21 22:53 UTC. |
# Conflicts: # VCVioTest.lean
… API - Use `FirstSuccess.missingMass` for the sampler's missing mass, of which the encoding-level `missingMass` was a copy. - Remove declarations that nothing in this PR or the later contributions of the Verified-zkEVM#1050 split uses: `failureMass_eq_runtime`, `failureMass_add_successMass_eq_one`, `ErrorAtMost.mono`, `CanonicalErrorAtMost.mono`, `encode_eq_none_of_code_eq_empty` and `Retry.failureIndicatorDist`. - Name the successor law `Retry.successMass_succ`, like its siblings, and make the sum helper `eq_of_sum_eq_of_le` private. - Free the universes of the parameter, message and epoch types, and of the retry layer's randomizer and monad (gotcha 9), with a use at nonzero universes in `VCVioTest/UniversePolymorphism.lean`. - Docstrings describe the code, not its history. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
dtumad
left a comment
There was a problem hiding this comment.
Thanks! This is VCVio's first general interface for incomparable encodings, and it follows ePrint 2025/055 closely. IncomparableCode is Definition 13's single global code, with the paper's 2^w generalized to any radix, and CanonicalErrorAtMost is Definition 14. Putting losslessness into ErrorAtMost closes the loophole of a sampler that never returns, and returned failure stays separate from missing mass throughout. Building the retry on #1117's FirstSuccess.runWith, rather than adding another search loop, is exactly what the #1050 review asked for. The tests cover real edge cases: the empty code, the empty alphabet, zero length, and an always-failing sampler at budgets 0 and 1.
The branch was based before #1117, so its CI could not pass. I merged current main into it, and it builds and validates there. I also pushed one commit with cleanups, keeping every name the later contributions of the #1050 split use:
- The sampler's missing mass is
FirstSuccess.missingMass, of which the encoding-levelmissingMasswas a copy. - Six declarations that nothing in this PR or the later contributions uses are gone, in line with the #1050 review's unreachable-code list:
failureMass_eq_runtime,failureMass_add_successMass_eq_one,ErrorAtMost.mono,CanonicalErrorAtMost.mono,encode_eq_none_of_code_eq_emptyandRetry.failureIndicatorDist. - The successor law is
Retry.successMass_succ, like its siblings, andeq_of_sum_eq_of_leis a private helper. - The parameter, message and epoch types, and the retry layer's randomizer and monad, are universe-polymorphic (gotcha 9), with a use at nonzero universes in
VCVioTest/UniversePolymorphism.lean. - A few docstrings described process ("shared", "independently derived", "established") or pointed to interfaces not on
main; they now describe the code.
Since the later contributions build on this one, a few design questions are better settled before they restack:
- Masses through
FirstSuccess.failureMass,successMassandfailureIndicatorDistare theFirstSuccessones withaccept := fun r => enc.value pp msg r ep, and most ofRetry/Measure.leanrestates #1117's laws one line at a time. Defining the one-draw masses throughFirstSuccesswould remove the private bridges, and callers could use theFirstSuccesslaws directly. OnlysuccessMass_eq_one_sub_pow,failureMass_eq_powandfailureMass_eq_probabilityare used downstream. - Mathlib's order notions.
IncomparableWordsisIncompRel (· ≤ ·)on the pointwise order, andIncomparableCodeisIsAntichain (· ≤ ·), whichHashChain/Antichain.leanalready uses. Stating them that way, or at least proving the two equivalences, would connect the code to that API.IncomparableCodealso spells outIncomparableWordsinstead of using it. value_eq_some_of_mem_retryis a general support fact aboutFirstSuccess.runWith, specialized to encodings and without the conclusion thatrlies in the sampler's support. It would fit inFirstSuccess, in that stronger form.- Error predicates. There are three error predicates and two sampler predicates, and
UniformErrorAtMoststates losslessness twice, sinceUniformSampleralready includes it. Could these be fewer? - The subtype-valued
encodeforces membership proofs inside computational definitions, as in the tests'some ⟨second, by simp⟩, and needs the extravaluelayer. A plainOption (Codeword n radix)with a membership field would avoid both.
Smaller points: the test file Retry.lean copies draw, optionalRuntime and two lemmas from VCVioTest/FirstSuccess.lean, which it could import instead. An exact retry mass, such as 1/4 for the half-failing toy at k = 2, would be a useful extra check.
Arbitrary globally incomparable encodings and their retry/error APIs live below HashSig. A shared payload carrier retains complete retry metadata without asserting message injectivity.
Dependent contribution from the PR #1050 review. Depends on A4a #1117.
This PR contains contribution E1's touched files against upstream
mainat0e67181a176e241956c073a214a1eb7d76b99aa9. Prerequisite source trees are omitted. Standalone CI can fail on missing prerequisite modules until this branch is restacked after those dependencies land. The dependency links define integration order; this contribution is available for maintainer review.Original contribution commits:
e417cc48a4e90df3babf6d17d814af0c49d00848. The exact original change range and published reference history remain preserved.Validation
The complete reconciled stack is the integration source. Its focused native build passes (189 changed owner/test modules, 3,639 reported jobs); all 68 retained hypertree consumer sources, four conformance fixtures and the complete owner audit pass without warnings. Combining the 34 contribution trees, including the distributed final import cleanup, exactly reproduces reconciled tree
7cabc9101bfe37331bd8aefbe578ed69dd642bc3.bash scripts/validate.sh --lint --test --axiomspasses on the complete reconciled stack: six proof libraries (5,474 reported jobs), test build (10,937 jobs), default executable tests/CSV, source/docs/boundary/style/initialization gates, the unchanged 156-entry lint baseline and zero axiom/sorry taint over 34,760 declarations/1,426 modules. The public API consumer and all-owner audit were refreshed after the umbrella rebuilt; all other consumer bindings were verified unchanged. Prior original-stack and A1 evidence remains preserved. No standalone full-suite pass is claimed for this dependent head, and no separate full suite or dedicated review is repeated per slice. Lean 4.35.0 and locked dependencies are unchanged; local uv is 0.12.5 versus hosted CI's 0.13.6. No independent clean install or optional native FFI/nightly result is claimed.Owner regressions included:
VCVioTest/IncomparableEncoding/Basic.lean,VCVioTest/IncomparableEncoding/Code.lean,VCVioTest/IncomparableEncoding/Retry.lean.