(* Specifications: *)
Theorem EquivDec_refl_left {T : Type} {c : EqDec T (@eq T)} : forall (n : T), equiv_dec n n = left (refl_equal _).
Theorem UIP_refl : forall {x : A} (p1 : x = x), p1 = refl_equal _.
Theorem UIP_equal : forall {x y : A} (p1 p2 : x = y), p1 = p2.
Lemma inj_pair2 : forall (P:A -> Type) (p:A) (x y:P p), existT P p x = existT P p y -> x = y.
Theorem equiv_dec_refl_left : forall a, @EquivDec.equiv_dec _ _ _ dec a a = left eq_refl.
Theorem wf_rightTrans : well_founded (rightTrans R).
Theorem wf_leftTrans : well_founded (leftTrans R).
Lemma wf_anti_sym T (R : T -> T -> Prop) (wf : well_founded R) : Irreflexive R.
Theorem Proper_red : forall T U (rT : relation T) (rU : relation U) (f : T -> U), (forall x x', rT x x' -> rU (f x) (f x')) -> Proper (rT ==> rU) f.
Theorem respectful_red : forall T U (rT : relation T) (rU : relation U) (f g : T -> U), (forall x x', rT x x' -> rU (f x) (g x')) -> respectful rT rU f g.
Theorem respectful_if_bool T : forall (x x' : bool) (t t' f f' : T) eqT, x = x' -> eqT t t' -> eqT f f' -> eqT (if x then t else f) (if x' then t' else f') .
Lemma negb_true : forall a, negb a = true -> a = false.
Lemma negb_false : forall a, negb a = false -> a = true.
Theorem UIP_refl : forall {x : A} (p1 : x = x), p1 = refl_equal _.
Theorem UIP_equal : forall {x y : A} (p1 p2 : x = y), p1 = p2.
Lemma inj_pair2 : forall (P:A -> Type) (p:A) (x y:P p), existT P p x = existT P p y -> x = y.
Lemma eq_sym_eq : forall T (a b : T) (pf : a = b) (F : T -> Type) val, match eq_sym pf in _ = x return F x with | eq_refl => val end = match pf in _ = x return F x -> F a with | eq_refl => fun x => x end val.
Lemma match_eq_sym_eq : forall T (a b : T) (pf : a = b) F X, match pf in _ = t return F t with | eq_refl => match eq_sym pf in _ = t return F t with | eq_refl => X end end = X.
Lemma match_eq_sym_eq' : forall T (a b : T) (pf : a = b) F X, match eq_sym pf in _ = t return F t with | eq_refl => match pf in _ = t return F t with | eq_refl => X end end = X.
Lemma match_eq_match_eq : forall T F (a b : T) (pf : a = b) X Y, X = Y -> match pf in _ = T return F T with | eq_refl => X end = match pf in _ = T return F T with | eq_refl => Y end.
Lemma eq_sym_eq_trans : forall T (a b c : T) (pf : a = b) (pf' : b = c), eq_sym (eq_trans pf pf') = eq_trans (eq_sym pf') (eq_sym pf).
Lemma eq_Const_eq : forall T (a b : T) (pf : a = b) (R : Type) val, match pf in _ = x return R with | eq_refl => val end = val.
Lemma eq_Arr_eq : forall T (a b : T) (pf : a = b) (F G : T -> Type) val x, match pf in _ = x return F x -> G x with | eq_refl => val end x = match pf in _ = x return G x with | eq_refl => val match eq_sym pf in _ = x return F x with | eq_refl => x end end.
Lemma eq_sym_eq_sym : forall (T : Type) (a b : T) (pf : a = b), eq_sym (eq_sym pf) = pf.
Lemma firstn_app_L : forall T n (a b : list T), n <= length a -> firstn n (a ++ b) = firstn n a.
Lemma firstn_app_R : forall T n (a b : list T), length a <= n -> firstn n (a ++ b) = a ++ firstn (n - length a) b.
Lemma firstn_all : forall T n (a : list T), length a <= n -> firstn n a = a.
Lemma firstn_0 : forall T n (a : list T), n = 0 -> firstn n a = nil.
Lemma firstn_cons : forall T n a (b : list T), 0 < n -> firstn n (a :: b) = a :: firstn (n - 1) b.
Lemma skipn_app_R : forall T n (a b : list T), length a <= n -> skipn n (a ++ b) = skipn (n - length a) b.
Lemma skipn_app_L : forall T n (a b : list T), n <= length a -> skipn n (a ++ b) = (skipn n a) ++ b.
Lemma skipn_0 : forall T n (a : list T), n = 0 -> skipn n a = a.
Lemma skipn_all : forall T n (a : list T), length a <= n -> skipn n a = nil.
Lemma skipn_cons : forall T n a (b : list T), 0 < n -> skipn n (a :: b) = skipn (n - 1) b.
Lemma app_ass_trans@{X} : forall {T : Type@{X} } (a b c : list T), (a ++ b) ++ c = a ++ b ++ c.
Lemma app_nil_r_trans : forall {T : Type} (a : list T), a ++ nil = a.
Lemma nth_error_app_L : forall (A B : list T) n, n < length A -> nth_error (A ++ B) n = nth_error A n.
Lemma nth_error_app_R : forall (A B : list T) n, length A <= n -> nth_error (A ++ B) n = nth_error B (n - length A).
Lemma nth_error_weaken : forall ls' (ls : list T) n v, nth_error ls n = Some v -> nth_error (ls ++ ls') n = Some v.
Lemma nth_error_nil : forall n, nth_error nil n = @None T.
Lemma nth_error_past_end : forall (ls : list T) n, length ls <= n -> nth_error ls n = None.
Lemma nth_error_length : forall (ls ls' : list T) n, nth_error (ls ++ ls') (n + length ls) = nth_error ls' n.
Theorem nth_error_length_ge : forall T (ls : list T) n, nth_error ls n = None -> length ls <= n.
Lemma nth_error_length_lt : forall {T} (ls : list T) n val, nth_error ls n = Some val -> n < length ls.
Theorem nth_error_map : forall U (f : T -> U) ls n, nth_error (map f ls) n = match nth_error ls n with | None => None | Some x => Some (f x) end.