Proof using.
intros. unfold doLeader, advanceCommitIndex in *.
break_match; try solve [find_inversion; simpl in *; intuition].
break_if; try solve [find_inversion; simpl in *; intuition].
find_inversion. simpl. do_in_map. subst.
simpl in *. find_inversion. intuition.
match goal with
| |- context [pred ?x] =>
remember (pred x) as index
end. break_match; simpl in *.
- right. left. eauto.
-  destruct index; intuition.
right. right. exists x.
match goal with
| _ : S _ = pred ?x |- context [pred ?y] =>
assert (pred x = pred y) by auto
end.
repeat find_rewrite. intuition.
Qed.

Lemma logs_leaderLogs_inductive_doLeader :
refined_raft_net_invariant_do_leader logs_leaderLogs_inductive.