Documentation

Linglib.Core.Combinatorics.RootedTree.Cut

Admissible cuts on n-ary rooted trees #

[MCB25] [foissy-introduction-hopf-algebras-trees]

An admissible cut of a tree T is a subset of edges such that every root-to-leaf path of T contains at most one selected edge. After deleting the selected edges, T decomposes into:

This file provides admissible cuts on the n-ary rooted-tree carrier RoseTree α (RoseTree/Basic.lean). The cuts work uniformly across arities — the binary case inherits as a subtype.

Status #

[UPSTREAM] candidate. No sorries.

MCB anchor #

[MCB25] Definition 1.2.6 (book p. 31) for the admissible cut definition; Lemma 1.2.7 (book p. 32) for the equivalence with forest extraction. Definitions 1.2.4 (T/^c, p. 30), 1.2.5 (T/^d, p. 31), 1.2.6 (T/^p, p. 31) for the three remainder flavors. We expose remainderDeletion (T/^p, p. 31) and remainderTrace (T/^c, p. 30); MCB's T/^d (deletion-then-rebinarize) is not directly exposed here since it's the closest to the consumer- visible "Externalization" form (PF interface) and can be derived from T/^p via tree-binarization at the algebra layer.

§1: The Cut inductive #

A cut is recursively built from a per-vertex choice: at the root, for each child edge, decide whether to (a) cut this edge (extracting that subtree), or (b) recurse into that subtree's own cut. The "antichain" condition (no two cuts on the same root-to-leaf path) is baked in because once you cut an edge, you don't recurse beneath it.

inductive RoseTree.Cut {α : Type u_1} :
RoseTree αType u_1

An admissible cut on a tree T: at the root vertex, a per-child cut decision for each child. (For a leaf, the empty list of children gives the unique trivial cut.)

  • mk {α : Type u_1} {a : α} {cs : List (RoseTree α)} (decisions : ChildCutList cs) : (node a cs).Cut

    A cut on a tree, given as a per-child decision list (matching the children list of the root by length).

Instances For
    inductive RoseTree.ChildCut {α : Type u_1} :
    RoseTree αType u_1

    A per-child cut decision: either extract (cut the edge and extract this subtree whole) or recurse cut (keep this edge, apply cut to the subtree).

    Instances For
      inductive RoseTree.ChildCutList {α : Type u_1} :
      List (RoseTree α)Type u_1

      A list of ChildCut decisions, indexed by the children list.

      Instances For

        §2: The empty cut #

        For every tree, there is a canonical "empty cut" that recurses everywhere and extracts nothing.

        def RoseTree.emptyCut {α : Type u_1} (t : RoseTree α) :
        t.Cut

        The empty cut on a tree: recurse into every child with the empty cut, never extract.

        Equations
        Instances For
          def RoseTree.emptyCutList {α : Type u_1} (cs : List (RoseTree α)) :

          The all-recurse decision list for a list of children.

          Equations
          Instances For
            def RoseTree.shallowTotalCut {α : Type u_1} (t : RoseTree α) :
            t.Cut

            The total cut: extract every child whole at the root level. (Note: this is shallow — it doesn't recurse. The "total cut" in Foissy's sense extracting the whole tree as a single piece is not directly representable in this Cut type; it lives at the bialgebra layer via the explicit T ⊗ 1 term.)

            Equations
            Instances For

              §3: The cut forest #

              For a cut c : Cut T, cutForest c is the multiset of subtrees extracted by c. We use List for now (the multiset structure emerges at the Hopf algebra layer via Multiset.ofList).

              def RoseTree.cutForest {α : Type u_1} {t : RoseTree α} :
              t.CutList (RoseTree α)

              The list of subtrees extracted by a cut.

              Equations
              Instances For
                def RoseTree.cutForestList {α : Type u_1} {cs : List (RoseTree α)} :
                ChildCutList csList (RoseTree α)

                Auxiliary: extracted subtrees from a child-decision list.

                Equations
                Instances For
                  def RoseTree.cutForestChild {α : Type u_1} {t : RoseTree α} :
                  t.ChildCutList (RoseTree α)

                  Auxiliary: extracted subtrees from a single child-decision.

                  Equations
                  Instances For

                    §4: Remainders #

                    Two remainder flavors per MCB §1.11.6:

                    def RoseTree.remainderDeletion {α : Type u_1} {t : RoseTree α} :
                    t.CutRoseTree α

                    Deletion remainder T/^p: cut subtrees disappear; parent loses children.

                    Equations
                    Instances For
                      def RoseTree.remainderTrace {α : Type u_1} [Inhabited α] {t : RoseTree α} :
                      t.CutRoseTree α

                      Trace remainder T/^c: cut subtrees replaced with default-leaves. Arity of all vertices preserved.

                      Equations
                      Instances For

                        §5: Sanity tests #

                        Verify on a small concrete cut that cutForest, remainderDeletion, and remainderTrace behave as expected.