Documentation

Complexitylib.RationalHitting.Internal.MatrixComputation

Rational hitting lists: matrix computation #

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

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

Consume one inner list and append it to the flattening accumulator.

Equations
Instances For
    theorem Complexity.RationalHitting.StackLanguage.Poly.listFlatMap {A : Type} [Coding A] {B C : Type} [Coding B] [Coding C] [Inhabited B] {f : C × B → List A} (hf : Poly f) :
    Poly fun (a : C × List B) => List.flatMap (fun (b : B) => f (a.1, b)) a.2

    Consume one word and append it to a concatenation accumulator.

    Equations
    Instances For

      Return the raw self-delimiting encoding of a binary natural word.

      Equations
      • One or more equations did not get rendered due to their size.
      Instances For
        @[reducible, inline]

        Three unary coordinates of an integer specialization point.

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

          Read a grid-point record as a function on three coordinates.

          Equations
          Instances For

            Compute the dense integral matrix at the given grid point and variable index.

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

              Compute a Cramer numerator by replacing one matrix column.

              Equations
              Instances For
                theorem Complexity.RationalHitting.StackLanguage.Runtime.cramer_of {d : ℕ} (A B : Matrix (Fin d) (Fin d) ℤ) (i j : Fin d) :
                cramer (DenseSquare.of A) (DenseSquare.of B) ↑i ↑j = DenseSquare.of (A.updateCol i fun (r : Fin d) => B r j)
                theorem Complexity.RationalHitting.StackLanguage.Runtime.cramer_det_of {d : ℕ} (A B : Matrix (Fin d) (Fin d) ℤ) (i j : Fin d) :
                (cramer (DenseSquare.of A) (DenseSquare.of B) ↑i ↑j).val.det = (A.updateCol i fun (r : Fin d) => B r j).det
                theorem Complexity.RationalHitting.StackLanguage.Runtime.cramer_encode_of {d : ℕ} (A B : Matrix (Fin d) (Fin d) ℤ) (den : ℤ) (i j : Fin d) :
                encodeRat (Rat.divInt (cramer (DenseSquare.of A) (DenseSquare.of B) ↑i ↑j).val.det den) = encodeRat (Rat.divInt (A.updateCol i fun (r : Fin d) => B r j).det den)