simple induction 1.
intros.
elim (L_idx f w ws0 l).
intros.
exists x.
exists (length ws0).
elim p.
intros.
inversion H0.
split.
rewrite H5 in H1.
assumption.
assumption.
inversion H0.
assumption.
intros.
cut (is_prefix word ws0 f).
assumption.
inversion H1.
assumption.
Defined.

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