proposition: Lemma xyz_rw: forall (a:ascii) b p x y z, ( length (x ++ y) <= p -> pow1 a p ++ pow1 b p = x ++ y ++ z -> exists n, (length (x ++ y) + n) % nat = p /\ pow1 a (length x + (length y + n)) ++ pow1 b (length x + length y + n) = x ++ y ++ z ) % list.
proof: Proof. intros. apply le_to_plus in H. destruct H as (n, Hlen). exists n. split; auto. rewrite <- Hlen in H0. rewrite app_length in H0. rewrite Nat.add_assoc. assumption. Qed.
imports: Coq.Strings.Ascii Coq.Lists.List Coq.Strings.Ascii Coq.Arith.PeanoNat Coq.micromega.Lia Turing.Lang Turing.Regex Turing.Util