AFTD Auto-Formalizing Theoretical Domains

BoolBLR.BLR_completeness_aux_h_linear

theoremverifiedimported Lean

Linearity gives additivity on XOR. Let $f : \{0,1\}^n \to \{0,1\}$ be a linear function, meaning that $f(x \oplus y) = f(x) \oplus f(y)$ for all $x, y \in \{0,1\}^n$, where $\oplus$ denotes componentwise XOR. Then for all $x, y \in \{0,1\}^n$ we have $f(x \oplus y) = f(x) \oplus f(y)$.

Statement

open Finset BoolFourier in
lemma BoolBLR.BLR_completeness_aux_h_linear {n : ℕ} (f : BoolFourier.hypercube n → Bool) (hlin : is_linear_bool f) :
    ∀ (x y : BoolFourier.hypercube n), f (BoolFourier.xor_vec x y) = (f x ^^ f y)
Source
TCSlib, `BoolBLR.BLR_completeness_aux_h_linear`
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
none — Lean reports it depends on no axioms
Built on 3
  • BoolBLR.is_linear_boolA function $f : \{0,1\}^n \to \{0,1\}$ is linear if for all $x, y \in \{0,1\}^n$ we have \[ f(x \oplus y) = f(x) \oplus f(y), \]…
  • 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.hypercubeThe Boolean hypercube of dimension $n$ is the type $\{0,1\}^n$, defined as an abbreviation for BooleanAnalysis.BoolCube $n$.
Used by 1
  • BoolBLR.BLR_completenessCompleteness of the BLR linearity test. Let $n$ be a natural number and let $f : \{0,1\}^n \to \{0,1\}$ be linear, meaning that…

Lean source view module on GitHub

open Finset BoolFourier inlemma BoolBLR.BLR_completeness_aux_h_linear {n : ℕ} (f : BoolFourier.hypercube n → Bool) (hlin : is_linear_bool f) :    ∀ (x y : BoolFourier.hypercube n), f (BoolFourier.xor_vec x y) = (f x ^^ f y) :=  by  exact hlin;
See it in the graphDiscuss this resultChallenge it