WorksComputer Science
Certifying Almost-Sure Reachability in Unknown MDPs
Abstract
Specification-Guided Reinforcement Learning (RL) has largely concerned itself with learning an optimal policy against a formal specification in an unknown Markov Decision Process (MDP). We take up the dual question. Given a policy already in hand, can one verify that it is correct against a formal specification in an unknown MDP, using sampling access alone? Such a question arises naturally in safety-critical systems. We investigate it for the almost-sure reachability property, whose correctness is witnessed by a ranking supermartingale (RSM) certificate. Our first finding is negative. In the absence of any further information about the MDP, one can neither learn such a certificate nor verify a candidate one with probabilistic guarantees. On the positive side, we show that, under a mild restriction, a known lower bound on nonzero transition probabilities, a correct certificate can be learned with PAC-style guarantees. To the best of our knowledge, this is the first study of learning and verifying certificates for almost-sure reachability in unknown MDPs from sampling access alone. Finally, our experiments show that the -based sufficient condition, while sound, is conservative: the learned certificate often remains valid on the true MDP even when the condition fails.
Introduction
Reinforcement learning (RL) [22] studies how an agent should act in a stochastic environment, standardly modeled as a Markov decision process (MDP) [20]. In many deployments the transition probabilities are not known explicitly. The resulting unknown MDPs grant the agent only sampling access. Querying a state–action pair returns a next state , while the kernel itself stays hidden. The dominant question in this setting, particularly when considering specification-guided RL [7], has been one of synthesis, namely how to learn a policy that is optimal against a given specification.
We take up a dual and equally pressing question. Given a policy already in hand, can we verify that it is correct against a formal specification, again using only sampling access to the unknown MDP? A positive answer would let us certify a deployed controller without ever building a model of its environment. A negative one would tell us precisely what extra knowledge such certification demands. It is especially important in safety-critical domains such as robotics and autonomous systems. In effect, we initiate the study of
Certifying almost-sure reachability thus reduces to producing, or checking, an RSM. When is known this is straightforward, as the expected-decrease inequality is directly verifiable. Under sampling access it is not. The decrease is an expectation over the hidden kernel, so a candidate can only be estimated against a learned model and its verdict transferred back to the true MDP . It is not obvious that a certificate can be produced, or even checked, from samples. We study three questions together, along with the transferability that bridges them. Learning asks whether a correct RSM certificate can be produced from samples with high probability. Verification asks whether a candidate RSM can be checked from samples with high probability. Transferability asks when a certificate valid on the learned remains valid on . This differs from classical PAC-MDP policy learning. For instance, Yang, Littman, and Carbin [26]; Alur et al. [6] show that PAC learnability for LTL objectives holds exactly for formulas decidable within a finite horizon. Here the policy is fixed and the object to be certified is the RSM itself.
Our first result is negative, and its cause is intrinsic to sampling-based certification. A certificate cannot be produced or confirmed until the transitions that make progress toward the target have been witnessed, yet a progress transition may carry arbitrarily small probability. Such a rare transition can remain unobserved for arbitrarily long, so the samples needed to observe it cannot be bounded by the size of the problem alone. We show this rare-transition obstacle is decisive. In the absence of any further information about the MDP, neither learning a correct certificate nor verifying a candidate one is possible with probabilistic guarantees.
The impossibility is driven entirely by transitions of vanishing probability, and a single mild and standard assumption removes it. A known lower bound on every nonzero transition probability [8] keeps a progress transition from hiding behind an arbitrarily small probability, so progress toward the target becomes observable in finitely many samples. Our positive result then follows a model-based route. Rather than learn an RSM directly, we learn a sufficiently accurate model (which standard finite-MDP model-learning provides from sampling access) and compute on it the expected hitting-time function , a natural RSM candidate that decreases by exactly one in expectation. Because the expected-decrease condition depends on transition probabilities, a certificate valid under need not be valid under . We prove that a close enough approximation preserves the RSM property, and under we obtain an explicit threshold on the approximation error. Learning a transferable certificate thereby reduces to learning a sufficiently accurate model, and a correct RSM certificate can be learned with probabilistic guarantees.
Our Results. Our key contributions are:
Impossibility of learning and verification. For general unknown finite MDPs, neither learning a correct RSM certificate nor verifying a candidate one is possible with probabilistic guarantees from sampling access alone, due to rare transitions (§ 3).
Sampling bounds under . A known lower bound on nonzero transition probabilities makes progress toward the target observable with high probability using finitely many samples, removing the rare-transition obstruction (§ 4).
Transferable expected-hitting-time certificates. An RSM valid for a learned approximation remains valid for the true MDP once the approximation error is small enough. We instantiate this for the expected hitting-time certificate, yielding an end-to-end learning guarantee with an explicit sample complexity (§ 4).
Empirical evaluation. On a range of finite MDPs, the transfer guarantee is found but conservative, remaining valid on the true MDP even where the sufficient condition fails (§ 8).
Related Work. Supermartingale certificates, rooted in stochastic Lyapunov theory [14] and barrier certificates [19], are the standard witness for temporal properties of probabilistic systems. Ranking supermartingales certify almost-sure reachability and stability [16] and extend to reach-avoid (Žikelić et al. 2023), safety and distributional objectives [4, 5], quantitative bounds [3, 1], and probabilistic-program invariants [10], with Farkas certificates playing the analogous role for reachability constraints [13]. A parallel line learns such certificates, representing them as neural networks and alternating a proposer with a counterexample-producing verifier [21, 12, 2] (Žikelić et al. 2023). All of this work assumes a known model, so the certificate conditions are concrete constraints to solve and to check. We instead have only sampling access to an unknown kernel, where those constraints can be estimated but not evaluated exactly, and our impossibility result and transfer condition delimit precisely this gap.
For unknown MDPs, PAC reinforcement learning bounds the samples needed to learn a near-optimal policy or an accurate model [11, 9]. General LTL objectives are not PAC learnable [26, 6], and the guarantees that survive rest on a known lower bound on nonzero transition probabilities [8, 18, 23], the same assumption our positive result needs and for the same reason. Weaker asymptotic guarantees are also attainable [17] (Le et al. 2024). All of these results learn a policy. We instead fix the policy and ask whether its correctness certificate can be learned or verified from samples.
Preliminaries
A Markov decision process (MDP) is a tuple with finite state space , finite action space , transition kernel , and initial state , where is the probability of moving from to under . A (deterministic, memoryless) policy fixes an action at each state, collapsing into a Markov chain over whose trajectories are sequences with . For a target set , denotes the event that a trajectory visits , and the induced measure over trajectories started at . Throughout, we work with unknown MDPs, where is not given and the learner has only sampling access. Choosing an action at returns a successor , while the probabilities stay hidden. This is the only mode of access we assume, and all our sample-complexity bounds are stated against it.
A fixed policy makes evolve stochastically. A filtration is a nondecreasing sequence of -algebras, with the information available up to time , in our setting the trajectory prefix . The one process we need is a supermartingale, whose conditional expectation only decreases over time, the monotonicity our certificates exploit.
Definition 1 (Supermartingale [12]). A process adapted to a filtration is a supermartingale if for all $k \geq 0.
We rely on one classical fact. A nonnegative supermartingale is unlikely to rise far above its starting value.
Theorem 1. Let be a nonnegative supermartingale. Then for every , $\mathbb{P}[\sup_{k \geq 0} X_k \geq \lambda] \leq
.
Our specification of interest is almost-sure reachability, that from the policy reaches a target set with probability . To certify it we use a ranking supermartingale (RSM) [16], a nonnegative progress measure that strictly decreases in expectation outside the target. Intuitively, if every non-target state moves closer to the target in expectation and closeness cannot go negative, cannot be avoided forever. Introduced for general stochastic systems, RSMs here act on the Markov chain induces on , with the general formulation deferred to sup. mat. E.
Definition 2 (RSM for an MDP). Let be a finite MDP, a fixed policy, and a target set. A function is an -RSM for w.r.t. if there is a constant such that
(i) for all , and
(ii) for all .
Here is a rank measuring distance to the target. Condition (ii) forces expected progress of at least at every non-target state, and since is nonnegative this cannot continue indefinitely, so must be reached. More precisely,
Theorem 2. Let be a finite MDP, a fixed policy, and a target set. If an -RSM for w.r.t. exists, then for every ; in particular .
The proof (deferred to sup. mat. C) builds a nonnegative supermartingale that would grow without bound if the target were missed, then applies Theorem 1 to rule it out. RSMs are thus sound, and in finite MDPs also complete. An RSM exists whenever is reached almost surely from every state, and this quantifier is essential. Definition 2 imposes the -decrease condition at every , so any state that cannot reach blocks an RSM, and the set of such states is closed under transitions, so setting to there does not help.
Corollary 1. For a finite MDP , fixed policy , and target , an -RSM for w.r.t. exists if and only if for every .
While the forward direction is simply Theorem 2, for the converse, the expected hitting time is finite because is finite, and decomposing on the first step shows it is a -RSM (see sup. mat. C for details). Corollary 1 underpins the rest of the paper. Certifying almost-sure reachability is exactly the problem of producing an RSM. When is known, condition (ii) is directly checkable. When is unknown, it is an expectation over an inaccessible kernel, so a candidate can only be evaluated against a learned model and its verdict carried back to the true MDP. Learning, verifying, and transferring such certificates are the three questions we take up next.
Learning RSMs under an Unknown Model
The objective of this section is to answer a single question. Can one learn a correct RSM certificate, with high probability, from sampling access to an unknown MDP? We answer in the negative. We fix the learning model for almost-sure reachability. A certificate learning task is a tuple ,
where is an unknown finite MDP with sampling access, is a fixed policy, and is a target set. Certifying with respect to means establishing . A learning algorithm never sees the transition kernel and interacts with only through samples. In each iteration it either resets the simulator or takes a single step, and outputs its current candidate RSM certificate , inducing a random sequence . This framework is not specific to reachability. It extends to arbitrary specifications, and we record the general formulation in sup. mat. D.
Definition 3 (Learning RSM Certificates with Probabilistic Guarantees). Let be an unknown finite MDP with sampling access, let be a fixed policy, and let be a target set. A learning algorithm is said to learn an RSM certificate with probabilistic guarantees if there exists a sample-complexity function such that, for every , taking , we have, for all , .
We claim that no such algorithm can exist, and the reason is already visible in a three-state MDP as we see next.
Lemma 1. There exists an unknown finite MDP , a fixed policy , and a reachability specification such that any learning algorithm that learns RSM certificates with probabilistic guarantees in the sense of Definition 3 must have sample complexity depending on the transition probabilities of . More precisely, for the MDP in Figure 1, any such algorithm must use
samples in order to output a correct RSM certificate with probability at least .
Figure 1. MDP for Lemma 1
Proof. At a high level, a correct RSM certificate cannot be produced until the learner has witnessed the sole progress transition, so it suffices to lower-bound the number of samples needed to witness it. Consider the MDP in Figure 1 together with the fixed policy . Since whenever , an RSM certificate exists, and the task is well posed. The key observation is that, from samples alone, a correct RSM certificate can be output only if the transition has been observed. Indeed, until that transition is seen, the observed sub-MDP is indistinguishable from one in which only self-loops and is unreachable, and in the latter no RSM exists. Hence the probability of success is at most the probability of the good event that the transition is observed within the first sampled transitions. Formally, .
To lower-bound , we exhibit one particular way in which the good event fails. The process first moves from to (probability ), and then takes the self-loop at for each of the remaining transitions (probability ). Therefore, . Consequently, . For the success probability to reach , we must therefore have , i.e., . Taking logarithms and dividing by (which reverses the inequality) yields , i.e., , as claimed. Note that the bound is informative (it forces ) exactly when , i.e., in the rare-transition regime where is small relative to . For the same argument gives .
Our impossibility result now follows.
Theorem 3. There is no learning algorithm that learns RSM certificates for almost-sure reachability objectives with probabilistic guarantees in the sense of Definition 3 using a sample-complexity function depending only on , , and . In particular, for general unknown finite MDPs, a correct RSM certificate cannot be learned with high probability efficiently from sampling access alone.
Proof. We argue by contradiction. Suppose such an algorithm exists. Then, by Definition 3, there is a sample-complexity function such that, after more than samples, outputs a correct RSM certificate with probability at least .
However, Lemma 1 exhibits an unknown finite MDP for which any algorithm that outputs a correct RSM certificate with probability at least must use samples. This lower bound depends on the transition probability , which is unknown and can be chosen arbitrarily small. As , the bound diverges. Therefore the required number of samples cannot be bounded by any function of , , and alone, contradicting the assumed existence of . Hence, in general unknown finite MDPs, it is not possible to learn correct RSM certificates for almost-sure reachability with high probability efficiently from sampling access alone.
Checking a candidate certificate is no easier than producing one. To make this precise, we introduce the notion of a sampling-based verifier.
Definition 4. Let be an unknown finite MDP with sampling access, let be a fixed policy, and let be a target set. A sampling-based verifier is an algorithm Ver that, given a candidate function and sampling access to , decides whether is an RSM certificate for with respect to . We say that Ver verifies RSM certificates with probabilistic guarantees if there exists a sample-complexity function such that, for every , Ver decides the correctness of with probability at least using at most samples.
Corollary 2. For general unknown finite MDPs, there is no sampling-based verifier Ver in the sense of Definition 4 whose sample complexity is bounded only by , , and .
Proof. By Lemma 1, even observing the progress transition requires a number of samples that grows without bound as . Since is unknown, no verifier can distinguish a valid candidate from an invalid one within a budget depending only on , , and , contradicting existence of such an .
In summary, the barrier is intrinsic to the unknown model. A single rare transition can hide for arbitrarily long, and no size-only budget can account for it.
Learning RSMs under a Known
The impossibility of § 3 is driven entirely by transitions of vanishing probability, and assuming a known lower bound on nonzero transition probabilities suffices to recover an explicit, transferable, and learnable RSM certificate. This restriction is standard in the literature on learning and statistical model checking of unknown MDPs [8], and it is mild in that it constrains only transitions that are already present. Any nonzero probability must be bounded away from zero by a known amount, while zero-probability transitions are left untouched.
The argument proceeds in four steps. We first adopt the restriction and show that it makes progress toward the target observable in finitely many samples (§ 4). We then exhibit a concrete certificate, the expected hitting-time function, prove it is a valid RSM on every finite MDP (Theorem 4), and bound it under (Theorem 5). Next we establish certificate transferability, conditions under which an RSM computed on a learned model remains valid on the true one (Theorems 6 and 7). Finally, we assemble these pieces into an end-to-end learning guarantee (Theorem 8).
The Restriction and Observing Progress
We define our restriction next.
Definition 5 (). Given an MDP , we define the quantity as a known lower bound on every nonzero transition probability of , where denotes the set of actions available in , and denotes the set of possible successors under action .
Two auxiliary notions make the sampling argument precise, the distance to the target and the transitions that decrease it.
Definition 6. Let be a finite MDP, let be a fixed policy, and let be a target set. The distance function is defined by
where .
Intuitively, is the minimum number of transitions needed to reach from under , with when no such path exists. The recursion has a unique solution in , namely breadth-first distance.
Two conditions recur as hypotheses below, and for a finite MDP they are equivalent. for every for every . The forward direction is immediate. means no path from reaches , so . For the converse, let be the smallest nonzero transition probability of . Following a shortest path reaches within steps with probability at least from every state, so the probability of not having reached after blocks of steps is at most . Note that quantifying over every state, rather than over alone, is necessary. The set is not in general closed under transitions, so almost-sure reachability from does not propagate to the states cannot reach (and Definition 2 constrains those states too).
Definition 7. Let , let , and let . A transition from to is a progress-making transition if and .
A progress-making transition strictly reduces the distance to the target. The key underpinning observation is that, once every realizable transition carries probability at least , such a transition can no longer carry an arbitrarily small probability, so progress toward becomes observable with high probability in finitely many samples.
Lemma 2. Let be an unknown finite MDP, let be a fixed policy, and let be a target set with for every . Suppose a lower bound on every nonzero transition probability is known. Then, with probability at least , a path to can be observed using a number of samples bounded in terms of , , and . Here, observing a path to means observing a finite sample trajectory under with .
Proof sketch. The strategy is to bound the length of a shortest progress path, lower-bound the probability of following it, and then amplify by independent episodes. Under , every reachable state has a shortest path to of length , and each step of such a path is a progress transition, which by the assumption has probability at least . Hence from any reachable state is reached within steps with probability at least . Running independent episodes of length , the failure probability decays as , so episodes (that is, samples) drive it below . The full argument is given in sup. mat. C.
Note that the role of is to simply remove the rare-transition barrier of Lemma 1, so that progress toward the target is observed with probability within finitely many samples. Observing progress, however, is not the same as learning or verifying a certificate. Both additionally require the expected-decrease inequality to hold at every non-target , and since is unknown, these expectations must themselves be estimated. The remainder of this section closes exactly this gap. We construct such a , bound it, and show that it transfers from the learned model to the true one.
The Expected Hitting-Time Certificate
We now exhibit the concrete certificate.
Definition 8. Let be an MDP, let be a policy, and let be a target set. The hitting time of is defined as , where denotes the state at time step . The expected hitting time from a state under is then defined as
We adopt the recursive form deliberately. Each application removes exactly one step, and this “” supplies the strict expected decrease an RSM requires. The expected hitting time is therefore a natural RSM candidate, as we show next.
Theorem 4. Let be a finite MDP, let be a fixed policy, and let be a target set that is almost surely reachable from every state, i.e. for every V:S\to\mathbb{R}_{\ge 0}$ by . Then is an -RSM with .
Proof sketch. Both RSM conditions follow directly from the recursive form of Definition 8. Non-negativity is immediate, since is the expectation of a non-negative random variable. For expected decrease, the recursion gives at every non-target , which is exactly the -decrease condition with .
We now bound the expected hitting time under the restriction, using the distance function and progress-making transitions from § 4. The bound is deliberately worst-case. It requires no knowledge of the model beyond , at the cost of being loose on any particular instance.
Theorem 5. Let be a finite MDP, let be a fixed policy, and let be a target set that is reachable almost surely under from every state. Let be the minimum nonzero transition probability, and let , which is finite by Definition 6. Then, for every state , the expected hitting time satisfies
Proof sketch. The strategy is to reach within steps with probability at least , and then turn this per-block success probability into a geometric bound on the expected hitting time. Fix a state with . Following progress-making transitions, each of probability at least (Definition 7), reaches within steps with probability at least . Dividing time into blocks of length , the target is missed for consecutive blocks with probability at most , so . See sup. mat. C for details.
The inequality cannot be strengthened to a strict one. Take with , a single action, and . Then , so , and . (The bound is also attained degenerately when , where and both sides are .)
Transferability
The central question of this section is whether an RSM certificate computed on a learned model remains valid on the true model ? A learned model is an MDP with the same states, actions, and initial state as , but with transition probabilities estimated from samples. Then we see that validity does not transfer automatically. Since depends on the state only, its values are identical on both models. The difficulty lies in the expectation, which the two models take with respect to different transition probabilities. The expected-decrease condition could in principle fail on the true model even though the -values agree. This threat, however, is controllable. We prove that a sufficiently close approximation preserves the RSM property, so the certificate transfers. We first quantify the approximation error.
Definition 9. Let be the original MDP and let be the learned MDP. The total probability error is defined as
We say that is an -approximation of , for , if the total probability error between the two is at most .
We now establish certificate transferability in full generality, without any restriction on the MDP.
Theorem 6. Let be a finite MDP, let be an -approximation of , and let be a fixed policy. Let be a target set. Suppose is an -RSM for with respect to . Assume is bounded on , and let . If , then is an -RSM for with .
Proof. The key idea is to bound the discrepancy between the one-step expectations of on the two models by , and then absorb it into the slack of the learned-model certificate. Fix and let . By definition of expectation, and . Subtracting and applying the triangle inequality, . Since for all , and since the -approximation assumption gives , we obtain . Because is an -RSM for , we have . Substituting, . Setting , this is exactly the expected decrease condition on , and precisely when . Hence is an -RSM for .
The condition of Theorem 6 is not immediately checkable. It couples three entangled quantities . Deriving requires an approximate model, which itself carries error , while depends on the computed certificate. The condition becomes checkable a priori once two of the three are fixed in advance, which is exactly what the restriction and the expected hitting-time certificate provide. Theorem 5 bounds , and Theorem 4 gives . One subtlety remains. Here is a supremum of expected hitting times of the learned model , whereas bounds the nonzero transition probabilities of the true model , so Theorem 5 does not apply to with directly. It applies with . Once , every transition of probability at least in retains probability at least in , so the progress paths of Definition 7 survive into with edge weight . With and pinned down, one refines the approximation until falls below the transfer threshold. We now specialize Theorem 6 to the expected hitting-time certificate, for which .
Theorem 7. Let be an -approximation of a finite MDP , let be a fixed policy, and let be reachable almost surely under from every state. Let be the expected hitting-time certificate of (a 1-RSM for by Theorem 4), and let . If , then is an -RSM for with . Moreover, if a lower bound is known and , then suffices, and it gives .
Proof sketch. This is Theorem 6 specialized to . The expected hitting-time function is a 1-RSM on (Theorem 4) with , so the one-step expectations of under and differ by at most , and the unit slack survives as whenever . The bound on then follows from Theorem 5.
The Learning Guarantee
We conclude by assembling these pieces into an end-to-end learning guarantee. We begin from the standard result that an -close approximation can be learned.
Lemma 3 (Learning an MDP approximation [11, 9]). Let be an unknown finite MDP with sampling access. For every accuracy parameter and confidence parameter , there exists a model-learning procedure that returns a learned MDP with with probability at least , using a number of samples polynomial in , , , and .
Theorem 8. Let be an unknown finite MDP, a fixed policy, and be a target set reached almost surely under from every state. Suppose a lower bound on every nonzero transition probability is known, and let . Then, for every , an expected hitting-time RSM certificate for w.r.t. can be learned with probability at least , using a number of samples polynomial in , , and .
Proof. The high-level strategy is to learn a model accurate enough that the transfer condition of Theorem 7 is met, compute the expected hitting-time certificate on that model, and invoke transferability. Let and . By Lemma 3, with probability at least we can learn an MDP approximation with . On , define the expected hitting-time function . By Theorem 4, is a 1-RSM for with respect to , and by the expected hitting-time bound under the assumption (Theorem 5, applied to with as in Theorem 7), . Note that for , so the hypothesis already supplies the condition that bound needs. Hence , so by Theorem 7 the certificate transfers from to . Consequently, with probability at least , is a valid RSM certificate for with respect to .
It remains to account for the computational cost. The complexity of learning is established by Lemma 3. Given , the expected hitting-time function is computed by solving the linear system for , with boundary condition for all . Writing , this system has at most variables and is solved by Gaussian elimination in time, a cost dominated by the sample complexity of Lemma 3. Therefore, the overall complexity of learning a correct expected-hitting-time RSM is governed by the complexity of learning an -approximation of the MDP at accuracy , and is in particular polynomial in , , and , which proves the theorem. □
Theorem 8 delivers a certificate with probabilistic guarantees, but it is deliberately not stated as an efficiency claim. The accuracy the model learner must be run at is , so the sample complexity is polynomial in , which is exponential in . Moreover is not available to the learner (it is determined by the support of the unknown kernel ), so the only a priori substitute is the worst-case bound . Whether the exponential dependence on is necessary, or is an artifact of the worst-case bound of Theorem 5, we leave open. Our experiments indicate that this bound is loose in practice.
Empirical Evaluation of Transferability
The objective of this section is to put our transfer guarantee to an empirical test. Recall that Theorem 8 is only sufficient. An EHT RSM computed on a learned model is valid on the true MDP when , where and is the approximation error. Since the guarantee is one-directional, two questions arise. First, how demanding is the condition in practice? Second, does the certificate ever transfer even when the condition fails?
Setup. For each benchmark we compute on the learned model (a 1-RSM for by Theorem 4), perturb the kernel to obtain the true MDP , and record two quantities. The first is the sufficient condition . The second is the empirical drift .
The first is what our theory can certify, namely . The second is the ground truth, since is a valid certificate on exactly when .
Benchmarks. We evaluate on seven MDPs spanning a range of progress dynamics. These are three cyclic MDPs (forward probability 0.01, a single 0.01 bottleneck, and 0.1), a DAG-like MDP, a gridworld, a RiverSwim-style chain, and a large sparse 100-state MDP. The suite mixes benign structures with ones containing rare progress transitions, since the rare transitions are precisely what inflate the hitting-time bound . All benchmark MDPs, their exact kernels, and per-state certificate and drift values are given in sup. mat. B, so every value in Table 1 is reproducible without code.
| Benchmark | ||||
| Cyclic () | 0.0167 | 200 | −2.333 | 0.500 |
| Cyclic (bottleneck) | 0.020 | 82.5 | −0.650 | 0.783 |
| Cyclic () | 0.020 | 20 | 0.600 | 0.933 |
| DAG-like | 0.010 | 3.132 | 0.969 | 0.999 |
| Gridworld | 0.010 | 5.001 | 0.950 | 0.998 |
| Chain (RiverSwim) | 0.010 | 15.695 | 0.843 | 0.997 |
| Large 100-state | 0.010 | 10666.7 | −105.667 | 0.958 |
Table 1. Transferability across benchmarks, with and . The certificate is empirically valid on () in every case, yet the sufficient condition fails wherever a rare transition inflates .
Observations. Two findings answer our questions. First, the condition is easy to meet exactly when the MDP is progress-making. For the DAG-like, gridworld, chain, and cyclic models, forward probabilities are not vanishingly small, so stays small and is comfortably positive, indeed close to 1. Second, a few rare transitions break it. For the all-0.01 cyclic MDP a mere already forces (through ), and the 100-state model is the extreme case, where a single rare transition inflates to 10666.7 and .
The decisive column, however, is . It is strictly positive in every benchmark (never below 0.5), including all three where . In other words, the certificate transfers in practice even where our theory cannot promise it. This confirms that , while sound, is conservative. It multiplies the global worst-case bound against , so a single rare state can inflate without endangering the drift elsewhere. Improving this gap is part of future work.
Conclusion
We showed that almost-sure reachability cannot be certified from samples alone in general unknown MDPs (§ 3), yet a known bound recovers a learnable, checkable, and transferable expected-hitting-time certificate (§ 4). As future work, we plan to investigate whether the exponential dependence on (§ 8) can be improved, and whether a similar certificate-based approach extends to reach-avoid and full LTL specifications.
Preliminaries
Measure-Theoretic Background
For completeness, we collect here the measure-theoretic notions underlying the stochastic-process language used in § 2. None of this is new; we follow standard treatments [25]. Readers familiar with basic probability theory may safely skip this supplementary material.
-algebras. Let be a nonempty set, thought of as the sample space of all possible outcomes of a random experiment. A collection of subsets of is a -algebra (or -field) over if it is closed under complementation and countable unions and contains the whole space:
;
if , then its complement ; and
if , then .
These three conditions also force (by (1) and (2)) and closure under countable intersections (by (2), (3), and De Morgan’s laws). The elements of are called events: a -algebra is thus the collection of subsets of to which we are able to assign a probability. The pair is called a measurable space.
Two extreme examples are the trivial -algebra , which records no information, and the power set , which records everything and is the default choice when is countable (as for the finite MDPs of this paper). Intermediate -algebras model partial information, which is precisely what filtrations exploit.
Generated -algebras. Given any family of subsets, the -algebra generated by , denoted , is the smallest -algebra containing , i.e. the intersection of all -algebras that contain . This intersection is itself a -algebra and is well defined because is one such -algebra, so the family being intersected is nonempty. Analogously, for a random variable we write for the smallest -algebra with respect to which is measurable; intuitively, encodes exactly the information revealed by observing .
Probability measures and probability spaces. A probability measure on is a function satisfying
Normalization: ; and
Countable additivity: for any countable collection of pairwise disjoint events ,
The triple is a probability space. It is the fundamental object on which all random quantities in the paper are defined.
Random variables and expectation. A random variable is a measurable function , meaning that for every Borel set ; measurability guarantees that events such as lie in and hence have a well-defined probability. We write for the expectation (Lebesgue integral) of with respect to , when it exists, and for the conditional expectation of given a sub--algebra , i.e. the (almost surely unique) -measurable random variable satisfying for all . Conditional expectation is the formal notion of “best prediction of given the information in ,” and it is the operation appearing in the defining inequality of a supermartingale (Definition 1).
Stochastic processes and filtrations. A (discrete-time) stochastic process is a sequence of random variables on a common probability space . A filtration is a nondecreasing sequence of sub--algebras
where models the information available up to time ; the nesting expresses that information accumulates and is never forgotten. A process is adapted to if each is -measurable, i.e. its value is determined by the information available at time . The canonical choice is the natural filtration , generated by the history of the process itself. For an MDP under a fixed policy, this is exactly the -algebra generated by the observed trajectory prefix, which is the filtration used in the main text.
Benchmark Details
This supplementary material supports the empirical evaluation of § 8 with the material that does not fit in the main text: for each benchmark we give the exact transition kernel of the true MDP , drawn as an automaton, together with the per-state certificate and drift values behind the aggregate results. The approximation error , the bound , the transfer margin , and the minimum drift are defined in § 8 and their per-benchmark values are collected in Table 1; we do not repeat them here. Instead, each table below reports, per state, the certificate value , its one-step expectations and under the true and nominal kernels, and the corresponding drifts and . As in the main text, the larger benchmarks are shown on a representative subset of states. All reported quantities are computed by exact linear-algebra solves, since the expected hitting time is the unique solution of a linear system. The results are therefore deterministic, involve no randomness, and complete in negligible time on a standard laptop.
Cyclic MDP, all forward probabilities 0.01
This benchmark (Figure 2) is a four-state cyclic MDP with target ; every state overwhelmingly self-loops, and progress is made only through rare forward transitions of order 0.01. These rare transitions inflate the expected hitting time, and hence the bound , which is what drives the transfer margin negative for this instance even though the true-MDP drift stays positive (per-state values in Table 2).

