Definition remove_at {A} i (l : list A) := firstn i l ++ skipn (S i) l.

(* Specifications: *)
Lemma Forall_firstn : forall {A} (P : A -> Prop) l i, Forall P l -> Forall P (firstn i l).
Lemma Forall_skipn : forall {A} (P : A -> Prop) l i, Forall P l -> Forall P (skipn i l).
Lemma Forall_upd_Znth : forall {A} (P : A -> Prop) x l i, Forall P l -> P x -> Forall P (upd_Znth i l x).
Lemma nth_last : forall {A} (d : A) l, nth (length l - 1) l d = last l d.
Lemma Znth_last : forall {A}{d: Inhabitant A} l, Znth (Zlength l - 1) l = last l default.
Lemma nat_sorted_list_eq : forall d n l (Hl : forall i, (i < n)%nat <-> In i l) (Hlen : length l = n) (Hsorted : forall i j, (i < j < n -> nth i l d < nth j l d)%nat) i (Hi : (i < n)%nat), nth i l d = i.
Lemma Forall2_In_l : forall {A B} (P : A -> B -> Prop) x l1 l2, Forall2 P l1 l2 -> In x l1 -> exists y, In y l2 /\ P x y.
Lemma Forall2_In_r : forall {A B} (P : A -> B -> Prop) x l1 l2, Forall2 P l1 l2 -> In x l2 -> exists y, In y l1 /\ P y x.
Lemma iter_sepcon_sepcon: forall {A} f g1 g2 l, (forall b : A, f b = g1 b * g2 b) -> iter_sepcon f l = iter_sepcon g1 l * iter_sepcon g2 l.
Lemma sepcon_app : forall l1 l2, fold_right sepcon emp (l1 ++ l2) = fold_right sepcon emp l1 * fold_right sepcon emp l2.