Documentation

LeanPool.FullyDynamicMatching.FD1D.Symmetry

Symmetry #

Local child-swap symmetries #

A swap at a depth-d node exchanges its two child subtrees. The permutation is propagated to deeper levels by preserving every subsequent left/right choice. This file also lifts the permutations to inventory states and records the equivariance of the hierarchical policy.

Lift a permutation of one tree level to the next level, preserving the left/right choice below every permuted node.

Equations
Instances For

    The permutation at level d+1+r induced by swapping the children of v.

    Equations
    Instances For
      theorem FD1D.TreeSymmetry.subtreeSwap_zero_of_ne {d : ℕ} (v : DyadicNode d) {w : DyadicNode (d + 1)} (hleft : w ≠ leftChild v) (hright : w ≠ rightChild v) :
      (subtreeSwap v 0) w = w
      @[simp]
      theorem FD1D.TreeSymmetry.subtreeSwap_succ_leftChild {d r : ℕ} (v : DyadicNode d) (w : DyadicNode (d + 1 + r)) :
      (subtreeSwap v (r + 1)) (leftChild w) = leftChild ((subtreeSwap v r) w)
      @[simp]
      theorem FD1D.TreeSymmetry.liftNodePerm_involutive {k : ℕ} (e : Equiv.Perm (DyadicNode k)) (he : ∀ (w : DyadicNode k), e (e w) = w) (w : DyadicNode (k + 1)) :
      @[simp]
      theorem FD1D.TreeSymmetry.subtreeSwap_involutive {d r : ℕ} (v : DyadicNode d) (w : DyadicNode (d + 1 + r)) :
      (subtreeSwap v r) ((subtreeSwap v r) w) = w
      theorem FD1D.TreeSymmetry.subtreeSwap_fixed_of_ancestor_ne {d r : ℕ} (v : DyadicNode d) (w : DyadicNode (d + 1 + r)) (hleft : ancestorNode r w ≠ leftChild v) (hright : ancestorNode r w ≠ rightChild v) :
      (subtreeSwap v r) w = w

      A node outside the two exchanged descendant blocks is fixed pointwise.

      theorem FD1D.TreeSymmetry.conjugate_involutive {α : Type u_1} {β : Type u_2} (c : α ≃ β) (e : Equiv.Perm α) (he : ∀ (x : α), e (e x) = x) (y : β) :
      (c.symm.trans (Equiv.trans e c)) ((c.symm.trans (Equiv.trans e c)) y) = y

      Relabeling finite inventories #

      Push a fixed-total count vector forward along a permutation.

      Equations
      Instances For
        @[simp]
        theorem FD1D.TreeSymmetry.inventoryPerm_apply_count {ι : Type u_1} [Fintype ι] {m : ℕ} (e : Equiv.Perm ι) (x : InventoryState ι m) (i : ι) :
        ↑((inventoryPerm e) x) i = ↑x ((Equiv.symm e) i)
        theorem FD1D.TreeSymmetry.inventoryPerm_apply_image_count {ι : Type u_1} [Fintype ι] {m : ℕ} (e : Equiv.Perm ι) (x : InventoryState ι m) (i : ι) :
        ↑((inventoryPerm e) x) (e i) = ↑x i
        def FD1D.TreeSymmetry.leafSwapWithGap {d L : ℕ} (v : DyadicNode d) (r : ℕ) (hlevel : d + 1 + r = L) :

        Transport an explicitly iterated subtree swap to a named leaf depth.

        Equations
        Instances For
          def FD1D.TreeSymmetry.leafSwap {d L : ℕ} (hdL : d < L) (v : DyadicNode d) :

          The involution of depth-L leaves induced by a child swap at v.

          Equations
          Instances For

            The child swap lifted to fixed-total leaf inventories.

            Equations
            Instances For
              def FD1D.TreeSymmetry.inventorySwapWithGap {d L m : ℕ} (v : DyadicNode d) (r : ℕ) (hlevel : d + 1 + r = L) :

              The lifted inventory swap with an explicit depth gap.

              Equations
              Instances For
                @[simp]
                theorem FD1D.TreeSymmetry.leafSwap_involutive {d L : ℕ} (hdL : d < L) (v : DyadicNode d) (w : DyadicNode L) :
                (leafSwap hdL v) ((leafSwap hdL v) w) = w
                theorem FD1D.TreeSymmetry.leafSwap_symm {d L : ℕ} (hdL : d < L) (v : DyadicNode d) :
                @[simp]
                theorem FD1D.TreeSymmetry.inventorySwap_apply_image_count {d L m : ℕ} (hdL : d < L) (v : DyadicNode d) (x : InventoryState (DyadicNode L) m) (w : DyadicNode L) :
                ↑((inventorySwap hdL v) x) ((leafSwap hdL v) w) = ↑x w

                Canonical aggregate counts under a swap #

                Regard a fixed-total state as a leaf inventory.

                Equations
                Instances For

                  The canonical aggregate counts of a fixed-total state.

                  Equations
                  Instances For

                    The inventory consisting of one item at w.

                    Equations
                    Instances For
                      theorem FD1D.TreeSymmetry.stateAggregate_count_subtreeSwap {d n m : ℕ} (v : DyadicNode d) (x : InventoryState (DyadicNode (d + 1 + n)) m) {r : ℕ} (hrn : r ≤ n) (w : DyadicNode (d + 1 + r)) :
                      (stateAggregate ((inventoryPerm (subtreeSwap v n)) x)).count (d + 1 + r) ((subtreeSwap v r) w) = (stateAggregate x).count (d + 1 + r) w

                      Below the swapped children, canonical aggregate counts are carried to the corresponding node by subtreeSwap.

                      Counts at the level of the swapped node itself are unchanged.

                      theorem FD1D.TreeSymmetry.stateAggregate_count_aboveSwap {d n m : ℕ} (v : DyadicNode d) (x : InventoryState (DyadicNode (d + 1 + n)) m) {k : ℕ} (hkd : k ≤ d) (w : DyadicNode k) :

                      Every count at or above the swapped node's depth is unchanged.

                      Action on descendant blocks #

                      theorem FD1D.TreeSymmetry.mem_leafBlock_subtreeSwap_iff {d n s : ℕ} (v : DyadicNode d) (hsn : s ≤ n) (u : DyadicNode (d + 1 + s)) (w : DyadicNode (d + 1 + n)) :
                      (subtreeSwap v n) w ∈ leafBlock ⋯ ((subtreeSwap v s) u) ↔ w ∈ leafBlock ⋯ u
                      theorem FD1D.TreeSymmetry.leafSwap_preserves_otherBlock {d n : ℕ} (v : DyadicNode d) (u : DyadicNode (d + 1)) (hleft : u ≠ leftChild v) (hright : u ≠ rightChild v) (w : DyadicNode (d + 1 + n)) :
                      (subtreeSwap v n) w ∈ leafBlock ⋯ u ↔ w ∈ leafBlock ⋯ u
                      theorem FD1D.TreeSymmetry.leafSwapWithGap_exchanges_leftBlock {d L : ℕ} (v : DyadicNode d) (r : ℕ) (hlevel : d + 1 + r = L) (w : DyadicNode L) :
                      theorem FD1D.TreeSymmetry.leafSwapWithGap_exchanges_rightBlock {d L : ℕ} (v : DyadicNode d) (r : ℕ) (hlevel : d + 1 + r = L) (w : DyadicNode L) :
                      theorem FD1D.TreeSymmetry.leafSwapWithGap_preserves_otherBlock {d L : ℕ} (v : DyadicNode d) (r : ℕ) (hlevel : d + 1 + r = L) (u : DyadicNode (d + 1)) (hleft : u ≠ leftChild v) (hright : u ≠ rightChild v) (w : DyadicNode L) :
                      (leafSwapWithGap v r hlevel) w ∈ leafBlock ⋯ u ↔ w ∈ leafBlock ⋯ u
                      theorem FD1D.TreeSymmetry.leafSwap_preserves_otherBlock_general {d L : ℕ} (hdL : d < L) (v : DyadicNode d) (u : DyadicNode (d + 1)) (hleft : u ≠ leftChild v) (hright : u ≠ rightChild v) (w : DyadicNode L) :
                      (leafSwap hdL v) w ∈ leafBlock ⋯ u ↔ w ∈ leafBlock ⋯ u

                      Equivariance of the hierarchical policy #

                      Hazards at every level weakly above the swapped node are unchanged.

                      At the first level below v, hazards follow the child swap.

                      theorem FD1D.TreeSymmetry.policy_hazard_subtreeSwap {d n m : ℕ} (v : DyadicNode d) (x : InventoryState (DyadicNode (d + 1 + n)) m) (a : ℝ) {r : ℕ} (hrn : r ≤ n) (w : DyadicNode (d + 1 + r)) :

                      Hazards at every descendant node are transported by the tree swap.

                      Deletion masses at and above the swapped node are unchanged.

                      Deletion masses at descendant nodes are transported by the swap.

                      The Haar-type deletion coefficient at the swapped node changes sign.

                      A strict ancestor's deletion coefficient is unchanged.

                      Arbitrary-depth wrappers #

                      theorem FD1D.TreeSymmetry.stateAggregate_count_subtreeSwapWithGap {d L m : ℕ} (v : DyadicNode d) (r : ℕ) (hlevel : d + 1 + r = L) (x : InventoryState (DyadicNode L) m) {s : ℕ} (hsr : s ≤ r) (w : DyadicNode (d + 1 + s)) :
                      (stateAggregate ((inventorySwapWithGap v r hlevel) x)).count (d + 1 + s) ((subtreeSwap v s) w) = (stateAggregate x).count (d + 1 + s) w
                      theorem FD1D.TreeSymmetry.stateAggregate_count_leafSwapWithGap {d L m : ℕ} (v : DyadicNode d) (r : ℕ) (hlevel : d + 1 + r = L) (x : InventoryState (DyadicNode L) m) (w : DyadicNode L) :
                      (stateAggregate ((inventorySwapWithGap v r hlevel) x)).count L ((leafSwapWithGap v r hlevel) w) = (stateAggregate x).count L w
                      theorem FD1D.TreeSymmetry.stateAggregate_count_aboveSwapWithGap {d L m : ℕ} (v : DyadicNode d) (r : ℕ) (hlevel : d + 1 + r = L) (x : InventoryState (DyadicNode L) m) {k : ℕ} (hkd : k ≤ d) (w : DyadicNode k) :
                      theorem FD1D.TreeSymmetry.policy_deletionMass_subtreeSwapWithGap {d L m : ℕ} (v : DyadicNode d) (r : ℕ) (hlevel : d + 1 + r = L) (x : InventoryState (DyadicNode L) m) (a : ℝ) {s : ℕ} (hsr : s ≤ r) (w : DyadicNode (d + 1 + s)) :
                      theorem FD1D.TreeSymmetry.stateAggregate_count_leafSwap {d L m : ℕ} (hdL : d < L) (v : DyadicNode d) (x : InventoryState (DyadicNode L) m) (w : DyadicNode L) :
                      (stateAggregate ((inventorySwap hdL v) x)).count L ((leafSwap hdL v) w) = (stateAggregate x).count L w

                      Generic move and kernel equivariance #

                      theorem FD1D.TreeSymmetry.inventoryPerm_move {ι : Type u_1} [Fintype ι] [DecidableEq ι] {m : ℕ} (e : Equiv.Perm ι) (x : InventoryState ι m) (deleted arrived : ι) :
                      (inventoryPerm e) (x.move deleted arrived) = ((inventoryPerm e) x).move (e deleted) (e arrived)
                      theorem FD1D.TreeSymmetry.deletionKernel_equivariant {ι : Type u_1} [Fintype ι] [DecidableEq ι] [Nonempty ι] {m : ℕ} (R : DeletionRule ι m) (e : Equiv.Perm ι) (hprob : ∀ (x : InventoryState ι m) (i : ι), R.prob ((inventoryPerm e) x) (e i) = R.prob x i) :

                      The concrete hierarchical deletion kernel #

                      theorem FD1D.TreeSymmetry.concrete_deletionRule_prob_subtreeSwap {d n m : ℕ} (v : DyadicNode d) (a : ℝ) (ha : 0 < a) (hm : 0 < m) (x : InventoryState (DyadicNode (d + 1 + n)) m) (w : DyadicNode (d + 1 + n)) :
                      theorem FD1D.TreeSymmetry.concrete_kernel_equivariant_withGap {d L m : ℕ} (v : DyadicNode d) (r : ℕ) (hlevel : d + 1 + r = L) (a : ℝ) (ha : 0 < a) (hm : 0 < m) :
                      theorem FD1D.TreeSymmetry.concrete_kernel_equivariant {d L m : ℕ} (hdL : d < L) (v : DyadicNode d) (a : ℝ) (ha : 0 < a) (hm : 0 < m) :

                      Invariant stationary laws for a single permutation #

                      def FD1D.TreeSymmetry.permuteLaw {α : Type u_1} [Fintype α] (e : Equiv.Perm α) (μ : FiniteLaw α) :

                      Push a finite law forward along a permutation, in pointwise form.

                      Equations
                      Instances For
                        @[simp]
                        theorem FD1D.TreeSymmetry.permuteLaw_mass {α : Type u_1} [Fintype α] (e : Equiv.Perm α) (μ : FiniteLaw α) (x : α) :
                        (permuteLaw e μ).mass x = μ.mass ((Equiv.symm e) x)
                        theorem FD1D.TreeSymmetry.permuteLaw_stationary {α : Type u_1} [Fintype α] {K : FiniteKernel α} {μ : FiniteLaw α} {e : Equiv.Perm α} (hK : K.Equivariant e) (hμ : K.IsStationary μ) :