Skip to content
Rainbow docs menu

Reference · The Applied Higher-Order Functions catalogue

rainbow.algorithms.proofs.ahof.ratio-normalizing

The Applied Higher-Order Functions cataloguesrc/rainbow/algorithms/proofs/ahof/ratio_normalizing.clj3 definitions, 3 theorems

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

DefinitionSource, line 54

ratio-nc/ratio :
  (x₁ x₂ : ℚ≥0)
  → ℚ≥0

ℚ≥0 = nnrat/NonnegativeRational

ratio-nc/unequal-ratio

DefinitionSource, line 59

ratio-nc/unequal-ratio :
  → ℚ≥0

ℚ≥0 = nnrat/NonnegativeRational

ratio-nc/equal-ratio

DefinitionSource, line 62

ratio-nc/equal-ratio :
  → ℚ≥0

ℚ≥0 = nnrat/NonnegativeRational

ratio-nc/ratio-unfold

TheoremHolds by unfolding a definitionNo axiomsSource, line 68

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

TheoremWorked exampleNo axiomsSource, line 76

ratio-nc/unequal-ratio-is-two :
  → ratio-nc/unequal-ratio = 2

= = nnrat/equivalent: equality of rational values

ratio-nc/equal-ratio-is-one

TheoremWorked exampleNo axiomsSource, line 81

ratio-nc/equal-ratio-is-one :
  → ratio-nc/equal-ratio = 1

= = nnrat/equivalent: equality of rational values