Skip to content

Commit 0d0144e

Browse files
authored
chore: deprecation of Sorted (#223)
Fixes an accidental use of deprecated declarations that were unnoticed because of a release. A CI method of detecting this will be added soon.
1 parent 2ee7c69 commit 0d0144e

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

Cslib/Algorithms/Lean/MergeSort/MergeSort.lean

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import Cslib.Algorithms.Lean.TimeM
88
import Mathlib.Data.Nat.Cast.Order.Ring
99
import Mathlib.Data.Nat.Lattice
1010
import Mathlib.Data.Nat.Log
11-
import Mathlib.Deprecated.Sort
1211

1312

1413
/-!
@@ -61,8 +60,8 @@ section Correctness
6160

6261
open List
6362

64-
/-- A list is sorted if it satisfies the `Sorted (· ≤ ·)` predicate. -/
65-
abbrev IsSorted (l : List α) : Prop := Sorted (· ≤ ·) l
63+
/-- A list is sorted if it satisfies the `Pairwise (· ≤ ·)` predicate. -/
64+
abbrev IsSorted (l : List α) : Prop := List.Pairwise (· ≤ ·) l
6665

6766
/-- `x` is a minimum element of list `l` if `x ≤ b` for all `b ∈ l`. -/
6867
abbrev MinOfList (x : α) (l : List α) : Prop := ∀ b ∈ l, x ≤ b
@@ -85,14 +84,14 @@ theorem sorted_merge {l1 l2 : List α} (hxs : IsSorted l1) (hys : IsSorted l2) :
8584
fun_induction merge l1 l2 with
8685
| case3 =>
8786
simp only [Bind.bind, Pure.pure]
88-
grind [sorted_cons]
87+
grind [pairwise_cons]
8988
| _ => simpa
9089

9190
theorem mergeSort_sorted (xs : List α) : IsSorted ⟪mergeSort xs⟫ := by
9291
fun_induction mergeSort xs with
9392
| case1 x =>
9493
simp only [Pure.pure]
95-
rcases x with _ | ⟨a, _ | ⟨b, rest⟩⟩ <;> grind [sorted_nil, sorted_singleton]
94+
rcases x with _ | ⟨a, _ | ⟨b, rest⟩⟩ <;> grind
9695
| case2 _ _ _ _ _ ih2 ih1 => exact sorted_merge ih2 ih1
9796

9897
lemma merge_perm (l₁ l₂ : List α) : ⟪merge l₁ l₂⟫ ~ l₁ ++ l₂ := by

0 commit comments

Comments
 (0)