data.matrix.autoMathlib.Data.Matrix.Auto

This file has been ported!

Changes since the initial port

The following section lists changes to this file in mathlib3 and mathlib4 that occured after the initial port. Most recent changes are shown first. Hovering over a commit will show all commits associated with the same mathlib3 commit.

Changes in mathlib3

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(last sync)

Changes in mathlib3port

mathlib3
mathlib3port
Diff
@@ -3,8 +3,8 @@ Copyright (c) 2022 Eric Wieser. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Eric Wieser
 -/
-import Mathbin.Algebra.Expr
-import Mathbin.Data.Matrix.Reflection
+import Algebra.Expr
+import Data.Matrix.Reflection
 
 #align_import data.matrix.auto from "leanprover-community/mathlib"@"08b081ea92d80e3a41f899eea36ef6d56e0f1db0"
 
@@ -43,7 +43,7 @@ namespace Matrix
 
 section FinEta
 
-/- ./././Mathport/Syntax/Translate/Expr.lean:336:4: warning: unsupported (TODO): `[tacs] -/
+/- ./././Mathport/Syntax/Translate/Expr.lean:337:4: warning: unsupported (TODO): `[tacs] -/
 -- PLEASE REPORT THIS TO MATHPORT DEVS, THIS SHOULD NOT HAPPEN.
 -- failed to format: unknown constant 'term.pseudo.antiquot'
 /--
Diff
@@ -141,11 +141,11 @@ unsafe def fin_to_pexpr {m n : ℕ} (A : Matrix (Fin m) (Fin n) pexpr) : pexpr :
 #align matrix.fin_to_pexpr matrix.fin_to_pexpr
 
 /-- This statement is defeq to `of_mul_of_fin`, but syntactically worse-/
-theorem of_mul_of_fin_aux (l m n : ℕ) ⦃α⦄ [Mul α] [AddCommMonoid α] :
+theorem of_hMul_of_fin_aux (l m n : ℕ) ⦃α⦄ [Mul α] [AddCommMonoid α] :
     Forall fun A : Matrix (Fin l) (Fin m) α =>
       Forall fun B : Matrix (Fin m) (Fin n) α => A.mul B = A.mulᵣ B :=
   by simp_rw [forall_iff, mulᵣ_eq, eq_self_iff_true, forall_const]
-#align matrix.of_mul_of_fin_aux Matrix.of_mul_of_fin_aux
+#align matrix.of_mul_of_fin_aux Matrix.of_hMul_of_fin_aux
 
 /-- Prove a statement of the form
 ```
@@ -212,7 +212,7 @@ unsafe def of_mul_of_fin.prove (l m n : ℕ) : tactic (expr × expr) := do
   let A_eq
     ←-- State and prove the equality, noting the RHS is defeq to `mulᵣ A B`.
         tactic.to_expr
-        ``(@Matrix.mul _ _ _ _ _ $(has_mul_α) $(add_comm_monoid_α) $(A) $(B) = $(AB))
+        ``(@HMul.hMul _ _ _ _ _ $(has_mul_α) $(add_comm_monoid_α) $(A) $(B) = $(AB))
   let t ← tactic.pis args A_eq
   let pr := (expr.const `matrix.of_mul_of_fin_aux [u]).mk_app [q(l), q(m), q(n)]
   let-- This seems to create a metavariable then assign it, which ensures `pr` carries the right type.
@@ -225,7 +225,7 @@ open scoped Matrix
 
 /-- Helper tactic used as an `auto_param` for `matrix.of_mul_of_fin` -/
 unsafe def of_mul_of_fin.derive : tactic Unit := do
-  let target@q(@Matrix.mul (Fin $(l)) (Fin $(m)) (Fin $(n)) $(α) $(_) $(i1) $(i2) $(A) $(B) = $(AB))
+  let target@q(@HMul.hMul (Fin $(l)) (Fin $(m)) (Fin $(n)) $(α) $(_) $(i1) $(i2) $(A) $(B) = $(AB))
     ← tactic.target
   let some (l, m, n) ← pure (Prod.mk <$> l.toNat <*> (Prod.mk <$> m.toNat <*> n.toNat)) |
     throwError "Dimensions {(← l)}, {(← m)} {← n} are not numerals"
@@ -243,14 +243,14 @@ unsafe def of_mul_of_fin.derive : tactic Unit := do
 `![![x₀₀, x₀₁], ![x₁₀, x₁₁]]`. It then uses an `auto_param` to populate `ab_coeffs` with an
 expression of the same form, containing the appropriate expressions in terms of `+`, `*`, `aᵢⱼ`,
 and `bⱼₖ`. -/
-theorem of_mul_of_fin {α} [Mul α] [AddCommMonoid α] {l m n : ℕ} {a_coeffs : Fin l → Fin m → α}
+theorem of_hMul_of_fin {α} [Mul α] [AddCommMonoid α] {l m n : ℕ} {a_coeffs : Fin l → Fin m → α}
     {b_coeffs : Fin m → Fin n → α} {ab_coeffs : Fin l → Fin n → α}
     (h : of a_coeffs ⬝ of b_coeffs = of ab_coeffs := by
       run_tac
         of_mul_of_fin.derive) :
     of a_coeffs ⬝ of b_coeffs = of ab_coeffs :=
   h
