Ltac sub_unfold :=
match goal with
| |- _ |-- ?A _ >=> ?A _ => unfold A
| |- _ |-- ?A _ _ >=> ?A _ _ => unfold A
| |- _ |-- ?A _ _ _ >=> ?A _ _ _ => unfold A
| |- _ |-- ?A _ _ _ _ >=> ?A _ _ _ _ => unfold A
| |- _ |-- ?A _ _ _ _ _ >=> ?A _ _ _ _ _ => unfold A
| v: _ |- _ => destruct v
end.
Hint Extern 2 (_ |-- _ >=> _) => sub_unfold : contractive.
Hint Resolve @prove_HOcontractive
@subp_allp @subp_imp @subp_refl @subp_exp @subp_andp @subp_orp @subp_subp
@allp_imp2_later_e1 @allp_imp2_later_e2 : contractive.

(* Specifications: *)
Lemma Rec_sub {A} `{ageable A} : forall G
(F   : pred A -> pred A -> pred A)
(HF1 : forall X, contractive (F X))
(HF2 : forall R P Q, P >=> Q |-- F P R >=> F Q R)
(HF3 : forall P Q X, |>(P >=> Q) |-- F X P >=> F X Q),
forall P Q,
G |-- P >=> Q ->
G |-- Rec (F P) >=> Rec (F Q).
Lemma HORec_sub {A} `{ageable A} : forall G B
(F : pred A -> (B -> pred A) -> B -> pred A)
(HF1 : forall X, HOcontractive (F X))
(HF2 : forall R a P Q, P >=> Q |-- F P R a >=> F Q R a)
(HF3 : forall P Q X, ALL b:B, |>(P b >=> Q b) |-- ALL b:B, F X P b >=> F X Q b),
forall P Q,
G |-- P >=> Q ->
G |-- ALL b:B, HORec (F P) b >=> HORec (F Q) b.
Lemma Rec_contractive {A} `{ageable A} : forall
(F   : pred A -> pred A -> pred A)
(HF1 : forall X, contractive (F X))
(HF2 : forall R, contractive (fun X => F X R)),
contractive (fun X => Rec (F X)).
Lemma Rec_nonexpansive {A} `{ageable A} : forall
(F   : pred A -> pred A -> pred A)
(HF1 : forall X, contractive (F X))
(HF2 : forall R, nonexpansive (fun X => F X R)),
nonexpansive (fun X => Rec (F X)).
Lemma HORec_contractive {A} `{ageable A} : forall B
(F : pred A -> (B -> pred A) -> B -> pred A)
(HF1 : forall X, HOcontractive (F X))
(HF2 : forall R a, contractive (fun X => F X R a)),
forall a, contractive (fun X => HORec (F X) a).
Lemma HORec_nonexpansive {A} `{ageable A} : forall B
(F : pred A -> (B -> pred A) -> B -> pred A)
(HF1 : forall X, HOcontractive (F X))
(HF2 : forall R a, nonexpansive (fun X => F X R a)),
forall a, nonexpansive (fun X => HORec (F X) a).