CommunicationComplexity.Deterministic.Protocol.sum_indicator_leafRectangles_eq
Indicator sum over leaf rectangles recovers the protocol output. Let $X$ and $Y$ be input types whose product $X \times Y$ carries a finite probability space, and let $p$ be a deterministic Boolean two-party protocol over $X$ (Alice) and $Y$ (Bob). Write $\{R\}$ for the finite collection of leaf rectangles of $p$, and for each such rectangle assign the sign $\varepsilon(R) = +1$ if $p$ outputs $\mathrm{false}$ at every point of $R$ and $\varepsilon(R) = -1$ otherwise. Then for every point $(x,y) \in X \times Y$, \[ \sum_{R} \mathbf{1}_R(x,y)\,\varepsilon(R) \;=\; \begin{cases} 1 & \text{if } p(x,y) = \mathrm{false},\\ -1 & \text{if } p(x,y) = \mathrm{true},\end{cases} \] where $p(x,y)$ denotes the Boolean value returned by running $p$ on inputs $x$ and $y$.
Statement
set_option relaxedAutoImplicit false in set_option autoImplicit false in open MeasureTheory in open scoped BigOperators in variable {X Y : Type*} in open Classical in lemma CommunicationComplexity.Deterministic.Protocol.sum_indicator_leafRectangles_eq [μ : FiniteProbabilitySpace (X × Y)] (p : Protocol X Y Bool) (xy : X × Y) : Finset.sum (leafRectanglesFinset p) (fun R => Set.indicator R (fun _ => rectangleSign p R) xy) = boolSign (p.run xy.1 xy.2)
- Source
- TCSlib, `CommunicationComplexity.Deterministic.Protocol.sum_indicator_leafRectangles_eq`
- 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.sum_indicator_leafRectangles_eq← CommunicationComplexity.Deterministic.Protocol.sum_indicator_leafRectangles_eq (TCSlib/CommunicationComplexity/NewmanTheorem/Discrepancy.lean:210): verbatim
- Verified
- 07 Oct 2026
- Axioms
Classical.choiceQuot.soundpropext- Built on 14
- CommunicationComplexity.Deterministic.Protocol.leafRectangles_isMonoPartitionLeaf rectangles of a protocol form a monochromatic partition. Let $p$ be a deterministic two-party communication protocol over input types…
- CommunicationComplexity.Rectangle.monoPartition_part_uniqueUniqueness of the part containing a point. Let $\mathcal{P}$ be a monochromatic rectangle partition for a function…
- 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.Deterministic.Protocol.mem_leafRectanglesFinsetMembership in the finite set of leaf rectangles. Let $X \times Y$ carry the structure of a finite probability space, let $p$ be a…
- CommunicationComplexity.Deterministic.Protocol.rectangleSign_eq_boolSignRectangle sign equals Boolean sign on leaf rectangles. Let $p$ be a deterministic two-party communication protocol with Boolean output,…
- CommunicationComplexity.boolSign_xorBoolean sign turns XOR into multiplication. Write $\mathrm{sgn} : \mathrm{Bool} \to \bbr$ for the Boolean sign map, which sends…
- CommunicationComplexity.Rectangle.monoPartition_point_memEvery point lies in some part of a partition. Let $g : X \times Y \to \alpha$ and let $\mathcal{P}$ be a monochromatic rectangle partition…
- 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.Deterministic.Protocol.leafRectanglesThe leaf rectangles of a protocol $p : \texttt{Protocol}\,X\,Y\,\alpha$ form the collection…
- CommunicationComplexity.Rectangle.IsMonoPartitionA collection $\mathcal{P}$ of subsets of $X \times Y$ is a monochromatic rectangle partition for $g : X \to Y \to \alpha$ if every…
- Used by 1
- CommunicationComplexity.Deterministic.Protocol.signedBias_eq_sum_rectanglesSigned bias as a sum over leaf rectangles. Let $\mu$ be a finite probability space on $X \times Y$, let $p$ be a deterministic Boolean…
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*} inopen Classical in/-- Summing, over the leaf rectangles `R` of `p`, the indicator of `R` weighted by the rectangle sign of `R` gives the `±1` sign of the protocol's output at every point: the leaf rectangles partition `X × Y`, so exactly one term is nonzero. -/lemma CommunicationComplexity.Deterministic.Protocol.sum_indicator_leafRectangles_eq [μ : FiniteProbabilitySpace (X × Y)] (p : Protocol X Y Bool) (xy : X × Y) : Finset.sum (leafRectanglesFinset p) (fun R => Set.indicator R (fun _ => rectangleSign p R) xy) = boolSign (p.run xy.1 xy.2) := by classical let hPart := leafRectangles_isMonoPartition p p.run rfl obtain ⟨R, hR, hxyR⟩ := Rectangle.monoPartition_point_mem hPart xy have hR' : R ∈ leafRectanglesFinset p := by exact (mem_leafRectanglesFinset p R).2 hR rw [Finset.sum_eq_single_of_mem R hR'] · simp [hxyR, rectangleSign_eq_boolSign p hR hxyR] · intro S hS hSR have hxyS : xy ∉ S := by intro hxyS have hEq := Rectangle.monoPartition_part_unique hPart hR ((mem_leafRectanglesFinset p S).1 hS) hxyR hxyS exact hSR hEq.symm simp [hxyS]