The Mathlib Handbook

The volumes of the handbook are not written yet. This site shows the map of Mathlib that they will follow, at Mathlib 4472534b60.

The areas / V34. The tactics of Mathlib

Mathlib.Tactic.Matrix.MulExpand

23 declarations. Mathlib docs · Source

theorem Mathlib.Tactic.Matrix.MulEq.mk.inj E1 #

∀ {u : Lean.Level} {α : Q(Type u)} {zα : Q(Zero «$α»)} {aα : Q(Add «$α»)} {mα : Q(Mul «$α»)} {l m n : ℕ}
  {A B : Q(List (List «$α»))} {rows : List (List Q(«$α»))} {expr : Q(List (List «$α»))}
  {proof : Q(Mathlib.Tactic.Matrix.ListMatrix.mul «$l» «$m» «$n» «$A» «$B» = «$expr»)} {A_1 B_1 : Q(List (List «$α»))}
  {rows_1 : List (List Q(«$α»))} {expr_1 : Q(List (List «$α»))}
  {proof_1 : Q(Mathlib.Tactic.Matrix.ListMatrix.mul «$l» «$m» «$n» «$A_1» «$B_1» = «$expr_1»)},
  { A := A, B := B, rows := rows, expr := expr, proof := proof } =
      { A := A_1, B := B_1, rows := rows_1, expr := expr_1, proof := proof_1 } →
    A = A_1 ∧ B = B_1 ∧ rows = rows_1 ∧ expr = expr_1 ∧ proof = proof_1

def Mathlib.Tactic.Matrix.DotProductEq.ctorIdx E1 #

{u : Lean.Level} →
  {α : Q(Type u)} →
    {zα : Q(Zero «$α»)} → {aα : Q(Add «$α»)} → {mα : Q(Mul «$α»)} → Mathlib.Tactic.Matrix.DotProductEq zα aα mα → ℕ

theorem Mathlib.Tactic.Matrix.DotProductEq.mk.inj E1 #

∀ {u : Lean.Level} {α : Q(Type u)} {zα : Q(Zero «$α»)} {aα : Q(Add «$α»)} {mα : Q(Mul «$α»)} {n : Q(ℕ)}
  {l₁ l₂ : Q(List «$α»)} {expr : Q(«$α»)}
  {proof : Q(Mathlib.Tactic.Matrix.ListMatrix.dotProduct «$n» «$l₁» «$l₂» = «$expr»)} {n_1 : Q(ℕ)}
  {l₁_1 l₂_1 : Q(List «$α»)} {expr_1 : Q(«$α»)}
  {proof_1 : Q(Mathlib.Tactic.Matrix.ListMatrix.dotProduct «$n_1» «$l₁_1» «$l₂_1» = «$expr_1»)},
  { n := n, l₁ := l₁, l₂ := l₂, expr := expr, proof := proof } =
      { n := n_1, l₁ := l₁_1, l₂ := l₂_1, expr := expr_1, proof := proof_1 } →
    n = n_1 ∧ l₁ = l₁_1 ∧ l₂ = l₂_1 ∧ expr = expr_1 ∧ proof = proof_1

theorem Mathlib.Tactic.Matrix.DotProductEq.mk.injEq E0 #

∀ {u : Lean.Level} {α : Q(Type u)} {zα : Q(Zero «$α»)} {aα : Q(Add «$α»)} {mα : Q(Mul «$α»)} (n : Q(ℕ))
  (l₁ l₂ : Q(List «$α»)) (expr : Q(«$α»))
  (proof : Q(Mathlib.Tactic.Matrix.ListMatrix.dotProduct «$n» «$l₁» «$l₂» = «$expr»)) (n_1 : Q(ℕ))
  (l₁_1 l₂_1 : Q(List «$α»)) (expr_1 : Q(«$α»))
  (proof_1 : Q(Mathlib.Tactic.Matrix.ListMatrix.dotProduct «$n_1» «$l₁_1» «$l₂_1» = «$expr_1»)),
  ({ n := n, l₁ := l₁, l₂ := l₂, expr := expr, proof := proof } =
      { n := n_1, l₁ := l₁_1, l₂ := l₂_1, expr := expr_1, proof := proof_1 }) =
    (n = n_1 ∧ l₁ = l₁_1 ∧ l₂ = l₂_1 ∧ expr = expr_1 ∧ proof = proof_1)

theorem Mathlib.Tactic.Matrix.MulEq.mk.injEq E0 #

