Section OutputGreatestId.
Context {orig_base_params : BaseParams}.
Context {one_node_params : OneNodeParams orig_base_params}.
Context {raft_params : RaftParams orig_base_params}.
Context {lmi : log_matching_interface}.
Context {si : sorted_interface}.
Context {aemi : applied_entries_monotonic_interface}.
Context {smsi : state_machine_safety_interface}.
Context {misi : max_index_sanity_interface}.
Context {smci : state_machine_correct_interface}.
Context {lacimi : lastApplied_commitIndex_match_interface}.
Proof using.
intros. unfold key_in_output_trace in *.
break_exists_exists.
intuition. do_in_app; intuition.
exfalso. eauto.
Qed.
Proof using.
intros.
unfold key_in_output_list in *.
break_exists; do_in_app; intuition eauto.
Qed.
Proof using.
intuition.
unfold key_in_output_list in *.
break_exists; intuition.
Qed.
Proof using.
intros. unfold doLeader, advanceCommitIndex in *.
repeat break_match; find_inversion; intuition;
find_apply_lem_hyp key_in_output_list_empty; auto.
Qed.

Lemma handleInput_key_in_output_list :
forall st h i out st' m client id,
handleInput h i st = (out, st', m) ->
~ key_in_output_list client id out.