Documentation

LeanPool.RareSubtreePatterns.Patterns.CutGraft

Cutting and grafting at a DFS position #

Source lines 2487–2509 (Section 6.1 of the paper; inventory U08) and the weight computations in the proof of Lemma lem:cut_graft, lines 2557–2580 (inventory P18).

For a finite plane tree T with |T| ≥ ℓ + 1, the paper's Cut_ℓ(T) replaces the fringe subtree T_{u_{ℓ+1}(T)} at the (ℓ+1)-st vertex in depth-first order by a single marked leaf ⋆; conversely A[S] grafts a tree S at the marked leaf of a marked tree A.

Main facts (U08): cut_graft (Cut_ℓ(A[S]) = A), fringeAt_graft (the (ℓ+1)-st fringe subtree of A[S] is S), graft_cut (T = Cut_ℓ(T)[T_{u_{ℓ+1}}]), graft_inj (uniqueness of the decomposition once the position of the marked leaf is fixed), cutFamily_eq (𝒜_ℓ = the marked trees whose marked leaf is the (ℓ+1)-st vertex: the DFS position of ⋆ is preserved), and the bijection cutEquiv.

Weights (P18): MarkedTree.weight μ A = ∏_{v ∈ A, v ≠ ⋆} μ_{k_v(A)} and the exact factorization weight_graft: 𝐏_μ(A[S]) = w(A) 𝐏_μ(S); the sum over cut trees bienayme_cut_mem: 𝐏(|𝒯| ≥ ℓ+1, Cut_ℓ(𝒯) ∈ 𝓡, 𝒯_{u_{ℓ+1}} ∈ F(Cut_ℓ(𝒯))) = ∑_{A ∈ 𝓡} w(A) 𝐏(𝒯 ∈ F(A)). These hold for every offspring law μ (no criticality is used).

Fringe subtree at a DFS position #

The fringe subtree T_{u_{i+1}(T)} at the vertex of DFS index i (0-indexed). It is T.fringeTrees[i] when i < |T|; for i ≥ |T| it is a (never used) leaf.