∀ {u : Lean.Level} {α : Q(Type u)} {zα : Q(Zero «$α»)} {aα : Q(Add «$α»)} {mα : Q(Mul «$α»)} {l m n : ℕ}
  (A B : Q(List (List «$α»))) (rows : List (List Q(«$α»))) (expr : Q(List (List «$α»)))
  (proof : Q(Mathlib.Tactic.Matrix.ListMatrix.mul «$l» «$m» «$n» «$A» «$B» = «$expr»)) (A_1 B_1 : Q(List (List «$α»)))
  (rows_1 : List (List Q(«$α»))) (expr_1 : Q(List (List «$α»)))
  (proof_1 : Q(Mathlib.Tactic.Matrix.ListMatrix.mul «$l» «$m» «$n» «$A_1» «$B_1» = «$expr_1»)),
  ({ A := A, B := B, rows := rows, expr := expr, proof := proof } =
      { A := A_1, B := B_1, rows := rows_1, expr := expr_1, proof := proof_1 }) =
    (A = A_1 ∧ B = B_1 ∧ rows = rows_1 ∧ expr = expr_1 ∧ proof = proof_1)

def Mathlib.Tactic.Matrix.MulEq.ctorIdx E1 #

{u : Lean.Level} →
  {α : Q(Type u)} →
    {zα : Q(Zero «$α»)} →
      {aα : Q(Add «$α»)} → {mα : Q(Mul «$α»)} → {l m n : ℕ} → Mathlib.Tactic.Matrix.MulEq zα aα mα l m n → ℕ

def Mathlib.Tactic.Matrix.mkListCongr E1 #

{u : Lean.Level} →
  {α : Q(Type u)} →
    List ((a : Q(«$α»)) × (b : Q(«$α»)) × Q(«$a» = «$b»)) → (l₁ : Q(List «$α»)) × (l₂ : Q(List «$α»)) × Q(«$l₁» = «$l₂»)

Construct a proof term that [a₀, …] = [b₀, …] in List α from proofs of aᵢ = bᵢ. MVarId.congrN also works, but is much slower to elaborate.

structure Mathlib.Tactic.Matrix.DotProductEq E1 #

{u : Lean.Level} → {α : Q(Type u)} → Q(Zero «$α») → Q(Add «$α») → Q(Mul «$α») → Type

A dot product of two lists of entries, ListMatrix.dotProduct n l₁ l₂ = expr, with its proof.

ctor Mathlib.Tactic.Matrix.DotProductEq.mk E0 #

{u : Lean.Level} →
  {α : Q(Type u)} →
    {zα : Q(Zero «$α»)} →
      {aα : Q(Add «$α»)} →
        {mα : Q(Mul «$α»)} →
          (n : Q(ℕ)) →
            (l₁ l₂ : Q(List «$α»)) →
              (expr : Q(«$α»)) →
                Q(Mathlib.Tactic.Matrix.ListMatrix.dotProduct «$n» «$l₁» «$l₂» = «$expr») →
                  Mathlib.Tactic.Matrix.DotProductEq zα aα mα

abbrev Mathlib.Tactic.Matrix.DotProductEq.n E1 #

{u : Lean.Level} →
  {α : Q(Type u)} →
    {zα : Q(Zero «$α»)} → {aα : Q(Add «$α»)} → {mα : Q(Mul «$α»)} → Mathlib.Tactic.Matrix.DotProductEq zα aα mα → Q(ℕ)

The number of terms.

abbrev Mathlib.Tactic.Matrix.DotProductEq.l₁ E1 #

{u : Lean.Level} →
  {α : Q(Type u)} →
    {zα : Q(Zero «$α»)} →
      {aα : Q(Add «$α»)} → {mα : Q(Mul «$α»)} → Mathlib.Tactic.Matrix.DotProductEq zα aα mα → Q(List «$α»)

The first list.

abbrev Mathlib.Tactic.Matrix.DotProductEq.l₂ E1 #

{u : Lean.Level} →
  {α : Q(Type u)} →
    {zα : Q(Zero «$α»)} →
      {aα : Q(Add «$α»)} → {mα : Q(Mul «$α»)} → Mathlib.Tactic.Matrix.DotProductEq zα aα mα → Q(List «$α»)

The second list.

abbrev Mathlib.Tactic.Matrix.DotProductEq.expr E1 #

{u : Lean.Level} →
  {α : Q(Type u)} →
    {zα : Q(Zero «$α»)} →
      {aα : Q(Add «$α»)} → {mα : Q(Mul «$α»)} → Mathlib.Tactic.Matrix.DotProductEq zα aα mα → Q(«$α»)

The right-hand side.

abbrev Mathlib.Tactic.Matrix.DotProductEq.proof E1 #

{u : Lean.Level} →
  {α : Q(Type u)} →
    {zα : Q(Zero «$α»)} →
      {aα : Q(Add «$α»)} →
        {mα : Q(Mul «$α»)} →
          (self : Mathlib.Tactic.Matrix.DotProductEq zα aα mα) →
            Q(Mathlib.Tactic.Matrix.ListMatrix.dotProduct unknown_1 unknown_2 unknown_3 = unknown_4)

The proof.

def Mathlib.Tactic.Matrix.proveDotProduct E1 #

