CommunicationComplexity.Deterministic.Protocol.run
defimported Lean
Given a protocol $p$, run evaluates $p$ on inputs $x : X$ and $y : Y$ by
recursively following the bit-branching structure until an output node is reached,
returning the stored value of type $\alpha$.
Statement
set_option relaxedAutoImplicit false in set_option autoImplicit false in variable {X Y α : Type*} in def CommunicationComplexity.Deterministic.Protocol.run (p : Protocol X Y α) (x : X) (y : Y) : α
- Defined in
- TCSlib, `CommunicationComplexity.Deterministic.Protocol.run`
- 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.run← CommunicationComplexity.Deterministic.Protocol.run (TCSlib/CommunicationComplexity/DeterministicCC/DetBasic.lean:73): verbatim
- Verified
- 07 Oct 2026
- Axioms
- none listed
- Built on 1
- CommunicationComplexity.Deterministic.ProtocolA deterministic two-party communication protocol over input types $X$ (Alice) and $Y$ (Bob) producing a value of type $\alpha$ is an…
- Used by 33
- CommunicationComplexity.Deterministic.FiniteMessage.Protocol.ofProtocol_runEmbedding preserves protocol output. Let $X$ and $Y$ be the input types of Alice and Bob, let $\alpha$ be an output type, and let $p$ be a…
- 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…
- CommunicationComplexity.Deterministic.Protocol.aux_monoLeaf rectangles are output-monochromatic. Let $p$ be a deterministic communication protocol over input types $X$ (Alice) and $Y$ (Bob)…
- CommunicationComplexity.PrivateCoin.FiniteMessage.Protocol.toProtocol_rrunExecution is preserved under conversion to a binary private-coin protocol. Let $p$ be a private-coin finite-message protocol with…
- CommunicationComplexity.PublicCoin.Protocol.toDeterministic_runFixing the shared randomness agrees with the randomised run. Let $p$ be a public-coin protocol over a randomness space $\Omega$, with…
- CommunicationComplexity.PublicCoin.FiniteMessage.Protocol.exists_good_randomnessExistence of good randomness for derandomization. Let $\Omega$ be a finite probability space and let $X$ and $Y$ be finite input sets. Let…
- 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.signedBias_eq_one_sub_two_distributionalErrorSigned correlation and distributional error. Let $X$ and $Y$ be the input types of Alice and Bob, and let $\mu$ be a finite probability…
- CommunicationComplexity.Deterministic.FiniteMessage.Protocol.toProtocolA noncomputable function that converts a finite-message protocol $p$ into a binary protocol…
- CommunicationComplexity.PublicCoin.FiniteMessage.Protocol.ofProtocol_rrunEmbedding preserves randomized execution. Let $\Omega$ be a shared-randomness space, let $X$ and $Y$ be the private input sets of the two…
- 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.PrivateCoin.FiniteMessage.Protocol.ofProtocol_rrunEmbedding preserves randomized execution of private-coin protocols. The embedding of a binary private-coin protocol into the…
- CommunicationComplexity.PublicCoin.Protocol.rrun_eqRandomized execution as deterministic execution on paired inputs. Let $p$ be a public-coin protocol with shared randomness in $\Omega$,…
- CommunicationComplexity.Deterministic.FiniteMessage.Protocol.toProtocol_runConversion to binary protocol preserves output. Let $p$ be a finite-message deterministic two-party protocol over input types $X$ and $Y$…
- 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.FiniteMessage.Protocol.toProtocol_existsBinary simulation of a finite-message protocol. Let $X$, $Y$, and $\alpha$ be types, and let $p$ be a finite-message two-party protocol…
- 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…
- CommunicationComplexity.Functions.Indexing.le_oneWayCommunicationComplexityOne-way complexity of Index is at least $n$. Every correct deterministic one-way protocol for $\mathrm{IND}_n$ has cost at least $n$; that…
- CommunicationComplexity.Deterministic.FiniteMessage.Protocol.completeTreeAlice_runEvaluation of the complete Alice-query tree. Fix a depth $d \in \bbn$, a family of binary query functions…
- CommunicationComplexity.PrivateCoin.Protocol.rrun_eqRandomized execution as deterministic run on paired inputs. Let $p$ be a private-coin protocol with randomness spaces $\Omega_X$ and…
- CommunicationComplexity.PublicCoin.FiniteMessage.Protocol.toProtocol_rrunBinary conversion preserves randomized execution. Let $p$ be a public-coin finite-message protocol with shared-randomness space $\Omega$,…
- CommunicationComplexity.PrivateCoin.communicationComplexity_le_iff_finiteMessageFinite-message characterization of private-coin complexity. Let $f : X \to Y \to \alpha$ be a function, let $\varepsilon \in \bbr$ be an…
- CommunicationComplexity.Deterministic.Protocol.distributionalErrorGiven a deterministic protocol $p : \mathrm{Protocol}\,X\,Y\,\alpha$, a finite probability space $\mu$ on $X \times Y$, and a target…
- CommunicationComplexity.Deterministic.Protocol.comap_runPull-back commutes with protocol execution. Let $p$ be a deterministic two-party communication protocol with Alice's inputs drawn from $X$…
- CommunicationComplexity.PrivateCoin.Protocol.rrun$\texttt{rrun}\;p\;x\;y\;\omega_x\;\omega_y$ executes the private-coin protocol $p$ on inputs $x \in X$ and $y \in Y$ with Alice's private…
- CommunicationComplexity.Deterministic.Protocol.ComputesA protocol $p$ computes a two-argument function $f : X \to Y \to \alpha$ if $p.\texttt{run}\,x\,y = f\,x\,y$ for all inputs $x : X$…
- CommunicationComplexity.Deterministic.FiniteMessage.Protocol.encode_aliceBinary encoding of a finite-alphabet message from Alice. Let $X$, $Y$, and $\alpha$ be types, let $\beta$ be a finite nonempty type, let…
- CommunicationComplexity.Functions.Equality.communicationComplexity_zeroDeterministic complexity of equality at $n = 0$. Let…
- CommunicationComplexity.PublicCoin.Protocol.rrunGiven a public-coin protocol $p$, private inputs $x \in X$, $y \in Y$, and a shared random string $\omega \in \Omega$,…
- CommunicationComplexity.Deterministic.communicationComplexity_le_of_finiteMessage_protocolUpper bound witnessed by a finite-message protocol. Let $f : X \to Y \to \alpha$ and let $p$ be a finite-message protocol over $X$, $Y$,…
- CommunicationComplexity.Deterministic.Protocol.swap_runRole swap preserves protocol output. Let $p$ be a deterministic two-party communication protocol with Alice's inputs drawn from $X$, Bob's…
- CommunicationComplexity.PublicCoin.newmanNewman's theorem for communication complexity. Let $X$ and $Y$ be finite types, let $f : X \to Y \to \alpha$, and let…
- CommunicationComplexity.Deterministic.FiniteMessage.Protocol.toProtocol_complexityConversion to a binary protocol preserves complexity. Let $p$ be a finite-message deterministic two-party communication protocol over…
Lean source view module on GitHub
set_option relaxedAutoImplicit false in set_option autoImplicit false in variable {X Y α : Type*} in /-- Executes the protocol on inputs `x` and `y`, returning the output value: starting at the root, the owner of the current node evaluates its message function on its own input and both parties descend to the indicated child, until a leaf is reached. [RY20, Ch. 1, Definition (outcome)]. -/ def CommunicationComplexity.Deterministic.Protocol.run (p : Protocol X Y α) (x : X) (y : Y) : α := match p with | .output val => val | .alice f P => (P (f x)).run x y | .bob f P => (P (f y)).run x y