Documentation

Complexity.Computability.PolyTime.BitString.InitialTestsSearch

Sequential initial-test search and shortened Tanner check matrices #

Deterministic sequential search and shortened Tanner parity-check construction from OpenAI, The Exponential Time Hypothesis is False, §6.1, Lemma 6.1 (pp. 40–42), giving the executable counterpart to Cslib.BitString.exists_initialTests. Given n, B ≥ 1 and m ≤ B * n, initialTestsRows m B constructs a binary matrix A^(0) on m columns with at most 3 * n rows of weight at most initialRowWeightBound B m whose GF(2) kernel excludes every nonzero vector of weight below m / greedyRowListLength B m, in exp(poly(B, log(m + 2))) bit operations and poly(n, m, B) working space via Cslib.GenericRAM.IndexFold.run.

Main definitions #

Main results #

References #

Lemma 6.1 integer parameter schedule #

Cayley degree d_G = min(m, D₀) (D₀ = initialRowWeightBound B m) of [OAI26c], Lemma 6.1.

Instances For

    Cube dimension ℓ_G = ⌈log₂ ⌈m / d_G⌉⌉ of [OAI26c], Lemma 6.1 (0 if d_G = 0).

    Instances For

      Vertex-side size q_G = 2 ^ ℓ_G of the double cover in [OAI26c], Lemma 6.1.

      Instances For

        Local parity-check row count c_G = ⌈d_G / (8 B)⌉ of [OAI26c], Lemma 6.1 (0 if B = 0).

        Instances For

          Maximum rejected weight h = ⌈d_G / (100 B μ)⌉ - 1 for the local code of Lemma 6.1 (0 if d_G = 0 or B = 0).

          Instances For

            Reciprocal bias denominator 200 B μ (ε = 1 / biasDen m B) in [OAI26c], (6.2).

            Instances For
              theorem Cslib.Complexity.InitialTestsSearch.dG_pos {m B : ℕ} (hm : 1 ≤ m) (hB : 1 ≤ B) :
              0 < dG m B
              theorem Cslib.Complexity.InitialTestsSearch.le_qG_mul_dG {m B : ℕ} (hm : 1 ≤ m) (hB : 1 ≤ B) :
              m ≤ qG m B * dG m B
              theorem Cslib.Complexity.InitialTestsSearch.qG_mul_dG_lt_two_mul {m B : ℕ} (hm : 1 ≤ m) (hB : 1 ≤ B) :
              qG m B * dG m B < 2 * m
              theorem Cslib.Complexity.InitialTestsSearch.qG_lt_two_mul {m B : ℕ} (hm : 1 ≤ m) (hB : 1 ≤ B) :
              qG m B < 2 * m
              theorem Cslib.Complexity.InitialTestsSearch.two_mul_qG_mul_cG_le_three_mul {n m B : ℕ} (hn : 1 ≤ n) (hm : 1 ≤ m) (hB : 1 ≤ B) (hmn : m ≤ B * n) :
              2 * qG m B * cG m B ≤ 3 * n
              theorem Cslib.Complexity.InitialTestsSearch.dG_le_hDist_succ_mul {m B : ℕ} (hm : 1 ≤ m) (hB : 1 ≤ B) :
              dG m B ≤ (hDist m B + 1) * (100 * B * (Nat.log 2 m + 1))

              Private streaming IndexFold and matrix-search combinators #

              Polynomial-time and streaming checkers #

              def Cslib.Complexity.InitialTestsSearch.checkSmallBiasShifts (ell d maxBiasNum maxBiasDen : ℕ) (shifts : List (List Bool)) :

              Streaming small-bias shift checker ([OAI26c], Lemma 6.1, eq. (6.2)): checks that shifts has d rows of length ell and |d - 2 * odd(b)| * maxBiasDen ≤ maxBiasNum * d on all nonzero masks b ∈ {0, 1} ^ ell \ {0}, returning false on any shape or bias violation.

              Instances For
                theorem Cslib.Complexity.InitialTestsSearch.checkSmallBiasShifts_eq_true_iff {ell d maxBiasNum maxBiasDen : ℕ} [NeZero d] (hden : 0 < maxBiasDen) (shifts : List (List Bool)) :
                checkSmallBiasShifts ell d maxBiasNum maxBiasDen shifts = true ↔ shifts.length = d ∧ (∀ row ∈ shifts, row.length = ell) ∧ BitString.IsSmallBias (↑maxBiasNum / ↑maxBiasDen) (PMF.map (fun (j : Fin d) => BitString.ofList ell (shifts.getD ↑j [])) (Probability.PMF.uniformOfFintype (Fin d)))

                Exact characterization of checkSmallBiasShifts for d ≥ 1 and 0 < maxBiasDen.

                Plain polynomial-time certificate for checkSmallBiasShifts when 2 ^ ell is poly-bounded.

                Streaming local-code distance checker ([OAI26c], Lemma 6.1) via IndexFold.run: checks that H0 has c rows of length d and every nonzero w ∈ {0, 1} ^ d \ {0} in its GF(2) kernel has Hamming weight at least minDist, returning false on any violation.

                Instances For
                  theorem Cslib.Complexity.InitialTestsSearch.checkLocalCodeDistance_eq_true_iff (c d minDist : ℕ) (H0 : List (List Bool)) :
                  checkLocalCodeDistance c d minDist H0 = true ↔ H0.length = c ∧ (∀ row ∈ H0, row.length = d) ∧ ∀ (w : Fin d → Bool), w ≠ 0 → (∀ (i : Fin c), BitString.ofList d (H0.getD ↑i []) ⬝ᵥ w = false) → minDist ≤ BitString.weight w

                  Exact characterization of checkLocalCodeDistance.

                  Sequential IndexFold searchers #

                  Sequential IndexFold search ([OAI26c], Lemma 6.1) over 0 .. 2 ^ (d * ell) - 1, returning the first d × ell shift table passing checkSmallBiasShifts, or the total all-false fallback listRows d ell [] when no candidate passes.

                  Instances For
                    theorem Cslib.Complexity.InitialTestsSearch.isSmallBias_findSmallBiasShifts {ell d maxBiasNum maxBiasDen : ℕ} [NeZero d] (hden : 0 < maxBiasDen) (hex : ∃ (s : Fin d → Fin ell → Bool), BitString.IsSmallBias (↑maxBiasNum / ↑maxBiasDen) (PMF.map s (Probability.PMF.uniformOfFintype (Fin d)))) :
                    have shifts := findSmallBiasShifts ell d maxBiasNum maxBiasDen; checkSmallBiasShifts ell d maxBiasNum maxBiasDen shifts = true ∧ shifts.length = d ∧ (∀ row ∈ shifts, row.length = ell) ∧ BitString.IsSmallBias (↑maxBiasNum / ↑maxBiasDen) (PMF.map (fun (j : Fin d) => BitString.ofList ell (shifts.getD ↑j [])) (Probability.PMF.uniformOfFintype (Fin d)))

                    Soundness of findSmallBiasShifts for d ≥ 1 and 0 < maxBiasDen when a witness exists.

                    Sequential IndexFold search ([OAI26c], Lemma 6.1) over 0 .. 2 ^ (c * d) - 1, returning the first c × d check matrix passing checkLocalCodeDistance, or the total all-false fallback listRows c d [] when no candidate passes.

                    Instances For
                      theorem Cslib.Complexity.InitialTestsSearch.weight_le_of_findLocalCheckMatrix {c d minDist : ℕ} (hex : ∃ (A : Fin c → Fin d → Bool), ∀ (w : Fin d → Bool), w ≠ 0 → (∀ (i : Fin c), A i ⬝ᵥ w = false) → minDist ≤ BitString.weight w) :
                      have H0 := findLocalCheckMatrix c d minDist; checkLocalCodeDistance c d minDist H0 = true ∧ H0.length = c ∧ (∀ row ∈ H0, row.length = d) ∧ ∀ (w : Fin d → Bool), w ≠ 0 → (∀ (i : Fin c), BitString.ofList d (H0.getD ↑i []) ⬝ᵥ w = false) → minDist ≤ BitString.weight w

                      Soundness of findLocalCheckMatrix when a check matrix of distance minDist exists.

                      Shortened Tanner parity-check matrix builder #

                      Construct the 2 * 2 ^ ell * c parity-check rows of length m for the shortened Tanner code ([OAI26c], Lemma 6.1, p. 42), matching Cslib.BitString.Tanner.shortRow. Fills entries with false when d = 0 and pads/truncates missing shifts or H0 entries with false.

                      Instances For
                        @[simp]
                        theorem Cslib.Complexity.InitialTestsSearch.length_buildShortenedTannerRows (m ell d c : ℕ) (shifts H0 : List (List Bool)) :
                        (buildShortenedTannerRows m ell d c shifts H0).length = 2 * 2 ^ ell * c
                        theorem Cslib.Complexity.InitialTestsSearch.length_mem_buildShortenedTannerRows {m ell d c : ℕ} {shifts H0 : List (List Bool)} {row : List Bool} (hrow : row ∈ buildShortenedTannerRows m ell d c shifts H0) :
                        row.length = m
                        theorem Cslib.Complexity.InitialTestsSearch.count_true_mem_buildShortenedTannerRows_le {m ell d c : ℕ} (hd : 0 < d) (hm : m ≤ 2 ^ ell * d) {shifts H0 : List (List Bool)} {row : List Bool} (hrow : row ∈ buildShortenedTannerRows m ell d c shifts H0) :
                        theorem Cslib.Complexity.InitialTestsSearch.le_weight_of_buildShortenedTannerRows {m ell d c maxBiasNum maxBiasDen h : ℕ} [NeZero d] (hden : 0 < maxBiasDen) (hm : m ≤ 2 ^ ell * d) {shifts H0 : List (List Bool)} (hshifts : checkSmallBiasShifts ell d maxBiasNum maxBiasDen shifts = true) (hH0 : checkLocalCodeDistance c d (h + 1) H0 = true) {z : Fin m → Bool} (hz0 : z ≠ 0) (hz : ∀ row ∈ buildShortenedTannerRows m ell d c shifts H0, BitString.ofList m row ⬝ᵥ z = false) :
                        ↑(h + 1) * (↑(h + 1) - ↑maxBiasNum / ↑maxBiasDen * ↑d) * 2 ^ ell ≤ ↑d * ↑(BitString.weight z)

                        Distance transfer from Tanner.le_weight_of_shortRow for d ≥ 1, 0 < maxBiasDen.

                        theorem Cslib.Complexity.InitialTestsSearch.le_mul_weight_of_buildShortenedTannerRows_params {n m B : ℕ} (hn : 1 ≤ n) (hm : 1 ≤ m) (hB : 1 ≤ B) (hmn : m ≤ B * n) {shifts H0 : List (List Bool)} (hshifts : checkSmallBiasShifts (ellG m B) (dG m B) 1 (biasDen m B) shifts = true) (hH0 : checkLocalCodeDistance (cG m B) (dG m B) (hDist m B + 1) H0 = true) :
                        have rows := buildShortenedTannerRows m (ellG m B) (dG m B) (cG m B) shifts H0; rows.length ≤ 3 * n ∧ (∀ row ∈ rows, row.length = m ∧ List.count true row ≤ BitString.initialRowWeightBound B m) ∧ ∀ (z : Fin m → Bool), z ≠ 0 → (∀ row ∈ rows, BitString.ofList m row ⬝ᵥ z = false) → m ≤ BitString.greedyRowListLength B m * BitString.weight z

                        Specialization of buildShortenedTannerRows to Lemma 6.1 (1 ≤ n, m, B, m ≤ B * n).

                        Unconditional Lemma 6.1 initial-tests assembly and native resource bounds #

                        Deterministic Lemma 6.1 construction of the initial parity-check matrix A^(0) via findSmallBiasShifts, findLocalCheckMatrix, and buildShortenedTannerRows. Returns [] in the degenerate cases m = 0 or B = 0.

                        Instances For
                          theorem Cslib.Complexity.InitialTestsSearch.initialTestsRows_spec {n m B : ℕ} (hn : 1 ≤ n) (hB : 1 ≤ B) (hmn : m ≤ B * n) :
                          have rows := initialTestsRows m B; rows.length ≤ 3 * n ∧ (∀ row ∈ rows, row.length = m ∧ List.count true row ≤ BitString.initialRowWeightBound B m) ∧ ∀ (z : Fin m → Bool), z ≠ 0 → (∀ row ∈ rows, BitString.ofList m row ⬝ᵥ z = false) → m ≤ BitString.greedyRowListLength B m * BitString.weight z

                          Unconditional correctness of initialTestsRows ([OAI26c], 6.1) for 1 ≤ n, B and m ≤ B * n.

                          theorem Cslib.Complexity.InitialTestsSearch.map_ofList_initialTestsRows_spec {n m B : ℕ} (hn : 1 ≤ n) (hB : 1 ≤ B) (hmn : m ≤ B * n) :
                          have rows := List.map (BitString.ofList m) (initialTestsRows m B); rows.length ≤ 3 * n ∧ (∀ r ∈ rows, BitString.weight r ≤ BitString.initialRowWeightBound B m) ∧ ∀ (z : Fin m → Bool), z ≠ 0 → (∀ r ∈ rows, r ⬝ᵥ z = false) → m ≤ BitString.greedyRowListLength B m * BitString.weight z

                          Executable witness matching Cslib.BitString.exists_initialTests for 1 ≤ n, B and m ≤ B * n.

                          theorem Cslib.Complexity.InitialTestsSearch.div_greedyRowListLength_le_weight_of_initialTestsRows {n m B : ℕ} (hn : 1 ≤ n) (hB : 1 ≤ B) (hmn : m ≤ B * n) {z : Fin m → Bool} (hz0 : z ≠ 0) (hz : ∀ row ∈ initialTestsRows m B, BitString.ofList m row ⬝ᵥ z = false) :

                          Real division corollary (m : ℝ) / greedyRowListLength B m ≤ weight z for 1 ≤ n, B and m ≤ B * n.

                          Native ComputableInO certificate for initialTestsRows on unary (m, B), proving pure 2 ^ q (B + Nat.log 2 (m + 2)) time and S (m + B) space.

                          Triple-input (n, m, B) form of initialTestsRows_computableInO on unary (n, m, B), proving n + 2 ^ q (B + Nat.log 2 (m + 2)) time (where + n scans past the unary n prefix on the input tape) and S (n + m + B) space.