Documentation

BGW.Tree.CycleLemma

The cycle lemma for Łukasiewicz bridges #

A bridge word of length n has entries at least -1 and sum -1. Writing S j for its prefix sums, the rotation by i < n is a tree excursion exactly when i is the first index in [0, n) at which S attains its minimum. Hence every bridge word has exactly one rotation that is a tree excursion, and (t, i) ↦ (increments t).rotate i is a bijection from the pairs of a tree of size n and an index i < n onto the bridge words of length n. Since rotating a word permutes its entries, the walk weight is rotation invariant, and n times the total weight of the trees of size n is the total walk weight of the bridge words. Adapted from PoissonDeclumping/Lukasiewicz/CyclicShift.lean, with the library's prefix-sum excursions.

Words of length n with all entries at least -1 and total sum -1.

Equations
Instances For
    theorem BGW.sum_take_rotate (x : List ℤ) {i k : ℕ} (hi : i ≤ x.length) (hk : k ≤ x.length) :
    (List.take k (x.rotate i)).sum = if k ≤ x.length - i then (List.take (i + k) x).sum - (List.take i x).sum else x.sum - (List.take i x).sum + (List.take (k - (x.length - i)) x).sum

    Prefix sums of a rotation, in terms of prefix sums of the original word.

    A bridge word has exactly one rotation, by an index below its length, that is a tree excursion: the cycle lemma.

    theorem BGW.walkWeight_rotate (p : ℕ → ENNReal) (x : List ℤ) (i : ℕ) :

    Rotating a word permutes its entries, so the walk weight is unchanged.

    def BGW.PlaneTree.shiftMap (n : ℕ) (q : { t : PlaneTree // t.size = n } × Fin n) :

    Cyclic shifts of the codes of trees with n vertices.

    Equations
    Instances For
      noncomputable def BGW.PlaneTree.shiftEquiv (n : ℕ) :

      The cycle lemma as an equivalence.

      Equations
      Instances For

        Kemperman–Dwass identity in weight form: n times the total weight of the trees of size n is the total walk weight of the bridge words of length n. No hypothesis on p.