1. The Safe Learning Landscape
What "safe" means, the three research traditions, who works on what, and how to read this section
This module assumes:
- Random variables, expectations, indicators, independence, and variance (Primer C)
- Joint probability guarantees, confidence statements, and union bounds (Primer C)
- Quantiles, VaR, CVaR, and tail conventions (Primer C)
- State-space models, trajectories, and existence of solutions (Primer D)
- Lyapunov stability, invariant sets, and regions of attraction (Primer D)
- MDPs, policies, trajectories, and discounted returns (Primer E)
- Lipschitz continuity and sensitivity bounds (Primer B)
- Gaussian distributions, standardization, and quantiles (Primer C)
- Gradients, directional derivatives, and the chain rule (Primer B)
- Class-K functions and scalar differential inequalities (Primer D)
Core reading. Read the seven meanings of safety, the guarantee table, and the notation reference. On a first pass, aim to say what is constrained, over what horizon, and over which randomness. Use the explorer to compare meanings on one system.
Practice route. Try the three readiness checks. If a skill is rusty, use its exact review link, then return. Work through Easy P1–P4, Medium P5–P8, and Hard P9–P12; each has a separate hint and a full worked solution. Reattempt a missed problem later without opening the answer.
Optional research reading. The full conformal, duality, and barrier-function theorems are research previews. Their proofs, the researcher directory, timeline, and original comparative exercises can wait until you know the tools they mention; later modules are not prerequisites for the new graded practice.
Try these before opening the answer. The review links lead to earlier material.
- If $C=\{x:x^2\le1\}$, does $-1$ belong to $C$? Review sets and inequalities.
- If an indicator is 1 on an event of probability 0.2, what is its expectation? Review indicators and expectation.
- If $x_{t+1}=x_t/2$ and $x_0=1$, what are $x_1$ and $x_2$? Review state updates.
Show readiness answers
The set is $[-1,1]$, so $-1$ is included. The indicator's expectation is $1(0.2)+0(0.8)=0.2$. The trajectory begins $1,1/2,1/4$. If any step felt uncertain, use its review link and try that primer's Easy practice before continuing.
Book contents · Apply this chapter to a real decision · Glossary
1. What "Safe" Means
A first example. Suppose the safe state range is $C=[-1,1]$. “The next state lies in $C$” concerns one time. “Every state on this 10-step trajectory lies in $C$” concerns one whole trajectory. “At least 99% of such trajectories stay in $C$” adds a probability distribution. “Starting anywhere in $C$, this controller stays in $C$ for all time and every allowed disturbance” adds universal initial-state, time and disturbance requirements. Keep these four sentences distinct as the definitions become more formal.
"Safe" is the most overloaded word in this literature: a constrained-RL paper, a barrier-function paper and a Lipschitz-network paper all claim it and mean three different mathematical objects. Throughout this section a safety claim is read as a statement about a set (of states, trajectories or inputs), a probability (or none; see Primer C), a horizon, and a list of assumptions. Seven formalisations recur.
We use the control notation of the notation table: state $x_t\in X$, input $u_t\in U$, dynamics $x_{t+1}=f(x_t,u_t)$ (possibly plus noise $w_t$; Primer D), policy $u_t=\pi(x_t)$ (Primer D), safe set $C=\{x:h(x)\ge0\}$ (set-builder notation: Primer 0); the RL modules call the same objects $s$, $a$, $\pi_\theta$.
How to read this section. Start with primers 0 and A–E, which build from first-course linear algebra and single-variable calculus. Read the seven meanings of safety next, then the walkthroughs and explorer. Names of advanced tools are previews; their forward links lead to later modules that explain the constructions.
When disturbances are present, write $x_{t+1}=f(x_t,u_t,w_t)$ with $w_t\in W$; additive noise is the special case $f(x_t,u_t)+w_t$. Robust safety requires the same controller to succeed for every allowed disturbance sequence, from each initial state covered by the claim.
Fix a measurable score $s(x,y)$ (larger means less plausible), trained on separate data if training is needed. Conditional on that training, assume the $n$ calibration pairs $(X_i,Y_i)$ and fresh pair $(X_{n+1},Y_{n+1})$ are exchangeable. For $0<\delta<1$, let $k=\lceil(n+1)(1-\delta)\rceil$ and $q$ be the $k$-th smallest calibration score, or $+\infty$ when $k=n+1$. Define $\widehat C(x)=\{y:s(x,y)\le q\}$. Then
Why. Without ties, exchangeability makes the rank of the fresh score among all $n+1$ scores uniform on $\{1,\dots,n+1\}$. The fresh score is $\le q$ exactly when its rank is at most $k$, which has probability $k/(n+1)\ge1-\delta$; ties only increase coverage. The score must not be fitted on the calibration examples (that breaks exchangeability). Coverage averages over calibration and test draws; it need not hold conditional on a particular input or a particular calibration sample. Explained in Module 15 (Angelopoulos & Bates, Found. Trends Mach. Learn. 2023).
Here $J(\pi)=\mathbb E_{\tau\sim\pi}[\sum_{t\ge0}\gamma^t r_t]$ with $0\le\gamma\lt1$, and $\tau\sim\pi$ means that the trajectory $\tau=(s_0,a_0,s_1,\dots)$ is generated by a fixed initial-state distribution, the policy and the transition law. $J_{c_i}$ is an expected discounted sum; papers that use the normalized $(1-\gamma)J_{c_i}$ (a weighted average, since the weights $(1-\gamma)\gamma^t$ sum to 1) scale their budgets by the same factor. Rewards and costs are assumed bounded, so all these expectations are finite.
$e_j$ is the $j$-th standard basis vector (a 1 in coordinate $j$, zeros elsewhere), so $\varphi_j=e_j^{\top}\varphi$. For $j\ne c$ set $d_j(x)=\varphi_c(x)-\varphi_j(x)=(e_c-e_j)^{\top}\varphi(x)$. Cauchy–Schwarz and then the Lipschitz bound give
The margin definition gives $d_j(x)\ge M(x)$, so $d_j(x+\delta)\ge M(x)-\sqrt2L\|\delta\|_2\gt0$ for every $j\ne c$ whenever $\|\delta\|_2\lt M(x)/(\sqrt2L)$: class $c$ keeps the strictly largest logit. (If $L=0$ the output is constant and every radius is certified.)
In randomized smoothing, let $A$ be the selected top class and $p_A=\mathbb P_\varepsilon(\mathrm{label}(x+\varepsilon)=A)$ its true probability. CERTIFY estimates $p_A$ from Monte-Carlo samples and returns $\underline{p_A}$ with $\mathbb P_{\mathrm{samples}}(\underline{p_A}\le p_A)\ge1-\eta$ ($A$ is chosen from a separate batch of samples, so this bound stays valid). On that event, $\underline{p_A}\gt1/2$ certifies the radius $\sigma\Phi^{-1}(\underline{p_A})$ for $g$. The confidence $1-\eta$ is over the sampling; on that event the radius holds for every perturbation.
$\mathcal U$ denotes the allowed controllers or control signals, and $\mathcal T$ the time set, including zero. In this definition there is no adversarial disturbance: from each $x\in X_V$, some admissible control avoids failure forever. In discrete time, controlled invariance means that for every state in the set an allowed input keeps the next state in the set. With disturbances, robust viability instead requires a causal controller that succeeds for every admissible disturbance sequence.
| Formalisation | Typical guarantee | Typical tools | Modules |
|---|---|---|---|
| (a) Hard constraint / invariance | deterministic, for all $w\in W$ and all $t$ | Nagumo (Primer D), CBF-QP (QPs: Primer B), HJ reachability, robust and tube MPC, shields | 10, 11 |
| (b) Chance constraint | $1-\delta$ over noise, data or prior; joint or per step | stochastic MPC, GP confidence bounds plus Lipschitz continuity (SafeOpt), conformal prediction, scenario approach | 4, 5, 6, 15 |
| (c) Expected cost (CMDP) | in expectation; asymptotic for primal-dual; near-satisfaction per iteration (CPO) | Lagrangians (Primer B), occupancy-measure LPs, trust regions (Primer E) | 8, 9 |
| (d) Risk (CVaR) | tail average bounded; implies (b) for the same random variable and threshold, with $\delta=1-\alpha$ | Rockafellar–Uryasev, distributional critics | 8 |
| (e) Stability / ROA | deterministic given the model; $1-\delta$ with a GP model | Lyapunov functions, contraction, LMIs | 11, 14 |
| (f) Robustness of a model | deterministic Lipschitz / reachable-set bounds; probabilistic smoothing radii | LipSDP, direct parameterizations, bound propagation, IQCs | 12, 13, 15 |
| (g) Viability | existence of a safe controller; largest safe set | viability theory, HJ backward reachable tubes, safe value functions | 7, 10 |
Reading the tools column. The tools are previews, not prerequisites of this module. A shield (safety filter) checks a proposed action and replaces it when it cannot be certified safe (Module 10). An occupancy-measure LP optimizes over discounted state-action visit frequencies, which satisfy linear probability-flow equations (Module 8; Primer E). A distributional critic predicts the whole distribution of future cost, not only its mean (Module 8). Contraction means that the distance between any two trajectories shrinks, which is stronger than convergence to one equilibrium (Module 11). An LMI requires a symmetric matrix that is affine in the decision variables to be semidefinite, and an SDP optimizes a linear objective subject to LMIs (Module 2). Bound propagation pushes an enclosure of the input set through the layers of a network to bound every possible output (Module 15). The scenario approach imposes a constraint only for sampled uncertainty values and bounds the violation probability on fresh ones (theorem below).
Row (d) needs care: for the same integrable random variable $Z$ and threshold $b$, $\operatorname{CVaR}_\alpha(Z)\le b$ implies $\mathbb P(Z\gt b)\le1-\alpha$ (because $\operatorname{CVaR}_\alpha(Z)\ge\operatorname{VaR}_\alpha(Z)$, first walkthrough, Step 5). A trajectory-safety statement needs $Z=\max_{0\le t\le T}[-h(x_t)]$ and $b=0$, since $Z\gt0$ exactly when some state is unsafe. A CVaR budget on the total cost instead bounds only the probability that the total cost exceeds that budget.
Choose a design $z_N\in K\subseteq\mathbb R^q$ ($K$ closed and convex) by minimizing a fixed linear objective subject to $g(z,w_i)\le0$ for $i=1,\dots,N$, where $N\ge q$ and $w_1,\dots,w_N$ are drawn independently from the distribution of the uncertainty $w$ met in deployment. Assume that every set $\{z:g(z,w)\le0\}$ is closed and convex and (their Assumption 1, as in Module 15) that every sampled program is feasible, its feasible set has nonempty interior, and its optimal solution exists and is unique. Let $V(z)=\mathbb P_w(g(z,w)\gt0)$ be the probability that a fixed design $z$ violates the constraint for a fresh $w$. Then for every $0\lt\epsilon\lt1$,
Intuition. A convex program in $q$ variables is pinned down by at most $q$ of its sampled constraints, and the right-hand side is the probability that a $\mathrm{Bin}(N,\epsilon)$ count is at most $q-1$ (Primer C), which shrinks as $N$ grows. The outer probability is over the $N$ design samples; $V$ is over one fresh sample. Convexity and uniqueness are substantive assumptions, so this is no certificate for arbitrary neural-network training. Explained in Module 15 (Campi & Garatti, SIAM J. Optim. 2008).
Use a finite discounted MDP with bounded costs, fixed initial law and transition probabilities, $0<\gamma<1$, and stationary randomized policies $\pi,\pi'$. Define $V_c^\pi(s)$ as the expected discounted cost collected from state $s$ onwards under $\pi$, $Q_c^\pi(s,a)$ the same after first taking action $a$, and the advantage $A_c^\pi=Q_c^\pi-V_c^\pi$ (Primer E). Let $d^\pi(s)=(1-\gamma)\sum_{t\ge0}\gamma^t\mathbb P_\pi(s_t=s)$ and $\varepsilon_c=\max_s|\sum_a\pi'(a|s)A_c^\pi(s,a)|$. Suppose the exact cost surrogate and trust-region constraints hold:
Here $\eta\ge0$ and $D_{\rm KL}(p\|q)=\sum_a p_a\log(p_a/q_a)$, with $0\log(0/q)=0$ and positive-over-zero terms infinite. Then
Intuition. The surrogate measures costs using old state frequencies; the remainder pays for their change. Exact feasible CPO updates obey these constraints. Estimated expectations and numerical approximations need additional error control. Explained in Module 9; Achiam et al., Proposition 2.
Fix an initial state of a deterministic continuous-time system and a class of admissible controllers $u$. Assume trajectories exist for all time, some admissible controller is safe (never reaches the failure set), rewards are measurable with $|r|\le R$, and every unsafe controller reaches the failure set by a common time $T_f\lt\infty$; its first failure time is $t_f\le T_f$. With discount time constant $\tau_d\gt0$ (subscript $d$ because $\tau$ denotes a trajectory elsewhere in this section), maximize the penalized return $G(u)-p\,e^{-t_f/\tau_d}$, where $G(u)=\int_0^\infty e^{-t/\tau_d}r(x(t),u(t))\,dt$ and the penalty term is zero if failure never occurs; assume the maximum is attained. Then
makes every maximizer safe, hence optimal among the safe controllers, whose returns the penalty does not change. Proof. $|G(u)|\le\int_0^\infty e^{-t/\tau_d}R\,dt=R\tau_d$ for every $u$. An unsafe $u$ has $e^{-t_f/\tau_d}\ge e^{-T_f/\tau_d}$, so
so no unsafe controller can be a maximizer. $\square$
Intuition. The time bound keeps the discounted penalty away from zero; bounded rewards limit what failure can buy. Massiani et al. prove a sharper threshold under their Assumption 1, explained in Module 7 (Massiani et al., TAC 2023).
For a function $F$ of one variable (below, $F=F_\alpha$), the right derivative is $F^{\prime}_+(v)=\lim_{a\downarrow0}[F(v+a)-F(v)]/a$ and the left derivative $F^{\prime}_-(v)$ is the same limit with $a\uparrow0$. For $F(v)=|v|$ they are $+1$ and $-1$ at $v=0$, where no ordinary derivative exists. If $F$ is convex, its chord slope $[F(v+a)-F(v)]/a$ never decreases as $a$ increases, so it is $\ge F^{\prime}_+(v)$ for every $a\gt0$ and $\le F^{\prime}_-(v)$ for every $a\lt0$. Multiplying by $a$ (and flipping the inequality when $a\lt0$) gives $F(v+a)-F(v)\ge aF^{\prime}_+(v)$ for $a\gt0$ and $F(v+a)-F(v)\ge aF^{\prime}_-(v)$ for $a\lt0$. Hence $F^{\prime}_-(v)\le0\le F^{\prime}_+(v)$ makes both right-hand sides $\ge0$: no step lowers $F$, so $v$ is a global minimizer, even at a corner. The CVaR objective has such corners when $Z$ has probability atoms.
Bounded convergence says: on a probability space, if measurable $Y_n$ converge almost surely to $Y$ and $|Y_n|\le M$ for one finite constant $M$, then $\mathbb E Y_n\to\mathbb E Y$. For instance, $Y_n=\mathbf1\{U\le1/n\}$ with $U$ uniform on $(0,1)$ tends to zero, and $\mathbb E Y_n=1/n\to0$. Step 2 of the walkthrough below applies this to the difference quotients of the hinge $(Z-\nu)^+$, which are bounded by 1.
(a), (e), (g) are classical control and viability theory: set invariance (Blanchini, Automatica 1999), viability kernels (Aubin, Viability Theory, 1991; reprint 2009), barrier certificates (Prajna & Jadbabaie, HSCC 2004), Lyapunov theory, and reachability as a Hamilton–Jacobi PDE (Mitchell, Bayen & Tomlin, TAC 2005). (b) comes from stochastic MPC and from bandit confidence bounds (Srinivas et al., ICML 2010). (c) is Altman's CMDP theory, adopted by deep RL through CPO and the Lagrangian baselines. (d) is the finance notion of coherent risk (Rockafellar–Uryasev), imported into RL by Chow and co-authors among others. (f) is adversarial-robustness research, brought into control language by LipSDP (Fazlyab et al., NeurIPS 2019). García & Fernández, JMLR 2015 classified safe RL by whether it modifies the optimality criterion (worst case, risk, constraints) or the exploration process; Brunke et al. (2022) proposed instead the Level I/II/III taxonomy (constraint satisfaction encouraged, with probability $p$, guaranteed) that maps roughly onto (c)/(b)/(a).
Coherent risk. For losses, a risk functional $\rho$ is coherent if it is monotone ($Z\le Y$ implies $\rho(Z)\le\rho(Y)$), translation equivariant ($\rho(Z+b)=\rho(Z)+b$ for constants $b$), positively homogeneous ($\rho(aZ)=a\rho(Z)$ for $a\ge0$), and subadditive ($\rho(Z+Y)\le\rho(Z)+\rho(Y)$), on a domain where these quantities are finite. For example, expected loss satisfies all four, and $\rho(2Z+3)=2\rho(Z)+3$. CVaR also satisfies them; VaR need not satisfy subadditivity. These rules explain why CVaR treats a sure added cost predictably and does not penalize diversification.
2. Three Traditions
Three communities work on the same word with different assumptions, tools and guarantees. Knowing a paper's tradition tells you what it will assume before you reach the theorem.
| Tradition | Assumes | Guarantees | Typical failure mode | Modules |
|---|---|---|---|---|
| Constrained RL CMDPs, Lagrangians, trust regions | an MDP you can sample (simulator or real system), a scalar cost signal, and that violations during training are tolerable and counted | $J_c(\pi)\le d$ in expectation at convergence; near-satisfaction per iteration (CPO); zero duality gap over all policies under Slater's condition and bounded rewards, so the Lagrangian relaxation is exact there (Paternain et al.); for a parametrised policy class the gap is only bounded in terms of its approximation error | violations while learning; averages hide rare catastrophes; oscillating multipliers (Stooke et al., ICML 2020) | 8, 9 |
| Control-theoretic certificates and filters Lyapunov, CBF, HJ, MPC, safe BO | a model: nominal dynamics with a bounded disturbance set, or a GP with a known Lipschitz constant and a known RKHS-norm bound (a bound on the unknown function's norm in the function space defined by the kernel, Module 3); a known constraint set; a safe seed or backup controller; a QP or MPC solved in real time | deterministic invariance or stability, or $1-\delta$ jointly for all $t$; active during learning (filters, SafeOpt) and at deployment | model misspecification; an RKHS-norm bound nobody can verify; infeasible QP/MPC; sampled-data effects | 4–7, 10, 11 |
| Certified models Lipschitz/SDP, verification, statistical guarantees | a fixed trained network with slope-restricted activations (see Primer D), or an architecture that is Lipschitz by construction; for statistical certificates, calibration and test data that are jointly exchangeable (conformal) or i.i.d. scenarios (scenario approach) | deterministic Lipschitz constants, reachable sets, robustness radii; distribution-free coverage (conformal) or violation bounds (scenario approach) | loose bounds at scale; distribution shift breaks exchangeability; says nothing about the closed loop unless combined with 10–11 or 14 | 12–15 |
Assume finite state and action sets (so rewards and costs are bounded), a fixed initial distribution and transition law, $0\le\gamma\lt1$, finitely many budgets, and optimization over all randomized policies. Suppose one policy satisfies $J_{c_i}(\pi)\lt d_i$ for every $i$ (Slater's strict feasibility). Define the feasible optimum $P^*=\sup_{\pi:J_{c_i}(\pi)\le d_i}J(\pi)$ and
Then $D^*=P^*$: the duality gap $D^*-P^*$ is zero. The inequality $D^*\ge P^*$ (weak duality) is one line: for feasible $\pi$ and $\lambda\ge0$ every term $-\lambda_i(J_{c_i}(\pi)-d_i)$ is $\ge0$, so $\sup_{\pi'}\mathcal L(\pi',\lambda)\ge\mathcal L(\pi,\lambda)\ge J(\pi)$; take the sup over feasible $\pi$, then the inf over $\lambda$. The theorem is the reverse inequality.
Intuition. State-action frequencies satisfy linear probability-flow equations, which turns this case into a linear program, and linear-programming duality closes the gap; Paternain et al. prove the result for general state spaces, where Slater's condition is what makes it work. Discounting keeps all values finite. The unrestricted policy class matters: a neural family need not realize the needed frequencies. Equality of optimal values does not ensure safe learning iterates. Explained in Module 8; Paternain et al., NeurIPS 2019.
The module map shows the section as a prerequisite graph: solid arrows are prerequisites, dashed arrows conceptual bridges that the target module makes explicit. The small labels name each module's key tools; for instance, dissipativity (Module 14) means that the energy stored in a system can grow only by the energy supplied through its inputs (Module 2).
In the map, BRT is the backward reachable tube of the failure set, read here as the set of states from which failure is unavoidable, with the same horizon and quantifiers as the viability problem. Without disturbances and over an infinite horizon it is $X_U=\{x:\ \forall u\in\mathcal U\ \exists t\in\mathcal T:\ \varphi_x^u(t)\in X_F\}$; negating the quantifiers in the definition of $X_V$ ("some $u$ avoids $X_F$ at all $t$") gives exactly this set, so $X_U=X\setminus X_V$. A finite-horizon tube gives finite-horizon viability. A tube defined by "some control reaches the failure set" ($\exists u$ instead of $\forall u$) is in general a larger set.
3. Types of Guarantees
Independently of what is guaranteed, guarantees differ in how strongly and when they hold.
| Type | Statement | Randomness | Examples here |
|---|---|---|---|
| Deterministic | holds for every admissible disturbance and initial state, given the assumptions | none | CBF invariance, LipSDP bounds, tube MPC, HJ safe sets |
| High probability | $\mathbb P(\text{property})\ge1-\delta$ | noise sequence (frequentist, $f$ fixed), prior over $f$ (Bayesian), calibration data and the test point jointly (conformal, marginal coverage), sampled scenarios, Monte-Carlo estimates (smoothing) | SafeOpt Thm 1, GP error bounds (Fiedler, Scherer & Trimpe, AAAI 2021), conformal planning |
| In expectation | $J_c(\pi)\le d$ | episodes and policy | every CMDP method |
| Asymptotic | a property of the limit only (convergence, vanishing average regret, Primer E) | varies | primal-dual convergence; GP-UCB's no-regret property (its regret bound itself holds w.h.p. for every finite $T$) |
| Finite-sample | after $t^\ast(\epsilon,\delta)$ samples the property holds | as above | SafeOpt's $t^\ast$, scenario sample sizes |
During learning versus at deployment. SafeOpt, SafeMDP, GoSafeOpt, safety filters and Berkenkamp-style model-based RL protect the system while it learns; CPO offers near-satisfaction at every iteration; plain Lagrangian methods promise the constraint only at convergence and may violate it freely on the way (what Safety Gym's cost-rate metric measures). Verification, Lipschitz certificates and conformal prediction certify a finished model and say nothing about the data collection that produced it.
Two representative theorems, one deterministic and one high-probability, show how much the assumptions carry.
An open neighbourhood $D$ of $C$ contains a small ball around every point of $C$, so a condition required on $D$ is also checked just outside $C$. The boundary $\partial C$ consists of the points that have both points of $C$ and points outside $C$ arbitrarily close; for continuous $h$, $h=0$ on $\partial C$ (Primer 0). $0$ is a regular value of $h$ if $\nabla h(x)\ne0$ wherever $h(x)=0$. Then $\nabla h(x)$ is a normal to the boundary pointing into $C$, and the sign of $\dot h=\nabla h(x)^{\top}\dot x$ distinguishes inward from outward motion. For $h(x)=1-x^2$, $C=[-1,1]$ and $h'(\pm1)=\mp2\ne0$ point into $C$. For $h(x)=-x^3$, $h'(0)=0$, so $\dot h=0$ at the boundary whatever the velocity, and a boundary-only check cannot see a crossing (worked out below the theorem).
In words. If an input keeping $\dot h\ge-\alpha(h)$ always exists, $h$ stays nonnegative along the closed loop, so the trajectory never leaves $C$; for a locally Lipschitz $\alpha$ the comparison lemma adds that $h$, if positive at the start, stays positive, so the boundary is approached at most asymptotically.
Why each assumption matters. Lipschitz $f,g,u$: solutions exist and are unique, otherwise "the" trajectory is undefined. Known $f,g$: the constraint is evaluated with the model; model error shifts $\dot h$ and needs a robust or ISSf version (Module 10). Open $D$ or regular $h$: Ames et al. (2017) prove invariance through Nagumo's boundary condition $\dot h\ge0$ on $\partial C$, which controls the flow only when $0$ is a regular value of $h$ ($\nabla h\ne0$ on $\partial C$; Remark 5 of the 2019 tutorial notes that the 2017 statement leaves this unstated although its proof needs it); if $D$ is an open neighbourhood of $C$, the inequality on $D$ gives invariance without it (while $h(x(t))\lt0$ it would satisfy $\dot h\ge-\alpha(h)\gt0$, so it can never become negative). With neither, the conclusion fails: $h(x)=-x^3$, $D=C=(-\infty,0]$, $\dot x=1$ and $\alpha(r)=3\,\mathrm{sign}(r)\,|r|^{2/3}$ satisfy the barrier inequality on $D$ (with equality), yet $x(t)=-1+t$ leaves $C$ after $t=1$. Admissible inputs on all of $D$ (sup versus max: Primer B): where the sup is negative, $K_{\rm zcbf}(x)=\emptyset$, the CBF-QP has no solution and the guarantee is void; a positive supremum guarantees a feasible input; a supremum of zero needs attainment. A continuous affine expression attains a finite supremum on a nonempty compact set or nonempty closed polyhedron; on $\mathbb R^m$ a nonconstant affine expression is unbounded above but still supplies feasible inputs. Feasibility can fail for an open $U$ ($h=x$, $\dot x=-1+u$, $U=(0,1)$: at $x=0$ the sup is $0$, yet every admissible $u$ gives $\dot h\lt0$); a Lipschitz controller with values in $K_{\rm zcbf}$ is a further requirement. Forward completeness: Corollary 2 gives invariance on the maximal interval of existence of the closed-loop solution (Ames et al., Remark 9: the closed loop need not be forward complete); the "for all $t\ge0$" of formalisation (a) follows when $C$ is compact or the closed loop is otherwise forward complete.
Here $x\in\mathbb R^n$, $u\in\mathbb R^m$, $f(x)\in\mathbb R^n$, $g(x)\in\mathbb R^{n\times m}$ and $h(x)\in\mathbb R$. Along a trajectory the chain rule gives
with the Lie derivatives $L_fh(x)$ (a scalar) and $L_gh(x)$ (a $1\times m$ row vector). At each fixed $x$ the barrier inequality $L_fh(x)+L_gh(x)u+\alpha(h(x))\ge0$ is therefore one linear inequality in $u$, which is why the CBF-QP has linear constraints. ($C^1$ means that the first partial derivatives exist and are continuous.)
Take $n=1$, $\dot x=1$ ($g=0$, so no input can help) and $C=D=(-\infty,0]$. For $x\le0$: $h=-x^3\ge0$, $\dot h=h'(x)\dot x=-3x^2$, and $\alpha(h)=3(-x^3)^{2/3}=3x^2$, so $\dot h+\alpha(h)=0$ throughout $D$ and the barrier inequality holds. At the boundary point $x=0$, $h'(0)=0$ gives $\dot h=0$, so Nagumo's condition $\dot h\ge0$ on $\partial C$ holds as well, yet $\dot x=1$ pushes the state out: from $x(0)=-1$ the solution $x(t)=-1+t$ leaves $C$ for $t\gt1$. Just outside $C$ ($x\gt0$), $h=-x^3\lt0$, $\alpha(h)=-3x^2$ and $\dot h+\alpha(h)=-6x^2\lt0$, so requiring the inequality on an open neighbourhood of $C$ would have rejected this example.
Algorithm assumption. Initialize $S_0$ as above. Intersect successive confidence intervals, retaining the known seed bounds, to obtain lower bounds $l_t$. Set $S_t=S_{t-1}\cup\{x\in D:\exists z\in S_{t-1},\ l_t(z)-Ld(z,x)\ge h\}$ and choose $x_t\in S_t$. The particular maximizer/expander choice is needed for optimality, not safety.
Statement. For $0<\delta<1$, $\lambda\ge\sigma_0^2>0$, and this query rule, with probability at least $1-\delta$ (over the noise, jointly for all $t\ge1$) every query satisfies $f(x_t)\ge h$. This is the safety part of Theorem 1. Its second part, a finite-sample optimality result (after $t^\ast$ iterations the best guess $\hat x_t=\arg\max_{x\in S_t}l_t(x)$ is $\epsilon$-optimal within the $\epsilon$-reachable safe region, last box below), is proved in Module 4 (Sui et al., ICML 2015).
In words. The intervals $\mu_{t-1}\pm\beta_t^{1/2}\sigma_{t-1}$ that guide the $t$-th query, built from the posterior after $t-1$ observations, contain $f$ everywhere at all times (Srinivas et al.'s Theorem 6 states the same after $T$ observations as $|\mu_T-f|\le\beta_{T+1}^{1/2}\sigma_T$); Lipschitz continuity extends "certified safe" from evaluated points to their neighbours; so nothing unsafe is ever queried. In this section's convention (norm bound $\|f\|_k\le\tilde B$ with $\tilde B=B^{1/2}$, band $\mu_{t-1}\pm\tilde\beta_t\sigma_{t-1}$) the same multiplier reads $\tilde\beta_t=\beta_t^{1/2}=\big(2\tilde B^2+300\gamma_t\log^3(t/\delta)\big)^{1/2}$.
Why each assumption matters. $B$ and $\beta_t$: too small a $B$ makes the intervals lie and the safety proof collapses (numbers below). $L$: it controls extension to neighbours in the original safe-set rule; other GP safety rules can also certify points directly from their own lower bounds. Bounded noise with this $\beta_t$: Lemma 1 rests on Srinivas et al.'s Theorem 6, which assumes bounded noise although the algorithm uses a Gaussian likelihood; the GP is a deliberately misspecified but frequentist-valid tool, provided its likelihood variance matches the bound: Theorem 6 uses one $\sigma$ both as the bound on $|n_t|$ and as the likelihood standard deviation (also inside $\gamma_t$), and a smaller $\lambda$ shrinks $\sigma_t$ without shrinking the noise (as $\lambda\to0$ the posterior interpolates the noisy data with $\sigma_t\to0$ at the queried points, and the intervals miss $f$). $S_0$: safety is only propagated, never created. Finite $D$: SafeOpt enumerates $S_t$, $G_t$, $M_t$ and the $\epsilon$-reachable set, and $t^\ast$ grows with $|\bar R_0(S_0)|$; the confidence lemma itself (Srinivas et al.'s Theorem 6) is uniform over $x$ through the RKHS structure and does not need a finite domain. Proof in Module 4, $\beta_t$ in Module 3.
A kernel $k$ is positive semidefinite if every Gram matrix $K$ with $K_{ij}=k(x_i,x_j)$ is PSD. Such a kernel determines a Hilbert space of functions $\mathcal H_k$, the RKHS, with the reproducing property $f(x)=\langle f,k(x,\cdot)\rangle_k$: evaluating $f$ at $x$ is an inner product with the kernel section $k(x,\cdot)$. For $f=\sum_i a_ik(x_i,\cdot)$ the reproducing property gives $\|f\|_k^2=\sum_{i,j}a_ia_j\langle k(x_i,\cdot),k(x_j,\cdot)\rangle_k=\sum_{i,j}a_ia_jk(x_i,x_j)=a^{\top}Ka$; the space also contains limits of such sums. A bound $\|f\|_k^2\le B$ therefore restricts the whole unknown function relative to the chosen kernel, not only its observed values. Explained in Module 3.
A Gaussian process assigns a joint Gaussian distribution to the function values at any finite collection of inputs. After observing $y_i=f(x_i)+n_i$, $i=1,\dots,t$, write $K_t=(k(x_i,x_j))_{i,j=1}^t$, $k_t(x)=(k(x_1,x),\ldots,k(x_t,x))^{\top}$ and $y=(y_1,\ldots,y_t)^{\top}$. Gaussian conditioning (Primer C) with prior mean zero and noise variance $\lambda$ gives $\mu_t(x)=k_t(x)^\top(K_t+\lambda I)^{-1}y$ and $\sigma_t^2(x)=k(x,x)-k_t(x)^\top(K_t+\lambda I)^{-1}k_t(x)$. This is uncertainty about the latent function, not the variance of a fresh noisy observation. In the frequentist theorem these formulas are a prediction procedure even though the actual bounded noise need not be Gaussian. Derived in Module 3.
For a design of $t$ query points with Gram matrix $K$, the information that the noisy observations carry about $f$ (their mutual information under the GP model with noise variance $\lambda$) is $\tfrac12\log\det(I+\lambda^{-1}K)$. The quantity
is the most any $t$ measurements could provide, computed with the same $\lambda$ as the posterior. Designs are ordered lists in $D^t$, so repeated queries are allowed ($K$ then has repeated rows and columns); this is what covers algorithms that revisit a point. Explained in Module 3.
Suppose $l_t(z)\le f(z)$ is a valid lower bound. Lipschitz continuity gives $f(x)\ge f(z)-L d(z,x)\ge l_t(z)-L d(z,x)$, so any $x$ with $l_t(z)-L d(z,x)\ge h$ is safe. The confidence lemma (Module 3) gives one event, of probability at least $1-\delta$, on which $l_t(z)\le f(z)$ for all $z$ and $t$. On that event every point that the rule adds to $S_t$ is safe, $S_0$ is safe by assumption, and so every query $x_t\in S_t$ is safe. SafeOpt's expanders are candidates for enlarging $S_t$ and its potential maximizers candidates for the best safe value. For example, $l_t(z)=1.4$, $h=1$, $L=2$ certifies points at distance at most $(1.4-1)/2=0.2$. Explained in Module 4.
An $\epsilon$-optimal point of a set $A$ is any $x\in A$ with $f(x)\ge\max_{x'\in A}f(x')-\epsilon$. SafeOpt is compared not with all safe points but with those the Lipschitz rule can reach from the seed with an $\epsilon$ margin: $R_\epsilon(S)=S\cup\{x\in D:\ \exists z\in S,\ f(z)-\epsilon-Ld(z,x)\ge h\}$, applied repeatedly until nothing is added; the result is $\bar R_\epsilon(S_0)$. A safe point separated from the seed by an unsafe gap is never reached. The time $t^\ast$ comes from a sample-complexity bound proved in Module 4; the safety statement above does not need it.
The Trimpe-group thesis: a guarantee is only as good as its assumptions, so prefer assumptions a user can check. The recurring premises, sorted by whether an engineer can verify them:
| Assumption | Where it appears | Can a user check it? |
|---|---|---|
| known dynamics $f,g$, or a nominal model plus a disturbance set $W$ | CBF, HJ, robust and tube MPC, predictive safety filters | partly: physics and identification, with explicit uncertainty margins |
| Lipschitz constant $L$ of the unknown function | SafeOpt, SafeMDP, LoSBO, Berkenkamp 2017 | plausibly: rate limits, actuator bandwidth, physical gradient bounds |
| noise bound $E$ (LoSBO) or sub-Gaussian parameter $R$ (see Primer C) | LoSBO, GP confidence bounds | only with a justified sensor specification or physical model (for $E$) or distributional model (for $R$); measurements can refute a proposed bound but never prove that larger errors are impossible |
| RKHS-norm bound $\|f\|_k\le B$ for a known kernel | GP-UCB, SafeOpt, Real-$\beta$-SafeOpt, GP-based safe MBRL | no: such a bound "at the moment appears to be impossible to derive from reasonable prior knowledge in practically relevant scenarios" (Fiedler et al., TMLR 2024) |
| non-empty safe seed $S_0$ / backup controller | SafeOpt family, GoSafe, safety filters | yes: a conservative default controller |
| calibration and test data jointly exchangeable; i.i.d. scenarios | conformal prediction, scenario approach | only if the deployment distribution matches; shift silently breaks it |
| exact weights, and activations that satisfy a valid quadratic constraint: componentwise slope restriction for the original LipSDP, other activation-specific QCs (GroupSort, MaxMin, Householder) in its extensions | LipSDP and the SDP certificates built on it | yes, by construction of the network |
| a simulator faithful enough that training violations are acceptable | constrained deep RL | rarely quantified |
4. Who's Who
The section is organised around two lenses, Sebastian Trimpe's group (safe exploration and learning-based control with checkable guarantees) and Patricia Pauli's work (certified neural networks via SDP and dissipativity), embedded in the wider community. Positions are as of September 2026; Trimpe's and Pauli's were verified against their institutional pages, the others follow the references cited. Landmark papers are linked in the timeline and the Key Papers table.
| Who | Where | Themes | Landmarks here | Modules |
|---|---|---|---|---|
| Sebastian Trimpe (DSME) | Full Professor and head of the Institute for Data Science in Mechanical Engineering (DSME), RWTH Aachen, since 2020; one of the two Executive Directors of the RWTH AI Center (with Holger Hoos) since 2023; formerly Max Planck Research Group Leader (Intelligent Control Systems) at the MPI for Intelligent Systems | learning-based control with guarantees: safe BO, rigorous GP bounds, viability-based safe RL, event-triggered learning, approximate MPC, uncertainty-aware model-based RL | Marco 2016; Fiedler 2021; Massiani 2023; Fiedler 2024; UPSi 2026 | 3–7 |
| Patricia Pauli | Assistant Professor, Control Systems Technology, Dept. of Mechanical Engineering, TU Eindhoven (since Oct 2025); PhD 2019–2025 at IST, University of Stuttgart, with Frank Allgöwer; research stay in Sydney 2022 | safe AI-based control for high-tech systems: Lipschitz-bounded networks via SDP and dissipativity, LMI certificates for NN controllers, CNN parameterizations | Pauli 2021 (CDC), 2022 (L-CSS), 2024 (ICLR); LipKernel 2026 | 12–14 |
| Frank Allgöwer | IST, University of Stuttgart | MPC, data-driven control, NN certification (Pauli's advisor) | co-author of the Pauli papers and of Hertneck et al. 2018 with Trimpe | 11–14 |
| Carsten Scherer | University of Stuttgart | IQCs, robust control, LMIs | Fiedler, Scherer & Trimpe 2021 | 2, 3, 11, 14 |
| Andreas Krause (LAS) | ETH Zürich | GP bandits, SafeOpt, SafeMDP, GoSafeOpt | Srinivas 2010; Sui 2015; Turchetta 2016; Berkenkamp 2017; Sukhija et al. 2023 | 3–6, 11 |
| Melanie Zeilinger (IDSC) | ETH Zürich | predictive safety filters, learning-based MPC | Wabersich & Zeilinger 2021; Hewing et al. 2020 | 10, 11 |
| Aaron Ames | Caltech | control barrier functions | Ames, Grizzle & Tabuada 2014; Ames et al. 2017, 2019 | 10 |
| Claire Tomlin / Jaime Fisac | UC Berkeley / Princeton | HJ reachability, safety filters, reachability via RL | Mitchell et al. 2005; Fisac et al. 2019 | 10 |
| Angela Schoellig | TU Munich (Humboldt Professor, since 2022); also UTIAS, University of Toronto | safe learning in robotics, benchmarks | Berkenkamp 2017; Brunke 2022 | 4, 11 |
| Ian Manchester & Ruigang Wang | University of Sydney | RENs, Sandwich layers, LipKernel co-authors | Wang & Manchester 2023; Revay et al. 2024 | 13 |
| Bin Hu | UIUC | LipSDP extensions, control-theoretic ML | co-author of Pauli et al. ICLR 2024 | 12 |
| Mahyar Fazlyab | Johns Hopkins (formerly UPenn) | LipSDP, DeepSDP | Fazlyab 2019; Fazlyab et al. 2022 | 12, 15 |
| Dominik Baumann | Aalto University | GoSafe, safe RL in uncertain contexts, lightweight safe learning | GoSafeOpt 2023 | 6 |
| Christian Fiedler | TU Munich (Munich Center for Machine Learning); formerly RWTH Aachen (DSME) | rigorous GP bounds, LoSBO | Fiedler 2021, 2024 | 3, 5 |
au:Trimpe AND au:Pauli returns zero results and Crossref lists no shared publication. The two lenses are linked only indirectly: (i) shared co-authors, Johannes Köhler (with Pauli at L4DC 2021; with Trimpe on Hose et al., TCST 2025, and Tokmak et al., TAC 2025) and Frank Allgöwer (Hertneck, Köhler, Trimpe & Allgöwer, L-CSS 2018); (ii) the Stuttgart/Tübingen MPI-IS and IMPRS-IS ecosystem, where Trimpe led a Max Planck research group (he moved to RWTH Aachen in 2020) and Pauli was an IMPRS-IS doctoral scholar from 2019; (iii) the shared topic of certified neural-network approximations of MPC (Module 11).5. Timeline of Landmark Papers
Twenty-two landmarks coloured by tradition (colours as in the module map); vertical spacing is proportional to time except where labels would overlap. Each label links to the paper.
Three phases: until about 2013 the ingredients mostly lived apart, certificates (barriers, HJ reachability) on the control side and confidence bounds (GP-UCB) on the learning side, with only early combinations such as learning-based MPC that keeps its safety from the nominal model (Aswani et al. 2013) and reachability supervisors with disturbance bounds learned online (Gillula & Tomlin, RSS 2012); between 2014 and 2019 each tradition produced its template (CBF-QP filters, SafeOpt and SafeMDP, CPO and the zero-duality-gap result, LipSDP); since 2020 the work has been about making the templates honest and scalable: rigorous yet usable GP bounds, PID multipliers (see Primer D), predictive filters, direct Lipschitz parameterizations, and, from the Trimpe group, the demonstration that SafeOpt's practical variants had left their guarantees behind.
6. Notation for This Section
Every module defines its symbols on first use; this table is the shared reference. Where the traditions collide we keep each tradition's convention inside its own modules and flag the clash.
| Area | Symbol | Meaning |
|---|---|---|
| RL | $s\in\mathcal S$, $a\in\mathcal A$, $\pi_\theta$ | state, action, parametrised policy |
| $r$, $c$, $\gamma$ | reward, cost, discount factor | |
| $V^\pi$, $Q^\pi$, $A^\pi$ | value, action-value, advantage | |
| $V_c^\pi$, $Q_c^\pi$, $A_c^\pi$ | the same for the cost | |
| $J_c(\pi)\le d$, $\lambda\ge0$ | expected discounted cost constraint with budget $d$; Lagrange multiplier | |
| $\rho_\pi$ (or $d_\pi$) | discounted occupancy measure | |
| Control | $x\in X$, $u\in U$ | state, input |
| $x_{t+1}=f(x_t,u_t)$; $\dot x=f(x)+g(x)u$ | discrete dynamics; continuous control-affine dynamics | |
| $C=\{x:h(x)\ge0\}$, $h$ | safe set and barrier function | |
| $V(x)$, $\alpha(\cdot)$ | Lyapunov function; class-$\mathcal K$ (or extended class-$\mathcal K$) function | |
| $L$ | Lipschitz constant | |
| GP / safe BO | $f:D\to\mathbb R$, $h$ | unknown function; safety threshold, $f(x)\ge h$ is safe (SafeOpt convention) |
| $k$, $\mathcal H_k$, $\|f\|_k\le B$ | kernel, RKHS, norm bound. $B$ bounds the norm; Srinivas et al. and SafeOpt write $\|f\|_k^2\le B$ with $\beta_t^{1/2}$, which we translate explicitly | |
| $\mu_t$, $\sigma_t$ | GP posterior mean and standard deviation after $t$ data | |
| $\lambda$ in $(K_t+\lambda I)^{-1}$; $\sigma_n^2$ | regularisation parameter; the physical noise variance when they differ | |
| $\beta_t$, band $\mu_{t-1}\pm\beta_t\sigma_{t-1}$ | confidence scaling (Chowdhury–Gopalan convention); the band before query $t$, from the posterior after $t-1$ data | |
| $\gamma_t$ | maximum information gain (never the discount in BO modules) | |
| $S_t$, $G_t$, $M_t$, $l_t(x)$, $u_t(x)$ | safe set, expanders, maximisers, lower and upper confidence bounds | |
| $E$ | hard noise bound (LoSBO) | |
| Neural networks | $W_i$, $b_i$, $\varphi$ | layer weights, biases, activation |
| $\varphi$ slope-restricted in $[\alpha,\beta]$ | LipSDP convention: $\alpha\le\frac{\varphi(a)-\varphi(b)}{a-b}\le\beta$ | |
| $L$, $\rho=L^2$ | Lipschitz constant; LipSDP's decision variable is the square (LipKernel uses $\rho$ for $L$ itself) | |
| $T=\mathrm{diag}(\lambda_i)\succeq0$ | diagonal multiplier ($\lambda_i\ge0$; $\succeq$: Primer A) of the incremental quadratic constraint, a quadratic inequality satisfied by the input and output increments of every slope-restricted activation (Module 2) | |
| $M\preceq0$ | the LMI certificate: a symmetric matrix affine in the decision variables $z$, $M(z)=M_0+\sum_iz_iM_i$, with $v^{\top}M(z)v\le0$ for every vector $v$; an SDP optimizes a linear objective subject to such constraints (Module 2) | |
| $V$, $s(w,z)$, $(Q,S,R)$ | storage function $V\ge0$, supply rate, QSR dissipativity matrices: for input $w$ and output $z$, $V(x_{t+1})-V(x_t)\le s(w_t,z_t)$ (stored energy grows at most by the supplied energy), with $s(w,z)=z^{\top}Qz+2z^{\top}Sw+w^{\top}Rw$ (Module 2) |
- $h$: SafeOpt's safety threshold ($f\ge h$) versus the barrier function ($C=\{h\ge0\}$); Modules 4–6 use the first (Module 6 also writes $h$ for GoSafe’s GP selector function and says so there), 10–11 the second.
- $\gamma$: discount factor (RL) versus information gain $\gamma_t$ (BO) versus the $\ell_2$-gain bound of dissipativity (Module 2).
- $\beta$: confidence scaling $\beta_t$ (BO) versus the upper slope bound in $[\alpha,\beta]$ (LipSDP); also Altman's initial law.
- $\alpha$: class-$\mathcal K$ function (CBF), CVaR level, lower slope bound (LipSDP), Altman's discount.
- $\lambda$: Lagrange multiplier (CMDP), GP regularisation, entries of LipSDP's $T=\mathrm{diag}(\lambda_i)$.
- $B$: bound on $\|f\|_k$ (this section, Chowdhury–Gopalan) or on $\|f\|_k^2$ (Srinivas et al., SafeOpt); $\beta_t$ versus $\beta_t^{1/2}$ changes with it.
- $S_t$, $G_t$, $M_t$: SafeOpt's safe set, expanders and maximisers (Modules 4–6) versus, in the confidence-bound proofs of Module 3, the noise-weighted feature sum, the realised information gain and the supermartingale.
- $d$: CMDP budget versus the metric $d(x,x')$ in SafeOpt's safe-set update.
- $V$: value function (RL), Lyapunov function (control), storage function (dissipativity).
- $\rho$: occupancy measure (RL), $L^2$ (LipSDP), $L$ (LipKernel), risk $\rho(x,u)$ (Safe Value Functions).
- $\delta$: failure probability, CLF-relaxation slack in CLF-CBF QPs (slack variables: Primer B), input perturbation in robustness.
Interactive: Constraint Semantics
One stochastic system, one policy, four verdicts. The scalar system $x_{t+1}=x_t+u_t+w_t$, $w_t\sim\mathcal N(0,\sigma^2)$ (seeded, so results reproduce), is driven by $u_t=-k\,(x_t-x_{\rm goal})$ towards $x_{\rm goal}=0.8$, right next to the boundary $x\le1$ of the safe set $C=(-\infty,1]$, from $x_0=0$.
The explorer simulates 200 episodes of length $T$ (Monte Carlo: Primer C) and evaluates, for the same policy: the expected number of violating steps $\mathbb E[N]$ (CMDP view, cost $c_t=\mathbf 1\{x_t\gt1\}$, budget $d$); the probability that an episode ever violates (chance view, level $\delta$); $\operatorname{CVaR}_\alpha$ of the signed maximum excursion $Z=\max_t(x_t-1)$ (risk view, must be $\le0$); and whether every sampled episode stayed inside (hard view).
The CMDP verdict uses the exact $\mathbb E[N]$ from the Gaussian marginals of the linear system (Exercise 1.5), with the sample mean shown as a cross-check; the other three verdicts are estimates from the 200 episodes. The same 200 noise sequences are reused when a slider moves (only "Resample noise" draws new ones), so every change you see is caused by the policy, the horizon or the question, not by new noise.
The noise is independent across time and across episodes (Exercise 1.5 writes the same noise as $\sigma w_t$ with $w_t\sim\mathcal N(0,1)$). States within one episode can be dependent because later states carry earlier noise. With $\sigma\gt0$, only at $k=1$, where $x_{t+1}=0.8+w_t$, are the states after time zero independent; then, with per-step violation probability $p$, an episode violates at least once with probability $1-(1-p)^T$. With $\sigma=0$ the hard verdict checks the single trajectory from $x_0=0$ up to time $T$ exactly, but certifies neither other initial states nor later times: with $k=1.1$ the state $x=-10\in C$ maps to $x^+=(1-k)x+0.8k=1+0.88=1.88\gt1$, so $C=(-\infty,1]$ is not invariant even when the displayed trajectory passes.
The $\pm$ values are one estimated standard error (Primer C): $s_N/\sqrt{200}$ for the mean count, with $s_N$ the sample standard deviation of $N$ over the 200 episodes, and $\sqrt{\widehat p(1-\widehat p)/200}$ for the observed failure fraction $\widehat p$. They are not confidence intervals, and they are $0$ when no episode fails, although zero failures in 200 independent episodes does not prove $p=0$: the exact one-sided 95% upper bound is the $p$ with $(1-p)^{200}=0.05$, i.e. $1-0.05^{1/200}\approx0.0149$. The chance, risk and hard badges compare sample statistics with thresholds (SAMPLE PASSES / SAMPLE FAILS); only the CMDP badge uses the analytical expectation, evaluated numerically.
A stationary distribution (Primer C) is a probability law that one update of the system leaves unchanged. Here $x_{t+1}-0.8=(1-k)(x_t-0.8)+w_t$, so $x_t\sim\mathcal N(0.8,v)$ gives $x_{t+1}\sim\mathcal N(0.8,(1-k)^2v+\sigma^2)$, the same law exactly when $v=\sigma^2/[1-(1-k)^2]=\sigma^2/[k(2-k)]$. For $0\lt k\lt2$ the law of $x_t$ converges to this stationary law (Exercise 1.5); its standard deviation is the stationary spread and the initial approach is the transient. With $\sigma\gt0$ the states keep fluctuating: stability of the recursion does not mean that the sample path settles at $0.8$, and "removes the error in one step" at $k=1$ refers to the deterministic part of the error.
From the mathematics to a real decision
Learning objectives
- Translate a request for safety into a constrained quantity, horizon, and uncertainty statement.
- Distinguish a temperature average from a probability of overheating and from robust invariance.
- Choose evidence that addresses the requested guarantee before choosing an algorithm.
A commissioning decision
A hypothetical laboratory is commissioning a small heated robot enclosure. A batch lasts six minutes. The components must remain at or below $60\,{}^\circ\mathrm C$ throughout a batch. An engineer proposes optimizing the mean of the batch's peak temperature. Another proposes requiring a small probability of any overheating. These are different commissioning specifications, even though both use the same temperature sensor.
For a deliberately simple comparison, assume the peak temperature $Z$ has a known distribution under each fixed schedule. Schedule A produces $58\,{}^\circ\mathrm C$ with probability 0.9 and $68\,{}^\circ\mathrm C$ with probability 0.1; schedule B always produces $59\,{}^\circ\mathrm C$. These numbers define a teaching model, rather than measurements. All variability is represented by this distribution; sensor bias, changing loads, and actuator faults are excluded.
A separate model describes minute-by-minute operation: $T_t$ is temperature in degrees Celsius, $u_t\in[0,12]$ is heater power in kilowatts, and $w_t\in[-1,1]$ is the net disturbance contribution in degrees Celsius during one minute. Assume the update below holds exactly for every admissible disturbance and that power changes occur at the sample times. This second model supports a different kind of evidence.
Worked decision, with its limits
First, name the requested event. Write $E=\{Z\gt60\}$ for overheating at any time during a batch. The expected peaks are $0.9(58)+0.1(68)=59$ for A and $59$ for B. A mean-peak budget of 60 accepts both. Nevertheless, $\mathbb P(E)$ is 0.1 for A and zero for B. Thus a 1% batch-overheating budget rejects A. Averaging the peak already includes the time maximum, but expectation still averages across batches.
Next, translate a repeated-use promise. Suppose six batches each have overheating probability at most 0.01. Without assuming independence, the union bound guarantees only that all six avoid overheating with probability at least $1-6(0.01)=0.94$. Under independence the lower bound becomes $0.99^6\approx0.94148$. Neither reaches 0.99. Allocating $0.01/6$ to each batch is sufficient for a 99% six-batch promise without independence. Shared sensor errors make independence particularly questionable.
Finally, examine a universal claim. The offset 4 is the ambient contribution in degrees Celsius per update; the power coefficient has units degrees Celsius per kilowatt. For $T_t\in[15,60]$, monotonicity in all three variables gives a smallest next temperature $0.8(15)+4-1=15$ and a largest $0.8(60)+4+0.5(12)+1=59$. Therefore this entire interval is invariant for every allowed input and disturbance. Induction extends the one-step calculation to every integer sample time.
The conclusion concerns the stated sampled model. It does not establish a temperature bound between samples, and it fails to cover disturbances outside the assumed interval. The lower endpoint also matters: saying only that the upper temperature decreases would not prove invariance of a two-sided operating range. The appropriate commissioning decision is to select B for the distributional batch specification, or to use the invariant-set argument for a requirement that actually matches the sampled thermal model.
A tempting wrong approach
Reporting “both schedules average 59 degrees” discards precisely the rare hot batches the component specification forbids. Conversely, the robust sampled calculation cannot be presented as a 99% empirical reliability estimate: it contains no probability distribution or observed failure frequency. A certificate should retain its original quantifiers when it is summarized for a colleague.
Transfer the argument
Exercise 1.B1 — Medium: Budget a fleet demonstration
Twenty robot enclosures each run one batch. Require probability at least 0.95 that none overheats. Give an equal per-enclosure risk budget sufficient without independence. What bound follows if the events are independent?
Review: Chance constraints and joint events.
Show hint
Allocate the total failure budget 0.05 across twenty events. Independence multiplies success probabilities instead.
Show worked solution
Use $\delta_i=0.05/20=0.0025$. The union bound gives failure probability at most $\sum_i\delta_i=0.05$. If the events are independent, joint success is at least $0.9975^{20}\approx0.95117$. The slightly stronger independent bound does not justify assuming independence when a common sensor calibration can affect every enclosure.
Exercise 1.B2 — Hard: A rare spike changes the chosen specification
A third schedule has peak $59\,{}^\circ\mathrm C$ with probability 0.98 and $109\,{}^\circ\mathrm C$ otherwise. Compare a mean-peak cap of 60, a 1% overheating cap, and a $\operatorname{CVaR}_{0.95}$ cap of 75 degrees.
Review: CVaR and its tail convention.
Show hint
The worst 5% includes all of the 2% hot outcomes and another 3% of the ordinary outcomes.
Show worked solution
The mean is $0.98(59)+0.02(109)=60$, so the mean cap accepts. Overheating probability is 0.02, so the chance constraint rejects. The worst-five-percent average is $[0.02(109)+0.03(59)]/0.05=79$, so the CVaR cap also rejects. The point mass at 59 must be split to fill the tail; conditioning only on outcomes strictly above 59 would incorrectly return 109. Neither rejection is a contradiction: the three specifications constrain different objects.
Synthesis and bridge
The first design artifact should be a sentence specifying what must stay within a limit, for how long, from which initial conditions, and under which randomness or disturbances. The thermal plant, the robot controller, and its learned sensor model can each require different sentences. A bound on one component is useful only after an argument connects it to the final requirement.
The next toolkit chapter turns a dynamical requirement into an inequality that can be checked for an entire set of states. The GP chapter then asks how a model bound can remain meaningful when the quantities needed by that inequality are learned from noisy measurements.
Exercises
Graded practice — Build the argument yourself
There are 12 new problems: four Easy, four Medium, and four Hard. Start with the level that lets you make progress without opening the solution. Easy problems rebuild individual operations; Medium problems combine them; Hard problems ask for proofs, boundary cases, and the limits of a guarantee. The required concepts are explained on this page or in the linked earlier material.
Easy — Warm up one skill at a time.
Exercise 1.P1 — Easy: Read a safe set
For the scalar state $x$, let $h(x)=4-x^2$ and $C=\{x:h(x)\ge0\}$. Write $C$ as an interval. Are $x=-2$, $x=1.5$, and $x=3$ safe? Does knowing that $x_0\in C$ alone prove that later states stay safe?
Review if needed: Primer 0: sets and inequalities. Apply here: this module's explanation.
Show hint
Solve $x^2\le4$; then distinguish a property of one state from a property of a trajectory.
Show worked solution
$4-x^2\ge0$ is equivalent to $x^2\le4$, hence $|x|\le2$ and $C=[-2,2]$. The boundary is included because the inequality is non-strict. At the three states, $h(-2)=0$, $h(1.5)=1.75$, and $h(3)=-5$, so the first two are safe and the third is unsafe.
A safe starting state gives only the base case. For instance, the dynamics $x_{t+1}=x_t+3$ take the safe state $x_0=0$ to $x_1=3$, outside $C$. Forward invariance requires a statement about the dynamics and controller at every safe state, not just membership of the initial state.
Exercise 1.P2 — Easy: Averages of indicator costs
Let $N$ count unsafe steps in one episode. Suppose $N=0$ with probability $0.9$ and $N=5$ with probability $0.1$. Compute $\mathbb E[N]$ and the probability of any violation. Which constraints pass: $\mathbb E[N]\le0.6$ and $\Pr(N\ge1)\le0.05$?
Review if needed: Primer C: expectations and indicators. Apply here: this module's explanation.
Show hint
Multiply each count by its probability. For the chance constraint, count episodes with any unsafe step once.
Show worked solution
$\mathbb E[N]=0(0.9)+5(0.1)=0.5$, so the expected-cost constraint passes. The event $\{N\ge1\}$ occurs exactly when $N=5$, giving probability $0.1$; it exceeds $0.05$, so the chance constraint fails.
The expectation counts unsafe steps, while the chance constraint counts unsafe episodes. Here one in ten episodes has five violations. Neither number tells us their physical severity; a separate magnitude-based cost would be needed for that.
Exercise 1.P3 — Easy: One-step versus joint confidence
There are four monitored steps. At each step the failure probability is at most $0.01$. Give a guaranteed lower bound on the probability that all four steps are safe. Is independence needed?
Review if needed: Primer C: union bounds. Apply here: this module's explanation.
Show hint
The complement of “all safe” is the union of the four failure events.
Show worked solution
Let $F_t$ be failure at step $t$. The union bound gives $\Pr(\bigcup_{t=1}^4F_t)\le\sum_{t=1}^4\Pr(F_t)\le0.04$. Taking complements yields $\Pr(\text{all four safe})\ge0.96$.
No independence is needed, so this remains valid for dependent states in one trajectory. Under the additional assumption of independent failures with probability exactly $0.01$, the exact safe probability would be $0.99^4=0.96059601$. Without that assumption, multiplying the four probabilities is unjustified.
Exercise 1.P4 — Easy: Translate notation across traditions
A control paper writes $x_{t+1}=f(x_t,u_t)$ and $u_t=\pi(x_t)$. An RL paper uses state $s_t$, action $a_t$, and policy $\pi$. Translate the deterministic closed-loop update into RL notation. What extra object is needed for stochastic transitions?
Review if needed: Primer E: states, actions and policies. Apply here: this module's explanation.
Show hint
The different letters describe the same roles; randomness changes a map into a conditional distribution.
Show worked solution
Replace $x_t$ by $s_t$ and $u_t$ by $a_t$. Then $a_t=\pi(s_t)$ and $s_{t+1}=f(s_t,\pi(s_t))$. The function $f$ here is a transition map, rather than the unknown performance function called $f$ in BO.
A stochastic model needs a transition distribution $P(\cdot\mid s,a)$: the next state is sampled from $P(\cdot\mid s_t,a_t)$. If the policy is stochastic too, the action is sampled from $\pi(\cdot\mid s_t)$. A safety probability must specify whether it averages over transitions, actions, initial states, learned data, or several of these.
Medium — Combine definitions and compute a certificate.
Exercise 1.P5 — Medium: Allocate a trajectory risk budget
A 20-step task has total allowed failure probability $\delta=0.02$. Choose equal per-step budgets that suffice by the union bound. If instead every step receives budget $0.02$, what run-wide bound follows?
Review if needed: Primer C: simultaneous probability statements. Apply here: this module's explanation.
Show hint
Add the budgets before taking the complement.
Show worked solution
Equal budgets $\delta_t=0.02/20=0.001$ satisfy $\sum_{t=1}^{20}\delta_t=0.02$, hence joint safety has probability at least $0.98$. This is a sufficient allocation; dependence may make it conservative.
If each step gets $0.02$, the sum is $0.4$, so the bound becomes only $\Pr(\text{all safe})\ge0.6$. Reusing a full run-wide budget at every step changes the guarantee. No independence assumption repairs the arithmetic of the union bound; independence would allow a different calculation if its hypotheses were justified.
Exercise 1.P6 — Medium: Compute a tail risk with an atom
The nonnegative episode cost $Z$ is 0 with probability $0.8$, 2 with probability $0.15$, and 10 with probability $0.05$. Compute its mean, $\operatorname{VaR}_{0.9}$, and $\operatorname{CVaR}_{0.9}$, using the confidence-level convention.
Review if needed: Primer C: quantiles and CVaR. Apply here: this module's explanation.
Show hint
The worst 10% contains all the cost-10 outcomes and only part of the cost-2 outcomes.
Show worked solution
The mean is $0(0.8)+2(0.15)+10(0.05)=0.8$. Since $\Pr(Z\le0)=0.8$ and $\Pr(Z\le2)=0.95$, the lower 90% quantile is $\operatorname{VaR}_{0.9}=2$.
The worst 10% consists of the 5% mass at 10 and another 5% drawn from the atom at 2. Thus $\operatorname{CVaR}_{0.9}=[0.05(10)+0.05(2)]/0.1=6$. Equivalently, the variational formula at $\nu=2$ gives $2+10\,\mathbb E[(Z-2)^+]=2+10(0.05)(8)=6$. Averaging all outcomes satisfying $Z\ge2$ would average 20% of the distribution and give the wrong tail size.
Exercise 1.P7 — Medium: Stability and constraints answer different questions
For $x_{t+1}=x_t/2$ with equilibrium 0, compare the constraints $C_1=[-1,1]$ and $C_2=[1,2]$. Is each set invariant? Does the system converge to 0 from $x_0=2$? Explain why convergence alone does not establish either constraint.
Review if needed: Primer D: stability and invariant sets. Apply here: this module's explanation.
Show hint
Compute the image of each interval under multiplication by $1/2$.
Show worked solution
The image of $C_1$ is $[-0.5,0.5]\subseteq C_1$, so $C_1$ is invariant. The image of $C_2$ is $[0.5,1]$, which is not a subset of $C_2$; for example, $x_0=1$ leaves at the first step.
From $x_0=2$, $x_t=2^{1-t}\to0$, so convergence holds. Nevertheless that initial state is already outside $C_1$, and the trajectory eventually leaves $C_2$. Stability concerns behavior near an equilibrium; a state constraint concerns a specified set. They coincide only when an additional invariant-set argument connects them.
Exercise 1.P8 — Medium: A robustness radius in numbers
A classifier has logit margin $M(x)=0.6$ and its vector of logits is $L$-Lipschitz in Euclidean norm with $L=2$. Compute the certified radius $M(x)/(\sqrt2L)$. Are perturbation norms $0.2$ and $0.22$ certified? What does failure to certify mean?
Review if needed: Primer A: norms and Cauchy–Schwarz. Apply here: this module's explanation.
Show hint
Evaluate the radius, and remember that the theorem uses a strict inequality.
Show worked solution
The radius is $0.6/(2\sqrt2)\approx0.212132$. Thus every perturbation of norm $0.2$ is certified to keep the label, while a perturbation of norm $0.22$ is outside this guarantee. At the radius itself the lower bound on a competing logit gap is zero, so the strict-label guarantee does not include the boundary.
Outside the radius, a label change is possible under the bound but not proved to happen. The certificate is a sufficient condition. It describes the classifier at this input; obtaining a guarantee for the controlled system still requires connecting prediction error to the system dynamics.
Hard — Explain why the argument works and where it stops.
Exercise 1.P9 — Hard: Negate the viability quantifiers
In a deterministic system, state $x$ is viable when there exists an admissible controller $u$ such that for all times $t$, the trajectory $\varphi_x^u(t)$ avoids the failure set $X_F$. Negate this statement. Explain why “some controller eventually fails” is not its negation.
Review if needed: Primer 0: quantifiers and negation. Apply here: this module's explanation.
Show hint
Negating an existential quantifier gives a universal one, and vice versa.
Show worked solution
Write viability as $\exists u\ \forall t:\varphi_x^u(t)\notin X_F$. Its negation is $\forall u\ \exists t:\varphi_x^u(t)\in X_F$: every controller eventually fails, with the failure time allowed to depend on the controller.
“Some controller eventually fails” is $\exists u\ \exists t:\varphi_x^u(t)\in X_F$. It can hold even at a viable state: one controller may steer into a wall while another brakes safely. Viability asks whether at least one safe continuation exists, rather than whether all available behaviors are safe.
Exercise 1.P10 — Hard: Why a discounted budget can hide certain failure
A deterministic trajectory is safe until time 50 and unsafe at every integer time $t\ge50$. With discount $\gamma=0.9$ and indicator cost $c_t$, compute $\sum_{t\ge0}\gamma^tc_t$. Does it pass budget $0.1$? What is the probability of eventual failure?
Review if needed: Primer 0: geometric series. Apply here: this module's explanation.
Show hint
Factor out $\gamma^{50}$ and sum the remaining geometric series.
Show worked solution
The cost is $\sum_{t=50}^{\infty}0.9^t=0.9^{50}/(1-0.9)\approx0.0515378$, so the discounted-cost budget $0.1$ passes. Yet failure occurs with probability 1, because the trajectory is deterministic and leaves the safe set at time 50.
The discount shrinks late violations; it does not make them less certain. This example is also why the horizon and the meaning of the cost must be part of a safety statement. An undiscounted count here is infinite, and a joint infinite-horizon chance constraint with failure budget below 1 fails.
Exercise 1.P11 — Hard: A finite experiment is not an invariant-set proof
Consider $x_{t+1}=x_t+0.01$ from $x_0=0$, with safe set $C=(-\infty,1]$. An experiment checks only times 0 through 100 and sees no violation. Determine the first violating time. State exactly what the experiment establishes and what an invariance claim would additionally require.
Review if needed: Primer D: trajectories and state updates. Apply here: this module's explanation.
Show hint
Unroll the recurrence, paying attention to whether the boundary is safe.
Show worked solution
Induction gives $x_t=0.01t$. At time 100, $x_{100}=1\in C$; at time 101, $x_{101}=1.01\notin C$. Therefore the first violation is at time 101.
The experiment establishes safety of the checked trajectory over the finite checked horizon, under the experiment's model and conditions. Forward invariance of $C$ would require every initial state in $C$ to remain in $C$ for all subsequent times. It already fails at $x=1$, whose successor is 1.01. Even exact measurements of many safe finite trajectories cannot replace the missing universal argument.
Exercise 1.P12 — Hard: Prove a robust invariant interval
For $x_{t+1}=0.5x_t+w_t$ with every disturbance satisfying $|w_t|\le0.1$, find the smallest radius $r\ge0$ such that $[-r,r]$ is robustly invariant. Give the induction argument, including its base case.
Review if needed: Primer A: triangle inequality. Apply here: this module's explanation.
Show hint
The worst successor magnitude is $0.5r+0.1$. Require this to be at most $r$.
Show worked solution
If $|x_t|\le r$, the triangle inequality gives $|x_{t+1}|\le0.5|x_t|+|w_t|\le0.5r+0.1$. This is at most $r$ exactly when $r\ge0.2$. Necessity follows by choosing $x_t=r$ and $w_t=0.1$, so no smaller centered interval works.
For $r=0.2$, assume the initial state satisfies $|x_0|\le0.2$ (the base case). If $|x_t|\le0.2$, the preceding estimate gives $|x_{t+1}|\le0.2$ (the inductive step). Thus the interval is invariant for every allowed disturbance sequence. The result is deterministic under the stated disturbance bound; no distribution or confidence parameter is involved.
Further practice — Original problems and research connections
The original exercises below retain their numbering. Some compare later methods or ask for longer research derivations; use the graded set above first, and return to a research-connection problem after reading the relevant linked module.
Key Papers
| Paper | Venue | Contribution | Why read it |
|---|---|---|---|
| Brunke, Greeff, Hall, Yuan, Zhou, Panerati & Schoellig, Safe Learning in Robotics: From Learning-Based Control to Safe Reinforcement Learning | Annu. Rev. Control Robot. Auton. Syst. 5, 2022 | unifies safe learning control and safe RL; Level I/II/III taxonomy; safe-control-gym | the best single entry survey; its taxonomy maps onto (c)/(b)/(a) |
| Fiedler, Menn, Kreisköther & Trimpe, On Safety in Safe Bayesian Optimization | TMLR 2024 | why SafeOpt implementations lose their guarantees; Real-$\beta$-SafeOpt, LoSBO, LoS-GP-UCB | the thesis of this section: guarantees need checkable assumptions |
| Wabersich, Taylor, Choi, Sreenath, Tomlin, Ames & Zeilinger, Data-Driven Safety Filters: Hamilton-Jacobi Reachability, Control Barrier Functions, and Predictive Methods for Uncertain Systems | IEEE Control Systems Magazine 43(5), 2023 | HJ, CBF and predictive filters as approximations of one ideal minimally invasive filter | the control tradition in one tutorial |
| García & Fernández, A Comprehensive Survey on Safe Reinforcement Learning | JMLR 16(42), 2015 | the two-branch taxonomy: optimality criterion versus exploration process | historical baseline of the RL view |
| Altman, Constrained Markov Decision Processes | Chapman & Hall/CRC, 1999 | occupation-measure LPs, Lagrangian duality, optimal stationary randomised policies | the reference for formalisation (c) |
| Achiam, Held, Tamar & Abbeel, Constrained Policy Optimization | ICML 2017 | trust-region policy search for CMDPs with per-iteration guarantees | fixes the deep-RL CMDP notation used here |
| Chow, Ghavamzadeh, Janson & Pavone, Risk-Constrained Reinforcement Learning with Percentile Risk Criteria | JMLR 18(167), 2018 | chance- and CVaR-constrained MDPs; Lagrangian gradients with the VaR parameter | formalisation (d) and the $\alpha$ convention |
| Ames, Xu, Grizzle & Tabuada, Control Barrier Function Based Quadratic Programs for Safety Critical Systems | IEEE TAC 62(8), 2017 | reciprocal and zeroing CBFs, the CLF-CBF QP, Lipschitz continuity of the QP controller | the deterministic invariance theorem quoted above |
| Massiani, Heim, Solowjow & Trimpe, Safe Value Functions | IEEE TAC 68(5), 2023 | when failure penalties give safe and optimal value functions; the finite threshold and its $e^{T_f/\tau}$ scaling | formalisation (g) and the bridge from viability to RL |
| Sui, Gotovos, Burdick & Krause, Safe Exploration for Optimization with Gaussian Processes | ICML 2015 | SafeOpt: safe set from a seed, expanders and maximisers, safety w.h.p. | the safe-exploration template and its assumption list |
| Srinivas, Krause, Kakade & Seeger, Gaussian Process Optimization in the Bandit Setting: No Regret and Experimental Design | ICML 2010 (IEEE TIT 2012) | GP-UCB, $\beta_t$ and the information gain $\gamma_T$ | where the confidence machinery and the squared-norm convention come from |
| Berkenkamp, Turchetta, Schoellig & Krause, Safe Model-based Reinforcement Learning with Stability Guarantees | NeurIPS 2017 | safe = inside a certified region of attraction; GP plus Lipschitz discretisation | formalisation (e) as a learning problem |
| Fazlyab, Robey, Hassani, Morari & Pappas, Efficient and Accurate Estimation of Lipschitz Constants for Deep Neural Networks | NeurIPS 2019 | LipSDP: slope restriction as an incremental quadratic constraint, Lipschitz bound by SDP | entry point of the certified-model tradition (read with Pauli et al.'s correction) |
| Paternain, Chamon, Calvo-Fullana & Ribeiro, Constrained Reinforcement Learning Has Zero Duality Gap | NeurIPS 2019 | CMDPs have zero duality gap under Slater's condition | why Lagrangian methods are principled despite non-convexity |
The full atlas of verified papers for the section is in the Paper Atlas.