Proof using.
unfold raft_net_invariant_client_request, match_index_sanity.
simpl.
intros.
repeat find_higher_order_rewrite.
update_destruct_simplify.
- find_copy_apply_lem_hyp handleClientRequest_type.
find_copy_apply_lem_hyp handleClientRequest_matchIndex.
intuition.
+ repeat find_rewrite. auto.
+ repeat find_rewrite.
destruct (name_eq_dec h0 leader).
* subst. rewrite get_set_same_default. auto.
* rewrite get_set_diff_default by auto.
eauto using le_trans.
- auto.
Qed.

(* Specifications: *)
Lemma match_index_sanity_preserved :
forall st st',
matchIndex_preserved st st' ->
(forall h,
type st = Leader ->
assoc_default name_eq_dec (matchIndex st) h 0 <=
maxIndex (log st)) ->
(forall h,
type st' = Leader ->
assoc_default name_eq_dec (matchIndex st') h 0 <=
maxIndex (log st')).