Documentation

MIPRE.Foundations.CL.Graph

The two-level graph sampler #

The graph may have loops. Its law is uniform on ordered adjacent pairs, so each loop is counted once. This file supplies the semantic CL presentations; compiling their finite graph table into an ambient sampler program is a separate obligation.

@[reducible, inline]
abbrev MIPRE.CL.Graph.Coord (T : Type u_2) :
Type u_2

Four binary blocks: player, vertex/neighbor indicator, vertex.

Equations
Instances For
    def MIPRE.CL.Graph.encode {T : Type u_1} [DecidableEq T] (E : T → T → Prop) [DecidableRel E] (u : T) :
    Bool × T → ZMod 2

    A vertex's one-hot indicator together with its neighbor indicator.

    Equations
    Instances For

      The one-hot half makes the encoding injective, even for an isolated vertex.

      noncomputable def MIPRE.CL.Graph.decode {T : Type u_1} [Fintype T] [DecidableEq T] (E : T → T → Prop) [DecidableRel E] (x : Bool × T → ZMod 2) :

      Decode the finite graph table; malformed blocks have no decoded vertex.

      Equations
      Instances For
        theorem MIPRE.CL.Graph.decode_eq_some_iff {T : Type u_1} [Fintype T] [DecidableEq T] (E : T → T → Prop) [DecidableRel E] (x : Bool × T → ZMod 2) (u : T) :
        decode E x = some u ↔ x = encode E u

        Successful decoding means equality with the whole vertex-and-neighbor encoding.

        def MIPRE.CL.Graph.own {T : Type u_1} [Fintype T] (w : Bool) :

        The first factor consists of the two blocks belonging to one player.

        Equations
        Instances For
          @[simp]
          theorem MIPRE.CL.Graph.mem_own {T : Type u_1} [Fintype T] [DecidableEq T] (w : Bool) (p : Coord T) :
          p ∈ own w ↔ p.1 = w
          noncomputable def MIPRE.CL.Graph.mask {T : Type u_1} [Fintype T] [DecidableEq T] (E : T → T → Prop) [DecidableRel E] (w : Bool) (x : Coord T → ZMod 2) :

          The second stage keeps just the relevant opposite neighbor bit when decoding succeeds.

          Equations
          Instances For
            theorem MIPRE.CL.Graph.mask_subset {T : Type u_1} [Fintype T] [DecidableEq T] (E : T → T → Prop) [DecidableRel E] (w : Bool) (x : Coord T → ZMod 2) :
            mask E w x ⊆ (own w)ᶜ

            The second-stage mask is contained in the complement of the first factor.

            noncomputable def MIPRE.CL.Graph.second {T : Type u_1} [Fintype T] [DecidableEq T] (E : T → T → Prop) [DecidableRel E] (w : Bool) (x : Coord T → ZMod 2) :

            The graph sampler's second-stage linear map, on the entire remaining factor.

            Equations
            Instances For
              noncomputable def MIPRE.CL.Graph.presentation {T : Type u_1} [Fintype T] [DecidableEq T] (E : T → T → Prop) [DecidableRel E] (w : Bool) :
              CLFun (ZMod 2) (Coord T) 2

              The actual two-level CL presentation: own blocks, then one opposite neighbor bit.

              Equations
              • One or more equations did not get rendered due to their size.
              Instances For

                Its two factors partition all four blocks on every prefix, valid or otherwise.

                theorem MIPRE.CL.Graph.mask_proj_own {T : Type u_1} [Fintype T] [DecidableEq T] (E : T → T → Prop) [DecidableRel E] (w : Bool) (z : Coord T → ZMod 2) :
                mask E w ((proj (own w)) z) = mask E w z

                Projecting onto one's own first-stage block does not affect decoding.

                theorem MIPRE.CL.Graph.presentation_eval {T : Type u_1} [Fintype T] [DecidableEq T] (E : T → T → Prop) [DecidableRel E] (w : Bool) (z : Coord T → ZMod 2) :
                (presentation E w).eval z = (proj (own w)) z + (proj (mask E w z)) z

                The semantic output is the own block plus the selected opposite neighbor bit.

                theorem MIPRE.CL.Graph.presentation_eval_own {T : Type u_1} [Fintype T] [DecidableEq T] (E : T → T → Prop) [DecidableRel E] (w : Bool) (z : Coord T → ZMod 2) (p : Bool × T) :
                (presentation E w).eval z (w, p) = z (w, p)

                A player sees its entire own block unchanged.

                theorem MIPRE.CL.Graph.presentation_eval_bit {T : Type u_1} [Fintype T] [DecidableEq T] (E : T → T → Prop) [DecidableRel E] (w : Bool) (z : Coord T → ZMod 2) {u : T} (hu : (fun (p : Bool × T) => z (w, p)) = encode E u) :

                On an encoded first-stage block, the selected opposite neighbor bit is visible unchanged.

                def MIPRE.CL.Graph.localValid {T : Type u_1} [DecidableEq T] (E : T → T → Prop) [DecidableRel E] (w : Bool) (z : Coord T → ZMod 2) :

                The local valid-view predicate, stated on the seed before applying the graph sampler.

                Equations
                Instances For
                  theorem MIPRE.CL.Graph.localValid_output_iff {T : Type u_1} [Fintype T] [DecidableEq T] (E : T → T → Prop) [DecidableRel E] (w : Bool) (z : Coord T → ZMod 2) :

                  Validity can be decided from the local sampled question, with no access to the seed.

                  theorem MIPRE.CL.Graph.opposite_output {T : Type u_1} [Fintype T] [DecidableEq T] (E : T → T → Prop) [DecidableRel E] (w : Bool) (z : Coord T → ZMod 2) :
                  (proj (own w)ᶜ) ((presentation E w).eval z) = (proj (mask E w z)) z

                  The opposite part of the sampled question contains exactly the selected bit.

                  theorem MIPRE.CL.Graph.opposite_output_zero_of_invalid {T : Type u_1} [Fintype T] [DecidableEq T] (E : T → T → Prop) [DecidableRel E] (w : Bool) (z : Coord T → ZMod 2) (h : ¬localValid E w z) :
                  (proj (own w)ᶜ) ((presentation E w).eval z) = 0

                  An invalid local view has zero opposite-neighbor block, as required for PCC detyping.

                  def MIPRE.CL.Graph.pairSeed {T : Type u_1} [DecidableEq T] (E : T → T → Prop) [DecidableRel E] (uv : T × T) :
                  Coord T → ZMod 2

                  A seed encoding a pair of types. Each ordered pair has precisely this one seed.

                  Equations
                  Instances For

                    Encoding an ordered pair is injective.

                    theorem MIPRE.CL.Graph.localValid_both_iff {T : Type u_1} [Fintype T] [DecidableEq T] (E : T → T → Prop) [DecidableRel E] (hE : ∀ (u v : T), E u v → E v u) (z : Coord T → ZMod 2) :
                    localValid E false z ∧ localValid E true z ↔ ∃ (uv : T × T), E uv.1 uv.2 ∧ z = pairSeed E uv

                    Both local valid views are exactly the encodings of adjacent ordered pairs.

                    def MIPRE.CL.Graph.edges {T : Type u_1} [Fintype T] (E : T → T → Prop) [DecidableRel E] :
                    Finset (T × T)

                    Ordered edges; a loop contributes once.

                    Equations
                    Instances For
                      def MIPRE.CL.Graph.validSeeds {T : Type u_1} [Fintype T] [DecidableEq T] (E : T → T → Prop) [DecidableRel E] :
                      Finset (Coord T → ZMod 2)

                      The valid seeds, expressed as an image so their exact number is transparent.

                      Equations
                      Instances For
                        theorem MIPRE.CL.Graph.card_validSeeds {T : Type u_1} [Fintype T] [DecidableEq T] (E : T → T → Prop) [DecidableRel E] :

                        The rejection event has exactly one seed per ordered edge.

                        theorem MIPRE.CL.Graph.mem_validSeeds_iff {T : Type u_1} [Fintype T] [DecidableEq T] (E : T → T → Prop) [DecidableRel E] (hE : ∀ (u v : T), E u v → E v u) (z : Coord T → ZMod 2) :

                        The rejection event is the event that both players have valid local views.

                        theorem MIPRE.CL.Graph.invalid_seed_locally_detected {T : Type u_1} [Fintype T] [DecidableEq T] (E : T → T → Prop) [DecidableRel E] (hE : ∀ (u v : T), E u v → E v u) (z : Coord T → ZMod 2) :

                        On every rejected seed, at least one player recognizes an invalid local question.

                        The four binary blocks have 16 ^ |T| seeds.

                        theorem MIPRE.CL.Graph.sum_validSeeds {T : Type u_1} [Fintype T] [DecidableEq T] {M : Type u_2} [AddCommMonoid M] (E : T → T → Prop) [DecidableRel E] (f : (Coord T → ZMod 2) → M) :
                        ∑ z ∈ validSeeds E, f z = ∑ uv ∈ edges E, f (pairSeed E uv)

                        Uniform averaging on valid seeds is uniform averaging on ordered edges, without multiplicity.

                        noncomputable def MIPRE.CL.Graph.validProbability {T : Type u_1} [Fintype T] [DecidableEq T] (E : T → T → Prop) [DecidableRel E] :

                        The probability of the valid-edge event under the uniform binary seed.

                        Equations
                        Instances For
                          theorem MIPRE.CL.Graph.validProbability_eq {T : Type u_1} [Fintype T] [DecidableEq T] (E : T → T → Prop) [DecidableRel E] :

                          Exact rejection probability, with loops counted once among the ordered edges.

                          A graph with an edge has acceptance probability at least 16 ^ (-|T|).

                          theorem MIPRE.CL.Graph.conditional_average {T : Type u_1} [Fintype T] [DecidableEq T] (E : T → T → Prop) [DecidableRel E] (f : (Coord T → ZMod 2) → ℝ) :
                          (∑ z ∈ validSeeds E, f z) / ↑(validSeeds E).card = (∑ uv ∈ edges E, f (pairSeed E uv)) / ↑(edges E).card

                          Conditioning uniform seeds on acceptance gives the uniform ordered-edge law.