data.fin.vec_notation
⟷
Mathlib.Data.Fin.VecNotation
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.
(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)
(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)
(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)
(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)
(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)
(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)
(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)
(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)
(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)
(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)
(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)
(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)
(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)
(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)
(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)
(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)
(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)
(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)
(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)
(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)
(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)
(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)
(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)
(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)
(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)
(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)
(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)
mathlib commit https://github.com/leanprover-community/mathlib/commit/65a1391a0106c9204fe45bc73a039f056558cb83
@@ -326,19 +326,18 @@ theorem empty_vecAppend (v : Fin n → α) : vecAppend (zero_add _).symm ![] v =
theorem cons_vecAppend (ho : o + 1 = m + 1 + n) (x : α) (u : Fin m → α) (v : Fin n → α) :
vecAppend ho (vecCons x u) v =
vecCons x
- (vecAppend (by rwa [add_assoc, add_comm 1, ← add_assoc, add_right_cancel_iff] at ho ) u
- v) :=
+ (vecAppend (by rwa [add_assoc, add_comm 1, ← add_assoc, add_right_cancel_iff] at ho) u v) :=
by
ext i
simp_rw [vec_append_eq_ite]
split_ifs with h
· rcases i with ⟨⟨⟩ | i, hi⟩
· simp
- · simp only [Nat.succ_eq_add_one, add_lt_add_iff_right, Fin.val_mk] at h
+ · simp only [Nat.succ_eq_add_one, add_lt_add_iff_right, Fin.val_mk] at h
simp [h]
· rcases i with ⟨⟨⟩ | i, hi⟩
· simpa using h
- · rw [not_lt, Fin.val_mk, Nat.succ_eq_add_one, add_le_add_iff_right] at h
+ · rw [not_lt, Fin.val_mk, Nat.succ_eq_add_one, add_le_add_iff_right] at h
simp [h]
#align matrix.cons_vec_append Matrix.cons_vecAppend
-/
@@ -365,10 +364,10 @@ theorem vecAlt0_vecAppend (v : Fin n → α) : vecAlt0 rfl (vecAppend rfl v v) =
ext i
simp_rw [Function.comp, bit0, vec_alt0, vec_append_eq_ite]
split_ifs with h <;> congr
- · rw [Fin.val_mk] at h
+ · rw [Fin.val_mk] at h
simp only [Fin.ext_iff, Fin.val_add, Fin.val_mk]
exact (Nat.mod_eq_of_lt h).symm
- · rw [Fin.val_mk, not_lt] at h
+ · rw [Fin.val_mk, not_lt] at h
simp only [Fin.ext_iff, Fin.val_add, Fin.val_mk, Nat.mod_eq_sub_mod h]
refine' (Nat.mod_eq_of_lt _).symm
rw [tsub_lt_iff_left h]
@@ -385,11 +384,11 @@ theorem vecAlt1_vecAppend (v : Fin (n + 1) → α) : vecAlt1 rfl (vecAppend rfl
· simp; congr
· split_ifs with h <;> simp_rw [bit1, bit0] <;> congr
· simp only [Fin.ext_iff, Fin.val_add, Fin.val_mk]
- rw [Fin.val_mk] at h
+ rw [Fin.val_mk] at h
rw [Fin.val_one]
rw [Nat.mod_eq_of_lt (Nat.lt_of_succ_lt h)]
rw [Nat.mod_eq_of_lt h]
- · rw [Fin.val_mk, not_lt] at h
+ · rw [Fin.val_mk, not_lt] at h
simp only [Fin.ext_iff, Fin.val_add, Fin.val_mk, Nat.mod_add_mod, Fin.val_one,
Nat.mod_eq_sub_mod h]
refine' (Nat.mod_eq_of_lt _).symm
@@ -437,7 +436,7 @@ theorem cons_vecAlt0 (h : m + 1 + 1 = n + 1 + (n + 1)) (x y : α) (u : Fin m →
(vecAlt0
(by
rwa [add_assoc n, add_comm 1, ← add_assoc, ← add_assoc, add_right_cancel_iff,
- add_right_cancel_iff] at h )
+ add_right_cancel_iff] at h)
u) :=
by
ext i
@@ -464,7 +463,7 @@ theorem cons_vecAlt1 (h : m + 1 + 1 = n + 1 + (n + 1)) (x y : α) (u : Fin m →
(vecAlt1
(by
rwa [add_assoc n, add_comm 1, ← add_assoc, ← add_assoc, add_right_cancel_iff,
- add_right_cancel_iff] at h )
+ add_right_cancel_iff] at h)
u) :=
by
ext i
mathlib commit https://github.com/leanprover-community/mathlib/commit/65a1391a0106c9204fe45bc73a039f056558cb83
@@ -54,7 +54,7 @@ section MatrixNotation
#print Matrix.vecEmpty /-
/-- `![]` is the vector with no entries. -/
def vecEmpty : Fin 0 → α :=
- Fin.elim0'
+ Fin.elim0
#align matrix.vec_empty Matrix.vecEmpty
-/
mathlib commit https://github.com/leanprover-community/mathlib/commit/ce64cd319bb6b3e82f31c2d38e79080d377be451
@@ -3,10 +3,10 @@ Copyright (c) 2020 Anne Baanen. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Anne Baanen
-/
-import Mathbin.Data.Fin.Tuple.Basic
-import Mathbin.Data.List.Range
-import Mathbin.GroupTheory.GroupAction.Pi
-import Mathbin.Meta.Univs
+import Data.Fin.Tuple.Basic
+import Data.List.Range
+import GroupTheory.GroupAction.Pi
+import Meta.Univs
#align_import data.fin.vec_notation from "leanprover-community/mathlib"@"63f84d91dd847f50bae04a01071f3a5491934e36"
mathlib commit https://github.com/leanprover-community/mathlib/commit/63721b2c3eba6c325ecf8ae8cca27155a4f6306f
@@ -224,7 +224,7 @@ theorem vec_single_eq_const (a : α) : ![a] = fun _ => a :=
-/
@[simp]
theorem cons_val_one (x : α) (u : Fin m.succ → α) : vecCons x u 1 = vecHead u := by
- rw [← Fin.succ_zero_eq_one, cons_val_succ]; rfl
+ rw [← Fin.succ_zero_eq_one', cons_val_succ]; rfl
#align matrix.cons_val_one Matrix.cons_val_one
-/
mathlib commit https://github.com/leanprover-community/mathlib/commit/8ea5598db6caeddde6cb734aa179cc2408dbd345
@@ -2,17 +2,14 @@
Copyright (c) 2020 Anne Baanen. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Anne Baanen
-
-! This file was ported from Lean 3 source module data.fin.vec_notation
-! leanprover-community/mathlib commit 63f84d91dd847f50bae04a01071f3a5491934e36
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
-/
import Mathbin.Data.Fin.Tuple.Basic
import Mathbin.Data.List.Range
import Mathbin.GroupTheory.GroupAction.Pi
import Mathbin.Meta.Univs
+#align_import data.fin.vec_notation from "leanprover-community/mathlib"@"63f84d91dd847f50bae04a01071f3a5491934e36"
+
/-!
# Matrix and vector notation
mathlib commit https://github.com/leanprover-community/mathlib/commit/728ef9dbb281241906f25cbeb30f90d83e0bb451
@@ -291,7 +291,7 @@ This turns out to be helpful when providing simp lemmas to reduce `![a, b, c] n`
that `vec_append ho u v 0` is valid. `fin.append u v 0` is not valid in this case because there is
no `has_zero (fin (m + n))` instance. -/
def vecAppend {α : Type _} {o : ℕ} (ho : o = m + n) (u : Fin m → α) (v : Fin n → α) : Fin o → α :=
- Fin.append u v ∘ Fin.cast ho
+ Fin.append u v ∘ Fin.castIso ho
#align matrix.vec_append Matrix.vecAppend
-/
mathlib commit https://github.com/leanprover-community/mathlib/commit/2a0ce625dbb0ffbc7d1316597de0b25c1ec75303
@@ -621,8 +621,8 @@ theorem zero_empty : (0 : Fin 0 → α) = ![] :=
#print Matrix.cons_zero_zero /-
@[simp]
-theorem cons_zero_zero : vecCons (0 : α) (0 : Fin n → α) = 0 := by ext (i j);
- refine' Fin.cases _ _ i; · rfl; simp
+theorem cons_zero_zero : vecCons (0 : α) (0 : Fin n → α) = 0 := by ext i j; refine' Fin.cases _ _ i;
+ · rfl; simp
#align matrix.cons_zero_zero Matrix.cons_zero_zero
-/
mathlib commit https://github.com/leanprover-community/mathlib/commit/9fb8964792b4237dac6200193a0d533f1b3f7423
@@ -72,7 +72,6 @@ def vecCons {n : ℕ} (h : α) (t : Fin n → α) : Fin n.succ → α :=
#align matrix.vec_cons Matrix.vecCons
-/
--- mathport name: «expr![ ,]»
notation3"!["(l ", "* => foldr (h t => vecCons h t) vecEmpty)"]" => l
#print Matrix.vecHead /-
@@ -123,10 +122,12 @@ theorem head_fin_const (a : α) : (vecHead fun i : Fin (n + 1) => a) = a :=
#align matrix.head_fin_const Matrix.head_fin_const
-/
+#print Matrix.cons_val_zero /-
@[simp]
theorem cons_val_zero (x : α) (u : Fin m → α) : vecCons x u 0 = x :=
rfl
#align matrix.cons_val_zero Matrix.cons_val_zero
+-/
#print Matrix.cons_val_zero' /-
theorem cons_val_zero' (h : 0 < m.succ) (x : α) (u : Fin m → α) : vecCons x u ⟨0, h⟩ = x :=
@@ -162,10 +163,12 @@ theorem tail_cons (x : α) (u : Fin m → α) : vecTail (vecCons x u) = u := by
#align matrix.tail_cons Matrix.tail_cons
-/
+#print Matrix.empty_val' /-
@[simp]
theorem empty_val' {n' : Type _} (j : n') : (fun i => (![] : Fin 0 → n' → α) i j) = ![] :=
empty_eq _
#align matrix.empty_val' Matrix.empty_val'
+-/
#print Matrix.cons_head_tail /-
@[simp]
@@ -174,10 +177,12 @@ theorem cons_head_tail (u : Fin m.succ → α) : vecCons (vecHead u) (vecTail u)
#align matrix.cons_head_tail Matrix.cons_head_tail
-/
+#print Matrix.range_cons /-
@[simp]
theorem range_cons (x : α) (u : Fin n → α) : Set.range (vecCons x u) = {x} ∪ Set.range u :=
Set.ext fun y => by simp [Fin.exists_fin_succ, eq_comm]
#align matrix.range_cons Matrix.range_cons
+-/
#print Matrix.range_empty /-
@[simp]
@@ -290,6 +295,7 @@ def vecAppend {α : Type _} {o : ℕ} (ho : o = m + n) (u : Fin m → α) (v : F
#align matrix.vec_append Matrix.vecAppend
-/
+#print Matrix.vecAppend_eq_ite /-
theorem vecAppend_eq_ite {α : Type _} {o : ℕ} (ho : o = m + n) (u : Fin m → α) (v : Fin n → α) :
vecAppend ho u v = fun i =>
if h : (i : ℕ) < m then u ⟨i, h⟩
@@ -301,17 +307,22 @@ theorem vecAppend_eq_ite {α : Type _} {o : ℕ} (ho : o = m + n) (u : Fin m →
simp only [eq_rec_constant]
rfl
#align matrix.vec_append_eq_ite Matrix.vecAppend_eq_ite
+-/
+#print Matrix.vecAppend_apply_zero /-
@[simp]
theorem vecAppend_apply_zero {α : Type _} {o : ℕ} (ho : o + 1 = m + 1 + n) (u : Fin (m + 1) → α)
(v : Fin n → α) : vecAppend ho u v 0 = u 0 :=
rfl
#align matrix.vec_append_apply_zero Matrix.vecAppend_apply_zero
+-/
+#print Matrix.empty_vecAppend /-
@[simp]
theorem empty_vecAppend (v : Fin n → α) : vecAppend (zero_add _).symm ![] v = v := by ext;
simp [vec_append_eq_ite]
#align matrix.empty_vec_append Matrix.empty_vecAppend
+-/
#print Matrix.cons_vecAppend /-
@[simp]
@@ -390,11 +401,13 @@ theorem vecAlt1_vecAppend (v : Fin (n + 1) → α) : vecAlt1 rfl (vecAppend rfl
#align matrix.vec_alt1_vec_append Matrix.vecAlt1_vecAppend
-/
+#print Matrix.vecHead_vecAlt0 /-
@[simp]
theorem vecHead_vecAlt0 (hm : m + 2 = n + 1 + (n + 1)) (v : Fin (m + 2) → α) :
vecHead (vecAlt0 hm v) = v 0 :=
rfl
#align matrix.vec_head_vec_alt0 Matrix.vecHead_vecAlt0
+-/
#print Matrix.vecHead_vecAlt1 /-
@[simp]
@@ -479,15 +492,19 @@ section Smul
variable {M : Type _} [SMul M α]
+#print Matrix.smul_empty /-
@[simp]
theorem smul_empty (x : M) (v : Fin 0 → α) : x • v = ![] :=
empty_eq _
#align matrix.smul_empty Matrix.smul_empty
+-/
+#print Matrix.smul_cons /-
@[simp]
theorem smul_cons (x : M) (y : α) (v : Fin n → α) : x • vecCons y v = vecCons (x • y) (x • v) := by
ext i; refine' Fin.cases _ _ i <;> simp
#align matrix.smul_cons Matrix.smul_cons
+-/
end Smul
mathlib commit https://github.com/leanprover-community/mathlib/commit/5f25c089cb34db4db112556f23c50d12da81b297
@@ -73,7 +73,7 @@ def vecCons {n : ℕ} (h : α) (t : Fin n → α) : Fin n.succ → α :=
-/
-- mathport name: «expr![ ,]»
-notation3"!["(l", "* => foldr (h t => vecCons h t) vecEmpty)"]" => l
+notation3"!["(l ", "* => foldr (h t => vecCons h t) vecEmpty)"]" => l
#print Matrix.vecHead /-
/-- `vec_head v` gives the first entry of the vector `v` -/
mathlib commit https://github.com/leanprover-community/mathlib/commit/cca40788df1b8755d5baf17ab2f27dacc2e17acb
@@ -318,18 +318,19 @@ theorem empty_vecAppend (v : Fin n → α) : vecAppend (zero_add _).symm ![] v =
theorem cons_vecAppend (ho : o + 1 = m + 1 + n) (x : α) (u : Fin m → α) (v : Fin n → α) :
vecAppend ho (vecCons x u) v =
vecCons x
- (vecAppend (by rwa [add_assoc, add_comm 1, ← add_assoc, add_right_cancel_iff] at ho) u v) :=
+ (vecAppend (by rwa [add_assoc, add_comm 1, ← add_assoc, add_right_cancel_iff] at ho ) u
+ v) :=
by
ext i
simp_rw [vec_append_eq_ite]
split_ifs with h
· rcases i with ⟨⟨⟩ | i, hi⟩
· simp
- · simp only [Nat.succ_eq_add_one, add_lt_add_iff_right, Fin.val_mk] at h
+ · simp only [Nat.succ_eq_add_one, add_lt_add_iff_right, Fin.val_mk] at h
simp [h]
· rcases i with ⟨⟨⟩ | i, hi⟩
· simpa using h
- · rw [not_lt, Fin.val_mk, Nat.succ_eq_add_one, add_le_add_iff_right] at h
+ · rw [not_lt, Fin.val_mk, Nat.succ_eq_add_one, add_le_add_iff_right] at h
simp [h]
#align matrix.cons_vec_append Matrix.cons_vecAppend
-/
@@ -356,10 +357,10 @@ theorem vecAlt0_vecAppend (v : Fin n → α) : vecAlt0 rfl (vecAppend rfl v v) =
ext i
simp_rw [Function.comp, bit0, vec_alt0, vec_append_eq_ite]
split_ifs with h <;> congr
- · rw [Fin.val_mk] at h
+ · rw [Fin.val_mk] at h
simp only [Fin.ext_iff, Fin.val_add, Fin.val_mk]
exact (Nat.mod_eq_of_lt h).symm
- · rw [Fin.val_mk, not_lt] at h
+ · rw [Fin.val_mk, not_lt] at h
simp only [Fin.ext_iff, Fin.val_add, Fin.val_mk, Nat.mod_eq_sub_mod h]
refine' (Nat.mod_eq_of_lt _).symm
rw [tsub_lt_iff_left h]
@@ -376,11 +377,11 @@ theorem vecAlt1_vecAppend (v : Fin (n + 1) → α) : vecAlt1 rfl (vecAppend rfl
· simp; congr
· split_ifs with h <;> simp_rw [bit1, bit0] <;> congr
· simp only [Fin.ext_iff, Fin.val_add, Fin.val_mk]
- rw [Fin.val_mk] at h
+ rw [Fin.val_mk] at h
rw [Fin.val_one]
rw [Nat.mod_eq_of_lt (Nat.lt_of_succ_lt h)]
rw [Nat.mod_eq_of_lt h]
- · rw [Fin.val_mk, not_lt] at h
+ · rw [Fin.val_mk, not_lt] at h
simp only [Fin.ext_iff, Fin.val_add, Fin.val_mk, Nat.mod_add_mod, Fin.val_one,
Nat.mod_eq_sub_mod h]
refine' (Nat.mod_eq_of_lt _).symm
@@ -426,7 +427,7 @@ theorem cons_vecAlt0 (h : m + 1 + 1 = n + 1 + (n + 1)) (x y : α) (u : Fin m →
(vecAlt0
(by
rwa [add_assoc n, add_comm 1, ← add_assoc, ← add_assoc, add_right_cancel_iff,
- add_right_cancel_iff] at h)
+ add_right_cancel_iff] at h )
u) :=
by
ext i
@@ -453,7 +454,7 @@ theorem cons_vecAlt1 (h : m + 1 + 1 = n + 1 + (n + 1)) (x y : α) (u : Fin m →
(vecAlt1
(by
rwa [add_assoc n, add_comm 1, ← add_assoc, ← add_assoc, add_right_cancel_iff,
- add_right_cancel_iff] at h)
+ add_right_cancel_iff] at h )
u) :=
by
ext i
mathlib commit https://github.com/leanprover-community/mathlib/commit/917c3c072e487b3cccdbfeff17e75b40e45f66cb
@@ -630,7 +630,7 @@ theorem cons_eq_zero_iff {v : Fin n → α} {x : α} : vecCons x v = 0 ↔ x = 0
#align matrix.cons_eq_zero_iff Matrix.cons_eq_zero_iff
-/
-open Classical
+open scoped Classical
#print Matrix.cons_nonzero_iff /-
theorem cons_nonzero_iff {v : Fin n → α} {x : α} : vecCons x v ≠ 0 ↔ x ≠ 0 ∨ v ≠ 0 :=
mathlib commit https://github.com/leanprover-community/mathlib/commit/917c3c072e487b3cccdbfeff17e75b40e45f66cb
@@ -123,12 +123,6 @@ theorem head_fin_const (a : α) : (vecHead fun i : Fin (n + 1) => a) = a :=
#align matrix.head_fin_const Matrix.head_fin_const
-/
-/- warning: matrix.cons_val_zero -> Matrix.cons_val_zero is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} {m : Nat} (x : α) (u : (Fin m) -> α), Eq.{succ u1} α (Matrix.vecCons.{u1} α m x u (OfNat.ofNat.{0} (Fin (Nat.succ m)) 0 (OfNat.mk.{0} (Fin (Nat.succ m)) 0 (Zero.zero.{0} (Fin (Nat.succ m)) (Fin.hasZeroOfNeZero (Nat.succ m) (NeZero.succ m)))))) x
-but is expected to have type
- forall {α : Type.{u1}} {m : Nat} (x : α) (u : (Fin m) -> α), Eq.{succ u1} α (Matrix.vecCons.{u1} α m x u (OfNat.ofNat.{0} (Fin (Nat.succ m)) 0 (Fin.instOfNatFin (Nat.succ m) 0 (NeZero.succ m)))) x
-Case conversion may be inaccurate. Consider using '#align matrix.cons_val_zero Matrix.cons_val_zeroₓ'. -/
@[simp]
theorem cons_val_zero (x : α) (u : Fin m → α) : vecCons x u 0 = x :=
rfl
@@ -168,12 +162,6 @@ theorem tail_cons (x : α) (u : Fin m → α) : vecTail (vecCons x u) = u := by
#align matrix.tail_cons Matrix.tail_cons
-/
-/- warning: matrix.empty_val' -> Matrix.empty_val' is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} {n' : Type.{u2}} (j : n'), Eq.{succ u1} ((Fin (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) -> α) (fun (i : Fin (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) => Matrix.vecEmpty.{max u2 u1} (n' -> α) i j) (Matrix.vecEmpty.{u1} α)
-but is expected to have type
- forall {α : Type.{u2}} {n' : Type.{u1}} (j : n'), Eq.{succ u2} ((Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> α) (fun (i : Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) => Matrix.vecEmpty.{max u2 u1} (n' -> α) i j) (Matrix.vecEmpty.{u2} α)
-Case conversion may be inaccurate. Consider using '#align matrix.empty_val' Matrix.empty_val'ₓ'. -/
@[simp]
theorem empty_val' {n' : Type _} (j : n') : (fun i => (![] : Fin 0 → n' → α) i j) = ![] :=
empty_eq _
@@ -186,12 +174,6 @@ theorem cons_head_tail (u : Fin m.succ → α) : vecCons (vecHead u) (vecTail u)
#align matrix.cons_head_tail Matrix.cons_head_tail
-/
-/- warning: matrix.range_cons -> Matrix.range_cons is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} {n : Nat} (x : α) (u : (Fin n) -> α), Eq.{succ u1} (Set.{u1} α) (Set.range.{u1, 1} α (Fin (Nat.succ n)) (Matrix.vecCons.{u1} α n x u)) (Union.union.{u1} (Set.{u1} α) (Set.hasUnion.{u1} α) (Singleton.singleton.{u1, u1} α (Set.{u1} α) (Set.hasSingleton.{u1} α) x) (Set.range.{u1, 1} α (Fin n) u))
-but is expected to have type
- forall {α : Type.{u1}} {n : Nat} (x : α) (u : (Fin n) -> α), Eq.{succ u1} (Set.{u1} α) (Set.range.{u1, 1} α (Fin (Nat.succ n)) (Matrix.vecCons.{u1} α n x u)) (Union.union.{u1} (Set.{u1} α) (Set.instUnionSet.{u1} α) (Singleton.singleton.{u1, u1} α (Set.{u1} α) (Set.instSingletonSet.{u1} α) x) (Set.range.{u1, 1} α (Fin n) u))
-Case conversion may be inaccurate. Consider using '#align matrix.range_cons Matrix.range_consₓ'. -/
@[simp]
theorem range_cons (x : α) (u : Fin n → α) : Set.range (vecCons x u) = {x} ∪ Set.range u :=
Set.ext fun y => by simp [Fin.exists_fin_succ, eq_comm]
@@ -308,9 +290,6 @@ def vecAppend {α : Type _} {o : ℕ} (ho : o = m + n) (u : Fin m → α) (v : F
#align matrix.vec_append Matrix.vecAppend
-/
-/- warning: matrix.vec_append_eq_ite -> Matrix.vecAppend_eq_ite is a dubious translation:
-<too large>
-Case conversion may be inaccurate. Consider using '#align matrix.vec_append_eq_ite Matrix.vecAppend_eq_iteₓ'. -/
theorem vecAppend_eq_ite {α : Type _} {o : ℕ} (ho : o = m + n) (u : Fin m → α) (v : Fin n → α) :
vecAppend ho u v = fun i =>
if h : (i : ℕ) < m then u ⟨i, h⟩
@@ -323,24 +302,12 @@ theorem vecAppend_eq_ite {α : Type _} {o : ℕ} (ho : o = m + n) (u : Fin m →
rfl
#align matrix.vec_append_eq_ite Matrix.vecAppend_eq_ite
-/- warning: matrix.vec_append_apply_zero -> Matrix.vecAppend_apply_zero is a dubious translation:
-lean 3 declaration is
- forall {m : Nat} {n : Nat} {α : Type.{u1}} {o : Nat} (ho : Eq.{1} Nat (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat Nat.hasAdd) o (OfNat.ofNat.{0} Nat 1 (OfNat.mk.{0} Nat 1 (One.one.{0} Nat Nat.hasOne)))) (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat Nat.hasAdd) (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat Nat.hasAdd) m (OfNat.ofNat.{0} Nat 1 (OfNat.mk.{0} Nat 1 (One.one.{0} Nat Nat.hasOne)))) n)) (u : (Fin (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat Nat.hasAdd) m (OfNat.ofNat.{0} Nat 1 (OfNat.mk.{0} Nat 1 (One.one.{0} Nat Nat.hasOne))))) -> α) (v : (Fin n) -> α), Eq.{succ u1} α (Matrix.vecAppend.{u1} (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat Nat.hasAdd) m (OfNat.ofNat.{0} Nat 1 (OfNat.mk.{0} Nat 1 (One.one.{0} Nat Nat.hasOne)))) n α (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat Nat.hasAdd) o (OfNat.ofNat.{0} Nat 1 (OfNat.mk.{0} Nat 1 (One.one.{0} Nat Nat.hasOne)))) ho u v (OfNat.ofNat.{0} (Fin (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat Nat.hasAdd) o (One.one.{0} Nat Nat.hasOne))) 0 (OfNat.mk.{0} (Fin (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat Nat.hasAdd) o (One.one.{0} Nat Nat.hasOne))) 0 (Zero.zero.{0} (Fin (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat Nat.hasAdd) o (One.one.{0} Nat Nat.hasOne))) (Fin.hasZeroOfNeZero (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat Nat.hasAdd) o (One.one.{0} Nat Nat.hasOne)) (NeZero.succ o)))))) (u (OfNat.ofNat.{0} (Fin (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat Nat.hasAdd) m (One.one.{0} Nat Nat.hasOne))) 0 (OfNat.mk.{0} (Fin (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat Nat.hasAdd) m (One.one.{0} Nat Nat.hasOne))) 0 (Zero.zero.{0} (Fin (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat Nat.hasAdd) m (One.one.{0} Nat Nat.hasOne))) (Fin.hasZeroOfNeZero (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat Nat.hasAdd) m (One.one.{0} Nat Nat.hasOne)) (NeZero.succ m))))))
-but is expected to have type
- forall {m : Nat} {n : Nat} {α : Type.{u1}} {o : Nat} (ho : Eq.{1} Nat (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat instAddNat) o (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1))) (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat instAddNat) (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat instAddNat) m (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1))) n)) (u : (Fin (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat instAddNat) m (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1)))) -> α) (v : (Fin n) -> α), Eq.{succ u1} α (Matrix.vecAppend.{u1} (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat instAddNat) m (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1))) n α (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat instAddNat) o (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1))) ho u v (OfNat.ofNat.{0} (Fin (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat instAddNat) o (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1)))) 0 (Fin.instOfNatFin (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat instAddNat) o (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1))) 0 (NeZero.succ o)))) (u (OfNat.ofNat.{0} (Fin (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat instAddNat) m (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1)))) 0 (Fin.instOfNatFin (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat instAddNat) m (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1))) 0 (NeZero.succ m))))
-Case conversion may be inaccurate. Consider using '#align matrix.vec_append_apply_zero Matrix.vecAppend_apply_zeroₓ'. -/
@[simp]
theorem vecAppend_apply_zero {α : Type _} {o : ℕ} (ho : o + 1 = m + 1 + n) (u : Fin (m + 1) → α)
(v : Fin n → α) : vecAppend ho u v 0 = u 0 :=
rfl
#align matrix.vec_append_apply_zero Matrix.vecAppend_apply_zero
-/- warning: matrix.empty_vec_append -> Matrix.empty_vecAppend is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} {n : Nat} (v : (Fin n) -> α), Eq.{succ u1} ((Fin n) -> α) (Matrix.vecAppend.{u1} (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat (AddZeroClass.toHasZero.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))))) n α n (Eq.symm.{1} Nat (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat (AddZeroClass.toHasAdd.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat (AddZeroClass.toHasZero.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))))) n) n (zero_add.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid) n)) (Matrix.vecEmpty.{u1} α) v) v
-but is expected to have type
- forall {α : Type.{u1}} {n : Nat} (v : (Fin n) -> α), Eq.{succ u1} ((Fin n) -> α) (Matrix.vecAppend.{u1} (OfNat.ofNat.{0} Nat 0 (Zero.toOfNat0.{0} Nat (AddZeroClass.toZero.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)))) n α n (Eq.symm.{1} Nat (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat (AddZeroClass.toAdd.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (OfNat.ofNat.{0} Nat 0 (Zero.toOfNat0.{0} Nat (AddZeroClass.toZero.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)))) n) n (zero_add.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid) n)) (Matrix.vecEmpty.{u1} α) v) v
-Case conversion may be inaccurate. Consider using '#align matrix.empty_vec_append Matrix.empty_vecAppendₓ'. -/
@[simp]
theorem empty_vecAppend (v : Fin n → α) : vecAppend (zero_add _).symm ![] v = v := by ext;
simp [vec_append_eq_ite]
@@ -422,12 +389,6 @@ theorem vecAlt1_vecAppend (v : Fin (n + 1) → α) : vecAlt1 rfl (vecAppend rfl
#align matrix.vec_alt1_vec_append Matrix.vecAlt1_vecAppend
-/
-/- warning: matrix.vec_head_vec_alt0 -> Matrix.vecHead_vecAlt0 is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} {m : Nat} {n : Nat} (hm : Eq.{1} Nat (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat Nat.hasAdd) m (OfNat.ofNat.{0} Nat 2 (OfNat.mk.{0} Nat 2 (bit0.{0} Nat Nat.hasAdd (One.one.{0} Nat Nat.hasOne))))) (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat Nat.hasAdd) (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat Nat.hasAdd) n (OfNat.ofNat.{0} Nat 1 (OfNat.mk.{0} Nat 1 (One.one.{0} Nat Nat.hasOne)))) (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat Nat.hasAdd) n (OfNat.ofNat.{0} Nat 1 (OfNat.mk.{0} Nat 1 (One.one.{0} Nat Nat.hasOne)))))) (v : (Fin (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat Nat.hasAdd) m (OfNat.ofNat.{0} Nat 2 (OfNat.mk.{0} Nat 2 (bit0.{0} Nat Nat.hasAdd (One.one.{0} Nat Nat.hasOne)))))) -> α), Eq.{succ u1} α (Matrix.vecHead.{u1} α n (Matrix.vecAlt0.{u1} α (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat Nat.hasAdd) m (OfNat.ofNat.{0} Nat 2 (OfNat.mk.{0} Nat 2 (bit0.{0} Nat Nat.hasAdd (One.one.{0} Nat Nat.hasOne))))) (Nat.succ n) hm v)) (v (OfNat.ofNat.{0} (Fin (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat Nat.hasAdd) m (bit0.{0} Nat Nat.hasAdd (One.one.{0} Nat Nat.hasOne)))) 0 (OfNat.mk.{0} (Fin (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat Nat.hasAdd) m (bit0.{0} Nat Nat.hasAdd (One.one.{0} Nat Nat.hasOne)))) 0 (Zero.zero.{0} (Fin (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat Nat.hasAdd) m (bit0.{0} Nat Nat.hasAdd (One.one.{0} Nat Nat.hasOne)))) (Fin.hasZeroOfNeZero (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat Nat.hasAdd) m (bit0.{0} Nat Nat.hasAdd (One.one.{0} Nat Nat.hasOne))) (NeZero.succ (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat Nat.hasAdd) m (One.one.{0} Nat Nat.hasOne))))))))
-but is expected to have type
- forall {α : Type.{u1}} {m : Nat} {n : Nat} (hm : Eq.{1} Nat (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat instAddNat) m (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2))) (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat instAddNat) (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat instAddNat) n (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1))) (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat instAddNat) n (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1))))) (v : (Fin (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat instAddNat) m (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2)))) -> α), Eq.{succ u1} α (Matrix.vecHead.{u1} α n (Matrix.vecAlt0.{u1} α (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat instAddNat) m (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2))) (Nat.succ n) hm v)) (v (OfNat.ofNat.{0} (Fin (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat instAddNat) m (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2)))) 0 (Fin.instOfNatFin (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat instAddNat) m (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2))) 0 (NeZero.succ (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat instAddNat) m (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1)))))))
-Case conversion may be inaccurate. Consider using '#align matrix.vec_head_vec_alt0 Matrix.vecHead_vecAlt0ₓ'. -/
@[simp]
theorem vecHead_vecAlt0 (hm : m + 2 = n + 1 + (n + 1)) (v : Fin (m + 2) → α) :
vecHead (vecAlt0 hm v) = v 0 :=
@@ -517,23 +478,11 @@ section Smul
variable {M : Type _} [SMul M α]
-/- warning: matrix.smul_empty -> Matrix.smul_empty is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} {M : Type.{u2}} [_inst_1 : SMul.{u2, u1} M α] (x : M) (v : (Fin (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) -> α), Eq.{succ u1} ((Fin (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) -> α) (SMul.smul.{u2, u1} M ((Fin (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) -> α) (Function.hasSMul.{0, u2, u1} (Fin (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) M α _inst_1) x v) (Matrix.vecEmpty.{u1} α)
-but is expected to have type
- forall {α : Type.{u2}} {M : Type.{u1}} [_inst_1 : SMul.{u1, u2} M α] (x : M) (v : (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> α), Eq.{succ u2} ((Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> α) (HSMul.hSMul.{u1, u2, u2} M ((Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> α) ((Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> α) (instHSMul.{u1, u2} M ((Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> α) (Pi.instSMul.{0, u2, u1} (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) M (fun (a._@.Mathlib.Data.Fin.VecNotation._hyg.4198 : Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) => α) (fun (i : Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) => _inst_1))) x v) (Matrix.vecEmpty.{u2} α)
-Case conversion may be inaccurate. Consider using '#align matrix.smul_empty Matrix.smul_emptyₓ'. -/
@[simp]
theorem smul_empty (x : M) (v : Fin 0 → α) : x • v = ![] :=
empty_eq _
#align matrix.smul_empty Matrix.smul_empty
-/- warning: matrix.smul_cons -> Matrix.smul_cons is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} {n : Nat} {M : Type.{u2}} [_inst_1 : SMul.{u2, u1} M α] (x : M) (y : α) (v : (Fin n) -> α), Eq.{succ u1} ((Fin (Nat.succ n)) -> α) (SMul.smul.{u2, u1} M ((Fin (Nat.succ n)) -> α) (Function.hasSMul.{0, u2, u1} (Fin (Nat.succ n)) M α _inst_1) x (Matrix.vecCons.{u1} α n y v)) (Matrix.vecCons.{u1} α n (SMul.smul.{u2, u1} M α _inst_1 x y) (SMul.smul.{u2, u1} M ((Fin n) -> α) (Function.hasSMul.{0, u2, u1} (Fin n) M α _inst_1) x v))
-but is expected to have type
- forall {α : Type.{u2}} {n : Nat} {M : Type.{u1}} [_inst_1 : SMul.{u1, u2} M α] (x : M) (y : α) (v : (Fin n) -> α), Eq.{succ u2} ((Fin (Nat.succ n)) -> α) (HSMul.hSMul.{u1, u2, u2} M ((Fin (Nat.succ n)) -> α) ((Fin (Nat.succ n)) -> α) (instHSMul.{u1, u2} M ((Fin (Nat.succ n)) -> α) (Pi.instSMul.{0, u2, u1} (Fin (Nat.succ n)) M (fun (a._@.Mathlib.Data.Fin.VecNotation._hyg.29 : Fin (Nat.succ n)) => α) (fun (i : Fin (Nat.succ n)) => _inst_1))) x (Matrix.vecCons.{u2} α n y v)) (Matrix.vecCons.{u2} α n (HSMul.hSMul.{u1, u2, u2} M α α (instHSMul.{u1, u2} M α _inst_1) x y) (HSMul.hSMul.{u1, u2, u2} M ((Fin n) -> α) ((Fin n) -> α) (instHSMul.{u1, u2} M ((Fin n) -> α) (Pi.instSMul.{0, u2, u1} (Fin n) M (fun (a._@.Mathlib.Data.Fin.VecNotation._hyg.4235 : Fin n) => α) (fun (i : Fin n) => _inst_1))) x v))
-Case conversion may be inaccurate. Consider using '#align matrix.smul_cons Matrix.smul_consₓ'. -/
@[simp]
theorem smul_cons (x : M) (y : α) (v : Fin n → α) : x • vecCons y v = vecCons (x • y) (x • v) := by
ext i; refine' Fin.cases _ _ i <;> simp
mathlib commit https://github.com/leanprover-community/mathlib/commit/917c3c072e487b3cccdbfeff17e75b40e45f66cb
@@ -164,10 +164,7 @@ theorem head_cons (x : α) (u : Fin m → α) : vecHead (vecCons x u) = x :=
#print Matrix.tail_cons /-
@[simp]
-theorem tail_cons (x : α) (u : Fin m → α) : vecTail (vecCons x u) = u :=
- by
- ext
- simp [vec_tail]
+theorem tail_cons (x : α) (u : Fin m → α) : vecTail (vecCons x u) = u := by ext; simp [vec_tail]
#align matrix.tail_cons Matrix.tail_cons
-/
@@ -242,19 +239,15 @@ theorem vec_single_eq_const (a : α) : ![a] = fun _ => a :=
`cons_val_succ`, because `1 : fin 1 = 0 : fin 1`.
-/
@[simp]
-theorem cons_val_one (x : α) (u : Fin m.succ → α) : vecCons x u 1 = vecHead u :=
- by
- rw [← Fin.succ_zero_eq_one, cons_val_succ]
- rfl
+theorem cons_val_one (x : α) (u : Fin m.succ → α) : vecCons x u 1 = vecHead u := by
+ rw [← Fin.succ_zero_eq_one, cons_val_succ]; rfl
#align matrix.cons_val_one Matrix.cons_val_one
-/
#print Matrix.cons_val_fin_one /-
@[simp]
-theorem cons_val_fin_one (x : α) (u : Fin 0 → α) (i : Fin 1) : vecCons x u i = x :=
- by
- refine' Fin.forall_fin_one.2 _ i
- rfl
+theorem cons_val_fin_one (x : α) (u : Fin 0 → α) (i : Fin 1) : vecCons x u i = x := by
+ refine' Fin.forall_fin_one.2 _ i; rfl
#align matrix.cons_val_fin_one Matrix.cons_val_fin_one
-/
@@ -349,9 +342,7 @@ but is expected to have type
forall {α : Type.{u1}} {n : Nat} (v : (Fin n) -> α), Eq.{succ u1} ((Fin n) -> α) (Matrix.vecAppend.{u1} (OfNat.ofNat.{0} Nat 0 (Zero.toOfNat0.{0} Nat (AddZeroClass.toZero.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)))) n α n (Eq.symm.{1} Nat (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat (AddZeroClass.toAdd.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (OfNat.ofNat.{0} Nat 0 (Zero.toOfNat0.{0} Nat (AddZeroClass.toZero.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)))) n) n (zero_add.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid) n)) (Matrix.vecEmpty.{u1} α) v) v
Case conversion may be inaccurate. Consider using '#align matrix.empty_vec_append Matrix.empty_vecAppendₓ'. -/
@[simp]
-theorem empty_vecAppend (v : Fin n → α) : vecAppend (zero_add _).symm ![] v = v :=
- by
- ext
+theorem empty_vecAppend (v : Fin n → α) : vecAppend (zero_add _).symm ![] v = v := by ext;
simp [vec_append_eq_ite]
#align matrix.empty_vec_append Matrix.empty_vecAppend
@@ -415,8 +406,7 @@ theorem vecAlt1_vecAppend (v : Fin (n + 1) → α) : vecAlt1 rfl (vecAppend rfl
ext i
simp_rw [Function.comp, vec_alt1, vec_append_eq_ite]
cases n
- · simp
- congr
+ · simp; congr
· split_ifs with h <;> simp_rw [bit1, bit0] <;> congr
· simp only [Fin.ext_iff, Fin.val_add, Fin.val_mk]
rw [Fin.val_mk] at h
@@ -545,10 +535,8 @@ but is expected to have type
forall {α : Type.{u2}} {n : Nat} {M : Type.{u1}} [_inst_1 : SMul.{u1, u2} M α] (x : M) (y : α) (v : (Fin n) -> α), Eq.{succ u2} ((Fin (Nat.succ n)) -> α) (HSMul.hSMul.{u1, u2, u2} M ((Fin (Nat.succ n)) -> α) ((Fin (Nat.succ n)) -> α) (instHSMul.{u1, u2} M ((Fin (Nat.succ n)) -> α) (Pi.instSMul.{0, u2, u1} (Fin (Nat.succ n)) M (fun (a._@.Mathlib.Data.Fin.VecNotation._hyg.29 : Fin (Nat.succ n)) => α) (fun (i : Fin (Nat.succ n)) => _inst_1))) x (Matrix.vecCons.{u2} α n y v)) (Matrix.vecCons.{u2} α n (HSMul.hSMul.{u1, u2, u2} M α α (instHSMul.{u1, u2} M α _inst_1) x y) (HSMul.hSMul.{u1, u2, u2} M ((Fin n) -> α) ((Fin n) -> α) (instHSMul.{u1, u2} M ((Fin n) -> α) (Pi.instSMul.{0, u2, u1} (Fin n) M (fun (a._@.Mathlib.Data.Fin.VecNotation._hyg.4235 : Fin n) => α) (fun (i : Fin n) => _inst_1))) x v))
Case conversion may be inaccurate. Consider using '#align matrix.smul_cons Matrix.smul_consₓ'. -/
@[simp]
-theorem smul_cons (x : M) (y : α) (v : Fin n → α) : x • vecCons y v = vecCons (x • y) (x • v) :=
- by
- ext i
- refine' Fin.cases _ _ i <;> simp
+theorem smul_cons (x : M) (y : α) (v : Fin n → α) : x • vecCons y v = vecCons (x • y) (x • v) := by
+ ext i; refine' Fin.cases _ _ i <;> simp
#align matrix.smul_cons Matrix.smul_cons
end Smul
@@ -567,9 +555,7 @@ theorem empty_add_empty (v w : Fin 0 → α) : v + w = ![] :=
#print Matrix.cons_add /-
@[simp]
theorem cons_add (x : α) (v : Fin n → α) (w : Fin n.succ → α) :
- vecCons x v + w = vecCons (x + vecHead w) (v + vecTail w) :=
- by
- ext i
+ vecCons x v + w = vecCons (x + vecHead w) (v + vecTail w) := by ext i;
refine' Fin.cases _ _ i <;> simp [vec_head, vec_tail]
#align matrix.cons_add Matrix.cons_add
-/
@@ -577,9 +563,7 @@ theorem cons_add (x : α) (v : Fin n → α) (w : Fin n.succ → α) :
#print Matrix.add_cons /-
@[simp]
theorem add_cons (v : Fin n.succ → α) (y : α) (w : Fin n → α) :
- v + vecCons y w = vecCons (vecHead v + y) (vecTail v + w) :=
- by
- ext i
+ v + vecCons y w = vecCons (vecHead v + y) (vecTail v + w) := by ext i;
refine' Fin.cases _ _ i <;> simp [vec_head, vec_tail]
#align matrix.add_cons Matrix.add_cons
-/
@@ -621,9 +605,7 @@ theorem empty_sub_empty (v w : Fin 0 → α) : v - w = ![] :=
#print Matrix.cons_sub /-
@[simp]
theorem cons_sub (x : α) (v : Fin n → α) (w : Fin n.succ → α) :
- vecCons x v - w = vecCons (x - vecHead w) (v - vecTail w) :=
- by
- ext i
+ vecCons x v - w = vecCons (x - vecHead w) (v - vecTail w) := by ext i;
refine' Fin.cases _ _ i <;> simp [vec_head, vec_tail]
#align matrix.cons_sub Matrix.cons_sub
-/
@@ -631,9 +613,7 @@ theorem cons_sub (x : α) (v : Fin n → α) (w : Fin n.succ → α) :
#print Matrix.sub_cons /-
@[simp]
theorem sub_cons (v : Fin n.succ → α) (y : α) (w : Fin n → α) :
- v - vecCons y w = vecCons (vecHead v - y) (vecTail v - w) :=
- by
- ext i
+ v - vecCons y w = vecCons (vecHead v - y) (vecTail v - w) := by ext i;
refine' Fin.cases _ _ i <;> simp [vec_head, vec_tail]
#align matrix.sub_cons Matrix.sub_cons
-/
@@ -674,12 +654,8 @@ theorem zero_empty : (0 : Fin 0 → α) = ![] :=
#print Matrix.cons_zero_zero /-
@[simp]
-theorem cons_zero_zero : vecCons (0 : α) (0 : Fin n → α) = 0 :=
- by
- ext (i j)
- refine' Fin.cases _ _ i
- · rfl
- simp
+theorem cons_zero_zero : vecCons (0 : α) (0 : Fin n → α) = 0 := by ext (i j);
+ refine' Fin.cases _ _ i; · rfl; simp
#align matrix.cons_zero_zero Matrix.cons_zero_zero
-/
@@ -700,11 +676,8 @@ theorem tail_zero : vecTail (0 : Fin n.succ → α) = 0 :=
#print Matrix.cons_eq_zero_iff /-
@[simp]
theorem cons_eq_zero_iff {v : Fin n → α} {x : α} : vecCons x v = 0 ↔ x = 0 ∧ v = 0 :=
- ⟨fun h =>
- ⟨congr_fun h 0, by
- convert congr_arg vec_tail h
- simp⟩,
- fun ⟨hx, hv⟩ => by simp [hx, hv]⟩
+ ⟨fun h => ⟨congr_fun h 0, by convert congr_arg vec_tail h; simp⟩, fun ⟨hx, hv⟩ => by
+ simp [hx, hv]⟩
#align matrix.cons_eq_zero_iff Matrix.cons_eq_zero_iff
-/
@@ -732,9 +705,7 @@ theorem neg_empty (v : Fin 0 → α) : -v = ![] :=
#print Matrix.neg_cons /-
@[simp]
-theorem neg_cons (x : α) (v : Fin n → α) : -vecCons x v = vecCons (-x) (-v) :=
- by
- ext i
+theorem neg_cons (x : α) (v : Fin n → α) : -vecCons x v = vecCons (-x) (-v) := by ext i;
refine' Fin.cases _ _ i <;> simp
#align matrix.neg_cons Matrix.neg_cons
-/
mathlib commit https://github.com/leanprover-community/mathlib/commit/917c3c072e487b3cccdbfeff17e75b40e45f66cb
@@ -316,10 +316,7 @@ def vecAppend {α : Type _} {o : ℕ} (ho : o = m + n) (u : Fin m → α) (v : F
-/
/- warning: matrix.vec_append_eq_ite -> Matrix.vecAppend_eq_ite is a dubious translation:
-lean 3 declaration is
- forall {m : Nat} {n : Nat} {α : Type.{u1}} {o : Nat} (ho : Eq.{1} Nat o (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat Nat.hasAdd) m n)) (u : (Fin m) -> α) (v : (Fin n) -> α), Eq.{succ u1} ((Fin o) -> α) (Matrix.vecAppend.{u1} m n α o ho u v) (fun (i : Fin o) => dite.{succ u1} α (LT.lt.{0} Nat Nat.hasLt ((fun (a : Type) (b : Type) [self : HasLiftT.{1, 1} a b] => self.0) (Fin o) Nat (HasLiftT.mk.{1, 1} (Fin o) Nat (CoeTCₓ.coe.{1, 1} (Fin o) Nat (coeBase.{1, 1} (Fin o) Nat (Fin.coeToNat o)))) i) m) (Nat.decidableLt ((fun (a : Type) (b : Type) [self : HasLiftT.{1, 1} a b] => self.0) (Fin o) Nat (HasLiftT.mk.{1, 1} (Fin o) Nat (CoeTCₓ.coe.{1, 1} (Fin o) Nat (coeBase.{1, 1} (Fin o) Nat (Fin.coeToNat o)))) i) m) (fun (h : LT.lt.{0} Nat Nat.hasLt ((fun (a : Type) (b : Type) [self : HasLiftT.{1, 1} a b] => self.0) (Fin o) Nat (HasLiftT.mk.{1, 1} (Fin o) Nat (CoeTCₓ.coe.{1, 1} (Fin o) Nat (coeBase.{1, 1} (Fin o) Nat (Fin.coeToNat o)))) i) m) => u (Fin.mk m ((fun (a : Type) (b : Type) [self : HasLiftT.{1, 1} a b] => self.0) (Fin o) Nat (HasLiftT.mk.{1, 1} (Fin o) Nat (CoeTCₓ.coe.{1, 1} (Fin o) Nat (coeBase.{1, 1} (Fin o) Nat (Fin.coeToNat o)))) i) h)) (fun (h : Not (LT.lt.{0} Nat Nat.hasLt ((fun (a : Type) (b : Type) [self : HasLiftT.{1, 1} a b] => self.0) (Fin o) Nat (HasLiftT.mk.{1, 1} (Fin o) Nat (CoeTCₓ.coe.{1, 1} (Fin o) Nat (coeBase.{1, 1} (Fin o) Nat (Fin.coeToNat o)))) i) m)) => v (Fin.mk n (HSub.hSub.{0, 0, 0} Nat Nat Nat (instHSub.{0} Nat Nat.hasSub) ((fun (a : Type) (b : Type) [self : HasLiftT.{1, 1} a b] => self.0) (Fin o) Nat (HasLiftT.mk.{1, 1} (Fin o) Nat (CoeTCₓ.coe.{1, 1} (Fin o) Nat (coeBase.{1, 1} (Fin o) Nat (Fin.coeToNat o)))) i) m) (Iff.mpr (LT.lt.{0} Nat (Preorder.toHasLt.{0} Nat (PartialOrder.toPreorder.{0} Nat (LinearOrder.toPartialOrder.{0} Nat Nat.linearOrder))) (HSub.hSub.{0, 0, 0} Nat Nat Nat (instHSub.{0} Nat Nat.hasSub) ((fun (a : Type) (b : Type) [self : HasLiftT.{1, 1} a b] => self.0) (Fin o) Nat (HasLiftT.mk.{1, 1} (Fin o) Nat (CoeTCₓ.coe.{1, 1} (Fin o) Nat (coeBase.{1, 1} (Fin o) Nat (Fin.coeToNat o)))) i) m) n) (LT.lt.{0} Nat (Preorder.toHasLt.{0} Nat (PartialOrder.toPreorder.{0} Nat (LinearOrder.toPartialOrder.{0} Nat Nat.linearOrder))) ((fun (a : Type) (b : Type) [self : HasLiftT.{1, 1} a b] => self.0) (Fin o) Nat (HasLiftT.mk.{1, 1} (Fin o) Nat (CoeTCₓ.coe.{1, 1} (Fin o) Nat (coeBase.{1, 1} (Fin o) Nat (Fin.coeToNat o)))) i) (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat (AddSemigroup.toHasAdd.{0} Nat (AddCommSemigroup.toAddSemigroup.{0} Nat Nat.addCommSemigroup))) m n)) (tsub_lt_iff_left.{0} Nat Nat.addCommSemigroup (LinearOrder.toPartialOrder.{0} Nat Nat.linearOrder) (CanonicallyOrderedAddMonoid.existsAddOfLE.{0} Nat (CanonicallyOrderedCommSemiring.toCanonicallyOrderedAddMonoid.{0} Nat Nat.canonicallyOrderedCommSemiring)) (OrderedAddCommMonoid.to_covariantClass_left.{0} Nat (OrderedSemiring.toOrderedAddCommMonoid.{0} Nat Nat.orderedSemiring)) Nat.hasSub Nat.orderedSub ((fun (a : Type) (b : Type) [self : HasLiftT.{1, 1} a b] => self.0) (Fin o) Nat (HasLiftT.mk.{1, 1} (Fin o) Nat (CoeTCₓ.coe.{1, 1} (Fin o) Nat (coeBase.{1, 1} (Fin o) Nat (Fin.coeToNat o)))) i) m n (AddLeftCancelSemigroup.contravariant_add_le_of_contravariant_add_lt.{0} Nat (AddLeftCancelMonoid.toAddLeftCancelSemigroup.{0} Nat (AddCancelCommMonoid.toAddLeftCancelMonoid.{0} Nat (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{0} Nat (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Nat Nat.strictOrderedSemiring)))) (OrderedCancelAddCommMonoid.toPartialOrder.{0} Nat (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Nat Nat.strictOrderedSemiring)) (OrderedCancelAddCommMonoid.to_contravariantClass_left.{0} Nat (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Nat Nat.strictOrderedSemiring))) (le_of_not_lt.{0} Nat Nat.linearOrder m ((fun (a : Type) (b : Type) [self : HasLiftT.{1, 1} a b] => self.0) (Fin o) Nat (HasLiftT.mk.{1, 1} (Fin o) Nat (CoeTCₓ.coe.{1, 1} (Fin o) Nat (coeBase.{1, 1} (Fin o) Nat (Fin.coeToNat o)))) i) h)) (Eq.subst.{1} Nat (fun (_x : Nat) => LT.lt.{0} Nat (Preorder.toHasLt.{0} Nat (PartialOrder.toPreorder.{0} Nat (LinearOrder.toPartialOrder.{0} Nat Nat.linearOrder))) ((fun (a : Type) (b : Type) [self : HasLiftT.{1, 1} a b] => self.0) (Fin o) Nat (HasLiftT.mk.{1, 1} (Fin o) Nat (CoeTCₓ.coe.{1, 1} (Fin o) Nat (coeBase.{1, 1} (Fin o) Nat (Fin.coeToNat o)))) i) _x) o (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat Nat.hasAdd) m n) ho (Fin.property o i))))))
-but is expected to have type
- forall {m : Nat} {n : Nat} {α : Type.{u1}} {o : Nat} (ho : Eq.{1} Nat o (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat instAddNat) m n)) (u : (Fin m) -> α) (v : (Fin n) -> α), Eq.{succ u1} ((Fin o) -> α) (Matrix.vecAppend.{u1} m n α o ho u v) (fun (i : Fin o) => dite.{succ u1} α (LT.lt.{0} Nat instLTNat (Fin.val o i) m) (Nat.decLt (Fin.val o i) m) (fun (h : LT.lt.{0} Nat instLTNat (Fin.val o i) m) => u (Fin.mk m (Fin.val o i) h)) (fun (h : Not (LT.lt.{0} Nat instLTNat (Fin.val o i) m)) => v (Fin.mk n (HSub.hSub.{0, 0, 0} Nat Nat Nat (instHSub.{0} Nat instSubNat) (Fin.val o i) m) (Iff.mpr (LT.lt.{0} Nat (Preorder.toLT.{0} Nat (PartialOrder.toPreorder.{0} Nat (LinearOrder.toPartialOrder.{0} Nat Nat.linearOrder))) (HSub.hSub.{0, 0, 0} Nat Nat Nat (instHSub.{0} Nat instSubNat) (Fin.val o i) m) n) (LT.lt.{0} Nat (Preorder.toLT.{0} Nat (PartialOrder.toPreorder.{0} Nat (LinearOrder.toPartialOrder.{0} Nat Nat.linearOrder))) (Fin.val o i) (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat (AddSemigroup.toAdd.{0} Nat (AddCommSemigroup.toAddSemigroup.{0} Nat Nat.addCommSemigroup))) m n)) (tsub_lt_iff_left.{0} Nat Nat.addCommSemigroup (LinearOrder.toPartialOrder.{0} Nat Nat.linearOrder) (CanonicallyOrderedAddMonoid.existsAddOfLE.{0} Nat (CanonicallyOrderedCommSemiring.toCanonicallyOrderedAddMonoid.{0} Nat Nat.canonicallyOrderedCommSemiring)) (OrderedAddCommMonoid.to_covariantClass_left.{0} Nat (OrderedSemiring.toOrderedAddCommMonoid.{0} Nat Nat.orderedSemiring)) instSubNat Nat.instOrderedSubNatInstLENatInstAddNatInstSubNat (Fin.val o i) m n (AddLeftCancelSemigroup.contravariant_add_le_of_contravariant_add_lt.{0} Nat (AddLeftCancelMonoid.toAddLeftCancelSemigroup.{0} Nat (AddCancelCommMonoid.toAddLeftCancelMonoid.{0} Nat (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{0} Nat (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Nat Nat.strictOrderedSemiring)))) (StrictOrderedSemiring.toPartialOrder.{0} Nat Nat.strictOrderedSemiring) (OrderedCancelAddCommMonoid.to_contravariantClass_left.{0} Nat (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Nat Nat.strictOrderedSemiring))) (le_of_not_lt.{0} Nat Nat.linearOrder m (Fin.val o i) h)) (Eq.rec.{0, 1} Nat o (fun (x._@.Mathlib.Data.Fin.VecNotation._hyg.2608 : Nat) (h._@.Mathlib.Data.Fin.VecNotation._hyg.2609 : Eq.{1} Nat o x._@.Mathlib.Data.Fin.VecNotation._hyg.2608) => LT.lt.{0} Nat (Preorder.toLT.{0} Nat (PartialOrder.toPreorder.{0} Nat (LinearOrder.toPartialOrder.{0} Nat Nat.linearOrder))) (Fin.val o i) x._@.Mathlib.Data.Fin.VecNotation._hyg.2608) (Fin.isLt o i) (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat instAddNat) m n) ho)))))
+<too large>
Case conversion may be inaccurate. Consider using '#align matrix.vec_append_eq_ite Matrix.vecAppend_eq_iteₓ'. -/
theorem vecAppend_eq_ite {α : Type _} {o : ℕ} (ho : o = m + n) (u : Fin m → α) (v : Fin n → α) :
vecAppend ho u v = fun i =>
@@ -534,7 +531,7 @@ variable {M : Type _} [SMul M α]
lean 3 declaration is
forall {α : Type.{u1}} {M : Type.{u2}} [_inst_1 : SMul.{u2, u1} M α] (x : M) (v : (Fin (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) -> α), Eq.{succ u1} ((Fin (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) -> α) (SMul.smul.{u2, u1} M ((Fin (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) -> α) (Function.hasSMul.{0, u2, u1} (Fin (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) M α _inst_1) x v) (Matrix.vecEmpty.{u1} α)
but is expected to have type
- forall {α : Type.{u2}} {M : Type.{u1}} [_inst_1 : SMul.{u1, u2} M α] (x : M) (v : (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> α), Eq.{succ u2} ((Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> α) (HSMul.hSMul.{u1, u2, u2} M ((Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> α) ((Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> α) (instHSMul.{u1, u2} M ((Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> α) (Pi.instSMul.{0, u2, u1} (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) M (fun (a._@.Mathlib.Data.Fin.VecNotation._hyg.4200 : Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) => α) (fun (i : Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) => _inst_1))) x v) (Matrix.vecEmpty.{u2} α)
+ forall {α : Type.{u2}} {M : Type.{u1}} [_inst_1 : SMul.{u1, u2} M α] (x : M) (v : (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> α), Eq.{succ u2} ((Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> α) (HSMul.hSMul.{u1, u2, u2} M ((Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> α) ((Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> α) (instHSMul.{u1, u2} M ((Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> α) (Pi.instSMul.{0, u2, u1} (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) M (fun (a._@.Mathlib.Data.Fin.VecNotation._hyg.4198 : Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) => α) (fun (i : Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) => _inst_1))) x v) (Matrix.vecEmpty.{u2} α)
Case conversion may be inaccurate. Consider using '#align matrix.smul_empty Matrix.smul_emptyₓ'. -/
@[simp]
theorem smul_empty (x : M) (v : Fin 0 → α) : x • v = ![] :=
@@ -545,7 +542,7 @@ theorem smul_empty (x : M) (v : Fin 0 → α) : x • v = ![] :=
lean 3 declaration is
forall {α : Type.{u1}} {n : Nat} {M : Type.{u2}} [_inst_1 : SMul.{u2, u1} M α] (x : M) (y : α) (v : (Fin n) -> α), Eq.{succ u1} ((Fin (Nat.succ n)) -> α) (SMul.smul.{u2, u1} M ((Fin (Nat.succ n)) -> α) (Function.hasSMul.{0, u2, u1} (Fin (Nat.succ n)) M α _inst_1) x (Matrix.vecCons.{u1} α n y v)) (Matrix.vecCons.{u1} α n (SMul.smul.{u2, u1} M α _inst_1 x y) (SMul.smul.{u2, u1} M ((Fin n) -> α) (Function.hasSMul.{0, u2, u1} (Fin n) M α _inst_1) x v))
but is expected to have type
- forall {α : Type.{u2}} {n : Nat} {M : Type.{u1}} [_inst_1 : SMul.{u1, u2} M α] (x : M) (y : α) (v : (Fin n) -> α), Eq.{succ u2} ((Fin (Nat.succ n)) -> α) (HSMul.hSMul.{u1, u2, u2} M ((Fin (Nat.succ n)) -> α) ((Fin (Nat.succ n)) -> α) (instHSMul.{u1, u2} M ((Fin (Nat.succ n)) -> α) (Pi.instSMul.{0, u2, u1} (Fin (Nat.succ n)) M (fun (a._@.Mathlib.Data.Fin.VecNotation._hyg.29 : Fin (Nat.succ n)) => α) (fun (i : Fin (Nat.succ n)) => _inst_1))) x (Matrix.vecCons.{u2} α n y v)) (Matrix.vecCons.{u2} α n (HSMul.hSMul.{u1, u2, u2} M α α (instHSMul.{u1, u2} M α _inst_1) x y) (HSMul.hSMul.{u1, u2, u2} M ((Fin n) -> α) ((Fin n) -> α) (instHSMul.{u1, u2} M ((Fin n) -> α) (Pi.instSMul.{0, u2, u1} (Fin n) M (fun (a._@.Mathlib.Data.Fin.VecNotation._hyg.4237 : Fin n) => α) (fun (i : Fin n) => _inst_1))) x v))
+ forall {α : Type.{u2}} {n : Nat} {M : Type.{u1}} [_inst_1 : SMul.{u1, u2} M α] (x : M) (y : α) (v : (Fin n) -> α), Eq.{succ u2} ((Fin (Nat.succ n)) -> α) (HSMul.hSMul.{u1, u2, u2} M ((Fin (Nat.succ n)) -> α) ((Fin (Nat.succ n)) -> α) (instHSMul.{u1, u2} M ((Fin (Nat.succ n)) -> α) (Pi.instSMul.{0, u2, u1} (Fin (Nat.succ n)) M (fun (a._@.Mathlib.Data.Fin.VecNotation._hyg.29 : Fin (Nat.succ n)) => α) (fun (i : Fin (Nat.succ n)) => _inst_1))) x (Matrix.vecCons.{u2} α n y v)) (Matrix.vecCons.{u2} α n (HSMul.hSMul.{u1, u2, u2} M α α (instHSMul.{u1, u2} M α _inst_1) x y) (HSMul.hSMul.{u1, u2, u2} M ((Fin n) -> α) ((Fin n) -> α) (instHSMul.{u1, u2} M ((Fin n) -> α) (Pi.instSMul.{0, u2, u1} (Fin n) M (fun (a._@.Mathlib.Data.Fin.VecNotation._hyg.4235 : Fin n) => α) (fun (i : Fin n) => _inst_1))) x v))
Case conversion may be inaccurate. Consider using '#align matrix.smul_cons Matrix.smul_consₓ'. -/
@[simp]
theorem smul_cons (x : M) (y : α) (v : Fin n → α) : x • vecCons y v = vecCons (x • y) (x • v) :=
mathlib commit https://github.com/leanprover-community/mathlib/commit/0b9eaaa7686280fad8cce467f5c3c57ee6ce77f8
@@ -317,7 +317,7 @@ def vecAppend {α : Type _} {o : ℕ} (ho : o = m + n) (u : Fin m → α) (v : F
/- warning: matrix.vec_append_eq_ite -> Matrix.vecAppend_eq_ite is a dubious translation:
lean 3 declaration is
- forall {m : Nat} {n : Nat} {α : Type.{u1}} {o : Nat} (ho : Eq.{1} Nat o (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat Nat.hasAdd) m n)) (u : (Fin m) -> α) (v : (Fin n) -> α), Eq.{succ u1} ((Fin o) -> α) (Matrix.vecAppend.{u1} m n α o ho u v) (fun (i : Fin o) => dite.{succ u1} α (LT.lt.{0} Nat Nat.hasLt ((fun (a : Type) (b : Type) [self : HasLiftT.{1, 1} a b] => self.0) (Fin o) Nat (HasLiftT.mk.{1, 1} (Fin o) Nat (CoeTCₓ.coe.{1, 1} (Fin o) Nat (coeBase.{1, 1} (Fin o) Nat (Fin.coeToNat o)))) i) m) (Nat.decidableLt ((fun (a : Type) (b : Type) [self : HasLiftT.{1, 1} a b] => self.0) (Fin o) Nat (HasLiftT.mk.{1, 1} (Fin o) Nat (CoeTCₓ.coe.{1, 1} (Fin o) Nat (coeBase.{1, 1} (Fin o) Nat (Fin.coeToNat o)))) i) m) (fun (h : LT.lt.{0} Nat Nat.hasLt ((fun (a : Type) (b : Type) [self : HasLiftT.{1, 1} a b] => self.0) (Fin o) Nat (HasLiftT.mk.{1, 1} (Fin o) Nat (CoeTCₓ.coe.{1, 1} (Fin o) Nat (coeBase.{1, 1} (Fin o) Nat (Fin.coeToNat o)))) i) m) => u (Fin.mk m ((fun (a : Type) (b : Type) [self : HasLiftT.{1, 1} a b] => self.0) (Fin o) Nat (HasLiftT.mk.{1, 1} (Fin o) Nat (CoeTCₓ.coe.{1, 1} (Fin o) Nat (coeBase.{1, 1} (Fin o) Nat (Fin.coeToNat o)))) i) h)) (fun (h : Not (LT.lt.{0} Nat Nat.hasLt ((fun (a : Type) (b : Type) [self : HasLiftT.{1, 1} a b] => self.0) (Fin o) Nat (HasLiftT.mk.{1, 1} (Fin o) Nat (CoeTCₓ.coe.{1, 1} (Fin o) Nat (coeBase.{1, 1} (Fin o) Nat (Fin.coeToNat o)))) i) m)) => v (Fin.mk n (HSub.hSub.{0, 0, 0} Nat Nat Nat (instHSub.{0} Nat Nat.hasSub) ((fun (a : Type) (b : Type) [self : HasLiftT.{1, 1} a b] => self.0) (Fin o) Nat (HasLiftT.mk.{1, 1} (Fin o) Nat (CoeTCₓ.coe.{1, 1} (Fin o) Nat (coeBase.{1, 1} (Fin o) Nat (Fin.coeToNat o)))) i) m) (Iff.mpr (LT.lt.{0} Nat (Preorder.toLT.{0} Nat (PartialOrder.toPreorder.{0} Nat (LinearOrder.toPartialOrder.{0} Nat Nat.linearOrder))) (HSub.hSub.{0, 0, 0} Nat Nat Nat (instHSub.{0} Nat Nat.hasSub) ((fun (a : Type) (b : Type) [self : HasLiftT.{1, 1} a b] => self.0) (Fin o) Nat (HasLiftT.mk.{1, 1} (Fin o) Nat (CoeTCₓ.coe.{1, 1} (Fin o) Nat (coeBase.{1, 1} (Fin o) Nat (Fin.coeToNat o)))) i) m) n) (LT.lt.{0} Nat (Preorder.toLT.{0} Nat (PartialOrder.toPreorder.{0} Nat (LinearOrder.toPartialOrder.{0} Nat Nat.linearOrder))) ((fun (a : Type) (b : Type) [self : HasLiftT.{1, 1} a b] => self.0) (Fin o) Nat (HasLiftT.mk.{1, 1} (Fin o) Nat (CoeTCₓ.coe.{1, 1} (Fin o) Nat (coeBase.{1, 1} (Fin o) Nat (Fin.coeToNat o)))) i) (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat (AddSemigroup.toHasAdd.{0} Nat (AddCommSemigroup.toAddSemigroup.{0} Nat Nat.addCommSemigroup))) m n)) (tsub_lt_iff_left.{0} Nat Nat.addCommSemigroup (LinearOrder.toPartialOrder.{0} Nat Nat.linearOrder) (CanonicallyOrderedAddMonoid.existsAddOfLE.{0} Nat (CanonicallyOrderedCommSemiring.toCanonicallyOrderedAddMonoid.{0} Nat Nat.canonicallyOrderedCommSemiring)) (OrderedAddCommMonoid.to_covariantClass_left.{0} Nat (OrderedSemiring.toOrderedAddCommMonoid.{0} Nat Nat.orderedSemiring)) Nat.hasSub Nat.orderedSub ((fun (a : Type) (b : Type) [self : HasLiftT.{1, 1} a b] => self.0) (Fin o) Nat (HasLiftT.mk.{1, 1} (Fin o) Nat (CoeTCₓ.coe.{1, 1} (Fin o) Nat (coeBase.{1, 1} (Fin o) Nat (Fin.coeToNat o)))) i) m n (AddLeftCancelSemigroup.contravariant_add_le_of_contravariant_add_lt.{0} Nat (AddLeftCancelMonoid.toAddLeftCancelSemigroup.{0} Nat (AddCancelCommMonoid.toAddLeftCancelMonoid.{0} Nat (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{0} Nat (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Nat Nat.strictOrderedSemiring)))) (OrderedCancelAddCommMonoid.toPartialOrder.{0} Nat (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Nat Nat.strictOrderedSemiring)) (OrderedCancelAddCommMonoid.to_contravariantClass_left.{0} Nat (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Nat Nat.strictOrderedSemiring))) (le_of_not_lt.{0} Nat Nat.linearOrder m ((fun (a : Type) (b : Type) [self : HasLiftT.{1, 1} a b] => self.0) (Fin o) Nat (HasLiftT.mk.{1, 1} (Fin o) Nat (CoeTCₓ.coe.{1, 1} (Fin o) Nat (coeBase.{1, 1} (Fin o) Nat (Fin.coeToNat o)))) i) h)) (Eq.subst.{1} Nat (fun (_x : Nat) => LT.lt.{0} Nat (Preorder.toLT.{0} Nat (PartialOrder.toPreorder.{0} Nat (LinearOrder.toPartialOrder.{0} Nat Nat.linearOrder))) ((fun (a : Type) (b : Type) [self : HasLiftT.{1, 1} a b] => self.0) (Fin o) Nat (HasLiftT.mk.{1, 1} (Fin o) Nat (CoeTCₓ.coe.{1, 1} (Fin o) Nat (coeBase.{1, 1} (Fin o) Nat (Fin.coeToNat o)))) i) _x) o (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat Nat.hasAdd) m n) ho (Fin.property o i))))))
+ forall {m : Nat} {n : Nat} {α : Type.{u1}} {o : Nat} (ho : Eq.{1} Nat o (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat Nat.hasAdd) m n)) (u : (Fin m) -> α) (v : (Fin n) -> α), Eq.{succ u1} ((Fin o) -> α) (Matrix.vecAppend.{u1} m n α o ho u v) (fun (i : Fin o) => dite.{succ u1} α (LT.lt.{0} Nat Nat.hasLt ((fun (a : Type) (b : Type) [self : HasLiftT.{1, 1} a b] => self.0) (Fin o) Nat (HasLiftT.mk.{1, 1} (Fin o) Nat (CoeTCₓ.coe.{1, 1} (Fin o) Nat (coeBase.{1, 1} (Fin o) Nat (Fin.coeToNat o)))) i) m) (Nat.decidableLt ((fun (a : Type) (b : Type) [self : HasLiftT.{1, 1} a b] => self.0) (Fin o) Nat (HasLiftT.mk.{1, 1} (Fin o) Nat (CoeTCₓ.coe.{1, 1} (Fin o) Nat (coeBase.{1, 1} (Fin o) Nat (Fin.coeToNat o)))) i) m) (fun (h : LT.lt.{0} Nat Nat.hasLt ((fun (a : Type) (b : Type) [self : HasLiftT.{1, 1} a b] => self.0) (Fin o) Nat (HasLiftT.mk.{1, 1} (Fin o) Nat (CoeTCₓ.coe.{1, 1} (Fin o) Nat (coeBase.{1, 1} (Fin o) Nat (Fin.coeToNat o)))) i) m) => u (Fin.mk m ((fun (a : Type) (b : Type) [self : HasLiftT.{1, 1} a b] => self.0) (Fin o) Nat (HasLiftT.mk.{1, 1} (Fin o) Nat (CoeTCₓ.coe.{1, 1} (Fin o) Nat (coeBase.{1, 1} (Fin o) Nat (Fin.coeToNat o)))) i) h)) (fun (h : Not (LT.lt.{0} Nat Nat.hasLt ((fun (a : Type) (b : Type) [self : HasLiftT.{1, 1} a b] => self.0) (Fin o) Nat (HasLiftT.mk.{1, 1} (Fin o) Nat (CoeTCₓ.coe.{1, 1} (Fin o) Nat (coeBase.{1, 1} (Fin o) Nat (Fin.coeToNat o)))) i) m)) => v (Fin.mk n (HSub.hSub.{0, 0, 0} Nat Nat Nat (instHSub.{0} Nat Nat.hasSub) ((fun (a : Type) (b : Type) [self : HasLiftT.{1, 1} a b] => self.0) (Fin o) Nat (HasLiftT.mk.{1, 1} (Fin o) Nat (CoeTCₓ.coe.{1, 1} (Fin o) Nat (coeBase.{1, 1} (Fin o) Nat (Fin.coeToNat o)))) i) m) (Iff.mpr (LT.lt.{0} Nat (Preorder.toHasLt.{0} Nat (PartialOrder.toPreorder.{0} Nat (LinearOrder.toPartialOrder.{0} Nat Nat.linearOrder))) (HSub.hSub.{0, 0, 0} Nat Nat Nat (instHSub.{0} Nat Nat.hasSub) ((fun (a : Type) (b : Type) [self : HasLiftT.{1, 1} a b] => self.0) (Fin o) Nat (HasLiftT.mk.{1, 1} (Fin o) Nat (CoeTCₓ.coe.{1, 1} (Fin o) Nat (coeBase.{1, 1} (Fin o) Nat (Fin.coeToNat o)))) i) m) n) (LT.lt.{0} Nat (Preorder.toHasLt.{0} Nat (PartialOrder.toPreorder.{0} Nat (LinearOrder.toPartialOrder.{0} Nat Nat.linearOrder))) ((fun (a : Type) (b : Type) [self : HasLiftT.{1, 1} a b] => self.0) (Fin o) Nat (HasLiftT.mk.{1, 1} (Fin o) Nat (CoeTCₓ.coe.{1, 1} (Fin o) Nat (coeBase.{1, 1} (Fin o) Nat (Fin.coeToNat o)))) i) (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat (AddSemigroup.toHasAdd.{0} Nat (AddCommSemigroup.toAddSemigroup.{0} Nat Nat.addCommSemigroup))) m n)) (tsub_lt_iff_left.{0} Nat Nat.addCommSemigroup (LinearOrder.toPartialOrder.{0} Nat Nat.linearOrder) (CanonicallyOrderedAddMonoid.existsAddOfLE.{0} Nat (CanonicallyOrderedCommSemiring.toCanonicallyOrderedAddMonoid.{0} Nat Nat.canonicallyOrderedCommSemiring)) (OrderedAddCommMonoid.to_covariantClass_left.{0} Nat (OrderedSemiring.toOrderedAddCommMonoid.{0} Nat Nat.orderedSemiring)) Nat.hasSub Nat.orderedSub ((fun (a : Type) (b : Type) [self : HasLiftT.{1, 1} a b] => self.0) (Fin o) Nat (HasLiftT.mk.{1, 1} (Fin o) Nat (CoeTCₓ.coe.{1, 1} (Fin o) Nat (coeBase.{1, 1} (Fin o) Nat (Fin.coeToNat o)))) i) m n (AddLeftCancelSemigroup.contravariant_add_le_of_contravariant_add_lt.{0} Nat (AddLeftCancelMonoid.toAddLeftCancelSemigroup.{0} Nat (AddCancelCommMonoid.toAddLeftCancelMonoid.{0} Nat (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{0} Nat (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Nat Nat.strictOrderedSemiring)))) (OrderedCancelAddCommMonoid.toPartialOrder.{0} Nat (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Nat Nat.strictOrderedSemiring)) (OrderedCancelAddCommMonoid.to_contravariantClass_left.{0} Nat (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Nat Nat.strictOrderedSemiring))) (le_of_not_lt.{0} Nat Nat.linearOrder m ((fun (a : Type) (b : Type) [self : HasLiftT.{1, 1} a b] => self.0) (Fin o) Nat (HasLiftT.mk.{1, 1} (Fin o) Nat (CoeTCₓ.coe.{1, 1} (Fin o) Nat (coeBase.{1, 1} (Fin o) Nat (Fin.coeToNat o)))) i) h)) (Eq.subst.{1} Nat (fun (_x : Nat) => LT.lt.{0} Nat (Preorder.toHasLt.{0} Nat (PartialOrder.toPreorder.{0} Nat (LinearOrder.toPartialOrder.{0} Nat Nat.linearOrder))) ((fun (a : Type) (b : Type) [self : HasLiftT.{1, 1} a b] => self.0) (Fin o) Nat (HasLiftT.mk.{1, 1} (Fin o) Nat (CoeTCₓ.coe.{1, 1} (Fin o) Nat (coeBase.{1, 1} (Fin o) Nat (Fin.coeToNat o)))) i) _x) o (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat Nat.hasAdd) m n) ho (Fin.property o i))))))
but is expected to have type
forall {m : Nat} {n : Nat} {α : Type.{u1}} {o : Nat} (ho : Eq.{1} Nat o (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat instAddNat) m n)) (u : (Fin m) -> α) (v : (Fin n) -> α), Eq.{succ u1} ((Fin o) -> α) (Matrix.vecAppend.{u1} m n α o ho u v) (fun (i : Fin o) => dite.{succ u1} α (LT.lt.{0} Nat instLTNat (Fin.val o i) m) (Nat.decLt (Fin.val o i) m) (fun (h : LT.lt.{0} Nat instLTNat (Fin.val o i) m) => u (Fin.mk m (Fin.val o i) h)) (fun (h : Not (LT.lt.{0} Nat instLTNat (Fin.val o i) m)) => v (Fin.mk n (HSub.hSub.{0, 0, 0} Nat Nat Nat (instHSub.{0} Nat instSubNat) (Fin.val o i) m) (Iff.mpr (LT.lt.{0} Nat (Preorder.toLT.{0} Nat (PartialOrder.toPreorder.{0} Nat (LinearOrder.toPartialOrder.{0} Nat Nat.linearOrder))) (HSub.hSub.{0, 0, 0} Nat Nat Nat (instHSub.{0} Nat instSubNat) (Fin.val o i) m) n) (LT.lt.{0} Nat (Preorder.toLT.{0} Nat (PartialOrder.toPreorder.{0} Nat (LinearOrder.toPartialOrder.{0} Nat Nat.linearOrder))) (Fin.val o i) (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat (AddSemigroup.toAdd.{0} Nat (AddCommSemigroup.toAddSemigroup.{0} Nat Nat.addCommSemigroup))) m n)) (tsub_lt_iff_left.{0} Nat Nat.addCommSemigroup (LinearOrder.toPartialOrder.{0} Nat Nat.linearOrder) (CanonicallyOrderedAddMonoid.existsAddOfLE.{0} Nat (CanonicallyOrderedCommSemiring.toCanonicallyOrderedAddMonoid.{0} Nat Nat.canonicallyOrderedCommSemiring)) (OrderedAddCommMonoid.to_covariantClass_left.{0} Nat (OrderedSemiring.toOrderedAddCommMonoid.{0} Nat Nat.orderedSemiring)) instSubNat Nat.instOrderedSubNatInstLENatInstAddNatInstSubNat (Fin.val o i) m n (AddLeftCancelSemigroup.contravariant_add_le_of_contravariant_add_lt.{0} Nat (AddLeftCancelMonoid.toAddLeftCancelSemigroup.{0} Nat (AddCancelCommMonoid.toAddLeftCancelMonoid.{0} Nat (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{0} Nat (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Nat Nat.strictOrderedSemiring)))) (StrictOrderedSemiring.toPartialOrder.{0} Nat Nat.strictOrderedSemiring) (OrderedCancelAddCommMonoid.to_contravariantClass_left.{0} Nat (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Nat Nat.strictOrderedSemiring))) (le_of_not_lt.{0} Nat Nat.linearOrder m (Fin.val o i) h)) (Eq.rec.{0, 1} Nat o (fun (x._@.Mathlib.Data.Fin.VecNotation._hyg.2608 : Nat) (h._@.Mathlib.Data.Fin.VecNotation._hyg.2609 : Eq.{1} Nat o x._@.Mathlib.Data.Fin.VecNotation._hyg.2608) => LT.lt.{0} Nat (Preorder.toLT.{0} Nat (PartialOrder.toPreorder.{0} Nat (LinearOrder.toPartialOrder.{0} Nat Nat.linearOrder))) (Fin.val o i) x._@.Mathlib.Data.Fin.VecNotation._hyg.2608) (Fin.isLt o i) (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat instAddNat) m n) ho)))))
Case conversion may be inaccurate. Consider using '#align matrix.vec_append_eq_ite Matrix.vecAppend_eq_iteₓ'. -/
mathlib commit https://github.com/leanprover-community/mathlib/commit/0b9eaaa7686280fad8cce467f5c3c57ee6ce77f8
@@ -534,7 +534,7 @@ variable {M : Type _} [SMul M α]
lean 3 declaration is
forall {α : Type.{u1}} {M : Type.{u2}} [_inst_1 : SMul.{u2, u1} M α] (x : M) (v : (Fin (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) -> α), Eq.{succ u1} ((Fin (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) -> α) (SMul.smul.{u2, u1} M ((Fin (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) -> α) (Function.hasSMul.{0, u2, u1} (Fin (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) M α _inst_1) x v) (Matrix.vecEmpty.{u1} α)
but is expected to have type
- forall {α : Type.{u2}} {M : Type.{u1}} [_inst_1 : SMul.{u1, u2} M α] (x : M) (v : (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> α), Eq.{succ u2} ((Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> α) (HSMul.hSMul.{u1, u2, u2} M ((Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> α) ((Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> α) (instHSMul.{u1, u2} M ((Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> α) (Pi.instSMul.{0, u2, u1} (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) M (fun (a._@.Mathlib.Data.Fin.VecNotation._hyg.4205 : Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) => α) (fun (i : Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) => _inst_1))) x v) (Matrix.vecEmpty.{u2} α)
+ forall {α : Type.{u2}} {M : Type.{u1}} [_inst_1 : SMul.{u1, u2} M α] (x : M) (v : (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> α), Eq.{succ u2} ((Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> α) (HSMul.hSMul.{u1, u2, u2} M ((Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> α) ((Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> α) (instHSMul.{u1, u2} M ((Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> α) (Pi.instSMul.{0, u2, u1} (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) M (fun (a._@.Mathlib.Data.Fin.VecNotation._hyg.4200 : Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) => α) (fun (i : Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) => _inst_1))) x v) (Matrix.vecEmpty.{u2} α)
Case conversion may be inaccurate. Consider using '#align matrix.smul_empty Matrix.smul_emptyₓ'. -/
@[simp]
theorem smul_empty (x : M) (v : Fin 0 → α) : x • v = ![] :=
@@ -545,7 +545,7 @@ theorem smul_empty (x : M) (v : Fin 0 → α) : x • v = ![] :=
lean 3 declaration is
forall {α : Type.{u1}} {n : Nat} {M : Type.{u2}} [_inst_1 : SMul.{u2, u1} M α] (x : M) (y : α) (v : (Fin n) -> α), Eq.{succ u1} ((Fin (Nat.succ n)) -> α) (SMul.smul.{u2, u1} M ((Fin (Nat.succ n)) -> α) (Function.hasSMul.{0, u2, u1} (Fin (Nat.succ n)) M α _inst_1) x (Matrix.vecCons.{u1} α n y v)) (Matrix.vecCons.{u1} α n (SMul.smul.{u2, u1} M α _inst_1 x y) (SMul.smul.{u2, u1} M ((Fin n) -> α) (Function.hasSMul.{0, u2, u1} (Fin n) M α _inst_1) x v))
but is expected to have type
- forall {α : Type.{u2}} {n : Nat} {M : Type.{u1}} [_inst_1 : SMul.{u1, u2} M α] (x : M) (y : α) (v : (Fin n) -> α), Eq.{succ u2} ((Fin (Nat.succ n)) -> α) (HSMul.hSMul.{u1, u2, u2} M ((Fin (Nat.succ n)) -> α) ((Fin (Nat.succ n)) -> α) (instHSMul.{u1, u2} M ((Fin (Nat.succ n)) -> α) (Pi.instSMul.{0, u2, u1} (Fin (Nat.succ n)) M (fun (a._@.Mathlib.Data.Fin.VecNotation._hyg.29 : Fin (Nat.succ n)) => α) (fun (i : Fin (Nat.succ n)) => _inst_1))) x (Matrix.vecCons.{u2} α n y v)) (Matrix.vecCons.{u2} α n (HSMul.hSMul.{u1, u2, u2} M α α (instHSMul.{u1, u2} M α _inst_1) x y) (HSMul.hSMul.{u1, u2, u2} M ((Fin n) -> α) ((Fin n) -> α) (instHSMul.{u1, u2} M ((Fin n) -> α) (Pi.instSMul.{0, u2, u1} (Fin n) M (fun (a._@.Mathlib.Data.Fin.VecNotation._hyg.4242 : Fin n) => α) (fun (i : Fin n) => _inst_1))) x v))
+ forall {α : Type.{u2}} {n : Nat} {M : Type.{u1}} [_inst_1 : SMul.{u1, u2} M α] (x : M) (y : α) (v : (Fin n) -> α), Eq.{succ u2} ((Fin (Nat.succ n)) -> α) (HSMul.hSMul.{u1, u2, u2} M ((Fin (Nat.succ n)) -> α) ((Fin (Nat.succ n)) -> α) (instHSMul.{u1, u2} M ((Fin (Nat.succ n)) -> α) (Pi.instSMul.{0, u2, u1} (Fin (Nat.succ n)) M (fun (a._@.Mathlib.Data.Fin.VecNotation._hyg.29 : Fin (Nat.succ n)) => α) (fun (i : Fin (Nat.succ n)) => _inst_1))) x (Matrix.vecCons.{u2} α n y v)) (Matrix.vecCons.{u2} α n (HSMul.hSMul.{u1, u2, u2} M α α (instHSMul.{u1, u2} M α _inst_1) x y) (HSMul.hSMul.{u1, u2, u2} M ((Fin n) -> α) ((Fin n) -> α) (instHSMul.{u1, u2} M ((Fin n) -> α) (Pi.instSMul.{0, u2, u1} (Fin n) M (fun (a._@.Mathlib.Data.Fin.VecNotation._hyg.4237 : Fin n) => α) (fun (i : Fin n) => _inst_1))) x v))
Case conversion may be inaccurate. Consider using '#align matrix.smul_cons Matrix.smul_consₓ'. -/
@[simp]
theorem smul_cons (x : M) (y : α) (v : Fin n → α) : x • vecCons y v = vecCons (x • y) (x • v) :=
mathlib commit https://github.com/leanprover-community/mathlib/commit/36b8aa61ea7c05727161f96a0532897bd72aedab
@@ -534,7 +534,7 @@ variable {M : Type _} [SMul M α]
lean 3 declaration is
forall {α : Type.{u1}} {M : Type.{u2}} [_inst_1 : SMul.{u2, u1} M α] (x : M) (v : (Fin (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) -> α), Eq.{succ u1} ((Fin (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) -> α) (SMul.smul.{u2, u1} M ((Fin (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) -> α) (Function.hasSMul.{0, u2, u1} (Fin (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) M α _inst_1) x v) (Matrix.vecEmpty.{u1} α)
but is expected to have type
- forall {α : Type.{u2}} {M : Type.{u1}} [_inst_1 : SMul.{u1, u2} M α] (x : M) (v : (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> α), Eq.{succ u2} ((Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> α) (HSMul.hSMul.{u1, u2, u2} M ((Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> α) ((Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> α) (instHSMul.{u1, u2} M ((Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> α) (Pi.instSMul.{0, u2, u1} (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) M (fun (a._@.Mathlib.Data.Fin.VecNotation._hyg.4219 : Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) => α) (fun (i : Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) => _inst_1))) x v) (Matrix.vecEmpty.{u2} α)
+ forall {α : Type.{u2}} {M : Type.{u1}} [_inst_1 : SMul.{u1, u2} M α] (x : M) (v : (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> α), Eq.{succ u2} ((Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> α) (HSMul.hSMul.{u1, u2, u2} M ((Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> α) ((Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> α) (instHSMul.{u1, u2} M ((Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> α) (Pi.instSMul.{0, u2, u1} (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) M (fun (a._@.Mathlib.Data.Fin.VecNotation._hyg.4205 : Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) => α) (fun (i : Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) => _inst_1))) x v) (Matrix.vecEmpty.{u2} α)
Case conversion may be inaccurate. Consider using '#align matrix.smul_empty Matrix.smul_emptyₓ'. -/
@[simp]
theorem smul_empty (x : M) (v : Fin 0 → α) : x • v = ![] :=
@@ -545,7 +545,7 @@ theorem smul_empty (x : M) (v : Fin 0 → α) : x • v = ![] :=
lean 3 declaration is
forall {α : Type.{u1}} {n : Nat} {M : Type.{u2}} [_inst_1 : SMul.{u2, u1} M α] (x : M) (y : α) (v : (Fin n) -> α), Eq.{succ u1} ((Fin (Nat.succ n)) -> α) (SMul.smul.{u2, u1} M ((Fin (Nat.succ n)) -> α) (Function.hasSMul.{0, u2, u1} (Fin (Nat.succ n)) M α _inst_1) x (Matrix.vecCons.{u1} α n y v)) (Matrix.vecCons.{u1} α n (SMul.smul.{u2, u1} M α _inst_1 x y) (SMul.smul.{u2, u1} M ((Fin n) -> α) (Function.hasSMul.{0, u2, u1} (Fin n) M α _inst_1) x v))
but is expected to have type
- forall {α : Type.{u2}} {n : Nat} {M : Type.{u1}} [_inst_1 : SMul.{u1, u2} M α] (x : M) (y : α) (v : (Fin n) -> α), Eq.{succ u2} ((Fin (Nat.succ n)) -> α) (HSMul.hSMul.{u1, u2, u2} M ((Fin (Nat.succ n)) -> α) ((Fin (Nat.succ n)) -> α) (instHSMul.{u1, u2} M ((Fin (Nat.succ n)) -> α) (Pi.instSMul.{0, u2, u1} (Fin (Nat.succ n)) M (fun (a._@.Mathlib.Data.Fin.VecNotation._hyg.29 : Fin (Nat.succ n)) => α) (fun (i : Fin (Nat.succ n)) => _inst_1))) x (Matrix.vecCons.{u2} α n y v)) (Matrix.vecCons.{u2} α n (HSMul.hSMul.{u1, u2, u2} M α α (instHSMul.{u1, u2} M α _inst_1) x y) (HSMul.hSMul.{u1, u2, u2} M ((Fin n) -> α) ((Fin n) -> α) (instHSMul.{u1, u2} M ((Fin n) -> α) (Pi.instSMul.{0, u2, u1} (Fin n) M (fun (a._@.Mathlib.Data.Fin.VecNotation._hyg.4256 : Fin n) => α) (fun (i : Fin n) => _inst_1))) x v))
+ forall {α : Type.{u2}} {n : Nat} {M : Type.{u1}} [_inst_1 : SMul.{u1, u2} M α] (x : M) (y : α) (v : (Fin n) -> α), Eq.{succ u2} ((Fin (Nat.succ n)) -> α) (HSMul.hSMul.{u1, u2, u2} M ((Fin (Nat.succ n)) -> α) ((Fin (Nat.succ n)) -> α) (instHSMul.{u1, u2} M ((Fin (Nat.succ n)) -> α) (Pi.instSMul.{0, u2, u1} (Fin (Nat.succ n)) M (fun (a._@.Mathlib.Data.Fin.VecNotation._hyg.29 : Fin (Nat.succ n)) => α) (fun (i : Fin (Nat.succ n)) => _inst_1))) x (Matrix.vecCons.{u2} α n y v)) (Matrix.vecCons.{u2} α n (HSMul.hSMul.{u1, u2, u2} M α α (instHSMul.{u1, u2} M α _inst_1) x y) (HSMul.hSMul.{u1, u2, u2} M ((Fin n) -> α) ((Fin n) -> α) (instHSMul.{u1, u2} M ((Fin n) -> α) (Pi.instSMul.{0, u2, u1} (Fin n) M (fun (a._@.Mathlib.Data.Fin.VecNotation._hyg.4242 : Fin n) => α) (fun (i : Fin n) => _inst_1))) x v))
Case conversion may be inaccurate. Consider using '#align matrix.smul_cons Matrix.smul_consₓ'. -/
@[simp]
theorem smul_cons (x : M) (y : α) (v : Fin n → α) : x • vecCons y v = vecCons (x • y) (x • v) :=
mathlib commit https://github.com/leanprover-community/mathlib/commit/730c6d4cab72b9d84fcfb9e95e8796e9cd8f40ba
@@ -319,7 +319,7 @@ def vecAppend {α : Type _} {o : ℕ} (ho : o = m + n) (u : Fin m → α) (v : F
lean 3 declaration is
forall {m : Nat} {n : Nat} {α : Type.{u1}} {o : Nat} (ho : Eq.{1} Nat o (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat Nat.hasAdd) m n)) (u : (Fin m) -> α) (v : (Fin n) -> α), Eq.{succ u1} ((Fin o) -> α) (Matrix.vecAppend.{u1} m n α o ho u v) (fun (i : Fin o) => dite.{succ u1} α (LT.lt.{0} Nat Nat.hasLt ((fun (a : Type) (b : Type) [self : HasLiftT.{1, 1} a b] => self.0) (Fin o) Nat (HasLiftT.mk.{1, 1} (Fin o) Nat (CoeTCₓ.coe.{1, 1} (Fin o) Nat (coeBase.{1, 1} (Fin o) Nat (Fin.coeToNat o)))) i) m) (Nat.decidableLt ((fun (a : Type) (b : Type) [self : HasLiftT.{1, 1} a b] => self.0) (Fin o) Nat (HasLiftT.mk.{1, 1} (Fin o) Nat (CoeTCₓ.coe.{1, 1} (Fin o) Nat (coeBase.{1, 1} (Fin o) Nat (Fin.coeToNat o)))) i) m) (fun (h : LT.lt.{0} Nat Nat.hasLt ((fun (a : Type) (b : Type) [self : HasLiftT.{1, 1} a b] => self.0) (Fin o) Nat (HasLiftT.mk.{1, 1} (Fin o) Nat (CoeTCₓ.coe.{1, 1} (Fin o) Nat (coeBase.{1, 1} (Fin o) Nat (Fin.coeToNat o)))) i) m) => u (Fin.mk m ((fun (a : Type) (b : Type) [self : HasLiftT.{1, 1} a b] => self.0) (Fin o) Nat (HasLiftT.mk.{1, 1} (Fin o) Nat (CoeTCₓ.coe.{1, 1} (Fin o) Nat (coeBase.{1, 1} (Fin o) Nat (Fin.coeToNat o)))) i) h)) (fun (h : Not (LT.lt.{0} Nat Nat.hasLt ((fun (a : Type) (b : Type) [self : HasLiftT.{1, 1} a b] => self.0) (Fin o) Nat (HasLiftT.mk.{1, 1} (Fin o) Nat (CoeTCₓ.coe.{1, 1} (Fin o) Nat (coeBase.{1, 1} (Fin o) Nat (Fin.coeToNat o)))) i) m)) => v (Fin.mk n (HSub.hSub.{0, 0, 0} Nat Nat Nat (instHSub.{0} Nat Nat.hasSub) ((fun (a : Type) (b : Type) [self : HasLiftT.{1, 1} a b] => self.0) (Fin o) Nat (HasLiftT.mk.{1, 1} (Fin o) Nat (CoeTCₓ.coe.{1, 1} (Fin o) Nat (coeBase.{1, 1} (Fin o) Nat (Fin.coeToNat o)))) i) m) (Iff.mpr (LT.lt.{0} Nat (Preorder.toLT.{0} Nat (PartialOrder.toPreorder.{0} Nat (LinearOrder.toPartialOrder.{0} Nat Nat.linearOrder))) (HSub.hSub.{0, 0, 0} Nat Nat Nat (instHSub.{0} Nat Nat.hasSub) ((fun (a : Type) (b : Type) [self : HasLiftT.{1, 1} a b] => self.0) (Fin o) Nat (HasLiftT.mk.{1, 1} (Fin o) Nat (CoeTCₓ.coe.{1, 1} (Fin o) Nat (coeBase.{1, 1} (Fin o) Nat (Fin.coeToNat o)))) i) m) n) (LT.lt.{0} Nat (Preorder.toLT.{0} Nat (PartialOrder.toPreorder.{0} Nat (LinearOrder.toPartialOrder.{0} Nat Nat.linearOrder))) ((fun (a : Type) (b : Type) [self : HasLiftT.{1, 1} a b] => self.0) (Fin o) Nat (HasLiftT.mk.{1, 1} (Fin o) Nat (CoeTCₓ.coe.{1, 1} (Fin o) Nat (coeBase.{1, 1} (Fin o) Nat (Fin.coeToNat o)))) i) (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat (AddSemigroup.toHasAdd.{0} Nat (AddCommSemigroup.toAddSemigroup.{0} Nat Nat.addCommSemigroup))) m n)) (tsub_lt_iff_left.{0} Nat Nat.addCommSemigroup (LinearOrder.toPartialOrder.{0} Nat Nat.linearOrder) (CanonicallyOrderedAddMonoid.existsAddOfLE.{0} Nat (CanonicallyOrderedCommSemiring.toCanonicallyOrderedAddMonoid.{0} Nat Nat.canonicallyOrderedCommSemiring)) (OrderedAddCommMonoid.to_covariantClass_left.{0} Nat (OrderedSemiring.toOrderedAddCommMonoid.{0} Nat Nat.orderedSemiring)) Nat.hasSub Nat.orderedSub ((fun (a : Type) (b : Type) [self : HasLiftT.{1, 1} a b] => self.0) (Fin o) Nat (HasLiftT.mk.{1, 1} (Fin o) Nat (CoeTCₓ.coe.{1, 1} (Fin o) Nat (coeBase.{1, 1} (Fin o) Nat (Fin.coeToNat o)))) i) m n (AddLeftCancelSemigroup.contravariant_add_le_of_contravariant_add_lt.{0} Nat (AddLeftCancelMonoid.toAddLeftCancelSemigroup.{0} Nat (AddCancelCommMonoid.toAddLeftCancelMonoid.{0} Nat (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{0} Nat (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Nat Nat.strictOrderedSemiring)))) (OrderedCancelAddCommMonoid.toPartialOrder.{0} Nat (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Nat Nat.strictOrderedSemiring)) (OrderedCancelAddCommMonoid.to_contravariantClass_left.{0} Nat (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Nat Nat.strictOrderedSemiring))) (le_of_not_lt.{0} Nat Nat.linearOrder m ((fun (a : Type) (b : Type) [self : HasLiftT.{1, 1} a b] => self.0) (Fin o) Nat (HasLiftT.mk.{1, 1} (Fin o) Nat (CoeTCₓ.coe.{1, 1} (Fin o) Nat (coeBase.{1, 1} (Fin o) Nat (Fin.coeToNat o)))) i) h)) (Eq.subst.{1} Nat (fun (_x : Nat) => LT.lt.{0} Nat (Preorder.toLT.{0} Nat (PartialOrder.toPreorder.{0} Nat (LinearOrder.toPartialOrder.{0} Nat Nat.linearOrder))) ((fun (a : Type) (b : Type) [self : HasLiftT.{1, 1} a b] => self.0) (Fin o) Nat (HasLiftT.mk.{1, 1} (Fin o) Nat (CoeTCₓ.coe.{1, 1} (Fin o) Nat (coeBase.{1, 1} (Fin o) Nat (Fin.coeToNat o)))) i) _x) o (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat Nat.hasAdd) m n) ho (Fin.property o i))))))
but is expected to have type
- forall {m : Nat} {n : Nat} {α : Type.{u1}} {o : Nat} (ho : Eq.{1} Nat o (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat instAddNat) m n)) (u : (Fin m) -> α) (v : (Fin n) -> α), Eq.{succ u1} ((Fin o) -> α) (Matrix.vecAppend.{u1} m n α o ho u v) (fun (i : Fin o) => dite.{succ u1} α (LT.lt.{0} Nat instLTNat (Fin.val o i) m) (Nat.decLt (Fin.val o i) m) (fun (h : LT.lt.{0} Nat instLTNat (Fin.val o i) m) => u (Fin.mk m (Fin.val o i) h)) (fun (h : Not (LT.lt.{0} Nat instLTNat (Fin.val o i) m)) => v (Fin.mk n (HSub.hSub.{0, 0, 0} Nat Nat Nat (instHSub.{0} Nat instSubNat) (Fin.val o i) m) (Iff.mpr (LT.lt.{0} Nat (Preorder.toLT.{0} Nat (PartialOrder.toPreorder.{0} Nat (LinearOrder.toPartialOrder.{0} Nat Nat.linearOrder))) (HSub.hSub.{0, 0, 0} Nat Nat Nat (instHSub.{0} Nat instSubNat) (Fin.val o i) m) n) (LT.lt.{0} Nat (Preorder.toLT.{0} Nat (PartialOrder.toPreorder.{0} Nat (LinearOrder.toPartialOrder.{0} Nat Nat.linearOrder))) (Fin.val o i) (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat (AddSemigroup.toAdd.{0} Nat (AddCommSemigroup.toAddSemigroup.{0} Nat Nat.addCommSemigroup))) m n)) (tsub_lt_iff_left.{0} Nat Nat.addCommSemigroup (LinearOrder.toPartialOrder.{0} Nat Nat.linearOrder) (CanonicallyOrderedAddMonoid.existsAddOfLE.{0} Nat (CanonicallyOrderedCommSemiring.toCanonicallyOrderedAddMonoid.{0} Nat Nat.canonicallyOrderedCommSemiring)) (OrderedAddCommMonoid.to_covariantClass_left.{0} Nat (OrderedSemiring.toOrderedAddCommMonoid.{0} Nat Nat.orderedSemiring)) instSubNat Nat.instOrderedSubNatInstLENatInstAddNatInstSubNat (Fin.val o i) m n (AddLeftCancelSemigroup.contravariant_add_le_of_contravariant_add_lt.{0} Nat (AddLeftCancelMonoid.toAddLeftCancelSemigroup.{0} Nat (AddCancelCommMonoid.toAddLeftCancelMonoid.{0} Nat (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{0} Nat (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Nat Nat.strictOrderedSemiring)))) (StrictOrderedSemiring.toPartialOrder.{0} Nat Nat.strictOrderedSemiring) (OrderedCancelAddCommMonoid.to_contravariantClass_left.{0} Nat (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Nat Nat.strictOrderedSemiring))) (le_of_not_lt.{0} Nat Nat.linearOrder m (Fin.val o i) h)) (Eq.rec.{0, 1} Nat o (fun (x._@.Mathlib.Data.Fin.VecNotation._hyg.2610 : Nat) (h._@.Mathlib.Data.Fin.VecNotation._hyg.2611 : Eq.{1} Nat o x._@.Mathlib.Data.Fin.VecNotation._hyg.2610) => LT.lt.{0} Nat (Preorder.toLT.{0} Nat (PartialOrder.toPreorder.{0} Nat (LinearOrder.toPartialOrder.{0} Nat Nat.linearOrder))) (Fin.val o i) x._@.Mathlib.Data.Fin.VecNotation._hyg.2610) (Fin.isLt o i) (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat instAddNat) m n) ho)))))
+ forall {m : Nat} {n : Nat} {α : Type.{u1}} {o : Nat} (ho : Eq.{1} Nat o (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat instAddNat) m n)) (u : (Fin m) -> α) (v : (Fin n) -> α), Eq.{succ u1} ((Fin o) -> α) (Matrix.vecAppend.{u1} m n α o ho u v) (fun (i : Fin o) => dite.{succ u1} α (LT.lt.{0} Nat instLTNat (Fin.val o i) m) (Nat.decLt (Fin.val o i) m) (fun (h : LT.lt.{0} Nat instLTNat (Fin.val o i) m) => u (Fin.mk m (Fin.val o i) h)) (fun (h : Not (LT.lt.{0} Nat instLTNat (Fin.val o i) m)) => v (Fin.mk n (HSub.hSub.{0, 0, 0} Nat Nat Nat (instHSub.{0} Nat instSubNat) (Fin.val o i) m) (Iff.mpr (LT.lt.{0} Nat (Preorder.toLT.{0} Nat (PartialOrder.toPreorder.{0} Nat (LinearOrder.toPartialOrder.{0} Nat Nat.linearOrder))) (HSub.hSub.{0, 0, 0} Nat Nat Nat (instHSub.{0} Nat instSubNat) (Fin.val o i) m) n) (LT.lt.{0} Nat (Preorder.toLT.{0} Nat (PartialOrder.toPreorder.{0} Nat (LinearOrder.toPartialOrder.{0} Nat Nat.linearOrder))) (Fin.val o i) (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat (AddSemigroup.toAdd.{0} Nat (AddCommSemigroup.toAddSemigroup.{0} Nat Nat.addCommSemigroup))) m n)) (tsub_lt_iff_left.{0} Nat Nat.addCommSemigroup (LinearOrder.toPartialOrder.{0} Nat Nat.linearOrder) (CanonicallyOrderedAddMonoid.existsAddOfLE.{0} Nat (CanonicallyOrderedCommSemiring.toCanonicallyOrderedAddMonoid.{0} Nat Nat.canonicallyOrderedCommSemiring)) (OrderedAddCommMonoid.to_covariantClass_left.{0} Nat (OrderedSemiring.toOrderedAddCommMonoid.{0} Nat Nat.orderedSemiring)) instSubNat Nat.instOrderedSubNatInstLENatInstAddNatInstSubNat (Fin.val o i) m n (AddLeftCancelSemigroup.contravariant_add_le_of_contravariant_add_lt.{0} Nat (AddLeftCancelMonoid.toAddLeftCancelSemigroup.{0} Nat (AddCancelCommMonoid.toAddLeftCancelMonoid.{0} Nat (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{0} Nat (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Nat Nat.strictOrderedSemiring)))) (StrictOrderedSemiring.toPartialOrder.{0} Nat Nat.strictOrderedSemiring) (OrderedCancelAddCommMonoid.to_contravariantClass_left.{0} Nat (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Nat Nat.strictOrderedSemiring))) (le_of_not_lt.{0} Nat Nat.linearOrder m (Fin.val o i) h)) (Eq.rec.{0, 1} Nat o (fun (x._@.Mathlib.Data.Fin.VecNotation._hyg.2608 : Nat) (h._@.Mathlib.Data.Fin.VecNotation._hyg.2609 : Eq.{1} Nat o x._@.Mathlib.Data.Fin.VecNotation._hyg.2608) => LT.lt.{0} Nat (Preorder.toLT.{0} Nat (PartialOrder.toPreorder.{0} Nat (LinearOrder.toPartialOrder.{0} Nat Nat.linearOrder))) (Fin.val o i) x._@.Mathlib.Data.Fin.VecNotation._hyg.2608) (Fin.isLt o i) (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat instAddNat) m n) ho)))))
Case conversion may be inaccurate. Consider using '#align matrix.vec_append_eq_ite Matrix.vecAppend_eq_iteₓ'. -/
theorem vecAppend_eq_ite {α : Type _} {o : ℕ} (ho : o = m + n) (u : Fin m → α) (v : Fin n → α) :
vecAppend ho u v = fun i =>
@@ -534,7 +534,7 @@ variable {M : Type _} [SMul M α]
lean 3 declaration is
forall {α : Type.{u1}} {M : Type.{u2}} [_inst_1 : SMul.{u2, u1} M α] (x : M) (v : (Fin (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) -> α), Eq.{succ u1} ((Fin (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) -> α) (SMul.smul.{u2, u1} M ((Fin (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) -> α) (Function.hasSMul.{0, u2, u1} (Fin (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) M α _inst_1) x v) (Matrix.vecEmpty.{u1} α)
but is expected to have type
- forall {α : Type.{u2}} {M : Type.{u1}} [_inst_1 : SMul.{u1, u2} M α] (x : M) (v : (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> α), Eq.{succ u2} ((Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> α) (HSMul.hSMul.{u1, u2, u2} M ((Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> α) ((Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> α) (instHSMul.{u1, u2} M ((Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> α) (Pi.instSMul.{0, u2, u1} (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) M (fun (a._@.Mathlib.Data.Fin.VecNotation._hyg.4221 : Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) => α) (fun (i : Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) => _inst_1))) x v) (Matrix.vecEmpty.{u2} α)
+ forall {α : Type.{u2}} {M : Type.{u1}} [_inst_1 : SMul.{u1, u2} M α] (x : M) (v : (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> α), Eq.{succ u2} ((Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> α) (HSMul.hSMul.{u1, u2, u2} M ((Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> α) ((Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> α) (instHSMul.{u1, u2} M ((Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> α) (Pi.instSMul.{0, u2, u1} (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) M (fun (a._@.Mathlib.Data.Fin.VecNotation._hyg.4219 : Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) => α) (fun (i : Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) => _inst_1))) x v) (Matrix.vecEmpty.{u2} α)
Case conversion may be inaccurate. Consider using '#align matrix.smul_empty Matrix.smul_emptyₓ'. -/
@[simp]
theorem smul_empty (x : M) (v : Fin 0 → α) : x • v = ![] :=
@@ -545,7 +545,7 @@ theorem smul_empty (x : M) (v : Fin 0 → α) : x • v = ![] :=
lean 3 declaration is
forall {α : Type.{u1}} {n : Nat} {M : Type.{u2}} [_inst_1 : SMul.{u2, u1} M α] (x : M) (y : α) (v : (Fin n) -> α), Eq.{succ u1} ((Fin (Nat.succ n)) -> α) (SMul.smul.{u2, u1} M ((Fin (Nat.succ n)) -> α) (Function.hasSMul.{0, u2, u1} (Fin (Nat.succ n)) M α _inst_1) x (Matrix.vecCons.{u1} α n y v)) (Matrix.vecCons.{u1} α n (SMul.smul.{u2, u1} M α _inst_1 x y) (SMul.smul.{u2, u1} M ((Fin n) -> α) (Function.hasSMul.{0, u2, u1} (Fin n) M α _inst_1) x v))
but is expected to have type
- forall {α : Type.{u2}} {n : Nat} {M : Type.{u1}} [_inst_1 : SMul.{u1, u2} M α] (x : M) (y : α) (v : (Fin n) -> α), Eq.{succ u2} ((Fin (Nat.succ n)) -> α) (HSMul.hSMul.{u1, u2, u2} M ((Fin (Nat.succ n)) -> α) ((Fin (Nat.succ n)) -> α) (instHSMul.{u1, u2} M ((Fin (Nat.succ n)) -> α) (Pi.instSMul.{0, u2, u1} (Fin (Nat.succ n)) M (fun (a._@.Mathlib.Data.Fin.VecNotation._hyg.29 : Fin (Nat.succ n)) => α) (fun (i : Fin (Nat.succ n)) => _inst_1))) x (Matrix.vecCons.{u2} α n y v)) (Matrix.vecCons.{u2} α n (HSMul.hSMul.{u1, u2, u2} M α α (instHSMul.{u1, u2} M α _inst_1) x y) (HSMul.hSMul.{u1, u2, u2} M ((Fin n) -> α) ((Fin n) -> α) (instHSMul.{u1, u2} M ((Fin n) -> α) (Pi.instSMul.{0, u2, u1} (Fin n) M (fun (a._@.Mathlib.Data.Fin.VecNotation._hyg.4258 : Fin n) => α) (fun (i : Fin n) => _inst_1))) x v))
+ forall {α : Type.{u2}} {n : Nat} {M : Type.{u1}} [_inst_1 : SMul.{u1, u2} M α] (x : M) (y : α) (v : (Fin n) -> α), Eq.{succ u2} ((Fin (Nat.succ n)) -> α) (HSMul.hSMul.{u1, u2, u2} M ((Fin (Nat.succ n)) -> α) ((Fin (Nat.succ n)) -> α) (instHSMul.{u1, u2} M ((Fin (Nat.succ n)) -> α) (Pi.instSMul.{0, u2, u1} (Fin (Nat.succ n)) M (fun (a._@.Mathlib.Data.Fin.VecNotation._hyg.29 : Fin (Nat.succ n)) => α) (fun (i : Fin (Nat.succ n)) => _inst_1))) x (Matrix.vecCons.{u2} α n y v)) (Matrix.vecCons.{u2} α n (HSMul.hSMul.{u1, u2, u2} M α α (instHSMul.{u1, u2} M α _inst_1) x y) (HSMul.hSMul.{u1, u2, u2} M ((Fin n) -> α) ((Fin n) -> α) (instHSMul.{u1, u2} M ((Fin n) -> α) (Pi.instSMul.{0, u2, u1} (Fin n) M (fun (a._@.Mathlib.Data.Fin.VecNotation._hyg.4256 : Fin n) => α) (fun (i : Fin n) => _inst_1))) x v))
Case conversion may be inaccurate. Consider using '#align matrix.smul_cons Matrix.smul_consₓ'. -/
@[simp]
theorem smul_cons (x : M) (y : α) (v : Fin n → α) : x • vecCons y v = vecCons (x • y) (x • v) :=
mathlib commit https://github.com/leanprover-community/mathlib/commit/730c6d4cab72b9d84fcfb9e95e8796e9cd8f40ba
@@ -319,7 +319,7 @@ def vecAppend {α : Type _} {o : ℕ} (ho : o = m + n) (u : Fin m → α) (v : F
lean 3 declaration is
forall {m : Nat} {n : Nat} {α : Type.{u1}} {o : Nat} (ho : Eq.{1} Nat o (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat Nat.hasAdd) m n)) (u : (Fin m) -> α) (v : (Fin n) -> α), Eq.{succ u1} ((Fin o) -> α) (Matrix.vecAppend.{u1} m n α o ho u v) (fun (i : Fin o) => dite.{succ u1} α (LT.lt.{0} Nat Nat.hasLt ((fun (a : Type) (b : Type) [self : HasLiftT.{1, 1} a b] => self.0) (Fin o) Nat (HasLiftT.mk.{1, 1} (Fin o) Nat (CoeTCₓ.coe.{1, 1} (Fin o) Nat (coeBase.{1, 1} (Fin o) Nat (Fin.coeToNat o)))) i) m) (Nat.decidableLt ((fun (a : Type) (b : Type) [self : HasLiftT.{1, 1} a b] => self.0) (Fin o) Nat (HasLiftT.mk.{1, 1} (Fin o) Nat (CoeTCₓ.coe.{1, 1} (Fin o) Nat (coeBase.{1, 1} (Fin o) Nat (Fin.coeToNat o)))) i) m) (fun (h : LT.lt.{0} Nat Nat.hasLt ((fun (a : Type) (b : Type) [self : HasLiftT.{1, 1} a b] => self.0) (Fin o) Nat (HasLiftT.mk.{1, 1} (Fin o) Nat (CoeTCₓ.coe.{1, 1} (Fin o) Nat (coeBase.{1, 1} (Fin o) Nat (Fin.coeToNat o)))) i) m) => u (Fin.mk m ((fun (a : Type) (b : Type) [self : HasLiftT.{1, 1} a b] => self.0) (Fin o) Nat (HasLiftT.mk.{1, 1} (Fin o) Nat (CoeTCₓ.coe.{1, 1} (Fin o) Nat (coeBase.{1, 1} (Fin o) Nat (Fin.coeToNat o)))) i) h)) (fun (h : Not (LT.lt.{0} Nat Nat.hasLt ((fun (a : Type) (b : Type) [self : HasLiftT.{1, 1} a b] => self.0) (Fin o) Nat (HasLiftT.mk.{1, 1} (Fin o) Nat (CoeTCₓ.coe.{1, 1} (Fin o) Nat (coeBase.{1, 1} (Fin o) Nat (Fin.coeToNat o)))) i) m)) => v (Fin.mk n (HSub.hSub.{0, 0, 0} Nat Nat Nat (instHSub.{0} Nat Nat.hasSub) ((fun (a : Type) (b : Type) [self : HasLiftT.{1, 1} a b] => self.0) (Fin o) Nat (HasLiftT.mk.{1, 1} (Fin o) Nat (CoeTCₓ.coe.{1, 1} (Fin o) Nat (coeBase.{1, 1} (Fin o) Nat (Fin.coeToNat o)))) i) m) (Iff.mpr (LT.lt.{0} Nat (Preorder.toLT.{0} Nat (PartialOrder.toPreorder.{0} Nat (LinearOrder.toPartialOrder.{0} Nat Nat.linearOrder))) (HSub.hSub.{0, 0, 0} Nat Nat Nat (instHSub.{0} Nat Nat.hasSub) ((fun (a : Type) (b : Type) [self : HasLiftT.{1, 1} a b] => self.0) (Fin o) Nat (HasLiftT.mk.{1, 1} (Fin o) Nat (CoeTCₓ.coe.{1, 1} (Fin o) Nat (coeBase.{1, 1} (Fin o) Nat (Fin.coeToNat o)))) i) m) n) (LT.lt.{0} Nat (Preorder.toLT.{0} Nat (PartialOrder.toPreorder.{0} Nat (LinearOrder.toPartialOrder.{0} Nat Nat.linearOrder))) ((fun (a : Type) (b : Type) [self : HasLiftT.{1, 1} a b] => self.0) (Fin o) Nat (HasLiftT.mk.{1, 1} (Fin o) Nat (CoeTCₓ.coe.{1, 1} (Fin o) Nat (coeBase.{1, 1} (Fin o) Nat (Fin.coeToNat o)))) i) (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat (AddSemigroup.toHasAdd.{0} Nat (AddCommSemigroup.toAddSemigroup.{0} Nat Nat.addCommSemigroup))) m n)) (tsub_lt_iff_left.{0} Nat Nat.addCommSemigroup (LinearOrder.toPartialOrder.{0} Nat Nat.linearOrder) (CanonicallyOrderedAddMonoid.existsAddOfLE.{0} Nat (CanonicallyOrderedCommSemiring.toCanonicallyOrderedAddMonoid.{0} Nat Nat.canonicallyOrderedCommSemiring)) (OrderedAddCommMonoid.to_covariantClass_left.{0} Nat (OrderedSemiring.toOrderedAddCommMonoid.{0} Nat Nat.orderedSemiring)) Nat.hasSub Nat.orderedSub ((fun (a : Type) (b : Type) [self : HasLiftT.{1, 1} a b] => self.0) (Fin o) Nat (HasLiftT.mk.{1, 1} (Fin o) Nat (CoeTCₓ.coe.{1, 1} (Fin o) Nat (coeBase.{1, 1} (Fin o) Nat (Fin.coeToNat o)))) i) m n (AddLeftCancelSemigroup.contravariant_add_le_of_contravariant_add_lt.{0} Nat (AddLeftCancelMonoid.toAddLeftCancelSemigroup.{0} Nat (AddCancelCommMonoid.toAddLeftCancelMonoid.{0} Nat (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{0} Nat (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Nat Nat.strictOrderedSemiring)))) (OrderedCancelAddCommMonoid.toPartialOrder.{0} Nat (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Nat Nat.strictOrderedSemiring)) (OrderedCancelAddCommMonoid.to_contravariantClass_left.{0} Nat (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Nat Nat.strictOrderedSemiring))) (le_of_not_lt.{0} Nat Nat.linearOrder m ((fun (a : Type) (b : Type) [self : HasLiftT.{1, 1} a b] => self.0) (Fin o) Nat (HasLiftT.mk.{1, 1} (Fin o) Nat (CoeTCₓ.coe.{1, 1} (Fin o) Nat (coeBase.{1, 1} (Fin o) Nat (Fin.coeToNat o)))) i) h)) (Eq.subst.{1} Nat (fun (_x : Nat) => LT.lt.{0} Nat (Preorder.toLT.{0} Nat (PartialOrder.toPreorder.{0} Nat (LinearOrder.toPartialOrder.{0} Nat Nat.linearOrder))) ((fun (a : Type) (b : Type) [self : HasLiftT.{1, 1} a b] => self.0) (Fin o) Nat (HasLiftT.mk.{1, 1} (Fin o) Nat (CoeTCₓ.coe.{1, 1} (Fin o) Nat (coeBase.{1, 1} (Fin o) Nat (Fin.coeToNat o)))) i) _x) o (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat Nat.hasAdd) m n) ho (Fin.property o i))))))
but is expected to have type
- forall {m : Nat} {n : Nat} {α : Type.{u1}} {o : Nat} (ho : Eq.{1} Nat o (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat instAddNat) m n)) (u : (Fin m) -> α) (v : (Fin n) -> α), Eq.{succ u1} ((Fin o) -> α) (Matrix.vecAppend.{u1} m n α o ho u v) (fun (i : Fin o) => dite.{succ u1} α (LT.lt.{0} Nat instLTNat (Fin.val o i) m) (Nat.decLt (Fin.val o i) m) (fun (h : LT.lt.{0} Nat instLTNat (Fin.val o i) m) => u (Fin.mk m (Fin.val o i) h)) (fun (h : Not (LT.lt.{0} Nat instLTNat (Fin.val o i) m)) => v (Fin.mk n (HSub.hSub.{0, 0, 0} Nat Nat Nat (instHSub.{0} Nat instSubNat) (Fin.val o i) m) (Iff.mpr (LT.lt.{0} Nat (Preorder.toLT.{0} Nat (PartialOrder.toPreorder.{0} Nat (LinearOrder.toPartialOrder.{0} Nat Nat.linearOrder))) (HSub.hSub.{0, 0, 0} Nat Nat Nat (instHSub.{0} Nat instSubNat) (Fin.val o i) m) n) (LT.lt.{0} Nat (Preorder.toLT.{0} Nat (PartialOrder.toPreorder.{0} Nat (LinearOrder.toPartialOrder.{0} Nat Nat.linearOrder))) (Fin.val o i) (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat (AddSemigroup.toAdd.{0} Nat (AddCommSemigroup.toAddSemigroup.{0} Nat Nat.addCommSemigroup))) m n)) (tsub_lt_iff_left.{0} Nat Nat.addCommSemigroup (LinearOrder.toPartialOrder.{0} Nat Nat.linearOrder) (CanonicallyOrderedAddMonoid.existsAddOfLE.{0} Nat (CanonicallyOrderedCommSemiring.toCanonicallyOrderedAddMonoid.{0} Nat Nat.canonicallyOrderedCommSemiring)) (OrderedAddCommMonoid.to_covariantClass_left.{0} Nat (OrderedSemiring.toOrderedAddCommMonoid.{0} Nat Nat.orderedSemiring)) instSubNat Nat.instOrderedSubNatInstLENatInstAddNatInstSubNat (Fin.val o i) m n (AddLeftCancelSemigroup.contravariant_add_le_of_contravariant_add_lt.{0} Nat (AddLeftCancelMonoid.toAddLeftCancelSemigroup.{0} Nat (AddCancelCommMonoid.toAddLeftCancelMonoid.{0} Nat (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{0} Nat (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Nat Nat.strictOrderedSemiring)))) (StrictOrderedSemiring.toPartialOrder.{0} Nat Nat.strictOrderedSemiring) (OrderedCancelAddCommMonoid.to_contravariantClass_left.{0} Nat (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Nat Nat.strictOrderedSemiring))) (le_of_not_lt.{0} Nat Nat.linearOrder m (Fin.val o i) h)) (Eq.rec.{0, 1} Nat o (fun (x._@.Mathlib.Data.Fin.VecNotation._hyg.1882 : Nat) (h._@.Mathlib.Data.Fin.VecNotation._hyg.1883 : Eq.{1} Nat o x._@.Mathlib.Data.Fin.VecNotation._hyg.1882) => LT.lt.{0} Nat (Preorder.toLT.{0} Nat (PartialOrder.toPreorder.{0} Nat (LinearOrder.toPartialOrder.{0} Nat Nat.linearOrder))) (Fin.val o i) x._@.Mathlib.Data.Fin.VecNotation._hyg.1882) (Fin.isLt o i) (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat instAddNat) m n) ho)))))
+ forall {m : Nat} {n : Nat} {α : Type.{u1}} {o : Nat} (ho : Eq.{1} Nat o (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat instAddNat) m n)) (u : (Fin m) -> α) (v : (Fin n) -> α), Eq.{succ u1} ((Fin o) -> α) (Matrix.vecAppend.{u1} m n α o ho u v) (fun (i : Fin o) => dite.{succ u1} α (LT.lt.{0} Nat instLTNat (Fin.val o i) m) (Nat.decLt (Fin.val o i) m) (fun (h : LT.lt.{0} Nat instLTNat (Fin.val o i) m) => u (Fin.mk m (Fin.val o i) h)) (fun (h : Not (LT.lt.{0} Nat instLTNat (Fin.val o i) m)) => v (Fin.mk n (HSub.hSub.{0, 0, 0} Nat Nat Nat (instHSub.{0} Nat instSubNat) (Fin.val o i) m) (Iff.mpr (LT.lt.{0} Nat (Preorder.toLT.{0} Nat (PartialOrder.toPreorder.{0} Nat (LinearOrder.toPartialOrder.{0} Nat Nat.linearOrder))) (HSub.hSub.{0, 0, 0} Nat Nat Nat (instHSub.{0} Nat instSubNat) (Fin.val o i) m) n) (LT.lt.{0} Nat (Preorder.toLT.{0} Nat (PartialOrder.toPreorder.{0} Nat (LinearOrder.toPartialOrder.{0} Nat Nat.linearOrder))) (Fin.val o i) (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat (AddSemigroup.toAdd.{0} Nat (AddCommSemigroup.toAddSemigroup.{0} Nat Nat.addCommSemigroup))) m n)) (tsub_lt_iff_left.{0} Nat Nat.addCommSemigroup (LinearOrder.toPartialOrder.{0} Nat Nat.linearOrder) (CanonicallyOrderedAddMonoid.existsAddOfLE.{0} Nat (CanonicallyOrderedCommSemiring.toCanonicallyOrderedAddMonoid.{0} Nat Nat.canonicallyOrderedCommSemiring)) (OrderedAddCommMonoid.to_covariantClass_left.{0} Nat (OrderedSemiring.toOrderedAddCommMonoid.{0} Nat Nat.orderedSemiring)) instSubNat Nat.instOrderedSubNatInstLENatInstAddNatInstSubNat (Fin.val o i) m n (AddLeftCancelSemigroup.contravariant_add_le_of_contravariant_add_lt.{0} Nat (AddLeftCancelMonoid.toAddLeftCancelSemigroup.{0} Nat (AddCancelCommMonoid.toAddLeftCancelMonoid.{0} Nat (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{0} Nat (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Nat Nat.strictOrderedSemiring)))) (StrictOrderedSemiring.toPartialOrder.{0} Nat Nat.strictOrderedSemiring) (OrderedCancelAddCommMonoid.to_contravariantClass_left.{0} Nat (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Nat Nat.strictOrderedSemiring))) (le_of_not_lt.{0} Nat Nat.linearOrder m (Fin.val o i) h)) (Eq.rec.{0, 1} Nat o (fun (x._@.Mathlib.Data.Fin.VecNotation._hyg.2610 : Nat) (h._@.Mathlib.Data.Fin.VecNotation._hyg.2611 : Eq.{1} Nat o x._@.Mathlib.Data.Fin.VecNotation._hyg.2610) => LT.lt.{0} Nat (Preorder.toLT.{0} Nat (PartialOrder.toPreorder.{0} Nat (LinearOrder.toPartialOrder.{0} Nat Nat.linearOrder))) (Fin.val o i) x._@.Mathlib.Data.Fin.VecNotation._hyg.2610) (Fin.isLt o i) (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat instAddNat) m n) ho)))))
Case conversion may be inaccurate. Consider using '#align matrix.vec_append_eq_ite Matrix.vecAppend_eq_iteₓ'. -/
theorem vecAppend_eq_ite {α : Type _} {o : ℕ} (ho : o = m + n) (u : Fin m → α) (v : Fin n → α) :
vecAppend ho u v = fun i =>
@@ -534,7 +534,7 @@ variable {M : Type _} [SMul M α]
lean 3 declaration is
forall {α : Type.{u1}} {M : Type.{u2}} [_inst_1 : SMul.{u2, u1} M α] (x : M) (v : (Fin (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) -> α), Eq.{succ u1} ((Fin (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) -> α) (SMul.smul.{u2, u1} M ((Fin (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) -> α) (Function.hasSMul.{0, u2, u1} (Fin (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) M α _inst_1) x v) (Matrix.vecEmpty.{u1} α)
but is expected to have type
- forall {α : Type.{u2}} {M : Type.{u1}} [_inst_1 : SMul.{u1, u2} M α] (x : M) (v : (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> α), Eq.{succ u2} ((Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> α) (HSMul.hSMul.{u1, u2, u2} M ((Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> α) ((Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> α) (instHSMul.{u1, u2} M ((Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> α) (Pi.instSMul.{0, u2, u1} (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) M (fun (a._@.Mathlib.Data.Fin.VecNotation._hyg.3501 : Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) => α) (fun (i : Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) => _inst_1))) x v) (Matrix.vecEmpty.{u2} α)
+ forall {α : Type.{u2}} {M : Type.{u1}} [_inst_1 : SMul.{u1, u2} M α] (x : M) (v : (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> α), Eq.{succ u2} ((Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> α) (HSMul.hSMul.{u1, u2, u2} M ((Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> α) ((Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> α) (instHSMul.{u1, u2} M ((Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> α) (Pi.instSMul.{0, u2, u1} (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) M (fun (a._@.Mathlib.Data.Fin.VecNotation._hyg.4221 : Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) => α) (fun (i : Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) => _inst_1))) x v) (Matrix.vecEmpty.{u2} α)
Case conversion may be inaccurate. Consider using '#align matrix.smul_empty Matrix.smul_emptyₓ'. -/
@[simp]
theorem smul_empty (x : M) (v : Fin 0 → α) : x • v = ![] :=
@@ -545,7 +545,7 @@ theorem smul_empty (x : M) (v : Fin 0 → α) : x • v = ![] :=
lean 3 declaration is
forall {α : Type.{u1}} {n : Nat} {M : Type.{u2}} [_inst_1 : SMul.{u2, u1} M α] (x : M) (y : α) (v : (Fin n) -> α), Eq.{succ u1} ((Fin (Nat.succ n)) -> α) (SMul.smul.{u2, u1} M ((Fin (Nat.succ n)) -> α) (Function.hasSMul.{0, u2, u1} (Fin (Nat.succ n)) M α _inst_1) x (Matrix.vecCons.{u1} α n y v)) (Matrix.vecCons.{u1} α n (SMul.smul.{u2, u1} M α _inst_1 x y) (SMul.smul.{u2, u1} M ((Fin n) -> α) (Function.hasSMul.{0, u2, u1} (Fin n) M α _inst_1) x v))
but is expected to have type
- forall {α : Type.{u2}} {n : Nat} {M : Type.{u1}} [_inst_1 : SMul.{u1, u2} M α] (x : M) (y : α) (v : (Fin n) -> α), Eq.{succ u2} ((Fin (Nat.succ n)) -> α) (HSMul.hSMul.{u1, u2, u2} M ((Fin (Nat.succ n)) -> α) ((Fin (Nat.succ n)) -> α) (instHSMul.{u1, u2} M ((Fin (Nat.succ n)) -> α) (Pi.instSMul.{0, u2, u1} (Fin (Nat.succ n)) M (fun (a._@.Mathlib.Data.Fin.VecNotation._hyg.29 : Fin (Nat.succ n)) => α) (fun (i : Fin (Nat.succ n)) => _inst_1))) x (Matrix.vecCons.{u2} α n y v)) (Matrix.vecCons.{u2} α n (HSMul.hSMul.{u1, u2, u2} M α α (instHSMul.{u1, u2} M α _inst_1) x y) (HSMul.hSMul.{u1, u2, u2} M ((Fin n) -> α) ((Fin n) -> α) (instHSMul.{u1, u2} M ((Fin n) -> α) (Pi.instSMul.{0, u2, u1} (Fin n) M (fun (a._@.Mathlib.Data.Fin.VecNotation._hyg.3539 : Fin n) => α) (fun (i : Fin n) => _inst_1))) x v))
+ forall {α : Type.{u2}} {n : Nat} {M : Type.{u1}} [_inst_1 : SMul.{u1, u2} M α] (x : M) (y : α) (v : (Fin n) -> α), Eq.{succ u2} ((Fin (Nat.succ n)) -> α) (HSMul.hSMul.{u1, u2, u2} M ((Fin (Nat.succ n)) -> α) ((Fin (Nat.succ n)) -> α) (instHSMul.{u1, u2} M ((Fin (Nat.succ n)) -> α) (Pi.instSMul.{0, u2, u1} (Fin (Nat.succ n)) M (fun (a._@.Mathlib.Data.Fin.VecNotation._hyg.29 : Fin (Nat.succ n)) => α) (fun (i : Fin (Nat.succ n)) => _inst_1))) x (Matrix.vecCons.{u2} α n y v)) (Matrix.vecCons.{u2} α n (HSMul.hSMul.{u1, u2, u2} M α α (instHSMul.{u1, u2} M α _inst_1) x y) (HSMul.hSMul.{u1, u2, u2} M ((Fin n) -> α) ((Fin n) -> α) (instHSMul.{u1, u2} M ((Fin n) -> α) (Pi.instSMul.{0, u2, u1} (Fin n) M (fun (a._@.Mathlib.Data.Fin.VecNotation._hyg.4258 : Fin n) => α) (fun (i : Fin n) => _inst_1))) x v))
Case conversion may be inaccurate. Consider using '#align matrix.smul_cons Matrix.smul_consₓ'. -/
@[simp]
theorem smul_cons (x : M) (y : α) (v : Fin n → α) : x • vecCons y v = vecCons (x • y) (x • v) :=
mathlib commit https://github.com/leanprover-community/mathlib/commit/7ebf83ed9c262adbf983ef64d5e8c2ae94b625f4
@@ -266,7 +266,8 @@ theorem cons_fin_one (x : α) (u : Fin 0 → α) : vecCons x u = fun _ => x :=
/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:73:14: unsupported tactic `reflect_name #[] -/
/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:73:14: unsupported tactic `reflect_name #[] -/
-unsafe instance _root_.pi_fin.reflect [Lean.ToLevel.{u}] [reflected _ α] [has_reflect α] :
+#print PiFin.toExpr /-
+unsafe instance PiFin.toExpr [Lean.ToLevel.{u}] [reflected _ α] [has_reflect α] :
∀ {n}, has_reflect (Fin n → α)
| 0, v =>
(Subsingleton.elim vecEmpty v).rec
@@ -282,7 +283,8 @@ unsafe instance _root_.pi_fin.reflect [Lean.ToLevel.{u}] [reflected _ α] [has_r
"./././Mathport/Syntax/Translate/Tactic/Builtin.lean:73:14: unsupported tactic `reflect_name #[]" :
reflected _ @vecCons.{u}).subst₄
q(α) q(n) q(_) (_root_.pi_fin.reflect _)
-#align pi_fin.reflect pi_fin.reflect
+#align pi_fin.reflect PiFin.toExpr
+-/
/-- Convert a vector of pexprs to the pexpr constructing that vector.-/
unsafe def _root_.pi_fin.to_pexpr : ∀ {n}, (Fin n → pexpr) → pexpr
@@ -317,7 +319,7 @@ def vecAppend {α : Type _} {o : ℕ} (ho : o = m + n) (u : Fin m → α) (v : F
lean 3 declaration is
forall {m : Nat} {n : Nat} {α : Type.{u1}} {o : Nat} (ho : Eq.{1} Nat o (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat Nat.hasAdd) m n)) (u : (Fin m) -> α) (v : (Fin n) -> α), Eq.{succ u1} ((Fin o) -> α) (Matrix.vecAppend.{u1} m n α o ho u v) (fun (i : Fin o) => dite.{succ u1} α (LT.lt.{0} Nat Nat.hasLt ((fun (a : Type) (b : Type) [self : HasLiftT.{1, 1} a b] => self.0) (Fin o) Nat (HasLiftT.mk.{1, 1} (Fin o) Nat (CoeTCₓ.coe.{1, 1} (Fin o) Nat (coeBase.{1, 1} (Fin o) Nat (Fin.coeToNat o)))) i) m) (Nat.decidableLt ((fun (a : Type) (b : Type) [self : HasLiftT.{1, 1} a b] => self.0) (Fin o) Nat (HasLiftT.mk.{1, 1} (Fin o) Nat (CoeTCₓ.coe.{1, 1} (Fin o) Nat (coeBase.{1, 1} (Fin o) Nat (Fin.coeToNat o)))) i) m) (fun (h : LT.lt.{0} Nat Nat.hasLt ((fun (a : Type) (b : Type) [self : HasLiftT.{1, 1} a b] => self.0) (Fin o) Nat (HasLiftT.mk.{1, 1} (Fin o) Nat (CoeTCₓ.coe.{1, 1} (Fin o) Nat (coeBase.{1, 1} (Fin o) Nat (Fin.coeToNat o)))) i) m) => u (Fin.mk m ((fun (a : Type) (b : Type) [self : HasLiftT.{1, 1} a b] => self.0) (Fin o) Nat (HasLiftT.mk.{1, 1} (Fin o) Nat (CoeTCₓ.coe.{1, 1} (Fin o) Nat (coeBase.{1, 1} (Fin o) Nat (Fin.coeToNat o)))) i) h)) (fun (h : Not (LT.lt.{0} Nat Nat.hasLt ((fun (a : Type) (b : Type) [self : HasLiftT.{1, 1} a b] => self.0) (Fin o) Nat (HasLiftT.mk.{1, 1} (Fin o) Nat (CoeTCₓ.coe.{1, 1} (Fin o) Nat (coeBase.{1, 1} (Fin o) Nat (Fin.coeToNat o)))) i) m)) => v (Fin.mk n (HSub.hSub.{0, 0, 0} Nat Nat Nat (instHSub.{0} Nat Nat.hasSub) ((fun (a : Type) (b : Type) [self : HasLiftT.{1, 1} a b] => self.0) (Fin o) Nat (HasLiftT.mk.{1, 1} (Fin o) Nat (CoeTCₓ.coe.{1, 1} (Fin o) Nat (coeBase.{1, 1} (Fin o) Nat (Fin.coeToNat o)))) i) m) (Iff.mpr (LT.lt.{0} Nat (Preorder.toLT.{0} Nat (PartialOrder.toPreorder.{0} Nat (LinearOrder.toPartialOrder.{0} Nat Nat.linearOrder))) (HSub.hSub.{0, 0, 0} Nat Nat Nat (instHSub.{0} Nat Nat.hasSub) ((fun (a : Type) (b : Type) [self : HasLiftT.{1, 1} a b] => self.0) (Fin o) Nat (HasLiftT.mk.{1, 1} (Fin o) Nat (CoeTCₓ.coe.{1, 1} (Fin o) Nat (coeBase.{1, 1} (Fin o) Nat (Fin.coeToNat o)))) i) m) n) (LT.lt.{0} Nat (Preorder.toLT.{0} Nat (PartialOrder.toPreorder.{0} Nat (LinearOrder.toPartialOrder.{0} Nat Nat.linearOrder))) ((fun (a : Type) (b : Type) [self : HasLiftT.{1, 1} a b] => self.0) (Fin o) Nat (HasLiftT.mk.{1, 1} (Fin o) Nat (CoeTCₓ.coe.{1, 1} (Fin o) Nat (coeBase.{1, 1} (Fin o) Nat (Fin.coeToNat o)))) i) (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat (AddSemigroup.toHasAdd.{0} Nat (AddCommSemigroup.toAddSemigroup.{0} Nat Nat.addCommSemigroup))) m n)) (tsub_lt_iff_left.{0} Nat Nat.addCommSemigroup (LinearOrder.toPartialOrder.{0} Nat Nat.linearOrder) (CanonicallyOrderedAddMonoid.existsAddOfLE.{0} Nat (CanonicallyOrderedCommSemiring.toCanonicallyOrderedAddMonoid.{0} Nat Nat.canonicallyOrderedCommSemiring)) (OrderedAddCommMonoid.to_covariantClass_left.{0} Nat (OrderedSemiring.toOrderedAddCommMonoid.{0} Nat Nat.orderedSemiring)) Nat.hasSub Nat.orderedSub ((fun (a : Type) (b : Type) [self : HasLiftT.{1, 1} a b] => self.0) (Fin o) Nat (HasLiftT.mk.{1, 1} (Fin o) Nat (CoeTCₓ.coe.{1, 1} (Fin o) Nat (coeBase.{1, 1} (Fin o) Nat (Fin.coeToNat o)))) i) m n (AddLeftCancelSemigroup.contravariant_add_le_of_contravariant_add_lt.{0} Nat (AddLeftCancelMonoid.toAddLeftCancelSemigroup.{0} Nat (AddCancelCommMonoid.toAddLeftCancelMonoid.{0} Nat (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{0} Nat (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Nat Nat.strictOrderedSemiring)))) (OrderedCancelAddCommMonoid.toPartialOrder.{0} Nat (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Nat Nat.strictOrderedSemiring)) (OrderedCancelAddCommMonoid.to_contravariantClass_left.{0} Nat (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Nat Nat.strictOrderedSemiring))) (le_of_not_lt.{0} Nat Nat.linearOrder m ((fun (a : Type) (b : Type) [self : HasLiftT.{1, 1} a b] => self.0) (Fin o) Nat (HasLiftT.mk.{1, 1} (Fin o) Nat (CoeTCₓ.coe.{1, 1} (Fin o) Nat (coeBase.{1, 1} (Fin o) Nat (Fin.coeToNat o)))) i) h)) (Eq.subst.{1} Nat (fun (_x : Nat) => LT.lt.{0} Nat (Preorder.toLT.{0} Nat (PartialOrder.toPreorder.{0} Nat (LinearOrder.toPartialOrder.{0} Nat Nat.linearOrder))) ((fun (a : Type) (b : Type) [self : HasLiftT.{1, 1} a b] => self.0) (Fin o) Nat (HasLiftT.mk.{1, 1} (Fin o) Nat (CoeTCₓ.coe.{1, 1} (Fin o) Nat (coeBase.{1, 1} (Fin o) Nat (Fin.coeToNat o)))) i) _x) o (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat Nat.hasAdd) m n) ho (Fin.property o i))))))
but is expected to have type
- forall {m : Nat} {n : Nat} {α : Type.{u1}} {o : Nat} (ho : Eq.{1} Nat o (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat instAddNat) m n)) (u : (Fin m) -> α) (v : (Fin n) -> α), Eq.{succ u1} ((Fin o) -> α) (Matrix.vecAppend.{u1} m n α o ho u v) (fun (i : Fin o) => dite.{succ u1} α (LT.lt.{0} Nat instLTNat (Fin.val o i) m) (Nat.decLt (Fin.val o i) m) (fun (h : LT.lt.{0} Nat instLTNat (Fin.val o i) m) => u (Fin.mk m (Fin.val o i) h)) (fun (h : Not (LT.lt.{0} Nat instLTNat (Fin.val o i) m)) => v (Fin.mk n (HSub.hSub.{0, 0, 0} Nat Nat Nat (instHSub.{0} Nat instSubNat) (Fin.val o i) m) (Iff.mpr (LT.lt.{0} Nat (Preorder.toLT.{0} Nat (PartialOrder.toPreorder.{0} Nat (LinearOrder.toPartialOrder.{0} Nat Nat.linearOrder))) (HSub.hSub.{0, 0, 0} Nat Nat Nat (instHSub.{0} Nat instSubNat) (Fin.val o i) m) n) (LT.lt.{0} Nat (Preorder.toLT.{0} Nat (PartialOrder.toPreorder.{0} Nat (LinearOrder.toPartialOrder.{0} Nat Nat.linearOrder))) (Fin.val o i) (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat (AddSemigroup.toAdd.{0} Nat (AddCommSemigroup.toAddSemigroup.{0} Nat Nat.addCommSemigroup))) m n)) (tsub_lt_iff_left.{0} Nat Nat.addCommSemigroup (LinearOrder.toPartialOrder.{0} Nat Nat.linearOrder) (CanonicallyOrderedAddMonoid.existsAddOfLE.{0} Nat (CanonicallyOrderedCommSemiring.toCanonicallyOrderedAddMonoid.{0} Nat Nat.canonicallyOrderedCommSemiring)) (OrderedAddCommMonoid.to_covariantClass_left.{0} Nat (OrderedSemiring.toOrderedAddCommMonoid.{0} Nat Nat.orderedSemiring)) instSubNat Nat.instOrderedSubNatInstLENatInstAddNatInstSubNat (Fin.val o i) m n (AddLeftCancelSemigroup.contravariant_add_le_of_contravariant_add_lt.{0} Nat (AddLeftCancelMonoid.toAddLeftCancelSemigroup.{0} Nat (AddCancelCommMonoid.toAddLeftCancelMonoid.{0} Nat (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{0} Nat (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Nat Nat.strictOrderedSemiring)))) (StrictOrderedSemiring.toPartialOrder.{0} Nat Nat.strictOrderedSemiring) (OrderedCancelAddCommMonoid.to_contravariantClass_left.{0} Nat (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Nat Nat.strictOrderedSemiring))) (le_of_not_lt.{0} Nat Nat.linearOrder m (Fin.val o i) h)) (Eq.rec.{0, 1} Nat o (fun (x._@.Mathlib.Data.Fin.VecNotation._hyg.1665 : Nat) (h._@.Mathlib.Data.Fin.VecNotation._hyg.1666 : Eq.{1} Nat o x._@.Mathlib.Data.Fin.VecNotation._hyg.1665) => LT.lt.{0} Nat (Preorder.toLT.{0} Nat (PartialOrder.toPreorder.{0} Nat (LinearOrder.toPartialOrder.{0} Nat Nat.linearOrder))) (Fin.val o i) x._@.Mathlib.Data.Fin.VecNotation._hyg.1665) (Fin.isLt o i) (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat instAddNat) m n) ho)))))
+ forall {m : Nat} {n : Nat} {α : Type.{u1}} {o : Nat} (ho : Eq.{1} Nat o (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat instAddNat) m n)) (u : (Fin m) -> α) (v : (Fin n) -> α), Eq.{succ u1} ((Fin o) -> α) (Matrix.vecAppend.{u1} m n α o ho u v) (fun (i : Fin o) => dite.{succ u1} α (LT.lt.{0} Nat instLTNat (Fin.val o i) m) (Nat.decLt (Fin.val o i) m) (fun (h : LT.lt.{0} Nat instLTNat (Fin.val o i) m) => u (Fin.mk m (Fin.val o i) h)) (fun (h : Not (LT.lt.{0} Nat instLTNat (Fin.val o i) m)) => v (Fin.mk n (HSub.hSub.{0, 0, 0} Nat Nat Nat (instHSub.{0} Nat instSubNat) (Fin.val o i) m) (Iff.mpr (LT.lt.{0} Nat (Preorder.toLT.{0} Nat (PartialOrder.toPreorder.{0} Nat (LinearOrder.toPartialOrder.{0} Nat Nat.linearOrder))) (HSub.hSub.{0, 0, 0} Nat Nat Nat (instHSub.{0} Nat instSubNat) (Fin.val o i) m) n) (LT.lt.{0} Nat (Preorder.toLT.{0} Nat (PartialOrder.toPreorder.{0} Nat (LinearOrder.toPartialOrder.{0} Nat Nat.linearOrder))) (Fin.val o i) (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat (AddSemigroup.toAdd.{0} Nat (AddCommSemigroup.toAddSemigroup.{0} Nat Nat.addCommSemigroup))) m n)) (tsub_lt_iff_left.{0} Nat Nat.addCommSemigroup (LinearOrder.toPartialOrder.{0} Nat Nat.linearOrder) (CanonicallyOrderedAddMonoid.existsAddOfLE.{0} Nat (CanonicallyOrderedCommSemiring.toCanonicallyOrderedAddMonoid.{0} Nat Nat.canonicallyOrderedCommSemiring)) (OrderedAddCommMonoid.to_covariantClass_left.{0} Nat (OrderedSemiring.toOrderedAddCommMonoid.{0} Nat Nat.orderedSemiring)) instSubNat Nat.instOrderedSubNatInstLENatInstAddNatInstSubNat (Fin.val o i) m n (AddLeftCancelSemigroup.contravariant_add_le_of_contravariant_add_lt.{0} Nat (AddLeftCancelMonoid.toAddLeftCancelSemigroup.{0} Nat (AddCancelCommMonoid.toAddLeftCancelMonoid.{0} Nat (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{0} Nat (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Nat Nat.strictOrderedSemiring)))) (StrictOrderedSemiring.toPartialOrder.{0} Nat Nat.strictOrderedSemiring) (OrderedCancelAddCommMonoid.to_contravariantClass_left.{0} Nat (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Nat Nat.strictOrderedSemiring))) (le_of_not_lt.{0} Nat Nat.linearOrder m (Fin.val o i) h)) (Eq.rec.{0, 1} Nat o (fun (x._@.Mathlib.Data.Fin.VecNotation._hyg.1882 : Nat) (h._@.Mathlib.Data.Fin.VecNotation._hyg.1883 : Eq.{1} Nat o x._@.Mathlib.Data.Fin.VecNotation._hyg.1882) => LT.lt.{0} Nat (Preorder.toLT.{0} Nat (PartialOrder.toPreorder.{0} Nat (LinearOrder.toPartialOrder.{0} Nat Nat.linearOrder))) (Fin.val o i) x._@.Mathlib.Data.Fin.VecNotation._hyg.1882) (Fin.isLt o i) (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat instAddNat) m n) ho)))))
Case conversion may be inaccurate. Consider using '#align matrix.vec_append_eq_ite Matrix.vecAppend_eq_iteₓ'. -/
theorem vecAppend_eq_ite {α : Type _} {o : ℕ} (ho : o = m + n) (u : Fin m → α) (v : Fin n → α) :
vecAppend ho u v = fun i =>
@@ -532,7 +534,7 @@ variable {M : Type _} [SMul M α]
lean 3 declaration is
forall {α : Type.{u1}} {M : Type.{u2}} [_inst_1 : SMul.{u2, u1} M α] (x : M) (v : (Fin (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) -> α), Eq.{succ u1} ((Fin (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) -> α) (SMul.smul.{u2, u1} M ((Fin (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) -> α) (Function.hasSMul.{0, u2, u1} (Fin (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) M α _inst_1) x v) (Matrix.vecEmpty.{u1} α)
but is expected to have type
- forall {α : Type.{u2}} {M : Type.{u1}} [_inst_1 : SMul.{u1, u2} M α] (x : M) (v : (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> α), Eq.{succ u2} ((Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> α) (HSMul.hSMul.{u1, u2, u2} M ((Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> α) ((Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> α) (instHSMul.{u1, u2} M ((Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> α) (Pi.instSMul.{0, u2, u1} (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) M (fun (a._@.Mathlib.Data.Fin.VecNotation._hyg.3284 : Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) => α) (fun (i : Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) => _inst_1))) x v) (Matrix.vecEmpty.{u2} α)
+ forall {α : Type.{u2}} {M : Type.{u1}} [_inst_1 : SMul.{u1, u2} M α] (x : M) (v : (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> α), Eq.{succ u2} ((Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> α) (HSMul.hSMul.{u1, u2, u2} M ((Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> α) ((Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> α) (instHSMul.{u1, u2} M ((Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> α) (Pi.instSMul.{0, u2, u1} (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) M (fun (a._@.Mathlib.Data.Fin.VecNotation._hyg.3501 : Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) => α) (fun (i : Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) => _inst_1))) x v) (Matrix.vecEmpty.{u2} α)
Case conversion may be inaccurate. Consider using '#align matrix.smul_empty Matrix.smul_emptyₓ'. -/
@[simp]
theorem smul_empty (x : M) (v : Fin 0 → α) : x • v = ![] :=
@@ -543,7 +545,7 @@ theorem smul_empty (x : M) (v : Fin 0 → α) : x • v = ![] :=
lean 3 declaration is
forall {α : Type.{u1}} {n : Nat} {M : Type.{u2}} [_inst_1 : SMul.{u2, u1} M α] (x : M) (y : α) (v : (Fin n) -> α), Eq.{succ u1} ((Fin (Nat.succ n)) -> α) (SMul.smul.{u2, u1} M ((Fin (Nat.succ n)) -> α) (Function.hasSMul.{0, u2, u1} (Fin (Nat.succ n)) M α _inst_1) x (Matrix.vecCons.{u1} α n y v)) (Matrix.vecCons.{u1} α n (SMul.smul.{u2, u1} M α _inst_1 x y) (SMul.smul.{u2, u1} M ((Fin n) -> α) (Function.hasSMul.{0, u2, u1} (Fin n) M α _inst_1) x v))
but is expected to have type
- forall {α : Type.{u2}} {n : Nat} {M : Type.{u1}} [_inst_1 : SMul.{u1, u2} M α] (x : M) (y : α) (v : (Fin n) -> α), Eq.{succ u2} ((Fin (Nat.succ n)) -> α) (HSMul.hSMul.{u1, u2, u2} M ((Fin (Nat.succ n)) -> α) ((Fin (Nat.succ n)) -> α) (instHSMul.{u1, u2} M ((Fin (Nat.succ n)) -> α) (Pi.instSMul.{0, u2, u1} (Fin (Nat.succ n)) M (fun (a._@.Mathlib.Data.Fin.VecNotation._hyg.29 : Fin (Nat.succ n)) => α) (fun (i : Fin (Nat.succ n)) => _inst_1))) x (Matrix.vecCons.{u2} α n y v)) (Matrix.vecCons.{u2} α n (HSMul.hSMul.{u1, u2, u2} M α α (instHSMul.{u1, u2} M α _inst_1) x y) (HSMul.hSMul.{u1, u2, u2} M ((Fin n) -> α) ((Fin n) -> α) (instHSMul.{u1, u2} M ((Fin n) -> α) (Pi.instSMul.{0, u2, u1} (Fin n) M (fun (a._@.Mathlib.Data.Fin.VecNotation._hyg.3322 : Fin n) => α) (fun (i : Fin n) => _inst_1))) x v))
+ forall {α : Type.{u2}} {n : Nat} {M : Type.{u1}} [_inst_1 : SMul.{u1, u2} M α] (x : M) (y : α) (v : (Fin n) -> α), Eq.{succ u2} ((Fin (Nat.succ n)) -> α) (HSMul.hSMul.{u1, u2, u2} M ((Fin (Nat.succ n)) -> α) ((Fin (Nat.succ n)) -> α) (instHSMul.{u1, u2} M ((Fin (Nat.succ n)) -> α) (Pi.instSMul.{0, u2, u1} (Fin (Nat.succ n)) M (fun (a._@.Mathlib.Data.Fin.VecNotation._hyg.29 : Fin (Nat.succ n)) => α) (fun (i : Fin (Nat.succ n)) => _inst_1))) x (Matrix.vecCons.{u2} α n y v)) (Matrix.vecCons.{u2} α n (HSMul.hSMul.{u1, u2, u2} M α α (instHSMul.{u1, u2} M α _inst_1) x y) (HSMul.hSMul.{u1, u2, u2} M ((Fin n) -> α) ((Fin n) -> α) (instHSMul.{u1, u2} M ((Fin n) -> α) (Pi.instSMul.{0, u2, u1} (Fin n) M (fun (a._@.Mathlib.Data.Fin.VecNotation._hyg.3539 : Fin n) => α) (fun (i : Fin n) => _inst_1))) x v))
Case conversion may be inaccurate. Consider using '#align matrix.smul_cons Matrix.smul_consₓ'. -/
@[simp]
theorem smul_cons (x : M) (y : α) (v : Fin n → α) : x • vecCons y v = vecCons (x • y) (x • v) :=
mathlib commit https://github.com/leanprover-community/mathlib/commit/7ebf83ed9c262adbf983ef64d5e8c2ae94b625f4
@@ -315,7 +315,7 @@ def vecAppend {α : Type _} {o : ℕ} (ho : o = m + n) (u : Fin m → α) (v : F
/- warning: matrix.vec_append_eq_ite -> Matrix.vecAppend_eq_ite is a dubious translation:
lean 3 declaration is
- forall {m : Nat} {n : Nat} {α : Type.{u1}} {o : Nat} (ho : Eq.{1} Nat o (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat Nat.hasAdd) m n)) (u : (Fin m) -> α) (v : (Fin n) -> α), Eq.{succ u1} ((Fin o) -> α) (Matrix.vecAppend.{u1} m n α o ho u v) (fun (i : Fin o) => dite.{succ u1} α (LT.lt.{0} Nat Nat.hasLt ((fun (a : Type) (b : Type) [self : HasLiftT.{1, 1} a b] => self.0) (Fin o) Nat (HasLiftT.mk.{1, 1} (Fin o) Nat (CoeTCₓ.coe.{1, 1} (Fin o) Nat (coeBase.{1, 1} (Fin o) Nat (Fin.coeToNat o)))) i) m) (Nat.decidableLt ((fun (a : Type) (b : Type) [self : HasLiftT.{1, 1} a b] => self.0) (Fin o) Nat (HasLiftT.mk.{1, 1} (Fin o) Nat (CoeTCₓ.coe.{1, 1} (Fin o) Nat (coeBase.{1, 1} (Fin o) Nat (Fin.coeToNat o)))) i) m) (fun (h : LT.lt.{0} Nat Nat.hasLt ((fun (a : Type) (b : Type) [self : HasLiftT.{1, 1} a b] => self.0) (Fin o) Nat (HasLiftT.mk.{1, 1} (Fin o) Nat (CoeTCₓ.coe.{1, 1} (Fin o) Nat (coeBase.{1, 1} (Fin o) Nat (Fin.coeToNat o)))) i) m) => u (Fin.mk m ((fun (a : Type) (b : Type) [self : HasLiftT.{1, 1} a b] => self.0) (Fin o) Nat (HasLiftT.mk.{1, 1} (Fin o) Nat (CoeTCₓ.coe.{1, 1} (Fin o) Nat (coeBase.{1, 1} (Fin o) Nat (Fin.coeToNat o)))) i) h)) (fun (h : Not (LT.lt.{0} Nat Nat.hasLt ((fun (a : Type) (b : Type) [self : HasLiftT.{1, 1} a b] => self.0) (Fin o) Nat (HasLiftT.mk.{1, 1} (Fin o) Nat (CoeTCₓ.coe.{1, 1} (Fin o) Nat (coeBase.{1, 1} (Fin o) Nat (Fin.coeToNat o)))) i) m)) => v (Fin.mk n (HSub.hSub.{0, 0, 0} Nat Nat Nat (instHSub.{0} Nat Nat.hasSub) ((fun (a : Type) (b : Type) [self : HasLiftT.{1, 1} a b] => self.0) (Fin o) Nat (HasLiftT.mk.{1, 1} (Fin o) Nat (CoeTCₓ.coe.{1, 1} (Fin o) Nat (coeBase.{1, 1} (Fin o) Nat (Fin.coeToNat o)))) i) m) (Iff.mpr (LT.lt.{0} Nat (Preorder.toLT.{0} Nat (PartialOrder.toPreorder.{0} Nat (LinearOrder.toPartialOrder.{0} Nat Nat.linearOrder))) (HSub.hSub.{0, 0, 0} Nat Nat Nat (instHSub.{0} Nat Nat.hasSub) ((fun (a : Type) (b : Type) [self : HasLiftT.{1, 1} a b] => self.0) (Fin o) Nat (HasLiftT.mk.{1, 1} (Fin o) Nat (CoeTCₓ.coe.{1, 1} (Fin o) Nat (coeBase.{1, 1} (Fin o) Nat (Fin.coeToNat o)))) i) m) n) (LT.lt.{0} Nat (Preorder.toLT.{0} Nat (PartialOrder.toPreorder.{0} Nat (LinearOrder.toPartialOrder.{0} Nat Nat.linearOrder))) ((fun (a : Type) (b : Type) [self : HasLiftT.{1, 1} a b] => self.0) (Fin o) Nat (HasLiftT.mk.{1, 1} (Fin o) Nat (CoeTCₓ.coe.{1, 1} (Fin o) Nat (coeBase.{1, 1} (Fin o) Nat (Fin.coeToNat o)))) i) (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat (AddSemigroup.toHasAdd.{0} Nat (AddCommSemigroup.toAddSemigroup.{0} Nat Nat.addCommSemigroup))) m n)) (tsub_lt_iff_left.{0} Nat Nat.addCommSemigroup (LinearOrder.toPartialOrder.{0} Nat Nat.linearOrder) (CanonicallyOrderedAddMonoid.existsAddOfLE.{0} Nat (CanonicallyOrderedCommSemiring.toCanonicallyOrderedAddMonoid.{0} Nat Nat.canonicallyOrderedCommSemiring)) (OrderedAddCommMonoid.to_covariantClass_left.{0} Nat (OrderedSemiring.toOrderedAddCommMonoid.{0} Nat Nat.orderedSemiring)) Nat.hasSub Nat.hasOrderedSub ((fun (a : Type) (b : Type) [self : HasLiftT.{1, 1} a b] => self.0) (Fin o) Nat (HasLiftT.mk.{1, 1} (Fin o) Nat (CoeTCₓ.coe.{1, 1} (Fin o) Nat (coeBase.{1, 1} (Fin o) Nat (Fin.coeToNat o)))) i) m n (AddLeftCancelSemigroup.contravariant_add_le_of_contravariant_add_lt.{0} Nat (AddLeftCancelMonoid.toAddLeftCancelSemigroup.{0} Nat (AddCancelCommMonoid.toAddLeftCancelMonoid.{0} Nat (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{0} Nat (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Nat Nat.strictOrderedSemiring)))) (OrderedCancelAddCommMonoid.toPartialOrder.{0} Nat (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Nat Nat.strictOrderedSemiring)) (OrderedCancelAddCommMonoid.to_contravariantClass_left.{0} Nat (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Nat Nat.strictOrderedSemiring))) (le_of_not_lt.{0} Nat Nat.linearOrder m ((fun (a : Type) (b : Type) [self : HasLiftT.{1, 1} a b] => self.0) (Fin o) Nat (HasLiftT.mk.{1, 1} (Fin o) Nat (CoeTCₓ.coe.{1, 1} (Fin o) Nat (coeBase.{1, 1} (Fin o) Nat (Fin.coeToNat o)))) i) h)) (Eq.subst.{1} Nat (fun (_x : Nat) => LT.lt.{0} Nat (Preorder.toLT.{0} Nat (PartialOrder.toPreorder.{0} Nat (LinearOrder.toPartialOrder.{0} Nat Nat.linearOrder))) ((fun (a : Type) (b : Type) [self : HasLiftT.{1, 1} a b] => self.0) (Fin o) Nat (HasLiftT.mk.{1, 1} (Fin o) Nat (CoeTCₓ.coe.{1, 1} (Fin o) Nat (coeBase.{1, 1} (Fin o) Nat (Fin.coeToNat o)))) i) _x) o (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat Nat.hasAdd) m n) ho (Fin.property o i))))))
+ forall {m : Nat} {n : Nat} {α : Type.{u1}} {o : Nat} (ho : Eq.{1} Nat o (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat Nat.hasAdd) m n)) (u : (Fin m) -> α) (v : (Fin n) -> α), Eq.{succ u1} ((Fin o) -> α) (Matrix.vecAppend.{u1} m n α o ho u v) (fun (i : Fin o) => dite.{succ u1} α (LT.lt.{0} Nat Nat.hasLt ((fun (a : Type) (b : Type) [self : HasLiftT.{1, 1} a b] => self.0) (Fin o) Nat (HasLiftT.mk.{1, 1} (Fin o) Nat (CoeTCₓ.coe.{1, 1} (Fin o) Nat (coeBase.{1, 1} (Fin o) Nat (Fin.coeToNat o)))) i) m) (Nat.decidableLt ((fun (a : Type) (b : Type) [self : HasLiftT.{1, 1} a b] => self.0) (Fin o) Nat (HasLiftT.mk.{1, 1} (Fin o) Nat (CoeTCₓ.coe.{1, 1} (Fin o) Nat (coeBase.{1, 1} (Fin o) Nat (Fin.coeToNat o)))) i) m) (fun (h : LT.lt.{0} Nat Nat.hasLt ((fun (a : Type) (b : Type) [self : HasLiftT.{1, 1} a b] => self.0) (Fin o) Nat (HasLiftT.mk.{1, 1} (Fin o) Nat (CoeTCₓ.coe.{1, 1} (Fin o) Nat (coeBase.{1, 1} (Fin o) Nat (Fin.coeToNat o)))) i) m) => u (Fin.mk m ((fun (a : Type) (b : Type) [self : HasLiftT.{1, 1} a b] => self.0) (Fin o) Nat (HasLiftT.mk.{1, 1} (Fin o) Nat (CoeTCₓ.coe.{1, 1} (Fin o) Nat (coeBase.{1, 1} (Fin o) Nat (Fin.coeToNat o)))) i) h)) (fun (h : Not (LT.lt.{0} Nat Nat.hasLt ((fun (a : Type) (b : Type) [self : HasLiftT.{1, 1} a b] => self.0) (Fin o) Nat (HasLiftT.mk.{1, 1} (Fin o) Nat (CoeTCₓ.coe.{1, 1} (Fin o) Nat (coeBase.{1, 1} (Fin o) Nat (Fin.coeToNat o)))) i) m)) => v (Fin.mk n (HSub.hSub.{0, 0, 0} Nat Nat Nat (instHSub.{0} Nat Nat.hasSub) ((fun (a : Type) (b : Type) [self : HasLiftT.{1, 1} a b] => self.0) (Fin o) Nat (HasLiftT.mk.{1, 1} (Fin o) Nat (CoeTCₓ.coe.{1, 1} (Fin o) Nat (coeBase.{1, 1} (Fin o) Nat (Fin.coeToNat o)))) i) m) (Iff.mpr (LT.lt.{0} Nat (Preorder.toLT.{0} Nat (PartialOrder.toPreorder.{0} Nat (LinearOrder.toPartialOrder.{0} Nat Nat.linearOrder))) (HSub.hSub.{0, 0, 0} Nat Nat Nat (instHSub.{0} Nat Nat.hasSub) ((fun (a : Type) (b : Type) [self : HasLiftT.{1, 1} a b] => self.0) (Fin o) Nat (HasLiftT.mk.{1, 1} (Fin o) Nat (CoeTCₓ.coe.{1, 1} (Fin o) Nat (coeBase.{1, 1} (Fin o) Nat (Fin.coeToNat o)))) i) m) n) (LT.lt.{0} Nat (Preorder.toLT.{0} Nat (PartialOrder.toPreorder.{0} Nat (LinearOrder.toPartialOrder.{0} Nat Nat.linearOrder))) ((fun (a : Type) (b : Type) [self : HasLiftT.{1, 1} a b] => self.0) (Fin o) Nat (HasLiftT.mk.{1, 1} (Fin o) Nat (CoeTCₓ.coe.{1, 1} (Fin o) Nat (coeBase.{1, 1} (Fin o) Nat (Fin.coeToNat o)))) i) (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat (AddSemigroup.toHasAdd.{0} Nat (AddCommSemigroup.toAddSemigroup.{0} Nat Nat.addCommSemigroup))) m n)) (tsub_lt_iff_left.{0} Nat Nat.addCommSemigroup (LinearOrder.toPartialOrder.{0} Nat Nat.linearOrder) (CanonicallyOrderedAddMonoid.existsAddOfLE.{0} Nat (CanonicallyOrderedCommSemiring.toCanonicallyOrderedAddMonoid.{0} Nat Nat.canonicallyOrderedCommSemiring)) (OrderedAddCommMonoid.to_covariantClass_left.{0} Nat (OrderedSemiring.toOrderedAddCommMonoid.{0} Nat Nat.orderedSemiring)) Nat.hasSub Nat.orderedSub ((fun (a : Type) (b : Type) [self : HasLiftT.{1, 1} a b] => self.0) (Fin o) Nat (HasLiftT.mk.{1, 1} (Fin o) Nat (CoeTCₓ.coe.{1, 1} (Fin o) Nat (coeBase.{1, 1} (Fin o) Nat (Fin.coeToNat o)))) i) m n (AddLeftCancelSemigroup.contravariant_add_le_of_contravariant_add_lt.{0} Nat (AddLeftCancelMonoid.toAddLeftCancelSemigroup.{0} Nat (AddCancelCommMonoid.toAddLeftCancelMonoid.{0} Nat (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{0} Nat (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Nat Nat.strictOrderedSemiring)))) (OrderedCancelAddCommMonoid.toPartialOrder.{0} Nat (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Nat Nat.strictOrderedSemiring)) (OrderedCancelAddCommMonoid.to_contravariantClass_left.{0} Nat (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Nat Nat.strictOrderedSemiring))) (le_of_not_lt.{0} Nat Nat.linearOrder m ((fun (a : Type) (b : Type) [self : HasLiftT.{1, 1} a b] => self.0) (Fin o) Nat (HasLiftT.mk.{1, 1} (Fin o) Nat (CoeTCₓ.coe.{1, 1} (Fin o) Nat (coeBase.{1, 1} (Fin o) Nat (Fin.coeToNat o)))) i) h)) (Eq.subst.{1} Nat (fun (_x : Nat) => LT.lt.{0} Nat (Preorder.toLT.{0} Nat (PartialOrder.toPreorder.{0} Nat (LinearOrder.toPartialOrder.{0} Nat Nat.linearOrder))) ((fun (a : Type) (b : Type) [self : HasLiftT.{1, 1} a b] => self.0) (Fin o) Nat (HasLiftT.mk.{1, 1} (Fin o) Nat (CoeTCₓ.coe.{1, 1} (Fin o) Nat (coeBase.{1, 1} (Fin o) Nat (Fin.coeToNat o)))) i) _x) o (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat Nat.hasAdd) m n) ho (Fin.property o i))))))
but is expected to have type
forall {m : Nat} {n : Nat} {α : Type.{u1}} {o : Nat} (ho : Eq.{1} Nat o (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat instAddNat) m n)) (u : (Fin m) -> α) (v : (Fin n) -> α), Eq.{succ u1} ((Fin o) -> α) (Matrix.vecAppend.{u1} m n α o ho u v) (fun (i : Fin o) => dite.{succ u1} α (LT.lt.{0} Nat instLTNat (Fin.val o i) m) (Nat.decLt (Fin.val o i) m) (fun (h : LT.lt.{0} Nat instLTNat (Fin.val o i) m) => u (Fin.mk m (Fin.val o i) h)) (fun (h : Not (LT.lt.{0} Nat instLTNat (Fin.val o i) m)) => v (Fin.mk n (HSub.hSub.{0, 0, 0} Nat Nat Nat (instHSub.{0} Nat instSubNat) (Fin.val o i) m) (Iff.mpr (LT.lt.{0} Nat (Preorder.toLT.{0} Nat (PartialOrder.toPreorder.{0} Nat (LinearOrder.toPartialOrder.{0} Nat Nat.linearOrder))) (HSub.hSub.{0, 0, 0} Nat Nat Nat (instHSub.{0} Nat instSubNat) (Fin.val o i) m) n) (LT.lt.{0} Nat (Preorder.toLT.{0} Nat (PartialOrder.toPreorder.{0} Nat (LinearOrder.toPartialOrder.{0} Nat Nat.linearOrder))) (Fin.val o i) (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat (AddSemigroup.toAdd.{0} Nat (AddCommSemigroup.toAddSemigroup.{0} Nat Nat.addCommSemigroup))) m n)) (tsub_lt_iff_left.{0} Nat Nat.addCommSemigroup (LinearOrder.toPartialOrder.{0} Nat Nat.linearOrder) (CanonicallyOrderedAddMonoid.existsAddOfLE.{0} Nat (CanonicallyOrderedCommSemiring.toCanonicallyOrderedAddMonoid.{0} Nat Nat.canonicallyOrderedCommSemiring)) (OrderedAddCommMonoid.to_covariantClass_left.{0} Nat (OrderedSemiring.toOrderedAddCommMonoid.{0} Nat Nat.orderedSemiring)) instSubNat Nat.instOrderedSubNatInstLENatInstAddNatInstSubNat (Fin.val o i) m n (AddLeftCancelSemigroup.contravariant_add_le_of_contravariant_add_lt.{0} Nat (AddLeftCancelMonoid.toAddLeftCancelSemigroup.{0} Nat (AddCancelCommMonoid.toAddLeftCancelMonoid.{0} Nat (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{0} Nat (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Nat Nat.strictOrderedSemiring)))) (StrictOrderedSemiring.toPartialOrder.{0} Nat Nat.strictOrderedSemiring) (OrderedCancelAddCommMonoid.to_contravariantClass_left.{0} Nat (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Nat Nat.strictOrderedSemiring))) (le_of_not_lt.{0} Nat Nat.linearOrder m (Fin.val o i) h)) (Eq.rec.{0, 1} Nat o (fun (x._@.Mathlib.Data.Fin.VecNotation._hyg.1665 : Nat) (h._@.Mathlib.Data.Fin.VecNotation._hyg.1666 : Eq.{1} Nat o x._@.Mathlib.Data.Fin.VecNotation._hyg.1665) => LT.lt.{0} Nat (Preorder.toLT.{0} Nat (PartialOrder.toPreorder.{0} Nat (LinearOrder.toPartialOrder.{0} Nat Nat.linearOrder))) (Fin.val o i) x._@.Mathlib.Data.Fin.VecNotation._hyg.1665) (Fin.isLt o i) (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat instAddNat) m n) ho)))))
Case conversion may be inaccurate. Consider using '#align matrix.vec_append_eq_ite Matrix.vecAppend_eq_iteₓ'. -/
mathlib commit https://github.com/leanprover-community/mathlib/commit/347636a7a80595d55bedf6e6fbd996a3c39da69a
@@ -266,7 +266,7 @@ theorem cons_fin_one (x : α) (u : Fin 0 → α) : vecCons x u = fun _ => x :=
/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:73:14: unsupported tactic `reflect_name #[] -/
/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:73:14: unsupported tactic `reflect_name #[] -/
-unsafe instance _root_.pi_fin.reflect [reflected_univ.{u}] [reflected _ α] [has_reflect α] :
+unsafe instance _root_.pi_fin.reflect [Lean.ToLevel.{u}] [reflected _ α] [has_reflect α] :
∀ {n}, has_reflect (Fin n → α)
| 0, v =>
(Subsingleton.elim vecEmpty v).rec
mathlib commit https://github.com/leanprover-community/mathlib/commit/347636a7a80595d55bedf6e6fbd996a3c39da69a
@@ -317,7 +317,7 @@ def vecAppend {α : Type _} {o : ℕ} (ho : o = m + n) (u : Fin m → α) (v : F
lean 3 declaration is
forall {m : Nat} {n : Nat} {α : Type.{u1}} {o : Nat} (ho : Eq.{1} Nat o (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat Nat.hasAdd) m n)) (u : (Fin m) -> α) (v : (Fin n) -> α), Eq.{succ u1} ((Fin o) -> α) (Matrix.vecAppend.{u1} m n α o ho u v) (fun (i : Fin o) => dite.{succ u1} α (LT.lt.{0} Nat Nat.hasLt ((fun (a : Type) (b : Type) [self : HasLiftT.{1, 1} a b] => self.0) (Fin o) Nat (HasLiftT.mk.{1, 1} (Fin o) Nat (CoeTCₓ.coe.{1, 1} (Fin o) Nat (coeBase.{1, 1} (Fin o) Nat (Fin.coeToNat o)))) i) m) (Nat.decidableLt ((fun (a : Type) (b : Type) [self : HasLiftT.{1, 1} a b] => self.0) (Fin o) Nat (HasLiftT.mk.{1, 1} (Fin o) Nat (CoeTCₓ.coe.{1, 1} (Fin o) Nat (coeBase.{1, 1} (Fin o) Nat (Fin.coeToNat o)))) i) m) (fun (h : LT.lt.{0} Nat Nat.hasLt ((fun (a : Type) (b : Type) [self : HasLiftT.{1, 1} a b] => self.0) (Fin o) Nat (HasLiftT.mk.{1, 1} (Fin o) Nat (CoeTCₓ.coe.{1, 1} (Fin o) Nat (coeBase.{1, 1} (Fin o) Nat (Fin.coeToNat o)))) i) m) => u (Fin.mk m ((fun (a : Type) (b : Type) [self : HasLiftT.{1, 1} a b] => self.0) (Fin o) Nat (HasLiftT.mk.{1, 1} (Fin o) Nat (CoeTCₓ.coe.{1, 1} (Fin o) Nat (coeBase.{1, 1} (Fin o) Nat (Fin.coeToNat o)))) i) h)) (fun (h : Not (LT.lt.{0} Nat Nat.hasLt ((fun (a : Type) (b : Type) [self : HasLiftT.{1, 1} a b] => self.0) (Fin o) Nat (HasLiftT.mk.{1, 1} (Fin o) Nat (CoeTCₓ.coe.{1, 1} (Fin o) Nat (coeBase.{1, 1} (Fin o) Nat (Fin.coeToNat o)))) i) m)) => v (Fin.mk n (HSub.hSub.{0, 0, 0} Nat Nat Nat (instHSub.{0} Nat Nat.hasSub) ((fun (a : Type) (b : Type) [self : HasLiftT.{1, 1} a b] => self.0) (Fin o) Nat (HasLiftT.mk.{1, 1} (Fin o) Nat (CoeTCₓ.coe.{1, 1} (Fin o) Nat (coeBase.{1, 1} (Fin o) Nat (Fin.coeToNat o)))) i) m) (Iff.mpr (LT.lt.{0} Nat (Preorder.toLT.{0} Nat (PartialOrder.toPreorder.{0} Nat (LinearOrder.toPartialOrder.{0} Nat Nat.linearOrder))) (HSub.hSub.{0, 0, 0} Nat Nat Nat (instHSub.{0} Nat Nat.hasSub) ((fun (a : Type) (b : Type) [self : HasLiftT.{1, 1} a b] => self.0) (Fin o) Nat (HasLiftT.mk.{1, 1} (Fin o) Nat (CoeTCₓ.coe.{1, 1} (Fin o) Nat (coeBase.{1, 1} (Fin o) Nat (Fin.coeToNat o)))) i) m) n) (LT.lt.{0} Nat (Preorder.toLT.{0} Nat (PartialOrder.toPreorder.{0} Nat (LinearOrder.toPartialOrder.{0} Nat Nat.linearOrder))) ((fun (a : Type) (b : Type) [self : HasLiftT.{1, 1} a b] => self.0) (Fin o) Nat (HasLiftT.mk.{1, 1} (Fin o) Nat (CoeTCₓ.coe.{1, 1} (Fin o) Nat (coeBase.{1, 1} (Fin o) Nat (Fin.coeToNat o)))) i) (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat (AddSemigroup.toHasAdd.{0} Nat (AddCommSemigroup.toAddSemigroup.{0} Nat Nat.addCommSemigroup))) m n)) (tsub_lt_iff_left.{0} Nat Nat.addCommSemigroup (LinearOrder.toPartialOrder.{0} Nat Nat.linearOrder) (CanonicallyOrderedAddMonoid.existsAddOfLE.{0} Nat (CanonicallyOrderedCommSemiring.toCanonicallyOrderedAddMonoid.{0} Nat Nat.canonicallyOrderedCommSemiring)) (OrderedAddCommMonoid.to_covariantClass_left.{0} Nat (OrderedSemiring.toOrderedAddCommMonoid.{0} Nat Nat.orderedSemiring)) Nat.hasSub Nat.hasOrderedSub ((fun (a : Type) (b : Type) [self : HasLiftT.{1, 1} a b] => self.0) (Fin o) Nat (HasLiftT.mk.{1, 1} (Fin o) Nat (CoeTCₓ.coe.{1, 1} (Fin o) Nat (coeBase.{1, 1} (Fin o) Nat (Fin.coeToNat o)))) i) m n (AddLeftCancelSemigroup.contravariant_add_le_of_contravariant_add_lt.{0} Nat (AddLeftCancelMonoid.toAddLeftCancelSemigroup.{0} Nat (AddCancelCommMonoid.toAddLeftCancelMonoid.{0} Nat (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{0} Nat (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Nat Nat.strictOrderedSemiring)))) (OrderedCancelAddCommMonoid.toPartialOrder.{0} Nat (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Nat Nat.strictOrderedSemiring)) (OrderedCancelAddCommMonoid.to_contravariantClass_left.{0} Nat (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Nat Nat.strictOrderedSemiring))) (le_of_not_lt.{0} Nat Nat.linearOrder m ((fun (a : Type) (b : Type) [self : HasLiftT.{1, 1} a b] => self.0) (Fin o) Nat (HasLiftT.mk.{1, 1} (Fin o) Nat (CoeTCₓ.coe.{1, 1} (Fin o) Nat (coeBase.{1, 1} (Fin o) Nat (Fin.coeToNat o)))) i) h)) (Eq.subst.{1} Nat (fun (_x : Nat) => LT.lt.{0} Nat (Preorder.toLT.{0} Nat (PartialOrder.toPreorder.{0} Nat (LinearOrder.toPartialOrder.{0} Nat Nat.linearOrder))) ((fun (a : Type) (b : Type) [self : HasLiftT.{1, 1} a b] => self.0) (Fin o) Nat (HasLiftT.mk.{1, 1} (Fin o) Nat (CoeTCₓ.coe.{1, 1} (Fin o) Nat (coeBase.{1, 1} (Fin o) Nat (Fin.coeToNat o)))) i) _x) o (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat Nat.hasAdd) m n) ho (Fin.property o i))))))
but is expected to have type
- forall {m : Nat} {n : Nat} {α : Type.{u1}} {o : Nat} (ho : Eq.{1} Nat o (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat instAddNat) m n)) (u : (Fin m) -> α) (v : (Fin n) -> α), Eq.{succ u1} ((Fin o) -> α) (Matrix.vecAppend.{u1} m n α o ho u v) (fun (i : Fin o) => dite.{succ u1} α (LT.lt.{0} Nat instLTNat (Fin.val o i) m) (Nat.decLt (Fin.val o i) m) (fun (h : LT.lt.{0} Nat instLTNat (Fin.val o i) m) => u (Fin.mk m (Fin.val o i) h)) (fun (h : Not (LT.lt.{0} Nat instLTNat (Fin.val o i) m)) => v (Fin.mk n (HSub.hSub.{0, 0, 0} Nat Nat Nat (instHSub.{0} Nat instSubNat) (Fin.val o i) m) (Iff.mpr (LT.lt.{0} Nat (Preorder.toLT.{0} Nat (PartialOrder.toPreorder.{0} Nat (LinearOrder.toPartialOrder.{0} Nat Nat.linearOrder))) (HSub.hSub.{0, 0, 0} Nat Nat Nat (instHSub.{0} Nat instSubNat) (Fin.val o i) m) n) (LT.lt.{0} Nat (Preorder.toLT.{0} Nat (PartialOrder.toPreorder.{0} Nat (LinearOrder.toPartialOrder.{0} Nat Nat.linearOrder))) (Fin.val o i) (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat (AddSemigroup.toAdd.{0} Nat (AddCommSemigroup.toAddSemigroup.{0} Nat Nat.addCommSemigroup))) m n)) (tsub_lt_iff_left.{0} Nat Nat.addCommSemigroup (LinearOrder.toPartialOrder.{0} Nat Nat.linearOrder) (CanonicallyOrderedAddMonoid.existsAddOfLE.{0} Nat (CanonicallyOrderedCommSemiring.toCanonicallyOrderedAddMonoid.{0} Nat Nat.canonicallyOrderedCommSemiring)) (OrderedAddCommMonoid.to_covariantClass_left.{0} Nat (OrderedSemiring.toOrderedAddCommMonoid.{0} Nat Nat.orderedSemiring)) instSubNat Nat.instOrderedSubNatInstLENatInstAddNatInstSubNat (Fin.val o i) m n (AddLeftCancelSemigroup.contravariant_add_le_of_contravariant_add_lt.{0} Nat (AddLeftCancelMonoid.toAddLeftCancelSemigroup.{0} Nat (AddCancelCommMonoid.toAddLeftCancelMonoid.{0} Nat (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{0} Nat (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Nat Nat.strictOrderedSemiring)))) (StrictOrderedSemiring.toPartialOrder.{0} Nat Nat.strictOrderedSemiring) (OrderedCancelAddCommMonoid.to_contravariantClass_left.{0} Nat (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Nat Nat.strictOrderedSemiring))) (le_of_not_lt.{0} Nat Nat.linearOrder m (Fin.val o i) h)) (Eq.rec.{0, 1} Nat o (fun (x._@.Mathlib.Data.Fin.VecNotation._hyg.1668 : Nat) (h._@.Mathlib.Data.Fin.VecNotation._hyg.1669 : Eq.{1} Nat o x._@.Mathlib.Data.Fin.VecNotation._hyg.1668) => LT.lt.{0} Nat (Preorder.toLT.{0} Nat (PartialOrder.toPreorder.{0} Nat (LinearOrder.toPartialOrder.{0} Nat Nat.linearOrder))) (Fin.val o i) x._@.Mathlib.Data.Fin.VecNotation._hyg.1668) (Fin.isLt o i) (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat instAddNat) m n) ho)))))
+ forall {m : Nat} {n : Nat} {α : Type.{u1}} {o : Nat} (ho : Eq.{1} Nat o (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat instAddNat) m n)) (u : (Fin m) -> α) (v : (Fin n) -> α), Eq.{succ u1} ((Fin o) -> α) (Matrix.vecAppend.{u1} m n α o ho u v) (fun (i : Fin o) => dite.{succ u1} α (LT.lt.{0} Nat instLTNat (Fin.val o i) m) (Nat.decLt (Fin.val o i) m) (fun (h : LT.lt.{0} Nat instLTNat (Fin.val o i) m) => u (Fin.mk m (Fin.val o i) h)) (fun (h : Not (LT.lt.{0} Nat instLTNat (Fin.val o i) m)) => v (Fin.mk n (HSub.hSub.{0, 0, 0} Nat Nat Nat (instHSub.{0} Nat instSubNat) (Fin.val o i) m) (Iff.mpr (LT.lt.{0} Nat (Preorder.toLT.{0} Nat (PartialOrder.toPreorder.{0} Nat (LinearOrder.toPartialOrder.{0} Nat Nat.linearOrder))) (HSub.hSub.{0, 0, 0} Nat Nat Nat (instHSub.{0} Nat instSubNat) (Fin.val o i) m) n) (LT.lt.{0} Nat (Preorder.toLT.{0} Nat (PartialOrder.toPreorder.{0} Nat (LinearOrder.toPartialOrder.{0} Nat Nat.linearOrder))) (Fin.val o i) (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat (AddSemigroup.toAdd.{0} Nat (AddCommSemigroup.toAddSemigroup.{0} Nat Nat.addCommSemigroup))) m n)) (tsub_lt_iff_left.{0} Nat Nat.addCommSemigroup (LinearOrder.toPartialOrder.{0} Nat Nat.linearOrder) (CanonicallyOrderedAddMonoid.existsAddOfLE.{0} Nat (CanonicallyOrderedCommSemiring.toCanonicallyOrderedAddMonoid.{0} Nat Nat.canonicallyOrderedCommSemiring)) (OrderedAddCommMonoid.to_covariantClass_left.{0} Nat (OrderedSemiring.toOrderedAddCommMonoid.{0} Nat Nat.orderedSemiring)) instSubNat Nat.instOrderedSubNatInstLENatInstAddNatInstSubNat (Fin.val o i) m n (AddLeftCancelSemigroup.contravariant_add_le_of_contravariant_add_lt.{0} Nat (AddLeftCancelMonoid.toAddLeftCancelSemigroup.{0} Nat (AddCancelCommMonoid.toAddLeftCancelMonoid.{0} Nat (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{0} Nat (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Nat Nat.strictOrderedSemiring)))) (StrictOrderedSemiring.toPartialOrder.{0} Nat Nat.strictOrderedSemiring) (OrderedCancelAddCommMonoid.to_contravariantClass_left.{0} Nat (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Nat Nat.strictOrderedSemiring))) (le_of_not_lt.{0} Nat Nat.linearOrder m (Fin.val o i) h)) (Eq.rec.{0, 1} Nat o (fun (x._@.Mathlib.Data.Fin.VecNotation._hyg.1665 : Nat) (h._@.Mathlib.Data.Fin.VecNotation._hyg.1666 : Eq.{1} Nat o x._@.Mathlib.Data.Fin.VecNotation._hyg.1665) => LT.lt.{0} Nat (Preorder.toLT.{0} Nat (PartialOrder.toPreorder.{0} Nat (LinearOrder.toPartialOrder.{0} Nat Nat.linearOrder))) (Fin.val o i) x._@.Mathlib.Data.Fin.VecNotation._hyg.1665) (Fin.isLt o i) (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat instAddNat) m n) ho)))))
Case conversion may be inaccurate. Consider using '#align matrix.vec_append_eq_ite Matrix.vecAppend_eq_iteₓ'. -/
theorem vecAppend_eq_ite {α : Type _} {o : ℕ} (ho : o = m + n) (u : Fin m → α) (v : Fin n → α) :
vecAppend ho u v = fun i =>
@@ -532,7 +532,7 @@ variable {M : Type _} [SMul M α]
lean 3 declaration is
forall {α : Type.{u1}} {M : Type.{u2}} [_inst_1 : SMul.{u2, u1} M α] (x : M) (v : (Fin (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) -> α), Eq.{succ u1} ((Fin (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) -> α) (SMul.smul.{u2, u1} M ((Fin (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) -> α) (Function.hasSMul.{0, u2, u1} (Fin (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) M α _inst_1) x v) (Matrix.vecEmpty.{u1} α)
but is expected to have type
- forall {α : Type.{u2}} {M : Type.{u1}} [_inst_1 : SMul.{u1, u2} M α] (x : M) (v : (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> α), Eq.{succ u2} ((Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> α) (HSMul.hSMul.{u1, u2, u2} M ((Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> α) ((Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> α) (instHSMul.{u1, u2} M ((Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> α) (Pi.instSMul.{0, u2, u1} (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) M (fun (a._@.Mathlib.Data.Fin.VecNotation._hyg.3287 : Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) => α) (fun (i : Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) => _inst_1))) x v) (Matrix.vecEmpty.{u2} α)
+ forall {α : Type.{u2}} {M : Type.{u1}} [_inst_1 : SMul.{u1, u2} M α] (x : M) (v : (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> α), Eq.{succ u2} ((Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> α) (HSMul.hSMul.{u1, u2, u2} M ((Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> α) ((Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> α) (instHSMul.{u1, u2} M ((Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> α) (Pi.instSMul.{0, u2, u1} (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) M (fun (a._@.Mathlib.Data.Fin.VecNotation._hyg.3284 : Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) => α) (fun (i : Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) => _inst_1))) x v) (Matrix.vecEmpty.{u2} α)
Case conversion may be inaccurate. Consider using '#align matrix.smul_empty Matrix.smul_emptyₓ'. -/
@[simp]
theorem smul_empty (x : M) (v : Fin 0 → α) : x • v = ![] :=
@@ -543,7 +543,7 @@ theorem smul_empty (x : M) (v : Fin 0 → α) : x • v = ![] :=
lean 3 declaration is
forall {α : Type.{u1}} {n : Nat} {M : Type.{u2}} [_inst_1 : SMul.{u2, u1} M α] (x : M) (y : α) (v : (Fin n) -> α), Eq.{succ u1} ((Fin (Nat.succ n)) -> α) (SMul.smul.{u2, u1} M ((Fin (Nat.succ n)) -> α) (Function.hasSMul.{0, u2, u1} (Fin (Nat.succ n)) M α _inst_1) x (Matrix.vecCons.{u1} α n y v)) (Matrix.vecCons.{u1} α n (SMul.smul.{u2, u1} M α _inst_1 x y) (SMul.smul.{u2, u1} M ((Fin n) -> α) (Function.hasSMul.{0, u2, u1} (Fin n) M α _inst_1) x v))
but is expected to have type
- forall {α : Type.{u2}} {n : Nat} {M : Type.{u1}} [_inst_1 : SMul.{u1, u2} M α] (x : M) (y : α) (v : (Fin n) -> α), Eq.{succ u2} ((Fin (Nat.succ n)) -> α) (HSMul.hSMul.{u1, u2, u2} M ((Fin (Nat.succ n)) -> α) ((Fin (Nat.succ n)) -> α) (instHSMul.{u1, u2} M ((Fin (Nat.succ n)) -> α) (Pi.instSMul.{0, u2, u1} (Fin (Nat.succ n)) M (fun (a._@.Mathlib.Data.Fin.VecNotation._hyg.29 : Fin (Nat.succ n)) => α) (fun (i : Fin (Nat.succ n)) => _inst_1))) x (Matrix.vecCons.{u2} α n y v)) (Matrix.vecCons.{u2} α n (HSMul.hSMul.{u1, u2, u2} M α α (instHSMul.{u1, u2} M α _inst_1) x y) (HSMul.hSMul.{u1, u2, u2} M ((Fin n) -> α) ((Fin n) -> α) (instHSMul.{u1, u2} M ((Fin n) -> α) (Pi.instSMul.{0, u2, u1} (Fin n) M (fun (a._@.Mathlib.Data.Fin.VecNotation._hyg.3325 : Fin n) => α) (fun (i : Fin n) => _inst_1))) x v))
+ forall {α : Type.{u2}} {n : Nat} {M : Type.{u1}} [_inst_1 : SMul.{u1, u2} M α] (x : M) (y : α) (v : (Fin n) -> α), Eq.{succ u2} ((Fin (Nat.succ n)) -> α) (HSMul.hSMul.{u1, u2, u2} M ((Fin (Nat.succ n)) -> α) ((Fin (Nat.succ n)) -> α) (instHSMul.{u1, u2} M ((Fin (Nat.succ n)) -> α) (Pi.instSMul.{0, u2, u1} (Fin (Nat.succ n)) M (fun (a._@.Mathlib.Data.Fin.VecNotation._hyg.29 : Fin (Nat.succ n)) => α) (fun (i : Fin (Nat.succ n)) => _inst_1))) x (Matrix.vecCons.{u2} α n y v)) (Matrix.vecCons.{u2} α n (HSMul.hSMul.{u1, u2, u2} M α α (instHSMul.{u1, u2} M α _inst_1) x y) (HSMul.hSMul.{u1, u2, u2} M ((Fin n) -> α) ((Fin n) -> α) (instHSMul.{u1, u2} M ((Fin n) -> α) (Pi.instSMul.{0, u2, u1} (Fin n) M (fun (a._@.Mathlib.Data.Fin.VecNotation._hyg.3322 : Fin n) => α) (fun (i : Fin n) => _inst_1))) x v))
Case conversion may be inaccurate. Consider using '#align matrix.smul_cons Matrix.smul_consₓ'. -/
@[simp]
theorem smul_cons (x : M) (y : α) (v : Fin n → α) : x • vecCons y v = vecCons (x • y) (x • v) :=
mathlib commit https://github.com/leanprover-community/mathlib/commit/3180fab693e2cee3bff62675571264cb8778b212
@@ -317,7 +317,7 @@ def vecAppend {α : Type _} {o : ℕ} (ho : o = m + n) (u : Fin m → α) (v : F
lean 3 declaration is
forall {m : Nat} {n : Nat} {α : Type.{u1}} {o : Nat} (ho : Eq.{1} Nat o (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat Nat.hasAdd) m n)) (u : (Fin m) -> α) (v : (Fin n) -> α), Eq.{succ u1} ((Fin o) -> α) (Matrix.vecAppend.{u1} m n α o ho u v) (fun (i : Fin o) => dite.{succ u1} α (LT.lt.{0} Nat Nat.hasLt ((fun (a : Type) (b : Type) [self : HasLiftT.{1, 1} a b] => self.0) (Fin o) Nat (HasLiftT.mk.{1, 1} (Fin o) Nat (CoeTCₓ.coe.{1, 1} (Fin o) Nat (coeBase.{1, 1} (Fin o) Nat (Fin.coeToNat o)))) i) m) (Nat.decidableLt ((fun (a : Type) (b : Type) [self : HasLiftT.{1, 1} a b] => self.0) (Fin o) Nat (HasLiftT.mk.{1, 1} (Fin o) Nat (CoeTCₓ.coe.{1, 1} (Fin o) Nat (coeBase.{1, 1} (Fin o) Nat (Fin.coeToNat o)))) i) m) (fun (h : LT.lt.{0} Nat Nat.hasLt ((fun (a : Type) (b : Type) [self : HasLiftT.{1, 1} a b] => self.0) (Fin o) Nat (HasLiftT.mk.{1, 1} (Fin o) Nat (CoeTCₓ.coe.{1, 1} (Fin o) Nat (coeBase.{1, 1} (Fin o) Nat (Fin.coeToNat o)))) i) m) => u (Fin.mk m ((fun (a : Type) (b : Type) [self : HasLiftT.{1, 1} a b] => self.0) (Fin o) Nat (HasLiftT.mk.{1, 1} (Fin o) Nat (CoeTCₓ.coe.{1, 1} (Fin o) Nat (coeBase.{1, 1} (Fin o) Nat (Fin.coeToNat o)))) i) h)) (fun (h : Not (LT.lt.{0} Nat Nat.hasLt ((fun (a : Type) (b : Type) [self : HasLiftT.{1, 1} a b] => self.0) (Fin o) Nat (HasLiftT.mk.{1, 1} (Fin o) Nat (CoeTCₓ.coe.{1, 1} (Fin o) Nat (coeBase.{1, 1} (Fin o) Nat (Fin.coeToNat o)))) i) m)) => v (Fin.mk n (HSub.hSub.{0, 0, 0} Nat Nat Nat (instHSub.{0} Nat Nat.hasSub) ((fun (a : Type) (b : Type) [self : HasLiftT.{1, 1} a b] => self.0) (Fin o) Nat (HasLiftT.mk.{1, 1} (Fin o) Nat (CoeTCₓ.coe.{1, 1} (Fin o) Nat (coeBase.{1, 1} (Fin o) Nat (Fin.coeToNat o)))) i) m) (Iff.mpr (LT.lt.{0} Nat (Preorder.toLT.{0} Nat (PartialOrder.toPreorder.{0} Nat (LinearOrder.toPartialOrder.{0} Nat Nat.linearOrder))) (HSub.hSub.{0, 0, 0} Nat Nat Nat (instHSub.{0} Nat Nat.hasSub) ((fun (a : Type) (b : Type) [self : HasLiftT.{1, 1} a b] => self.0) (Fin o) Nat (HasLiftT.mk.{1, 1} (Fin o) Nat (CoeTCₓ.coe.{1, 1} (Fin o) Nat (coeBase.{1, 1} (Fin o) Nat (Fin.coeToNat o)))) i) m) n) (LT.lt.{0} Nat (Preorder.toLT.{0} Nat (PartialOrder.toPreorder.{0} Nat (LinearOrder.toPartialOrder.{0} Nat Nat.linearOrder))) ((fun (a : Type) (b : Type) [self : HasLiftT.{1, 1} a b] => self.0) (Fin o) Nat (HasLiftT.mk.{1, 1} (Fin o) Nat (CoeTCₓ.coe.{1, 1} (Fin o) Nat (coeBase.{1, 1} (Fin o) Nat (Fin.coeToNat o)))) i) (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat (AddSemigroup.toHasAdd.{0} Nat (AddCommSemigroup.toAddSemigroup.{0} Nat Nat.addCommSemigroup))) m n)) (tsub_lt_iff_left.{0} Nat Nat.addCommSemigroup (LinearOrder.toPartialOrder.{0} Nat Nat.linearOrder) (CanonicallyOrderedAddMonoid.existsAddOfLE.{0} Nat (CanonicallyOrderedCommSemiring.toCanonicallyOrderedAddMonoid.{0} Nat Nat.canonicallyOrderedCommSemiring)) (OrderedAddCommMonoid.to_covariantClass_left.{0} Nat (OrderedSemiring.toOrderedAddCommMonoid.{0} Nat Nat.orderedSemiring)) Nat.hasSub Nat.hasOrderedSub ((fun (a : Type) (b : Type) [self : HasLiftT.{1, 1} a b] => self.0) (Fin o) Nat (HasLiftT.mk.{1, 1} (Fin o) Nat (CoeTCₓ.coe.{1, 1} (Fin o) Nat (coeBase.{1, 1} (Fin o) Nat (Fin.coeToNat o)))) i) m n (AddLeftCancelSemigroup.contravariant_add_le_of_contravariant_add_lt.{0} Nat (AddLeftCancelMonoid.toAddLeftCancelSemigroup.{0} Nat (AddCancelCommMonoid.toAddLeftCancelMonoid.{0} Nat (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{0} Nat (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Nat Nat.strictOrderedSemiring)))) (OrderedCancelAddCommMonoid.toPartialOrder.{0} Nat (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Nat Nat.strictOrderedSemiring)) (OrderedCancelAddCommMonoid.to_contravariantClass_left.{0} Nat (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Nat Nat.strictOrderedSemiring))) (le_of_not_lt.{0} Nat Nat.linearOrder m ((fun (a : Type) (b : Type) [self : HasLiftT.{1, 1} a b] => self.0) (Fin o) Nat (HasLiftT.mk.{1, 1} (Fin o) Nat (CoeTCₓ.coe.{1, 1} (Fin o) Nat (coeBase.{1, 1} (Fin o) Nat (Fin.coeToNat o)))) i) h)) (Eq.subst.{1} Nat (fun (_x : Nat) => LT.lt.{0} Nat (Preorder.toLT.{0} Nat (PartialOrder.toPreorder.{0} Nat (LinearOrder.toPartialOrder.{0} Nat Nat.linearOrder))) ((fun (a : Type) (b : Type) [self : HasLiftT.{1, 1} a b] => self.0) (Fin o) Nat (HasLiftT.mk.{1, 1} (Fin o) Nat (CoeTCₓ.coe.{1, 1} (Fin o) Nat (coeBase.{1, 1} (Fin o) Nat (Fin.coeToNat o)))) i) _x) o (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat Nat.hasAdd) m n) ho (Fin.property o i))))))
but is expected to have type
- forall {m : Nat} {n : Nat} {α : Type.{u1}} {o : Nat} (ho : Eq.{1} Nat o (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat instAddNat) m n)) (u : (Fin m) -> α) (v : (Fin n) -> α), Eq.{succ u1} ((Fin o) -> α) (Matrix.vecAppend.{u1} m n α o ho u v) (fun (i : Fin o) => dite.{succ u1} α (LT.lt.{0} Nat instLTNat (Fin.val o i) m) (Nat.decLt (Fin.val o i) m) (fun (h : LT.lt.{0} Nat instLTNat (Fin.val o i) m) => u (Fin.mk m (Fin.val o i) h)) (fun (h : Not (LT.lt.{0} Nat instLTNat (Fin.val o i) m)) => v (Fin.mk n (HSub.hSub.{0, 0, 0} Nat Nat Nat (instHSub.{0} Nat instSubNat) (Fin.val o i) m) (Iff.mpr (LT.lt.{0} Nat (Preorder.toLT.{0} Nat (PartialOrder.toPreorder.{0} Nat (LinearOrder.toPartialOrder.{0} Nat Nat.linearOrder))) (HSub.hSub.{0, 0, 0} Nat Nat Nat (instHSub.{0} Nat instSubNat) (Fin.val o i) m) n) (LT.lt.{0} Nat (Preorder.toLT.{0} Nat (PartialOrder.toPreorder.{0} Nat (LinearOrder.toPartialOrder.{0} Nat Nat.linearOrder))) (Fin.val o i) (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat (AddSemigroup.toAdd.{0} Nat (AddCommSemigroup.toAddSemigroup.{0} Nat Nat.addCommSemigroup))) m n)) (tsub_lt_iff_left.{0} Nat Nat.addCommSemigroup (LinearOrder.toPartialOrder.{0} Nat Nat.linearOrder) (CanonicallyOrderedAddMonoid.existsAddOfLE.{0} Nat (CanonicallyOrderedCommSemiring.toCanonicallyOrderedAddMonoid.{0} Nat Nat.canonicallyOrderedCommSemiring)) (OrderedAddCommMonoid.to_covariantClass_left.{0} Nat (OrderedSemiring.toOrderedAddCommMonoid.{0} Nat Nat.orderedSemiring)) instSubNat Nat.instOrderedSubNatInstLENatInstAddNatInstSubNat (Fin.val o i) m n (AddLeftCancelSemigroup.contravariant_add_le_of_contravariant_add_lt.{0} Nat (AddLeftCancelMonoid.toAddLeftCancelSemigroup.{0} Nat (AddCancelCommMonoid.toAddLeftCancelMonoid.{0} Nat (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{0} Nat (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Nat Nat.strictOrderedSemiring)))) (StrictOrderedSemiring.toPartialOrder.{0} Nat Nat.strictOrderedSemiring) (OrderedCancelAddCommMonoid.to_contravariantClass_left.{0} Nat (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Nat Nat.strictOrderedSemiring))) (le_of_not_lt.{0} Nat Nat.linearOrder m (Fin.val o i) h)) (Eq.rec.{0, 1} Nat o (fun (x._@.Mathlib.Data.Fin.VecNotation._hyg.1667 : Nat) (h._@.Mathlib.Data.Fin.VecNotation._hyg.1668 : Eq.{1} Nat o x._@.Mathlib.Data.Fin.VecNotation._hyg.1667) => LT.lt.{0} Nat (Preorder.toLT.{0} Nat (PartialOrder.toPreorder.{0} Nat (LinearOrder.toPartialOrder.{0} Nat Nat.linearOrder))) (Fin.val o i) x._@.Mathlib.Data.Fin.VecNotation._hyg.1667) (Fin.isLt o i) (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat instAddNat) m n) ho)))))
+ forall {m : Nat} {n : Nat} {α : Type.{u1}} {o : Nat} (ho : Eq.{1} Nat o (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat instAddNat) m n)) (u : (Fin m) -> α) (v : (Fin n) -> α), Eq.{succ u1} ((Fin o) -> α) (Matrix.vecAppend.{u1} m n α o ho u v) (fun (i : Fin o) => dite.{succ u1} α (LT.lt.{0} Nat instLTNat (Fin.val o i) m) (Nat.decLt (Fin.val o i) m) (fun (h : LT.lt.{0} Nat instLTNat (Fin.val o i) m) => u (Fin.mk m (Fin.val o i) h)) (fun (h : Not (LT.lt.{0} Nat instLTNat (Fin.val o i) m)) => v (Fin.mk n (HSub.hSub.{0, 0, 0} Nat Nat Nat (instHSub.{0} Nat instSubNat) (Fin.val o i) m) (Iff.mpr (LT.lt.{0} Nat (Preorder.toLT.{0} Nat (PartialOrder.toPreorder.{0} Nat (LinearOrder.toPartialOrder.{0} Nat Nat.linearOrder))) (HSub.hSub.{0, 0, 0} Nat Nat Nat (instHSub.{0} Nat instSubNat) (Fin.val o i) m) n) (LT.lt.{0} Nat (Preorder.toLT.{0} Nat (PartialOrder.toPreorder.{0} Nat (LinearOrder.toPartialOrder.{0} Nat Nat.linearOrder))) (Fin.val o i) (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat (AddSemigroup.toAdd.{0} Nat (AddCommSemigroup.toAddSemigroup.{0} Nat Nat.addCommSemigroup))) m n)) (tsub_lt_iff_left.{0} Nat Nat.addCommSemigroup (LinearOrder.toPartialOrder.{0} Nat Nat.linearOrder) (CanonicallyOrderedAddMonoid.existsAddOfLE.{0} Nat (CanonicallyOrderedCommSemiring.toCanonicallyOrderedAddMonoid.{0} Nat Nat.canonicallyOrderedCommSemiring)) (OrderedAddCommMonoid.to_covariantClass_left.{0} Nat (OrderedSemiring.toOrderedAddCommMonoid.{0} Nat Nat.orderedSemiring)) instSubNat Nat.instOrderedSubNatInstLENatInstAddNatInstSubNat (Fin.val o i) m n (AddLeftCancelSemigroup.contravariant_add_le_of_contravariant_add_lt.{0} Nat (AddLeftCancelMonoid.toAddLeftCancelSemigroup.{0} Nat (AddCancelCommMonoid.toAddLeftCancelMonoid.{0} Nat (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{0} Nat (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Nat Nat.strictOrderedSemiring)))) (StrictOrderedSemiring.toPartialOrder.{0} Nat Nat.strictOrderedSemiring) (OrderedCancelAddCommMonoid.to_contravariantClass_left.{0} Nat (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Nat Nat.strictOrderedSemiring))) (le_of_not_lt.{0} Nat Nat.linearOrder m (Fin.val o i) h)) (Eq.rec.{0, 1} Nat o (fun (x._@.Mathlib.Data.Fin.VecNotation._hyg.1668 : Nat) (h._@.Mathlib.Data.Fin.VecNotation._hyg.1669 : Eq.{1} Nat o x._@.Mathlib.Data.Fin.VecNotation._hyg.1668) => LT.lt.{0} Nat (Preorder.toLT.{0} Nat (PartialOrder.toPreorder.{0} Nat (LinearOrder.toPartialOrder.{0} Nat Nat.linearOrder))) (Fin.val o i) x._@.Mathlib.Data.Fin.VecNotation._hyg.1668) (Fin.isLt o i) (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat instAddNat) m n) ho)))))
Case conversion may be inaccurate. Consider using '#align matrix.vec_append_eq_ite Matrix.vecAppend_eq_iteₓ'. -/
theorem vecAppend_eq_ite {α : Type _} {o : ℕ} (ho : o = m + n) (u : Fin m → α) (v : Fin n → α) :
vecAppend ho u v = fun i =>
@@ -532,7 +532,7 @@ variable {M : Type _} [SMul M α]
lean 3 declaration is
forall {α : Type.{u1}} {M : Type.{u2}} [_inst_1 : SMul.{u2, u1} M α] (x : M) (v : (Fin (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) -> α), Eq.{succ u1} ((Fin (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) -> α) (SMul.smul.{u2, u1} M ((Fin (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) -> α) (Function.hasSMul.{0, u2, u1} (Fin (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) M α _inst_1) x v) (Matrix.vecEmpty.{u1} α)
but is expected to have type
- forall {α : Type.{u2}} {M : Type.{u1}} [_inst_1 : SMul.{u1, u2} M α] (x : M) (v : (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> α), Eq.{succ u2} ((Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> α) (HSMul.hSMul.{u1, u2, u2} M ((Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> α) ((Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> α) (instHSMul.{u1, u2} M ((Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> α) (Pi.instSMul.{0, u2, u1} (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) M (fun (a._@.Mathlib.Data.Fin.VecNotation._hyg.3286 : Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) => α) (fun (i : Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) => _inst_1))) x v) (Matrix.vecEmpty.{u2} α)
+ forall {α : Type.{u2}} {M : Type.{u1}} [_inst_1 : SMul.{u1, u2} M α] (x : M) (v : (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> α), Eq.{succ u2} ((Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> α) (HSMul.hSMul.{u1, u2, u2} M ((Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> α) ((Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> α) (instHSMul.{u1, u2} M ((Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> α) (Pi.instSMul.{0, u2, u1} (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) M (fun (a._@.Mathlib.Data.Fin.VecNotation._hyg.3287 : Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) => α) (fun (i : Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) => _inst_1))) x v) (Matrix.vecEmpty.{u2} α)
Case conversion may be inaccurate. Consider using '#align matrix.smul_empty Matrix.smul_emptyₓ'. -/
@[simp]
theorem smul_empty (x : M) (v : Fin 0 → α) : x • v = ![] :=
@@ -543,7 +543,7 @@ theorem smul_empty (x : M) (v : Fin 0 → α) : x • v = ![] :=
lean 3 declaration is
forall {α : Type.{u1}} {n : Nat} {M : Type.{u2}} [_inst_1 : SMul.{u2, u1} M α] (x : M) (y : α) (v : (Fin n) -> α), Eq.{succ u1} ((Fin (Nat.succ n)) -> α) (SMul.smul.{u2, u1} M ((Fin (Nat.succ n)) -> α) (Function.hasSMul.{0, u2, u1} (Fin (Nat.succ n)) M α _inst_1) x (Matrix.vecCons.{u1} α n y v)) (Matrix.vecCons.{u1} α n (SMul.smul.{u2, u1} M α _inst_1 x y) (SMul.smul.{u2, u1} M ((Fin n) -> α) (Function.hasSMul.{0, u2, u1} (Fin n) M α _inst_1) x v))
but is expected to have type
- forall {α : Type.{u2}} {n : Nat} {M : Type.{u1}} [_inst_1 : SMul.{u1, u2} M α] (x : M) (y : α) (v : (Fin n) -> α), Eq.{succ u2} ((Fin (Nat.succ n)) -> α) (HSMul.hSMul.{u1, u2, u2} M ((Fin (Nat.succ n)) -> α) ((Fin (Nat.succ n)) -> α) (instHSMul.{u1, u2} M ((Fin (Nat.succ n)) -> α) (Pi.instSMul.{0, u2, u1} (Fin (Nat.succ n)) M (fun (a._@.Mathlib.Data.Fin.VecNotation._hyg.29 : Fin (Nat.succ n)) => α) (fun (i : Fin (Nat.succ n)) => _inst_1))) x (Matrix.vecCons.{u2} α n y v)) (Matrix.vecCons.{u2} α n (HSMul.hSMul.{u1, u2, u2} M α α (instHSMul.{u1, u2} M α _inst_1) x y) (HSMul.hSMul.{u1, u2, u2} M ((Fin n) -> α) ((Fin n) -> α) (instHSMul.{u1, u2} M ((Fin n) -> α) (Pi.instSMul.{0, u2, u1} (Fin n) M (fun (a._@.Mathlib.Data.Fin.VecNotation._hyg.3324 : Fin n) => α) (fun (i : Fin n) => _inst_1))) x v))
+ forall {α : Type.{u2}} {n : Nat} {M : Type.{u1}} [_inst_1 : SMul.{u1, u2} M α] (x : M) (y : α) (v : (Fin n) -> α), Eq.{succ u2} ((Fin (Nat.succ n)) -> α) (HSMul.hSMul.{u1, u2, u2} M ((Fin (Nat.succ n)) -> α) ((Fin (Nat.succ n)) -> α) (instHSMul.{u1, u2} M ((Fin (Nat.succ n)) -> α) (Pi.instSMul.{0, u2, u1} (Fin (Nat.succ n)) M (fun (a._@.Mathlib.Data.Fin.VecNotation._hyg.29 : Fin (Nat.succ n)) => α) (fun (i : Fin (Nat.succ n)) => _inst_1))) x (Matrix.vecCons.{u2} α n y v)) (Matrix.vecCons.{u2} α n (HSMul.hSMul.{u1, u2, u2} M α α (instHSMul.{u1, u2} M α _inst_1) x y) (HSMul.hSMul.{u1, u2, u2} M ((Fin n) -> α) ((Fin n) -> α) (instHSMul.{u1, u2} M ((Fin n) -> α) (Pi.instSMul.{0, u2, u1} (Fin n) M (fun (a._@.Mathlib.Data.Fin.VecNotation._hyg.3325 : Fin n) => α) (fun (i : Fin n) => _inst_1))) x v))
Case conversion may be inaccurate. Consider using '#align matrix.smul_cons Matrix.smul_consₓ'. -/
@[simp]
theorem smul_cons (x : M) (y : α) (v : Fin n → α) : x • vecCons y v = vecCons (x • y) (x • v) :=
mathlib commit https://github.com/leanprover-community/mathlib/commit/4c586d291f189eecb9d00581aeb3dd998ac34442
@@ -264,22 +264,22 @@ theorem cons_fin_one (x : α) (u : Fin 0 → α) : vecCons x u = fun _ => x :=
#align matrix.cons_fin_one Matrix.cons_fin_one
-/
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:76:14: unsupported tactic `reflect_name #[] -/
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:76:14: unsupported tactic `reflect_name #[] -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:73:14: unsupported tactic `reflect_name #[] -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:73:14: unsupported tactic `reflect_name #[] -/
unsafe instance _root_.pi_fin.reflect [reflected_univ.{u}] [reflected _ α] [has_reflect α] :
∀ {n}, has_reflect (Fin n → α)
| 0, v =>
(Subsingleton.elim vecEmpty v).rec
((by
trace
- "./././Mathport/Syntax/Translate/Tactic/Builtin.lean:76:14: unsupported tactic `reflect_name #[]" :
+ "./././Mathport/Syntax/Translate/Tactic/Builtin.lean:73:14: unsupported tactic `reflect_name #[]" :
reflected _ @vecEmpty.{u}).subst
q(α))
| n + 1, v =>
(cons_head_tail v).rec <|
(by
trace
- "./././Mathport/Syntax/Translate/Tactic/Builtin.lean:76:14: unsupported tactic `reflect_name #[]" :
+ "./././Mathport/Syntax/Translate/Tactic/Builtin.lean:73:14: unsupported tactic `reflect_name #[]" :
reflected _ @vecCons.{u}).subst₄
q(α) q(n) q(_) (_root_.pi_fin.reflect _)
#align pi_fin.reflect pi_fin.reflect
mathlib commit https://github.com/leanprover-community/mathlib/commit/bd9851ca476957ea4549eb19b40e7b5ade9428cc
Purely automatic replacement. If this is in any way controversial; I'm happy to just close this PR.
@@ -252,7 +252,7 @@ protected instance _root_.PiFin.toExpr [ToLevel.{u}] [ToExpr α] (n : ℕ) : ToE
-- Porting note: the next decl is commented out. TODO(eric-wieser)
--- /-- Convert a vector of pexprs to the pexpr constructing that vector.-/
+-- /-- Convert a vector of pexprs to the pexpr constructing that vector. -/
-- unsafe def _root_.pi_fin.to_pexpr : ∀ {n}, (Fin n → pexpr) → pexpr
-- | 0, v => ``(![])
-- | n + 1, v => ``(vecCons $(v 0) $(_root_.pi_fin.to_pexpr <| vecTail v))
Matrix.cons_val_three
, Matrix.cons_val_four
(#11382)
I just needed the three
version of these when doing some explicit computations with a cubic polynomial. Obviously there is a limit to how far we should go but I think the proposed values are reasonable.
@@ -214,6 +214,16 @@ theorem cons_val_one (x : α) (u : Fin m.succ → α) : vecCons x u 1 = vecHead
theorem cons_val_two (x : α) (u : Fin m.succ.succ → α) : vecCons x u 2 = vecHead (vecTail u) :=
rfl
+@[simp]
+lemma cons_val_three (x : α) (u : Fin m.succ.succ.succ → α) :
+ vecCons x u 3 = vecHead (vecTail (vecTail u)) :=
+ rfl
+
+@[simp]
+lemma cons_val_four (x : α) (u : Fin m.succ.succ.succ.succ → α) :
+ vecCons x u 4 = vecHead (vecTail (vecTail (vecTail u))) :=
+ rfl
+
@[simp]
theorem cons_val_fin_one (x : α) (u : Fin 0 → α) : ∀ (i : Fin 1), vecCons x u i = x := by
rw [Fin.forall_fin_one]
open Classical
(#11199)
We remove all but one open Classical
s, instead preferring to use open scoped Classical
. The only real side-effect this led to is moving a couple declarations to use Exists.choose
instead of Classical.choose
.
The first few commits are explicitly labelled regex replaces for ease of review.
@@ -566,7 +566,7 @@ theorem cons_eq_zero_iff {v : Fin n → α} {x : α} : vecCons x v = 0 ↔ x = 0
fun ⟨hx, hv⟩ => by simp [hx, hv]⟩
#align matrix.cons_eq_zero_iff Matrix.cons_eq_zero_iff
-open Classical
+open scoped Classical
theorem cons_nonzero_iff {v : Fin n → α} {x : α} : vecCons x v ≠ 0 ↔ x ≠ 0 ∨ v ≠ 0 :=
⟨fun h => not_and_or.mp (h ∘ cons_eq_zero_iff.mpr), fun h =>
@@ -602,4 +602,7 @@ theorem tail_neg (a : Fin n.succ → α) : vecTail (-a) = -vecTail a :=
end Neg
+lemma const_fin1_eq (x : α) : (fun _ : Fin 1 => x) = ![x] :=
+ (cons_fin_one x _).symm
+
end Matrix
Fin 0
(#10850)
Fin.elim0
and Fin.elim0'
are exactly the same function (non-dependent eliminator for Fin 0
) and we were missing the dependent version (I suspect that Fin.elim0
originally was dependent, and became non-dependent upon landing in Std).
From PFR
@@ -49,7 +49,7 @@ section MatrixNotation
/-- `![]` is the vector with no entries. -/
def vecEmpty : Fin 0 → α :=
- Fin.elim0'
+ Fin.elim0
#align matrix.vec_empty Matrix.vecEmpty
/-- `vecCons h t` prepends an entry `h` to a vector `t`.
@@ -179,12 +179,12 @@ theorem range_empty (u : Fin 0 → α) : Set.range u = ∅ :=
Set.range_eq_empty _
#align matrix.range_empty Matrix.range_empty
--- @[simp] -- Porting note: simp can prove this
+-- @[simp] -- Porting note (#10618): simp can prove this
theorem range_cons_empty (x : α) (u : Fin 0 → α) : Set.range (Matrix.vecCons x u) = {x} := by
rw [range_cons, range_empty, Set.union_empty]
#align matrix.range_cons_empty Matrix.range_cons_empty
--- @[simp] -- Porting note: simp can prove this (up to commutativity)
+-- @[simp] -- Porting note (#10618): simp can prove this (up to commutativity)
theorem range_cons_cons_empty (x y : α) (u : Fin 0 → α) :
Set.range (vecCons x <| vecCons y u) = {x, y} := by
rw [range_cons, range_cons_empty, Set.singleton_union]
@@ -474,7 +474,7 @@ theorem add_cons (v : Fin n.succ → α) (y : α) (w : Fin n → α) :
refine' Fin.cases _ _ i <;> simp [vecHead, vecTail]
#align matrix.add_cons Matrix.add_cons
--- @[simp] -- Porting note: simp can prove this
+-- @[simp] -- Porting note (#10618): simp can prove this
theorem cons_add_cons (x : α) (v : Fin n → α) (y : α) (w : Fin n → α) :
vecCons x v + vecCons y w = vecCons (x + y) (v + w) := by simp
#align matrix.cons_add_cons Matrix.cons_add_cons
@@ -514,7 +514,7 @@ theorem sub_cons (v : Fin n.succ → α) (y : α) (w : Fin n → α) :
refine' Fin.cases _ _ i <;> simp [vecHead, vecTail]
#align matrix.sub_cons Matrix.sub_cons
--- @[simp] -- Porting note: simp can prove this
+-- @[simp] -- Porting note (#10618): simp can prove this
theorem cons_sub_cons (x : α) (v : Fin n → α) (y : α) (w : Fin n → α) :
vecCons x v - vecCons y w = vecCons (x - y) (v - w) := by simp
#align matrix.cons_sub_cons Matrix.cons_sub_cons
@@ -5,7 +5,7 @@ Authors: Anne Baanen
-/
import Mathlib.Data.Fin.Tuple.Basic
import Mathlib.Data.List.Range
-import Mathlib.GroupTheory.GroupAction.Pi
+import Mathlib.Data.Set.Image
#align_import data.fin.vec_notation from "leanprover-community/mathlib"@"2445c98ae4b87eabebdde552593519b9b6dc350c"
Nsmul
-> NSMul
, Zpow
-> ZPow
, etc (#9067)
Normalising to naming convention rule number 6.
@@ -434,7 +434,7 @@ theorem empty_vecAlt1 (α) {h} : vecAlt1 h (![] : Fin 0 → α) = ![] := by
end Val
-section Smul
+section SMul
variable {M : Type*} [SMul M α]
@@ -449,7 +449,7 @@ theorem smul_cons (x : M) (y : α) (v : Fin n → α) : x • vecCons y v = vecC
refine' Fin.cases _ _ i <;> simp
#align matrix.smul_cons Matrix.smul_cons
-end Smul
+end SMul
section Add
attribute [simp] ... in
-> attribute [local simp] ... in
(#7678)
Mathlib.Logic.Unique contains the line attribute [simp] eq_iff_true_of_subsingleton in ...
:
Despite what the in
part may imply, this adds the lemma to the simp set "globally", including for downstream files; it is likely that attribute [local simp] eq_iff_true_of_subsingleton in ...
was meant instead (or maybe scoped simp
, but I think "scoped" refers to the current namespace). Indeed, the relevant lemma is not marked with @[simp]
for possible slowness: https://github.com/leanprover/std4/blob/846e9e1d6bb534774d1acd2dc430e70987da3c18/Std/Logic.lean#L749. Adding it to the simp set causes the example at https://leanprover.zulipchat.com/#narrow/stream/287929-mathlib4/topic/Regression.20in.20simp to slow down.
This PR changes this and fixes the relevant downstream simp
s. There was also one ocurrence of attribute [simp] FullSubcategory.comp_def FullSubcategory.id_def in
in Mathlib.CategoryTheory.Monoidal.Subcategory but that was much easier to fix.
@@ -405,7 +405,8 @@ theorem cons_vecAlt0 (h : m + 1 + 1 = n + 1 + (n + 1)) (x y : α) (u : Fin m →
-- Although proved by simp, extracting element 8 of a five-element
-- vector does not work by simp unless this lemma is present.
@[simp]
-theorem empty_vecAlt0 (α) {h} : vecAlt0 h (![] : Fin 0 → α) = ![] := by simp
+theorem empty_vecAlt0 (α) {h} : vecAlt0 h (![] : Fin 0 → α) = ![] := by
+ simp [eq_iff_true_of_subsingleton]
#align matrix.empty_vec_alt0 Matrix.empty_vecAlt0
@[simp]
@@ -427,7 +428,8 @@ theorem cons_vecAlt1 (h : m + 1 + 1 = n + 1 + (n + 1)) (x y : α) (u : Fin m →
-- Although proved by simp, extracting element 9 of a five-element
-- vector does not work by simp unless this lemma is present.
@[simp]
-theorem empty_vecAlt1 (α) {h} : vecAlt1 h (![] : Fin 0 → α) = ![] := by simp
+theorem empty_vecAlt1 (α) {h} : vecAlt1 h (![] : Fin 0 → α) = ![] := by
+ simp [eq_iff_true_of_subsingleton]
#align matrix.empty_vec_alt1 Matrix.empty_vecAlt1
end Val
@@ -61,7 +61,14 @@ def vecCons {n : ℕ} (h : α) (t : Fin n → α) : Fin n.succ → α :=
Fin.cons h t
#align matrix.vec_cons Matrix.vecCons
-/-- Construct a vector `Fin n → α` using `Matrix.vecEmpty` and `Matrix.vecCons`. -/
+/-- `![...]` notation is used to construct a vector `Fin n → α` using `Matrix.vecEmpty` and
+`Matrix.vecCons`.
+
+For instance, `![a, b, c] : Fin 3` is syntax for `vecCons a (vecCons b (vecCons c vecEmpty))`.
+
+Note that this should not be used as syntax for `Matrix` as it generates a term with the wrong type.
+The `!![a, b; c, d]` syntax (provided by `Matrix.matrixNotation`) should be used instead.
+-/
syntax (name := vecNotation) "![" term,* "]" : term
macro_rules
Fin.castIso
and Fin.revPerm
with Fin.cast
and Fin.rev
for the bump of Std (#5847)
Some theorems in Data.Fin.Basic
are copied to Std at the recent commit in Std.
These are written using Fin.cast
and Fin.rev
, so declarations using Fin.castIso
and Fin.revPerm
in Mathlib should be rewritten.
Co-authored-by: Pol'tta / Miyahara Kō <52843868+Komyyy@users.noreply.github.com> Co-authored-by: Johan Commelin <johan@commelin.net>
@@ -259,7 +259,7 @@ This turns out to be helpful when providing simp lemmas to reduce `![a, b, c] n`
that `vecAppend ho u v 0` is valid. `Fin.append u v 0` is not valid in this case because there is
no `Zero (Fin (m + n))` instance. -/
def vecAppend {α : Type*} {o : ℕ} (ho : o = m + n) (u : Fin m → α) (v : Fin n → α) : Fin o → α :=
- Fin.append u v ∘ Fin.castIso ho
+ Fin.append u v ∘ Fin.cast ho
#align matrix.vec_append Matrix.vecAppend
theorem vecAppend_eq_ite {α : Type*} {o : ℕ} (ho : o = m + n) (u : Fin m → α) (v : Fin n → α) :
@@ -326,7 +326,6 @@ theorem vecAlt0_vecAppend (v : Fin n → α) : vecAlt0 rfl (vecAppend rfl v v) =
simp_rw [Function.comp, bit0, vecAlt0, vecAppend_eq_ite]
split_ifs with h <;> congr
· rw [Fin.val_mk] at h
- simp only [Fin.ext_iff, Fin.val_add, Fin.val_mk]
exact (Nat.mod_eq_of_lt h).symm
· rw [Fin.val_mk, not_lt] at h
simp only [Fin.ext_iff, Fin.val_add, Fin.val_mk, Nat.mod_eq_sub_mod h]
@@ -344,9 +343,8 @@ theorem vecAlt1_vecAppend (v : Fin (n + 1) → α) : vecAlt1 rfl (vecAppend rfl
simp only [Nat.zero_eq, zero_add, Nat.lt_one_iff] at hi; subst i; rfl
| succ n =>
split_ifs with h <;> simp_rw [bit1, bit0] <;> congr
- · simp only [Fin.ext_iff, Fin.val_add, Fin.val_mk]
- rw [Fin.val_mk] at h
- erw [Nat.mod_eq_of_lt (Nat.lt_of_succ_lt h)]
+ · rw [Fin.val_mk] at h
+ rw [Nat.mod_eq_of_lt (Nat.lt_of_succ_lt h)]
erw [Nat.mod_eq_of_lt h]
· rw [Fin.val_mk, not_lt] at h
simp only [Fin.ext_iff, Fin.val_add, Fin.val_mk, Nat.mod_add_mod, Fin.val_one,
Type _
and Sort _
(#6499)
We remove all possible occurences of Type _
and Sort _
in favor of Type*
and Sort*
.
This has nice performance benefits.
@@ -108,7 +108,7 @@ instance _root_.PiFin.hasRepr [Repr α] : Repr (Fin n → α) where
end MatrixNotation
-variable {m n o : ℕ} {m' n' o' : Type _}
+variable {m n o : ℕ} {m' n' o' : Type*}
theorem empty_eq (v : Fin 0 → α) : v = ![] :=
Subsingleton.elim _ _
@@ -153,7 +153,7 @@ theorem tail_cons (x : α) (u : Fin m → α) : vecTail (vecCons x u) = u := by
#align matrix.tail_cons Matrix.tail_cons
@[simp]
-theorem empty_val' {n' : Type _} (j : n') : (fun i => (![] : Fin 0 → n' → α) i j) = ![] :=
+theorem empty_val' {n' : Type*} (j : n') : (fun i => (![] : Fin 0 → n' → α) i j) = ![] :=
empty_eq _
#align matrix.empty_val' Matrix.empty_val'
@@ -258,11 +258,11 @@ which provides control of definitional equality for the vector length.
This turns out to be helpful when providing simp lemmas to reduce `![a, b, c] n`, and also means
that `vecAppend ho u v 0` is valid. `Fin.append u v 0` is not valid in this case because there is
no `Zero (Fin (m + n))` instance. -/
-def vecAppend {α : Type _} {o : ℕ} (ho : o = m + n) (u : Fin m → α) (v : Fin n → α) : Fin o → α :=
+def vecAppend {α : Type*} {o : ℕ} (ho : o = m + n) (u : Fin m → α) (v : Fin n → α) : Fin o → α :=
Fin.append u v ∘ Fin.castIso ho
#align matrix.vec_append Matrix.vecAppend
-theorem vecAppend_eq_ite {α : Type _} {o : ℕ} (ho : o = m + n) (u : Fin m → α) (v : Fin n → α) :
+theorem vecAppend_eq_ite {α : Type*} {o : ℕ} (ho : o = m + n) (u : Fin m → α) (v : Fin n → α) :
vecAppend ho u v = fun i : Fin o =>
if h : (i : ℕ) < m then u ⟨i, h⟩
else v ⟨(i : ℕ) - m, (tsub_lt_iff_left (le_of_not_lt h)).2 (ho ▸ i.2)⟩ := by
@@ -277,7 +277,7 @@ theorem vecAppend_eq_ite {α : Type _} {o : ℕ} (ho : o = m + n) (u : Fin m →
-- Could become one again with change to `Nat.ble`:
-- https://github.com/leanprover-community/mathlib4/pull/1741/files/#r1083902351
@[simp]
-theorem vecAppend_apply_zero {α : Type _} {o : ℕ} (ho : o + 1 = m + 1 + n) (u : Fin (m + 1) → α)
+theorem vecAppend_apply_zero {α : Type*} {o : ℕ} (ho : o + 1 = m + 1 + n) (u : Fin (m + 1) → α)
(v : Fin n → α) : vecAppend ho u v 0 = u 0 :=
dif_pos _
#align matrix.vec_append_apply_zero Matrix.vecAppend_apply_zero
@@ -429,7 +429,7 @@ end Val
section Smul
-variable {M : Type _} [SMul M α]
+variable {M : Type*} [SMul M α]
@[simp]
theorem smul_empty (x : M) (v : Fin 0 → α) : x • v = ![] :=
@@ -199,11 +199,14 @@ theorem vec_single_eq_const (a : α) : ![a] = fun _ => a :=
`cons_val_succ`, because `1 : Fin 1 = 0 : Fin 1`.
-/
@[simp]
-theorem cons_val_one (x : α) (u : Fin m.succ → α) : vecCons x u 1 = vecHead u := by
- rw [← Fin.succ_zero_eq_one, cons_val_succ]
+theorem cons_val_one (x : α) (u : Fin m.succ → α) : vecCons x u 1 = vecHead u :=
rfl
#align matrix.cons_val_one Matrix.cons_val_one
+@[simp]
+theorem cons_val_two (x : α) (u : Fin m.succ.succ → α) : vecCons x u 2 = vecHead (vecTail u) :=
+ rfl
+
@[simp]
theorem cons_val_fin_one (x : α) (u : Fin 0 → α) : ∀ (i : Fin 1), vecCons x u i = x := by
rw [Fin.forall_fin_one]
@@ -2,16 +2,13 @@
Copyright (c) 2020 Anne Baanen. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Anne Baanen
-
-! This file was ported from Lean 3 source module data.fin.vec_notation
-! leanprover-community/mathlib commit 2445c98ae4b87eabebdde552593519b9b6dc350c
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
-/
import Mathlib.Data.Fin.Tuple.Basic
import Mathlib.Data.List.Range
import Mathlib.GroupTheory.GroupAction.Pi
+#align_import data.fin.vec_notation from "leanprover-community/mathlib"@"2445c98ae4b87eabebdde552593519b9b6dc350c"
+
/-!
# Matrix and vector notation
@@ -259,7 +259,7 @@ This turns out to be helpful when providing simp lemmas to reduce `![a, b, c] n`
that `vecAppend ho u v 0` is valid. `Fin.append u v 0` is not valid in this case because there is
no `Zero (Fin (m + n))` instance. -/
def vecAppend {α : Type _} {o : ℕ} (ho : o = m + n) (u : Fin m → α) (v : Fin n → α) : Fin o → α :=
- Fin.append u v ∘ Fin.cast ho
+ Fin.append u v ∘ Fin.castIso ho
#align matrix.vec_append Matrix.vecAppend
theorem vecAppend_eq_ite {α : Type _} {o : ℕ} (ho : o = m + n) (u : Fin m → α) (v : Fin n → α) :
Co-authored-by: Scott Morrison <scott.morrison@gmail.com> Co-authored-by: Mario Carneiro <di.gama@gmail.com> Co-authored-by: Floris van Doorn <fpvdoorn@gmail.com> Co-authored-by: Jeremy Tan Jie Rui <reddeloostw@gmail.com> Co-authored-by: Alex J Best <alex.j.best@gmail.com>
@@ -535,7 +535,7 @@ theorem zero_empty : (0 : Fin 0 → α) = ![] :=
@[simp]
theorem cons_zero_zero : vecCons (0 : α) (0 : Fin n → α) = 0 := by
- ext (i j)
+ ext i
refine' Fin.cases _ _ i
· rfl
simp
@@ -338,10 +338,11 @@ theorem vecAlt0_vecAppend (v : Fin n → α) : vecAlt0 rfl (vecAppend rfl v v) =
theorem vecAlt1_vecAppend (v : Fin (n + 1) → α) : vecAlt1 rfl (vecAppend rfl v v) = v ∘ bit1 := by
ext i
simp_rw [Function.comp, vecAlt1, vecAppend_eq_ite]
- cases n
- · cases' i with i hi
+ cases n with
+ | zero =>
+ cases' i with i hi
simp only [Nat.zero_eq, zero_add, Nat.lt_one_iff] at hi; subst i; rfl
- case succ n =>
+ | succ n =>
split_ifs with h <;> simp_rw [bit1, bit0] <;> congr
· simp only [Fin.ext_iff, Fin.val_add, Fin.val_mk]
rw [Fin.val_mk] at h
This makes a mathlib4 version of mathlib3's tactic.basic
, now called Mathlib.Tactic.Common
, which imports all tactics which do not have significant theory requirements, and then is imported all across the base of the hierarchy.
This ensures that all common tactics are available nearly everywhere in the library, rather than having to be imported one-by-one as you need them.
Co-authored-by: Scott Morrison <scott.morrison@gmail.com>
@@ -11,8 +11,6 @@ Authors: Anne Baanen
import Mathlib.Data.Fin.Tuple.Basic
import Mathlib.Data.List.Range
import Mathlib.GroupTheory.GroupAction.Pi
-import Mathlib.Tactic.ToExpr
-import Qq
/-!
# Matrix and vector notation
Now that leanprover/lean4#2210 has been merged, this PR:
set_option synthInstance.etaExperiment true
commands (and some etaExperiment%
term elaborators)set_option maxHeartbeats
commandsCo-authored-by: Scott Morrison <scott.morrison@anu.edu.au> Co-authored-by: Scott Morrison <scott.morrison@gmail.com> Co-authored-by: Matthew Ballard <matt@mrb.email>
@@ -343,16 +343,16 @@ theorem vecAlt1_vecAppend (v : Fin (n + 1) → α) : vecAlt1 rfl (vecAppend rfl
cases n
· cases' i with i hi
simp only [Nat.zero_eq, zero_add, Nat.lt_one_iff] at hi; subst i; rfl
- · split_ifs with h <;> simp_rw [bit1, bit0] <;> congr
+ case succ n =>
+ split_ifs with h <;> simp_rw [bit1, bit0] <;> congr
· simp only [Fin.ext_iff, Fin.val_add, Fin.val_mk]
rw [Fin.val_mk] at h
- rw [Fin.val_one]
erw [Nat.mod_eq_of_lt (Nat.lt_of_succ_lt h)]
erw [Nat.mod_eq_of_lt h]
· rw [Fin.val_mk, not_lt] at h
simp only [Fin.ext_iff, Fin.val_add, Fin.val_mk, Nat.mod_add_mod, Fin.val_one,
- Nat.mod_eq_sub_mod h]
- refine' (Nat.mod_eq_of_lt _).symm
+ Nat.mod_eq_sub_mod h, show 1 % (n + 2) = 1 from Nat.mod_eq_of_lt (by simp)]
+ refine (Nat.mod_eq_of_lt ?_).symm
rw [tsub_lt_iff_left h]
exact Nat.add_succ_lt_add i.2 i.2
#align matrix.vec_alt1_vec_append Matrix.vecAlt1_vecAppend
by
s! (#3825)
This PR puts, with one exception, every single remaining by
that lies all by itself on its own line to the previous line, thus matching the current behaviour of start-port.sh
. The exception is when the by
begins the second or later argument to a tuple or anonymous constructor; see https://github.com/leanprover-community/mathlib4/pull/3825#discussion_r1186702599.
Essentially this is s/\n *by$/ by/g
, but with manual editing to satisfy the linter's max-100-char-line requirement. The Python style linter is also modified to catch these "isolated by
s".
@@ -292,10 +292,8 @@ theorem empty_vecAppend (v : Fin n → α) : vecAppend (zero_add _).symm ![] v =
@[simp]
theorem cons_vecAppend (ho : o + 1 = m + 1 + n) (x : α) (u : Fin m → α) (v : Fin n → α) :
- vecAppend ho (vecCons x u) v =
- vecCons x
- (vecAppend (by rwa [add_assoc, add_comm 1, ← add_assoc, add_right_cancel_iff] at ho) u v) :=
- by
+ vecAppend ho (vecCons x u) v = vecCons x (vecAppend (by
+ rwa [add_assoc, add_comm 1, ← add_assoc, add_right_cancel_iff] at ho) u v) := by
ext i
simp_rw [vecAppend_eq_ite]
split_ifs with h
@@ -18,25 +18,25 @@ import Qq
# Matrix and vector notation
This file defines notation for vectors and matrices. Given `a b c d : α`,
-the notation allows us to write `![a, b, c, d] : fin 4 → α`.
-Nesting vectors gives coefficients of a matrix, so `![![a, b], ![c, d]] : fin 2 → fin 2 → α`.
-In later files we introduce `!![a, b; c, d]` as notation for `matrix.of ![![a, b], ![c, d]]`.
+the notation allows us to write `![a, b, c, d] : Fin 4 → α`.
+Nesting vectors gives coefficients of a matrix, so `![![a, b], ![c, d]] : Fin 2 → Fin 2 → α`.
+In later files we introduce `!![a, b; c, d]` as notation for `Matrix.of ![![a, b], ![c, d]]`.
## Main definitions
-* `vec_empty` is the empty vector (or `0` by `n` matrix) `![]`
-* `vec_cons` prepends an entry to a vector, so `![a, b]` is `vec_cons a (vec_cons b vec_empty)`
+* `vecEmpty` is the empty vector (or `0` by `n` matrix) `![]`
+* `vecCons` prepends an entry to a vector, so `![a, b]` is `vecCons a (vecCons b vecEmpty)`
## Implementation notes
-The `simp` lemmas require that one of the arguments is of the form `vec_cons _ _`.
+The `simp` lemmas require that one of the arguments is of the form `vecCons _ _`.
This ensures `simp` works with entries only when (some) entries are already given.
In other words, this notation will only appear in the output of `simp` if it
already appears in the input.
## Notations
-The main new notation is `![a, b]`, which gets expanded to `vec_cons a (vec_cons b vec_empty)`.
+The main new notation is `![a, b]`, which gets expanded to `vecCons a (vecCons b vecEmpty)`.
## Examples
@@ -60,14 +60,32 @@ def vecEmpty : Fin 0 → α :=
/-- `vecCons h t` prepends an entry `h` to a vector `t`.
The inverse functions are `vecHead` and `vecTail`.
-The notation `![a, b, ...]` expands to `vecCons a (vec_cons b ...)`.
+The notation `![a, b, ...]` expands to `vecCons a (vecCons b ...)`.
-/
def vecCons {n : ℕ} (h : α) (t : Fin n → α) : Fin n.succ → α :=
Fin.cons h t
#align matrix.vec_cons Matrix.vecCons
/-- Construct a vector `Fin n → α` using `Matrix.vecEmpty` and `Matrix.vecCons`. -/
-notation3"!["(l", "* => foldr (h t => vecCons h t) vecEmpty)"]" => l
+syntax (name := vecNotation) "![" term,* "]" : term
+
+macro_rules
+ | `(![$term:term, $terms:term,*]) => `(vecCons $term ![$terms,*])
+ | `(![$term:term]) => `(vecCons $term ![])
+ | `(![]) => `(vecEmpty)
+
+/-- Unexpander for the `![x, y, ...]` notation. -/
+@[app_unexpander vecCons]
+def vecConsUnexpander : Lean.PrettyPrinter.Unexpander
+ | `($_ $term ![$term2, $terms,*]) => `(![$term, $term2, $terms,*])
+ | `($_ $term ![$term2]) => `(![$term, $term2])
+ | `($_ $term ![]) => `(![$term])
+ | _ => throw ()
+
+/-- Unexpander for the `![]` notation. -/
+@[app_unexpander vecEmpty]
+def vecEmptyUnexpander : Lean.PrettyPrinter.Unexpander
+ | _ => `(![])
/-- `vecHead v` gives the first entry of the vector `v` -/
def vecHead {n : ℕ} (v : Fin n.succ → α) : α :=
@@ -81,7 +99,7 @@ def vecTail {n : ℕ} (v : Fin n.succ → α) : Fin n → α :=
variable {m n : ℕ}
-/-- Use `![...]` notation for displaying a vector `fin n → α`, for example:
+/-- Use `![...]` notation for displaying a vector `Fin n → α`, for example:
```
#eval ![1, 2] + ![3, 4] -- ![4, 6]
@@ -183,7 +201,7 @@ theorem vec_single_eq_const (a : α) : ![a] = fun _ => a :=
/-- `![a, b, ...] 1` is equal to `b`.
The simplifier needs a special lemma for length `≥ 2`, in addition to
- `cons_val_succ`, because `1 : fin 1 = 0 : fin 1`.
+ `cons_val_succ`, because `1 : Fin 1 = 0 : Fin 1`.
-/
@[simp]
theorem cons_val_one (x : α) (u : Fin m.succ → α) : vecCons x u 1 = vecHead u := by
@@ -225,13 +243,13 @@ protected instance _root_.PiFin.toExpr [ToLevel.{u}] [ToExpr α] (n : ℕ) : ToE
-- | n + 1, v => ``(vecCons $(v 0) $(_root_.pi_fin.to_pexpr <| vecTail v))
-- #align pi_fin.to_pexpr pi_fin.to_pexpr
-/-! ### Numeral (`bit0` and `bit1`) indices
-The following definitions and `simp` lemmas are to allow any
+/-! ### `bit0` and `bit1` indices
+The following definitions and `simp` lemmas are used to allow
numeral-indexed element of a vector given with matrix notation to
-be extracted by `simp` (even when the numeral is larger than the
+be extracted by `simp` in Lean 3 (even when the numeral is larger than the
number of elements in the vector, which is taken modulo that number
of elements by virtue of the semantics of `bit0` and `bit1` and of
-addition on `fin n`).
+addition on `Fin n`).
-/
@@ -241,7 +259,7 @@ which provides control of definitional equality for the vector length.
This turns out to be helpful when providing simp lemmas to reduce `![a, b, c] n`, and also means
that `vecAppend ho u v 0` is valid. `Fin.append u v 0` is not valid in this case because there is
-no `Zero (fin (m + n))` instance. -/
+no `Zero (Fin (m + n))` instance. -/
def vecAppend {α : Type _} {o : ℕ} (ho : o = m + n) (u : Fin m → α) (v : Fin n → α) : Fin o → α :=
Fin.append u v ∘ Fin.cast ho
#align matrix.vec_append Matrix.vecAppend
pi_fin.reflect
instance (#3430)
This was skipped during the initial port of this file.
There are some golfing discussions here on Zulip that we could revisit later
Co-authored-by: Gabriel Ebner <gebner@gebner.org>
@@ -11,6 +11,8 @@ Authors: Anne Baanen
import Mathlib.Data.Fin.Tuple.Basic
import Mathlib.Data.List.Range
import Mathlib.GroupTheory.GroupAction.Pi
+import Mathlib.Tactic.ToExpr
+import Qq
/-!
# Matrix and vector notation
@@ -199,31 +201,23 @@ theorem cons_fin_one (x : α) (u : Fin 0 → α) : vecCons x u = fun _ => x :=
funext (cons_val_fin_one x u)
#align matrix.cons_fin_one Matrix.cons_fin_one
--- Porting note: the next two decls are commented out. TODO(eric-wieser)
-
--- /- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:76:14:
--- unsupported tactic `reflect_name #[] -/
--- /- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:76:14:
--- unsupported tactic `reflect_name #[] -/
--- unsafe instance _root_.pi_fin.reflect [reflected_univ.{u}] [reflected _ α] [has_reflect α] :
--- ∀ {n}, has_reflect (Fin n → α)
--- | 0, v =>
--- (Subsingleton.elim vecEmpty v).rec
--- ((by
--- trace
--- "./././Mathport/Syntax/Translate/Tactic/Builtin.lean:76:14:
--- unsupported tactic `reflect_name #[]" :
--- reflected _ @vecEmpty.{u}).subst
--- q(α))
--- | n + 1, v =>
--- (cons_head_tail v).rec <|
--- (by
--- trace
--- "./././Mathport/Syntax/Translate/Tactic/Builtin.lean:76:14:
--- unsupported tactic `reflect_name #[]" :
--- reflected _ @vecCons.{u}).subst₄
--- q(α) q(n) q(_) (_root_.pi_fin.reflect _)
--- #align pi_fin.reflect pi_fin.reflect
+open Lean in
+open Qq in
+protected instance _root_.PiFin.toExpr [ToLevel.{u}] [ToExpr α] (n : ℕ) : ToExpr (Fin n → α) :=
+ have lu := toLevel.{u}
+ have eα : Q(Type $lu) := toTypeExpr α
+ have toTypeExpr := q(Fin $n → $eα)
+ match n with
+ | 0 => { toTypeExpr, toExpr := fun _ => q(@vecEmpty $eα) }
+ | n + 1 =>
+ { toTypeExpr, toExpr := fun v =>
+ have := PiFin.toExpr n
+ have eh : Q($eα) := toExpr (vecHead v)
+ have et : Q(Fin $n → $eα) := toExpr (vecTail v)
+ q(vecCons $eh $et) }
+#align pi_fin.reflect PiFin.toExpr
+
+-- Porting note: the next decl is commented out. TODO(eric-wieser)
-- /-- Convert a vector of pexprs to the pexpr constructing that vector.-/
-- unsafe def _root_.pi_fin.to_pexpr : ∀ {n}, (Fin n → pexpr) → pexpr
The unported dependencies are