(* * Copyright (c) 2009-2010, Andrew Appel, Robert Dockins and Aquinas Hobor. * *)
Delimit Scope pred with pred.
Local Open Scope pred.
Set Implicit Arguments.
Definition contractive {A} `{ageable A} (f: pred A -> pred A) : Prop :=
forall P Q,  |> (P <=> Q)  |-- f P <=> f Q.
Definition nonexpansive {A} `{ageable A} (f: pred A -> pred A) : Prop :=
forall P Q,  (P <=> Q)  |-- f P <=> f Q.
Definition HOcontractive {A} `{ageable A} (X: Type) (f: (X -> pred A) -> (X -> pred A)) : Prop :=
forall P Q,  (ALL x:X, |> (P x <=> Q x)) |-- (ALL x:X, f P x <=> f Q x).
Definition HOnonexpansive {A} `{ageable A} (X: Type) (f: (X -> pred A) -> (X -> pred A)) : Prop :=
forall P Q, (ALL x:X, P x <=> Q x)  |-- (ALL x:X, f P x <=> f Q x).
Module Type HO_REC.
Parameter HORec : forall {A} `{ageable A} X (f: (X -> pred A) -> (X -> pred A)), X -> pred A.

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