@@ -66,7 +66,11 @@ theorem mapM'_eq_mapM [Monad m] [LawfulMonad m] {f : α → m β} {l : List α}
6666 l.mapM (m := m) (pure <| f ·) = pure (l.map f) := by
6767 induction l <;> simp_all
6868
69- @[simp] theorem mapM_id {l : List α} {f : α → Id β} : (l.mapM f).run = l.map (f · |>.run) :=
69+ @[simp] theorem idRun_mapM {l : List α} {f : α → Id β} : (l.mapM f).run = l.map (f · |>.run) :=
70+ mapM_pure
71+
72+ @[deprecated idRun_mapM (since := " 2025-05-21" )]
73+ theorem mapM_id {l : List α} {f : α → Id β} : (l.mapM f).run = l.map (f · |>.run) :=
7074 mapM_pure
7175
7276@[simp] theorem mapM_append [Monad m] [LawfulMonad m] {f : α → m β} {l₁ l₂ : List α} :
@@ -339,12 +343,19 @@ theorem forIn'_eq_foldlM [Monad m] [LawfulMonad m]
339343 simp only [forIn'_eq_foldlM]
340344 induction l.attach generalizing init <;> simp_all
341345
342- @[simp] theorem forIn '_yield_eq_foldl
346+ @[simp] theorem idRun_forIn '_yield_eq_foldl
343347 (l : List α) (f : (a : α) → a ∈ l → β → Id β) (init : β) :
344348 (forIn' l init (fun a m b => .yield <$> f a m b)).run =
345349 l.attach.foldl (fun b ⟨a, h⟩ => f a h b |>.run) init :=
346350 forIn'_pure_yield_eq_foldl _ _
347351
352+ @[deprecated idRun_forIn'_yield_eq_foldl (since := " 2025-05-21" )]
353+ theorem forIn'_yield_eq_foldl
354+ {l : List α} (f : (a : α) → a ∈ l → β → β) (init : β) :
355+ forIn' (m := Id) l init (fun a m b => .yield (f a m b)) =
356+ l.attach.foldl (fun b ⟨a, h⟩ => f a h b) init :=
357+ forIn'_pure_yield_eq_foldl _ _
358+
348359@[simp] theorem forIn'_map [Monad m] [LawfulMonad m]
349360 {l : List α} (g : α → β) (f : (b : β) → b ∈ l.map g → γ → m (ForInStep γ)) :
350361 forIn' (l.map g) init f = forIn' l init fun a h y => f (g a) (mem_map_of_mem h) y := by
@@ -391,12 +402,19 @@ theorem forIn_eq_foldlM [Monad m] [LawfulMonad m]
391402 simp only [forIn_eq_foldlM]
392403 induction l generalizing init <;> simp_all
393404
394- @[simp] theorem forIn_yield_eq_foldl
405+ @[simp] theorem idRun_forIn_yield_eq_foldl
395406 (l : List α) (f : α → β → Id β) (init : β) :
396407 (forIn l init (fun a b => .yield <$> f a b)).run =
397408 l.foldl (fun b a => f a b |>.run) init :=
398409 forIn_pure_yield_eq_foldl _ _
399410
411+ @[deprecated idRun_forIn_yield_eq_foldl (since := " 2025-05-21" )]
412+ theorem forIn_yield_eq_foldl
413+ {l : List α} (f : α → β → β) (init : β) :
414+ forIn (m := Id) l init (fun a b => .yield (f a b)) =
415+ l.foldl (fun b a => f a b) init :=
416+ forIn_pure_yield_eq_foldl _ _
417+
400418@[simp] theorem forIn_map [Monad m] [LawfulMonad m]
401419 {l : List α} {g : α → β} {f : β → γ → m (ForInStep γ)} :
402420 forIn (l.map g) init f = forIn l init fun a y => f (g a) y := by
0 commit comments