AFTD Auto-Formalizing Theoretical Domains

BooleanAnalysis.boolToSign_mul_self

theoremverifiedimported Lean

Sign encoding of false. Under the sign encoding $\sigma\colon\mathrm{Bool}\to\{-1,1\}$, the Boolean value $\mathrm{false}$ is sent to $1$; that is, $\sigma(\mathrm{false}) = 1$. Under the sign encoding $\sigma\colon \mathrm{Bool}\to\{-1,1\}$, which sends the truth value false to $1$ and true to $-1$, the truth value true is mapped to $-1$; that is, $\sigma(\text{true}) = -1$. For every Boolean value $b$, the sign encoding satisfies $\sigma(b)^2 = 1$. For every $b \in \mathrm{Bool}$, the sign encoding $\sigma(b) \in \{-1,1\}$ satisfies $\sigma(b)\cdot\sigma(b) = 1$; that is, $\sigma(b)^2 = 1$. Let $\sigma\colon\mathrm{Bool}\to\{-1,1\}$ be the sign encoding, so that $\sigma(\mathrm{false})=1$ and $\sigma(\mathrm{true})=-1$. Then for every Boolean value $b$, negating $b$ flips the sign of its encoding: \[ \sigma(\lnot b) \;=\; -\,\sigma(b). \]

Statement

set_option maxHeartbeats 400000 in
open scoped BigOperators in
variable {n : ℕ} in
@[simp]
lemma BooleanAnalysis.boolToSign_mul_self (b : Bool) : boolToSign b * boolToSign b = 1
Source
TCSlib, `BooleanAnalysis.boolToSign_mul_self`
Lean proof
By Jingzhen Sha, Allan Li, Hydroxyi, Mina, Owen McGinty (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.
Verified
07 Oct 2026
Axioms
Classical.choiceQuot.soundpropext
Built on 1
Used by 16
  • BoolBLR.fourier_coeff_le_of_far_from_linearFourier coefficient bound for functions far from linear. Let $f : \{0,1\}^n \to \{0,1\}$ be $\varepsilon$-far from linear, meaning that…
  • BoolFourier.BoolToPM1_sqSquare of the Bool-to-$\pm 1$ embedding. For every Boolean value $b$, the image $\mathrm{BoolToPM1}(b)$ under the map sending…
  • 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.chiS_mul_chiSWalsh characters multiply by symmetric difference. Fix $n$, and for a subset $S\subseteq[n]$ let $\chi_S\colon\{0,1\}^n\to\bbr$ denote the…
  • BoolBLR.BLR_accept_prob_pm1_aux_h_eqPointwise $\pm 1$ form of the BLR indicator. Fix $n \in \bbn$ and a Boolean-valued function $f : \{0,1\}^n \to \{0,1\}$, and let…
  • BooleanAnalysis.sum_chiS_mul_eqCompleteness kernel for the Walsh basis. Let $x, y \in \{0,1\}^n$ be points of the Boolean hypercube. Then the sum of the products of…
  • ArrowTheorem.degree_one_implies_dictatorDegree-one unanimous voting rules are dictatorships. Let $f:\{0,1\}^n\to\bbr$ be a Boolean function that is odd, is $\pm 1$-valued, and is…
  • BooleanAnalysis.sum_chiSSum of a Walsh character over the cube. Let $n$ be a natural number and let $S \subseteq [n]$. Summing the Walsh--Fourier character…
  • BoolBLR.BLR_soundness_via_fourierSum of cubed Fourier coefficients bounds distance to linearity. Let $f : \{0,1\}^n \to \{0,1\}$ be a Boolean function and let…
  • BoolBLR.fourier_coeff_le_of_dist_ge_aux_h_lift_pm1Product of $\pm 1$ lifts as a disagreement indicator. Let $f, g : \{0,1\}^n \to \{0,1\}$ be Boolean-valued functions on the hypercube, and…
  • BoolBLR.fourier_coeff_le_of_dist_geFourier coefficient bound from distance. Let $f,g:\{0,1\}^n\to\{0,1\}$ be Boolean-valued functions, let $S\subseteq[n]$, and let…
  • BoolBLR.BLR_soundnessSoundness of the BLR linearity test. Let $f : \{0,1\}^n \to \{0,1\}$ and let $\varepsilon \in \bbr$ satisfy $0 \le \varepsilon \le 1$.…
  • BoolBLR.BLR_soundness_via_fourier_aux_h_boundPer-coefficient cube bound for functions far from linear. Let $f : \{0,1\}^n \to \{0,1\}$ be $\varepsilon$-far from linear, meaning that…
  • DecisionTree.degree_le_dtDepthDegree bounded by decision-tree depth. Let $f : \{0,1\}^n \to \{0,1\}$ be a Boolean-valued function, and let $D(f)$ denote its…
  • KKL.lowDegreePart_depends_on_influentialLow-degree part is close to a junta on the influential coordinates. Let $f:\{0,1\}^n\to\bbr$ be a Boolean function, let $k$ be a natural…
  • Bonami.degree_zero_constDegree-zero Boolean functions are constant. Let $f:\{0,1\}^n\to\bbr$ be a Boolean function of degree at most $0$; that is, every set $S$…

Lean source view module on GitHub

set_option maxHeartbeats 400000 inopen scoped BigOperators invariable {n : ℕ} in@[simp]lemma BooleanAnalysis.boolToSign_mul_self (b : Bool) : boolToSign b * boolToSign b = 1 := by  cases b <;> simp [boolToSign]
See it in the graphDiscuss this resultChallenge it