induction b; intuition; simpl in *.
Qed.

(* Specifications: *)
Theorem perm_flatten_listReplace :
forall b (A : Set)(ls1 : list (list A))(ls2 : list A) (a : A),
Permutation (flatten ls1) ls2 ->
Permutation (flatten (listReplace ls1 b (nth b ls1 nil ++ (a :: nil)) nil))
(a :: ls2).