Documentation

MIPRE.Background.Tailored.Intro.LenIntro

The answer-length calculator of the introspection verifier #

Issue #281 (Phase 3 of planning/aldous-lyons-track.md): the answer-length calculator L^intro_λ of the tailored presentation of Introspection.seven. It depends on λ only, not on the input verifier: the lengths of the presented game at a question are those of the label its graph view decodes to (TypedData.detype), and the typed lengths (Typed.lenR, Typed.len) are functions of the parameters k = fieldBits c λ n, j = selectorBits c λ n and R = (2^n)^λ alone.

On (n, x, κ), for λ ≥ 1 and n ≥ 1, the program

  1. computes the binary pair (Q, R) (SourceCompiler.boundsProg) and puts it in unary;
  2. computes the unary parameters (k, j, m = 2^j) (PauliSamplerParameters.prog);
  3. reads the graph view of x (its first graphDim Label bits), decodes it to a label by a finite table (finiteFunction, the router's own device), together with κ, into the five coefficients of the length as a combination of k, m k, Q, R and 1 (coef), zero when the view does not decode;
  4. outputs the combination in unary (linF).

At λ = 0 it is the empty program, and at n = 0 it inspects the index in place and outputs nil: both output length 0 within constant time, which the budget Introspection.budget, constant in the index there, requires.

@[reducible, inline]

The labels of the introspection verifier's detyping.

Equations
Instances For
    @[reducible, inline]

    The type graph of the introspection verifier's detyping.

    Equations
    Instances For

      The lengths #

      @[reducible, inline]

      The field width k = fieldBits c λ n.

      Equations
      Instances For
        @[reducible, inline]

        The selector width j = selectorBits c λ n.

        Equations
        Instances For

          The readable length of a label at (c, λ, n): Typed.lenR at k = fieldBits c λ n, j = selectorBits c λ n, R = (2^n)^λ.

          Equations
          Instances For

            The linear length of a label at (c, λ, n): Typed.len - Typed.lenR.

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

              The length of kind κ: readable for false, linear for true.

              Equations
              Instances For

                The lengths as combinations of the parameters #

                @[reducible, inline]

                The five coefficients of a length, on k, m k, Q, R and 1.

                Equations
                Instances For

                  The combination of the coefficients.

                  Equations
                  Instances For

                    The coefficients of the length of kind κ at a label.

                    Equations
                    Instances For
                      theorem MIPRE.Tailored.Intro.LenIntro.lin_coef (k j R : ℕ) (t : Label) (κ : Bool) :
                      lin (coef t κ) k (2 ^ j) (2 ^ 2 ^ j * k) R = if κ = true then Typed.len k j R t - Typed.lenR k j R t else Typed.lenR k j R t

                      The typed lengths are the combinations of the coefficients, at m = 2^j and Q = 2^m k.

                      The decoding of a question #

                      @[reducible, inline]

                      The number of bits of a graph view.

                      Equations
                      Instances For

                        The coefficients at a graph view and a kind: those of the label it decodes to, zero when it does not decode.

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

                          The finite table: from the bits of a graph view and a kind, the coefficients.

                          Equations
                          Instances For

                            The combination of unary coefficients with the unary parameters (k, m, Q, R).

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

                              The stages #

                              @[reducible, inline]

                              The input of the core: (λ, n, d).

                              Equations
                              Instances For

                                Stage 1: keep (d, (λ, n)), and pass (λ, n) to the bounds program.

                                Equations
                                • One or more equations did not get rendered due to their size.
                                Instances For
                                  @[simp]
                                  theorem MIPRE.Tailored.Intro.LenIntro.g1_apply (a : In0) :
                                  g1.toFun a = ((a.2.2, a.1, a.2.1), a.1, a.2.1)

                                  Stage 4: keep (d, (Q, R)) in unary, and pass (λ, n) to the parameters program.

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

                                    Stage 6, the output: (d, (Q, R)) and (k, j, m) in unary give the length in unary.

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

                                      The core of the calculator, on (λ, n, d).

                                      Equations
                                      • One or more equations did not get rendered due to their size.
                                      Instances For
                                        noncomputable def MIPRE.Tailored.Intro.LenIntro.coreOut (c lam n : ℕ) (d : Cost.Data) :

                                        The output of the core at (λ, n, d).

                                        Equations
                                        • One or more equations did not get rendered due to their size.
                                        Instances For
                                          noncomputable def MIPRE.Tailored.Intro.LenIntro.coreCost (c lam n : ℕ) (d : Cost.Data) :

                                          The cost of the core at (λ, n, d), stage by stage.

                                          Equations
                                          • One or more equations did not get rendered due to their size.
                                          Instances For
                                            theorem MIPRE.Tailored.Intro.LenIntro.core_runsLe (c lam n : ℕ) (d : Cost.Data) :
                                            Calls.RunsLe (core c) (Cost.encode (lam, n, d)) (Cost.encode (coreOut c lam n d)) (coreCost c lam n d)

                                            The run of the core.

                                            The calculator #

                                            Inspect the index in place: at n = 0 (and on malformed inputs) output nil, otherwise run p on the input.

                                            Equations
                                            Instances For
                                              theorem MIPRE.Tailored.Intro.LenIntro.lenWrap_runs_pos {p : Cost.Prog} (hp : Cost.Prog.WellScoped 1 p) {n : ℕ} (hn : 1 ≤ n) (d r : Cost.Data) (t : ℕ) (hr : p.Runs ((Cost.encode n).cons d) r t) :
                                              (lenWrap p).Runs ((Cost.encode n).cons d) r (t + ((Cost.encode n).cons d).size + 4)

                                              The program of the calculator at λ: empty at λ = 0, otherwise the core with λ stored, behind the index test.

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

                                                The answer-length calculator of the introspection verifier at the constant c and level λ.

                                                Equations
                                                Instances For

                                                  The wrapper, as a polynomial-time map on descriptions.

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

                                                    The calculator's program from λ, in polynomial time.

                                                    Equations
                                                    • One or more equations did not get rendered due to their size.
                                                    Instances For
                                                      theorem MIPRE.Tailored.Intro.LenIntro.lenIntroC_runs_pos (c : ℕ) {lam n : ℕ} (hl : 1 ≤ lam) (hn : 1 ≤ n) (d : Cost.Data) :
                                                      Calls.RunsLe (lenIntroC c lam).prog ((Cost.encode n).cons d) (Cost.encode (coreOut c lam n d)) (coreCost c lam n d + (Cost.encode lam).size + 2 * ((Cost.encode n).cons d).size + 7)

                                                      The run of the calculator at positive λ and n.

                                                      What the calculator outputs #

                                                      noncomputable def MIPRE.Tailored.Intro.LenIntro.lenAt (c lam n : ℕ) (x : Cost.BitStr) (κ : Bool) :

                                                      The length the calculator outputs on (n, x, κ): 0 at λ = 0 or n = 0, otherwise the combination of the coefficients of the label x's graph view decodes to.

                                                      Equations
                                                      • One or more equations did not get rendered due to their size.
                                                      Instances For
                                                        theorem MIPRE.Tailored.Intro.LenIntro.lenIntroC_lenIs (c lam n : ℕ) (x : Cost.BitStr) (κ : Bool) :
                                                        LenIs (lenIntroC c lam) n x κ (lenAt c lam n x κ)

                                                        What the calculator outputs, on every bit string and every n, λ.

                                                        theorem MIPRE.Tailored.Intro.LenIntro.lenAt_eq (c : ℕ) {lam n : ℕ} (hl : 1 ≤ lam) (hn : 1 ≤ n) (x : Cost.BitStr) (κ : Bool) :
                                                        lenAt c lam n x κ = (Option.map (fun (p : Bool × Label) => introLen c lam n κ p.2) (CL.Detyping.decodeView E (CL.Detyping.graphOfBits x))).getD 0

                                                        At positive λ and n, the output is the length of the label the graph view decodes to, 0 when it does not decode.

                                                        theorem MIPRE.Tailored.Intro.LenIntro.lenIntroC_lenIs_question (c : ℕ) {lam n : ℕ} (hl : 1 ≤ lam) (hn : 1 ≤ n) {s : ℕ} (q : CL.Detyping.Coord Label (Fin s) → CL.𝔽₂) (κ : Bool) :

                                                        The calculator at a detyped question: at positive λ and n, on the bits of a detyped question q (numbered as the reference verifier numbers them, vectorEquiv), it outputs the readable (κ = false) or linear (κ = true) length of the label q decodes to, 0 when it does not decode — the lengths of the presented game, TypedData.detype.

                                                        theorem MIPRE.Tailored.Intro.LenIntro.lenIntroC_lenIs_detype (c : ℕ) {lam n : ℕ} (hl : 1 ≤ lam) (hn : 1 ≤ n) {s : ℕ} (D : TypedData Label (Fin s)) (hR : D.lenR = introLenR c lam n) (hL : D.lenL = introLenL c lam n) (μ : (CL.Detyping.Coord Label (Fin s) → ZMod 2) → (CL.Detyping.Coord Label (Fin s) → ZMod 2) → ℝ) (hμ : ∀ (x y : CL.Detyping.Coord Label (Fin s) → ZMod 2), 0 ≤ μ x y) (hμ1 : ∑ x : CL.Detyping.Coord Label (Fin s) → ZMod 2, ∑ y : CL.Detyping.Coord Label (Fin s) → ZMod 2, μ x y = 1) (q : CL.Detyping.Coord Label (Fin s) → CL.𝔽₂) :

                                                        The same, read on a detyped tailored game whose typed lengths are introLenR, introLenL.

                                                        The costs #

                                                        The scale of the parameters at u = λ n: 2^{(2c + 2)(u + 2)}.

                                                        Equations
                                                        Instances For
                                                          theorem MIPRE.Tailored.Intro.LenIntro.params_le_scale (c : ℕ) {lam n : ℕ} (hl : 1 ≤ lam) (hn : 1 ≤ n) :
                                                          lam ≤ scale c (lam * n) ∧ n ≤ scale c (lam * n) ∧ lam * n ≤ scale c (lam * n) ∧ Introspection.SourceCompiler.registerBits c lam n ≤ scale c (lam * n) ∧ Introspection.SourceCompiler.originalBound lam n ≤ scale c (lam * n)

                                                          The parameters at positive λ and n are at most the scale.

                                                          noncomputable def MIPRE.Tailored.Intro.LenIntro.costF (c z : ℕ) :

                                                          A majorant of the cost of the calculator at positive λ and n, in z = scale + |d|.

                                                          Equations
                                                          • One or more equations did not get rendered due to their size.
                                                          Instances For
                                                            theorem MIPRE.Tailored.Intro.LenIntro.cost_le_costF {c : ℕ} (hc : 1 ≤ c) {lam n : ℕ} (hl : 1 ≤ lam) (hn : 1 ≤ n) (d : Cost.Data) :
                                                            coreCost c lam n d + (Cost.encode lam).size + 2 * ((Cost.encode n).cons d).size + 7 ≤ costF c (scale c (lam * n) + d.size)

                                                            The cost at positive λ and n is at most the majorant at z = scale + |d|.

                                                            theorem MIPRE.Tailored.Intro.LenIntro.mul_le_pow {A u C : ℕ} (hu : 1 ≤ u) (hC : 1 ≤ C) (hA : A ≤ 2 ^ (C - 1)) :
                                                            A * (u + 1) ≤ (u + 1) ^ C

                                                            A (u + 1) ≤ (u + 1)^C once A ≤ 2^{C - 1}, for u ≥ 1.

                                                            theorem MIPRE.Tailored.Intro.LenIntro.lin_coef_le (t : Label) (κ : Bool) (k m Q R : ℕ) :
                                                            lin (coef t κ) k m Q R ≤ 2 * k + m * k + 2 * Q + R + 3
                                                            theorem MIPRE.Tailored.Intro.LenIntro.lin_coefAt_le (g : CL.Graph.Coord Label → CL.𝔽₂) (κ : Bool) (k m Q R : ℕ) :
                                                            lin (coefAt g κ) k m Q R ≤ 2 * k + m * k + 2 * Q + R + 3
                                                            theorem MIPRE.Tailored.Intro.LenIntro.lenIntroC_budget {c : ℕ} (hc : 1 ≤ c) :
                                                            ∃ (C : ℕ), ∀ (lam n : ℕ), (lenIntroC c lam).TimeBoundAt n (Introspection.ansBound C lam n) C ∧ LenBound (lenIntroC c lam) n (Introspection.ansBound C lam n)

                                                            The costs of the calculator, in the shape of Introspection.budget: a constant C with the calculator within 2^{(λn + 1)^C} at degree C on every input, and its lengths at most 2^{(λn + 1)^C}.

                                                            The calculator halts at every question, of every dimension.

                                                            At the constant of Introspection.seven #

                                                            The answer-length calculator L^intro_λ of the tailored presentation of Introspection.seven.

                                                            Equations
                                                            Instances For

                                                              Correctness: at positive λ and n, at every detyped question, the presented lengths of the label the question decodes to (0 when it does not decode).

                                                              theorem MIPRE.Tailored.Intro.LenIntro.lenIntro_lenIs_zero {lam n : ℕ} (h : lam = 0 ∨ n = 0) (x : Cost.BitStr) (κ : Bool) :
                                                              LenIs (lenIntro lam) n x κ 0

                                                              At λ = 0 or n = 0, the calculator outputs 0 everywhere.

                                                              The costs, in the shape of Introspection.budget.

                                                              The calculator halts at every question.