Documentation

Complexitylib.RationalHitting

Rational hitting lists, nonzeroness, and admissibility #

OpenAI's source constructs one uniform polynomial-time generator of rational matrix hitting lists for noncommutative rational formulas: https://github.com/openai/math/blob/adc7f1241b42e322a6451854ab7e4b4c146bf78a/lean/OAI/Computability/RationalHitting/Main.lean

The source runtime counts ordinary transitions of a fixed finite-state Mathlib TM0 machine. Its inputs are two unary parameters separated by a nonblank symbol, and its output is the complete canonical binary encoding of the list. Complexitylib.RationalHitting.PolynomialTime transfers this generator to canonical FP, returning empty output on malformed binary inputs.

The additional executable tests decide nonzeroness and admissibility using exact rational matrix evaluation. The latter needs a list for two extra syntax nodes: if f has a defined value, either f or f + 1 has a nonzero value. Their correctness theorems do not assert polynomial bit complexity of evaluation. These are deductions from the source result, without a claim of new priority.

The explicit, executable list of rational matrix substitutions.

Equations
Instances For

    The generated list hits every nonzero formula of bounded size with an invertible value.

    The generated matrices have polynomially bounded dimension.

    The complete reduced-rational binary encoding has polynomial length.

    theorem Complexity.RationalHitting.exists_uniform_generator :
    ∃ (m : ℕ) (G : Machine m) (C : ℕ) (k : ℕ), 0 < C ∧ 0 < k ∧ ∀ (n s : ℕ), 1 ≤ n → 1 ≤ s → OutputsWithin G s (C * (n + s + 1) ^ k) (hittingList n s)

    A fixed finite-state Mathlib machine generates these exact lists in polynomial bit time.

    OpenAI's combined dimension, encoding-length, hitting, and finite-machine runtime theorem.

    Some matrix evaluation of the inverse is defined exactly when the formula is nonzero.

    theorem Complexity.RationalHitting.Admissible.exists_dimension_le {n : ℕ} {f : Formula n} (hf : Admissible f) :
    ∃ (d : ℕ), 0 < d ∧ d ≤ 256 * (n + f.size + 3) ^ 10 ∧ ∃ (X : Tuple n d) (v : Mat d), Evaluates f X v

    Every nonempty matrix domain has a witness of polynomially bounded dimension.

    Test whether the formula has a defined positive-dimensional rational matrix evaluation.

    Equations
    Instances For

      Test whether the formula has a defined nonzero rational matrix evaluation.

      Equations
      Instances For

        The generated finite domain test is correct, with no promise on the formula.

        The generated finite nonzeroness test is correct, with no admissibility promise.

        @[instance_reducible]

        Computed decidability of the existence of a defined matrix evaluation.

        Equations
        @[instance_reducible]

        Computed decidability of the existence of a defined nonzero matrix evaluation.

        Equations