Documentation

LeanPool.FullyDynamicMatching.FD1D.Dynamics

Dynamics #

Concrete hierarchical inventory dynamics #

This module instantiates the finite inventory chain with the hierarchical deletion masses. It also connects the actual delete-then-arrive kernel to the harmonic-potential drift identity.

Regard a fixed-total count vector as a leaf inventory.

Equations
Instances For
    theorem FD1D.HierarchicalDynamics.aggregatedInventory_count {L m : ℕ} (x : InventoryState (DyadicNode L) m) {d : ℕ} (hdL : d ≤ L) (v : DyadicNode d) :
    (aggregatedInventory x).count d v = ∑ w ∈ leafBlock hdL v, ↑x w
    noncomputable def FD1D.HierarchicalDynamics.deletionRule {L m : ℕ} (a : ℝ) (ha : 0 < a) (hm : 0 < m) :

    Leaf deletion probabilities prescribed by the hierarchical policy.

    Equations
    • One or more equations did not get rendered due to their size.
    Instances For
      @[simp]
      noncomputable def FD1D.HierarchicalDynamics.kernel {L m : ℕ} (a : ℝ) (ha : 0 < a) (hm : 0 < m) :

      Delete according to the hierarchical rule, then add a uniform leaf.

      Equations
      Instances For
        @[simp]
        theorem FD1D.HierarchicalDynamics.kernel_apply {L m : ℕ} (a : ℝ) (ha : 0 < a) (hm : 0 < m) (x y : InventoryState (DyadicNode L) m) :
        (kernel a ha hm).trans x y = ∑ deleted : DyadicNode L, ∑ arrived : DyadicNode L, if x.move deleted arrived = y then HierarchicalPolicy.deletionMass (aggregatedInventory x) a L deleted * (1 / ↑(Fintype.card (DyadicNode L))) else 0

        Constructive irreducibility of fixed-total inventory dynamics #

        Total target deficit of one fixed-total inventory relative to another.

        Equations
        Instances For
          theorem FD1D.HierarchicalDynamics.inventoryDeficit_move_lt {ι : Type u_1} [Fintype ι] [DecidableEq ι] {m : ℕ} (x y : InventoryState ι m) {deleted arrived : ι} (harrived : ↑x arrived < ↑y arrived) (hdeleted : ↑y deleted < ↑x deleted) :
          inventoryDeficit (x.move deleted arrived) y < inventoryDeficit x y

          Every fixed-total inventory is reachable from every other one under any deletion rule that is strictly positive on occupied coordinates.

          theorem FD1D.HierarchicalDynamics.kernel_move_pos {L m : ℕ} (a : ℝ) (ha : 0 < a) (hm : 0 < m) (x : InventoryState (DyadicNode L) m) {deleted arrived : DyadicNode L} (hdeleted : 0 < ↑x deleted) :
          0 < (kernel a ha hm).trans x (x.move deleted arrived)
          theorem FD1D.HierarchicalDynamics.kernel_irreducible {L m : ℕ} (a : ℝ) (ha : 0 < a) (hm : 0 < m) :

          The hierarchical fixed-total count chain is irreducible.

          theorem FD1D.HierarchicalDynamics.coherent_eq_sum_leafBlock {L : ℕ} {A : Type u_1} [AddCommMonoid A] (q : CoherentTreeLabel L A) {d : ℕ} (hdL : d ≤ L) (v : DyadicNode d) :
          q.value d v = ∑ w ∈ leafBlock hdL v, q.value L w

          A coherent tree label equals the sum of its leaf labels over the corresponding descendant block.

          noncomputable def FD1D.HierarchicalDynamics.deletionMarginal {L m : ℕ} (a : ℝ) (ha : 0 < a) (hm : 0 < m) (x : InventoryState (DyadicNode L) m) {d : ℕ} (hdL : d ≤ L) (v : DyadicNode d) :

          Probability that the deleted leaf lies below a given node.

          Equations
          Instances For
            theorem FD1D.HierarchicalDynamics.deletionMarginal_eq {L m : ℕ} (a : ℝ) (ha : 0 < a) (hm : 0 < m) (x : InventoryState (DyadicNode L) m) {d : ℕ} (hdL : d ≤ L) (v : DyadicNode d) :
            noncomputable def FD1D.HierarchicalDynamics.arrivalMarginal {L d : ℕ} (hdL : d ≤ L) (v : DyadicNode d) :

            Probability that a uniform arriving leaf lies below a given node.

            Equations
            Instances For

              Counts under an actual leaf move #

              def FD1D.HierarchicalDynamics.inBlock {ι : Type u_1} [DecidableEq ι] (S : Finset ι) (i : ι) :

              Boolean membership in a finite block.

              Equations
              Instances For
                @[simp]
                theorem FD1D.HierarchicalDynamics.inBlock_eq_true {ι : Type u_1} [DecidableEq ι] {S : Finset ι} {i : ι} :
                inBlock S i = true ↔ i ∈ S
                @[simp]
                theorem FD1D.HierarchicalDynamics.inBlock_eq_false {ι : Type u_1} [DecidableEq ι] {S : Finset ι} {i : ι} :
                inBlock S i = false ↔ i ∉ S
                theorem FD1D.HierarchicalDynamics.sum_move_eq_updateCount {ι : Type u_1} [Fintype ι] [DecidableEq ι] {m : ℕ} (x : InventoryState ι m) (S : Finset ι) {deleted arrived : ι} (hdeleted : 0 < ↑x deleted) :
                ∑ i ∈ S, ↑(x.move deleted arrived) i = updateCount (∑ i ∈ S, ↑x i) (inBlock S deleted) (inBlock S arrived)

                The count in any finite block after an occupied deletion and an arrival is the four-case updateCount used by the potential calculation.

                theorem FD1D.HierarchicalDynamics.aggregatedInventory_move_count {L m : ℕ} (x : InventoryState (DyadicNode L) m) {deleted arrived : DyadicNode L} (hdeleted : 0 < ↑x deleted) {d : ℕ} (hdL : d ≤ L) (v : DyadicNode d) :
                (aggregatedInventory (x.move deleted arrived)).count d v = updateCount ((aggregatedInventory x).count d v) (inBlock (leafBlock hdL v) deleted) (inBlock (leafBlock hdL v) arrived)

                Concrete aggregated count update at every node.

                Finite weighted membership partitions #

                theorem FD1D.HierarchicalDynamics.double_inBlock_partition {ι : Type u_1} {κ : Type u_2} [Fintype ι] [DecidableEq ι] [Fintype κ] [DecidableEq κ] (deleteWeight : ι → ℝ) (arrivalWeight : κ → ℝ) (deleteSet : Finset ι) (arrivalSet : Finset κ) (q p : ℝ) (hdeleteSum : ∑ i : ι, deleteWeight i = 1) (harrivalSum : ∑ j : κ, arrivalWeight j = 1) (hq : ∑ i ∈ deleteSet, deleteWeight i = q) (hp : ∑ j ∈ arrivalSet, arrivalWeight j = p) (f : Bool → Bool → ℝ) :
                ∑ i : ι, ∑ j : κ, deleteWeight i * arrivalWeight j * f (inBlock deleteSet i) (inBlock arrivalSet j) = ∑ deleted : Bool, ∑ arrived : Bool, bernoulliMass q deleted * bernoulliMass p arrived * f deleted arrived

                Expectations under the concrete kernel #

                theorem FD1D.HierarchicalDynamics.kernel_expectation_eq_delete_arrive {L m : ℕ} (a : ℝ) (ha : 0 < a) (hm : 0 < m) (x : InventoryState (DyadicNode L) m) (f : InventoryState (DyadicNode L) m → ℝ) :
                ∑ y : InventoryState (DyadicNode L) m, (kernel a ha hm).trans x y * f y = ∑ deleted : DyadicNode L, ∑ arrived : DyadicNode L, (deletionRule a ha hm).prob x deleted * (1 / ↑(Fintype.card (DyadicNode L))) * f (x.move deleted arrived)

                Global state observables and exact kernel drift #

                Coherent natural count label of a count-chain state.

                Equations
                Instances For
                  noncomputable def FD1D.HierarchicalDynamics.deletionLabel {L m : ℕ} (a : ℝ) (x : InventoryState (DyadicNode L) m) (d : ℕ) :

                  Hierarchical deletion mass at every tree node.

                  Equations
                  Instances For
                    noncomputable def FD1D.HierarchicalDynamics.hazardLabel {L m : ℕ} (a : ℝ) (x : InventoryState (DyadicNode L) m) (d : ℕ) :

                    Extended policy hazard at every tree node.

                    Equations
                    Instances For
                      noncomputable def FD1D.HierarchicalDynamics.statePotential {L m : ℕ} (a : ℝ) (x : InventoryState (DyadicNode L) m) :

                      Global harmonic potential of a count-chain state.

                      Equations
                      Instances For
                        noncomputable def FD1D.HierarchicalDynamics.stateDrift {L m : ℕ} (a : ℝ) (x : InventoryState (DyadicNode L) m) :

                        Bellman drift quantity D of a count-chain state.

                        Equations
                        Instances For
                          noncomputable def FD1D.HierarchicalDynamics.stateHazardEnergy {L m : ℕ} (a : ℝ) (x : InventoryState (DyadicNode L) m) (d : ℕ) :

                          Hazard energy at one level in a count-chain state.

                          Equations
                          Instances For

                            The conditional drift of the actual count-chain kernel is exactly the policy's D - R.

                            Expanded form of the concrete one-step identity, exposing the generic potentialDrift and potentialRemainder definitions directly.

                            Per-state bounds used by stationarity and finite-time telescoping #

                            theorem FD1D.HierarchicalDynamics.deletionLabel_nonneg {L m : ℕ} (a : ℝ) (ha : 0 < a) (hm : 0 < m) (x : InventoryState (DyadicNode L) m) {d : ℕ} (hdL : d ≤ L) (v : DyadicNode d) :
                            0 ≤ deletionLabel a x d v
                            theorem FD1D.HierarchicalDynamics.deletionLabel_le_one {L m : ℕ} (a : ℝ) (ha : 0 < a) (hm : 0 < m) (x : InventoryState (DyadicNode L) m) {d : ℕ} (hdL : d ≤ L) (v : DyadicNode d) :
                            deletionLabel a x d v ≤ 1
                            theorem FD1D.HierarchicalDynamics.intervalMass_le_count_add_a_mul_hazard {L m : ℕ} (a : ℝ) (ha : 0 < a) (hm : 0 < m) (x : InventoryState (DyadicNode L) m) {d : ℕ} (hdL : d ≤ L) (v : DyadicNode d) :
                            nodeMass d v ≤ (↑(countLabel x d v) + a) * hazardLabel a x d v
                            theorem FD1D.HierarchicalDynamics.stateDrift_lower_bound {L m : ℕ} (a : ℝ) (ha : 0 < a) (hm : 0 < m) (x : InventoryState (DyadicNode L) m) :
                            stateDrift a x ≥ a * (stateHazardEnergy a x L / 100 - 103 / (300 * ↑m ^ 2))
                            theorem FD1D.HierarchicalDynamics.stateHazardEnergy_step {L m : ℕ} (a : ℝ) (ha : 0 < a) (x : InventoryState (DyadicNode L) m) {d : ℕ} (hdL : d < L) :
                            theorem FD1D.HierarchicalDynamics.stateHazardEnergy_mono_to_depth {L m : ℕ} (a : ℝ) (ha : 0 < a) (x : InventoryState (DyadicNode L) m) {i j : ℕ} (hij : i ≤ j) (hjL : j ≤ L) :
                            theorem FD1D.HierarchicalDynamics.stateRemainder_nonneg {L m : ℕ} (a : ℝ) (ha : 0 < a) (hm : 0 < m) (x : InventoryState (DyadicNode L) m) :
                            theorem FD1D.HierarchicalDynamics.stateRemainder_bounds {L m : ℕ} (a : ℝ) (ha : 0 < a) (hm : 0 < m) (x : InventoryState (DyadicNode L) m) :
                            0 ≤ stateRemainder a x ∧ stateRemainder a x ≤ ∑ d ∈ Finset.range L, stateHazardEnergy a x (d + 1) ∧ ∑ d ∈ Finset.range L, stateHazardEnergy a x (d + 1) ≤ ↑L * stateHazardEnergy a x L