Proof using.
red. unfold CandidateEntries.
intros.
intuition; simpl in *.
- unfold candidateEntries_host_invariant in *.
intros.
eapply candidateEntries_ext; eauto.
repeat find_higher_order_rewrite.
update_destruct; subst; rewrite_update.
+ simpl in *.
find_erewrite_lem doLeader_same_log.
repeat match goal with
| [ H : nwState ?net ?h = (_, ?d), H' : context [ log ?d ] |- _ ] =>
replace (log d) with (log (snd (nwState net h))) in H' by (repeat find_rewrite; auto)
end.
eauto using doLeader_preserves_candidateEntries.
+ eauto using doLeader_preserves_candidateEntries.
- unfold candidateEntries_nw_invariant in *.
intros. simpl in *.
eapply candidateEntries_ext; eauto.
find_apply_hyp_hyp.
intuition.
+ eauto using doLeader_preserves_candidateEntries.
+ do_in_map. subst. simpl in *.
eapply doLeader_preserves_candidateEntries; eauto.
eapply_prop candidateEntries_host_invariant.
match goal with
| [ H : _ |- _ ] => rewrite H
end.
simpl.
eauto using doLeader_in_entries.
Qed.

(* Specifications: *)
Lemma doGenericServer_same_type :
forall h d os d' ms,
doGenericServer h d = (os, d', ms) ->
type d' = type d.