proposition: Lemma fold_left_In : forall l kv p', fold_left (fun (a : option (StringIndexedMap.key * nat)) (p : StringIndexedMap.key * nat) => Ifopt a as sv' Then if lt_dec (snd p) (snd sv') then Some (fst p, snd p) else Some sv' Else Some p) l p' = Some kv -> (Some kv = p') \/ SetoidList.InA (fun p p' : string * nat => fst p = fst p' /\ snd p = snd p') kv l.
proof: Proof. clear; induction l; simpl; intros; subst; eauto. destruct p'; simpl in H. destruct (lt_dec (snd a) (snd p)). destruct (IHl _ _ H). right; constructor; injections; simpl; eauto. right; constructor 2; eauto. destruct (IHl _ _ H). injections; eauto. eauto. right; destruct (IHl _ _ H); injections; eauto. Qed.
imports: Fiat.Common.Coq__8_4__8_5__Compat Coq.Strings.String Coq.ZArith.ZArith Coq.Lists.List Coq.Logic.FunctionalExtensionality Coq.Sets.Ensembles Computation ADT ADTRefinement ADTNotation BuildADTRefinements KVEnsembles CacheSpec CacheRefinements String_as_OT FMapAVL