Documentation

HexBareiss.Kernel

inductive Hex.Matrix.DetWitness (R : Type := Int) :

A kernel-checkable determinant certificate. See the module docstring.

  • triangular {R : optParam Type Int} (swaps : List (Nat × Nat)) (transform : List (List R)) (value : R) : DetWitness R

    A triangularization: the row swaps in application order, the rows of the lower triangular transform (row i holds its i + 1 leading entries), and the value.

  • singular {R : optParam Type Int} (vec : List R) : DetWitness R

    A nonzero left kernel vector: the value is 0.

Instances For
    Equations
    • One or more equations did not get rendered due to their size.
    Instances For
      @[instance_reducible]
      instance Hex.Matrix.instReprDetWitness {R✝ : Type} [Repr R✝] :
      Equations

      The certified value.

      Equations
      Instances For

        Row i of a row list, [] past the end.

        Equations
        Instances For

          Entry j of a row, 0 past the end.

          Equations
          Instances For

            Row i replaced by r; unchanged past the end.

            Equations
            Instances For

              Every swap exchanges two distinct rows below n.

              Equations
              Instances For

                The sign of the arrangement: (-1)^(number of swaps).

                Equations
                Instances For

                  The row is orthogonal to every column in the list.

                  Equations
                  Instances For

                    Walk the transform rows against the columns of the arranged matrix. Row i (with done the i columns already passed, in any order) must have length i + 1, a nonzero last entry lᵢ, and zero products with the earlier columns; its product with column i is the diagonal entry uᵢ of the triangular product. pl and pu accumulate ∏ lᵢ and sign · ∏ uᵢ, and at the end pl · d = pu is required.

                    Equations
                    Instances For
                      def Hex.Matrix.DetWitness.triangularCheckPacked (W r : Nat) (d : Int) :
                      List (Nat × Nat) → Nat → List (List Int) → List (Nat × Nat) → List (Nat × Nat) → Int → Int → Bool

                      triangularCheck with the dot products on packed pairs: tps the packed rows of the transform alongside its rows ts, done and cs the packed columns.

                      Equations
                      Instances For

                        Every row of A scaled by its positive scale is the row of B.

                        Equations
                        Instances For

                          The kernel checker. A is the matrix as a list of n rows of length n. Checks the shape, and then either the triangularization or the left kernel vector; see the module docstring.

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

                            The kernel checker with the triangularization on packed rows, slot width W and entry bound k: checkDetList with triangularCheck replaced by triangularCheckPacked, plus the bounds that make the packed dot products exact: every entry of the matrix and of the transform below k in absolute value, k > 0, and n · k² < 2^W. The singular branch is unchanged. A passing packed check implies a passing checkDetList; see the companion's checkDetList_of_packed.

                            Equations
                            • One or more equations did not get rendered due to their size.
                            Instances For
                              def Hex.Matrix.checkDetRatPacked (W k n : Nat) (A : List (List Rat)) (s : List Nat) (B : List (List Int)) (c : DetWitness) (v : Rat) :

                              checkDetRat with the packed integer check.

                              Equations
                              • One or more equations did not get rendered due to their size.
                              Instances For
                                def Hex.Matrix.checkDetRat (n : Nat) (A : List (List Rat)) (s : List Nat) (B : List (List Int)) (c : DetWitness) (v : Rat) :

                                The kernel checker for a rational matrix A given as n rows: the scales s take the rows of A to the rows of the integer matrix B, which c certifies, and the value v satisfies v · ∏ s = value c.

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

                                  Independent limits on current elimination blocks and the emitted witness.

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

                                            Resource declines remain distinct from malformed input or a rejected witness.

                                            Instances For
                                              Equations
                                              • One or more equations did not get rendered due to their size.
                                              Instances For
                                                Equations
                                                Instances For
                                                  def Hex.Matrix.DetWitness.measure {R : Type} (size : R → Nat) :

                                                  Total serialized support, including the value in the triangular case.

                                                  Equations
                                                  Instances For
                                                    def Hex.Matrix.detWitnessBudgeted {R : Type} [Zero R] [One R] [Neg R] [Sub R] [Mul R] [Inhabited R] [DecidableEq R] (quot : R → R → R) (n : Nat) (size : R → Nat) (budget : DetWitness.Budget) (check : List (List R) → DetWitness R → Bool) (A : List (List R)) :

                                                    Fraction-free production with operand admission, block support and witness limits. The final self-check runs only after the witness fits its budget.

                                                    Equations
                                                    Instances For
                                                      theorem Hex.Matrix.detWitnessBudgeted_check {R : Type} [Zero R] [One R] [Neg R] [Sub R] [Mul R] [Inhabited R] [DecidableEq R] (quot : R → R → R) (n : Nat) (size : R → Nat) (budget : DetWitness.Budget) (check : List (List R) → DetWitness R → Bool) (A : List (List R)) (w : DetWitness R) (h : detWitnessBudgeted quot n size budget check A = Except.ok w) :
                                                      check A w = true
                                                      def Hex.Matrix.detWitnessWith {R : Type} [Zero R] [One R] [Neg R] [Sub R] [Mul R] [Inhabited R] [DecidableEq R] (quot : R → R → R) (n : Nat) (check : List (List R) → DetWitness R → Bool) (A : List (List R)) :

                                                      The unlimited instance of the same producer, retaining the integer API.

                                                      Equations
                                                      • One or more equations did not get rendered due to their size.
                                                      Instances For
                                                        theorem Hex.Matrix.detWitnessWith_check {R : Type} [Zero R] [One R] [Neg R] [Sub R] [Mul R] [Inhabited R] [DecidableEq R] (quot : R → R → R) (n : Nat) (check : List (List R) → DetWitness R → Bool) (A : List (List R)) (w : DetWitness R) (h : detWitnessWith quot n check A = Except.ok w) :
                                                        check A w = true

                                                        Every successful producer return has passed its supplied checker. This does not assume the quotient implementation is correct: a rejected witness is returned as an error.

                                                        The integer instance of the generic witness producer.

                                                        Equations
                                                        Instances For

                                                          The kernel witness of a square integer matrix.

                                                          Equations
                                                          Instances For