DecisionTree.degree_le_dtDepth
theoremverifiedformalizationimported Lean
Degree bounded by decision-tree depth. Let $f : \{0,1\}^n \to \{0,1\}$ be a Boolean-valued function, and let $D(f)$ denote its decision-tree depth, the least $d$ for which some decision tree of depth at most $d$ computes $f$. Let $g : \{0,1\}^n \to \bbr$ be its sign encoding, $g(x) = \sigma(f(x))$, where $\sigma$ sends $0$ to $1$ and $1$ to $-1$. Then $g$ has degree at most $D(f)$: every set $S$ with $\hat g(S) \neq 0$ satisfies $\abs{S} \le D(f)$.
Statement
set_option autoImplicit true in set_option relaxedAutoImplicit true in open BooleanAnalysis in variable {n : ℕ} in theorem DecisionTree.degree_le_dtDepth (f : (Fin n → Bool) → Bool) : has_degree_at_most (fun x => boolToSign (f x)) (dtDepth f)
- Formalizes
- Degree bounded by decision-tree depth, as formalized in TCSlib (`DecisionTree.degree_le_dtDepth`)
- 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.DecisionTree.degree_le_dtDepth← DecisionTree.degree_le_dtDepth (TCSlib/BooleanAnalysis/LMN/DecisionTreeFourier.lean:399): verbatim
- Verified
- 07 Oct 2026
- Axioms
Classical.choiceQuot.soundpropext- Built on 14
- BooleanAnalysis.sum_boolToSignSign encoding sums to zero over the Booleans. Let $\sigma\colon\mathrm{Bool}\to\{-1,1\}$ be the sign encoding, sending the value *false*…
- BooleanAnalysis.boolToSignThe sign encoding maps $\mathrm{Bool}$ to $\{-1,1\}\subset\bbr$:…
- dtDepthThe decision-tree depth of $f : (\mathrm{Fin}\,n \to \mathrm{Bool}) \to \mathrm{Bool}$ is the least $d$ such that some decision tree of…
- DecisionTree.degree_le_depthFourier degree of a decision tree is at most its depth. Let $T$ be a decision tree on $n$ Boolean variables, and let…
- BooleanAnalysis.boolToSign_mul_selfSign encoding of false. Under the sign encoding $\sigma\colon\mathrm{Bool}\to\{-1,1\}$, the Boolean value $\mathrm{false}$ is sent to $1$;…
- 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…
- BooleanAnalysis.chiS_singletonValue of a singleton Walsh character. Fix a dimension $n$, a coordinate $i \in [n]$, and a point $x$ of the Boolean hypercube $\{0,1\}^n$.…
- DecisionTree.exists_dtree_of_dtDepthAttainment of the decision-tree depth. For every Boolean function $f : (\mathrm{Fin}\,n \to \mathrm{Bool}) \to \mathrm{Bool}$, there is a…
- BooleanAnalysis.boolToSign_trueSign encoding of false. Under the sign encoding $\sigma\colon\mathrm{Bool}\to\{-1,1\}$, the Boolean value $\mathrm{false}$ is sent to $1$;…
- BooleanAnalysis.boolToSign_falseSign encoding of false. Under the sign encoding $\sigma\colon\mathrm{Bool}\to\{-1,1\}$, the Boolean value $\mathrm{false}$ is sent to $1$;…
- DecisionTree.signEvalThe $\pm 1$-valued function computed by a decision tree $T$, namely $x \mapsto \mathrm{boolToSign}(T.\mathrm{eval}\,x)$, where…
- BooleanAnalysis.boolToSign_notSign encoding of false. Under the sign encoding $\sigma\colon\mathrm{Bool}\to\{-1,1\}$, the Boolean value $\mathrm{false}$ is sent to $1$;…
- BooleanAnalysis.boolToSign_sqSign encoding of false. Under the sign encoding $\sigma\colon\mathrm{Bool}\to\{-1,1\}$, the Boolean value $\mathrm{false}$ is sent to $1$;…
- DecisionTreeA decision tree on $n$ Boolean variables: a leaf $\mathtt{leaf}\,b$ outputs $b$, and a branch $\mathtt{branch}\,i\,lo\,hi$ queries…
Lean source view module on GitHub
Choose a tactic — a marked line — to see the goals Lean had before and after it, as in Lean’s infoview. Step with ← → or j k.
set_option autoImplicit true inset_option relaxedAutoImplicit true inopen BooleanAnalysis invariable {n : ℕ} in/-- **Proposition 3.16 for `dtDepth`**: the ±1-encoding of a Boolean function has Fourier degree at most its minimum decision-tree depth. This is the "DT(f) ≤ k ⇒ deg(f) ≤ k" input to O'Donnell Lemma 4.21. **Source:** [OD14, Prop. 3.16]. -/theorem DecisionTree.degree_le_dtDepth (f : (Fin n → Bool) → Bool) : has_degree_at_most (fun x => boolToSign (f x)) (dtDepth f) := by obtain ⟨T, hdepth, heval⟩ := exists_dtree_of_dtDepth f have hfun : (fun x => boolToSign (f x)) = T.signEval := by funext x rw [signEval, heval x] rw [hfun] intro S hS exact le_trans (degree_le_depth T S hS) hdepth