(* Copyright 2012-2015 by Adam Petcher.				* * Use of this source code is governed by the license described	* * in the LICENSE file at the root of the source tree.		*)
Set Implicit Arguments.
Definition Bernoulli(r : Rat) : Comp bool :=
match r with
| RatIntro n d =>
v <-$ RndNat d; ret (if (lt_dec v n) then true else false)
end.

(* Specifications: *)
Theorem Bernoulli_correct :
forall (r : Rat),
r <= 1 ->
Pr[Bernoulli r] == r.