(** *** Search using Choose *)
Section Fix_f.
Variable u : term.
Hypothesis proc_u : proc u.
Hypothesis total_u : forall n, u (enc n) ≡ none \/ exists s, u (enc n) ≡ oenc (Some s).
Definition Re : term := Eval cbv in
.\ "s"; !C (.\ "n"; !u "n" (.\ "t"; !Eq "s" "t") !F).

(* Specifications: *)
Lemma Re_proc :
proc Re.
Lemma H_rec n s : ((lambda (((u 0) (lambda ((Eq (tenc s)) 0))) F)) (enc n) ≡ u (enc n) (lambda (Eq (tenc s) 0)) F).
Lemma H_proc s : proc (.\ "n"; !u "n" (.\ "t"; !Eq !(tenc s) "t") !F).
Lemma H_test s : test (.\ "n"; !u "n" (.\ "t"; !Eq !(tenc s) "t") !F).
Lemma Re_sound s : eva (Re (tenc s)) -> exists n, u (enc n) ≡ oenc (Some s).
Lemma Re_complete n s : u (enc n) ≡ oenc (Some s) -> eva (Re (tenc s)).
End Fix_f.
Lemma enumerable_recognisable p : enumerable p -> recognisable p.
(** ** The class of all terms is enumerable *)
Lemma R_enumerates (R : nat -> option term) (u : term) :
proc u -> (forall s, exists n, R n = Some s) -> (forall n, u (enc n) ▷ oenc (R n)) ->
enumerable (fun s => True).