Built with Alectryon, running Coq+SerAPI v8.10.0+0.7.0. Coq sources are in this panel; goals and messages will appear in the other. Bubbles () indicate interactive fragments: hover for details, tap to reveal contents. Use Ctrl+↑ Ctrl+↓ to navigate, Ctrl+🖱️ to focus.
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
(* * GNU Lesser General Public License Version 2.1 *)
(* * (see LICENSE file for the text of the license) *)
(************************************************************************)
This file proposes an implementation of the non-dependent interface
FMapInterface.WS using lists of pairs, unordered but without redundancy.
Require Import FunInd FMapInterface. Set Implicit Arguments. Unset Strict Implicit. Module Raw (X:DecidableType). Module Import PX := KeyDecidableType X. Definition key := X.t. Definition t (elt:Type) := list (X.t * elt). Section Elt. Variable elt : Type. Notation eqk := (eqk (elt:=elt)). Notation eqke := (eqke (elt:=elt)). Notation MapsTo := (MapsTo (elt:=elt)). Notation In := (In (elt:=elt)). Notation NoDupA := (NoDupA eqk).
Definition empty : t elt := nil. Definition Empty m := forall (a : key)(e:elt), ~ MapsTo a e m.elt:TypeEmpty emptyelt:TypeEmpty emptyelt:Typeforall (a : key) (e : elt), ~ MapsTo a e nilelt:Typea:keye:elt~ MapsTo a e nilinversion abs. Qed. Hint Resolve empty_1 : core.elt:Typea:keye:eltabs:MapsTo a e nilFalseelt:TypeNoDupA emptyunfold empty; auto. Qed.elt:TypeNoDupA empty
Definition is_empty (l : t elt) : bool := if l then true else false.elt:Typeforall m : list (X.t * elt), Empty m -> is_empty m = trueelt:Typeforall m : list (X.t * elt), Empty m -> is_empty m = trueelt:Typeforall m : list (X.t * elt), (forall (a : key) (e : elt), ~ InA eqke (a, e) m) -> is_empty m = trueelt:Typem:list (X.t * elt)(forall (a : key) (e : elt), ~ InA eqke (a, e) m) -> is_empty m = trueelt:Typem:list (X.t * elt)forall (p : X.t * elt) (l : list (X.t * elt)), (forall (a : key) (e : elt), ~ InA eqke (a, e) (p :: l)) -> is_empty (p :: l) = trueelt:Typem:list (X.t * elt)p:(X.t * elt)%typel:list (X.t * elt)inlist:forall (a : key) (e : elt), ~ InA eqke (a, e) (p :: l)is_empty (p :: l) = trueabsurd (InA eqke (t0, e) ((t0, e) :: l));auto. Qed.elt:Typem:list (X.t * elt)t0:X.te:eltl:list (X.t * elt)inlist:forall (a : key) (e0 : elt), ~ InA eqke (a, e0) ((t0, e) :: l)is_empty ((t0, e) :: l) = trueelt:Typeforall m : t elt, is_empty m = true -> Empty melt:Typeforall m : t elt, is_empty m = true -> Empty melt:Typem:t eltis_empty m = true -> Empty melt:Typem:t eltforall (p : X.t * elt) (l : list (X.t * elt)), is_empty (p :: l) = true -> Empty (p :: l)inversion abs. Qed.elt:Typem:t eltp:(X.t * elt)%typel:list (X.t * elt)abs:is_empty (p :: l) = trueEmpty (p :: l)
Function mem (k : key) (s : t elt) {struct s} : bool := match s with | nil => false | (k',_) :: l => if X.eq_dec k k' then true else mem k l end.elt:Typeforall m : list (X.t * elt), NoDupA m -> forall x : X.t, In x m -> mem x m = trueelt:Typeforall m : list (X.t * elt), NoDupA m -> forall x : X.t, In x m -> mem x m = trueelt:Typem:list (X.t * elt)x:X.tNoDupA m -> In x m -> mem x m = trueelt:Typex:X.tNoDup:NoDupA nilbelong1:In x nilfalse = trueelt:Typex, k':X.t_x:eltl:list (X.t * elt)_x0:~ X.eq x k'e0:X.eq_dec x k' = right _x0IHb:NoDupA l -> In x l -> mem x l = trueNoDup:NoDupA ((k', _x) :: l)belong1:In x ((k', _x) :: l)mem x l = trueelt:Typex:X.tNoDup:NoDupA nilbelong1:In x nilx0:eltH:MapsTo x x0 nilfalse = trueelt:Typex, k':X.t_x:eltl:list (X.t * elt)_x0:~ X.eq x k'e0:X.eq_dec x k' = right _x0IHb:NoDupA l -> In x l -> mem x l = trueNoDup:NoDupA ((k', _x) :: l)belong1:In x ((k', _x) :: l)mem x l = trueelt:Typex, k':X.t_x:eltl:list (X.t * elt)_x0:~ X.eq x k'e0:X.eq_dec x k' = right _x0IHb:NoDupA l -> In x l -> mem x l = trueNoDup:NoDupA ((k', _x) :: l)belong1:In x ((k', _x) :: l)mem x l = trueelt:Typex, k':X.t_x:eltl:list (X.t * elt)_x0:~ X.eq x k'e0:X.eq_dec x k' = right _x0IHb:NoDupA l -> In x l -> mem x l = truebelong1:In x ((k', _x) :: l)H:~ InA eqk (k', _x) lH0:NoDupA lmem x l = trueelt:Typex, k':X.t_x:eltl:list (X.t * elt)_x0:~ X.eq x k'e0:X.eq_dec x k' = right _x0IHb:NoDupA l -> In x l -> mem x l = trueH:~ InA eqk (k', _x) lH0:NoDupA lx0:eltH1:MapsTo x x0 ((k', _x) :: l)mem x l = trueelt:Typex, k':X.t_x:eltl:list (X.t * elt)_x0:~ X.eq x k'e0:X.eq_dec x k' = right _x0IHb:NoDupA l -> In x l -> mem x l = trueH:~ InA eqk (k', _x) lH0:NoDupA lx0:eltH2:eqke (x, x0) (k', _x)mem x l = trueelt:Typex, k':X.t_x:eltl:list (X.t * elt)_x0:~ X.eq x k'e0:X.eq_dec x k' = right _x0IHb:NoDupA l -> In x l -> mem x l = trueH:~ InA eqk (k', _x) lH0:NoDupA lx0:eltH2:InA eqke (x, x0) lmem x l = trueelt:Typex, k':X.t_x:eltl:list (X.t * elt)_x0:~ X.eq x k'e0:X.eq_dec x k' = right _x0IHb:NoDupA l -> In x l -> mem x l = trueH:~ InA eqk (k', _x) lH0:NoDupA lx0:eltH1:X.eq x k'H2:x0 = _xmem x l = trueelt:Typex, k':X.t_x:eltl:list (X.t * elt)_x0:~ X.eq x k'e0:X.eq_dec x k' = right _x0IHb:NoDupA l -> In x l -> mem x l = trueH:~ InA eqk (k', _x) lH0:NoDupA lx0:eltH2:InA eqke (x, x0) lmem x l = trueelt:Typex, k':X.t_x:eltl:list (X.t * elt)_x0:~ X.eq x k'e0:X.eq_dec x k' = right _x0IHb:NoDupA l -> In x l -> mem x l = trueH:~ InA eqk (k', _x) lH0:NoDupA lx0:eltH2:InA eqke (x, x0) lmem x l = trueexists x0; auto. Qed.elt:Typex, k':X.t_x:eltl:list (X.t * elt)_x0:~ X.eq x k'e0:X.eq_dec x k' = right _x0IHb:NoDupA l -> In x l -> mem x l = trueH:~ InA eqk (k', _x) lH0:NoDupA lx0:eltH2:InA eqke (x, x0) lIn x lelt:Typeforall m : list (X.t * elt), NoDupA m -> forall x : key, mem x m = true -> In x melt:Typeforall m : list (X.t * elt), NoDupA m -> forall x : key, mem x m = true -> In x melt:Typem:list (X.t * elt)x:keyNoDupA m -> mem x m = true -> exists e : elt, InA eqke (x, e) melt:Typex:keyk':X.t_x:eltl:list (X.t * elt)_x0:X.eq x k'e0:X.eq_dec x k' = left _x0NoDup:NoDupA ((k', _x) :: l)hyp:true = trueexists e : elt, InA eqke (x, e) ((k', _x) :: l)elt:Typex:keyk':X.t_x:eltl:list (X.t * elt)_x0:~ X.eq x k'e0:X.eq_dec x k' = right _x0IHb:NoDupA l -> mem x l = true -> exists e : elt, InA eqke (x, e) lNoDup:NoDupA ((k', _x) :: l)hyp:mem x l = trueexists e : elt, InA eqke (x, e) ((k', _x) :: l)elt:Typex:keyk':X.t_x:eltl:list (X.t * elt)_x0:~ X.eq x k'e0:X.eq_dec x k' = right _x0IHb:NoDupA l -> mem x l = true -> exists e : elt, InA eqke (x, e) lNoDup:NoDupA ((k', _x) :: l)hyp:mem x l = trueexists e : elt, InA eqke (x, e) ((k', _x) :: l)elt:Typex:keyk':X.t_x:eltl:list (X.t * elt)_x0:~ X.eq x k'e0:X.eq_dec x k' = right _x0IHb:NoDupA l -> mem x l = true -> exists e : elt, InA eqke (x, e) lhyp:mem x l = trueH:~ InA eqk (k', _x) lH0:NoDupA lexists e : elt, InA eqke (x, e) ((k', _x) :: l)exists x0; auto. Qed.elt:Typex:keyk':X.t_x:eltl:list (X.t * elt)_x0:~ X.eq x k'e0:X.eq_dec x k' = right _x0hyp:mem x l = trueH:~ InA eqk (k', _x) lH0:NoDupA lx0:eltH1:InA eqke (x, x0) lexists e : elt, InA eqke (x, e) ((k', _x) :: l)
Function find (k:key) (s: t elt) {struct s} : option elt := match s with | nil => None | (k',x)::s' => if X.eq_dec k k' then Some x else find k s' end.elt:Typeforall (m : t elt) (x : key) (e : elt), find x m = Some e -> MapsTo x e melt:Typeforall (m : t elt) (x : key) (e : elt), find x m = Some e -> MapsTo x e melt:Typem:t eltx:keyforall e : elt, find x m = Some e -> MapsTo x e mfunctional induction (find x m);simpl;intros e' eqfind; inversion eqfind; auto. Qed.elt:Typem:t eltx:keyforall e : elt, find x m = Some e -> InA eqke (x, e) melt:Typeforall m : list (X.t * elt), NoDupA m -> forall (x : X.t) (e : elt), MapsTo x e m -> find x m = Some eelt:Typeforall m : list (X.t * elt), NoDupA m -> forall (x : X.t) (e : elt), MapsTo x e m -> find x m = Some eelt:Typem:list (X.t * elt)x:X.te:eltNoDupA m -> InA eqke (x, e) m -> find x m = Some eelt:Typex:X.te:eltNoDupA nil -> InA eqke (x, e) nil -> None = Some eelt:Typex:X.te:eltk':X.tx0:elts':list (X.t * elt)_x:X.eq x k'e1:X.eq_dec x k' = left _xNoDupA ((k', x0) :: s') -> InA eqke (x, e) ((k', x0) :: s') -> Some x0 = Some eelt:Typex:X.te:eltk':X.tx0:elts':list (X.t * elt)_x:~ X.eq x k'e1:X.eq_dec x k' = right _xIHo:NoDupA s' -> InA eqke (x, e) s' -> find x s' = Some eNoDupA ((k', x0) :: s') -> InA eqke (x, e) ((k', x0) :: s') -> find x s' = Some eelt:Typex:X.te:eltk':X.tx0:elts':list (X.t * elt)_x:X.eq x k'e1:X.eq_dec x k' = left _xNoDupA ((k', x0) :: s') -> InA eqke (x, e) ((k', x0) :: s') -> Some x0 = Some eelt:Typex:X.te:eltk':X.tx0:elts':list (X.t * elt)_x:~ X.eq x k'e1:X.eq_dec x k' = right _xIHo:NoDupA s' -> InA eqke (x, e) s' -> find x s' = Some eNoDupA ((k', x0) :: s') -> InA eqke (x, e) ((k', x0) :: s') -> find x s' = Some eelt:Typex:X.te:eltk':X.tx0:elts':list (X.t * elt)_x:X.eq x k'e1:X.eq_dec x k' = left _xH:~ InA eqk (k', x0) s'H0:NoDupA s'H2:eqke (x, e) (k', x0)Some x0 = Some eelt:Typex:X.te:eltk':X.tx0:elts':list (X.t * elt)_x:X.eq x k'e1:X.eq_dec x k' = left _xH:~ InA eqk (k', x0) s'H0:NoDupA s'H2:InA eqke (x, e) s'Some x0 = Some eelt:Typex:X.te:eltk':X.tx0:elts':list (X.t * elt)_x:~ X.eq x k'e1:X.eq_dec x k' = right _xIHo:NoDupA s' -> InA eqke (x, e) s' -> find x s' = Some eNoDupA ((k', x0) :: s') -> InA eqke (x, e) ((k', x0) :: s') -> find x s' = Some eelt:Typex:X.te:eltk':X.tx0:elts':list (X.t * elt)_x:X.eq x k'e1:X.eq_dec x k' = left _xH:~ InA eqk (k', x0) s'H0:NoDupA s'H2:InA eqke (x, e) s'Some x0 = Some eelt:Typex:X.te:eltk':X.tx0:elts':list (X.t * elt)_x:~ X.eq x k'e1:X.eq_dec x k' = right _xIHo:NoDupA s' -> InA eqke (x, e) s' -> find x s' = Some eNoDupA ((k', x0) :: s') -> InA eqke (x, e) ((k', x0) :: s') -> find x s' = Some eelt:Typex:X.te:eltk':X.tx0:elts':list (X.t * elt)_x:~ X.eq x k'e1:X.eq_dec x k' = right _xIHo:NoDupA s' -> InA eqke (x, e) s' -> find x s' = Some eNoDupA ((k', x0) :: s') -> InA eqke (x, e) ((k', x0) :: s') -> find x s' = Some ecompute in H2; destruct H2; elim _x; auto. Qed. (* Not part of the exported specifications, used later for [combine]. *)elt:Typex:X.te:eltk':X.tx0:elts':list (X.t * elt)_x:~ X.eq x k'e1:X.eq_dec x k' = right _xIHo:NoDupA s' -> InA eqke (x, e) s' -> find x s' = Some eH:~ InA eqk (k', x0) s'H0:NoDupA s'H2:eqke (x, e) (k', x0)find x s' = Some eelt:Typeforall m : list (X.t * elt), NoDupA m -> forall x x' : X.t, X.eq x x' -> find x m = find x' melt:Typeforall m : list (X.t * elt), NoDupA m -> forall x x' : X.t, X.eq x x' -> find x m = find x' melt:Typet0:X.te:eltm:list (X.t * elt)IHm:NoDupA m -> forall x0 x'0 : X.t, X.eq x0 x'0 -> find x0 m = find x'0 mHm:NoDupA ((t0, e) :: m)x, x':X.tH:X.eq x x'(if X.eq_dec x t0 then Some e else find x m) = (if X.eq_dec x' t0 then Some e else find x' m)elt:Typet0:X.te:eltm:list (X.t * elt)IHm:NoDupA m -> forall x0 x'0 : X.t, X.eq x0 x'0 -> find x0 m = find x'0 mx, x':X.tH:X.eq x x'H0:~ InA eqk (t0, e) mH1:NoDupA m(if X.eq_dec x t0 then Some e else find x m) = (if X.eq_dec x' t0 then Some e else find x' m)elt:Typet0:X.te:eltm:list (X.t * elt)IHm:NoDupA m -> forall x0 x'0 : X.t, X.eq x0 x'0 -> find x0 m = find x'0 mx, x':X.tH:X.eq x x'H0:~ InA eqk (t0, e) mH1:NoDupA m(if X.eq_dec x t0 then Some e else find x' m) = (if X.eq_dec x' t0 then Some e else find x' m)elt:Typet0:X.te:eltm:list (X.t * elt)IHm:NoDupA m -> forall x0 x'0 : X.t, X.eq x0 x'0 -> find x0 m = find x'0 mx, x':X.tH:X.eq x x'H0:~ InA eqk (t0, e) mH1:NoDupA me0:X.eq x t0Hneq':~ X.eq x' t0Some e = find x' melt:Typet0:X.te:eltm:list (X.t * elt)IHm:NoDupA m -> forall x0 x'0 : X.t, X.eq x0 x'0 -> find x0 m = find x'0 mx, x':X.tH:X.eq x x'H0:~ InA eqk (t0, e) mH1:NoDupA mHneq:~ X.eq x t0e0:X.eq x' t0find x' m = Some eelim Hneq; apply X.eq_trans with x'; auto. Qed.elt:Typet0:X.te:eltm:list (X.t * elt)IHm:NoDupA m -> forall x0 x'0 : X.t, X.eq x0 x'0 -> find x0 m = find x'0 mx, x':X.tH:X.eq x x'H0:~ InA eqk (t0, e) mH1:NoDupA mHneq:~ X.eq x t0e0:X.eq x' t0find x' m = Some e
Function add (k : key) (x : elt) (s : t elt) {struct s} : t elt := match s with | nil => (k,x) :: nil | (k',y) :: l => if X.eq_dec k k' then (k,x)::l else (k',y)::add k x l end.elt:Typeforall (m : t elt) (x y : X.t) (e : elt), X.eq x y -> MapsTo y e (add x e m)elt:Typeforall (m : t elt) (x y : X.t) (e : elt), X.eq x y -> MapsTo y e (add x e m)functional induction (add x e m);simpl;auto. Qed.elt:Typem:t eltx:X.te:eltforall y : X.t, X.eq x y -> InA eqke (y, e) (add x e m)elt:Typeforall (m : list (X.t * elt)) (x y : X.t) (e e' : elt), ~ X.eq x y -> MapsTo y e m -> MapsTo y e (add x e' m)elt:Typeforall (m : list (X.t * elt)) (x y : X.t) (e e' : elt), ~ X.eq x y -> MapsTo y e m -> MapsTo y e (add x e' m)elt:Typem:list (X.t * elt)x:X.te':eltforall (y : X.t) (e : elt), ~ X.eq x y -> InA eqke (y, e) m -> InA eqke (y, e) (add x e' m)elt:Typex:X.te':eltk':X.ty:eltl:list (X.t * elt)_x:X.eq x k'e0:X.eq_dec x k' = left _xforall (y0 : X.t) (e : elt), ~ X.eq x y0 -> InA eqke (y0, e) ((k', y) :: l) -> InA eqke (y0, e) ((x, e') :: l)elt:Typex:X.te':eltk':X.ty:eltl:list (X.t * elt)_x:~ X.eq x k'e0:X.eq_dec x k' = right _xIHt0:forall (y0 : X.t) (e : elt), ~ X.eq x y0 -> InA eqke (y0, e) l -> InA eqke (y0, e) (add x e' l)forall (y0 : X.t) (e : elt), ~ X.eq x y0 -> InA eqke (y0, e) ((k', y) :: l) -> InA eqke (y0, e) ((k', y) :: add x e' l)elt:Typex:X.te':eltk':X.ty:eltl:list (X.t * elt)_x:X.eq x k'e0:X.eq_dec x k' = left _xy':X.te'':elteqky':~ X.eq x y'H0:eqke (y', e'') (k', y)InA eqke (y', e'') ((x, e') :: l)elt:Typex:X.te':eltk':X.ty:eltl:list (X.t * elt)_x:X.eq x k'e0:X.eq_dec x k' = left _xy':X.te'':elteqky':~ X.eq x y'H0:InA eqke (y', e'') lInA eqke (y', e'') ((x, e') :: l)elt:Typex:X.te':eltk':X.ty:eltl:list (X.t * elt)_x:~ X.eq x k'e0:X.eq_dec x k' = right _xIHt0:forall (y0 : X.t) (e : elt), ~ X.eq x y0 -> InA eqke (y0, e) l -> InA eqke (y0, e) (add x e' l)forall (y0 : X.t) (e : elt), ~ X.eq x y0 -> InA eqke (y0, e) ((k', y) :: l) -> InA eqke (y0, e) ((k', y) :: add x e' l)elt:Typex:X.te':eltk':X.ty:eltl:list (X.t * elt)_x:X.eq x k'e0:X.eq_dec x k' = left _xy':X.te'':elteqky':~ X.eq x y'H:X.eq y' k'H0:e'' = yInA eqke (y', e'') ((x, e') :: l)elt:Typex:X.te':eltk':X.ty:eltl:list (X.t * elt)_x:X.eq x k'e0:X.eq_dec x k' = left _xy':X.te'':elteqky':~ X.eq x y'H0:InA eqke (y', e'') lInA eqke (y', e'') ((x, e') :: l)elt:Typex:X.te':eltk':X.ty:eltl:list (X.t * elt)_x:~ X.eq x k'e0:X.eq_dec x k' = right _xIHt0:forall (y0 : X.t) (e : elt), ~ X.eq x y0 -> InA eqke (y0, e) l -> InA eqke (y0, e) (add x e' l)forall (y0 : X.t) (e : elt), ~ X.eq x y0 -> InA eqke (y0, e) ((k', y) :: l) -> InA eqke (y0, e) ((k', y) :: add x e' l)elt:Typex:X.te':eltk':X.ty:eltl:list (X.t * elt)_x:X.eq x k'e0:X.eq_dec x k' = left _xy':X.te'':elteqky':~ X.eq x y'H0:InA eqke (y', e'') lInA eqke (y', e'') ((x, e') :: l)elt:Typex:X.te':eltk':X.ty:eltl:list (X.t * elt)_x:~ X.eq x k'e0:X.eq_dec x k' = right _xIHt0:forall (y0 : X.t) (e : elt), ~ X.eq x y0 -> InA eqke (y0, e) l -> InA eqke (y0, e) (add x e' l)forall (y0 : X.t) (e : elt), ~ X.eq x y0 -> InA eqke (y0, e) ((k', y) :: l) -> InA eqke (y0, e) ((k', y) :: add x e' l)intros y' e'' eqky'; inversion_clear 1; intuition. Qed.elt:Typex:X.te':eltk':X.ty:eltl:list (X.t * elt)_x:~ X.eq x k'e0:X.eq_dec x k' = right _xIHt0:forall (y0 : X.t) (e : elt), ~ X.eq x y0 -> InA eqke (y0, e) l -> InA eqke (y0, e) (add x e' l)forall (y0 : X.t) (e : elt), ~ X.eq x y0 -> InA eqke (y0, e) ((k', y) :: l) -> InA eqke (y0, e) ((k', y) :: add x e' l)elt:Typeforall (m : t elt) (x y : X.t) (e e' : elt), ~ X.eq x y -> MapsTo y e (add x e' m) -> MapsTo y e melt:Typeforall (m : t elt) (x y : X.t) (e e' : elt), ~ X.eq x y -> MapsTo y e (add x e' m) -> MapsTo y e melt:Typem:t eltx, y:X.te, e':elt~ X.eq x y -> MapsTo y e (add x e' m) -> MapsTo y e melt:Typem:t eltx:X.te':eltforall (y : X.t) (e : elt), ~ X.eq x y -> InA eqke (y, e) (add x e' m) -> InA eqke (y, e) melt:Typex:X.te':eltforall (y : X.t) (e : elt), ~ X.eq x y -> InA eqke (y, e) ((x, e') :: nil) -> InA eqke (y, e) nilelt:Typex:X.te':eltk':X.ty:eltl:list (X.t * elt)_x:X.eq x k'e0:X.eq_dec x k' = left _xforall (y0 : X.t) (e : elt), ~ X.eq x y0 -> InA eqke (y0, e) ((x, e') :: l) -> InA eqke (y0, e) ((k', y) :: l)elt:Typex:X.te':eltk':X.ty:eltl:list (X.t * elt)_x:~ X.eq x k'e0:X.eq_dec x k' = right _xIHt0:forall (y0 : X.t) (e : elt), ~ X.eq x y0 -> InA eqke (y0, e) (add x e' l) -> InA eqke (y0, e) lforall (y0 : X.t) (e : elt), ~ X.eq x y0 -> InA eqke (y0, e) ((k', y) :: add x e' l) -> InA eqke (y0, e) ((k', y) :: l)elt:Typex:X.te':eltk':X.ty:eltl:list (X.t * elt)_x:X.eq x k'e0:X.eq_dec x k' = left _xforall (y0 : X.t) (e : elt), ~ X.eq x y0 -> InA eqke (y0, e) ((x, e') :: l) -> InA eqke (y0, e) ((k', y) :: l)elt:Typex:X.te':eltk':X.ty:eltl:list (X.t * elt)_x:~ X.eq x k'e0:X.eq_dec x k' = right _xIHt0:forall (y0 : X.t) (e : elt), ~ X.eq x y0 -> InA eqke (y0, e) (add x e' l) -> InA eqke (y0, e) lforall (y0 : X.t) (e : elt), ~ X.eq x y0 -> InA eqke (y0, e) ((k', y) :: add x e' l) -> InA eqke (y0, e) ((k', y) :: l)inversion_clear 2; auto. Qed.elt:Typex:X.te':eltk':X.ty:eltl:list (X.t * elt)_x:~ X.eq x k'e0:X.eq_dec x k' = right _xIHt0:forall (y0 : X.t) (e : elt), ~ X.eq x y0 -> InA eqke (y0, e) (add x e' l) -> InA eqke (y0, e) lforall (y0 : X.t) (e : elt), ~ X.eq x y0 -> InA eqke (y0, e) ((k', y) :: add x e' l) -> InA eqke (y0, e) ((k', y) :: l)elt:Typeforall (m : t elt) (x y : X.t) (e e' : elt), ~ X.eq x y -> InA eqk (y, e) (add x e' m) -> InA eqk (y, e) melt:Typeforall (m : t elt) (x y : X.t) (e e' : elt), ~ X.eq x y -> InA eqk (y, e) (add x e' m) -> InA eqk (y, e) melt:Typem:t eltx, y:X.te, e':elt~ X.eq x y -> InA eqk (y, e) (add x e' m) -> InA eqk (y, e) melt:Typem:t eltx:X.te':eltforall (y : X.t) (e : elt), ~ X.eq x y -> InA eqk (y, e) (add x e' m) -> InA eqk (y, e) melt:Typex:X.te':eltforall (y : X.t) (e : elt), ~ X.eq x y -> InA eqk (y, e) ((x, e') :: nil) -> InA eqk (y, e) nilelt:Typex:X.te':eltk':X.ty:eltl:list (X.t * elt)_x:X.eq x k'e0:X.eq_dec x k' = left _xforall (y0 : X.t) (e : elt), ~ X.eq x y0 -> InA eqk (y0, e) ((x, e') :: l) -> InA eqk (y0, e) ((k', y) :: l)elt:Typex:X.te':eltk':X.ty:eltl:list (X.t * elt)_x:~ X.eq x k'e0:X.eq_dec x k' = right _xIHt0:forall (y0 : X.t) (e : elt), ~ X.eq x y0 -> InA eqk (y0, e) (add x e' l) -> InA eqk (y0, e) lforall (y0 : X.t) (e : elt), ~ X.eq x y0 -> InA eqk (y0, e) ((k', y) :: add x e' l) -> InA eqk (y0, e) ((k', y) :: l)elt:Typex:X.te':elty:X.te:eltH:~ X.eq x yH1:eqk (y, e) (x, e')InA eqk (y, e) nilelt:Typex:X.te':elty:X.te:eltH:~ X.eq x yH1:InA eqk (y, e) nilInA eqk (y, e) nilelt:Typex:X.te':eltk':X.ty:eltl:list (X.t * elt)_x:X.eq x k'e0:X.eq_dec x k' = left _xforall (y0 : X.t) (e : elt), ~ X.eq x y0 -> InA eqk (y0, e) ((x, e') :: l) -> InA eqk (y0, e) ((k', y) :: l)elt:Typex:X.te':eltk':X.ty:eltl:list (X.t * elt)_x:~ X.eq x k'e0:X.eq_dec x k' = right _xIHt0:forall (y0 : X.t) (e : elt), ~ X.eq x y0 -> InA eqk (y0, e) (add x e' l) -> InA eqk (y0, e) lforall (y0 : X.t) (e : elt), ~ X.eq x y0 -> InA eqk (y0, e) ((k', y) :: add x e' l) -> InA eqk (y0, e) ((k', y) :: l)elt:Typex:X.te':elty:X.te:eltH:~ X.eq x yH1:InA eqk (y, e) nilInA eqk (y, e) nilelt:Typex:X.te':eltk':X.ty:eltl:list (X.t * elt)_x:X.eq x k'e0:X.eq_dec x k' = left _xforall (y0 : X.t) (e : elt), ~ X.eq x y0 -> InA eqk (y0, e) ((x, e') :: l) -> InA eqk (y0, e) ((k', y) :: l)elt:Typex:X.te':eltk':X.ty:eltl:list (X.t * elt)_x:~ X.eq x k'e0:X.eq_dec x k' = right _xIHt0:forall (y0 : X.t) (e : elt), ~ X.eq x y0 -> InA eqk (y0, e) (add x e' l) -> InA eqk (y0, e) lforall (y0 : X.t) (e : elt), ~ X.eq x y0 -> InA eqk (y0, e) ((k', y) :: add x e' l) -> InA eqk (y0, e) ((k', y) :: l)elt:Typex:X.te':eltk':X.ty:eltl:list (X.t * elt)_x:X.eq x k'e0:X.eq_dec x k' = left _xforall (y0 : X.t) (e : elt), ~ X.eq x y0 -> InA eqk (y0, e) ((x, e') :: l) -> InA eqk (y0, e) ((k', y) :: l)elt:Typex:X.te':eltk':X.ty:eltl:list (X.t * elt)_x:~ X.eq x k'e0:X.eq_dec x k' = right _xIHt0:forall (y0 : X.t) (e : elt), ~ X.eq x y0 -> InA eqk (y0, e) (add x e' l) -> InA eqk (y0, e) lforall (y0 : X.t) (e : elt), ~ X.eq x y0 -> InA eqk (y0, e) ((k', y) :: add x e' l) -> InA eqk (y0, e) ((k', y) :: l)elt:Typex:X.te':eltk':X.ty:eltl:list (X.t * elt)_x:X.eq x k'e0:X.eq_dec x k' = left _xy0:X.te:eltH:~ X.eq x y0H1:eqk (y0, e) (x, e')InA eqk (y0, e) lelt:Typex:X.te':eltk':X.ty:eltl:list (X.t * elt)_x:~ X.eq x k'e0:X.eq_dec x k' = right _xIHt0:forall (y0 : X.t) (e : elt), ~ X.eq x y0 -> InA eqk (y0, e) (add x e' l) -> InA eqk (y0, e) lforall (y0 : X.t) (e : elt), ~ X.eq x y0 -> InA eqk (y0, e) ((k', y) :: add x e' l) -> InA eqk (y0, e) ((k', y) :: l)inversion_clear 2; auto. Qed.elt:Typex:X.te':eltk':X.ty:eltl:list (X.t * elt)_x:~ X.eq x k'e0:X.eq_dec x k' = right _xIHt0:forall (y0 : X.t) (e : elt), ~ X.eq x y0 -> InA eqk (y0, e) (add x e' l) -> InA eqk (y0, e) lforall (y0 : X.t) (e : elt), ~ X.eq x y0 -> InA eqk (y0, e) ((k', y) :: add x e' l) -> InA eqk (y0, e) ((k', y) :: l)elt:Typeforall m : list (X.t * elt), NoDupA m -> forall (x : key) (e : elt), NoDupA (add x e m)elt:Typeforall m : list (X.t * elt), NoDupA m -> forall (x : key) (e : elt), NoDupA (add x e m)elt:TypeNoDupA nil -> forall (x : key) (e : elt), NoDupA (add x e nil)elt:Typea:(X.t * elt)%typem:list (X.t * elt)IHm:NoDupA m -> forall (x : key) (e : elt), NoDupA (add x e m)NoDupA (a :: m) -> forall (x : key) (e : elt), NoDupA (add x e (a :: m))elt:Typea:(X.t * elt)%typem:list (X.t * elt)IHm:NoDupA m -> forall (x : key) (e : elt), NoDupA (add x e m)NoDupA (a :: m) -> forall (x : key) (e : elt), NoDupA (add x e (a :: m))elt:Typea:(X.t * elt)%typem:list (X.t * elt)IHm:NoDupA m -> forall (x0 : key) (e0 : elt), NoDupA (add x0 e0 m)Hm:NoDupA (a :: m)x:keye:eltNoDupA (add x e (a :: m))elt:Typex':X.te':eltm:list (X.t * elt)IHm:NoDupA m -> forall (x0 : key) (e0 : elt), NoDupA (add x0 e0 m)Hm:NoDupA ((x', e') :: m)x:keye:eltNoDupA (add x e ((x', e') :: m))elt:Typex':X.te':eltm:list (X.t * elt)IHm:NoDupA m -> forall (x0 : key) (e0 : elt), NoDupA (add x0 e0 m)x:keye:eltH:~ InA eqk (x', e') mH0:NoDupA mX.eq x x' -> NoDupA ((x, e) :: m)elt:Typex':X.te':eltm:list (X.t * elt)IHm:NoDupA m -> forall (x0 : key) (e0 : elt), NoDupA (add x0 e0 m)x:keye:eltH:~ InA eqk (x', e') mH0:NoDupA m~ X.eq x x' -> NoDupA ((x', e') :: add x e m)elt:Typex':X.te':eltm:list (X.t * elt)IHm:NoDupA m -> forall (x0 : key) (e1 : elt), NoDupA (add x0 e1 m)x:keye:eltH:~ InA eqk (x', e') mH0:NoDupA me0:X.eq x x'~ InA eqk (x, e) melt:Typex':X.te':eltm:list (X.t * elt)IHm:NoDupA m -> forall (x0 : key) (e0 : elt), NoDupA (add x0 e0 m)x:keye:eltH:~ InA eqk (x', e') mH0:NoDupA m~ X.eq x x' -> NoDupA ((x', e') :: add x e m)elt:Typex':X.te':eltm:list (X.t * elt)IHm:NoDupA m -> forall (x0 : key) (e1 : elt), NoDupA (add x0 e1 m)x:keye:eltH0:NoDupA me0:X.eq x x'H:InA eqk (x, e) mInA eqk (x', e') melt:Typex':X.te':eltm:list (X.t * elt)IHm:NoDupA m -> forall (x0 : key) (e0 : elt), NoDupA (add x0 e0 m)x:keye:eltH:~ InA eqk (x', e') mH0:NoDupA m~ X.eq x x' -> NoDupA ((x', e') :: add x e m)elt:Typex':X.te':eltm:list (X.t * elt)IHm:NoDupA m -> forall (x0 : key) (e0 : elt), NoDupA (add x0 e0 m)x:keye:eltH:~ InA eqk (x', e') mH0:NoDupA m~ X.eq x x' -> NoDupA ((x', e') :: add x e m)contradict H; apply add_3' with x e; auto. Qed. (* Not part of the exported specifications, used later for [combine]. *)elt:Typex':X.te':eltm:list (X.t * elt)IHm:NoDupA m -> forall (x0 : key) (e0 : elt), NoDupA (add x0 e0 m)x:keye:eltH:~ InA eqk (x', e') mH0:NoDupA mn:~ X.eq x x'~ InA eqk (x', e') (add x e m)elt:Typeforall m : list (X.t * elt), NoDupA m -> forall (x a : X.t) (e : elt), X.eq x a -> find x (add a e m) = Some eelt:Typeforall m : list (X.t * elt), NoDupA m -> forall (x a : X.t) (e : elt), X.eq x a -> find x (add a e m) = Some eelt:Typem:list (X.t * elt)Hm:NoDupA mx, a:X.te:eltH:X.eq x afind x (add a e m) = Some eelt:Typem:list (X.t * elt)Hm:NoDupA mx, a:X.te:eltH:X.eq x aNoDupA (add a e m)elt:Typem:list (X.t * elt)Hm:NoDupA mx, a:X.te:eltH:X.eq x aMapsTo x e (add a e m)apply add_1; auto. Qed.elt:Typem:list (X.t * elt)Hm:NoDupA mx, a:X.te:eltH:X.eq x aMapsTo x e (add a e m)elt:Typeforall m : list (X.t * elt), NoDupA m -> forall (x a : X.t) (e : elt), ~ X.eq x a -> find x (add a e m) = find x melt:Typeforall m : list (X.t * elt), NoDupA m -> forall (x a : X.t) (e : elt), ~ X.eq x a -> find x (add a e m) = find x melt:Typem:list (X.t * elt)Hm:NoDupA mx, a:X.te:eltH:~ X.eq x afind x (add a e m) = find x melt:Typem:list (X.t * elt)Hm:NoDupA mx, a:X.te:eltH:~ X.eq x ae0:eltH0:find x m = Some e0find x (add a e m) = Some e0elt:Typem:list (X.t * elt)Hm:NoDupA mx, a:X.te:eltH:~ X.eq x aH0:find x m = Nonefind x (add a e m) = Noneelt:Typem:list (X.t * elt)Hm:NoDupA mx, a:X.te:eltH:~ X.eq x ae0:eltH0:find x m = Some e0NoDupA (add a e m)elt:Typem:list (X.t * elt)Hm:NoDupA mx, a:X.te:eltH:~ X.eq x ae0:eltH0:find x m = Some e0MapsTo x e0 (add a e m)elt:Typem:list (X.t * elt)Hm:NoDupA mx, a:X.te:eltH:~ X.eq x aH0:find x m = Nonefind x (add a e m) = Noneelt:Typem:list (X.t * elt)Hm:NoDupA mx, a:X.te:eltH:~ X.eq x ae0:eltH0:find x m = Some e0MapsTo x e0 (add a e m)elt:Typem:list (X.t * elt)Hm:NoDupA mx, a:X.te:eltH:~ X.eq x aH0:find x m = Nonefind x (add a e m) = Noneelt:Typem:list (X.t * elt)Hm:NoDupA mx, a:X.te:eltH:~ X.eq x ae0:eltH0:find x m = Some e0MapsTo x e0 melt:Typem:list (X.t * elt)Hm:NoDupA mx, a:X.te:eltH:~ X.eq x aH0:find x m = Nonefind x (add a e m) = Noneelt:Typem:list (X.t * elt)Hm:NoDupA mx, a:X.te:eltH:~ X.eq x aH0:find x m = Nonefind x (add a e m) = Noneelt:Typem:list (X.t * elt)Hm:NoDupA mx, a:X.te:eltH:~ X.eq x aH0:find x m = Nonee0:eltH1:find x (add a e m) = Some e0Some e0 = Noneelt:Typem:list (X.t * elt)Hm:NoDupA mx, a:X.te:eltH:~ X.eq x aH0:find x m = Nonee0:eltH1:find x (add a e m) = Some e0find x m = Some e0elt:Typem:list (X.t * elt)Hm:NoDupA mx, a:X.te:eltH:~ X.eq x aH0:find x m = Nonee0:eltH1:find x (add a e m) = Some e0MapsTo x e0 mapply find_2; auto. Qed.elt:Typem:list (X.t * elt)Hm:NoDupA mx, a:X.te:eltH:~ X.eq x aH0:find x m = Nonee0:eltH1:find x (add a e m) = Some e0MapsTo x e0 (add a e m)
Function remove (k : key) (s : t elt) {struct s} : t elt := match s with | nil => nil | (k',x) :: l => if X.eq_dec k k' then l else (k',x) :: remove k l end.elt:Typeforall m : list (X.t * elt), NoDupA m -> forall x y : X.t, X.eq x y -> ~ In y (remove x m)elt:Typeforall m : list (X.t * elt), NoDupA m -> forall x y : X.t, X.eq x y -> ~ In y (remove x m)elt:Typem:list (X.t * elt)x, y:X.tNoDupA m -> X.eq x y -> ~ In y (remove x m)elt:Typex, y:X.tHm:NoDupA nilH:X.eq x y~ In y nilelt:Typex, y, k':X.tx0:eltl:list (X.t * elt)_x:X.eq x k'e0:X.eq_dec x k' = left _xHm:NoDupA ((k', x0) :: l)H:X.eq x y~ In y lelt:Typex, y, k':X.tx0:eltl:list (X.t * elt)_x:~ X.eq x k'e0:X.eq_dec x k' = right _xIHt0:NoDupA l -> X.eq x y -> ~ In y (remove x l)Hm:NoDupA ((k', x0) :: l)H:X.eq x y~ In y ((k', x0) :: remove x l)elt:Typex, y, k':X.tx0:eltl:list (X.t * elt)_x:X.eq x k'e0:X.eq_dec x k' = left _xHm:NoDupA ((k', x0) :: l)H:X.eq x y~ In y lelt:Typex, y, k':X.tx0:eltl:list (X.t * elt)_x:~ X.eq x k'e0:X.eq_dec x k' = right _xIHt0:NoDupA l -> X.eq x y -> ~ In y (remove x l)Hm:NoDupA ((k', x0) :: l)H:X.eq x y~ In y ((k', x0) :: remove x l)elt:Typex, y, k':X.tx0:eltl:list (X.t * elt)_x:X.eq x k'e0:X.eq_dec x k' = left _xH:X.eq x yH0:~ InA eqk (k', x0) lH1:NoDupA l~ In y lelt:Typex, y, k':X.tx0:eltl:list (X.t * elt)_x:~ X.eq x k'e0:X.eq_dec x k' = right _xIHt0:NoDupA l -> X.eq x y -> ~ In y (remove x l)Hm:NoDupA ((k', x0) :: l)H:X.eq x y~ In y ((k', x0) :: remove x l)elt:Typex, y, k':X.tx0:eltl:list (X.t * elt)_x:X.eq x k'e0:X.eq_dec x k' = left _xH:X.eq x yH0:~ InA eqk (k', x0) lH1:NoDupA l~ In y lelt:Typex, y, k':X.tx0:eltl:list (X.t * elt)_x:~ X.eq x k'e0:X.eq_dec x k' = right _xIHt0:NoDupA l -> X.eq x y -> ~ In y (remove x l)Hm:NoDupA ((k', x0) :: l)H:X.eq x y~ In y ((k', x0) :: remove x l)elt:Typex, y, k':X.tx0:eltl:list (X.t * elt)_x:X.eq x k'e0:X.eq_dec x k' = left _xH:X.eq x yH1:NoDupA lH0:In y lInA eqk (k', x0) lelt:Typex, y, k':X.tx0:eltl:list (X.t * elt)_x:~ X.eq x k'e0:X.eq_dec x k' = right _xIHt0:NoDupA l -> X.eq x y -> ~ In y (remove x l)Hm:NoDupA ((k', x0) :: l)H:X.eq x y~ In y ((k', x0) :: remove x l)elt:Typex, y, k':X.tx0:eltl:list (X.t * elt)_x:X.eq x k'e0:X.eq_dec x k' = left _xH:X.eq x yH1:NoDupA le:eltH2:InA eqke (y, e) lInA eqk (k', x0) lelt:Typex, y, k':X.tx0:eltl:list (X.t * elt)_x:~ X.eq x k'e0:X.eq_dec x k' = right _xIHt0:NoDupA l -> X.eq x y -> ~ In y (remove x l)Hm:NoDupA ((k', x0) :: l)H:X.eq x y~ In y ((k', x0) :: remove x l)elt:Typex, y, k':X.tx0:eltl:list (X.t * elt)_x:X.eq x k'e0:X.eq_dec x k' = left _xH:X.eq x yH1:NoDupA le:eltH2:InA eqke (y, e) leqk (y, e) (k', x0)elt:Typex, y, k':X.tx0:eltl:list (X.t * elt)_x:~ X.eq x k'e0:X.eq_dec x k' = right _xIHt0:NoDupA l -> X.eq x y -> ~ In y (remove x l)Hm:NoDupA ((k', x0) :: l)H:X.eq x y~ In y ((k', x0) :: remove x l)elt:Typex, y, k':X.tx0:eltl:list (X.t * elt)_x:~ X.eq x k'e0:X.eq_dec x k' = right _xIHt0:NoDupA l -> X.eq x y -> ~ In y (remove x l)Hm:NoDupA ((k', x0) :: l)H:X.eq x y~ In y ((k', x0) :: remove x l)elt:Typex, y, k':X.tx0:eltl:list (X.t * elt)_x:~ X.eq x k'e0:X.eq_dec x k' = right _xIHt0:NoDupA l -> X.eq x y -> ~ In y (remove x l)Hm:NoDupA ((k', x0) :: l)H:X.eq x yH2:In y ((k', x0) :: remove x l)Falseelt:Typex, y, k':X.tx0:eltl:list (X.t * elt)_x:~ X.eq x k'e0:X.eq_dec x k' = right _xIHt0:NoDupA l -> X.eq x y -> ~ In y (remove x l)Hm:NoDupA ((k', x0) :: l)H:X.eq x ye:eltH0:eqke (y, e) (k', x0)Falseelt:Typex, y, k':X.tx0:eltl:list (X.t * elt)_x:~ X.eq x k'e0:X.eq_dec x k' = right _xIHt0:NoDupA l -> X.eq x y -> ~ In y (remove x l)Hm:NoDupA ((k', x0) :: l)H:X.eq x ye:eltH0:InA eqke (y, e) (remove x l)Falseelt:Typex, y, k':X.tx0:eltl:list (X.t * elt)_x:~ X.eq x k'e0:X.eq_dec x k' = right _xIHt0:NoDupA l -> X.eq x y -> ~ In y (remove x l)Hm:NoDupA ((k', x0) :: l)H:X.eq x ye:eltH0:X.eq y k'H1:e = x0Falseelt:Typex, y, k':X.tx0:eltl:list (X.t * elt)_x:~ X.eq x k'e0:X.eq_dec x k' = right _xIHt0:NoDupA l -> X.eq x y -> ~ In y (remove x l)Hm:NoDupA ((k', x0) :: l)H:X.eq x ye:eltH0:InA eqke (y, e) (remove x l)Falseelt:Typex, y, k':X.tx0:eltl:list (X.t * elt)_x:~ X.eq x k'e0:X.eq_dec x k' = right _xIHt0:NoDupA l -> X.eq x y -> ~ In y (remove x l)Hm:NoDupA ((k', x0) :: l)H:X.eq x ye:eltH0:InA eqke (y, e) (remove x l)Falseelt:Typex, y, k':X.tx0:eltl:list (X.t * elt)_x:~ X.eq x k'e0:X.eq_dec x k' = right _xIHt0:NoDupA l -> X.eq x y -> ~ In y (remove x l)H:X.eq x ye:eltH0:InA eqke (y, e) (remove x l)H1:~ InA eqk (k', x0) lH2:NoDupA lFalseexists e; auto. Qed.elt:Typex, y, k':X.tx0:eltl:list (X.t * elt)_x:~ X.eq x k'e0:X.eq_dec x k' = right _xIHt0:NoDupA l -> X.eq x y -> ~ In y (remove x l)H:X.eq x ye:eltH0:InA eqke (y, e) (remove x l)H1:~ InA eqk (k', x0) lH2:NoDupA lIn y (remove x l)elt:Typeforall m : list (X.t * elt), NoDupA m -> forall (x y : X.t) (e : elt), ~ X.eq x y -> MapsTo y e m -> MapsTo y e (remove x m)elt:Typeforall m : list (X.t * elt), NoDupA m -> forall (x y : X.t) (e : elt), ~ X.eq x y -> MapsTo y e m -> MapsTo y e (remove x m)elt:Typem:list (X.t * elt)x, y:X.te:eltNoDupA m -> ~ X.eq x y -> InA eqke (y, e) m -> InA eqke (y, e) (remove x m)elt:Typex, y:X.te:eltk':X.tx0:eltl:list (X.t * elt)_x:X.eq x k'e1:X.eq_dec x k' = left _xNoDupA ((k', x0) :: l) -> ~ X.eq x y -> InA eqke (y, e) ((k', x0) :: l) -> InA eqke (y, e) lelt:Typex, y:X.te:eltk':X.tx0:eltl:list (X.t * elt)_x:~ X.eq x k'e1:X.eq_dec x k' = right _xIHt0:NoDupA l -> ~ X.eq x y -> InA eqke (y, e) l -> InA eqke (y, e) (remove x l)NoDupA ((k', x0) :: l) -> ~ X.eq x y -> InA eqke (y, e) ((k', x0) :: l) -> InA eqke (y, e) ((k', x0) :: remove x l)elt:Typex, y:X.te:eltk':X.tx0:eltl:list (X.t * elt)_x:X.eq x k'e1:X.eq_dec x k' = left _xHm:NoDupA ((k', x0) :: l)H:~ X.eq x yH1:eqke (y, e) (k', x0)InA eqke (y, e) lelt:Typex, y:X.te:eltk':X.tx0:eltl:list (X.t * elt)_x:~ X.eq x k'e1:X.eq_dec x k' = right _xIHt0:NoDupA l -> ~ X.eq x y -> InA eqke (y, e) l -> InA eqke (y, e) (remove x l)NoDupA ((k', x0) :: l) -> ~ X.eq x y -> InA eqke (y, e) ((k', x0) :: l) -> InA eqke (y, e) ((k', x0) :: remove x l)elt:Typex, y:X.te:eltk':X.tx0:eltl:list (X.t * elt)_x:X.eq x k'e1:X.eq_dec x k' = left _xHm:NoDupA ((k', x0) :: l)H:~ X.eq x yH0:X.eq y k'H1:e = x0InA eqke (y, e) lelt:Typex, y:X.te:eltk':X.tx0:eltl:list (X.t * elt)_x:~ X.eq x k'e1:X.eq_dec x k' = right _xIHt0:NoDupA l -> ~ X.eq x y -> InA eqke (y, e) l -> InA eqke (y, e) (remove x l)NoDupA ((k', x0) :: l) -> ~ X.eq x y -> InA eqke (y, e) ((k', x0) :: l) -> InA eqke (y, e) ((k', x0) :: remove x l)inversion_clear 1; inversion_clear 2; auto. Qed.elt:Typex, y:X.te:eltk':X.tx0:eltl:list (X.t * elt)_x:~ X.eq x k'e1:X.eq_dec x k' = right _xIHt0:NoDupA l -> ~ X.eq x y -> InA eqke (y, e) l -> InA eqke (y, e) (remove x l)NoDupA ((k', x0) :: l) -> ~ X.eq x y -> InA eqke (y, e) ((k', x0) :: l) -> InA eqke (y, e) ((k', x0) :: remove x l)elt:Typeforall m : list (X.t * elt), NoDupA m -> forall (x : key) (y : X.t) (e : elt), MapsTo y e (remove x m) -> MapsTo y e melt:Typeforall m : list (X.t * elt), NoDupA m -> forall (x : key) (y : X.t) (e : elt), MapsTo y e (remove x m) -> MapsTo y e melt:Typem:list (X.t * elt)x:keyy:X.te:eltNoDupA m -> InA eqke (y, e) (remove x m) -> InA eqke (y, e) mdo 2 inversion_clear 1; auto. Qed.elt:Typex:keyy:X.te:eltk':X.tx0:eltl:list (X.t * elt)_x:~ X.eq x k'e1:X.eq_dec x k' = right _xIHt0:NoDupA l -> InA eqke (y, e) (remove x l) -> InA eqke (y, e) lNoDupA ((k', x0) :: l) -> InA eqke (y, e) ((k', x0) :: remove x l) -> InA eqke (y, e) ((k', x0) :: l)elt:Typeforall m : list (X.t * elt), NoDupA m -> forall (x : key) (y : X.t) (e : elt), InA eqk (y, e) (remove x m) -> InA eqk (y, e) melt:Typeforall m : list (X.t * elt), NoDupA m -> forall (x : key) (y : X.t) (e : elt), InA eqk (y, e) (remove x m) -> InA eqk (y, e) melt:Typem:list (X.t * elt)x:keyy:X.te:eltNoDupA m -> InA eqk (y, e) (remove x m) -> InA eqk (y, e) mdo 2 inversion_clear 1; auto. Qed.elt:Typex:keyy:X.te:eltk':X.tx0:eltl:list (X.t * elt)_x:~ X.eq x k'e1:X.eq_dec x k' = right _xIHt0:NoDupA l -> InA eqk (y, e) (remove x l) -> InA eqk (y, e) lNoDupA ((k', x0) :: l) -> InA eqk (y, e) ((k', x0) :: remove x l) -> InA eqk (y, e) ((k', x0) :: l)elt:Typeforall m : list (X.t * elt), NoDupA m -> forall x : key, NoDupA (remove x m)elt:Typeforall m : list (X.t * elt), NoDupA m -> forall x : key, NoDupA (remove x m)elt:TypeNoDupA nil -> forall x : key, NoDupA (remove x nil)elt:Typea:(X.t * elt)%typem:list (X.t * elt)IHm:NoDupA m -> forall x : key, NoDupA (remove x m)NoDupA (a :: m) -> forall x : key, NoDupA (remove x (a :: m))elt:Typea:(X.t * elt)%typem:list (X.t * elt)IHm:NoDupA m -> forall x : key, NoDupA (remove x m)NoDupA (a :: m) -> forall x : key, NoDupA (remove x (a :: m))elt:Typea:(X.t * elt)%typem:list (X.t * elt)IHm:NoDupA m -> forall x0 : key, NoDupA (remove x0 m)Hm:NoDupA (a :: m)x:keyNoDupA (remove x (a :: m))elt:Typea:(X.t * elt)%typem:list (X.t * elt)IHm:NoDupA m -> forall x0 : key, NoDupA (remove x0 m)x:keyH:~ InA eqk a mH0:NoDupA mNoDupA (remove x (a :: m))elt:Typex':X.te':eltm:list (X.t * elt)IHm:NoDupA m -> forall x0 : key, NoDupA (remove x0 m)x:keyH:~ InA eqk (x', e') mH0:NoDupA mNoDupA (remove x ((x', e') :: m))elt:Typex':X.te':eltm:list (X.t * elt)IHm:NoDupA m -> forall x0 : key, NoDupA (remove x0 m)x:keyH:~ InA eqk (x', e') mH0:NoDupA m~ X.eq x x' -> NoDupA ((x', e') :: remove x m)contradict H; apply remove_3' with x; auto. Qed.elt:Typex':X.te':eltm:list (X.t * elt)IHm:NoDupA m -> forall x0 : key, NoDupA (remove x0 m)x:keyH:~ InA eqk (x', e') mH0:NoDupA mn:~ X.eq x x'~ InA eqk (x', e') (remove x m)
Definition elements (m: t elt) := m.elt:Typeforall (m : list (X.t * elt)) (x : X.t) (e : elt), MapsTo x e m -> InA eqke (x, e) (elements m)auto. Qed.elt:Typeforall (m : list (X.t * elt)) (x : X.t) (e : elt), MapsTo x e m -> InA eqke (x, e) (elements m)elt:Typeforall (m : t elt) (x : X.t) (e : elt), InA eqke (x, e) (elements m) -> MapsTo x e mauto. Qed.elt:Typeforall (m : t elt) (x : X.t) (e : elt), InA eqke (x, e) (elements m) -> MapsTo x e melt:Typeforall m : list (X.t * elt), NoDupA m -> NoDupA (elements m)auto. Qed.elt:Typeforall m : list (X.t * elt), NoDupA m -> NoDupA (elements m)
Function fold (A:Type)(f:key->elt->A->A)(m:t elt) (acc : A) {struct m} : A := match m with | nil => acc | (k,e)::m' => fold f m' (f k e acc) end.elt:Typeforall (m : t elt) (A : Type) (i : A) (f : key -> elt -> A -> A), fold f m i = fold_left (fun (a : A) (p : key * elt) => f (fst p) (snd p) a) (elements m) iintros; functional induction (@fold A f m i); auto. Qed.elt:Typeforall (m : t elt) (A : Type) (i : A) (f : key -> elt -> A -> A), fold f m i = fold_left (fun (a : A) (p : key * elt) => f (fst p) (snd p) a) (elements m) i
Definition check (cmp : elt -> elt -> bool)(k:key)(e:elt)(m': t elt) := match find k m' with | None => false | Some e' => cmp e e' end. Definition submap (cmp : elt -> elt -> bool)(m m' : t elt) : bool := fold (fun k e b => andb (check cmp k e m') b) m true. Definition equal (cmp : elt -> elt -> bool)(m m' : t elt) : bool := andb (submap cmp m m') (submap (fun e' e => cmp e e') m' m). Definition Submap cmp m m' := (forall k, In k m -> In k m') /\ (forall k e e', MapsTo k e m -> MapsTo k e' m' -> cmp e e' = true). Definition Equivb cmp m m' := (forall k, In k m <-> In k m') /\ (forall k e e', MapsTo k e m -> MapsTo k e' m' -> cmp e e' = true).elt:Typeforall m : list (X.t * elt), NoDupA m -> forall m' : list (X.t * elt), NoDupA m' -> forall cmp : elt -> elt -> bool, Submap cmp m m' -> submap cmp m m' = trueelt:Typeforall m : list (X.t * elt), NoDupA m -> forall m' : list (X.t * elt), NoDupA m' -> forall cmp : elt -> elt -> bool, Submap cmp m m' -> submap cmp m m' = trueelt:Typeforall m : list (X.t * elt), NoDupA m -> forall m' : list (X.t * elt), NoDupA m' -> forall cmp : elt -> elt -> bool, (forall k : X.t, In k m -> In k m') /\ (forall (k : X.t) (e e' : elt), MapsTo k e m -> MapsTo k e' m' -> cmp e e' = true) -> fold (fun (k : key) (e : elt) (b : bool) => check cmp k e m' && b) m true = trueelt:TypeNoDupA nil -> forall m' : list (X.t * elt), NoDupA m' -> forall cmp : elt -> elt -> bool, (forall k : X.t, In k nil -> In k m') /\ (forall (k : X.t) (e e' : elt), MapsTo k e nil -> MapsTo k e' m' -> cmp e e' = true) -> fold (fun (k : key) (e : elt) (b : bool) => check cmp k e m' && b) nil true = trueelt:Typea:(X.t * elt)%typem:list (X.t * elt)IHm:NoDupA m -> forall m' : list (X.t * elt), NoDupA m' -> forall cmp : elt -> elt -> bool, (forall k : X.t, In k m -> In k m') /\ (forall (k : X.t) (e e' : elt), MapsTo k e m -> MapsTo k e' m' -> cmp e e' = true) -> fold (fun (k : key) (e : elt) (b : bool) => check cmp k e m' && b) m true = trueNoDupA (a :: m) -> forall m' : list (X.t * elt), NoDupA m' -> forall cmp : elt -> elt -> bool, (forall k : X.t, In k (a :: m) -> In k m') /\ (forall (k : X.t) (e e' : elt), MapsTo k e (a :: m) -> MapsTo k e' m' -> cmp e e' = true) -> fold (fun (k : key) (e : elt) (b : bool) => check cmp k e m' && b) (a :: m) true = trueelt:Typea:(X.t * elt)%typem:list (X.t * elt)IHm:NoDupA m -> forall m' : list (X.t * elt), NoDupA m' -> forall cmp : elt -> elt -> bool, (forall k : X.t, In k m -> In k m') /\ (forall (k : X.t) (e e' : elt), MapsTo k e m -> MapsTo k e' m' -> cmp e e' = true) -> fold (fun (k : key) (e : elt) (b : bool) => check cmp k e m' && b) m true = trueNoDupA (a :: m) -> forall m' : list (X.t * elt), NoDupA m' -> forall cmp : elt -> elt -> bool, (forall k : X.t, In k (a :: m) -> In k m') /\ (forall (k : X.t) (e e' : elt), MapsTo k e (a :: m) -> MapsTo k e' m' -> cmp e e' = true) -> fold (fun (k : key) (e : elt) (b : bool) => check cmp k e m' && b) (a :: m) true = trueelt:Typet0:X.te:eltm:list (X.t * elt)IHm:NoDupA m -> forall m'0 : list (X.t * elt), NoDupA m'0 -> forall cmp0 : elt -> elt -> bool, (forall k : X.t, In k m -> In k m'0) /\ (forall (k : X.t) (e0 e' : elt), MapsTo k e0 m -> MapsTo k e' m'0 -> cmp0 e0 e' = true) -> fold (fun (k : key) (e0 : elt) (b : bool) => check cmp0 k e0 m'0 && b) m true = trueHm:NoDupA ((t0, e) :: m)m':list (X.t * elt)Hm':NoDupA m'cmp:elt -> elt -> boolH:(forall k : X.t, In k ((t0, e) :: m) -> In k m') /\ (forall (k : X.t) (e0 e' : elt), MapsTo k e0 ((t0, e) :: m) -> MapsTo k e' m' -> cmp e0 e' = true)fold (fun (k : key) (e0 : elt) (b : bool) => check cmp k e0 m' && b) m (check cmp t0 e m' && true) = trueelt:Typet0:X.te:eltm:list (X.t * elt)IHm:NoDupA m -> forall m'0 : list (X.t * elt), NoDupA m'0 -> forall cmp0 : elt -> elt -> bool, (forall k : X.t, In k m -> In k m'0) /\ (forall (k : X.t) (e0 e' : elt), MapsTo k e0 m -> MapsTo k e' m'0 -> cmp0 e0 e' = true) -> fold (fun (k : key) (e0 : elt) (b : bool) => check cmp0 k e0 m'0 && b) m true = trueHm:NoDupA ((t0, e) :: m)m':list (X.t * elt)Hm':NoDupA m'cmp:elt -> elt -> boolH:forall k : X.t, In k ((t0, e) :: m) -> In k m'H0:forall (k : X.t) (e0 e' : elt), MapsTo k e0 ((t0, e) :: m) -> MapsTo k e' m' -> cmp e0 e' = truefold (fun (k : key) (e0 : elt) (b : bool) => check cmp k e0 m' && b) m (check cmp t0 e m' && true) = trueelt:Typet0:X.te:eltm:list (X.t * elt)IHm:NoDupA m -> forall m'0 : list (X.t * elt), NoDupA m'0 -> forall cmp0 : elt -> elt -> bool, (forall k : X.t, In k m -> In k m'0) /\ (forall (k : X.t) (e0 e' : elt), MapsTo k e0 m -> MapsTo k e' m'0 -> cmp0 e0 e' = true) -> fold (fun (k : key) (e0 : elt) (b : bool) => check cmp0 k e0 m'0 && b) m true = truem':list (X.t * elt)Hm':NoDupA m'cmp:elt -> elt -> boolH:forall k : X.t, In k ((t0, e) :: m) -> In k m'H0:forall (k : X.t) (e0 e' : elt), MapsTo k e0 ((t0, e) :: m) -> MapsTo k e' m' -> cmp e0 e' = trueH1:~ InA eqk (t0, e) mH2:NoDupA mfold (fun (k : key) (e0 : elt) (b : bool) => check cmp k e0 m' && b) m (check cmp t0 e m' && true) = trueelt:Typet0:X.te:eltm:list (X.t * elt)IHm:NoDupA m -> forall m'0 : list (X.t * elt), NoDupA m'0 -> forall cmp0 : elt -> elt -> bool, (forall k : X.t, In k m -> In k m'0) /\ (forall (k : X.t) (e0 e' : elt), MapsTo k e0 m -> MapsTo k e' m'0 -> cmp0 e0 e' = true) -> fold (fun (k : key) (e0 : elt) (b : bool) => check cmp0 k e0 m'0 && b) m true = truem':list (X.t * elt)Hm':NoDupA m'cmp:elt -> elt -> boolH:forall k : X.t, In k ((t0, e) :: m) -> In k m'H0:forall (k : X.t) (e0 e' : elt), MapsTo k e0 ((t0, e) :: m) -> MapsTo k e' m' -> cmp e0 e' = trueH1:~ InA eqk (t0, e) mH2:NoDupA mIn t0 m'elt:Typet0:X.te:eltm:list (X.t * elt)IHm:NoDupA m -> forall m'0 : list (X.t * elt), NoDupA m'0 -> forall cmp0 : elt -> elt -> bool, (forall k : X.t, In k m -> In k m'0) /\ (forall (k : X.t) (e0 e' : elt), MapsTo k e0 m -> MapsTo k e' m'0 -> cmp0 e0 e' = true) -> fold (fun (k : key) (e0 : elt) (b : bool) => check cmp0 k e0 m'0 && b) m true = truem':list (X.t * elt)Hm':NoDupA m'cmp:elt -> elt -> boolH:forall k : X.t, In k ((t0, e) :: m) -> In k m'H0:forall (k : X.t) (e0 e' : elt), MapsTo k e0 ((t0, e) :: m) -> MapsTo k e' m' -> cmp e0 e' = trueH1:~ InA eqk (t0, e) mH2:NoDupA mH3:In t0 m'fold (fun (k : key) (e0 : elt) (b : bool) => check cmp k e0 m' && b) m (check cmp t0 e m' && true) = trueelt:Typet0:X.te:eltm:list (X.t * elt)IHm:NoDupA m -> forall m'0 : list (X.t * elt), NoDupA m'0 -> forall cmp0 : elt -> elt -> bool, (forall k : X.t, In k m -> In k m'0) /\ (forall (k : X.t) (e0 e' : elt), MapsTo k e0 m -> MapsTo k e' m'0 -> cmp0 e0 e' = true) -> fold (fun (k : key) (e0 : elt) (b : bool) => check cmp0 k e0 m'0 && b) m true = truem':list (X.t * elt)Hm':NoDupA m'cmp:elt -> elt -> boolH:forall k : X.t, In k ((t0, e) :: m) -> In k m'H0:forall (k : X.t) (e0 e' : elt), MapsTo k e0 ((t0, e) :: m) -> MapsTo k e' m' -> cmp e0 e' = trueH1:~ InA eqk (t0, e) mH2:NoDupA mH3:In t0 m'fold (fun (k : key) (e0 : elt) (b : bool) => check cmp k e0 m' && b) m (check cmp t0 e m' && true) = trueelt:Typet0:X.te:eltm:list (X.t * elt)IHm:NoDupA m -> forall m'0 : list (X.t * elt), NoDupA m'0 -> forall cmp0 : elt -> elt -> bool, (forall k : X.t, In k m -> In k m'0) /\ (forall (k : X.t) (e0 e'0 : elt), MapsTo k e0 m -> MapsTo k e'0 m'0 -> cmp0 e0 e'0 = true) -> fold (fun (k : key) (e0 : elt) (b : bool) => check cmp0 k e0 m'0 && b) m true = truem':list (X.t * elt)Hm':NoDupA m'cmp:elt -> elt -> boolH:forall k : X.t, In k ((t0, e) :: m) -> In k m'H0:forall (k : X.t) (e0 e'0 : elt), MapsTo k e0 ((t0, e) :: m) -> MapsTo k e'0 m' -> cmp e0 e'0 = trueH1:~ InA eqk (t0, e) mH2:NoDupA me':eltH3:MapsTo t0 e' m'fold (fun (k : key) (e0 : elt) (b : bool) => check cmp k e0 m' && b) m (check cmp t0 e m' && true) = trueelt:Typet0:X.te:eltm:list (X.t * elt)IHm:NoDupA m -> forall m'0 : list (X.t * elt), NoDupA m'0 -> forall cmp0 : elt -> elt -> bool, (forall k : X.t, In k m -> In k m'0) /\ (forall (k : X.t) (e0 e'0 : elt), MapsTo k e0 m -> MapsTo k e'0 m'0 -> cmp0 e0 e'0 = true) -> fold (fun (k : key) (e0 : elt) (b : bool) => check cmp0 k e0 m'0 && b) m true = truem':list (X.t * elt)Hm':NoDupA m'cmp:elt -> elt -> boolH:forall k : X.t, In k ((t0, e) :: m) -> In k m'H0:forall (k : X.t) (e0 e'0 : elt), MapsTo k e0 ((t0, e) :: m) -> MapsTo k e'0 m' -> cmp e0 e'0 = trueH1:~ InA eqk (t0, e) mH2:NoDupA me':eltH3:MapsTo t0 e' m'fold (fun (k : key) (e0 : elt) (b : bool) => check cmp k e0 m' && b) m (cmp e e' && true) = trueelt:Typet0:X.te:eltm:list (X.t * elt)IHm:NoDupA m -> forall m'0 : list (X.t * elt), NoDupA m'0 -> forall cmp0 : elt -> elt -> bool, (forall k : X.t, In k m -> In k m'0) /\ (forall (k : X.t) (e0 e'0 : elt), MapsTo k e0 m -> MapsTo k e'0 m'0 -> cmp0 e0 e'0 = true) -> fold (fun (k : key) (e0 : elt) (b : bool) => check cmp0 k e0 m'0 && b) m true = truem':list (X.t * elt)Hm':NoDupA m'cmp:elt -> elt -> boolH:forall k : X.t, In k ((t0, e) :: m) -> In k m'H0:forall (k : X.t) (e0 e'0 : elt), MapsTo k e0 ((t0, e) :: m) -> MapsTo k e'0 m' -> cmp e0 e'0 = trueH1:~ InA eqk (t0, e) mH2:NoDupA me':eltH3:MapsTo t0 e' m'fold (fun (k : key) (e0 : elt) (b : bool) => check cmp k e0 m' && b) m true = trueelt:Typet0:X.te:eltm:list (X.t * elt)IHm:NoDupA m -> forall m'0 : list (X.t * elt), NoDupA m'0 -> forall cmp0 : elt -> elt -> bool, (forall k : X.t, In k m -> In k m'0) /\ (forall (k : X.t) (e0 e'0 : elt), MapsTo k e0 m -> MapsTo k e'0 m'0 -> cmp0 e0 e'0 = true) -> fold (fun (k : key) (e0 : elt) (b : bool) => check cmp0 k e0 m'0 && b) m true = truem':list (X.t * elt)Hm':NoDupA m'cmp:elt -> elt -> boolH:forall k : X.t, In k ((t0, e) :: m) -> In k m'H0:forall (k : X.t) (e0 e'0 : elt), MapsTo k e0 ((t0, e) :: m) -> MapsTo k e'0 m' -> cmp e0 e'0 = trueH1:~ InA eqk (t0, e) mH2:NoDupA me':eltH3:MapsTo t0 e' m'(forall k : X.t, In k m -> In k m') /\ (forall (k : X.t) (e0 e'0 : elt), MapsTo k e0 m -> MapsTo k e'0 m' -> cmp e0 e'0 = true)elt:Typet0:X.te:eltm, m':list (X.t * elt)Hm':NoDupA m'cmp:elt -> elt -> boolH:forall k0 : X.t, In k0 ((t0, e) :: m) -> In k0 m'H0:forall (k0 : X.t) (e0 e'0 : elt), MapsTo k0 e0 ((t0, e) :: m) -> MapsTo k0 e'0 m' -> cmp e0 e'0 = trueH1:InA eqk (t0, e) m -> FalseH2:NoDupA me':eltH3:MapsTo t0 e' m'H4:forall m'0 : list (X.t * elt), NoDupA m'0 -> forall cmp0 : elt -> elt -> bool, (forall k0 : X.t, In k0 m -> In k0 m'0) /\ (forall (k0 : X.t) (e0 e'0 : elt), MapsTo k0 e0 m -> MapsTo k0 e'0 m'0 -> cmp0 e0 e'0 = true) -> fold (fun (k0 : key) (e0 : elt) (b : bool) => check cmp0 k0 e0 m'0 && b) m true = truek:X.tH5:In k mIn k m'elt:Typet0:X.te:eltm, m':list (X.t * elt)Hm':NoDupA m'cmp:elt -> elt -> boolH:forall k0 : X.t, In k0 ((t0, e) :: m) -> In k0 m'H0:forall (k0 : X.t) (e1 e'1 : elt), MapsTo k0 e1 ((t0, e) :: m) -> MapsTo k0 e'1 m' -> cmp e1 e'1 = trueH1:InA eqk (t0, e) m -> FalseH2:NoDupA me':eltH3:MapsTo t0 e' m'H4:forall m'0 : list (X.t * elt), NoDupA m'0 -> forall cmp0 : elt -> elt -> bool, (forall k0 : X.t, In k0 m -> In k0 m'0) /\ (forall (k0 : X.t) (e1 e'1 : elt), MapsTo k0 e1 m -> MapsTo k0 e'1 m'0 -> cmp0 e1 e'1 = true) -> fold (fun (k0 : key) (e1 : elt) (b : bool) => check cmp0 k0 e1 m'0 && b) m true = truek:X.te0, e'0:eltH5:MapsTo k e0 mH6:MapsTo k e'0 m'cmp e0 e'0 = trueelt:Typet0:X.te:eltm, m':list (X.t * elt)Hm':NoDupA m'cmp:elt -> elt -> boolH:forall k0 : X.t, In k0 ((t0, e) :: m) -> In k0 m'H0:forall (k0 : X.t) (e0 e'0 : elt), MapsTo k0 e0 ((t0, e) :: m) -> MapsTo k0 e'0 m' -> cmp e0 e'0 = trueH1:InA eqk (t0, e) m -> FalseH2:NoDupA me':eltH3:MapsTo t0 e' m'H4:forall m'0 : list (X.t * elt), NoDupA m'0 -> forall cmp0 : elt -> elt -> bool, (forall k0 : X.t, In k0 m -> In k0 m'0) /\ (forall (k0 : X.t) (e0 e'0 : elt), MapsTo k0 e0 m -> MapsTo k0 e'0 m'0 -> cmp0 e0 e'0 = true) -> fold (fun (k0 : key) (e0 : elt) (b : bool) => check cmp0 k0 e0 m'0 && b) m true = truek:X.tH5:In k mIn k ((t0, e) :: m)elt:Typet0:X.te:eltm, m':list (X.t * elt)Hm':NoDupA m'cmp:elt -> elt -> boolH:forall k0 : X.t, In k0 ((t0, e) :: m) -> In k0 m'H0:forall (k0 : X.t) (e1 e'1 : elt), MapsTo k0 e1 ((t0, e) :: m) -> MapsTo k0 e'1 m' -> cmp e1 e'1 = trueH1:InA eqk (t0, e) m -> FalseH2:NoDupA me':eltH3:MapsTo t0 e' m'H4:forall m'0 : list (X.t * elt), NoDupA m'0 -> forall cmp0 : elt -> elt -> bool, (forall k0 : X.t, In k0 m -> In k0 m'0) /\ (forall (k0 : X.t) (e1 e'1 : elt), MapsTo k0 e1 m -> MapsTo k0 e'1 m'0 -> cmp0 e1 e'1 = true) -> fold (fun (k0 : key) (e1 : elt) (b : bool) => check cmp0 k0 e1 m'0 && b) m true = truek:X.te0, e'0:eltH5:MapsTo k e0 mH6:MapsTo k e'0 m'cmp e0 e'0 = trueapply H0 with k; auto. Qed.elt:Typet0:X.te:eltm, m':list (X.t * elt)Hm':NoDupA m'cmp:elt -> elt -> boolH:forall k0 : X.t, In k0 ((t0, e) :: m) -> In k0 m'H0:forall (k0 : X.t) (e1 e'1 : elt), MapsTo k0 e1 ((t0, e) :: m) -> MapsTo k0 e'1 m' -> cmp e1 e'1 = trueH1:InA eqk (t0, e) m -> FalseH2:NoDupA me':eltH3:MapsTo t0 e' m'H4:forall m'0 : list (X.t * elt), NoDupA m'0 -> forall cmp0 : elt -> elt -> bool, (forall k0 : X.t, In k0 m -> In k0 m'0) /\ (forall (k0 : X.t) (e1 e'1 : elt), MapsTo k0 e1 m -> MapsTo k0 e'1 m'0 -> cmp0 e1 e'1 = true) -> fold (fun (k0 : key) (e1 : elt) (b : bool) => check cmp0 k0 e1 m'0 && b) m true = truek:X.te0, e'0:eltH5:MapsTo k e0 mH6:MapsTo k e'0 m'cmp e0 e'0 = trueelt:Typeforall m : list (X.t * elt), NoDupA m -> forall m' : list (X.t * elt), NoDupA m' -> forall cmp : elt -> elt -> bool, submap cmp m m' = true -> Submap cmp m m'elt:Typeforall m : list (X.t * elt), NoDupA m -> forall m' : list (X.t * elt), NoDupA m' -> forall cmp : elt -> elt -> bool, submap cmp m m' = true -> Submap cmp m m'elt:Typeforall m : list (X.t * elt), NoDupA m -> forall m' : list (X.t * elt), NoDupA m' -> forall cmp : elt -> elt -> bool, fold (fun (k : key) (e : elt) (b : bool) => check cmp k e m' && b) m true = true -> (forall k : X.t, In k m -> In k m') /\ (forall (k : X.t) (e e' : elt), MapsTo k e m -> MapsTo k e' m' -> cmp e e' = true)elt:TypeNoDupA nil -> forall m' : list (X.t * elt), NoDupA m' -> forall cmp : elt -> elt -> bool, fold (fun (k : key) (e : elt) (b : bool) => check cmp k e m' && b) nil true = true -> (forall k : X.t, In k nil -> In k m') /\ (forall (k : X.t) (e e' : elt), MapsTo k e nil -> MapsTo k e' m' -> cmp e e' = true)elt:Typea:(X.t * elt)%typem:list (X.t * elt)IHm:NoDupA m -> forall m' : list (X.t * elt), NoDupA m' -> forall cmp : elt -> elt -> bool, fold (fun (k : key) (e : elt) (b : bool) => check cmp k e m' && b) m true = true -> (forall k : X.t, In k m -> In k m') /\ (forall (k : X.t) (e e' : elt), MapsTo k e m -> MapsTo k e' m' -> cmp e e' = true)NoDupA (a :: m) -> forall m' : list (X.t * elt), NoDupA m' -> forall cmp : elt -> elt -> bool, fold (fun (k : key) (e : elt) (b : bool) => check cmp k e m' && b) (a :: m) true = true -> (forall k : X.t, In k (a :: m) -> In k m') /\ (forall (k : X.t) (e e' : elt), MapsTo k e (a :: m) -> MapsTo k e' m' -> cmp e e' = true)elt:TypeNoDupA nil -> forall m' : list (X.t * elt), NoDupA m' -> forall cmp : elt -> elt -> bool, true = true -> (forall k : X.t, In k nil -> In k m') /\ (forall (k : X.t) (e e' : elt), MapsTo k e nil -> MapsTo k e' m' -> cmp e e' = true)elt:Typea:(X.t * elt)%typem:list (X.t * elt)IHm:NoDupA m -> forall m' : list (X.t * elt), NoDupA m' -> forall cmp : elt -> elt -> bool, fold (fun (k : key) (e : elt) (b : bool) => check cmp k e m' && b) m true = true -> (forall k : X.t, In k m -> In k m') /\ (forall (k : X.t) (e e' : elt), MapsTo k e m -> MapsTo k e' m' -> cmp e e' = true)NoDupA (a :: m) -> forall m' : list (X.t * elt), NoDupA m' -> forall cmp : elt -> elt -> bool, fold (fun (k : key) (e : elt) (b : bool) => check cmp k e m' && b) (a :: m) true = true -> (forall k : X.t, In k (a :: m) -> In k m') /\ (forall (k : X.t) (e e' : elt), MapsTo k e (a :: m) -> MapsTo k e' m' -> cmp e e' = true)elt:TypeHm:NoDupA nilm':list (X.t * elt)Hm':NoDupA m'cmp:elt -> elt -> boolH:true = truek:X.tH0:In k nilIn k m'elt:TypeHm:NoDupA nilm':list (X.t * elt)Hm':NoDupA m'cmp:elt -> elt -> boolH:true = truek:X.te, e':eltH0:MapsTo k e nilH1:MapsTo k e' m'cmp e e' = trueelt:Typea:(X.t * elt)%typem:list (X.t * elt)IHm:NoDupA m -> forall m' : list (X.t * elt), NoDupA m' -> forall cmp : elt -> elt -> bool, fold (fun (k : key) (e : elt) (b : bool) => check cmp k e m' && b) m true = true -> (forall k : X.t, In k m -> In k m') /\ (forall (k : X.t) (e e' : elt), MapsTo k e m -> MapsTo k e' m' -> cmp e e' = true)NoDupA (a :: m) -> forall m' : list (X.t * elt), NoDupA m' -> forall cmp : elt -> elt -> bool, fold (fun (k : key) (e : elt) (b : bool) => check cmp k e m' && b) (a :: m) true = true -> (forall k : X.t, In k (a :: m) -> In k m') /\ (forall (k : X.t) (e e' : elt), MapsTo k e (a :: m) -> MapsTo k e' m' -> cmp e e' = true)elt:TypeHm:NoDupA nilm':list (X.t * elt)Hm':NoDupA m'cmp:elt -> elt -> boolH:true = truek:X.te, e':eltH0:MapsTo k e nilH1:MapsTo k e' m'cmp e e' = trueelt:Typea:(X.t * elt)%typem:list (X.t * elt)IHm:NoDupA m -> forall m' : list (X.t * elt), NoDupA m' -> forall cmp : elt -> elt -> bool, fold (fun (k : key) (e : elt) (b : bool) => check cmp k e m' && b) m true = true -> (forall k : X.t, In k m -> In k m') /\ (forall (k : X.t) (e e' : elt), MapsTo k e m -> MapsTo k e' m' -> cmp e e' = true)NoDupA (a :: m) -> forall m' : list (X.t * elt), NoDupA m' -> forall cmp : elt -> elt -> bool, fold (fun (k : key) (e : elt) (b : bool) => check cmp k e m' && b) (a :: m) true = true -> (forall k : X.t, In k (a :: m) -> In k m') /\ (forall (k : X.t) (e e' : elt), MapsTo k e (a :: m) -> MapsTo k e' m' -> cmp e e' = true)elt:Typea:(X.t * elt)%typem:list (X.t * elt)IHm:NoDupA m -> forall m' : list (X.t * elt), NoDupA m' -> forall cmp : elt -> elt -> bool, fold (fun (k : key) (e : elt) (b : bool) => check cmp k e m' && b) m true = true -> (forall k : X.t, In k m -> In k m') /\ (forall (k : X.t) (e e' : elt), MapsTo k e m -> MapsTo k e' m' -> cmp e e' = true)NoDupA (a :: m) -> forall m' : list (X.t * elt), NoDupA m' -> forall cmp : elt -> elt -> bool, fold (fun (k : key) (e : elt) (b : bool) => check cmp k e m' && b) (a :: m) true = true -> (forall k : X.t, In k (a :: m) -> In k m') /\ (forall (k : X.t) (e e' : elt), MapsTo k e (a :: m) -> MapsTo k e' m' -> cmp e e' = true)elt:Typet0:X.te:eltm:list (X.t * elt)IHm:NoDupA m -> forall m'0 : list (X.t * elt), NoDupA m'0 -> forall cmp0 : elt -> elt -> bool, fold (fun (k : key) (e0 : elt) (b : bool) => check cmp0 k e0 m'0 && b) m true = true -> (forall k : X.t, In k m -> In k m'0) /\ (forall (k : X.t) (e0 e' : elt), MapsTo k e0 m -> MapsTo k e' m'0 -> cmp0 e0 e' = true)Hm:NoDupA ((t0, e) :: m)m':list (X.t * elt)Hm':NoDupA m'cmp:elt -> elt -> boolH:fold (fun (k : key) (e0 : elt) (b : bool) => check cmp k e0 m' && b) m (check cmp t0 e m' && true) = true(forall k : X.t, In k ((t0, e) :: m) -> In k m') /\ (forall (k : X.t) (e0 e' : elt), MapsTo k e0 ((t0, e) :: m) -> MapsTo k e' m' -> cmp e0 e' = true)elt:Typet0:X.te:eltm:list (X.t * elt)IHm:NoDupA m -> forall m'0 : list (X.t * elt), NoDupA m'0 -> forall cmp0 : elt -> elt -> bool, fold (fun (k : key) (e0 : elt) (b : bool) => check cmp0 k e0 m'0 && b) m true = true -> (forall k : X.t, In k m -> In k m'0) /\ (forall (k : X.t) (e0 e' : elt), MapsTo k e0 m -> MapsTo k e' m'0 -> cmp0 e0 e' = true)m':list (X.t * elt)Hm':NoDupA m'cmp:elt -> elt -> boolH:fold (fun (k : key) (e0 : elt) (b : bool) => check cmp k e0 m' && b) m (check cmp t0 e m' && true) = trueH0:~ InA eqk (t0, e) mH1:NoDupA m(forall k : X.t, In k ((t0, e) :: m) -> In k m') /\ (forall (k : X.t) (e0 e' : elt), MapsTo k e0 ((t0, e) :: m) -> MapsTo k e' m' -> cmp e0 e' = true)elt:Typet0:X.te:eltm:list (X.t * elt)IHm:NoDupA m -> forall m'0 : list (X.t * elt), NoDupA m'0 -> forall cmp0 : elt -> elt -> bool, fold (fun (k : key) (e0 : elt) (b : bool) => check cmp0 k e0 m'0 && b) m true = true -> (forall k : X.t, In k m -> In k m'0) /\ (forall (k : X.t) (e0 e' : elt), MapsTo k e0 m -> MapsTo k e' m'0 -> cmp0 e0 e' = true)m':list (X.t * elt)Hm':NoDupA m'cmp:elt -> elt -> boolH:fold (fun (k : key) (e0 : elt) (b : bool) => check cmp k e0 m' && b) m (check cmp t0 e m') = trueH0:~ InA eqk (t0, e) mH1:NoDupA m(forall k : X.t, In k ((t0, e) :: m) -> In k m') /\ (forall (k : X.t) (e0 e' : elt), MapsTo k e0 ((t0, e) :: m) -> MapsTo k e' m' -> cmp e0 e' = true)elt:Typet0:X.te:eltm:list (X.t * elt)IHm:NoDupA m -> forall m'0 : list (X.t * elt), NoDupA m'0 -> forall cmp0 : elt -> elt -> bool, fold (fun (k : key) (e0 : elt) (b : bool) => check cmp0 k e0 m'0 && b) m true = true -> (forall k : X.t, In k m -> In k m'0) /\ (forall (k : X.t) (e0 e' : elt), MapsTo k e0 m -> MapsTo k e' m'0 -> cmp0 e0 e' = true)m':list (X.t * elt)Hm':NoDupA m'cmp:elt -> elt -> boolH:fold (fun (k : key) (e0 : elt) (b : bool) => check cmp k e0 m' && b) m (check cmp t0 e m') = trueH0:~ InA eqk (t0, e) mH1:NoDupA mcheck cmp t0 e m' = trueelt:Typet0:X.te:eltm:list (X.t * elt)IHm:NoDupA m -> forall m'0 : list (X.t * elt), NoDupA m'0 -> forall cmp0 : elt -> elt -> bool, fold (fun (k : key) (e0 : elt) (b : bool) => check cmp0 k e0 m'0 && b) m true = true -> (forall k : X.t, In k m -> In k m'0) /\ (forall (k : X.t) (e0 e' : elt), MapsTo k e0 m -> MapsTo k e' m'0 -> cmp0 e0 e' = true)m':list (X.t * elt)Hm':NoDupA m'cmp:elt -> elt -> boolH:fold (fun (k : key) (e0 : elt) (b : bool) => check cmp k e0 m' && b) m (check cmp t0 e m') = trueH0:~ InA eqk (t0, e) mH1:NoDupA mH2:check cmp t0 e m' = true(forall k : X.t, In k ((t0, e) :: m) -> In k m') /\ (forall (k : X.t) (e0 e' : elt), MapsTo k e0 ((t0, e) :: m) -> MapsTo k e' m' -> cmp e0 e' = true)elt:Typet0:X.te:eltm, m':list (X.t * elt)cmp:elt -> elt -> boolH:fold (fun (k : key) (e0 : elt) (b : bool) => check cmp k e0 m' && b) m (check cmp t0 e m') = truecheck cmp t0 e m' = trueelt:Typet0:X.te:eltm:list (X.t * elt)IHm:NoDupA m -> forall m'0 : list (X.t * elt), NoDupA m'0 -> forall cmp0 : elt -> elt -> bool, fold (fun (k : key) (e0 : elt) (b : bool) => check cmp0 k e0 m'0 && b) m true = true -> (forall k : X.t, In k m -> In k m'0) /\ (forall (k : X.t) (e0 e' : elt), MapsTo k e0 m -> MapsTo k e' m'0 -> cmp0 e0 e' = true)m':list (X.t * elt)Hm':NoDupA m'cmp:elt -> elt -> boolH:fold (fun (k : key) (e0 : elt) (b : bool) => check cmp k e0 m' && b) m (check cmp t0 e m') = trueH0:~ InA eqk (t0, e) mH1:NoDupA mH2:check cmp t0 e m' = true(forall k : X.t, In k ((t0, e) :: m) -> In k m') /\ (forall (k : X.t) (e0 e' : elt), MapsTo k e0 ((t0, e) :: m) -> MapsTo k e' m' -> cmp e0 e' = true)elt:Typet0:X.te:eltm, m':list (X.t * elt)cmp:elt -> elt -> boolb:=check cmp t0 e m':boolH:fold (fun (k : key) (e0 : elt) (b0 : bool) => check cmp k e0 m' && b0) m b = trueb = trueelt:Typet0:X.te:eltm:list (X.t * elt)IHm:NoDupA m -> forall m'0 : list (X.t * elt), NoDupA m'0 -> forall cmp0 : elt -> elt -> bool, fold (fun (k : key) (e0 : elt) (b : bool) => check cmp0 k e0 m'0 && b) m true = true -> (forall k : X.t, In k m -> In k m'0) /\ (forall (k : X.t) (e0 e' : elt), MapsTo k e0 m -> MapsTo k e' m'0 -> cmp0 e0 e' = true)m':list (X.t * elt)Hm':NoDupA m'cmp:elt -> elt -> boolH:fold (fun (k : key) (e0 : elt) (b : bool) => check cmp k e0 m' && b) m (check cmp t0 e m') = trueH0:~ InA eqk (t0, e) mH1:NoDupA mH2:check cmp t0 e m' = true(forall k : X.t, In k ((t0, e) :: m) -> In k m') /\ (forall (k : X.t) (e0 e' : elt), MapsTo k e0 ((t0, e) :: m) -> MapsTo k e' m' -> cmp e0 e' = true)elt:Typet0:X.te:eltm, m':list (X.t * elt)cmp:elt -> elt -> boolforall b : bool, fold (fun (k : key) (e0 : elt) (b0 : bool) => check cmp k e0 m' && b0) m b = true -> b = trueelt:Typet0:X.te:eltm:list (X.t * elt)IHm:NoDupA m -> forall m'0 : list (X.t * elt), NoDupA m'0 -> forall cmp0 : elt -> elt -> bool, fold (fun (k : key) (e0 : elt) (b : bool) => check cmp0 k e0 m'0 && b) m true = true -> (forall k : X.t, In k m -> In k m'0) /\ (forall (k : X.t) (e0 e' : elt), MapsTo k e0 m -> MapsTo k e' m'0 -> cmp0 e0 e' = true)m':list (X.t * elt)Hm':NoDupA m'cmp:elt -> elt -> boolH:fold (fun (k : key) (e0 : elt) (b : bool) => check cmp k e0 m' && b) m (check cmp t0 e m') = trueH0:~ InA eqk (t0, e) mH1:NoDupA mH2:check cmp t0 e m' = true(forall k : X.t, In k ((t0, e) :: m) -> In k m') /\ (forall (k : X.t) (e0 e' : elt), MapsTo k e0 ((t0, e) :: m) -> MapsTo k e' m' -> cmp e0 e' = true)elt:Typet0:X.te:elta:(X.t * elt)%typem, m':list (X.t * elt)cmp:elt -> elt -> boolIHm:forall b0 : bool, fold (fun (k : key) (e0 : elt) (b1 : bool) => check cmp k e0 m' && b1) m b0 = true -> b0 = trueb:boolH:(let (k, e0) := a in fold (fun (k0 : key) (e1 : elt) (b0 : bool) => check cmp k0 e1 m' && b0) m (check cmp k e0 m' && b)) = trueb = trueelt:Typet0:X.te:eltm:list (X.t * elt)IHm:NoDupA m -> forall m'0 : list (X.t * elt), NoDupA m'0 -> forall cmp0 : elt -> elt -> bool, fold (fun (k : key) (e0 : elt) (b : bool) => check cmp0 k e0 m'0 && b) m true = true -> (forall k : X.t, In k m -> In k m'0) /\ (forall (k : X.t) (e0 e' : elt), MapsTo k e0 m -> MapsTo k e' m'0 -> cmp0 e0 e' = true)m':list (X.t * elt)Hm':NoDupA m'cmp:elt -> elt -> boolH:fold (fun (k : key) (e0 : elt) (b : bool) => check cmp k e0 m' && b) m (check cmp t0 e m') = trueH0:~ InA eqk (t0, e) mH1:NoDupA mH2:check cmp t0 e m' = true(forall k : X.t, In k ((t0, e) :: m) -> In k m') /\ (forall (k : X.t) (e0 e' : elt), MapsTo k e0 ((t0, e) :: m) -> MapsTo k e' m' -> cmp e0 e' = true)elt:Typet0:X.te:eltt1:X.te0:eltm, m':list (X.t * elt)cmp:elt -> elt -> boolIHm:forall b0 : bool, fold (fun (k : key) (e1 : elt) (b1 : bool) => check cmp k e1 m' && b1) m b0 = true -> b0 = trueb:boolH:fold (fun (k : key) (e1 : elt) (b0 : bool) => check cmp k e1 m' && b0) m (check cmp t1 e0 m' && b) = trueb = trueelt:Typet0:X.te:eltm:list (X.t * elt)IHm:NoDupA m -> forall m'0 : list (X.t * elt), NoDupA m'0 -> forall cmp0 : elt -> elt -> bool, fold (fun (k : key) (e0 : elt) (b : bool) => check cmp0 k e0 m'0 && b) m true = true -> (forall k : X.t, In k m -> In k m'0) /\ (forall (k : X.t) (e0 e' : elt), MapsTo k e0 m -> MapsTo k e' m'0 -> cmp0 e0 e' = true)m':list (X.t * elt)Hm':NoDupA m'cmp:elt -> elt -> boolH:fold (fun (k : key) (e0 : elt) (b : bool) => check cmp k e0 m' && b) m (check cmp t0 e m') = trueH0:~ InA eqk (t0, e) mH1:NoDupA mH2:check cmp t0 e m' = true(forall k : X.t, In k ((t0, e) :: m) -> In k m') /\ (forall (k : X.t) (e0 e' : elt), MapsTo k e0 ((t0, e) :: m) -> MapsTo k e' m' -> cmp e0 e' = true)elt:Typet0:X.te:eltm:list (X.t * elt)IHm:NoDupA m -> forall m'0 : list (X.t * elt), NoDupA m'0 -> forall cmp0 : elt -> elt -> bool, fold (fun (k : key) (e0 : elt) (b : bool) => check cmp0 k e0 m'0 && b) m true = true -> (forall k : X.t, In k m -> In k m'0) /\ (forall (k : X.t) (e0 e' : elt), MapsTo k e0 m -> MapsTo k e' m'0 -> cmp0 e0 e' = true)m':list (X.t * elt)Hm':NoDupA m'cmp:elt -> elt -> boolH:fold (fun (k : key) (e0 : elt) (b : bool) => check cmp k e0 m' && b) m (check cmp t0 e m') = trueH0:~ InA eqk (t0, e) mH1:NoDupA mH2:check cmp t0 e m' = true(forall k : X.t, In k ((t0, e) :: m) -> In k m') /\ (forall (k : X.t) (e0 e' : elt), MapsTo k e0 ((t0, e) :: m) -> MapsTo k e' m' -> cmp e0 e' = true)elt:Typet0:X.te:eltm:list (X.t * elt)IHm:NoDupA m -> forall m'0 : list (X.t * elt), NoDupA m'0 -> forall cmp0 : elt -> elt -> bool, fold (fun (k : key) (e0 : elt) (b : bool) => check cmp0 k e0 m'0 && b) m true = true -> (forall k : X.t, In k m -> In k m'0) /\ (forall (k : X.t) (e0 e' : elt), MapsTo k e0 m -> MapsTo k e' m'0 -> cmp0 e0 e' = true)m':list (X.t * elt)Hm':NoDupA m'cmp:elt -> elt -> boolH:fold (fun (k : key) (e0 : elt) (b : bool) => check cmp k e0 m' && b) m true = trueH0:~ InA eqk (t0, e) mH1:NoDupA mH2:check cmp t0 e m' = true(forall k : X.t, In k ((t0, e) :: m) -> In k m') /\ (forall (k : X.t) (e0 e' : elt), MapsTo k e0 ((t0, e) :: m) -> MapsTo k e' m' -> cmp e0 e' = true)elt:Typet0:X.te:eltm:list (X.t * elt)IHm:NoDupA m -> forall m'0 : list (X.t * elt), NoDupA m'0 -> forall cmp0 : elt -> elt -> bool, fold (fun (k : key) (e0 : elt) (b : bool) => check cmp0 k e0 m'0 && b) m true = true -> (forall k : X.t, In k m -> In k m'0) /\ (forall (k : X.t) (e0 e' : elt), MapsTo k e0 m -> MapsTo k e' m'0 -> cmp0 e0 e' = true)m':list (X.t * elt)Hm':NoDupA m'cmp:elt -> elt -> boolH:fold (fun (k : key) (e0 : elt) (b : bool) => check cmp k e0 m' && b) m true = trueH0:~ InA eqk (t0, e) mH1:NoDupA mH2:check cmp t0 e m' = trueH3:forall k : X.t, In k m -> In k m'H4:forall (k : X.t) (e0 e' : elt), MapsTo k e0 m -> MapsTo k e' m' -> cmp e0 e' = true(forall k : X.t, In k ((t0, e) :: m) -> In k m') /\ (forall (k : X.t) (e0 e' : elt), MapsTo k e0 ((t0, e) :: m) -> MapsTo k e' m' -> cmp e0 e' = true)elt:Typet0:X.te:eltm:list (X.t * elt)IHm:NoDupA m -> forall m'0 : list (X.t * elt), NoDupA m'0 -> forall cmp0 : elt -> elt -> bool, fold (fun (k : key) (e0 : elt) (b : bool) => check cmp0 k e0 m'0 && b) m true = true -> (forall k : X.t, In k m -> In k m'0) /\ (forall (k : X.t) (e0 e' : elt), MapsTo k e0 m -> MapsTo k e' m'0 -> cmp0 e0 e' = true)m':list (X.t * elt)Hm':NoDupA m'cmp:elt -> elt -> boolH:fold (fun (k : key) (e0 : elt) (b : bool) => check cmp k e0 m' && b) m true = trueH0:~ InA eqk (t0, e) mH1:NoDupA mH2:match find t0 m' with | Some e' => cmp e e' | None => false end = trueH3:forall k : X.t, In k m -> In k m'H4:forall (k : X.t) (e0 e' : elt), MapsTo k e0 m -> MapsTo k e' m' -> cmp e0 e' = true(forall k : X.t, In k ((t0, e) :: m) -> In k m') /\ (forall (k : X.t) (e0 e' : elt), MapsTo k e0 ((t0, e) :: m) -> MapsTo k e' m' -> cmp e0 e' = true)elt:Typet0:X.te:eltm:list (X.t * elt)IHm:NoDupA m -> forall m'0 : list (X.t * elt), NoDupA m'0 -> forall cmp0 : elt -> elt -> bool, fold (fun (k : key) (e0 : elt) (b : bool) => check cmp0 k e0 m'0 && b) m true = true -> (forall k : X.t, In k m -> In k m'0) /\ (forall (k : X.t) (e0 e'0 : elt), MapsTo k e0 m -> MapsTo k e'0 m'0 -> cmp0 e0 e'0 = true)m':list (X.t * elt)Hm':NoDupA m'cmp:elt -> elt -> boolH:fold (fun (k : key) (e0 : elt) (b : bool) => check cmp k e0 m' && b) m true = trueH0:~ InA eqk (t0, e) mH1:NoDupA me':eltH2:cmp e e' = trueH3:forall k : X.t, In k m -> In k m'H4:forall (k : X.t) (e0 e'0 : elt), MapsTo k e0 m -> MapsTo k e'0 m' -> cmp e0 e'0 = trueH5:find t0 m' = Some e'(forall k : X.t, In k ((t0, e) :: m) -> In k m') /\ (forall (k : X.t) (e0 e'0 : elt), MapsTo k e0 ((t0, e) :: m) -> MapsTo k e'0 m' -> cmp e0 e'0 = true)elt:Typet0:X.te:eltm:list (X.t * elt)IHm:NoDupA m -> forall m'0 : list (X.t * elt), NoDupA m'0 -> forall cmp0 : elt -> elt -> bool, fold (fun (k0 : key) (e0 : elt) (b : bool) => check cmp0 k0 e0 m'0 && b) m true = true -> (forall k0 : X.t, In k0 m -> In k0 m'0) /\ (forall (k0 : X.t) (e0 e'0 : elt), MapsTo k0 e0 m -> MapsTo k0 e'0 m'0 -> cmp0 e0 e'0 = true)m':list (X.t * elt)Hm':NoDupA m'cmp:elt -> elt -> boolH:fold (fun (k0 : key) (e0 : elt) (b : bool) => check cmp k0 e0 m' && b) m true = trueH0:~ InA eqk (t0, e) mH1:NoDupA me':eltH2:cmp e e' = trueH3:forall k0 : X.t, In k0 m -> In k0 m'H4:forall (k0 : X.t) (e0 e'0 : elt), MapsTo k0 e0 m -> MapsTo k0 e'0 m' -> cmp e0 e'0 = trueH5:find t0 m' = Some e'k:X.tH6:In k ((t0, e) :: m)In k m'elt:Typet0:X.te:eltm:list (X.t * elt)IHm:NoDupA m -> forall m'0 : list (X.t * elt), NoDupA m'0 -> forall cmp0 : elt -> elt -> bool, fold (fun (k0 : key) (e1 : elt) (b : bool) => check cmp0 k0 e1 m'0 && b) m true = true -> (forall k0 : X.t, In k0 m -> In k0 m'0) /\ (forall (k0 : X.t) (e1 e'1 : elt), MapsTo k0 e1 m -> MapsTo k0 e'1 m'0 -> cmp0 e1 e'1 = true)m':list (X.t * elt)Hm':NoDupA m'cmp:elt -> elt -> boolH:fold (fun (k0 : key) (e1 : elt) (b : bool) => check cmp k0 e1 m' && b) m true = trueH0:~ InA eqk (t0, e) mH1:NoDupA me':eltH2:cmp e e' = trueH3:forall k0 : X.t, In k0 m -> In k0 m'H4:forall (k0 : X.t) (e1 e'1 : elt), MapsTo k0 e1 m -> MapsTo k0 e'1 m' -> cmp e1 e'1 = trueH5:find t0 m' = Some e'k:X.te0, e'0:eltH6:MapsTo k e0 ((t0, e) :: m)H7:MapsTo k e'0 m'cmp e0 e'0 = trueelt:Typet0:X.te:eltm:list (X.t * elt)IHm:NoDupA m -> forall m'0 : list (X.t * elt), NoDupA m'0 -> forall cmp0 : elt -> elt -> bool, fold (fun (k0 : key) (e1 : elt) (b : bool) => check cmp0 k0 e1 m'0 && b) m true = true -> (forall k0 : X.t, In k0 m -> In k0 m'0) /\ (forall (k0 : X.t) (e1 e'0 : elt), MapsTo k0 e1 m -> MapsTo k0 e'0 m'0 -> cmp0 e1 e'0 = true)m':list (X.t * elt)Hm':NoDupA m'cmp:elt -> elt -> boolH:fold (fun (k0 : key) (e1 : elt) (b : bool) => check cmp k0 e1 m' && b) m true = trueH0:~ InA eqk (t0, e) mH1:NoDupA me':eltH2:cmp e e' = trueH3:forall k0 : X.t, In k0 m -> In k0 m'H4:forall (k0 : X.t) (e1 e'0 : elt), MapsTo k0 e1 m -> MapsTo k0 e'0 m' -> cmp e1 e'0 = trueH5:find t0 m' = Some e'k:X.te0:eltH7:eqke (k, e0) (t0, e)In k m'elt:Typet0:X.te:eltm:list (X.t * elt)IHm:NoDupA m -> forall m'0 : list (X.t * elt), NoDupA m'0 -> forall cmp0 : elt -> elt -> bool, fold (fun (k0 : key) (e1 : elt) (b : bool) => check cmp0 k0 e1 m'0 && b) m true = true -> (forall k0 : X.t, In k0 m -> In k0 m'0) /\ (forall (k0 : X.t) (e1 e'0 : elt), MapsTo k0 e1 m -> MapsTo k0 e'0 m'0 -> cmp0 e1 e'0 = true)m':list (X.t * elt)Hm':NoDupA m'cmp:elt -> elt -> boolH:fold (fun (k0 : key) (e1 : elt) (b : bool) => check cmp k0 e1 m' && b) m true = trueH0:~ InA eqk (t0, e) mH1:NoDupA me':eltH2:cmp e e' = trueH3:forall k0 : X.t, In k0 m -> In k0 m'H4:forall (k0 : X.t) (e1 e'0 : elt), MapsTo k0 e1 m -> MapsTo k0 e'0 m' -> cmp e1 e'0 = trueH5:find t0 m' = Some e'k:X.te0:eltH7:InA eqke (k, e0) mIn k m'elt:Typet0:X.te:eltm:list (X.t * elt)IHm:NoDupA m -> forall m'0 : list (X.t * elt), NoDupA m'0 -> forall cmp0 : elt -> elt -> bool, fold (fun (k0 : key) (e1 : elt) (b : bool) => check cmp0 k0 e1 m'0 && b) m true = true -> (forall k0 : X.t, In k0 m -> In k0 m'0) /\ (forall (k0 : X.t) (e1 e'1 : elt), MapsTo k0 e1 m -> MapsTo k0 e'1 m'0 -> cmp0 e1 e'1 = true)m':list (X.t * elt)Hm':NoDupA m'cmp:elt -> elt -> boolH:fold (fun (k0 : key) (e1 : elt) (b : bool) => check cmp k0 e1 m' && b) m true = trueH0:~ InA eqk (t0, e) mH1:NoDupA me':eltH2:cmp e e' = trueH3:forall k0 : X.t, In k0 m -> In k0 m'H4:forall (k0 : X.t) (e1 e'1 : elt), MapsTo k0 e1 m -> MapsTo k0 e'1 m' -> cmp e1 e'1 = trueH5:find t0 m' = Some e'k:X.te0, e'0:eltH6:MapsTo k e0 ((t0, e) :: m)H7:MapsTo k e'0 m'cmp e0 e'0 = trueelt:Typet0:X.te:eltm:list (X.t * elt)IHm:NoDupA m -> forall m'0 : list (X.t * elt), NoDupA m'0 -> forall cmp0 : elt -> elt -> bool, fold (fun (k0 : key) (e0 : elt) (b : bool) => check cmp0 k0 e0 m'0 && b) m true = true -> (forall k0 : X.t, In k0 m -> In k0 m'0) /\ (forall (k0 : X.t) (e0 e'0 : elt), MapsTo k0 e0 m -> MapsTo k0 e'0 m'0 -> cmp0 e0 e'0 = true)m':list (X.t * elt)Hm':NoDupA m'cmp:elt -> elt -> boolH:fold (fun (k0 : key) (e0 : elt) (b : bool) => check cmp k0 e0 m' && b) m true = trueH0:~ InA eqk (t0, e) mH1:NoDupA me':eltH2:cmp e e' = trueH3:forall k0 : X.t, In k0 m -> In k0 m'H4:forall (k0 : X.t) (e0 e'0 : elt), MapsTo k0 e0 m -> MapsTo k0 e'0 m' -> cmp e0 e'0 = trueH5:find t0 m' = Some e'k:X.tH6:X.eq k t0In k m'elt:Typet0:X.te:eltm:list (X.t * elt)IHm:NoDupA m -> forall m'0 : list (X.t * elt), NoDupA m'0 -> forall cmp0 : elt -> elt -> bool, fold (fun (k0 : key) (e1 : elt) (b : bool) => check cmp0 k0 e1 m'0 && b) m true = true -> (forall k0 : X.t, In k0 m -> In k0 m'0) /\ (forall (k0 : X.t) (e1 e'0 : elt), MapsTo k0 e1 m -> MapsTo k0 e'0 m'0 -> cmp0 e1 e'0 = true)m':list (X.t * elt)Hm':NoDupA m'cmp:elt -> elt -> boolH:fold (fun (k0 : key) (e1 : elt) (b : bool) => check cmp k0 e1 m' && b) m true = trueH0:~ InA eqk (t0, e) mH1:NoDupA me':eltH2:cmp e e' = trueH3:forall k0 : X.t, In k0 m -> In k0 m'H4:forall (k0 : X.t) (e1 e'0 : elt), MapsTo k0 e1 m -> MapsTo k0 e'0 m' -> cmp e1 e'0 = trueH5:find t0 m' = Some e'k:X.te0:eltH7:InA eqke (k, e0) mIn k m'elt:Typet0:X.te:eltm:list (X.t * elt)IHm:NoDupA m -> forall m'0 : list (X.t * elt), NoDupA m'0 -> forall cmp0 : elt -> elt -> bool, fold (fun (k0 : key) (e1 : elt) (b : bool) => check cmp0 k0 e1 m'0 && b) m true = true -> (forall k0 : X.t, In k0 m -> In k0 m'0) /\ (forall (k0 : X.t) (e1 e'1 : elt), MapsTo k0 e1 m -> MapsTo k0 e'1 m'0 -> cmp0 e1 e'1 = true)m':list (X.t * elt)Hm':NoDupA m'cmp:elt -> elt -> boolH:fold (fun (k0 : key) (e1 : elt) (b : bool) => check cmp k0 e1 m' && b) m true = trueH0:~ InA eqk (t0, e) mH1:NoDupA me':eltH2:cmp e e' = trueH3:forall k0 : X.t, In k0 m -> In k0 m'H4:forall (k0 : X.t) (e1 e'1 : elt), MapsTo k0 e1 m -> MapsTo k0 e'1 m' -> cmp e1 e'1 = trueH5:find t0 m' = Some e'k:X.te0, e'0:eltH6:MapsTo k e0 ((t0, e) :: m)H7:MapsTo k e'0 m'cmp e0 e'0 = trueelt:Typet0:X.te:eltm:list (X.t * elt)IHm:NoDupA m -> forall m'0 : list (X.t * elt), NoDupA m'0 -> forall cmp0 : elt -> elt -> bool, fold (fun (k0 : key) (e0 : elt) (b : bool) => check cmp0 k0 e0 m'0 && b) m true = true -> (forall k0 : X.t, In k0 m -> In k0 m'0) /\ (forall (k0 : X.t) (e0 e'0 : elt), MapsTo k0 e0 m -> MapsTo k0 e'0 m'0 -> cmp0 e0 e'0 = true)m':list (X.t * elt)Hm':NoDupA m'cmp:elt -> elt -> boolH:fold (fun (k0 : key) (e0 : elt) (b : bool) => check cmp k0 e0 m' && b) m true = trueH0:~ InA eqk (t0, e) mH1:NoDupA me':eltH2:cmp e e' = trueH3:forall k0 : X.t, In k0 m -> In k0 m'H4:forall (k0 : X.t) (e0 e'0 : elt), MapsTo k0 e0 m -> MapsTo k0 e'0 m' -> cmp e0 e'0 = trueH5:find t0 m' = Some e'k:X.tH6:X.eq k t0MapsTo k e' m'elt:Typet0:X.te:eltm:list (X.t * elt)IHm:NoDupA m -> forall m'0 : list (X.t * elt), NoDupA m'0 -> forall cmp0 : elt -> elt -> bool, fold (fun (k0 : key) (e1 : elt) (b : bool) => check cmp0 k0 e1 m'0 && b) m true = true -> (forall k0 : X.t, In k0 m -> In k0 m'0) /\ (forall (k0 : X.t) (e1 e'0 : elt), MapsTo k0 e1 m -> MapsTo k0 e'0 m'0 -> cmp0 e1 e'0 = true)m':list (X.t * elt)Hm':NoDupA m'cmp:elt -> elt -> boolH:fold (fun (k0 : key) (e1 : elt) (b : bool) => check cmp k0 e1 m' && b) m true = trueH0:~ InA eqk (t0, e) mH1:NoDupA me':eltH2:cmp e e' = trueH3:forall k0 : X.t, In k0 m -> In k0 m'H4:forall (k0 : X.t) (e1 e'0 : elt), MapsTo k0 e1 m -> MapsTo k0 e'0 m' -> cmp e1 e'0 = trueH5:find t0 m' = Some e'k:X.te0:eltH7:InA eqke (k, e0) mIn k m'elt:Typet0:X.te:eltm:list (X.t * elt)IHm:NoDupA m -> forall m'0 : list (X.t * elt), NoDupA m'0 -> forall cmp0 : elt -> elt -> bool, fold (fun (k0 : key) (e1 : elt) (b : bool) => check cmp0 k0 e1 m'0 && b) m true = true -> (forall k0 : X.t, In k0 m -> In k0 m'0) /\ (forall (k0 : X.t) (e1 e'1 : elt), MapsTo k0 e1 m -> MapsTo k0 e'1 m'0 -> cmp0 e1 e'1 = true)m':list (X.t * elt)Hm':NoDupA m'cmp:elt -> elt -> boolH:fold (fun (k0 : key) (e1 : elt) (b : bool) => check cmp k0 e1 m' && b) m true = trueH0:~ InA eqk (t0, e) mH1:NoDupA me':eltH2:cmp e e' = trueH3:forall k0 : X.t, In k0 m -> In k0 m'H4:forall (k0 : X.t) (e1 e'1 : elt), MapsTo k0 e1 m -> MapsTo k0 e'1 m' -> cmp e1 e'1 = trueH5:find t0 m' = Some e'k:X.te0, e'0:eltH6:MapsTo k e0 ((t0, e) :: m)H7:MapsTo k e'0 m'cmp e0 e'0 = trueelt:Typet0:X.te:eltm:list (X.t * elt)IHm:NoDupA m -> forall m'0 : list (X.t * elt), NoDupA m'0 -> forall cmp0 : elt -> elt -> bool, fold (fun (k0 : key) (e0 : elt) (b : bool) => check cmp0 k0 e0 m'0 && b) m true = true -> (forall k0 : X.t, In k0 m -> In k0 m'0) /\ (forall (k0 : X.t) (e0 e'0 : elt), MapsTo k0 e0 m -> MapsTo k0 e'0 m'0 -> cmp0 e0 e'0 = true)m':list (X.t * elt)Hm':NoDupA m'cmp:elt -> elt -> boolH:fold (fun (k0 : key) (e0 : elt) (b : bool) => check cmp k0 e0 m' && b) m true = trueH0:~ InA eqk (t0, e) mH1:NoDupA me':eltH2:cmp e e' = trueH3:forall k0 : X.t, In k0 m -> In k0 m'H4:forall (k0 : X.t) (e0 e'0 : elt), MapsTo k0 e0 m -> MapsTo k0 e'0 m' -> cmp e0 e'0 = trueH5:find t0 m' = Some e'k:X.tH6:X.eq k t0MapsTo t0 e' m'elt:Typet0:X.te:eltm:list (X.t * elt)IHm:NoDupA m -> forall m'0 : list (X.t * elt), NoDupA m'0 -> forall cmp0 : elt -> elt -> bool, fold (fun (k0 : key) (e1 : elt) (b : bool) => check cmp0 k0 e1 m'0 && b) m true = true -> (forall k0 : X.t, In k0 m -> In k0 m'0) /\ (forall (k0 : X.t) (e1 e'0 : elt), MapsTo k0 e1 m -> MapsTo k0 e'0 m'0 -> cmp0 e1 e'0 = true)m':list (X.t * elt)Hm':NoDupA m'cmp:elt -> elt -> boolH:fold (fun (k0 : key) (e1 : elt) (b : bool) => check cmp k0 e1 m' && b) m true = trueH0:~ InA eqk (t0, e) mH1:NoDupA me':eltH2:cmp e e' = trueH3:forall k0 : X.t, In k0 m -> In k0 m'H4:forall (k0 : X.t) (e1 e'0 : elt), MapsTo k0 e1 m -> MapsTo k0 e'0 m' -> cmp e1 e'0 = trueH5:find t0 m' = Some e'k:X.te0:eltH7:InA eqke (k, e0) mIn k m'elt:Typet0:X.te:eltm:list (X.t * elt)IHm:NoDupA m -> forall m'0 : list (X.t * elt), NoDupA m'0 -> forall cmp0 : elt -> elt -> bool, fold (fun (k0 : key) (e1 : elt) (b : bool) => check cmp0 k0 e1 m'0 && b) m true = true -> (forall k0 : X.t, In k0 m -> In k0 m'0) /\ (forall (k0 : X.t) (e1 e'1 : elt), MapsTo k0 e1 m -> MapsTo k0 e'1 m'0 -> cmp0 e1 e'1 = true)m':list (X.t * elt)Hm':NoDupA m'cmp:elt -> elt -> boolH:fold (fun (k0 : key) (e1 : elt) (b : bool) => check cmp k0 e1 m' && b) m true = trueH0:~ InA eqk (t0, e) mH1:NoDupA me':eltH2:cmp e e' = trueH3:forall k0 : X.t, In k0 m -> In k0 m'H4:forall (k0 : X.t) (e1 e'1 : elt), MapsTo k0 e1 m -> MapsTo k0 e'1 m' -> cmp e1 e'1 = trueH5:find t0 m' = Some e'k:X.te0, e'0:eltH6:MapsTo k e0 ((t0, e) :: m)H7:MapsTo k e'0 m'cmp e0 e'0 = trueelt:Typet0:X.te:eltm:list (X.t * elt)IHm:NoDupA m -> forall m'0 : list (X.t * elt), NoDupA m'0 -> forall cmp0 : elt -> elt -> bool, fold (fun (k0 : key) (e1 : elt) (b : bool) => check cmp0 k0 e1 m'0 && b) m true = true -> (forall k0 : X.t, In k0 m -> In k0 m'0) /\ (forall (k0 : X.t) (e1 e'0 : elt), MapsTo k0 e1 m -> MapsTo k0 e'0 m'0 -> cmp0 e1 e'0 = true)m':list (X.t * elt)Hm':NoDupA m'cmp:elt -> elt -> boolH:fold (fun (k0 : key) (e1 : elt) (b : bool) => check cmp k0 e1 m' && b) m true = trueH0:~ InA eqk (t0, e) mH1:NoDupA me':eltH2:cmp e e' = trueH3:forall k0 : X.t, In k0 m -> In k0 m'H4:forall (k0 : X.t) (e1 e'0 : elt), MapsTo k0 e1 m -> MapsTo k0 e'0 m' -> cmp e1 e'0 = trueH5:find t0 m' = Some e'k:X.te0:eltH7:InA eqke (k, e0) mIn k m'elt:Typet0:X.te:eltm:list (X.t * elt)IHm:NoDupA m -> forall m'0 : list (X.t * elt), NoDupA m'0 -> forall cmp0 : elt -> elt -> bool, fold (fun (k0 : key) (e1 : elt) (b : bool) => check cmp0 k0 e1 m'0 && b) m true = true -> (forall k0 : X.t, In k0 m -> In k0 m'0) /\ (forall (k0 : X.t) (e1 e'1 : elt), MapsTo k0 e1 m -> MapsTo k0 e'1 m'0 -> cmp0 e1 e'1 = true)m':list (X.t * elt)Hm':NoDupA m'cmp:elt -> elt -> boolH:fold (fun (k0 : key) (e1 : elt) (b : bool) => check cmp k0 e1 m' && b) m true = trueH0:~ InA eqk (t0, e) mH1:NoDupA me':eltH2:cmp e e' = trueH3:forall k0 : X.t, In k0 m -> In k0 m'H4:forall (k0 : X.t) (e1 e'1 : elt), MapsTo k0 e1 m -> MapsTo k0 e'1 m' -> cmp e1 e'1 = trueH5:find t0 m' = Some e'k:X.te0, e'0:eltH6:MapsTo k e0 ((t0, e) :: m)H7:MapsTo k e'0 m'cmp e0 e'0 = trueelt:Typet0:X.te:eltm:list (X.t * elt)IHm:NoDupA m -> forall m'0 : list (X.t * elt), NoDupA m'0 -> forall cmp0 : elt -> elt -> bool, fold (fun (k0 : key) (e1 : elt) (b : bool) => check cmp0 k0 e1 m'0 && b) m true = true -> (forall k0 : X.t, In k0 m -> In k0 m'0) /\ (forall (k0 : X.t) (e1 e'0 : elt), MapsTo k0 e1 m -> MapsTo k0 e'0 m'0 -> cmp0 e1 e'0 = true)m':list (X.t * elt)Hm':NoDupA m'cmp:elt -> elt -> boolH:fold (fun (k0 : key) (e1 : elt) (b : bool) => check cmp k0 e1 m' && b) m true = trueH0:~ InA eqk (t0, e) mH1:NoDupA me':eltH2:cmp e e' = trueH3:forall k0 : X.t, In k0 m -> In k0 m'H4:forall (k0 : X.t) (e1 e'0 : elt), MapsTo k0 e1 m -> MapsTo k0 e'0 m' -> cmp e1 e'0 = trueH5:find t0 m' = Some e'k:X.te0:eltH7:InA eqke (k, e0) mIn k melt:Typet0:X.te:eltm:list (X.t * elt)IHm:NoDupA m -> forall m'0 : list (X.t * elt), NoDupA m'0 -> forall cmp0 : elt -> elt -> bool, fold (fun (k0 : key) (e1 : elt) (b : bool) => check cmp0 k0 e1 m'0 && b) m true = true -> (forall k0 : X.t, In k0 m -> In k0 m'0) /\ (forall (k0 : X.t) (e1 e'1 : elt), MapsTo k0 e1 m -> MapsTo k0 e'1 m'0 -> cmp0 e1 e'1 = true)m':list (X.t * elt)Hm':NoDupA m'cmp:elt -> elt -> boolH:fold (fun (k0 : key) (e1 : elt) (b : bool) => check cmp k0 e1 m' && b) m true = trueH0:~ InA eqk (t0, e) mH1:NoDupA me':eltH2:cmp e e' = trueH3:forall k0 : X.t, In k0 m -> In k0 m'H4:forall (k0 : X.t) (e1 e'1 : elt), MapsTo k0 e1 m -> MapsTo k0 e'1 m' -> cmp e1 e'1 = trueH5:find t0 m' = Some e'k:X.te0, e'0:eltH6:MapsTo k e0 ((t0, e) :: m)H7:MapsTo k e'0 m'cmp e0 e'0 = trueelt:Typet0:X.te:eltm:list (X.t * elt)IHm:NoDupA m -> forall m'0 : list (X.t * elt), NoDupA m'0 -> forall cmp0 : elt -> elt -> bool, fold (fun (k0 : key) (e1 : elt) (b : bool) => check cmp0 k0 e1 m'0 && b) m true = true -> (forall k0 : X.t, In k0 m -> In k0 m'0) /\ (forall (k0 : X.t) (e1 e'1 : elt), MapsTo k0 e1 m -> MapsTo k0 e'1 m'0 -> cmp0 e1 e'1 = true)m':list (X.t * elt)Hm':NoDupA m'cmp:elt -> elt -> boolH:fold (fun (k0 : key) (e1 : elt) (b : bool) => check cmp k0 e1 m' && b) m true = trueH0:~ InA eqk (t0, e) mH1:NoDupA me':eltH2:cmp e e' = trueH3:forall k0 : X.t, In k0 m -> In k0 m'H4:forall (k0 : X.t) (e1 e'1 : elt), MapsTo k0 e1 m -> MapsTo k0 e'1 m' -> cmp e1 e'1 = trueH5:find t0 m' = Some e'k:X.te0, e'0:eltH6:MapsTo k e0 ((t0, e) :: m)H7:MapsTo k e'0 m'cmp e0 e'0 = trueelt:Typet0:X.te:eltm:list (X.t * elt)IHm:NoDupA m -> forall m'0 : list (X.t * elt), NoDupA m'0 -> forall cmp0 : elt -> elt -> bool, fold (fun (k0 : key) (e1 : elt) (b : bool) => check cmp0 k0 e1 m'0 && b) m true = true -> (forall k0 : X.t, In k0 m -> In k0 m'0) /\ (forall (k0 : X.t) (e1 e'1 : elt), MapsTo k0 e1 m -> MapsTo k0 e'1 m'0 -> cmp0 e1 e'1 = true)m':list (X.t * elt)Hm':NoDupA m'cmp:elt -> elt -> boolH:fold (fun (k0 : key) (e1 : elt) (b : bool) => check cmp k0 e1 m' && b) m true = trueH0:~ InA eqk (t0, e) mH1:NoDupA me':eltH2:cmp e e' = trueH3:forall k0 : X.t, In k0 m -> In k0 m'H4:forall (k0 : X.t) (e1 e'1 : elt), MapsTo k0 e1 m -> MapsTo k0 e'1 m' -> cmp e1 e'1 = trueH5:find t0 m' = Some e'k:X.te0, e'0:eltH7:MapsTo k e'0 m'H8:eqke (k, e0) (t0, e)cmp e0 e'0 = trueelt:Typet0:X.te:eltm:list (X.t * elt)IHm:NoDupA m -> forall m'0 : list (X.t * elt), NoDupA m'0 -> forall cmp0 : elt -> elt -> bool, fold (fun (k0 : key) (e1 : elt) (b : bool) => check cmp0 k0 e1 m'0 && b) m true = true -> (forall k0 : X.t, In k0 m -> In k0 m'0) /\ (forall (k0 : X.t) (e1 e'1 : elt), MapsTo k0 e1 m -> MapsTo k0 e'1 m'0 -> cmp0 e1 e'1 = true)m':list (X.t * elt)Hm':NoDupA m'cmp:elt -> elt -> boolH:fold (fun (k0 : key) (e1 : elt) (b : bool) => check cmp k0 e1 m' && b) m true = trueH0:~ InA eqk (t0, e) mH1:NoDupA me':eltH2:cmp e e' = trueH3:forall k0 : X.t, In k0 m -> In k0 m'H4:forall (k0 : X.t) (e1 e'1 : elt), MapsTo k0 e1 m -> MapsTo k0 e'1 m' -> cmp e1 e'1 = trueH5:find t0 m' = Some e'k:X.te0, e'0:eltH7:MapsTo k e'0 m'H8:InA eqke (k, e0) mcmp e0 e'0 = trueelt:Typet0:X.te:eltm:list (X.t * elt)IHm:NoDupA m -> forall m'0 : list (X.t * elt), NoDupA m'0 -> forall cmp0 : elt -> elt -> bool, fold (fun (k0 : key) (e0 : elt) (b : bool) => check cmp0 k0 e0 m'0 && b) m true = true -> (forall k0 : X.t, In k0 m -> In k0 m'0) /\ (forall (k0 : X.t) (e0 e'1 : elt), MapsTo k0 e0 m -> MapsTo k0 e'1 m'0 -> cmp0 e0 e'1 = true)m':list (X.t * elt)Hm':NoDupA m'cmp:elt -> elt -> boolH:fold (fun (k0 : key) (e0 : elt) (b : bool) => check cmp k0 e0 m' && b) m true = trueH0:~ InA eqk (t0, e) mH1:NoDupA me':eltH2:cmp e e' = trueH3:forall k0 : X.t, In k0 m -> In k0 m'H4:forall (k0 : X.t) (e0 e'1 : elt), MapsTo k0 e0 m -> MapsTo k0 e'1 m' -> cmp e0 e'1 = trueH5:find t0 m' = Some e'k:X.te'0:eltH7:MapsTo k e'0 m'H6:X.eq k t0cmp e e'0 = trueelt:Typet0:X.te:eltm:list (X.t * elt)IHm:NoDupA m -> forall m'0 : list (X.t * elt), NoDupA m'0 -> forall cmp0 : elt -> elt -> bool, fold (fun (k0 : key) (e1 : elt) (b : bool) => check cmp0 k0 e1 m'0 && b) m true = true -> (forall k0 : X.t, In k0 m -> In k0 m'0) /\ (forall (k0 : X.t) (e1 e'1 : elt), MapsTo k0 e1 m -> MapsTo k0 e'1 m'0 -> cmp0 e1 e'1 = true)m':list (X.t * elt)Hm':NoDupA m'cmp:elt -> elt -> boolH:fold (fun (k0 : key) (e1 : elt) (b : bool) => check cmp k0 e1 m' && b) m true = trueH0:~ InA eqk (t0, e) mH1:NoDupA me':eltH2:cmp e e' = trueH3:forall k0 : X.t, In k0 m -> In k0 m'H4:forall (k0 : X.t) (e1 e'1 : elt), MapsTo k0 e1 m -> MapsTo k0 e'1 m' -> cmp e1 e'1 = trueH5:find t0 m' = Some e'k:X.te0, e'0:eltH7:MapsTo k e'0 m'H8:InA eqke (k, e0) mcmp e0 e'0 = trueapply H4 with k; auto. Qed.elt:Typet0:X.te:eltm:list (X.t * elt)IHm:NoDupA m -> forall m'0 : list (X.t * elt), NoDupA m'0 -> forall cmp0 : elt -> elt -> bool, fold (fun (k0 : key) (e1 : elt) (b : bool) => check cmp0 k0 e1 m'0 && b) m true = true -> (forall k0 : X.t, In k0 m -> In k0 m'0) /\ (forall (k0 : X.t) (e1 e'1 : elt), MapsTo k0 e1 m -> MapsTo k0 e'1 m'0 -> cmp0 e1 e'1 = true)m':list (X.t * elt)Hm':NoDupA m'cmp:elt -> elt -> boolH:fold (fun (k0 : key) (e1 : elt) (b : bool) => check cmp k0 e1 m' && b) m true = trueH0:~ InA eqk (t0, e) mH1:NoDupA me':eltH2:cmp e e' = trueH3:forall k0 : X.t, In k0 m -> In k0 m'H4:forall (k0 : X.t) (e1 e'1 : elt), MapsTo k0 e1 m -> MapsTo k0 e'1 m' -> cmp e1 e'1 = trueH5:find t0 m' = Some e'k:X.te0, e'0:eltH7:MapsTo k e'0 m'H8:InA eqke (k, e0) mcmp e0 e'0 = true
Specification of equal
elt:Typeforall m : list (X.t * elt), NoDupA m -> forall m' : list (X.t * elt), NoDupA m' -> forall cmp : elt -> elt -> bool, Equivb cmp m m' -> equal cmp m m' = trueelt:Typeforall m : list (X.t * elt), NoDupA m -> forall m' : list (X.t * elt), NoDupA m' -> forall cmp : elt -> elt -> bool, Equivb cmp m m' -> equal cmp m m' = trueelt:Typeforall m : list (X.t * elt), NoDupA m -> forall m' : list (X.t * elt), NoDupA m' -> forall cmp : elt -> elt -> bool, (forall k : X.t, In k m <-> In k m') /\ (forall (k : X.t) (e e' : elt), MapsTo k e m -> MapsTo k e' m' -> cmp e e' = true) -> submap cmp m m' && submap (fun e' e : elt => cmp e e') m' m = trueapply andb_true_intro; split; apply submap_1; unfold Submap; firstorder. Qed.elt:Typem:list (X.t * elt)Hm:NoDupA mm':list (X.t * elt)Hm':NoDupA m'cmp:elt -> elt -> boolH0:forall k : X.t, In k m <-> In k m'H1:forall (k : X.t) (e e' : elt), MapsTo k e m -> MapsTo k e' m' -> cmp e e' = truesubmap cmp m m' && submap (fun e' e : elt => cmp e e') m' m = trueelt:Typeforall m : list (X.t * elt), NoDupA m -> forall m' : list (X.t * elt), NoDupA m' -> forall cmp : elt -> elt -> bool, equal cmp m m' = true -> Equivb cmp m m'elt:Typeforall m : list (X.t * elt), NoDupA m -> forall m' : list (X.t * elt), NoDupA m' -> forall cmp : elt -> elt -> bool, equal cmp m m' = true -> Equivb cmp m m'elt:Typeforall m : list (X.t * elt), NoDupA m -> forall m' : list (X.t * elt), NoDupA m' -> forall cmp : elt -> elt -> bool, submap cmp m m' && submap (fun e' e : elt => cmp e e') m' m = true -> (forall k : X.t, In k m <-> In k m') /\ (forall (k : X.t) (e e' : elt), MapsTo k e m -> MapsTo k e' m' -> cmp e e' = true)elt:Typem:list (X.t * elt)Hm:NoDupA mm':list (X.t * elt)Hm':NoDupA m'cmp:elt -> elt -> boolH:submap cmp m m' && submap (fun e' e : elt => cmp e e') m' m = true(forall k : X.t, In k m <-> In k m') /\ (forall (k : X.t) (e e' : elt), MapsTo k e m -> MapsTo k e' m' -> cmp e e' = true)elt:Typem:list (X.t * elt)Hm:NoDupA mm':list (X.t * elt)Hm':NoDupA m'cmp:elt -> elt -> boolH0:submap cmp m m' = trueH1:submap (fun e' e : elt => cmp e e') m' m = true(forall k : X.t, In k m <-> In k m') /\ (forall (k : X.t) (e e' : elt), MapsTo k e m -> MapsTo k e' m' -> cmp e e' = true)elt:Typem:list (X.t * elt)Hm:NoDupA mm':list (X.t * elt)Hm':NoDupA m'cmp:elt -> elt -> boolH0:submap cmp m m' = trueH1:submap (fun e' e : elt => cmp e e') m' m = trueSubmap cmp m m' -> (forall k : X.t, In k m <-> In k m') /\ (forall (k : X.t) (e e' : elt), MapsTo k e m -> MapsTo k e' m' -> cmp e e' = true)firstorder. Qed. Variable elt':Type.elt:Typem:list (X.t * elt)Hm:NoDupA mm':list (X.t * elt)Hm':NoDupA m'cmp:elt -> elt -> boolH0:submap cmp m m' = trueH1:submap (fun e' e : elt => cmp e e') m' m = trueSubmap (fun e' e : elt => cmp e e') m' m -> Submap cmp m m' -> (forall k : X.t, In k m <-> In k m') /\ (forall (k : X.t) (e e' : elt), MapsTo k e m -> MapsTo k e' m' -> cmp e e' = true)
Fixpoint map (f:elt -> elt') (m:t elt) : t elt' := match m with | nil => nil | (k,e)::m' => (k,f e) :: map f m' end. Fixpoint mapi (f: key -> elt -> elt') (m:t elt) : t elt' := match m with | nil => nil | (k,e)::m' => (k,f k e) :: mapi f m' end. End Elt. Section Elt2. (* A new section is necessary for previous definitions to work with different [elt], especially [MapsTo]... *) Variable elt elt' : Type.
Specification of map
elt, elt':Typeforall (m : t elt) (x : key) (e : elt) (f : elt -> elt'), MapsTo x e m -> MapsTo x (f e) (map f m)elt, elt':Typeforall (m : t elt) (x : key) (e : elt) (f : elt -> elt'), MapsTo x e m -> MapsTo x (f e) (map f m)(* functional induction map elt elt' f m. *) (* Marche pas ??? *)elt, elt':Typem:t eltx:keye:eltf:elt -> elt'MapsTo x e m -> MapsTo x (f e) (map f m)elt, elt':Typex:keye:eltf:elt -> elt'MapsTo x e nil -> MapsTo x (f e) (map f nil)elt, elt':Typea:(X.t * elt)%typem:list (X.t * elt)x:keye:eltf:elt -> elt'IHm:MapsTo x e m -> MapsTo x (f e) (map f m)MapsTo x e (a :: m) -> MapsTo x (f e) (map f (a :: m))elt, elt':Typea:(X.t * elt)%typem:list (X.t * elt)x:keye:eltf:elt -> elt'IHm:MapsTo x e m -> MapsTo x (f e) (map f m)MapsTo x e (a :: m) -> MapsTo x (f e) (map f (a :: m))elt, elt':Typex':X.te':eltm:list (X.t * elt)x:keye:eltf:elt -> elt'IHm:MapsTo x e m -> MapsTo x (f e) (map f m)MapsTo x e ((x', e') :: m) -> MapsTo x (f e) (map f ((x', e') :: m))elt, elt':Typex':X.te':eltm:list (X.t * elt)x:keye:eltf:elt -> elt'IHm:MapsTo x e m -> MapsTo x (f e) (map f m)MapsTo x e ((x', e') :: m) -> MapsTo x (f e) ((x', f e') :: map f m)elt, elt':Typex':X.te':eltm:list (X.t * elt)x:keye:eltf:elt -> elt'IHm:MapsTo x e m -> MapsTo x (f e) (map f m)H0:eqke (x, e) (x', e')MapsTo x (f e) ((x', f e') :: map f m)elt, elt':Typex':X.te':eltm:list (X.t * elt)x:keye:eltf:elt -> elt'IHm:MapsTo x e m -> MapsTo x (f e) (map f m)H0:InA (eqke (elt:=elt)) (x, e) mMapsTo x (f e) ((x', f e') :: map f m)elt, elt':Typex':X.te':eltm:list (X.t * elt)x:keye:eltf:elt -> elt'IHm:MapsTo x e m -> MapsTo x (f e) (map f m)H0:eqke (x, e) (x', e')eqke (x, f e) (x', f e')elt, elt':Typex':X.te':eltm:list (X.t * elt)x:keye:eltf:elt -> elt'IHm:MapsTo x e m -> MapsTo x (f e) (map f m)H0:InA (eqke (elt:=elt)) (x, e) mMapsTo x (f e) ((x', f e') :: map f m)elt, elt':Typex':X.te':eltm:list (X.t * elt)x:keye:eltf:elt -> elt'IHm:MapsTo x e m -> MapsTo x (f e) (map f m)H0:InA (eqke (elt:=elt)) (x, e) mMapsTo x (f e) ((x', f e') :: map f m)unfold MapsTo in *; auto. Qed.elt, elt':Typex':X.te':eltm:list (X.t * elt)x:keye:eltf:elt -> elt'IHm:MapsTo x e m -> MapsTo x (f e) (map f m)H0:InA (eqke (elt:=elt)) (x, e) mInA (eqke (elt:=elt')) (x, f e) (map f m)elt, elt':Typeforall (m : t elt) (x : key) (f : elt -> elt'), In x (map f m) -> In x melt, elt':Typeforall (m : t elt) (x : key) (f : elt -> elt'), In x (map f m) -> In x m(* functional induction map elt elt' f m. *) (* Marche pas ??? *)elt, elt':Typem:t eltx:keyf:elt -> elt'In x (map f m) -> In x melt, elt':Typex:keyf:elt -> elt'In x nil -> In x nilelt, elt':Typea:(X.t * elt)%typem:list (X.t * elt)x:keyf:elt -> elt'IHm:In x (map f m) -> In x mIn x (let (k, e) := a in (k, f e) :: map f m) -> In x (a :: m)elt, elt':Typex:keyf:elt -> elt'e:elt'abs:MapsTo x e nilIn x nilelt, elt':Typea:(X.t * elt)%typem:list (X.t * elt)x:keyf:elt -> elt'IHm:In x (map f m) -> In x mIn x (let (k, e) := a in (k, f e) :: map f m) -> In x (a :: m)elt, elt':Typea:(X.t * elt)%typem:list (X.t * elt)x:keyf:elt -> elt'IHm:In x (map f m) -> In x mIn x (let (k, e) := a in (k, f e) :: map f m) -> In x (a :: m)elt, elt':Typex':X.te:eltm:list (X.t * elt)x:keyf:elt -> elt'IHm:In x (map f m) -> In x mIn x ((x', f e) :: map f m) -> In x ((x', e) :: m)elt, elt':Typex':X.te:eltm:list (X.t * elt)x:keyf:elt -> elt'IHm:In x (map f m) -> In x mhyp:In x ((x', f e) :: map f m)In x ((x', e) :: m)elt, elt':Typex':X.te:eltm:list (X.t * elt)x:keyf:elt -> elt'IHm:In x (map f m) -> In x mhyp:In x ((x', f e) :: map f m)x0:elt'H:MapsTo x x0 ((x', f e) :: map f m)In x ((x', e) :: m)elt, elt':Typex':X.te:eltm:list (X.t * elt)x:keyf:elt -> elt'IHm:In x (map f m) -> In x mx0:elt'H:MapsTo x x0 ((x', f e) :: map f m)In x ((x', e) :: m)elt, elt':Typex':X.te:eltm:list (X.t * elt)x:keyf:elt -> elt'IHm:In x (map f m) -> In x me':elt'H:MapsTo x e' ((x', f e) :: map f m)H1:eqke (x, e') (x', f e)In x ((x', e) :: m)elt, elt':Typex':X.te:eltm:list (X.t * elt)x:keyf:elt -> elt'IHm:In x (map f m) -> In x me':elt'H:MapsTo x e' ((x', f e) :: map f m)H1:InA (eqke (elt:=elt')) (x, e') (map f m)In x ((x', e) :: m)elt, elt':Typex':X.te:eltm:list (X.t * elt)x:keyf:elt -> elt'IHm:In x (map f m) -> In x me':elt'H:MapsTo x e' ((x', f e) :: map f m)H1:eqke (x, e') (x', f e)eqke (x, e) (x', e)elt, elt':Typex':X.te:eltm:list (X.t * elt)x:keyf:elt -> elt'IHm:In x (map f m) -> In x me':elt'H:MapsTo x e' ((x', f e) :: map f m)H1:InA (eqke (elt:=elt')) (x, e') (map f m)In x ((x', e) :: m)elt, elt':Typex':X.te:eltm:list (X.t * elt)x:keyf:elt -> elt'IHm:In x (map f m) -> In x me':elt'H:MapsTo x e' ((x', f e) :: map f m)H1:InA (eqke (elt:=elt')) (x, e') (map f m)In x ((x', e) :: m)elt, elt':Typex':X.te:eltm:list (X.t * elt)x:keyf:elt -> elt'e':elt'H:MapsTo x e' ((x', f e) :: map f m)H1:InA (eqke (elt:=elt')) (x, e') (map f m)In x (map f m)elt, elt':Typex':X.te:eltm:list (X.t * elt)x:keyf:elt -> elt'e':elt'H:MapsTo x e' ((x', f e) :: map f m)H1:InA (eqke (elt:=elt')) (x, e') (map f m)e'':elthyp:MapsTo x e'' mIn x ((x', e) :: m)elt, elt':Typex':X.te:eltm:list (X.t * elt)x:keyf:elt -> elt'e':elt'H:MapsTo x e' ((x', f e) :: map f m)H1:InA (eqke (elt:=elt')) (x, e') (map f m)e'':elthyp:MapsTo x e'' mIn x ((x', e) :: m)constructor 2; auto. Qed.elt, elt':Typex':X.te:eltm:list (X.t * elt)x:keyf:elt -> elt'e':elt'H:MapsTo x e' ((x', f e) :: map f m)H1:InA (eqke (elt:=elt')) (x, e') (map f m)e'':elthyp:MapsTo x e'' mMapsTo x e'' ((x', e) :: m)elt, elt':Typeforall m : list (X.t * elt), NoDupA (eqk (elt:=elt)) m -> forall f : elt -> elt', NoDupA (eqk (elt:=elt')) (map f m)elt, elt':Typeforall m : list (X.t * elt), NoDupA (eqk (elt:=elt)) m -> forall f : elt -> elt', NoDupA (eqk (elt:=elt')) (map f m)elt, elt':Typea:(X.t * elt)%typem:list (X.t * elt)IHm:NoDupA (eqk (elt:=elt)) m -> forall f : elt -> elt', NoDupA (eqk (elt:=elt')) (map f m)NoDupA (eqk (elt:=elt)) (a :: m) -> forall f : elt -> elt', NoDupA (eqk (elt:=elt')) (let (k, e) := a in (k, f e) :: map f m)elt, elt':Typea:(X.t * elt)%typem:list (X.t * elt)IHm:NoDupA (eqk (elt:=elt)) m -> forall f0 : elt -> elt', NoDupA (eqk (elt:=elt')) (map f0 m)Hm:NoDupA (eqk (elt:=elt)) (a :: m)f:elt -> elt'NoDupA (eqk (elt:=elt')) (let (k, e) := a in (k, f e) :: map f m)elt, elt':Typex':X.te':eltm:list (X.t * elt)IHm:NoDupA (eqk (elt:=elt)) m -> forall f0 : elt -> elt', NoDupA (eqk (elt:=elt')) (map f0 m)Hm:NoDupA (eqk (elt:=elt)) ((x', e') :: m)f:elt -> elt'NoDupA (eqk (elt:=elt')) ((x', f e') :: map f m)elt, elt':Typex':X.te':eltm:list (X.t * elt)IHm:NoDupA (eqk (elt:=elt)) m -> forall f0 : elt -> elt', NoDupA (eqk (elt:=elt')) (map f0 m)f:elt -> elt'H:~ InA (eqk (elt:=elt)) (x', e') mH0:NoDupA (eqk (elt:=elt)) mNoDupA (eqk (elt:=elt')) ((x', f e') :: map f m)elt, elt':Typex':X.te':eltm:list (X.t * elt)IHm:NoDupA (eqk (elt:=elt)) m -> forall f0 : elt -> elt', NoDupA (eqk (elt:=elt')) (map f0 m)f:elt -> elt'H:~ InA (eqk (elt:=elt)) (x', e') mH0:NoDupA (eqk (elt:=elt)) m~ InA (eqk (elt:=elt')) (x', f e') (map f m)(* il faut un map_1 avec eqk au lieu de eqke *)elt, elt':Typex':X.te':eltm:list (X.t * elt)IHm:NoDupA (eqk (elt:=elt)) m -> forall f0 : elt -> elt', NoDupA (eqk (elt:=elt')) (map f0 m)f:elt -> elt'H0:NoDupA (eqk (elt:=elt)) mH:InA (eqk (elt:=elt')) (x', f e') (map f m)InA (eqk (elt:=elt)) (x', e') melt, elt':Typex':X.te':eltm:list (X.t * elt)f:elt -> elt'H:InA (eqk (elt:=elt')) (x', f e') (map f m)InA (eqk (elt:=elt)) (x', e') melt, elt':Typex':X.te':eltf:elt -> elt'H:InA (eqk (elt:=elt')) (x', f e') nilInA (eqk (elt:=elt)) (x', e') nilelt, elt':Typex':X.te':elta:(X.t * elt)%typem:list (X.t * elt)f:elt -> elt'H:InA (eqk (elt:=elt')) (x', f e') (let (k, e) := a in (k, f e) :: map f m)IHm:InA (eqk (elt:=elt')) (x', f e') (map f m) -> InA (eqk (elt:=elt)) (x', e') mInA (eqk (elt:=elt)) (x', e') (a :: m)destruct a; inversion H; auto. Qed.elt, elt':Typex':X.te':elta:(X.t * elt)%typem:list (X.t * elt)f:elt -> elt'H:InA (eqk (elt:=elt')) (x', f e') (let (k, e) := a in (k, f e) :: map f m)IHm:InA (eqk (elt:=elt')) (x', f e') (map f m) -> InA (eqk (elt:=elt)) (x', e') mInA (eqk (elt:=elt)) (x', e') (a :: m)
Specification of mapi
elt, elt':Typeforall (m : t elt) (x : key) (e : elt) (f : key -> elt -> elt'), MapsTo x e m -> exists y : X.t, X.eq y x /\ MapsTo x (f y e) (mapi f m)elt, elt':Typeforall (m : t elt) (x : key) (e : elt) (f : key -> elt -> elt'), MapsTo x e m -> exists y : X.t, X.eq y x /\ MapsTo x (f y e) (mapi f m)(* functional induction mapi elt elt' f m. *) (* Marche pas ??? *)elt, elt':Typem:t eltx:keye:eltf:key -> elt -> elt'MapsTo x e m -> exists y : X.t, X.eq y x /\ MapsTo x (f y e) (mapi f m)elt, elt':Typex:keye:eltf:key -> elt -> elt'MapsTo x e nil -> exists y : X.t, X.eq y x /\ MapsTo x (f y e) (mapi f nil)elt, elt':Typea:(X.t * elt)%typem:list (X.t * elt)x:keye:eltf:key -> elt -> elt'IHm:MapsTo x e m -> exists y : X.t, X.eq y x /\ MapsTo x (f y e) (mapi f m)MapsTo x e (a :: m) -> exists y : X.t, X.eq y x /\ MapsTo x (f y e) (mapi f (a :: m))elt, elt':Typea:(X.t * elt)%typem:list (X.t * elt)x:keye:eltf:key -> elt -> elt'IHm:MapsTo x e m -> exists y : X.t, X.eq y x /\ MapsTo x (f y e) (mapi f m)MapsTo x e (a :: m) -> exists y : X.t, X.eq y x /\ MapsTo x (f y e) (mapi f (a :: m))elt, elt':Typex':X.te':eltm:list (X.t * elt)x:keye:eltf:key -> elt -> elt'IHm:MapsTo x e m -> exists y : X.t, X.eq y x /\ MapsTo x (f y e) (mapi f m)MapsTo x e ((x', e') :: m) -> exists y : X.t, X.eq y x /\ MapsTo x (f y e) (mapi f ((x', e') :: m))elt, elt':Typex':X.te':eltm:list (X.t * elt)x:keye:eltf:key -> elt -> elt'IHm:MapsTo x e m -> exists y : X.t, X.eq y x /\ MapsTo x (f y e) (mapi f m)MapsTo x e ((x', e') :: m) -> exists y : X.t, X.eq y x /\ MapsTo x (f y e) ((x', f x' e') :: mapi f m)elt, elt':Typex':X.te':eltm:list (X.t * elt)x:keye:eltf:key -> elt -> elt'IHm:MapsTo x e m -> exists y : X.t, X.eq y x /\ MapsTo x (f y e) (mapi f m)H0:eqke (x, e) (x', e')exists y : X.t, X.eq y x /\ MapsTo x (f y e) ((x', f x' e') :: mapi f m)elt, elt':Typex':X.te':eltm:list (X.t * elt)x:keye:eltf:key -> elt -> elt'IHm:MapsTo x e m -> exists y : X.t, X.eq y x /\ MapsTo x (f y e) (mapi f m)H0:InA (eqke (elt:=elt)) (x, e) mexists y : X.t, X.eq y x /\ MapsTo x (f y e) ((x', f x' e') :: mapi f m)elt, elt':Typex':X.te':eltm:list (X.t * elt)x:keye:eltf:key -> elt -> elt'IHm:MapsTo x e m -> exists y : X.t, X.eq y x /\ MapsTo x (f y e) (mapi f m)H0:eqke (x, e) (x', e')X.eq x' x /\ MapsTo x (f x' e) ((x', f x' e') :: mapi f m)elt, elt':Typex':X.te':eltm:list (X.t * elt)x:keye:eltf:key -> elt -> elt'IHm:MapsTo x e m -> exists y : X.t, X.eq y x /\ MapsTo x (f y e) (mapi f m)H0:InA (eqke (elt:=elt)) (x, e) mexists y : X.t, X.eq y x /\ MapsTo x (f y e) ((x', f x' e') :: mapi f m)elt, elt':Typex':X.te':eltm:list (X.t * elt)x:keye:eltf:key -> elt -> elt'IHm:MapsTo x e m -> exists y : X.t, X.eq y x /\ MapsTo x (f y e) (mapi f m)H:X.eq x x'H0:e = e'X.eq x' x /\ MapsTo x (f x' e) ((x', f x' e') :: mapi f m)elt, elt':Typex':X.te':eltm:list (X.t * elt)x:keye:eltf:key -> elt -> elt'IHm:MapsTo x e m -> exists y : X.t, X.eq y x /\ MapsTo x (f y e) (mapi f m)H0:InA (eqke (elt:=elt)) (x, e) mexists y : X.t, X.eq y x /\ MapsTo x (f y e) ((x', f x' e') :: mapi f m)elt, elt':Typex':X.te':eltm:list (X.t * elt)x:keye:eltf:key -> elt -> elt'IHm:MapsTo x e m -> exists y : X.t, X.eq y x /\ MapsTo x (f y e) (mapi f m)H:X.eq x x'H0:e = e'MapsTo x (f x' e) ((x', f x' e') :: mapi f m)elt, elt':Typex':X.te':eltm:list (X.t * elt)x:keye:eltf:key -> elt -> elt'IHm:MapsTo x e m -> exists y : X.t, X.eq y x /\ MapsTo x (f y e) (mapi f m)H0:InA (eqke (elt:=elt)) (x, e) mexists y : X.t, X.eq y x /\ MapsTo x (f y e) ((x', f x' e') :: mapi f m)elt, elt':Typex':X.te':eltm:list (X.t * elt)x:keye:eltf:key -> elt -> elt'IHm:MapsTo x e m -> exists y : X.t, X.eq y x /\ MapsTo x (f y e) (mapi f m)H:X.eq x x'H0:e = e'eqke (x, f x' e) (x', f x' e')elt, elt':Typex':X.te':eltm:list (X.t * elt)x:keye:eltf:key -> elt -> elt'IHm:MapsTo x e m -> exists y : X.t, X.eq y x /\ MapsTo x (f y e) (mapi f m)H0:InA (eqke (elt:=elt)) (x, e) mexists y : X.t, X.eq y x /\ MapsTo x (f y e) ((x', f x' e') :: mapi f m)elt, elt':Typex':X.te':eltm:list (X.t * elt)x:keye:eltf:key -> elt -> elt'IHm:MapsTo x e m -> exists y : X.t, X.eq y x /\ MapsTo x (f y e) (mapi f m)H0:InA (eqke (elt:=elt)) (x, e) mexists y : X.t, X.eq y x /\ MapsTo x (f y e) ((x', f x' e') :: mapi f m)exists y; intuition. Qed.elt, elt':Typex':X.te':eltm:list (X.t * elt)x:keye:eltf:key -> elt -> elt'H0:InA (eqke (elt:=elt)) (x, e) my:X.thyp:X.eq y x /\ MapsTo x (f y e) (mapi f m)exists y0 : X.t, X.eq y0 x /\ MapsTo x (f y0 e) ((x', f x' e') :: mapi f m)elt, elt':Typeforall (m : t elt) (x : key) (f : key -> elt -> elt'), In x (mapi f m) -> In x melt, elt':Typeforall (m : t elt) (x : key) (f : key -> elt -> elt'), In x (mapi f m) -> In x m(* functional induction mapi elt elt' f m. *) (* Marche pas ??? *)elt, elt':Typem:t eltx:keyf:key -> elt -> elt'In x (mapi f m) -> In x melt, elt':Typex:keyf:key -> elt -> elt'In x nil -> In x nilelt, elt':Typea:(X.t * elt)%typem:list (X.t * elt)x:keyf:key -> elt -> elt'IHm:In x (mapi f m) -> In x mIn x (let (k, e) := a in (k, f k e) :: mapi f m) -> In x (a :: m)elt, elt':Typex:keyf:key -> elt -> elt'e:elt'abs:MapsTo x e nilIn x nilelt, elt':Typea:(X.t * elt)%typem:list (X.t * elt)x:keyf:key -> elt -> elt'IHm:In x (mapi f m) -> In x mIn x (let (k, e) := a in (k, f k e) :: mapi f m) -> In x (a :: m)elt, elt':Typea:(X.t * elt)%typem:list (X.t * elt)x:keyf:key -> elt -> elt'IHm:In x (mapi f m) -> In x mIn x (let (k, e) := a in (k, f k e) :: mapi f m) -> In x (a :: m)elt, elt':Typex':X.te:eltm:list (X.t * elt)x:keyf:key -> elt -> elt'IHm:In x (mapi f m) -> In x mIn x ((x', f x' e) :: mapi f m) -> In x ((x', e) :: m)elt, elt':Typex':X.te:eltm:list (X.t * elt)x:keyf:key -> elt -> elt'IHm:In x (mapi f m) -> In x mhyp:In x ((x', f x' e) :: mapi f m)In x ((x', e) :: m)elt, elt':Typex':X.te:eltm:list (X.t * elt)x:keyf:key -> elt -> elt'IHm:In x (mapi f m) -> In x mhyp:In x ((x', f x' e) :: mapi f m)x0:elt'H:MapsTo x x0 ((x', f x' e) :: mapi f m)In x ((x', e) :: m)elt, elt':Typex':X.te:eltm:list (X.t * elt)x:keyf:key -> elt -> elt'IHm:In x (mapi f m) -> In x mx0:elt'H:MapsTo x x0 ((x', f x' e) :: mapi f m)In x ((x', e) :: m)elt, elt':Typex':X.te:eltm:list (X.t * elt)x:keyf:key -> elt -> elt'IHm:In x (mapi f m) -> In x me':elt'H:MapsTo x e' ((x', f x' e) :: mapi f m)H1:eqke (x, e') (x', f x' e)In x ((x', e) :: m)elt, elt':Typex':X.te:eltm:list (X.t * elt)x:keyf:key -> elt -> elt'IHm:In x (mapi f m) -> In x me':elt'H:MapsTo x e' ((x', f x' e) :: mapi f m)H1:InA (eqke (elt:=elt')) (x, e') (mapi f m)In x ((x', e) :: m)elt, elt':Typex':X.te:eltm:list (X.t * elt)x:keyf:key -> elt -> elt'IHm:In x (mapi f m) -> In x me':elt'H:MapsTo x e' ((x', f x' e) :: mapi f m)H1:eqke (x, e') (x', f x' e)eqke (x, e) (x', e)elt, elt':Typex':X.te:eltm:list (X.t * elt)x:keyf:key -> elt -> elt'IHm:In x (mapi f m) -> In x me':elt'H:MapsTo x e' ((x', f x' e) :: mapi f m)H1:InA (eqke (elt:=elt')) (x, e') (mapi f m)In x ((x', e) :: m)elt, elt':Typex':X.te:eltm:list (X.t * elt)x:keyf:key -> elt -> elt'IHm:In x (mapi f m) -> In x me':elt'H:MapsTo x e' ((x', f x' e) :: mapi f m)H1:InA (eqke (elt:=elt')) (x, e') (mapi f m)In x ((x', e) :: m)elt, elt':Typex':X.te:eltm:list (X.t * elt)x:keyf:key -> elt -> elt'e':elt'H:MapsTo x e' ((x', f x' e) :: mapi f m)H1:InA (eqke (elt:=elt')) (x, e') (mapi f m)In x (mapi f m)elt, elt':Typex':X.te:eltm:list (X.t * elt)x:keyf:key -> elt -> elt'e':elt'H:MapsTo x e' ((x', f x' e) :: mapi f m)H1:InA (eqke (elt:=elt')) (x, e') (mapi f m)e'':elthyp:MapsTo x e'' mIn x ((x', e) :: m)elt, elt':Typex':X.te:eltm:list (X.t * elt)x:keyf:key -> elt -> elt'e':elt'H:MapsTo x e' ((x', f x' e) :: mapi f m)H1:InA (eqke (elt:=elt')) (x, e') (mapi f m)e'':elthyp:MapsTo x e'' mIn x ((x', e) :: m)constructor 2; auto. Qed.elt, elt':Typex':X.te:eltm:list (X.t * elt)x:keyf:key -> elt -> elt'e':elt'H:MapsTo x e' ((x', f x' e) :: mapi f m)H1:InA (eqke (elt:=elt')) (x, e') (mapi f m)e'':elthyp:MapsTo x e'' mMapsTo x e'' ((x', e) :: m)elt, elt':Typeforall m : list (X.t * elt), NoDupA (eqk (elt:=elt)) m -> forall f : key -> elt -> elt', NoDupA (eqk (elt:=elt')) (mapi f m)elt, elt':Typeforall m : list (X.t * elt), NoDupA (eqk (elt:=elt)) m -> forall f : key -> elt -> elt', NoDupA (eqk (elt:=elt')) (mapi f m)elt, elt':Typea:(X.t * elt)%typem:list (X.t * elt)IHm:NoDupA (eqk (elt:=elt)) m -> forall f : key -> elt -> elt', NoDupA (eqk (elt:=elt')) (mapi f m)NoDupA (eqk (elt:=elt)) (a :: m) -> forall f : key -> elt -> elt', NoDupA (eqk (elt:=elt')) (let (k, e) := a in (k, f k e) :: mapi f m)elt, elt':Typea:(X.t * elt)%typem:list (X.t * elt)IHm:NoDupA (eqk (elt:=elt)) m -> forall f0 : key -> elt -> elt', NoDupA (eqk (elt:=elt')) (mapi f0 m)Hm:NoDupA (eqk (elt:=elt)) (a :: m)f:key -> elt -> elt'NoDupA (eqk (elt:=elt')) (let (k, e) := a in (k, f k e) :: mapi f m)elt, elt':Typex':X.te':eltm:list (X.t * elt)IHm:NoDupA (eqk (elt:=elt)) m -> forall f0 : key -> elt -> elt', NoDupA (eqk (elt:=elt')) (mapi f0 m)Hm:NoDupA (eqk (elt:=elt)) ((x', e') :: m)f:key -> elt -> elt'NoDupA (eqk (elt:=elt')) ((x', f x' e') :: mapi f m)elt, elt':Typex':X.te':eltm:list (X.t * elt)IHm:NoDupA (eqk (elt:=elt)) m -> forall f0 : key -> elt -> elt', NoDupA (eqk (elt:=elt')) (mapi f0 m)f:key -> elt -> elt'H:~ InA (eqk (elt:=elt)) (x', e') mH0:NoDupA (eqk (elt:=elt)) mNoDupA (eqk (elt:=elt')) ((x', f x' e') :: mapi f m)elt, elt':Typex':X.te':eltm:list (X.t * elt)IHm:NoDupA (eqk (elt:=elt)) m -> forall f0 : key -> elt -> elt', NoDupA (eqk (elt:=elt')) (mapi f0 m)f:key -> elt -> elt'H:~ InA (eqk (elt:=elt)) (x', e') mH0:NoDupA (eqk (elt:=elt)) m~ InA (eqk (elt:=elt')) (x', f x' e') (mapi f m)elt, elt':Typex':X.te':eltm:list (X.t * elt)IHm:NoDupA (eqk (elt:=elt)) m -> forall f0 : key -> elt -> elt', NoDupA (eqk (elt:=elt')) (mapi f0 m)f:key -> elt -> elt'H0:NoDupA (eqk (elt:=elt)) mH:InA (eqk (elt:=elt')) (x', f x' e') (mapi f m)InA (eqk (elt:=elt)) (x', e') melt, elt':Typex':X.te':eltm:list (X.t * elt)f:key -> elt -> elt'H:InA (eqk (elt:=elt')) (x', f x' e') (mapi f m)InA (eqk (elt:=elt)) (x', e') melt, elt':Typex':X.te':eltf:key -> elt -> elt'H:InA (eqk (elt:=elt')) (x', f x' e') nilInA (eqk (elt:=elt)) (x', e') nilelt, elt':Typex':X.te':elta:(X.t * elt)%typem:list (X.t * elt)f:key -> elt -> elt'H:InA (eqk (elt:=elt')) (x', f x' e') (let (k, e) := a in (k, f k e) :: mapi f m)IHm:InA (eqk (elt:=elt')) (x', f x' e') (mapi f m) -> InA (eqk (elt:=elt)) (x', e') mInA (eqk (elt:=elt)) (x', e') (a :: m)destruct a; inversion_clear H; auto. Qed. End Elt2. Section Elt3. Variable elt elt' elt'' : Type. Notation oee' := (option elt * option elt')%type. Definition combine_l (m:t elt)(m':t elt') : t oee' := mapi (fun k e => (Some e, find k m')) m. Definition combine_r (m:t elt)(m':t elt') : t oee' := mapi (fun k e' => (find k m, Some e')) m'. Definition fold_right_pair (A B C:Type)(f:A->B->C->C) := List.fold_right (fun p => f (fst p) (snd p)). Definition combine (m:t elt)(m':t elt') : t oee' := let l := combine_l m m' in let r := combine_r m m' in fold_right_pair (add (elt:=oee')) r l.elt, elt':Typex':X.te':elta:(X.t * elt)%typem:list (X.t * elt)f:key -> elt -> elt'H:InA (eqk (elt:=elt')) (x', f x' e') (let (k, e) := a in (k, f k e) :: mapi f m)IHm:InA (eqk (elt:=elt')) (x', f x' e') (mapi f m) -> InA (eqk (elt:=elt)) (x', e') mInA (eqk (elt:=elt)) (x', e') (a :: m)elt, elt', elt'':Typeforall l r : list (X.t * oee'), NoDupA (eqk (elt:=oee')) l -> NoDupA (eqk (elt:=oee')) r -> NoDupA (eqk (elt:=oee')) (fold_right_pair (add (elt:=oee')) r l)elt, elt', elt'':Typeforall l r : list (X.t * oee'), NoDupA (eqk (elt:=oee')) l -> NoDupA (eqk (elt:=oee')) r -> NoDupA (eqk (elt:=oee')) (fold_right_pair (add (elt:=oee')) r l)elt, elt', elt'':Typea:(X.t * oee')%typel:list (X.t * oee')IHl:forall r : list (X.t * oee'), NoDupA (eqk (elt:=oee')) l -> NoDupA (eqk (elt:=oee')) r -> NoDupA (eqk (elt:=oee')) (fold_right_pair (add (elt:=oee')) r l)forall r : list (X.t * oee'), NoDupA (eqk (elt:=oee')) (a :: l) -> NoDupA (eqk (elt:=oee')) r -> NoDupA (eqk (elt:=oee')) (add (fst a) (snd a) (fold_right_pair (add (elt:=oee')) r l))elt, elt', elt'':Typet0:X.tp:oee'l:list (X.t * oee')IHl:forall r : list (X.t * oee'), NoDupA (eqk (elt:=oee')) l -> NoDupA (eqk (elt:=oee')) r -> NoDupA (eqk (elt:=oee')) (fold_right_pair (add (elt:=oee')) r l)forall r : list (X.t * oee'), NoDupA (eqk (elt:=oee')) ((t0, p) :: l) -> NoDupA (eqk (elt:=oee')) r -> NoDupA (eqk (elt:=oee')) (add t0 p (fold_right_pair (add (elt:=oee')) r l))intros; apply add_NoDup; auto. Qed. Hint Resolve fold_right_pair_NoDup : core.elt, elt', elt'':Typet0:X.tp:oee'l:list (X.t * oee')IHl:forall r0 : list (X.t * oee'), NoDupA (eqk (elt:=oee')) l -> NoDupA (eqk (elt:=oee')) r0 -> NoDupA (eqk (elt:=oee')) (fold_right_pair (add (elt:=oee')) r0 l)r:list (X.t * oee')H:~ InA (eqk (elt:=oee')) (t0, p) lH0:NoDupA (eqk (elt:=oee')) lNoDupA (eqk (elt:=oee')) r -> NoDupA (eqk (elt:=oee')) (add t0 p (fold_right_pair (add (elt:=oee')) r l))elt, elt', elt'':Typeforall m : list (X.t * elt), NoDupA (eqk (elt:=elt)) m -> forall m' : list (X.t * elt'), NoDupA (eqk (elt:=elt')) m' -> NoDupA (eqk (elt:=oee')) (combine m m')elt, elt', elt'':Typeforall m : list (X.t * elt), NoDupA (eqk (elt:=elt)) m -> forall m' : list (X.t * elt'), NoDupA (eqk (elt:=elt')) m' -> NoDupA (eqk (elt:=oee')) (combine m m')elt, elt', elt'':Typeforall m : list (X.t * elt), NoDupA (eqk (elt:=elt)) m -> forall m' : list (X.t * elt'), NoDupA (eqk (elt:=elt')) m' -> NoDupA (eqk (elt:=oee')) (fold_right_pair (add (elt:=oee')) (mapi (fun (k : key) (e' : elt') => (find (elt:=elt) k m, Some e')) m') (mapi (fun (k : key) (e : elt) => (Some e, find (elt:=elt') k m')) m))elt, elt', elt'':Typem:list (X.t * elt)Hm:NoDupA (eqk (elt:=elt)) mm':list (X.t * elt')Hm':NoDupA (eqk (elt:=elt')) m'NoDupA (eqk (elt:=oee')) (fold_right_pair (add (elt:=oee')) (mapi (fun (k : key) (e' : elt') => (find (elt:=elt) k m, Some e')) m') (mapi (fun (k : key) (e : elt) => (Some e, find (elt:=elt') k m')) m))elt, elt', elt'':Typem:list (X.t * elt)Hm:NoDupA (eqk (elt:=elt)) mm':list (X.t * elt')Hm':NoDupA (eqk (elt:=elt')) m'f1:=fun (k : key) (e : elt) => (Some e, find (elt:=elt') k m'):key -> elt -> oee'NoDupA (eqk (elt:=oee')) (fold_right_pair (add (elt:=oee')) (mapi (fun (k : key) (e' : elt') => (find (elt:=elt) k m, Some e')) m') (mapi f1 m))elt, elt', elt'':Typem:list (X.t * elt)Hm:NoDupA (eqk (elt:=elt)) mm':list (X.t * elt')Hm':NoDupA (eqk (elt:=elt')) m'f1:=fun (k : key) (e : elt) => (Some e, find (elt:=elt') k m'):key -> elt -> oee'f2:=fun (k : key) (e' : elt') => (find (elt:=elt) k m, Some e'):key -> elt' -> oee'NoDupA (eqk (elt:=oee')) (fold_right_pair (add (elt:=oee')) (mapi f2 m') (mapi f1 m))elt, elt', elt'':Typem:list (X.t * elt)Hm:NoDupA (eqk (elt:=elt)) mm':list (X.t * elt')Hm':NoDupA (eqk (elt:=elt')) m'f1:=fun (k : key) (e : elt) => (Some e, find (elt:=elt') k m'):key -> elt -> oee'f2:=fun (k : key) (e' : elt') => (find (elt:=elt) k m, Some e'):key -> elt' -> oee'NoDupA (eqk (elt:=oee')) (mapi f1 m) -> NoDupA (eqk (elt:=oee')) (fold_right_pair (add (elt:=oee')) (mapi f2 m') (mapi f1 m))elt, elt', elt'':Typem:list (X.t * elt)Hm:NoDupA (eqk (elt:=elt)) mm':list (X.t * elt')Hm':NoDupA (eqk (elt:=elt')) m'f1:=fun (k : key) (e : elt) => (Some e, find (elt:=elt') k m'):key -> elt -> oee'f2:=fun (k : key) (e' : elt') => (find (elt:=elt) k m, Some e'):key -> elt' -> oee'NoDupA (eqk (elt:=oee')) (mapi f2 m') -> NoDupA (eqk (elt:=oee')) (mapi f1 m) -> NoDupA (eqk (elt:=oee')) (fold_right_pair (add (elt:=oee')) (mapi f2 m') (mapi f1 m))elt, elt', elt'':Typem:list (X.t * elt)Hm:NoDupA (eqk (elt:=elt)) mm':list (X.t * elt')Hm':NoDupA (eqk (elt:=elt')) m'f1:=fun (k : key) (e : elt) => (Some e, find (elt:=elt') k m'):key -> elt -> oee'f2:=fun (k : key) (e' : elt') => (find (elt:=elt) k m, Some e'):key -> elt' -> oee'l:t oee'NoDupA (eqk (elt:=oee')) (mapi f2 m') -> NoDupA (eqk (elt:=oee')) l -> NoDupA (eqk (elt:=oee')) (fold_right_pair (add (elt:=oee')) (mapi f2 m') l)auto. Qed. Definition at_least_left (o:option elt)(o':option elt') := match o with | None => None | _ => Some (o,o') end. Definition at_least_right (o:option elt)(o':option elt') := match o' with | None => None | _ => Some (o,o') end.elt, elt', elt'':Typem:list (X.t * elt)Hm:NoDupA (eqk (elt:=elt)) mm':list (X.t * elt')Hm':NoDupA (eqk (elt:=elt')) m'f1:=fun (k : key) (e : elt) => (Some e, find (elt:=elt') k m'):key -> elt -> oee'f2:=fun (k : key) (e' : elt') => (find (elt:=elt) k m, Some e'):key -> elt' -> oee'l, r:t oee'NoDupA (eqk (elt:=oee')) r -> NoDupA (eqk (elt:=oee')) l -> NoDupA (eqk (elt:=oee')) (fold_right_pair (add (elt:=oee')) r l)elt, elt', elt'':Typeforall m : list (X.t * elt), NoDupA (eqk (elt:=elt)) m -> forall m' : list (X.t * elt'), NoDupA (eqk (elt:=elt')) m' -> forall x : key, find (elt:=oee') x (combine_l m m') = at_least_left (find (elt:=elt) x m) (find (elt:=elt') x m')elt, elt', elt'':Typeforall m : list (X.t * elt), NoDupA (eqk (elt:=elt)) m -> forall m' : list (X.t * elt'), NoDupA (eqk (elt:=elt')) m' -> forall x : key, find (elt:=oee') x (combine_l m m') = at_least_left (find (elt:=elt) x m) (find (elt:=elt') x m')elt, elt', elt'':Typeforall m : list (X.t * elt), NoDupA (eqk (elt:=elt)) m -> forall m' : list (X.t * elt'), NoDupA (eqk (elt:=elt')) m' -> forall x : key, find (elt:=oee') x (mapi (fun (k : key) (e : elt) => (Some e, find (elt:=elt') k m')) m) = at_least_left (find (elt:=elt) x m) (find (elt:=elt') x m')elt, elt', elt'':Typem:list (X.t * elt)Hm:NoDupA (eqk (elt:=elt)) mm':list (X.t * elt')Hm':NoDupA (eqk (elt:=elt')) m'x:keyfind (elt:=oee') x (mapi (fun (k : key) (e : elt) => (Some e, find (elt:=elt') k m')) m) = at_least_left (find (elt:=elt) x m) (find (elt:=elt') x m')elt, elt', elt'':Typem:list (X.t * elt)Hm:NoDupA (eqk (elt:=elt)) mm':list (X.t * elt')Hm':NoDupA (eqk (elt:=elt')) m'x:keye:eltH:find (elt:=elt) x m = Some efind (elt:=oee') x (mapi (fun (k : key) (e0 : elt) => (Some e0, find (elt:=elt') k m')) m) = at_least_left (Some e) (find (elt:=elt') x m')elt, elt', elt'':Typem:list (X.t * elt)Hm:NoDupA (eqk (elt:=elt)) mm':list (X.t * elt')Hm':NoDupA (eqk (elt:=elt')) m'x:keyH:find (elt:=elt) x m = Nonefind (elt:=oee') x (mapi (fun (k : key) (e : elt) => (Some e, find (elt:=elt') k m')) m) = at_least_left None (find (elt:=elt') x m')elt, elt', elt'':Typem:list (X.t * elt)Hm:NoDupA (eqk (elt:=elt)) mm':list (X.t * elt')Hm':NoDupA (eqk (elt:=elt')) m'x:keye:eltH:find (elt:=elt) x m = Some efind (elt:=oee') x (mapi (fun (k : key) (e0 : elt) => (Some e0, find (elt:=elt') k m')) m) = Some (Some e, find (elt:=elt') x m')elt, elt', elt'':Typem:list (X.t * elt)Hm:NoDupA (eqk (elt:=elt)) mm':list (X.t * elt')Hm':NoDupA (eqk (elt:=elt')) m'x:keyH:find (elt:=elt) x m = Nonefind (elt:=oee') x (mapi (fun (k : key) (e : elt) => (Some e, find (elt:=elt') k m')) m) = at_least_left None (find (elt:=elt') x m')elt, elt', elt'':Typem:list (X.t * elt)Hm:NoDupA (eqk (elt:=elt)) mm':list (X.t * elt')Hm':NoDupA (eqk (elt:=elt')) m'x:keye:eltH:find (elt:=elt) x m = Some eNoDupA (eqk (elt:=oee')) (mapi (fun (k : key) (e0 : elt) => (Some e0, find (elt:=elt') k m')) m)elt, elt', elt'':Typem:list (X.t * elt)Hm:NoDupA (eqk (elt:=elt)) mm':list (X.t * elt')Hm':NoDupA (eqk (elt:=elt')) m'x:keye:eltH:find (elt:=elt) x m = Some eMapsTo x (Some e, find (elt:=elt') x m') (mapi (fun (k : key) (e0 : elt) => (Some e0, find (elt:=elt') k m')) m)elt, elt', elt'':Typem:list (X.t * elt)Hm:NoDupA (eqk (elt:=elt)) mm':list (X.t * elt')Hm':NoDupA (eqk (elt:=elt')) m'x:keyH:find (elt:=elt) x m = Nonefind (elt:=oee') x (mapi (fun (k : key) (e : elt) => (Some e, find (elt:=elt') k m')) m) = at_least_left None (find (elt:=elt') x m')elt, elt', elt'':Typem:list (X.t * elt)Hm:NoDupA (eqk (elt:=elt)) mm':list (X.t * elt')Hm':NoDupA (eqk (elt:=elt')) m'x:keye:eltH:find (elt:=elt) x m = Some eMapsTo x (Some e, find (elt:=elt') x m') (mapi (fun (k : key) (e0 : elt) => (Some e0, find (elt:=elt') k m')) m)elt, elt', elt'':Typem:list (X.t * elt)Hm:NoDupA (eqk (elt:=elt)) mm':list (X.t * elt')Hm':NoDupA (eqk (elt:=elt')) m'x:keyH:find (elt:=elt) x m = Nonefind (elt:=oee') x (mapi (fun (k : key) (e : elt) => (Some e, find (elt:=elt') k m')) m) = at_least_left None (find (elt:=elt') x m')elt, elt', elt'':Typem:list (X.t * elt)Hm:NoDupA (eqk (elt:=elt)) mm':list (X.t * elt')Hm':NoDupA (eqk (elt:=elt')) m'x:keye:eltH:find (elt:=elt) x m = Some ey:X.tH0:X.eq y xH1:MapsTo x (Some e, find (elt:=elt') y m') (mapi (fun (k : key) (e0 : elt) => (Some e0, find (elt:=elt') k m')) m)MapsTo x (Some e, find (elt:=elt') x m') (mapi (fun (k : key) (e0 : elt) => (Some e0, find (elt:=elt') k m')) m)elt, elt', elt'':Typem:list (X.t * elt)Hm:NoDupA (eqk (elt:=elt)) mm':list (X.t * elt')Hm':NoDupA (eqk (elt:=elt')) m'x:keyH:find (elt:=elt) x m = Nonefind (elt:=oee') x (mapi (fun (k : key) (e : elt) => (Some e, find (elt:=elt') k m')) m) = at_least_left None (find (elt:=elt') x m')elt, elt', elt'':Typem:list (X.t * elt)Hm:NoDupA (eqk (elt:=elt)) mm':list (X.t * elt')Hm':NoDupA (eqk (elt:=elt')) m'x:keyH:find (elt:=elt) x m = Nonefind (elt:=oee') x (mapi (fun (k : key) (e : elt) => (Some e, find (elt:=elt') k m')) m) = at_least_left None (find (elt:=elt') x m')elt, elt', elt'':Typem:list (X.t * elt)Hm:NoDupA (eqk (elt:=elt)) mm':list (X.t * elt')Hm':NoDupA (eqk (elt:=elt')) m'x:keyH:find (elt:=elt) x m = Nonefind (elt:=oee') x (mapi (fun (k : key) (e : elt) => (Some e, find (elt:=elt') k m')) m) = Noneelt, elt', elt'':Typem:list (X.t * elt)Hm:NoDupA (eqk (elt:=elt)) mm':list (X.t * elt')Hm':NoDupA (eqk (elt:=elt')) m'x:keyH:find (elt:=elt) x m = Nonep:oee'H0:find (elt:=oee') x (mapi (fun (k : key) (e : elt) => (Some e, find (elt:=elt') k m')) m) = Some pSome p = Noneelt, elt', elt'':Typem:list (X.t * elt)Hm:NoDupA (eqk (elt:=elt)) mm':list (X.t * elt')Hm':NoDupA (eqk (elt:=elt')) m'x:keyH:find (elt:=elt) x m = Nonep:oee'H0:find (elt:=oee') x (mapi (fun (k : key) (e : elt) => (Some e, find (elt:=elt') k m')) m) = Some pIn x (mapi (fun (k : key) (e : elt) => (Some e, find (elt:=elt') k m')) m)elt, elt', elt'':Typem:list (X.t * elt)Hm:NoDupA (eqk (elt:=elt)) mm':list (X.t * elt')Hm':NoDupA (eqk (elt:=elt')) m'x:keyH:find (elt:=elt) x m = Nonep:oee'H0:find (elt:=oee') x (mapi (fun (k : key) (e : elt) => (Some e, find (elt:=elt') k m')) m) = Some px0:eltH1:MapsTo x x0 mSome p = Nonerewrite (find_1 Hm H1) in H; discriminate. Qed.elt, elt', elt'':Typem:list (X.t * elt)Hm:NoDupA (eqk (elt:=elt)) mm':list (X.t * elt')Hm':NoDupA (eqk (elt:=elt')) m'x:keyH:find (elt:=elt) x m = Nonep:oee'H0:find (elt:=oee') x (mapi (fun (k : key) (e : elt) => (Some e, find (elt:=elt') k m')) m) = Some px0:eltH1:MapsTo x x0 mSome p = Noneelt, elt', elt'':Typeforall m : list (X.t * elt), NoDupA (eqk (elt:=elt)) m -> forall m' : list (X.t * elt'), NoDupA (eqk (elt:=elt')) m' -> forall x : key, find (elt:=oee') x (combine_r m m') = at_least_right (find (elt:=elt) x m) (find (elt:=elt') x m')elt, elt', elt'':Typeforall m : list (X.t * elt), NoDupA (eqk (elt:=elt)) m -> forall m' : list (X.t * elt'), NoDupA (eqk (elt:=elt')) m' -> forall x : key, find (elt:=oee') x (combine_r m m') = at_least_right (find (elt:=elt) x m) (find (elt:=elt') x m')elt, elt', elt'':Typeforall m : list (X.t * elt), NoDupA (eqk (elt:=elt)) m -> forall m' : list (X.t * elt'), NoDupA (eqk (elt:=elt')) m' -> forall x : key, find (elt:=oee') x (mapi (fun (k : key) (e' : elt') => (find (elt:=elt) k m, Some e')) m') = at_least_right (find (elt:=elt) x m) (find (elt:=elt') x m')elt, elt', elt'':Typem:list (X.t * elt)Hm:NoDupA (eqk (elt:=elt)) mm':list (X.t * elt')Hm':NoDupA (eqk (elt:=elt')) m'x:keyfind (elt:=oee') x (mapi (fun (k : key) (e' : elt') => (find (elt:=elt) k m, Some e')) m') = at_least_right (find (elt:=elt) x m) (find (elt:=elt') x m')elt, elt', elt'':Typem:list (X.t * elt)Hm:NoDupA (eqk (elt:=elt)) mm':list (X.t * elt')Hm':NoDupA (eqk (elt:=elt')) m'x:keye:elt'H:find (elt:=elt') x m' = Some efind (elt:=oee') x (mapi (fun (k : key) (e' : elt') => (find (elt:=elt) k m, Some e')) m') = at_least_right (find (elt:=elt) x m) (Some e)elt, elt', elt'':Typem:list (X.t * elt)Hm:NoDupA (eqk (elt:=elt)) mm':list (X.t * elt')Hm':NoDupA (eqk (elt:=elt')) m'x:keyH:find (elt:=elt') x m' = Nonefind (elt:=oee') x (mapi (fun (k : key) (e' : elt') => (find (elt:=elt) k m, Some e')) m') = at_least_right (find (elt:=elt) x m) Noneelt, elt', elt'':Typem:list (X.t * elt)Hm:NoDupA (eqk (elt:=elt)) mm':list (X.t * elt')Hm':NoDupA (eqk (elt:=elt')) m'x:keye:elt'H:find (elt:=elt') x m' = Some efind (elt:=oee') x (mapi (fun (k : key) (e' : elt') => (find (elt:=elt) k m, Some e')) m') = Some (find (elt:=elt) x m, Some e)elt, elt', elt'':Typem:list (X.t * elt)Hm:NoDupA (eqk (elt:=elt)) mm':list (X.t * elt')Hm':NoDupA (eqk (elt:=elt')) m'x:keyH:find (elt:=elt') x m' = Nonefind (elt:=oee') x (mapi (fun (k : key) (e' : elt') => (find (elt:=elt) k m, Some e')) m') = at_least_right (find (elt:=elt) x m) Noneelt, elt', elt'':Typem:list (X.t * elt)Hm:NoDupA (eqk (elt:=elt)) mm':list (X.t * elt')Hm':NoDupA (eqk (elt:=elt')) m'x:keye:elt'H:find (elt:=elt') x m' = Some eNoDupA (eqk (elt:=oee')) (mapi (fun (k : key) (e' : elt') => (find (elt:=elt) k m, Some e')) m')elt, elt', elt'':Typem:list (X.t * elt)Hm:NoDupA (eqk (elt:=elt)) mm':list (X.t * elt')Hm':NoDupA (eqk (elt:=elt')) m'x:keye:elt'H:find (elt:=elt') x m' = Some eMapsTo x (find (elt:=elt) x m, Some e) (mapi (fun (k : key) (e' : elt') => (find (elt:=elt) k m, Some e')) m')elt, elt', elt'':Typem:list (X.t * elt)Hm:NoDupA (eqk (elt:=elt)) mm':list (X.t * elt')Hm':NoDupA (eqk (elt:=elt')) m'x:keyH:find (elt:=elt') x m' = Nonefind (elt:=oee') x (mapi (fun (k : key) (e' : elt') => (find (elt:=elt) k m, Some e')) m') = at_least_right (find (elt:=elt) x m) Noneelt, elt', elt'':Typem:list (X.t * elt)Hm:NoDupA (eqk (elt:=elt)) mm':list (X.t * elt')Hm':NoDupA (eqk (elt:=elt')) m'x:keye:elt'H:find (elt:=elt') x m' = Some eMapsTo x (find (elt:=elt) x m, Some e) (mapi (fun (k : key) (e' : elt') => (find (elt:=elt) k m, Some e')) m')elt, elt', elt'':Typem:list (X.t * elt)Hm:NoDupA (eqk (elt:=elt)) mm':list (X.t * elt')Hm':NoDupA (eqk (elt:=elt')) m'x:keyH:find (elt:=elt') x m' = Nonefind (elt:=oee') x (mapi (fun (k : key) (e' : elt') => (find (elt:=elt) k m, Some e')) m') = at_least_right (find (elt:=elt) x m) Noneelt, elt', elt'':Typem:list (X.t * elt)Hm:NoDupA (eqk (elt:=elt)) mm':list (X.t * elt')Hm':NoDupA (eqk (elt:=elt')) m'x:keye:elt'H:find (elt:=elt') x m' = Some ey:X.tH0:X.eq y xH1:MapsTo x (find (elt:=elt) y m, Some e) (mapi (fun (k : key) (e0 : elt') => (find (elt:=elt) k m, Some e0)) m')MapsTo x (find (elt:=elt) x m, Some e) (mapi (fun (k : key) (e' : elt') => (find (elt:=elt) k m, Some e')) m')elt, elt', elt'':Typem:list (X.t * elt)Hm:NoDupA (eqk (elt:=elt)) mm':list (X.t * elt')Hm':NoDupA (eqk (elt:=elt')) m'x:keyH:find (elt:=elt') x m' = Nonefind (elt:=oee') x (mapi (fun (k : key) (e' : elt') => (find (elt:=elt) k m, Some e')) m') = at_least_right (find (elt:=elt) x m) Noneelt, elt', elt'':Typem:list (X.t * elt)Hm:NoDupA (eqk (elt:=elt)) mm':list (X.t * elt')Hm':NoDupA (eqk (elt:=elt')) m'x:keyH:find (elt:=elt') x m' = Nonefind (elt:=oee') x (mapi (fun (k : key) (e' : elt') => (find (elt:=elt) k m, Some e')) m') = at_least_right (find (elt:=elt) x m) Noneelt, elt', elt'':Typem:list (X.t * elt)Hm:NoDupA (eqk (elt:=elt)) mm':list (X.t * elt')Hm':NoDupA (eqk (elt:=elt')) m'x:keyH:find (elt:=elt') x m' = Nonefind (elt:=oee') x (mapi (fun (k : key) (e' : elt') => (find (elt:=elt) k m, Some e')) m') = Noneelt, elt', elt'':Typem:list (X.t * elt)Hm:NoDupA (eqk (elt:=elt)) mm':list (X.t * elt')Hm':NoDupA (eqk (elt:=elt')) m'x:keyH:find (elt:=elt') x m' = Nonep:oee'H0:find (elt:=oee') x (mapi (fun (k : key) (e' : elt') => (find (elt:=elt) k m, Some e')) m') = Some pSome p = Noneelt, elt', elt'':Typem:list (X.t * elt)Hm:NoDupA (eqk (elt:=elt)) mm':list (X.t * elt')Hm':NoDupA (eqk (elt:=elt')) m'x:keyH:find (elt:=elt') x m' = Nonep:oee'H0:find (elt:=oee') x (mapi (fun (k : key) (e' : elt') => (find (elt:=elt) k m, Some e')) m') = Some pIn x (mapi (fun (k : key) (e' : elt') => (find (elt:=elt) k m, Some e')) m')elt, elt', elt'':Typem:list (X.t * elt)Hm:NoDupA (eqk (elt:=elt)) mm':list (X.t * elt')Hm':NoDupA (eqk (elt:=elt')) m'x:keyH:find (elt:=elt') x m' = Nonep:oee'H0:find (elt:=oee') x (mapi (fun (k : key) (e' : elt') => (find (elt:=elt) k m, Some e')) m') = Some px0:elt'H1:MapsTo x x0 m'Some p = Nonerewrite (find_1 Hm' H1) in H; discriminate. Qed. Definition at_least_one (o:option elt)(o':option elt') := match o, o' with | None, None => None | _, _ => Some (o,o') end.elt, elt', elt'':Typem:list (X.t * elt)Hm:NoDupA (eqk (elt:=elt)) mm':list (X.t * elt')Hm':NoDupA (eqk (elt:=elt')) m'x:keyH:find (elt:=elt') x m' = Nonep:oee'H0:find (elt:=oee') x (mapi (fun (k : key) (e' : elt') => (find (elt:=elt) k m, Some e')) m') = Some px0:elt'H1:MapsTo x x0 m'Some p = Noneelt, elt', elt'':Typeforall m : list (X.t * elt), NoDupA (eqk (elt:=elt)) m -> forall m' : list (X.t * elt'), NoDupA (eqk (elt:=elt')) m' -> forall x : key, find (elt:=oee') x (combine m m') = at_least_one (find (elt:=elt) x m) (find (elt:=elt') x m')elt, elt', elt'':Typeforall m : list (X.t * elt), NoDupA (eqk (elt:=elt)) m -> forall m' : list (X.t * elt'), NoDupA (eqk (elt:=elt')) m' -> forall x : key, find (elt:=oee') x (combine m m') = at_least_one (find (elt:=elt) x m) (find (elt:=elt') x m')elt, elt', elt'':Typeforall m : list (X.t * elt), NoDupA (eqk (elt:=elt)) m -> forall m' : list (X.t * elt'), NoDupA (eqk (elt:=elt')) m' -> forall x : key, find (elt:=oee') x (fold_right_pair (add (elt:=oee')) (combine_r m m') (combine_l m m')) = at_least_one (find (elt:=elt) x m) (find (elt:=elt') x m')elt, elt', elt'':Typem:list (X.t * elt)Hm:NoDupA (eqk (elt:=elt)) mm':list (X.t * elt')Hm':NoDupA (eqk (elt:=elt')) m'x:keyfind (elt:=oee') x (fold_right_pair (add (elt:=oee')) (combine_r m m') (combine_l m m')) = at_least_one (find (elt:=elt) x m) (find (elt:=elt') x m')elt, elt', elt'':Typem:list (X.t * elt)Hm:NoDupA (eqk (elt:=elt)) mm':list (X.t * elt')Hm':NoDupA (eqk (elt:=elt')) m'x:keyfind (elt:=oee') x (combine_r m m') = at_least_right (find (elt:=elt) x m) (find (elt:=elt') x m') -> find (elt:=oee') x (fold_right_pair (add (elt:=oee')) (combine_r m m') (combine_l m m')) = at_least_one (find (elt:=elt) x m) (find (elt:=elt') x m')elt, elt', elt'':Typem:list (X.t * elt)Hm:NoDupA (eqk (elt:=elt)) mm':list (X.t * elt')Hm':NoDupA (eqk (elt:=elt')) m'x:keyfind (elt:=oee') x (combine_l m m') = at_least_left (find (elt:=elt) x m) (find (elt:=elt') x m') -> find (elt:=oee') x (combine_r m m') = at_least_right (find (elt:=elt) x m) (find (elt:=elt') x m') -> find (elt:=oee') x (fold_right_pair (add (elt:=oee')) (combine_r m m') (combine_l m m')) = at_least_one (find (elt:=elt) x m) (find (elt:=elt') x m')elt, elt', elt'':Typem:list (X.t * elt)Hm:NoDupA (eqk (elt:=elt)) mm':list (X.t * elt')Hm':NoDupA (eqk (elt:=elt')) m'x:keyNoDupA (eqk (elt:=oee')) (combine_l m m')elt, elt', elt'':Typem:list (X.t * elt)Hm:NoDupA (eqk (elt:=elt)) mm':list (X.t * elt')Hm':NoDupA (eqk (elt:=elt')) m'x:keyH:NoDupA (eqk (elt:=oee')) (combine_l m m')find (elt:=oee') x (combine_l m m') = at_least_left (find (elt:=elt) x m) (find (elt:=elt') x m') -> find (elt:=oee') x (combine_r m m') = at_least_right (find (elt:=elt) x m) (find (elt:=elt') x m') -> find (elt:=oee') x (fold_right_pair (add (elt:=oee')) (combine_r m m') (combine_l m m')) = at_least_one (find (elt:=elt) x m) (find (elt:=elt') x m')elt, elt', elt'':Typem:list (X.t * elt)Hm:NoDupA (eqk (elt:=elt)) mm':list (X.t * elt')Hm':NoDupA (eqk (elt:=elt')) m'x:keyH:NoDupA (eqk (elt:=oee')) (combine_l m m')find (elt:=oee') x (combine_l m m') = at_least_left (find (elt:=elt) x m) (find (elt:=elt') x m') -> find (elt:=oee') x (combine_r m m') = at_least_right (find (elt:=elt) x m) (find (elt:=elt') x m') -> find (elt:=oee') x (fold_right_pair (add (elt:=oee')) (combine_r m m') (combine_l m m')) = at_least_one (find (elt:=elt) x m) (find (elt:=elt') x m')elt, elt', elt'':Typem:list (X.t * elt)Hm:NoDupA (eqk (elt:=elt)) mm':list (X.t * elt')Hm':NoDupA (eqk (elt:=elt')) m'x:keyH:NoDupA (eqk (elt:=oee')) (combine_l m m')NoDupA (eqk (elt:=oee')) (combine_r m m')elt, elt', elt'':Typem:list (X.t * elt)Hm:NoDupA (eqk (elt:=elt)) mm':list (X.t * elt')Hm':NoDupA (eqk (elt:=elt')) m'x:keyH:NoDupA (eqk (elt:=oee')) (combine_l m m')H0:NoDupA (eqk (elt:=oee')) (combine_r m m')find (elt:=oee') x (combine_l m m') = at_least_left (find (elt:=elt) x m) (find (elt:=elt') x m') -> find (elt:=oee') x (combine_r m m') = at_least_right (find (elt:=elt) x m) (find (elt:=elt') x m') -> find (elt:=oee') x (fold_right_pair (add (elt:=oee')) (combine_r m m') (combine_l m m')) = at_least_one (find (elt:=elt) x m) (find (elt:=elt') x m')elt, elt', elt'':Typem:list (X.t * elt)Hm:NoDupA (eqk (elt:=elt)) mm':list (X.t * elt')Hm':NoDupA (eqk (elt:=elt')) m'x:keyH:NoDupA (eqk (elt:=oee')) (combine_l m m')H0:NoDupA (eqk (elt:=oee')) (combine_r m m')find (elt:=oee') x (combine_l m m') = at_least_left (find (elt:=elt) x m) (find (elt:=elt') x m') -> find (elt:=oee') x (combine_r m m') = at_least_right (find (elt:=elt) x m) (find (elt:=elt') x m') -> find (elt:=oee') x (fold_right_pair (add (elt:=oee')) (combine_r m m') (combine_l m m')) = at_least_one (find (elt:=elt) x m) (find (elt:=elt') x m')elt, elt', elt'':Typem:list (X.t * elt)Hm:NoDupA (eqk (elt:=elt)) mm':list (X.t * elt')Hm':NoDupA (eqk (elt:=elt')) m'x:keyl:t oee'H:NoDupA (eqk (elt:=oee')) lH0:NoDupA (eqk (elt:=oee')) (combine_r m m')find (elt:=oee') x l = at_least_left (find (elt:=elt) x m) (find (elt:=elt') x m') -> find (elt:=oee') x (combine_r m m') = at_least_right (find (elt:=elt) x m) (find (elt:=elt') x m') -> find (elt:=oee') x (fold_right_pair (add (elt:=oee')) (combine_r m m') l) = at_least_one (find (elt:=elt) x m) (find (elt:=elt') x m')elt, elt', elt'':Typem:list (X.t * elt)Hm:NoDupA (eqk (elt:=elt)) mm':list (X.t * elt')Hm':NoDupA (eqk (elt:=elt')) m'x:keyl:t oee'H:NoDupA (eqk (elt:=oee')) lr:t oee'H0:NoDupA (eqk (elt:=oee')) rfind (elt:=oee') x l = at_least_left (find (elt:=elt) x m) (find (elt:=elt') x m') -> find (elt:=oee') x r = at_least_right (find (elt:=elt) x m) (find (elt:=elt') x m') -> find (elt:=oee') x (fold_right_pair (add (elt:=oee')) r l) = at_least_one (find (elt:=elt) x m) (find (elt:=elt') x m')elt, elt', elt'':Typem:list (X.t * elt)Hm:NoDupA (eqk (elt:=elt)) mm':list (X.t * elt')Hm':NoDupA (eqk (elt:=elt')) m'x:keyl:t oee'H:NoDupA (eqk (elt:=oee')) lr:t oee'H0:NoDupA (eqk (elt:=oee')) ro:option eltfind (elt:=oee') x l = at_least_left o (find (elt:=elt') x m') -> find (elt:=oee') x r = at_least_right o (find (elt:=elt') x m') -> find (elt:=oee') x (fold_right_pair (add (elt:=oee')) r l) = at_least_one o (find (elt:=elt') x m')elt, elt', elt'':Typem:list (X.t * elt)Hm:NoDupA (eqk (elt:=elt)) mm':list (X.t * elt')Hm':NoDupA (eqk (elt:=elt')) m'x:keyl:t oee'H:NoDupA (eqk (elt:=oee')) lr:t oee'H0:NoDupA (eqk (elt:=oee')) ro:option elto':option elt'find (elt:=oee') x l = at_least_left o o' -> find (elt:=oee') x r = at_least_right o o' -> find (elt:=oee') x (fold_right_pair (add (elt:=oee')) r l) = at_least_one o o'elt, elt', elt'':Typex:keyl:t oee'H:NoDupA (eqk (elt:=oee')) lr:t oee'H0:NoDupA (eqk (elt:=oee')) ro:option elto':option elt'find (elt:=oee') x l = at_least_left o o' -> find (elt:=oee') x r = at_least_right o o' -> find (elt:=oee') x (fold_right_pair (add (elt:=oee')) r l) = at_least_one o o'elt, elt', elt'':Typex:keyH:NoDupA (eqk (elt:=oee')) nilr:t oee'H0:NoDupA (eqk (elt:=oee')) ro:option elto':option elt'find (elt:=oee') x nil = at_least_left o o' -> find (elt:=oee') x r = at_least_right o o' -> find (elt:=oee') x (fold_right_pair (add (elt:=oee')) r nil) = at_least_one o o'elt, elt', elt'':Typex:keya:(X.t * oee')%typel:list (X.t * oee')H:NoDupA (eqk (elt:=oee')) (a :: l)r:t oee'H0:NoDupA (eqk (elt:=oee')) ro:option elto':option elt'IHl:NoDupA (eqk (elt:=oee')) l -> find (elt:=oee') x l = at_least_left o o' -> find (elt:=oee') x r = at_least_right o o' -> find (elt:=oee') x (fold_right_pair (add (elt:=oee')) r l) = at_least_one o o'find (elt:=oee') x (a :: l) = at_least_left o o' -> find (elt:=oee') x r = at_least_right o o' -> find (elt:=oee') x (fold_right_pair (add (elt:=oee')) r (a :: l)) = at_least_one o o'elt, elt', elt'':Typex:keya:(X.t * oee')%typel:list (X.t * oee')H:NoDupA (eqk (elt:=oee')) (a :: l)r:t oee'H0:NoDupA (eqk (elt:=oee')) ro:option elto':option elt'IHl:NoDupA (eqk (elt:=oee')) l -> find (elt:=oee') x l = at_least_left o o' -> find (elt:=oee') x r = at_least_right o o' -> find (elt:=oee') x (fold_right_pair (add (elt:=oee')) r l) = at_least_one o o'find (elt:=oee') x (a :: l) = at_least_left o o' -> find (elt:=oee') x r = at_least_right o o' -> find (elt:=oee') x (fold_right_pair (add (elt:=oee')) r (a :: l)) = at_least_one o o'elt, elt', elt'':Typex:keyt0:X.tp:oee'l:list (X.t * oee')H:NoDupA (eqk (elt:=oee')) ((t0, p) :: l)r:t oee'H0:NoDupA (eqk (elt:=oee')) ro:option elto':option elt'IHl:NoDupA (eqk (elt:=oee')) l -> find (elt:=oee') x l = at_least_left o o' -> find (elt:=oee') x r = at_least_right o o' -> find (elt:=oee') x (fold_right_pair (add (elt:=oee')) r l) = at_least_one o o'H1:(if X.eq_dec x t0 then Some p else find (elt:=oee') x l) = at_least_left o o'H2:find (elt:=oee') x r = at_least_right o o'find (elt:=oee') x (add t0 p (fold_right_pair (add (elt:=oee')) r l)) = at_least_one o o'elt, elt', elt'':Typex:keyt0:X.tp:oee'l:list (X.t * oee')H:NoDupA (eqk (elt:=oee')) ((t0, p) :: l)r:t oee'H0:NoDupA (eqk (elt:=oee')) ro:option elto':option elt'IHl:NoDupA (eqk (elt:=oee')) l -> find (elt:=oee') x l = at_least_left o o' -> find (elt:=oee') x r = at_least_right o o' -> find (elt:=oee') x (fold_right_pair (add (elt:=oee')) r l) = at_least_one o o'e:X.eq x t0H1:Some p = at_least_left o o'H2:find (elt:=oee') x r = at_least_right o o'find (elt:=oee') x (add t0 p (fold_right_pair (add (elt:=oee')) r l)) = at_least_one o o'elt, elt', elt'':Typex:keyt0:X.tp:oee'l:list (X.t * oee')H:NoDupA (eqk (elt:=oee')) ((t0, p) :: l)r:t oee'H0:NoDupA (eqk (elt:=oee')) ro:option elto':option elt'IHl:NoDupA (eqk (elt:=oee')) l -> find (elt:=oee') x l = at_least_left o o' -> find (elt:=oee') x r = at_least_right o o' -> find (elt:=oee') x (fold_right_pair (add (elt:=oee')) r l) = at_least_one o o'n:~ X.eq x t0H1:find (elt:=oee') x l = at_least_left o o'H2:find (elt:=oee') x r = at_least_right o o'find (elt:=oee') x (add t0 p (fold_right_pair (add (elt:=oee')) r l)) = at_least_one o o'elt, elt', elt'':Typex:keyt0:X.tp:oee'l:list (X.t * oee')H:NoDupA (eqk (elt:=oee')) ((t0, p) :: l)r:t oee'H0:NoDupA (eqk (elt:=oee')) ro:option elto':option elt'IHl:NoDupA (eqk (elt:=oee')) l -> find (elt:=oee') x l = at_least_left o o' -> find (elt:=oee') x r = at_least_right o o' -> find (elt:=oee') x (fold_right_pair (add (elt:=oee')) r l) = at_least_one o o'e:X.eq x t0H1:Some p = match o with | Some _ => Some (o, o') | None => None endH2:find (elt:=oee') x r = at_least_right o o'find (elt:=oee') x (add t0 p (fold_right_pair (add (elt:=oee')) r l)) = at_least_one o o'elt, elt', elt'':Typex:keyt0:X.tp:oee'l:list (X.t * oee')H:NoDupA (eqk (elt:=oee')) ((t0, p) :: l)r:t oee'H0:NoDupA (eqk (elt:=oee')) ro:option elto':option elt'IHl:NoDupA (eqk (elt:=oee')) l -> find (elt:=oee') x l = at_least_left o o' -> find (elt:=oee') x r = at_least_right o o' -> find (elt:=oee') x (fold_right_pair (add (elt:=oee')) r l) = at_least_one o o'n:~ X.eq x t0H1:find (elt:=oee') x l = at_least_left o o'H2:find (elt:=oee') x r = at_least_right o o'find (elt:=oee') x (add t0 p (fold_right_pair (add (elt:=oee')) r l)) = at_least_one o o'elt, elt', elt'':Typex:keyt0:X.tp:oee'l:list (X.t * oee')H:NoDupA (eqk (elt:=oee')) ((t0, p) :: l)r:t oee'H0:NoDupA (eqk (elt:=oee')) re0:elto':option elt'IHl:NoDupA (eqk (elt:=oee')) l -> find (elt:=oee') x l = Some (Some e0, o') -> find (elt:=oee') x r = at_least_right (Some e0) o' -> find (elt:=oee') x (fold_right_pair (add (elt:=oee')) r l) = Some (Some e0, o')e:X.eq x t0H1:Some p = Some (Some e0, o')H2:find (elt:=oee') x r = at_least_right (Some e0) o'find (elt:=oee') x (add t0 p (fold_right_pair (add (elt:=oee')) r l)) = Some (Some e0, o')elt, elt', elt'':Typex:keyt0:X.tp:oee'l:list (X.t * oee')H:NoDupA (eqk (elt:=oee')) ((t0, p) :: l)r:t oee'H0:NoDupA (eqk (elt:=oee')) ro:option elto':option elt'IHl:NoDupA (eqk (elt:=oee')) l -> find (elt:=oee') x l = at_least_left o o' -> find (elt:=oee') x r = at_least_right o o' -> find (elt:=oee') x (fold_right_pair (add (elt:=oee')) r l) = at_least_one o o'n:~ X.eq x t0H1:find (elt:=oee') x l = at_least_left o o'H2:find (elt:=oee') x r = at_least_right o o'find (elt:=oee') x (add t0 p (fold_right_pair (add (elt:=oee')) r l)) = at_least_one o o'elt, elt', elt'':Typex:keyt0:X.tl:list (X.t * oee')e0:elto':option elt'H:NoDupA (eqk (elt:=oee')) ((t0, (Some e0, o')) :: l)r:t oee'H0:NoDupA (eqk (elt:=oee')) rIHl:NoDupA (eqk (elt:=oee')) l -> find (elt:=oee') x l = Some (Some e0, o') -> find (elt:=oee') x r = at_least_right (Some e0) o' -> find (elt:=oee') x (fold_right_pair (add (elt:=oee')) r l) = Some (Some e0, o')e:X.eq x t0H1:Some (Some e0, o') = Some (Some e0, o')H2:find (elt:=oee') x r = at_least_right (Some e0) o'find (elt:=oee') x (add t0 (Some e0, o') (fold_right_pair (add (elt:=oee')) r l)) = Some (Some e0, o')elt, elt', elt'':Typex:keyt0:X.tp:oee'l:list (X.t * oee')H:NoDupA (eqk (elt:=oee')) ((t0, p) :: l)r:t oee'H0:NoDupA (eqk (elt:=oee')) ro:option elto':option elt'IHl:NoDupA (eqk (elt:=oee')) l -> find (elt:=oee') x l = at_least_left o o' -> find (elt:=oee') x r = at_least_right o o' -> find (elt:=oee') x (fold_right_pair (add (elt:=oee')) r l) = at_least_one o o'n:~ X.eq x t0H1:find (elt:=oee') x l = at_least_left o o'H2:find (elt:=oee') x r = at_least_right o o'find (elt:=oee') x (add t0 p (fold_right_pair (add (elt:=oee')) r l)) = at_least_one o o'elt, elt', elt'':Typex:keyt0:X.tl:list (X.t * oee')e0:elto':option elt'H:NoDupA (eqk (elt:=oee')) ((t0, (Some e0, o')) :: l)r:t oee'H0:NoDupA (eqk (elt:=oee')) rIHl:NoDupA (eqk (elt:=oee')) l -> find (elt:=oee') x l = Some (Some e0, o') -> find (elt:=oee') x r = at_least_right (Some e0) o' -> find (elt:=oee') x (fold_right_pair (add (elt:=oee')) r l) = Some (Some e0, o')e:X.eq x t0H1:Some (Some e0, o') = Some (Some e0, o')H2:find (elt:=oee') x r = at_least_right (Some e0) o'NoDupA (eqk (elt:=oee')) (fold_right_pair (add (elt:=oee')) r l)elt, elt', elt'':Typex:keyt0:X.tp:oee'l:list (X.t * oee')H:NoDupA (eqk (elt:=oee')) ((t0, p) :: l)r:t oee'H0:NoDupA (eqk (elt:=oee')) ro:option elto':option elt'IHl:NoDupA (eqk (elt:=oee')) l -> find (elt:=oee') x l = at_least_left o o' -> find (elt:=oee') x r = at_least_right o o' -> find (elt:=oee') x (fold_right_pair (add (elt:=oee')) r l) = at_least_one o o'n:~ X.eq x t0H1:find (elt:=oee') x l = at_least_left o o'H2:find (elt:=oee') x r = at_least_right o o'find (elt:=oee') x (add t0 p (fold_right_pair (add (elt:=oee')) r l)) = at_least_one o o'elt, elt', elt'':Typex:keyt0:X.tp:oee'l:list (X.t * oee')H:NoDupA (eqk (elt:=oee')) ((t0, p) :: l)r:t oee'H0:NoDupA (eqk (elt:=oee')) ro:option elto':option elt'IHl:NoDupA (eqk (elt:=oee')) l -> find (elt:=oee') x l = at_least_left o o' -> find (elt:=oee') x r = at_least_right o o' -> find (elt:=oee') x (fold_right_pair (add (elt:=oee')) r l) = at_least_one o o'n:~ X.eq x t0H1:find (elt:=oee') x l = at_least_left o o'H2:find (elt:=oee') x r = at_least_right o o'find (elt:=oee') x (add t0 p (fold_right_pair (add (elt:=oee')) r l)) = at_least_one o o'elt, elt', elt'':Typex:keyt0:X.tp:oee'l:list (X.t * oee')r:t oee'H0:NoDupA (eqk (elt:=oee')) ro:option elto':option elt'IHl:NoDupA (eqk (elt:=oee')) l -> find (elt:=oee') x l = at_least_left o o' -> find (elt:=oee') x r = at_least_right o o' -> find (elt:=oee') x (fold_right_pair (add (elt:=oee')) r l) = at_least_one o o'n:~ X.eq x t0H1:find (elt:=oee') x l = at_least_left o o'H2:find (elt:=oee') x r = at_least_right o o'H3:~ InA (eqk (elt:=oee')) (t0, p) lH4:NoDupA (eqk (elt:=oee')) lfind (elt:=oee') x (add t0 p (fold_right_pair (add (elt:=oee')) r l)) = at_least_one o o'apply add_not_eq; auto. Qed. Variable f : option elt -> option elt' -> option elt''. Definition option_cons (A:Type)(k:key)(o:option A)(l:list (key*A)) := match o with | Some e => (k,e)::l | None => l end. Definition map2 m m' := let m0 : t oee' := combine m m' in let m1 : t (option elt'') := map (fun p => f (fst p) (snd p)) m0 in fold_right_pair (option_cons (A:=elt'')) nil m1.elt, elt', elt'':Typex:keyt0:X.tp:oee'l:list (X.t * oee')r:t oee'H0:NoDupA (eqk (elt:=oee')) ro:option elto':option elt'IHl:NoDupA (eqk (elt:=oee')) l -> find (elt:=oee') x l = at_least_left o o' -> find (elt:=oee') x r = at_least_right o o' -> find (elt:=oee') x (fold_right_pair (add (elt:=oee')) r l) = at_least_one o o'n:~ X.eq x t0H1:find (elt:=oee') x l = at_least_left o o'H2:find (elt:=oee') x r = at_least_right o o'H3:~ InA (eqk (elt:=oee')) (t0, p) lH4:NoDupA (eqk (elt:=oee')) lfind (elt:=oee') x (add t0 p (fold_right_pair (add (elt:=oee')) r l)) = find (elt:=oee') x (fold_right_pair (add (elt:=oee')) r l)elt, elt', elt'':Typef:option elt -> option elt' -> option elt''forall m : list (X.t * elt), NoDupA (eqk (elt:=elt)) m -> forall m' : list (X.t * elt'), NoDupA (eqk (elt:=elt')) m' -> NoDupA (eqk (elt:=elt'')) (map2 m m')elt, elt', elt'':Typef:option elt -> option elt' -> option elt''forall m : list (X.t * elt), NoDupA (eqk (elt:=elt)) m -> forall m' : list (X.t * elt'), NoDupA (eqk (elt:=elt')) m' -> NoDupA (eqk (elt:=elt'')) (map2 m m')elt, elt', elt'':Typef:option elt -> option elt' -> option elt''m:list (X.t * elt)Hm:NoDupA (eqk (elt:=elt)) mm':list (X.t * elt')Hm':NoDupA (eqk (elt:=elt')) m'NoDupA (eqk (elt:=elt'')) (map2 m m')elt, elt', elt'':Typef:option elt -> option elt' -> option elt''m:list (X.t * elt)Hm:NoDupA (eqk (elt:=elt)) mm':list (X.t * elt')Hm':NoDupA (eqk (elt:=elt')) m'NoDupA (eqk (elt:=elt'')) (fold_right_pair (option_cons (A:=elt'')) nil (map (fun p : oee' => f (fst p) (snd p)) (combine m m')))elt, elt', elt'':Typef:option elt -> option elt' -> option elt''m:list (X.t * elt)Hm:NoDupA (eqk (elt:=elt)) mm':list (X.t * elt')Hm':NoDupA (eqk (elt:=elt')) m'H0:NoDupA (eqk (elt:=oee')) (combine m m')NoDupA (eqk (elt:=elt'')) (fold_right_pair (option_cons (A:=elt'')) nil (map (fun p : oee' => f (fst p) (snd p)) (combine m m')))elt, elt', elt'':Typef:option elt -> option elt' -> option elt''m:list (X.t * elt)Hm:NoDupA (eqk (elt:=elt)) mm':list (X.t * elt')Hm':NoDupA (eqk (elt:=elt')) m'l0:t oee'H0:NoDupA (eqk (elt:=oee')) l0NoDupA (eqk (elt:=elt'')) (fold_right_pair (option_cons (A:=elt'')) nil (map (fun p : oee' => f (fst p) (snd p)) l0))elt, elt', elt'':Typef:option elt -> option elt' -> option elt''m:list (X.t * elt)Hm:NoDupA (eqk (elt:=elt)) mm':list (X.t * elt')Hm':NoDupA (eqk (elt:=elt')) m'l0:t oee'H0:NoDupA (eqk (elt:=oee')) l0f':=fun p : oee' => f (fst p) (snd p):oee' -> option elt''NoDupA (eqk (elt:=elt'')) (fold_right_pair (option_cons (A:=elt'')) nil (map f' l0))elt, elt', elt'':Typef:option elt -> option elt' -> option elt''m:list (X.t * elt)Hm:NoDupA (eqk (elt:=elt)) mm':list (X.t * elt')Hm':NoDupA (eqk (elt:=elt')) m'l0:t oee'H0:NoDupA (eqk (elt:=oee')) l0f':=fun p : oee' => f (fst p) (snd p):oee' -> option elt''H1:NoDupA (eqk (elt:=option elt'')) (map f' l0)NoDupA (eqk (elt:=elt'')) (fold_right_pair (option_cons (A:=elt'')) nil (map f' l0))elt, elt', elt'':Typef:option elt -> option elt' -> option elt''m:list (X.t * elt)Hm:NoDupA (eqk (elt:=elt)) mm':list (X.t * elt')Hm':NoDupA (eqk (elt:=elt')) m'l0:t oee'H0:NoDupA (eqk (elt:=oee')) l0f':=fun p : oee' => f (fst p) (snd p):oee' -> option elt''l1:t (option elt'')H1:NoDupA (eqk (elt:=option elt'')) l1NoDupA (eqk (elt:=elt'')) (fold_right_pair (option_cons (A:=elt'')) nil l1)elt, elt', elt'':Typel1:t (option elt'')H1:NoDupA (eqk (elt:=option elt'')) l1NoDupA (eqk (elt:=elt'')) (fold_right_pair (option_cons (A:=elt'')) nil l1)elt, elt', elt'':TypeH1:NoDupA (eqk (elt:=option elt'')) nilNoDupA (eqk (elt:=elt'')) (fold_right_pair (option_cons (A:=elt'')) nil nil)elt, elt', elt'':Typea:(X.t * option elt'')%typel1:list (X.t * option elt'')H1:NoDupA (eqk (elt:=option elt'')) (a :: l1)IHl1:NoDupA (eqk (elt:=option elt'')) l1 -> NoDupA (eqk (elt:=elt'')) (fold_right_pair (option_cons (A:=elt'')) nil l1)NoDupA (eqk (elt:=elt'')) (fold_right_pair (option_cons (A:=elt'')) nil (a :: l1))elt, elt', elt'':Typea:(X.t * option elt'')%typel1:list (X.t * option elt'')H1:NoDupA (eqk (elt:=option elt'')) (a :: l1)IHl1:NoDupA (eqk (elt:=option elt'')) l1 -> NoDupA (eqk (elt:=elt'')) (fold_right_pair (option_cons (A:=elt'')) nil l1)NoDupA (eqk (elt:=elt'')) (fold_right_pair (option_cons (A:=elt'')) nil (a :: l1))elt, elt', elt'':Typea:(X.t * option elt'')%typel1:list (X.t * option elt'')IHl1:NoDupA (eqk (elt:=option elt'')) l1 -> NoDupA (eqk (elt:=elt'')) (fold_right_pair (option_cons (A:=elt'')) nil l1)H:~ InA (eqk (elt:=option elt'')) a l1H0:NoDupA (eqk (elt:=option elt'')) l1NoDupA (eqk (elt:=elt'')) (fold_right_pair (option_cons (A:=elt'')) nil (a :: l1))elt, elt', elt'':Typet0:X.te:elt''l1:list (X.t * option elt'')IHl1:NoDupA (eqk (elt:=option elt'')) l1 -> NoDupA (eqk (elt:=elt'')) (fold_right_pair (option_cons (A:=elt'')) nil l1)H:~ InA (eqk (elt:=option elt'')) (t0, Some e) l1H0:NoDupA (eqk (elt:=option elt'')) l1NoDupA (eqk (elt:=elt'')) ((t0, e) :: fold_right_pair (option_cons (A:=elt'')) nil l1)elt, elt', elt'':Typet0:X.te:elt''l1:list (X.t * option elt'')IHl1:NoDupA (eqk (elt:=option elt'')) l1 -> NoDupA (eqk (elt:=elt'')) (fold_right_pair (option_cons (A:=elt'')) nil l1)H:~ InA (eqk (elt:=option elt'')) (t0, Some e) l1H0:NoDupA (eqk (elt:=option elt'')) l1~ InA (eqk (elt:=elt'')) (t0, e) (fold_right_pair (option_cons (A:=elt'')) nil l1)elt, elt', elt'':Typet0:X.te:elt''l1:list (X.t * option elt'')IHl1:NoDupA (eqk (elt:=option elt'')) l1 -> NoDupA (eqk (elt:=elt'')) (fold_right_pair (option_cons (A:=elt'')) nil l1)H0:NoDupA (eqk (elt:=option elt'')) l1H:InA (eqk (elt:=elt'')) (t0, e) (fold_right_pair (option_cons (A:=elt'')) nil l1)InA (eqk (elt:=option elt'')) (t0, Some e) l1elt, elt', elt'':Typet0:X.te:elt''l1:list (X.t * option elt'')H0:NoDupA (eqk (elt:=option elt'')) l1H:InA (eqk (elt:=elt'')) (t0, e) (fold_right_pair (option_cons (A:=elt'')) nil l1)InA (eqk (elt:=option elt'')) (t0, Some e) l1elt, elt', elt'':Typet0:X.te:elt''H0:NoDupA (eqk (elt:=option elt'')) nilH:InA (eqk (elt:=elt'')) (t0, e) (fold_right_pair (option_cons (A:=elt'')) nil nil)InA (eqk (elt:=option elt'')) (t0, Some e) nilelt, elt', elt'':Typet0:X.te:elt''a:(X.t * option elt'')%typel1:list (X.t * option elt'')H0:NoDupA (eqk (elt:=option elt'')) (a :: l1)H:InA (eqk (elt:=elt'')) (t0, e) (fold_right_pair (option_cons (A:=elt'')) nil (a :: l1))IHl1:NoDupA (eqk (elt:=option elt'')) l1 -> InA (eqk (elt:=elt'')) (t0, e) (fold_right_pair (option_cons (A:=elt'')) nil l1) -> InA (eqk (elt:=option elt'')) (t0, Some e) l1InA (eqk (elt:=option elt'')) (t0, Some e) (a :: l1)elt, elt', elt'':Typet0:X.te:elt''a:(X.t * option elt'')%typel1:list (X.t * option elt'')H0:NoDupA (eqk (elt:=option elt'')) (a :: l1)H:InA (eqk (elt:=elt'')) (t0, e) (fold_right_pair (option_cons (A:=elt'')) nil (a :: l1))IHl1:NoDupA (eqk (elt:=option elt'')) l1 -> InA (eqk (elt:=elt'')) (t0, e) (fold_right_pair (option_cons (A:=elt'')) nil l1) -> InA (eqk (elt:=option elt'')) (t0, Some e) l1InA (eqk (elt:=option elt'')) (t0, Some e) (a :: l1)elt, elt', elt'':Typet0:X.te:elt''a:(X.t * option elt'')%typel1:list (X.t * option elt'')H:InA (eqk (elt:=elt'')) (t0, e) (fold_right_pair (option_cons (A:=elt'')) nil (a :: l1))IHl1:NoDupA (eqk (elt:=option elt'')) l1 -> InA (eqk (elt:=elt'')) (t0, e) (fold_right_pair (option_cons (A:=elt'')) nil l1) -> InA (eqk (elt:=option elt'')) (t0, Some e) l1H1:~ InA (eqk (elt:=option elt'')) a l1H2:NoDupA (eqk (elt:=option elt'')) l1InA (eqk (elt:=option elt'')) (t0, Some e) (a :: l1)inversion_clear H; auto. Qed. Definition at_least_one_then_f (o:option elt)(o':option elt') := match o, o' with | None, None => None | _, _ => f o o' end.elt, elt', elt'':Typet0:X.te:elt''t1:X.te0:elt''l1:list (X.t * option elt'')H:InA (eqk (elt:=elt'')) (t0, e) ((t1, e0) :: fold_right_pair (option_cons (A:=elt'')) nil l1)IHl1:NoDupA (eqk (elt:=option elt'')) l1 -> InA (eqk (elt:=elt'')) (t0, e) (fold_right_pair (option_cons (A:=elt'')) nil l1) -> InA (eqk (elt:=option elt'')) (t0, Some e) l1H1:~ InA (eqk (elt:=option elt'')) (t1, Some e0) l1H2:NoDupA (eqk (elt:=option elt'')) l1InA (eqk (elt:=option elt'')) (t0, Some e) ((t1, Some e0) :: l1)elt, elt', elt'':Typef:option elt -> option elt' -> option elt''forall m : list (X.t * elt), NoDupA (eqk (elt:=elt)) m -> forall m' : list (X.t * elt'), NoDupA (eqk (elt:=elt')) m' -> forall x : key, find (elt:=elt'') x (map2 m m') = at_least_one_then_f (find (elt:=elt) x m) (find (elt:=elt') x m')elt, elt', elt'':Typef:option elt -> option elt' -> option elt''forall m : list (X.t * elt), NoDupA (eqk (elt:=elt)) m -> forall m' : list (X.t * elt'), NoDupA (eqk (elt:=elt')) m' -> forall x : key, find (elt:=elt'') x (map2 m m') = at_least_one_then_f (find (elt:=elt) x m) (find (elt:=elt') x m')elt, elt', elt'':Typef:option elt -> option elt' -> option elt''m:list (X.t * elt)Hm:NoDupA (eqk (elt:=elt)) mm':list (X.t * elt')Hm':NoDupA (eqk (elt:=elt')) m'x:keyfind (elt:=elt'') x (map2 m m') = at_least_one_then_f (find (elt:=elt) x m) (find (elt:=elt') x m')elt, elt', elt'':Typef:option elt -> option elt' -> option elt''m:list (X.t * elt)Hm:NoDupA (eqk (elt:=elt)) mm':list (X.t * elt')Hm':NoDupA (eqk (elt:=elt')) m'x:keyfind (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (map (fun p : oee' => f (fst p) (snd p)) (combine m m'))) = at_least_one_then_f (find (elt:=elt) x m) (find (elt:=elt') x m')elt, elt', elt'':Typef:option elt -> option elt' -> option elt''m:list (X.t * elt)Hm:NoDupA (eqk (elt:=elt)) mm':list (X.t * elt')Hm':NoDupA (eqk (elt:=elt')) m'x:keyH:find (elt:=oee') x (combine m m') = at_least_one (find (elt:=elt) x m) (find (elt:=elt') x m')find (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (map (fun p : oee' => f (fst p) (snd p)) (combine m m'))) = at_least_one_then_f (find (elt:=elt) x m) (find (elt:=elt') x m')elt, elt', elt'':Typef:option elt -> option elt' -> option elt''m:list (X.t * elt)Hm:NoDupA (eqk (elt:=elt)) mm':list (X.t * elt')Hm':NoDupA (eqk (elt:=elt')) m'x:keyH:find (elt:=oee') x (combine m m') = at_least_one (find (elt:=elt) x m) (find (elt:=elt') x m')H2:NoDupA (eqk (elt:=oee')) (combine m m')find (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (map (fun p : oee' => f (fst p) (snd p)) (combine m m'))) = at_least_one_then_f (find (elt:=elt) x m) (find (elt:=elt') x m')elt, elt', elt'':Typef:option elt -> option elt' -> option elt''m:list (X.t * elt)Hm:NoDupA (eqk (elt:=elt)) mm':list (X.t * elt')Hm':NoDupA (eqk (elt:=elt')) m'x:keyH:find (elt:=oee') x (combine m m') = at_least_one (find (elt:=elt) x m) (find (elt:=elt') x m')H2:NoDupA (eqk (elt:=oee')) (combine m m')f':=fun p : oee' => f (fst p) (snd p):oee' -> option elt''find (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (map f' (combine m m'))) = at_least_one_then_f (find (elt:=elt) x m) (find (elt:=elt') x m')elt, elt', elt'':Typef:option elt -> option elt' -> option elt''m:list (X.t * elt)Hm:NoDupA (eqk (elt:=elt)) mm':list (X.t * elt')Hm':NoDupA (eqk (elt:=elt')) m'x:keym0:t oee'H:find (elt:=oee') x m0 = at_least_one (find (elt:=elt) x m) (find (elt:=elt') x m')H2:NoDupA (eqk (elt:=oee')) m0f':=fun p : oee' => f (fst p) (snd p):oee' -> option elt''find (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (map f' m0)) = at_least_one_then_f (find (elt:=elt) x m) (find (elt:=elt') x m')elt, elt', elt'':Typef:option elt -> option elt' -> option elt''m:list (X.t * elt)Hm:NoDupA (eqk (elt:=elt)) mm':list (X.t * elt')Hm':NoDupA (eqk (elt:=elt')) m'x:keym0:t oee'o:option eltH:find (elt:=oee') x m0 = at_least_one o (find (elt:=elt') x m')H2:NoDupA (eqk (elt:=oee')) m0f':=fun p : oee' => f (fst p) (snd p):oee' -> option elt''find (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (map f' m0)) = at_least_one_then_f o (find (elt:=elt') x m')elt, elt', elt'':Typef:option elt -> option elt' -> option elt''m:list (X.t * elt)Hm:NoDupA (eqk (elt:=elt)) mm':list (X.t * elt')Hm':NoDupA (eqk (elt:=elt')) m'x:keym0:t oee'o:option elto':option elt'H:find (elt:=oee') x m0 = at_least_one o o'H2:NoDupA (eqk (elt:=oee')) m0f':=fun p : oee' => f (fst p) (snd p):oee' -> option elt''find (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (map f' m0)) = at_least_one_then_f o o'elt, elt', elt'':Typef:option elt -> option elt' -> option elt''x:keym0:t oee'o:option elto':option elt'H:find (elt:=oee') x m0 = at_least_one o o'H2:NoDupA (eqk (elt:=oee')) m0f':=fun p : oee' => f (fst p) (snd p):oee' -> option elt''find (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (map f' m0)) = at_least_one_then_f o o'elt, elt', elt'':Typef:option elt -> option elt' -> option elt''x:keym0:t oee'o:option elto':option elt'H2:NoDupA (eqk (elt:=oee')) m0f':=fun p : oee' => f (fst p) (snd p):oee' -> option elt''find (elt:=oee') x m0 = at_least_one o o' -> find (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (map f' m0)) = at_least_one_then_f o o'elt, elt', elt'':Typef:option elt -> option elt' -> option elt''x:keym0:t oee'o:option elto':option elt'H2:NoDupA (eqk (elt:=oee')) m0f':=fun p : oee' => f (fst p) (snd p):oee' -> option elt''(find (elt:=oee') x m0 = at_least_one o o' -> find (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (map f' m0)) = at_least_one_then_f o o') /\ (find (elt:=oee') x m0 = None -> find (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (map f' m0)) = None)elt, elt', elt'':Typef:option elt -> option elt' -> option elt''x:keyo:option elto':option elt'H2:NoDupA (eqk (elt:=oee')) nilX:option elt''H:None = at_least_one o o'None = at_least_one_then_f o o'elt, elt', elt'':Typef:option elt -> option elt' -> option elt''x:keya:(X.t * oee')%typem0:list (X.t * oee')o:option elto':option elt'H2:NoDupA (eqk (elt:=oee')) (a :: m0)f':=fun p : oee' => f (fst p) (snd p):oee' -> option elt''IHm0:NoDupA (eqk (elt:=oee')) m0 -> (find (elt:=oee') x m0 = at_least_one o o' -> find (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (map f' m0)) = at_least_one_then_f o o') /\ (find (elt:=oee') x m0 = None -> find (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (map f' m0)) = None)H:(let (k', x0) := a in if X.eq_dec x k' then Some x0 else find (elt:=oee') x m0) = at_least_one o o'find (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (let (k, e) := a in (k, f' e) :: map f' m0)) = at_least_one_then_f o o'elt, elt', elt'':Typef:option elt -> option elt' -> option elt''x:keya:(X.t * oee')%typem0:list (X.t * oee')o:option elto':option elt'H2:NoDupA (eqk (elt:=oee')) (a :: m0)f':=fun p : oee' => f (fst p) (snd p):oee' -> option elt''IHm0:NoDupA (eqk (elt:=oee')) m0 -> (find (elt:=oee') x m0 = at_least_one o o' -> find (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (map f' m0)) = at_least_one_then_f o o') /\ (find (elt:=oee') x m0 = None -> find (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (map f' m0)) = None)H:(let (k', x0) := a in if X.eq_dec x k' then Some x0 else find (elt:=oee') x m0) = Nonefind (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (let (k, e) := a in (k, f' e) :: map f' m0)) = Noneelt, elt', elt'':Typef:option elt -> option elt' -> option elt''x:keya:(X.t * oee')%typem0:list (X.t * oee')o:option elto':option elt'H2:NoDupA (eqk (elt:=oee')) (a :: m0)f':=fun p : oee' => f (fst p) (snd p):oee' -> option elt''IHm0:NoDupA (eqk (elt:=oee')) m0 -> (find (elt:=oee') x m0 = at_least_one o o' -> find (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (map f' m0)) = at_least_one_then_f o o') /\ (find (elt:=oee') x m0 = None -> find (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (map f' m0)) = None)H:(let (k', x0) := a in if X.eq_dec x k' then Some x0 else find (elt:=oee') x m0) = at_least_one o o'find (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (let (k, e) := a in (k, f' e) :: map f' m0)) = at_least_one_then_f o o'elt, elt', elt'':Typef:option elt -> option elt' -> option elt''x:keya:(X.t * oee')%typem0:list (X.t * oee')o:option elto':option elt'H2:NoDupA (eqk (elt:=oee')) (a :: m0)f':=fun p : oee' => f (fst p) (snd p):oee' -> option elt''IHm0:NoDupA (eqk (elt:=oee')) m0 -> (find (elt:=oee') x m0 = at_least_one o o' -> find (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (map f' m0)) = at_least_one_then_f o o') /\ (find (elt:=oee') x m0 = None -> find (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (map f' m0)) = None)H:(let (k', x0) := a in if X.eq_dec x k' then Some x0 else find (elt:=oee') x m0) = Nonefind (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (let (k, e) := a in (k, f' e) :: map f' m0)) = Noneelt, elt', elt'':Typef:option elt -> option elt' -> option elt''x:keyk:X.too:option eltoo':option elt'm0:list (X.t * oee')o:option elto':option elt'H2:NoDupA (eqk (elt:=oee')) ((k, (oo, oo')) :: m0)f':=fun p : oee' => f (fst p) (snd p):oee' -> option elt''IHm0:NoDupA (eqk (elt:=oee')) m0 -> (find (elt:=oee') x m0 = at_least_one o o' -> find (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (map f' m0)) = at_least_one_then_f o o') /\ (find (elt:=oee') x m0 = None -> find (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (map f' m0)) = None)H:(if X.eq_dec x k then Some (oo, oo') else find (elt:=oee') x m0) = at_least_one o o'find (elt:=elt'') x (option_cons k (f' (oo, oo')) (fold_right_pair (option_cons (A:=elt'')) nil (map f' m0))) = at_least_one_then_f o o'elt, elt', elt'':Typef:option elt -> option elt' -> option elt''x:keya:(X.t * oee')%typem0:list (X.t * oee')o:option elto':option elt'H2:NoDupA (eqk (elt:=oee')) (a :: m0)f':=fun p : oee' => f (fst p) (snd p):oee' -> option elt''IHm0:NoDupA (eqk (elt:=oee')) m0 -> (find (elt:=oee') x m0 = at_least_one o o' -> find (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (map f' m0)) = at_least_one_then_f o o') /\ (find (elt:=oee') x m0 = None -> find (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (map f' m0)) = None)H:(let (k', x0) := a in if X.eq_dec x k' then Some x0 else find (elt:=oee') x m0) = Nonefind (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (let (k, e) := a in (k, f' e) :: map f' m0)) = Noneelt, elt', elt'':Typef:option elt -> option elt' -> option elt''x:keyk:X.too:option eltoo':option elt'm0:list (X.t * oee')o:option elto':option elt'f':=fun p : oee' => f (fst p) (snd p):oee' -> option elt''IHm0:NoDupA (eqk (elt:=oee')) m0 -> (find (elt:=oee') x m0 = at_least_one o o' -> find (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (map f' m0)) = at_least_one_then_f o o') /\ (find (elt:=oee') x m0 = None -> find (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (map f' m0)) = None)H:(if X.eq_dec x k then Some (oo, oo') else find (elt:=oee') x m0) = at_least_one o o'H0:~ InA (eqk (elt:=oee')) (k, (oo, oo')) m0H1:NoDupA (eqk (elt:=oee')) m0find (elt:=elt'') x (option_cons k (f' (oo, oo')) (fold_right_pair (option_cons (A:=elt'')) nil (map f' m0))) = at_least_one_then_f o o'elt, elt', elt'':Typef:option elt -> option elt' -> option elt''x:keya:(X.t * oee')%typem0:list (X.t * oee')o:option elto':option elt'H2:NoDupA (eqk (elt:=oee')) (a :: m0)f':=fun p : oee' => f (fst p) (snd p):oee' -> option elt''IHm0:NoDupA (eqk (elt:=oee')) m0 -> (find (elt:=oee') x m0 = at_least_one o o' -> find (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (map f' m0)) = at_least_one_then_f o o') /\ (find (elt:=oee') x m0 = None -> find (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (map f' m0)) = None)H:(let (k', x0) := a in if X.eq_dec x k' then Some x0 else find (elt:=oee') x m0) = Nonefind (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (let (k, e) := a in (k, f' e) :: map f' m0)) = None(* x = k *)elt, elt', elt'':Typef:option elt -> option elt' -> option elt''x:keyk:X.too:option eltoo':option elt'm0:list (X.t * oee')o:option elto':option elt'f':=fun p : oee' => f (fst p) (snd p):oee' -> option elt''IHm0:NoDupA (eqk (elt:=oee')) m0 -> (find (elt:=oee') x m0 = at_least_one o o' -> find (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (map f' m0)) = at_least_one_then_f o o') /\ (find (elt:=oee') x m0 = None -> find (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (map f' m0)) = None)e:X.eq x kH:Some (oo, oo') = at_least_one o o'H0:~ InA (eqk (elt:=oee')) (k, (oo, oo')) m0H1:NoDupA (eqk (elt:=oee')) m0find (elt:=elt'') x (option_cons k (f' (oo, oo')) (fold_right_pair (option_cons (A:=elt'')) nil (map f' m0))) = at_least_one_then_f o o'elt, elt', elt'':Typef:option elt -> option elt' -> option elt''x:keyk:X.too:option eltoo':option elt'm0:list (X.t * oee')o:option elto':option elt'f':=fun p : oee' => f (fst p) (snd p):oee' -> option elt''IHm0:NoDupA (eqk (elt:=oee')) m0 -> (find (elt:=oee') x m0 = at_least_one o o' -> find (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (map f' m0)) = at_least_one_then_f o o') /\ (find (elt:=oee') x m0 = None -> find (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (map f' m0)) = None)Hneq:~ X.eq x kH:find (elt:=oee') x m0 = at_least_one o o'H0:~ InA (eqk (elt:=oee')) (k, (oo, oo')) m0H1:NoDupA (eqk (elt:=oee')) m0find (elt:=elt'') x (option_cons k (f' (oo, oo')) (fold_right_pair (option_cons (A:=elt'')) nil (map f' m0))) = at_least_one_then_f o o'elt, elt', elt'':Typef:option elt -> option elt' -> option elt''x:keya:(X.t * oee')%typem0:list (X.t * oee')o:option elto':option elt'H2:NoDupA (eqk (elt:=oee')) (a :: m0)f':=fun p : oee' => f (fst p) (snd p):oee' -> option elt''IHm0:NoDupA (eqk (elt:=oee')) m0 -> (find (elt:=oee') x m0 = at_least_one o o' -> find (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (map f' m0)) = at_least_one_then_f o o') /\ (find (elt:=oee') x m0 = None -> find (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (map f' m0)) = None)H:(let (k', x0) := a in if X.eq_dec x k' then Some x0 else find (elt:=oee') x m0) = Nonefind (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (let (k, e) := a in (k, f' e) :: map f' m0)) = Noneelt, elt', elt'':Typef:option elt -> option elt' -> option elt''x:keyk:X.too:option eltoo':option elt'm0:list (X.t * oee')o:option elto':option elt'f':=fun p : oee' => f (fst p) (snd p):oee' -> option elt''IHm0:NoDupA (eqk (elt:=oee')) m0 -> (find (elt:=oee') x m0 = at_least_one o o' -> find (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (map f' m0)) = at_least_one_then_f o o') /\ (find (elt:=oee') x m0 = None -> find (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (map f' m0)) = None)e:X.eq x kH:Some (oo, oo') = at_least_one o o'H0:~ InA (eqk (elt:=oee')) (k, (oo, oo')) m0H1:NoDupA (eqk (elt:=oee')) m0at_least_one_then_f o o' = f oo oo'elt, elt', elt'':Typef:option elt -> option elt' -> option elt''x:keyk:X.too:option eltoo':option elt'm0:list (X.t * oee')o:option elto':option elt'f':=fun p : oee' => f (fst p) (snd p):oee' -> option elt''IHm0:NoDupA (eqk (elt:=oee')) m0 -> (find (elt:=oee') x m0 = at_least_one o o' -> find (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (map f' m0)) = at_least_one_then_f o o') /\ (find (elt:=oee') x m0 = None -> find (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (map f' m0)) = None)e:X.eq x kH:Some (oo, oo') = at_least_one o o'H0:~ InA (eqk (elt:=oee')) (k, (oo, oo')) m0H1:NoDupA (eqk (elt:=oee')) m0H2:at_least_one_then_f o o' = f oo oo'find (elt:=elt'') x (option_cons k (f' (oo, oo')) (fold_right_pair (option_cons (A:=elt'')) nil (map f' m0))) = at_least_one_then_f o o'elt, elt', elt'':Typef:option elt -> option elt' -> option elt''x:keyk:X.too:option eltoo':option elt'm0:list (X.t * oee')o:option elto':option elt'f':=fun p : oee' => f (fst p) (snd p):oee' -> option elt''IHm0:NoDupA (eqk (elt:=oee')) m0 -> (find (elt:=oee') x m0 = at_least_one o o' -> find (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (map f' m0)) = at_least_one_then_f o o') /\ (find (elt:=oee') x m0 = None -> find (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (map f' m0)) = None)Hneq:~ X.eq x kH:find (elt:=oee') x m0 = at_least_one o o'H0:~ InA (eqk (elt:=oee')) (k, (oo, oo')) m0H1:NoDupA (eqk (elt:=oee')) m0find (elt:=elt'') x (option_cons k (f' (oo, oo')) (fold_right_pair (option_cons (A:=elt'')) nil (map f' m0))) = at_least_one_then_f o o'elt, elt', elt'':Typef:option elt -> option elt' -> option elt''x:keya:(X.t * oee')%typem0:list (X.t * oee')o:option elto':option elt'H2:NoDupA (eqk (elt:=oee')) (a :: m0)f':=fun p : oee' => f (fst p) (snd p):oee' -> option elt''IHm0:NoDupA (eqk (elt:=oee')) m0 -> (find (elt:=oee') x m0 = at_least_one o o' -> find (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (map f' m0)) = at_least_one_then_f o o') /\ (find (elt:=oee') x m0 = None -> find (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (map f' m0)) = None)H:(let (k', x0) := a in if X.eq_dec x k' then Some x0 else find (elt:=oee') x m0) = Nonefind (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (let (k, e) := a in (k, f' e) :: map f' m0)) = Noneelt, elt', elt'':Typef:option elt -> option elt' -> option elt''x:keyk:X.too:option eltoo':option elt'm0:list (X.t * oee')o:option elto':option elt'f':=fun p : oee' => f (fst p) (snd p):oee' -> option elt''IHm0:NoDupA (eqk (elt:=oee')) m0 -> (find (elt:=oee') x m0 = at_least_one o o' -> find (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (map f' m0)) = at_least_one_then_f o o') /\ (find (elt:=oee') x m0 = None -> find (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (map f' m0)) = None)e:X.eq x kH:Some (oo, oo') = at_least_one o o'H0:~ InA (eqk (elt:=oee')) (k, (oo, oo')) m0H1:NoDupA (eqk (elt:=oee')) m0H2:at_least_one_then_f o o' = f oo oo'find (elt:=elt'') x (option_cons k (f' (oo, oo')) (fold_right_pair (option_cons (A:=elt'')) nil (map f' m0))) = at_least_one_then_f o o'elt, elt', elt'':Typef:option elt -> option elt' -> option elt''x:keyk:X.too:option eltoo':option elt'm0:list (X.t * oee')o:option elto':option elt'f':=fun p : oee' => f (fst p) (snd p):oee' -> option elt''IHm0:NoDupA (eqk (elt:=oee')) m0 -> (find (elt:=oee') x m0 = at_least_one o o' -> find (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (map f' m0)) = at_least_one_then_f o o') /\ (find (elt:=oee') x m0 = None -> find (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (map f' m0)) = None)Hneq:~ X.eq x kH:find (elt:=oee') x m0 = at_least_one o o'H0:~ InA (eqk (elt:=oee')) (k, (oo, oo')) m0H1:NoDupA (eqk (elt:=oee')) m0find (elt:=elt'') x (option_cons k (f' (oo, oo')) (fold_right_pair (option_cons (A:=elt'')) nil (map f' m0))) = at_least_one_then_f o o'elt, elt', elt'':Typef:option elt -> option elt' -> option elt''x:keya:(X.t * oee')%typem0:list (X.t * oee')o:option elto':option elt'H2:NoDupA (eqk (elt:=oee')) (a :: m0)f':=fun p : oee' => f (fst p) (snd p):oee' -> option elt''IHm0:NoDupA (eqk (elt:=oee')) m0 -> (find (elt:=oee') x m0 = at_least_one o o' -> find (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (map f' m0)) = at_least_one_then_f o o') /\ (find (elt:=oee') x m0 = None -> find (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (map f' m0)) = None)H:(let (k', x0) := a in if X.eq_dec x k' then Some x0 else find (elt:=oee') x m0) = Nonefind (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (let (k, e) := a in (k, f' e) :: map f' m0)) = Noneelt, elt', elt'':Typef:option elt -> option elt' -> option elt''x:keyk:X.too:option eltoo':option elt'm0:list (X.t * oee')o:option elto':option elt'f':=fun p : oee' => f (fst p) (snd p):oee' -> option elt''IHm0:NoDupA (eqk (elt:=oee')) m0 -> (find (elt:=oee') x m0 = at_least_one o o' -> find (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (map f' m0)) = at_least_one_then_f o o') /\ (find (elt:=oee') x m0 = None -> find (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (map f' m0)) = None)e:X.eq x kH:Some (oo, oo') = at_least_one o o'H0:~ InA (eqk (elt:=oee')) (k, (oo, oo')) m0H1:NoDupA (eqk (elt:=oee')) m0H2:at_least_one_then_f o o' = f oo oo'find (elt:=elt'') x (option_cons k (f' (oo, oo')) (fold_right_pair (option_cons (A:=elt'')) nil (map f' m0))) = f oo oo'elt, elt', elt'':Typef:option elt -> option elt' -> option elt''x:keyk:X.too:option eltoo':option elt'm0:list (X.t * oee')o:option elto':option elt'f':=fun p : oee' => f (fst p) (snd p):oee' -> option elt''IHm0:NoDupA (eqk (elt:=oee')) m0 -> (find (elt:=oee') x m0 = at_least_one o o' -> find (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (map f' m0)) = at_least_one_then_f o o') /\ (find (elt:=oee') x m0 = None -> find (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (map f' m0)) = None)Hneq:~ X.eq x kH:find (elt:=oee') x m0 = at_least_one o o'H0:~ InA (eqk (elt:=oee')) (k, (oo, oo')) m0H1:NoDupA (eqk (elt:=oee')) m0find (elt:=elt'') x (option_cons k (f' (oo, oo')) (fold_right_pair (option_cons (A:=elt'')) nil (map f' m0))) = at_least_one_then_f o o'elt, elt', elt'':Typef:option elt -> option elt' -> option elt''x:keya:(X.t * oee')%typem0:list (X.t * oee')o:option elto':option elt'H2:NoDupA (eqk (elt:=oee')) (a :: m0)f':=fun p : oee' => f (fst p) (snd p):oee' -> option elt''IHm0:NoDupA (eqk (elt:=oee')) m0 -> (find (elt:=oee') x m0 = at_least_one o o' -> find (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (map f' m0)) = at_least_one_then_f o o') /\ (find (elt:=oee') x m0 = None -> find (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (map f' m0)) = None)H:(let (k', x0) := a in if X.eq_dec x k' then Some x0 else find (elt:=oee') x m0) = Nonefind (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (let (k, e) := a in (k, f' e) :: map f' m0)) = Noneelt, elt', elt'':Typef:option elt -> option elt' -> option elt''x:keyk:X.too:option eltoo':option elt'm0:list (X.t * oee')o:option elto':option elt'f':=fun p : oee' => f (fst p) (snd p):oee' -> option elt''IHm0:NoDupA (eqk (elt:=oee')) m0 -> (find (elt:=oee') x m0 = at_least_one o o' -> find (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (map f' m0)) = at_least_one_then_f o o') /\ (find (elt:=oee') x m0 = None -> find (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (map f' m0)) = None)e:X.eq x kH:Some (oo, oo') = at_least_one o o'H0:~ InA (eqk (elt:=oee')) (k, (oo, oo')) m0H1:NoDupA (eqk (elt:=oee')) m0H2:at_least_one_then_f o o' = f oo oo'find (elt:=elt'') x (option_cons k (f oo oo') (fold_right_pair (option_cons (A:=elt'')) nil (map (fun p : oee' => f (fst p) (snd p)) m0))) = f oo oo'elt, elt', elt'':Typef:option elt -> option elt' -> option elt''x:keyk:X.too:option eltoo':option elt'm0:list (X.t * oee')o:option elto':option elt'f':=fun p : oee' => f (fst p) (snd p):oee' -> option elt''IHm0:NoDupA (eqk (elt:=oee')) m0 -> (find (elt:=oee') x m0 = at_least_one o o' -> find (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (map f' m0)) = at_least_one_then_f o o') /\ (find (elt:=oee') x m0 = None -> find (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (map f' m0)) = None)Hneq:~ X.eq x kH:find (elt:=oee') x m0 = at_least_one o o'H0:~ InA (eqk (elt:=oee')) (k, (oo, oo')) m0H1:NoDupA (eqk (elt:=oee')) m0find (elt:=elt'') x (option_cons k (f' (oo, oo')) (fold_right_pair (option_cons (A:=elt'')) nil (map f' m0))) = at_least_one_then_f o o'elt, elt', elt'':Typef:option elt -> option elt' -> option elt''x:keya:(X.t * oee')%typem0:list (X.t * oee')o:option elto':option elt'H2:NoDupA (eqk (elt:=oee')) (a :: m0)f':=fun p : oee' => f (fst p) (snd p):oee' -> option elt''IHm0:NoDupA (eqk (elt:=oee')) m0 -> (find (elt:=oee') x m0 = at_least_one o o' -> find (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (map f' m0)) = at_least_one_then_f o o') /\ (find (elt:=oee') x m0 = None -> find (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (map f' m0)) = None)H:(let (k', x0) := a in if X.eq_dec x k' then Some x0 else find (elt:=oee') x m0) = Nonefind (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (let (k, e) := a in (k, f' e) :: map f' m0)) = Noneelt, elt', elt'':Typef:option elt -> option elt' -> option elt''x:keyk:X.too:option eltoo':option elt'm0:list (X.t * oee')o:option elto':option elt'f':=fun p : oee' => f (fst p) (snd p):oee' -> option elt''IHm0:NoDupA (eqk (elt:=oee')) m0 -> (find (elt:=oee') x m0 = at_least_one o o' -> find (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (map f' m0)) = at_least_one_then_f o o') /\ (find (elt:=oee') x m0 = None -> find (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (map f' m0)) = None)e:X.eq x kH:Some (oo, oo') = at_least_one o o'H0:~ InA (eqk (elt:=oee')) (k, (oo, oo')) m0H1:NoDupA (eqk (elt:=oee')) m0e0:elt''H2:at_least_one_then_f o o' = Some e0(if X.eq_dec x k then Some e0 else find (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (map (fun p : oee' => f (fst p) (snd p)) m0))) = Some e0elt, elt', elt'':Typef:option elt -> option elt' -> option elt''x:keyk:X.too:option eltoo':option elt'm0:list (X.t * oee')o:option elto':option elt'f':=fun p : oee' => f (fst p) (snd p):oee' -> option elt''IHm0:NoDupA (eqk (elt:=oee')) m0 -> (find (elt:=oee') x m0 = at_least_one o o' -> find (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (map f' m0)) = at_least_one_then_f o o') /\ (find (elt:=oee') x m0 = None -> find (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (map f' m0)) = None)e:X.eq x kH:Some (oo, oo') = at_least_one o o'H0:~ InA (eqk (elt:=oee')) (k, (oo, oo')) m0H1:NoDupA (eqk (elt:=oee')) m0H2:at_least_one_then_f o o' = Nonefind (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (map (fun p : oee' => f (fst p) (snd p)) m0)) = Noneelt, elt', elt'':Typef:option elt -> option elt' -> option elt''x:keyk:X.too:option eltoo':option elt'm0:list (X.t * oee')o:option elto':option elt'f':=fun p : oee' => f (fst p) (snd p):oee' -> option elt''IHm0:NoDupA (eqk (elt:=oee')) m0 -> (find (elt:=oee') x m0 = at_least_one o o' -> find (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (map f' m0)) = at_least_one_then_f o o') /\ (find (elt:=oee') x m0 = None -> find (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (map f' m0)) = None)Hneq:~ X.eq x kH:find (elt:=oee') x m0 = at_least_one o o'H0:~ InA (eqk (elt:=oee')) (k, (oo, oo')) m0H1:NoDupA (eqk (elt:=oee')) m0find (elt:=elt'') x (option_cons k (f' (oo, oo')) (fold_right_pair (option_cons (A:=elt'')) nil (map f' m0))) = at_least_one_then_f o o'elt, elt', elt'':Typef:option elt -> option elt' -> option elt''x:keya:(X.t * oee')%typem0:list (X.t * oee')o:option elto':option elt'H2:NoDupA (eqk (elt:=oee')) (a :: m0)f':=fun p : oee' => f (fst p) (snd p):oee' -> option elt''IHm0:NoDupA (eqk (elt:=oee')) m0 -> (find (elt:=oee') x m0 = at_least_one o o' -> find (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (map f' m0)) = at_least_one_then_f o o') /\ (find (elt:=oee') x m0 = None -> find (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (map f' m0)) = None)H:(let (k', x0) := a in if X.eq_dec x k' then Some x0 else find (elt:=oee') x m0) = Nonefind (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (let (k, e) := a in (k, f' e) :: map f' m0)) = Noneelt, elt', elt'':Typef:option elt -> option elt' -> option elt''x:keyk:X.too:option eltoo':option elt'm0:list (X.t * oee')o:option elto':option elt'f':=fun p : oee' => f (fst p) (snd p):oee' -> option elt''IHm0:NoDupA (eqk (elt:=oee')) m0 -> (find (elt:=oee') x m0 = at_least_one o o' -> find (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (map f' m0)) = at_least_one_then_f o o') /\ (find (elt:=oee') x m0 = None -> find (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (map f' m0)) = None)e:X.eq x kH:Some (oo, oo') = at_least_one o o'H0:~ InA (eqk (elt:=oee')) (k, (oo, oo')) m0H1:NoDupA (eqk (elt:=oee')) m0H2:at_least_one_then_f o o' = Nonefind (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (map (fun p : oee' => f (fst p) (snd p)) m0)) = Noneelt, elt', elt'':Typef:option elt -> option elt' -> option elt''x:keyk:X.too:option eltoo':option elt'm0:list (X.t * oee')o:option elto':option elt'f':=fun p : oee' => f (fst p) (snd p):oee' -> option elt''IHm0:NoDupA (eqk (elt:=oee')) m0 -> (find (elt:=oee') x m0 = at_least_one o o' -> find (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (map f' m0)) = at_least_one_then_f o o') /\ (find (elt:=oee') x m0 = None -> find (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (map f' m0)) = None)Hneq:~ X.eq x kH:find (elt:=oee') x m0 = at_least_one o o'H0:~ InA (eqk (elt:=oee')) (k, (oo, oo')) m0H1:NoDupA (eqk (elt:=oee')) m0find (elt:=elt'') x (option_cons k (f' (oo, oo')) (fold_right_pair (option_cons (A:=elt'')) nil (map f' m0))) = at_least_one_then_f o o'elt, elt', elt'':Typef:option elt -> option elt' -> option elt''x:keya:(X.t * oee')%typem0:list (X.t * oee')o:option elto':option elt'H2:NoDupA (eqk (elt:=oee')) (a :: m0)f':=fun p : oee' => f (fst p) (snd p):oee' -> option elt''IHm0:NoDupA (eqk (elt:=oee')) m0 -> (find (elt:=oee') x m0 = at_least_one o o' -> find (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (map f' m0)) = at_least_one_then_f o o') /\ (find (elt:=oee') x m0 = None -> find (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (map f' m0)) = None)H:(let (k', x0) := a in if X.eq_dec x k' then Some x0 else find (elt:=oee') x m0) = Nonefind (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (let (k, e) := a in (k, f' e) :: map f' m0)) = Noneelt, elt', elt'':Typef:option elt -> option elt' -> option elt''x:keyk:X.too:option eltoo':option elt'm0:list (X.t * oee')o:option elto':option elt'f':=fun p : oee' => f (fst p) (snd p):oee' -> option elt''IHm0:NoDupA (eqk (elt:=oee')) m0 -> (find (elt:=oee') x m0 = at_least_one o o' -> find (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (map f' m0)) = at_least_one_then_f o o') /\ (find (elt:=oee') x m0 = None -> find (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (map f' m0)) = None)e:X.eq x kH:Some (oo, oo') = at_least_one o o'H0:~ InA (eqk (elt:=oee')) (k, (oo, oo')) m0H1:NoDupA (eqk (elt:=oee')) m0H2:at_least_one_then_f o o' = NoneH4:find (elt:=oee') x m0 = None -> find (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (map f' m0)) = Nonefind (elt:=oee') x m0 = Noneelt, elt', elt'':Typef:option elt -> option elt' -> option elt''x:keyk:X.too:option eltoo':option elt'm0:list (X.t * oee')o:option elto':option elt'f':=fun p : oee' => f (fst p) (snd p):oee' -> option elt''IHm0:NoDupA (eqk (elt:=oee')) m0 -> (find (elt:=oee') x m0 = at_least_one o o' -> find (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (map f' m0)) = at_least_one_then_f o o') /\ (find (elt:=oee') x m0 = None -> find (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (map f' m0)) = None)Hneq:~ X.eq x kH:find (elt:=oee') x m0 = at_least_one o o'H0:~ InA (eqk (elt:=oee')) (k, (oo, oo')) m0H1:NoDupA (eqk (elt:=oee')) m0find (elt:=elt'') x (option_cons k (f' (oo, oo')) (fold_right_pair (option_cons (A:=elt'')) nil (map f' m0))) = at_least_one_then_f o o'elt, elt', elt'':Typef:option elt -> option elt' -> option elt''x:keya:(X.t * oee')%typem0:list (X.t * oee')o:option elto':option elt'H2:NoDupA (eqk (elt:=oee')) (a :: m0)f':=fun p : oee' => f (fst p) (snd p):oee' -> option elt''IHm0:NoDupA (eqk (elt:=oee')) m0 -> (find (elt:=oee') x m0 = at_least_one o o' -> find (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (map f' m0)) = at_least_one_then_f o o') /\ (find (elt:=oee') x m0 = None -> find (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (map f' m0)) = None)H:(let (k', x0) := a in if X.eq_dec x k' then Some x0 else find (elt:=oee') x m0) = Nonefind (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (let (k, e) := a in (k, f' e) :: map f' m0)) = Noneelt, elt', elt'':Typef:option elt -> option elt' -> option elt''x:keyk:X.too:option eltoo':option elt'm0:list (X.t * oee')o:option elto':option elt'f':=fun p0 : oee' => f (fst p0) (snd p0):oee' -> option elt''IHm0:NoDupA (eqk (elt:=oee')) m0 -> (find (elt:=oee') x m0 = at_least_one o o' -> find (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (map f' m0)) = at_least_one_then_f o o') /\ (find (elt:=oee') x m0 = None -> find (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (map f' m0)) = None)e:X.eq x kH:Some (oo, oo') = at_least_one o o'H0:~ InA (eqk (elt:=oee')) (k, (oo, oo')) m0H1:NoDupA (eqk (elt:=oee')) m0H2:at_least_one_then_f o o' = NoneH4:find (elt:=oee') x m0 = None -> find (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (map f' m0)) = Nonep:oee'H3:find (elt:=oee') x m0 = Some pSome p = Noneelt, elt', elt'':Typef:option elt -> option elt' -> option elt''x:keyk:X.too:option eltoo':option elt'm0:list (X.t * oee')o:option elto':option elt'f':=fun p : oee' => f (fst p) (snd p):oee' -> option elt''IHm0:NoDupA (eqk (elt:=oee')) m0 -> (find (elt:=oee') x m0 = at_least_one o o' -> find (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (map f' m0)) = at_least_one_then_f o o') /\ (find (elt:=oee') x m0 = None -> find (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (map f' m0)) = None)Hneq:~ X.eq x kH:find (elt:=oee') x m0 = at_least_one o o'H0:~ InA (eqk (elt:=oee')) (k, (oo, oo')) m0H1:NoDupA (eqk (elt:=oee')) m0find (elt:=elt'') x (option_cons k (f' (oo, oo')) (fold_right_pair (option_cons (A:=elt'')) nil (map f' m0))) = at_least_one_then_f o o'elt, elt', elt'':Typef:option elt -> option elt' -> option elt''x:keya:(X.t * oee')%typem0:list (X.t * oee')o:option elto':option elt'H2:NoDupA (eqk (elt:=oee')) (a :: m0)f':=fun p : oee' => f (fst p) (snd p):oee' -> option elt''IHm0:NoDupA (eqk (elt:=oee')) m0 -> (find (elt:=oee') x m0 = at_least_one o o' -> find (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (map f' m0)) = at_least_one_then_f o o') /\ (find (elt:=oee') x m0 = None -> find (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (map f' m0)) = None)H:(let (k', x0) := a in if X.eq_dec x k' then Some x0 else find (elt:=oee') x m0) = Nonefind (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (let (k, e) := a in (k, f' e) :: map f' m0)) = Noneelt, elt', elt'':Typef:option elt -> option elt' -> option elt''x:keyk:X.too:option eltoo':option elt'm0:list (X.t * oee')o:option elto':option elt'f':=fun p0 : oee' => f (fst p0) (snd p0):oee' -> option elt''IHm0:NoDupA (eqk (elt:=oee')) m0 -> (find (elt:=oee') x m0 = at_least_one o o' -> find (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (map f' m0)) = at_least_one_then_f o o') /\ (find (elt:=oee') x m0 = None -> find (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (map f' m0)) = None)e:X.eq x kH:Some (oo, oo') = at_least_one o o'H0:~ InA (eqk (elt:=oee')) (k, (oo, oo')) m0H1:NoDupA (eqk (elt:=oee')) m0H2:at_least_one_then_f o o' = NoneH4:find (elt:=oee') x m0 = None -> find (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (map f' m0)) = Nonep:oee'H3:find (elt:=oee') x m0 = Some pInA (eqk (elt:=oee')) (k, (oo, oo')) m0elt, elt', elt'':Typef:option elt -> option elt' -> option elt''x:keyk:X.too:option eltoo':option elt'm0:list (X.t * oee')o:option elto':option elt'f':=fun p : oee' => f (fst p) (snd p):oee' -> option elt''IHm0:NoDupA (eqk (elt:=oee')) m0 -> (find (elt:=oee') x m0 = at_least_one o o' -> find (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (map f' m0)) = at_least_one_then_f o o') /\ (find (elt:=oee') x m0 = None -> find (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (map f' m0)) = None)Hneq:~ X.eq x kH:find (elt:=oee') x m0 = at_least_one o o'H0:~ InA (eqk (elt:=oee')) (k, (oo, oo')) m0H1:NoDupA (eqk (elt:=oee')) m0find (elt:=elt'') x (option_cons k (f' (oo, oo')) (fold_right_pair (option_cons (A:=elt'')) nil (map f' m0))) = at_least_one_then_f o o'elt, elt', elt'':Typef:option elt -> option elt' -> option elt''x:keya:(X.t * oee')%typem0:list (X.t * oee')o:option elto':option elt'H2:NoDupA (eqk (elt:=oee')) (a :: m0)f':=fun p : oee' => f (fst p) (snd p):oee' -> option elt''IHm0:NoDupA (eqk (elt:=oee')) m0 -> (find (elt:=oee') x m0 = at_least_one o o' -> find (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (map f' m0)) = at_least_one_then_f o o') /\ (find (elt:=oee') x m0 = None -> find (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (map f' m0)) = None)H:(let (k', x0) := a in if X.eq_dec x k' then Some x0 else find (elt:=oee') x m0) = Nonefind (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (let (k, e) := a in (k, f' e) :: map f' m0)) = Noneelt, elt', elt'':Typef:option elt -> option elt' -> option elt''x:keyk:X.too:option eltoo':option elt'm0:list (X.t * oee')o:option elto':option elt'f':=fun p0 : oee' => f (fst p0) (snd p0):oee' -> option elt''IHm0:NoDupA (eqk (elt:=oee')) m0 -> (find (elt:=oee') x m0 = at_least_one o o' -> find (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (map f' m0)) = at_least_one_then_f o o') /\ (find (elt:=oee') x m0 = None -> find (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (map f' m0)) = None)e:X.eq x kH:Some (oo, oo') = at_least_one o o'H0:~ InA (eqk (elt:=oee')) (k, (oo, oo')) m0H1:NoDupA (eqk (elt:=oee')) m0H2:at_least_one_then_f o o' = NoneH4:find (elt:=oee') x m0 = None -> find (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (map f' m0)) = Nonep:oee'H3:find (elt:=oee') x m0 = Some pInA (eqk (elt:=oee')) (x, p) m0elt, elt', elt'':Typef:option elt -> option elt' -> option elt''x:keyk:X.too:option eltoo':option elt'm0:list (X.t * oee')o:option elto':option elt'f':=fun p : oee' => f (fst p) (snd p):oee' -> option elt''IHm0:NoDupA (eqk (elt:=oee')) m0 -> (find (elt:=oee') x m0 = at_least_one o o' -> find (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (map f' m0)) = at_least_one_then_f o o') /\ (find (elt:=oee') x m0 = None -> find (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (map f' m0)) = None)Hneq:~ X.eq x kH:find (elt:=oee') x m0 = at_least_one o o'H0:~ InA (eqk (elt:=oee')) (k, (oo, oo')) m0H1:NoDupA (eqk (elt:=oee')) m0find (elt:=elt'') x (option_cons k (f' (oo, oo')) (fold_right_pair (option_cons (A:=elt'')) nil (map f' m0))) = at_least_one_then_f o o'elt, elt', elt'':Typef:option elt -> option elt' -> option elt''x:keya:(X.t * oee')%typem0:list (X.t * oee')o:option elto':option elt'H2:NoDupA (eqk (elt:=oee')) (a :: m0)f':=fun p : oee' => f (fst p) (snd p):oee' -> option elt''IHm0:NoDupA (eqk (elt:=oee')) m0 -> (find (elt:=oee') x m0 = at_least_one o o' -> find (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (map f' m0)) = at_least_one_then_f o o') /\ (find (elt:=oee') x m0 = None -> find (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (map f' m0)) = None)H:(let (k', x0) := a in if X.eq_dec x k' then Some x0 else find (elt:=oee') x m0) = Nonefind (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (let (k, e) := a in (k, f' e) :: map f' m0)) = Noneelt, elt', elt'':Typef:option elt -> option elt' -> option elt''x:keyk:X.too:option eltoo':option elt'm0:list (X.t * oee')o:option elto':option elt'f':=fun p0 : oee' => f (fst p0) (snd p0):oee' -> option elt''IHm0:NoDupA (eqk (elt:=oee')) m0 -> (find (elt:=oee') x m0 = at_least_one o o' -> find (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (map f' m0)) = at_least_one_then_f o o') /\ (find (elt:=oee') x m0 = None -> find (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (map f' m0)) = None)e:X.eq x kH:Some (oo, oo') = at_least_one o o'H0:~ InA (eqk (elt:=oee')) (k, (oo, oo')) m0H1:NoDupA (eqk (elt:=oee')) m0H2:at_least_one_then_f o o' = NoneH4:find (elt:=oee') x m0 = None -> find (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (map f' m0)) = Nonep:oee'H3:find (elt:=oee') x m0 = Some pInA (eqke (elt:=oee')) (x, p) m0elt, elt', elt'':Typef:option elt -> option elt' -> option elt''x:keyk:X.too:option eltoo':option elt'm0:list (X.t * oee')o:option elto':option elt'f':=fun p : oee' => f (fst p) (snd p):oee' -> option elt''IHm0:NoDupA (eqk (elt:=oee')) m0 -> (find (elt:=oee') x m0 = at_least_one o o' -> find (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (map f' m0)) = at_least_one_then_f o o') /\ (find (elt:=oee') x m0 = None -> find (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (map f' m0)) = None)Hneq:~ X.eq x kH:find (elt:=oee') x m0 = at_least_one o o'H0:~ InA (eqk (elt:=oee')) (k, (oo, oo')) m0H1:NoDupA (eqk (elt:=oee')) m0find (elt:=elt'') x (option_cons k (f' (oo, oo')) (fold_right_pair (option_cons (A:=elt'')) nil (map f' m0))) = at_least_one_then_f o o'elt, elt', elt'':Typef:option elt -> option elt' -> option elt''x:keya:(X.t * oee')%typem0:list (X.t * oee')o:option elto':option elt'H2:NoDupA (eqk (elt:=oee')) (a :: m0)f':=fun p : oee' => f (fst p) (snd p):oee' -> option elt''IHm0:NoDupA (eqk (elt:=oee')) m0 -> (find (elt:=oee') x m0 = at_least_one o o' -> find (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (map f' m0)) = at_least_one_then_f o o') /\ (find (elt:=oee') x m0 = None -> find (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (map f' m0)) = None)H:(let (k', x0) := a in if X.eq_dec x k' then Some x0 else find (elt:=oee') x m0) = Nonefind (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (let (k, e) := a in (k, f' e) :: map f' m0)) = None(* k < x *)elt, elt', elt'':Typef:option elt -> option elt' -> option elt''x:keyk:X.too:option eltoo':option elt'm0:list (X.t * oee')o:option elto':option elt'f':=fun p : oee' => f (fst p) (snd p):oee' -> option elt''IHm0:NoDupA (eqk (elt:=oee')) m0 -> (find (elt:=oee') x m0 = at_least_one o o' -> find (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (map f' m0)) = at_least_one_then_f o o') /\ (find (elt:=oee') x m0 = None -> find (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (map f' m0)) = None)Hneq:~ X.eq x kH:find (elt:=oee') x m0 = at_least_one o o'H0:~ InA (eqk (elt:=oee')) (k, (oo, oo')) m0H1:NoDupA (eqk (elt:=oee')) m0find (elt:=elt'') x (option_cons k (f' (oo, oo')) (fold_right_pair (option_cons (A:=elt'')) nil (map f' m0))) = at_least_one_then_f o o'elt, elt', elt'':Typef:option elt -> option elt' -> option elt''x:keya:(X.t * oee')%typem0:list (X.t * oee')o:option elto':option elt'H2:NoDupA (eqk (elt:=oee')) (a :: m0)f':=fun p : oee' => f (fst p) (snd p):oee' -> option elt''IHm0:NoDupA (eqk (elt:=oee')) m0 -> (find (elt:=oee') x m0 = at_least_one o o' -> find (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (map f' m0)) = at_least_one_then_f o o') /\ (find (elt:=oee') x m0 = None -> find (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (map f' m0)) = None)H:(let (k', x0) := a in if X.eq_dec x k' then Some x0 else find (elt:=oee') x m0) = Nonefind (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (let (k, e) := a in (k, f' e) :: map f' m0)) = Noneelt, elt', elt'':Typef:option elt -> option elt' -> option elt''x:keyk:X.too:option eltoo':option elt'm0:list (X.t * oee')o:option elto':option elt'f':=fun p : oee' => f (fst p) (snd p):oee' -> option elt''IHm0:NoDupA (eqk (elt:=oee')) m0 -> (find (elt:=oee') x m0 = at_least_one o o' -> find (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (map f' m0)) = at_least_one_then_f o o') /\ (find (elt:=oee') x m0 = None -> find (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (map f' m0)) = None)Hneq:~ X.eq x kH:find (elt:=oee') x m0 = at_least_one o o'H0:~ InA (eqk (elt:=oee')) (k, (oo, oo')) m0H1:NoDupA (eqk (elt:=oee')) m0find (elt:=elt'') x (option_cons k (f oo oo') (fold_right_pair (option_cons (A:=elt'')) nil (map (fun p : oee' => f (fst p) (snd p)) m0))) = at_least_one_then_f o o'elt, elt', elt'':Typef:option elt -> option elt' -> option elt''x:keya:(X.t * oee')%typem0:list (X.t * oee')o:option elto':option elt'H2:NoDupA (eqk (elt:=oee')) (a :: m0)f':=fun p : oee' => f (fst p) (snd p):oee' -> option elt''IHm0:NoDupA (eqk (elt:=oee')) m0 -> (find (elt:=oee') x m0 = at_least_one o o' -> find (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (map f' m0)) = at_least_one_then_f o o') /\ (find (elt:=oee') x m0 = None -> find (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (map f' m0)) = None)H:(let (k', x0) := a in if X.eq_dec x k' then Some x0 else find (elt:=oee') x m0) = Nonefind (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (let (k, e) := a in (k, f' e) :: map f' m0)) = Noneelt, elt', elt'':Typef:option elt -> option elt' -> option elt''x:keyk:X.too:option eltoo':option elt'm0:list (X.t * oee')o:option elto':option elt'f':=fun p : oee' => f (fst p) (snd p):oee' -> option elt''IHm0:NoDupA (eqk (elt:=oee')) m0 -> (find (elt:=oee') x m0 = at_least_one o o' -> find (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (map f' m0)) = at_least_one_then_f o o') /\ (find (elt:=oee') x m0 = None -> find (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (map f' m0)) = None)Hneq:~ X.eq x kH:find (elt:=oee') x m0 = at_least_one o o'H0:~ InA (eqk (elt:=oee')) (k, (oo, oo')) m0H1:NoDupA (eqk (elt:=oee')) m0e:elt''(if X.eq_dec x k then Some e else find (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (map (fun p : oee' => f (fst p) (snd p)) m0))) = at_least_one_then_f o o'elt, elt', elt'':Typef:option elt -> option elt' -> option elt''x:keyk:X.too:option eltoo':option elt'm0:list (X.t * oee')o:option elto':option elt'f':=fun p : oee' => f (fst p) (snd p):oee' -> option elt''IHm0:NoDupA (eqk (elt:=oee')) m0 -> (find (elt:=oee') x m0 = at_least_one o o' -> find (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (map f' m0)) = at_least_one_then_f o o') /\ (find (elt:=oee') x m0 = None -> find (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (map f' m0)) = None)Hneq:~ X.eq x kH:find (elt:=oee') x m0 = at_least_one o o'H0:~ InA (eqk (elt:=oee')) (k, (oo, oo')) m0H1:NoDupA (eqk (elt:=oee')) m0find (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (map (fun p : oee' => f (fst p) (snd p)) m0)) = at_least_one_then_f o o'elt, elt', elt'':Typef:option elt -> option elt' -> option elt''x:keya:(X.t * oee')%typem0:list (X.t * oee')o:option elto':option elt'H2:NoDupA (eqk (elt:=oee')) (a :: m0)f':=fun p : oee' => f (fst p) (snd p):oee' -> option elt''IHm0:NoDupA (eqk (elt:=oee')) m0 -> (find (elt:=oee') x m0 = at_least_one o o' -> find (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (map f' m0)) = at_least_one_then_f o o') /\ (find (elt:=oee') x m0 = None -> find (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (map f' m0)) = None)H:(let (k', x0) := a in if X.eq_dec x k' then Some x0 else find (elt:=oee') x m0) = Nonefind (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (let (k, e) := a in (k, f' e) :: map f' m0)) = Noneelt, elt', elt'':Typef:option elt -> option elt' -> option elt''x:keyk:X.too:option eltoo':option elt'm0:list (X.t * oee')o:option elto':option elt'f':=fun p : oee' => f (fst p) (snd p):oee' -> option elt''IHm0:NoDupA (eqk (elt:=oee')) m0 -> (find (elt:=oee') x m0 = at_least_one o o' -> find (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (map f' m0)) = at_least_one_then_f o o') /\ (find (elt:=oee') x m0 = None -> find (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (map f' m0)) = None)Hneq:~ X.eq x kH:find (elt:=oee') x m0 = at_least_one o o'H0:~ InA (eqk (elt:=oee')) (k, (oo, oo')) m0H1:NoDupA (eqk (elt:=oee')) m0e:elt''n:~ X.eq x kfind (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (map (fun p : oee' => f (fst p) (snd p)) m0)) = at_least_one_then_f o o'elt, elt', elt'':Typef:option elt -> option elt' -> option elt''x:keyk:X.too:option eltoo':option elt'm0:list (X.t * oee')o:option elto':option elt'f':=fun p : oee' => f (fst p) (snd p):oee' -> option elt''IHm0:NoDupA (eqk (elt:=oee')) m0 -> (find (elt:=oee') x m0 = at_least_one o o' -> find (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (map f' m0)) = at_least_one_then_f o o') /\ (find (elt:=oee') x m0 = None -> find (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (map f' m0)) = None)Hneq:~ X.eq x kH:find (elt:=oee') x m0 = at_least_one o o'H0:~ InA (eqk (elt:=oee')) (k, (oo, oo')) m0H1:NoDupA (eqk (elt:=oee')) m0find (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (map (fun p : oee' => f (fst p) (snd p)) m0)) = at_least_one_then_f o o'elt, elt', elt'':Typef:option elt -> option elt' -> option elt''x:keya:(X.t * oee')%typem0:list (X.t * oee')o:option elto':option elt'H2:NoDupA (eqk (elt:=oee')) (a :: m0)f':=fun p : oee' => f (fst p) (snd p):oee' -> option elt''IHm0:NoDupA (eqk (elt:=oee')) m0 -> (find (elt:=oee') x m0 = at_least_one o o' -> find (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (map f' m0)) = at_least_one_then_f o o') /\ (find (elt:=oee') x m0 = None -> find (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (map f' m0)) = None)H:(let (k', x0) := a in if X.eq_dec x k' then Some x0 else find (elt:=oee') x m0) = Nonefind (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (let (k, e) := a in (k, f' e) :: map f' m0)) = Noneelt, elt', elt'':Typef:option elt -> option elt' -> option elt''x:keyk:X.too:option eltoo':option elt'm0:list (X.t * oee')o:option elto':option elt'f':=fun p : oee' => f (fst p) (snd p):oee' -> option elt''IHm0:NoDupA (eqk (elt:=oee')) m0 -> (find (elt:=oee') x m0 = at_least_one o o' -> find (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (map f' m0)) = at_least_one_then_f o o') /\ (find (elt:=oee') x m0 = None -> find (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (map f' m0)) = None)Hneq:~ X.eq x kH:find (elt:=oee') x m0 = at_least_one o o'H0:~ InA (eqk (elt:=oee')) (k, (oo, oo')) m0H1:NoDupA (eqk (elt:=oee')) m0find (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (map (fun p : oee' => f (fst p) (snd p)) m0)) = at_least_one_then_f o o'elt, elt', elt'':Typef:option elt -> option elt' -> option elt''x:keya:(X.t * oee')%typem0:list (X.t * oee')o:option elto':option elt'H2:NoDupA (eqk (elt:=oee')) (a :: m0)f':=fun p : oee' => f (fst p) (snd p):oee' -> option elt''IHm0:NoDupA (eqk (elt:=oee')) m0 -> (find (elt:=oee') x m0 = at_least_one o o' -> find (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (map f' m0)) = at_least_one_then_f o o') /\ (find (elt:=oee') x m0 = None -> find (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (map f' m0)) = None)H:(let (k', x0) := a in if X.eq_dec x k' then Some x0 else find (elt:=oee') x m0) = Nonefind (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (let (k, e) := a in (k, f' e) :: map f' m0)) = None(* None -> None *)elt, elt', elt'':Typef:option elt -> option elt' -> option elt''x:keya:(X.t * oee')%typem0:list (X.t * oee')o:option elto':option elt'H2:NoDupA (eqk (elt:=oee')) (a :: m0)f':=fun p : oee' => f (fst p) (snd p):oee' -> option elt''IHm0:NoDupA (eqk (elt:=oee')) m0 -> (find (elt:=oee') x m0 = at_least_one o o' -> find (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (map f' m0)) = at_least_one_then_f o o') /\ (find (elt:=oee') x m0 = None -> find (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (map f' m0)) = None)H:(let (k', x0) := a in if X.eq_dec x k' then Some x0 else find (elt:=oee') x m0) = Nonefind (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (let (k, e) := a in (k, f' e) :: map f' m0)) = Noneelt, elt', elt'':Typef:option elt -> option elt' -> option elt''x:keyk:X.too:option eltoo':option elt'm0:list (X.t * oee')o:option elto':option elt'H2:NoDupA (eqk (elt:=oee')) ((k, (oo, oo')) :: m0)f':=fun p : oee' => f (fst p) (snd p):oee' -> option elt''IHm0:NoDupA (eqk (elt:=oee')) m0 -> (find (elt:=oee') x m0 = at_least_one o o' -> find (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (map f' m0)) = at_least_one_then_f o o') /\ (find (elt:=oee') x m0 = None -> find (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (map f' m0)) = None)H:(if X.eq_dec x k then Some (oo, oo') else find (elt:=oee') x m0) = Nonefind (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil ((k, f' (oo, oo')) :: map f' m0)) = Noneelt, elt', elt'':Typef:option elt -> option elt' -> option elt''x:keyk:X.too:option eltoo':option elt'm0:list (X.t * oee')o:option elto':option elt'H2:NoDupA (eqk (elt:=oee')) ((k, (oo, oo')) :: m0)f':=fun p : oee' => f (fst p) (snd p):oee' -> option elt''IHm0:NoDupA (eqk (elt:=oee')) m0 -> (find (elt:=oee') x m0 = at_least_one o o' -> find (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (map f' m0)) = at_least_one_then_f o o') /\ (find (elt:=oee') x m0 = None -> find (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (map f' m0)) = None)H:(if X.eq_dec x k then Some (oo, oo') else find (elt:=oee') x m0) = Nonefind (elt:=elt'') x (option_cons k (f' (oo, oo')) (fold_right_pair (option_cons (A:=elt'')) nil (map f' m0))) = Noneelt, elt', elt'':Typef:option elt -> option elt' -> option elt''x:keyk:X.too:option eltoo':option elt'm0:list (X.t * oee')o:option elto':option elt'f':=fun p : oee' => f (fst p) (snd p):oee' -> option elt''IHm0:NoDupA (eqk (elt:=oee')) m0 -> (find (elt:=oee') x m0 = at_least_one o o' -> find (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (map f' m0)) = at_least_one_then_f o o') /\ (find (elt:=oee') x m0 = None -> find (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (map f' m0)) = None)H:(if X.eq_dec x k then Some (oo, oo') else find (elt:=oee') x m0) = NoneH0:~ InA (eqk (elt:=oee')) (k, (oo, oo')) m0H1:NoDupA (eqk (elt:=oee')) m0find (elt:=elt'') x (option_cons k (f' (oo, oo')) (fold_right_pair (option_cons (A:=elt'')) nil (map f' m0))) = None(* x = k *)elt, elt', elt'':Typef:option elt -> option elt' -> option elt''x:keyk:X.too:option eltoo':option elt'm0:list (X.t * oee')o:option elto':option elt'f':=fun p : oee' => f (fst p) (snd p):oee' -> option elt''IHm0:NoDupA (eqk (elt:=oee')) m0 -> (find (elt:=oee') x m0 = at_least_one o o' -> find (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (map f' m0)) = at_least_one_then_f o o') /\ (find (elt:=oee') x m0 = None -> find (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (map f' m0)) = None)e:X.eq x kH:Some (oo, oo') = NoneH0:~ InA (eqk (elt:=oee')) (k, (oo, oo')) m0H1:NoDupA (eqk (elt:=oee')) m0find (elt:=elt'') x (option_cons k (f' (oo, oo')) (fold_right_pair (option_cons (A:=elt'')) nil (map f' m0))) = Noneelt, elt', elt'':Typef:option elt -> option elt' -> option elt''x:keyk:X.too:option eltoo':option elt'm0:list (X.t * oee')o:option elto':option elt'f':=fun p : oee' => f (fst p) (snd p):oee' -> option elt''IHm0:NoDupA (eqk (elt:=oee')) m0 -> (find (elt:=oee') x m0 = at_least_one o o' -> find (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (map f' m0)) = at_least_one_then_f o o') /\ (find (elt:=oee') x m0 = None -> find (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (map f' m0)) = None)Hneq:~ X.eq x kH:find (elt:=oee') x m0 = NoneH0:~ InA (eqk (elt:=oee')) (k, (oo, oo')) m0H1:NoDupA (eqk (elt:=oee')) m0find (elt:=elt'') x (option_cons k (f' (oo, oo')) (fold_right_pair (option_cons (A:=elt'')) nil (map f' m0))) = None(* k < x *)elt, elt', elt'':Typef:option elt -> option elt' -> option elt''x:keyk:X.too:option eltoo':option elt'm0:list (X.t * oee')o:option elto':option elt'f':=fun p : oee' => f (fst p) (snd p):oee' -> option elt''IHm0:NoDupA (eqk (elt:=oee')) m0 -> (find (elt:=oee') x m0 = at_least_one o o' -> find (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (map f' m0)) = at_least_one_then_f o o') /\ (find (elt:=oee') x m0 = None -> find (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (map f' m0)) = None)Hneq:~ X.eq x kH:find (elt:=oee') x m0 = NoneH0:~ InA (eqk (elt:=oee')) (k, (oo, oo')) m0H1:NoDupA (eqk (elt:=oee')) m0find (elt:=elt'') x (option_cons k (f' (oo, oo')) (fold_right_pair (option_cons (A:=elt'')) nil (map f' m0))) = Noneelt, elt', elt'':Typef:option elt -> option elt' -> option elt''x:keyk:X.too:option eltoo':option elt'm0:list (X.t * oee')o:option elto':option elt'f':=fun p : oee' => f (fst p) (snd p):oee' -> option elt''IHm0:NoDupA (eqk (elt:=oee')) m0 -> (find (elt:=oee') x m0 = at_least_one o o' -> find (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (map f' m0)) = at_least_one_then_f o o') /\ (find (elt:=oee') x m0 = None -> find (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (map f' m0)) = None)Hneq:~ X.eq x kH:find (elt:=oee') x m0 = NoneH0:~ InA (eqk (elt:=oee')) (k, (oo, oo')) m0H1:NoDupA (eqk (elt:=oee')) m0find (elt:=elt'') x (option_cons k (f oo oo') (fold_right_pair (option_cons (A:=elt'')) nil (map (fun p : oee' => f (fst p) (snd p)) m0))) = Noneelt, elt', elt'':Typef:option elt -> option elt' -> option elt''x:keyk:X.too:option eltoo':option elt'm0:list (X.t * oee')o:option elto':option elt'f':=fun p : oee' => f (fst p) (snd p):oee' -> option elt''IHm0:NoDupA (eqk (elt:=oee')) m0 -> (find (elt:=oee') x m0 = at_least_one o o' -> find (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (map f' m0)) = at_least_one_then_f o o') /\ (find (elt:=oee') x m0 = None -> find (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (map f' m0)) = None)Hneq:~ X.eq x kH:find (elt:=oee') x m0 = NoneH0:~ InA (eqk (elt:=oee')) (k, (oo, oo')) m0H1:NoDupA (eqk (elt:=oee')) m0e:elt''(if X.eq_dec x k then Some e else find (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (map (fun p : oee' => f (fst p) (snd p)) m0))) = Noneelt, elt', elt'':Typef:option elt -> option elt' -> option elt''x:keyk:X.too:option eltoo':option elt'm0:list (X.t * oee')o:option elto':option elt'f':=fun p : oee' => f (fst p) (snd p):oee' -> option elt''IHm0:NoDupA (eqk (elt:=oee')) m0 -> (find (elt:=oee') x m0 = at_least_one o o' -> find (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (map f' m0)) = at_least_one_then_f o o') /\ (find (elt:=oee') x m0 = None -> find (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (map f' m0)) = None)Hneq:~ X.eq x kH:find (elt:=oee') x m0 = NoneH0:~ InA (eqk (elt:=oee')) (k, (oo, oo')) m0H1:NoDupA (eqk (elt:=oee')) m0find (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (map (fun p : oee' => f (fst p) (snd p)) m0)) = Noneelt, elt', elt'':Typef:option elt -> option elt' -> option elt''x:keyk:X.too:option eltoo':option elt'm0:list (X.t * oee')o:option elto':option elt'f':=fun p : oee' => f (fst p) (snd p):oee' -> option elt''IHm0:NoDupA (eqk (elt:=oee')) m0 -> (find (elt:=oee') x m0 = at_least_one o o' -> find (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (map f' m0)) = at_least_one_then_f o o') /\ (find (elt:=oee') x m0 = None -> find (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (map f' m0)) = None)Hneq:~ X.eq x kH:find (elt:=oee') x m0 = NoneH0:~ InA (eqk (elt:=oee')) (k, (oo, oo')) m0H1:NoDupA (eqk (elt:=oee')) m0e:elt''n:~ X.eq x kfind (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (map (fun p : oee' => f (fst p) (snd p)) m0)) = Noneelt, elt', elt'':Typef:option elt -> option elt' -> option elt''x:keyk:X.too:option eltoo':option elt'm0:list (X.t * oee')o:option elto':option elt'f':=fun p : oee' => f (fst p) (snd p):oee' -> option elt''IHm0:NoDupA (eqk (elt:=oee')) m0 -> (find (elt:=oee') x m0 = at_least_one o o' -> find (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (map f' m0)) = at_least_one_then_f o o') /\ (find (elt:=oee') x m0 = None -> find (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (map f' m0)) = None)Hneq:~ X.eq x kH:find (elt:=oee') x m0 = NoneH0:~ InA (eqk (elt:=oee')) (k, (oo, oo')) m0H1:NoDupA (eqk (elt:=oee')) m0find (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (map (fun p : oee' => f (fst p) (snd p)) m0)) = Nonedestruct (IHm0 H1) as (_,H4); apply H4; auto. Qed.elt, elt', elt'':Typef:option elt -> option elt' -> option elt''x:keyk:X.too:option eltoo':option elt'm0:list (X.t * oee')o:option elto':option elt'f':=fun p : oee' => f (fst p) (snd p):oee' -> option elt''IHm0:NoDupA (eqk (elt:=oee')) m0 -> (find (elt:=oee') x m0 = at_least_one o o' -> find (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (map f' m0)) = at_least_one_then_f o o') /\ (find (elt:=oee') x m0 = None -> find (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (map f' m0)) = None)Hneq:~ X.eq x kH:find (elt:=oee') x m0 = NoneH0:~ InA (eqk (elt:=oee')) (k, (oo, oo')) m0H1:NoDupA (eqk (elt:=oee')) m0find (elt:=elt'') x (fold_right_pair (option_cons (A:=elt'')) nil (map (fun p : oee' => f (fst p) (snd p)) m0)) = None
Specification of map2
elt, elt', elt'':Typef:option elt -> option elt' -> option elt''forall m : list (X.t * elt), NoDupA (eqk (elt:=elt)) m -> forall m' : list (X.t * elt'), NoDupA (eqk (elt:=elt')) m' -> forall x : key, In x m \/ In x m' -> find (elt:=elt'') x (map2 m m') = f (find (elt:=elt) x m) (find (elt:=elt') x m')elt, elt', elt'':Typef:option elt -> option elt' -> option elt''forall m : list (X.t * elt), NoDupA (eqk (elt:=elt)) m -> forall m' : list (X.t * elt'), NoDupA (eqk (elt:=elt')) m' -> forall x : key, In x m \/ In x m' -> find (elt:=elt'') x (map2 m m') = f (find (elt:=elt) x m) (find (elt:=elt') x m')elt, elt', elt'':Typef:option elt -> option elt' -> option elt''m:list (X.t * elt)Hm:NoDupA (eqk (elt:=elt)) mm':list (X.t * elt')Hm':NoDupA (eqk (elt:=elt')) m'x:keyH:In x m \/ In x m'find (elt:=elt'') x (map2 m m') = f (find (elt:=elt) x m) (find (elt:=elt') x m')elt, elt', elt'':Typef:option elt -> option elt' -> option elt''m:list (X.t * elt)Hm:NoDupA (eqk (elt:=elt)) mm':list (X.t * elt')Hm':NoDupA (eqk (elt:=elt')) m'x:keyH:In x m \/ In x m'at_least_one_then_f (find (elt:=elt) x m) (find (elt:=elt') x m') = f (find (elt:=elt) x m) (find (elt:=elt') x m')elt, elt', elt'':Typef:option elt -> option elt' -> option elt''m:list (X.t * elt)Hm:NoDupA (eqk (elt:=elt)) mm':list (X.t * elt')Hm':NoDupA (eqk (elt:=elt')) m'x:keye:eltH:MapsTo x e mat_least_one_then_f (find (elt:=elt) x m) (find (elt:=elt') x m') = f (find (elt:=elt) x m) (find (elt:=elt') x m')elt, elt', elt'':Typef:option elt -> option elt' -> option elt''m:list (X.t * elt)Hm:NoDupA (eqk (elt:=elt)) mm':list (X.t * elt')Hm':NoDupA (eqk (elt:=elt')) m'x:keye:elt'H:MapsTo x e m'at_least_one_then_f (find (elt:=elt) x m) (find (elt:=elt') x m') = f (find (elt:=elt) x m) (find (elt:=elt') x m')elt, elt', elt'':Typef:option elt -> option elt' -> option elt''m:list (X.t * elt)Hm:NoDupA (eqk (elt:=elt)) mm':list (X.t * elt')Hm':NoDupA (eqk (elt:=elt')) m'x:keye:eltH:MapsTo x e mat_least_one_then_f (Some e) (find (elt:=elt') x m') = f (Some e) (find (elt:=elt') x m')elt, elt', elt'':Typef:option elt -> option elt' -> option elt''m:list (X.t * elt)Hm:NoDupA (eqk (elt:=elt)) mm':list (X.t * elt')Hm':NoDupA (eqk (elt:=elt')) m'x:keye:elt'H:MapsTo x e m'at_least_one_then_f (find (elt:=elt) x m) (find (elt:=elt') x m') = f (find (elt:=elt) x m) (find (elt:=elt') x m')elt, elt', elt'':Typef:option elt -> option elt' -> option elt''m:list (X.t * elt)Hm:NoDupA (eqk (elt:=elt)) mm':list (X.t * elt')Hm':NoDupA (eqk (elt:=elt')) m'x:keye:elt'H:MapsTo x e m'at_least_one_then_f (find (elt:=elt) x m) (find (elt:=elt') x m') = f (find (elt:=elt) x m) (find (elt:=elt') x m')destruct (find x m); simpl; auto. Qed.elt, elt', elt'':Typef:option elt -> option elt' -> option elt''m:list (X.t * elt)Hm:NoDupA (eqk (elt:=elt)) mm':list (X.t * elt')Hm':NoDupA (eqk (elt:=elt')) m'x:keye:elt'H:MapsTo x e m'at_least_one_then_f (find (elt:=elt) x m) (Some e) = f (find (elt:=elt) x m) (Some e)elt, elt', elt'':Typef:option elt -> option elt' -> option elt''forall m : list (X.t * elt), NoDupA (eqk (elt:=elt)) m -> forall m' : list (X.t * elt'), NoDupA (eqk (elt:=elt')) m' -> forall x : key, In x (map2 m m') -> In x m \/ In x m'elt, elt', elt'':Typef:option elt -> option elt' -> option elt''forall m : list (X.t * elt), NoDupA (eqk (elt:=elt)) m -> forall m' : list (X.t * elt'), NoDupA (eqk (elt:=elt')) m' -> forall x : key, In x (map2 m m') -> In x m \/ In x m'elt, elt', elt'':Typef:option elt -> option elt' -> option elt''m:list (X.t * elt)Hm:NoDupA (eqk (elt:=elt)) mm':list (X.t * elt')Hm':NoDupA (eqk (elt:=elt')) m'x:keyH:In x (map2 m m')In x m \/ In x m'elt, elt', elt'':Typef:option elt -> option elt' -> option elt''m:list (X.t * elt)Hm:NoDupA (eqk (elt:=elt)) mm':list (X.t * elt')Hm':NoDupA (eqk (elt:=elt')) m'x:keye:elt''H:MapsTo x e (map2 m m')In x m \/ In x m'elt, elt', elt'':Typef:option elt -> option elt' -> option elt''m:list (X.t * elt)Hm:NoDupA (eqk (elt:=elt)) mm':list (X.t * elt')Hm':NoDupA (eqk (elt:=elt')) m'x:keye:elt''H:MapsTo x e (map2 m m')find (elt:=elt'') x (map2 m m') = at_least_one_then_f (find (elt:=elt) x m) (find (elt:=elt') x m') -> In x m \/ In x m'elt, elt', elt'':Typef:option elt -> option elt' -> option elt''m:list (X.t * elt)Hm:NoDupA (eqk (elt:=elt)) mm':list (X.t * elt')Hm':NoDupA (eqk (elt:=elt')) m'x:keye:elt''H:MapsTo x e (map2 m m')Some e = at_least_one_then_f (find (elt:=elt) x m) (find (elt:=elt') x m') -> In x m \/ In x m'elt, elt', elt'':Typef:option elt -> option elt' -> option elt''m:list (X.t * elt)Hm:NoDupA (eqk (elt:=elt)) mm':list (X.t * elt')Hm':NoDupA (eqk (elt:=elt')) m'x:keye:elt''H:MapsTo x e (map2 m m')(forall e0 : elt, find (elt:=elt) x m = Some e0 -> MapsTo x e0 m) -> Some e = at_least_one_then_f (find (elt:=elt) x m) (find (elt:=elt') x m') -> In x m \/ In x m'elt, elt', elt'':Typef:option elt -> option elt' -> option elt''m:list (X.t * elt)Hm:NoDupA (eqk (elt:=elt)) mm':list (X.t * elt')Hm':NoDupA (eqk (elt:=elt')) m'x:keye:elt''H:MapsTo x e (map2 m m')(forall e0 : elt', find (elt:=elt') x m' = Some e0 -> MapsTo x e0 m') -> (forall e0 : elt, find (elt:=elt) x m = Some e0 -> MapsTo x e0 m) -> Some e = at_least_one_then_f (find (elt:=elt) x m) (find (elt:=elt') x m') -> In x m \/ In x m'elt, elt', elt'':Typef:option elt -> option elt' -> option elt''m:list (X.t * elt)Hm:NoDupA (eqk (elt:=elt)) mm':list (X.t * elt')Hm':NoDupA (eqk (elt:=elt')) m'x:keye:elt''H:MapsTo x e (map2 m m')e0:elte1:elt'H0:forall e2 : elt', Some e1 = Some e2 -> MapsTo x e2 m'H1:forall e2 : elt, Some e0 = Some e2 -> MapsTo x e2 mH2:Some e = f (Some e0) (Some e1)In x m \/ In x m'elt, elt', elt'':Typef:option elt -> option elt' -> option elt''m:list (X.t * elt)Hm:NoDupA (eqk (elt:=elt)) mm':list (X.t * elt')Hm':NoDupA (eqk (elt:=elt')) m'x:keye:elt''H:MapsTo x e (map2 m m')e0:eltH0:forall e1 : elt', None = Some e1 -> MapsTo x e1 m'H1:forall e1 : elt, Some e0 = Some e1 -> MapsTo x e1 mH2:Some e = f (Some e0) NoneIn x m \/ In x m'elt, elt', elt'':Typef:option elt -> option elt' -> option elt''m:list (X.t * elt)Hm:NoDupA (eqk (elt:=elt)) mm':list (X.t * elt')Hm':NoDupA (eqk (elt:=elt')) m'x:keye:elt''H:MapsTo x e (map2 m m')e0:elt'H0:forall e1 : elt', Some e0 = Some e1 -> MapsTo x e1 m'H1:forall e1 : elt, None = Some e1 -> MapsTo x e1 mH2:Some e = f None (Some e0)In x m \/ In x m'elt, elt', elt'':Typef:option elt -> option elt' -> option elt''m:list (X.t * elt)Hm:NoDupA (eqk (elt:=elt)) mm':list (X.t * elt')Hm':NoDupA (eqk (elt:=elt')) m'x:keye:elt''H:MapsTo x e (map2 m m')H0:forall e0 : elt', None = Some e0 -> MapsTo x e0 m'H1:forall e0 : elt, None = Some e0 -> MapsTo x e0 mH2:Some e = NoneIn x m \/ In x m'elt, elt', elt'':Typef:option elt -> option elt' -> option elt''m:list (X.t * elt)Hm:NoDupA (eqk (elt:=elt)) mm':list (X.t * elt')Hm':NoDupA (eqk (elt:=elt')) m'x:keye:elt''H:MapsTo x e (map2 m m')e0:eltH0:forall e1 : elt', None = Some e1 -> MapsTo x e1 m'H1:forall e1 : elt, Some e0 = Some e1 -> MapsTo x e1 mH2:Some e = f (Some e0) NoneIn x m \/ In x m'elt, elt', elt'':Typef:option elt -> option elt' -> option elt''m:list (X.t * elt)Hm:NoDupA (eqk (elt:=elt)) mm':list (X.t * elt')Hm':NoDupA (eqk (elt:=elt')) m'x:keye:elt''H:MapsTo x e (map2 m m')e0:elt'H0:forall e1 : elt', Some e0 = Some e1 -> MapsTo x e1 m'H1:forall e1 : elt, None = Some e1 -> MapsTo x e1 mH2:Some e = f None (Some e0)In x m \/ In x m'elt, elt', elt'':Typef:option elt -> option elt' -> option elt''m:list (X.t * elt)Hm:NoDupA (eqk (elt:=elt)) mm':list (X.t * elt')Hm':NoDupA (eqk (elt:=elt')) m'x:keye:elt''H:MapsTo x e (map2 m m')H0:forall e0 : elt', None = Some e0 -> MapsTo x e0 m'H1:forall e0 : elt, None = Some e0 -> MapsTo x e0 mH2:Some e = NoneIn x m \/ In x m'elt, elt', elt'':Typef:option elt -> option elt' -> option elt''m:list (X.t * elt)Hm:NoDupA (eqk (elt:=elt)) mm':list (X.t * elt')Hm':NoDupA (eqk (elt:=elt')) m'x:keye:elt''H:MapsTo x e (map2 m m')e0:elt'H0:forall e1 : elt', Some e0 = Some e1 -> MapsTo x e1 m'H1:forall e1 : elt, None = Some e1 -> MapsTo x e1 mH2:Some e = f None (Some e0)In x m \/ In x m'elt, elt', elt'':Typef:option elt -> option elt' -> option elt''m:list (X.t * elt)Hm:NoDupA (eqk (elt:=elt)) mm':list (X.t * elt')Hm':NoDupA (eqk (elt:=elt')) m'x:keye:elt''H:MapsTo x e (map2 m m')H0:forall e0 : elt', None = Some e0 -> MapsTo x e0 m'H1:forall e0 : elt, None = Some e0 -> MapsTo x e0 mH2:Some e = NoneIn x m \/ In x m'discriminate. Qed. End Elt3. End Raw. Module Make (X: DecidableType) <: WS with Module E:=X. Module Raw := Raw X. Module E := X. Definition key := E.t. Record slist (elt:Type) := {this :> Raw.t elt; NoDup : NoDupA (@Raw.PX.eqk elt) this}. Definition t (elt:Type) := slist elt. Section Elt. Variable elt elt' elt'':Type. Implicit Types m : t elt. Implicit Types x y : key. Implicit Types e : elt. Definition empty : t elt := Build_slist (Raw.empty_NoDup elt). Definition is_empty m : bool := Raw.is_empty (this m). Definition add x e m : t elt := Build_slist (Raw.add_NoDup (NoDup m) x e). Definition find x m : option elt := Raw.find x (this m). Definition remove x m : t elt := Build_slist (Raw.remove_NoDup (NoDup m) x). Definition mem x m : bool := Raw.mem x (this m). Definition map f m : t elt' := Build_slist (Raw.map_NoDup (NoDup m) f). Definition mapi (f:key->elt->elt') m : t elt' := Build_slist (Raw.mapi_NoDup (NoDup m) f). Definition map2 f m (m':t elt') : t elt'' := Build_slist (Raw.map2_NoDup f (NoDup m) (NoDup m')). Definition elements m : list (key*elt) := @Raw.elements elt (this m). Definition cardinal m := length (this m). Definition fold (A:Type)(f:key->elt->A->A) m (i:A) : A := @Raw.fold elt A f (this m) i. Definition equal cmp m m' : bool := @Raw.equal elt cmp (this m) (this m'). Definition MapsTo x e m : Prop := Raw.PX.MapsTo x e (this m). Definition In x m : Prop := Raw.PX.In x (this m). Definition Empty m : Prop := Raw.Empty (this m). Definition Equal m m' := forall y, find y m = find y m'. Definition Equiv (eq_elt:elt->elt->Prop) m m' := (forall k, In k m <-> In k m') /\ (forall k e e', MapsTo k e m -> MapsTo k e' m' -> eq_elt e e'). Definition Equivb cmp m m' : Prop := @Raw.Equivb elt cmp (this m) (this m'). Definition eq_key : (key*elt) -> (key*elt) -> Prop := @Raw.PX.eqk elt. Definition eq_key_elt : (key*elt) -> (key*elt) -> Prop:= @Raw.PX.eqke elt.elt, elt', elt'':Typef:option elt -> option elt' -> option elt''m:list (X.t * elt)Hm:NoDupA (eqk (elt:=elt)) mm':list (X.t * elt')Hm':NoDupA (eqk (elt:=elt')) m'x:keye:elt''H:MapsTo x e (map2 m m')H0:forall e0 : elt', None = Some e0 -> MapsTo x e0 m'H1:forall e0 : elt, None = Some e0 -> MapsTo x e0 mH2:Some e = NoneIn x m \/ In x m'elt, elt', elt'':Typeforall (m : t elt) (x y : key) (e : elt), E.eq x y -> MapsTo x e m -> MapsTo y e mintros m; exact (@Raw.PX.MapsTo_eq elt (this m)). Qed.elt, elt', elt'':Typeforall (m : t elt) (x y : key) (e : elt), E.eq x y -> MapsTo x e m -> MapsTo y e melt, elt', elt'':Typeforall (m : t elt) (x : key), In x m -> mem x m = trueintros m; exact (@Raw.mem_1 elt (this m) (NoDup m)). Qed.elt, elt', elt'':Typeforall (m : t elt) (x : key), In x m -> mem x m = trueelt, elt', elt'':Typeforall (m : t elt) (x : key), mem x m = true -> In x mintros m; exact (@Raw.mem_2 elt (this m) (NoDup m)). Qed.elt, elt', elt'':Typeforall (m : t elt) (x : key), mem x m = true -> In x melt, elt', elt'':TypeEmpty emptyexact (@Raw.empty_1 elt). Qed.elt, elt', elt'':TypeEmpty emptyelt, elt', elt'':Typeforall m : t elt, Empty m -> is_empty m = trueintros m; exact (@Raw.is_empty_1 elt (this m)). Qed.elt, elt', elt'':Typeforall m : t elt, Empty m -> is_empty m = trueelt, elt', elt'':Typeforall m : t elt, is_empty m = true -> Empty mintros m; exact (@Raw.is_empty_2 elt (this m)). Qed.elt, elt', elt'':Typeforall m : t elt, is_empty m = true -> Empty melt, elt', elt'':Typeforall (m : t elt) (x y : key) (e : elt), E.eq x y -> MapsTo y e (add x e m)intros m; exact (@Raw.add_1 elt (this m)). Qed.elt, elt', elt'':Typeforall (m : t elt) (x y : key) (e : elt), E.eq x y -> MapsTo y e (add x e m)elt, elt', elt'':Typeforall (m : t elt) (x y : key) (e e' : elt), ~ E.eq x y -> MapsTo y e m -> MapsTo y e (add x e' m)intros m; exact (@Raw.add_2 elt (this m)). Qed.elt, elt', elt'':Typeforall (m : t elt) (x y : key) (e e' : elt), ~ E.eq x y -> MapsTo y e m -> MapsTo y e (add x e' m)elt, elt', elt'':Typeforall (m : t elt) (x y : key) (e e' : elt), ~ E.eq x y -> MapsTo y e (add x e' m) -> MapsTo y e mintros m; exact (@Raw.add_3 elt (this m)). Qed.elt, elt', elt'':Typeforall (m : t elt) (x y : key) (e e' : elt), ~ E.eq x y -> MapsTo y e (add x e' m) -> MapsTo y e melt, elt', elt'':Typeforall (m : t elt) (x y : key), E.eq x y -> ~ In y (remove x m)intros m; exact (@Raw.remove_1 elt (this m) (NoDup m)). Qed.elt, elt', elt'':Typeforall (m : t elt) (x y : key), E.eq x y -> ~ In y (remove x m)elt, elt', elt'':Typeforall (m : t elt) (x y : key) (e : elt), ~ E.eq x y -> MapsTo y e m -> MapsTo y e (remove x m)intros m; exact (@Raw.remove_2 elt (this m) (NoDup m)). Qed.elt, elt', elt'':Typeforall (m : t elt) (x y : key) (e : elt), ~ E.eq x y -> MapsTo y e m -> MapsTo y e (remove x m)elt, elt', elt'':Typeforall (m : t elt) (x y : key) (e : elt), MapsTo y e (remove x m) -> MapsTo y e mintros m; exact (@Raw.remove_3 elt (this m) (NoDup m)). Qed.elt, elt', elt'':Typeforall (m : t elt) (x y : key) (e : elt), MapsTo y e (remove x m) -> MapsTo y e melt, elt', elt'':Typeforall (m : t elt) (x : key) (e : elt), MapsTo x e m -> find x m = Some eintros m; exact (@Raw.find_1 elt (this m) (NoDup m)). Qed.elt, elt', elt'':Typeforall (m : t elt) (x : key) (e : elt), MapsTo x e m -> find x m = Some eelt, elt', elt'':Typeforall (m : t elt) (x : key) (e : elt), find x m = Some e -> MapsTo x e mintros m; exact (@Raw.find_2 elt (this m)). Qed.elt, elt', elt'':Typeforall (m : t elt) (x : key) (e : elt), find x m = Some e -> MapsTo x e melt, elt', elt'':Typeforall (m : t elt) (x : key) (e : elt), MapsTo x e m -> InA eq_key_elt (x, e) (elements m)intros m; exact (@Raw.elements_1 elt (this m)). Qed.elt, elt', elt'':Typeforall (m : t elt) (x : key) (e : elt), MapsTo x e m -> InA eq_key_elt (x, e) (elements m)elt, elt', elt'':Typeforall (m : t elt) (x : key) (e : elt), InA eq_key_elt (x, e) (elements m) -> MapsTo x e mintros m; exact (@Raw.elements_2 elt (this m)). Qed.elt, elt', elt'':Typeforall (m : t elt) (x : key) (e : elt), InA eq_key_elt (x, e) (elements m) -> MapsTo x e melt, elt', elt'':Typeforall m : t elt, NoDupA eq_key (elements m)intros m; exact (@Raw.elements_3w elt (this m) (NoDup m)). Qed.elt, elt', elt'':Typeforall m : t elt, NoDupA eq_key (elements m)elt, elt', elt'':Typeforall m : t elt, cardinal m = length (elements m)intros; reflexivity. Qed.elt, elt', elt'':Typeforall m : t elt, cardinal m = length (elements m)elt, elt', elt'':Typeforall (m : t elt) (A : Type) (i : A) (f : key -> elt -> A -> A), fold f m i = fold_left (fun (a : A) (p : key * elt) => f (fst p) (snd p) a) (elements m) iintros m; exact (@Raw.fold_1 elt (this m)). Qed.elt, elt', elt'':Typeforall (m : t elt) (A : Type) (i : A) (f : key -> elt -> A -> A), fold f m i = fold_left (fun (a : A) (p : key * elt) => f (fst p) (snd p) a) (elements m) ielt, elt', elt'':Typeforall (m m' : t elt) (cmp : elt -> elt -> bool), Equivb cmp m m' -> equal cmp m m' = trueintros m m'; exact (@Raw.equal_1 elt (this m) (NoDup m) (this m') (NoDup m')). Qed.elt, elt', elt'':Typeforall (m m' : t elt) (cmp : elt -> elt -> bool), Equivb cmp m m' -> equal cmp m m' = trueelt, elt', elt'':Typeforall (m m' : t elt) (cmp : elt -> elt -> bool), equal cmp m m' = true -> Equivb cmp m m'intros m m'; exact (@Raw.equal_2 elt (this m) (NoDup m) (this m') (NoDup m')). Qed. End Elt.elt, elt', elt'':Typeforall (m m' : t elt) (cmp : elt -> elt -> bool), equal cmp m m' = true -> Equivb cmp m m'forall (elt elt' : Type) (m : t elt) (x : key) (e : elt) (f : elt -> elt'), MapsTo x e m -> MapsTo x (f e) (map f m)intros elt elt' m; exact (@Raw.map_1 elt elt' (this m)). Qed.forall (elt elt' : Type) (m : t elt) (x : key) (e : elt) (f : elt -> elt'), MapsTo x e m -> MapsTo x (f e) (map f m)forall (elt elt' : Type) (m : t elt) (x : key) (f : elt -> elt'), In (elt:=elt') x (map f m) -> In (elt:=elt) x mintros elt elt' m; exact (@Raw.map_2 elt elt' (this m)). Qed.forall (elt elt' : Type) (m : t elt) (x : key) (f : elt -> elt'), In (elt:=elt') x (map f m) -> In (elt:=elt) x mforall (elt elt' : Type) (m : t elt) (x : key) (e : elt) (f : key -> elt -> elt'), MapsTo x e m -> exists y : E.t, E.eq y x /\ MapsTo x (f y e) (mapi f m)intros elt elt' m; exact (@Raw.mapi_1 elt elt' (this m)). Qed.forall (elt elt' : Type) (m : t elt) (x : key) (e : elt) (f : key -> elt -> elt'), MapsTo x e m -> exists y : E.t, E.eq y x /\ MapsTo x (f y e) (mapi f m)forall (elt elt' : Type) (m : t elt) (x : key) (f : key -> elt -> elt'), In (elt:=elt') x (mapi f m) -> In (elt:=elt) x mintros elt elt' m; exact (@Raw.mapi_2 elt elt' (this m)). Qed.forall (elt elt' : Type) (m : t elt) (x : key) (f : key -> elt -> elt'), In (elt:=elt') x (mapi f m) -> In (elt:=elt) x mforall (elt elt' elt'' : Type) (m : t elt) (m' : t elt') (x : key) (f : option elt -> option elt' -> option elt''), In (elt:=elt) x m \/ In (elt:=elt') x m' -> find (elt:=elt'') x (map2 f m m') = f (find (elt:=elt) x m) (find (elt:=elt') x m')intros elt elt' elt'' m m' x f; exact (@Raw.map2_1 elt elt' elt'' f (this m) (NoDup m) (this m') (NoDup m') x). Qed.forall (elt elt' elt'' : Type) (m : t elt) (m' : t elt') (x : key) (f : option elt -> option elt' -> option elt''), In (elt:=elt) x m \/ In (elt:=elt') x m' -> find (elt:=elt'') x (map2 f m m') = f (find (elt:=elt) x m) (find (elt:=elt') x m')forall (elt elt' elt'' : Type) (m : t elt) (m' : t elt') (x : key) (f : option elt -> option elt' -> option elt''), In (elt:=elt'') x (map2 f m m') -> In (elt:=elt) x m \/ In (elt:=elt') x m'intros elt elt' elt'' m m' x f; exact (@Raw.map2_2 elt elt' elt'' f (this m) (NoDup m) (this m') (NoDup m') x). Qed. End Make.forall (elt elt' elt'' : Type) (m : t elt) (m' : t elt') (x : key) (f : option elt -> option elt' -> option elt''), In (elt:=elt'') x (map2 f m m') -> In (elt:=elt) x m \/ In (elt:=elt') x m'