Samplers #
Blueprint def:sampler (paper linear.tex, Definition def:sampler; ledger node 1.1.3
with def:normal-verifier). A sampler is the half of a normal form verifier that produces the
questions: a program of the ambient model (MIPRE.Cost) that, on an index n, presents two
conditionally linear functions L^๐ , L^๐ก on ๐ฝโ^{s(n)} โ one per player โ through a fixed
query interface, so that the question distribution of the game at index n is the CL
distribution (L^๐ x, L^๐ก x), x uniform. The interface is what every transformation of the
pipeline (introspection, oracularization, answer reduction) is written against, which is why the
blueprint fixes it once and for all. It is the paper's, restricted to field size 2 as the
blueprint's normal form verifiers are:
(n, dimension) โฆ s(n);(n, w, marginal, j, z) โฆ L^w_{โค j}(z), thej-th marginal (CLFun.truncate);(n, w, linear, j, u, y) โฆ L^w_{j,u}(y), thej-th linear map with prefixu(CLFun.mapOfPrefix);(n, w, factor, j, u) โฆ V^w_{j,u}, thej-th factor space with prefixu, as an indicator vector (CLFun.factorOfPrefix),
for 1 โค j โค โ, z, y of length s(n), and โ for the last two โ u in the image of
L^w_{< j}, exactly as the paper quantifies (CLFun.SupportedOn.factorOfPrefix_eval is what
makes the answers well defined there). The sampler must moreover halt on every input of the
form (n, โฆ); the paper's bounded format checks are what make its running time on index n,
the supremum over all such inputs, finite. Sampler.TimeBoundAt n T k is that supremum
bounded by T, read as halting within cost T ยท (|d| + 1)^k on every input (n, d): the
ambient model has no cursor into its input, and a bound uniform over all inputs is not
satisfiable by any program that walks a list of unbounded length (see the module docstring of
MIPRE.Foundations.Verifier, which also says why the degree k is needed).
Vectors and register subspaces of ๐ฝโ^s travel as bit strings of length s (toBits,
ofBits, indicatorBits); the paper's binary representation over ๐ฝ_{2^k} through a
self-dual basis is not needed at field size 2.
The CL functions of a sampler are required to be exactly on the whole space
(CLFun.ExactlyOn): their factor spaces partition the coordinates, item (2) of lem:cl-kth,
which the paper's definition demands of them.
Conventions #
The input of the program is the one value encode (n, q) for q : Sampler.Query, with a query
encoded as the tuple (kind, w, j, u, y), missing arguments empty (Sampler.Query.toTuple).
Players are MIPRE.Player, Alice first.
The two players of a nonlocal game.
Instances For
Players as bits: Alice is false, Bob is true.
Equations
Instances For
The player of a bit.
Instances For
Equations
- One or more equations did not get rendered due to their size.
The binary field ๐ฝโ: the field size of every sampler of a normal form verifier (blueprint
def:sampler).
Equations
Instances For
Vectors of ๐ฝโ^s as bit strings #
The bit string of a vector in ๐ฝโ^s: its list of coordinates.
Instances For
The vector in ๐ฝโ^s read off a bit string; missing bits read as 0, bits beyond s are
ignored.
Instances For
The indicator bit string of a set of coordinates: the paper's representation of a register
subspace of ๐ฝโ^s as a vector in {0,1}^s.
Instances For
The query interface #
The queries a sampler answers (def:sampler): the paper's 6-input Turing machine, whose
inputs after the index n are a player label w, a query kind, a level j and up to two
vectors.
- dimension : Query
(n, dimension): the dimensions(n). - marginal
(w : Player)
(j : โ)
(z : Cost.BitStr)
: Query
(n, w, marginal, j, z): thej-th marginalL^w_{โค j}(z). - linear
(w : Player)
(j : โ)
(u y : Cost.BitStr)
: Query
(n, w, linear, j, u, y): thej-th linear map with prefixu, applied toy. - factor
(w : Player)
(j : โ)
(u : Cost.BitStr)
: Query
(n, w, factor, j, u): thej-th factor space with prefixu, as an indicator vector.
Instances For
Equations
- One or more equations did not get rendered due to their size.
- MIPRE.CL.Sampler.instDecidableEqQuery.decEq MIPRE.CL.Sampler.Query.dimension MIPRE.CL.Sampler.Query.dimension = isTrue โฏ
- MIPRE.CL.Sampler.instDecidableEqQuery.decEq MIPRE.CL.Sampler.Query.dimension (MIPRE.CL.Sampler.Query.marginal w j z) = isFalse โฏ
- MIPRE.CL.Sampler.instDecidableEqQuery.decEq MIPRE.CL.Sampler.Query.dimension (MIPRE.CL.Sampler.Query.linear w j u y) = isFalse โฏ
- MIPRE.CL.Sampler.instDecidableEqQuery.decEq MIPRE.CL.Sampler.Query.dimension (MIPRE.CL.Sampler.Query.factor w j u) = isFalse โฏ
- MIPRE.CL.Sampler.instDecidableEqQuery.decEq (MIPRE.CL.Sampler.Query.marginal w j z) MIPRE.CL.Sampler.Query.dimension = isFalse โฏ
- MIPRE.CL.Sampler.instDecidableEqQuery.decEq (MIPRE.CL.Sampler.Query.marginal w j z) (MIPRE.CL.Sampler.Query.linear w_1 j_1 u y) = isFalse โฏ
- MIPRE.CL.Sampler.instDecidableEqQuery.decEq (MIPRE.CL.Sampler.Query.marginal w j z) (MIPRE.CL.Sampler.Query.factor w_1 j_1 u) = isFalse โฏ
- MIPRE.CL.Sampler.instDecidableEqQuery.decEq (MIPRE.CL.Sampler.Query.linear w j u y) MIPRE.CL.Sampler.Query.dimension = isFalse โฏ
- MIPRE.CL.Sampler.instDecidableEqQuery.decEq (MIPRE.CL.Sampler.Query.linear w j u y) (MIPRE.CL.Sampler.Query.marginal w_1 j_1 z) = isFalse โฏ
- MIPRE.CL.Sampler.instDecidableEqQuery.decEq (MIPRE.CL.Sampler.Query.linear w j u y) (MIPRE.CL.Sampler.Query.factor w_1 j_1 u_1) = isFalse โฏ
- MIPRE.CL.Sampler.instDecidableEqQuery.decEq (MIPRE.CL.Sampler.Query.factor w j u) MIPRE.CL.Sampler.Query.dimension = isFalse โฏ
- MIPRE.CL.Sampler.instDecidableEqQuery.decEq (MIPRE.CL.Sampler.Query.factor w j u) (MIPRE.CL.Sampler.Query.marginal w_1 j_1 z) = isFalse โฏ
- MIPRE.CL.Sampler.instDecidableEqQuery.decEq (MIPRE.CL.Sampler.Query.factor w j u) (MIPRE.CL.Sampler.Query.linear w_1 j_1 u_1 y) = isFalse โฏ
Instances For
A query as the tuple (kind, w, j, u, y), missing arguments empty.
Equations
Instances For
Reading a query back from its tuple.
Equations
- MIPRE.CL.Sampler.Query.ofTuple (0, fst, fst_1, fst_2, snd) = some MIPRE.CL.Sampler.Query.dimension
- MIPRE.CL.Sampler.Query.ofTuple (1, w, j, z, snd) = some (MIPRE.CL.Sampler.Query.marginal w j z)
- MIPRE.CL.Sampler.Query.ofTuple (2, w, j, u, y) = some (MIPRE.CL.Sampler.Query.linear w j u y)
- MIPRE.CL.Sampler.Query.ofTuple (3, w, j, u, snd) = some (MIPRE.CL.Sampler.Query.factor w j u)
- MIPRE.CL.Sampler.Query.ofTuple xโ = none
Instances For
Queries are data: their tuple, encoded.
Equations
- One or more equations did not get rendered due to their size.
Blueprint def:sampler: an โ-level sampler (field size 2). A program of the ambient
model which, on index n, presents an โ-level CL function on ๐ฝโ^{s(n)} for each player
through the query interface โ dimension, marginals, stage maps and factor spaces (the data of
lem:cl-kth) โ and halts on every input of the form (n, โฆ). The correctness clauses are
imposed exactly where the paper imposes them: well-formed vectors, levels 1 โค j โค โ, and
prefixes u in the image of L^w_{< j}.
- prog : Cost.Prog
The program; its one input is
encode (n, q)for an indexnand a queryq. - closed : Cost.Prog.WellScoped 1 self.prog
The program is closed.
The dimension
s(n)of the ambient space๐ฝโ^{s(n)}on indexn.The CL functions of the sampler on index
n, one per player.Each is exactly on the whole space: its factor spaces partition the coordinates (item (2) of
lem:cl-kth).- runs_dimension (n : โ) : โ (t : โ), self.prog.Runs (Cost.encode (n, Query.dimension)) (Cost.encode (self.dim n)) t
(n, dimension) โฆ s(n). - runs_marginal (n : โ) (w : Player) (j : โ) (z : Cost.BitStr) : 1 โค j โ j โค โ โ List.length z = self.dim n โ โ (t : โ), self.prog.Runs (Cost.encode (n, Query.marginal w j z)) (Cost.encode (toBits ((CLFun.truncate j (self.cl n w)).eval (ofBits (self.dim n) z)))) t
(n, w, marginal, j, z) โฆ L^w_{โค j}(z), for1 โค j โค โandzof lengths(n). - runs_linear (n : โ) (w : Player) (j : โ) (u y : Cost.BitStr) : 1 โค j โ j โค โ โ (โ (x : Fin (self.dim n) โ ๐ฝโ), u = toBits ((CLFun.truncate (j - 1) (self.cl n w)).eval x)) โ List.length y = self.dim n โ โ (t : โ), self.prog.Runs (Cost.encode (n, Query.linear w j u y)) (Cost.encode (toBits (((self.cl n w).mapOfPrefix (j - 1) (ofBits (self.dim n) u)) (ofBits (self.dim n) y)))) t
(n, w, linear, j, u, y) โฆ L^w_{j,u}(y), for1 โค j โค โ,uin the image ofL^w_{< j}andyof lengths(n). - runs_factor (n : โ) (w : Player) (j : โ) (u : Cost.BitStr) : 1 โค j โ j โค โ โ (โ (x : Fin (self.dim n) โ ๐ฝโ), u = toBits ((CLFun.truncate (j - 1) (self.cl n w)).eval x)) โ โ (t : โ), self.prog.Runs (Cost.encode (n, Query.factor w j u)) (Cost.encode (indicatorBits ((self.cl n w).factorOfPrefix (j - 1) (ofBits (self.dim n) u)))) t
(n, w, factor, j, u) โฆ V^w_{j,u}as an indicator vector, for1 โค j โค โanduin the image ofL^w_{< j}. The sampler halts on every input of the form
(n, โฆ), well formed or not.
Instances For
TIME_๐ฎ(n) โค T: the sampler halts within cost T ยท (|d| + 1)^k on every input (n, d),
well formed or not โ the supremum of def:sampler at index n, bounded by a polynomial in
the size of the input with coefficient T and degree k.
Equations
- S.TimeBoundAt n T k = โ (d : MIPRE.Cost.Data), MIPRE.Cost.HaltsWithin S.prog ((MIPRE.Cost.encode n).cons d) (T * (d.size + 1) ^ k)
Instances For
The bound is monotone in both parameters.
The paper's s(n) โค TIME_๐ฎ(n) (a marginal query writes s(n) output cells) does not
follow from TimeBoundAt, whose bound grows with the input โ the query carrying a vector of
length s(n) is itself of size about 3 s(n). Where the pipeline needs it, it is a clause of
Verifier.IsBounded.
The distribution of the sampler on index n (paper def:sampler-sample): the CL
distribution of its two CL functions, (L^๐ x, L^๐ก x) for x uniform in ๐ฝโ^{s(n)}.
Equations
- S.dist n = MIPRE.CL.clDist (S.cl n MIPRE.Player.alice).eval (S.cl n MIPRE.Player.bob).eval