Reference · The Applied Higher-Order Functions catalogue
rainbow.algorithms.proofs.ahof.ratio-normalizing
AHoF V31 Ratio of Normalizing Constants: estimate the ratio of two normalizing constants (partition functions) Z1/Z2, the quantity underlying Bayes factors and bridge/path sampling: ratio z1 z2 = z1 / z2. The ratio reading holds only for a POSITIVE denominator Z2 (normalizing constants are positive). nnrat/divide is totalised: z2 = 0 is accepted and yields a junk value (its reciprocal maps the equivalent zeros 0/1 and 0/2 to 1 and 2), and that zero case lies outside the ratio claim. Proved: ratio unfolds to nnrat/divide for all inputs (by reflexivity, an unfolding and not a ratio claim); with Z1 = 1/2 and Z2 = 1/4 the ratio is 2; equal constants 1/4, 1/4 give ratio 1. Values are proved by cross-product equivalence. Proved native and axiom-free. Requires nnrat/divide, nnrat/equivalent (all in the D63 checkpoint). Scope (measured by the kernel): this module has 2 worked instances (statements about specific values) and 1 definitional unfoldings (true by unfolding a definition). None of its theorems is a guarantee about the algorithm for all inputs; `lein verify rainbow.algorithms.proofs.ahof.ratio-normalizing` prints this classification.
ratio-nc/ratio
ratio-nc/ratio : (x₁ x₂ : ℚ≥0) → ℚ≥0
ℚ≥0 = nnrat/NonnegativeRational
ratio-nc/unequal-ratio
ratio-nc/unequal-ratio : → ℚ≥0
ℚ≥0 = nnrat/NonnegativeRational
ratio-nc/equal-ratio
ratio-nc/equal-ratio : → ℚ≥0
ℚ≥0 = nnrat/NonnegativeRational
ratio-nc/ratio-unfold
ratio-nc/ratio-unfold : (z1 z2 : ℚ≥0) → ols/slope z1 z2 = nnrat/divide z1 z2
= = equality/Eqℚ≥0 = nnrat/NonnegativeRational
ratio-nc/unequal-ratio-is-two
ratio-nc/unequal-ratio-is-two : → ratio-nc/unequal-ratio = 2
= = nnrat/equivalent: equality of rational values
ratio-nc/equal-ratio-is-one
ratio-nc/equal-ratio-is-one : → ratio-nc/equal-ratio = 1
= = nnrat/equivalent: equality of rational values