(** ** Properties of [const] *)

(* Specifications: *)
Lemma const_nth A (a: A) n (p: Fin.t n): (const a n)[@ p] = a.
Lemma append_const A (a : A) n m : (const a n) ++ (const a m) = const a (n + m).
(** ** Properties of [map] *)
Lemma map_id A: forall n (v : t A n),
map (fun x => x) v = v.
Lemma map_map A B C: forall (f:A->B) (g:B->C) n (v : t A n),
map g (map f v) = map (fun x => g (f x)) v.
Lemma map_ext_in A B: forall (f g:A->B) n (v : t A n),
(forall a, In a v -> f a = g a) -> map f v = map g v.
Lemma map_ext A B: forall (f g:A->B), (forall a, f a = g a) ->
forall n (v : t A n), map f v = map g v.
Lemma nth_map {A B} (f: A -> B) {n} v (p1 p2: Fin.t n) (eq: p1 = p2):
(map f v) [@ p1] = f (v [@ p2]).
Lemma map_append A B: forall (f:A->B) n m (v: t A n) (w: t A m),
(map f (v ++ w)) = map f v ++ map f w.
Lemma nth_map2 {A B C} (f: A -> B -> C) {n} v w (p1 p2 p3: Fin.t n):
p1 = p2 -> p2 = p3 -> (map2 f v w) [@p1] = f (v[@p2]) (w[@p3]).
Lemma map2_ext A B C: forall (f g:A->B->C), (forall a b, f a b = g a b) ->
forall n (v : t A n) (w : t B n), map2 f v w = map2 g v w.