Documentation

HexRowReduce.Api

def Hex.Matrix.spanCoeffs {R : Type u} {n m : Nat} [Lean.Grind.Field R] [DecidableEq R] (M : Matrix R n m) (v : Vector R m) :

Compute row-span coefficients using Hex.Matrix.rowReduce internally.

Equations
Instances For
    theorem Hex.Matrix.spanCoeffs_sound {R : Type u} {n m : Nat} [Lean.Grind.Field R] [DecidableEq R] (M : Matrix R n m) (v : Vector R m) (c : Vector R n) :
    M.spanCoeffs v = some cvecMul c M = v

    Soundness of Hex.Matrix.spanCoeffs: returned coefficients reconstruct the requested vector.

    def Hex.Matrix.spanContains {R : Type u} {n m : Nat} [Lean.Grind.Field R] [DecidableEq R] (M : Matrix R n m) (v : Vector R m) :

    Decide row-span membership using Hex.Matrix.rowReduce internally.

    Equations
    Instances For
      @[simp]
      theorem Hex.Matrix.spanContains_eq_isSome {R : Type u} {n m : Nat} [Lean.Grind.Field R] [DecidableEq R] (M : Matrix R n m) (v : Vector R m) :

      Hex.Matrix.spanContains is the Boolean isSome view of Hex.Matrix.spanCoeffs.

      theorem Hex.Matrix.spanContains_iff {R : Type u} {n m : Nat} [Lean.Grind.Field R] [DecidableEq R] (M : Matrix R n m) (v : Vector R m) :

      Hex.Matrix.spanContains is exactly row-span membership.

      theorem Hex.Matrix.spanCoeffs_eq_none_iff {R : Type u} {n m : Nat} [Lean.Grind.Field R] [DecidableEq R] (M : Matrix R n m) (v : Vector R m) :

      Hex.Matrix.spanCoeffs returns none exactly when v is in no row combination of M, so a none result certifies that v is not in the row span.

      def Hex.Matrix.rowReduce_rank {R : Type u} {n m : Nat} [Lean.Grind.Field R] [DecidableEq R] (M : Matrix R n m) :

      The rank returned by Hex.Matrix.rowReduce.

      Equations
      Instances For
        theorem Hex.Matrix.rowReduce_rank_eq_n_of_rightInverse {R : Type u} {n m : Nat} [Lean.Grind.Field R] [DecidableEq R] (M : Matrix R n m) (Q : Matrix R m n) (hMQ : M * Q = Matrix.identity n) :

        A matrix with a right inverse has full row rank.

        theorem Hex.Matrix.takeRows_mul {R : Type u} {n m k : Nat} [Lean.Grind.Field R] [DecidableEq R] (A : Matrix R n m) (B : Matrix R m k) (r : Nat) (hr : r n) :
        (A * B).takeRows r hr = A.takeRows r hr * B

        If row reduction finds full column rank, the leading square block of the reduced echelon form is the identity.

        theorem Hex.Matrix.rowReduce_rank_le_of_eq_mul {R : Type u} {n m k : Nat} [Lean.Grind.Field R] [DecidableEq R] (M : Matrix R n m) (C : Matrix R n k) (B : Matrix R k m) (hM : M = C * B) :

        The computed rank is no larger than the middle dimension of any matrix factorization.

        theorem Hex.Matrix.rowReduce_rank_le_of_rows_span {R : Type u} {n m k : Nat} [Lean.Grind.Field R] [DecidableEq R] (M : Matrix R n m) (B : Matrix R k m) (hspan : ∀ (i : Fin n), (c : Vector R k), vecMul c B = M.row i) :

        A spanning family bounds the computed rank: if every row of M is a combination of the rows of B, then M has rank at most the row count of B.

        theorem Hex.Matrix.rowReduce_rank_ge_of_rightInverse {R : Type u} {n m : Nat} [Lean.Grind.Field R] [DecidableEq R] (M : Matrix R n m) (Q : Matrix R m n) (hMQ : M * Q = Matrix.identity n) :

        A right inverse supplies the matching lower rank bound.

        The computed rank supplies an explicit factorization through that many coordinates.

        Row reduction computes the same rank for a matrix and its transpose.

        The public nullspace basis assembled as a matrix of basis columns.

        Equations
        Instances For
          def Hex.Matrix.nullspace {R : Type u} {n m : Nat} [Lean.Grind.Field R] [DecidableEq R] (M : Matrix R n m) :

          Compute the nullspace basis using Hex.Matrix.rowReduce internally.

          Equations
          Instances For
            theorem Hex.Matrix.nullspace_sound {R : Type u} {n m : Nat} [Lean.Grind.Field R] [DecidableEq R] (M : Matrix R n m) (k : Fin (m - M.rowReduce_rank)) :
            M * M.nullspace.get k = 0

            Every vector returned by Hex.Matrix.nullspace is annihilated by M.

            theorem Hex.Matrix.nullspace_ne_zero {R : Type u} {n m : Nat} [Lean.Grind.Field R] [DecidableEq R] (M : Matrix R n m) (k : Fin (m - M.rowReduce_rank)) :

            Every vector in the computed nullspace basis is nonzero.

            theorem Hex.Matrix.nullspace_complete {R : Type u} {n m : Nat} [Lean.Grind.Field R] [DecidableEq R] (M : Matrix R n m) (v : Vector R m) :
            M * v = 0 (c : Vector R (m - M.rowReduce_rank)), M.nullspaceBasisMatrix * c = v

            Every vector annihilated by M is generated by the public nullspace basis matrix.