A round starts an election only on an election quorum, only while open and not yet started
ProvedOpenSearchPreVote.round_start_quorumFor every election strategy es, requester response lr, response resp, sender, rounds r and r' and m: if r.handlePreVoteResponse es lr resp sender = (r', true, m) — handling the response calls startElection — then
r.isClosed = false,r.electionStarted = falseandr'.electionStarted = true;NoFresher resp r.clusterState;r'has the accepted state and the local node ofr;- the votes of
r', the round as updated by the response, form an election quorum for the round's local node and the requester's responselrover the last committed and last accepted configurations of the round's accepted state:isElectionQuorumFor es r.localNode lr.currentTerm lr.lastAcceptedTerm lr.lastAcceptedVersion r.clusterState.lastCommittedConfiguration r.clusterState.lastAcceptedConfiguration r'.votes = true.
import Definitions.Def_OpenSearchPreVote open OpenSearchCoordination OpenSearchPreVote
theorem OpenSearchPreVote.round_start_quorum {V : Type} (es : ElectionStrategy) (lr resp : PreVoteResponse)
(sender : DiscoveryNode) (r r' : PreVotingRound V) (m : Option Nat)
(h : r.handlePreVoteResponse es lr resp sender = (r', true, m)) :
r.isClosed = false ∧ r.electionStarted = false ∧ r'.electionStarted = true ∧ NoFresher resp r.clusterState ∧
r'.clusterState = r.clusterState ∧ r'.localNode = r.localNode ∧
isElectionQuorumFor es r.localNode lr.currentTerm lr.lastAcceptedTerm lr.lastAcceptedVersion
r.clusterState.lastCommittedConfiguration r.clusterState.lastAcceptedConfiguration r'.votes = true := 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_start_quorum
Notions used
Basics.
- A discovery node is a pair (node id, cluster-manager-eligible flag ).
- A pre-vote response has a current term, a last accepted term (both in ) and a last accepted version .
- A cluster state has a term, a version and a metadata version, a last committed configuration and a last accepted configuration .
- is the metadata version when , and the version otherwise.
- A voting configuration is a strictly increasing list of node ids. means that strictly more than half of 's ids occur in the list .
No-fresher. means
Votes. is the set (a duplicate-free list) of ids of the cluster-manager-eligible senders in .
Election quorum. is the conjunction of three tests:
- has a quorum of ;
- has a quorum of ;
- the strategy's arbitrary extra test holds.
The handler. returns a triple (new round, start flag, max-term argument). Write . The cases, in order:
- If : .
- If is not : .
- Otherwise let be with list , and let
- If is false, or is already true: .
- Otherwise: .
1. Declaration
Binders and hypothesis.
- : an implicit type;
- : an election strategy;
- : pre-vote responses ( is the requester's "local response");
- : a discovery node;
- : rounds over ;
- : "none" or "some ";
- : .
Conclusion. Seven conjuncts:
- ;
- ;
- ;
- ;
- ;
- ;
- .
Conjunct 7, unfolded, says three things:
- the eligible-sender ids of form a strict majority of the last committed configuration of 's cluster state;
- they also form a strict majority of its last accepted configuration;
- the strategy's extra test holds for these arguments.
Here , because differs from only in the started flag. So it is computed from the updated list, with the new entry in front and older entries from the same sender removed.
2. What is not constrained
- No reachability hypothesis. is an arbitrary round. The theorem is a one-step inversion of the handler's definition.
- . It appears only in the hypothesis. The conclusion says nothing about it (in fact it is "some ").
- What is not described. The conclusion does not describe or . It does not say that the sender's own vote was counted; the sender may be ineligible and contribute no vote.
- . It is arbitrary. Its three fields enter only as the strategy's term and version arguments, exactly as in the handler. Under a strategy that ignores those arguments, such as the default one, has no effect.
- Vacuity. None. The hypothesis is satisfiable. For example, take a one-node configuration in both slots, cluster state term , versions , and an open, unstarted round with an empty list. Then a response from under the default strategy yields the start flag true. I checked this by evaluation.
3. Plain-language summary
If handling one pre-vote response makes a round start an election, then the round was open and had not started one before, and the response was no fresher than the round's accepted state. The resulting round is marked as started and keeps the same accepted state and local node. Its updated pre-votes form an election quorum: a majority of both the last committed and the last accepted configuration, plus the strategy's extra condition, evaluated with the given local response.
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.