AFTD Auto-Formalizing Theoretical Domains

CommunicationComplexity.Deterministic.Protocol.swap_run

theoremverifiedimported Lean

Role swap preserves protocol output. Let $p$ be a deterministic two-party communication protocol with Alice's inputs drawn from $X$, Bob's inputs drawn from $Y$, and outputs in $\alpha$, and let $x : X$ and $y : Y$ be inputs. Then executing the role-swapped protocol on the input pair $(y, x)$ returns the same value as executing $p$ on $(x, y)$.

Statement

set_option relaxedAutoImplicit false in
set_option autoImplicit false in
variable {X Y α : Type*} in
@[simp]
theorem CommunicationComplexity.Deterministic.Protocol.swap_run (p : Protocol X Y α) (x : X) (y : Y) :
    p.swap.run y x = p.run x y
Source
TCSlib, `CommunicationComplexity.Deterministic.Protocol.swap_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
propext
Built on 3
Used by 36

Lean source view module on GitHub

set_option relaxedAutoImplicit false inset_option autoImplicit false invariable {X Y α : Type*} in/-- Running the swapped protocol on `(y, x)` gives the same output as running the original protocol on `(x, y)`. -/@[simp]theorem CommunicationComplexity.Deterministic.Protocol.swap_run (p : Protocol X Y α) (x : X) (y : Y) :    p.swap.run y x = p.run x y := by  induction p <;> simp [swap, run, *]
See it in the graphDiscuss this resultChallenge it