Documentation

Init.Data.Iterators.Lemmas.Combinators.Monadic.Attach

theorem Std.Iterators.IterM.step_attachWith {α : Type w} {m : Type w → Type w'} {β : Type w} {P : βProp} [Iterator α m β] [Monad m] {it : IterM m β} {hP : ∀ (out : β), it.IsPlausibleIndirectOutput outP out} :
(it.attachWith P hP).step = (fun (s : it.Step) => Types.Attach.Monadic.modifyStep (it.attachWith P hP) s, ) <$> it.step
@[simp]
theorem Std.Iterators.IterM.map_unattach_toList_attachWith {α : Type w} {m : Type w → Type w'} {β : Type w} {P : βProp} [Iterator α m β] [Monad m] {it : IterM m β} {hP : ∀ (out : β), it.IsPlausibleIndirectOutput outP out} [Finite α m] [IteratorCollect α m m] [LawfulMonad m] [LawfulIteratorCollect α m m] :
@[simp]
theorem Std.Iterators.IterM.map_unattach_toListRev_attachWith {α : Type w} {m : Type w → Type w'} {β : Type w} {P : βProp} {n : Type u_1 → Type u_2} [Iterator α m β] [Monad m] [Monad n] {it : IterM m β} {hP : ∀ (out : β), it.IsPlausibleIndirectOutput outP out} [Finite α m] [IteratorCollect α m m] [LawfulMonad m] [LawfulIteratorCollect α m m] :
@[simp]
theorem Std.Iterators.IterM.map_unattach_toArray_attachWith {α : Type w} {m : Type w → Type w'} {β : Type w} {P : βProp} {n : Type u_1 → Type u_2} [Iterator α m β] [Monad m] [Monad n] {it : IterM m β} {hP : ∀ (out : β), it.IsPlausibleIndirectOutput outP out} [Finite α m] [IteratorCollect α m m] [LawfulMonad m] [LawfulIteratorCollect α m m] :
(fun (x : Array { out : β // P out }) => Array.map Subtype.val x) <$> (it.attachWith P hP).toArray = it.toArray