Markov #
Finite inventory Markov chains #
This file uses elementary finite sums throughout. A FiniteKernel is a
row-stochastic matrix, and FiniteLaw.step is left multiplication by that
matrix. The inventory chain near the end of the file removes one item and
then adds an independent uniformly distributed item.
Finite laws and stochastic kernels #
The uniform law on a nonempty finite type.
Equations
- FD1D.FiniteLaw.uniform = { mass := fun (x : α) => 1 / ↑(Fintype.card α), mass_nonneg := ⋯, sum_mass := ⋯ }
Instances For
Push a finite law forward along a map.
Equations
Instances For
A stochastic kernel on a finite state space.
- trans : α → α → ℝ
One-step transition probability from the first state to the second.
Instances For
Equations
The row-stochastic matrix of a finite kernel.
Instances For
The n-step transition probability.
Instances For
A law is stationary when one step leaves it unchanged.
Equations
- K.IsStationary μ = (K.step μ = μ)
Instances For
Existence of a stationary law #
The mass vector after n steps, written as a matrix product.
Instances For
The average of the first n+1 orbit vectors.
Instances For
Cesaro averages remain probability laws.
Instances For
The one-step error of a Cesaro average is its final endpoint minus its initial endpoint, divided by the averaging length.
Every finite stochastic kernel on a nonempty state space has a stationary law. The proof takes a convergent subsequence of Cesaro averages in the compact finite probability simplex.
Reachability by a positive-probability path.
Instances For
Every state can be reached from every other state.
Equations
- K.Irreducible = ∀ (x y : α), K.Reaches x y
Instances For
Every state has positive mass under a stationary law of an irreducible finite kernel.
An irreducible finite kernel has at most one stationary law.
Strictly positive one-step self-loops.
Equations
- K.HasPositiveLoops = ∀ (x : α), 0 < K.trans x x
Instances For
Equivariance and invariant laws #
Equivariance of a kernel under a permutation of its state space.
Equations
- K.Equivariant e = ∀ (x y : α), K.trans (e x) (e y) = K.trans x y
Instances For
Invariance of a law under a permutation of its state space.
Equations
- FD1D.FiniteKernel.LawInvariant μ e = ∀ (x : α), μ.mass (e x) = μ.mass x
Instances For
A finite group action preserves a law.
Equations
- FD1D.FiniteKernel.GroupInvariant ρ μ = ∀ (g : G), FD1D.FiniteKernel.LawInvariant μ (ρ g)
Instances For
A finite kernel is equivariant for a group action.
Equations
- FD1D.FiniteKernel.GroupEquivariant ρ K = ∀ (g : G), K.Equivariant (ρ g)
Instances For
A finite equivariant Markov kernel has a stationary law invariant under the entire finite group action.
Inventory vectors and delete/arrive dynamics #
Equations
- FD1D.InventoryState.instFintype m = Fintype.ofInjective (fun (x : FD1D.InventoryState ι m) (i : ι) => ⟨↑x i, ⋯⟩) ⋯
Equations
The count vector after deleting at d and arriving at a.
If d is empty, this is defined to be the original state.
Equations
- x.move d a = if hd : 0 < ↑x d then let removed := Function.update (↑x) d (↑x d - 1); ⟨Function.update removed a (removed a + 1), ⋯⟩ else x
Instances For
A deletion rule chooses an occupied leaf, assigning every occupied leaf strictly positive probability.
- prob : InventoryState ι m → ι → ℝ
Probability of deleting an item from each occupied inventory coordinate.
Instances For
Transition probability: delete according to R, then independently
arrive at a uniformly chosen leaf.
Equations
Instances For
Every legal delete/arrive move has positive one-step probability.
The self-loop probability is at least the uniform arrival mass.
Integrating against a deletion kernel amounts to summing over its two moves.