DecisionTree.card_symmDiff_singleton
theoremverifiedimported Lean
Cardinality under singleton symmetric difference. Let $S$ be a finite subset of $\{0,1,\dots,n-1\}$ and let $i$ be one of these indices. Then the symmetric difference $S \triangle \{i\}$ satisfies \[ \abs{S} - 1 \le \abs{S \triangle \{i\}}, \] where $\abs{S} - 1$ denotes truncated subtraction on the natural numbers (so it is $0$ when $S$ is empty).
Statement
variable {n : ℕ} in lemma DecisionTree.card_symmDiff_singleton (S : Finset (Fin n)) (i : Fin n) : S.card - 1 ≤ (symmDiff S {i}).card
- Source
- TCSlib, `DecisionTree.card_symmDiff_singleton`
- 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.card_symmDiff_singleton← DecisionTree.card_symmDiff_singleton (TCSlib/BooleanAnalysis/LMN/DecisionTreeFourier.lean:77): verbatim
- Verified
- 07 Oct 2026
- Axioms
Classical.choiceQuot.soundpropext- Used by 1
- 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…
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.
variable {n : ℕ} inlemma DecisionTree.card_symmDiff_singleton (S : Finset (Fin n)) (i : Fin n) : S.card - 1 ≤ (symmDiff S {i}).card := by by_cases h : i ∈ S · have he : symmDiff S {i} = S.erase i := by ext j by_cases hj : j = i <;> simp [Finset.mem_symmDiff, Finset.mem_erase, hj, h] rw [he, Finset.card_erase_of_mem h] · have he : symmDiff S {i} = insert i S := by ext j by_cases hj : j = i <;> simp [Finset.mem_symmDiff, Finset.mem_insert, hj, h] rw [he, Finset.card_insert_of_notMem h] omega