Figure 2. Cyclic MDP with all forward probabilities 0.01 (true kernel ).
| State | Drift() | Drift() | |||
| 150 | 148.5 | 149 | 1.5 | 1 | |
| 200 | 199.125 | 199 | 0.875 | 1 | |
| 150 | 149.5 | 149 | 0.5 | 1 |
Table 2. Per-state certificate and drift values for the cyclic MDP with all forward probabilities 0.01.
Cyclic MDP, one bottleneck forward probability 0.01
This variant (Figure 3) keeps the four-state cyclic structure but makes only a single forward transition rare, with the remaining forward probabilities raised to 0.1. The lone bottleneck alone suffices to inflate and defeat the sufficient condition, while the true-MDP drift again remains positive (Table 3).

Figure 3. Cyclic MDP with one bottleneck forward transition of probability 0.01 (true kernel ).
| State | Drift() | Drift() | |||
| 82.5 | 81.225 | 81.5 | 1.275 | 1 | |
| 65 | 63.942 | 64 | 1.058 | 1 | |
| 37.5 | 36.717 | 36.5 | 0.783 | 1 |
Table 3. Per-state certificate and drift values for the cyclic MDP with one bottleneck forward probability 0.01.
Cyclic MDP, forward probabilities 0.1
The third cyclic instance (Figure 4) raises all forward probabilities to 0.1. With more frequent progress the hitting time, and hence , drops sharply, so that here the certificate provably transfers (Table 4).
Figure 4. Cyclic MDP with forward probabilities 0.1 (true kernel ).
| State | Drift() | Drift() | |||
| 15 | 13.95 | 14 | 1.05 | 1 | |
| 20 | 19.017 | 19 | 0.983 | 1 | |
| 15 | 14.067 | 14 | 0.933 | 1 |
Table 4. Per-state certificate and drift values for the cyclic MDP with forward probabilities 0.1.
DAG-like MDP
This benchmark (Figure 5) is an acyclic five-state MDP with absorbing target . Because every path makes steady forward progress, stays small and the certificate transfers provably, with a comfortable margin (Table 5).

