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.
Bagging and random forests
1 · Prerequisites
- Absolute and Conditional Convergence; Rearrangement; Products
- Binary Operations, Monoids, Groups and Subgroups
- CART trees and pruning
- Compactness in Metric Spaces
- Completeness, Completion, and Uniform Continuity
- 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
- Divisibility, Euclidean Domains, Principal Ideal Domains and Unique Factorisation
- Dual Spaces, Bilinear and Quadratic Forms, and Sylvester's Law of Inertia
- Equivalent Forms of Completeness
- Finite Counting, Factorials and Binomial Coefficients
- Finite Probability Spaces and Random Variables
- Foundations of the Real Numbers for Analysis
- Ideals, Quotient Rings and the Isomorphism Theorems for Rings
- Independence Borel Cantelli and Zero One Laws
- Inner Product Spaces, Gram-Schmidt, Projections and Adjoints
- 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
- Modes of Convergence for Random Variables
- Monotone Functions, Discontinuities, and Continuity Sets
- Monotone Sequences, Bolzano-Weierstrass, and Cauchy Completeness
- Normal Subgroups and Quotient Groups
- Order, Zorn's Lemma, and the Axiom of Choice
- Pointwise Extended-Real Function Products
- Polynomial Rings, the Division Algorithm and Roots
- Power Series and Real-Analytic Functions
- Probability Spaces Random Variables and Expectation
- Product Measures and the Fubini Tonelli Theorems
- Properties of the Integral and the Working FTC
- Relations, Functions, and Quotients
- Rings, Subrings, Integral Domains and Fields
- Roots, Rational Powers, and Classical Inequalities
- 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
- Strong Laws of Large Numbers
- Suprema and Infima
- The Derivative and the Mean Value Theorems
- The Exponential Function
- The Lebesgue Integral and the Convergence Theorems
- The Logarithm and General Powers
- The Lᵖ Spaces Holder Minkowski and Riesz Fischer
- The Riemann Integral: Definition and Integrability
- The ZFC Axioms and the Basic Set Constructions
- Topological Spaces and Continuity
- Topology of ℝ
- Triangularisation, Generalised Eigenspaces and Jordan Canonical Form
- Vector Spaces, Linear Subspaces, Span and Direct Sums
- Weak Laws and Series of Independent Random Variables
2 · Logical flowchart
3 · Definitions, theorems and proofs
Bagged random-forest construction on a fixed finite sample
Definition
Fix training data with , features with , and one response mode: regression with , or classification with labels in a fixed ordered finite set , . Choose a finite integer depth cap , an integer tree count , and a feature count . Choosing disables feature randomization.
For every tree index , draw independent uniform indices from and put . For every possible binary node address of depth less than , draw a subset uniformly from the -element subsets of . All bootstrap-index and feature-subset draws are mutually independent across trees, index positions, and node addresses. Write ; thus the are independent with a common law conditional on the fixed data and chosen settings.
At a node with bootstrap position set , define in regression. In classification define and choose one fixed impurity, either misclassification , Gini , or entropy , with .
For tree , write the resampled rows as , so bootstrap positions remain distinct even when they contain the same original row. Build from , starting at the root with position set . At a node of depth , form the candidate midpoint thresholds between consecutive distinct observed values using the coordinates in that node's set . A candidate at coordinate and threshold partitions the current bootstrap positions into and ; only candidates with both children nonempty are used. Score each candidate by in regression or by in classification, where is the chosen impurity. Select a candidate of least score, breaking ties by coordinate index and then cut index, and recurse on its two children. If or there is no candidate, make the node a leaf. When , this is the greedy CART growth procedure on the bootstrap sample; when , the same procedure restricts each node's candidate coordinates to its sampled subset. Each regression leaf predicts its sample mean; each classification leaf predicts its most frequent class, choosing the least class index in a tie. Define by following the unique tree path for .
For regression, the finite-forest prediction is . For classification, it is the class receiving the largest number of votes, with the least class index breaking ties. For a training observation , let . Its out-of-bag prediction is formed using only trees indexed by , with the same regression average or classification vote rule; if , no out-of-bag prediction is returned. An out-of-bag prediction is a diagnostic computed from this finite forest, not an exact identity for its full-forest prediction or risk.
The data flow is shown below. The arrows mean that the same fixed and the independent randomization vector determine each tree, and the stated aggregation combines the resulting predictions; the diagram records the procedure and is not a proof of a performance claim.
diagram failed to render:
\begin{tikzpicture}[>=stealth]
\node[draw,rounded corners] (data) at (0,0) {fixed data $D$};
\node[draw,rounded corners] (random) at (0,-1.2) {IID $\Theta_b$};
\node[draw,rounded corners] (tree) at (3,-0.6) {$T_b(x)=h(x,\Theta_b)$};
\node[draw,rounded corners] (aggregate) at (6,-0.6) {vote or average over $b=1,\ldots,B$};
\draw[->] (data) -- (tree);
\draw[->] (random) -- (tree);
\draw[->] (tree) -- (aggregate);
\end{tikzpicture}Almost-sure limiting risk of an infinite random-forest classifier
Statement
Fix a finite training dataset and a classifier taking values in an ordered finite class set with . Let be IID random elements of a measurable space with common law . Regard the sequence as a random element of and assume it is independent of a test pair with law on . Assume is jointly measurable in . For define , and let
For each , let be the class with the largest number of votes among , choosing the least class index in a tie. Define the finite-forest conditional risk by
If , then, almost surely with respect to the IID tree-randomization sequence,
Statement references
Facts & Assumptions
Given: The fixed training data, measurable classifier and IID tree-randomization sequence, independent test pair, finite ordered class set, and zero-margin hypothesis in the Statement.
Bagged random-forest construction on a fixed finite sample: Classification uses the class with the largest number of tree votes and the least class index for a tie.
Identical distribution and IID families: IID means mutual independence together with identical laws; it includes no moment assumption.
Measurable coordinatewise functions preserve independence: Applying the same measurable map to each member of an independent family preserves independence.
Kolmogorov iid l1 strong law: For IID real random variables with finite first absolute moment, their sample averages converge almost surely to their common mean.
Independent random elements have product joint law: The joint law of a finite independent family of random elements is the product of their marginal laws.
Fubini's theorem for L^1 functions on a sigma-finite product: For an integrable function on a product of sigma-finite measure spaces, either order of iterated integration gives the product integral.
Dominated convergence: Almost-everywhere convergence under a common integrable majorant implies convergence of the integrals.
Expectation of a nonnegative or integrable random variable: Expectation on a probability space is integration against its probability measure.
Proof
Fix a test pair outside the zero-margin set. For each class , the variables are identically distributed because they use the same measurable map on randomizations with common law, independent by [F3], and integrable because they are bounded by . Applying [F4] to each of the finitely many classes shows that every vote proportion converges almost surely to .
On a sequence where those proportions converge, if , the true class has a strictly larger limiting vote proportion than each wrong class, so the finite forest eventually predicts . If , a wrong class attaining the finite maximum in the definition of has a strictly larger limiting proportion than , so the finite forest eventually predicts a wrong class. Thus the finite-forest error indicator converges almost surely in the randomizations to for -almost every test pair.
The functions are measurable by [F6] applied to the bounded jointly measurable indicators . Hence the error indicators and the limiting margin indicator are jointly measurable and bounded. Independence of the sequence-valued randomization and test pair lets [F5] give their product joint law. Applying [F6] to the indicator of the nonconvergence set and using step 2.1 shows that for almost every randomization sequence the error indicators converge for -almost every test pair.
For each such sequence, the error indicators are dominated by the integrable constant on the probability space . By [F7] their integrals converge to the integral of , which by [F8] is . These integrals are exactly , proving the claimed limit.
Breiman's random-forest strength–correlation error bound
Statement
Fix a finite training dataset and a classifier taking values in an ordered finite class set with . Assume is jointly measurable on the product of the test-feature space and the randomization space. Let be a test pair with and test law . Let be independent randomizations with common law , and assume the pair is independent of . For define . For , let be the least index attaining , and define the limiting margin
Assume . For a tree randomization , define the raw margin and . Put . If , then . If , define
Then and
The covariance formula for is Breiman's weighted mean raw-margin correlation written without undefined zero-standard-deviation correlation terms.
Statement references
Facts & Assumptions
Given: The fixed data, classifier jointly measurable on the product of the test-feature and randomization spaces, finite ordered class set, class-valued test response, independent randomizations and test pair, and positive-strength condition in the Statement.
Bagged random-forest construction on a fixed finite sample: The tree law is fixed conditional on the training data, and each tree takes one class value at an input.
Expectation of a nonnegative or integrable random variable: Expectation on a probability space is integration against its probability measure.
Moments, variance, and covariance on a probability space: For square-integrable real random variables, variance is the mean squared centered value and covariance is the mean product of centered values.
Independent random elements have product joint law: The joint law of a finite independent family of random elements is the product of their marginal laws.
Fubini's theorem for L^1 functions on a sigma-finite product: For an integrable function on a product of sigma-finite measure spaces, either order of iterated integration gives the product integral.
Cauchy-Schwarz for random variables: If , then .
Chebyshev's inequality for random variables: For square-integrable and , .
Proof
For each fixed , the definition of gives . Also , so all displayed means and covariances are finite.
The bounded jointly measurable class indicators and [F5] make and the finite maximizer measurable. By [F4] the pair has product law, and [F5] permits exchanging the integrals of these bounded functions. Thus . Indeed, the product of the two conditional raw-margin means is , while the product of their -means integrates to . If both standard deviations are positive, covariance equals correlation times their product; if either is zero, both the covariance and the weighted correlation term are zero. Thus the covariance expression for is exactly Breiman's weighted mean raw-margin correlation.
Suppose . From step 2.1, . Since , . The final inequality uses , by [F6] with one factor equal to ; [F5] and step 1.1 give . The same inequality gives . Therefore .
Since , the event is contained in . Applying [F7] and then step 3.1 gives .
If , then and . For each , , since otherwise ; taking the countable union gives -almost everywhere. For each such , , so the same nonnegative-integral argument makes -almost surely. By [F5], is therefore the constant for -almost every . Hence , as claimed in this case.
Unbiased randomized-tree residual correlation bounds forest risk
Statement
Fix a finite training dataset and a jointly measurable real-valued tree predictor . Let have test law . Let be independent randomizations with common law , assume the pair is independent of , and assume and . For every allowed tree randomization , assume and . Put and . Define
If , then both risks are zero. If , define
Then and
The covariance formula for is Breiman's weighted mean residual correlation written without undefined zero-standard-deviation correlation terms.
Statement references
Facts & Assumptions
Given: The fixed data, jointly measurable square-integrable predictor, unbiasedness condition for every allowed tree randomization, and independent randomizations and test pair in the Statement.
Bagged random-forest construction on a fixed finite sample: For regression, each tree predicts its leaf sample mean and the forest prediction is the average of its tree predictions.
Expectation of a nonnegative or integrable random variable: Expectation on a probability space is integration against its probability measure.
Moments, variance, and covariance on a probability space: For square-integrable real random variables, variance is the mean squared centered value and covariance is the mean product of centered values.
Independent random elements have product joint law: The joint law of a finite independent family of random elements is the product of their marginal laws.
Fubini's theorem for L^1 functions on a sigma-finite product: For an integrable function on a product of sigma-finite measure spaces, either order of iterated integration gives the product integral.
Cauchy-Schwarz for random variables: If , then .
Proof
For every allowed , the mean condition gives . Hence [F3] gives . If both residual standard deviations are positive, define their correlation as this covariance divided by their product; if either is zero, the covariance is zero. Thus the covariance expression for agrees with Breiman's weighted mean residual correlation, including zero-standard-deviation pairs. The products are integrable by [F6] and square-integrability. Also , since and both and are square-integrable.
By [F4] the pair has product law. For -almost every , [F6] gives ; integrating and using step 1.1 shows is integrable on . Thus [F5] permits the following integrations. The -average is the infinite-forest prediction obtained from the same regression tree predictions that the algorithm averages at finite [F1]. Also for -almost every . Consequently . Thus when , and .
The zero-mean condition and [F3] give . By [F6] with one factor equal to , . For , combining with step 2.1 and yields .
If , then the nonnegative function vanishes -almost everywhere: each set has measure zero since otherwise . For -almost every , the mean-zero residual has variance zero, so the same argument applied to gives -almost surely. Fubini then gives for -almost every ; both displayed risks are zero.
4 · Examples, counterexamples and false statements
None yet.