(** Now, the pumping lemma itself says that, if [s =~ re] and if the length of [s] is at least the pumping constant of [re], then [s] can be split into three substrings [s1 ++ s2 ++ s3] in such a way that [s2] can be repeated any number of times and the result, when combined with [s1] and [s3] will still match [re].  Since [s2] is also guaranteed not to be the empty string, this gives us a (constructive!) way to generate strings matching [re] that are as long as we like. *)

Lemma pumping : forall T (re : reg_exp T) s,
s =~ re ->
pumping_constant re <= length s ->
exists s1 s2 s3,
s = s1 ++ s2 ++ s3 /\
s2 <> [] /\
forall m, s1 ++ napp m s2 ++ s3 =~ re.