Section HORec.
Variable A:Type.
Variable ag: ageable A.
Variable X:Type.
Variable f: (X-> pred A) -> (X -> pred A).
Fixpoint HORec' (n:nat) : X -> pred A :=
match n with
| S n' => f (HORec' n')
| O    => f (fun _ => FF)
end.
Hypothesis Hcont : HOcontractive f.
End HORec.
Definition HORec {A} `{ag: ageable A}  {X: Type} (f:  (X-> pred A) -> (X -> pred A)) (x: X) : pred A :=
mkPred (fun a : A => app_pred (@HORec' A ag X f (level a) x) a).

Lemma HORec_fold_unfold {A} `{ageable A} : forall X f (H:HOcontractive (X:=X) f),
HORec f = f (HORec f).