AFTD Auto-Formalizing Theoretical Domains

CommunicationComplexity.Deterministic.FiniteMessage.Protocol.complexity

defimported Lean

The worst-case communication cost of a finite-message protocol, measured in bits. An output node costs $0$; an alice or bob node with message type $\beta$ costs $\lceil \log_2 |\beta| \rceil$ plus the maximum complexity over all continuations, i.e.\ $\lceil \log_2 |\beta| \rceil + \sup_{b \in \beta} \mathrm{complexity}(P\,b)$.

Statement

set_option relaxedAutoImplicit false in
set_option autoImplicit false in
variable {X Y α : Type*} in
def CommunicationComplexity.Deterministic.FiniteMessage.Protocol.complexity : Protocol X Y α → ℕ
Defined in
TCSlib, `CommunicationComplexity.Deterministic.FiniteMessage.Protocol.complexity`
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 20

Lean source view module on GitHub

set_option relaxedAutoImplicit false in
set_option autoImplicit false in
variable {X Y α : Type*} in
/-- The communication complexity of a generalized protocol. Sending a `β`-valued message costs `⌈log₂ |β|⌉` bits, reflecting the number of bits needed to encode an element of `β`. -/
def CommunicationComplexity.Deterministic.FiniteMessage.Protocol.complexity : Protocol X Y α → ℕ
  | Deterministic.FiniteMessage.Protocol.output _ => 0
  | Deterministic.FiniteMessage.Protocol.alice (β := β) _ P =>
      Nat.clog 2 (Fintype.card β) +
        Finset.univ.sup (fun i => (P i).complexity)
  | Deterministic.FiniteMessage.Protocol.bob (β := β) _ P =>
      Nat.clog 2 (Fintype.card β) +
        Finset.univ.sup (fun i => (P i).complexity)
See it in the graphDiscuss this resultChallenge it