How statement and proof provenance work
The first chip identifies the source of the statement or construction; the second identifies the source of its local proof or verification.
- Literature-sourced: the exact statement appears in a cited source; only wording and notation differ.
- AI-adapted: a semantically identical restatement of literature-sourced material, modulo indexing, notation, and boundary cases adopted by the library.
- AI-generated: a genuinely novel statement formulated by AI, with no source for the claim itself.
These labels describe origin, not correctness: citations and verification chips remain separate evidence.
Midpoint categorical frequencies have at most one-grid-cell error
Statement
For the finite categorical procedure of Finite categorical sampling by inverse CDF and binary search, ideal uniform input gives exact probability to outcome . For -bit midpoint input, each cumulative threshold frequency differs from its target by at most , and each individual outcome frequency differs from by at most . The ordered binary search terminates at the stated least index, using at most cumulative-array comparisons on a positive input; its explicit zero-input branch returns outcome .
Facts & Assumptions
Given: A finite probability vector and either ideal uniform input or the midpoint grid.
The midpoint input is uniform on . Midpoint bit discretization has bounded coupling and CDF error
On positive input the categorical procedure uses the non-strict test and returns the least index with ; at zero it returns . Finite categorical sampling by inverse CDF and binary search
When the midpoint law is realized by the countable fair-bit product in [F1], that source assumes Countable Choice and Dependent Choice; the finite counting argument is conditional on the stated grid law. The Axiom of Countable Choice (), The axiom of dependent choice: a relation in which every element is related to something admits an -indexed chain
Proof
Apart from the null event , outcome is returned exactly when , an interval of length . Its uniform probability is the interval length , so the ideal law is exactly the specified categorical law.
Put . For any threshold , the number of midpoints is . Thus its normalized count differs from by at most . Applying this to and , the frequency of outcome is the difference of their cumulative frequencies, so its error from is at most .
The cumulative and individual bounds in step 1.2 give the stated finite-grid error, while step 1.1 proves the ideal-input clause.
For positive , the least admissible index exists. Initially it lies in . If , monotonicity of the cumulative sums puts that index in ; otherwise it lies in . Thus both updates preserve the invariant, and at the returned index is the least admissible one. When the interval contains indices, leaves at most indices and uses one cumulative-array comparison. After updates at most remain, by induction; at this is one. When the loop has zero updates. The zero-input branch returns immediately as specified.
Depends on
Used by
Nothing in the library uses this result yet.
Dependency tree · two levels
21 results within two dependency steps of this one, each drawn at its shortest distance from it. An arrow runs from a result to what uses it, so the chart reads left to right and ends at this result, which carries a heavier outline. Every node is a link to that result. Click elsewhere on the chart to enlarge it.
Sources
- Luc Devroye, Non-Uniform Random Variate Generation, Chapter III §2, discrete inversion (standard reference, not scraped)
- Luc Devroye, Non-Uniform Random Variate Generation, Chapter XV §1, the random-bit model (standard reference, not scraped)