Documentation

Complexity.Computability.PolyTime.LinearAlgebra.ExchangeReplacement

Polynomial-time construction of auxiliary exchange matrices and replacement rows #

Executable pure-integer counterparts, Lemma 4.6 magnitude and bit-length bounds, and plain Turing.MultiTapeTM.ComputableInPolyTime certificates for the auxiliary measurement matrix C^B (measurementMatrix), swap-interpolation matrix (R - 1)! M_0 (M0ScaledInt), common denominator d_den = (R - 1)! Q! (commonDenom), and cleared replacement rows d_den · P⃗_u(T) (auxReplacementRowScaledInt) from §§4.1–4.3 and §4.6 (Lemmas 4.1, 4.3, 4.6, and 4.7, pp. 27–29, 33–34) of OpenAI, The Exponential Time Hypothesis is False. Plain ComputableInPolyTime certificates cover the concrete Nat- and List-encoded routines (decodeAuxDigits, encodeAuxDigits, commonDenom, auxMeasurementRowsBounded, auxReplacementRowCoeffsDigits, auxReplacementRowCoeffsIdx, auxReplacementTableBounded), while AuxLabel wrappers and full-D aliases (auxMeasurementRows, auxReplacementTable) provide unencoded semantic bridges to Complexity.Foundations.LinearAlgebra.ExchangeReplacement.

Main definitions and results #

References #

1. Mixed-radix AuxLabel encoding and decoding #

Decode idx in base r into two length-Q digit lists (u₁, u₂) via Cslib.Radix.digit. Total for all r, idx: extracts the low 2 * Q digits idx / r ^ i % r when idx ≥ r ^ (2 * Q) (0 digits at r = 1; at r = 0, slot 0 is idx when 0 < Q and higher slots are 0).

