Documentation

MDP.MarkovChain

structure MarkovChain (State : Type u_1) :
Type u_1
  • ι : State
  • P : StatePMF State
Instances For
    structure MarkovChain.Path {State : Type u_1} (M : MarkovChain State) :
    Type u_1
    Instances For
      def MarkovChain.instDecidableEqPath.decEq {State✝ : Type u_2} {M✝ : MarkovChain State✝} [DecidableEq State✝] (x✝ x✝¹ : M✝.Path) :
      Decidable (x✝ = x✝¹)
      Equations
      • One or more equations did not get rendered due to their size.
      Instances For
        instance MarkovChain.instInhabitedPath {State : Type u_1} {M : MarkovChain State} :
        Equations
        @[reducible, inline]
        abbrev MarkovChain.Path.length {State : Type u_1} {M : MarkovChain State} (π : M.Path) :
        Equations
        Instances For
          Equations
          • One or more equations did not get rendered due to their size.
          Instances For
            @[simp]
            theorem MarkovChain.Path.states_length_eq_length {State : Type u_1} {M : MarkovChain State} {π : M.Path} :
            @[simp]
            theorem MarkovChain.Path.mk_length {State : Type u_1} {M : MarkovChain State} {states : List State} {length_pos : states.length 0} {nonempty : states []} {initial : states[0] = M.ι} {property : ∀ (i : ) (h : i + 1 < states.length), (M.P states[i]) states[i + 1] 0} :
            { states := states, length_pos := length_pos, initial := initial, property := property }.length = states.length
            structure MarkovChain.Path' {State : Type u_1} (M : MarkovChain State) :
            Type u_1
            Instances For
              instance MarkovChain.instGetElemPathNatLtLength {State : Type u_1} {M : MarkovChain State} :
              GetElem M.Path State fun (π : M.Path) (n : ) => n < π.length
              Equations
              instance MarkovChain.instGetElemPath'NatEqBoolTrue {State : Type u_1} {M : MarkovChain State} :
              GetElem M.Path' State fun (x : M.Path') (x_1 : ) => true = true
              Equations
              def MarkovChain.Path.eq_iff {State : Type u_1} {M : MarkovChain State} {a b : M.Path} :
              a = b a.states = b.states
              Equations
              • =
              Instances For
                def MarkovChain.Path.ext {State : Type u_1} {M : MarkovChain State} {a b : M.Path} (h₀ : a.length = b.length) (h : ∀ (i : ) (ha : i < a.length) (hb : i < b.length), a.states[i] = b.states[i]) :
                a = b
                Equations
                • =
                Instances For
                  theorem MarkovChain.Path.ext_iff {State : Type u_1} {M : MarkovChain State} {a b : M.Path} :
                  a = b a.length = b.length ∀ (i : ) (ha : i < a.length) (hb : i < b.length), a.states[i] = b.states[i]
                  def MarkovChain.Path'.ext {State : Type u_1} {M : MarkovChain State} {a b : M.Path'} (h : a.states = b.states) :
                  a = b
                  Equations
                  • =
                  Instances For
                    theorem MarkovChain.Path'.ext_iff {State : Type u_1} {M : MarkovChain State} {a b : M.Path'} :
                    a = b a.states = b.states
                    @[simp]
                    theorem MarkovChain.Path.mk_getElem {State : Type u_1} {M : MarkovChain State} {states : List State} {length_pos : states.length 0} {nonempty : states []} {initial : states[0] = M.ι} {property : ∀ (i : ) (h : i + 1 < states.length), (M.P states[i]) states[i + 1] 0} (i : ) (hi : i < states.length) :
                    { states := states, length_pos := length_pos, initial := initial, property := property }[i] = states[i]
                    theorem MarkovChain.Path.length_eq_of_eq {State : Type u_1} {M : MarkovChain State} {a b : M.Path} (h : a = b) :
                    noncomputable def MarkovChain.measure {State : Type u_1} [MeasurableSpace State] (M : MarkovChain State) (s : State) :
                    Equations
                    Instances For
                      def MarkovChain.Path.take {State : Type u_1} {M : MarkovChain State} (π : M.Path) (i : Fin π.length) :
                      Equations
                      Instances For
                        def MarkovChain.Path.take_inj {State : Type u_1} {M : MarkovChain State} (π : M.Path) :
                        Equations
                        • =
                        Instances For
                          @[simp]
                          theorem MarkovChain.Path.take_length {State : Type u_1} {M : MarkovChain State} {π : M.Path} (i : Fin π.length) :
                          (π.take i).length = i + 1
                          def MarkovChain.Path'.take {State : Type u_1} {M : MarkovChain State} (π' : M.Path') (n : ) :
                          Equations
                          Instances For
                            @[simp]
                            theorem MarkovChain.Path'.take_length {State : Type u_1} {M : MarkovChain State} {π : M.Path'} (i : ) :
                            (π.take i).length = i + 1
                            def MarkovChain.Path.pref {State : Type u_1} {M : MarkovChain State} (π : M.Path) :
                            Equations
                            Instances For
                              @[simp]
                              theorem MarkovChain.Path.take_mem_pref {State : Type u_1} {M : MarkovChain State} {π : M.Path} {i : } (hi : i < π.length) :
                              π.take i, hi π.pref
                              @[simp]
                              theorem MarkovChain.Path'.take_take {State : Type u_1} {M : MarkovChain State} {j : } {π : M.Path'} {i : } (hi : i < (π.take j).length) :
                              (π.take j).take i, hi = π.take i
                              def MarkovChain.Path'.pref {State : Type u_1} {M : MarkovChain State} (π' : M.Path') :
                              Equations
                              Instances For
                                def MarkovChain.Path.Cyl {State : Type u_1} {M : MarkovChain State} (π : M.Path) :
                                Equations
                                Instances For
                                  noncomputable def MarkovChain.Path.succs {State : Type u_1} {M : MarkovChain State} (π : M.Path) :
                                  Equations
                                  Instances For
                                    @[simp]
                                    theorem MarkovChain.Path.succs_length {State : Type u_1} {M : MarkovChain State} {π : M.Path} (π' : π.succs) :
                                    (↑π').length = π.length + 1
                                    @[simp]
                                    theorem MarkovChain.Path.succs_length' {State : Type u_1} {M : MarkovChain State} {π π' : M.Path} (hπ' : π' π.succs) :
                                    π'.length = π.length + 1
                                    @[simp]
                                    theorem MarkovChain.Path.succs_getElem {State : Type u_1} {M : MarkovChain State} {π : M.Path} (π' : π.succs) (i : ) (h : i < π.length) :
                                    (↑π')[i] = π[i]
                                    @[simp]
                                    theorem MarkovChain.Path.succs_states_getElem {State : Type u_1} {M : MarkovChain State} {π : M.Path} (π' : π.succs) (i : ) (h : i < π.length) :
                                    (↑π').states[i] = π[i]
                                    @[simp]
                                    theorem MarkovChain.Path.succs_states_getElem' {State : Type u_1} {M : MarkovChain State} {π π' : M.Path} (hπ' : π' π.succs) (i : ) (h : i < π.length) :
                                    π'.states[i] = π[i]
                                    noncomputable def MarkovChain.Path.pmf {State : Type u_1} {M : MarkovChain State} (π : M.Path) :
                                    PMF π.succs

                                    NOTE: this is the dependent version of pmf'

                                    Equations
                                    • One or more equations did not get rendered due to their size.
                                    Instances For
                                      noncomputable def MarkovChain.Path.pmf' {State : Type u_1} {M : MarkovChain State} (π : M.Path) :
                                      Equations
                                      • One or more equations did not get rendered due to their size.
                                      Instances For
                                        theorem MarkovChain.Path.pmf_apply {State : Type u_1} {M : MarkovChain State} {π : M.Path} {π' : π.succs} :
                                        π.pmf π' = π.pmf' π'
                                        theorem MarkovChain.Path.pmf'_apply {State : Type u_1} {M : MarkovChain State} [DecidableEq State] {π π' : M.Path} :
                                        π.pmf' π' = if h : List.take π.length π'.states = π.states π'.length = π.length + 1 then (M.P π'.states[π'.length - 2]) π'.states[π'.length - 1] else 0
                                        def MarkovChain.Path.ofLength_countable {State : Type u_1} {M : MarkovChain State} (n : ) :
                                        Countable {π : M.Path | π.length = n}
                                        Equations
                                        • =
                                        Instances For
                                          theorem MarkovChain.Path.complete {State : Type u_1} {M : MarkovChain State} :
                                          ⋃ (n : ), {π : M.Path | π.length = n} = Set.univ
                                          instance MarkovChain.instCountablePath {State : Type u_1} {M : MarkovChain State} :
                                          theorem MarkovChain.Path.pmf_toMeasure_apply {State : Type u_1} {M : MarkovChain State} {π : M.Path} {S : Set π.succs} :
                                          π.pmf.toMeasure S = π.pmf'.toMeasure ((fun (x : π.succs) => x) '' S)
                                          @[simp]
                                          theorem MarkovChain.Path.pmf'_toMeasure_apply {State : Type u_1} {M : MarkovChain State} [DecidableEq State] {π : M.Path} {S : Set M.Path} [(π' : M.Path) → Decidable (π' S)] :
                                          π.pmf'.toMeasure S = ∑' (π' : M.Path), if h : List.take π.length π'.states = π.states π'.length = π.length + 1 then if π' S then (M.P π'.states[π'.length - 2]) π'.states[π'.length - 1] else 0 else 0
                                          noncomputable def MarkovChain.Path.measure {State : Type u_1} {M : MarkovChain State} (π : M.Path) :
                                          Equations
                                          Instances For
                                            noncomputable instance MarkovChain.instInhabitedElemPathSuccs {State : Type u_1} {M : MarkovChain State} {π : M.Path} :
                                            Equations
                                            noncomputable def MarkovChain.embed.help {State : Type u_1} {M : MarkovChain State} (f : (π : M.Path) → π.succs) :
                                            M.Path
                                            Equations
                                            Instances For
                                              theorem MarkovChain.embed.help_eq {State : Type u_1} {M : MarkovChain State} {n : } (f : (π : M.Path) → π.succs) :
                                              help f n = (fun (x : M.Path) => (f x))^[n] default
                                              @[simp]
                                              theorem MarkovChain.embed.help_length {State : Type u_1} {M : MarkovChain State} {f : (π : M.Path) → π.succs} {n : } :
                                              (help f n).length = n + 1
                                              @[simp]
                                              theorem MarkovChain.embed.help_getElem {State : Type u_1} {M : MarkovChain State} {n : } {f : (π : M.Path) → π.succs} (i : ) (h : i < n + 1) :
                                              (help f n)[i] = (help f i)[i]
                                              @[simp]
                                              theorem MarkovChain.embed.help_states_getElem {State : Type u_1} {M : MarkovChain State} {n : } {f : (π : M.Path) → π.succs} (i : ) (h : i < n + 1) :
                                              (help f n).states[i] = (help f i).states[i]
                                              noncomputable def MarkovChain.embed {State : Type u_1} {M : MarkovChain State} (f : (π : M.Path) → π.succs) :
                                              Equations
                                              Instances For
                                                noncomputable def MarkovChain.embedInv {State : Type u_1} {M : MarkovChain State} (π' : M.Path') (π : M.Path) :
                                                π.succs
                                                Equations
                                                Instances For
                                                  def MarkovChain.Path.theSet {State : Type u_1} {M : MarkovChain State} (π : M.Path) :
                                                  Set ((i : π.pref) → (↑i).succs)
                                                  Equations
                                                  Instances For
                                                    theorem MarkovChain.Path.theSet_measurable {State : Type u_1} {M : MarkovChain State} (π : M.Path) :
                                                    theorem MarkovChain.Path.theSet_eq_pi {State : Type u_1} {M : MarkovChain State} (π : M.Path) :
                                                    π.theSet = Set.univ.pi fun (π' : π.pref) => {π'' : (↑π').succs | ¬π' = ππ'' π.pref}
                                                    theorem MarkovChain.Path.Cyl_measurable {State : Type u_1} {M : MarkovChain State} (π : M.Path) :
                                                    theorem MarkovChain.Pr_cyl_help {State : Type u_1} {M : MarkovChain State} (π : M.Path) :
                                                    (∏ xπ.pref.attach, if h : x = π then 1 else (↑x).pmf' (π.take (↑x).length, )) = i : Fin (π.length - 1), (M.P π.states[i]) π.states[i + 1]
                                                    theorem MarkovChain.Pr_cyl {State : Type u_1} {M : MarkovChain State} (π : M.Path) :
                                                    Pr π.Cyl = i : Fin (π.length - 1), (M.P π.states[i]) π.states[i + 1]