data.array.lemmas
⟷
Mathlib.Data.Array.Lemmas
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)
(last sync)
mathlib commit https://github.com/leanprover-community/mathlib/commit/65a1391a0106c9204fe45bc73a039f056558cb83
@@ -71,11 +71,11 @@ theorem mem_rev_list_aux :
⟨fun ⟨j, ji1, e⟩ =>
Or.elim (lt_or_eq_of_le <| Nat.le_of_succ_le_succ ji1)
(fun ji => List.mem_cons_of_mem _ <| IH.1 ⟨j, ji, e⟩) fun je => by
- simp [DArray.iterateAux] <;> apply Or.inl <;> unfold read at e <;>
+ simp [DArray.iterateAux] <;> apply Or.inl <;> unfold read at e <;>
have H : j = ⟨i, h⟩ := Fin.eq_of_veq je <;>
rwa [← H, e],
fun m => by
- simp [DArray.iterateAux, List.Mem] at m
+ simp [DArray.iterateAux, List.Mem] at m
cases' m with e m'
exact ⟨⟨i, h⟩, Nat.lt_succ_self _, Eq.symm e⟩
exact
mathlib commit https://github.com/leanprover-community/mathlib/commit/ce64cd319bb6b3e82f31c2d38e79080d377be451
@@ -3,8 +3,8 @@ Copyright (c) 2017 Microsoft Corporation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Leonardo de Moura, Mario Carneiro
-/
-import Mathbin.Data.Fin.Basic
-import Mathbin.Data.List.Basic
+import Data.Fin.Basic
+import Data.List.Basic
#align_import data.array.lemmas from "leanprover-community/mathlib"@"f0c8bf9245297a541f468be517f1bde6195105e9"
mathlib commit https://github.com/leanprover-community/mathlib/commit/8ea5598db6caeddde6cb734aa179cc2408dbd345
@@ -2,15 +2,12 @@
Copyright (c) 2017 Microsoft Corporation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Leonardo de Moura, Mario Carneiro
-
-! This file was ported from Lean 3 source module data.array.lemmas
-! leanprover-community/mathlib commit f0c8bf9245297a541f468be517f1bde6195105e9
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
-/
import Mathbin.Data.Fin.Basic
import Mathbin.Data.List.Basic
+#align_import data.array.lemmas from "leanprover-community/mathlib"@"f0c8bf9245297a541f468be517f1bde6195105e9"
+
universe u v w
namespace DArray
mathlib commit https://github.com/leanprover-community/mathlib/commit/2fe465deb81bcd7ccafa065bb686888a82f15372
@@ -284,7 +284,8 @@ theorem read_pushBack_left (i : Fin n) : (a.pushBack v).read i.cast_succ = a.rea
by
cases' i with i hi
have : ¬i = n := ne_of_lt hi
- simp [push_back, this, Fin.castSuccEmb, Fin.castAdd, Fin.castLE, Fin.castLT, read, DArray.read]
+ simp [push_back, this, Fin.castSuccEmb, Fin.castAddEmb, Fin.castLEEmb, Fin.castLT, read,
+ DArray.read]
#align array.read_push_back_left Array'.read_pushBack_left
@[simp]
@@ -292,7 +293,8 @@ theorem read_pushBack_right : (a.pushBack v).read (Fin.last _) = v :=
by
cases' hn : Fin.last n with k hk
have : k = n := by simpa [Fin.eq_iff_veq] using hn.symm
- simp [push_back, this, Fin.castSuccEmb, Fin.castAdd, Fin.castLE, Fin.castLT, read, DArray.read]
+ simp [push_back, this, Fin.castSuccEmb, Fin.castAddEmb, Fin.castLEEmb, Fin.castLT, read,
+ DArray.read]
#align array.read_push_back_right Array'.read_pushBack_right
end PushBack
mathlib commit https://github.com/leanprover-community/mathlib/commit/5dc6092d09e5e489106865241986f7f2ad28d4c8
@@ -284,7 +284,7 @@ theorem read_pushBack_left (i : Fin n) : (a.pushBack v).read i.cast_succ = a.rea
by
cases' i with i hi
have : ¬i = n := ne_of_lt hi
- simp [push_back, this, Fin.castSucc, Fin.castAdd, Fin.castLE, Fin.castLT, read, DArray.read]
+ simp [push_back, this, Fin.castSuccEmb, Fin.castAdd, Fin.castLE, Fin.castLT, read, DArray.read]
#align array.read_push_back_left Array'.read_pushBack_left
@[simp]
@@ -292,7 +292,7 @@ theorem read_pushBack_right : (a.pushBack v).read (Fin.last _) = v :=
by
cases' hn : Fin.last n with k hk
have : k = n := by simpa [Fin.eq_iff_veq] using hn.symm
- simp [push_back, this, Fin.castSucc, Fin.castAdd, Fin.castLE, Fin.castLT, read, DArray.read]
+ simp [push_back, this, Fin.castSuccEmb, Fin.castAdd, Fin.castLE, Fin.castLT, read, DArray.read]
#align array.read_push_back_right Array'.read_pushBack_right
end PushBack
mathlib commit https://github.com/leanprover-community/mathlib/commit/cca40788df1b8755d5baf17ab2f27dacc2e17acb
@@ -74,11 +74,11 @@ theorem mem_rev_list_aux :
⟨fun ⟨j, ji1, e⟩ =>
Or.elim (lt_or_eq_of_le <| Nat.le_of_succ_le_succ ji1)
(fun ji => List.mem_cons_of_mem _ <| IH.1 ⟨j, ji, e⟩) fun je => by
- simp [DArray.iterateAux] <;> apply Or.inl <;> unfold read at e <;>
+ simp [DArray.iterateAux] <;> apply Or.inl <;> unfold read at e <;>
have H : j = ⟨i, h⟩ := Fin.eq_of_veq je <;>
rwa [← H, e],
fun m => by
- simp [DArray.iterateAux, List.Mem] at m
+ simp [DArray.iterateAux, List.Mem] at m
cases' m with e m'
exact ⟨⟨i, h⟩, Nat.lt_succ_self _, Eq.symm e⟩
exact
mathlib commit https://github.com/leanprover-community/mathlib/commit/cca40788df1b8755d5baf17ab2f27dacc2e17acb
@@ -229,7 +229,7 @@ section ToArray
variable {n : ℕ} {α : Type u}
@[simp]
-theorem toList_to_array' (a : Array' n α) : HEq a.toList.to_array a :=
+theorem toList_toArray (a : Array' n α) : HEq a.toList.toArray a :=
hEq_of_hEq_of_eq
(@Eq.drecOn
(fun m (e : a.toList.length = m) =>
@@ -237,12 +237,12 @@ theorem toList_to_array' (a : Array' n α) : HEq a.toList.to_array a :=
(@DArray.mk m (fun _ => α) fun v => a.toList.nthLe v.1 <| e.symm ▸ v.2))
a.toList_length HEq.rfl) <|
DArray.ext fun ⟨i, h⟩ => toList_nthLe i h _
-#align array.to_list_to_array Array'.toList_to_array'
+#align array.to_list_to_array Array'.toList_toArray
@[simp]
-theorem to_array_toList (l : List α) : l.to_array.toList = l :=
+theorem toArray_toList (l : List α) : l.toArray.toList = l :=
List.ext_nthLe (toList_length _) fun n h1 h2 => toList_nthLe _ h2 _
-#align array.to_array_to_list Array'.to_array_toList
+#align array.to_array_to_list Array'.toArray_toList
end ToArray
mathlib commit https://github.com/leanprover-community/mathlib/commit/917c3c072e487b3cccdbfeff17e75b40e45f66cb
@@ -202,7 +202,7 @@ theorem write_toList {i v} : (a.write i v).toList = a.toList.set i v :=
let ⟨_, e⟩ := List.get?_eq_some'.1 _
e.symm
by_cases ij : (i : ℕ) = j
- · subst j
+ · subst j;
rw [show (⟨(i : ℕ), h₃⟩ : Fin _) = i from Fin.eq_of_veq rfl, Array'.read_write,
List.get?_set_eq_of_lt]
simp [h₃]
mathlib commit https://github.com/leanprover-community/mathlib/commit/738054fa93d43512da144ec45ce799d18fd44248
@@ -4,12 +4,12 @@ Released under Apache 2.0 license as described in the file LICENSE.
Authors: Leonardo de Moura, Mario Carneiro
! This file was ported from Lean 3 source module data.array.lemmas
-! leanprover-community/mathlib commit 78314d08d707a6338079f00094bbdb90bf11fc41
+! leanprover-community/mathlib commit f0c8bf9245297a541f468be517f1bde6195105e9
! Please do not edit these lines, except to modify the commit id
! if you have ported upstream changes.
-/
-import Mathbin.Control.Traversable.Equiv
-import Mathbin.Data.Vector.Basic
+import Mathbin.Data.Fin.Basic
+import Mathbin.Data.List.Basic
universe u v w
mathlib commit https://github.com/leanprover-community/mathlib/commit/039ef89bef6e58b32b62898dd48e9d1a4312bb65
@@ -284,7 +284,7 @@ theorem read_pushBack_left (i : Fin n) : (a.pushBack v).read i.cast_succ = a.rea
by
cases' i with i hi
have : ¬i = n := ne_of_lt hi
- simp [push_back, this, Fin.castSucc, Fin.castAdd, Fin.castLe, Fin.castLT, read, DArray.read]
+ simp [push_back, this, Fin.castSucc, Fin.castAdd, Fin.castLE, Fin.castLT, read, DArray.read]
#align array.read_push_back_left Array'.read_pushBack_left
@[simp]
@@ -292,7 +292,7 @@ theorem read_pushBack_right : (a.pushBack v).read (Fin.last _) = v :=
by
cases' hn : Fin.last n with k hk
have : k = n := by simpa [Fin.eq_iff_veq] using hn.symm
- simp [push_back, this, Fin.castSucc, Fin.castAdd, Fin.castLe, Fin.castLT, read, DArray.read]
+ simp [push_back, this, Fin.castSucc, Fin.castAdd, Fin.castLE, Fin.castLT, read, DArray.read]
#align array.read_push_back_right Array'.read_pushBack_right
end PushBack
mathlib commit https://github.com/leanprover-community/mathlib/commit/e05ead7993520a432bec94ac504842d90707ad63
@@ -229,7 +229,7 @@ section ToArray
variable {n : ℕ} {α : Type u}
@[simp]
-theorem toList_toArray (a : Array' n α) : HEq a.toList.toArray a :=
+theorem toList_to_array' (a : Array' n α) : HEq a.toList.to_array a :=
hEq_of_hEq_of_eq
(@Eq.drecOn
(fun m (e : a.toList.length = m) =>
@@ -237,12 +237,12 @@ theorem toList_toArray (a : Array' n α) : HEq a.toList.toArray a :=
(@DArray.mk m (fun _ => α) fun v => a.toList.nthLe v.1 <| e.symm ▸ v.2))
a.toList_length HEq.rfl) <|
DArray.ext fun ⟨i, h⟩ => toList_nthLe i h _
-#align array.to_list_to_array Array'.toList_toArray
+#align array.to_list_to_array Array'.toList_to_array'
@[simp]
-theorem toArray_toList (l : List α) : l.toArray.toList = l :=
+theorem to_array_toList (l : List α) : l.to_array.toList = l :=
List.ext_nthLe (toList_length _) fun n h1 h2 => toList_nthLe _ h2 _
-#align array.to_array_to_list Array'.toArray_toList
+#align array.to_array_to_list Array'.to_array_toList
end ToArray
mathlib commit https://github.com/leanprover-community/mathlib/commit/5ec62c8106221a3f9160e4e4fcc3eed79fe213e9
@@ -284,7 +284,7 @@ theorem read_pushBack_left (i : Fin n) : (a.pushBack v).read i.cast_succ = a.rea
by
cases' i with i hi
have : ¬i = n := ne_of_lt hi
- simp [push_back, this, Fin.castSucc, Fin.castAdd, Fin.castLe, Fin.castLt, read, DArray.read]
+ simp [push_back, this, Fin.castSucc, Fin.castAdd, Fin.castLe, Fin.castLT, read, DArray.read]
#align array.read_push_back_left Array'.read_pushBack_left
@[simp]
@@ -292,7 +292,7 @@ theorem read_pushBack_right : (a.pushBack v).read (Fin.last _) = v :=
by
cases' hn : Fin.last n with k hk
have : k = n := by simpa [Fin.eq_iff_veq] using hn.symm
- simp [push_back, this, Fin.castSucc, Fin.castAdd, Fin.castLe, Fin.castLt, read, DArray.read]
+ simp [push_back, this, Fin.castSucc, Fin.castAdd, Fin.castLe, Fin.castLT, read, DArray.read]
#align array.read_push_back_right Array'.read_pushBack_right
end PushBack
mathlib commit https://github.com/leanprover-community/mathlib/commit/bd9851ca476957ea4549eb19b40e7b5ade9428cc
Removes the insertNth
section of this long file to its own new file. This section seems to be completely independent of the rest of the file, so this is a fairly easy split to make.
@@ -337,4 +337,3 @@ section Map₂
end Map₂
end Array'
-
Fin.eq_of_veq
and Fin.veq_of_eq
(#10626)
We have Fin.eq_of_val_eq
and Fin.val_eq_of_eq
in Lean core now.
Also slightly shake the tree.
@@ -295,7 +295,7 @@ section PushBack
-- @[simp]
-- theorem read_pushBack_right : (a.pushBack v).read (Fin.last _) = v := by
-- cases' hn : Fin.last n with k hk
--- have : k = n := by simpa [Fin.eq_iff_veq] using hn.symm
+-- have : k = n := by simpa [Fin.ext_iff] using hn.symm
-- simp [push_back, this, Fin.castSucc, Fin.castAdd, Fin.castLe, Fin.castLt, read, DArray.read]
#noalign array.read_push_back_right -- Array'.read_pushBack_right
@@ -2,15 +2,12 @@
Copyright (c) 2017 Microsoft Corporation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Leonardo de Moura, Mario Carneiro
-
-! This file was ported from Lean 3 source module data.array.lemmas
-! leanprover-community/mathlib commit f0c8bf9245297a541f468be517f1bde6195105e9
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
-/
import Mathlib.Data.Fin.Basic
import Mathlib.Data.List.Basic
+#align_import data.array.lemmas from "leanprover-community/mathlib"@"f0c8bf9245297a541f468be517f1bde6195105e9"
+
/-!
Porting note:
Following the discussion on [Zulip](https://leanprover.zulipchat.com/#narrow/stream/287929-