Documentation

HexDeterminant.Minor

def Hex.Matrix.selectedSubmatrix {R : Type u} {n m k : Nat} (M : Matrix R n m) (rows : Vector (Fin n) k) (cols : Vector (Fin m) k) :
Matrix R k k

Square submatrix obtained by selecting arbitrary row and column index tuples. Strictly increasing tuples give the canonical unoriented minors; the more general constructor is also useful while expanding products.

Equations
Instances For
    theorem Hex.Matrix.getElem_selectedSubmatrix {R : Type u} {n m k : Nat} (M : Matrix R n m) (rows : Vector (Fin n) k) (cols : Vector (Fin m) k) (i j : Fin k) :
    (M.selectedSubmatrix rows cols)[i][j] = M[rows[i]][cols[j]]

    Entry formula for an arbitrary selected submatrix.

    theorem Hex.Matrix.selectedSubmatrix_transpose {R : Type u} {n m k : Nat} (M : Matrix R n m) (rows : Vector (Fin m) k) (cols : Vector (Fin n) k) :

    Selecting rows and columns after transposition swaps the two index tuples.

    theorem Hex.Matrix.selectedSubmatrix_smul {R : Type u} {S : Type v} [SMul S R] {n m k : Nat} (c : S) (M : Matrix R n m) (rows : Vector (Fin n) k) (cols : Vector (Fin m) k) :
    (c • M).selectedSubmatrix rows cols = c • M.selectedSubmatrix rows cols

    Selecting rows and columns commutes with scalar multiplication.

    def Hex.Matrix.skipIndex {n : Nat} (skip : Fin (n + 1)) (i : Fin n) :
    Fin (n + 1)

    Embed Fin n into Fin (n + 1) while skipping one deleted index.

    Equations
    Instances For
      @[simp]
      theorem Hex.Matrix.skipIndex_val_of_lt {n : Nat} (skip : Fin (n + 1)) (i : Fin n) (h : ↑i < ↑skip) :
      ↑(skipIndex skip i) = ↑i

      The skipped-index embedding leaves entries below the deleted index unchanged. This is the low-side simp branch for row and column deletion.

      @[simp]
      theorem Hex.Matrix.skipIndex_val_of_not_lt {n : Nat} (skip : Fin (n + 1)) (i : Fin n) (h : ¬↑i < ↑skip) :
      ↑(skipIndex skip i) = ↑i + 1

      The skipped-index embedding shifts entries at or above the deleted index by one. This is the high-side simp branch for row and column deletion.

      theorem Hex.Matrix.skipIndex_ne {n : Nat} (skip : Fin (n + 1)) (i : Fin n) :
      skipIndex skip i ≠ skip

      The index produced by skipIndex skip is never the deleted index skip. This is the basic side condition for minors that remove a row or column.

      @[simp]

      Skipping the final index embeds Fin n by castSucc. This normalizes bottom-right minors to leading prefixes.

      def Hex.Matrix.deleteRowCol {R : Type u} {n : Nat} (M : Matrix R (n + 1) (n + 1)) (row col : Fin (n + 1)) :
      Matrix R n n

      Delete one row and one column from an (n + 1) × (n + 1) matrix.

      Equations
      Instances For
        theorem Hex.Matrix.getElem_deleteRowCol {R : Type u} {n : Nat} (M : Matrix R (n + 1) (n + 1)) (row col : Fin (n + 1)) (i j : Fin n) :
        (M.deleteRowCol row col)[i][j] = M[skipIndex row i][skipIndex col j]

        Entries of a deleted-row/deleted-column minor are the corresponding source entries at the skipped row and column indices.

        @[simp]
        theorem Hex.Matrix.deleteRowCol_last_last {R : Type u} {n : Nat} (M : Matrix R (n + 1) (n + 1)) :

        Deleting the final row and final column gives the leading prefix. This is the minor normalization used by bottom-right cofactor expansion.

        theorem Hex.Matrix.deleteRowCol_transpose {R : Type u} {n : Nat} (M : Matrix R (n + 1) (n + 1)) (row col : Fin (n + 1)) :

        Deleting row row and column col after transposing is the transpose of the minor obtained by deleting row col and column row before transposing.

        def Hex.Matrix.cofactorSign {R : Type u} [OfNat R 1] [Neg R] {n : Nat} (row col : Fin (n + 1)) :
        R

        The alternating sign used in signed cofactors.

        Equations
        Instances For
          @[simp]
          theorem Hex.Matrix.cofactorSign_of_even {R : Type u} [OfNat R 1] [Neg R] {n : Nat} (row col : Fin (n + 1)) (h : (↑row + ↑col) % 2 = 0) :
          cofactorSign row col = 1

          An even row-plus-column parity gives cofactor sign 1. This is the positive simp branch for signed cofactors.

          @[simp]
          theorem Hex.Matrix.cofactorSign_of_odd {R : Type u} [OfNat R 1] [Neg R] {n : Nat} (row col : Fin (n + 1)) (h : (↑row + ↑col) % 2 ≠ 0) :
          cofactorSign row col = -1

          An odd row-plus-column parity gives cofactor sign -1. This is the negative simp branch for signed cofactors.

          def Hex.Matrix.cofactor {R : Type u} [Lean.Grind.Ring R] {n : Nat} (M : Matrix R (n + 1) (n + 1)) (row col : Fin (n + 1)) :
          R

          The signed cofactor for the local Leibniz determinant.

          Equations
          Instances For
            @[simp]
            theorem Hex.Matrix.cofactor_of_even {R : Type u} [Lean.Grind.Ring R] {n : Nat} (M : Matrix R (n + 1) (n + 1)) (row col : Fin (n + 1)) (h : (↑row + ↑col) % 2 = 0) :
            M.cofactor row col = (M.deleteRowCol row col).det

            At even parity, a signed cofactor is just the determinant of its minor. This removes the sign in cofactor-expansion normalization.

            @[simp]
            theorem Hex.Matrix.cofactor_of_odd {R : Type u} [Lean.Grind.Ring R] {n : Nat} (M : Matrix R (n + 1) (n + 1)) (row col : Fin (n + 1)) (h : (↑row + ↑col) % 2 ≠ 0) :
            M.cofactor row col = -(M.deleteRowCol row col).det

            At odd parity, a signed cofactor is the negated determinant of its minor. This supplies the alternating sign in cofactor-expansion normalization.

            @[simp]
            theorem Hex.Matrix.cofactor_last_last {R : Type u} [Lean.Grind.Ring R] {n : Nat} (M : Matrix R (n + 1) (n + 1)) :

            The bottom-right cofactor reduces to the determinant of the leading prefix. This combines the final-index minor with its even sign.