Documentation

RoseTree.Basic

@[simp]
theorem Rose.eta {A : Type u_1} (t : Rose A) :
{ label := t.label, children := t.children } = t
@[simp]
theorem Rose.label_bind {A : Type u_1} {B : Type u_2} (f : ARose B) (t : Rose A) :
(bind f t).label = (f t.label).label
@[simp]
theorem Rose.children_bind {A : Type u_1} {B : Type u_2} (f : ARose B) (t : Rose A) :
@[simp]
theorem Rose.label_map {A : Type u_1} {B : Type u_2} (f : AB) (t : Rose A) :
(map f t).label = f t.label
@[simp]
theorem Rose.children_map {A : Type u_1} {B : Type u_2} (f : AB) (t : Rose A) :
theorem Rose.induction {A : Type u_1} (motive : Rose AProp) (mk : ∀ (label : A) (children : List (Rose A)), (∀ tchildren, motive t)motive { label := label, children := children }) (t : Rose A) :
motive t
theorem Rose.induction' {A : Type u_1} (motive : Rose AProp) (mk : ∀ (label : A) (children : List (Rose A)), (∀ (i : Fin children.length), motive children[i])motive { label := label, children := children }) (t : Rose A) :
motive t
theorem Rose.bind_pure {A : Type u_1} (t : Rose A) :
bind (fun (x : A) => { label := x, children := [] }) t = t
@[simp]
theorem Rose.bind_pure_fun {A : Type u_1} :
(bind fun (x : A) => { label := x, children := [] }) = id
@[simp]
theorem Rose.bind_bind {A : Type u_1} {B : Type u_2} {C : Type u_3} (f : BRose C) (g : ARose B) (t : Rose A) :
bind f (bind g t) = bind (fun (x : A) => bind f (g x)) t
@[simp]
theorem Rose.bind_comp {A : Type u_1} {B : Type u_2} {C : Type u_3} (f : BRose C) (g : ARose B) :
bind f bind g = bind (bind f g)
@[simp]
theorem Rose.bind_comp_r {A : Type u_1} {B : Type u_2} {C : Type u_3} {D : Type u_4} (f : BRose C) (g : ARose B) (h : DRose A) :
bind f bind g h = bind (bind f g) h
@[simp]
theorem Rose.fold_eq_bind {A : Type u_1} {B : Type u_2} (f : ARose B) :
(fold fun (x : A) (xs : List (Rose B)) => { label := (f x).label, children := (f x).children ++ xs }) = bind f
@[simp]
theorem Rose.map_mk {A : Type u_1} {B : Type u_2} (f : AB) (x : A) (xs : List (Rose A)) :
map f { label := x, children := xs } = { label := f x, children := List.map (map f) xs }
@[simp]
theorem Rose.map_id {A : Type u_1} {f : AA} (hf : ∀ (x : A), f x = x) (t : Rose A) :
map f t = t
@[simp]
theorem Rose.map_map {A : Type u_1} {B : Type u_2} {C : Type u_3} (f : BC) (g : AB) (t : Rose A) :
map f (map g t) = map (fun (x : A) => f (g x)) t
@[simp]
theorem Rose.map_bind {A : Type u_1} {B : Type u_2} {C : Type u_3} (f : BC) (g : ARose B) (t : Rose A) :
map f (bind g t) = bind (fun (x : A) => map f (g x)) t
@[simp]
theorem Rose.bind_map {A : Type u_1} {B : Type u_2} {C : Type u_3} (f : BRose C) (g : AB) (t : Rose A) :
bind f (map g t) = bind (fun (x : A) => f (g x)) t
@[simp]
theorem Rose.bind_eq_map {A : Type u_1} {B : Type u_2} (f : AB) (t : Rose A) :
bind (fun (x : A) => { label := f x, children := [] }) t = map f t
@[simp]
theorem Rose.fold_map {A : Type u_1} {B : Type u_2} {C : Type u_3} (f : BList CC) (g : AB) (t : Rose A) :
fold f (map g t) = fold (fun (x : A) => f (g x)) t
@[simp]
theorem Rose.bind_eq {A B : Type u_1} (t : Rose A) (f : ARose B) :
t >>= f = bind f t
@[simp]
theorem Rose.pure_eq {A : Type u_1} (x : A) :
pure x = { label := x, children := [] }
@[simp]
theorem Rose.seq_eq {A B : Type u_1} (f : Rose (AB)) (t : Rose A) :
f <*> t = bind (fun (f : AB) => map f t) f
@[simp]
theorem Rose.map_eq {A B : Type u_1} (f : AB) (t : Rose A) :
f <$> t = map f t
@[simp]
theorem Rose.seqLeft_eq {A B : Type u_1} (t : Rose A) (u : Rose B) :
t <* u = bind (fun (x : A) => map (fun (x_1 : B) => x) u) t
@[simp]
theorem Rose.seqRight_eq {A B : Type u_1} (t : Rose A) (u : Rose B) :
t *> u = bind (fun (x : A) => u) t
@[simp]
theorem Rose.decode_encode {A : Type u_1} [Encodable A] (t : Rose A) :
instance Rose.instEncodable {A : Type u_1} [Encodable A] :
Equations
@[simp]
theorem Rose.le_mk {A : Type u_1} [LE A] (x y : A) (xs ys : List (Rose A)) :
{ label := x, children := xs } { label := y, children := ys } x y List.Forall₂ (fun (x1 x2 : Rose A) => x1 x2) xs ys
instance Rose.instPreorder {A : Type u_1} [Preorder A] :
Equations
Equations