@@ -27,100 +27,110 @@ arrays, remove duplicates and then compare them elementwise.
2727def equalSet [BEq α] (xs ys : Array α) : Bool :=
2828 xs.all (ys.contains ·) && ys.all (xs.contains ·)
2929
30- set_option linter.unusedVariables.funArgs false in
3130/--
3231Returns the first minimal element among `d` and elements of the array.
33- If `start` and `stop` are given, only the subarray `xs[start: stop]` is
32+ If `start` and `stop` are given, only the subarray `xs[start... stop]` is
3433considered (in addition to `d`).
3534-/
3635@[inline]
37- protected def minWith [ord : Ord α]
36+ protected def rangeMinWith [ord : Ord α]
3837 (xs : Array α) (d : α) (start := 0 ) (stop := xs.size) : α :=
3938 xs.foldl (init := d) (start := start) (stop := stop) fun min x =>
4039 if compare x min |>.isLT then x else min
4140
42- set_option linter.unusedVariables.funArgs false in
41+ @ [inherit_doc Array.rangeMinWith, deprecated Array.rangeMinWith (since := "2026-01-08" )]
42+ protected def minWith := @Array.rangeMinWith
43+
4344/--
4445Find the first minimal element of an array. If the array is empty, `d` is
45- returned. If `start` and `stop` are given, only the subarray `xs[start: stop]` is
46+ returned. If `start` and `stop` are given, only the subarray `xs[start... stop]` is
4647considered.
4748-/
4849@[inline]
49- protected def minD [ord : Ord α]
50+ protected def rangeMinD [ord : Ord α]
5051 (xs : Array α) (d : α) (start := 0 ) (stop := xs.size) : α :=
5152 if h: start < xs.size ∧ start < stop then
52- xs.minWith xs[start] (start + 1 ) stop
53+ xs.rangeMinWith xs[start] (start + 1 ) stop
5354 else
5455 d
5556
56- set_option linter.unusedVariables.funArgs false in
57+ @ [inherit_doc Array.rangeMinD, deprecated Array.rangeMinD (since := "2026-01-08" )]
58+ protected def minD := @Array.rangeMinD
59+
5760/--
5861Find the first minimal element of an array. If the array is empty, `none` is
59- returned. If `start` and `stop` are given, only the subarray `xs[start: stop]` is
62+ returned. If `start` and `stop` are given, only the subarray `xs[start... stop]` is
6063considered.
6164-/
6265@[inline]
63- protected def min ? [ord : Ord α]
66+ protected def rangeMin ? [ord : Ord α]
6467 (xs : Array α) (start := 0 ) (stop := xs.size) : Option α :=
6568 if h : start < xs.size ∧ start < stop then
66- some $ xs.minD xs[start] start stop
69+ some $ xs.rangeMinD xs[start] start stop
6770 else
6871 none
6972
70- set_option linter.unusedVariables.funArgs false in
7173/--
7274Find the first minimal element of an array. If the array is empty, `default` is
73- returned. If `start` and `stop` are given, only the subarray `xs[start: stop]` is
75+ returned. If `start` and `stop` are given, only the subarray `xs[start... stop]` is
7476considered.
7577-/
7678@[inline]
77- protected def minI [ord : Ord α] [Inhabited α]
79+ protected def rangeMinI [ord : Ord α] [Inhabited α]
7880 (xs : Array α) (start := 0 ) (stop := xs.size) : α :=
79- xs.minD default start stop
81+ xs.rangeMinD default start stop
82+
83+ @ [inherit_doc Array.rangeMinI, deprecated Array.rangeMinI (since := "2026-01-08" )]
84+ protected def minI := @Array.rangeMinI
8085
81- set_option linter.unusedVariables.funArgs false in
8286/--
8387Returns the first maximal element among `d` and elements of the array.
84- If `start` and `stop` are given, only the subarray `xs[start: stop]` is
88+ If `start` and `stop` are given, only the subarray `xs[start... stop]` is
8589considered (in addition to `d`).
8690-/
8791@[inline]
88- protected def maxWith [ord : Ord α]
92+ protected def rangeMaxWith [ord : Ord α]
8993 (xs : Array α) (d : α) (start := 0 ) (stop := xs.size) : α :=
90- xs.minWith (ord := ord.opposite) d start stop
94+ xs.rangeMinWith (ord := ord.opposite) d start stop
95+
96+ @ [inherit_doc Array.rangeMaxWith, deprecated Array.rangeMaxWith (since := "2026-01-08" )]
97+ protected def maxWith := @Array.rangeMaxWith
9198
92- set_option linter.unusedVariables.funArgs false in
9399/--
94100Find the first maximal element of an array. If the array is empty, `d` is
95- returned. If `start` and `stop` are given, only the subarray `xs[start: stop]` is
101+ returned. If `start` and `stop` are given, only the subarray `xs[start... stop]` is
96102considered.
97103-/
98104@[inline]
99- protected def maxD [ord : Ord α]
105+ protected def rangeMaxD [ord : Ord α]
100106 (xs : Array α) (d : α) (start := 0 ) (stop := xs.size) : α :=
101- xs.minD (ord := ord.opposite) d start stop
107+ xs.rangeMinD (ord := ord.opposite) d start stop
108+
109+ @ [inherit_doc Array.rangeMaxD, deprecated Array.rangeMaxD (since := "2026-01-08" )]
110+ protected def maxD := @Array.rangeMaxD
102111
103- set_option linter.unusedVariables.funArgs false in
104112/--
105113Find the first maximal element of an array. If the array is empty, `none` is
106- returned. If `start` and `stop` are given, only the subarray `xs[start: stop]` is
114+ returned. If `start` and `stop` are given, only the subarray `xs[start... stop]` is
107115considered.
108116-/
109117@[inline]
110- protected def max ? [ord : Ord α]
118+ protected def rangeMax ? [ord : Ord α]
111119 (xs : Array α) (start := 0 ) (stop := xs.size) : Option α :=
112- xs.min ? (ord := ord.opposite) start stop
120+ xs.rangeMin ? (ord := ord.opposite) start stop
113121
114- set_option linter.unusedVariables.funArgs false in
115122/--
116123Find the first maximal element of an array. If the array is empty, `default` is
117- returned. If `start` and `stop` are given, only the subarray `xs[start: stop]` is
124+ returned. If `start` and `stop` are given, only the subarray `xs[start... stop]` is
118125considered.
119126-/
120127@[inline]
121- protected def maxI [ord : Ord α] [Inhabited α]
128+ protected def rangeMaxI [ord : Ord α] [Inhabited α]
122129 (xs : Array α) (start := 0 ) (stop := xs.size) : α :=
123- xs.minI (ord := ord.opposite) start stop
130+ xs.rangeMinI (ord := ord.opposite) start stop
131+
132+ @ [inherit_doc Array.rangeMaxI, deprecated Array.rangeMaxI (since := "2026-01-08" )]
133+ protected def maxI := @Array.rangeMaxI
124134
125135@ [deprecated set (since := "2026-02-02" )]
126136alias setN := set
0 commit comments