Documentation

HexGramSchmidt.Basic.Kernel

Executable Gram-Schmidt orthogonalization kernel for hex-gram-schmidt.

This module is the rational core that the rest of the library builds on. It defines the projection primitives (projectionCoeff, subtractProjection), the per-row reduction reduceAgainstBasis, the left-to-right orthogonalization basisRows/basisMatrix, the coefficient matrix coeffMatrix, and the supporting entry/prefix helpers (entry, castIntMatrix, prefixCombination, prefixRows, prefixSpan). It also proves the foundational facts the correspondence proofs consume: pairwise orthogonality of basisRows, the residual/projection reconstruction identity, the leading-row equation, and the zero-norm degeneracy lemmas (a Rat vector with zero self-dot-product is the zero vector).

def Hex.GramSchmidt.projectionCoeff {m : Nat} (row basisRow : Vector Rat m) :

Coefficient of the orthogonal projection of row onto basisRow. When the basis row has zero norm we use 0, which matches the degenerate case of Gram-Schmidt where the corresponding projection term vanishes.

Equations
Instances For
    def Hex.GramSchmidt.subtractProjection {m : Nat} (row basisRow : Vector Rat m) :

    Subtract the projection of row onto basisRow.

    Equations
    Instances For
      theorem Hex.GramSchmidt.dot_zero_of_dot_self_zero {m : Nat} (row v : Vector Rat m) (hzero : v.dotProduct v = 0) :
      row.dotProduct v = 0

      Over Rat, a vector whose self-dot-product is zero is the zero vector, so its dot product with any other row also vanishes. Used to discharge the degenerate zero-norm basis row case when reasoning about orthogonality.

      def Hex.GramSchmidt.reduceAgainstBasis {m : Nat} (basisRev : List (Vector Rat m)) (row : Vector Rat m) :

      Reduce a row against the previously constructed orthogonal basis rows.

      Equations
      Instances For
        def Hex.GramSchmidt.basisRowsAux {m : Nat} (basisRev pending : List (Vector Rat m)) :

        Left-to-right Gram-Schmidt orthogonalization on a list of rows.

        Equations
        Instances For

          Left-to-right Gram-Schmidt orthogonalization on a matrix's rows.

          Equations
          Instances For
            def Hex.GramSchmidt.basisMatrix {n m : Nat} (b : Matrix Rat n m) :

            Rebuild a matrix from its row list after Gram-Schmidt orthogonalization.

            Equations
            Instances For
              def Hex.GramSchmidt.coeffMatrix {n m : Nat} (rows basis : Matrix Rat n m) :

              Gram-Schmidt coefficient matrix for an already-cast rational input.

              Equations
              Instances For
                def Hex.GramSchmidt.entry {R : Type u_1} {n m : Nat} (M : Matrix R n m) (i : Fin n) (j : Fin m) :
                R

                Access a dense matrix entry by row and column indices.

                Equations
                Instances For

                  Cast an integer matrix into the rational matrix space used by Gram-Schmidt.

                  Equations
                  Instances For
                    def Hex.GramSchmidt.prefixCombination {n m : Nat} (coeffs : Matrix Rat n n) (basis : Matrix Rat n m) (i : Nat) (hi : i < n) :

                    The prefix combination term used in the decomposition theorem shape.

                    Equations
                    • One or more equations did not get rendered due to their size.
                    Instances For
                      def Hex.GramSchmidt.prefixRows {R : Type u_1} {n m : Nat} (M : Matrix R n m) (i : Nat) (hi : i < n) :
                      Matrix R (i + 1) m

                      The row-prefix matrix containing rows 0 through i.

                      Equations
                      Instances For
                        def Hex.GramSchmidt.prefixSpan {n m : Nat} (M : Matrix Rat n m) (i : Nat) (hi : i < n) (v : Vector Rat m) :

                        Executable row-span membership in the first i + 1 rows of a matrix.

                        Equations
                        Instances For