Documentation

Complexity.Algorithms.WordRAM.ThreeSum.Host.Prepare

Preparing the native Convolution-3SUM host #

The host reads the standard length header and computes a polynomial magnitude bound using the existing native parameter program. It then computes the matrix side and consecutive matrix addresses. The parameter program's additional computations are included in the instruction count.

This directly adapts the setup of Anthropic's pinned c3Body. The complete reduction must also fill every instance and invoke a concrete certified solver.

Main definitions #

Main results #

References #

@[reducible, inline]

Input length.

Instances For
    @[reducible, inline]

    Polynomial magnitude bound.

    Instances For
      @[reducible, inline]

      Input base address.

      Instances For
        @[reducible, inline]

        AB matrix base address.

        Instances For
          @[reducible, inline]

          BC matrix base address.

          Instances For
            @[reducible, inline]

            AC matrix base address.

            Instances For
              @[reducible, inline]

              Solver workspace starts after the three matrices.

              Instances For
                @[reducible, inline]

                Number of vertices per part.

                Instances For
                  @[reducible, inline]

                  Current instance number.

                  Instances For
                    @[reducible, inline]

                    Number of instances.

                    Instances For
                      @[reducible, inline]

                      Accumulated Boolean verdict.

                      Instances For
                        @[reducible, inline]

                        Constant one.

                        Instances For
                          @[reducible, inline]

                          Unsigned filler magnitude.

                          Instances For
                            @[reducible, inline]

                            Signed-encoded positive filler.

                            Instances For
                              @[reducible, inline]

                              Number of entries per matrix.

                              Instances For
                                @[reducible, inline]

                                Square-root argument.

                                Instances For
                                  @[reducible, inline]

                                  Square-root output.

                                  Instances For

                                    Register embedding for the existing parameter routine.

                                    Instances For

                                      Register embedding for successive squares.

                                      Instances For
                                        @[reducible, inline]

                                        The mathematical side length used by the reduction.

                                        Instances For

                                          Runtime source and caller-owned matrix workspace retained throughout the instance loop.

                                          Instances For
                                            @[reducible, inline]

                                            Standalone layout: input starts after header zero and matrices immediately follow it.

                                            Instances For
                                              @[reducible, inline]

                                              Input-length output of the parameter bank.

                                              Instances For
                                                @[reducible, inline]

                                                Magnitude output of the parameter bank.

                                                Instances For

                                                  Copy the two needed parameter outputs and initialize constants.

                                                  Instances For

                                                    Consecutive output blocks and the two loop counters.

                                                    Instances For

                                                      All initialization consists of actual native subprograms and charged register operations.

                                                      Instances For
                                                        theorem Cslib.Algorithms.WordRAM.ThreeSum.Host.exec_layout_at {w N U src : ℕ} (x : WordRAM.Data 64) (hN : x.regs len = N) (hU : x.regs upper = U) (hb : x.regs base = src) (ho : x.regs one = 1) (hr : x.regs sqrtRoot = N.sqrt) (hsize : WordRAM.Fits w (N + src + 3 * (sideLength N * sideLength N))) (hfill : WordRAM.Fits w (4 * U + 2)) :
                                                        ∃ (y : WordRAM.Data 64), WordRAM.ExecWithin w layout x y 12 ∧ ParametersAt N U src (N + src) y ∧ y.regs inst = 0 ∧ y.regs found = 0 ∧ y.mem = x.mem

                                                        Existing layout code also supports arbitrary source placement.

                                                        theorem Cslib.Algorithms.WordRAM.ThreeSum.Host.exec_prepare {w : ℕ} (κ : ℕ) (x : WordRAM.Data 64) (hbudget : WordRAM.Fits w (ChanHe.Parameters.Math.budget (x.mem 0) ((x.mem 0 + 2) ^ κ))) (hsize : WordRAM.Fits w (x.mem 0 + 1 + 3 * (sideLength (x.mem 0) * sideLength (x.mem 0)))) (hfill : WordRAM.Fits w (4 * (x.mem 0 + 2) ^ κ + 2)) :
                                                        ∃ (y : WordRAM.Data 64), WordRAM.ExecWithin w (prepare κ) x y (ChanHe.Parameters.time κ (x.mem 0) ((x.mem 0 + 2) ^ κ) + 5 * (x.mem 0).sqrt + 24) ∧ Parameters (x.mem 0) ((x.mem 0 + 2) ^ κ) y ∧ y.regs inst = 0 ∧ y.regs found = 0 ∧ y.mem = x.mem

                                                        Exact initialization from the ordinary length header. The existing parameter program computes U = (N+2)^κ; its entire execution is charged, including the unused extra parameters. The additional fit premises cover matrix addresses and the encoded filler, and are independent of any solver execution contract.