Loogle!
Result
Found 501 declarations mentioning Functor.map. Of these, only the first 200 are shown.
- Functor.map 📋 Init.Prelude
{f : Type u → Type v} [self : Functor f] {α β : Type u} : (α → β) → f α → f β - LawfulMonadAttach.canReturn_map_imp 📋 Init.Control.MonadAttach
{m : Type u → Type v} {inst✝ : Monad m} {inst✝¹ : MonadAttach m} [self : LawfulMonadAttach m] {α : Type u} {P : α → Prop} {x : m (Subtype P)} {a : α} : MonadAttach.CanReturn (Subtype.val <$> x) a → P a - LawfulMonadAttach.mk 📋 Init.Control.MonadAttach
{m : Type u → Type v} [Monad m] [MonadAttach m] [toWeaklyLawfulMonadAttach : WeaklyLawfulMonadAttach m] (canReturn_map_imp : ∀ {α : Type u} {P : α → Prop} {x : m (Subtype P)} {a : α}, MonadAttach.CanReturn (Subtype.val <$> x) a → P a) : LawfulMonadAttach m - WeaklyLawfulMonadAttach.map_attach 📋 Init.Control.MonadAttach
{m : Type u → Type v} {inst✝ : Monad m} {inst✝¹ : MonadAttach m} [self : WeaklyLawfulMonadAttach m] {α : Type u} {x : m α} : Subtype.val <$> MonadAttach.attach x = x - WeaklyLawfulMonadAttach.mk 📋 Init.Control.MonadAttach
{m : Type u → Type v} [Monad m] [MonadAttach m] (map_attach : ∀ {α : Type u} {x : m α}, Subtype.val <$> MonadAttach.attach x = x) : WeaklyLawfulMonadAttach m - Option.sequence_some 📋 Init.Data.Option.Basic
{m : Type u_1 → Type u_2} {α : Type u_1} [Applicative m] (f : m α) : (some f).sequence = some <$> f - Option.mapM_some 📋 Init.Data.Option.Basic
{m : Type u_1 → Type u_2} {α : Type u_3} {β : Type u_1} [Applicative m] (x : α) (f : α → m β) : Option.mapM f (some x) = some <$> f x - Functor.map_unit 📋 Init.Control.Lawful.Basic
{f : Type u_1 → Type u_2} [Functor f] [LawfulFunctor f] {a : f PUnit.{u_1 + 1}} : (fun x => PUnit.unit) <$> a = a - id_map' 📋 Init.Control.Lawful.Basic
{f : Type u_1 → Type u_2} {α : Type u_1} [Functor f] [LawfulFunctor f] (x : f α) : (fun a => a) <$> x = x - LawfulFunctor.id_map 📋 Init.Control.Lawful.Basic
{f : Type u → Type v} {inst✝ : Functor f} [self : LawfulFunctor f] {α : Type u} (x : f α) : id <$> x = x - Id.run_map 📋 Init.Control.Lawful.Basic
{α β : Type u_1} (x : Id α) (f : α → β) : (f <$> x).run = f x.run - map_congr 📋 Init.Control.Lawful.Basic
{m : Type u_1 → Type u_2} {α β : Type u_1} [Functor m] {x : m α} {f g : α → β} (h : ∀ (a : α), f a = g a) : f <$> x = g <$> x - LawfulFunctor.map_const 📋 Init.Control.Lawful.Basic
{f : Type u → Type v} {inst✝ : Functor f} [self : LawfulFunctor f] {α β : Type u} : Functor.mapConst = Functor.map ∘ Function.const β - LawfulApplicative.map_pure 📋 Init.Control.Lawful.Basic
{f : Type u → Type v} {inst✝ : Applicative f} [self : LawfulApplicative f] {α β : Type u} (g : α → β) (x : α) : g <$> pure x = pure (g x) - Functor.map_map 📋 Init.Control.Lawful.Basic
{f : Type u_1 → Type u_2} {α β γ : Type u_1} [Functor f] [LawfulFunctor f] (m : α → β) (g : β → γ) (x : f α) : g <$> m <$> x = (fun a => g (m a)) <$> x - LawfulApplicative.pure_seq 📋 Init.Control.Lawful.Basic
{f : Type u → Type v} {inst✝ : Applicative f} [self : LawfulApplicative f] {α β : Type u} (g : α → β) (x : f α) : pure g <*> x = g <$> x - LawfulFunctor.comp_map 📋 Init.Control.Lawful.Basic
{f : Type u → Type v} {inst✝ : Functor f} [self : LawfulFunctor f] {α β γ : Type u} (g : α → β) (h : β → γ) (x : f α) : (h ∘ g) <$> x = h <$> g <$> x - LawfulMonad.map_pure' 📋 Init.Control.Lawful.Basic
{m : Type u_1 → Type u_2} {α β : Type u_1} {f : α → β} [Monad m] [LawfulMonad m] {a : α} : f <$> pure a = pure (f a) - LawfulApplicative.seq_pure 📋 Init.Control.Lawful.Basic
{f : Type u → Type v} {inst✝ : Applicative f} [self : LawfulApplicative f] {α β : Type u} (g : f (α → β)) (x : α) : g <*> pure x = (fun h => h x) <$> g - map_eq_pure_bind 📋 Init.Control.Lawful.Basic
{m : Type u_1 → Type u_2} {α β : Type u_1} [Monad m] [LawfulMonad m] (f : α → β) (x : m α) : f <$> x = do let a ← x pure (f a) - LawfulMonad.bind_pure_comp 📋 Init.Control.Lawful.Basic
{m : Type u → Type v} {inst✝ : Monad m} [self : LawfulMonad m] {α β : Type u} (f : α → β) (x : m α) : (do let a ← x pure (f a)) = f <$> x - LawfulApplicative.seqLeft_eq 📋 Init.Control.Lawful.Basic
{f : Type u → Type v} {inst✝ : Applicative f} [self : LawfulApplicative f] {α β : Type u} (x : f α) (y : f β) : x <* y = Function.const β <$> x <*> y - LawfulApplicative.seqRight_eq 📋 Init.Control.Lawful.Basic
{f : Type u → Type v} {inst✝ : Applicative f} [self : LawfulApplicative f] {α β : Type u} (x : f α) (y : f β) : x *> y = Function.const α id <$> x <*> y - seq_eq_bind 📋 Init.Control.Lawful.Basic
{m : Type u → Type u_1} {α β : Type u} [Monad m] [LawfulMonad m] (mf : m (α → β)) (x : m α) : mf <*> x = do let f ← mf f <$> x - seq_eq_bind_map 📋 Init.Control.Lawful.Basic
{m : Type u → Type u_1} {α β : Type u} [Monad m] [LawfulMonad m] (f : m (α → β)) (x : m α) : f <*> x = do let x_1 ← f x_1 <$> x - LawfulMonad.bind_map 📋 Init.Control.Lawful.Basic
{m : Type u → Type v} {inst✝ : Monad m} [self : LawfulMonad m] {α β : Type u} (f : m (α → β)) (x : m α) : (do let x_1 ← f x_1 <$> x) = f <*> x - bind_map_left 📋 Init.Control.Lawful.Basic
{m : Type u_1 → Type u_2} {α β γ : Type u_1} [Monad m] [LawfulMonad m] (f : α → β) (x : m α) (g : β → m γ) : (do let b ← f <$> x g b) = do let a ← x g (f a) - LawfulMonad.map_map 📋 Init.Control.Lawful.Basic
{α α✝ a✝ : Type u_1} {g : α✝ → a✝} {f : α → α✝} {m : Type u_1 → Type u_2} [Monad m] [LawfulMonad m] {x : m α} : g <$> f <$> x = (fun a => g (f a)) <$> x - map_bind 📋 Init.Control.Lawful.Basic
{m : Type u_1 → Type u_2} {β γ α : Type u_1} [Monad m] [LawfulMonad m] (f : β → γ) (x : m α) (g : α → m β) : f <$> (x >>= g) = do let a ← x f <$> g a - LawfulApplicative.seq_assoc 📋 Init.Control.Lawful.Basic
{f : Type u → Type v} {inst✝ : Applicative f} [self : LawfulApplicative f] {α β γ : Type u} (x : f α) (g : f (α → β)) (h : f (β → γ)) : h <*> (g <*> x) = Function.comp <$> h <*> g <*> x - LawfulFunctor.mk 📋 Init.Control.Lawful.Basic
{f : Type u → Type v} [Functor f] (map_const : ∀ {α β : Type u}, Functor.mapConst = Functor.map ∘ Function.const β) (id_map : ∀ {α : Type u} (x : f α), id <$> x = x) (comp_map : ∀ {α β γ : Type u} (g : α → β) (h : β → γ) (x : f α), (h ∘ g) <$> x = h <$> g <$> x) : LawfulFunctor f - LawfulMonad.mk 📋 Init.Control.Lawful.Basic
{m : Type u → Type v} [Monad m] [toLawfulApplicative : LawfulApplicative m] (bind_pure_comp : ∀ {α β : Type u} (f : α → β) (x : m α), (do let a ← x pure (f a)) = f <$> x) (bind_map : ∀ {α β : Type u} (f : m (α → β)) (x : m α), (do let x_1 ← f x_1 <$> x) = f <*> x) (pure_bind : ∀ {α β : Type u} (x : α) (f : α → m β), pure x >>= f = f x) (bind_assoc : ∀ {α β γ : Type u} (x : m α) (f : α → m β) (g : β → m γ), x >>= f >>= g = x >>= fun x => f x >>= g) : LawfulMonad m - LawfulApplicative.mk 📋 Init.Control.Lawful.Basic
{f : Type u → Type v} [Applicative f] [toLawfulFunctor : LawfulFunctor f] (seqLeft_eq : ∀ {α β : Type u} (x : f α) (y : f β), x <* y = Function.const β <$> x <*> y) (seqRight_eq : ∀ {α β : Type u} (x : f α) (y : f β), x *> y = Function.const α id <$> x <*> y) (pure_seq : ∀ {α β : Type u} (g : α → β) (x : f α), pure g <*> x = g <$> x) (map_pure : ∀ {α β : Type u} (g : α → β) (x : α), g <$> pure x = pure (g x)) (seq_pure : ∀ {α β : Type u} (g : f (α → β)) (x : α), g <*> pure x = (fun h => h x) <$> g) (seq_assoc : ∀ {α β γ : Type u} (x : f α) (g : f (α → β)) (h : f (β → γ)), h <*> (g <*> x) = Function.comp <$> h <*> g <*> x) : LawfulApplicative f - LawfulMonad.mk' 📋 Init.Control.Lawful.Basic
(m : Type u → Type v) [Monad m] (id_map : ∀ {α : Type u} (x : m α), id <$> x = x) (pure_bind : ∀ {α β : Type u} (x : α) (f : α → m β), pure x >>= f = f x) (bind_assoc : ∀ {α β γ : Type u} (x : m α) (f : α → m β) (g : β → m γ), x >>= f >>= g = x >>= fun x => f x >>= g) (map_const : ∀ {α β : Type u} (x : α) (y : m β), Functor.mapConst x y = Function.const β x <$> y := by intros; rfl) (seqLeft_eq : ∀ {α β : Type u} (x : m α) (y : m β), x <* y = do let a ← x let _ ← y pure a := by intros; rfl) (seqRight_eq : ∀ {α β : Type u} (x : m α) (y : m β), x *> y = do let _ ← x y := by intros; rfl) (bind_pure_comp : ∀ {α β : Type u} (f : α → β) (x : m α), (do let y ← x pure (f y)) = f <$> x := by intros; rfl) (bind_map : ∀ {α β : Type u} (f : m (α → β)) (x : m α), (do let x_1 ← f x_1 <$> x) = f <*> x := by intros; rfl) : LawfulMonad m - ExceptT.run_lift 📋 Init.Control.Lawful.Instances
{m : Type u → Type v} {α ε : Type u} [Monad m] (x : m α) : (ExceptT.lift x).run = Except.ok <$> x - OptionT.map_failure 📋 Init.Control.Lawful.Instances
{m : Type u_1 → Type u_2} [Monad m] [LawfulMonad m] {α β : Type u_1} (f : α → β) : f <$> failure = failure - StateT.run'_eq 📋 Init.Control.Lawful.Instances
{m : Type u_1 → Type u_2} {σ α : Type u_1} [Monad m] (x : StateT σ m α) (s : σ) : x.run' s = (fun x => x.1) <$> x.run s - ReaderT.run_map 📋 Init.Control.Lawful.Instances
{m : Type u_1 → Type u_2} {α β ρ : Type u_1} [Monad m] (f : α → β) (x : ReaderT ρ m α) (ctx : ρ) : (f <$> x).run ctx = f <$> x.run ctx - ExceptT.run_adapt 📋 Init.Control.Lawful.Instances
{m : Type u_1 → Type u_2} {ε ε' α : Type u_1} [Monad m] (f : ε → ε') (x : ExceptT ε m α) : (ExceptT.adapt f x).run = Except.mapError f <$> x.run - OptionT.run_map 📋 Init.Control.Lawful.Instances
{m : Type u_1 → Type u_2} {α β : Type u_1} [Monad m] [LawfulMonad m] (f : α → β) (x : OptionT m α) : (f <$> x).run = Option.map f <$> x.run - OptionT.bind_pure_comp 📋 Init.Control.Lawful.Instances
{m : Type u_1 → Type u_2} {α β : Type u_1} [Monad m] (f : α → β) (x : OptionT m α) : x >>= pure ∘ f = f <$> x - OptionT.seq_eq 📋 Init.Control.Lawful.Instances
{m : Type u → Type u_1} {α β : Type u} [Monad m] (mf : OptionT m (α → β)) (x : OptionT m α) : mf <*> x = do let f ← mf f <$> x - ExceptT.run_map 📋 Init.Control.Lawful.Instances
{m : Type u_1 → Type u_2} {α β ε : Type u_1} [Monad m] [LawfulMonad m] (f : α → β) (x : ExceptT ε m α) : (f <$> x).run = Except.map f <$> x.run - ExceptT.map_throw 📋 Init.Control.Lawful.Instances
{m : Type u_1 → Type u_2} {ε : Type u_1} [Monad m] [LawfulMonad m] {α β : Type u_1} (f : α → β) (e : ε) : f <$> throw e = throw e - OptionT.seqLeft_eq 📋 Init.Control.Lawful.Instances
{α β : Type u} {m : Type u → Type v} [Monad m] [LawfulMonad m] (x : OptionT m α) (y : OptionT m β) : x <* y = Function.const β <$> x <*> y - OptionT.seqRight_eq 📋 Init.Control.Lawful.Instances
{m : Type u_1 → Type u_2} {α β : Type u_1} [Monad m] [LawfulMonad m] (x : OptionT m α) (y : OptionT m β) : x *> y = Function.const α id <$> x <*> y - ExceptT.bind_pure_comp 📋 Init.Control.Lawful.Instances
{m : Type u_1 → Type u_2} {α β ε : Type u_1} [Monad m] (f : α → β) (x : ExceptT ε m α) : x >>= pure ∘ f = f <$> x - ExceptT.seq_eq 📋 Init.Control.Lawful.Instances
{m : Type u → Type u_1} {α β ε : Type u} [Monad m] (mf : ExceptT ε m (α → β)) (x : ExceptT ε m α) : mf <*> x = do let f ← mf f <$> x - StateT.run_map 📋 Init.Control.Lawful.Instances
{m : Type u → Type u_1} {α β σ : Type u} [Monad m] [LawfulMonad m] (f : α → β) (x : StateT σ m α) (s : σ) : (f <$> x).run s = (fun p => (f p.1, p.2)) <$> x.run s - OptionT.run_seqLeft 📋 Init.Control.Lawful.Instances
{m : Type u_1 → Type u_2} {α β : Type u_1} [Monad m] [LawfulMonad m] (x : OptionT m α) (y : OptionT m β) : (x <* y).run = Option.elimM x.run (pure none) fun x => Option.map (Function.const β x) <$> y.run - OptionT.run_liftWith 📋 Init.Control.Lawful.Instances
{m : Type u → Type u_1} {α : Type u} [Monad m] [LawfulMonad m] (f : ({β : Type u} → OptionT m β → m (stM m (OptionT m) β)) → m α) : (liftWith f).run = some <$> f fun {β} x => x.run - OptionT.run_seq 📋 Init.Control.Lawful.Instances
{m : Type u_1 → Type u_2} {α β : Type u_1} [Monad m] [LawfulMonad m] (f : OptionT m (α → β)) (x : OptionT m α) : (f <*> x).run = Option.elimM f.run (pure none) fun f => Option.map f <$> x.run - ExceptT.seqLeft_eq 📋 Init.Control.Lawful.Instances
{α β ε : Type u} {m : Type u → Type v} [Monad m] [LawfulMonad m] (x : ExceptT ε m α) (y : ExceptT ε m β) : x <* y = Function.const β <$> x <*> y - StateT.seqLeft_eq 📋 Init.Control.Lawful.Instances
{m : Type u_1 → Type u_2} {σ α β : Type u_1} [Monad m] [LawfulMonad m] (x : StateT σ m α) (y : StateT σ m β) : x <* y = Function.const β <$> x <*> y - ExceptT.seqRight_eq 📋 Init.Control.Lawful.Instances
{m : Type u_1 → Type u_2} {ε α β : Type u_1} [Monad m] [LawfulMonad m] (x : ExceptT ε m α) (y : ExceptT ε m β) : x *> y = Function.const α id <$> x <*> y - StateT.seqRight_eq 📋 Init.Control.Lawful.Instances
{m : Type u_1 → Type u_2} {σ α β : Type u_1} [Monad m] [LawfulMonad m] (x : StateT σ m α) (y : StateT σ m β) : x *> y = Function.const α id <$> x <*> y - ExceptT.run_liftWith 📋 Init.Control.Lawful.Instances
{m : Type u → Type u_1} {ε α : Type u} [Monad m] (f : ({β : Type u} → ExceptT ε m β → m (stM m (ExceptT ε m) β)) → m α) : (liftWith f).run = Except.ok <$> f fun {β} x => x.run - StateT.run_liftWith 📋 Init.Control.Lawful.Instances
{m : Type u → Type u_1} {σ α : Type u} [Monad m] [LawfulMonad m] (f : ({β : Type u} → StateT σ m β → m (stM m (StateT σ m) β)) → m α) (s : σ) : (liftWith f).run s = (fun x => (x, s)) <$> f fun {β} x => x.run s - StateT.run_seq 📋 Init.Control.Lawful.Instances
{m : Type u → Type u_1} {α β σ : Type u} [Monad m] [LawfulMonad m] (f : StateT σ m (α → β)) (x : StateT σ m α) (s : σ) : (f <*> x).run s = do let fs ← f.run s (fun p => (fs.1 p.1, p.2)) <$> x.run fs.2 - map_inj_of_left_inverse 📋 Init.Control.Lawful.Lemmas
{m : Type u_1 → Type u_2} {α β : Type u_1} [Functor m] [LawfulFunctor m] {f : α → β} (w : ∃ g, ∀ (x : α), g (f x) = x) {x y : m α} : f <$> x = f <$> y ↔ x = y - map_inj_right_of_nonempty 📋 Init.Control.Lawful.Lemmas
{m : Type u_1 → Type u_2} {α β : Type u_1} [Functor m] [LawfulFunctor m] [Nonempty α] {f : α → β} (w : ∀ {x y : α}, f x = f y → x = y) {x y : m α} : f <$> x = f <$> y ↔ x = y - map_inj_right 📋 Init.Control.Lawful.Lemmas
{m : Type u_1 → Type u_2} {α β : Type u_1} [Monad m] [LawfulMonad m] {f : α → β} (h : ∀ {x y : α}, f x = f y → x = y) {x y : m α} : f <$> x = f <$> y ↔ x = y - liftM_map 📋 Init.Control.Lawful.MonadLift.Lemmas
{m : Type u → Type v} {n : Type u → Type w} [Monad m] [Monad n] [MonadLiftT m n] [LawfulMonadLiftT m n] {α β : Type u} [LawfulMonad m] [LawfulMonad n] (f : α → β) (ma : m α) : liftM (f <$> ma) = f <$> liftM ma - monadLift_map 📋 Init.Control.Lawful.MonadLift.Lemmas
{m : Type u → Type v} {n : Type u → Type w} [Monad m] [Monad n] [MonadLiftT m n] [LawfulMonadLiftT m n] {α β : Type u} [LawfulMonad m] [LawfulMonad n] (f : α → β) (ma : m α) : monadLift (f <$> ma) = f <$> monadLift ma - LawfulMonadAttach.canReturn_map_imp' 📋 Init.Control.Lawful.MonadAttach.Lemmas
{m : Type u_1 → Type u_2} {α β : Type u_1} {b : β} [Monad m] [LawfulMonad m] [MonadAttach m] [LawfulMonadAttach m] {x : m α} {f : α → β} : MonadAttach.CanReturn (f <$> x) b → ∃ a, MonadAttach.CanReturn x a ∧ f a = b - Option.map_eq_map 📋 Init.Data.Option.Lemmas
{α✝ α✝¹ : Type u_1} {f : α✝ → α✝¹} : Functor.map f = Option.map f - Option.map_apply 📋 Init.Data.Option.Lemmas
{α✝ α✝¹ : Type u_1} {f : α✝ → α✝¹} {x : Option α✝} : f <$> x = Option.map f x - List.getElem?_set_self' 📋 Init.Data.List.Lemmas
{α : Type u_1} {l : List α} {i : ℕ} {a : α} : (l.set i a)[i]? = Function.const α a <$> l[i]? - List.getElem?_set' 📋 Init.Data.List.Lemmas
{α : Type u_1} {l : List α} {i j : ℕ} {a : α} : (l.set i a)[j]? = if i = j then Function.const α a <$> l[j]? else l[j]? - List.allM_eq_not_anyM_not 📋 Init.Data.List.Monadic
{m : Type → Type u_1} {α : Type u_2} [Monad m] [LawfulMonad m] {p : α → m Bool} {as : List α} : List.allM p as = (fun x => !x) <$> List.anyM (fun x => (fun x => !x) <$> p x) as - List.idRun_forIn_yield_eq_foldl 📋 Init.Data.List.Monadic
{α : Type u_1} {β : Type u_2} (l : List α) (f : α → β → Id β) (init : β) : (forIn l init fun a b => ForInStep.yield <$> f a b).run = List.foldl (fun b a => (f a b).run) init l - List.filterMapM_loop_eq 📋 Init.Data.List.Monadic
{m : Type u_1 → Type u_2} {α : Type u_3} {β : Type u_1} [Monad m] [LawfulMonad m] {f : α → m (Option β)} {l : List α} {acc : List β} : List.filterMapM.loop f l acc = (fun x => acc.reverse ++ x) <$> List.filterMapM.loop f l [] - List.mapM_eq_reverse_foldlM_cons 📋 Init.Data.List.Monadic
{m : Type u_1 → Type u_2} {α : Type u_3} {β : Type u_1} [Monad m] [LawfulMonad m] {f : α → m β} {l : List α} : List.mapM f l = List.reverse <$> List.foldlM (fun acc a => (fun x => x :: acc) <$> f a) [] l - List.flatMapM_loop_eq 📋 Init.Data.List.Monadic
{m : Type u_1 → Type u_2} {α : Type u_3} {β : Type u_1} [Monad m] [LawfulMonad m] {f : α → m (List β)} {l : List α} {acc : List (List β)} : List.flatMapM.loop f l acc = (fun x => acc.reverse.flatten ++ x) <$> List.flatMapM.loop f l [] - List.forIn_yield_eq_foldlM 📋 Init.Data.List.Monadic
{m : Type u_1 → Type u_2} {α : Type u_3} {β γ : Type u_1} [Monad m] [LawfulMonad m] {l : List α} (f : α → β → m γ) (g : α → β → γ → β) (init : β) : (forIn l init fun a b => (fun c => ForInStep.yield (g a b c)) <$> f a b) = List.foldlM (fun b a => g a b <$> f a b) init l - List.forIn_eq_foldlM 📋 Init.Data.List.Monadic
{m : Type u_1 → Type u_2} {α : Type u_3} {β : Type u_1} [Monad m] [LawfulMonad m] {l : List α} (f : α → β → m (ForInStep β)) (init : β) : forIn l init f = ForInStep.value <$> List.foldlM (fun b a => match b with | ForInStep.yield b => f a b | ForInStep.done b => pure (ForInStep.done b)) (ForInStep.yield init) l - List.foldlM_cons_eq_append 📋 Init.Data.List.Monadic
{m : Type u_1 → Type u_2} {α : Type u_3} {β : Type u_1} [Monad m] [LawfulMonad m] {f : α → m β} {as : List α} {b : β} {bs : List β} : List.foldlM (fun acc a => (fun x => x :: acc) <$> f a) (b :: bs) as = (fun x => x ++ b :: bs) <$> List.foldlM (fun acc a => (fun x => x :: acc) <$> f a) [] as - List.idRun_forIn'_yield_eq_foldl 📋 Init.Data.List.Monadic
{α : Type u_1} {β : Type u_2} (l : List α) (f : (a : α) → a ∈ l → β → Id β) (init : β) : (forIn' l init fun a m b => ForInStep.yield <$> f a m b).run = List.foldl (fun b x => match x with | ⟨a, h⟩ => (f a h b).run) init l.attach - List.forIn'_eq_foldlM 📋 Init.Data.List.Monadic
{m : Type u_1 → Type u_2} {α : Type u_3} {β : Type u_1} [Monad m] [LawfulMonad m] {l : List α} (f : (a : α) → a ∈ l → β → m (ForInStep β)) (init : β) : forIn' l init f = ForInStep.value <$> List.foldlM (fun b x => match x with | ⟨a, m_1⟩ => match b with | ForInStep.yield b => f a m_1 b | ForInStep.done b => pure (ForInStep.done b)) (ForInStep.yield init) l.attach - List.forIn'_yield_eq_foldlM 📋 Init.Data.List.Monadic
{m : Type u_1 → Type u_2} {α : Type u_3} {β γ : Type u_1} [Monad m] [LawfulMonad m] {l : List α} (f : (a : α) → a ∈ l → β → m γ) (g : (a : α) → a ∈ l → β → γ → β) (init : β) : (forIn' l init fun a m_1 b => (fun c => ForInStep.yield (g a m_1 b c)) <$> f a m_1 b) = List.foldlM (fun b x => match x with | ⟨a, m_1⟩ => g a m_1 b <$> f a m_1 b) init l.attach - List.zipWithAll_map_left 📋 Init.Data.List.Zip
{α : Type u_1} {β : Type u_2} {α' : Type u_1} {γ : Type u_3} {l₁ : List α} {l₂ : List β} {f : α → α'} {g : Option α' → Option β → γ} : List.zipWithAll g (List.map f l₁) l₂ = List.zipWithAll (fun a b => g (f <$> a) b) l₁ l₂ - List.zipWithAll_map_right 📋 Init.Data.List.Zip
{α : Type u_1} {β β' : Type u_2} {γ : Type u_3} {l₁ : List α} {l₂ : List β} {f : β → β'} {g : Option α → Option β' → γ} : List.zipWithAll g l₁ (List.map f l₂) = List.zipWithAll (fun a b => g a (f <$> b)) l₁ l₂ - List.zipWithAll_map 📋 Init.Data.List.Zip
{γ : Type u_1} {δ : Type u_2} {α : Type u_1} {β : Type u_2} {μ : Type u_3} {f : Option γ → Option δ → μ} {g : α → γ} {h : β → δ} {l₁ : List α} {l₂ : List β} : List.zipWithAll f (List.map g l₁) (List.map h l₂) = List.zipWithAll (fun a b => f (g <$> a) (h <$> b)) l₁ l₂ - List.getElem?_modify_eq 📋 Init.Data.List.Nat.Modify
{α : Type u_1} (f : α → α) (i : ℕ) (l : List α) : (l.modify i f)[i]? = f <$> l[i]? - List.getElem?_modify 📋 Init.Data.List.Nat.Modify
{α : Type u_1} (f : α → α) (i : ℕ) (l : List α) (j : ℕ) : (l.modify i f)[j]? = (fun a => if i = j then f a else a) <$> l[j]? - Array.mapM_eq_mapM_toList 📋 Init.Data.Array.Lemmas
{m : Type u_1 → Type u_2} {α : Type u_3} {β : Type u_1} [Monad m] [LawfulMonad m] {f : α → m β} {xs : Array α} : Array.mapM f xs = List.toArray <$> List.mapM f xs.toList - Array.toList_mapM 📋 Init.Data.Array.Lemmas
{m : Type u_1 → Type u_2} {α : Type u_3} {β : Type u_1} [Monad m] [LawfulMonad m] {f : α → m β} {xs : Array α} : Array.toList <$> Array.mapM f xs = List.mapM f xs.toList - List.mapM_toArray 📋 Init.Data.Array.Lemmas
{m : Type u_1 → Type u_2} {α : Type u_3} {β : Type u_1} [Monad m] [LawfulMonad m] {f : α → m β} {l : List α} : Array.mapM f l.toArray = List.toArray <$> List.mapM f l - Array.mapM_eq_foldlM 📋 Init.Data.Array.Lemmas
{m : Type u_1 → Type u_2} {α : Type u_3} {β : Type u_1} [Monad m] [LawfulMonad m] {f : α → m β} {xs : Array α} : Array.mapM f xs = Array.foldlM (fun bs a => bs.push <$> f a) #[] xs - Array.allM_eq_not_anyM_not 📋 Init.Data.Array.Lemmas
{m : Type → Type u_1} {α : Type u_2} [Monad m] [LawfulMonad m] {p : α → m Bool} {as : Array α} : Array.allM p as = (fun x => !x) <$> Array.anyM (fun x => (fun x => !x) <$> p x) as - List.foldlM_push_eq_append 📋 Init.Data.Array.Lemmas
{m : Type u_1 → Type u_2} {α : Type u_3} {β : Type u_1} [Monad m] [LawfulMonad m] {l : List α} {f : α → m β} {xs : Array β} : List.foldlM (fun xs x => xs.push <$> f x) xs l = do let __do_lift ← List.mapM f l pure (xs ++ __do_lift.toArray) - List.foldrM_push_eq_append 📋 Init.Data.Array.Lemmas
{m : Type u_1 → Type u_2} {α : Type u_3} {β : Type u_1} [Monad m] [LawfulMonad m] {l : List α} {f : α → m β} {xs : Array β} : List.foldrM (fun x xs => xs.push <$> f x) xs l = do let __do_lift ← List.mapM f l.reverse pure (xs ++ __do_lift.toArray) - Std.Internal.LawfulMonadLiftFunction.lift_map 📋 Init.Data.Iterators.Internal.LawfulMonadLiftFunction
{m : Type u → Type v} {n : Type u → Type w} [Monad m] [Monad n] {lift : ⦃α : Type u⦄ → m α → n α} {α β : Type u} [LawfulMonad m] [LawfulMonad n] [Std.Internal.LawfulMonadLiftFunction lift] (f : α → β) (ma : m α) : lift (f <$> ma) = f <$> lift ma - Std.IterM.toList_toArray 📋 Init.Data.Iterators.Lemmas.Consumers.Monadic.Collect
{α β : Type w} {m : Type w → Type w'} [Monad m] [Std.Iterator α m β] [Std.Iterators.Finite α m] {it : Std.IterM m β} : Array.toList <$> it.toArray = it.toList - Std.IterM.reverse_toListRev 📋 Init.Data.Iterators.Lemmas.Consumers.Monadic.Collect
{α β : Type w} {m : Type w → Type w'} [Monad m] [LawfulMonad m] [Std.Iterator α m β] [Std.Iterators.Finite α m] {it : Std.IterM m β} : List.reverse <$> it.toListRev = it.toList - Std.IterM.toArray_toList 📋 Init.Data.Iterators.Lemmas.Consumers.Monadic.Collect
{α β : Type w} {m : Type w → Type w'} [Monad m] [LawfulMonad m] [Std.Iterator α m β] [Std.Iterators.Finite α m] {it : Std.IterM m β} : List.toArray <$> it.toList = it.toArray - Std.IterM.toListRev_eq 📋 Init.Data.Iterators.Lemmas.Consumers.Monadic.Collect
{α β : Type w} {m : Type w → Type w'} [Monad m] [LawfulMonad m] [Std.Iterator α m β] [Std.Iterators.Finite α m] {it : Std.IterM m β} : it.toListRev = List.reverse <$> it.toList - Std.IterM.toList_toArray_ensureTermination 📋 Init.Data.Iterators.Lemmas.Consumers.Monadic.Collect
{α β : Type w} {m : Type w → Type w'} [Monad m] [Std.Iterator α m β] [Std.Iterators.Finite α m] {it : Std.IterM m β} : Array.toList <$> it.ensureTermination.toArray = it.toList - Std.IterM.reverse_toListRev_ensureTermination 📋 Init.Data.Iterators.Lemmas.Consumers.Monadic.Collect
{α β : Type w} {m : Type w → Type w'} [Monad m] [LawfulMonad m] [Std.Iterator α m β] [Std.Iterators.Finite α m] {it : Std.IterM m β} : List.reverse <$> it.ensureTermination.toListRev = it.toList - Std.IterM.toArray_toList_ensureTermination 📋 Init.Data.Iterators.Lemmas.Consumers.Monadic.Collect
{α β : Type w} {m : Type w → Type w'} [Monad m] [LawfulMonad m] [Std.Iterator α m β] [Std.Iterators.Finite α m] {it : Std.IterM m β} : List.toArray <$> it.ensureTermination.toList = it.toArray - Std.IterM.toListRev_ensureTermination 📋 Init.Data.Iterators.Lemmas.Consumers.Monadic.Collect
{α β : Type w} {m : Type w → Type w'} [Monad m] [LawfulMonad m] [Std.Iterator α m β] [Std.Iterators.Finite α m] {it : Std.IterM m β} : it.ensureTermination.toListRev = List.reverse <$> it.toList - Std.IterM.drain_eq_map_toArray 📋 Init.Data.Iterators.Lemmas.Consumers.Monadic.Loop
{α β : Type w} {m : Type w → Type w'} [Std.Iterator α m β] [Std.Iterators.Finite α m] [Monad m] [LawfulMonad m] [Std.IteratorLoop α m m] [Std.LawfulIteratorLoop α m m] {it : Std.IterM m β} : it.drain = (fun x => PUnit.unit) <$> it.toList - Std.IterM.drain_eq_map_toList 📋 Init.Data.Iterators.Lemmas.Consumers.Monadic.Loop
{α β : Type w} {m : Type w → Type w'} [Std.Iterator α m β] [Std.Iterators.Finite α m] [Monad m] [LawfulMonad m] [Std.IteratorLoop α m m] [Std.LawfulIteratorLoop α m m] {it : Std.IterM m β} : it.drain = (fun x => PUnit.unit) <$> it.toList - Std.IterM.drain_eq_map_toListRev 📋 Init.Data.Iterators.Lemmas.Consumers.Monadic.Loop
{α β : Type w} {m : Type w → Type w'} [Std.Iterator α m β] [Std.Iterators.Finite α m] [Monad m] [LawfulMonad m] [Std.IteratorLoop α m m] [Std.LawfulIteratorLoop α m m] {it : Std.IterM m β} : it.drain = (fun x => PUnit.unit) <$> it.toListRev - Std.IterM.up_length_toListRev_eq_count 📋 Init.Data.Iterators.Lemmas.Consumers.Monadic.Loop
{m : Type u_1 → Type u_2} {α β : Type u_1} [Std.Iterator α m β] [Std.Iterators.Finite α m] [Monad m] [LawfulMonad m] [Std.IteratorLoop α m m] [Std.LawfulIteratorLoop α m m] {it : Std.IterM m β} : (fun x => { down := x.length }) <$> it.toListRev = it.length - Std.IterM.up_length_toListRev_eq_length 📋 Init.Data.Iterators.Lemmas.Consumers.Monadic.Loop
{m : Type w → Type u_1} {α β : Type w} [Std.Iterator α m β] [Std.Iterators.Finite α m] [Monad m] [LawfulMonad m] [Std.IteratorLoop α m m] [Std.LawfulIteratorLoop α m m] {it : Std.IterM m β} : (fun x => { down := x.length }) <$> it.toListRev = it.length - Std.IterM.up_length_toList_eq_count 📋 Init.Data.Iterators.Lemmas.Consumers.Monadic.Loop
{m : Type u_1 → Type u_2} {α β : Type u_1} [Std.Iterator α m β] [Std.Iterators.Finite α m] [Monad m] [LawfulMonad m] [Std.IteratorLoop α m m] [Std.LawfulIteratorLoop α m m] {it : Std.IterM m β} : (fun x => { down := x.length }) <$> it.toList = it.length - Std.IterM.up_length_toList_eq_length 📋 Init.Data.Iterators.Lemmas.Consumers.Monadic.Loop
{m : Type w → Type u_1} {α β : Type w} [Std.Iterator α m β] [Std.Iterators.Finite α m] [Monad m] [LawfulMonad m] [Std.IteratorLoop α m m] [Std.LawfulIteratorLoop α m m] {it : Std.IterM m β} : (fun x => { down := x.length }) <$> it.toList = it.length - Std.IterM.up_size_toArray_eq_count 📋 Init.Data.Iterators.Lemmas.Consumers.Monadic.Loop
{m : Type u_1 → Type u_2} {α β : Type u_1} [Std.Iterator α m β] [Std.Iterators.Finite α m] [Monad m] [LawfulMonad m] [Std.IteratorLoop α m m] [Std.LawfulIteratorLoop α m m] {it : Std.IterM m β} : (fun x => { down := x.size }) <$> it.toArray = it.length - Std.IterM.up_size_toArray_eq_length 📋 Init.Data.Iterators.Lemmas.Consumers.Monadic.Loop
{m : Type w → Type u_1} {α β : Type w} [Std.Iterator α m β] [Std.Iterators.Finite α m] [Monad m] [LawfulMonad m] [Std.IteratorLoop α m m] [Std.LawfulIteratorLoop α m m] {it : Std.IterM m β} : (fun x => { down := x.size }) <$> it.toArray = it.length - Std.IterM.foldl_toList 📋 Init.Data.Iterators.Lemmas.Consumers.Monadic.Loop
{m : Type w → Type u_1} {γ α β : Type w} [Monad m] [LawfulMonad m] [Std.Iterator α m β] [Std.Iterators.Finite α m] [Std.IteratorLoop α m m] [Std.LawfulIteratorLoop α m m] {it : Std.IterM m β} {f : γ → β → γ} {init : γ} : (fun x => List.foldl f init x) <$> it.toList = Std.IterM.fold f init it - Std.IterM.all_eq_not_any_not 📋 Init.Data.Iterators.Lemmas.Consumers.Monadic.Loop
{α β : Type w} {m : Type w → Type w'} [Std.Iterator α m β] [Std.Iterators.Finite α m] [Monad m] [LawfulMonad m] [Std.IteratorLoop α m m] [Std.LawfulIteratorLoop α m m] {it : Std.IterM m β} {p : β → Bool} : Std.IterM.all p it = (fun x => { down := !x.down }) <$> Std.IterM.any (fun x => !p x) it - Std.IterM.foldM_eq_forIn 📋 Init.Data.Iterators.Lemmas.Consumers.Monadic.Loop
{α β γ : Type w} {m : Type w → Type w'} [Std.Iterator α m β] [Std.Iterators.Finite α m] {n : Type w → Type w''} [Monad n] [Std.IteratorLoop α m n] [MonadLiftT m n] {f : γ → β → n γ} {init : γ} {it : Std.IterM m β} : Std.IterM.foldM f init it = forIn it init fun x acc => ForInStep.yield <$> f acc x - Std.IterM.foldl_toArray 📋 Init.Data.Iterators.Lemmas.Consumers.Monadic.Loop
{m : Type w → Type u_1} {γ α β : Type w} [Monad m] [LawfulMonad m] [Std.Iterator α m β] [Std.Iterators.Finite α m] [Std.IteratorLoop α m m] [Std.LawfulIteratorLoop α m m] {it : Std.IterM m β} {f : γ → β → γ} {init : γ} : (fun x => Array.foldl f init x) <$> it.toArray = Std.IterM.fold f init it - Std.IterM.fold_hom 📋 Init.Data.Iterators.Lemmas.Consumers.Monadic.Loop
{α β γ₁ γ₂ : Type w} {m : Type w → Type w'} [Std.Iterator α m β] [Std.Iterators.Finite α m] [Monad m] [LawfulMonad m] [Std.IteratorLoop α m m] [Std.LawfulIteratorLoop α m m] {it : Std.IterM m β} (f : γ₁ → γ₂) {g₁ : γ₁ → β → γ₁} {g₂ : γ₂ → β → γ₂} {init : γ₁} (H : ∀ (x : γ₁) (y : β), g₂ (f x) y = f (g₁ x y)) : Std.IterM.fold g₂ (f init) it = f <$> Std.IterM.fold g₁ init it - Std.IterM.allM_eq_not_anyM_not 📋 Init.Data.Iterators.Lemmas.Consumers.Monadic.Loop
{α β : Type w} {m : Type w → Type w'} [Std.Iterator α m β] [Std.Iterators.Finite α m] [Monad m] [LawfulMonad m] [Std.IteratorLoop α m m] [Std.LawfulIteratorLoop α m m] {it : Std.IterM m β} {p : β → m (ULift.{w, 0} Bool)} : Std.IterM.allM p it = (fun x => { down := !x.down }) <$> Std.IterM.anyM (fun x => (fun x => { down := !x.down }) <$> p x) it - Std.IterM.forIn_yield_eq_foldM 📋 Init.Data.Iterators.Lemmas.Consumers.Monadic.Loop
{α β γ δ : Type w} {m : Type w → Type w'} [Std.Iterator α m β] [Std.Iterators.Finite α m] {n : Type w → Type w''} [Monad m] [Monad n] [LawfulMonad n] [Std.IteratorLoop α m n] [Std.LawfulIteratorLoop α m n] [MonadLiftT m n] {f : β → γ → n δ} {g : β → γ → δ → γ} {init : γ} {it : Std.IterM m β} : (forIn it init fun c b => (fun d => ForInStep.yield (g c b d)) <$> f c b) = Std.IterM.foldM (fun b c => g c b <$> f c b) init it - Array.toList_filterM 📋 Init.Data.Array.Monadic
{m : Type → Type u_1} {α : Type} [Monad m] [LawfulMonad m] {xs : Array α} {p : α → m Bool} : Array.toList <$> Array.filterM p xs = List.filterM p xs.toList - Array.toList_filterRevM 📋 Init.Data.Array.Monadic
{m : Type → Type u_1} {α : Type} [Monad m] [LawfulMonad m] {xs : Array α} {p : α → m Bool} : Array.toList <$> Array.filterRevM p xs = List.filterRevM p xs.toList - Array.map_toList_inj 📋 Init.Data.Array.Monadic
{m : Type u_1 → Type u_2} {α : Type u_1} [Monad m] [LawfulMonad m] {xs ys : m (Array α)} : Array.toList <$> xs = Array.toList <$> ys ↔ xs = ys - List.filterM_toArray 📋 Init.Data.Array.Monadic
{m : Type → Type u_1} {α : Type} [Monad m] [LawfulMonad m] {l : List α} {p : α → m Bool} : Array.filterM p l.toArray = List.toArray <$> List.filterM p l - List.filterRevM_toArray 📋 Init.Data.Array.Monadic
{m : Type → Type u_1} {α : Type} [Monad m] [LawfulMonad m] {l : List α} {p : α → m Bool} : Array.filterRevM p l.toArray = List.toArray <$> List.filterRevM p l - Array.toList_filterMapM 📋 Init.Data.Array.Monadic
{m : Type u_1 → Type u_2} {α : Type u_3} {β : Type u_1} [Monad m] [LawfulMonad m] {xs : Array α} {f : α → m (Option β)} : Array.toList <$> Array.filterMapM f xs = List.filterMapM f xs.toList - List.filterM_toArray' 📋 Init.Data.Array.Monadic
{m : Type → Type u_1} {α : Type} {stop : ℕ} [Monad m] [LawfulMonad m] {l : List α} {p : α → m Bool} (w : stop = l.length) : Array.filterM p l.toArray 0 stop = List.toArray <$> List.filterM p l - List.filterRevM_toArray' 📋 Init.Data.Array.Monadic
{m : Type → Type u_1} {α : Type} {start : ℕ} [Monad m] [LawfulMonad m] {l : List α} {p : α → m Bool} (w : start = l.length) : Array.filterRevM p l.toArray start = List.toArray <$> List.filterRevM p l - List.filterMapM_toArray 📋 Init.Data.Array.Monadic
{m : Type u_1 → Type u_2} {α : Type u_3} {β : Type u_1} [Monad m] [LawfulMonad m] {l : List α} {f : α → m (Option β)} : Array.filterMapM f l.toArray = List.toArray <$> List.filterMapM f l - List.filterMapM_toArray' 📋 Init.Data.Array.Monadic
{m : Type u_1 → Type u_2} {α : Type u_3} {β : Type u_1} {stop : ℕ} [Monad m] [LawfulMonad m] {l : List α} {f : α → m (Option β)} (w : stop = l.length) : Array.filterMapM f l.toArray 0 stop = List.toArray <$> List.filterMapM f l - Array.toList_flatMapM 📋 Init.Data.Array.Monadic
{m : Type u_1 → Type u_2} {α : Type u_3} {β : Type u_1} [Monad m] [LawfulMonad m] {xs : Array α} {f : α → m (Array β)} : Array.toList <$> Array.flatMapM f xs = List.flatMapM (fun a => Array.toList <$> f a) xs.toList - List.flatMapM_toArray 📋 Init.Data.Array.Monadic
{m : Type u_1 → Type u_2} {α : Type u_3} {β : Type u_1} [Monad m] [LawfulMonad m] {l : List α} {f : α → m (Array β)} : Array.flatMapM f l.toArray = List.toArray <$> List.flatMapM (fun a => Array.toList <$> f a) l - Array.idRun_forIn_yield_eq_foldl 📋 Init.Data.Array.Monadic
{α : Type u_1} {β : Type u_2} {xs : Array α} (f : α → β → Id β) (init : β) : (forIn xs init fun a b => ForInStep.yield <$> f a b).run = Array.foldl (fun b a => (f a b).run) init xs - Array.forIn_yield_eq_foldlM 📋 Init.Data.Array.Monadic
{m : Type u_1 → Type u_2} {α : Type u_3} {β γ : Type u_1} [Monad m] [LawfulMonad m] {xs : Array α} (f : α → β → m γ) (g : α → β → γ → β) (init : β) : (forIn xs init fun a b => (fun c => ForInStep.yield (g a b c)) <$> f a b) = Array.foldlM (fun b a => g a b <$> f a b) init xs - Array.forIn_eq_foldlM 📋 Init.Data.Array.Monadic
{m : Type u_1 → Type u_2} {α : Type u_3} {β : Type u_1} [Monad m] [LawfulMonad m] {xs : Array α} (f : α → β → m (ForInStep β)) (init : β) : forIn xs init f = ForInStep.value <$> Array.foldlM (fun b a => match b with | ForInStep.yield b => f a b | ForInStep.done b => pure (ForInStep.done b)) (ForInStep.yield init) xs - Array.idRun_forIn'_yield_eq_foldl 📋 Init.Data.Array.Monadic
{α : Type u_1} {β : Type u_2} {xs : Array α} (f : (a : α) → a ∈ xs → β → Id β) (init : β) : (forIn' xs init fun a m b => ForInStep.yield <$> f a m b).run = Array.foldl (fun b x => match x with | ⟨a, h⟩ => (f a h b).run) init xs.attach - Array.forIn'_eq_foldlM 📋 Init.Data.Array.Monadic
{m : Type u_1 → Type u_2} {α : Type u_3} {β : Type u_1} [Monad m] [LawfulMonad m] {xs : Array α} (f : (a : α) → a ∈ xs → β → m (ForInStep β)) (init : β) : forIn' xs init f = ForInStep.value <$> Array.foldlM (fun b x => match x with | ⟨a, m_1⟩ => match b with | ForInStep.yield b => f a m_1 b | ForInStep.done b => pure (ForInStep.done b)) (ForInStep.yield init) xs.attach - Array.forIn'_yield_eq_foldlM 📋 Init.Data.Array.Monadic
{m : Type u_1 → Type u_2} {α : Type u_3} {β γ : Type u_1} [Monad m] [LawfulMonad m] {xs : Array α} (f : (a : α) → a ∈ xs → β → m γ) (g : (a : α) → a ∈ xs → β → γ → β) (init : β) : (forIn' xs init fun a m_1 b => (fun c => ForInStep.yield (g a m_1 b c)) <$> f a m_1 b) = Array.foldlM (fun b x => match x with | ⟨a, m_1⟩ => g a m_1 b <$> f a m_1 b) init xs.attach - Array.toList_ofFnM 📋 Init.Data.Array.OfFn
{m : Type u_1 → Type u_2} {n : ℕ} {α : Type u_1} [Monad m] [LawfulMonad m] {f : Fin n → m α} : Array.toList <$> Array.ofFnM f = List.ofFnM f - Array.toList_mapIdxM 📋 Init.Data.Array.MapIdx
{m : Type u_1 → Type u_2} {α : Type u_3} {β : Type u_1} [Monad m] [LawfulMonad m] {xs : Array α} {f : ℕ → α → m β} : Array.toList <$> Array.mapIdxM f xs = List.mapIdxM f xs.toList - List.mapIdxM_toArray 📋 Init.Data.Array.MapIdx
{m : Type u_1 → Type u_2} {α : Type u_3} {β : Type u_1} [Monad m] [LawfulMonad m] {l : List α} {f : ℕ → α → m β} : Array.mapIdxM f l.toArray = List.toArray <$> List.mapIdxM f l - Array.toList_mapFinIdxM 📋 Init.Data.Array.MapIdx
{m : Type u_1 → Type u_2} {α : Type u_3} {β : Type u_1} [Monad m] [LawfulMonad m] {xs : Array α} {f : (i : ℕ) → α → i < xs.size → m β} : Array.toList <$> xs.mapFinIdxM f = xs.toList.mapFinIdxM f - List.mapFinIdxM_toArray 📋 Init.Data.Array.MapIdx
{m : Type u_1 → Type u_2} {α : Type u_3} {β : Type u_1} [Monad m] [LawfulMonad m] {l : List α} {f : (i : ℕ) → α → i < l.length → m β} : l.toArray.mapFinIdxM f = List.toArray <$> l.mapFinIdxM f - Std.Iterators.PostconditionT.run_eq_map 📋 Init.Data.Iterators.PostconditionMonad
{m : Type w → Type w'} [Monad m] {α : Type w} {x : Std.Iterators.PostconditionT m α} : x.run = Subtype.val <$> x.operation - Std.Iterators.PostconditionT.operation_eq_map_mk_operation 📋 Init.Data.Iterators.PostconditionMonad
{α : Type w} {m : Type w → Type w'} [Monad m] [LawfulMonad m] {x : Std.Iterators.PostconditionT m α} : x.operation = (fun a => ⟨↑a, ⋯⟩) <$> x.operation - Std.Iterators.PostconditionT.operation_lift 📋 Init.Data.Iterators.PostconditionMonad
{m : Type w → Type w'} [Functor m] {α : Type w} {x : m α} : (Std.Iterators.PostconditionT.lift x).operation = (fun x_1 => ⟨x_1, ⋯⟩) <$> x - Std.Iterators.PostconditionT.ext 📋 Init.Data.Iterators.PostconditionMonad
{m : Type w → Type w'} [Monad m] [LawfulMonad m] {α : Type w} {x y : Std.Iterators.PostconditionT m α} (h : x.Property = y.Property) (h' : (fun p => ⟨↑p, ⋯⟩) <$> x.operation = y.operation) : x = y - Std.Iterators.PostconditionT.ext_iff 📋 Init.Data.Iterators.PostconditionMonad
{m : Type w → Type w'} [Monad m] [LawfulMonad m] {α : Type w} {x y : Std.Iterators.PostconditionT m α} : x = y ↔ ∃ (h : x.Property = y.Property), (fun p => ⟨↑p, ⋯⟩) <$> x.operation = y.operation - Std.Iterators.PostconditionT.operation_bind 📋 Init.Data.Iterators.PostconditionMonad
{m : Type w → Type w'} [Monad m] {α β : Type w} {x : Std.Iterators.PostconditionT m α} {f : α → Std.Iterators.PostconditionT m β} : (x.bind f).operation = do let a ← x.operation (fun fa => ⟨↑fa, ⋯⟩) <$> (f ↑a).operation - Std.Iterators.PostconditionT.operation_bind' 📋 Init.Data.Iterators.PostconditionMonad
{m : Type w → Type w'} [Monad m] {α β : Type w} {x : Std.Iterators.PostconditionT m α} {f : α → Std.Iterators.PostconditionT m β} : (x >>= f).operation = do let a ← x.operation (fun fa => ⟨↑fa, ⋯⟩) <$> (f ↑a).operation - Std.Iterators.PostconditionT.operation_map 📋 Init.Data.Iterators.PostconditionMonad
{m : Type w → Type w'} [Functor m] {α β : Type w} {x : Std.Iterators.PostconditionT m α} {f : α → β} : (Std.Iterators.PostconditionT.map f x).operation = (fun a => ⟨f ↑a, ⋯⟩) <$> x.operation - Std.IterM.toListRev_filterMapWithPostcondition 📋 Init.Data.Iterators.Lemmas.Combinators.Monadic.FilterMap
{α β γ : Type w} {m : Type w → Type w'} [Monad m] [LawfulMonad m] [Std.Iterator α Id β] [Std.Iterators.Finite α Id] {f : β → Std.Iterators.PostconditionT m (Option γ)} (it : Std.IterM Id β) : (Std.IterM.filterMapWithPostcondition f it).toListRev = List.reverse <$> List.filterMapM (fun x => (f x).run) it.toList.run - Std.IterM.toListRev_filterMap 📋 Init.Data.Iterators.Lemmas.Combinators.Monadic.FilterMap
{α β γ : Type w} {m : Type w → Type w'} [Monad m] [LawfulMonad m] [Std.Iterator α m β] [Std.Iterators.Finite α m] {f : β → Option γ} (it : Std.IterM m β) : (Std.IterM.filterMap f it).toListRev = (fun x => List.filterMap f x) <$> it.toListRev - Std.IterM.toList_filterMap 📋 Init.Data.Iterators.Lemmas.Combinators.Monadic.FilterMap
{α β γ : Type w} {m : Type w → Type w'} [Monad m] [LawfulMonad m] [Std.Iterator α m β] [Std.Iterators.Finite α m] {f : β → Option γ} (it : Std.IterM m β) : (Std.IterM.filterMap f it).toList = (fun x => List.filterMap f x) <$> it.toList - Std.IterM.InternalConsumers.toList_filterMap 📋 Init.Data.Iterators.Lemmas.Combinators.Monadic.FilterMap
{α β γ : Type w} {m : Type w → Type w'} [Monad m] [LawfulMonad m] [Std.Iterator α m β] [Std.Iterators.Finite α m] {f : β → Option γ} (it : Std.IterM m β) : (Std.IterM.filterMap f it).toList = (fun x => List.filterMap f x) <$> it.toList - Std.IterM.toArray_map 📋 Init.Data.Iterators.Lemmas.Combinators.Monadic.FilterMap
{α β γ : Type w} {m : Type w → Type w'} [Monad m] [LawfulMonad m] [Std.Iterator α m β] [Std.Iterators.Finite α m] {f : β → γ} (it : Std.IterM m β) : (Std.IterM.map f it).toArray = (fun x => Array.map f x) <$> it.toArray - Std.IterM.toListRev_map 📋 Init.Data.Iterators.Lemmas.Combinators.Monadic.FilterMap
{α β γ : Type w} {m : Type w → Type w'} [Monad m] [LawfulMonad m] [Std.Iterator α m β] [Std.Iterators.Finite α m] {f : β → γ} (it : Std.IterM m β) : (Std.IterM.map f it).toListRev = (fun x => List.map f x) <$> it.toListRev - Std.IterM.toListRev_mapWithPostcondition 📋 Init.Data.Iterators.Lemmas.Combinators.Monadic.FilterMap
{α β γ : Type w} {m : Type w → Type w'} [Monad m] [LawfulMonad m] [Std.Iterator α Id β] [Std.Iterators.Finite α Id] {f : β → Std.Iterators.PostconditionT m γ} (it : Std.IterM Id β) : (Std.IterM.mapWithPostcondition f it).toListRev = List.reverse <$> List.mapM (fun x => (f x).run) it.toList.run - Std.IterM.toList_map 📋 Init.Data.Iterators.Lemmas.Combinators.Monadic.FilterMap
{α β β' : Type w} {m : Type w → Type w'} [Monad m] [LawfulMonad m] [Std.Iterator α m β] [Std.Iterators.Finite α m] {f : β → β'} (it : Std.IterM m β) : (Std.IterM.map f it).toList = (fun x => List.map f x) <$> it.toList - Std.IterM.toArray_filterMap 📋 Init.Data.Iterators.Lemmas.Combinators.Monadic.FilterMap
{α β γ : Type w} {m : Type w → Type w'} [Monad m] [LawfulMonad m] [Std.Iterator α m β] [Std.Iterators.Finite α m] {f : β → Option γ} (it : Std.IterM m β) : (Std.IterM.filterMap f it).toArray = (fun x => Array.filterMap f x) <$> it.toArray - Std.IterM.toListRev_filterMapM 📋 Init.Data.Iterators.Lemmas.Combinators.Monadic.FilterMap
{α β γ : Type w} {m : Type w → Type w'} [Monad m] [MonadAttach m] [LawfulMonad m] [WeaklyLawfulMonadAttach m] [Std.Iterator α Id β] [Std.Iterators.Finite α Id] {f : β → m (Option γ)} (it : Std.IterM Id β) : (Std.IterM.filterMapM f it).toListRev = List.reverse <$> List.filterMapM f it.toList.run - Std.IterM.toListRev_mapM 📋 Init.Data.Iterators.Lemmas.Combinators.Monadic.FilterMap
{α β γ : Type w} {m : Type w → Type w'} [Monad m] [MonadAttach m] [LawfulMonad m] [WeaklyLawfulMonadAttach m] [Std.Iterator α Id β] [Std.Iterators.Finite α Id] {f : β → m γ} (it : Std.IterM Id β) : (Std.IterM.mapM f it).toListRev = List.reverse <$> List.mapM f it.toList.run - Std.IterM.toListRev_filter 📋 Init.Data.Iterators.Lemmas.Combinators.Monadic.FilterMap
{α β : Type w} {m : Type w → Type w'} [Monad m] [LawfulMonad m] [Std.Iterator α m β] [Std.Iterators.Finite α m] {f : β → Bool} {it : Std.IterM m β} : (Std.IterM.filter f it).toListRev = List.filter f <$> it.toListRev - Std.IterM.toList_filter 📋 Init.Data.Iterators.Lemmas.Combinators.Monadic.FilterMap
{α : Type w} {m : Type w → Type w'} [Monad m] [LawfulMonad m] {β : Type w} [Std.Iterator α m β] [Std.Iterators.Finite α m] {f : β → Bool} {it : Std.IterM m β} : (Std.IterM.filter f it).toList = List.filter f <$> it.toList - Std.IterM.toArray_filter 📋 Init.Data.Iterators.Lemmas.Combinators.Monadic.FilterMap
{α : Type w} {m : Type w → Type w'} [Monad m] [LawfulMonad m] {β : Type w} [Std.Iterator α m β] [Std.Iterators.Finite α m] {f : β → Bool} {it : Std.IterM m β} : (Std.IterM.filter f it).toArray = (fun as => Array.filter f as) <$> it.toArray - Std.IterM.toArray_mapM_eq_toArray_filterMapM 📋 Init.Data.Iterators.Lemmas.Combinators.Monadic.FilterMap
{α β γ : Type w} {m : Type w → Type w'} {n : Type w → Type w''} [Monad m] [LawfulMonad m] [Monad n] [MonadAttach n] [LawfulMonad n] [WeaklyLawfulMonadAttach n] [MonadLiftT m n] [LawfulMonadLiftT m n] [Std.Iterator α m β] [Std.Iterators.Finite α m] {f : β → n γ} {it : Std.IterM m β} : (Std.IterM.mapM f it).toArray = (Std.IterM.filterMapM (fun b => some <$> f b) it).toArray - Std.IterM.toListRev_mapM_eq_toListRev_filterMapM 📋 Init.Data.Iterators.Lemmas.Combinators.Monadic.FilterMap
{α β γ : Type w} {m : Type w → Type w'} {n : Type w → Type w''} [Monad m] [LawfulMonad m] [Monad n] [MonadAttach n] [LawfulMonad n] [WeaklyLawfulMonadAttach n] [MonadLiftT m n] [LawfulMonadLiftT m n] [Std.Iterator α m β] [Std.Iterators.Finite α m] {f : β → n γ} {it : Std.IterM m β} : (Std.IterM.mapM f it).toListRev = (Std.IterM.filterMapM (fun b => some <$> f b) it).toListRev - Std.IterM.toList_mapM_eq_toList_filterMapM 📋 Init.Data.Iterators.Lemmas.Combinators.Monadic.FilterMap
{α β γ : Type w} {m : Type w → Type w'} {n : Type w → Type w''} [Monad m] [LawfulMonad m] [Monad n] [MonadAttach n] [LawfulMonad n] [WeaklyLawfulMonadAttach n] [MonadLiftT m n] [LawfulMonadLiftT m n] [Std.Iterator α m β] [Std.Iterators.Finite α m] {f : β → n γ} {it : Std.IterM m β} : (Std.IterM.mapM f it).toList = (Std.IterM.filterMapM (fun b => some <$> f b) it).toList - Std.IterM.all_mapM 📋 Init.Data.Iterators.Lemmas.Combinators.Monadic.FilterMap
{α β β' : Type w} {m : Type w → Type w'} {n : Type w → Type w''} [Std.Iterator α m β] [Std.Iterators.Finite α m] [MonadLiftT m n] [Std.IteratorLoop α m m] [Monad m] [LawfulMonad m] [Monad n] [MonadAttach n] [LawfulMonad n] [WeaklyLawfulMonadAttach n] [LawfulMonadLiftT m n] [Std.LawfulIteratorLoop α m m] {it : Std.IterM m β} {f : β → n β'} {p : β' → Bool} : Std.IterM.all p (Std.IterM.mapM f it) = Std.IterM.allM (fun x => (fun x => { down := p x }) <$> f x) (Std.IterM.mapM pure it) - Std.IterM.any_mapM 📋 Init.Data.Iterators.Lemmas.Combinators.Monadic.FilterMap
{α β β' : Type w} {m : Type w → Type w'} {n : Type w → Type w''} [Std.Iterator α m β] [Std.Iterators.Finite α m] [MonadLiftT m n] [Std.IteratorLoop α m m] [Monad m] [LawfulMonad m] [Monad n] [MonadAttach n] [LawfulMonad n] [WeaklyLawfulMonadAttach n] [LawfulMonadLiftT m n] [Std.LawfulIteratorLoop α m m] {it : Std.IterM m β} {f : β → n β'} {p : β' → Bool} : Std.IterM.any p (Std.IterM.mapM f it) = Std.IterM.anyM (fun x => (fun x => { down := p x }) <$> f x) (Std.IterM.mapM pure it) - Std.IterM.toArray_mapM_filterMapM 📋 Init.Data.Iterators.Lemmas.Combinators.Monadic.FilterMap
{α β γ δ : Type w} {m : Type w → Type w'} {n : Type w → Type w''} {o : Type w → Type w'''} [Monad m] [LawfulMonad m] [Monad n] [MonadAttach n] [LawfulMonad n] [WeaklyLawfulMonadAttach n] [Monad o] [MonadAttach o] [LawfulMonad o] [WeaklyLawfulMonadAttach o] [MonadLiftT m n] [MonadLiftT n o] [LawfulMonadLiftT m n] [LawfulMonadLiftT n o] [Std.Iterator α m β] [Std.Iterators.Finite α m] {f : β → n (Option γ)} {g : γ → o δ} {it : Std.IterM m β} : (Std.IterM.mapM g (Std.IterM.filterMapM f it)).toArray = (Std.IterM.filterMapM (fun b => do let __do_lift ← liftM (f b) match __do_lift with | none => pure none | some fb => some <$> g fb) it).toArray - Std.IterM.toListRev_mapM_filterMapM 📋 Init.Data.Iterators.Lemmas.Combinators.Monadic.FilterMap
{α β γ δ : Type w} {m : Type w → Type w'} {n : Type w → Type w''} {o : Type w → Type w'''} [Monad m] [LawfulMonad m] [Monad n] [MonadAttach n] [LawfulMonad n] [WeaklyLawfulMonadAttach n] [Monad o] [MonadAttach o] [LawfulMonad o] [WeaklyLawfulMonadAttach o] [MonadLiftT m n] [MonadLiftT n o] [LawfulMonadLiftT m n] [LawfulMonadLiftT n o] [Std.Iterator α m β] [Std.Iterators.Finite α m] {f : β → n (Option γ)} {g : γ → o δ} {it : Std.IterM m β} : (Std.IterM.mapM g (Std.IterM.filterMapM f it)).toListRev = (Std.IterM.filterMapM (fun b => do let __do_lift ← liftM (f b) match __do_lift with | none => pure none | some fb => some <$> g fb) it).toListRev - Std.IterM.toList_mapM_filterMapM 📋 Init.Data.Iterators.Lemmas.Combinators.Monadic.FilterMap
{α β γ δ : Type w} {m : Type w → Type w'} {n : Type w → Type w''} {o : Type w → Type w'''} [Monad m] [LawfulMonad m] [Monad n] [MonadAttach n] [LawfulMonad n] [WeaklyLawfulMonadAttach n] [Monad o] [MonadAttach o] [LawfulMonad o] [WeaklyLawfulMonadAttach o] [MonadLiftT m n] [MonadLiftT n o] [LawfulMonadLiftT m n] [LawfulMonadLiftT n o] [Std.Iterator α m β] [Std.Iterators.Finite α m] {f : β → n (Option γ)} {g : γ → o δ} {it : Std.IterM m β} : (Std.IterM.mapM g (Std.IterM.filterMapM f it)).toList = (Std.IterM.filterMapM (fun b => do let __do_lift ← liftM (f b) match __do_lift with | none => pure none | some fb => some <$> g fb) it).toList - Std.Iter.findM?_toList 📋 Init.Data.Iterators.Lemmas.Consumers.Loop
{α β : Type} {m : Type → Type w'} [Monad m] [Std.Iterator α Id β] [Std.IteratorLoop α Id m] [LawfulMonad m] [Std.Iterators.Finite α Id] [Std.LawfulIteratorLoop α Id m] {it : Std.Iter β} {f : β → m Bool} : List.findM? f it.toList = it.findM? fun x => ULift.up <$> f x - Std.Iter.findM?_eq_findM?_toList 📋 Init.Data.Iterators.Lemmas.Consumers.Loop
{α β : Type} {m : Type → Type w'} [Monad m] [Std.Iterator α Id β] [Std.IteratorLoop α Id m] [LawfulMonad m] [Std.Iterators.Finite α Id] [Std.LawfulIteratorLoop α Id m] {it : Std.Iter β} {f : β → m (ULift.{0, 0} Bool)} : it.findM? f = List.findM? (fun x => ULift.down <$> f x) it.toList - Std.Iter.foldM_eq_forIn 📋 Init.Data.Iterators.Lemmas.Consumers.Loop
{α β : Type w} {γ : Type x} [Std.Iterator α Id β] [Std.Iterators.Finite α Id] {m : Type x → Type x'} [Monad m] [Std.IteratorLoop α Id m] {f : γ → β → m γ} {init : γ} {it : Std.Iter β} : Std.Iter.foldM f init it = forIn it init fun x acc => ForInStep.yield <$> f acc x - Std.Iter.allM_eq_not_anyM_not 📋 Init.Data.Iterators.Lemmas.Consumers.Loop
{α β : Type w} {m : Type → Type w'} [Std.Iterator α Id β] [Std.Iterators.Finite α Id] [Monad m] [LawfulMonad m] [Std.IteratorLoop α Id m] [Std.LawfulIteratorLoop α Id m] {it : Std.Iter β} {p : β → m Bool} : Std.Iter.allM p it = (fun x => !x) <$> Std.Iter.anyM (fun x => (fun x => !x) <$> p x) it - Std.Iter.forIn_yield_eq_foldM 📋 Init.Data.Iterators.Lemmas.Consumers.Loop
{α β : Type w} {γ δ : Type x} [Std.Iterator α Id β] [Std.Iterators.Finite α Id] {m : Type x → Type x'} [Monad m] [LawfulMonad m] [Std.IteratorLoop α Id m] [Std.LawfulIteratorLoop α Id m] {f : β → γ → m δ} {g : β → γ → δ → γ} {init : γ} {it : Std.Iter β} : (forIn it init fun c b => (fun d => ForInStep.yield (g c b d)) <$> f c b) = Std.Iter.foldM (fun b c => g c b <$> f c b) init it - Std.IterM.forIn_eq_foldM 📋 Init.Data.Iterators.Lemmas.Consumers.Loop
{α β : Type w} [Std.Iterator α Id β] [Std.Iterators.Finite α Id] {m : Type x → Type x'} [Monad m] [LawfulMonad m] [Std.IteratorLoop α Id m] [Std.LawfulIteratorLoop α Id m] {γ : Type x} {it : Std.Iter β} {init : γ} {f : β → γ → m (ForInStep γ)} : forIn it init f = ForInStep.value <$> Std.Iter.foldM (fun c b => match c with | ForInStep.yield c => f b c | ForInStep.done c => pure (ForInStep.done c)) (ForInStep.yield init) it - Std.Iter.allM_eq_allM_mapM_pure 📋 Init.Data.Iterators.Lemmas.Combinators.FilterMap
{α β : Type} {m : Type → Type w'} [Std.Iterator α Id β] [Std.Iterators.Finite α Id] [Monad m] [MonadAttach m] [LawfulMonad m] [WeaklyLawfulMonadAttach m] [Std.IteratorLoop α Id m] [Std.LawfulIteratorLoop α Id m] {it : Std.Iter β} {p : β → m Bool} : Std.Iter.allM p it = ULift.down <$> Std.IterM.allM (fun x => ULift.up <$> p x) (Std.Iter.mapM pure it) - Std.Iter.anyM_eq_anyM_mapM_pure 📋 Init.Data.Iterators.Lemmas.Combinators.FilterMap
{α β : Type} {m : Type → Type w'} [Std.Iterator α Id β] [Std.Iterators.Finite α Id] [Monad m] [MonadAttach m] [LawfulMonad m] [WeaklyLawfulMonadAttach m] [Std.IteratorLoop α Id m] [Std.LawfulIteratorLoop α Id m] {it : Std.Iter β} {p : β → m Bool} : Std.Iter.anyM p it = ULift.down <$> Std.IterM.anyM (fun x => ULift.up <$> p x) (Std.Iter.mapM pure it) - Std.Iter.all_mapM 📋 Init.Data.Iterators.Lemmas.Combinators.FilterMap
{α β β' : Type w} {m : Type w → Type w'} [Std.Iterator α Id β] [Std.Iterators.Finite α Id] [Std.IteratorLoop α Id m] [Monad m] [MonadAttach m] [LawfulMonad m] [WeaklyLawfulMonadAttach m] [Std.LawfulIteratorLoop α Id m] {it : Std.Iter β} {f : β → m β'} {p : β' → Bool} : Std.IterM.all p (Std.Iter.mapM f it) = Std.IterM.allM (fun x => (fun x => { down := p x }) <$> f x) (Std.Iter.mapM pure it) - Std.Iter.any_mapM 📋 Init.Data.Iterators.Lemmas.Combinators.FilterMap
{α β β' : Type w} {m : Type w → Type w'} [Std.Iterator α Id β] [Std.Iterators.Finite α Id] [Std.IteratorLoop α Id m] [Monad m] [MonadAttach m] [LawfulMonad m] [WeaklyLawfulMonadAttach m] [Std.LawfulIteratorLoop α Id m] {it : Std.Iter β} {f : β → m β'} {p : β' → Bool} : Std.IterM.any p (Std.Iter.mapM f it) = Std.IterM.anyM (fun x => (fun x => { down := p x }) <$> f x) (Std.Iter.mapM pure it) - Vector.toArray_mapM 📋 Init.Data.Vector.Lemmas
{m : Type u_1 → Type u_2} {α : Type u_3} {β : Type u_1} {n : ℕ} [Monad m] [LawfulMonad m] {f : α → m β} {xs : Vector α n} : Vector.toArray <$> Vector.mapM f xs = Array.mapM f xs.toArray - Vector.allM_eq_not_anyM_not 📋 Init.Data.Vector.Lemmas
{m : Type → Type u_1} {α : Type u_2} {n : ℕ} [Monad m] [LawfulMonad m] {p : α → m Bool} {xs : Vector α n} : Vector.allM p xs = (fun x => !x) <$> Vector.anyM (fun x => (fun x => !x) <$> p x) xs - List.scanlM_eq_scanrM_reverse 📋 Init.Data.List.Scan.Lemmas
{m : Type u_1 → Type u_2} {β : Type u_1} {α : Type u_3} {init : β} {as : List α} [Monad m] {f : β → α → m β} : List.scanlM f init as = List.reverse <$> List.scanrM (flip f) init as.reverse - List.scanlM_reverse 📋 Init.Data.List.Scan.Lemmas
{m : Type u_1 → Type u_2} {β : Type u_1} {α : Type u_3} {init : β} {as : List α} [Monad m] {f : β → α → m β} : List.scanlM f init as.reverse = List.reverse <$> List.scanrM (flip f) init as - List.scanrM_eq_scanlM_reverse 📋 Init.Data.List.Scan.Lemmas
{m : Type u_1 → Type u_2} {α : Type u_3} {β : Type u_1} {init : β} {as : List α} [Monad m] [LawfulMonad m] {f : α → β → m β} : List.scanrM f init as = List.reverse <$> List.scanlM (flip f) init as.reverse - List.scanrM_reverse 📋 Init.Data.List.Scan.Lemmas
{m : Type u_1 → Type u_2} {α : Type u_3} {β : Type u_1} {init : β} {as : List α} [Monad m] [LawfulMonad m] {f : α → β → m β} : List.scanrM f init as.reverse = List.reverse <$> List.scanlM (flip f) init as - Array.zipWithAll_map_left 📋 Init.Data.Array.Zip
{α : Type u_1} {β : Type u_2} {α' : Type u_1} {γ : Type u_3} {as : Array α} {bs : Array β} {f : α → α'} {g : Option α' → Option β → γ} : Array.zipWithAll g (Array.map f as) bs = Array.zipWithAll (fun a b => g (f <$> a) b) as bs - Array.zipWithAll_map_right 📋 Init.Data.Array.Zip
{α : Type u_1} {β β' : Type u_2} {γ : Type u_3} {as : Array α} {bs : Array β} {f : β → β'} {g : Option α → Option β' → γ} : Array.zipWithAll g as (Array.map f bs) = Array.zipWithAll (fun a b => g a (f <$> b)) as bs - Array.zipWithAll_map 📋 Init.Data.Array.Zip
{γ : Type u_1} {δ : Type u_2} {α : Type u_1} {β : Type u_2} {μ : Type u_3} {f : Option γ → Option δ → μ} {g : α → γ} {h : β → δ} {as : Array α} {bs : Array β} : Array.zipWithAll f (Array.map g as) (Array.map h bs) = Array.zipWithAll (fun a b => f (g <$> a) (h <$> b)) as bs - Option.filterM_some 📋 Init.Data.Option.Monadic
{m : Type → Type u_1} {α : Type} [Applicative m] (p : α → m Bool) (a : α) : Option.filterM p (some a) = (fun b => if b = true then some a else none) <$> p a - Option.sequence_join 📋 Init.Data.Option.Monadic
{m : Type u_1 → Type u_2} {α : Type u_1} [Applicative m] [LawfulApplicative m] {o : Option (Option (m α))} : o.join.sequence = Option.join <$> (Option.map Option.sequence o).sequence - Option.mapM_join 📋 Init.Data.Option.Monadic
{m : Type u_1 → Type u_2} {α : Type u_3} {β : Type u_1} [Applicative m] [LawfulApplicative m] {f : α → m β} {o : Option (Option α)} : Option.mapM f o.join = Option.join <$> Option.mapM (Option.mapM f) o - Option.elimM_map 📋 Init.Data.Option.Monadic
{m : Type u_1 → Type u_2} {α β γ : Type u_1} [Monad m] [LawfulMonad m] (x : m α) (f : α → Option β) (y : m γ) (z : β → m γ) : Option.elimM (f <$> x) y z = do let __do_lift ← x (f __do_lift).elim y z - Option.mapM_guard 📋 Init.Data.Option.Monadic
{m : Type u_1 → Type u_2} {α : Type u_3} {β : Type u_1} [Applicative m] {x : α} {p : α → Bool} {f : α → m β} : Option.mapM f (Option.guard p x) = if p x = true then some <$> f x else pure none - Option.idRun_forIn_yield_eq_elim 📋 Init.Data.Option.Monadic
{α : Type u_1} {β : Type u_2} (o : Option α) (f : α → β → Id β) (b : β) : (forIn o b fun a b => ForInStep.yield <$> f a b).run = o.elim b fun a => (f a b).run - Option.forIn_eq_elim 📋 Init.Data.Option.Monadic
{m : Type u_1 → Type u_2} {α : Type u_3} {β : Type u_1} [Monad m] [LawfulMonad m] (o : Option α) (f : α → β → m (ForInStep β)) (b : β) : forIn o b f = o.elim (pure b) fun a => ForInStep.value <$> f a b - Option.idRun_forIn'_yield_eq_pelim 📋 Init.Data.Option.Monadic
{α : Type u_1} {β : Type u_2} (o : Option α) (f : (a : α) → a ∈ o → β → Id β) (b : β) : (forIn' o b fun a m b => ForInStep.yield <$> f a m b).run = o.pelim b fun a h => (f a h b).run - Option.forIn'_eq_pelim 📋 Init.Data.Option.Monadic
{m : Type u_1 → Type u_2} {α : Type u_3} {β : Type u_1} [Monad m] [LawfulMonad m] (o : Option α) (f : (a : α) → a ∈ o → β → m (ForInStep β)) (b : β) : forIn' o b f = o.pelim (pure b) fun a h => ForInStep.value <$> f a h b - Option.forIn_yield_eq_elim 📋 Init.Data.Option.Monadic
{m : Type u_1 → Type u_2} {α : Type u_3} {β γ : Type u_1} [Monad m] [LawfulMonad m] (o : Option α) (f : α → β → m γ) (g : α → β → γ → β) (b : β) : (forIn o b fun a b => (fun c => ForInStep.yield (g a b c)) <$> f a b) = o.elim (pure b) fun a => g a b <$> f a b - Option.forIn_join 📋 Init.Data.Option.Monadic
{m : Type u_1 → Type u_2} {α : Type u_3} {β : Type u_1} {init : β} [Monad m] [LawfulMonad m] (o : Option (Option α)) (f : α → β → m (ForInStep β)) : forIn o.join init f = forIn o init fun o' b => ForInStep.yield <$> forIn o' b f
About
Loogle searches Lean and Mathlib definitions and theorems.
You can use Loogle from within the Lean4 VSCode language extension
using the Loogle command from the command palette. You can also try the
#loogle command from LeanSearchClient,
the CLI version, the Loogle
VS Code extension, the lean.nvim
integration or the Zulip bot.
Usage
Loogle finds definitions and lemmas in various ways:
By constant:
🔍Real.sin
finds all lemmas whose statement somehow mentions the sine function.By lemma name substring:
🔍"differ"
finds all lemmas that have"differ"somewhere in their lemma name.By subexpression:
🔍_ * (_ ^ _)
finds all lemmas whose statements somewhere include a product where the second argument is raised to some power.The pattern can also be non-linear, as in
🔍Real.sqrt ?a * Real.sqrt ?aIf the pattern has parameters, they are matched in any order. Both of these will find
List.map:
🔍(?a -> ?b) -> List ?a -> List ?b
🔍List ?a -> (?a -> ?b) -> List ?bBy main conclusion:
🔍|- tsum _ = _ * tsum _
finds all lemmas where the conclusion (the subexpression to the right of all→and∀) has the given shape.As before, if the pattern has parameters, they are matched against the hypotheses of the lemma in any order; for example,
🔍|- _ < _ → tsum _ < tsum _
will findtsum_lt_tsumeven though the hypothesisf i < g iis not the last.You can filter for definitions vs theorems: Using
⊢ (_ : Type _)finds all definitions which provide data while⊢ (_ : Prop)finds all theorems (and definitions of proofs).
If you pass more than one such search filter, separated by commas
Loogle will return lemmas which match all of them. The
search
🔍 Real.sin, "two", tsum, _ * _, _ ^ _, |- _ < _ → _
would find all lemmas which mention the constants Real.sin
and tsum, have "two" as a substring of the
lemma name, include a product and a power somewhere in the type,
and have a hypothesis of the form _ < _ (if
there were any such lemmas). Metavariables (?a) are
assigned independently in each filter.
The #lucky button will directly send you to the
documentation of the first hit.
Source code
You can find the source code for this service at https://github.com/nomeata/loogle. The https://loogle.lean-lang.org/ service is provided by the Lean FRO. Please review the Lean FRO Terms of Use and Privacy Policy.
This is Loogle revision a114d38 serving mathlib revision 0d14bcb