Section inner.
Variable client : clientId.
Variable id : nat.
Variable i : input.
Proof using.
unfold applied_implies_input_state.
intros.
break_exists_exists.
intuition.
break_exists.
simpl in *.
destruct (name_eq_dec h x0); rewrite_update; eauto.
Qed.
Proof using.
unfold applied_implies_input_state.
eauto 10.
Qed.
Proof using.
unfold applied_implies_input_state.
eauto 10.
Qed.
Proof using.
intros. unfold doGenericServer in *.
repeat break_match; find_inversion;
use_applyEntries_spec; simpl in *;
subst; auto.
Qed.
Proof using.
intros. unfold handleTimeout, tryToBecomeLeader in *.
break_match; find_inversion; subst; auto.
Qed.
Proof using.
unfold handleClientRequest.
intros.
break_match; find_inversion; simpl in *; intuition.
Qed.
Proof using.
unfold mEntries.
intros.
break_match; try discriminate.
find_inversion.
eauto 10.
Qed.
Proof using.
intros. unfold doGenericServer in *.
repeat break_match; find_inversion; subst; auto.
Qed.

Lemma doLeader_messages :
forall d h os d' ms m es e,
doLeader d h = (os, d', ms) ->
In m ms ->
mEntries (snd m) = Some es ->
In e es ->
In e (log d).