Documentation

HexRowReduceTheory.Kernel

inductive HexMatrixTheory.InverseResult {F : Type u} [Field F] {n : ℕ} (A : Matrix (Fin n) (Fin n) F) :

A certified inverse or a certified nonzero right-kernel vector.

Instances For
    inductive HexMatrixTheory.SolveResult {F : Type u} [Field F] {n m : ℕ} (A : Matrix (Fin n) (Fin m) F) (b : Fin n → F) :

    The complete affine solution space or a certified separating row.

    Instances For
      def HexMatrixTheory.SolveResult.statement {F : Type u} [Field F] {n m : ℕ} {A : Matrix (Fin n) (Fin m) F} {b : Fin n → F} :

      The full mathematical statement certified by either solve outcome.

      Equations
      Instances For
        theorem HexMatrixTheory.SolveResult.spec {F : Type u} [Field F] {n m : ℕ} {A : Matrix (Fin n) (Fin m) F} {b : Fin n → F} (r : SolveResult A b) :

        Extract completeness or impossibility while retaining the literal result data.

        Decoding belongs to soundness, outside the arithmetic reduction path.

        Equations
        Instances For

          Arbitrary accepted scaled products transport to Mathlib multiplication.

          The scaled identity check supplies the matrix inverse equation.

          theorem HexMatrixTheory.FieldCertificate.inv_eq {F : Type u} [Field F] {n : ℕ} {A B : Matrix (Fin n) (Fin n) F} (hr : A * B = 1) (hl : B * A = 1) :
          A⁻¹ = B

          A two-sided inverse determines Mathlib's nonsingular inverse.

          theorem HexMatrixTheory.FieldCertificate.singular {F : Type u} [Field F] {n : ℕ} {A : Matrix (Fin n) (Fin n) F} {v : Fin n → F} (hv : v ≠ 0) (ha : A.mulVec v = 0) :
          A.det = 0 ∧ A⁻¹ = 0

          A nonzero kernel vector certifies determinant zero, including the empty boundary.

          theorem HexMatrixTheory.FieldCertificate.impossible {F : Type u} [Field F] {n m : ℕ} {A : Matrix (Fin n) (Fin m) F} {b y : Fin n → F} (hy : Matrix.vecMul y A = 0) (hb : y ⬝ᵥ b ≠ 0) :
          ¬∃ (x : Fin m → F), A.mulVec x = b

          A separating row rules out every solution by associativity.

          Transport the two independently checked separator conditions.

          The proof-facing reduced-row-echelon conditions extracted from a list check.

          Instances For
            @[reducible, inline]

            Reconstruct executable data only in the soundness layer.

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

              The checked basis is exactly the computed free-column basis of the reconstructed RREF.

              theorem HexMatrixTheory.FieldCertificate.affine {F : Type u} [Field F] {n m : ℕ} {M : Hex.Matrix F n m} {D : Hex.Matrix.RowEchelonData F n m} (E : M.IsRowReduced D) {b : Fin n → F} {value : Fin m → F} (hvalue : (matrixEquiv M).mulVec value = b) (x : Fin m → F) :
              (matrixEquiv M).mulVec x = b ↔ ∃! c : Fin (m - D.rank) → F, x = value + (matrixEquiv E.nullspaceMatrix).mulVec c

              Span completeness and independence give unique affine coordinates.

              All proof fields for one inverse outcome, bundled for a single kernel check.

              Equations
              • One or more equations did not get rendered due to their size.
              Instances For
                def HexMatrixTheory.SolveFacts {n m : ℕ} (A : Matrix (Fin n) (Fin m) ℚ) (b : Fin n → ℚ) :

                All proof fields for one solve outcome.

                Equations
                • One or more equations did not get rendered due to their size.
                Instances For
                  theorem HexMatrixTheory.inverse_facts {n : ℕ} (A : Matrix (Fin n) (Fin n) ℚ) (rows : List (List ℚ)) (c : Hex.Matrix.InverseWitness) (hA : A = ofLists n n rows) (hc : Hex.Matrix.checkInverseList n rows c = true) :

                  Soundness for both inverse certificate alternatives.

                  noncomputable def HexMatrixTheory.inverse_of_checkList {n : ℕ} (A : Matrix (Fin n) (Fin n) ℚ) (rows : List (List ℚ)) (c : Hex.Matrix.InverseWitness) (hA : A = ofLists n n rows) (hc : Hex.Matrix.checkInverseList n rows c = true) :

                  Accepted inverse-product and kernel certificates produce either certified outcome.

                  Equations
                  • One or more equations did not get rendered due to their size.
                  Instances For
                    theorem HexMatrixTheory.solve_of_checkList {n m : ℕ} (A : Matrix (Fin n) (Fin m) ℚ) (b : Fin n → ℚ) (x : Fin m → ℚ) (rows : List (List ℚ)) (rhs candidate : List ℚ) (hA : A = ofLists n m rows) (hb : b = vecOfList n rhs) (hx : x = vecOfList m candidate) (hc : Hex.Matrix.checkSolutionList n m rows rhs candidate = true) :
                    A.mulVec x = b

                    Direct residual soundness for literal matrices and vectors.

                    theorem HexMatrixTheory.solve_facts {n m : ℕ} (A : Matrix (Fin n) (Fin m) ℚ) (b : Fin n → ℚ) (rows : List (List ℚ)) (rhs : List ℚ) (c : Hex.Matrix.SolveWitness) (hA : A = ofLists n m rows) (hb : b = vecOfList n rhs) (hc : Hex.Matrix.checkSolveList n m rows rhs c = true) :

                    Soundness for both complete solve certificate alternatives.

                    noncomputable def HexMatrixTheory.solveResult_of_checkList {n m : ℕ} (A : Matrix (Fin n) (Fin m) ℚ) (b : Fin n → ℚ) (rows : List (List ℚ)) (rhs : List ℚ) (c : Hex.Matrix.SolveWitness) (hA : A = ofLists n m rows) (hb : b = vecOfList n rhs) (hc : Hex.Matrix.checkSolveList n m rows rhs c = true) :

                    Complete positive and negative outcomes from arbitrary accepted list data.

                    Equations
                    • One or more equations did not get rendered due to their size.
                    Instances For
                      def HexMatrixTheory.InverseResult.value? {F : Type u} [Field F] {n : ℕ} {A : Matrix (Fin n) (Fin n) F} :
                      InverseResult A → Option (Matrix (Fin n) (Fin n) F)

                      The inverse matrix, when present.

                      Equations
                      Instances For
                        def HexMatrixTheory.InverseResult.kernel? {F : Type u} [Field F] {n : ℕ} {A : Matrix (Fin n) (Fin n) F} :
                        InverseResult A → Option (Fin n → F)

                        The nonzero kernel witness in the singular branch.

                        Equations
                        Instances For
                          def HexMatrixTheory.SolveResult.data? {F : Type u} [Field F] {n m : ℕ} {A : Matrix (Fin n) (Fin m) F} {b : Fin n → F} :
                          SolveResult A b → Option ((k : ℕ) × (Fin m → F) × Matrix (Fin m) (Fin k) F)

                          Literal nullity, particular solution and basis, when the system is consistent.

                          Equations
                          Instances For
                            def HexMatrixTheory.SolveResult.separator? {F : Type u} [Field F] {n m : ℕ} {A : Matrix (Fin n) (Fin m) F} {b : Fin n → F} :
                            SolveResult A b → Option (Fin n → F)

                            The separating row in the inconsistent branch.

                            Equations
                            Instances For
                              theorem HexMatrixTheory.FieldCertificate.identify_matrix {n m : ℕ} (A : Matrix (Fin n) (Fin m) ℚ) (rows : List (List ℚ)) (s : Hex.Matrix.Lists.ScaledRows) (hA : A = ofLists n m rows) (hd : 0 < s.denom) (hs : Hex.Matrix.Lists.scaleRows s.denom rows s.nums = true) :
                              A = matrix n m s

                              A literal matrix is identified with its scaled encoding by cross products.

                              theorem HexMatrixTheory.FieldCertificate.identify_vector {n : ℕ} (v : Fin n → ℚ) (xs : List ℚ) (s : Hex.Matrix.Lists.Scaled) (hv : v = vecOfList n xs) (hd : 0 < s.denom) (hs : Hex.Matrix.Lists.scaleRow s.denom xs s.nums = true) :
                              v = vector n s

                              A literal vector is identified without normalizing decoded fractions.

                              theorem HexMatrixTheory.FieldCertificate.solve_literal {n m : ℕ} {A : Matrix (Fin n) (Fin m) ℚ} {b : Fin n → ℚ} {a : Hex.Matrix.Lists.ScaledRows} {rhs : Hex.Matrix.Lists.Scaled} {d : Hex.Matrix.SolveBasis} {v : Fin m → ℚ} {B : Matrix (Fin m) (Fin d.nullity) ℚ} (h : SolveFacts A b (Hex.Matrix.SolveWitness.consistent a rhs d)) (hv : v = vector m d.value) (hB : B = matrix m d.nullity d.basis) :
                              A.mulVec v = b ∧ ∀ (x : Fin m → ℚ), A.mulVec x = b ↔ ∃! c : Fin d.nullity → ℚ, x = v + B.mulVec c
                              theorem HexMatrixTheory.FieldCertificate.separator_literal {n m : ℕ} {A : Matrix (Fin n) (Fin m) ℚ} {b y : Fin n → ℚ} {a : Hex.Matrix.Lists.ScaledRows} {rhs s : Hex.Matrix.Lists.Scaled} (h : SolveFacts A b (Hex.Matrix.SolveWitness.inconsistent a rhs s)) (hy : y = vector n s) :
                              Matrix.vecMul y A = 0 ∧ y ⬝ᵥ b ≠ 0 ∧ ¬∃ (x : Fin m → ℚ), A.mulVec x = b