Documentation

Probability.MDP.Histories

structure MDPs.MDP :

Markov decision process

Instances For
    def MDPs.MDP.maxS (M : MDP) :
    Fin M.S
    Equations
    Instances For
      def MDPs.MDP.maxA (M : MDP) :
      Fin M.A
      Equations
      Instances For
        @[reducible, inline]
        abbrev MDPs.MDP.St (M : MDP) :
        Equations
        Instances For
          @[reducible, inline]
          abbrev MDPs.MDP.At (M : MDP) :
          Equations
          Instances For
            def MDPs.MDP.setS (M : MDP) :

            Set of all states

            Equations
            Instances For
              def MDPs.MDP.setA (M : MDP) :

              Set of all actions

              Equations
              Instances For
                theorem MDPs.MDP.inS (M : MDP) (s : M.St) :
                s M.setS
                theorem MDPs.MDP.inA (M : MDP) (a : M.At) :
                a M.setA
                def MDPs.MDP.SA (M : MDP) :
                Equations
                Instances For
                  theorem MDPs.MDP.SA_ne (M : MDP) :
                  0 < M.SA
                  inductive MDPs.Hist (M : MDP) :

                  Represents a history. The state is type ℕ and action is type ℕ.

                  Instances For
                    instance MDPs.instCoeFinSHist {M : MDP} :
                    Coe (Fin M.S) (Hist M)
                    Equations
                    def MDPs.Hist.length {M : MDP} :
                    Hist M

                    History's length = the number of actions taken

                    Equations
                    Instances For
                      def MDPs.MDP.HistT (M : MDP) (t : ) :
                      Equations
                      Instances For
                        @[reducible, inline]
                        abbrev MDPs.HistNE (M : MDP) :

                        Nonempty histories

                        Equations
                        Instances For
                          def MDPs.Hist.last {M : MDP} :
                          Hist MFin M.S

                          Returns the last state of the history

                          Equations
                          Instances For
                            def MDPs.MDP.numhist (M : MDP) (t : ) :

                            Number of histories of length t.

                            Equations
                            Instances For
                              theorem MDPs.hist_len_zero {M : MDP} :
                              M.numhist 0 = M.S
                              def MDPs.MDP.idx_to_hist (M : MDP) (t : ) (i : Fin (M.numhist t)) :
                              M.HistT t

                              Construct i-th history of length t

                              Equations
                              Instances For
                                theorem MDPs.Nat.sum_one_prod_cancel (n : ) {m : } (h : 0 < m) :
                                (m - 1) * n + n = m * n
                                def MDPs.MDP.hist_to_idx (M : MDP) (h : Hist M) :

                                Compute the index of a history

                                Equations
                                Instances For
                                  def MDPs.MDP.hist_to_idx' (M : MDP) (t : ) (h : M.HistT t) :
                                  Fin (M.numhist t)

                                  A more convenient definition for constructing inverses

                                  Equations
                                  Instances For
                                    def MDPs.MDP.idx_to_hist' (M : MDP) (t : ) (i : Fin (M.numhist t)) :
                                    M.HistT t

                                    A more convenient definition for constructing inverses

                                    Equations
                                    Instances For
                                      Equations
                                      Instances For
                                        theorem MDPs.state_of_hist_len0 (M : MDP) (h : M.HistT 0) :
                                        ∃ (s : Fin M.S), h = Hist.init s
                                        theorem MDPs.state_of_hist_len_t (M : MDP) (t : ) (h : M.HistT t.succ) :
                                        ∃ (h' : Hist M) (a : Fin M.A) (s : Fin M.S), h = h'.foll a s
                                        def MDPs.Hist.prefix {M : MDP} (k : ) (h : Hist M) :

                                        Return the prefix of hist of length k

                                        Equations
                                        Instances For
                                          def MDPs.MDP.tuple2hist {M : MDP} :
                                          Hist M × Fin M.A × Fin M.SHistNE M
                                          Equations
                                          Instances For
                                            def MDPs.MDP.hist2tuple {M : MDP} :
                                            HistNE MHist M × Fin M.A × Fin M.S
                                            Equations
                                            Instances For
                                              Equations
                                              Instances For
                                                Equations
                                                Instances For
                                                  def MDPs.MDP.state2hist (M : MDP) (s : Fin M.S) :
                                                  Equations
                                                  Instances For
                                                    def MDPs.MDP.hist2state (M : MDP) :
                                                    Hist MFin M.S
                                                    Equations
                                                    Instances For
                                                      Equations
                                                      Instances For
                                                        def MDPs.isprefix {M : MDP} :
                                                        Hist MHist MBool

                                                        Checks if the first hist is the prefix of the second hist.

                                                        Equations
                                                        Instances For
                                                          def MDPs.Histories {M : MDP} (h : Hist M) :
                                                          Finset (Hist M)

                                                          All histories that follow h for t decisions

                                                          Equations
                                                          Instances For
                                                            @[reducible, inline]
                                                            abbrev MDPs. {M : MDP} :
                                                            Hist MFinset (Hist M)
                                                            Equations
                                                            Instances For
                                                              theorem MDPs.hist_lenth_eq_horizon {M : MDP} (h : Hist M) (t : ) (h' : Hist M) :
                                                              h' h th'.length = h.length + t
                                                              @[simp]
                                                              theorem MDPs.hist_foll_nonempty {M : MDP} (h : Hist M) (a : M.At) (s : M.St) :
                                                              (h.foll a s).length > 0
                                                              theorem MDPs.hist_foll_len {M : MDP} (h : Hist M) (a : M.At) (s : M.St) :
                                                              (h.foll a s).length = h.length + 1
                                                              theorem MDPs.hist_horiz_complete {M : MDP} (t : ) (h : M.HistT t) :
                                                              theorem MDPs.hist_horiz_exact {M : MDP} (t : ) (h : Hist M) (hh : h M.HistoriesHorizon t) :
                                                              h.length = t

                                                              Shows that there are no extra histories in the finset

                                                              Equations
                                                              Instances For
                                                                theorem MDPs.hist_horiz_complete_t {M : MDP} (t : ) (h : M.HistT t) :
                                                                instance MDPs.instFintypeHistT (M : MDP) (t : ) :
                                                                Equations
                                                                @[reducible, inline]
                                                                abbrev MDPs.ℋₜ {M : MDP} :
                                                                Finset (Hist M)
                                                                Equations
                                                                Instances For