-#align matrix.of_mul_of_fin Matrix.of_mul_of_fin
+#align matrix.of_mul_of_fin Matrix.of_hMul_of_fin
 
 end OfMulOfFin
 
Diff
@@ -2,15 +2,12 @@
 Copyright (c) 2022 Eric Wieser. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Eric Wieser
-
-! This file was ported from Lean 3 source module data.matrix.auto
-! leanprover-community/mathlib commit 08b081ea92d80e3a41f899eea36ef6d56e0f1db0
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathbin.Algebra.Expr
 import Mathbin.Data.Matrix.Reflection
 
+#align_import data.matrix.auto from "leanprover-community/mathlib"@"08b081ea92d80e3a41f899eea36ef6d56e0f1db0"
+
 /-! # Automatically generated lemmas for working with concrete matrices
 
 > THIS FILE IS SYNCHRONIZED WITH MATHLIB4.
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Eric Wieser
 
 ! This file was ported from Lean 3 source module data.matrix.auto
-! leanprover-community/mathlib commit 6b711d2ba5d470c040677ddda0c26b0d72283886
+! leanprover-community/mathlib commit 08b081ea92d80e3a41f899eea36ef6d56e0f1db0
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -13,6 +13,9 @@ import Mathbin.Data.Matrix.Reflection
 
 /-! # Automatically generated lemmas for working with concrete matrices
 
+> THIS FILE IS SYNCHRONIZED WITH MATHLIB4.
+> Any changes to this file require a corresponding PR to mathlib4.
+
 This file contains "magic" lemmas which autogenerate to the correct size of matrix. For instance,
 `matrix.of_mul_of_fin` can be used as:
 ```lean
Diff
@@ -204,9 +204,9 @@ unsafe def of_mul_of_fin.prove (l m n : ℕ) : tactic (expr × expr) := do
     -- `matrix.mulᵣ` to build the expression we want to end up with. It doesn't matter which we pick,
     -- but the typeclasses are easier to create for the latter.
     (t, has_mul_αe)
-    ← expr.has_mul t
-  let (t, has_add_αe) ← expr.has_add t
-  let (t, has_zero_αe) ← expr.has_zero t
+    ← Expr.instMul t
+  let (t, has_add_αe) ← Expr.instAdd t
+  let (t, has_zero_αe) ← Expr.instZero t
   let ab := @Matrix.mulᵣ _ _ _ _ has_mul_αe has_add_αe has_zero_αe a b
   let AB := matrix.fin_to_pexpr (Matrix.map ab to_pexpr)
   let A_eq

Changes in mathlib4

mathlib3
mathlib4
refactor(Data/Matrix): Eliminate notation in favor of HMul (#6487)

The main difficulty here is that * has a slightly difference precedence to . notably around smul and neg.

The other annoyance is that ↑U ⬝ A ⬝ ↑U⁻¹ : Matrix m m 𝔸 now has to be written U.val * A * (U⁻¹).val in order to typecheck.

A downside of this change to consider: if you have a goal of A * (B * C) = (A * B) * C, mul_assoc now gives the illusion of matching, when in fact Matrix.mul_assoc is needed. Previously the distinct symbol made it easy to avoid this mistake.

On the flipside, there is now no need to rewrite by Matrix.mul_eq_mul all the time (indeed, the lemma is now removed).

Diff
@@ -15,7 +15,7 @@ For instance, `Matrix.of_mul_of_fin` could be used as:
 ```lean
 example {α} [AddCommMonoid α] [Mul α] (a₁₁ a₁₂ a₂₁ a₂₂ b₁₁ b₁₂ b₂₁ b₂₂ : α) :
   !![a₁₁, a₁₂;
-     a₂₁, a₂₂] ⬝ !![b₁₁, b₁₂;
+     a₂₁, a₂₂] * !![b₁₁, b₁₂;
                     b₂₁, b₂₂] = !![a₁₁ * b₁₁ + a₁₂ * b₂₁, a₁₁ * b₁₂ + a₁₂ * b₂₂;
                                    a₂₁ * b₁₁ + a₂₂ * b₂₁, a₂₁ * b₁₂ + a₂₂ * b₂₂] := by
   rw [of_mul_of_fin]
chore: script to replace headers with #align_import statements (#5979)

Open in Gitpod

Co-authored-by: Eric Wieser <wieser.eric@gmail.com> Co-authored-by: Scott Morrison <scott.morrison@gmail.com>

Diff
@@ -2,15 +2,12 @@
 Copyright (c) 2022 Eric Wieser. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Eric Wieser
-
-! This file was ported from Lean 3 source module data.matrix.auto
-! leanprover-community/mathlib commit 6b711d2ba5d470c040677ddda0c26b0d72283886
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathlib.Algebra.Expr
 import Mathlib.Data.Matrix.Reflection
 
+#align_import data.matrix.auto from "leanprover-community/mathlib"@"6b711d2ba5d470c040677ddda0c26b0d72283886"
+
 /-! # Automatically generated lemmas for working with concrete matrices
 
 In Mathlib3, this file contained "magic" lemmas which autogenerate to the correct size of matrix.
chore: port Data/Matrix/Auto (#5926)

Co-authored-by: Jeremy Tan Jie Rui <reddeloostw@gmail.com>

Dependencies 8 + 392

393 files ported (98.0%)
160755 lines ported (98.1%)
Show graph

The unported dependencies are