Documentation

Complexitylib.RationalHitting.Internal.EncodingBounds

Rational hitting lists: encoding bounds #

Adapted from OpenAI's formalization at revision adc7f1241b42e322a6451854ab7e4b4c146bf78a. Source: https://github.com/openai/math/blob/adc7f1241b42e322a6451854ab7e4b4c146bf78a/lean/OAI/Computability/RationalHitting/EncodingBounds.lean

Imports, namespaces, module visibility, documentation, and formatting are adapted for complexitylib. The source theorem statements and mathematical arguments are retained.

theorem Complexity.RationalHitting.EncodingBounds.encodeRat_ratio_le (a b : ℤ) (hb : b ≠ 0) (L : ℕ) (ha : a.natAbs < 2 ^ L) (hb' : b.natAbs < 2 ^ L) :
theorem Complexity.RationalHitting.EncodingBounds.determinant_bound {d : ℕ} (A : Matrix (Fin d) (Fin d) ℤ) (B : ℕ) (hA : ∀ (i j : Fin d), |A i j| ≤ ↑B) :
|A.det| ≤ ↑d.factorial * ↑B ^ d
theorem Complexity.RationalHitting.EncodingBounds.normalized_entry_ratio {d : ℕ} (A B : Matrix (Fin d) (Fin d) ℤ) (hA : A.det ≠ 0) (i j : Fin d) :
((A.map ⇑(Int.castRingHom ℚ))⁻¹ * B.map ⇑(Int.castRingHom ℚ)) i j = Rat.divInt (A.updateCol i fun (k : Fin d) => B k j).det A.det

Cramer's rule used by the generator, without any assumption on arithmetic algorithms.

theorem Complexity.RationalHitting.EncodingBounds.determinant_pow_bound {d b : ℕ} (A : Matrix (Fin d) (Fin d) ℤ) (hA : ∀ (i j : Fin d), |A i j| ≤ 2 ^ b) :
|A.det| < 2 ^ (d * d + d * b + 1)
theorem Complexity.RationalHitting.EncodingBounds.normalization_bit_bound {d b : ℕ} (A B : Matrix (Fin d) (Fin d) ℤ) (hA : A.det ≠ 0) (hAb : ∀ (i j : Fin d), |A i j| ≤ 2 ^ b) (hBb : ∀ (i j : Fin d), |B i j| ≤ 2 ^ b) (i j : Fin d) :
(encodeRat (((A.map ⇑(Int.castRingHom ℚ))⁻¹ * B.map ⇑(Int.castRingHom ℚ)) i j)).length ≤ 4 * (d * d + d * b + 1) + 3
theorem Complexity.RationalHitting.EncodingBounds.flatMap_length_le {α : Type u_1} {β : Type u_2} (l : List α) (f : α → List β) (B : ℕ) (h : ∀ a ∈ l, (f a).length ≤ B) :
theorem Complexity.RationalHitting.EncodingBounds.tuple_length_le {n d B : ℕ} (X : Tuple n d) (h : ∀ (a : Fin n) (i j : Fin d), (encodeRat (X a i j)).length ≤ B) :
(encodeTuple X).length ≤ n * d * d * B
theorem Complexity.RationalHitting.EncodingBounds.output_length_le {n B : ℕ} (H : Output n) (hb : ∀ X ∈ H.tuples, ∀ (a : Fin n) (i j : Fin H.dimension), (encodeRat (X a i j)).length ≤ B) :
theorem Complexity.RationalHitting.PolynomialBounds.mul_monomials (a b m i j : ℕ) :
a * m ^ i * (b * m ^ j) = a * b * m ^ (i + j)

Coefficient/exponent bookkeeping, with no symbolic expansion of large powers.

theorem Complexity.RationalHitting.PolynomialBounds.lift_power (c m i j : ℕ) (hm : 1 ≤ m) (hij : i ≤ j) :
c * m ^ i ≤ c * m ^ j

Exponent bounding all denominator-cleared matrix entries by a power of 2.

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

    Fixed coefficient bounding the binary logarithm of integral entry magnitudes.

    Equations
    Instances For

      Fixed coefficient in the bound on normalized rational entry encodings.

      Equations
      Instances For
        theorem Complexity.RationalHitting.PolynomialBounds.normalized_bits_bound (m D b : ℕ) (hm : 1 ≤ m) (hD : D ≤ 256 * m ^ 10) (hb : b ≤ logConstant * m ^ 22) :
        4 * (D * D + D * b + 1) + 3 ≤ bitConstant * m ^ 32

        Fixed coefficient in the bound on the complete binary output length.

        Equations
        Instances For
          theorem Complexity.RationalHitting.PolynomialBounds.output_bits_bound (n m D L B : ℕ) (hm : 1 ≤ m) (hn : n ≤ m) (hD : D ≤ 256 * m ^ 10) (hL : L ≤ 24577 ^ 3 * m ^ 51) (hB : B ≤ bitConstant * m ^ 32) :
          2 * (D + 1) + 1 + 2 * (L + 1) + 1 + L * n * D * D * B ≤ outputConstant * m ^ 104
          theorem Complexity.RationalHitting.Generator.U_power_bound (n N e H : ℕ) (x : Fin 3 → ℕ) (hH : 1 ≤ H) (hx : ∀ (l : Fin 3), x l ≤ H) (a : Fin (n + 1)) (i j : Fin (matrixDimension e)) :
          theorem Complexity.RationalHitting.Generator.tupleAt_bit_bound (n N e H : ℕ) (x : Fin 3 → ℕ) (hH : 1 ≤ H) (hx : ∀ (l : Fin 3), x l ≤ H) (hz : Matrix.det (rationalLift n N e x 0) ≠ 0) (a : Fin n) (i j : Fin (matrixDimension e)) :