Prerequisites. Direct starred prerequisites: none. No later core chapter depends on this route.
A disease affects one person in a thousand. A test reports positive on 99/100 of the affected and on 1/50 of the unaffected. Given a positive report, the posterior probability of the disease is a quotient of two exact rationals: Pr[𝐷∣𝑇]=Pr[𝐷∧𝑇]Pr[𝑇]=11000⋅9910011000⋅99100+9991000⋅150=99/10000099/100000+1998/100000=992097=33699=11233. Every step is a finite computation on reduced fractions, and a program that performs it needs nothing but integer arithmetic and a check that the denominator is nonzero.
Replace the test report by a real-valued measurement. The event {𝑋 =𝑥} then has probability zero, the quotient has the form 0/0, and the object to be computed — a family of measures indexed by 𝑥 — is determined only up to a set of 𝑥 of measure zero. Two questions arise at once, and this chapter answers both. Which family is meant? And, once the family is pinned down, is it computable from a program that samples the joint distribution?
The answer to the second question is negative in a strong and precise sense, and the mechanism is already visible in the first: a family determined only almost everywhere cannot be recovered from finitely much information about the joint distribution, because a perturbation of arbitrarily small size can install an arbitrary answer at the point of interest. That perturbation argument is proved here in full. The chapter’s positive results identify the hypotheses — a discrete observation, or a positive bounded computable conditional density — that defeat it.
Conditioning on a null event
Let 𝑃 be a probability measure on a measurable space and let 𝐶 be an event with 𝑃(𝐶) >0. For every event 𝐴, 𝑃(𝐴 ∣𝐶) =𝑃(𝐴 ∩𝐶)/𝑃(𝐶).
Referenced from 4 locations
The hypothesis 𝑃(𝐶) >0 is not a technicality that a limit can remove, and the following calculation shows what fails. It is the standard reason why “the conditional distribution given 𝑌 =0” is not a well-posed request.
Let (𝑋,𝑌) be uniformly distributed on the closed unit disc, with density 1/𝜋. Condition on two families of events, both shrinking to {𝑌 =0}.
Strips. Let 𝐶𝜀 ={|𝑌| ≤𝜀}. For |𝑥| ≤√1−𝜀2 the section {𝑦 ∣(𝑥,𝑦) ∈𝐶𝜀} is the full interval [ −𝜀,𝜀], so the density of 𝑋 restricted to 𝐶𝜀 is the constant 2𝜀/𝜋 there. Hence the conditional law of 𝑋 given 𝐶𝜀 is uniform on [ −√1−𝜀2,√1−𝜀2], and as 𝜀 →0 it converges weakly to the uniform law on [ −1,1].
Wedges. Write (𝑋,𝑌) =(𝑅cosΘ,𝑅sinΘ) and let 𝐷𝜀 ={|Θ| ≤𝜀} ∪{|Θ −𝜋| ≤𝜀}, also shrinking to {𝑌 =0}. In polar coordinates the density is 𝑟/𝜋, so given 𝐷𝜀 the radius 𝑅 has density 2𝑟 on [0,1], independently of Θ. As 𝜀 →0 the law of 𝑋 =𝑅cosΘ converges weakly to the law with density |𝑥| on [ −1,1].
The two limits are different measures; at 𝑥 =0 the first has density 1/2 and the second density 0. The event {𝑌 =0} is common to both families, so the phrase “condition on 𝑌 =0” does not name a measure. What does name one is a family indexed by all values of 𝑌, constrained by an integral equation, and determined only up to a null set of indices.
Referenced from 4 locations
Let 𝑋 and 𝑌 be random variables in measurable spaces 𝑆 and 𝑇 on a probability space with law 𝑃, and let 𝑃𝑋 =𝑋∗𝑃. A conditional distribution of 𝑌 given 𝑋 is a kernel 𝜅 :𝑆 ⇝𝑇, in the sense of definition 172.16, such that every 𝜅(𝑥) is a probability measure and ∫𝐴𝜅(𝑥)(𝐵)𝑑𝑃𝑋(𝑥)=𝑃{𝑋∈𝐴, 𝑌∈𝐵}(𝐴∈Σ𝑆, 𝐵∈Σ𝑇). Any such 𝜅 is written 𝑃[𝑌 ∣𝑋 = ⋅ ], and a particular 𝜅 satisfying the equation is called a version.
Referenced from 9 locations
Let 𝑇 be a measurable space whose 𝜎-algebra is generated by a countable family closed under finite intersection. If 𝜅 and 𝜅′ are versions of 𝑃[𝑌 ∣𝑋 = ⋅ ], then there is a set 𝑁 ∈Σ𝑆 with 𝑃𝑋(𝑁) =0 such that 𝜅(𝑥) =𝜅′(𝑥) for all 𝑥 ∉𝑁.
Referenced from 5 locations
Proof of Proposition 173.4 — Versions agree almost everywhere
Proof. Let G ={𝐵1,𝐵2,…} be the countable generating family. Fix 𝐵 ∈G. The two functions 𝑥 ↦𝜅(𝑥)(𝐵) and 𝑥 ↦𝜅′(𝑥)(𝐵) are measurable and, by definition 173.3, have equal integrals over every 𝐴 ∈Σ𝑆. Taking 𝐴 ={𝑥 ∣𝜅(𝑥)(𝐵) >𝜅′(𝑥)(𝐵)} gives ∫𝐴(𝜅( ⋅)(𝐵) −𝜅′( ⋅)(𝐵)) 𝑑𝑃𝑋 =0 with a nonnegative integrand, so 𝑃𝑋(𝐴) =0; the reverse inequality is the same computation with the roles exchanged. Let 𝑁𝐵 be the union of the two null sets and 𝑁 =⋃𝐵∈G𝑁𝐵, a countable union of null sets, hence null. For 𝑥 ∉𝑁 the measures 𝜅(𝑥) and 𝜅′(𝑥) are probability measures agreeing on G; since G is closed under finite intersection and generates Σ𝑇, the finite unions of differences of its members form a Boolean algebra on which the two agree, and lemma 172.29 gives 𝜅(𝑥) =𝜅′(𝑥). ◻
Existence of a version is imported at the following signature. For random variables 𝑋,𝑌 in computable Polish spaces — separable, completely metrizable spaces with the Borel 𝜎-algebra — a conditional distribution 𝑃[𝑌 ∣𝑋 = ⋅ ] exists. Ackerman–Freer–Roy obtain it in their §3 from the Radon–Nikodym theorem, which they state as their Theorem 3.2: for 𝜎-finite measures 𝜇 ≪𝜈 on a measurable space there is a measurable 𝑓 ≥0 with 𝜇(𝐴) =∫𝐴𝑓 𝑑𝜈, unique up to 𝜈-null sets. What the import supplies is a version to speak about; none of the negative results below depends on which version is chosen, by proposition 173.4.
Referenced from 2 locations
★☆☆ Recompute the opening posterior with the false-positive rate changed from 1/50 to 1/500, as a reduced fraction, and state the exact hypothesis of definition 173.1 that the computation checks.
Referenced from 2 locations
★☆☆ Let 𝑋 be uniform on [0,1] and 𝑌 =𝑋. Exhibit two versions of 𝑃[𝑌 ∣𝑋 = ⋅ ] that differ at the single point 𝑥 =1/2, and check both against definition 173.3.
Referenced from 2 locations
★★☆ In example 173.2, exhibit a third family of events shrinking to {𝑌 =0} whose conditional laws of 𝑋 converge to a third measure, and give that measure explicitly.
Referenced from 2 locations
Representations and computability
Computability of a real-valued object is a statement about programs that read and write approximations, so the objects of this chapter must first be given representations.
A real 𝑟 is computable when some program enumerates a sequence of rationals 𝑞𝑛 with |𝑟 −𝑞𝑛| ≤2−𝑛, and lower semicomputable when some program enumerates rationals increasing to 𝑟. A computable Polish space is a complete separable metric space (𝑇,𝑑) with a distinguished countable dense sequence whose mutual distances are computable uniformly. On 𝑀1(𝑇), the probability measures on 𝑇, the Prokhorov metric and the finitely supported rational-mass measures at the distinguished points make 𝑀1(𝑇) a computable Polish space; a measure is computable when it is a computable point of it. A random variable 𝑋 is 𝑃-almost computable when it is computable on a set of 𝑃-measure one. A set 𝐴 is 𝑃-almost decidable when its indicator is 𝑃-almost computable. Finally, every computable map between computable Polish spaces is continuous, and this is the only fact about the computability notions that the negative result of section 173.3 uses.
Referenced from 4 locations
Conditioning is discontinuous everywhere
Let F ⊆𝑀1([0,1]2). A map Φ :𝑀1([0,1]2) ×[0,1] →𝑀1([0,1]) is a conditioning operator for F when, for every 𝜇 ∈F and every pair (𝑋,𝑌) with joint law 𝜇, the equation Φ(𝜇,𝑥) =𝑃[𝑌 ∣𝑋 =𝑥] holds for 𝑃𝑋-almost all 𝑥. It is computable when it is computable on F ×[0,1] with respect to the representations of convention 173.6.
Referenced from 2 locations
Let F ⊆𝑀1([0,1]2) contain every finitely supported rational-mass measure. Let 𝜈 ∈𝑀1([0,1]2), let 𝑥 ∈[0,1], let 𝛼 ∈𝑀1([0,1]) be finitely supported with rational masses, and let 𝜀 ∈(0,1) be rational. Then there is 𝜇 ∈𝑀1([0,1]2) with Prokhorov distance 𝑑𝜌(𝜇,𝜈) <𝜀 such that Φ(𝜇,𝑥) =𝛼 for every conditioning operator Φ for F.
Referenced from 9 locations
Proof of Lemma 173.9 — An arbitrary answer nearby
Proof. Choose a finitely supported rational-mass 𝑝∗ ∈𝑀1([0,1]2) with 𝑑𝜌(𝑝∗,𝜈) <𝜀/2 and 𝑝∗({𝑥} ×[0,1]) =0; this is possible because the finitely supported rational-mass measures are dense and because a support point with first coordinate 𝑥 may be moved by an arbitrarily small amount. Put 𝜇=𝜀2(𝛿𝑥⊗𝛼)+(1−𝜀2)𝑝∗. Then 𝜇 differs from 𝑝∗ by total variation at most 𝜀/2, hence 𝑑𝜌(𝜇,𝑝∗) ≤𝜀/2 and 𝑑𝜌(𝜇,𝜈) <𝜀.
Let (𝑋,𝑌) have law 𝜇. Its first marginal gives the point 𝑥 the mass 𝜇𝑋({𝑥}) =𝜀/2 >0, because 𝑝∗ contributes nothing there. For 𝐴 ={𝑥} and any Borel 𝐵, definition 173.3 reads 𝜅(𝑥)(𝐵)𝜇𝑋({𝑥})=𝜇({𝑥}×𝐵)=𝜀2𝛼(𝐵), so 𝜅(𝑥) =𝛼 for every version 𝜅. A conditioning operator must agree with some version 𝜇𝑋-almost everywhere, and {𝑥} has positive 𝜇𝑋-measure, so Φ(𝜇,𝑥) =𝛼. ◻
Let F ⊆𝑀1([0,1]2) contain every finitely supported rational-mass measure. Then no conditioning operator for F is continuous at any point of F ×[0,1], and hence none is computable.
Referenced from 8 locations
Proof of Theorem 173.10 — Every conditioning operator is discontinuous everywhere
Proof. Give 𝑀1([0,1]) and 𝑀1([0,1]2) the weak topology, which the Prokhorov metric induces. Let Φ be a conditioning operator, let (𝜈,𝑥) be any point, and let 𝛼,𝛼′ be two finitely supported rational-mass measures with disjoint supports, so that some weak neighborhood separates them. For every 𝜀 >0, lemma 173.9 provides 𝜇 and 𝜇′ within Prokhorov distance 𝜀 of 𝜈 with Φ(𝜇,𝑥) =𝛼 and Φ(𝜇′,𝑥) =𝛼′. Hence every neighborhood of (𝜈,𝑥) contains points whose images are separated, so Φ is not continuous at (𝜈,𝑥). By convention 173.6 a computable map is continuous, so Φ is not computable. ◻
Theorem 173.10 rules out an operator, not a single instance: for each fixed computable joint distribution it leaves open whether its conditional distribution map is computable. The following statements of Ackerman–Freer–Roy close that gap and are imported at exactly these signatures.
Their Theorem 7.6: there are 𝑃-almost computable random variables 𝑊 and 𝑌 on [0,1] such that the conditional distribution map 𝑃[𝑌 ∣𝑊 = ⋅ ] is 𝑃𝑊-almost continuous but not 𝑃𝑊-almost computable.
Their Corollary 7.7, for the pair (𝑋,𝑁) underlying that construction: if 𝑃[𝑁 ∣𝑋 = ⋅ ] is 𝐴-computable on a set of 𝑃𝑋-measure greater than 5/6 for an oracle 𝐴 ⊆ℕ, then 𝐴 computes the halting set; consequently no version of 𝑃[𝑁 ∣𝑋 = ⋅ ] is 𝑃𝑋-almost computable.
Their Proposition 7.8: for every 𝑘, the map 𝑃[𝑁 =𝑘 ∣𝑋 = ⋅ ] is not 𝐿1(𝑃𝑋)-computable, so the failure is not repaired by weakening the demand to an 𝐿1 approximation.
Their Theorem 6.7: for every conditioning program for a class containing the finitely supported rational-mass measures, and for every code 𝑒 of a computable distribution and code 𝑗 of a computable point, one can compute a code 𝑖 with 𝜇𝑖 =𝜇𝑒 on which the program returns no information at all.
What these imports supply is a single computable joint distribution whose conditioning problem encodes the halting set. Their mechanism is a mixture over 𝑛 ∈ℕ of piecewise constant densities whose 𝑛-th piece records whether the 𝑛-th program halts; the mixture’s value at a point determines, through a base-5 expansion with digits confined to {2,3,4}, the whole halting sequence, so a semicomputable approximation to the posterior would decide it. Nothing below uses these statements as a premise; they are recorded because theorem 173.10 alone does not establish them.
Referenced from 4 locations
★☆☆ In lemma 173.9, verify directly from definition 173.3 that a version at a point of positive marginal mass is forced, and state where the proof would fail if 𝑝∗({𝑥} ×[0,1]) >0 were allowed.
Referenced from 2 locations
★★☆ Prove that 𝑑𝜌(𝜇,𝜈) ≤12‖𝜇 −𝜈‖TV for probability measures on a metric space, and identify the step of lemma 173.9 that uses it.
Referenced from 2 locations
★★☆ Give a class F ⊆𝑀1([0,1]2) for which a computable conditioning operator does exist, and explain why it does not contradict theorem 173.10.
Referenced from 2 locations
Where conditioning is computable
The perturbation of lemma 173.9 installs an atom at the query point. Two hypotheses defeat it, and each yields a positive result. The first forbids the query point from being a limit of other query points: the observed variable takes discrete values, each of positive probability. The second forbids atoms altogether by requiring a bounded computable conditional density, so that the answer at 𝑥 is an integral rather than a quotient of atoms.
Let 𝑋 take values in a countable set 𝐷 with the discrete 𝜎-algebra, let 𝑌 take values in a measurable space 𝑇, and suppose that 𝑃{𝑋 =𝑑} >0 for every 𝑑 ∈𝐷. Then 𝜅(𝑑)(𝐵) =𝑃{𝑋 =𝑑, 𝑌 ∈𝐵}/𝑃{𝑋 =𝑑} defines a version of 𝑃[𝑌 ∣𝑋 = ⋅ ], it is the unique version, and if the reals 𝑃{𝑋 =𝑑, 𝑌 ∈𝐵} and 𝑃{𝑋 =𝑑} are computable uniformly in 𝑑 and a witness for 𝐵, then 𝜅 is computable uniformly in the same data.
Referenced from 5 locations
Proof of Proposition 173.13 — Discrete observations
Proof. Each 𝜅(𝑑) is a probability measure, since 𝐵 ↦𝑃{𝑋 =𝑑,𝑌 ∈𝐵} is a measure of total mass 𝑃{𝑋 =𝑑}; measurability in 𝑑 is automatic on a discrete space. For 𝐴 ⊆𝐷, ∫𝐴𝜅(𝑑)(𝐵)𝑑𝑃𝑋(𝑑)=∑𝑑∈𝐴𝑃{𝑋=𝑑,𝑌∈𝐵}𝑃{𝑋=𝑑}𝑃{𝑋=𝑑}=𝑃{𝑋∈𝐴, 𝑌∈𝐵}, which is definition 173.3. Uniqueness holds because every singleton has positive measure, so proposition 173.4 leaves no room for a discrepancy. For computability, the quotient of two computable reals with computable nonzero denominator is computable: from approximations 𝑎𝑛 →𝑎 and 𝑏𝑛 →𝑏 with 𝑏 >0, and a rational 𝑞 with 0 <𝑞 <𝑏 obtained from the approximations, the quotient 𝑎𝑛/𝑏𝑛 approximates 𝑎/𝑏 with an error bounded by |𝑎𝑛 −𝑎|/𝑞 +|𝑎| |𝑏𝑛 −𝑏|/𝑞2, and both terms are driven below any prescribed 2−𝑘 by taking 𝑛 large enough, uniformly in the data. ◻
Take 𝐷 ={positive,negative} and 𝑇 ={ill,well} with the joint masses of the opening paragraph. Then 𝜅(positive)({ill}) =99/1000002097/100000 =11233 and 𝜅(positive)({well}) =222233, a probability measure; the disintegration equation at 𝐴 =𝐷 recovers 𝑃{𝑌 =ill} =1/1000. Every number is a reduced rational, and the only side condition checked is the positivity of 𝑃{𝑋 =positive}.
Referenced from 2 locations
Let 𝑋 and 𝑌 take values in measurable spaces 𝑆 and 𝑇, and suppose there is a jointly measurable 𝑝 :𝑆 ×𝑇 →(0,∞), bounded, a conditional density of 𝑋 given 𝑌 with respect to a 𝜎-finite measure 𝜆 on 𝑆: that is, 𝑃{𝑋 ∈𝐴, 𝑌 ∈𝐵} =∫𝐵∫𝐴𝑝(𝑥,𝑦) 𝑑𝜆(𝑥) 𝑑𝑃𝑌(𝑦) for all measurable 𝐴,𝐵. Then 𝜅(𝑥)(𝐵)=∫𝐵𝑝(𝑥,𝑦)𝑑𝑃𝑌(𝑦)∫𝑇𝑝(𝑥,𝑦)𝑑𝑃𝑌(𝑦) is a version of 𝑃[𝑌 ∣𝑋 = ⋅ ].
Referenced from 7 locations
Proof of Proposition 173.15 — Bayes' rule under a positive bounded density
Proof. The denominator is finite because 𝑝 is bounded and 𝑃𝑌 is a probability measure, and it is positive because 𝑝 >0; so 𝜅(𝑥) is a probability measure for each 𝑥, and it is measurable in 𝑥 by Tonelli’s theorem (convention 172.12) applied to (𝑥,𝑦) ↦𝑝(𝑥,𝑦)1𝐵(𝑦). Write 𝑚(𝑥) =∫𝑇𝑝(𝑥,𝑦) 𝑑𝑃𝑌(𝑦) for the denominator. First, 𝑃𝑋 =𝑚 𝜆 in the sense that 𝑃𝑋(𝐴) =∫𝐴𝑚 𝑑𝜆: take 𝐵 =𝑇 in the density hypothesis and exchange the order of integration by Tonelli. Then for measurable 𝐴,𝐵, ∫𝐴𝜅(𝑥)(𝐵)𝑑𝑃𝑋(𝑥)𝑃𝑋=𝑚𝜆=∫𝐴∫𝐵𝑝(𝑥,𝑦)𝑑𝑃𝑌(𝑦)𝑚(𝑥)𝑚(𝑥)𝑑𝜆(𝑥)𝑇𝑜𝑛𝑒𝑙𝑙𝑖=∫𝐵∫𝐴𝑝(𝑥,𝑦)𝑑𝜆(𝑥)𝑑𝑃𝑌(𝑦)ℎ𝑦𝑝𝑜𝑡ℎ𝑒𝑠𝑖𝑠=𝑃{𝑋∈𝐴, 𝑌∈𝐵}. The first step uses the change of measure for the nonnegative measurable integrand 𝑥 ↦𝜅(𝑥)(𝐵), which is legitimate by the three-stage ascent of theorem 172.14 applied to indicators, simple functions, and monotone limits. ◻
In the situation of proposition 173.15, suppose in addition that 𝑆,𝑇 are computable Polish spaces, that 𝑃𝑌 is a computable measure, that 𝑝 is computable on 𝑅 ×𝑇 for some 𝑅 ⊆𝑆, and that 𝑝 is bounded away from 0 on 𝑅 ×𝑇. Then 𝜅 is computable on 𝑅.
Referenced from 5 locations
Proof of Proposition 173.16 — Computability of Bayes' rule
Proof. For a 𝑃𝑌-almost decidable 𝐵, the map 𝑥 ↦∫𝐵𝑝(𝑥,𝑦) 𝑑𝑃𝑌(𝑦) is computable on 𝑅, uniformly in a witness for 𝐵: this is the imported computability of integration against a computable measure for a bounded computable integrand, used by Ackerman–Freer–Roy as their Proposition 2.30. The denominator is the same integral with 𝐵 =𝑇, and it is bounded below by the assumed positive bound times 𝑃𝑌(𝑇) =1; so the quotient is computable by the division argument of proposition 173.13. A measure on a computable Polish space is determined computably by its values on almost decidable sets, so 𝜅(𝑥) is a computable point of 𝑀1(𝑇) uniformly in 𝑥 ∈𝑅. ◻
Let 𝑈 be a random variable in ℝ and 𝑉 a random variable in a computable Polish space, and let 𝐸 be independent of (𝑈,𝑉) with a bounded computable density 𝑝𝐸 with respect to Lebesgue measure that is positive everywhere. Put 𝑋 =𝑈 +𝐸. Then 𝑃[(𝑈,𝑉) ∣𝑋 = ⋅ ] is computable.
Referenced from 3 locations
Proof of Corollary 173.17 — Observations corrupted by independent noise
Proof. By independence, the conditional density of 𝑋 given (𝑈,𝑉) =(𝑢,𝑣) with respect to Lebesgue measure is 𝑝(𝑥,(𝑢,𝑣)) =𝑝𝐸(𝑥 −𝑢): for measurable 𝐴 ⊆ℝ and 𝐵 in the range of (𝑈,𝑉), 𝑃{𝑋 ∈𝐴,(𝑈,𝑉) ∈𝐵} =∫𝐵∫𝐴𝑝𝐸(𝑥 −𝑢) 𝑑𝑥 𝑑𝑃(𝑈,𝑉)(𝑢,𝑣) by the independence of 𝐸 and the translation formula for Lebesgue measure. This 𝑝 is positive, bounded and computable, so proposition 173.15, proposition 173.16 apply. ◻
★★☆ Give a conditional density that is positive and computable but unbounded, for which the denominator in proposition 173.15 is infinite for some 𝑥. State which hypothesis of proposition 173.16 fails.
Referenced from 2 locations
★★☆ For 𝑈 uniform on {0,1} and 𝐸 uniform on [ −𝜎,𝜎], compute 𝑃[𝑈 ∣𝑋 =𝑥] for 𝑋 =𝑈 +𝐸 explicitly as a function of 𝑥 and 𝜎, and describe its limit as 𝜎 →0 at 𝑥 =1/2.
Referenced from 2 locations
Suggested first pass.
None of these problems is a prerequisite for a later chapter. Begin with exercise 173.10, then exercise 173.11, then the practical project exercise 173.14.
★☆☆ Compute, as reduced rationals, the posterior of a two-state cause given three conditionally independent binary observations with likelihoods 3/4 and 1/4, and verify the disintegration equation of definition 173.3 for the resulting kernel.
Referenced from 3 locations
★★☆ Reconstruct lemma 173.9 with 𝜈 the uniform measure on [0,1]2, 𝑥 =1/2, 𝛼 =𝛿1/3, and 𝜀 =1/10: write 𝑝∗ and 𝜇 explicitly and compute 𝜇𝑋({1/2}).
Referenced from 3 locations
★★☆ In example 173.2, compute for each family the conditional expectation 𝔼[𝑋2 ∣𝐶𝜀] and 𝔼[𝑋2 ∣𝐷𝜀] exactly, and take both limits. State the two limits and the ratio between them.
Referenced from 2 locations
★★★ Prove that if a conditioning operator were continuous at one point of F ×[0,1], then the perturbation of lemma 173.9 would have to fail at that point, and deduce theorem 173.10 again by contradiction rather than directly. Compare the two arguments and state which hypotheses each uses.
Referenced from 2 locations
★★★ Practical project.finite-conditioning-checker Build an exact finite conditioner. Its input is a finite joint distribution over pairs (𝑥,𝑦) with reduced rational masses summing to 1, together with an observation 𝑥0; its output is either the exact posterior table 𝑦 ↦𝜅(𝑥0)({𝑦}) or a rejection naming the reason. The program has three parts: a normalizer that checks the input masses sum to 1; the elementary conditioner of definition 173.1 implemented on reduced rationals with integer arithmetic; and a checker that verifies the disintegration equation of definition 173.3 for the computed kernel on every pair (𝐴,𝐵) of subsets of the finite value sets.
The invariant to maintain is that no division is performed before the denominator has been checked nonzero, and that the output table sums to exactly 1 whenever a table is produced. The concrete result is the posterior for the opening example: with the joint table {(pos,ill)↦99/100000, (pos,well)↦1998/100000,(neg,ill)↦1/100000, (neg,well)↦97902/100000} and the observation pos, the program must print the posterior table {ill ↦11/233, well ↦222/233}.
The acceptance test is decidable and exact: that table, verbatim; a rejection naming a zero denominator when the observation is a value of probability zero added to the input; a rejection naming a mass defect when the input masses sum to 999/1000; and a successful verification of the disintegration equation for all sixteen pairs of subsets in the example. The checker decides the finite case only. It does not bear on theorem 173.10, whose content is that no such program extends to arbitrary computable joint distributions on [0,1]2.
Referenced from 3 locations