Skip to content
Rainbow docs menu

Reference · The Applied Higher-Order Functions catalogue

rainbow.algorithms.proofs.ahof.rejection

The Applied Higher-Order Functions cataloguesrc/rainbow/algorithms/proofs/ahof/rejection.clj1 definitions, 4 theorems

AHoF D6 Rejection Sampling: draw a proposal and a uniform u, accepting the proposal when u falls under the acceptance ratio f(x)/(M g(x)): accepts? draw accept-ratio = decide (draw <= accept-ratio). Proved native and axiom-free (decision, two positive instances, at-most certificate, negative instance). Requires audit/decide-nnrat-at-most, nnrat/at-most, nnrat/decide-at-most-true-sound (all in the D63 checkpoint). Scope (measured by the kernel): this module has 4 worked instances (statements about specific values). None of its theorems is a guarantee about the algorithm for all inputs; `lein verify rainbow.algorithms.proofs.ahof.rejection` prints this classification.

rejection/accepts?

DefinitionSource, line 43

rejection/accepts? :
  (x₁ x₂ : ℚ≥0)
  → data/Bool

ℚ≥0 = nnrat/NonnegativeRational

rejection/draw-under-ratio-accepts

TheoremWorked exampleNo axiomsSource, line 50

rejection/draw-under-ratio-accepts :
  → lis/extends? 1/4 1/2 = data/true

= = equality/Eq

rejection/boundary-accepts

TheoremWorked exampleNo axiomsSource, line 56

rejection/boundary-accepts :
  → lis/extends? 1/2 1/2 = data/true

= = equality/Eq

rejection/acceptance-certificate

TheoremWorked exampleNo axiomsSource, line 62

rejection/acceptance-certificate :
  → 1/4 ≤ 1/2

≤ = nnrat/at-most

rejection/draw-over-ratio-rejects

TheoremWorked exampleNo axiomsSource, line 67

rejection/draw-over-ratio-rejects :
  → lis/extends? 3/4 1/2 = data/false

= = equality/Eq