data.array.lemmasMathlib.Data.Array.Lemmas

This file has been ported!

Changes since the initial port

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

Changes in mathlib3

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(last sync)

Changes in mathlib3port

mathlib3
mathlib3port
Diff
@@ -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
Diff
@@ -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"
 
Diff
@@ -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
Diff
@@ -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
Diff
@@ -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
Diff
@@ -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
Diff
@@ -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
 
Diff
@@ -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₃]
Diff
@@ -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
 
Diff
@@ -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
Diff
@@ -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
 
Diff
@@ -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

Changes in mathlib4

mathlib3
mathlib4
chore: split insertNth lemmas from List.Basic (#11542)

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.

Diff
@@ -337,4 +337,3 @@ section Map₂
 end Map₂
 
 end Array'
-
chore(Init/Fin): deprecate 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.

Diff
@@ -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
 
chore: script to replace headers with #align_import statements (#5979)

Open in Gitpod

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

Diff
@@ -2,15 +2,12 @@
 Copyright (c) 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-
feat: port Data.Array.Lemmas (#5821)

Dependencies 1 + 99

100 files ported (99.0%)
50397 lines ported (99.8%)
Show graph

The unported dependencies are