Documentation

CommunicationComplexity.Deterministic.Basic

inductive CommunicationComplexity.Deterministic.Protocol (X : Type u_1) (Y : Type u_2) (α : Type u_3) :
Type (max (max u_1 u_2) u_3)

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.

Instances For
    def CommunicationComplexity.Deterministic.Protocol.run {X : Type u_1} {Y : Type u_2} {α : Type u_3} (p : Protocol X Y α) (x : X) (y : Y) :
    α

    Executes the protocol on inputs x and y, returning the output value.

    Equations
    Instances For
      def CommunicationComplexity.Deterministic.Protocol.Equiv {X : Type u_1} {Y : Type u_2} {α : Type u_3} (p q : Protocol X Y α) :

      Two protocols are equivalent if they produce the same output on all inputs.

      Equations
      Instances For
        def CommunicationComplexity.Deterministic.Protocol.Computes {X : Type u_1} {Y : Type u_2} {α : Type u_3} (p : Protocol X Y α) (f : XYα) :

        A protocol computes a function f if it produces f x y on all inputs (x, y).

        Equations
        Instances For
          def CommunicationComplexity.Deterministic.Protocol.swap {X : Type u_1} {Y : Type u_2} {α : Type u_3} :
          Protocol X Y αProtocol Y X α

          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
          Instances For
            @[simp]
            theorem CommunicationComplexity.Deterministic.Protocol.swap_run {X : Type u_1} {Y : Type u_2} {α : Type u_3} (p : Protocol X Y α) (x : X) (y : Y) :
            p.swap.run y x = p.run x y
            @[simp]
            theorem CommunicationComplexity.Deterministic.Protocol.swap_swap {X : Type u_1} {Y : Type u_2} {α : Type u_3} (p : Protocol X Y α) :
            p.swap.swap = p

            Swapping Alice and Bob twice returns the original protocol.

            theorem CommunicationComplexity.Deterministic.Protocol.alice_to_bob {X : Type u_1} {Y : Type u_2} {α : Type u_3} (f : XBool) (P : BoolProtocol X Y α) :
            (q : Protocol Y X α), (∀ (x : X) (y : Y), q.run y x = (alice f P).run x y) q.complexity = (alice f P).complexity

            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.

            theorem CommunicationComplexity.Deterministic.Protocol.bob_to_alice {X : Type u_1} {Y : Type u_2} {α : Type u_3} (f : YBool) (P : BoolProtocol X Y α) :
            (q : Protocol Y X α), (∀ (x : X) (y : Y), q.run y x = (bob f P).run x y) q.complexity = (bob f P).complexity

            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.

            def CommunicationComplexity.Deterministic.Protocol.comap {X : Type u_1} {Y : Type u_2} {α : Type u_3} {X' : Type u_4} {Y' : Type u_5} (p : Protocol X Y α) (fX : X'X) (fY : Y'Y) :
            Protocol X' Y' α

            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
            Instances For
              @[simp]
              theorem CommunicationComplexity.Deterministic.Protocol.comap_run {X : Type u_1} {Y : Type u_2} {α : Type u_3} {X' : Type u_4} {Y' : Type u_5} (p : Protocol X Y α) (fX : X'X) (fY : Y'Y) (x' : X') (y' : Y') :
              (p.comap fX fY).run x' y' = p.run (fX x') (fY y')
              @[simp]
              theorem CommunicationComplexity.Deterministic.Protocol.comap_complexity {X : Type u_1} {Y : Type u_2} {α : Type u_3} {X' : Type u_4} {Y' : Type u_5} (p : Protocol X Y α) (fX : X'X) (fY : Y'Y) :