CommunicationComplexity.Deterministic.Protocol.signedBias_eq_sum_rectangles
Signed bias as a sum over leaf rectangles. Let $\mu$ be a finite probability space on $X \times Y$, let $p$ be a deterministic Boolean communication protocol with input types $X$ and $Y$, and let $g : X \to Y \to \mathrm{Bool}$. Writing $\sigma$ for the sign map sending $\mathrm{false}$ to $1$ and $\mathrm{true}$ to $-1$, the signed bias of $p$ against $g$ satisfies \[ \E_{(x,y)\sim\mu}\bigl[\sigma\bigl(p(x,y)\bigr)\cdot\sigma\bigl(g(x,y)\bigr)\bigr] \;=\; \sum_{R}\; s(p,R)\,\cdot\,\mathrm{disc}_\mu(g,R), \] where the sum runs over the (finitely many) leaf rectangles $R$ of $p$, the value $p(x,y)$ is the output of $p$ on inputs $x$ and $y$, the rectangle sign $s(p,R)$ equals $+1$ if $p$ outputs $\mathrm{false}$ at every point of $R$ and $-1$ otherwise, and $\mathrm{disc}_\mu(g,R) = \E_{(x,y)\sim\mu}[\mathbf{1}_R(x,y)\cdot\sigma(g(x,y))]$ is the discrepancy of $g$ on $R$.
Statement
set_option relaxedAutoImplicit false in set_option autoImplicit false in open MeasureTheory in open scoped BigOperators in variable {X Y : Type*} in lemma CommunicationComplexity.Deterministic.Protocol.signedBias_eq_sum_rectangles [μ : FiniteProbabilitySpace (X × Y)] (p : Protocol X Y Bool) (g : X → Y → Bool) : ∫ xy : X × Y, boolSign (p.run xy.1 xy.2) * boolSign (g xy.1 xy.2) = Finset.sum (leafRectanglesFinset p) (fun R => rectangleSign p R * discrepancy g R)
- Source
- TCSlib, `CommunicationComplexity.Deterministic.Protocol.signedBias_eq_sum_rectangles`
- Lean proof
- By Lucy Horowitz, Timothe Kasriel, Mihir Singhal, from github.com/Shilun-Allan-Li/tcslib at
c8a02591b1e5(Copyright (c) 2026 Lucy Horowitz, Timothe Kasriel, and Mihir Singhal. 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.CommunicationComplexity.Deterministic.Protocol.signedBias_eq_sum_rectangles← CommunicationComplexity.Deterministic.Protocol.signedBias_eq_sum_rectangles (TCSlib/CommunicationComplexity/NewmanTheorem/Discrepancy.lean:272): verbatim
- Verified
- 07 Oct 2026
- Axioms
Classical.choiceQuot.soundpropext- Built on 10
- CommunicationComplexity.Deterministic.Protocol.rectangleSignFor a deterministic Boolean protocol $p$ and a set $R \subseteq X \times Y$, the rectangle sign is $+1$ if the protocol outputs…
- CommunicationComplexity.boolSign_xorBoolean sign turns XOR into multiplication. Write $\mathrm{sgn} : \mathrm{Bool} \to \bbr$ for the Boolean sign map, which sends…
- CommunicationComplexity.discrepancyLet $\mu$ be a finite probability space on $X \times Y$, let $g : X \to Y \to \mathrm{Bool}$, and let $S \subseteq X \times Y$. The…
- CommunicationComplexity.Deterministic.Protocol.sum_indicator_leafRectangles_eqIndicator sum over leaf rectangles recovers the protocol output. Let $X$ and $Y$ be input types whose product $X \times Y$ carries a…
- CommunicationComplexity.Deterministic.Protocol.leafRectanglesFinsetGiven a finite probability space $\mu$ on $X \times Y$ and a deterministic protocol $p$, this is the canonical
Finsetenumerating… - CommunicationComplexity.Deterministic.ProtocolA deterministic two-party communication protocol over input types $X$ (Alice) and $Y$ (Bob) producing a value of type $\alpha$ is an…
- CommunicationComplexity.boolSign$\texttt{boolSign} : \mathrm{Bool} \to \mathbb{R}$ assigns the real value $1$ to $\mathrm{false}$ and $-1$ to $\mathrm{true}$, embedding…
- CommunicationComplexity.Deterministic.Protocol.runGiven a protocol $p$,
runevaluates $p$ on inputs $x : X$ and $y : Y$ by recursively following the bit-branching structure until… - CommunicationComplexity.FiniteProbabilitySpaceA typeclass bundling a
MeasureSpacestructure on $\Omega$ together with aCommunicationComplexity.FiniteMeasureSpace… - CommunicationComplexity.FiniteMeasureSpaceA typeclass for a measurable space $\Omega$ that is simultaneously finite (carries a
Fintypeinstance) and discrete (every subset…
- Used by 1
- CommunicationComplexity.Deterministic.Protocol.one_sub_two_distributionalError_le_two_pow_mulDiscrepancy lower bound on distributional error. Let $\mu$ be a finite probability measure on $X \times Y$, let…
Lean source view module on GitHub
Choose a tactic — a marked line — to see the goals Lean had before and after it, as in Lean’s infoview. Step with ← → or j k.
set_option relaxedAutoImplicit false inset_option autoImplicit false inopen MeasureTheory inopen scoped BigOperators invariable {X Y : Type*} in/-- The signed bias of `p` with `g` equals the sum, over the leaf rectangles `R` of `p`, of the rectangle sign of `R` times the discrepancy of `g` on `R`. **Proof sketch.** Pointwise, replace the sign of the protocol's output by the sum of signed rectangle indicators (`sum_indicator_leafRectangles_eq`) and distribute the sign of `g` over the sum. Then exchange the finite sum with the integral and identify each term with `rectangleSign p R` times the integral defining `discrepancy g R`. -/lemma CommunicationComplexity.Deterministic.Protocol.signedBias_eq_sum_rectangles [μ : FiniteProbabilitySpace (X × Y)] (p : Protocol X Y Bool) (g : X → Y → Bool) : ∫ xy : X × Y, boolSign (p.run xy.1 xy.2) * boolSign (g xy.1 xy.2) = Finset.sum (leafRectanglesFinset p) (fun R => rectangleSign p R * discrepancy g R) := by classical have hpoint : (fun xy : X × Y => boolSign (p.run xy.1 xy.2) * boolSign (g xy.1 xy.2)) = fun xy : X × Y => Finset.sum (leafRectanglesFinset p) (fun R => Set.indicator R (fun _ => rectangleSign p R) xy * boolSign (g xy.1 xy.2)) := by ext xy calc boolSign (p.run xy.1 xy.2) * boolSign (g xy.1 xy.2) = (Finset.sum (leafRectanglesFinset p) (fun R => Set.indicator R (fun _ => rectangleSign p R) xy)) * boolSign (g xy.1 xy.2) := by rw [sum_indicator_leafRectangles_eq p xy] _ = Finset.sum (leafRectanglesFinset p) (fun R => Set.indicator R (fun _ => rectangleSign p R) xy * boolSign (g xy.1 xy.2)) := by rw [Finset.sum_mul] rw [hpoint, MeasureTheory.integral_finset_sum] · refine Finset.sum_congr rfl ?_ intro R hR have hterm : (fun xy : X × Y => Set.indicator R (fun _ => rectangleSign p R) xy * boolSign (g xy.1 xy.2)) = fun xy : X × Y => rectangleSign p R * ((if xy ∈ R then (1 : ℝ) else 0) * boolSign (g xy.1 xy.2)) := by ext xy by_cases hxy : xy ∈ R <;> simp [hxy, mul_comm] rw [hterm, MeasureTheory.integral_const_mul, discrepancy] · intro R hR exact Integrable.of_finite