Alphabeta Math
TheoremStatement: AI-adaptedProof: AI-adaptedPipeline-generatedprecheck pass
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 pi to outcome i. For b-bit midpoint input, each cumulative threshold frequency differs from its target Ci by at most 2−b−1, and each individual outcome frequency differs from pi by at most 2−b. The ordered binary search terminates at the stated least index, using at most ⌈log⁡2r⌉ cumulative-array comparisons on a positive input; its explicit zero-input branch returns outcome 1.

Facts & Assumptions

Given: A finite probability vector (p1,…,pr) and either ideal uniform input or the N=2b midpoint grid.

[F1]

The midpoint input is uniform on {(k+1/2)/N:0≤k<N}. Midpoint bit discretization has bounded coupling and CDF error

[F2]

On positive input the categorical procedure uses the non-strict test v≤Cj and returns the least index with v≤Ci; at zero it returns 1. Finite categorical sampling by inverse CDF and binary search

[A1]

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 (ACω), The axiom of dependent choice: a relation in which every element is related to something admits an N-indexed chain

Proof

1.1givenF2algebra

Apart from the null event U=0, outcome i is returned exactly when Ci−1<U≤Ci, an interval of length Ci−Ci−1=pi. Its uniform probability is the interval length Ci−Ci−1=pi, so the ideal law is exactly the specified categorical law.

1.2F1F2A1algebra

Put N=2b. For any threshold C∈[0,1], the number of midpoints (k+1/2)/N≤C is min⁡(N,max⁡(0,⌊NC+1/2⌋)). Thus its normalized count differs from C by at most 1/(2N). Applying this to Ci and Ci−1, the frequency of outcome i is the difference of their cumulative frequencies, so its error from pi is at most 1/N=2−b.

2.1step 1.1step 1.2

The cumulative and individual bounds in step 1.2 give the stated finite-grid error, while step 1.1 proves the ideal-input clause.

3.1givenF2algebrainduction∎

For positive v≤1=Cr, the least admissible index exists. Initially it lies in [L,H]=[1,r]. If v≤Cj, monotonicity of the cumulative sums puts that index in [L,j]; otherwise it lies in [j+1,H]. Thus both updates preserve the invariant, and at L=H the returned index is the least admissible one. When the interval contains n>1 indices, j=⌊(L+H)/2⌋ leaves at most ⌈n/2⌉ indices and uses one cumulative-array comparison. After k updates at most ⌈r/2k⌉ remain, by induction; at k=⌈log⁡2r⌉ this is one. When r=1 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