Equations
Instances For

    The DFS sequence of T splits around the block of the fringe subtree at DFS index i.

    Splicing DFS sequences #

    theorem PoissonDeclumping.PlaneTree.exists_dfsSeq_eq_of_excursion {y : List ℤ} (hy : ∀ a ∈ y, -1 ≤ a) (hs : y.sum = -1) (hp : ∀ j < y.length, 0 ≤ (List.take j y).sum) :
    ∃ (T : PlaneTree), T.dfsSeq = y

    A sequence with increments ≥ -1, total sum -1 and nonnegative proper partial sums is a DFS sequence.

    theorem PoissonDeclumping.PlaneTree.exists_dfsSeq_splice {a u z s : List ℤ} (hx : ∃ (T : PlaneTree), T.dfsSeq = a ++ u ++ z) (hu : ∃ (U : PlaneTree), U.dfsSeq = u) (hs : ∃ (S : PlaneTree), S.dfsSeq = s) :
    ∃ (T₀ : PlaneTree), T₀.dfsSeq = a ++ s ++ z

    Replacing a sub-excursion u of a DFS sequence a ++ u ++ z by another DFS sequence s yields a DFS sequence.

    Replacing a fringe subtree #

    replaceAt T i S: the tree obtained from T by replacing the fringe subtree T_{u_{i+1}(T)} at the vertex of DFS index i by S. It is the tree whose DFS sequence is 𝐱(T) with the block of T_{u_{i+1}} replaced by 𝐱(S) (dfsSeq_replaceAt, for i < |T|).

    Equations
    Instances For

      The DFS sequence before position i is unchanged: in particular the vertex where S is grafted keeps its DFS position i.

      After replacement, the fringe subtree at DFS index i is S.

      Replacing at the root (DFS index 0) replaces the whole tree.

      theorem PoissonDeclumping.PlaneTree.weight_replaceAt_mul {T : PlaneTree} {i : ℕ} (h : i < T.vertexCount) (μ : PMF ℕ) (S : PlaneTree) :
      weight μ (T.replaceAt i S) * weight μ (T.fringeAt i) = weight μ T * weight μ S

      Bienaymé weights under replacement: 𝐏_μ(T[S/T_{u_{i+1}}]) 𝐏_μ(T_{u_{i+1}}) = 𝐏_μ(T) 𝐏_μ(S).

      Marked trees, cut and graft #

      A marked tree: a finite plane tree tree with a marked leaf ⋆, recorded by its DFS index pos (0-indexed, so ⋆ = u_{pos+1}).

      Instances For
        theorem PoissonDeclumping.PlaneTree.MarkedTree.ext {x y : MarkedTree} (tree : x.tree = y.tree) (pos : x.pos = y.pos) :
        x = y

        A[S]: graft the tree S at the marked leaf of A.

        Equations
        Instances For

          w(A) = ∏_{v ∈ A, v ≠ ⋆} μ_{k_v(A)} (source line 2560): the Bienaymé weight of A without the factor of the marked leaf.

          Equations
          Instances For

            The fringe subtree of A[S] at the DFS position of ⋆ is S.

            Weight factorization (source line 2562, inventory P18): 𝐏_μ(𝒯 = A[S]) = w(A) 𝐏_μ(𝒯 = S).

            𝐏_μ(𝒯 = A[S]) = w(A) 𝐏_μ(𝒯 = S), as point masses of the Bienaymé measure.

            Consistency check: as an ordinary plane tree, A has weight w(A) μ_0.

            noncomputable def PoissonDeclumping.PlaneTree.cut (ℓ : ℕ) (T : PlaneTree) :

            Cut_ℓ(T): replace the fringe subtree T_{u_{ℓ+1}(T)} by a marked leaf ⋆, which is then the vertex of DFS index ℓ. Only used for |T| ≥ ℓ + 1 (otherwise a fixed junk value).

            Equations
            • One or more equations did not get rendered due to their size.
            Instances For
              theorem PoissonDeclumping.PlaneTree.cut_tree {ℓ : ℕ} {T : PlaneTree} (h : ℓ < T.vertexCount) :
              (cut ℓ T).tree = T.replaceAt ℓ (node [])
              theorem PoissonDeclumping.PlaneTree.cut_pos {ℓ : ℕ} {T : PlaneTree} (h : ℓ < T.vertexCount) :
              (cut ℓ T).pos = ℓ

              The marked leaf of Cut_ℓ(T) is its (ℓ+1)-st vertex: the DFS position is preserved.

              theorem PoissonDeclumping.PlaneTree.graft_cut {ℓ : ℕ} {T : PlaneTree} (h : ℓ < T.vertexCount) :
              (cut ℓ T).graft (T.fringeAt ℓ) = T

              T = Cut_ℓ(T)[T_{u_{ℓ+1}(T)}].

              Cut_ℓ(A[S]) = A when the marked leaf of A is its (ℓ+1)-st vertex.

              theorem PoissonDeclumping.PlaneTree.graft_inj {A A' : MarkedTree} {S S' : PlaneTree} (hpos : A.pos = A'.pos) (h : A.graft S = A'.graft S') :
              A = A' ∧ S = S'

              Uniqueness of the decomposition T = A[S] once the position of the marked leaf is fixed.

              𝒜_ℓ consists exactly of the marked trees whose marked leaf is the (ℓ+1)-st vertex.

              The cut-and-graft bijection {T : |T| ≥ ℓ + 1} ≃ 𝒜_ℓ × {plane trees}, T ↦ (Cut_ℓ(T), T_{u_{ℓ+1}(T)}), with inverse (A, S) ↦ A[S].

              Equations
              • One or more equations did not get rendered due to their size.
              Instances For
                theorem PoissonDeclumping.PlaneTree.bienayme_cut_mem (μ : PMF ℕ) (ℓ : ℕ) (R : Set MarkedTree) (hR : R ⊆ cutFamily ℓ) (F : MarkedTree → Set PlaneTree) :
                (bienayme μ) {T : PlaneTree | ℓ + 1 ≤ T.vertexCount ∧ cut ℓ T ∈ R ∧ T.fringeAt ℓ ∈ F (cut ℓ T)} = ∑' (A : MarkedTree), R.indicator (fun (A : MarkedTree) => MarkedTree.weight μ A * (bienayme μ) (F A)) A

                Sum over cut trees (inventory P18). For 𝓡 ⊆ 𝒜_ℓ and target sets F(A), 𝐏_μ(|𝒯| ≥ ℓ+1, Cut_ℓ(𝒯) ∈ 𝓡, 𝒯_{u_{ℓ+1}(𝒯)} ∈ F(Cut_ℓ(𝒯))) = ∑_{A ∈ 𝓡} w(A) 𝐏_μ(𝒯 ∈ F(A)), for every offspring law μ.