Definition alist_sorted_2 (l:alist A) :=
    forall m n:nat,
      m < n ->
      S n <= length l -> Nless (alist_nth_ad m l) (alist_nth_ad n l) = true.

(* Specifications: *)
Lemma alist_sorted_1_imp_2 : forall l:alist A, alist_sorted_1 l -> alist_sorted_2 l.
Lemma alist_sorted_2_imp : forall l:alist A, alist_sorted_2 l -> alist_sorted l = true.
Lemma app_length : forall (C:Type) (l l':list C), length (l ++ l') = length l + length l'.
Lemma aapp_length : forall l l':alist A, length (aapp A l l') = length l + length l'.
Lemma alist_nth_ad_aapp_1 : forall (l l':alist A) (n:nat), S n <= length l -> alist_nth_ad n (aapp A l l') = alist_nth_ad n l.
Lemma alist_nth_ad_aapp_2 : forall (l l':alist A) (n:nat), S n <= length l' -> alist_nth_ad (length l + n) (aapp A l l') = alist_nth_ad n l'.
Lemma interval_split : forall p q n:nat, S n <= p + q -> {n' : nat | S n' <= q /\ n = p + n'} + {S n <= p}.
Lemma alist_conc_sorted : forall l l':alist A, alist_sorted_2 l -> alist_sorted_2 l' -> (forall n n':nat, S n <= length l -> S n' <= length l' -> Nless (alist_nth_ad n l) (alist_nth_ad n' l') = true) -> alist_sorted_2 (aapp A l l').
Lemma alist_nth_ad_semantics : forall (l:alist A) (n:nat), S n <= length l -> {y : A | alist_semantics A l (alist_nth_ad n l) = Some y}.
Lemma alist_of_Map_nth_ad : forall (m:Map A) (pf:ad -> ad) (l:alist A), l = MapFold1 A (alist A) (anil A) (aapp A) (fun (a0:ad) (y:A) => acons A (a0, y) (anil A)) pf m -> forall n:nat, S n <= length l -> {a' : ad | alist_nth_ad n l = pf a'}.