Documentation

LeanPool.RareSubtreePatterns.Lukasiewicz.Coding

The Łukasiewicz coding of plane trees #

Section 2.1 of the paper (source lines 683–696) and Section 2.3 (source lines 735–736).

Forests (lists of trees) are coded by concatenation (PlaneTree.forestSeq); a forest of k trees corresponds to a sequence with first passage to -k at its end.

The DFS sequence 𝐱(T) = (k_{u_1}(T) - 1, …, k_{u_n}(T) - 1) of a plane tree.

Equations
Instances For

    The DFS sequence of a forest: the concatenation of the DFS sequences of its trees.

    Equations
    Instances For

      Every entry of a DFS sequence is at least -1.

      theorem PoissonDeclumping.PlaneTree.forestSeq_excursion {ts : List PlaneTree} (h : ∀ t ∈ ts, t.dfsSeq.sum = -1 ∧ ∀ j < t.dfsSeq.length, 0 ≤ (List.take j t.dfsSeq).sum) :
      (forestSeq ts).sum = -↑ts.length ∧ ∀ j < (forestSeq ts).length, -↑ts.length < (List.take j (forestSeq ts)).sum

      Excursion property of forests, given the excursion property of every tree.

      Łukasiewicz excursion property. The DFS sequence of a tree sums to -1, and all its proper partial sums are nonnegative.

      All proper partial sums of a DFS sequence are nonnegative (before ζ).

      Łukasiewicz coding (B02). For every tree T and every continuation 𝐲, ζ(𝐱(T) 𝐲) = |T|.

      theorem PoissonDeclumping.PlaneTree.dfsSeq_append_inj {T U : PlaneTree} {y z : List ℤ} (h : T.dfsSeq ++ y = U.dfsSeq ++ z) :
      T = U ∧ y = z

      The coding is prefix-free: a DFS sequence determines its tree even when followed by an arbitrary continuation.

      The outdegree sequence in DFS order determines the tree.

      theorem PoissonDeclumping.PlaneTree.exists_forestSeq_eq (x : List ℤ) (hx : ∀ a ∈ x, -1 ≤ a) (k : ℕ) (hs : x.sum = -↑k) (hp : ∀ j < x.length, -↑k < (List.take j x).sum) :
      ∃ (ts : List PlaneTree), ts.length = k ∧ forestSeq ts = x

      Every sequence with increments ≥ -1 and first passage to -k exactly at its end is the DFS sequence of a forest of k trees.

      theorem PoissonDeclumping.PlaneTree.exists_dfsSeq_eq_take {x : List ℤ} (hx : ∀ a ∈ x, -1 ≤ a) {m : ℕ} (hz : Lukasiewicz.zeta x = some m) :
      ∃ (T : PlaneTree), T.dfsSeq = List.take m x ∧ T.vertexCount = m

      Łukasiewicz coding, surjectivity (B02). If 𝐱 has increments ≥ -1 and ζ(𝐱) = m < ∞, then (x_1, …, x_m) is the DFS sequence of a tree (with m vertices).

      The paper's T(𝐱): the tree whose DFS sequence is (x_1, …, x_{ζ(𝐱)}), if ζ(𝐱) < ∞ and this prefix is a DFS sequence (which holds whenever all increments are ≥ -1), and none otherwise.

      Equations
      • One or more equations did not get rendered due to their size.
      Instances For

        Characterization of T(𝐱).

        T(𝐱(T) 𝐲) = T for every continuation 𝐲.

        theorem PoissonDeclumping.PlaneTree.exists_ofSeq_eq_some {x : List ℤ} (hx : ∀ a ∈ x, -1 ≤ a) {m : ℕ} (hz : Lukasiewicz.zeta x = some m) :

        If 𝐱 has increments ≥ -1 and ζ(𝐱) = m < ∞, then T(𝐱) is defined, has m vertices, and its DFS sequence is (x_1, …, x_m).

        For sequences with increments ≥ -1, T(𝐱) is defined exactly when ζ(𝐱) < ∞.

        The range of the coding: a finite sequence is a DFS sequence iff its increments are ≥ -1 and its first passage time to -1 is its length.

        Fringe subtrees and cyclic shifts (eq:fringe) #

        The DFS sequence of the fringe subtree at the i-th vertex (in DFS order, 0-indexed) is a contiguous block of 𝐱(T) starting at position i.

        Index bound transfer: |T| is the length of the list of fringe trees.

        The i-th cyclic shift of 𝐱(T) starts with the DFS sequence of the fringe subtree at the i-th vertex.

        eq:fringe. The i-th cyclic shift of 𝐱(T) first hits -1 at the size of the fringe subtree T_{u_i} at the i-th vertex.

        eq:fringe. The i-th cyclic shift of 𝐱(T), up to its first passage time to -1, is the DFS sequence of the fringe subtree T_{u_i}.

        eq:fringe. T(𝐱^{(i)}(T)) = T_{u_i}.