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.
CART trees and pruning
1 · Prerequisites
- Binary Operations, Monoids, Groups and Subgroups
- Construction of the Natural Numbers
- Construction of the Real Numbers via Cauchy Sequences
- Construction of the Real Numbers via Dedekind Cuts
- 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
- Finite Counting, Factorials and Binomial Coefficients
- Foundations of the Real Numbers for Analysis
- Ideals, Quotient Rings and the Isomorphism Theorems for Rings
- Inner Product Spaces, Gram-Schmidt, Projections and Adjoints
- Linear Independence, Bases and Dimension
- Linear Transformations, Rank-Nullity and Quotient Spaces
- Matrices, the Matrix of a Linear Map, and Change of Basis
- Normal Subgroups and Quotient Groups
- Order, Zorn's Lemma, and the Axiom of Choice
- Polynomial Rings, the Division Algorithm and Roots
- Relations, Functions, and Quotients
- Rings, Subrings, Integral Domains and Fields
- Roots, Rational Powers, and Classical Inequalities
- Simple Field Extensions and the Construction of the Complex Numbers
- Suprema and Infima
- The ZFC Axioms and the Basic Set Constructions
- Vector Spaces, Linear Subspaces, Span and Direct Sums
2 · Logical flowchart
3 · Definitions, theorems and proofs
Empirical axis-aligned binary decision trees
Definition
Fix a finite labeled sample with , and . In regression, . In classification, the labels lie in a fixed ordered finite set with . A finite empirical axis-aligned binary decision tree has root sample-index set . Each internal node stores a coordinate and threshold ; its left and right child sample sets are and , and both are required to be nonempty. A leaf is a terminal node. The leaf sample sets partition , and each node's feature region is the intersection of its path inequalities. Every input feature vector follows the unique path determined by the stored comparisons.
For a regression leaf with sample set , put , , and ; its prediction is and its total squared-error loss is . For a classification leaf, put and predict the class with largest , choosing the least index in a tie. Its optional impurities are misclassification , Gini , and entropy , where is the natural logarithm and . A chosen classification criterion determines and the corresponding total leaf impurity is .
The sample mean uniquely minimizes squared error on a nonempty leaf
Statement
Let be a nonempty finite set of sample indices and let for every . Put and . Among all constants , the unique minimizer of is , and the minimum value is .
Statement references
Facts & Assumptions
Given: A nonempty finite sample-index set and real responses .
Empirical axis-aligned binary decision trees: A regression leaf with sample set has , mean , and squared-error impurity .
The standard formulas on and on are inner products: For every , the standard coordinate dot product on is an inner product; in particular, identifying with supplies the standard inner products on both and .
The adjoint is characterised by : An adjoint satisfies for every and .
For a linear map between finite-dimensional inner-product spaces, minimises if and only if , equivalently ; minimisers exist and any two differ by an element of : For a linear map between finite-dimensional inner-product spaces, characterizes minimizers of ; minimizers exist.
Proof
Enumerate in increasing sample-index order as and define and . For all scalars , coordinatewise, so is linear.
Identify with . By [F2] for and , the standard coordinate inner products make and finite-dimensional inner-product spaces. Hence .
Define by . This map is linear, and for every and , . Thus is an adjoint of by [F3]. If another map also satisfied this identity, its value at each would differ from by a scalar pairing to zero with every , hence would equal by positive definiteness. Therefore .
Now [F4] applies to the linear map between these finite-dimensional inner-product spaces, with its adjoint established in step 3.1. The normal equation is , whose unique solution is because . By [F4], this solution is the unique minimizer.
Expanding around gives , since . Therefore the minimum value is .
Cost-complexity criteria for subtrees
Definition
Let be a fixed finite binary tree grown on the sample from an empirical decision tree. A subtree is obtained by collapsing zero or more internal nodes and all their descendants to leaves. For each leaf of , let be its sample count and let be its regression squared-error impurity or its chosen classification impurity, computed as in the empirical decision-tree definition. Define the total training impurity , the terminal-node count , and for the cost-complexity criterion .
For a current nonterminal node , let be its sample set and let be its current descendant subtree. Let be the training impurity if is collapsed to a leaf, using the same response or class rule as for a leaf; let be the sum of the impurities of the current descendant leaves. Define the weakest-link quotient . The denominator is the number of leaves removed by collapsing . This definition makes no claim that a weakest-link sequence globally minimizes for every or that validation selection guarantees test-risk performance.
Definition references
Remark
Choosing by validation or cross-validation is a data-selection procedure; by itself, that choice does not guarantee test-risk performance.
Greedy axis-aligned CART growth on a finite sample
Definition
The inputs are observations with and for an integer , a response mode (regression with or classification with labels in a fixed finite ordered class set), a fixed classification impurity criterion when in classification mode, and a finite integer maximum depth . The root has sample set and depth . At a current leaf with nonempty sample set and depth , perform the following procedure.
-
For each coordinate , sort the distinct observed values in that coordinate as . For each , form the candidate threshold and its child sets and . These are the finite candidates at the node; if no coordinate has at least two distinct values, the candidate set is empty.
-
For each candidate, compute its child score. In regression the score is . In classification it is for the fixed chosen impurity criterion. Select the candidate with the smallest score; when scores tie, select the least pair by comparing coordinate first and cut index second.
-
Store the selected coordinate and threshold at the current node, create its left and right children, and apply this procedure to the left child and then the right child at depth . If or the candidate set is empty, leave the current node as a leaf.
The output is the finite tree whose leaves use the regression means or classification majority labels from the empirical decision-tree definition. No strictly positive loss reduction is required for a split below the depth cap, and the returned tree is not asserted to be globally optimal among all trees.
Definition references
Weakest-link pruning of a finite tree
Definition
The input is a fixed finite empirical decision tree . Start with the current tree and output sequence . At each iteration, if consists of its root leaf, stop and return the sequence. Otherwise, for every current nonterminal node , compute using the current subtree quantities from the cost-complexity definition. Select a node minimizing ; if several tie, select the node whose root-to-node address is least in lexicographic order with . Collapse the current descendant subtree at that node to a leaf, using the empirical tree's leaf prediction rule on its sample set, and append the resulting subtree to the output sequence. Repeat on that new current tree.
The sequence contains the initial tree and each successive collapse through the root leaf. This procedure makes no claim that its subtrees globally minimize the cost-complexity criterion for every penalty or that a validation choice of penalty guarantees test-risk performance.
Greedy CART minimizes the listed split loss and terminates
Statement
Fix a finite labeled sample, response mode, classification impurity criterion when needed, and finite maximum depth as in greedy CART growth. At any node where the procedure splits, its selected coordinate and midpoint threshold minimize the declared child-weighted empirical loss among all nonempty coordinate-threshold partitions of that node's sample, with the specified lexicographic tie rule. The procedure produces a finite tree of depth at most the maximum depth, with nonempty children at every split. This is a nodewise candidate-optimality result only; it gives no global tree-optimality claim.
Statement references
Facts & Assumptions
Given: A finite labeled sample with , a regression or classification mode, the fixed classification impurity criterion when applicable, and a finite integer maximum depth .
Empirical axis-aligned binary decision trees: Each split compares the nonempty child sample sets formed by one coordinate threshold; regression leaf loss is the sum of squared deviations from its sample mean, and classification leaf loss is sample count times the selected impurity.
The sample mean uniquely minimizes squared error on a nonempty leaf: On a nonempty regression leaf, the unique constant minimizing the sum of squared errors is the sample mean.
Greedy axis-aligned CART growth on a finite sample: At each eligible node, the algorithm forms midpoint thresholds between adjacent distinct observed coordinate values and selects the least child score, resolving score ties by coordinate and cut-index order.
Proof
At a node with finite nonempty sample set , each coordinate has finitely many distinct observed values. Arrange them in increasing order . For every , the midpoint between and gives two nonempty children. Conversely, any real threshold with two nonempty children has a unique gap and induces the same partition as that midpoint. Thus the algorithm's candidate list is finite and contains every nonempty partition produced by one coordinate threshold.
For each candidate the child score is a finite real sum. If the candidate list is nonempty, repeatedly comparing its finite list of scores produces a minimum, and the coordinate/cut-index order selects a unique first minimizer among ties. By [F2], the regression child means attain the least squared error on each child; by [F1], the classification score is the declared weighted impurity. The chosen candidate therefore minimizes the declared child loss over all such partitions.
Every recursive call increases depth by one, and calls at depth stop. Each split creates two disjoint nonempty sample sets from its parent, so every terminal leaf contains at least one of the sample indices. Each split increases the number of leaves by one; hence there are at most splits. The recursion terminates with depth at most and all created children nonempty.
Weakest-link pruning terminates at the root
Statement
Let be a finite empirical binary tree with terminal nodes and nonempty sample set at every leaf. The weakest-link pruning procedure that repeatedly collapses a current nonterminal node minimizing terminates at the root leaf after at most collapses. This is a termination statement only; it does not assert global cost-complexity optimality.
Statement references
Facts & Assumptions
Given: A finite empirical binary tree whose internal nodes each have two nonempty child sample sets.
Empirical axis-aligned binary decision trees: Every internal node splits its sample set into two nonempty child sets, and the terminal sample sets partition the original sample.
Cost-complexity criteria for subtrees: For a current nonterminal node , , where is its current descendant subtree.
Weakest-link pruning of a finite tree: At each iteration the algorithm chooses a current nonterminal node minimizing , collapses its descendant subtree to a leaf, and stops when the current tree is the root leaf.
Proof
If the current tree has more than one leaf, its root is nonterminal. Every nonterminal node has two finite child subtrees. Starting at either child and following descendants must reach a leaf because the tree is finite, so and every denominator in [F2] is positive. The tree has finitely many nonterminal nodes, and every loss in [F2] is a finite real number because the sample and chosen impurity formulas are finite. Hence the candidate quotients form a finite nonempty set of real numbers, which has a minimum by repeated pairwise comparison.
By [F3], the algorithm selects a minimizing candidate, using its fixed tie rule. If that node has descendant leaves, collapsing it replaces those leaves by one, reducing the current leaf count by . The resulting tree is still a finite subtree of .
Starting from leaves, each collapse strictly decreases the positive integer leaf count, so there are at most collapses. If more than one leaf remains, the root is nonterminal and is among the available candidates by step 1.1; therefore the algorithm cannot stop early. A nonterminal root has at least two descendant leaves by step 1.1, so a tree with one leaf is the root leaf.
4 · Examples, counterexamples and false statements
None yet.
Sources
- Trevor Hastie, Robert Tibshirani, and Jerome Friedman, The Elements of Statistical Learning, 2nd ed., §9.2
- MIT OpenCourseWare, 15.097, Lecture 8: Decision trees, slides 14–15
- Trevor Hastie, Robert Tibshirani, and Jerome Friedman, The Elements of Statistical Learning, 2nd ed., §9.2.2
- MIT OpenCourseWare, 15.097, Lecture 8: Decision trees, slide 16
- Trevor Hastie, Robert Tibshirani, and Jerome Friedman, The Elements of Statistical Learning, 2nd ed., §9.2.2–9.2.3
- MIT OpenCourseWare, 15.097, Lecture 8: Decision trees, slides 14 and 16
- MIT OpenCourseWare, 15.097, Lecture 8: Decision trees, slides 14–16