simple induction 1.
intros.
exists (length ws0).
inversion_clear H0.
split.
rewrite H1 in e.
assumption.
auto.
intros.
cut (is_prefix word ws0 f).
intro.
elim (H0 H2).
intros.
exists x.
elim p.
split.
assumption.
apply (le_S (S x) (length ws0)).
assumption.
inversion H1.
assumption.
Defined.

(* Specifications: *)
Theorem good_idx :
forall (f : nat -> word) (ws : list word),
good ws ->
is_prefix word ws f -> {i : nat &  {j : nat | emb (f i) (f j) /\ i < j}}.