Skip to content

Commit d548ce2

Browse files
committed
cleanup for simpNF linter
1 parent f3d1653 commit d548ce2

29 files changed

+189
-231
lines changed

src/Init/Data/Array/Count.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ theorem countP_push {a : α} {xs : Array α} : countP p (xs.push a) = countP p x
5252
rcases xs with ⟨xs⟩
5353
simp_all
5454

55-
@[simp] theorem countP_singleton {a : α} : countP p #[a] = if p a then 1 else 0 := by
56-
simp [countP_push]
55+
theorem countP_singleton {a : α} : countP p #[a] = if p a then 1 else 0 := by
56+
simp
5757

5858
theorem size_eq_countP_add_countP {xs : Array α} : xs.size = countP p xs + countP (fun a => ¬p a) xs := by
5959
rcases xs with ⟨xs⟩

src/Init/Data/Array/Erase.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ open Nat
2424

2525
/-! ### eraseP -/
2626

27-
@[simp] theorem eraseP_empty : #[].eraseP p = #[] := by simp
27+
theorem eraseP_empty : #[].eraseP p = #[] := by simp
2828

2929
theorem eraseP_of_forall_mem_not {xs : Array α} (h : ∀ a, a ∈ xs → ¬p a) : xs.eraseP p = xs := by
3030
rcases xs with ⟨xs⟩

src/Init/Data/Array/Extract.lean

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -238,11 +238,9 @@ theorem extract_append_left {as bs : Array α} :
238238
(as ++ bs).extract 0 as.size = as.extract 0 as.size := by
239239
simp
240240

241-
@[simp] theorem extract_append_right {as bs : Array α} :
241+
theorem extract_append_right {as bs : Array α} :
242242
(as ++ bs).extract as.size (as.size + i) = bs.extract 0 i := by
243-
simp only [extract_append, extract_size_left, Nat.sub_self, empty_append]
244-
congr 1
245-
omega
243+
simp
246244

247245
@[simp] theorem map_extract {as : Array α} {i j : Nat} :
248246
(as.extract i j).map f = (as.map f).extract i j := by

src/Init/Data/Array/Find.lean

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -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+
351352
theorem 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+
604606
theorem 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.
699701
The 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]
716717
theorem 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
725723
The 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]
752749
theorem isNone_finIdxOf? [BEq α] [LawfulBEq α] {xs : Array α} {a : α} :
753750
(xs.finIdxOf? a).isNone = ¬ a ∈ xs := by
754-
rcases xs with ⟨xs⟩
755751
simp
756752

757753
end Array

src/Init/Data/Array/Lemmas.lean

Lines changed: 38 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -140,13 +140,13 @@ theorem getElem_of_getElem? {xs : Array α} : xs[i]? = some a → ∃ h : i < xs
140140
theorem some_eq_getElem?_iff {xs : Array α} : some b = xs[i]? ↔ ∃ h : i < xs.size, xs[i] = b := by
141141
rw [eq_comm, getElem?_eq_some_iff]
142142

143-
@[simp] theorem some_getElem_eq_getElem?_iff (xs : Array α) (i : Nat) (h : i < xs.size) :
143+
theorem some_getElem_eq_getElem?_iff (xs : Array α) (i : Nat) (h : i < xs.size) :
144144
(some xs[i] = xs[i]?) ↔ True := by
145-
simp [h]
145+
simp
146146

147-
@[simp] theorem getElem?_eq_some_getElem_iff (xs : Array α) (i : Nat) (h : i < xs.size) :
147+
theorem getElem?_eq_some_getElem_iff (xs : Array α) (i : Nat) (h : i < xs.size) :
148148
(xs[i]? = some xs[i]) ↔ True := by
149-
simp [h]
149+
simp
150150

