AFTD Auto-Formalizing Theoretical Domains

BoolBLR.linear_bool_iff_character_aux_h_eq

theoremverifiedimported Lean

XOR-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$ lift coincides with a Walsh character, say $x \mapsto (-1)^{f(x)}$ equals $\chi_S$ for some $S \subseteq [n]$, and fix points $x, y \in \{0,1\}^n$. If the character is multiplicative at this pair, meaning $\chi_S(x \oplus y) = \chi_S(x)\,\chi_S(y)$ where $x \oplus y$ denotes the componentwise XOR, then \[ (-1)^{f(x \oplus y)} \;=\; (-1)^{f(x) \oplus f(y)}. \]

Statement

set_option autoImplicit true in
set_option relaxedAutoImplicit true in
open Finset BoolFourier in
lemma BoolBLR.linear_bool_iff_character_aux_h_eq {n : ℕ} (f : BoolFourier.hypercube n → Bool) (S : Finset (Fin n)) (hS : lift_pm1 f = BoolFourier.char_S S) (x : BoolFourier.hypercube n) (y : BoolFourier.hypercube n) (h_char : BoolFourier.char_S S (BoolFourier.xor_vec x y) = BoolFourier.char_S S x * BoolFourier.char_S S y) :
    BoolFourier.BoolToPM1 (f (BoolFourier.xor_vec x y)) = BoolFourier.BoolToPM1 (f x ^^ f y)
Source
TCSlib, `BoolBLR.linear_bool_iff_character_aux_h_eq`
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.
Verified
07 Oct 2026
Axioms
Classical.choiceQuot.soundpropext
Built on 6
  • 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$.
  • BoolFourier.BoolToPM1_xorXOR as multiplication under the $\pm 1$ embedding. Let $\mathrm{BoolToPM1} : \mathrm{Bool} \to \bbr$ be the map sending $\mathtt{false}$…
  • 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…
Used by 1

Lean source view module on GitHub

set_option autoImplicit true inset_option relaxedAutoImplicit true inopen Finset BoolFourier inlemma BoolBLR.linear_bool_iff_character_aux_h_eq {n : ℕ} (f : BoolFourier.hypercube n → Bool) (S : Finset (Fin n)) (hS : lift_pm1 f = BoolFourier.char_S S) (x : BoolFourier.hypercube n) (y : BoolFourier.hypercube n) (h_char : BoolFourier.char_S S (BoolFourier.xor_vec x y) = BoolFourier.char_S S x * BoolFourier.char_S S y) :    BoolFourier.BoolToPM1 (f (BoolFourier.xor_vec x y)) = BoolFourier.BoolToPM1 (f x ^^ f y) :=  by  unfold lift_pm1 at hS;  rw [congr_fun hS (xor_vec x y), h_char, ← congr_fun hS x, ← congr_fun hS y, ← BoolToPM1_xor]
See it in the graphDiscuss this resultChallenge it