BoolBLR.linear_bool_iff_character_aux_h_eq_h
theoremverifiedimported Lean
XOR-additivity of a Boolean function that lifts to a character. Let $f : \{0,1\}^n \to \{0,1\}$ be a Boolean-valued function whose $\pm 1$ lift $x \mapsto (-1)^{f(x)}$ coincides with the Walsh character $\chi_S$ for some subset $S \subseteq [n]$. Then for all $x, y \in \{0,1\}^n$, \[ (-1)^{f(x \oplus y)} \;=\; (-1)^{f(x) \oplus f(y)}, \] where $x \oplus y$ denotes the componentwise XOR of $x$ and $y$ and $f(x) \oplus f(y)$ the XOR of the two Boolean outputs.
Statement
set_option autoImplicit true in set_option relaxedAutoImplicit true in open Finset BoolFourier in lemma BoolBLR.linear_bool_iff_character_aux_h_eq_h {n : ℕ} (f : hypercube n → Bool) (S : Finset (Fin n)) (hS : lift_pm1 f = char_S S) (x : hypercube n) (y : hypercube n) : BoolToPM1 (f (xor_vec x y)) = BoolToPM1 (f x ^^ f y)
- Source
- TCSlib, `BoolBLR.linear_bool_iff_character_aux_h_eq_h`
- Lean proof
- By Prastik Mohanraj, from github.com/Shilun-Allan-Li/tcslib at
c8a02591b1e5(Copyright (c) 2026 Prastik Mohanraj. All rights reserved, Apache-2.0). Compiled here against leanprover/lean4:v4.33.1, Mathlib v4.33.1; written for leanprover/lean4:v4.25.0.BoolBLR.linear_bool_iff_character_aux_h_eq_h← BoolBLR.linear_bool_iff_character_aux_h_eq_h (TCSlib/BooleanAnalysis/BLR/BoolBLR.lean:118): verbatim
- Verified
- 07 Oct 2026
- Axioms
Classical.choiceQuot.soundpropext- Built on 7
- BoolFourier.char_SFor a set $S \subseteq [n]$, the Walsh character $\chi_S : \{0,1\}^n \to \mathbb{R}$ is \[ \chi_S(x) = \prod_{i \in S} (-1)^{x_i}, \]…
- BoolFourier.xor_vecFor $x, y \in \{0,1\}^n$, the vector $\mathrm{xor\_vec}(x,y)_i = x_i \oplus y_i$ is the componentwise XOR, giving the group operation on…
- BoolFourier.BoolToPM1The map $\mathrm{BoolToPM1} : \mathrm{Bool} \to \mathbb{R}$ sends $\mathtt{false}$ to $1$ and $\mathtt{true}$ to $-1$, realising the…
- BoolFourier.hypercubeThe Boolean hypercube of dimension $n$ is the type $\{0,1\}^n$, defined as an abbreviation for
BooleanAnalysis.BoolCube$n$. - BoolBLR.linear_bool_iff_character_aux_h_charMultiplicativity of the Walsh characters. Fix $n$ and a subset $S \subseteq [n]$, and let $\chi_S(x) = \prod_{i \in S}(-1)^{x_i}$ be the…
- BoolBLR.lift_pm1Given $f : \{0,1\}^n \to \{0,1\}$, its $\pm 1$ lift $\texttt{BoolBLR.lift\_pm1}\,f : \{0,1\}^n \to \mathbb{R}$ is defined by…
- BoolBLR.linear_bool_iff_character_aux_h_eqXOR-additivity of a Boolean function whose lift is a character. Let $f : \{0,1\}^n \to \{0,1\}$ be a Boolean-valued function whose $\pm 1$…
- Used by 1
- BoolBLR.linear_bool_iff_characterLinear Boolean functions are exactly the Walsh characters. Let $f : \{0,1\}^n \to \{0,1\}$ be a Boolean function. Then $f$ is linear —…
Lean source view module on GitHub
set_option autoImplicit true in set_option relaxedAutoImplicit true in open Finset BoolFourier in lemma BoolBLR.linear_bool_iff_character_aux_h_eq_h {n : ℕ} (f : hypercube n → Bool) (S : Finset (Fin n)) (hS : lift_pm1 f = char_S S) (x : hypercube n) (y : hypercube n) : BoolToPM1 (f (xor_vec x y)) = BoolToPM1 (f x ^^ f y) := (linear_bool_iff_character_aux_h_eq f S hS x y (linear_bool_iff_character_aux_h_char S x y))