Documentation

Mathlib.Tactic.Echelon.Cert

Certificate construction for the Bareiss decomposition #

certifyDecomposition constructs a proof of Echelon.Decomposition A L σ pivot from the given decomposition data. It proves that L * A_σ has the given pivots (through the product L * A_σ = U), and that L is lower triangular with nonzero diagonal entries.

The certify* functions assemble these proofs from facts about single entries, including the arithmetic equalities for the product and the non-zeroness for the diagonal entries of L and the pivots of U, which are established by the model's certifier (or the kernel).

Main definitions #

Implementation notes #

The elimination records its echelon form U, making the product L * A_σ = U a certificate obligation of its own.

The product is proved on the list representation which the kernel checks more cheaply.

structure Mathlib.Tactic.Echelon.ListMatrixLit {u : Lean.Level} (α : Q(Type u)) (m n : ℕ) :

Three forms of one list-based matrix literal. This makes the argument list more succinct when a cert construction function needs to use multiple representations.

  • matrix : Q(Matrix (Fin «$m») (Fin «$n») «$α»)

    The matrix, the ofLists term on lit.

  • lit : Q(List (List «$α»))

    The list literal of rows.

  • rows : List (List Q(«$α»))

    The rows of the matrix.

Instances For
    def Mathlib.Tactic.Echelon.ListMatrixLit.ofArray {u : Lean.Level} {α : Q(Type u)} (zα : Q(Zero «$α»)) (m n : ℕ) (rows : Array (Array Q(«$α»))) :

    The ListMatrixLit of the matrix with rows rows.

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

      Build the permutation σ = swap a₀ b₀ * swap a₁ b₁ * ⋯ from the recorded swaps.

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

        The certifier that leaves each fact to the kernel's decide.

        Equations
        Instances For
          def Mathlib.Tactic.Echelon.certifyLowerTriangularDiagList {u : Lean.Level} {α : Q(Type u)} (certifier : EntryCertifier α) (zα : Q(Zero «$α»)) (k c : ℕ) (kQ cQ : Q(ℕ)) (rows : Q(List (List «$α»))) :
          Lean.MetaM Q(IsLowerTriangularDiagList «$kQ» «$cQ» «$rows»)

          Construct the list-based IsLowerTriangularDiagList k c rows cert.

          Equations
          Instances For
            def Mathlib.Tactic.Echelon.certifyLowerTriangularDiag {u : Lean.Level} {m : ℕ} {α : Q(Type u)} (certifier : EntryCertifier α) (zα : Q(Zero «$α»)) (L : ListMatrixLit α m m) :
            Lean.MetaM ((have a := L.matrix; Q(«$a».IsLowerTriangular)) × have a := L.matrix; Q(∀ (i : Fin «$m»), «$a».diag i ≠ 0))

            Prove that L is lower triangular with a nonzero diagonal.

            Equations
            • One or more equations did not get rendered due to their size.
            Instances For
              def Mathlib.Tactic.Echelon.certifyPivotedList {u : Lean.Level} {n : ℕ} {α : Q(Type u)} (certifier : EntryCertifier α) (zα : Q(Zero «$α»)) (cols : List ℕ) (pivots : Q(List (Fin «$n»))) (rows : Q(List (List «$α»))) :
              Lean.MetaM Q(IsPivotedList «$pivots» «$rows»)

              Construct the list-based IsPivotedList pivots rows cert.

              Equations
              Instances For
                def Mathlib.Tactic.Echelon.certifyPivotedBy {u : Lean.Level} {m n : ℕ} {α : Q(Type u)} (certifier : EntryCertifier α) (zα : Q(Zero «$α»)) (U : ListMatrixLit α m n) (cols : List ℕ) (pivots : Q(List (Fin «$n»))) :
                Lean.MetaM (have a := U.matrix; Q(«$a».IsPivotedBy fun (i : Fin «$m») => pivotOfList «$pivots» ↑i))

                Prove that U is pivoted by pivotOfList pivots from the rows of U, with certifier proving the pivot entries nonzero.

                Equations
                • One or more equations did not get rendered due to their size.
                Instances For
                  def Mathlib.Tactic.Echelon.certifyPermEq {u : Lean.Level} {m n : ℕ} {α : Q(Type u)} (A Aσ : Q(Matrix (Fin «$m») (Fin «$n») «$α»)) (σ : Q(Equiv.Perm (Fin «$m»))) :
                  Q(«$A».submatrix (⇑«$σ») id = «$Aσ»)

                  Prove the row arrangement A.submatrix σ id = Aσ.

                  Equations
                  Instances For
                    def Mathlib.Tactic.Echelon.certifyRowsEq {u : Lean.Level} {α : Q(Type u)} (certifier : EntryCertifier α) (rows₁ rows₂ : List (List Q(«$α»))) :
                    Lean.MetaM ((l₁ : Q(List (List «$α»))) × (l₂ : Q(List (List «$α»))) × Q(«$l₁» = «$l₂»))

                    Prove the row literals of rows₁ and rows₂ equal from the entrywise equations a = b, each proved by certifier.

                    Equations
                    • One or more equations did not get rendered due to their size.
                    Instances For
                      def Mathlib.Tactic.Echelon.certifyProductEq {u : Lean.Level} {m n : ℕ} {α : Q(Type u)} (certifier? : Option (EntryCertifier α)) (cα : Q(AddCommMonoid «$α»)) {zα : Q(Zero «$α»)} {aα : Q(Add «$α»)} {mα : Q(Mul «$α»)} (mulEq : Matrix.MulEq zα aα mα m m n) (U : ListMatrixLit α m n) :
                      Lean.MetaM (have a := U.matrix; have a_1 := mulEq.B; have a_2 := mulEq.A; Q(Matrix.ofLists «$m» «$m» «$a_2» * Matrix.ofLists «$m» «$n» «$a_1» = «$a»))

                      Prove the product L * Aσ = U from the expansion mulEq of the product of the row lists of L and Aσ, whose literals are mulEq.A and mulEq.B.

                      Equations
                      • One or more equations did not get rendered due to their size.
                      Instances For
                        structure Mathlib.Tactic.Echelon.DecompositionCert {u : Lean.Level} {m n : ℕ} {α : Q(Type u)} (rα : Q(CommRing «$α»)) (A : Q(Matrix (Fin «$m») (Fin «$n») «$α»)) :

                        An internal structure recording the Echelon.Decomposition certificate of A with its data, together with the intermediate certificates that downstream tactics reuse (the echelon form U and the product equation stated on it).

                        Instances For
                          def Mathlib.Tactic.Echelon.certifyDecomposition {u : Lean.Level} {m n : ℕ} {α : Q(Type u)} (certifier? : Option (EntryCertifier α)) (rα : Q(CommRing «$α»)) (A : Q(Matrix (Fin «$m») (Fin «$n») «$α»)) (entries : Array (Array Q(«$α»))) (data : BareissData Q(«$α»)) :

                          Build the DecompositionCert of A from the decomposition data and the parsed entries of A.

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