Documentation

Complexitylib.RationalHitting.Internal.DenseDeterminant

Rational hitting lists: dense determinant #

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

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

@[simp]
theorem Complexity.RationalHitting.StackLanguage.list_code_length_le {A : Type} [Coding A] (l : List A) (B : ℕ) (h : ∀ a ∈ l, (code a).length ≤ B) :
(code l).length ≤ l.length * (2 * B + 1)
theorem Complexity.RationalHitting.StackLanguage.drop_headD_getElem {A : Type} (l : List A) (z : A) (i : ℕ) (hi : i < l.length) :
(List.drop i l).headD z = l[i]
theorem Complexity.RationalHitting.StackLanguage.finRows_access {A : Type} (z : A) {n : ℕ} (f : Fin n → A) (i : Fin n) :
(List.drop (↑i) (List.map f (List.finRange n))).headD z = f i

A square integer matrix carrying its dimension.

Instances For

    Enumerate the matrix entries as a list of rows.

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

      Read a matrix entry, returning zero outside the stored dimension.

      Equations
      Instances For
        theorem Complexity.RationalHitting.StackLanguage.DenseSquare.code_length_le (a : DenseSquare) (b : ℕ) (h : ∀ (i j : Fin a.dim), (a.val i j).natAbs.bits.length ≤ b) :
        (code a).length ≤ 4 * a.dim ^ 2 * b + 14 * a.dim ^ 2 + 3 * a.dim + 1
        theorem Complexity.RationalHitting.StackLanguage.Poly.denseBuild {A : Type} [Coding A] {n : A → Unary} {f : A × Unary × Unary → ℤ} (hn : Poly n) (hf : Poly f) :
        Poly fun (a : A) => { dim := (n a).val, val := fun (i j : Fin (n a).val) => f (a, { val := ↑i }, { val := ↑j }) }
        theorem Complexity.RationalHitting.StackLanguage.Poly.sumRange {A : Type} [Coding A] {f : A × Unary → ℤ} (hf : Poly f) :
        Poly fun (a : Unary × A) => (List.map (fun (i : ℕ) => f (a.2, { val := i })) (List.range a.1.val)).sum

        Package an indexed matrix with its dimension.

        Equations
        Instances For

          One Bird determinant stage on dimension-carrying matrices.

          Equations
          Instances For
            theorem Complexity.RationalHitting.StackLanguage.sum_diag_range (A F : DenseSquare) (i : Fin A.dim) :
            (List.map (fun (k : ℕ) => if ↑i < k then F.get k k else 0) (List.range A.dim)).sum = ∑ k > i, F.get ↑k ↑k
            theorem Complexity.RationalHitting.StackLanguage.sum_product_range (A F : DenseSquare) (i j : Fin A.dim) :
            (List.map (fun (k : ℕ) => if ↑i < k then F.get (↑i) k * A.get k ↑j else 0) (List.range A.dim)).sum = ∑ k > i, F.get ↑i ↑k * A.val k j
            theorem Complexity.RationalHitting.StackLanguage.DenseSquare.step_get_bound (A F : DenseSquare) (B C : ℕ) (hA : ∀ (i j : ℕ), |A.get i j| ≤ ↑B) (hF : ∀ (i j : ℕ), |F.get i j| ≤ ↑C) (i j : ℕ) :
            |(A.step F).get i j| ≤ ↑(2 * A.dim * B * C)
            theorem Complexity.RationalHitting.StackLanguage.DenseSquare.iterate_get_bound (A F : DenseSquare) (b : ℕ) (hA : ∀ (i j : ℕ), |A.get i j| ≤ 2 ^ b) (hF : ∀ (i j : ℕ), |F.get i j| ≤ 2 ^ b) (k i j : ℕ) :
            |(A.step^[k] F).get i j| ≤ 2 ^ (b + k * (1 + A.dim + b))
            theorem Complexity.RationalHitting.StackLanguage.DenseSquare.iterate_code_bound (A F : DenseSquare) (b k : ℕ) (hA : (code A).length ≤ b) (hF : (code F).length ≤ b) :
            (code (A.step^[k + 1] F)).length ≤ 4 * A.dim ^ 2 * (b + (k + 1) * (1 + A.dim + b) + 1) + 14 * A.dim ^ 2 + 3 * A.dim + 1

            Advance the Bird stage while preserving the original matrix.

            Equations
            Instances For

              The executable determinant obtained from bounded Bird iteration.

              Equations
              Instances For