BooleanAnalysis.boolToSign
defimported Lean
The sign encoding maps $\mathrm{Bool}$ to $\{-1,1\}\subset\bbr$: \[ \sigma(b) \;=\; \begin{cases} 1 & b = \texttt{false},\\ -1 & b = \texttt{true}. \end{cases} \]
Statement
set_option maxHeartbeats 400000 in open scoped BigOperators in variable {n : ℕ} in def BooleanAnalysis.boolToSign (b : Bool) : ℝ
- Defined in
- TCSlib, `BooleanAnalysis.boolToSign`
- 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.BooleanAnalysis.boolToSign← BooleanAnalysis.boolToSign (TCSlib/BooleanAnalysis/Basic.lean:142): verbatim
- Verified
- 07 Oct 2026
- Axioms
- none listed
- Used by 34
- 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…
- ArrowTheorem.sum_abPref_bcPrefSum of paired preference signs. Label the six strict orderings of three alternatives $a,b,c$ by $k\in\{0,\dots,5\}$. For each ordering let…
- ArrowTheorem.sum_abPref_caPrefSum of paired preference signs. Label the six strict orderings of three alternatives $a,b,c$ by $k\in\{0,\dots,5\}$. For each ordering let…
- DecisionTree.chiS_symmDiff_singletonSymmetric difference by a singleton toggles a Walsh character. Let $S\subseteq[n]$, let $i\in[n]$, and let $x\in\{0,1\}^n$. Then the…
- 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…
- BooleanAnalysis.chiS_flipBitWalsh character under a single bit flip. Fix a subset $S\subseteq[n]$ of coordinates. For every point $x$ of the Boolean hypercube…
- ArrowTheorem.profile_kernel_genGeneral profile kernel for paired preference assignments. Let $x, y : \mathrm{Fin}\,6 \to \mathrm{Bool}$ be two preference assignments…
- ArrowTheorem.sum_caPref_signVanishing sum of signed $c$-vs-$a$ preferences. For each of the six strict orderings $k\in\{0,1,\dots,5\}$ of three alternatives, let…
- 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…
- DecisionTree.signEval_eq_sum_coeffsWalsh expansion of a decision tree's sign function. Let $T$ be a decision tree on $n$ Boolean variables, computing the $\pm 1$-valued…
- 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…
- BooleanAnalysis.boolToSign_mul_selfSign encoding of false. Under the sign encoding $\sigma\colon\mathrm{Bool}\to\{-1,1\}$, the Boolean value $\mathrm{false}$ is sent to $1$;…
- BooleanAnalysis.dictatorThe dictator function for coordinate $i$ outputs the sign of the $i$-th bit: $\mathrm{dict}_i(x) = (-1)^{x_i}$. Its unique nonzero…
- 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…
- level_one_to_three_witness_gThe second witness function of the three-variable example of arXiv:2611.08289 equation (53): g(x) = -(sigma(x_0) + sigma(x_1) + sigma(x_2)…
- BooleanAnalysis.chiS_singletonValue of a singleton Walsh character. Fix a dimension $n$, a coordinate $i \in [n]$, and a point $x$ of the Boolean hypercube $\{0,1\}^n$.…
- 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…
- BoolFourier.BoolToPM1The map $\mathrm{BoolToPM1} : \mathrm{Bool} \to \mathbb{R}$ sends $\mathtt{false}$ to $1$ and $\mathtt{true}$ to $-1$, realising the…
- DecisionTree.coeffsThe coefficient function $\mathrm{coeffs}\,T : \mathcal{P}(\mathrm{Fin}\,n) \to \bbr$ defined by structural recursion on $T$. A leaf…
- ArrowTheorem.sum_bcPref_signBalanced b-versus-c preferences over the six orderings. Consider the six strict orderings of three alternatives $a$, $b$, and $c$, indexed…
- ArrowTheorem.sum_abPref_signBalance of the a-vs-b preference signs. There are six strict orderings $k \in \{0,1,\dots,5\}$ of the three alternatives $a,b,c$. For each…
- BooleanAnalysis.boolToSign_trueSign encoding of false. Under the sign encoding $\sigma\colon\mathrm{Bool}\to\{-1,1\}$, the Boolean value $\mathrm{false}$ is sent to $1$;…
- BooleanAnalysis.boolToSign_falseSign encoding of false. Under the sign encoding $\sigma\colon\mathrm{Bool}\to\{-1,1\}$, the Boolean value $\mathrm{false}$ is sent to $1$;…
- level_one_to_three_witness_fThe first witness function of the three-variable example of arXiv:2611.08289 equation (53): f(x) = -(sigma(x_0) + sigma(x_1) + sigma(x_2)…
- ArrowTheorem.sum_bcPref_caPrefSum of paired preference signs. Label the six strict orderings of three alternatives $a,b,c$ by $k\in\{0,\dots,5\}$. For each ordering let…
- DecisionTree.signEvalThe $\pm 1$-valued function computed by a decision tree $T$, namely $x \mapsto \mathrm{boolToSign}(T.\mathrm{eval}\,x)$, where…
- BooleanAnalysis.boolToSign_notSign encoding of false. Under the sign encoding $\sigma\colon\mathrm{Bool}\to\{-1,1\}$, the Boolean value $\mathrm{false}$ is sent to $1$;…
- 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…
- BoolFourier.BoolToPM1_xorXOR as multiplication under the $\pm 1$ embedding. Let $\mathrm{BoolToPM1} : \mathrm{Bool} \to \bbr$ be the map sending $\mathtt{false}$…
- BooleanAnalysis.boolToSign_sqSign encoding of false. Under the sign encoding $\sigma\colon\mathrm{Bool}\to\{-1,1\}$, the Boolean value $\mathrm{false}$ is sent to $1$;…
- BoolFourier.fourier_coeff_convolution_aux_h_splitMultiplicative splitting of a Walsh character along XOR. Let $S \subseteq [n]$, let $f, g : \{0,1\}^n \to \bbr$ be Boolean functions, and…
- BooleanAnalysis.chiSThe Walsh--Fourier character associated to $S\subseteq[n]$ is…
Lean source view module on GitHub
set_option maxHeartbeats 400000 in open scoped BigOperators in variable {n : ℕ} in /-- Converts a `Bool` to `{-1, 1} ⊆ ℝ`: `false ↦ 1`, `true ↦ -1`. **Source:** [OD14, §1.1]. -/ def BooleanAnalysis.boolToSign (b : Bool) : ℝ := if b then -1 else 1