Definition ltNatBool := fun x1 x2 => if (lt_dec x1 x2) then true else false.(* RndNat uses Repeat to get a number strictly less than n *)
Definition RndNat(n : nat) :=
    (Repeat (RndNat_unchecked n) (fun x => (ltNatBool x n))).Notation "[ 0 '..' n )" := (RndNat n)
  (right associativity, at level 77) : comp_scope.

(* Specifications: *)
Lemma well_formed_RndNat : forall n, n > O -> well_formed_comp (RndNat n).
Lemma RndNat_support_lt : forall n x, In x (getSupport (RndNat n)) -> x < n.
Lemma RndNat_unchecked_lt_support : forall n v, v < n -> In v (getSupport (RndNat_unchecked n)).
Lemma in_getSupport_RndNat : forall x k, x < k -> In x (getSupport (RndNat k)).
Lemma RndNat_support_length : forall n, length (getSupport (RndNat n)) = n.