The Mathlib Handbook

The volumes of the handbook are not written yet. This site shows the map of Mathlib that they will follow, at Mathlib 4472534b60.

The areas / V33. Data structures and computation

Mathlib.Data.Tree.Traversable

5 declarations. Mathlib docs · Source

instance BinaryTree.instTraversable E0 #

Traversable BinaryTree

theorem BinaryTree.comp_traverse E1 #

∀ {α : Type u_1} {F : Type u → Type v} {G : Type v → Type w} [inst : Applicative F] [inst_1 : Applicative G]
  [LawfulApplicative G] {β : Type v} {γ : Type u} (f : β → F γ) (g : α → G β) (t : BinaryTree α),
  BinaryTree.traverse (Functor.Comp.mk ∘ (fun x ↦ f <$> x) ∘ g) t =
    Functor.Comp.mk ((fun x ↦ BinaryTree.traverse f x) <$> BinaryTree.traverse g t)

theorem BinaryTree.traverse_eq_map_id E1 #

∀ {α : Type u_1} {β : Type u_2} (f : α → β) (t : BinaryTree α),
  BinaryTree.traverse (pure ∘ f) t = pure (BinaryTree.map f t)

theorem BinaryTree.naturality E1 #

∀ {α : Type u_1} {F : Type u → Type u_3} {G : Type u → Type u_4} [inst : Applicative F] [inst_1 : Applicative G]
  [LawfulApplicative F] [LawfulApplicative G] (η : ApplicativeTransformation F G) {β : Type u} (f : α → F β)
  (t : BinaryTree α), (fun {α} ↦ η.app α) (BinaryTree.traverse f t) = BinaryTree.traverse (η.app β ∘ f) t

instance BinaryTree.instLawfulTraversable E0 #

LawfulTraversable BinaryTree