A freshly started node satisfies invariant()
ProvedOpenSearchCoordination.init_javaInvariantFor every election strategy es, node n, term t and cluster state s with s.term ≤ t: (CoordinationState.init n t s).javaInvariant es. The constructor, which a restart runs over the persisted current term t and last accepted state s, yields empty votes, no election and last published version 0, and these satisfy the five assertions of invariant() as soon as the persisted accepted term is at most the persisted current term.
import Definitions.Def_OpenSearchCoordination
theorem OpenSearchCoordination.init_javaInvariant {V : Type} (es : ElectionStrategy) (n : DiscoveryNode) (t : Nat) (s : ClusterState V)
(h : s.term ≤ t) : (CoordinationState.init n t s).javaInvariant es := 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: OpenSearchCoordination.init_javaInvariant
Notions used
Coordination states. For a payload type , a coordination state has nine fields:
- , a node with an id and an eligibility flag;
- ;
- , a cluster state;
- and , vote collections (lists of ids);
- and , Booleans;
- ;
- .
A cluster state has a term , a version , last committed and last accepted voting configurations, and other independent fields. Abbreviations, all read from :
- : its term;
- : its version;
- and : its two configurations.
Constructor. is the state with:
- ;
- ;
- ;
- ;
- ;
- ;
- .
Quorums.
- holds iff . It is false whenever is empty.
- An election strategy is an arbitrary Boolean function .
- .
The Java invariant. is the conjunction of:
- (i) ;
- (ii) ;
- (iii) if , then ; otherwise ;
- (iv) ;
- (v) is empty .
1. Declaration
Binders.
- (implicit);
- : an election strategy;
- : a node;
- ;
- (
s): a cluster state over .
Hypothesis. : .
Conclusion. . Unfolded, it states the following:
- (i) . This is the hypothesis itself.
- (ii) . The right side is false because the empty vote collection is not a quorum.
- (iii) Since the election is not won, .
- (iv) This holds vacuously.
- (v) The publish votes are empty.
2. What is not constrained
- is arbitrary. No monotonicity is needed.
- is arbitrary.
- is arbitrary apart from . Its configurations may be empty or non-empty, and its version, metadata version and other fields are free.
- is necessary: conjunct (i) for the initial state is exactly .
- The hypothesis is satisfiable, for example with . The statement is not vacuous.
- The statement is about the constructor only. It says nothing about later steps.
3. Plain-language summary
A freshly constructed (restarted) coordination state satisfies all five Java invariant assertions, for every election strategy, provided the persisted accepted term does not exceed the persisted current term.
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.