Proof using.
induction l; intros; simpl in *; auto using assoc_default_assoc_set_diff.
repeat break_match; simpl in *; eauto.
- do_bool. destruct (clientId_eq_dec (eClient a) k); subst; simpl in *.
+ rewrite assoc_set_assoc_set_same. auto.
+ erewrite assoc_default_a_equiv; [|apply log_to_ks'_a_equiv;
apply assoc_set_assoc_set_diff]; eauto.
- do_bool. destruct (clientId_eq_dec (eClient a) k); subst; simpl in *.
+ rewrite assoc_set_assoc_set_same. auto.
+ rewrite assoc_default_assoc_set_diff in *; auto; omega.
- do_bool. destruct (clientId_eq_dec (eClient a) k); subst; simpl in *.
+ erewrite <- assoc_set_assoc_set_same; eauto.
+ rewrite assoc_default_assoc_set_diff in *; auto; omega.
Qed.

(* Specifications: *)
Lemma assoc_set_log_to_ks'_le:
forall (l : list entry) (ks : list (clientId * nat)) c i,
assoc_default clientId_eq_dec (log_to_ks' l ks) c 0 <= i ->
a_equiv clientId_eq_dec
(assoc_set clientId_eq_dec (log_to_ks' l ks) c i)
(log_to_ks' l (assoc_set clientId_eq_dec ks c i)).