Documentation

CslibFrontier.Computability.PolyTime.BitString.TannerSearch

Unconditional exhaustive-search wrappers and M20 parity-test assembly #

Unconditional specifications and resource bounds layered on CslibFrontier.Computability.PolyTime.BitString.InitialTestsSearch:

  1. Small-bias shift search at d ≥ ⌈4 (r + 1) / ε²⌉: smallBiasCeil r p q gives the integer threshold ⌈4 (r + 1) q² / p²⌉. Combining Cslib.BitString.exists_isSmallBias_map_of_ceil_le with InitialTestsSearch.findSmallBiasShifts yields an unconditional IsSmallBias (p / q) certificate (isSmallBias_findSmallBiasShifts_of_le, isSmallBias_findSmallBiasShiftsCeil) and an explicit ComputableInO search bound (findSmallBiasShiftsCeil_computableInO).
  2. Local check matrix search under Gilbert–Varshamov bounds: findLocalCheckMatrix succeeds unconditionally whenever the Hamming ball of nonzero strings of weight at most h has size less than 2 ^ c (weight_le_of_findLocalCheckMatrix_of_ball_lt), in particular whenever ballSize d h ≤ 2 ^ c or (d + 1) ^ h ≤ 2 ^ c (weight_le_of_findLocalCheckMatrix_of_ballSize_le, weight_le_of_findLocalCheckMatrix_of_pow_le), with the search cost from InitialTestsSearch.findLocalCheckMatrix_computableInO.
  3. End-to-end M20 parity-test composition: tannerParityTests pairs findSmallBiasShifts, findLocalCheckMatrix, and buildShortenedTannerRows, unconditionally producing at most 2 · 2 ^ r · c rows of weight at most d with global relative-distance guarantee δ * (δ - p / q) * (d * 2 ^ r) ≤ weight z (tannerParityTests_spec). The exponential-time, polynomial-space resource certificate applies exactly to the bounded wrapper tannerParityTestsWithBound (tannerParityTests_computableInO), which clamps the dimension to a unary parameter to preserve the polynomial space bound.

Main definitions #

Main results #

References #

Computable natural ceiling ⌈4 (r + 1) q² / p²⌉ for bias ε = p / q.

theorem Cslib.Complexity.TannerSearch.smallBiasCeil_pos (r : ℕ) {p q : ℕ} (hp : 0 < p) (hq : 0 < q) :

smallBiasCeil r p q is positive whenever p > 0 and q > 0.

theorem Cslib.Complexity.TannerSearch.ceil_le_smallBiasCeil (r : ℕ) {p q : ℕ} (hp : 0 < p) (hq : 0 < q) :
⌈4 * (↑r + 1) / (↑p / ↑q) ^ 2⌉₊ ≤ smallBiasCeil r p q

The real ceiling ⌈4 (r + 1) / (p / q)²⌉ is at most smallBiasCeil r p q.

theorem Cslib.Complexity.TannerSearch.isSmallBias_findSmallBiasShifts_of_le {r d p q : ℕ} [NeZero d] (hp : 0 < p) (hq : 0 < q) (hd : smallBiasCeil r p q ≤ d) :
have shifts := InitialTestsSearch.findSmallBiasShifts r d p q; InitialTestsSearch.checkSmallBiasShifts r d p q shifts = true ∧ shifts.length = d ∧ (∀ row ∈ shifts, row.length = r) ∧ BitString.IsSmallBias (↑p / ↑q) (PMF.map (fun (j : Fin d) => BitString.ofList r (shifts.getD ↑j [])) (Probability.PMF.uniformOfFintype (Fin d)))

Unconditional correctness of findSmallBiasShifts r d p q whenever d ≥ smallBiasCeil r p q and p, q > 0.

Deterministic exhaustive search for (p / q)-biased shifts at size smallBiasCeil r p q.

