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
        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
            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) (h : Hist M) :
                              Equations
                              Instances For
                                def MDPs.MDP.idx_to_hist' (M : MDP) (ti : × ) :
                                Equations
                                Instances For
                                  Equations
                                  Instances For
                                    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.state2hist {M : MDP} (s : Fin M.S) :
                                              Equations
                                              Instances For
                                                def MDPs.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
                                                          @[reducible, inline]
                                                          abbrev MDPs.ℋₜ {M : MDP} :
                                                          Finset (Hist M)
                                                          Equations
                                                          Instances For