Documentation

HexMatrixMathlib.Literal

theorem HexMatrixMathlib.getD_eq_getElem' {α : Type u_1} (l : List α) (i : ℕ) (d : α) (h : i < l.length) :
l.getD i d = l[i]
theorem HexMatrixMathlib.getD_eq_default' {α : Type u_1} (l : List α) (i : ℕ) (d : α) (h : l.length ≤ i) :
l.getD i d = d
def HexMatrixMathlib.vecOfList {α : Type u_1} [Zero α] (k : ℕ) :
List α → Fin k → α

A list as a vector, padded with zeros; vecOfList (k + 1) (a :: l) unfolds to vecCons a (vecOfList k l), so a ![…] literal is definitionally vecOfList of its entries.

Equations
Instances For
    def HexMatrixMathlib.ofLists {α : Type u_1} [Zero α] (n m : ℕ) (L : List (List α)) :
    Matrix (Fin n) (Fin m) α

    The Mathlib matrix of a row list, padded with zeros.

    Equations
    Instances For
      theorem HexMatrixMathlib.vecOfList_apply {α : Type u_1} [Zero α] (k : ℕ) (l : List α) (i : Fin k) :
      vecOfList k l i = l.getD (↑i) 0
      theorem HexMatrixMathlib.ofLists_apply {α : Type u_1} [Zero α] (n m : ℕ) (L : List (List α)) (i : Fin n) (j : Fin m) :
      ofLists n m L i j = (L.getD ↑i []).getD (↑j) 0
      def HexMatrixMathlib.entriesEq {α : Type u_1} [Zero α] [DecidableEq α] (n m : ℕ) (A : Matrix (Fin n) (Fin m) α) (L : List (List α)) :

      The entrywise comparison of a matrix with its row list, as a Boolean the kernel evaluates by enumerating every index pair.

      Equations
      Instances For
        theorem HexMatrixMathlib.eq_ofLists_of_entriesEq {α : Type u_1} [Zero α] [DecidableEq α] (n m : ℕ) (A : Matrix (Fin n) (Fin m) α) (L : List (List α)) (h : entriesEq n m A L = true) :
        A = ofLists n m L

        A passing entrywise comparison identifies the matrix with its row list.

        structure HexMatrixMathlib.Certified {α : Type u_1} {β : Type u_2} (f : α → β) (a : α) :
        Type u_2

        The record returned by the result-producing term forms (det% A): the value of f a and the proof.

        • value : β

          The computed value.

        • proof : f a = self.value

          The certificate that it is f a.

        Instances For

          How a recognized literal is identified with its row list.

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

              A recognized closed matrix literal.

              • n : ℕ

                Rows.

              • m : ℕ

                Columns.

              • carrier : Lean.Expr

                The entry carrier.

              • entries : Array (Array Lean.Expr)

                The entry expressions, row-major, as they appear in the literal (or, for the fun and ofArray forms, as instantiated at each index pair).

              • route : Route

                The identification route.

              Instances For

                How many definitions are unfolded when looking for a literal.

                Equations
                Instances For

                  The shape of the type Matrix (Fin n) (Fin m) R with closed dimensions: (n, m, R), or of the function type Fin n → Fin m → R a bare lambda has. The dimensions may be any closed expressions that evaluate to numerals, as Matrix.of ![…] elaborates them as Nat.succ chains.

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

                    Match a Matrix.of ![…] chain (the !![…] notation included) of the given shape. Like Mathlib's matchMatrixLit?, but every vecCons chain must end in vecEmpty, so that the literal is definitionally the ofLists of its entries.

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

                      ⟨k, _⟩ : Fin n.

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

                        Match a fun i j => … literal: the body instantiated at every index pair.

                        Equations
                        Instances For

                          Match a Matrix.ofArray xs h literal whose array is a #[…] literal of n * m entries.

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

                            Find the literal behind A : Matrix (Fin n) (Fin m) R, unfolding definitions within unfoldBudget; an open term is not a literal.

                            Recognize a closed matrix literal from its type and its expression.

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

                              Evaluate an entry to a rational with norm_num; an entry norm_num alone does not evaluate (the fun i j => … form instantiates its body at Fin literals, leaving Fin.val, casts and if i = j tests) is first simplified with the default simp set. An entry that is not a closed numeric expression is an error naming it.

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

                                The row list of quoted entries, as a List (List type).

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

                                  of_decide_eq_true on a closed decidable proposition, for the kernel to evaluate; no elaborator-side evaluation happens.

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

                                    The proof of A = ofLists n m L along the literal's route: rfl for a vector chain, one kernel decide on entriesEq otherwise.

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

                                      Elaborate a matrix argument of a term form. The !![…] notations are given an integer entry expectation so their numerals do not default to Nat.

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