@[instance_reducible]
Equations
- Word.instCoeList = { coe := Word.ofList }
@[instance_reducible]
Equations
- Word.instCoeForallNat = { coe := Word.ofSeq }
@[instance_reducible]
Equations
- Word.instInhabited = { default := Word.nil }
Equations
- Word.ofGet? f = { get? := Word.ofGet?' f, wf := ⋯ }
Instances For
Equations
- Word.append' f g 0 = (f 0).or (g 0)
- Word.append' f g i.succ = match f 0 with | none => g (i + 1) | some val => Word.append' (fun (x : ℕ) => f (x + 1)) g i
Instances For
@[instance_reducible]
Equations
- Word.instAppend = { append := Word.append }
Equations
- L.flatten = Word.ofGet? fun (i : ℕ) => choose? fun (x : α) => ∃ (n : ℕ), (List.foldr Word.append Word.nil (Word.take n L)).get? i = some x
Instances For
noncomputable def
Word.wordFun
{α : Type u_1}
{β : Type u_2}
(p : (ℕ → α) → Prop)
(f : List α → List β)
(xs : Word α)
:
Word β
Equations
- Word.wordFun p f xs = match xs.cases with | Sum.inl xs => Word.ofList (f xs) | Sum.inr a => if h : IsEmpty β then Word.nil else Word.ofSeq (seqFun p f a)
Instances For
@[instance_reducible]
Equations
- Word.instMembership = { mem := Word.mem }