Ltac spec H := match type of H with ?A -> _ =>
let H' := fresh in (assert (H' : A); [ | specialize (H H'); clear H']) end.

Lemma treeify_g_induc:
forall fP gP : positive -> list key -> tree * list key -> Prop,
(forall l n' t1 x l2 t2 l3
(LEN: length l >= nat_of_P n')
(LEN2: length l2 >= nat_of_P n'),
fP n' l (t1, x::l2) ->  treeify_f n' l = (t1, x::l2) -> fP n' l2 (t2, l3) ->
treeify_f n' l2 = (t2, l3) -> fP (xI n') l (T Black t1 x t2, l3)) ->
(forall  l n' t1 x l2 t2 l3
(LEN: length l >= nat_of_P n')
(LEN2: S (length l2) >= nat_of_P n'),
fP n' l (t1, x :: l2) -> treeify_f n' l = (t1, x :: l2) -> gP n' l2 (t2, l3) ->
treeify_g n' l2 = (t2, l3) -> fP (xO n') l (T Black t1 x t2, l3)) ->
(forall x l1, fP xH (x :: l1) (T Red EE x EE, l1)) ->
(forall  l n' t1 x l2 t2 l3
(LEN: length l >= nat_of_P n')
(LEN2: S (length l2) >= nat_of_P n'),
fP n' l (t1, x :: l2) -> treeify_f n' l = (t1, x :: l2) -> gP n' l2 (t2, l3) ->
treeify_g n' l2 = (t2, l3) -> gP (xI n') l (T Black t1 x t2, l3)) ->
(forall l n' t1 x l2 t2 l3
(LEN: S (length l) >= nat_of_P n')
(LEN2: S (length l2) >= nat_of_P n'),
gP n' l (t1, x :: l2) -> treeify_g n' l = (t1, x :: l2) ->
gP n' l2 (t2, l3) -> treeify_g n' l2 = (t2, l3) -> gP (xO n') l (T Black t1 x t2, l3)) ->
(forall l, gP xH l (EE, l)) ->
forall n l, S (length l) >= nat_of_P n -> gP n l (treeify_g n l).