Documentation

LeanPool.RlTheoryInLean.Data.Matrix.Stochastic

LeanPool.RlTheoryInLean.Data.Matrix.Stochastic #

@[reducible, inline]

The finite-dimensional 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 .

      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 n0 < (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) [StochasticVec μ] (P : Matrix S S ) [RowStochastic P] (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