151151
theorem getElem_eq_iff {xs : Array α} {i : Nat} {h : i < xs.size} : xs[i] = x ↔ xs[i]? = some x := by
152152
simp only [getElem?_eq_some_iff]
@@ -186,12 +186,11 @@ theorem getElem?_push {xs : Array α} {x} : (xs.push x)[i]? = if i = xs.size the
186186
simp [getElem?_def, getElem_push]
187187
(repeat' split) <;> first | rfl | omega
188188

189-
@[simp] theorem getElem?_push_size {xs : Array α} {x} : (xs.push x)[xs.size]? = some x := by
190-
simp [getElem?_push]
189+
theorem getElem?_push_size {xs : Array α} {x} : (xs.push x)[xs.size]? = some x := by
190+
simp
191191

192-
@[simp] theorem getElem_singleton {a : α} {i : Nat} (h : i < 1) : #[a][i] = a :=
193-
match i, h with
194-
| 0, _ => rfl
192+
theorem getElem_singleton {a : α} {i : Nat} (h : i < 1) : #[a][i] = a := by
193+
simp
195194

196195
@[grind]
197196
theorem getElem?_singleton {a : α} {i : Nat} : #[a][i]? = if i = 0 then some a else none := by
@@ -423,8 +422,7 @@ theorem eq_empty_iff_forall_not_mem {xs : Array α} : xs = #[] ↔ ∀ a, a ∉
423422
theorem eq_of_mem_singleton (h : a ∈ #[b]) : a = b := by
424423
simpa using h
425424

426-
@[simp] theorem mem_singleton {a b : α} : a ∈ #[b] ↔ a = b :=
427-
⟨eq_of_mem_singleton, (by simp [·])⟩
425+
theorem mem_singleton {a b : α} : a ∈ #[b] ↔ a = b := by simp
428426

429427
theorem forall_mem_push {p : α → Prop} {xs : Array α} {a : α} :
430428
(∀ x, x ∈ xs.push a → p x) ↔ p a ∧ ∀ x, x ∈ xs → p x := by
@@ -868,8 +866,8 @@ theorem elem_eq_mem [BEq α] [LawfulBEq α] {a : α} {xs : Array α} :
868866
@[simp, grind] theorem contains_eq_mem [BEq α] [LawfulBEq α] {a : α} {xs : Array α} :
869867
xs.contains a = decide (a ∈ xs) := by rw [← elem_eq_contains, elem_eq_mem]
870868

871-
@[simp, grind] theorem any_empty [BEq α] {p : α → Bool} : (#[] : Array α).any p = false := by simp
872-
@[simp, grind] theorem all_empty [BEq α] {p : α → Bool} : (#[] : Array α).all p = true := by simp
869+
@[grind] theorem any_empty [BEq α] {p : α → Bool} : (#[] : Array α).any p = false := by simp
870+
@[grind] theorem all_empty [BEq α] {p : α → Bool} : (#[] : Array α).all p = true := by simp
873871

874872
/-- Variant of `any_push` with a side condition on `stop`. -/
875873
@[simp, grind] theorem any_push' [BEq α] {xs : Array α} {a : α} {p : α → Bool} (h : stop = xs.size + 1) :
@@ -1228,7 +1226,7 @@ where
12281226
@[simp] theorem mapM_empty [Monad m] (f : α → m β) : mapM f #[] = pure #[] := by
12291227
rw [mapM, mapM.map]; rfl
12301228

1231-
@[simp, grind] theorem map_empty {f : α → β} : map f #[] = #[] := mapM_empty f
1229+
@[grind] theorem map_empty {f : α → β} : map f #[] = #[] := by simp
12321230

12331231
@[simp, grind] theorem map_push {f : α → β} {as : Array α} {x : α} :
12341232
(as.push x).map f = (as.map f).push (f x) := by
@@ -1813,7 +1811,8 @@ theorem toArray_append {xs : List α} {ys : Array α} :
18131811

18141812
theorem singleton_eq_toArray_singleton {a : α} : #[a] = [a].toArray := rfl
18151813

1816-
@[simp] theorem empty_append_fun : ((#[] : Array α) ++ ·) = id := by
1814+
@[deprecated empty_append (since := "2025-05-26")]
1815+
theorem empty_append_fun : ((#[] : Array α) ++ ·) = id := by
18171816
funext ⟨l⟩
18181817
simp
18191818

@@ -1964,8 +1963,8 @@ theorem append_left_inj {xs₁ xs₂ : Array α} (ys) : xs₁ ++ ys = xs₂ ++ y
19641963
theorem eq_empty_of_append_eq_empty {xs ys : Array α} (h : xs ++ ys = #[]) : xs = #[] ∧ ys = #[] :=
19651964
append_eq_empty_iff.mp h
19661965

1967-
@[simp] theorem empty_eq_append_iff {xs ys : Array α} : #[] = xs ++ ys ↔ xs = #[] ∧ ys = #[] := by
1968-
rw [eq_comm, append_eq_empty_iff]
1966+
theorem empty_eq_append_iff {xs ys : Array α} : #[] = xs ++ ys ↔ xs = #[] ∧ ys = #[] := by
1967+
simp
19691968

19701969
theorem append_ne_empty_of_left_ne_empty {xs ys : Array α} (h : xs ≠ #[]) : xs ++ ys ≠ #[] := by
19711970
simp_all
@@ -2033,7 +2032,7 @@ theorem append_eq_append_iff {ws xs ys zs : Array α} :
20332032
simp only [List.append_toArray, List.set_toArray, List.set_append]
20342033
split <;> simp
20352034

2036-
@[simp] theorem set_append_left {xs ys : Array α} {i : Nat} {x : α} (h : i < xs.size) :
2035+
@[simp] theorem set_append_left {xs ys : Array α} {i : Nat} {x : α} (h : i < xs.size) :
20372036
(xs ++ ys).set i x (by simp; omega) = xs.set i x ++ ys := by
20382037
simp [set_append, h]
20392038

@@ -2108,14 +2107,13 @@ theorem append_eq_map_iff {f : α → β} :
21082107
| nil => simp
21092108
| cons as => induction as.toList <;> simp [*]
21102109

2111-
@[simp] theorem flatten_map_toArray {L : List (List α)} :
2112-
(L.toArray.map List.toArray).flatten = L.flatten.toArray := by
2110+
@[simp] theorem flatten_toArray_map {L : List (List α)} :
2111+
(L.map List.toArray).toArray.flatten = L.flatten.toArray := by
21132112
apply ext'
21142113
simp [Function.comp_def]
21152114

2116-
@[simp] theorem flatten_toArray_map {L : List (List α)} :
2117-
(L.map List.toArray).toArray.flatten = L.flatten.toArray := by
2118-
rw [← flatten_map_toArray]
2115+
theorem flatten_map_toArray {L : List (List α)} :
2116+
(L.toArray.map List.toArray).flatten = L.flatten.toArray := by
21192117
simp
21202118

21212119
-- We set this to lower priority so that `flatten_toArray_map` is applied first when relevant.
@@ -2143,8 +2141,8 @@ theorem mem_flatten : ∀ {xss : Array (Array α)}, a ∈ xss.flatten ↔ ∃ xs
21432141
induction xss using array₂_induction
21442142
simp
21452143

2146-
@[simp] theorem empty_eq_flatten_iff {xss : Array (Array α)} : #[] = xss.flatten ↔ ∀ xs ∈ xss, xs = #[] := by
2147-
rw [eq_comm, flatten_eq_empty_iff]
2144+
theorem empty_eq_flatten_iff {xss : Array (Array α)} : #[] = xss.flatten ↔ ∀ xs ∈ xss, xs = #[] := by
2145+
simp
21482146

21492147
theorem flatten_ne_empty_iff {xss : Array (Array α)} : xss.flatten ≠ #[] ↔ ∃ xs, xs ∈ xss ∧ xs ≠ #[] := by
21502148
simp
@@ -2284,15 +2282,9 @@ theorem eq_iff_flatten_eq {xss₁ xss₂ : Array (Array α)} :
22842282
rw [List.map_inj_right]
22852283
simp +contextual
22862284

2287-
@[simp] theorem flatten_toArray_map_toArray {xss : List (List α)} :
2285+
theorem flatten_toArray_map_toArray {xss : List (List α)} :
22882286
(xss.map List.toArray).toArray.flatten = xss.flatten.toArray := by
2289-
simp [flatten]
2290-
suffices ∀ as, List.foldl (fun acc bs => acc ++ bs) as (List.map List.toArray xss) = as ++ xss.flatten.toArray by
2291-
simpa using this #[]
2292-
intro as
2293-
induction xss generalizing as with
2294-
| nil => simp
2295-
| cons xs xss ih => simp [ih]
2287+
simp
22962288

22972289
/-! ### flatMap -/
22982290

@@ -2322,13 +2314,9 @@ theorem flatMap_toArray_cons {β} {f : α → Array β} {a : α} {as : List α}
23222314
intro cs
23232315
induction as generalizing cs <;> simp_all
23242316

2325-
@[simp, grind =] theorem flatMap_toArray {β} {f : α → Array β} {as : List α} :
2317+
theorem flatMap_toArray {β} {f : α → Array β} {as : List α} :
23262318
as.toArray.flatMap f = (as.flatMap (fun a => (f a).toList)).toArray := by
2327-
induction as with
2328-
| nil => simp
2329-
| cons a as ih =>
2330-
apply ext'
2331-
simp [ih, flatMap_toArray_cons]
2319+
simp
23322320

23332321
@[simp] theorem flatMap_id {xss : Array (Array α)} : xss.flatMap id = xss.flatten := by simp [flatMap_def]
23342322

@@ -3030,19 +3018,21 @@ theorem take_size {xs : Array α} : xs.take xs.size = xs := by
30303018
| succ n ih =>
30313019
simp [shrink.loop, ih]
30323020

3033-
@[simp] theorem size_shrink {xs : Array α} {i : Nat} : (xs.shrink i).size = min i xs.size := by
3021+
-- This doesn't need to be a simp lemma, as shortly we will simplify `shrink` to `take`.
3022+
theorem size_shrink {xs : Array α} {i : Nat} : (xs.shrink i).size = min i xs.size := by
30343023
simp [shrink]
30353024
omega
30363025

3037-
@[simp] theorem getElem_shrink {xs : Array α} {i j : Nat} (h : j < (xs.shrink i).size) :
3038-
(xs.shrink i)[j] = xs[j]'(by simp at h; omega) := by
3026+
-- This doesn't need to be a simp lemma, as shortly we will simplify `shrink` to `take`.
3027+
theorem getElem_shrink {xs : Array α} {i j : Nat} (h : j < (xs.shrink i).size) :
3028+
(xs.shrink i)[j] = xs[j]'(by simp [size_shrink] at h; omega) := by
30393029
simp [shrink]
30403030

3041-
@[simp] theorem toList_shrink {xs : Array α} {i : Nat} : (xs.shrink i).toList = xs.toList.take i := by
3042-
apply List.ext_getElem <;> simp
3043-
30443031
@[simp] theorem shrink_eq_take {xs : Array α} {i : Nat} : xs.shrink i = xs.take i := by
3045-
ext <;> simp
3032+
ext <;> simp [size_shrink, getElem_shrink]
3033+
3034+
theorem toList_shrink {xs : Array α} {i : Nat} : (xs.shrink i).toList = xs.toList.take i := by
3035+
simp
30463036

30473037
/-! ### foldlM and foldrM -/
30483038

@@ -4572,8 +4562,8 @@ Our goal is to have `simp` "pull `List.toArray` outwards" as much as possible.
45724562

45734563
theorem toListRev_toArray {l : List α} : l.toArray.toListRev = l.reverse := by simp
45744564

4575-
@[simp, grind =] theorem take_toArray {l : List α} {i : Nat} : l.toArray.take i = (l.take i).toArray := by
4576-
apply Array.ext <;> simp
4565+
@[grind =] theorem take_toArray {l : List α} {i : Nat} : l.toArray.take i = (l.take i).toArray := by
4566+
simp
45774567

45784568
@[simp, grind =] theorem mapM_toArray [Monad m] [LawfulMonad m] {f : α → m β} {l : List α} :
45794569
l.toArray.mapM f = List.toArray <$> l.mapM f := by

src/Init/Data/Array/Lex/Lemmas.lean

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,6 @@ protected theorem not_le_iff_gt [DecidableEq α] [LT α] [DecidableLT α] {xs ys
3131
@[simp] theorem lex_empty [BEq α] {lt : α → α → Bool} {xs : Array α} : xs.lex #[] lt = false := by
3232
simp [lex]
3333

34-
@[simp] theorem singleton_lex_singleton [BEq α] {lt : α → α → Bool} : #[a].lex #[b] lt = lt a b := by
35-
simp only [lex, List.getElem_toArray, List.getElem_singleton]
36-
cases lt a b <;> cases a != b <;> simp
37-
3834
private theorem cons_lex_cons [BEq α] {lt : α → α → Bool} {a b : α} {xs ys : Array α} :
3935
(#[a] ++ xs).lex (#[b] ++ ys) lt =
4036
(lt a b || a == b && xs.lex ys lt) := by
@@ -58,6 +54,9 @@ private theorem cons_lex_cons [BEq α] {lt : α → α → Bool} {a b : α} {xs
5854
| cons y l₂ =>
5955
rw [List.toArray_cons, List.toArray_cons y, cons_lex_cons, List.lex, ih]
6056

57+
theorem singleton_lex_singleton [BEq α] {lt : α → α → Bool} : #[a].lex #[b] lt = lt a b := by
58+
simp
59+
6160
@[simp, grind =] theorem lex_toList [BEq α] {lt : α → α → Bool} {xs ys : Array α} :
6261
xs.toList.lex ys.toList lt = xs.lex ys lt := by
6362
cases xs <;> cases ys <;> simp

src/Init/Data/Array/Monadic.lean

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@ open Nat
2525

2626
/-! ## Monadic operations -/
2727

28-
@[simp] theorem map_toList_inj [Monad m] [LawfulMonad m]
28+
theorem map_toList_inj [Monad m] [LawfulMonad m]
2929
{xs : m (Array α)} {ys : m (Array α)} :
30-
toList <$> xs = toList <$> ys ↔ xs = ys :=
31-
_root_.map_inj_right (by simp)
30+
toList <$> xs = toList <$> ys ↔ xs = ys := by
31+
simp
3232

3333
/-! ### mapM -/
3434

@@ -195,11 +195,11 @@ theorem forIn'_eq_foldlM [Monad m] [LawfulMonad m]
195195
rcases xs with ⟨xs⟩
196196
simp [List.forIn'_pure_yield_eq_foldl, List.foldl_map]
197197

198-
@[simp] theorem idRun_forIn'_yield_eq_foldl
198+
theorem idRun_forIn'_yield_eq_foldl
199199
{xs : Array α} (f : (a : α) → a ∈ xs → β → Id β) (init : β) :
200200
(forIn' xs init (fun a m b => .yield <$> f a m b)).run =
201-
xs.attach.foldl (fun b ⟨a, h⟩ => f a h b |>.run) init :=
202-
forIn'_pure_yield_eq_foldl _ _
201+
xs.attach.foldl (fun b ⟨a, h⟩ => f a h b |>.run) init := by
202+
simp
203203

204204
@[deprecated idRun_forIn'_yield_eq_foldl (since := "2025-05-21")]
205205
theorem forIn'_yield_eq_foldl
@@ -243,11 +243,11 @@ theorem forIn_eq_foldlM [Monad m] [LawfulMonad m]
243243
rcases xs with ⟨xs⟩
244244
simp [List.forIn_pure_yield_eq_foldl, List.foldl_map]
245245

246-
@[simp] theorem idRun_forIn_yield_eq_foldl
246+
theorem idRun_forIn_yield_eq_foldl
247247
{xs : Array α} (f : α → β → Id β) (init : β) :
248248
(forIn xs init (fun a b => .yield <$> f a b)).run =
249-
xs.foldl (fun b a => f a b |>.run) init :=
250-
forIn_pure_yield_eq_foldl _ _
249+
xs.foldl (fun b a => f a b |>.run) init := by
250+
simp
251251

252252
@[deprecated idRun_forIn_yield_eq_foldl (since := "2025-05-21")]
253253
theorem forIn_yield_eq_foldl

src/Init/Data/Array/Zip.lean

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -334,11 +334,13 @@ abbrev zipWithAll_mkArray := @zipWithAll_replicate
334334

335335
/-! ### unzip -/
336336

337-
@[simp] theorem unzip_fst : (unzip l).fst = l.map Prod.fst := by
338-
induction l <;> simp_all
337+
@[deprecated fst_unzip (since := "2025-05-26")]
338+
theorem unzip_fst : (unzip l).fst = l.map Prod.fst := by
339+
simp
339340

340-
@[simp] theorem unzip_snd : (unzip l).snd = l.map Prod.snd := by
341-
induction l <;> simp_all
341+
@[deprecated snd_unzip (since := "2025-05-26")]
342+
theorem unzip_snd : (unzip l).snd = l.map Prod.snd := by
343+
simp
342344

343345
theorem unzip_eq_map {xs : Array (α × β)} : unzip xs = (xs.map Prod.fst, xs.map Prod.snd) := by
344346
cases xs

0 commit comments

Comments
 (0)