Skip to content

Commit c043355

Browse files
kim-emwkrozowski
authored andcommitted
chore: remove >6 month old deprecations (leanprover#10968)
1 parent ed6be2f commit c043355

36 files changed

+19
-396
lines changed

src/Init/Classical.lean

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -181,9 +181,6 @@ theorem not_imp_iff_and_not : ¬(a → b) ↔ a ∧ ¬b := Decidable.not_imp_iff
181181

182182
theorem not_and_iff_not_or_not : ¬(a ∧ b) ↔ ¬a ∨ ¬b := Decidable.not_and_iff_not_or_not
183183

184-
@[deprecated not_and_iff_not_or_not (since := "2025-03-18")]
185-
abbrev not_and_iff_or_not_not := @not_and_iff_not_or_not
186-
187184
theorem not_iff : ¬(a ↔ b) ↔ (¬a ↔ b) := Decidable.not_iff
188185

189186
@[simp] theorem imp_iff_left_iff : (b ↔ a → b) ↔ a ∨ b := Decidable.imp_iff_left_iff

src/Init/Control/Lawful/Basic.lean

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -255,11 +255,6 @@ instance : LawfulMonad Id := by
255255
@[simp] theorem run_seqLeft (x y : Id α) : (x <* y).run = x.run := rfl
256256
@[simp] theorem run_seq (f : Id (α → β)) (x : Id α) : (f <*> x).run = f.run x.run := rfl
257257

258-
-- These lemmas are bad as they abuse the defeq of `Id α` and `α`
259-
@[deprecated run_map (since := "2025-03-05")] theorem map_eq (x : Id α) (f : α → β) : f <$> x = f x := rfl
260-
@[deprecated run_bind (since := "2025-03-05")] theorem bind_eq (x : Id α) (f : α → id β) : x >>= f = f x := rfl
261-
@[deprecated run_pure (since := "2025-03-05")] theorem pure_eq (a : α) : (pure a : Id α) = a := rfl
262-
263258
end Id
264259

265260
/-! # Option -/

src/Init/Core.lean

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -600,17 +600,6 @@ export LawfulSingleton (insert_empty_eq)
600600

601601
attribute [simp] insert_empty_eq
602602

603-
@[deprecated insert_empty_eq (since := "2025-03-12")]
604-
theorem insert_emptyc_eq [EmptyCollection β] [Insert α β] [Singleton α β]
605-
[LawfulSingleton α β] (x : α) : (insert x ∅ : β) = singleton x :=
606-
insert_empty_eq _
607-
608-
@[deprecated insert_empty_eq (since := "2025-03-12")]
609-
theorem LawfulSingleton.insert_emptyc_eq [EmptyCollection β] [Insert α β] [Singleton α β]
610-
[LawfulSingleton α β] (x : α) : (insert x ∅ : β) = singleton x :=
611-
insert_empty_eq _
612-
613-
614603
/-- Type class used to implement the notation `{ a ∈ c | p a }` -/
615604
class Sep (α : outParam <| Type u) (γ : Type v) where
616605
/-- Computes `{ a ∈ c | p a }`. -/

src/Init/Data/Array/Attach.lean

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -749,9 +749,6 @@ and simplifies these to the function directly taking the value.
749749
(Array.replicate n x).unattach = Array.replicate n x.1 := by
750750
simp [unattach]
751751

752-
@[deprecated unattach_replicate (since := "2025-03-18")]
753-
abbrev unattach_mkArray := @unattach_replicate
754-
755752
/-! ### Well-founded recursion preprocessing setup -/
756753

757754
@[wf_preprocess] theorem map_wfParam {xs : Array α} {f : α → β} :

src/Init/Data/Array/Basic.lean

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -209,20 +209,6 @@ Examples:
209209
def replicate {α : Type u} (n : Nat) (v : α) : Array α where
210210
toList := List.replicate n v
211211

212-
/--
213-
Creates an array that contains `n` repetitions of `v`.
214-
215-
The corresponding `List` function is `List.replicate`.
216-
217-
Examples:
218-
* `Array.mkArray 2 true = #[true, true]`
219-
* `Array.mkArray 3 () = #[(), (), ()]`
220-
* `Array.mkArray 0 "anything" = #[]`
221-
-/
222-
@[extern "lean_mk_array", deprecated replicate (since := "2025-03-18")]
223-
def mkArray {α : Type u} (n : Nat) (v : α) : Array α where
224-
toList := List.replicate n v
225-
226212
/--
227213
Swaps two elements of an array. The modification is performed in-place when the reference to the
228214
array is unique.
@@ -2147,5 +2133,3 @@ instance [ToString α] : ToString (Array α) where
21472133
toString xs := String.Internal.append "#" (toString xs.toList)
21482134

21492135
end Array
2150-
2151-
export Array (mkArray)

src/Init/Data/Array/Count.lean

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,6 @@ theorem countP_le_size : countP p xs ≤ xs.size := by
9999
theorem countP_replicate {a : α} {n : Nat} : countP p (replicate n a) = if p a then n else 0 := by
100100
simp [← List.toArray_replicate, List.countP_replicate]
101101

102-
@[deprecated countP_replicate (since := "2025-03-18")]
103-
abbrev countP_mkArray := @countP_replicate
104-
105102
theorem boole_getElem_le_countP {xs : Array α} {i : Nat} (h : i < xs.size) :
106103
(if p xs[i] then 1 else 0) ≤ xs.countP p := by
107104
rcases xs with ⟨xs⟩
@@ -262,15 +259,9 @@ theorem count_eq_size {xs : Array α} : count a xs = xs.size ↔ ∀ b ∈ xs, a
262259
@[simp] theorem count_replicate_self {a : α} {n : Nat} : count a (replicate n a) = n := by
263260
simp [← List.toArray_replicate]
264261

265-
@[deprecated count_replicate_self (since := "2025-03-18")]
266-
abbrev count_mkArray_self := @count_replicate_self
267-
268262
theorem count_replicate {a b : α} {n : Nat} : count a (replicate n b) = if b == a then n else 0 := by
269263
simp [← List.toArray_replicate, List.count_replicate]
270264

271-
@[deprecated count_replicate (since := "2025-03-18")]
272-
abbrev count_mkArray := @count_replicate
273-
274265
theorem filter_beq {xs : Array α} (a : α) : xs.filter (· == a) = replicate (count a xs) a := by
275266
rcases xs with ⟨xs⟩
276267
simp [List.filter_beq]
@@ -284,9 +275,6 @@ theorem replicate_count_eq_of_count_eq_size {xs : Array α} (h : count a xs = xs
284275
rw [← toList_inj]
285276
simp [List.replicate_count_eq_of_count_eq_length (by simpa using h)]
286277

287-
@[deprecated replicate_count_eq_of_count_eq_size (since := "2025-03-18")]
288-
abbrev mkArray_count_eq_of_count_eq_size := @replicate_count_eq_of_count_eq_size
289-
290278
@[simp] theorem count_filter {xs : Array α} (h : p a) : count a (filter p xs) = count a xs := by
291279
rcases xs with ⟨xs⟩
292280
simp [List.count_filter, h]

src/Init/Data/Array/Erase.lean

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -139,25 +139,16 @@ theorem eraseP_replicate {n : Nat} {a : α} {p : α → Bool} :
139139
simp only [← List.toArray_replicate, List.eraseP_toArray, List.eraseP_replicate]
140140
split <;> simp
141141

142-
@[deprecated eraseP_replicate (since := "2025-03-18")]
143-
abbrev eraseP_mkArray := @eraseP_replicate
144-
145142
@[simp] theorem eraseP_replicate_of_pos {n : Nat} {a : α} (h : p a) :
146143
(replicate n a).eraseP p = replicate (n - 1) a := by
147144
simp only [← List.toArray_replicate, List.eraseP_toArray]
148145
simp [h]
149146

150-
@[deprecated eraseP_replicate_of_pos (since := "2025-03-18")]
151-
abbrev eraseP_mkArray_of_pos := @eraseP_replicate_of_pos
152-
153147
@[simp] theorem eraseP_replicate_of_neg {n : Nat} {a : α} (h : ¬p a) :
154148
(replicate n a).eraseP p = replicate n a := by
155149
simp only [← List.toArray_replicate, List.eraseP_toArray]
156150
simp [h]
157151

158-
@[deprecated eraseP_replicate_of_neg (since := "2025-03-18")]
159-
abbrev eraseP_mkArray_of_neg := @eraseP_replicate_of_neg
160-
161152
theorem eraseP_eq_iff {p} {xs : Array α} :
162153
xs.eraseP p = ys ↔
163154
((∀ a ∈ xs, ¬ p a) ∧ xs = ys) ∨
@@ -278,9 +269,6 @@ theorem erase_replicate [LawfulBEq α] {n : Nat} {a b : α} :
278269
simp only [List.erase_replicate, beq_iff_eq, List.toArray_replicate]
279270
split <;> simp
280271

281-
@[deprecated erase_replicate (since := "2025-03-18")]
282-
abbrev erase_mkArray := @erase_replicate
283-
284272
-- The arguments `a b` are explicit,
285273
-- so they can be specified to prevent `simp` repeatedly applying the lemma.
286274
@[grind =]
@@ -308,17 +296,11 @@ theorem erase_eq_iff [LawfulBEq α] {a : α} {xs : Array α} :
308296
simp only [← List.toArray_replicate, List.erase_toArray]
309297
simp
310298

311-
@[deprecated erase_replicate_self (since := "2025-03-18")]
312-
abbrev erase_mkArray_self := @erase_replicate_self
313-
314299
@[simp] theorem erase_replicate_ne [LawfulBEq α] {a b : α} (h : !b == a) :
315300
(replicate n a).erase b = replicate n a := by
316301
rw [erase_of_not_mem]
317302
simp_all
318303

319-
@[deprecated erase_replicate_ne (since := "2025-03-18")]
320-
abbrev erase_mkArray_ne := @erase_replicate_ne
321-
322304
end erase
323305

324306
/-! ### eraseIdxIfInBounds -/
@@ -429,9 +411,6 @@ theorem eraseIdx_replicate {n : Nat} {a : α} {k : Nat} {h} :
429411
simp only [← List.toArray_replicate, List.eraseIdx_toArray]
430412
simp [List.eraseIdx_replicate, h]
431413

432-
@[deprecated eraseIdx_replicate (since := "2025-03-18")]
433-
abbrev eraseIdx_mkArray := @eraseIdx_replicate
434-
435414
theorem mem_eraseIdx_iff_getElem {x : α} {xs : Array α} {k} {h} : x ∈ xs.eraseIdx k h ↔ ∃ i w, i ≠ k ∧ xs[i]'w = x := by
436415
rcases xs with ⟨xs⟩
437416
simp [List.mem_eraseIdx_iff_getElem, *]

src/Init/Data/Array/Extract.lean

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -289,9 +289,6 @@ theorem extract_append_right {as bs : Array α} :
289289
· simp only [size_extract, size_replicate] at h₁ h₂
290290
simp only [getElem_extract, getElem_replicate]
291291

292-
@[deprecated extract_replicate (since := "2025-03-18")]
293-
abbrev extract_mkArray := @extract_replicate
294-
295292
theorem extract_eq_extract_right {as : Array α} {i j j' : Nat} :
296293
as.extract i j = as.extract i j' ↔ min (j - i) (as.size - i) = min (j' - i) (as.size - i) := by
297294
rcases as with ⟨as⟩
@@ -429,32 +426,20 @@ theorem popWhile_append {xs ys : Array α} :
429426
(replicate n a).takeWhile p = (replicate n a).filter p := by
430427
simp [← List.toArray_replicate]
431428

432-
@[deprecated takeWhile_replicate_eq_filter (since := "2025-03-18")]
433-
abbrev takeWhile_mkArray_eq_filter := @takeWhile_replicate_eq_filter
434-
435429
theorem takeWhile_replicate {p : α → Bool} :
436430
(replicate n a).takeWhile p = if p a then replicate n a else #[] := by
437431
simp [takeWhile_replicate_eq_filter, filter_replicate]
438432

439-
@[deprecated takeWhile_replicate (since := "2025-03-18")]
440-
abbrev takeWhile_mkArray := @takeWhile_replicate
441-
442433
@[simp] theorem popWhile_replicate_eq_filter_not {p : α → Bool} :
443434
(replicate n a).popWhile p = (replicate n a).filter (fun a => !p a) := by
444435
simp [← List.toArray_replicate, ← List.filter_reverse]
445436

446-
@[deprecated popWhile_replicate_eq_filter_not (since := "2025-03-18")]
447-
abbrev popWhile_mkArray_eq_filter_not := @popWhile_replicate_eq_filter_not
448-
449437
theorem popWhile_replicate {p : α → Bool} :
450438
(replicate n a).popWhile p = if p a then #[] else replicate n a := by
451439
simp only [popWhile_replicate_eq_filter_not, size_replicate, filter_replicate, Bool.not_eq_eq_eq_not,
452440
Bool.not_true]
453441
split <;> simp_all
454442

455-
@[deprecated popWhile_replicate (since := "2025-03-18")]
456-
abbrev popWhile_mkArray := @popWhile_replicate
457-
458443
theorem extract_takeWhile {as : Array α} {i : Nat} :
459444
(as.takeWhile p).extract 0 i = (as.extract 0 i).takeWhile p := by
460445
rcases as with ⟨as⟩

src/Init/Data/Array/Find.lean

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -129,31 +129,19 @@ theorem getElem_zero_flatten {xss : Array (Array α)} (h) :
129129
theorem findSome?_replicate : findSome? f (replicate n a) = if n = 0 then none else f a := by
130130
simp [← List.toArray_replicate, List.findSome?_replicate]
131131

132-
@[deprecated findSome?_replicate (since := "2025-03-18")]
133-
abbrev findSome?_mkArray := @findSome?_replicate
134-
135132
@[simp] theorem findSome?_replicate_of_pos (h : 0 < n) : findSome? f (replicate n a) = f a := by
136133
simp [findSome?_replicate, Nat.ne_of_gt h]
137134

138-
@[deprecated findSome?_replicate_of_pos (since := "2025-03-18")]
139-
abbrev findSome?_mkArray_of_pos := @findSome?_replicate_of_pos
140-
141135
-- Argument is unused, but used to decide whether `simp` should unfold.
142136
@[simp] theorem findSome?_replicate_of_isSome (_ : (f a).isSome) :
143137
findSome? f (replicate n a) = if n = 0 then none else f a := by
144138
simp [findSome?_replicate]
145139

146-
@[deprecated findSome?_replicate_of_isSome (since := "2025-03-18")]
147-
abbrev findSome?_mkArray_of_isSome := @findSome?_replicate_of_isSome
148-
149140
@[simp] theorem findSome?_replicate_of_isNone (h : (f a).isNone) :
150141
findSome? f (replicate n a) = none := by
151142
rw [Option.isNone_iff_eq_none] at h
152143
simp [findSome?_replicate, h]
153144

154-
@[deprecated findSome?_replicate_of_isNone (since := "2025-03-18")]
155-
abbrev findSome?_mkArray_of_isNone := @findSome?_replicate_of_isNone
156-
157145
/-! ### find? -/
158146

159147
@[simp, grind =] theorem find?_empty : find? p #[] = none := rfl
@@ -318,16 +306,10 @@ theorem find?_replicate :
318306
find? p (replicate n a) = if p a then some a else none := by
319307
simp [find?_replicate, Nat.ne_of_gt h]
320308

321-
@[deprecated find?_replicate_of_size_pos (since := "2025-03-18")]
322-
abbrev find?_mkArray_of_length_pos := @find?_replicate_of_size_pos
323-
324309
@[simp] theorem find?_replicate_of_pos (h : p a) :
325310
find? p (replicate n a) = if n = 0 then none else some a := by
326311
simp [find?_replicate, h]
327312

328-
@[deprecated find?_replicate_of_pos (since := "2025-03-18")]
329-
abbrev find?_mkArray_of_pos := @find?_replicate_of_pos
330-
331313
@[simp] theorem find?_replicate_of_neg (h : ¬ p a) : find? p (replicate n a) = none := by
332314
simp [find?_replicate, h]
333315

@@ -583,9 +565,6 @@ theorem findIdx?_flatten {xss : Array (Array α)} {p : α → Bool} :
583565
simp only [List.findIdx?_toArray]
584566
simp
585567

586-
@[deprecated findIdx?_replicate (since := "2025-03-18")]
587-
abbrev findIdx?_mkArray := @findIdx?_replicate
588-
589568
theorem findIdx?_eq_findSome?_zipIdx {xs : Array α} {p : α → Bool} :
590569
xs.findIdx? p = xs.zipIdx.findSome? fun ⟨a, i⟩ => if p a then some i else none := by
591570
rcases xs with ⟨xs⟩

0 commit comments

Comments
 (0)