diff --git a/src/Init/Classical.lean b/src/Init/Classical.lean index 8a3391d6ce..5a403ba54d 100644 --- a/src/Init/Classical.lean +++ b/src/Init/Classical.lean @@ -181,9 +181,6 @@ theorem not_imp_iff_and_not : ¬(a → b) ↔ a ∧ ¬b := Decidable.not_imp_iff theorem not_and_iff_not_or_not : ¬(a ∧ b) ↔ ¬a ∨ ¬b := Decidable.not_and_iff_not_or_not -@[deprecated not_and_iff_not_or_not (since := "2025-03-18")] -abbrev not_and_iff_or_not_not := @not_and_iff_not_or_not - theorem not_iff : ¬(a ↔ b) ↔ (¬a ↔ b) := Decidable.not_iff @[simp] theorem imp_iff_left_iff : (b ↔ a → b) ↔ a ∨ b := Decidable.imp_iff_left_iff diff --git a/src/Init/Control/Lawful/Basic.lean b/src/Init/Control/Lawful/Basic.lean index e29ed32f7c..0aa972cd2f 100644 --- a/src/Init/Control/Lawful/Basic.lean +++ b/src/Init/Control/Lawful/Basic.lean @@ -255,11 +255,6 @@ instance : LawfulMonad Id := by @[simp] theorem run_seqLeft (x y : Id α) : (x <* y).run = x.run := rfl @[simp] theorem run_seq (f : Id (α → β)) (x : Id α) : (f <*> x).run = f.run x.run := rfl --- These lemmas are bad as they abuse the defeq of `Id α` and `α` -@[deprecated run_map (since := "2025-03-05")] theorem map_eq (x : Id α) (f : α → β) : f <$> x = f x := rfl -@[deprecated run_bind (since := "2025-03-05")] theorem bind_eq (x : Id α) (f : α → id β) : x >>= f = f x := rfl -@[deprecated run_pure (since := "2025-03-05")] theorem pure_eq (a : α) : (pure a : Id α) = a := rfl - end Id /-! # Option -/ diff --git a/src/Init/Core.lean b/src/Init/Core.lean index 7a827dac19..d769874991 100644 --- a/src/Init/Core.lean +++ b/src/Init/Core.lean @@ -600,17 +600,6 @@ export LawfulSingleton (insert_empty_eq) attribute [simp] insert_empty_eq -@[deprecated insert_empty_eq (since := "2025-03-12")] -theorem insert_emptyc_eq [EmptyCollection β] [Insert α β] [Singleton α β] - [LawfulSingleton α β] (x : α) : (insert x ∅ : β) = singleton x := - insert_empty_eq _ - -@[deprecated insert_empty_eq (since := "2025-03-12")] -theorem LawfulSingleton.insert_emptyc_eq [EmptyCollection β] [Insert α β] [Singleton α β] - [LawfulSingleton α β] (x : α) : (insert x ∅ : β) = singleton x := - insert_empty_eq _ - - /-- Type class used to implement the notation `{ a ∈ c | p a }` -/ class Sep (α : outParam <| Type u) (γ : Type v) where /-- Computes `{ a ∈ c | p a }`. -/ diff --git a/src/Init/Data/Array/Attach.lean b/src/Init/Data/Array/Attach.lean index 55cf1f6cf2..bb54b2418c 100644 --- a/src/Init/Data/Array/Attach.lean +++ b/src/Init/Data/Array/Attach.lean @@ -749,9 +749,6 @@ and simplifies these to the function directly taking the value. (Array.replicate n x).unattach = Array.replicate n x.1 := by simp [unattach] -@[deprecated unattach_replicate (since := "2025-03-18")] -abbrev unattach_mkArray := @unattach_replicate - /-! ### Well-founded recursion preprocessing setup -/ @[wf_preprocess] theorem map_wfParam {xs : Array α} {f : α → β} : diff --git a/src/Init/Data/Array/Basic.lean b/src/Init/Data/Array/Basic.lean index 522bbce71e..1fba890e15 100644 --- a/src/Init/Data/Array/Basic.lean +++ b/src/Init/Data/Array/Basic.lean @@ -209,20 +209,6 @@ Examples: def replicate {α : Type u} (n : Nat) (v : α) : Array α where toList := List.replicate n v -/-- -Creates an array that contains `n` repetitions of `v`. - -The corresponding `List` function is `List.replicate`. - -Examples: - * `Array.mkArray 2 true = #[true, true]` - * `Array.mkArray 3 () = #[(), (), ()]` - * `Array.mkArray 0 "anything" = #[]` --/ -@[extern "lean_mk_array", deprecated replicate (since := "2025-03-18")] -def mkArray {α : Type u} (n : Nat) (v : α) : Array α where - toList := List.replicate n v - /-- Swaps two elements of an array. The modification is performed in-place when the reference to the array is unique. @@ -2147,5 +2133,3 @@ instance [ToString α] : ToString (Array α) where toString xs := String.Internal.append "#" (toString xs.toList) end Array - -export Array (mkArray) diff --git a/src/Init/Data/Array/Count.lean b/src/Init/Data/Array/Count.lean index f322db3689..905fa4d314 100644 --- a/src/Init/Data/Array/Count.lean +++ b/src/Init/Data/Array/Count.lean @@ -99,9 +99,6 @@ theorem countP_le_size : countP p xs ≤ xs.size := by theorem countP_replicate {a : α} {n : Nat} : countP p (replicate n a) = if p a then n else 0 := by simp [← List.toArray_replicate, List.countP_replicate] -@[deprecated countP_replicate (since := "2025-03-18")] -abbrev countP_mkArray := @countP_replicate - theorem boole_getElem_le_countP {xs : Array α} {i : Nat} (h : i < xs.size) : (if p xs[i] then 1 else 0) ≤ xs.countP p := by rcases xs with ⟨xs⟩ @@ -262,15 +259,9 @@ theorem count_eq_size {xs : Array α} : count a xs = xs.size ↔ ∀ b ∈ xs, a @[simp] theorem count_replicate_self {a : α} {n : Nat} : count a (replicate n a) = n := by simp [← List.toArray_replicate] -@[deprecated count_replicate_self (since := "2025-03-18")] -abbrev count_mkArray_self := @count_replicate_self - theorem count_replicate {a b : α} {n : Nat} : count a (replicate n b) = if b == a then n else 0 := by simp [← List.toArray_replicate, List.count_replicate] -@[deprecated count_replicate (since := "2025-03-18")] -abbrev count_mkArray := @count_replicate - theorem filter_beq {xs : Array α} (a : α) : xs.filter (· == a) = replicate (count a xs) a := by rcases xs with ⟨xs⟩ simp [List.filter_beq] @@ -284,9 +275,6 @@ theorem replicate_count_eq_of_count_eq_size {xs : Array α} (h : count a xs = xs rw [← toList_inj] simp [List.replicate_count_eq_of_count_eq_length (by simpa using h)] -@[deprecated replicate_count_eq_of_count_eq_size (since := "2025-03-18")] -abbrev mkArray_count_eq_of_count_eq_size := @replicate_count_eq_of_count_eq_size - @[simp] theorem count_filter {xs : Array α} (h : p a) : count a (filter p xs) = count a xs := by rcases xs with ⟨xs⟩ simp [List.count_filter, h] diff --git a/src/Init/Data/Array/Erase.lean b/src/Init/Data/Array/Erase.lean index fb01020579..1ebcac92d1 100644 --- a/src/Init/Data/Array/Erase.lean +++ b/src/Init/Data/Array/Erase.lean @@ -139,25 +139,16 @@ theorem eraseP_replicate {n : Nat} {a : α} {p : α → Bool} : simp only [← List.toArray_replicate, List.eraseP_toArray, List.eraseP_replicate] split <;> simp -@[deprecated eraseP_replicate (since := "2025-03-18")] -abbrev eraseP_mkArray := @eraseP_replicate - @[simp] theorem eraseP_replicate_of_pos {n : Nat} {a : α} (h : p a) : (replicate n a).eraseP p = replicate (n - 1) a := by simp only [← List.toArray_replicate, List.eraseP_toArray] simp [h] -@[deprecated eraseP_replicate_of_pos (since := "2025-03-18")] -abbrev eraseP_mkArray_of_pos := @eraseP_replicate_of_pos - @[simp] theorem eraseP_replicate_of_neg {n : Nat} {a : α} (h : ¬p a) : (replicate n a).eraseP p = replicate n a := by simp only [← List.toArray_replicate, List.eraseP_toArray] simp [h] -@[deprecated eraseP_replicate_of_neg (since := "2025-03-18")] -abbrev eraseP_mkArray_of_neg := @eraseP_replicate_of_neg - theorem eraseP_eq_iff {p} {xs : Array α} : xs.eraseP p = ys ↔ ((∀ a ∈ xs, ¬ p a) ∧ xs = ys) ∨ @@ -278,9 +269,6 @@ theorem erase_replicate [LawfulBEq α] {n : Nat} {a b : α} : simp only [List.erase_replicate, beq_iff_eq, List.toArray_replicate] split <;> simp -@[deprecated erase_replicate (since := "2025-03-18")] -abbrev erase_mkArray := @erase_replicate - -- The arguments `a b` are explicit, -- so they can be specified to prevent `simp` repeatedly applying the lemma. @[grind =] @@ -308,17 +296,11 @@ theorem erase_eq_iff [LawfulBEq α] {a : α} {xs : Array α} : simp only [← List.toArray_replicate, List.erase_toArray] simp -@[deprecated erase_replicate_self (since := "2025-03-18")] -abbrev erase_mkArray_self := @erase_replicate_self - @[simp] theorem erase_replicate_ne [LawfulBEq α] {a b : α} (h : !b == a) : (replicate n a).erase b = replicate n a := by rw [erase_of_not_mem] simp_all -@[deprecated erase_replicate_ne (since := "2025-03-18")] -abbrev erase_mkArray_ne := @erase_replicate_ne - end erase /-! ### eraseIdxIfInBounds -/ @@ -429,9 +411,6 @@ theorem eraseIdx_replicate {n : Nat} {a : α} {k : Nat} {h} : simp only [← List.toArray_replicate, List.eraseIdx_toArray] simp [List.eraseIdx_replicate, h] -@[deprecated eraseIdx_replicate (since := "2025-03-18")] -abbrev eraseIdx_mkArray := @eraseIdx_replicate - theorem mem_eraseIdx_iff_getElem {x : α} {xs : Array α} {k} {h} : x ∈ xs.eraseIdx k h ↔ ∃ i w, i ≠ k ∧ xs[i]'w = x := by rcases xs with ⟨xs⟩ simp [List.mem_eraseIdx_iff_getElem, *] diff --git a/src/Init/Data/Array/Extract.lean b/src/Init/Data/Array/Extract.lean index 8431780b78..89a1747803 100644 --- a/src/Init/Data/Array/Extract.lean +++ b/src/Init/Data/Array/Extract.lean @@ -289,9 +289,6 @@ theorem extract_append_right {as bs : Array α} : · simp only [size_extract, size_replicate] at h₁ h₂ simp only [getElem_extract, getElem_replicate] -@[deprecated extract_replicate (since := "2025-03-18")] -abbrev extract_mkArray := @extract_replicate - theorem extract_eq_extract_right {as : Array α} {i j j' : Nat} : as.extract i j = as.extract i j' ↔ min (j - i) (as.size - i) = min (j' - i) (as.size - i) := by rcases as with ⟨as⟩ @@ -429,32 +426,20 @@ theorem popWhile_append {xs ys : Array α} : (replicate n a).takeWhile p = (replicate n a).filter p := by simp [← List.toArray_replicate] -@[deprecated takeWhile_replicate_eq_filter (since := "2025-03-18")] -abbrev takeWhile_mkArray_eq_filter := @takeWhile_replicate_eq_filter - theorem takeWhile_replicate {p : α → Bool} : (replicate n a).takeWhile p = if p a then replicate n a else #[] := by simp [takeWhile_replicate_eq_filter, filter_replicate] -@[deprecated takeWhile_replicate (since := "2025-03-18")] -abbrev takeWhile_mkArray := @takeWhile_replicate - @[simp] theorem popWhile_replicate_eq_filter_not {p : α → Bool} : (replicate n a).popWhile p = (replicate n a).filter (fun a => !p a) := by simp [← List.toArray_replicate, ← List.filter_reverse] -@[deprecated popWhile_replicate_eq_filter_not (since := "2025-03-18")] -abbrev popWhile_mkArray_eq_filter_not := @popWhile_replicate_eq_filter_not - theorem popWhile_replicate {p : α → Bool} : (replicate n a).popWhile p = if p a then #[] else replicate n a := by simp only [popWhile_replicate_eq_filter_not, size_replicate, filter_replicate, Bool.not_eq_eq_eq_not, Bool.not_true] split <;> simp_all -@[deprecated popWhile_replicate (since := "2025-03-18")] -abbrev popWhile_mkArray := @popWhile_replicate - theorem extract_takeWhile {as : Array α} {i : Nat} : (as.takeWhile p).extract 0 i = (as.extract 0 i).takeWhile p := by rcases as with ⟨as⟩ diff --git a/src/Init/Data/Array/Find.lean b/src/Init/Data/Array/Find.lean index 136982ad66..f47ca8a399 100644 --- a/src/Init/Data/Array/Find.lean +++ b/src/Init/Data/Array/Find.lean @@ -129,31 +129,19 @@ theorem getElem_zero_flatten {xss : Array (Array α)} (h) : theorem findSome?_replicate : findSome? f (replicate n a) = if n = 0 then none else f a := by simp [← List.toArray_replicate, List.findSome?_replicate] -@[deprecated findSome?_replicate (since := "2025-03-18")] -abbrev findSome?_mkArray := @findSome?_replicate - @[simp] theorem findSome?_replicate_of_pos (h : 0 < n) : findSome? f (replicate n a) = f a := by simp [findSome?_replicate, Nat.ne_of_gt h] -@[deprecated findSome?_replicate_of_pos (since := "2025-03-18")] -abbrev findSome?_mkArray_of_pos := @findSome?_replicate_of_pos - -- Argument is unused, but used to decide whether `simp` should unfold. @[simp] theorem findSome?_replicate_of_isSome (_ : (f a).isSome) : findSome? f (replicate n a) = if n = 0 then none else f a := by simp [findSome?_replicate] -@[deprecated findSome?_replicate_of_isSome (since := "2025-03-18")] -abbrev findSome?_mkArray_of_isSome := @findSome?_replicate_of_isSome - @[simp] theorem findSome?_replicate_of_isNone (h : (f a).isNone) : findSome? f (replicate n a) = none := by rw [Option.isNone_iff_eq_none] at h simp [findSome?_replicate, h] -@[deprecated findSome?_replicate_of_isNone (since := "2025-03-18")] -abbrev findSome?_mkArray_of_isNone := @findSome?_replicate_of_isNone - /-! ### find? -/ @[simp, grind =] theorem find?_empty : find? p #[] = none := rfl @@ -318,16 +306,10 @@ theorem find?_replicate : find? p (replicate n a) = if p a then some a else none := by simp [find?_replicate, Nat.ne_of_gt h] -@[deprecated find?_replicate_of_size_pos (since := "2025-03-18")] -abbrev find?_mkArray_of_length_pos := @find?_replicate_of_size_pos - @[simp] theorem find?_replicate_of_pos (h : p a) : find? p (replicate n a) = if n = 0 then none else some a := by simp [find?_replicate, h] -@[deprecated find?_replicate_of_pos (since := "2025-03-18")] -abbrev find?_mkArray_of_pos := @find?_replicate_of_pos - @[simp] theorem find?_replicate_of_neg (h : ¬ p a) : find? p (replicate n a) = none := by simp [find?_replicate, h] @@ -583,9 +565,6 @@ theorem findIdx?_flatten {xss : Array (Array α)} {p : α → Bool} : simp only [List.findIdx?_toArray] simp -@[deprecated findIdx?_replicate (since := "2025-03-18")] -abbrev findIdx?_mkArray := @findIdx?_replicate - theorem findIdx?_eq_findSome?_zipIdx {xs : Array α} {p : α → Bool} : xs.findIdx? p = xs.zipIdx.findSome? fun ⟨a, i⟩ => if p a then some i else none := by rcases xs with ⟨xs⟩ diff --git a/src/Init/Data/Array/Lemmas.lean b/src/Init/Data/Array/Lemmas.lean index 492da3a5ae..37df775893 100644 --- a/src/Init/Data/Array/Lemmas.lean +++ b/src/Init/Data/Array/Lemmas.lean @@ -317,41 +317,23 @@ theorem singleton_inj : #[a] = #[b] ↔ a = b := by @[simp, grind =] theorem size_replicate {n : Nat} {v : α} : (replicate n v).size = n := List.length_replicate .. -@[deprecated size_replicate (since := "2025-03-18")] -abbrev size_mkArray := @size_replicate - @[simp] theorem toList_replicate : (replicate n a).toList = List.replicate n a := by simp only [replicate] -@[deprecated toList_replicate (since := "2025-03-18")] -abbrev toList_mkArray := @toList_replicate - @[simp, grind =] theorem replicate_zero : replicate 0 a = #[] := rfl -@[deprecated replicate_zero (since := "2025-03-18")] -abbrev mkArray_zero := @replicate_zero - @[grind =] theorem replicate_succ : replicate (n + 1) a = (replicate n a).push a := by apply toList_inj.1 simp [List.replicate_succ'] -@[deprecated replicate_succ (since := "2025-03-18")] -abbrev mkArray_succ := @replicate_succ - @[simp, grind =] theorem getElem_replicate {n : Nat} {v : α} {i : Nat} (h : i < (replicate n v).size) : (replicate n v)[i] = v := by simp [← getElem_toList] -@[deprecated getElem_replicate (since := "2025-03-18")] -abbrev getElem_mkArray := @getElem_replicate - @[grind =] theorem getElem?_replicate {n : Nat} {v : α} {i : Nat} : (replicate n v)[i]? = if i < n then some v else none := by simp [getElem?_def] -@[deprecated getElem?_replicate (since := "2025-03-18")] -abbrev getElem?_mkArray := @getElem?_replicate - /-! ### mem -/ @[grind ←] @@ -1100,9 +1082,6 @@ theorem size_eq_of_beq [BEq α] {xs ys : Array α} (h : xs == ys) : xs.size = ys rw [Bool.eq_iff_iff] simp +contextual -@[deprecated replicate_beq_replicate (since := "2025-03-18")] -abbrev mkArray_beq_mkArray := @replicate_beq_replicate - private theorem beq_of_beq_singleton [BEq α] {a b : α} : #[a] == #[b] → a == b := by intro h have : isEqv #[a] #[b] BEq.beq = true := h @@ -2390,77 +2369,44 @@ theorem flatMap_eq_foldl {f : α → Array β} {xs : Array α} : @[simp] theorem replicate_one : replicate 1 a = #[a] := rfl -@[deprecated replicate_one (since := "2025-03-18")] -abbrev mkArray_one := @replicate_one - /-- Variant of `replicate_succ` that prepends `a` at the beginning of the array. -/ theorem replicate_succ' : replicate (n + 1) a = #[a] ++ replicate n a := by apply Array.ext' simp [List.replicate_succ] -@[deprecated replicate_succ' (since := "2025-03-18")] -abbrev mkArray_succ' := @replicate_succ' - @[simp, grind =] theorem mem_replicate {a b : α} {n} : b ∈ replicate n a ↔ n ≠ 0 ∧ b = a := by unfold replicate simp only [List.mem_toArray, List.mem_replicate] -@[deprecated mem_replicate (since := "2025-03-18")] -abbrev mem_mkArray := @mem_replicate - @[grind →] theorem eq_of_mem_replicate {a b : α} {n} (h : b ∈ replicate n a) : b = a := (mem_replicate.1 h).2 -@[deprecated eq_of_mem_mkArray (since := "2025-03-18")] -abbrev eq_of_mem_mkArray := @eq_of_mem_replicate - theorem forall_mem_replicate {p : α → Prop} {a : α} {n} : (∀ b, b ∈ replicate n a → p b) ↔ n = 0 ∨ p a := by cases n <;> simp [mem_replicate] -@[deprecated forall_mem_replicate (since := "2025-03-18")] -abbrev forall_mem_mkArray := @forall_mem_replicate - @[simp] theorem replicate_succ_ne_empty {n : Nat} {a : α} : replicate (n+1) a ≠ #[] := by simp [replicate_succ] -@[deprecated replicate_succ_ne_empty (since := "2025-03-18")] -abbrev mkArray_succ_ne_empty := @replicate_succ_ne_empty - @[simp] theorem replicate_eq_empty_iff {n : Nat} {a : α} : replicate n a = #[] ↔ n = 0 := by cases n <;> simp -@[deprecated replicate_eq_empty_iff (since := "2025-03-18")] -abbrev mkArray_eq_empty_iff := @replicate_eq_empty_iff - @[simp] theorem replicate_inj : replicate n a = replicate m b ↔ n = m ∧ (n = 0 ∨ a = b) := by rw [← toList_inj] simp -@[deprecated replicate_inj (since := "2025-03-18")] -abbrev mkArray_inj := @replicate_inj - theorem eq_replicate_of_mem {a : α} {xs : Array α} (h : ∀ (b) (_ : b ∈ xs), b = a) : xs = replicate xs.size a := by rw [← toList_inj] simpa using List.eq_replicate_of_mem (by simpa using h) -@[deprecated eq_replicate_of_mem (since := "2025-03-18")] -abbrev eq_mkArray_of_mem := @eq_replicate_of_mem - theorem eq_replicate_iff {a : α} {n} {xs : Array α} : xs = replicate n a ↔ xs.size = n ∧ ∀ (b) (_ : b ∈ xs), b = a := by rw [← toList_inj] simpa using List.eq_replicate_iff (l := xs.toList) -@[deprecated eq_replicate_iff (since := "2025-03-18")] -abbrev eq_mkArray_iff := @eq_replicate_iff - theorem map_eq_replicate_iff {xs : Array α} {f : α → β} {b : β} : xs.map f = replicate xs.size b ↔ ∀ x ∈ xs, f x = b := by simp [eq_replicate_iff] -@[deprecated map_eq_replicate_iff (since := "2025-03-18")] -abbrev map_eq_mkArray_iff := @map_eq_replicate_iff - @[simp] theorem map_const {xs : Array α} {b : β} : map (Function.const α b) xs = replicate xs.size b := map_eq_replicate_iff.mpr fun _ _ => rfl @@ -2477,143 +2423,86 @@ theorem map_const' {xs : Array α} {b : β} : map (fun _ => b) xs = replicate xs apply Array.ext' simp -@[deprecated set_replicate_self (since := "2025-03-18")] -abbrev set_mkArray_self := @set_replicate_self - @[simp] theorem setIfInBounds_replicate_self : (replicate n a).setIfInBounds i a = replicate n a := by apply Array.ext' simp -@[deprecated setIfInBounds_replicate_self (since := "2025-03-18")] -abbrev setIfInBounds_mkArray_self := @setIfInBounds_replicate_self - @[simp] theorem replicate_append_replicate : replicate n a ++ replicate m a = replicate (n + m) a := by apply Array.ext' simp -@[deprecated replicate_append_replicate (since := "2025-03-18")] -abbrev mkArray_append_mkArray := @replicate_append_replicate - theorem append_eq_replicate_iff {xs ys : Array α} {a : α} : xs ++ ys = replicate n a ↔ xs.size + ys.size = n ∧ xs = replicate xs.size a ∧ ys = replicate ys.size a := by simp [← toList_inj, List.append_eq_replicate_iff] -@[deprecated append_eq_replicate_iff (since := "2025-03-18")] -abbrev append_eq_mkArray_iff := @append_eq_replicate_iff - theorem replicate_eq_append_iff {xs ys : Array α} {a : α} : replicate n a = xs ++ ys ↔ xs.size + ys.size = n ∧ xs = replicate xs.size a ∧ ys = replicate ys.size a := by rw [eq_comm, append_eq_replicate_iff] -@[deprecated replicate_eq_append_iff (since := "2025-03-18")] -abbrev replicate_eq_mkArray_iff := @replicate_eq_append_iff - @[simp] theorem map_replicate : (replicate n a).map f = replicate n (f a) := by apply Array.ext' simp -@[deprecated map_replicate (since := "2025-03-18")] -abbrev map_mkArray := @map_replicate - @[grind =] theorem filter_replicate (w : stop = n) : (replicate n a).filter p 0 stop = if p a then replicate n a else #[] := by apply Array.ext' simp only [w] split <;> simp_all -@[deprecated filter_replicate (since := "2025-03-18")] -abbrev filter_mkArray := @filter_replicate - @[simp] theorem filter_replicate_of_pos (w : stop = n) (h : p a) : (replicate n a).filter p 0 stop = replicate n a := by simp [filter_replicate, h, w] -@[deprecated filter_replicate_of_pos (since := "2025-03-18")] -abbrev filter_mkArray_of_pos := @filter_replicate_of_pos - @[simp] theorem filter_replicate_of_neg (w : stop = n) (h : ¬ p a) : (replicate n a).filter p 0 stop = #[] := by simp [filter_replicate, h, w] -@[deprecated filter_replicate_of_neg (since := "2025-03-18")] -abbrev filter_mkArray_of_neg := @filter_replicate_of_neg - theorem filterMap_replicate {f : α → Option β} (w : stop = n := by simp) : (replicate n a).filterMap f 0 stop = match f a with | none => #[] | .some b => replicate n b := by apply Array.ext' simp only [w, size_replicate, toList_filterMap', toList_replicate, List.filterMap_replicate] split <;> simp_all -@[deprecated filterMap_replicate (since := "2025-03-18")] -abbrev filterMap_mkArray := @filterMap_replicate - -- This is not a useful `simp` lemma because `b` is unknown. theorem filterMap_replicate_of_some {f : α → Option β} (h : f a = some b) : (replicate n a).filterMap f = replicate n b := by simp [filterMap_replicate, h] -@[deprecated filterMap_replicate_of_some (since := "2025-03-18")] -abbrev filterMap_mkArray_of_some := @filterMap_replicate_of_some - @[simp] theorem filterMap_replicate_of_isSome {f : α → Option β} (h : (f a).isSome) : (replicate n a).filterMap f = replicate n (Option.get _ h) := by match w : f a, h with | some b, _ => simp [filterMap_replicate, w] -@[deprecated filterMap_replicate_of_isSome (since := "2025-03-18")] -abbrev filterMap_mkArray_of_isSome := @filterMap_replicate_of_isSome - @[simp] theorem filterMap_replicate_of_none {f : α → Option β} (h : f a = none) : (replicate n a).filterMap f = #[] := by simp [filterMap_replicate, h] -@[deprecated filterMap_replicate_of_none (since := "2025-03-18")] -abbrev filterMap_mkArray_of_none := @filterMap_replicate_of_none - @[simp] theorem flatten_replicate_empty : (replicate n (#[] : Array α)).flatten = #[] := by rw [← toList_inj] simp -@[deprecated flatten_replicate_empty (since := "2025-03-18")] -abbrev flatten_mkArray_empty := @flatten_replicate_empty - @[simp] theorem flatten_replicate_singleton : (replicate n #[a]).flatten = replicate n a := by rw [← toList_inj] simp -@[deprecated flatten_replicate_singleton (since := "2025-03-18")] -abbrev flatten_mkArray_singleton := @flatten_replicate_singleton - @[simp] theorem flatten_replicate_replicate : (replicate n (replicate m a)).flatten = replicate (n * m) a := by rw [← toList_inj] simp -@[deprecated flatten_replicate_replicate (since := "2025-03-18")] -abbrev flatten_mkArray_replicate := @flatten_replicate_replicate - theorem flatMap_replicate {f : α → Array β} : (replicate n a).flatMap f = (replicate n (f a)).flatten := by rw [← toList_inj] simp [List.flatMap_replicate] -@[deprecated flatMap_replicate (since := "2025-03-18")] -abbrev flatMap_mkArray := @flatMap_replicate - @[simp] theorem isEmpty_replicate : (replicate n a).isEmpty = decide (n = 0) := by rw [← List.toArray_replicate, List.isEmpty_toArray] simp -@[deprecated isEmpty_replicate (since := "2025-03-18")] -abbrev isEmpty_mkArray := @isEmpty_replicate - @[simp] theorem sum_replicate_nat {n : Nat} {a : Nat} : (replicate n a).sum = n * a := by rw [← List.toArray_replicate, List.sum_toArray] simp -@[deprecated sum_replicate_nat (since := "2025-03-18")] -abbrev sum_mkArray_nat := @sum_replicate_nat - /-! ### Preliminaries about `swap` needed for `reverse`. -/ @[grind =] @@ -2800,9 +2689,6 @@ theorem flatten_reverse {xss : Array (Array α)} : rw [← toList_inj] simp -@[deprecated reverse_replicate (since := "2025-03-18")] -abbrev reverse_mkArray := @reverse_replicate - /-! ### extract -/ theorem extract_loop_zero {xs ys : Array α} {start : Nat} : extract.loop xs 0 start ys = ys := by @@ -3712,15 +3598,9 @@ theorem back?_replicate {a : α} {n : Nat} : rw [replicate_eq_toArray_replicate] simp only [List.back?_toArray, List.getLast?_replicate] -@[deprecated back?_replicate (since := "2025-03-18")] -abbrev back?_mkArray := @back?_replicate - @[simp] theorem back_replicate {xs : Array α} (w : 0 < n) : (replicate n xs).back (by simpa using w) = xs := by simp [back_eq_getElem] -@[deprecated back_replicate (since := "2025-03-18")] -abbrev back_mkArray := @back_replicate - /-! ## Additional operations -/ /-! ### leftpad -/ @@ -3818,9 +3698,6 @@ theorem pop_append {xs ys : Array α} : @[simp, grind =] theorem pop_replicate {n : Nat} {a : α} : (replicate n a).pop = replicate (n - 1) a := by ext <;> simp -@[deprecated pop_replicate (since := "2025-03-18")] -abbrev pop_mkArray := @pop_replicate - /-! ## Logic -/ /-! ### any / all -/ @@ -4050,16 +3927,10 @@ theorem all_filterMap {xs : Array α} {f : α → Option β} {p : β → Bool} : (replicate n a).any f = if n = 0 then false else f a := by induction n <;> simp_all [replicate_succ'] -@[deprecated any_replicate (since := "2025-03-18")] -abbrev any_mkArray := @any_replicate - @[simp] theorem all_replicate {n : Nat} {a : α} : (replicate n a).all f = if n = 0 then true else f a := by induction n <;> simp_all +contextual [replicate_succ'] -@[deprecated all_replicate (since := "2025-03-18")] -abbrev all_mkArray := @all_replicate - /-! ### modify -/ @[simp, grind =] theorem size_modify {xs : Array α} {i : Nat} {f : α → α} : (xs.modify i f).size = xs.size := by @@ -4234,17 +4105,11 @@ theorem replace_extract {xs : Array α} {i : Nat} : (replicate n a).replace a b = #[b] ++ replicate (n - 1) a := by cases n <;> simp_all [replicate_succ', replace_append] -@[deprecated replace_replicate_self (since := "2025-03-18")] -abbrev replace_mkArray_self := @replace_replicate_self - @[simp] theorem replace_replicate_ne {a b c : α} (h : !b == a) : (replicate n a).replace b c = replicate n a := by rw [replace_of_not_mem] simp_all -@[deprecated replace_replicate_ne (since := "2025-03-18")] -abbrev replace_mkArray_ne := @replace_replicate_ne - end replace /-! ### toListRev -/ @@ -4412,9 +4277,6 @@ theorem getElem!_eq_getD [Inhabited α] {xs : Array α} {i} : xs[i]! = xs.getD i @[deprecated mem_toList_iff (since := "2025-05-26")] theorem mem_toList {a : α} {xs : Array α} : a ∈ xs.toList ↔ a ∈ xs := mem_def.symm -@[deprecated not_mem_empty (since := "2025-03-25")] -theorem not_mem_nil (a : α) : ¬ a ∈ #[] := nofun - /-! # get lemmas -/ theorem lt_of_getElem {x : α} {xs : Array α} {i : Nat} {hidx : i < xs.size} (_ : xs[i] = x) : diff --git a/src/Init/Data/Array/MapIdx.lean b/src/Init/Data/Array/MapIdx.lean index 6a0dc4aa21..9cac5d9cca 100644 --- a/src/Init/Data/Array/MapIdx.lean +++ b/src/Init/Data/Array/MapIdx.lean @@ -296,9 +296,6 @@ theorem mapFinIdx_eq_replicate_iff {xs : Array α} {f : (i : Nat) → α → (h rw [← toList_inj] simp [List.mapFinIdx_eq_replicate_iff] -@[deprecated mapFinIdx_eq_replicate_iff (since := "2025-03-18")] -abbrev mapFinIdx_eq_mkArray_iff := @mapFinIdx_eq_replicate_iff - @[simp, grind =] theorem mapFinIdx_reverse {xs : Array α} {f : (i : Nat) → α → (h : i < xs.reverse.size) → β} : xs.reverse.mapFinIdx f = (xs.mapFinIdx (fun i a h => f (xs.size - 1 - i) a (by simp; omega))).reverse := by rcases xs with ⟨l⟩ @@ -438,9 +435,6 @@ theorem mapIdx_eq_replicate_iff {xs : Array α} {f : Nat → α → β} {b : β} rw [← toList_inj] simp [List.mapIdx_eq_replicate_iff] -@[deprecated mapIdx_eq_replicate_iff (since := "2025-03-18")] -abbrev mapIdx_eq_mkArray_iff := @mapIdx_eq_replicate_iff - @[simp, grind =] theorem mapIdx_reverse {xs : Array α} {f : Nat → α → β} : xs.reverse.mapIdx f = (mapIdx (fun i => f (xs.size - 1 - i)) xs).reverse := by rcases xs with ⟨xs⟩ diff --git a/src/Init/Data/Array/Zip.lean b/src/Init/Data/Array/Zip.lean index 2e88a8681b..025e4ba60d 100644 --- a/src/Init/Data/Array/Zip.lean +++ b/src/Init/Data/Array/Zip.lean @@ -166,9 +166,6 @@ theorem zipWith_eq_append_iff {f : α → β → γ} {as : Array α} {bs : Array zipWith f (replicate m a) (replicate n b) = replicate (min m n) (f a b) := by simp [← List.toArray_replicate] -@[deprecated zipWith_replicate (since := "2025-03-18")] -abbrev zipWith_mkArray := @zipWith_replicate - theorem map_uncurry_zip_eq_zipWith {f : α → β → γ} {as : Array α} {bs : Array β} : map (Function.uncurry f) (as.zip bs) = zipWith f as bs := by cases as @@ -294,9 +291,6 @@ theorem zip_eq_append_iff {as : Array α} {bs : Array β} : zip (replicate m a) (replicate n b) = replicate (min m n) (a, b) := by simp [← List.toArray_replicate] -@[deprecated zip_replicate (since := "2025-03-18")] -abbrev zip_mkArray := @zip_replicate - theorem zip_eq_zip_take_min {as : Array α} {bs : Array β} : zip as bs = zip (as.take (min as.size bs.size)) (bs.take (min as.size bs.size)) := by cases as @@ -348,9 +342,6 @@ theorem map_zipWithAll {δ : Type _} {f : α → β} {g : Option γ → Option zipWithAll f (replicate n a) (replicate n b) = replicate n (f (some a) (some b)) := by simp [← List.toArray_replicate] -@[deprecated zipWithAll_replicate (since := "2025-03-18")] -abbrev zipWithAll_mkArray := @zipWithAll_replicate - /-! ### zipWithM -/ @[simp, grind =] @@ -408,7 +399,4 @@ theorem zip_of_prod {as : Array α} {bs : Array β} {xs : Array (α × β)} (hl unzip (replicate n (a, b)) = (replicate n a, replicate n b) := by ext1 <;> simp -@[deprecated unzip_replicate (since := "2025-03-18")] -abbrev unzip_mkArray := @unzip_replicate - end Array diff --git a/src/Init/Data/BitVec/Lemmas.lean b/src/Init/Data/BitVec/Lemmas.lean index 7f6fbe3e78..f44efe06b1 100644 --- a/src/Init/Data/BitVec/Lemmas.lean +++ b/src/Init/Data/BitVec/Lemmas.lean @@ -2572,10 +2572,6 @@ theorem signExtend_eq_setWidth_of_le (x : BitVec w) {v : Nat} (hv : v ≤ w) : ext i h simp [getElem_signExtend, show i < w by omega] -@[deprecated signExtend_eq_setWidth_of_le (since := "2025-03-07")] -theorem signExtend_eq_setWidth_of_lt (x : BitVec w) {v : Nat} (hv : v ≤ w) : - x.signExtend v = x.setWidth v := signExtend_eq_setWidth_of_le x hv - /-- Sign extending to the same bitwidth is a no op. -/ @[simp] theorem signExtend_eq (x : BitVec w) : x.signExtend w = x := by rw [signExtend_eq_setWidth_of_le _ (Nat.le_refl _), setWidth_eq] diff --git a/src/Init/Data/ByteArray/Basic.lean b/src/Init/Data/ByteArray/Basic.lean index a2eb7fede4..44a6265598 100644 --- a/src/Init/Data/ByteArray/Basic.lean +++ b/src/Init/Data/ByteArray/Basic.lean @@ -24,9 +24,6 @@ attribute [ext] ByteArray instance : DecidableEq ByteArray := fun _ _ => decidable_of_decidable_of_iff ByteArray.ext_iff.symm -@[deprecated emptyWithCapacity (since := "2025-03-12")] -abbrev mkEmpty := emptyWithCapacity - instance : Inhabited ByteArray where default := empty diff --git a/src/Init/Data/FloatArray/Basic.lean b/src/Init/Data/FloatArray/Basic.lean index ec6c4f8112..21de86a98a 100644 --- a/src/Init/Data/FloatArray/Basic.lean +++ b/src/Init/Data/FloatArray/Basic.lean @@ -29,9 +29,6 @@ attribute [ext] FloatArray def emptyWithCapacity (c : @& Nat) : FloatArray := { data := #[] } -@[deprecated emptyWithCapacity (since := "2025-03-12")] -abbrev mkEmpty := emptyWithCapacity - def empty : FloatArray := emptyWithCapacity 0 diff --git a/src/Init/Data/Int/Basic.lean b/src/Init/Data/Int/Basic.lean index 8b64e0ac66..06a590e951 100644 --- a/src/Init/Data/Int/Basic.lean +++ b/src/Init/Data/Int/Basic.lean @@ -369,9 +369,6 @@ def toNat? : Int → Option Nat | (n : Nat) => some n | -[_+1] => none -@[deprecated toNat? (since := "2025-03-11"), inherit_doc toNat?] -abbrev toNat' := toNat? - /-! ## divisibility -/ /-- diff --git a/src/Init/Data/Int/DivMod/Lemmas.lean b/src/Init/Data/Int/DivMod/Lemmas.lean index 35b4cdcb58..c3cf6b9d25 100644 --- a/src/Init/Data/Int/DivMod/Lemmas.lean +++ b/src/Init/Data/Int/DivMod/Lemmas.lean @@ -510,9 +510,6 @@ theorem ediv_neg_of_neg_of_pos {a b : Int} (Ha : a < 0) (Hb : 0 < b) : a / b < 0 match a, b, eq_negSucc_of_lt_zero Ha, eq_succ_of_zero_lt Hb with | _, _, ⟨_, rfl⟩, ⟨_, rfl⟩ => negSucc_lt_zero _ -@[deprecated ediv_neg_of_neg_of_pos (since := "2025-03-04")] -abbrev ediv_neg' := @ediv_neg_of_neg_of_pos - theorem negSucc_ediv (m : Nat) {b : Int} (H : 0 < b) : -[m+1] / b = -(ediv m b + 1) := match b, eq_succ_of_zero_lt H with | _, ⟨_, rfl⟩ => rfl @@ -545,9 +542,6 @@ theorem ediv_pos_of_neg_of_neg {a b : Int} (ha : a < 0) (hb : b < 0) : 0 < a / b theorem ediv_nonpos_of_nonneg_of_nonpos {a b : Int} (Ha : 0 ≤ a) (Hb : b ≤ 0) : a / b ≤ 0 := Int.nonpos_of_neg_nonneg <| Int.ediv_neg .. ▸ Int.ediv_nonneg Ha (Int.neg_nonneg_of_nonpos Hb) -@[deprecated ediv_nonpos_of_nonneg_of_nonpos (since := "2025-03-04")] -abbrev ediv_nonpos := @ediv_nonpos_of_nonneg_of_nonpos - theorem ediv_eq_zero_of_lt {a b : Int} (H1 : 0 ≤ a) (H2 : a < b) : a / b = 0 := match a, b, eq_ofNat_of_zero_le H1, eq_succ_of_zero_lt (Int.lt_of_le_of_lt H1 H2) with | _, _, ⟨_, rfl⟩, ⟨_, rfl⟩ => congrArg Nat.cast <| Nat.div_eq_of_lt <| ofNat_lt.1 H2 @@ -937,9 +931,6 @@ where | -[_+1], 0 => Nat.zero_le _ | -[_+1], succ _ => Nat.succ_le_succ (Nat.div_le_self _ _) -@[deprecated natAbs_ediv_le_natAbs (since := "2025-03-05")] -abbrev natAbs_div_le_natAbs := natAbs_ediv_le_natAbs - theorem ediv_le_self {a : Int} (b : Int) (Ha : 0 ≤ a) : a / b ≤ a := by have := Int.le_trans le_natAbs (ofNat_le.2 <| natAbs_ediv_le_natAbs a b) rwa [natAbs_of_nonneg Ha] at this @@ -972,14 +963,6 @@ theorem emod_eq_iff {a b c : Int} (hb : b ≠ 0) : a % b = c ↔ 0 ≤ c ∧ c < rw [← dvd_iff_emod_eq_zero, Int.dvd_neg] exact Int.dvd_mul_right a b -@[deprecated mul_ediv_cancel (since := "2025-03-05")] -theorem neg_mul_ediv_cancel (a b : Int) (h : b ≠ 0) : -(a * b) / b = -a := by - rw [neg_ediv_of_dvd (Int.dvd_mul_left a b), mul_ediv_cancel _ h] - -@[deprecated mul_ediv_cancel (since := "2025-03-05")] -theorem neg_mul_ediv_cancel_left (a b : Int) (h : a ≠ 0) : -(a * b) / a = -b := by - rw [neg_ediv_of_dvd (Int.dvd_mul_right a b), mul_ediv_cancel_left _ h] - @[simp] theorem ediv_one : ∀ a : Int, a / 1 = a | (_:Nat) => congrArg Nat.cast (Nat.div_one _) | -[_+1] => congrArg negSucc (Nat.div_one _) @@ -1329,9 +1312,6 @@ theorem tdiv_nonneg_of_nonpos_of_nonpos {a b : Int} (Ha : a ≤ 0) (Hb : b ≤ 0 protected theorem tdiv_nonpos_of_nonneg_of_nonpos {a b : Int} (Ha : 0 ≤ a) (Hb : b ≤ 0) : a.tdiv b ≤ 0 := Int.nonpos_of_neg_nonneg <| Int.tdiv_neg .. ▸ Int.tdiv_nonneg Ha (Int.neg_nonneg_of_nonpos Hb) -@[deprecated Int.tdiv_nonpos_of_nonneg_of_nonpos (since := "2025-03-04")] -abbrev tdiv_nonpos := @Int.tdiv_nonpos_of_nonneg_of_nonpos - theorem tdiv_eq_zero_of_lt {a b : Int} (H1 : 0 ≤ a) (H2 : a < b) : a.tdiv b = 0 := match a, b, eq_ofNat_of_zero_le H1, eq_succ_of_zero_lt (Int.lt_of_le_of_lt H1 H2) with | _, _, ⟨_, rfl⟩, ⟨_, rfl⟩ => congrArg Nat.cast <| Nat.div_eq_of_lt <| ofNat_lt.1 H2 @@ -2029,9 +2009,6 @@ theorem fdiv_nonpos_of_nonneg_of_nonpos : ∀ {a b : Int}, 0 ≤ a → b ≤ 0 | 0, 0, _, _ | 0, -[_+1], _, _ | succ _, 0, _, _ | succ _, -[_+1], _, _ => by simp [fdiv, negSucc_le_zero] -@[deprecated fdiv_nonpos_of_nonneg_of_nonpos (since := "2025-03-04")] -abbrev fdiv_nonpos := @fdiv_nonpos_of_nonneg_of_nonpos - theorem fdiv_neg_of_neg_of_pos : ∀ {a b : Int}, a < 0 → 0 < b → a.fdiv b < 0 | -[_+1], succ _, _, _ => negSucc_lt_zero _ @@ -2150,9 +2127,6 @@ theorem fmod_nonneg {a b : Int} (ha : 0 ≤ a) (hb : 0 ≤ b) : 0 ≤ a.fmod b : theorem fmod_nonneg_of_pos (a : Int) {b : Int} (hb : 0 < b) : 0 ≤ a.fmod b := fmod_eq_emod_of_nonneg _ (Int.le_of_lt hb) ▸ emod_nonneg _ (Int.ne_of_lt hb).symm -@[deprecated fmod_nonneg_of_pos (since := "2025-03-04")] -abbrev fmod_nonneg' := @fmod_nonneg_of_pos - theorem fmod_lt_of_pos (a : Int) {b : Int} (H : 0 < b) : a.fmod b < b := fmod_eq_emod_of_nonneg _ (Int.le_of_lt H) ▸ emod_lt_of_pos a H diff --git a/src/Init/Data/Int/Lemmas.lean b/src/Init/Data/Int/Lemmas.lean index 4cb3841c48..6e3548f6f4 100644 --- a/src/Init/Data/Int/Lemmas.lean +++ b/src/Init/Data/Int/Lemmas.lean @@ -74,9 +74,6 @@ theorem negSucc_inj : negSucc m = negSucc n ↔ m = n := ⟨negSucc.inj, fun H = theorem negSucc_eq (n : Nat) : -[n+1] = -((n : Int) + 1) := rfl -@[deprecated negSucc_eq (since := "2025-03-11")] -theorem negSucc_coe (n : Nat) : -[n+1] = -↑(n + 1) := rfl - @[simp] theorem negSucc_ne_zero (n : Nat) : -[n+1] ≠ 0 := nofun @[simp] theorem zero_ne_negSucc (n : Nat) : 0 ≠ -[n+1] := nofun @@ -353,10 +350,6 @@ protected theorem add_sub_assoc (a b c : Int) : a + b - c = a + (b - c) := by change ofNat (n - succ m) = subNatNat n (succ m) rw [subNatNat, Nat.sub_eq_zero_of_le h] -@[deprecated negSucc_eq (since := "2025-03-11")] -theorem negSucc_coe' (n : Nat) : -[n+1] = -↑n - 1 := by - rw [Int.sub_eq_add_neg, ← Int.neg_add]; rfl - protected theorem subNatNat_eq_coe {m n : Nat} : subNatNat m n = ↑m - ↑n := by apply subNatNat_elim m n fun m n i => i = m - n · intro i n diff --git a/src/Init/Data/Int/Order.lean b/src/Init/Data/Int/Order.lean index 7ad2f73862..8934c01aa3 100644 --- a/src/Init/Data/Int/Order.lean +++ b/src/Init/Data/Int/Order.lean @@ -234,9 +234,6 @@ theorem eq_natAbs_of_nonneg {a : Int} (h : 0 ≤ a) : a = natAbs a := by let ⟨n, e⟩ := eq_ofNat_of_zero_le h rw [e]; rfl -@[deprecated eq_natAbs_of_nonneg (since := "2025-03-11")] -abbrev eq_natAbs_of_zero_le := @eq_natAbs_of_nonneg - theorem le_natAbs {a : Int} : a ≤ natAbs a := match Int.le_total 0 a with | .inl h => by rw [eq_natAbs_of_nonneg h]; apply Int.le_refl @@ -717,9 +714,6 @@ theorem mem_toNat? : ∀ {a : Int} {n : Nat}, toNat? a = some n ↔ a = n | (m : Nat), n => by simp [toNat?, Int.ofNat_inj] | -[m+1], n => by constructor <;> nofun -@[deprecated mem_toNat? (since := "2025-03-11")] -abbrev mem_toNat' := @mem_toNat? - /-! ## Order properties of the integers -/ protected theorem le_of_not_le {a b : Int} : ¬ a ≤ b → b ≤ a := (Int.le_total a b).resolve_left @@ -1325,8 +1319,6 @@ theorem neg_of_sign_eq_neg_one : ∀ {a : Int}, sign a = -1 → a < 0 exact Int.le_add_one (natCast_nonneg _) | .negSucc _ => simp +decide [sign] -@[deprecated sign_nonneg_iff (since := "2025-03-11")] abbrev sign_nonneg := @sign_nonneg_iff - @[simp] theorem sign_pos_iff : 0 < sign x ↔ 0 < x := by match x with | 0 @@ -1409,9 +1401,6 @@ theorem natAbs_add_of_nonpos {a b : Int} (ha : a ≤ 0) (hb : b ≤ 0) : natAbs_add_of_nonneg (Int.neg_nonneg_of_nonpos ha) (Int.neg_nonneg_of_nonpos hb), natAbs_neg (-a), natAbs_neg (-b)] -@[deprecated negSucc_eq (since := "2025-03-11")] -theorem negSucc_eq' (m : Nat) : -[m+1] = -m - 1 := by simp only [negSucc_eq, Int.neg_add]; rfl - theorem natAbs_lt_natAbs_of_nonneg_of_lt {a b : Int} (w₁ : 0 ≤ a) (w₂ : a < b) : a.natAbs < b.natAbs := match a, b, eq_ofNat_of_zero_le w₁, eq_ofNat_of_zero_le (Int.le_trans w₁ (Int.le_of_lt w₂)) with @@ -1420,9 +1409,6 @@ theorem natAbs_lt_natAbs_of_nonneg_of_lt {a b : Int} theorem natAbs_eq_iff_mul_eq_zero : natAbs a = n ↔ (a - n) * (a + n) = 0 := by rw [natAbs_eq_iff, Int.mul_eq_zero, ← Int.sub_neg, Int.sub_eq_zero, Int.sub_eq_zero] -@[deprecated natAbs_eq_iff_mul_eq_zero (since := "2025-03-11")] -abbrev eq_natAbs_iff_mul_eq_zero := @natAbs_eq_iff_mul_eq_zero - instance instIsLinearOrder : IsLinearOrder Int := by apply IsLinearOrder.of_le case le_antisymm => constructor; apply Int.le_antisymm diff --git a/src/Init/Data/Int/Pow.lean b/src/Init/Data/Int/Pow.lean index 5a9178fd41..f9322bac9a 100644 --- a/src/Init/Data/Int/Pow.lean +++ b/src/Init/Data/Int/Pow.lean @@ -49,10 +49,6 @@ protected theorem pow_ne_zero {n : Int} {m : Nat} : n ≠ 0 → n ^ m ≠ 0 := b instance {n : Int} {m : Nat} [NeZero n] : NeZero (n ^ m) := ⟨Int.pow_ne_zero (NeZero.ne _)⟩ --- This can't be removed until the next update-stage0 -@[deprecated Nat.pow_pos (since := "2025-02-17")] -abbrev _root_.Nat.pos_pow_of_pos := @Nat.pow_pos - @[simp, norm_cast] protected theorem natCast_pow (b n : Nat) : ((b^n : Nat) : Int) = (b : Int) ^ n := by match n with diff --git a/src/Init/Data/List/Lemmas.lean b/src/Init/Data/List/Lemmas.lean index fc8c102ca9..7fe3724fbc 100644 --- a/src/Init/Data/List/Lemmas.lean +++ b/src/Init/Data/List/Lemmas.lean @@ -933,9 +933,6 @@ theorem head?_eq_some_iff {xs : List α} {a : α} : xs.head? = some a ↔ ∃ ys @[simp] theorem isSome_head? : l.head?.isSome ↔ l ≠ [] := by cases l <;> simp -@[deprecated isSome_head? (since := "2025-03-18")] -abbrev head?_isSome := @isSome_head? - @[simp] theorem head_mem : ∀ {l : List α} (h : l ≠ []), head l h ∈ l | [], h => absurd rfl h | _::_, _ => .head .. diff --git a/src/Init/Data/List/ToArray.lean b/src/Init/Data/List/ToArray.lean index dd8ef8b082..ee8b2c215d 100644 --- a/src/Init/Data/List/ToArray.lean +++ b/src/Init/Data/List/ToArray.lean @@ -548,9 +548,6 @@ theorem _root_.Array.replicate_eq_toArray_replicate : Array.replicate n v = (List.replicate n v).toArray := by simp -@[deprecated _root_.Array.replicate_eq_toArray_replicate (since := "2025-03-18")] -abbrev _root_.Array.mkArray_eq_toArray_replicate := @_root_.Array.replicate_eq_toArray_replicate - @[simp, grind =] theorem flatMap_empty {β} (f : α → Array β) : (#[] : Array α).flatMap f = #[] := rfl theorem flatMap_toArray_cons {β} (f : α → Array β) (a : α) (as : List α) : diff --git a/src/Init/Data/Nat/Bitwise/Lemmas.lean b/src/Init/Data/Nat/Bitwise/Lemmas.lean index 79c8f2551c..947ead45ef 100644 --- a/src/Init/Data/Nat/Bitwise/Lemmas.lean +++ b/src/Init/Data/Nat/Bitwise/Lemmas.lean @@ -529,16 +529,10 @@ theorem and_lt_two_pow (x : Nat) {y n : Nat} (right : y < 2^n) : (x &&& y) < 2^n simp only [testBit_and, testBit_mod_two_pow] cases testBit x i <;> simp -@[deprecated and_two_pow_sub_one_eq_mod (since := "2025-03-18")] -abbrev and_pow_two_sub_one_eq_mod := @and_two_pow_sub_one_eq_mod - theorem and_two_pow_sub_one_of_lt_two_pow {x : Nat} (lt : x < 2^n) : x &&& 2^n - 1 = x := by rw [and_two_pow_sub_one_eq_mod] apply Nat.mod_eq_of_lt lt -@[deprecated and_two_pow_sub_one_of_lt_two_pow (since := "2025-03-18")] -abbrev and_pow_two_sub_one_of_lt_two_pow := @and_two_pow_sub_one_of_lt_two_pow - @[simp] theorem and_mod_two_eq_one : (a &&& b) % 2 = 1 ↔ a % 2 = 1 ∧ b % 2 = 1 := by simp only [mod_two_eq_one_iff_testBit_zero] rw [testBit_and] @@ -728,9 +722,6 @@ theorem testBit_two_pow_mul_add (a : Nat) {b i : Nat} (b_lt : b < 2^i) (j : Nat) Nat.div_eq_of_lt b_lt, Nat.two_pow_pos i] -@[deprecated testBit_two_pow_mul_add (since := "2025-03-18")] -abbrev testBit_mul_pow_two_add := @testBit_two_pow_mul_add - @[grind =] theorem testBit_two_pow_mul : testBit (2 ^ i * a) j = (decide (j ≥ i) && testBit a (j-i)) := by @@ -745,9 +736,6 @@ theorem testBit_mul_two_pow (x j i : Nat) : (x * 2 ^ i).testBit j = (decide (i ≤ j) && x.testBit (j - i)) := by rw [Nat.mul_comm, testBit_two_pow_mul] -@[deprecated testBit_two_pow_mul (since := "2025-03-18")] -abbrev testBit_mul_pow_two := @testBit_two_pow_mul - theorem two_pow_add_eq_or_of_lt {b : Nat} (b_lt : b < 2^i) (a : Nat) : 2^i * a + b = 2^i * a ||| b := by apply eq_of_testBit_eq @@ -763,9 +751,6 @@ theorem two_pow_add_eq_or_of_lt {b : Nat} (b_lt : b < 2^i) (a : Nat) : _ ≤ 2 ^ j := Nat.pow_le_pow_right Nat.zero_lt_two i_le simp [i_le, j_lt, testBit_lt_two_pow, b_lt_j] -@[deprecated two_pow_add_eq_or_of_lt (since := "2025-03-18")] -abbrev mul_add_lt_is_or := @two_pow_add_eq_or_of_lt - /-! ### shiftLeft and shiftRight -/ @[simp, grind =] theorem testBit_shiftLeft (x : Nat) : testBit (x <<< i) j = diff --git a/src/Init/Data/Nat/Compare.lean b/src/Init/Data/Nat/Compare.lean index de6c6d8d3e..33fb88956a 100644 --- a/src/Init/Data/Nat/Compare.lean +++ b/src/Init/Data/Nat/Compare.lean @@ -30,9 +30,6 @@ theorem compare_eq_ite_lt (a b : Nat) : | .inl h => simp [h, Nat.ne_of_gt h] | .inr rfl => simp -@[deprecated compare_eq_ite_lt (since := "2025-03_28")] -def compare_def_lt := compare_eq_ite_lt - theorem compare_eq_ite_le (a b : Nat) : compare a b = if a ≤ b then if b ≤ a then .eq else .lt else .gt := by rw [compare_eq_ite_lt] @@ -43,9 +40,6 @@ theorem compare_eq_ite_le (a b : Nat) : next hgt => simp [Nat.not_le.2 hgt] next hle => simp [Nat.not_lt.1 hge, Nat.not_lt.1 hle] -@[deprecated compare_eq_ite_le (since := "2025-03_28")] -def compare_def_le := compare_eq_ite_le - protected theorem compare_swap (a b : Nat) : (compare a b).swap = compare b a := by simp only [compare_eq_ite_le]; (repeat' split) <;> try rfl next h1 h2 => cases h1 (Nat.le_of_not_le h2) diff --git a/src/Init/Data/Nat/Gcd.lean b/src/Init/Data/Nat/Gcd.lean index 67e57c50cb..e5ff75fa0f 100644 --- a/src/Init/Data/Nat/Gcd.lean +++ b/src/Init/Data/Nat/Gcd.lean @@ -242,10 +242,6 @@ theorem gcd_left_eq_iff {m m' n : Nat} : gcd m n = gcd m' n ↔ ∀ k, k ∣ n @[simp] theorem gcd_add_mul_right_right (m n k : Nat) : gcd m (n + k * m) = gcd m n := by simp [gcd_rec m (n + k * m), gcd_rec m n] -@[deprecated gcd_add_mul_right_right (since := "2025-03-31")] -theorem gcd_add_mul_self (m n k : Nat) : gcd m (n + k * m) = gcd m n := - gcd_add_mul_right_right _ _ _ - @[simp] theorem gcd_add_mul_left_right (m n k : Nat) : gcd m (n + m * k) = gcd m n := by rw [Nat.mul_comm, gcd_add_mul_right_right] diff --git a/src/Init/Data/Nat/Power2.lean b/src/Init/Data/Nat/Power2.lean index 4a36825de1..05898dc9d5 100644 --- a/src/Init/Data/Nat/Power2.lean +++ b/src/Init/Data/Nat/Power2.lean @@ -46,9 +46,6 @@ def isPowerOfTwo (n : Nat) := ∃ k, n = 2 ^ k theorem isPowerOfTwo_one : isPowerOfTwo 1 := ⟨0, by decide⟩ -@[deprecated isPowerOfTwo_one (since := "2025-03-18")] -abbrev one_isPowerOfTwo := isPowerOfTwo_one - theorem isPowerOfTwo_mul_two_of_isPowerOfTwo (h : isPowerOfTwo n) : isPowerOfTwo (n * 2) := have ⟨k, h⟩ := h ⟨k+1, by simp [h, Nat.pow_succ]⟩ diff --git a/src/Init/PropLemmas.lean b/src/Init/PropLemmas.lean index 8480d99aa3..088b74433a 100644 --- a/src/Init/PropLemmas.lean +++ b/src/Init/PropLemmas.lean @@ -543,31 +543,15 @@ theorem Decidable.not_and_not_right [Decidable b] : ¬(a ∧ ¬b) ↔ (a → b) theorem Decidable.not_and_iff_not_or_not [Decidable a] : ¬(a ∧ b) ↔ ¬a ∨ ¬b := ⟨fun h => if ha : a then .inr (h ⟨ha, ·⟩) else .inl ha, not_and_of_not_or_not⟩ -set_option linter.missingDocs false in -@[deprecated Decidable.not_and_iff_not_or_not (since := "2025-03-18")] -abbrev Decidable.not_and_iff_or_not_not := @Decidable.not_and_iff_not_or_not - theorem Decidable.not_and_iff_not_or_not' [Decidable b] : ¬(a ∧ b) ↔ ¬a ∨ ¬b := ⟨fun h => if hb : b then .inl (h ⟨·, hb⟩) else .inr hb, not_and_of_not_or_not⟩ -set_option linter.missingDocs false in -@[deprecated Decidable.not_and_iff_not_or_not' (since := "2025-03-18")] -abbrev Decidable.not_and_iff_or_not_not' := @Decidable.not_and_iff_not_or_not' - theorem Decidable.or_iff_not_not_and_not [Decidable a] [Decidable b] : a ∨ b ↔ ¬(¬a ∧ ¬b) := by rw [← not_or, not_not] -set_option linter.missingDocs false in -@[deprecated Decidable.or_iff_not_not_and_not (since := "2025-03-18")] -abbrev Decidable.or_iff_not_and_not := @Decidable.or_iff_not_not_and_not - theorem Decidable.and_iff_not_not_or_not [Decidable a] [Decidable b] : a ∧ b ↔ ¬(¬a ∨ ¬b) := by rw [← not_and_iff_not_or_not, not_not] -set_option linter.missingDocs false in -@[deprecated Decidable.and_iff_not_not_or_not (since := "2025-03-18")] -abbrev Decidable.and_iff_not_or_not := @Decidable.and_iff_not_not_or_not - theorem Decidable.imp_iff_right_iff [Decidable a] : (a → b ↔ b) ↔ a ∨ b := Iff.intro (fun h => (Decidable.em a).imp_right fun ha' => h.mp fun ha => (ha' ha).elim) diff --git a/tests/bench/liasolver.lean b/tests/bench/liasolver.lean index 4b7805a1a0..eabdadde25 100644 --- a/tests/bench/liasolver.lean +++ b/tests/bench/liasolver.lean @@ -64,10 +64,10 @@ namespace Std.HashMap return false def mapValsM [Monad m] (f : β → m γ) (xs : HashMap α β) : m (HashMap α γ) := - HashMap.empty (capacity := xs.size) |> xs.foldM fun acc k v => return acc.insert k (←f v) + HashMap.emptyWithCapacity (capacity := xs.size) |> xs.foldM fun acc k v => return acc.insert k (←f v) def mapVals (f : β → γ) (xs : HashMap α β) : HashMap α γ := - HashMap.empty (capacity := xs.size) |> xs.fold fun acc k v => acc.insert k (f v) + HashMap.emptyWithCapacity (capacity := xs.size) |> xs.fold fun acc k v => acc.insert k (f v) def fastMapVals (f : α → β → β) (xs : HashMap α β) : HashMap α β := xs.map f @@ -275,7 +275,7 @@ partial def readSolution? (p : Problem) : Option Solution := Id.run <| do return none if p.equations.any (fun _ eq => eq.const ≠ 0) then return some Solution.unsat - let mut assignment : Array (Option Int) := mkArray p.nVars none + let mut assignment : Array (Option Int) := Array.replicate p.nVars none for i in *...p.nVars do assignment := readSolution i assignment return Solution.sat <| assignment.map (·.get!) diff --git a/tests/lean/match4.lean b/tests/lean/match4.lean index 65986a8628..ab09125dd3 100644 --- a/tests/lean/match4.lean +++ b/tests/lean/match4.lean @@ -44,7 +44,7 @@ match x with def Vector' (α : Type) (n : Nat) := { a : Array α // a.size = n } def mkVec {α : Type} (n : Nat) (a : α) : Vector' α n := -⟨mkArray n a, Array.size_mkArray ..⟩ +⟨Array.replicate n a, Array.size_replicate ..⟩ structure S := (n : Nat) diff --git a/tests/lean/repr_issue.lean b/tests/lean/repr_issue.lean index 5b138475df..32871f65ea 100644 --- a/tests/lean/repr_issue.lean +++ b/tests/lean/repr_issue.lean @@ -13,5 +13,5 @@ foo -- The following examples were producing an element of Type `id (Except String Nat)`. -- Type class resolution was failing to produce an instance for `Repr (id (Except String Nat))` because `id` is not transparent. -#eval ex₁.run' (mkArray 10 1000) |>.run -#eval ex₂.run' (mkArray 10 1000) |>.run +#eval ex₁.run' (Array.replicate 10 1000) |>.run +#eval ex₂.run' (Array.replicate 10 1000) |>.run diff --git a/tests/lean/run/addDecorationsWithoutPartial.lean b/tests/lean/run/addDecorationsWithoutPartial.lean index e8f648acf9..ac3420e5f8 100644 --- a/tests/lean/run/addDecorationsWithoutPartial.lean +++ b/tests/lean/run/addDecorationsWithoutPartial.lean @@ -39,8 +39,8 @@ unsafe def replaceUnsafeM (size : USize) (e : Expr) (f? : (e' : Expr) → sizeOf private def notAnExpr : Unit × Unit := ⟨⟨⟩, ⟨⟩⟩ unsafe def initCache : State := - { keys := mkArray cacheSize.toNat (cast lcProof notAnExpr), -- `notAnExpr` is not a valid `Expr` - results := mkArray cacheSize.toNat default } + { keys := Array.replicate cacheSize.toNat (cast lcProof notAnExpr), -- `notAnExpr` is not a valid `Expr` + results := Array.replicate cacheSize.toNat default } unsafe def replaceUnsafe (e : Expr) (f? : (e' : Expr) → sizeOf e' ≤ sizeOf e → Option Expr) : Expr := (replaceUnsafeM cacheSize e f?).run' initCache diff --git a/tests/lean/run/array1.lean b/tests/lean/run/array1.lean index e989a53bc5..8aaa4baaa2 100644 --- a/tests/lean/run/array1.lean +++ b/tests/lean/run/array1.lean @@ -5,7 +5,7 @@ def v : Array Nat := Array.mk [1, 2, 3, 4] #guard v == #[1, 2, 3, 4, ] def w : Array Nat := -(mkArray 9 1).push 3 +(Array.replicate 9 1).push 3 #check @Array.casesOn @@ -15,7 +15,7 @@ def f : Fin w.size → Nat := def arraySum (a : Array Nat) : Nat := a.foldl Nat.add 0 -#guard mkArray 4 1 == #[1, 1, 1, 1] +#guard Array.replicate 4 1 == #[1, 1, 1, 1] #guard Array.map (fun x => x+10) v == #[11, 12, 13, 14] @@ -23,9 +23,9 @@ a.foldl Nat.add 0 #guard f ⟨9, sorry⟩ == 3 -#guard (((mkArray 1 1).push 2).push 3).foldl (fun x y => x + y) 0 == 6 +#guard (((Array.replicate 1 1).push 2).push 3).foldl (fun x y => x + y) 0 == 6 -#guard arraySum (mkArray 10 1) == 10 +#guard arraySum (Array.replicate 10 1) == 10 axiom axLt {a b : Nat} : a < b diff --git a/tests/lean/run/depElim1.lean b/tests/lean/run/depElim1.lean index fd2b7df438..f25c8f647b 100644 --- a/tests/lean/run/depElim1.lean +++ b/tests/lean/run/depElim1.lean @@ -154,7 +154,7 @@ def mkTester (elimName : Name) (majors : List Expr) (lhss : List AltLHS) (inProp generalizeTelescope majors.toArray fun majors => do let resultType := if inProp then mkConst `True /- some proposition -/ else mkConst `Nat let matchType ← mkForallFVars majors resultType - Match.mkMatcher { matcherName := elimName, matchType, discrInfos := mkArray majors.size {}, lhss } + Match.mkMatcher { matcherName := elimName, matchType, discrInfos := Array.replicate majors.size {}, lhss } def test (ex : Name) (numPats : Nat) (elimName : Name) (inProp : Bool := false) : MetaM Unit := withDepElimFrom ex numPats fun majors alts => do diff --git a/tests/lean/run/maze.lean b/tests/lean/run/maze.lean index 5f07dcdd09..ca54deae12 100644 --- a/tests/lean/run/maze.lean +++ b/tests/lean/run/maze.lean @@ -144,13 +144,13 @@ def delabGameState : Lean.Expr → Lean.PrettyPrinter.Delaborator.Delab try extractGameState e catch err => failure -- can happen if game state has variables in it - let topBar := Array.mkArray numCols $ ← `(horizontal_border| ─) + let topBar := Array.replicate numCols $ ← `(horizontal_border| ─) let emptyCell ← `(game_cell| ░) - let emptyRow := Array.mkArray numCols emptyCell + let emptyRow := Array.replicate numCols emptyCell let emptyRowStx ← `(game_row| │$emptyRow:game_cell*│) - let allRows := Array.mkArray numRows emptyRowStx + let allRows := Array.replicate numRows emptyRowStx - let a0 := Array.mkArray numRows $ Array.mkArray numCols emptyCell + let a0 := Array.replicate numRows $ Array.replicate numCols emptyCell let a1 := update2dArray a0 playerCoords $ ← `(game_cell| @) let a2 := update2dArrayMulti a1 walls $ ← `(game_cell| ▓) let aa ← Array.mapM delabGameRow a2 diff --git a/tests/lean/run/unifhint2.lean b/tests/lean/run/unifhint2.lean index c31691f22c..4f9e629ba9 100644 --- a/tests/lean/run/unifhint2.lean +++ b/tests/lean/run/unifhint2.lean @@ -13,7 +13,7 @@ unif_hint natAddStep (x y z w : Nat) where def BV (n : Nat) := { a : Array Bool // a.size = n } def sext (x : BV s) (n : Nat) : BV (s+n) := - ⟨mkArray (s+n) false, Array.size_mkArray ..⟩ + ⟨Array.replicate (s+n) false, Array.size_replicate ..⟩ def bvmul (x y : BV w) : BV w := x diff --git a/tests/lean/run/unihint.lean b/tests/lean/run/unihint.lean index 5b48ecab95..a3279632ad 100644 --- a/tests/lean/run/unihint.lean +++ b/tests/lean/run/unihint.lean @@ -32,7 +32,7 @@ set_option pp.all true def BV (n : Nat) := { a : Array Bool // a.size = n } def sext (x : BV s) (n : Nat) : BV (s+n) := - ⟨mkArray (s+n) false, Array.size_mkArray ..⟩ + ⟨Array.replicate (s+n) false, Array.size_replicate ..⟩ def bvmul (x y : BV w) : BV w := x