Definition Monoid_list_app {T} : Monoid (list T) :=
{| monoid_plus := @List.app _
 ; monoid_unit := @nil _
 |}.Fixpoint list_eqb (ls rs : list T) : bool :=
    match ls , rs with
      | nil , nil => true
      | cons l ls , cons r rs =>
        if l ?[ eq ] r then list_eqb ls rs else false
      | _ , _ => false
    end.(** Specialization for equality **)
  Global Instance RelDec_eq_list : RelDec (@eq (list T)) :=
  { rel_dec := list_eqb }.Global Instance RelDec_Correct_eq_list : RelDec_Correct RelDec_eq_list.Global Instance Injective_cons T (a : T) b c d : Injective (a :: b = c :: d).Global Instance Injective_cons_nil T (a : T) b : Injective (a :: b = nil).Global Instance Injective_nil_cons T (a : T) b : Injective (nil = a :: b).Global Instance Injective_nil_nil T : Injective (nil = @nil T).Global Instance Injective_app_cons {T} (a : list T) b c d
: Injective (a ++ b :: nil = (c ++ d :: nil)).Global Instance Injective_app_same_L {T} (a : list T) b c
: Injective (b ++ a = b ++ c).Global Instance Injective_app_same_R {T} (a : list T) b c
: Injective (a ++ b = c ++ b).

Lemma eq_list_eq : forall T (a b : T) (pf : a = b) (F : _ -> Type) val, match pf in _ = x return list (F x) with | eq_refl => val end = map (fun val => match pf in _ = x return F x with | eq_refl => val end) val.