@@ -142,9 +142,9 @@ abbrev findSome?_mkArray_of_isNone := @findSome?_replicate_of_isNone
142142
143143@[simp] theorem find ?_empty : find? p #[] = none := rfl
144144
145- @[simp] theorem find ?_singleton {a : α} {p : α → Bool} :
145+ theorem find ?_singleton {a : α} {p : α → Bool} :
146146 #[a].find? p = if p a then some a else none := by
147- simp [singleton_eq_toArray_singleton]
147+ simp
148148
149149@[simp] theorem findRev ?_push_of_pos {xs : Array α} (h : p a) :
150150 findRev? p (xs.push a) = some a := by
@@ -347,7 +347,8 @@ theorem find?_eq_some_iff_getElem {xs : Array α} {p : α → Bool} {b : α} :
347347
348348/-! ### findIdx -/
349349
350- @[simp] theorem findIdx_empty : findIdx p #[] = 0 := rfl
350+ theorem findIdx_empty : findIdx p #[] = 0 := rfl
351+
351352theorem findIdx_singleton {a : α} {p : α → Bool} :
352353 #[a].findIdx p = if p a then 0 else 1 := by
353354 simp
@@ -600,7 +601,8 @@ theorem findIdx?_eq_some_le_of_findIdx?_eq_some {xs : Array α} {p q : α → Bo
600601
601602/-! ### findFinIdx? -/
602603
603- @[simp] theorem findFinIdx ?_empty {p : α → Bool} : findFinIdx? p #[] = none := by simp
604+ theorem findFinIdx ?_empty {p : α → Bool} : findFinIdx? p #[] = none := by simp
605+
604606theorem findFinIdx ?_singleton {a : α} {p : α → Bool} :
605607 #[a].findFinIdx? p = if p a then some ⟨0 , by simp⟩ else none := by
606608 simp
@@ -699,7 +701,7 @@ The verification API for `idxOf?` is still incomplete.
699701The lemmas below should be made consistent with those for `findIdx?` (and proved using them).
700702-/
701703
702- @[simp] theorem idxOf ?_empty [BEq α] : (#[] : Array α).idxOf? a = none := by simp
704+ theorem idxOf ?_empty [BEq α] : (#[] : Array α).idxOf? a = none := by simp
703705
704706@[simp] theorem idxOf ?_eq_none_iff [BEq α] [LawfulBEq α] {xs : Array α} {a : α} :
705707 xs.idxOf? a = none ↔ a ∉ xs := by
@@ -712,14 +714,10 @@ theorem isSome_idxOf? [BEq α] [LawfulBEq α] {xs : Array α} {a : α} :
712714 rcases xs with ⟨xs⟩
713715 simp
714716
715- @[simp]
716717theorem isNone_idxOf ? [BEq α] [LawfulBEq α] {xs : Array α} {a : α} :
717718 (xs.idxOf? a).isNone = ¬ a ∈ xs := by
718- rcases xs with ⟨xs⟩
719719 simp
720720
721-
722-
723721/-! ### finIdxOf?
724722
725723The verification API for `finIdxOf?` is still incomplete.
@@ -730,7 +728,7 @@ theorem idxOf?_eq_map_finIdxOf?_val [BEq α] {xs : Array α} {a : α} :
730728 xs.idxOf? a = (xs.finIdxOf? a).map (·.val) := by
731729 simp [idxOf?, finIdxOf?, findIdx?_eq_map_findFinIdx?_val]
732730
733- @[simp] theorem finIdxOf ?_empty [BEq α] : (#[] : Array α).finIdxOf? a = none := by simp
731+ theorem finIdxOf ?_empty [BEq α] : (#[] : Array α).finIdxOf? a = none := by simp
734732
735733@[simp] theorem finIdxOf ?_eq_none_iff [BEq α] [LawfulBEq α] {xs : Array α} {a : α} :
736734 xs.finIdxOf? a = none ↔ a ∉ xs := by
@@ -748,10 +746,8 @@ theorem isSome_finIdxOf? [BEq α] [LawfulBEq α] {xs : Array α} {a : α} :
748746 rcases xs with ⟨xs⟩
749747 simp
750748
751- @[simp]
752749theorem isNone_finIdxOf ? [BEq α] [LawfulBEq α] {xs : Array α} {a : α} :
753750 (xs.finIdxOf? a).isNone = ¬ a ∈ xs := by
754- rcases xs with ⟨xs⟩
755751 simp
756752
757753end Array
0 commit comments