Figure 5. DAG-like MDP (true kernel ).
| State | Drift() | Drift() | |||
| 3.132 | 2.131 | 2.132 | 1.001 | 1 | |
| 2.42 | 1.421 | 1.42 | 0.999 | 1 | |
| 1.7 | 0.698 | 0.7 | 1.002 | 1 | |
| 1 | 0 | 0 | 1 | 1 |
Table 5. Per-state certificate and drift values for the DAG-like MDP.
Gridworld MDP
This benchmark (Figure 6) is a gridworld with states and target . Under the fixed policy each state advances toward the goal (rightward or downward) with high probability and slips laterally or self-loops with small probability. This progress-making structure keeps small, so the certificate transfers provably (Table 6).

Figure 6. Gridworld MDP (true kernel ; reproduced from the experiment output).
| State | Drift() | Drift() | |||
| 5.001 | 4.001 | 4.001 | 1.001 | 1 | |
| 2.793 | 1.795 | 1.793 | 0.998 | 1 | |
| 2.654 | 1.654 | 1.654 | 1 | 1 | |
| 2.795 | 1.794 | 1.795 | 1.001 | 1 | |
| 1.406 | 0.404 | 0.406 | 1.002 | 1 |
Table 6. Per-state certificate and drift values for the gridworld MDP.
Chain (RiverSwim-style) MDP
This benchmark (Figure 7) is a six-state RiverSwim-style chain with target : each interior state predominantly self-loops, advances toward the target with moderate probability, and occasionally drifts backward. The certificate transfers provably here (Table 7).
Figure 7. Chain (RiverSwim-style) MDP (true kernel ).
| State | Drift() | Drift() | |||
| 15.695 | 14.692 | 14.695 | 1.003 | 1 | |
| 13.195 | 12.198 | 12.195 | 0.997 | 1 | |
| 6.664 | 5.657 | 5.664 | 1.007 | 1 | |
| 3.333 | 2.33 | 2.333 | 1.003 | 1 |
Table 7. Per-state certificate and drift values for the chain (RiverSwim-style) MDP.
Large 100-state MDP
Our final benchmark is a large, sparse MDP with 100 states ; being high-dimensional, it is reported by the representative per-state slice below rather than a drawn automaton. Its structure contains a single rare transition whose
large hitting-time value dominates , which is what makes the sufficient condition fail by a wide margin while the true-MDP drift stays positive at every state (Table 8).
| State | Drift() | Drift() | |||
| 421.467 | 420.445 | 420.467 | 1.021 | 1 | |
| 8791.467 | 8790.446 | 8790.467 | 1.021 | 1 | |
| 10661.467 | 10660.467 | 10660.467 | 1 | 1 | |
| 8364.8 | 8363.778 | 8363.8 | 1.022 | 1 | |
| 425.2 | 424.179 | 424.2 | 1.021 | 1 |
Table 8. Per-state certificate and drift values for the large 100-state MDP (representative states).
Omitted Proofs
This supplementary material collects the proofs omitted from the main body. Each proof is restated together with the statement it establishes.
Proofs from Section 2
Proof of Theorem 2. The strategy is to build a nonnegative supermartingale that would have to grow without bound if the target were missed, and then invoke Theorem 1 to rule this out. Fix any ; the argument does not use that the chain starts at , which is what gives the conclusion at every state. Under , induces a Markov chain with . Let and set , noting that is a stopping time, so . Then is a nonnegative supermartingale with . Nonnegativity is condition (i) together with . For the supermartingale property we split on : on the process is frozen, and , so pathwise and condition (ii) is never invoked at a state of ; on we have , so condition (ii) gives and hence . Observe that on we have , so . By Theorem 1, for every , . Since , letting forces , i.e. . □
Proof of Corollary 1. The forward direction is Theorem 2, which yields at every . For the converse, assume for every , and let as above.
We first check that is integrable from every state. Almost-sure finiteness alone does not give this — a random variable can be finite almost surely and still have infinite mean — and the step uses that is finite. Write and let be the smallest nonzero transition probability of under . Since , every state has a path to in the transition graph induced by , and a shortest such path is simple, hence of length at most . Following it reaches within steps with probability at least , from every state. Applying this at the start of each block of steps — legitimate by the Markov property, since the same bound holds from whatever state the chain occupies there — gives
a geometric tail, so for every .
Hence is a well-defined map . It satisfies ; on , since there under the convention ; and, decomposing on the first step for (using the Markov property of the chain induced by the memoryless ), . This is exactly the -decrease condition with , so is a 1-RSM.
Proofs from Section 4
Proof of Lemma 2. The strategy is to bound the length of a shortest progress path, lower-bound the probability of following it, and then amplify by independent episodes.
Let . Since is reached almost surely under from every state, every state has a path to in the transition graph induced by . For a state , let be the length of a shortest such path, so for and, since the MDP is finite, for every reachable . For every non-target reachable state there is a successor with and ; we call such a transition a progress transition. By Definition 5, each progress transition has probability at least .
Let over reachable states, so . Starting from any reachable state, there is a path of at most progress transitions leading to , and hence the probability of reaching within the next steps is at least .
Now consider independent episodes of length . In each episode the probability of reaching is at least , so the probability of not reaching in a single episode is at most , and after episodes it is at most . To drive this failure probability to at most , it suffices to take
i.e.,
where the direction of the inequality is preserved because . Each episode uses at most samples, so it suffices to take
Finally, using the worst-case bound (the expression is increasing in ), it suffices to take
Thus, with probability at least , a path to is observed within a number of samples bounded by the known parameters , , and .
Proof of Theorem 4. The strategy is to verify the two defining conditions of Definition 2 directly from the recursive form of Definition 3. Throughout, set .
(1) Non-negativity. For every , the hitting time is a non-negative random variable, and hence
(2) Expected decrease. Let and let . By Definition 8,
and the sum is exactly the one-step expectation of ,
Hence , which is precisely the expected-decrease condition with . Both conditions holding, is a 1-RSM. □
Proof of Theorem 5. The high-level idea is to show that from any state of finite distance the target is reached within steps with probability at least , and then to turn this per-block success probability into a geometric bound on the expected hitting time.
By hypothesis for every . Fix a state . If , then and hence , so assume . By Definition 6, every state admits a successor with . By Definition 7, the transition is progress-making, and since we have ; therefore, by the definition of ,
Now consider any state . Repeatedly following a progress-making transition decreases the distance by one at each step, so starting from there is a path to of length . Since each transition along this path has probability at least , the probability of following it and reaching within steps is at least . Hence, for every state ,
Let , and divide time into blocks of length . If the target has not been reached before the start of a block, the process occupies some state , and by hypothesis—this is exactly where reachability from every state is needed, since is not in general closed under transitions—and hence reaches during that block with probability at least ; equivalently, it fails to reach during the block with probability at most . It follows that, for every ,
Since , grouping the sum into blocks of length gives
In particular, is finite. □
Proof of Theorem 7. This is the specialization of Theorem 6 to the expected hitting-time certificate, for which ; we spell it out for completeness. Fix and let . By definition of expectation on the two models,
Subtracting and taking absolute values, so as to invoke the approximation assumption,
By Definition 9, for the fixed pair , and since is finite for every (the progress paths of survive into with edge weight , as shown below, so is reachable from every state of as well), we may set , so that for all . Therefore,
Because is a 1-RSM on , we have . Substituting,
Writing , the RSM condition on holds whenever , i.e., whenever . It remains to bound a priori. Theorem 5 cannot be applied to with , since constrains and not ; an estimated transition may carry arbitrarily small mass. Suppose therefore that . Every transition with then satisfies , because Definition 9 bounds each entry by . Hence every progress path of (Definition 7) is a path of all of whose edges have probability at least , and Theorem 5 applied to with gives . The transfer condition is therefore implied by , which for is itself at most , so the supposition above is not an extra hypothesis. Hence the expected hitting-time function, an RSM on , is also an RSM on . □
Remark 1. It is worth noting where the assumption is actually spent. In the proof above it enters only through the bound on the certificate, which is what converts the a-posteriori transfer condition into the a-priori threshold . The halved base is what makes the bound legitimate on the learned model: itself constrains only . The transfer mechanism itself (Theorem 6) needs no such assumption; it requires only that the certificate be bounded.
The General Certification-Learning Framework
Section 3 works with the specialization of the certification-learning framework to almost-sure reachability. For completeness we record here the general formulation, which applies to arbitrary specifications.
Formally, a certification learning task is a tuple , where is an unknown MDP with sampling access, is a policy in , and is a specification over . A learning algorithm is an iterative process that, in each iteration, (i) either resets the simulator or takes a step in , and (ii) outputs its current estimate of a certificate for the policy . Thus induces a random sequence of output certificates, and interacts with the kernel only through samples.
Definition 10 (Learning Certificates with Probabilistic Guarantees). A learning algorithm is said to learn a certificate with probabilistic guarantees for a class of specifications if there exists a sample-complexity function such that, for all and all certificate learning tasks with and , taking , we have, for all ,
We say that a learning algorithm with probabilistic guarantees is efficient if the sample-complexity function is polynomial in , , , , and .
Here and denote the number of states and actions of the MDP, denotes the size of the representation of the policy , and denotes the size of the specification . The crux of the definition is that it demands a single budget that works uniformly over all tasks of a given size. Once is exceeded, correctness must hold with probability at least .
Almost-sure reachability is the instance in which is a target set , and certifying with respect to means establishing . Writing such tasks as and absorbing and into the finite-MDP description size recovers Definition 3, the reachability formulation used in the main text.
Ranking Supermartingales for Stochastic Systems
Ranking supermartingales were introduced for general discrete-time stochastic systems ([16]) , with state , fixed controller , and noise . The MDP certificate of Definition 2 is the instance of this notion in which and the update is realized by sampling .
Definition 11 (RSM for a stochastic system [16]). Let be a target set. A continuous function
is a ranking supermartingale (RSM) w.r.t. if there exists such that
for all , and
for all .
Theorem 9 (Almost-sure reachability [16]). If an RSM w.r.t. exists, then for every .
References
- [1]Abate, A.; Contro, D.; Giacobbe, M.; Martínez-Suñé, A.; and Roy, D. 2026. Value Function Certificates. In International Symposium on AI Verification (SAIV), volume 16831 of Lecture Notes in Computer Science. Cham: Springer. Accepted/In press.
- [2]Abate, A.; Edwards, A.; Giacobbe, M.; Punchihewa, H.; and Roy, D. 2023. Quantitative Verification with Neural Networks. In Pérez, G. A.; and Raskin, J., eds., 34th International Conference on Concurrency Theory, CONCUR 2023, Antwerp, Belgium, September 18-23, 2023, volume 279 of LIPIcs, 22:1–22:18. Schloss Dagstuhl - Leibniz-Zentrum für Informatik.DOI
- [3]Abate, A.; Giacobbe, M.; and Roy, D. 2025. Quantitative Supermartingale Certificates. In International Conference on Computer Aided Verification (CAV), volume 15932 of Lecture Notes in Computer Science, 3–28. Cham: Springer.arxiv.org/abs/2504.05065
- [4]Akshay, S.; Chatterjee, K.; Meggendorfer, T.; and Zikelic, D. 2023. MDPs as Distribution Transformers: Affine Invariant Synthesis for Safety Objectives. In Enea, C.; and Lal, A., eds., Computer Aided Verification - 35th International Conference, CAV 2023, Paris, France, July 17-22, 2023, Proceedings, Part III, volume 13966 of Lecture Notes in Computer Science, 86–112. Springer.arxiv.org/abs/2305.16796
- [5]Akshay, S.; Chatterjee, K.; Meggendorfer, T.; and Zikelic, D. 2024. Certified Policy Verification and Synthesis for MDPs under Distributional Reach-Avoidance Properties. In Proceedings of the Thirty-Third International Joint Conference on Artificial Intelligence, IJCAI 2024, Jeju, South Korea, August 3-9, 2024, 3–12. ijcai.org.
- [6]Alur, R.; Bansal, S.; Bastani, O.; and Jothimurugan, K. 2022. A Framework for Transforming Specifications in Reinforcement Learning. In Raskin, J.; Chatterjee, K.; Doyen, L.; and Majumdar, R., eds., Principles of Systems Design - Essays Dedicated to Thomas A. Henzinger on the Occasion of His 60th Birthday, volume 13660 of Lecture Notes in Computer Science, 604–624. Springer.arxiv.org/abs/2111.00272
- [7]Alur, R.; Bansal, S.; Bastani, O.; and Jothimurugan, K. 2026. Specification-Guided Reinforcement Learning. Communications of the ACM, 69(2): 80–87.DOI
- [8]Ashok, P.; Křetínský, J.; and Weininger, M. 2019. PAC statistical model checking for Markov decision processes and stochastic games. In International Conference on Computer Aided Verification, 497–519. Cham: Springer International Publishing.
- [9]Azar, M. G.; Munos, R.; and Kappen, H. J. 2013. Minimax PAC Bounds on the Sample Complexity of Reinforcement Learning with a Generative Model. Machine Learning, 91(3): 325–349.
- [10]Batz, K.; Chen, M.; Junges, S.; Kaminski, B. L.; Katoen, J.-P.; and Matheja, C. 2023. Probabilistic Program Verification via Inductive Synthesis of Inductive Invariants. In International Conference on Tools and Algorithms for the Construction and Analysis of Systems (TACAS), volume 13994 of Lecture Notes in Computer Science, 410–429. Cham: Springer.
- [11]Brafman, R. I.; and Tennenholtz, M. 2001. R-MAX: A General Polynomial Time Algorithm for Near-Optimal Reinforcement Learning. In Proceedings of the Seventeenth International Joint Conference on Artificial Intelligence, 953–958.
- [12]Chatterjee, K.; Henzinger, T. A.; Lechner, M.; and Žikelić, Đ. 2023. A Learner–Verifier Framework for Neural Network Controllers and Certificates of Stochastic Systems. In International Conference on Tools and Algorithms for the Construction and Analysis of Systems (TACAS), Lecture Notes in Computer Science, 3–25. Cham: Springer Nature Switzerland.
- [13]Funke, F.; Jantsch, S.; and Baier, C. 2020. Farkas Certificates and Minimal Witnesses for Probabilistic Reachability Constraints. Logical Methods in Computer Science, 16(1).
- [14]Kushner, H. J. 2014. A partial history of the early development of continuous-time nonlinear stochastic systems theory. Automatica, 50(2): 303–334.
- [16]Lechner, M.; Žikelić, Đ.; Chatterjee, K.; and Henzinger, T. A. 2022. Stability Verification in Stochastic Control Systems via Neural Network Supermartingales. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 36, 7326–7336.
- [17]Palasamudram, A.; Svoboda, J.; Bansal, S.; and Chatterjee, K. 2026. Reinforcement Learning for Reachability: Guaranteeing Asymptotic Optimality. In International Conference on Machine Learning (ICML), volume 306 of Proceedings of Machine Learning Research.arxiv.org/abs/2605.24740
- [18]Perez, M.; Somenzi, F.; and Trivedi, A. 2024. A PAC Learning Algorithm for LTL and Omega-Regular Objectives in MDPs. In Wooldridge, M. J.; Dy, J. G.; and Natarajan, S., eds., Thirty-Eighth AAAI Conference on Artificial Intelligence, AAAI 2024, Thirty-Sixth Conference on Innovative Applications of Artificial Intelligence, IAAI 2024, Fourteenth Symposium on Educational Advances in Artificial Intelligence, EAAI 2024, February 20-27, 2024, Vancouver, Canada, 21510–21517. AAAI Press.
- [19]Prajna, S.; Jadbabaie, A.; and Pappas, G. J. 2007. A framework for worst-case and stochastic safety verification using barrier certificates. IEEE Transactions on Automatic Control, 52(8): 1415–1428.
- [20]Puterman, M. L. 1994. Markov Decision Processes: Discrete Stochastic Dynamic Programming. Wiley Series in Probability and Statistics. John Wiley & Sons.
- [21]Ravanbakhsh, S.; and Sankaranarayanan, S. 2017. Counterexample Guided Synthesis of Switched Controllers for Reach-While-Stay Properties. In American Control Conference (ACC), 5504–5509. IEEE.
- [22]Sutton, R. S.; and Barto, A. G. 2018. Reinforcement Learning: An Introduction. MIT Press, 2nd edition.
- [23]Svoboda, J.; Bansal, S.; and Chatterjee, K. 2024. Reinforcement Learning for Reachability Specifications: PAC Guarantees with Expected Conditional Distance. In International Conference on Machine Learning (ICML).
- [25]Williams, D. 1991. Probability with Martingales. Cambridge Mathematical Textbooks. Cambridge University Press.DOI
- [26]Yang, C.; Littman, M. L.; and Carbin, M. 2022. On the (In)Tractability of Reinforcement Learning for LTL Objectives. In Raedt, L. D., ed., Proceedings of the Thirty-First International Joint Conference on Artificial Intelligence, IJCAI 2022, Vienna, Austria, 23-29 July 2022, 3650–3658. ijcai.org.arxiv.org/abs/2111.12679


