@@ -207,22 +207,22 @@ theorem toArray_mk {xs : Array α} (h : xs.size = n) : (Vector.mk xs h).toArray
207207 (Vector.mk xs h).reverse = Vector.mk xs.reverse (by simp [h]) := rfl
208208
209209@[simp] theorem set_mk {xs : Array α} (h : xs.size = n) {i x} (w) :
210- (Vector.mk xs h).set i x = Vector.mk (xs.set i x) (by simp [h]) := rfl
210+ (Vector.mk xs h).set i x w = Vector.mk (xs.set i x) (by simp [h]) := rfl
211211
212212@[simp] theorem set !_mk {xs : Array α} (h : xs.size = n) {i x} :
213213 (Vector.mk xs h).set! i x = Vector.mk (xs.set! i x) (by simp [h]) := rfl
214214
215215@[simp] theorem setIfInBounds_mk {xs : Array α} (h : xs.size = n) {i x} :
216216 (Vector.mk xs h).setIfInBounds i x = Vector.mk (xs.setIfInBounds i x) (by simp [h]) := rfl
217217
218- @[simp] theorem swap_mk {xs : Array α} (h : xs.size = n) {i j} (hi hj ) :
218+ @[simp] theorem swap_mk {xs : Array α} (h : xs.size = n) {i j} (hi : i < n) (hj : j < n ) :
219219 (Vector.mk xs h).swap i j = Vector.mk (xs.swap i j) (by simp [h]) :=
220220 rfl
221221
222222@[simp] theorem swapIfInBounds_mk {xs : Array α} (h : xs.size = n) {i j} :
223223 (Vector.mk xs h).swapIfInBounds i j = Vector.mk (xs.swapIfInBounds i j) (by simp [h]) := rfl
224224
225- @[simp] theorem swapAt_mk {xs : Array α} (h : xs.size = n) {i x} (hi) :
225+ @[simp] theorem swapAt_mk {xs : Array α} (h : xs.size = n) {i x} (hi : i < n ) :
226226 (Vector.mk xs h).swapAt i x =
227227 ((xs.swapAt i x).fst, Vector.mk (xs.swapAt i x).snd (by simp [h])) :=
228228 rfl
@@ -382,7 +382,7 @@ private theorem toArray_mapM_go [Monad m] [LawfulMonad m] {f : α → m β} {xs
382382
383383@[simp, grind =] theorem toArray_reverse (xs : Vector α n) : xs.reverse.toArray = xs.toArray.reverse := rfl
384384
385- @[simp, grind =] theorem toArray_set {xs : Vector α n} {i x} (h) :
385+ @[simp, grind =] theorem toArray_set {xs : Vector α n} {i x} (h : i < n ) :
386386 (xs.set i x).toArray = xs.toArray.set i x (by simpa using h):= rfl
387387
388388@[simp, grind =] theorem toArray_set ! {xs : Vector α n} {i x} :
@@ -393,13 +393,13 @@ private theorem toArray_mapM_go [Monad m] [LawfulMonad m] {f : α → m β} {xs
393393
394394@[simp, grind =] theorem toArray_singleton {x : α} : (Vector.singleton x).toArray = #[x] := rfl
395395
396- @[simp, grind =] theorem toArray_swap {xs : Vector α n} {i j} (hi hj ) : (xs.swap i j).toArray =
397- xs.toArray.swap i j (by simp [hj ]) (by simp [hi ]) := rfl
396+ @[simp, grind =] theorem toArray_swap {xs : Vector α n} {i j} (hi : i < n) (hj : j < n ) : (xs.swap i j).toArray =
397+ xs.toArray.swap i j (by simp [hi ]) (by simp [hj ]) := rfl
398398
399399@[simp, grind =] theorem toArray_swapIfInBounds {xs : Vector α n} {i j} :
400400 (xs.swapIfInBounds i j).toArray = xs.toArray.swapIfInBounds i j := rfl
401401
402- theorem toArray_swapAt {xs : Vector α n} {i x} (h) :
402+ theorem toArray_swapAt {xs : Vector α n} {i x} (h : i < n ) :
403403 ((xs.swapAt i x).fst, (xs.swapAt i x).snd.toArray) =
404404 ((xs.toArray.swapAt i x (by simpa using h)).fst,
405405 (xs.toArray.swapAt i x (by simpa using h)).snd) := rfl
@@ -630,7 +630,7 @@ theorem toList_range : (Vector.range n).toList = List.range n := by simp [toList
630630
631631@[simp] theorem toList_reverse {xs : Vector α n} : xs.reverse.toList = xs.toList.reverse := by simp [toList]
632632
633- theorem toList_set {xs : Vector α n} {i x} (h) :
633+ theorem toList_set {xs : Vector α n} {i x} (h : i < n ) :
634634 (xs.set i x).toList = xs.toList.set i x := rfl
635635
636636@[simp] theorem toList_setIfInBounds {xs : Vector α n} {i x} :
@@ -639,7 +639,7 @@ theorem toList_set {xs : Vector α n} {i x} (h) :
639639
640640theorem toList_singleton {x : α} : (Vector.singleton x).toList = [x] := rfl
641641
642- theorem toList_swap {xs : Vector α n} {i j} (hi hj ) :
642+ theorem toList_swap {xs : Vector α n} {i j} (hi : i < n) (hj : j < n ) :
643643 (xs.swap i j).toList = (xs.toList.set i xs[j]).set j xs[i] := rfl
644644
645645@[simp] theorem toList_take {xs : Vector α n} {i} : (xs.take i).toList = xs.toList.take i := by
@@ -1074,21 +1074,21 @@ theorem getElem_of_mem {a} {xs : Vector α n} (h : a ∈ xs) : ∃ (i : Nat) (h
10741074 simpa using Array.getElem_of_mem (by simpa using h)
10751075
10761076theorem getElem ?_of_mem {a} {xs : Vector α n} (h : a ∈ xs) : ∃ i : Nat, xs[i]? = some a :=
1077- let ⟨n, _ , e⟩ := getElem_of_mem h; ⟨n, e ▸ getElem?_eq_getElem _ ⟩
1077+ let ⟨n, hn , e⟩ := getElem_of_mem h; ⟨n, e ▸ getElem?_eq_getElem hn ⟩
10781078
1079- theorem mem_of_getElem {xs : Vector α n} {i : Nat} {h} {a : α} (e : xs[i] = a) : a ∈ xs := by
1079+ theorem mem_of_getElem {xs : Vector α n} {i : Nat} {h : i < n } {a : α} (e : xs[i] = a) : a ∈ xs := by
10801080 subst e
10811081 simp
10821082
10831083theorem mem_of_getElem ? {xs : Vector α n} {i : Nat} {a : α} (e : xs[i]? = some a) : a ∈ xs :=
1084- let ⟨_ , e⟩ := getElem?_eq_some_iff.1 e; e ▸ getElem_mem ..
1084+ let ⟨w , e⟩ := getElem?_eq_some_iff.1 e; e ▸ getElem_mem w
10851085
10861086theorem mem_of_back ? {xs : Vector α n} {a : α} (h : xs.back? = some a) : a ∈ xs := by
10871087 cases xs
10881088 simpa using Array.mem_of_back? (by simpa using h)
10891089
10901090theorem mem_iff_getElem {a} {xs : Vector α n} : a ∈ xs ↔ ∃ (i : Nat) (h : i < n), xs[i]'h = a :=
1091- ⟨getElem_of_mem, fun ⟨_, _ , e⟩ => e ▸ getElem_mem .. ⟩
1091+ ⟨getElem_of_mem, fun ⟨_, w , e⟩ => e ▸ getElem_mem w ⟩
10921092
10931093theorem mem_iff_getElem ? {a} {xs : Vector α n} : a ∈ xs ↔ ∃ i : Nat, xs[i]? = some a := by
10941094 simp [getElem?_eq_some_iff, mem_iff_getElem]
@@ -1327,7 +1327,7 @@ instance [BEq α] [LawfulBEq α] (a : α) (as : Vector α n) : Decidable (a ∈
13271327 simp
13281328
13291329theorem set_push {xs : Vector α n} {x y : α} {h} :
1330- (xs.push x).set i y = if _ : i < n then (xs.set i y).push x else xs.push y := by
1330+ (xs.push x).set i y h = if _ : i < n then (xs.set i y).push x else xs.push y := by
13311331 rcases xs with ⟨xs, rfl⟩
13321332 simp only [push_mk, set_mk, Array.set_push]
13331333 split <;> simp
0 commit comments