feat(val): prove VAL-3 each slot has exactly one proposer - #40
Merged
Conversation
Extract ValidatorIndex.proposerForSlot mirroring proposer_for_slot in upstream containers/identifiers.py and refactor processBlockHeader's proposer check to consume it (semantics unchanged: the UInt64 construction never wraps since slot % n <= slot < 2^64, recorded as proposerForSlot_toNat). Prove proposer_index_round_robin, the catalog form of the round-robin selection. Axiom-free, no Mathlib.
Define isProposerFor (equality with the round-robin index, phrased on Fin n so registry membership is carried by the type) and prove unique_proposer: the proposer slot % n exists and any proposer equals it. The catalog's exists-unique is written in expanded form since ExistsUnique is Mathlib-only. Axiom-free.
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.
Summary
Discharges VAL-3 from
docs/lean4-proof-propositions.md: each slot has exactly one proposer.LeanSpec/Forks/Lstar/Containers/Identifiers.lean:ValidatorIndex.isProposerFor— validatorvid : Fin nis the scheduled proposer ofslotiffvid.val = slot.toNat % n(the equality-with-proposer_for_slotcheck the validator service uses, e.g. invalidator_duties.py).unique_proposer(VAL-3) — existence (slot % n < nfor a nonempty registry) plus uniqueness (Fin.ext). The catalog's∃!is written in its expanded form∃ vid, P vid ∧ ∀ vid', P vid' → vid' = vid—ExistsUniquelives in Mathlib, which this repo does not depend on (noted in the catalog annotation).Stacked on #39 — merge order: #39 → this (retarget to
mainbefore merging #39).Verification
lake buildgreen with zero warnings; nosorry, no new axioms.Remaining VAL propositions (VAL-2 dual keys, VAL-4 no double vote, VAL-5 XMSS preparation monotonicity) need the ValidatorService / KeyRegistry / XMSS-state models — a separate machinery step.