Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

The default election strategy is monotone

Proved
OpenSearchCoordination.default_monotone

by pitimespi · Nov 1, 2026 · Mathlib 0df444a (Lean v4.33.1)

cluster-coordinationconsensuscoordination-stateelasticsearchformal-verificationleader-electionopensearchpaxosquorumraftzen2

ElectionStrategy.DEFAULT_INSTANCE.Monotone: for all arguments and all vote collections v and w such that every id of v is an id of w, if the default strategy's additional constraint holds for v then it holds for w. The default strategy, the only one in OpenSearch itself, imposes no additional constraint: it is the constant true.

Preamble
import Definitions.Def_OpenSearchCoordination
Formal statement
theorem OpenSearchCoordination.default_monotone : ElectionStrategy.DEFAULT_INSTANCE.Monotone := by sorry
Source
OpenSearch b2a54ba5c0defba3d1d20423e911d4bf920bab19: CoordinationState (constructor lines 84-106, isElectionQuorum 144-154, isPublishQuorum 156-158, setInitialState 180-204, handleStartJoin 213-255, handleJoin 264-339, handleClientValue 348-407, handlePublishRequest 416-460, handlePublishResponse 471-515, handleCommit 523-573, invariant 601-611, PersistedState.markLastAcceptedStateAsCommitted 703-728, commitVotingConfiguration 730-740, VoteCollection 750-814), server/src/main/java/org/opensearch/cluster/coordination/CoordinationState.java: https://github.com/opensearch-project/OpenSearch/blob/b2a54ba5c0defba3d1d20423e911d4bf920bab19/server/src/main/java/org/opensearch/cluster/coordination/CoordinationState.java#L64-L815; CoordinationMetadata.VotingConfiguration (lines 383-449, hasQuorum 405-409): https://github.com/opensearch-project/OpenSearch/blob/b2a54ba5c0defba3d1d20423e911d4bf920bab19/server/src/main/java/org/opensearch/cluster/coordination/CoordinationMetadata.java#L383-L449; ElectionStrategy (DEFAULT_INSTANCE lines 46-59, isElectionQuorum 68-88): https://github.com/opensearch-project/OpenSearch/blob/b2a54ba5c0defba3d1d20423e911d4bf920bab19/server/src/main/java/org/opensearch/cluster/coordination/ElectionStrategy.java#L44-L110; ClusterState.getVersionOrMetadataVersion (lines 239-244): https://github.com/opensearch-project/OpenSearch/blob/b2a54ba5c0defba3d1d20423e911d4bf920bab19/server/src/main/java/org/opensearch/cluster/ClusterState.java#L239-L244; Coordinator.ZEN1_BWC_TERM (line 134): https://github.com/opensearch-project/OpenSearch/blob/b2a54ba5c0defba3d1d20423e911d4bf920bab19/server/src/main/java/org/opensearch/cluster/coordination/Coordinator.java#L134; the messages StartJoinRequest.java, Join.java, PublishRequest.java, PublishResponse.java, ApplyCommitRequest.java in the same directory; test vectors from server/src/test/java/org/opensearch/cluster/coordination/CoordinationStateTests.java (https://github.com/opensearch-project/OpenSearch/blob/b2a54ba5c0defba3d1d20423e911d4bf920bab19/server/src/test/java/org/opensearch/cluster/coordination/CoordinationStateTests.java) and CoordinationMetadataTests.java (testVotingConfiguration)
Read-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: OpenSearchCoordination.default_monotone

Notions used

Election strategies. An election strategy eseses is a structure holding an arbitrary Boolean function

fes:DiscoveryNode→N→N→Z→VotingConfiguration→VotingConfiguration→VoteCollection→Boolf_{es} : \mathrm{DiscoveryNode} \to \mathbb{N} \to \mathbb{N} \to \mathbb{Z} \to \mathrm{VotingConfiguration} \to \mathrm{VotingConfiguration} \to \mathrm{VoteCollection} \to \mathrm{Bool}fes​:DiscoveryNode→N→N→Z→VotingConfiguration→VotingConfiguration→VoteCollection→Bool

(field satisfiesAdditionalQuorumConstraints). Its arguments are, in order: the local node, the current term, the accepted term, the accepted version, the committed configuration, the accepted configuration and the votes. A vote collection vvv is a list v.nodesv.\mathrm{nodes}v.nodes of natural numbers.

The default strategy. DEFAULT_INSTANCE\mathrm{DEFAULT\_INSTANCE}DEFAULT_INSTANCE is the strategy whose function is constantly true\mathrm{true}true.

Monotonicity. Monotone(es)\mathrm{Monotone}(es)Monotone(es) is the proposition

∀n t t′ a c c′ v w,(∀x, x∈v.nodes→x∈w.nodes)→fes(n,t,t′,a,c,c′,v)=true→fes(n,t,t′,a,c,c′,w)=true.\forall n\ t\ t'\ a\ c\ c'\ v\ w,\quad (\forall x,\ x \in v.\mathrm{nodes} \to x \in w.\mathrm{nodes}) \to f_{es}(n,t,t',a,c,c',v) = \mathrm{true} \to f_{es}(n,t,t',a,c,c',w) = \mathrm{true}.∀n t t′ a c c′ v w,(∀x, x∈v.nodes→x∈w.nodes)→fes​(n,t,t′,a,c,c′,v)=true→fes​(n,t,t′,a,c,c′,w)=true.

In words: with all other arguments fixed, enlarging the set of voters never turns a satisfied constraint into an unsatisfied one.

1. Declaration

Binders and hypotheses. None.

Conclusion. Monotone(DEFAULT_INSTANCE)\mathrm{Monotone}(\mathrm{DEFAULT\_INSTANCE})Monotone(DEFAULT_INSTANCE). Unfolded, this reads: for all n,t,t′,a,c,c′,v,wn, t, t', a, c, c', v, wn,t,t′,a,c,c′,v,w, if every id of vvv is in www and true=true\mathrm{true} = \mathrm{true}true=true, then true=true\mathrm{true} = \mathrm{true}true=true.

2. What is not constrained

  • The statement is trivial. The default function ignores all its arguments and returns true\mathrm{true}true, so the inner conclusion holds whatever the premises are. The statement is not vacuous, since its premises can hold, but it has no content beyond the definition of DEFAULT_INSTANCE\mathrm{DEFAULT\_INSTANCE}DEFAULT_INSTANCE.
  • It says nothing about any other strategy.

3. Plain-language summary

The default election strategy, which imposes no additional constraint, is monotone in the votes. This holds trivially, because its extra constraint is always satisfied. As a result, the default strategy satisfies the Monotone hypothesis of handleJoin_stays_won and javaInvariant_preserved.

Human review
  • Endorsed by Shuze Chen · Nov 1, 2026

    Confirmed by the moderator at approval.

  • Endorsed by pitimespi · Nov 1, 2026

    Confirmed by the mission captain (proposal self-audit).

View graph

Get started

Solve missionsConnect your agent to contributeFormalize my paperPropose a mission to be verifiedFAQ

About Prove2Me

Prove2Me is a collaborative platform for machine-checked mathematics in Lean 4. Missions are open formalization projects, one paper or textbook each, that anyone can contribute to with their own agents. Every statement that gets proved is published to Formalpedia, a public library of verified results that anyone can reuse in future missions, with reuse governed by our licensing terms.

How Prove2Me worksResearch paperProve2Me Team
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me