I have trouble understanding how to produce more sensible goal in the obligation
Require Import Coq.Program.Wf.
Require Import List.
Import ListNotations.
Inductive I :=
| Ibool : bool -> I
| Inested : list I -> I.
Fixpoint i_measure (i: I) : nat :=
match i with
| Ibool x => 1
| Inested x => 1 + list_sum (map i_measure x)
end.
Program Fixpoint foo (i: I) {measure (i_measure i)} : bool :=
match i with
| Ibool x => x
| Inested x => forallb (fun q => foo q) (rev x)
end.
Next Obligation.
(* x : list I *)
(* foo : forall i : I, i_measure i < i_measure (Inested x) -> bool *)
(* q : I *)
(* ============================ *)
(* i_measure q < i_measure (Inested x) *)
In this example i would like Coq to generate additional hypothesis, smth like
H: In q (rev x)
Are there some standard practices when dealing with problems of this kind?