{u : Lean.Level} →
  {α : Q(Type u)} →
    (zα : Q(Zero «$α»)) →
      (aα : Q(Add «$α»)) →
        (mα : Q(Mul «$α»)) → ℕ → Q(List «$α») → Q(List «$α») → Mathlib.Tactic.Matrix.DotProductEq zα aα mα

The dot product of the first m entries of the list literals l₁ and l₂, ListMatrix.dotProduct m l₁ l₂ = fold, with m a numeral and fold the sum of the products a₀ * b₀ + (a₁ * b₁ + (… + 0)), unfolded by the equations of ListMatrix.dotProduct. The function takes the pre-built Expr for list literals instead of taking the list of entry literals and build it here, to avoid reconstructing the expressions multiple times.

structure Mathlib.Tactic.Matrix.MulEq E1 #

{u : Lean.Level} → {α : Q(Type u)} → Q(Zero «$α») → Q(Add «$α») → Q(Mul «$α») → ℕ → ℕ → ℕ → Type

The expansion of the product ListMatrix.mul l m n A B of two list literals with the associated proof term. The input matrices are put as fields of the structure to avoid over-long dependent type signatures downstream.

ctor Mathlib.Tactic.Matrix.MulEq.mk E0 #

{u : Lean.Level} →
  {α : Q(Type u)} →
    {zα : Q(Zero «$α»)} →
      {aα : Q(Add «$α»)} →
        {mα : Q(Mul «$α»)} →
          {l m n : ℕ} →
            (A B : Q(List (List «$α»))) →
              List (List Q(«$α»)) →
                (expr : Q(List (List «$α»))) →
                  Q(Mathlib.Tactic.Matrix.ListMatrix.mul «$l» «$m» «$n» «$A» «$B» = «$expr») →
                    Mathlib.Tactic.Matrix.MulEq zα aα mα l m n

abbrev Mathlib.Tactic.Matrix.MulEq.A E1 #

{u : Lean.Level} →
  {α : Q(Type u)} →
    {zα : Q(Zero «$α»)} →
      {aα : Q(Add «$α»)} →
        {mα : Q(Mul «$α»)} → {l m n : ℕ} → Mathlib.Tactic.Matrix.MulEq zα aα mα l m n → Q(List (List «$α»))

The list literal of the first factor.

abbrev Mathlib.Tactic.Matrix.MulEq.B E1 #

{u : Lean.Level} →
  {α : Q(Type u)} →
    {zα : Q(Zero «$α»)} →
      {aα : Q(Add «$α»)} →
        {mα : Q(Mul «$α»)} → {l m n : ℕ} → Mathlib.Tactic.Matrix.MulEq zα aα mα l m n → Q(List (List «$α»))

The list literal of the second factor.

abbrev Mathlib.Tactic.Matrix.MulEq.rows E1 #

{u : Lean.Level} →
  {α : Q(Type u)} →
    {zα : Q(Zero «$α»)} →
      {aα : Q(Add «$α»)} →
        {mα : Q(Mul «$α»)} → {l m n : ℕ} → Mathlib.Tactic.Matrix.MulEq zα aα mα l m n → List (List Q(«$α»))

The rows of the product, each entry the sum of the products of the entries.

abbrev Mathlib.Tactic.Matrix.MulEq.expr E1 #

{u : Lean.Level} →
  {α : Q(Type u)} →
    {zα : Q(Zero «$α»)} →
      {aα : Q(Add «$α»)} →
        {mα : Q(Mul «$α»)} → {l m n : ℕ} → Mathlib.Tactic.Matrix.MulEq zα aα mα l m n → Q(List (List «$α»))

The list literal of rows.

abbrev Mathlib.Tactic.Matrix.MulEq.proof E1 #

{u : Lean.Level} →
  {α : Q(Type u)} →
    {zα : Q(Zero «$α»)} →
      {aα : Q(Add «$α»)} →
        {mα : Q(Mul «$α»)} →
          {l m n : ℕ} →
            (self : Mathlib.Tactic.Matrix.MulEq zα aα mα l m n) →
              Q(Mathlib.Tactic.Matrix.ListMatrix.mul «$l» «$m» «$n» unknown_1 unknown_2 = unknown_3)

The proof.

def Mathlib.Tactic.Matrix.proveMul E1 #

{u : Lean.Level} →
  {α : Q(Type u)} →
    (zα : Q(Zero «$α»)) →
      (aα : Q(Add «$α»)) →
        (mα : Q(Mul «$α»)) →
          (l m n : ℕ) → List (List Q(«$α»)) → List (List Q(«$α»)) → Mathlib.Tactic.Matrix.MulEq zα aα mα l m n

Rewrite ListMatrix.mul l m n A B to the literal whose entries are the sums of products of the entries. listA/listB are the rows of the l × m and m × n matrix respectively. The rows are not checked against l, m and n.