Loogle!
Result
Found 729 declarations mentioning Option.map. Of these, only the first 200 are shown.
- Option.map 📋 Init.Prelude
{α : Type u_1} {β : Type u_2} (f : α → β) : Option α → Option β - Option.map_id 📋 Init.Data.Option.Basic
{α : Type u_1} : Option.map id = id - Option.map_none 📋 Init.Data.Option.Basic
{α : Type u_1} {β : Type u_2} (f : α → β) : Option.map f none = none - Option.map_some 📋 Init.Data.Option.Basic
{α : Type u_1} {β : Type u_2} (a : α) (f : α → β) : Option.map f (some a) = some (f a) - Array.findIdx?_eq_map_findFinIdx?_val 📋 Init.Data.Array.Basic
{α : Type u} {xs : Array α} {p : α → Bool} : Array.findIdx? p xs = Option.map (fun x => ↑x) (Array.findFinIdx? p xs) - 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.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_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 - Option.map_id' 📋 Init.Data.Option.Lemmas
{α : Type u_1} {x : Option α} : Option.map (fun a => a) x = x - Option.map_id_apply 📋 Init.Data.Option.Lemmas
{α : Type u} {x : Option α} : Option.map id x = x - Option.map_id_apply' 📋 Init.Data.Option.Lemmas
{α : Type u} {x : Option α} : Option.map (fun a => a) x = x - Option.map_id_fun 📋 Init.Data.Option.Lemmas
{α : Type u} : Option.map id = id - Option.map_id_fun' 📋 Init.Data.Option.Lemmas
{α : Type u} : (Option.map fun a => a) = id - Option.isNone_map 📋 Init.Data.Option.Lemmas
{α : Type u_1} {α✝ : Type u_2} {f : α → α✝} {x : Option α} : (Option.map f x).isNone = x.isNone - Option.isSome_map 📋 Init.Data.Option.Lemmas
{α : Type u_1} {α✝ : Type u_2} {f : α → α✝} {x : Option α} : (Option.map f x).isSome = x.isSome - 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 - Option.getD_map 📋 Init.Data.Option.Lemmas
{α : Type u_1} {β : Type u_2} (f : α → β) (x : α) (o : Option α) : (Option.map f o).getD (f x) = f (o.getD x) - Option.map_eq_none_iff 📋 Init.Data.Option.Lemmas
{α✝ : Type u_1} {x : Option α✝} {α✝¹ : Type u_2} {f : α✝ → α✝¹} : Option.map f x = none ↔ x = none - Option.all_map 📋 Init.Data.Option.Lemmas
{α : Type u_1} {β : Type u_2} {x : Option α} {f : α → β} {p : β → Bool} : Option.all p (Option.map f x) = Option.all (fun a => p (f a)) x - Option.any_map 📋 Init.Data.Option.Lemmas
{α : Type u_1} {β : Type u_2} {x : Option α} {f : α → β} {p : β → Bool} : Option.any p (Option.map f x) = Option.any (fun a => p (f a)) x - Option.join_join 📋 Init.Data.Option.Lemmas
{α : Type u_1} {x : Option (Option (Option α))} : x.join.join = (Option.map Option.join x).join - Option.map_eq_bind 📋 Init.Data.Option.Lemmas
{α : Type u_1} {α✝ : Type u_2} {f : α → α✝} {x : Option α} : Option.map f x = x.bind (some ∘ f) - Option.mem_map_of_mem 📋 Init.Data.Option.Lemmas
{α : Type u_1} {β : Type u_2} {x : Option α} {a : α} (g : α → β) (h : a ∈ x) : g a ∈ Option.map g x - Option.join_map_eq_map_join 📋 Init.Data.Option.Lemmas
{α : Type u_1} {β : Type u_2} {f : α → β} {x : Option (Option α)} : (Option.map (Option.map f) x).join = Option.map f x.join - Option.comp_map 📋 Init.Data.Option.Lemmas
{β : Type u_1} {γ : Type u_2} {α : Type u_3} (h : β → γ) (g : α → β) (x : Option α) : Option.map (h ∘ g) x = Option.map h (Option.map g x) - Option.map_map 📋 Init.Data.Option.Lemmas
{β : Type u_1} {γ : Type u_2} {α : Type u_3} (h : β → γ) (g : α → β) (x : Option α) : Option.map h (Option.map g x) = Option.map (h ∘ g) x - Option.map_or 📋 Init.Data.Option.Lemmas
{α✝ : Type u_1} {o o' : Option α✝} {α✝¹ : Type u_2} {f : α✝ → α✝¹} : Option.map f (o.or o') = (Option.map f o).or (Option.map f o') - Option.apply_get 📋 Init.Data.Option.Lemmas
{α : Type u_1} {β : Type u_2} {f : α → β} {o : Option α} {h : o.isSome = true} : f (o.get h) = (Option.map f o).get ⋯ - Option.filter_map 📋 Init.Data.Option.Lemmas
{α : Type u_1} {β : Type u_2} {x : Option α} {f : α → β} {p : β → Bool} : Option.filter p (Option.map f x) = Option.map f (Option.filter (p ∘ f) x) - Option.bind_map 📋 Init.Data.Option.Lemmas
{α : Type u_1} {β : Type u_2} {γ : Type u_3} {f : α → β} {g : β → Option γ} {x : Option α} : (Option.map f x).bind g = x.bind (g ∘ f) - Option.elim_map 📋 Init.Data.Option.Lemmas
{α : Type u_1} {β : Type u_2} {γ : Sort u_3} {f : α → β} {g' : γ} {g : β → γ} (o : Option α) : (Option.map f o).elim g' g = o.elim g' (g ∘ f) - Option.map_congr 📋 Init.Data.Option.Lemmas
{α : Type u_1} {α✝ : Type u_2} {f g : α → α✝} {x : Option α} (h : ∀ (a : α), x = some a → f a = g a) : Option.map f x = Option.map g x - Option.map_eq_some_iff 📋 Init.Data.Option.Lemmas
{α✝ : Type u_1} {b : α✝} {α✝¹ : Type u_2} {x : Option α✝¹} {f : α✝¹ → α✝} : Option.map f x = some b ↔ ∃ a, x = some a ∧ f a = b - Option.bind_map_comm 📋 Init.Data.Option.Lemmas
{α : Type u_1} {β : Type u_2} {x : Option (Option α)} {f : α → β} : x.bind (Option.map f) = (Option.map (Option.map f) x).bind id - Option.get_map 📋 Init.Data.Option.Lemmas
{α : Type u_1} {β : Type u_2} {f : α → β} {o : Option α} {h : (Option.map f o).isSome = true} : (Option.map f o).get h = f (o.get ⋯) - Option.map_comp_map 📋 Init.Data.Option.Lemmas
{α : Type u_1} {β : Type u_2} {γ : Type u_3} (f : α → β) (g : β → γ) : Option.map g ∘ Option.map f = Option.map (g ∘ f) - Option.map_guard 📋 Init.Data.Option.Lemmas
{α : Type u_1} {β : Type u_2} {p : α → Bool} {f : α → β} {x : α} : Option.map f (Option.guard p x) = if p x = true then some (f x) else none - Option.map_if 📋 Init.Data.Option.Lemmas
{α : Type u_1} {β : Type u_2} {c : Prop} {a : α} {f : α → β} {x✝ : Decidable c} : Option.map f (if c then some a else none) = if c then some (f a) else none - Option.guard_comp 📋 Init.Data.Option.Lemmas
{α : Type u_1} {β : Type u_2} {p : α → Bool} {f : β → α} : Option.guard p ∘ f = Option.map f ∘ Option.guard (p ∘ f) - Option.map_bind 📋 Init.Data.Option.Lemmas
{α : Type u_1} {β : Type u_2} {γ : Type u_3} {f : α → Option β} {g : β → γ} {x : Option α} : Option.map g (x.bind f) = x.bind (Option.map g ∘ f) - Option.pmap_eq_map 📋 Init.Data.Option.Lemmas
{α : Type u_1} {β : Type u_2} (p : α → Prop) (f : α → β) (o : Option α) (H : ∀ (a : α), o = some a → p a) : Option.pmap (fun a x => f a) o H = Option.map f o - Option.map_inj_right 📋 Init.Data.Option.Lemmas
{α : Type u_1} {β : Type u_2} {f : α → β} {o o' : Option α} (w : ∀ (x y : α), f x = f y → x = y) : Option.map f o = Option.map f o' ↔ o = o' - Option.map_dif 📋 Init.Data.Option.Lemmas
{α : Type u_1} {β : Type u_2} {c : Prop} {f : α → β} {x✝ : Decidable c} {a : c → α} : Option.map f (if h : c then some (a h) else none) = if h : c then some (f (a h)) else none - Option.map_pbind 📋 Init.Data.Option.Lemmas
{α : Type u_1} {β : Type u_2} {γ : Type u_3} {o : Option α} {f : (a : α) → o = some a → Option β} {g : β → γ} : Option.map g (o.pbind f) = o.pbind fun a h => Option.map g (f a h) - Option.map_pmap 📋 Init.Data.Option.Lemmas
{α : Type u_1} {β : Type u_2} {γ : Type u_3} {p : α → Prop} (g : β → γ) (f : (a : α) → p a → β) (o : Option α) (H : ∀ (a : α), o = some a → p a) : Option.map g (Option.pmap f o H) = Option.pmap (fun a h => g (f a h)) o H - Option.map_max 📋 Init.Data.Option.Lemmas
{α : Type u_1} {β : Type u_2} [Max α] [Max β] {o o' : Option α} {f : α → β} (hf : ∀ (x y : α), f (x ⊔ y) = f x ⊔ f y) : Option.map f (o ⊔ o') = Option.map f o ⊔ Option.map f o' - Option.map_min 📋 Init.Data.Option.Lemmas
{α : Type u_1} {β : Type u_2} [Min α] [Min β] {o o' : Option α} {f : α → β} (hf : ∀ (x y : α), f (x ⊓ y) = f x ⊓ f y) : Option.map f (o ⊓ o') = Option.map f o ⊓ Option.map f o' - Option.pbind_map 📋 Init.Data.Option.Lemmas
{α : Type u_1} {β : Type u_2} {γ : Type u_3} (o : Option α) (f : α → β) (g : (x : β) → Option.map f o = some x → Option γ) : (Option.map f o).pbind g = o.pbind fun x h => g (f x) ⋯ - Option.pmap_map 📋 Init.Data.Option.Lemmas
{α : Type u_1} {β : Type u_2} {γ : Type u_3} (o : Option α) (f : α → β) {p : β → Prop} (g : (b : β) → p b → γ) (H : ∀ (a : β), Option.map f o = some a → p a) : Option.pmap g (Option.map f o) H = Option.pmap (fun a h => g (f a) h) o ⋯ - List.getLast?_map 📋 Init.Data.List.Lemmas
{α : Type u_1} {β : Type u_2} {f : α → β} {l : List α} : (List.map f l).getLast? = Option.map f l.getLast? - List.head?_map 📋 Init.Data.List.Lemmas
{α : Type u_1} {β : Type u_2} {f : α → β} {l : List α} : (List.map f l).head? = Option.map f l.head? - List.map_tail? 📋 Init.Data.List.Lemmas
{α : Type u_1} {β : Type u_2} {f : α → β} {l : List α} : Option.map (List.map f) l.tail? = (List.map f l).tail? - List.map_filterMap 📋 Init.Data.List.Lemmas
{α : Type u_1} {β : Type u_2} {γ : Type u_3} {f : α → Option β} {g : β → γ} {l : List α} : List.map g (List.filterMap f l) = List.filterMap (fun x => Option.map g (f x)) l - List.map_filterMap_of_inv 📋 Init.Data.List.Lemmas
{α : Type u_1} {β : Type u_2} {f : α → Option β} {g : β → α} (H : ∀ (x : α), Option.map g (f x) = some x) {l : List α} : List.map g (List.filterMap f l) = l - List.tail?_append 📋 Init.Data.List.Lemmas
{α : Type u_1} {l l' : List α} : (l ++ l').tail? = (Option.map (fun x => x ++ l') l.tail?).or l'.tail? - List.getElem?_map 📋 Init.Data.List.Lemmas
{α : Type u_1} {β : Type u_2} {f : α → β} {l : List α} {i : ℕ} : (List.map f l)[i]? = Option.map f l[i]? - List.map_eq_cons_iff' 📋 Init.Data.List.Lemmas
{α : Type u_1} {β : Type u_2} {b : β} {l₂ : List β} {f : α → β} {l : List α} : List.map f l = b :: l₂ ↔ Option.map f l.head? = some b ∧ Option.map (List.map f) l.tail? = some l₂ - List.map_eq_iff 📋 Init.Data.List.Lemmas
{α✝ : Type u_1} {α✝¹ : Type u_2} {f : α✝ → α✝¹} {l : List α✝} {l' : List α✝¹} : List.map f l = l' ↔ ∀ (i : ℕ), l'[i]? = Option.map f l[i]? - List.countP_filterMap 📋 Init.Data.List.Count
{α : Type u_2} {β : Type u_1} {p : β → Bool} {f : α → Option β} {l : List α} : List.countP p (List.filterMap f l) = List.countP (fun a => (Option.map p (f a)).getD false) l - List.find?_subtype 📋 Init.Data.List.Attach
{α : Type u_1} {p : α → Prop} {l : List { x // p x }} {f : { x // p x } → Bool} {g : α → Bool} (hf : ∀ (x : α) (h : p x), f ⟨x, h⟩ = g x) : Option.map Subtype.val (List.find? f l) = List.find? g l.unattach - List.getElem?_unattach 📋 Init.Data.List.Attach
{α : Type u_1} {p : α → Prop} {l : List { x // p x }} (i : ℕ) : l.unattach[i]? = Option.map Subtype.val l[i]? - List.getLast?_pmap 📋 Init.Data.List.Attach
{α : Type u_1} {β : Type u_2} {P : α → Prop} {f : (a : α) → P a → β} {xs : List α} (H : ∀ a ∈ xs, P a) : (List.pmap f xs H).getLast? = Option.map (fun x => match x with | ⟨a, m⟩ => f a ⋯) xs.attach.getLast? - List.head?_pmap 📋 Init.Data.List.Attach
{α : Type u_1} {β : Type u_2} {P : α → Prop} {f : (a : α) → P a → β} {xs : List α} (H : ∀ a ∈ xs, P a) : (List.pmap f xs H).head? = Option.map (fun x => match x with | ⟨a, m⟩ => f a ⋯) xs.attach.head? - List.getElem?_zipWith' 📋 Init.Data.List.Zip
{α : Type u_1} {β : Type u_2} {γ : Type u_3} {l₁ : List α} {l₂ : List β} {f : α → β → γ} {i : ℕ} : (List.zipWith f l₁ l₂)[i]? = (Option.map f l₁[i]?).bind fun g => Option.map g l₂[i]? - List.getElem?_zipIdx 📋 Init.Data.List.Range
{α : Type u_1} {l : List α} {i j : ℕ} : (l.zipIdx i)[j]? = Option.map (fun a => (a, i + j)) l[j]? - List.findIdx?_eq_map_findFinIdx?_val 📋 Init.Data.List.Find
{α : Type u_1} {xs : List α} {p : α → Bool} : List.findIdx? p xs = Option.map (fun x => ↑x) (List.findFinIdx? p xs) - List.find?_map 📋 Init.Data.List.Find
{β : Type u_1} {α : Type u_2} {p : α → Bool} {f : β → α} {l : List β} : List.find? p (List.map f l) = Option.map f (List.find? (p ∘ f) l) - List.idxOf?_eq_map_finIdxOf?_val 📋 Init.Data.List.Find
{α : Type u_1} [BEq α] {xs : List α} {a : α} : List.idxOf? a xs = Option.map (fun x => ↑x) (List.finIdxOf? a xs) - List.map_findSome? 📋 Init.Data.List.Find
{α : Type u_1} {β : Type u_2} {γ : Type u_3} {f : α → Option β} {g : β → γ} {l : List α} : Option.map g (List.findSome? f l) = List.findSome? (Option.map g ∘ f) l - List.findIdx?_eq_fst_find?_zipIdx 📋 Init.Data.List.Find
{α : Type u_1} {xs : List α} {p : α → Bool} : List.findIdx? p xs = Option.map (fun x => x.2) (List.find? (fun x => match x with | (x, snd) => p x) xs.zipIdx) - List.findIdx?_append 📋 Init.Data.List.Find
{α : Type u_1} {xs ys : List α} {p : α → Bool} : List.findIdx? p (xs ++ ys) = (List.findIdx? p xs).or (Option.map (fun i => i + xs.length) (List.findIdx? p ys)) - List.findIdx?_go_eq_map_findFinIdx?_go_val 📋 Init.Data.List.Find
{α : Type u_1} {l xs : List α} {p : α → Bool} {i : ℕ} {h : xs.length + i = l.length} : List.findIdx?.go p xs i = Option.map (fun x => ↑x) (List.findFinIdx?.go p l xs i h) - List.findIdx?_cons 📋 Init.Data.List.Find
{α✝ : Type u_1} {x : α✝} {xs : List α✝} {p : α✝ → Bool} : List.findIdx? p (x :: xs) = if p x = true then some 0 else Option.map (fun i => i + 1) (List.findIdx? p xs) - List.idxOf?_cons 📋 Init.Data.List.Find
{α : Type u_1} [BEq α] {a : α} {xs : List α} {b : α} : List.idxOf? b (a :: xs) = if (a == b) = true then some 0 else Option.map (fun x => x + 1) (List.idxOf? b xs) - List.find?_eq_map_findFinIdx?_getElem 📋 Init.Data.List.Find
{α : Type u_1} {xs : List α} {p : α → Bool} : List.find? p xs = Option.map (fun x => xs[x]) (List.findFinIdx? p xs) - List.findIdx?_flatten 📋 Init.Data.List.Find
{α : Type u_1} {l : List (List α)} {p : α → Bool} : List.findIdx? p l.flatten = Option.map (fun i => (List.map List.length (List.take i l)).sum + (Option.map (fun xs => List.findIdx p xs) l[i]?).getD 0) (List.findIdx? (fun x => x.any p) l) - List.findFinIdx?_subtype 📋 Init.Data.List.Find
{α : Type u_1} {p : α → Prop} {l : List { x // p x }} {f : { x // p x } → Bool} {g : α → Bool} (hf : ∀ (x : α) (h : p x), f ⟨x, h⟩ = g x) : List.findFinIdx? f l = Option.map (fun i => Fin.cast ⋯ i) (List.findFinIdx? g l.unattach) - List.finIdxOf?_cons 📋 Init.Data.List.Find
{α : Type u_1} {b : α} [BEq α] {a : α} {xs : List α} : List.finIdxOf? b (a :: xs) = if (a == b) = true then some ⟨0, ⋯⟩ else Option.map (fun x => x.succ) (List.finIdxOf? b xs) - List.findFinIdx?_cons 📋 Init.Data.List.Find
{α : Type u_1} {p : α → Bool} {x : α} {xs : List α} : List.findFinIdx? p (x :: xs) = if p x = true then some 0 else Option.map Fin.succ (List.findFinIdx? p xs) - List.find?_pmap 📋 Init.Data.List.Find
{α : Type u_1} {β : Type u_2} {P : α → Prop} {f : (a : α) → P a → β} {xs : List α} (H : ∀ a ∈ xs, P a) {p : β → Bool} : List.find? p (List.pmap f xs H) = Option.map (fun x => match x with | ⟨a, m⟩ => f a ⋯) (List.find? (fun x => match x with | ⟨a, m⟩ => p (f a ⋯)) xs.attach) - List.findFinIdx?_append 📋 Init.Data.List.Find
{α : Type u_1} {xs ys : List α} {p : α → Bool} : List.findFinIdx? p (xs ++ ys) = (Option.map (Fin.castLE ⋯) (List.findFinIdx? p xs)).or (Option.map (Fin.cast ⋯) (Option.map (Fin.natAdd xs.length) (List.findFinIdx? p ys))) - List.head?_modifyHead 📋 Init.Data.List.Nat.Modify
{α : Type u_1} {l : List α} {f : α → α} : (List.modifyHead f l).head? = Option.map f l.head? - List.getElem?_modifyHead_zero 📋 Init.Data.List.Nat.Modify
{α : Type u_1} {l : List α} {f : α → α} : (List.modifyHead f l)[0]? = Option.map f l[0]? - List.getElem?_modifyHead 📋 Init.Data.List.Nat.Modify
{α : Type u_1} {l : List α} {f : α → α} {i : ℕ} : (List.modifyHead f l)[i]? = if i = 0 then Option.map f l[i]? else l[i]? - List.max?_eq_max?_attach 📋 Init.Data.List.MinMax
{α : Type u_1} [Max α] [Std.MaxEqOr α] {xs : List α} : xs.max? = Option.map Subtype.val xs.attach.max? - List.min?_eq_min?_attach 📋 Init.Data.List.MinMax
{α : Type u_1} [Min α] [Std.MinEqOr α] {xs : List α} : xs.min? = Option.map Subtype.val xs.attach.min? - Array.back?_map 📋 Init.Data.Array.Lemmas
{α : Type u_1} {β : Type u_2} {f : α → β} {xs : Array α} : (Array.map f xs).back? = Option.map f xs.back? - Array.map_filterMap_of_inv 📋 Init.Data.Array.Lemmas
{α : Type u_1} {β : Type u_2} {f : α → Option β} {g : β → α} (H : ∀ (x : α), Option.map g (f x) = some x) {xs : Array α} : Array.map g (Array.filterMap f xs) = xs - Array.findFinIdx?_toList 📋 Init.Data.Array.Lemmas
{α : Type u_1} {p : α → Bool} {xs : Array α} : List.findFinIdx? p xs.toList = Option.map (Fin.cast ⋯) (Array.findFinIdx? p xs) - Array.finIdxOf?_toList 📋 Init.Data.Array.Lemmas
{α : Type u_1} [BEq α] {a : α} {xs : Array α} : List.finIdxOf? a xs.toList = Option.map (Fin.cast ⋯) (xs.finIdxOf? a) - Array.map_filterMap 📋 Init.Data.Array.Lemmas
{α : Type u_1} {β : Type u_2} {γ : Type u_3} {f : α → Option β} {g : β → γ} {xs : Array α} : Array.map g (Array.filterMap f xs) = Array.filterMap (fun x => Option.map g (f x)) xs - Array.getElem?_map 📋 Init.Data.Array.Lemmas
{α : Type u_1} {β : Type u_2} {f : α → β} {xs : Array α} {i : ℕ} : (Array.map f xs)[i]? = Option.map f xs[i]? - Array.map_eq_iff 📋 Init.Data.Array.Lemmas
{α : Type u_1} {β : Type u_2} {f : α → β} {xs : Array α} {ys : Array β} : Array.map f xs = ys ↔ ∀ (i : ℕ), ys[i]? = Option.map f xs[i]? - Array.getElem?_modify 📋 Init.Data.Array.Lemmas
{α : Type u_1} {xs : Array α} {i : ℕ} {f : α → α} {j : ℕ} : (xs.modify i f)[j]? = if i = j then Option.map f xs[j]? else xs[j]? - ByteArray.utf8Decode?_utf8Encode_singleton_append 📋 Init.Data.String.Basic
{l : ByteArray} {c : Char} : ([c].utf8Encode ++ l).utf8Decode? = Option.map (fun x => #[c] ++ x) l.utf8Decode? - Char.succMany?_eq 📋 Init.Data.Char.Ordinal
{m : ℕ} {c : Char} : Char.succMany? m c = Option.map Char.ofOrdinal (c.ordinal.addNat? m) - Char.succ?_eq 📋 Init.Data.Char.Ordinal
{c : Char} : c.succ? = Option.map Char.ofOrdinal (c.ordinal.addNat? 1) - Char.map_ordinal_succ? 📋 Init.Data.Char.Ordinal
{c : Char} : Option.map Char.ordinal c.succ? = c.ordinal.addNat? 1 - String.Pos.prev?_eq_prev?_toSlice 📋 Init.Data.String.Lemmas.FindPos
{s : String} {p : s.Pos} : p.prev? = Option.map String.Pos.ofToSlice p.toSlice.prev? - String.Pos.prev?_toSlice 📋 Init.Data.String.Lemmas.FindPos
{s : String} {p : s.Pos} : p.toSlice.prev? = Option.map String.Pos.toSlice p.prev? - String.Pos.map_toSlice_next? 📋 Init.Data.String.Termination
{s : String} {p : s.Pos} : Option.map String.Pos.toSlice p.next? = p.toSlice.next? - String.Pos.map_toSlice_prev? 📋 Init.Data.String.Termination
{s : String} {p : s.Pos} : Option.map String.Pos.toSlice p.prev? = p.toSlice.prev? - Array.countP_filterMap 📋 Init.Data.Array.Count
{α : Type u_2} {β : Type u_1} {p : β → Bool} {f : α → Option β} {xs : Array α} : Array.countP p (Array.filterMap f xs) = Array.countP (fun a => (Option.map p (f a)).getD false) xs - Array.find?_subtype 📋 Init.Data.Array.Attach
{α : Type u_1} {p : α → Prop} {xs : Array { x // p x }} {f : { x // p x } → Bool} {g : α → Bool} (hf : ∀ (x : α) (h : p x), f ⟨x, h⟩ = g x) : Option.map Subtype.val (Array.find? f xs) = Array.find? g xs.unattach - Array.getElem?_unattach 📋 Init.Data.Array.Attach
{α : Type u_1} {p : α → Prop} {xs : Array { x // p x }} (i : ℕ) : xs.unattach[i]? = Option.map Subtype.val xs[i]? - Array.back?_pmap 📋 Init.Data.Array.Attach
{α : Type u_1} {β : Type u_2} {P : α → Prop} {f : (a : α) → P a → β} {xs : Array α} (H : ∀ a ∈ xs, P a) : (Array.pmap f xs H).back? = Option.map (fun x => match x with | ⟨a, m⟩ => f a ⋯) xs.attach.back? - Option.toList_map 📋 Init.Data.Option.List
{α : Type u_1} {β : Type u_2} {o : Option α} {f : α → β} : (Option.map f o).toList = List.map f o.toList - Option.toArray_map 📋 Init.Data.Option.Array
{α : Type u_1} {β : Type u_2} {o : Option α} {f : α → β} : (Option.map f o).toArray = Array.map f o.toArray - Option.attach_map_subtype_val 📋 Init.Data.Option.Attach
{α : Type u_1} (o : Option α) : Option.map Subtype.val o.attach = o - Option.attachWith_map_subtype_val 📋 Init.Data.Option.Attach
{α : Type u_1} {p : α → Prop} (o : Option α) (H : ∀ (a : α), o = some a → p a) : Option.map Subtype.val (o.attachWith p H) = o - Option.attachWith_map_val 📋 Init.Data.Option.Attach
{α : Type u_1} {β : Type u_2} {p : α → Prop} (f : α → β) (o : Option α) (H : ∀ (a : α), o = some a → p a) : Option.map (fun i => f ↑i) (o.attachWith p H) = Option.map f o - Option.attach_map_val 📋 Init.Data.Option.Attach
{α : Type u_1} {β : Type u_2} (o : Option α) (f : α → β) : Option.map (fun i => f ↑i) o.attach = Option.map f o - Option.map_subtype 📋 Init.Data.Option.Attach
{α : Type u_1} {β : Type u_2} {p : α → Prop} {o : Option { x // p x }} {f : { x // p x } → β} {g : α → β} (hf : ∀ (x : α) (h : p x), f ⟨x, h⟩ = g x) : Option.map f o = Option.map g o.unattach - Option.map_attach_eq_pmap 📋 Init.Data.Option.Attach
{α : Type u_1} {β : Type u_2} {o : Option α} (f : { x // o = some x } → β) : Option.map f o.attach = Option.pmap (fun a h => f ⟨a, h⟩) o ⋯ - Option.attach_congr 📋 Init.Data.Option.Attach
{α : Type u_1} {o₁ o₂ : Option α} (h : o₁ = o₂) : o₁.attach = Option.map (fun x => ⟨↑x, ⋯⟩) o₂.attach - Option.map_attach_eq_attachWith 📋 Init.Data.Option.Attach
{α : Type u_1} {o : Option α} {p : α → Prop} (f : ∀ (a : α), o = some a → p a) : Option.map (fun x => ⟨↑x, ⋯⟩) o.attach = o.attachWith p f - Option.map_attachWith 📋 Init.Data.Option.Attach
{α : Type u_1} {β : Type u_2} {l : Option α} {P : α → Prop} {H : ∀ (a : α), l = some a → P a} (f : { x // P x } → β) : Option.map f (l.attachWith P H) = Option.map (fun x => match x with | ⟨x, h⟩ => f ⟨x, ⋯⟩) l.attach - Option.map_attachWith_eq_pmap 📋 Init.Data.Option.Attach
{α : Type u_1} {β : Type u_2} {o : Option α} {P : α → Prop} {H : ∀ (a : α), o = some a → P a} (f : { x // P x } → β) : Option.map f (o.attachWith P H) = Option.pmap (fun a h => f ⟨a, ⋯⟩) o ⋯ - Option.attach_toList 📋 Init.Data.Option.Attach
{α : Type u_1} (o : Option α) : o.toList.attach = (Option.map (fun x => match x with | ⟨a, h⟩ => ⟨a, ⋯⟩) o.attach).toList - Option.attach_map 📋 Init.Data.Option.Attach
{α : Type u_1} {β : Type u_2} {o : Option α} (f : α → β) : (Option.map f o).attach = Option.map (fun x => match x with | ⟨x, h⟩ => ⟨f x, ⋯⟩) o.attach - Option.attachWith_map 📋 Init.Data.Option.Attach
{α : Type u_1} {β : Type u_2} {o : Option α} (f : α → β) {P : β → Prop} {H : ∀ (b : β), Option.map f o = some b → P b} : (Option.map f o).attachWith P H = Option.map (fun x => match x with | ⟨x, h⟩ => ⟨f x, h⟩) (o.attachWith (P ∘ f) ⋯) - Option.attach_bind 📋 Init.Data.Option.Attach
{α : Type u_1} {β : Type u_2} {o : Option α} {f : α → Option β} : (o.bind f).attach = o.attach.bind fun x => match x with | ⟨x, h⟩ => Option.map (fun x_1 => match x_1 with | ⟨y, h'⟩ => ⟨y, ⋯⟩) (f x).attach - List.head?_zipIdx 📋 Init.Data.List.Nat.Range
{α : Type u_1} {l : List α} {k : ℕ} : (l.zipIdx k).head? = Option.map (fun a => (a, k)) l.head? - List.getLast?_zipIdx 📋 Init.Data.List.Nat.Range
{α : Type u_1} {l : List α} {k : ℕ} : (l.zipIdx k).getLast? = Option.map (fun a => (a, k + l.length - 1)) l.getLast? - List.head?_mapIdx 📋 Init.Data.List.MapIdx
{α : Type u_1} {β : Type u_2} {l : List α} {f : ℕ → α → β} : (List.mapIdx f l).head? = Option.map (f 0) l.head? - List.getLast?_mapIdx 📋 Init.Data.List.MapIdx
{α : Type u_1} {β : Type u_2} {l : List α} {f : ℕ → α → β} : (List.mapIdx f l).getLast? = Option.map (f (l.length - 1)) l.getLast? - List.getElem?_mapIdx 📋 Init.Data.List.MapIdx
{α : Type u_1} {α✝ : Type u_2} {f : ℕ → α → α✝} {l : List α} {i : ℕ} : (List.mapIdx f l)[i]? = Option.map (f i) l[i]? - List.mapIdx_eq_iff 📋 Init.Data.List.MapIdx
{α : Type u_1} {α✝ : Type u_2} {f : ℕ → α → α✝} {l' : List α✝} {l : List α} : List.mapIdx f l = l' ↔ ∀ (i : ℕ), l'[i]? = Option.map (f i) l[i]? - List.mapIdx_eq_cons_iff' 📋 Init.Data.List.MapIdx
{α : Type u_1} {β : Type u_2} {f : ℕ → α → β} {l₂ : List β} {l : List α} {b : β} : List.mapIdx f l = b :: l₂ ↔ Option.map (f 0) l.head? = some b ∧ Option.map (List.mapIdx fun i => f (i + 1)) l.tail? = some l₂ - List.getElem?_mapIdx_go 📋 Init.Data.List.MapIdx
{α : Type u_1} {β : Type u_2} {f : ℕ → α → β} {l : List α} {acc : Array β} {i : ℕ} : (List.mapIdx.go f l acc)[i]? = if h : i < acc.size then some acc[i] else Option.map (f i) l[i - acc.size]? - List.mapFinIdx_eq_cons_iff' 📋 Init.Data.List.MapIdx
{α : Type u_1} {β : Type u_2} {l₂ : List β} {l : List α} {b : β} {f : (i : ℕ) → α → i < l.length → β} : l.mapFinIdx f = b :: l₂ ↔ (l.head?.pbind fun x m => some (f 0 x ⋯)) = some b ∧ Option.map (fun x => match x with | ⟨t, m⟩ => t.mapFinIdx fun i a h => f (i + 1) a ⋯) l.tail?.attach = some l₂ - Array.back?_mapIdx 📋 Init.Data.Array.MapIdx
{α : Type u_1} {β : Type u_2} {xs : Array α} {f : ℕ → α → β} : (Array.mapIdx f xs).back? = Option.map (f (xs.size - 1)) xs.back? - Array.getElem?_mapIdx 📋 Init.Data.Array.MapIdx
{α : Type u_1} {β : Type u_2} {f : ℕ → α → β} {xs : Array α} {i : ℕ} : (Array.mapIdx f xs)[i]? = Option.map (f i) xs[i]? - Array.mapIdx_eq_iff 📋 Init.Data.Array.MapIdx
{α : Type u_1} {α✝ : Type u_2} {f : ℕ → α → α✝} {ys : Array α✝} {xs : Array α} : Array.mapIdx f xs = ys ↔ ∀ (i : ℕ), ys[i]? = Option.map (f i) xs[i]? - String.Slice.Pattern.Model.matchAt?_cast 📋 Init.Data.String.Lemmas.Pattern.Basic
{ρ : Type} (pat : ρ) [String.Slice.Pattern.Model.PatternModel pat] {s t : String.Slice} (hst : s.copy = t.copy) {startPos : s.Pos} : String.Slice.Pattern.Model.matchAt? pat (startPos.cast hst) = Option.map (fun x => x.cast hst) (String.Slice.Pattern.Model.matchAt? pat startPos) - String.Slice.Pattern.Model.revMatchAt?_cast 📋 Init.Data.String.Lemmas.Pattern.Basic
{ρ : Type} (pat : ρ) [String.Slice.Pattern.Model.PatternModel pat] {s t : String.Slice} (hst : s.copy = t.copy) {startPos : s.Pos} : String.Slice.Pattern.Model.revMatchAt? pat (startPos.cast hst) = Option.map (fun x => x.cast hst) (String.Slice.Pattern.Model.revMatchAt? pat startPos) - Array.find?_map 📋 Init.Data.Array.Find
{β : Type u_1} {α : Type u_2} {p : α → Bool} {f : β → α} {xs : Array β} : Array.find? p (Array.map f xs) = Option.map f (Array.find? (p ∘ f) xs) - Array.idxOf?_eq_map_finIdxOf?_val 📋 Init.Data.Array.Find
{α : Type u_1} [BEq α] {xs : Array α} {a : α} : xs.idxOf? a = Option.map (fun x => ↑x) (xs.finIdxOf? a) - Array.map_findSome? 📋 Init.Data.Array.Find
{α : Type u_1} {β : Type u_2} {γ : Type u_3} {f : α → Option β} {g : β → γ} {xs : Array α} : Option.map g (Array.findSome? f xs) = Array.findSome? (Option.map g ∘ f) xs - Array.findIdx?_eq_fst_find?_zipIdx 📋 Init.Data.Array.Find
{α : Type u_1} {xs : Array α} {p : α → Bool} : Array.findIdx? p xs = Option.map (fun x => x.2) (Array.find? (fun x => match x with | (x, snd) => p x) xs.zipIdx) - Array.findFinIdx?_congr 📋 Init.Data.Array.Find
{α : Type u_1} {p : α → Bool} {xs ys : Array α} (w : xs = ys) : Array.findFinIdx? p xs = Option.map (fun i => Fin.cast ⋯ i) (Array.findFinIdx? p ys) - Array.findIdx?_append 📋 Init.Data.Array.Find
{α : Type u_1} {xs ys : Array α} {p : α → Bool} : Array.findIdx? p (xs ++ ys) = (Array.findIdx? p xs).or (Option.map (fun i => i + xs.size) (Array.findIdx? p ys)) - Array.find?_eq_map_findFinIdx?_getElem 📋 Init.Data.Array.Find
{α : Type u_1} {xs : Array α} {p : α → Bool} : Array.find? p xs = Option.map (fun x => xs[x]) (Array.findFinIdx? p xs) - Array.findFinIdx?_subtype 📋 Init.Data.Array.Find
{α : Type u_1} {p : α → Prop} {xs : Array { x // p x }} {f : { x // p x } → Bool} {g : α → Bool} (hf : ∀ (x : α) (h : p x), f ⟨x, h⟩ = g x) : Array.findFinIdx? f xs = Option.map (fun i => Fin.cast ⋯ i) (Array.findFinIdx? g xs.unattach) - Array.findIdx?_flatten 📋 Init.Data.Array.Find
{α : Type u_1} {xss : Array (Array α)} {p : α → Bool} : Array.findIdx? p xss.flatten = Option.map (fun i => (Array.map Array.size (xss.take i)).sum + (Option.map (fun xs => Array.findIdx p xs) xss[i]?).getD 0) (Array.findIdx? (fun x => x.any p) xss) - Array.findFinIdx?_push 📋 Init.Data.Array.Find
{α : Type u_1} {xs : Array α} {a : α} {p : α → Bool} : Array.findFinIdx? p (xs.push a) = (Option.map (Fin.castLE ⋯) (Array.findFinIdx? p xs)).or (if p a = true then some ⟨xs.size, ⋯⟩ else none) - Array.find?_pmap 📋 Init.Data.Array.Find
{α : Type u_1} {β : Type u_2} {P : α → Prop} {f : (a : α) → P a → β} {xs : Array α} (H : ∀ a ∈ xs, P a) {p : β → Bool} : Array.find? p (Array.pmap f xs H) = Option.map (fun x => match x with | ⟨a, m⟩ => f a ⋯) (Array.find? (fun x => match x with | ⟨a, m⟩ => p (f a ⋯)) xs.attach) - Array.findFinIdx?_append 📋 Init.Data.Array.Find
{α : Type u_1} {xs ys : Array α} {p : α → Bool} : Array.findFinIdx? p (xs ++ ys) = (Option.map (Fin.castLE ⋯) (Array.findFinIdx? p xs)).or (Option.map (Fin.cast ⋯) (Option.map (Fin.natAdd xs.size) (Array.findFinIdx? p ys))) - Vector.back?_map 📋 Init.Data.Vector.Lemmas
{α : Type u_1} {β : Type u_2} {n : ℕ} {f : α → β} {xs : Vector α n} : (Vector.map f xs).back? = Option.map f xs.back? - Vector.findFinIdx?_mk 📋 Init.Data.Vector.Lemmas
{α : Type u_1} {n : ℕ} {xs : Array α} (h : xs.size = n) (f : α → Bool) : Vector.findFinIdx? f (Vector.mk xs h) = Option.map (Fin.cast h) (Array.findFinIdx? f xs) - Vector.finIdxOf?_mk 📋 Init.Data.Vector.Lemmas
{α : Type u_1} {n : ℕ} [BEq α] {xs : Array α} (h : xs.size = n) (x : α) : (Vector.mk xs h).finIdxOf? x = Option.map (Fin.cast h) (xs.finIdxOf? x) - Vector.findFinIdx?_toList 📋 Init.Data.Vector.Lemmas
{α : Type u_1} {n : ℕ} {p : α → Bool} {xs : Vector α n} : List.findFinIdx? p xs.toList = Option.map (Fin.cast ⋯) (Vector.findFinIdx? p xs) - Vector.finIdxOf?_toList 📋 Init.Data.Vector.Lemmas
{α : Type u_1} {n : ℕ} [BEq α] {a : α} {xs : Vector α n} : List.finIdxOf? a xs.toList = Option.map (Fin.cast ⋯) (xs.finIdxOf? a) - Vector.findFinIdx?_toArray 📋 Init.Data.Vector.Lemmas
{α : Type u_1} {n : ℕ} {p : α → Bool} {xs : Vector α n} : Array.findFinIdx? p xs.toArray = Option.map (Fin.cast ⋯) (Vector.findFinIdx? p xs) - Vector.finIdxOf?_toArray 📋 Init.Data.Vector.Lemmas
{α : Type u_1} {n : ℕ} [BEq α] {a : α} {xs : Vector α n} : xs.toArray.finIdxOf? a = Option.map (Fin.cast ⋯) (xs.finIdxOf? a) - Vector.getElem?_map 📋 Init.Data.Vector.Lemmas
{α : Type u_1} {β : Type u_2} {n : ℕ} {f : α → β} {xs : Vector α n} {i : ℕ} : (Vector.map f xs)[i]? = Option.map f xs[i]? - String.find?_eq_find?_toSlice 📋 Init.Data.String.Lemmas.Pattern.Find.Basic
{ρ : Type} {pat : ρ} {σ : String.Slice → Type} [(s : String.Slice) → Std.Iterator (σ s) Id (String.Slice.Pattern.SearchStep s)] [(s : String.Slice) → Std.IteratorLoop (σ s) Id Id] [String.Slice.Pattern.ToForwardSearcher pat σ] {s : String} : s.find? pat = Option.map String.Pos.ofToSlice (s.toSlice.find? pat) - String.Pos.find?_eq_find?_toSlice 📋 Init.Data.String.Lemmas.Pattern.Find.Basic
{ρ : Type} {pat : ρ} {σ : String.Slice → Type} [(s : String.Slice) → Std.Iterator (σ s) Id (String.Slice.Pattern.SearchStep s)] [(s : String.Slice) → Std.IteratorLoop (σ s) Id Id] [String.Slice.Pattern.ToForwardSearcher pat σ] {s : String} {p : s.Pos} : p.find? pat = Option.map String.Pos.ofToSlice (p.toSlice.find? pat) - String.Slice.Pos.find?_eq_find?_sliceFrom 📋 Init.Data.String.Lemmas.Pattern.Find.Basic
{ρ : Type} {pat : ρ} {σ : String.Slice → Type} [(s : String.Slice) → Std.Iterator (σ s) Id (String.Slice.Pattern.SearchStep s)] [(s : String.Slice) → Std.IteratorLoop (σ s) Id Id] [String.Slice.Pattern.ToForwardSearcher pat σ] {s : String.Slice} {p : s.Pos} : p.find? pat = Option.map String.Slice.Pos.ofSliceFrom ((s.sliceFrom p).find? pat) - String.Slice.dropPrefix?_eq_map_skipPrefix? 📋 Init.Data.String.Lemmas.Pattern.TakeDrop.Basic
{ρ : Type} {pat : ρ} [String.Slice.Pattern.ForwardPattern pat] {s : String.Slice} : s.dropPrefix? pat = Option.map s.sliceFrom (s.skipPrefix? pat) - String.Slice.dropSuffix?_eq_map_skipSuffix? 📋 Init.Data.String.Lemmas.Pattern.TakeDrop.Basic
{ρ : Type} {pat : ρ} [String.Slice.Pattern.BackwardPattern pat] {s : String.Slice} : s.dropSuffix? pat = Option.map s.sliceTo (s.skipSuffix? pat) - String.skipPrefix?_eq_skipPrefix?_toSlice 📋 Init.Data.String.Lemmas.Pattern.TakeDrop.Basic
{ρ : Type} {pat : ρ} [String.Slice.Pattern.ForwardPattern pat] {s : String} : s.skipPrefix? pat = Option.map String.Pos.ofToSlice (s.toSlice.skipPrefix? pat) - String.skipSuffix?_eq_skipSuffix?_toSlice 📋 Init.Data.String.Lemmas.Pattern.TakeDrop.Basic
{ρ : Type} {pat : ρ} [String.Slice.Pattern.BackwardPattern pat] {s : String} : s.skipSuffix? pat = Option.map String.Pos.ofToSlice (s.toSlice.skipSuffix? pat) - String.skipPrefix?_toSlice 📋 Init.Data.String.Lemmas.Pattern.TakeDrop.Basic
{ρ : Type} {pat : ρ} [String.Slice.Pattern.ForwardPattern pat] {s : String} : s.toSlice.skipPrefix? pat = Option.map String.Pos.toSlice (s.skipPrefix? pat) - String.skipSuffix?_toSlice 📋 Init.Data.String.Lemmas.Pattern.TakeDrop.Basic
{ρ : Type} {pat : ρ} [String.Slice.Pattern.BackwardPattern pat] {s : String} : s.toSlice.skipSuffix? pat = Option.map String.Pos.toSlice (s.skipSuffix? pat) - String.revSkip?_eq_revSkip?_toSlice 📋 Init.Data.String.Lemmas.Pattern.TakeDrop.Basic
{ρ : Type} {pat : ρ} [String.Slice.Pattern.BackwardPattern pat] {s : String} {pos : s.Pos} : pos.revSkip? pat = Option.map String.Pos.ofToSlice (pos.toSlice.revSkip? pat) - String.Pos.skip?_eq_skip?_toSlice 📋 Init.Data.String.Lemmas.Pattern.TakeDrop.Basic
{ρ : Type} {pat : ρ} [String.Slice.Pattern.ForwardPattern pat] {s : String} {pos : s.Pos} : pos.skip? pat = Option.map String.Pos.ofToSlice (pos.toSlice.skip? pat) - String.Slice.Pos.revSkip?_eq_map_skipSuffix? 📋 Init.Data.String.Lemmas.Pattern.TakeDrop.Basic
{ρ : Type} {pat : ρ} [String.Slice.Pattern.BackwardPattern pat] {s : String.Slice} {pos : s.Pos} : pos.revSkip? pat = Option.map String.Slice.Pos.ofSliceTo ((s.sliceTo pos).skipSuffix? pat) - String.Slice.Pos.skip?_eq_map_skipPrefix? 📋 Init.Data.String.Lemmas.Pattern.TakeDrop.Basic
{ρ : Type} {pat : ρ} [String.Slice.Pattern.ForwardPattern pat] {s : String.Slice} {pos : s.Pos} : pos.skip? pat = Option.map String.Slice.Pos.ofSliceFrom ((s.sliceFrom pos).skipPrefix? pat) - String.revSkip?_toSlice 📋 Init.Data.String.Lemmas.Pattern.TakeDrop.Basic
{ρ : Type} {pat : ρ} [String.Slice.Pattern.BackwardPattern pat] {s : String} {pos : s.Pos} : pos.toSlice.revSkip? pat = Option.map String.Pos.toSlice (pos.revSkip? pat) - String.Pos.skip?_toSlice 📋 Init.Data.String.Lemmas.Pattern.TakeDrop.Basic
{ρ : Type} {pat : ρ} [String.Slice.Pattern.ForwardPattern pat] {s : String} {pos : s.Pos} : pos.toSlice.skip? pat = Option.map String.Pos.toSlice (pos.skip? pat) - String.Slice.copy_dropPrefix?_copy 📋 Init.Data.String.Lemmas.Pattern.TakeDrop.Basic
{ρ : Type} {pat : ρ} [String.Slice.Pattern.ForwardPattern pat] [String.Slice.Pattern.Model.PatternModel pat] [String.Slice.Pattern.Model.LawfulForwardPatternModel pat] {s : String.Slice} : Option.map String.Slice.copy (s.copy.dropPrefix? pat) = Option.map String.Slice.copy (s.dropPrefix? pat) - String.Slice.copy_dropSuffix?_copy 📋 Init.Data.String.Lemmas.Pattern.TakeDrop.Basic
{ρ : Type} {pat : ρ} [String.Slice.Pattern.BackwardPattern pat] [String.Slice.Pattern.Model.PatternModel pat] [String.Slice.Pattern.Model.LawfulBackwardPatternModel pat] {s : String.Slice} : Option.map String.Slice.copy (s.copy.dropSuffix? pat) = Option.map String.Slice.copy (s.dropSuffix? pat) - String.Slice.skipPrefix?_copy 📋 Init.Data.String.Lemmas.Pattern.TakeDrop.Basic
{ρ : Type} {pat : ρ} [String.Slice.Pattern.ForwardPattern pat] [String.Slice.Pattern.Model.PatternModel pat] [String.Slice.Pattern.Model.LawfulForwardPatternModel pat] {s : String.Slice} : s.copy.skipPrefix? pat = Option.map String.Slice.Pos.copy (s.skipPrefix? pat) - String.Slice.skipSuffix?_copy 📋 Init.Data.String.Lemmas.Pattern.TakeDrop.Basic
{ρ : Type} {pat : ρ} [String.Slice.Pattern.BackwardPattern pat] [String.Slice.Pattern.Model.PatternModel pat] [String.Slice.Pattern.Model.LawfulBackwardPatternModel pat] {s : String.Slice} : s.copy.skipSuffix? pat = Option.map String.Slice.Pos.copy (s.skipSuffix? pat) - String.Slice.dropPrefix?_congr 📋 Init.Data.String.Lemmas.Pattern.TakeDrop.Basic
{ρ : Type} {pat : ρ} [String.Slice.Pattern.Model.PatternModel pat] [String.Slice.Pattern.ForwardPattern pat] [String.Slice.Pattern.Model.LawfulForwardPatternModel pat] {s t : String.Slice} (hst : s.copy = t.copy) : Option.map String.Slice.copy (s.dropPrefix? pat) = Option.map String.Slice.copy (t.dropPrefix? pat) - String.Slice.dropSuffix?_congr 📋 Init.Data.String.Lemmas.Pattern.TakeDrop.Basic
{ρ : Type} {pat : ρ} [String.Slice.Pattern.Model.PatternModel pat] [String.Slice.Pattern.BackwardPattern pat] [String.Slice.Pattern.Model.LawfulBackwardPatternModel pat] {s t : String.Slice} (hst : s.copy = t.copy) : Option.map String.Slice.copy (s.dropSuffix? pat) = Option.map String.Slice.copy (t.dropSuffix? pat) - String.Slice.Pos.revSkip?_copy 📋 Init.Data.String.Lemmas.Pattern.TakeDrop.Basic
{ρ : Type} {pat : ρ} [String.Slice.Pattern.BackwardPattern pat] [String.Slice.Pattern.Model.PatternModel pat] [String.Slice.Pattern.Model.LawfulBackwardPatternModel pat] {s : String.Slice} {pos : s.Pos} : pos.copy.revSkip? pat = Option.map String.Slice.Pos.copy (pos.revSkip? pat) - String.Slice.Pos.skip?_copy 📋 Init.Data.String.Lemmas.Pattern.TakeDrop.Basic
{ρ : Type} {pat : ρ} [String.Slice.Pattern.ForwardPattern pat] [String.Slice.Pattern.Model.PatternModel pat] [String.Slice.Pattern.Model.LawfulForwardPatternModel pat] {s : String.Slice} {pos : s.Pos} : pos.copy.skip? pat = Option.map String.Slice.Pos.copy (pos.skip? pat) - String.Slice.skipPrefix?_congr 📋 Init.Data.String.Lemmas.Pattern.TakeDrop.Basic
{ρ : Type} {pat : ρ} [String.Slice.Pattern.Model.PatternModel pat] [String.Slice.Pattern.ForwardPattern pat] [String.Slice.Pattern.Model.LawfulForwardPatternModel pat] {s t : String.Slice} (hst : s.copy = t.copy) : s.skipPrefix? pat = Option.map (fun x => x.cast ⋯) (t.skipPrefix? pat) - String.Slice.skipSuffix?_congr 📋 Init.Data.String.Lemmas.Pattern.TakeDrop.Basic
{ρ : Type} {pat : ρ} [String.Slice.Pattern.Model.PatternModel pat] [String.Slice.Pattern.BackwardPattern pat] [String.Slice.Pattern.Model.LawfulBackwardPatternModel pat] {s t : String.Slice} (hst : s.copy = t.copy) : s.skipSuffix? pat = Option.map (fun x => x.cast ⋯) (t.skipSuffix? pat) - String.Slice.Pos.revSkip?_cast 📋 Init.Data.String.Lemmas.Pattern.TakeDrop.Basic
{ρ : Type} {pat : ρ} [String.Slice.Pattern.Model.PatternModel pat] [String.Slice.Pattern.BackwardPattern pat] [String.Slice.Pattern.Model.LawfulBackwardPatternModel pat] {s t : String.Slice} (hst : s.copy = t.copy) {pos : s.Pos} : (pos.cast hst).revSkip? pat = Option.map (fun x => x.cast hst) (pos.revSkip? pat) - String.Slice.Pos.skip?_cast 📋 Init.Data.String.Lemmas.Pattern.TakeDrop.Basic
{ρ : Type} {pat : ρ} [String.Slice.Pattern.Model.PatternModel pat] [String.Slice.Pattern.ForwardPattern pat] [String.Slice.Pattern.Model.LawfulForwardPatternModel pat] {s t : String.Slice} (hst : s.copy = t.copy) {pos : s.Pos} : (pos.cast hst).skip? pat = Option.map (fun x => x.cast hst) (pos.skip? pat) - String.Slice.Pos.revSkip?_congr 📋 Init.Data.String.Lemmas.Pattern.TakeDrop.Basic
{ρ : Type} {pat : ρ} [String.Slice.Pattern.Model.PatternModel pat] [String.Slice.Pattern.BackwardPattern pat] [String.Slice.Pattern.Model.LawfulBackwardPatternModel pat] {s t : String.Slice} (hst : s.copy = t.copy) {pos : s.Pos} : pos.revSkip? pat = Option.map (fun x => x.cast ⋯) ((pos.cast hst).revSkip? pat) - String.Slice.Pos.skip?_congr 📋 Init.Data.String.Lemmas.Pattern.TakeDrop.Basic
{ρ : Type} {pat : ρ} [String.Slice.Pattern.Model.PatternModel pat] [String.Slice.Pattern.ForwardPattern pat] [String.Slice.Pattern.Model.LawfulForwardPatternModel pat] {s t : String.Slice} (hst : s.copy = t.copy) {pos : s.Pos} : pos.skip? pat = Option.map (fun x => x.cast ⋯) ((pos.cast hst).skip? pat) - List.getElem?_succ_scanl 📋 Init.Data.List.Scan.Lemmas
{β : Type u_1} {α : Type u_2} {b : β} {l : List α} {i : ℕ} {f : β → α → β} : (List.scanl f b l)[i + 1]? = (List.scanl f b l)[i]?.bind fun x => Option.map (fun y => f x y) l[i]? - Array.getElem?_zipWith' 📋 Init.Data.Array.Zip
{α : Type u_1} {β : Type u_2} {γ : Type u_3} {l₁ : Array α} {l₂ : Array β} {f : α → β → γ} {i : ℕ} : (Array.zipWith f l₁ l₂)[i]? = (Option.map f l₁[i]?).bind fun g => Option.map g l₂[i]? - Array.getElem?_zipIdx 📋 Init.Data.Array.Range
{α : Type u_1} {xs : Array α} {i j : ℕ} : (xs.zipIdx i)[j]? = Option.map (fun a => (a, i + j)) xs[j]? - Option.forM_map 📋 Init.Data.Option.Monadic
{m : Type u_1 → Type u_2} {α : Type u_3} {β : Type u_4} [Monad m] [LawfulMonad m] (o : Option α) (g : α → β) (f : β → m PUnit.{u_1 + 1}) : forM (Option.map g o) f = forM o fun a => f (g 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.forIn_map 📋 Init.Data.Option.Monadic
{m : Type u_1 → Type u_2} {α : Type u_3} {β : Type u_4} {γ : Type u_1} {init : γ} [Monad m] [LawfulMonad m] (o : Option α) (g : α → β) (f : β → γ → m (ForInStep γ)) : forIn (Option.map g o) init f = forIn o init fun a y => f (g a) y - Option.forIn'_map 📋 Init.Data.Option.Monadic
{m : Type u_1 → Type u_2} {α : Type u_3} {β : Type u_4} {γ : Type u_1} {init : γ} [Monad m] [LawfulMonad m] (o : Option α) (g : α → β) (f : (b : β) → b ∈ Option.map g o → γ → m (ForInStep γ)) : forIn' (Option.map g o) init f = forIn' o init fun a h y => f (g a) ⋯ y - Option.map_injective 📋 Init.Data.Option.Function
{α : Type u_1} {β : Type u_2} {f : α → β} (hf : Function.Injective f) : Function.Injective (Option.map f) - Sum.getLeft?_map 📋 Init.Data.Sum.Lemmas
{α : Type u_1} {β : Type u_2} {γ : Type u_3} {δ : Type u_4} (f : α → β) (g : γ → δ) (x : α ⊕ γ) : (Sum.map f g x).getLeft? = Option.map f x.getLeft? - Sum.getRight?_map 📋 Init.Data.Sum.Lemmas
{α : Type u_1} {β : Type u_2} {γ : Type u_3} {δ : Type u_4} (f : α → β) (g : γ → δ) (x : α ⊕ γ) : (Sum.map f g x).getRight? = Option.map g x.getRight? - Vector.find?_subtype 📋 Init.Data.Vector.Attach
{α : Type} {n : ℕ} {p : α → Prop} {xs : Vector { x // p x } n} {f : { x // p x } → Bool} {g : α → Bool} (hf : ∀ (x : α) (h : p x), f ⟨x, h⟩ = g x) : Option.map Subtype.val (Vector.find? f xs) = Vector.find? g xs.unattach - Vector.back?_pmap 📋 Init.Data.Vector.Attach
{α : Type u_1} {β : Type u_2} {n : ℕ} {P : α → Prop} {f : (a : α) → P a → β} {xs : Vector α n} (H : ∀ a ∈ xs, P a) : (Vector.pmap f xs H).back? = Option.map (fun x => match x with | ⟨a, m⟩ => f a ⋯) xs.attach.back? - Vector.getElem?_unattach 📋 Init.Data.Vector.Attach
{α : Type u_1} {n : ℕ} {p : α → Prop} {xs : Vector { x // p x } n} (i : ℕ) : xs.unattach[i]? = Option.map Subtype.val xs[i]? - Vector.back?_mapIdx 📋 Init.Data.Vector.MapIdx
{α : Type u_1} {n : ℕ} {β : Type u_2} {xs : Vector α n} {f : ℕ → α → β} : (Vector.mapIdx f xs).back? = Option.map (f (n - 1)) xs.back?
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