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.
Finite bit random streams and variate generation
1 · Prerequisites
- Absolute and Conditional Convergence; Rearrangement; Products
- Areas of Elementary Plane Figures
- Binary Operations, Monoids, Groups and Subgroups
- Compactness
- Compactness in Metric Spaces
- Completeness, Completion, and Uniform Continuity
- Complex Norms and Realification
- Complexification, Realification and Real Structures
- Computed fast transforms and convolution
- Construction of the Natural Numbers
- Construction of the Real Numbers via Cauchy Sequences
- Construction of the Real Numbers via Dedekind Cuts
- Continuity, IVT, EVT, and Uniform Continuity
- Cosets, Index and Lagrange's Theorem
- Countability and Uncountability
- Countability Axioms and Cardinal Functions
- Determinants of Matrices over a Commutative Ring
- Divisibility, Euclidean Domains, Principal Ideal Domains and Unique Factorisation
- Divisibility, Greatest Common Divisors and Bézout's Identity
- Equivalent Forms of Completeness
- Euclidean Surface Measure, Divergence, and Green Identities
- Filters and Ultrafilters
- Finite Counting, Factorials and Binomial Coefficients
- Finite Probability and the Probabilistic Method
- Finite Probability Spaces and Random Variables
- Foundations of the Real Numbers for Analysis
- Fubini and Change of Variables
- Fundamental Trigonometric Identities
- Further Trigonometric Identities and Inverse Functions
- Gaussian Elimination, Elementary Matrices and Reduced Row Echelon Form
- Group Actions, Orbits, Stabilisers and Cayley's Theorem
- Hausdorff via the Diagonal
- Ideals, Quotient Rings and the Isomorphism Theorems for Rings
- Improper and Parameter-Dependent Multiple Integrals
- Improper Integrals
- Independence Borel Cantelli and Zero One Laws
- Infinite Product Measures and Kolmogorov Extension
- Lebesgue Measure on Euclidean Space
- Lebesgue-Stieltjes Measures and Distribution Functions
- Limits of Real Functions
- limsup, liminf, and Subsequential Limits
- Linear Independence, Bases and Dimension
- Linear Transformations, Rank-Nullity and Quotient Spaces
- Matrices, the Matrix of a Linear Map, and Change of Basis
- Measurable Functions and Simple Approximation
- Measures and Their Basic Properties
- Metric Spaces
- Monotone Functions, Discontinuities, and Continuity Sets
- Monotone Sequences, Bolzano-Weierstrass, and Cauchy Completeness
- Normal Subgroups and Quotient Groups
- Norming and Separation under Hahn–Banach
- Order, Zorn's Lemma, and the Axiom of Choice
- Outer Measure and the Caratheodory Extension Theorem
- Outward rounded interval and ball arithmetic
- Pointwise Extended-Real Function Products
- Polynomial Rings, the Division Algorithm and Roots
- Power Series and Real-Analytic Functions
- Primes, Euclid's Lemma and the Fundamental Theorem of Arithmetic
- Probability Spaces Random Variables and Expectation
- Product Measures and the Fubini Tonelli Theorems
- Properties of the Integral and the Working FTC
- Radon Measures and the Riesz Markov Kakutani Theorem
- Relations, Functions, and Quotients
- Rings, Subrings, Integral Domains and Fields
- Rⁿ as a Normed Space; Vector-Valued Functions
- Roots, Rational Powers, and Classical Inequalities
- Separation Axioms: the Hierarchy
- Sequences and Limits
- Sequences and Series of Functions; Uniform Convergence
- Series: Convergence and the Nonnegative Tests
- Sigma Algebras and Borel Sets
- Simple Field Extensions and the Construction of the Complex Numbers
- Sine, Cosine, and the Definition of Pi
- Stationary Markov Chains and Ergodic Limits
- Subspaces, Products, and Quotients
- Suprema and Infima
- Symmetric Groups, Cycle Decomposition and the Sign Homomorphism
- The Complex Exponential and Euler's Formula
- The Derivative and the Mean Value Theorems
- The Exponential Function
- The Inverse and Implicit Function Theorems
- The Lebesgue and Riemann Integrals Compared
- The Lebesgue Integral and the Convergence Theorems
- The Logarithm and General Powers
- The Lᵖ Spaces Holder Minkowski and Riesz Fischer
- The Riemann Integral in Rᵐ and Jordan Content
- The Riemann Integral: Definition and Integrability
- The Topology of Euclidean Space
- The Total Derivative in ℝᵐ → ℝⁿ
- The ZFC Axioms and the Basic Set Constructions
- Topological Spaces and Continuity
- Topology of ℝ
- Uniform Spaces: the Three Definitions
- Vector Spaces, Linear Subspaces, Span and Direct Sums
- Weak Convergence Tightness and Representation
2 · Summary
This page separates ideal independent fair bits from deterministic finite-state streams. It proves that disjoint fair-bit subsequences give independent uniforms, then quantifies midpoint discretization, including the fact that its total-variation distance from a continuous uniform law is maximal. Finite state and LCG results explain why a long period or uniform single-state marginals do not imply independence. Inverse CDF, rational rejection, and Box–Muller are developed with explicit endpoint, tail, and finite-work behavior. The exact Box–Muller map has a product Gaussian law; its finite-bit implementation requires certified elementary-function evaluators, and any failed certification returns inconclusive.
The finite-bit implementation reuses the interval page's finite real evaluator and the computed-transform page's certified unit-circle phase routine. Its distribution-error theorem requires one fixed configuration to certify every possible bit input, with uniform error bounds; conditioning on a successful random sample does not establish that theorem.
3 · Logical flowchart
4 · Definitions, theorems and proofs
Linear congruential generator modulo a power of two
Definition
Let an integer , , integers , and a seed be inputs. For an integer , denotes the unique residue in congruent to modulo . The state sequence and returned midpoint word are The output is the deterministic state sequence, or its midpoint conversion . A full-period LCG is the special case and odd; its period is proved separately. A seed chosen at random is a distinct probability model, not part of this deterministic procedure.
Remarks
An LCG has finite state and therefore eventually repeats. Full period and uniform one-time marginals do not assert independence of successive states. The output conversion uses midpoints to avoid exact values and .
Counter stream from a keyed finite permutation
Definition
Let for an integer . The input is a key , a specified bijection , and a counter interval with integer endpoints satisfying . Initialize . On each call:
- If , return the status exhausted.
- Otherwise return the word and replace by .
The procedure never wraps the counter. Different keys define different supplied permutations; their statistical relationship is not specified by this interface. A fixed key and counter interval define a deterministic stream. Any random-key model or computational pseudorandomness guarantee must be stated separately.
Remarks
The bijection assumption is an input contract. This definition supplies no cryptographic claim and no IID theorem. Dividing the counter range into disjoint intervals prevents exact reuse within one fixed key because each counter is used once.
Every deterministic finite-state stream is eventually periodic
Statement
Let be a nonempty finite set with elements, let be a deterministic transition, let , and let be any output map. The state sequence has integers and with such that for all . Hence the output sequence is eventually periodic with period . If is bijective, then can be used.
Facts & Assumptions
Given: The finite state set, deterministic transition, initial state, and output map in the Statement.
The state space has exactly elements, and each next state is uniquely determined by the current one.
Proof
Among the states , two must be equal, so choose with . Put and . Applying the same transition to equal states repeatedly gives for every , and .
If is bijective, its -fold iterate is injective. Applying that injectivity to gives . Repeated application of yields from , and applying gives the same output period.
Disjoint streams of independent fair bits produce independent uniform variables
Statement
Assume Countable Choice and Dependent Choice. Let carry the countable product probability measure of fair bits. For any finite family of coordinate sequences such that each sequence has distinct coordinates and their ranges are pairwise disjoint, define Then each has the uniform Borel law on , and the family is independent. No other choice principle is used.
Facts & Assumptions
Given: Countable Choice, Dependent Choice, the canonical countable product probability space of fair bits, and finitely many enumerated coordinate sequences, each injective, whose ranges are pairwise disjoint.
Under Countable Choice and Dependent Choice, the countable product probability measure exists, is unique, and has every prescribed finite product marginal. Assuming countable and dependent choice, countable products of arbitrary probability spaces
The coordinate maps of that product probability space are independent. Coordinate random elements of a countable product are independent
Independence means independence of the generated sigma-algebras. The finite Borel-rectangle factorization criterion is equivalent to this definition. Independent random elements, Independent random elements are characterized by finite rectangle probabilities
For decreasing measurable sets with finite first-set measure, probability is continuous from above. Continuity from above when one set has finite measure
Measures agreeing on a generating pi-system and on a finite-measure exhaustion agree on the generated sigma-algebra. Measures agreeing on a generating pi-system are equal under an increasing finite-measure exhaustion from that pi-system
Finite-prefix sums of measurable coordinates are measurable, as are their pointwise increasing limits. Coordinate maps, finite-coordinate cylinders, and the cylinder -algebra, Closure properties of measurable functions used by the integral
Rational half-open boxes generate the Borel sigma-algebra of finite-dimensional real space. For n at least one, open sets, closed sets, compact sets, open balls, boxes, rational open boxes, and rational half-open boxes generate the Borel sigma-algebra on R^n
Countable Choice and Dependent Choice are the exact assumptions of [F1]; the construction below uses no arbitrary family of choices. 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
Given: As in the Statement. Write , so with .
By [F1], every specified pattern on distinct coordinates has probability . Thus is uniform on . The events that the first bits after position are all zero, or all one, decrease to the corresponding constant-tail events and have probabilities . By [F4], both constant-tail events have probability zero. The partial sums defining each are measurable and increase to by [F6].
Fix a dyadic threshold with . If , then ; if , then ; if , then only on the null event . Hence . For an arbitrary , dyadic lower and upper approximations differ by at most , so monotonicity of the CDF and passage to the limit give . Outside the CDF is or .
For finitely many streams and dyadic thresholds , the joint event differs by a null set from the event that every prefix integer . Injectivity within each sequence and pairwise disjointness of their ranges make all prefix coordinates distinct. By [F2] these coordinate bits are independent and by [F1] each is fair, so the probability that each stream's prefix integer is below is the product .
For arbitrary thresholds , dyadic lower and upper approximations squeeze the joint probability between products converging to . Thus the joint CDF equals the product-uniform CDF. The lower rectangles , including the whole cube, are closed under intersections. They generate each coordinate slab by taking the other thresholds to be ; complements and finite intersections then give the intersections of the cube with all rational half-open boxes (thresholds outside give empty or full slabs). By [F7] these generate the relative Borel sigma-algebra of the cube. Both laws have total mass one there, a finite-measure exhaustion. Thus [F5] identifies the joint law with the product-uniform law. In particular every Borel rectangle has the product of its marginal probabilities, so the rectangle criterion [F3] gives independence of the generated sigma-algebras.
Generalized inverse sublevel identity for a CDF
Statement
Assume Countable Choice. Let be the CDF of a real random variable. For define The set in this infimum is nonempty and bounded below, so , and for every ,
Facts & Assumptions
Given: Countable Choice, a real random variable , its CDF , and .
A CDF is nondecreasing and right-continuous, with limits and at the two infinities. Probability laws correspond to distribution functions
Every nonempty subset of bounded below has a finite infimum, and for every it has an element below its infimum plus . Complete ordered field (least-upper-bound property)
Countable Choice is assumed for the supplied CDF theorem; the local infimum argument makes only finitely many individual choices and uses no stronger choice principle. The Axiom of Countable Choice ()
Proof
Given: As in the Statement. Put .
By the upper-tail limit in [F1], some real has , so is nonempty. By the lower-tail limit, some real has ; monotonicity then gives for all , so is bounded below. Fact [F2] gives a finite infimum .
If , then , hence .
Conversely, suppose . For every , the definition of infimum gives some with . Monotonicity gives . Right continuity at as yields .
Steps 2.1 and 2.2 prove the equivalence, and step 1.1 proves the required well-definedness.
Box–Muller has a product Gaussian density and Rayleigh second moment
Statement
Assume Countable Choice. Let have product Lebesgue probability law on , and set Then has the Borel density In particular, its coordinates are independent with density . Also for and .
Facts & Assumptions
Given: Countable Choice and the joint-uniform pair and transform in the Statement.
For a diffeomorphism between open Euclidean sets, nonnegative Borel change of variables is valid under Countable Choice. Borel change of variables from the compact-support formula and Radon uniqueness
A coordinate hyperplane has two-dimensional Lebesgue measure zero under Countable Choice. A box with a degenerate side is Lebesgue null, and so is every coordinate hyperplane in
Tonelli's theorem factors nonnegative integrals on sigma-finite product spaces and allows order exchange. Tonelli's theorem for nonnegative measurable functions on a sigma-finite product
Independence means independence of the generated sigma-algebras; factorization of probabilities on every finite Borel rectangle is an equivalent criterion. Independent random elements, Independent random elements are characterized by finite rectangle probabilities
A probability measure has total mass one, and its pushforward law is again a probability measure. Probability measures and probability spaces
Continuous maps pull Borel functions back to Borel functions. A continuous map has Borel preimages of Borel sets
The exponential derivative, chain rule, logarithm identity, and square-root law justify the displayed transform derivatives and radial inverse; is the fixed positive constant of the trigonometric coordinate. The real exponential function and the number by a power series, The exponential function is strictly increasing, The exponential function is smooth and , The chain rule, in one line from Carathéodory: if is differentiable at and is differentiable at , then is differentiable at with , Order, continuity, range, and the product, quotient, and reciprocal laws for the natural logarithm, Square roots exist: a unique with ; the positives are , Pi as twice the smallest positive zero of cosine
The logarithm is the inverse of the exponential: for and for real . Also ; differentiating the inverse of on gives . Exponentials satisfy . The natural logarithm as the inverse of the exponential function, The natural logarithm has derivative 1/x and equals the integral from 1 to x of 1/t, Derivative of an inverse: if is continuous and injective on a nondegenerate interval and differentiable at with , then the inverse is differentiable at with ; and if then is not differentiable at , The exponential addition formula
The map bijects onto the unit circle, and its component derivatives are and . A map between open Euclidean sets with invertible derivative has a local inverse with the inverse derivative. is a bijection from onto the real unit circle, The derivatives of sine and cosine are cosine and minus sine, The Euclidean inverse function theorem
Countable Choice is the only choice assumption used by the change-of-variables and null-axis suppliers; no use is made of full Choice. The Axiom of Countable Choice ()
Proof
Given: As in the Statement. Let , an open slit plane. The map will be shown to be the inverse of the displayed Box–Muller map from onto .
By [F7]–[F8], is positive on , with inverse for . By [F9], the angles for parametrize the unit circle with removed exactly once. Thus is bijective onto , with inverse . The scalar derivatives give , so is and . The local inverse theorem [F9], together with global bijectivity, makes a inverse on , with .
For every nonnegative Borel on , [F6] makes Borel. Apply [F1] to with integrand on its target. Since has product Lebesgue law, this gives . The omitted nonnegative -axis is Borel and null by [F2], and always lies in , so is the density on all of .
By [F5], the pushforward law has total mass one, so its density integrates to . By [F3] and the exponential addition law [F8], writing , we have . Positivity of the integrand gives , and the equality forces and . Therefore with each factor integrating to . For arbitrary Borel sets , [F3] applied to gives . Taking or identifies the marginal probabilities. Thus the Borel-rectangle factorization criterion [F4] proves independence, with the stated marginal densities.
For , monotonicity and the inverse identities [F7]–[F8] give ; uniformity gives probability , also at . Pointwise, . By [F3], , using the substitution .
Midpoint bit discretization has bounded coupling and CDF error
Statement
Assume Countable Choice and Dependent Choice as in Disjoint streams of independent fair bits produce independent uniform variables. Let be the uniform variable from an independent fair-bit stream. For , put Then is uniform on , pointwise, the 1-Wasserstein and Kolmogorov distances between their laws are at most , and their total-variation distance is exactly . We use over couplings, , and .
Facts & Assumptions
Given: An independent fair-bit stream, a bit budget , and the definitions in the Statement.
The bit-stream sum is uniform on , and every finite bit prefix is uniform. Disjoint streams of independent fair bits produce independent uniform variables
For probability laws, total variation here is the supremum of absolute event-probability differences. Total variation distance for probability laws
Every half-open or closed interval has Lebesgue measure equal to its length, including degenerate intervals. A box in with parameters is Lebesgue measurable of measure , whichever of its faces are included
The uniform law in [F1] is Lebesgue measure on ; its CDF and strict CDF are both the clipped identity by [F3]. Countable Choice is the assumption of [F3]. The Axiom of Countable Choice ()
The fair-bit product source in [F1] assumes Countable Choice and Dependent Choice. 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
The first independent fair bits give each of the binary prefixes probability , so is uniform on the stated integer set. Write the remaining binary tail as . Then , while , hence .
The displayed coupling gives by the infimum definition of . For non-strict CDFs, ; for strict CDFs, . Since both uniform CDFs equal the clipped identity by [A1], these inclusions bound each absolute discrepancy by .
The law of is supported on its finite midpoint grid, which has probability under and probability under the continuous uniform law of . By [F2], this event gives , the maximal possible value.
The power-of-two mixed LCG has full period but dependent adjacent states
Statement
For the LCG of Linear congruential generator modulo a power of two, assume , , and odd. For every seed the state sequence has exact period . If the seed is chosen uniformly from , every is uniform on that finite set, but is not an independent uniform pair.
Facts & Assumptions
Given: The LCG recurrence, , , , and odd .
The update is and the output state is a residue modulo . Linear congruential generator modulo a power of two
The uniform probability law on a finite set assigns equal mass to every point. The uniform probability space on a nonempty finite set
Every positive integer factors into primes uniquely up to order. The only positive divisors of are and , so is prime. The fundamental theorem of arithmetic: every integer is a product of primes, and the factorisation is unique up to order — if with every and prime, then and for some , Prime and composite integers: is prime when and its only positive divisors are and
Proof
For , let . Induction on in the affine recurrence gives , and the same formula holds from any starting state.
For every , . The base case is . If , then squaring gives , whose difference from is divisible by .
Write . For , is odd. The identity and show that is odd; hence is odd.
For every , the affine iterate in step 1.1 and facts from steps 2.1 and 3.1 give . Indeed, the first summand is divisible by , while with odd and odd; thus a return at is impossible modulo .
Taking in the affine iterate from step 1.1 shows : the first summand is divisible by and by . Thus a least positive return time exists.
This least return time divides . Indeed, write with . Determinism and imply for all , so . Since , minimality of forces , hence for some positive integer . By [F3], factor and into primes; their combined list is a prime factorization of , whose prime list consists of copies of the prime . Uniqueness in [F3] implies every prime factor of is 2, so for some . If , step 4.1 shows modulo and therefore modulo , contradiction. Hence , for every seed.
The map is injective: if two outputs agree then . Since is odd, implies ; canceling a factor and repeating times gives . Thus the map is a permutation of the finite state set. By [F2], a uniform seed therefore remains uniform at every time. The adjacent-pair law is supported on exactly the pairs , while the product of two uniform marginals assigns positive mass to all pairs. Since , , so the adjacent states are dependent.
A keyed permutation stream does not reuse outputs before its counter interval ends
Statement
For a fixed key and counter interval in Counter stream from a keyed finite permutation, distinct counters produce distinct output words. If the interval is the full set , every word of that finite state set appears exactly once. These are deterministic no-reuse statements; they imply no probabilistic independence.
Facts & Assumptions
Given: A fixed key, a bijection , and the counter procedure of Counter stream from a keyed finite permutation.
For a fixed key, the supplied map is a bijection of the finite counter set. Counter stream from a keyed finite permutation
Proof
If are counters in the interval, injectivity of gives . The procedure uses each counter at most once before returning exhausted, so no output repeats in that interval.
On the full counter set, the injective map has distinct outputs in a set of size , hence its range is all of . Thus every word appears exactly once, with no probability assertion.
Unbiased rational Bernoulli sampling by bit rejection
Definition
Input integers and , a stream of independent fair bits as in Disjoint streams of independent fair bits produce independent uniform variables, and an optional positive integer attempt cap (or ). If , return without reading bits; if , return without reading bits. Otherwise let be the least nonnegative integer with . For each attempt, read a fresh non-overlapping block of bits and interpret it as a uniform integer . If , reject the block and start another attempt. If , return when and otherwise. If a finite cap is reached before an accepted block, return status inconclusive and no Bernoulli value.
Remarks
The finite-cap branch is not a sample with a substituted default value. Its success law and failure probability are proved separately. The algorithm assumes independent fair-bit blocks; an LCG or keyed deterministic stream does not satisfy that premise by definition.
Finite categorical sampling by inverse CDF and binary search
Definition
Input a nonempty finite list of outcomes () with probabilities and , and either an ideal bit-stream uniform as in Disjoint streams of independent fair bits produce independent uniform variables or a -bit midpoint as in Midpoint bit discretization has bounded coupling and CDF error. Write for the supplied input. Let and .
- If , return outcome . This assigns the ideal uniform's null zero-endpoint event an explicit value.
- Otherwise initialize integer bounds , . While , set . If , set ; otherwise set .
- When , return outcome .
Thus on positive inputs the intended output is the least index with , including equality at a cumulative threshold. For , this is the generalized inverse of the step CDF by Generalized inverse sublevel identity for a CDF. At , the same least-index rule specifies the endpoint extension ; this set contains . The midpoint and ideal-input law and binary-search properties are proved separately.
Remarks
With ideal , this is exact finite categorical inversion. Midpoint input has a discrete law; its threshold counts, rather than total-variation closeness to a continuous uniform law, control its categorical error.
Certified bracketed bisection for a continuous CDF
Definition
Input a continuous nondecreasing CDF on a finite interval with , a target , tolerance , a nonnegative integer , and a verified modulus certificate An exact real-comparison oracle for and a budget of at least evaluations are also inputs. First evaluate and store and , counting both against the budget; an evaluation failure returns inconclusive. If , return status tail-unresolved. Otherwise set and . Repeat times: set ; if , replace by , and otherwise replace by . If an evaluation or the budget fails, return inconclusive. Return and the certificate and .
A caller that cannot supply a certified , the required budget, or exact comparison returns inconclusive. The procedure resolves the central bracket only; any tails outside require a separately specified branch or sampler.
Remarks
This is a real-arithmetic reference procedure. Endpoint queries and each midpoint query are counted against the input evaluation budget, with tail and precision failures explicit. It does not identify CDF residual with spatial error unless an additional positive lower density bound is supplied.
Disjoint ideal fair-bit streams yield independent standard normals by Box–Muller
Statement
Assume the Axiom of Choice and Dependent Choice. On the countable product space of ideal independent fair bits, choose two disjoint infinite coordinate subsequences and form their bit-stream uniforms . Use the displayed formula when , and define when , so the null endpoint event is assigned a value. Then are independent with the canonical standard-normal law .
Facts & Assumptions
Given: The Axiom of Choice, Dependent Choice, the fair-bit product construction, and the two Box–Muller formulas in the Statement.
Disjoint fair-bit subsequences produce independent uniform variables under Countable Choice and Dependent Choice. Disjoint streams of independent fair bits produce independent uniform variables
The Box–Muller transform of a joint-uniform pair has independent marginals with density . Box–Muller has a product Gaussian density and Rayleigh second moment
Under the Axiom of Choice, the canonical law is the probability measure with density . Standard normal and normal laws
A singleton has Lebesgue measure zero, so each uniform coordinate has zero probability of either endpoint. A box in with parameters is Lebesgue measurable of measure , whichever of its faces are included
The Axiom of Choice supplies Countable Choice and is used to identify the canonical law. The Axiom of Choice, The Axiom of Countable Choice ()
Dependent Choice is required by the countable fair-bit product. The axiom of dependent choice: a relation in which every element is related to something admits an -indexed chain
Proof
By [F1], the two disjoint subsequences give a joint-uniform pair on ; [F4] shows the pair lies in almost surely. The chosen endpoint convention changes no law. Applying [F2] gives a pair with independent marginals, each the probability law with density . The existence of this finite bit pair uses Dependent Choice through [F1].
By [A1], the Axiom of Choice supplies Countable Choice for the hypotheses of [F1] and is the exact axiom required by [F3]. Thus each density- marginal is the canonical law, and the pair remains independent.
Rational Bernoulli rejection has exact law, geometric failure, and bounded expected bit cost
Statement
Consider Unbiased rational Bernoulli sampling by bit rejection with and as in its Definition. One attempt accepts with probability . With cap , failure probability is , and conditional on success the returned bit is Bernoulli with success probability . With no cap, the algorithm terminates almost surely, returns an exact Bernoulli bit, and uses expected blocks and fair bits. The endpoint cases are deterministic and use zero bits.
Facts & Assumptions
Given: Integers , independent fair-bit blocks, and the procedure in Unbiased rational Bernoulli sampling by bit rejection.
Each fresh -bit block is uniform on , and disjoint blocks are independent. Disjoint streams of independent fair bits produce independent uniform variables
The procedure accepts exactly when the block integer lies in and returns one exactly for . Unbiased rational Bernoulli sampling by bit rejection
For nonnegative measurable , monotone convergence gives . Monotone convergence for the integral
For real , . For , , and for the series diverges
The countable fair-bit product supplying [F1] assumes Countable Choice and Dependent Choice; the rejection calculation is conditional on that source. 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
By minimality of , for . [F1] gives acceptance probability and rejection probability . On one accepted block, the possible accepted integers have equal probability , with of them returning and returning .
By independence of attempts, the probability that the first accepted block occurs at attempt and returns is , while the probability that it occurs at attempt is . Summing over gives success probability and returned-one probability ; dividing yields conditional success probability . The no-acceptance event has probability .
With no cap, , so the probability of never accepting is zero. Let be the first accepted attempt, setting on the null nontermination event. For each , ; these truncations increase to , and independence gives . By [F3] and the geometric identity [F4] with , . Taking in step 2.1 gives output-one probability and hence the exact Bernoulli law. Each attempt consumes bits, so the expected bit cost is . The cases and use the explicit zero-bit branches in the algorithm.
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.
Certified bisection controls CDF residual, spatial error, and distribution error
Statement
For the fixed-depth procedure of Certified bracketed bisection for a continuous CDF, a successful call uses two endpoint evaluations and midpoint evaluations, at most CDF evaluations in total. For every continuous CDF on its compact bracket, some finite depth meets each positive modulus tolerance. The bracket invariant holds and its returned point satisfies . For , if the exact quantile lies in and a density satisfies and almost everywhere on the bracket, then .
For the distribution bound, assume the procedure is run with one fixed depth and bracket on every , with , , and residual at most for a continuous CDF . Let be its returned point. Then is nondecreasing. If for another CDF , then where is the -bit midpoint uniform, , and . If the target is unbounded, the finite-bracket algorithm alone has no global distribution guarantee; its outside-bracket status remains tail-unresolved. Here .
Facts & Assumptions
Given: The algorithm inputs and hypotheses in the Statement. The Kolmogorov distance is .
For , the generalized inverse satisfies exactly when . Generalized inverse sublevel identity for a CDF
A -bit midpoint input has both strict and non-strict CDF discrepancies at most . Midpoint bit discretization has bounded coupling and CDF error
A continuous real-valued function on a compact interval is uniformly continuous. Every continuous map from a nonempty compact Hausdorff space to a uniform space is uniformly continuous
The geometric sequence tends to zero. For the sequence is null, and for the sequence diverges to
For the spatial claim, the density identity and lower bound in the Statement imply on the bracket by integrating .
The bisection depth, bracket, tolerance, modulus, and evaluation budget satisfy the algorithm's Definition. A returned comes from a successful call that passed its endpoint bracket test. The distribution claim additionally has a single fixed depth and full-support bracket.
The approximate CDF is continuous, nondecreasing, and satisfies the stated uniform CDF error bound .
The generalized-inverse supplier in [F1] assumes Countable Choice. The Axiom of Countable Choice ()
When in [F2] is realized from the countable fair-bit product, its source model assumes Countable Choice and Dependent Choice; the distribution bound is conditional on that stated midpoint 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
Initially by the algorithm's bracket test. If , replacing by preserves both inequalities by monotonicity; if , replacing by preserves them. After steps, , so the modulus certificate gives . Since , monotonicity puts both and in this range, proving . For a continuous , uniform continuity [F3] supplies a positive distance tolerance; since by [F4], some finite meets it. A successful run evaluates the two endpoints once and one midpoint per update, hence uses CDF evaluations; the budget explicitly includes these endpoints.
For fixed depth , the grid consists of the cells in the partition of ; their left endpoints are for . At each bisection, the tested midpoint separates the remaining candidate left endpoints into lower and upper halves, and the rule keeps the upper half exactly when . Induction on the updates shows that the final is the greatest such left endpoint and is the next grid point. As increases, the predicate set can only grow, so the selected cell midpoint is nondecreasing.
The successful call's endpoint test gives . By [F1], gives , while every satisfies . If , the endpoint test and [F1] give . If , take for ; then and . Continuity of on gives . Thus in either case. Since , [A4] gives by step 1.1.
Fix and set and . Monotonicity makes an initial interval. If , then , so . If , then , so and . Taking one-sided limits gives ; if or , the missing side follows from . The set is either an initial closed or open interval, or empty/all; its -bit midpoint-grid probability differs from by at most , using the strict or non-strict CDF bound in [F2]. Thus .
The uniform CDF error implies . The triangle inequality for the supremum norm of CDF differences and step 2.2 give the stated bound.
Finite-bit Box–Muller with certified elementary-function evaluators
Definition
Input an integer bit budget , two disjoint ideal fair-bit subsequences as in
Disjoint streams of independent fair bits produce independent uniform variables, and a fixed deterministic
configuration consisting of finite dyadic format parameters, positive integer
series truncation indices and nonnegative integer total split budgets
for the log/root interval evaluators, positive dyadic log/root width
targets, and phase parameters with exact rational , integer exponent limits
, integer precisions ,
and a positive integer elementary-series cap . Every call uses
these fixed parameters; a failed call returns inconclusive with its supplier
status. No success at a requested width is promised for arbitrary fixed budgets.
The midpoint convention is Midpoint bit discretization has bounded coupling and CDF error, and
the exact reference transform is Box–Muller has a product Gaussian density and Rayleigh second moment.
-
Take the first bits from each subsequence and form the exact dyadics . Enclose by directed dyadic endpoints in the selected format. If this is non-finite or its lower endpoint is not positive, return
inconclusive; underflow may not turn a log argument into an accepted interval containing zero. -
Apply Finite-budget validated range evaluation to the logarithm DAG on that interval with the configured finite parameters and log width target. On
certified(L,X), write and set , . The natural logarithm equals the integral logarithm by The natural logarithm has derivative 1/x and equals the integral from 1 to x of 1/t, so . Compute the exact dyadic . -
Enclose by directed endpoints in the configured format; reject non-finite endpoints or a negative lower endpoint. Apply the same budgeted procedure to its square-root DAG with the root width target. On a certified interval , set and . The range guarantee of Budgeted range evaluation terminates and certifies only sound enclosures gives and . Width differences and the products in these instructions are exact dyadic arithmetic.
-
Call Certified dyadic enclosures for unit-circle phases on the exact rational and configured phase parameters. On its certified return , set and . By Certified phase output encloses the exact unit-circle value, , including pi, angle, truncation and directed-endpoint errors. This is the existing phase routine, with its existing canonical-pi bridge.
-
Return the exact dyadic vector and the dyadic certificates . If any preceding supplier call has a non-finite status, propagate it as
inconclusive. Final vector multiplication is exact dyadic multiplication; rounding it further requires a separate added error certificate.
The output is the dyadic vector together with the reported evaluator certificates. Its arithmetic suppliers provide neither an IID source nor exact normal output.
Certified finite-bit Box–Muller has explicit BL and W1 error
Statement
Let , , and with . Form the exact Box–Muller vector from the same ideal uniforms, assigning when so the null endpoint is defined. Run Finite-bit Box–Muller with certified elementary-function evaluators with one fixed deterministic configuration that succeeds for every one of the possible midpoint input pairs. Let be fixed finite upper bounds for its respective reported certificates over all those calls. Such bounds can be obtained as maxima over that finite set after every call has certified success; success on a single sampled input or conditioning on a random success event does not meet this hypothesis. Put For the exact ideal Box–Muller vector and the computed midpoint output , the bounded-Lipschitz distance, defined by the supremum over functions with supremum norm and Lipschitz constant at most , is at most . The 1-Wasserstein distance, defined as the infimum of over couplings, is at most The finite-bit output has finite support and bounded radius, so its total-variation distance from the continuous law with density is , where total variation is . A successful finite transform consumes exactly random bits and makes three top-level evaluator calls (log, root, and phase); the phase call may perform multiple internal evaluations. These bounds do not assert exact Gaussian output.
Facts & Assumptions
Given: The bit budget, , the certified evaluator bounds, and the exact/finite procedures in the Statement.
Coupling a bit-stream uniform to its -bit midpoint gives coordinate error at most . Midpoint bit discretization has bounded coupling and CDF error
The exact Box–Muller vector has product Gaussian density, radial tail , and . Box–Muller has a product Gaussian density and Rayleigh second moment
For square-integrable random variables, Cauchy–Schwarz bounds by the product of their norms. Cauchy-Schwarz for random variables
On every midpoint input pair the fixed deterministic finite transform succeeds and returns with its stated certificates, bounded by the fixed uniform constants . Finite-bit Box–Muller with certified elementary-function evaluators
Total variation between probability laws is the supremum of event-probability differences. Total variation distance for probability laws
On positive reals, ; the real mean-value theorem bounds a differentiable function's increment by its derivative on an interval. The natural logarithm has derivative 1/x and equals the integral from 1 to x of 1/t, The mean value theorem, as the case of Cauchy's: for continuous on with and differentiable on there is with
Every nonnegative real has a unique nonnegative square root. Square roots exist: a unique with ; the positives are
The fair-bit product probability model requires Countable Choice and Dependent Choice. The Axiom of Countable Choice (), The axiom of dependent choice: a relation in which every element is related to something admits an -indexed chain
The exact Box–Muller law uses Countable Choice for Borel change of variables and the null-axis calculation. The Axiom of Countable Choice ()
Proof
The all-input-success hypothesis makes the computed output a deterministic function of the two finite bit blocks on the original probability space; no conditioning changes their law. Couple each ideal uniform input to its midpoint using the same bits. On the event , both and are at least . The mean-value theorem and logarithm derivative [F6] give . For , [F7] and give ; interchanging proves . Thus the radial change before evaluator error is at most . The angular unit vector changes by at most , and the midpoint radius is at most . Thus the exact transform difference on is at most .
Put and . The certified log interval contains , so and . The certified root interval contains and has width at most , hence . The square-root inequality from step 1.1 yields . The phase certificate gives , so . Therefore the evaluator perturbation satisfies , using [F4] and . Combining with step 1.1 gives on .
Since is uniform by [F1], . For every bounded-Lipschitz test function the difference on is at most , and on it is at most . Taking expectations and then the supremum gives .
By [F2], , so [F3] gives . The smallest midpoint is , hence every exact midpoint radius is at most ; [F4] gives . Therefore the expected coupled error is at most , which bounds .
The instructions take exactly bits from each of two subsequences and, on success, call the log evaluator, root evaluator, and phase evaluator once each; hence the stated bit count and three top-level calls. There are only possible pairs of bit blocks, so is supported on a finite set. The exact Gaussian law has a density and assigns that set probability zero; by [F5], the distance is . The radius bound in step 3.2 proves bounded support.
5 · Examples, counterexamples and false statements
None yet.
Sources
- J. Jung, Monte-Carlo Methods lecture notes, §3.1 and Theorem 3.6
- John K. Salmon, Mark A. Moraes, Ron O. Dror, and David E. Shaw, Parallel Random Numbers: As Easy as 1, 2, 3, §2
- Pierre L’Ecuyer, Pseudorandom Number Generators (2007)
- Luc Devroye, Non-Uniform Random Variate Generation, Chapter XV §1, The Random Bit Model
- Kajino, Probability Theory, Theorem 3.65 and Proposition 3.67
- Luc Devroye, Non-Uniform Random Variate Generation, Chapter II §2.1, The Inversion Principle
- D. Pollard, A User's Guide to Measure Theoretic Probability, generalized inverse discussion
- Luc Devroye, Non-Uniform Random Variate Generation, Chapter V §4.4, Box–Muller method
- E. M. Raz, Lecture Notes in Probability, Chapter 5, Exercise 5.2
- J. Jung, Monte-Carlo Methods lecture notes, Theorem 3.6 (Hull-Dobell)
- John K. Salmon et al., Parallel Random Numbers: As Easy as 1, 2, 3, §2
- Luc Devroye, Non-Uniform Random Variate Generation, Chapter XV §1.2, random-bit examples
- Luc Devroye, Non-Uniform Random Variate Generation, Chapter III §2, discrete inversion
- Luc Devroye, Non-Uniform Random Variate Generation, Chapter III §2.1 and §2.3, discrete inversion
- Luc Devroye, Non-Uniform Random Variate Generation, Chapter II §2.2, Inversion by numerical solution
- Luc Devroye, Non-Uniform Random Variate Generation, Chapter V §4.4, generating normal random variates
- J. Jung, Monte-Carlo Methods lecture notes, §4.1 rejection sampling
- Luc Devroye, Non-Uniform Random Variate Generation, Chapter XV §1, the random-bit model
- Luc Devroye, Non-Uniform Random Variate Generation, Chapter II §2.2, bisection inversion
- Luc Devroye, Non-Uniform Random Variate Generation, Chapter V §4.4