AFTD Auto-Formalizing Theoretical Domains

CommunicationComplexity.Deterministic.FiniteMessage.Protocol.run

defimported Lean

Given a finite-message protocol $p$ and inputs $x : X$, $y : Y$, run executes $p$ recursively: at an alice node it evaluates $f(x)$ and follows the corresponding continuation, at a bob node it evaluates $f(y)$, and at an output node it returns the stored value.

Statement

set_option relaxedAutoImplicit false in
set_option autoImplicit false in
variable {X Y α : Type*} in
def CommunicationComplexity.Deterministic.FiniteMessage.Protocol.run (p : Protocol X Y α) (x : X) (y : Y) : α
Defined in
TCSlib, `CommunicationComplexity.Deterministic.FiniteMessage.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.
Verified
07 Oct 2026
Axioms
none listed
Built on 1
Used by 21

Lean source view module on GitHub

set_option relaxedAutoImplicit false in
set_option autoImplicit false in
variable {X Y α : Type*} in
/-- Executes the generalized protocol on inputs `x` and `y`, returning the output value: the owner of the current node evaluates its message function on its own input and both parties descend to the child indexed by that message, until a leaf is reached. -/
def CommunicationComplexity.Deterministic.FiniteMessage.Protocol.run (p : Protocol X Y α) (x : X) (y : Y) : α :=
  match p with
  | Deterministic.FiniteMessage.Protocol.output val => val
  | Deterministic.FiniteMessage.Protocol.alice f P => (P (f x)).run x y
  | Deterministic.FiniteMessage.Protocol.bob f P => (P (f y)).run x y
See it in the graphDiscuss this resultChallenge it