(****************************)
(** * Some data structures  *)
(****************************)

(** ** Option type **)

(** The option type (opt X) : Typ1 (parametrized by X : Typ1) that
    would be inductively defined in Coq by

      Inductive opt [X:Typ1] : Typ1 :=
      | some : X->(opt X)
      | none : (opt X).

    is mimicked by the following definitions: *)

Definition opt (X : Typ1) : Typ1 := (X -> Prop) -> Prop.Definition some (X : Typ1) (x : X) : opt X := fun f => f x.Definition none (X : Typ1) : opt X := fun _ => bot.

Lemma eq_none_some : forall (X : Typ1) (x : X), eq (opt X) (none X) (some X x) -> bot.