A round records only no-fresher, delivered responses, one per sender
ProvedOpenSearchPreVote.round_entriesFor every election strategy es, delivery predicate Delivered and round r with RoundReachable es Delivered r (started, then any responses allowed by Delivered handled in any order and any number of times, and possibly closed):
- every recorded entry
p ∈ r.preVotesReceivedsatisfiesNoFresher p.2 r.clusterState— the response's accepted (term, version) is lexicographically at most the round's accepted (term, version-or-metadata-version) — andDelivered p.1 p.2; - the senders of the recorded entries are pairwise distinct as node values (id and role; two entries may share an id with different roles):
(r.preVotesReceived.map Prod.fst).Nodup.
import Definitions.Def_OpenSearchPreVote open OpenSearchCoordination OpenSearchPreVote
theorem OpenSearchPreVote.round_entries {V : Type} (es : ElectionStrategy)
(Delivered : DiscoveryNode → PreVoteResponse → Prop) (r : PreVotingRound V)
(hr : RoundReachable es Delivered r) :
(∀ p ∈ r.preVotesReceived, NoFresher p.2 r.clusterState ∧ Delivered p.1 p.2) ∧
(r.preVotesReceived.map Prod.fst).Nodup := by sorryRead-back
What the Lean code literally says, in plain math · claude-opus-5-5 (independent sub-agent, blind: Lean code + auditor instructions only)
Read-back: OpenSearchPreVote.round_entries
Notions used
Discovery nodes, responses, cluster states.
- A discovery node is a pair (node id , Boolean cluster-manager-eligible flag). Equality is equality of both components.
- A pre-vote response has a current term , a last accepted term and a last accepted version .
- A cluster state has, among other fields, a term , a version and a metadata version in , and two voting configurations and .
- is the metadata version if , and the version otherwise.
No-fresher. means
Rounds and the response handler. A round has five fields: a cluster state , a local node, a list of (sender, response) pairs, and Booleans and . , and sets to true.
changes the round as follows:
- If is closed, or is not than , the round is returned unchanged.
- Otherwise the list becomes followed by the old list with every entry whose sender equals removed. If the votes then form an election quorum and no election was started yet, becomes true.
The cluster state and the local node never change.
Reachability. is the least predicate on rounds closed under three rules:
- every is reachable;
- if is reachable and holds, then for any the round produced by is reachable;
- if is reachable, so is .
1. Declaration
Binders and hypothesis.
- : an implicit type;
- : an election strategy (an arbitrary Boolean "extra constraint" function);
- : an arbitrary predicate on (discovery node, response) pairs;
- : a round over ;
- : .
Conclusion. Two conjuncts:
- For every entry of , both of these hold:
- : the response's (last accepted term, last accepted version) is lexicographically at most ;
- .
- The list of senders has no duplicates. No two entries have equal senders, that is, senders with the same id and the same flag.
2. What is not constrained
- No duplicate senders is not no duplicate ids. Conjunct 2 is about discovery-node values, not ids. Two entries whose senders share an id but differ in the flag are allowed, and do occur. I checked by evaluation: delivering from and then from keeps both entries.
- Free parameters. and are arbitrary, and so is the local response used in each step. The strategy affects only , which the conclusion does not mention.
- Reference state. is measured against the round's own cluster state, which is fixed when the round starts. It is not measured against any later state of the requester.
- Only one direction. The theorem does not say every delivered response appears in the list. Fresher ones are dropped, closed rounds ignore deliveries, and a later delivery from the same sender replaces the earlier one. It says nothing about or .
- Vacuity. None. is reachable for every and , with an empty list, where the conclusion is trivially true. Non-empty reachable lists exist whenever holds for some pair whose response is than .
3. Plain-language summary
In any round obtained by starting, handling delivered responses (with any local response) and closing, every recorded pre-vote really was delivered by its sender and is no fresher than the round's accepted state. No sender, taken as an (id, role) pair, is recorded twice.
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.