Section tree_rect.
Variables
(P : tree -> Type)
(Q : list tree -> Type).
Hypotheses
(H1 : forall x, P (node x nil))
(H2 : forall f v, Q v -> P (node f v))
(H3 : Q nil)
(H4 : forall t v, P t -> Q v -> Q (t :: v)).
Fixpoint tree_rect_aux t : P t :=
match t as t return P t with
| node f v => H2 f
((fix vt_rect (v : list tree) : Q v :=
match v as v return Q v with
| nil => H3
| cons t' v' => H4 (tree_rect_aux t') (vt_rect v')
end) v)
end.
End tree_rect.
Set Elimination Schemes.
Inductive lforall (P : tree -> Type) : list tree -> Type :=
| lforall_nil : lforall P nil
| lforall_cons : forall a l, lforall P l -> P a -> lforall P (a::l).

Lemma tree_ind : forall P : tree -> Prop,
(forall x, P (node x nil)) -> (forall f v, (forall u, In u v -> P u) -> P (node f v)) ->
forall t, P t.