proposition: Lemma app_first_eq : forall (A : Type)(ls2 ls1 ls3 : list A), ls1 = ls2 ++ ls3 -> length ls1 = length ls2 -> ls1 = ls2 /\ ls3 = nil.
proof: Proof. intros; subst. assert (ls3 = nil). rewrite app_length in H0. assert (length ls3 = O). lia. destruct ls3; simpl in *; try lia; trivial. subst. rewrite app_nil_r. intuition. Qed.
imports: FCF.StdNat List Bvector micromega.Lia FCF.EqDec FCF.Fold ZArith Permutation