Proof using.
intros.
unfold update_elections_data_client_request.
repeat break_match; repeat find_inversion; auto.
simpl.
find_copy_apply_lem_hyp handleClientRequest_log.
intuition.
- repeat find_rewrite. do_bool. omega.
- right.  break_exists_exists. intuition.
congruence.
Qed.

Lemma update_elections_data_client_request_allEntries_ind :
forall {h st client id c out st' ps},
handleClientRequest h (snd st) client id c = (out, st', ps) ->
forall (P : list (term * entry) -> Prop),
P (allEntries (fst st)) ->
(forall e,
eIndex e = S (maxIndex (log (snd st))) ->
eTerm e = currentTerm (snd st) ->
eClient e = client -> eInput e = c -> eId e = id -> type (snd st) = Leader ->
P ((currentTerm st', e) :: allEntries (fst st))) ->
P (allEntries (update_elections_data_client_request h st client id c)).