(* ** Definitions *)

Definition compl X p := fun x : X => ~ p x.Definition decidable {X} (p : X -> Prop) := exists f, forall x, p x <-> f x = true.Definition enumerable {X} (p : X -> Prop) := exists f, forall x, p x <-> exists n : nat, f n = Some x.Definition discrete X := decidable (fun '(x,y) => x = y :> X).Definition enumerable__T X := exists f : nat -> option X, forall x, exists n, f n = Some x.

Theorem dec_count_enum X (p : X -> Prop) : decidable p -> enumerable__T X -> enumerable p.