AFTD Auto-Formalizing Theoretical Domains

DecisionTree.degree_le_depth

theoremverifiedimported Lean

Fourier degree of a decision tree is at most its depth. Let $T$ be a decision tree on $n$ Boolean variables, and let $f\colon\{0,1\}^n\to\bbr$ be the $\pm 1$-valued function it computes, so that $f(x)=\sigma(T(x))$ where $\sigma$ sends $\mathrm{false}$ to $1$ and $\mathrm{true}$ to $-1$. Then $f$ has Fourier degree at most the depth of $T$: for every $S\subseteq\{1,\dots,n\}$ with $\hat f(S)\ne 0$, one has $\abs{S}\le\operatorname{depth}(T)$.

Statement

set_option autoImplicit true in
set_option relaxedAutoImplicit true in
open BooleanAnalysis in
variable {n : ℕ} in
theorem DecisionTree.degree_le_depth (T : DecisionTree n) :
    has_degree_at_most T.signEval T.depth
Source
TCSlib, `DecisionTree.degree_le_depth`
Lean proof
By Hydroxyi, Owen McGinty, Seyoon Ragavan (from the file's git history), from github.com/Shilun-Allan-Li/tcslib at c8a02591b1e5 (Apache-2.0). Compiled here against leanprover/lean4:v4.33.1, Mathlib v4.33.1; written for leanprover/lean4:v4.25.0.
Verified
07 Oct 2026
Axioms
Classical.choiceQuot.soundpropext
Built on 6
  • DecisionTree.coeffs_eq_zero_of_depth_ltFourier coefficients vanish above the tree depth. Let $T$ be a decision tree on $n$ Boolean variables, and let…
  • DecisionTree.fourierCoeff_signEvalFourier coefficients of a decision tree. Let $T$ be a decision tree on $n$ Boolean variables, and let $\sigma\!\circ\! T$ denote its…
  • BooleanAnalysis.has_degree_at_mostA Boolean function $f$ has degree at most $k$ if every nonzero Fourier coefficient is supported on a set of size at most $k$: for…
  • DecisionTree.depthThe depth of a decision tree (maximum path length to a leaf): a leaf has depth $0$ and a branch has depth $1$ plus the maximum of its two…
  • DecisionTree.signEvalThe $\pm 1$-valued function computed by a decision tree $T$, namely $x \mapsto \mathrm{boolToSign}(T.\mathrm{eval}\,x)$, where…
  • DecisionTreeA decision tree on $n$ Boolean variables: a leaf $\mathtt{leaf}\,b$ outputs $b$, and a branch $\mathtt{branch}\,i\,lo\,hi$ queries…
Used by 1
  • DecisionTree.degree_le_dtDepthDegree bounded by decision-tree depth. Let $f : \{0,1\}^n \to \{0,1\}$ be a Boolean-valued function, and let $D(f)$ denote its…

Lean source view module on GitHub

set_option autoImplicit true inset_option relaxedAutoImplicit true inopen BooleanAnalysis invariable {n : ℕ} in/-- **Proposition 3.16, degree bound**: a function computed by a decision tree of depth `k` has Fourier degree at most `k`. **Source:** [OD14, Prop. 3.16]. -/theorem DecisionTree.degree_le_depth (T : DecisionTree n) :    has_degree_at_most T.signEval T.depth := by  intro S hS  by_contra hcard  push_neg at hcard  exact hS (by rw [fourierCoeff_signEval]; exact coeffs_eq_zero_of_depth_lt T S hcard)
See it in the graphDiscuss this resultChallenge it