Documentation

LeanPool.RlTheoryInLean.Data.Matrix.Stochastic

LeanPool.RlTheoryInLean.Data.Matrix.Stochastic #

@[reducible, inline]

The finite-dimensional L¹ space of real-valued functions on S.

Equations
Instances For
    class StochasticMatrix.StochasticVec {S : Type u} [Fintype S] (x : S → ℝ) :

    A nonnegative vector whose entries sum to one.

    • nonneg (s : S) : 0 ≤ x s
    • rowsum : ∑ s : S, x s = 1
    Instances
      theorem StochasticMatrix.StochasticVec.le_one {S : Type u} [Fintype S] (x : S → ℝ) [StochasticVec x] (s : S) :
      x s ≤ 1
      @[reducible, inline]

      The probability simplex, represented inside finite-dimensional L¹.

      Equations
      Instances For
        theorem StochasticMatrix.l1_norm_eq_sum {S : Type u} [Fintype S] (f : l1Space S) :
        ‖f‖ = ∑ s : S, |f.ofLp s|

        A matrix whose rows are stochastic vectors.

        Instances
          theorem StochasticMatrix.sum_svec_mul_smat_eq_one {S : Type u} [Fintype S] (μ : S → ℝ) [StochasticVec μ] (P : Matrix S S ℝ) [RowStochastic P] :
          ∑ i : S, ∑ j : S, μ i * P i j = 1
          theorem StochasticMatrix.chapman_kolmogorov_eq_ge {S : Type u} [Fintype S] [DecidableEq S] (P : Matrix S S ℝ) [RowStochastic P] (m n : ℕ) (i j k : S) :
          (P ^ (m + n)) i j ≥ (P ^ m) i k * (P ^ n) k j

          Irreducibility of a finite stochastic matrix.

          • irreducible (i j : S) : ∃ (n : ℕ), 0 < (P ^ n) i j
          Instances
            noncomputable def StochasticMatrix.returnTimes {S : Type u} [Fintype S] [DecidableEq S] (P : Matrix S S ℝ) (i : S) :

            The set of positive return times for state i

            Equations
            Instances For
              theorem StochasticMatrix.return_times_add_mem {S : Type u} [Fintype S] [DecidableEq S] (P : Matrix S S ℝ) [RowStochastic P] (i : S) {a b : ℕ} (ha : a ∈ returnTimes P i) (hb : b ∈ returnTimes P i) :
              a + b ∈ returnTimes P i

              Return times are closed under addition (used via AddSubmonoid.closure)

              A stochastic matrix is aperiodic if for each state, the GCD of return times is 1

              Instances
                theorem StochasticMatrix.eventually_positive {S : Type u} [Fintype S] [DecidableEq S] [Nonempty S] (P : Matrix S S ℝ) [RowStochastic P] [Irreducible P] [Aperiodic P] :
                ∃ (N : ℕ), ∀ (n : ℕ) (i j : S), N ≤ n → 0 < (P ^ n) i j

                A Doeblin minorization for a finite stochastic matrix.

                Instances
                  def StochasticMatrix.smatAsOperator {S : Type u} [Fintype S] (P : Matrix S S ℝ) [RowStochastic P] :
                  ↑(Simplex S) → ↑(Simplex S)

                  The affine action of a stochastic matrix on the probability simplex.

                  Equations
                  Instances For
                    theorem StochasticMatrix.smat_as_operator_iter {S : Type u} [Fintype S] [DecidableEq S] (P : Matrix S S ℝ) [RowStochastic P] (n : ℕ) :
                    (smatAsOperator P)^[n] = fun (μ : ↑(Simplex S)) => ⟨WithLp.toLp 1 (Matrix.vecMul (↑μ).ofLp (P ^ n)), ⋯⟩
                    class StochasticMatrix.Stationary {S : Type u} [Fintype S] (μ : S → ℝ) (P : Matrix S S ℝ) :

                    A stationary distribution for a matrix.

                    Instances
                      theorem StochasticMatrix.multi_step_stationary {S : Type u} [Fintype S] [DecidableEq S] (μ : S → ℝ) (P : Matrix S S ℝ) (n : ℕ) [Stationary μ P] :
                      Stationary μ (P ^ n)
                      theorem StochasticMatrix.pos_of_stationary {S : Type u} [Fintype S] [DecidableEq S] (μ : S → ℝ) [StochasticVec μ] (P : Matrix S S ℝ) [RowStochastic P] [Irreducible P] [Stationary μ P] (s : S) :
                      0 < μ s
                      noncomputable def StochasticMatrix.cesaroAverage {S : Type u} [Fintype S] [DecidableEq S] (x₀ : S → ℝ) (P : Matrix S S ℝ) (n : ℕ) :
                      S → ℝ

                      The Cesaro average of the first n + 1 iterates of a stochastic vector.

                      Equations
                      Instances For
                        theorem StochasticMatrix.cesaro_average_almost_invariant {S : Type u} [Fintype S] [DecidableEq S] (x₀ : S → ℝ) [StochasticVec x₀] (P : Matrix S S ℝ) [RowStochastic P] (n : ℕ) :
                        ‖WithLp.toLp 1 (Matrix.vecMul (cesaroAverage x₀ P n) P - cesaroAverage x₀ P n)‖ ≤ 2 / (↑n + 1)
                        @[reducible, inline]
                        noncomputable abbrev StochasticMatrix.uniformDistribution {S : Type u} [Fintype S] :
                        S → ℝ

                        The uniform probability distribution on a nonempty finite type.

                        Equations
                        Instances For

                          Geometric convergence to stationarity in total variation/L¹ distance.

                          Instances