AFTD Auto-Formalizing Theoretical Domains

CommunicationComplexity.Deterministic.Protocol.swap_swap

theoremverifiedimported Lean

Role swap is an involution. Let $p$ be a deterministic two-party communication protocol with Alice's inputs drawn from a type $X$, Bob's from a type $Y$, and outputs in a type $\alpha$. Applying the role swap twice — first exchanging the roles of Alice and Bob throughout $p$, then exchanging them again — returns the original protocol $p$ unchanged.

Statement

set_option relaxedAutoImplicit false in
set_option autoImplicit false in
variable {X Y α : Type*} in
@[simp]
theorem CommunicationComplexity.Deterministic.Protocol.swap_swap (p : Protocol X Y α) :
    p.swap.swap = p
Source
TCSlib, `CommunicationComplexity.Deterministic.Protocol.swap_swap`
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
Quot.soundpropext
Built on 2
Used by 35

Lean source view module on GitHub

set_option relaxedAutoImplicit false inset_option autoImplicit false invariable {X Y α : Type*} in/-- Swapping Alice and Bob twice returns the original protocol. -/@[simp]theorem CommunicationComplexity.Deterministic.Protocol.swap_swap (p : Protocol X Y α) :    p.swap.swap = p := by  induction p <;> simp [swap, *]
See it in the graphDiscuss this resultChallenge it