Section TREE_ABS.
Definition total_map (A:Type) := key -> A.
Definition t_empty {A:Type} (v : A) : total_map A :=
(fun _ => v).
Definition t_update {A:Type} (m : total_map A)
(x : key) (v : A) :=
fun x' => if x =? x' then v else m x'.
Definition combine {A} (pivot: key) (m1 m2: total_map A) : total_map A :=
fun x : key => if zlt x pivot  then m1 x else m2 x.
Inductive Abs:  tree val -> total_map val -> Prop :=
| Abs_E: Abs E (t_empty nullval)
| Abs_T: forall a b l k v r,
Abs l a ->
Abs r b ->
Abs (T l k v r)  (t_update (combine k a b) k v).
Admitted.  (* This is an exercise in Verified Functional Algorithms *)

Theorem lookup_relate:
forall k t cts ,
Abs t cts -> lookup nullval k t =  cts k.