Skip to content

Commit 6254bed

Browse files
kim-emleanprover-community-mathlib4-botleanprover-community-mathlib4-botTwoFXnomeata
authored
chore: bump toolchain to v4.27.0-rc1 (#1560)
Co-authored-by: leanprover-community-mathlib4-bot <129911861+leanprover-community-mathlib4-bot@users.noreply.github.com> Co-authored-by: leanprover-community-mathlib4-bot <leanprover-community-mathlib4-bot@users.noreply.github.com> Co-authored-by: Markus Himmel <markus@lean-fro.org> Co-authored-by: Joachim Breitner <mail@joachim-breitner.de> Co-authored-by: mathlib4-bot <github-mathlib4-bot@leanprover.zulipchat.com> Co-authored-by: Mario Carneiro <di.gama@gmail.com> Co-authored-by: Rob23oba <152706811+Rob23oba@users.noreply.github.com> Co-authored-by: Johan Commelin <johan@commelin.net> Co-authored-by: Matthew Ballard <matt@mrb.email> Co-authored-by: Kyle Miller <kmill31415@gmail.com> Co-authored-by: Sebastian Ullrich <sebasti@nullri.ch> Co-authored-by: Mac Malone <mac@lean-fro.org> Co-authored-by: Anne C.A. Baanen <vierkantor@vierkantor.com> Co-authored-by: Paul Reichert <6992158+datokrat@users.noreply.github.com> Co-authored-by: Eric Wieser <wieser.eric@gmail.com> Co-authored-by: github-actions <github-actions@github.com> Co-authored-by: Parth Shastri <31370288+cppio@users.noreply.github.com> Co-authored-by: Joseph Rotella <7482866+jrr6@users.noreply.github.com> Co-authored-by: Sebastian Graf <sgraf1337@gmail.com> Co-authored-by: Marc Huisinga <mhuisi@protonmail.com> Co-authored-by: Eric Wieser <efw@google.com> Co-authored-by: François G. Dorais <fgdorais@gmail.com> Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 2424182 commit 6254bed

File tree

23 files changed

+527
-290
lines changed

23 files changed

+527
-290
lines changed

Batteries.lean

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,4 +113,3 @@ public import Batteries.Util.LibraryNote
113113
public import Batteries.Util.Panic
114114
public import Batteries.Util.Pickle
115115
public import Batteries.Util.ProofWanted
116-
public import Batteries.WF

Batteries/Control/OptionT.lean

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,6 @@ namespace OptionT
2424
@[simp] theorem run_mapConst [Monad m] [LawfulMonad m] (x : OptionT m α) (y : β) :
2525
(Functor.mapConst y x).run = Option.map (Function.const α y) <$> x.run := run_map _ _
2626

27-
@[simp] theorem run_monadMap {n} [MonadFunctorT n m] (f : ∀ {α}, n α → n α) :
28-
(monadMap (@f) x : OptionT m α).run = monadMap (@f) x.run := (rfl)
29-
3027
instance [Monad m] [LawfulMonad m] [MonadStateOf σ m] [LawfulMonadStateOf σ m] :
3128
LawfulMonadStateOf σ (OptionT m) where
3229
modifyGet_eq f := by simp [← liftM_modifyGet, ← liftM_get, LawfulMonadStateOf.modifyGet_eq]

Batteries/Data/AssocList.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ with key equal to `a` to have key `a` and value `f a' b`.
242242
| ForInStep.done d => pure d
243243
| ForInStep.yield d => es.forIn d f
244244

245-
instance : ForIn m (AssocList α β) (α × β) where
245+
instance [Monad m] : ForIn m (AssocList α β) (α × β) where
246246
forIn := AssocList.forIn
247247

248248
@[simp] theorem forIn_eq [Monad m] (l : AssocList α β) (init : δ)

Batteries/Data/BinomialHeap/Basic.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -545,7 +545,7 @@ which iterates over the elements in the heap in increasing order.
545545
protected def forIn [Monad m] (b : BinomialHeap α le) (x : β) (f : α → β → m (ForInStep β)) : m β :=
546546
ForInStep.run <$> b.1.foldM le (.yield x) fun x a => x.bind (f a)
547547

548-
instance : ForIn m (BinomialHeap α le) α := ⟨BinomialHeap.forIn⟩
548+
instance [Monad m] : ForIn m (BinomialHeap α le) α := ⟨BinomialHeap.forIn⟩
549549

550550
/-- `O(log n)`. Returns the smallest element in the heap, or `none` if the heap is empty. -/
551551
@[inline] def head? (b : BinomialHeap α le) : Option α := b.1.head? le

Batteries/Data/ByteSlice.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ where
5151
| ForInStep.done b => pure b
5252
| ForInStep.yield b => loop i (Nat.le_of_succ_le h) b
5353

54-
instance : ForIn m ByteSlice UInt8 where
54+
instance [Monad m] : ForIn m ByteSlice UInt8 where
5555
forIn := ByteSlice.forIn
5656

5757
instance : Std.Stream ByteSlice UInt8 where
@@ -169,7 +169,7 @@ where
169169
| ForInStep.done b => pure b
170170
| ForInStep.yield b => loop i (Nat.le_of_succ_le h) b
171171

172-
instance : ForIn m ByteSubarray UInt8 where
172+
instance [Monad m] : ForIn m ByteSubarray UInt8 where
173173
forIn := ByteSubarray.forIn
174174

175175
instance : Std.Stream ByteSubarray UInt8 where

Batteries/Data/List/Lemmas.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -543,7 +543,7 @@ theorem findIdxs_append :
543543
@[simp, grind =]
544544
theorem findIdxs_take :
545545
((xs : List α).take n).findIdxs p s = (xs.findIdxs p s).take ((xs.take n).countP p) := by
546-
induction xs generalizing n s <;> cases n <;> grind
546+
induction xs generalizing n s <;> cases n <;> grind [countP_eq_length_filter]
547547

548548
@[simp, grind =>]
549549
theorem le_getElem_findIdxs (h : i < ((xs : List α).findIdxs p s).length) :

Batteries/Data/MLList/Basic.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ private local instance [Monad n] : Inhabited (δ → (α → δ → n (ForInStep
115115
| ForInStep.done d => pure d
116116
| ForInStep.yield d => t.forIn d f
117117

118-
instance [Monad m] [MonadLiftT m n] : ForIn n (MLList m α) α where
118+
instance [Monad m] [Monad n] [MonadLiftT m n] : ForIn n (MLList m α) α where
119119
forIn := MLList.forIn
120120

121121
/-- Construct a singleton monadic lazy list from a single monadic value. -/

Batteries/Data/RBMap/Basic.lean

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ where
115115
| nil, b => return ForInStep.yield b
116116
| node _ l v r, b => ForInStep.bindM (visit l b) fun b => ForInStep.bindM (f v b) (visit r ·)
117117

118-
instance : ForIn m (RBNode α) α where
118+
instance [Monad m] : ForIn m (RBNode α) α where
119119
forIn := RBNode.forIn
120120

121121
/--
@@ -658,7 +658,7 @@ instance (α : Type u) (cmp : α → α → Ordering) : Inhabited (RBSet α cmp)
658658
/-- `O(n)`. Run monadic function `f` on each element of the tree (in increasing order). -/
659659
@[inline] def forM [Monad m] (f : α → m PUnit) (t : RBSet α cmp) : m PUnit := t.1.forM f
660660

661-
instance : ForIn m (RBSet α cmp) α where
661+
instance [Monad m] : ForIn m (RBSet α cmp) α where
662662
forIn t := t.1.forIn
663663

664664
instance : Std.ToStream (RBSet α cmp) (RBNode.Stream α) := ⟨fun x => x.1.toStream .nil⟩
@@ -944,7 +944,7 @@ variable {α : Type u} {β : Type v} {σ : Type w} {cmp : α → α → Ordering
944944
@[inline] def forM [Monad m] (f : α → β → m PUnit) (t : RBMap α β cmp) : m PUnit :=
945945
t.1.forM (fun (a, b) => f a b)
946946

947-
instance : ForIn m (RBMap α β cmp) (α × β) := inferInstanceAs (ForIn _ (RBSet ..) _)
947+
instance [Monad m] : ForIn m (RBMap α β cmp) (α × β) := inferInstanceAs (ForIn _ (RBSet ..) _)
948948

949949
instance : Std.ToStream (RBMap α β cmp) (RBNode.Stream (α × β)) :=
950950
inferInstanceAs (Std.ToStream (RBSet ..) _)
@@ -977,10 +977,10 @@ instance : CoeHead (Keys α β cmp) (Array α) := ⟨keysArray⟩
977977

978978
instance : CoeHead (Keys α β cmp) (List α) := ⟨keysList⟩
979979

980-
instance : ForIn m (Keys α β cmp) α where
980+
instance [Monad m] : ForIn m (Keys α β cmp) α where
981981
forIn t init f := t.val.forIn init (f ·.1)
982982

983-
instance : ForM m (Keys α β cmp) α where
983+
instance [Monad m] : ForM m (Keys α β cmp) α where
984984
forM t f := t.val.forM (f ·.1)
985985

986986
/-- The result of `toStream` on a `Keys`. -/
@@ -1026,10 +1026,10 @@ instance : CoeHead (Values α β cmp) (Array β) := ⟨valuesArray⟩
10261026

10271027
instance : CoeHead (Values α β cmp) (List β) := ⟨valuesList⟩
10281028

1029-
instance : ForIn m (Values α β cmp) β where
1029+
instance [Monad m] : ForIn m (Values α β cmp) β where
10301030
forIn t init f := t.val.forIn init (f ·.2)
10311031

1032-
instance : ForM m (Values α β cmp) β where
1032+
instance [Monad m] : ForM m (Values α β cmp) β where
10331033
forM t f := t.val.forM (f ·.2)
10341034

10351035
/-- The result of `toStream` on a `Values`. -/

0 commit comments

Comments
 (0)