A deterministic two-party communication protocol where Alice holds input x : X,
Bob holds input y : Y, and the protocol computes a value of type α.
At each step, either Alice or Bob sends a single bit based on their input,
and the protocol branches accordingly.
- output {X : Type u_1} {Y : Type u_2} {α : Type u_3} (val : α) : Protocol X Y α
- alice {X : Type u_1} {Y : Type u_2} {α : Type u_3} (f : X → Bool) (P : Bool → Protocol X Y α) : Protocol X Y α
- bob {X : Type u_1} {Y : Type u_2} {α : Type u_3} (f : Y → Bool) (P : Bool → Protocol X Y α) : Protocol X Y α
Instances For
Executes the protocol on inputs x and y, returning the output value.
Equations
- (CommunicationComplexity.Deterministic.Protocol.output val).run x y = val
- (CommunicationComplexity.Deterministic.Protocol.alice f P).run x y = (P (f x)).run x y
- (CommunicationComplexity.Deterministic.Protocol.bob f P).run x y = (P (f y)).run x y
Instances For
The communication complexity of a protocol, i.e. the worst-case number of bits exchanged.
Equations
- (CommunicationComplexity.Deterministic.Protocol.output val).complexity = 0
- (CommunicationComplexity.Deterministic.Protocol.alice f P).complexity = 1 + max (P false).complexity (P true).complexity
- (CommunicationComplexity.Deterministic.Protocol.bob f P).complexity = 1 + max (P false).complexity (P true).complexity
Instances For
Swaps the roles of Alice and Bob, producing a protocol on Y × X from one on X × Y.
Alice nodes become bob nodes and vice versa.
Equations
- (CommunicationComplexity.Deterministic.Protocol.output val).swap = CommunicationComplexity.Deterministic.Protocol.output val
- (CommunicationComplexity.Deterministic.Protocol.alice f P).swap = CommunicationComplexity.Deterministic.Protocol.bob f fun (b : Bool) => (P b).swap
- (CommunicationComplexity.Deterministic.Protocol.bob f P).swap = CommunicationComplexity.Deterministic.Protocol.alice f fun (b : Bool) => (P b).swap
Instances For
An alice protocol on X × Y can be converted into a bob protocol on Y × X
with the same run behavior (up to argument swap) and complexity.
Useful for reducing the bob case to the alice case in inductive proofs.
A bob protocol on X × Y can be converted into an alice protocol on Y × X
with the same run behavior (up to argument swap) and complexity.
Useful for reducing the alice case to the bob case in inductive proofs.
Pull back a protocol along functions fX : X' → X and fY : Y' → Y.
The resulting protocol over X' × Y' simulates the original by applying
fX and fY to the inputs before each message function.
Equations
- (CommunicationComplexity.Deterministic.Protocol.output val).comap fX fY = CommunicationComplexity.Deterministic.Protocol.output val
- (CommunicationComplexity.Deterministic.Protocol.alice f P).comap fX fY = CommunicationComplexity.Deterministic.Protocol.alice (f ∘ fX) fun (b : Bool) => (P b).comap fX fY
- (CommunicationComplexity.Deterministic.Protocol.bob f P).comap fX fY = CommunicationComplexity.Deterministic.Protocol.bob (f ∘ fY) fun (b : Bool) => (P b).comap fX fY