Instances For

    Pack a pair of base-r digit lists (u₁, u₂) into a natural number via Nat.ofDigits.

    Instances For

      Convert u : AuxLabel Q r to its pair of length-Q natural-number digit lists.

      Instances For

        Pack u : AuxLabel Q r into its mixed-radix index < r ^ (2 * Q).

        Instances For
          def Cslib.LinearAlgebra.decodeAuxLabel {Q r : ℕ} (hD : 0 < r ^ (2 * Q)) (idx : ℕ) :

          Decode an index idx : ℕ into AuxLabel Q r whenever 0 < r ^ (2 * Q).

          Instances For
            @[simp]

            First coordinate list of decodeAuxDigits Q r idx has length Q.

            @[simp]

            Second coordinate list of decodeAuxDigits Q r idx has length Q.

            theorem Cslib.LinearAlgebra.mem_fst_decodeAuxDigits_lt {Q r idx a : ℕ} (hr : 1 ≤ r) (ha : a ∈ (decodeAuxDigits Q r idx).1) :
            a < r

            Every digit in (decodeAuxDigits Q r idx).1 is strictly less than r when 1 ≤ r.

            theorem Cslib.LinearAlgebra.mem_snd_decodeAuxDigits_lt {Q r idx a : ℕ} (hr : 1 ≤ r) (ha : a ∈ (decodeAuxDigits Q r idx).2) :
            a < r

            Every digit in (decodeAuxDigits Q r idx).2 is strictly less than r when 1 ≤ r.

            theorem Cslib.LinearAlgebra.encodeAuxDigits_lt {Q r : ℕ} {u : List ℕ × List ℕ} (hu₁ : u.1.length = Q) (hu₂ : u.2.length = Q) (hb₁ : ∀ a ∈ u.1, a < r) (hb₂ : ∀ a ∈ u.2, a < r) (hQr : Q = 0 ∨ 1 ≤ r) :
            encodeAuxDigits r u < r ^ (2 * Q)

            A pair of length-Q digit lists < r encodes below r ^ (2 * Q) when Q = 0 ∨ 1 ≤ r.

            theorem Cslib.LinearAlgebra.decodeAuxDigits_encodeAuxDigits {Q r : ℕ} {u : List ℕ × List ℕ} (hu₁ : u.1.length = Q) (hu₂ : u.2.length = Q) (hb₁ : ∀ a ∈ u.1, a < r) (hb₂ : ∀ a ∈ u.2, a < r) :

            Decoding encodeAuxDigits r u recovers u for every pair of length-Q digit lists < r.

            theorem Cslib.LinearAlgebra.encodeAuxDigits_decodeAuxDigits {Q r idx : ℕ} (hidx : idx < r ^ (2 * Q)) :

            Encoding decodeAuxDigits Q r idx recovers idx for every idx < r ^ (2 * Q).

            @[simp]

            Converting decodeAuxLabel hD idx back to digits yields decodeAuxDigits Q r idx.

            Every u : AuxLabel Q r encodes to an index strictly less than r ^ (2 * Q).

            @[simp]

            Left-inverse identity for decodeAuxLabel and encodeAuxLabel.

            @[simp]
            theorem Cslib.LinearAlgebra.encodeAuxLabel_decodeAuxLabel {Q r idx : ℕ} (hD : 0 < r ^ (2 * Q)) (hidx : idx < r ^ (2 * Q)) :

            Right-inverse identity for encodeAuxLabel and decodeAuxLabel on idx < r ^ (2 * Q).

            Computable mixed-radix equivalence between AuxLabel Q r and Fin (r ^ (2 * Q)).

            Instances For

              2. Common denominator bit-length bounds (commonDenom) #

              theorem Cslib.LinearAlgebra.size_commonDenom_le (Q R : ℕ) :
              (commonDenom Q R).size ≤ (R - 1) * (R - 1).size + Q * Q.size + 2

              Binary bit-length bound for commonDenom Q R = (R - 1)! * Q! (Lemma 4.6, p. 33).

              Encoded encIntBin bit-length bound for (commonDenom Q R : ℤ).

              3. Executable {0, 1, -1} measurement matrix C^B #

              Executable 1-slot {0, 1, -1} basis value on natural-number digits α δ x y : ℕ.

              Instances For

                Executable {0, 1, -1} entry ψ_β(u) on digit lists β, u (missing digits read as 0).

                Instances For

                  Antisymmetric slot count #{s < Q | β.2[s] < β.1[s]} on digits β (missing digits 0).

                  Instances For

                    Measurement row indices outside Ico A₀ (A₀ + R), truncated to < min D_cap (r ^ (2 * Q)).

                    Instances For

                      Full list of measurement row indices < r ^ (2 * Q) outside Finset.Ico A₀ (A₀ + R).

                      Instances For

                        Executable {0, 1, -1} measurement matrix C^B truncated below min D_cap (r ^ (2 * Q)).

                        Instances For

                          Executable {0, 1, -1} measurement matrix C^B of Lemma 4.1 (p. 28).

                          Instances For
                            theorem Cslib.LinearAlgebra.pairBasisNat_mem (α δ x y : ℕ) :
                            pairBasisNat α δ x y = 0 ∨ pairBasisNat α δ x y = 1 ∨ pairBasisNat α δ x y = -1

                            Every value of pairBasisNat lies in {0, 1, -1}.

                            Every entry of eigenvecDigits lies in {0, 1, -1}.

                            theorem Cslib.LinearAlgebra.auxMeasurementRowsBounded_eq_auxMeasurementRows {D_cap Q r A₀ R : ℕ} (h : r ^ (2 * Q) ≤ D_cap) :
                            auxMeasurementRowsBounded D_cap Q r A₀ R = auxMeasurementRows Q r A₀ R

                            When r ^ (2 * Q) ≤ D_cap, auxMeasurementRowsBounded equals auxMeasurementRows.

                            theorem Cslib.LinearAlgebra.decodeAuxLabel_mem_measurementIndices_iff {Q r A₀ R b_idx : ℕ} (hb : b_idx < r ^ (2 * Q)) :
                            decodeAuxLabel ⋯ b_idx ∈ measurementIndices Q r A₀ R ↔ b_idx ∈ auxMeasurementIndices Q r A₀ R

                            Characterization of membership in auxMeasurementIndices Q r A₀ R via measurementIndices.

                            auxMeasurementRows Q r A₀ R is a #(measurementIndices Q r A₀ R) × r ^ (2 * Q) table.

                            theorem Cslib.LinearAlgebra.mem_auxMeasurementRowsBounded_mem {D_cap Q r A₀ R : ℕ} {row : List ℤ} {c : ℤ} (hrow : row ∈ auxMeasurementRowsBounded D_cap Q r A₀ R) (hc : c ∈ row) :
                            c = 0 ∨ c = 1 ∨ c = -1

                            Every entry of auxMeasurementRowsBounded D_cap Q r A₀ R belongs to {0, 1, -1}.

                            theorem Cslib.LinearAlgebra.abs_mem_auxMeasurementRowsBounded_le_one {D_cap Q r A₀ R : ℕ} {row : List ℤ} {c : ℤ} (hrow : row ∈ auxMeasurementRowsBounded D_cap Q r A₀ R) (hc : c ∈ row) :
                            |c| ≤ 1

                            Every entry of auxMeasurementRowsBounded D_cap Q r A₀ R has absolute value at most 1.

                            theorem Cslib.LinearAlgebra.rowEntry_auxMeasurementRows {Q r A₀ R i u_idx : ℕ} (hi : i < (auxMeasurementIndices Q r A₀ R).length) (hu : u_idx < r ^ (2 * Q)) :

                            In-bounds entry correspondence (i < length, u_idx < r ^ (2 * Q)) between auxMeasurementRows and eigenvecInt via Cslib.rowEntry (0 out of bounds).

                            theorem Cslib.LinearAlgebra.measurementMatrix_mulVec_eq_zero_iff_auxMeasurementRows (Q r A₀ R : ℕ) (K : Type u_1) [CommRing K] (ξ : AuxLabel Q r → K) :
                            (measurementMatrix Q r A₀ R K).mulVec ξ = 0 ↔ ∀ row ∈ auxMeasurementRows Q r A₀ R, ∑ u : AuxLabel Q r, ↑(row.getD (encodeAuxLabel u) 0) * ξ u = 0

                            Kernel correspondence: ξ lies in ker (measurementMatrix Q r A₀ R K) iff its inner product with every row in auxMeasurementRows Q r A₀ R vanishes.

                            4. Executable cleared integer replacement rows (auxReplacementRowCoeffs) #

                            Whether y lies in the swap orbit of (u.2, u.1) across slots < Q (missing digits 0).

                            Instances For

                              Number of off-diagonal slots s < Q where u.2[s] ≠ u.1[s] (missing digits read as 0).

                              Instances For

                                Number of mismatch slots s < Q where y.1[s] ≠ u.2[s] (missing digits read as 0).

                                Instances For

                                  One factor (2 W_0 - c I) on the (m + 1)-state Hamming-weight vector f of a swap orbit.

                                  Instances For

                                    Weight profile after multiplying ∏_{a < j} (2 W_0 - 2 (A₀ + a) I) on a swap orbit.

                                    Instances For

                                      Executable (R - 1)! M_0[u, y] entry summing j < R runs of the (m + 1)-state 1D swap-orbit DP fallingOrbitWeights (0 at R = 0; missing digits read as 0).

                                      Instances For

                                        Multiply a polynomial coefficient list p (constant term first) by (t - X).

                                        Instances For

                                          Executable integer coefficient list of Q! φ_{u,y}(T) = mismatchAnnihilatorScaledInt u y (missing digits at slots s ≥ length read as 0).

                                          Instances For

                                            Whether two digit-list pairs agree on their first Q slots (missing digits read as 0).

                                            Instances For

                                              Executable dense coefficient list (length max R 1) of d_den · P⃗_u(T)_y on digit lists, cleared by commonDenom Q R = (R - 1)! * Q! > 0 (at R = 0, (R - 1)! = 1 and length is 1; missing digits read as 0).

                                              Instances For

                                                Executable cleared integer replacement polynomial coefficients from mixed-radix indices.

                                                Instances For

                                                  Executable dense coefficient list (length max R 1) of auxReplacementRowScaledInt, cleared by commonDenom Q R = (R - 1)! * Q! > 0 (at R = 0, (R - 1)! = 1 and output length is 1).

                                                  Instances For

                                                    Executable D_len × D_len × max R 1 table of cleared replacement polynomials guarded by unary cap D_cap (truncating row and column indices to < D_len = min D_cap (r ^ (2 * Q))).

                                                    Instances For

                                                      Full D × D × max R 1 table of cleared integer replacement polynomials.

                                                      Instances For

                                                        4.1 Correctness of the 1D swap-orbit DP for M0ScaledInt #

                                                        @[simp]

                                                        m0ScaledIntDigits on auxLabelToDigits equals M0ScaledInt Q r A₀ R u y.

                                                        4.2 Correctness of mismatchAnnihilatorCoeffsDigits and auxReplacementRowCoeffs #

                                                        @[simp]
                                                        theorem Cslib.LinearAlgebra.length_auxReplacementRowCoeffs (Q r A₀ R : ℕ) (u y : AuxLabel Q r) :
                                                        (auxReplacementRowCoeffs Q r A₀ R u y).length = max R 1

                                                        Length of auxReplacementRowCoeffs is max R 1 (equal to R whenever 1 ≤ R).

                                                        Degree of mismatchAnnihilatorScaledInt u y is at most #(mismatchSet u y).

                                                        theorem Cslib.LinearAlgebra.getD_auxReplacementRowCoeffs (Q r A₀ R : ℕ) (u y : AuxLabel Q r) (k : ℕ) :
                                                        (auxReplacementRowCoeffs Q r A₀ R u y).getD k 0 = (auxReplacementRowScaledInt Q r A₀ R u y).coeff k

                                                        Exact coefficient equality between auxReplacementRowCoeffs and auxReplacementRowScaledInt.

                                                        @[simp]

                                                        Reconstructing a polynomial from auxReplacementRowCoeffs Q r A₀ R u y gives auxReplacementRowScaledInt Q r A₀ R u y unconditionally.

                                                        theorem Cslib.LinearAlgebra.auxReplacementTableBounded_eq_auxReplacementTable {D_cap Q r A₀ R : ℕ} (h : r ^ (2 * Q) ≤ D_cap) :

                                                        When r ^ (2 * Q) ≤ D_cap, auxReplacementTableBounded equals auxReplacementTable.

                                                        theorem Cslib.LinearAlgebra.getD_auxReplacementTable {Q r A₀ R u_idx y_idx : ℕ} (hu : u_idx < r ^ (2 * Q)) (hy : y_idx < r ^ (2 * Q)) :
                                                        ((auxReplacementTable Q r A₀ R).getD u_idx []).getD y_idx [] = auxReplacementRowCoeffs Q r A₀ R (decodeAuxLabel ⋯ u_idx) (decodeAuxLabel ⋯ y_idx)

                                                        Exact entry lookup in auxReplacementTable Q r A₀ R for u_idx, y_idx < r ^ (2 * Q).

                                                        4.3 Coefficient magnitude, coeffNorm1 bridge, and bit-length bounds (Lemma 4.6) #

                                                        theorem Cslib.LinearAlgebra.natAbs_m0ScaledIntDigits_le (Q A₀ R : ℕ) (u y : List ℕ × List ℕ) :
                                                        (m0ScaledIntDigits Q A₀ R u y).natAbs ≤ (R - 1).factorial * R * (2 * (Q + A₀ + R)) ^ (R - 1)

                                                        Unconditional magnitude bound on m0ScaledIntDigits Q A₀ R u y.

                                                        Polynomial ℓ₁ bound ‖Q! φ_{u,y}‖₁ ≤ 2 ^ Q * Q! on mismatchAnnihilatorCoeffsDigits (Lemma 4.6, p. 33).

                                                        @[simp]

                                                        Exact equality between the list ℓ₁ sum of auxReplacementRowCoeffs and Polynomial.coeffNorm1 of auxReplacementRowScaledInt.

                                                        theorem Cslib.LinearAlgebra.natAbs_mem_auxReplacementRowCoeffsDigits_le {Q A₀ R : ℕ} {u y : List ℕ × List ℕ} {c : ℤ} (hc : c ∈ auxReplacementRowCoeffsDigits Q A₀ R u y) :
                                                        c.natAbs ≤ commonDenom Q R * (1 + (1 + 2 ^ Q) * R * (2 * (Q + A₀ + R)) ^ (R - 1))

                                                        Unconditional magnitude bound on every coefficient of auxReplacementRowCoeffsDigits.

                                                        theorem Cslib.LinearAlgebra.length_encIntBin_mem_auxReplacementRowCoeffs_le {Q r A₀ R : ℕ} {u y : AuxLabel Q r} {c : ℤ} (hc : c ∈ auxReplacementRowCoeffs Q r A₀ R u y) :
                                                        (Turing.MultiTapeTM.encIntBin c).length ≤ (commonDenom Q R).size + Q + R.size + (R - 1) * (2 * (Q + A₀ + R)).size + 5

                                                        Explicit encIntBin bit-length bound for every coefficient of auxReplacementRowCoeffs (Lemma 4.6, p. 33).

                                                        theorem Cslib.LinearAlgebra.sum_row_natAbs_auxReplacementRowCoeffs_le {Q r A₀ R : ℕ} (hQ : 0 < Q) (hI : ∀ a < R - 1, A₀ + a ≤ Q) (u : AuxLabel Q r) :
                                                        ∑ y : AuxLabel Q r, (List.map Int.natAbs (auxReplacementRowCoeffs Q r A₀ R u y)).sum ≤ commonDenom Q R * (1 + (1 + 2 ^ Q) * R * (4 * Q) ^ (R - 1))

                                                        Row-ℓ₁ coefficient bound (Lemma 4.6, p. 33): when 0 < Q and ∀ a < R - 1, A₀ + a ≤ Q, the sum of absolute values across row u of auxReplacementRowCoeffs is at most commonDenom Q R * (1 + (1 + 2 ^ Q) * R * (4 * Q) ^ (R - 1)).

                                                        5. Plain polynomial-time certificates (Lemma 4.7, p. 34) #

                                                        commonDenom Q R = (R - 1)! * Q! is computable in polynomial time from unary (Q, R).

                                                        (commonDenom Q R : ℤ) is computable in polynomial time in encIntBin from unary (Q, R).

                                                        The D_len × D_len × max R 1 auxiliary replacement table (auxReplacementTableBounded, with D_len = min D_cap (r ^ (2 * Q)), giving the full D × D table when r ^ (2 * Q) ≤ D_cap) is computable in polynomial time from unary (D_cap, Q, r, A₀, R) (Lemma 4.7, p. 34).