theorem Cslib.Complexity.TannerSearch.isSmallBias_findSmallBiasShiftsCeil (r : ℕ) {p q : ℕ} (hp : 0 < p) (hq : 0 < q) :
have x := ⋯; have shifts := findSmallBiasShiftsCeil r p q; InitialTestsSearch.checkSmallBiasShifts r (smallBiasCeil r p q) p q shifts = true ∧ shifts.length = smallBiasCeil r p q ∧ (∀ row ∈ shifts, row.length = r) ∧ BitString.IsSmallBias (↑p / ↑q) (PMF.map (fun (j : Fin (smallBiasCeil r p q)) => BitString.ofList r (shifts.getD ↑j [])) (Probability.PMF.uniformOfFintype (Fin (smallBiasCeil r p q))))

Unconditional correctness of findSmallBiasShiftsCeil r p q for p > 0 and q > 0.

Input parameters for findSmallBiasShiftsCeil: cube dimension r and bias numerator p and denominator q (ε = p / q).

  • r : ℕ

    Dimension r of the Boolean cube Fin r → Bool.

  • p : ℕ

    Bias numerator p.

  • q : ℕ

    Bias denominator q.

Instances For
    theorem Cslib.Complexity.TannerSearch.encSmallBiasCeilParams_r_budget {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → SmallBiasCeilParams} :
    theorem Cslib.Complexity.TannerSearch.encSmallBiasCeilParams_q_budget {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → SmallBiasCeilParams} :
    theorem Cslib.Complexity.TannerSearch.encSmallBiasCeilParams_mk_inO {γ : Type} {encIn : γ ↪ List Bool} {x0 T0 S0 x1 T1 S1 x2 T2 S2 : γ → ℕ} (h0 : Turing.MultiTapeTM.ComputableInO x0 encIn Turing.MultiTapeTM.encUnary T0 S0) (h1 : Turing.MultiTapeTM.ComputableInO x1 encIn Turing.MultiTapeTM.encUnary T1 S1) (h2 : Turing.MultiTapeTM.ComputableInO x2 encIn Turing.MultiTapeTM.encUnary T2 S2) :
    Turing.MultiTapeTM.ComputableInO (fun (x : γ) => { r := x0 x, p := x1 x, q := x2 x }) encIn encSmallBiasCeilParams (fun (x : γ) => T0 x + (T1 x + T2 x)) fun (x : γ) => S0 x + (S1 x + S2 x)
    theorem Cslib.Complexity.TannerSearch.encSmallBiasCeilParams_p_budget {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → SmallBiasCeilParams} :

    Native ComputableInO certificate for findSmallBiasShiftsCeil on unary SmallBiasCeilParams, running in time 2 ^ (smallBiasCeil q.r q.p q.q * q.r + q.r) times a polynomial and polynomial space.

    theorem Cslib.Complexity.TannerSearch.weight_le_of_findLocalCheckMatrix_of_ball_lt {c d h : ℕ} (hball : {w : Fin d → Bool | w ≠ 0 ∧ BitString.weight w ≤ h}.card < 2 ^ c) :
    have H0 := InitialTestsSearch.findLocalCheckMatrix c d (h + 1); InitialTestsSearch.checkLocalCodeDistance c d (h + 1) 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) → h + 1 ≤ BitString.weight w

    Unconditional correctness of findLocalCheckMatrix c d (h + 1) whenever fewer than 2 ^ c nonzero strings in Fin d → Bool have weight at most h.

    theorem Cslib.Complexity.TannerSearch.weight_le_of_findLocalCheckMatrix_of_ballSize_le {c d h : ℕ} (hb : BitString.ballSize d h ≤ 2 ^ c) :
    have H0 := InitialTestsSearch.findLocalCheckMatrix c d (h + 1); InitialTestsSearch.checkLocalCodeDistance c d (h + 1) 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) → h + 1 ≤ BitString.weight w

    Unconditional correctness of findLocalCheckMatrix c d (h + 1) under the Hamming-ball Gilbert–Varshamov hypothesis ballSize d h ≤ 2 ^ c (strictly excluding 0).

    theorem Cslib.Complexity.TannerSearch.weight_le_of_findLocalCheckMatrix_of_pow_le {c d h : ℕ} (hp : (d + 1) ^ h ≤ 2 ^ c) :
    have H0 := InitialTestsSearch.findLocalCheckMatrix c d (h + 1); InitialTestsSearch.checkLocalCodeDistance c d (h + 1) 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) → h + 1 ≤ BitString.weight w

    Unconditional correctness of findLocalCheckMatrix c d (h + 1) under (d + 1) ^ h ≤ 2 ^ c (strict variant (d + 1) ^ h < 2 ^ c holds a fortiori).

    End-to-end deterministic construction of shortened bipartite Tanner parity-check tests from (m, r, d, c, h, p, q): searches for (p / q)-biased d shifts in Fin r → Bool and a c × d local check matrix of distance at least h + 1, then outputs the shortened Tanner rows.

    theorem Cslib.Complexity.TannerSearch.tannerParityTests_spec {m r d c h p q : ℕ} [NeZero d] (hm : m ≤ 2 ^ r * d) (hp : 0 < p) (hq : 0 < q) (hd_bias : smallBiasCeil r p q ≤ d) (hGV : (d + 1) ^ h ≤ 2 ^ c) :
    have rows := tannerParityTests m r d c h p q; rows.length = 2 * 2 ^ r * c ∧ (∀ row ∈ rows, row.length = m ∧ List.count true row ≤ d) ∧ ∀ (z : Fin m → Bool), z ≠ 0 → (∀ row ∈ rows, BitString.ofList m row ⬝ᵥ z = false) → ↑(h + 1) * (↑(h + 1) - ↑p / ↑q * ↑d) * 2 ^ r ≤ ↑d * ↑(BitString.weight z) ∧ ↑(h + 1) / ↑d * (↑(h + 1) / ↑d - ↑p / ↑q) * (↑d * 2 ^ r) ≤ ↑(BitString.weight z)

    End-to-end unconditional specification of tannerParityTests m r d c h p q: under d > 0, m ≤ 2 ^ r * d, p, q > 0, small-bias size smallBiasCeil r p q ≤ d, and Gilbert–Varshamov (d + 1) ^ h ≤ 2 ^ c, every row has length m and weight at most d, and every nonzero kernel word z : Fin m → Bool has weight at least δ * (δ - p / q) * (d * 2 ^ r) with δ = (h + 1) / d.

    Effective cube dimension clamped by 2 ^ r ≤ max M 1, used for polynomial-space iteration in buildShortenedTannerRows. Equal to r whenever 2 ^ r ≤ M (M ≥ 1).

    @[simp]

    Parameterized parity-test builder bounded in output dimension by unary M, agreeing with tannerParityTests m r d c h p q whenever 1 ≤ M and 2 ^ r ≤ M.

    theorem Cslib.Complexity.TannerSearch.tannerParityTestsWithBound_eq {M m r d c h p q : ℕ} (hM : 1 ≤ M) (hr : 2 ^ r ≤ M) :
    tannerParityTestsWithBound M m r d c h p q = tannerParityTests m r d c h p q

    Input parameters for bounded end-to-end parity-test construction: unary vertex-count upper bound maxVerts, target block length m, cube dimension r, degree d, local check count c, local weight parameter h (requiring minimum distance h + 1), and binary bias p / q.

    • maxVerts : ℕ

      Unary upper bound M clamping 2 ^ r ≤ max M 1.

    • m : ℕ

      Shortened target block length m.

    • r : ℕ

      Boolean cube dimension r (2 ^ r vertices per side).

    • d : ℕ

      Regularity / local code block length d.

    • c : ℕ

      Number of local parity checks c per vertex.

    • h : ℕ

      Local weight threshold h (enforcing minimum distance ≥ h + 1).

    • p : ℕ

      Small-bias numerator p.

    • q : ℕ

      Small-bias denominator q.

    Instances For
      theorem Cslib.Complexity.TannerSearch.encTannerParityParams_mk_inO {γ : Type} {encIn : γ ↪ List Bool} {x0 T0 S0 x1 T1 S1 x2 T2 S2 x3 T3 S3 x4 T4 S4 x5 T5 S5 x6 T6 S6 x7 T7 S7 : γ → ℕ} (h0 : Turing.MultiTapeTM.ComputableInO x0 encIn Turing.MultiTapeTM.encUnary T0 S0) (h1 : Turing.MultiTapeTM.ComputableInO x1 encIn Turing.MultiTapeTM.encUnary T1 S1) (h2 : Turing.MultiTapeTM.ComputableInO x2 encIn Turing.MultiTapeTM.encUnary T2 S2) (h3 : Turing.MultiTapeTM.ComputableInO x3 encIn Turing.MultiTapeTM.encUnary T3 S3) (h4 : Turing.MultiTapeTM.ComputableInO x4 encIn Turing.MultiTapeTM.encUnary T4 S4) (h5 : Turing.MultiTapeTM.ComputableInO x5 encIn Turing.MultiTapeTM.encUnary T5 S5) (h6 : Turing.MultiTapeTM.ComputableInO x6 encIn Turing.MultiTapeTM.encNat T6 S6) (h7 : Turing.MultiTapeTM.ComputableInO x7 encIn Turing.MultiTapeTM.encNat T7 S7) :
      Turing.MultiTapeTM.ComputableInO (fun (x : γ) => { maxVerts := x0 x, m := x1 x, r := x2 x, d := x3 x, c := x4 x, h := x5 x, p := x6 x, q := x7 x }) encIn encTannerParityParams (fun (x : γ) => T0 x + (T1 x + (T2 x + (T3 x + (T4 x + (T5 x + (T6 x + T7 x))))))) fun (x : γ) => S0 x + (S1 x + (S2 x + (S3 x + (S4 x + (S5 x + (S6 x + S7 x))))))
      theorem Cslib.Complexity.TannerSearch.encTannerParityParams_c_budget {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → TannerParityParams} :
      theorem Cslib.Complexity.TannerSearch.encTannerParityParams_m_budget {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → TannerParityParams} :
      theorem Cslib.Complexity.TannerSearch.encTannerParityParams_d_budget {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → TannerParityParams} :
      theorem Cslib.Complexity.TannerSearch.encTannerParityParams_p_budget {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → TannerParityParams} :

      Mixed unary/binary encoding of TannerParityParams (maxVerts, m, r, d, c, h unary; p, q binary).

      theorem Cslib.Complexity.TannerSearch.encTannerParityParams_h_budget {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → TannerParityParams} :
      theorem Cslib.Complexity.TannerSearch.encTannerParityParams_mk_deg :
      Turing.MultiTapeTM.ComputableInDegree (fun (p : ℕ × ℕ × ℕ × ℕ × ℕ × ℕ × ℕ × ℕ) => { maxVerts := p.1, m := p.2.1, r := p.2.2.1, d := p.2.2.2.1, c := p.2.2.2.2.1, h := p.2.2.2.2.2.1, p := p.2.2.2.2.2.2.1, q := p.2.2.2.2.2.2.2 }) encTannerParityParamsFields encTannerParityParams 1 1
      theorem Cslib.Complexity.TannerSearch.encTannerParityParams_q_budget {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → TannerParityParams} :
      theorem Cslib.Complexity.TannerSearch.encTannerParityParams_r_budget {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → TannerParityParams} :

      End-to-end ComputableInO certificate for tannerParityTestsWithBound on TannerParityParams: runs in time 2 ^ (d * r + r + c * d + d) times a polynomial and polynomial space (including the O(maxVerts · c · m) output).