1. The Safe Learning Landscape

What "safe" means, the three research traditions, who works on what, and how to read this section

Before you start

This module assumes:

How to study this module

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.

Readiness check — Three prerequisite skills

Try these before opening the answer. The review links lead to earlier material.

  1. If $C=\{x:x^2\le1\}$, does $-1$ belong to $C$? Review sets and inequalities.
  2. If an indicator is 1 on an event of probability 0.2, what is its expectation? Review indicators and expectation.
  3. 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

Contents
1. What "Safe" Means 2. Three Traditions 3. Types of Guarantees 4. Who's Who 5. Timeline of Landmark Papers 6. Notation for This Section Interactive: Constraint Semantics Application lab & chapter review Exercises Graded practice: Easy, Medium & Hard Key Papers Flashcards

1. What "Safe" Means

Intuition — A starting example

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.

Definition — (a) Hard state constraints and forward invariance
$C\subseteq X$ is forward invariant under the closed loop $x_{t+1}=f(x_t,\pi(x_t))$ if $x_0\in C$ implies $x_t\in C$ for all $t\ge0$ (continuous time: $x(0)\in C\Rightarrow x(t)\in C$ for all $t\ge0$). The hard-constraint requirement is
$$x_t\in C\ \text{ and }\ u_t\in U\quad\text{for all } t\text{ and every disturbance sequence } w_t\in W,$$
the "Safety Level III" of Brunke et al., Annu. Rev. 2022, written there as $c^j_k(x_k,u_k,w_k)\le0$ for all times $k$ and indices $j$. Example: a manipulator never exceeds its joint limits for any payload in the specified range. Deterministic and worst-case over $W$; needs a model of $f$ and $W$.

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.

Definition — (b) Chance constraints
A joint (trajectory-level) chance constraint asks
$$\mathbb P\big(x_t\in C\ \ \forall t\in\{0,\dots,T\}\big)\ \ge\ 1-\delta,$$
a per-step one asks $\mathbb P(x_t\in C)\ge1-\delta_t$ for each $t$ (Brunke et al.'s Level II, $\Pr(c^j_k\le0)\ge p_j$ at each $k$). The union bound (Primer C) gives $\mathbb P(\exists t: x_t\notin C)\le\sum_t\delta_t$. Conversely, the joint constraint gives $\mathbb P(x_t\notin C)\le\delta$ at every single $t$, because $\{x_t\notin C\}\subseteq\{\exists s:x_s\notin C\}$; it does not give any smaller per-step budgets $\delta_t$. Always ask over which randomness: process noise (stochastic MPC, Primer D); the measurement noise seen by a learner (frequentist GP bounds: $f$ fixed, probability over the noise, jointly for all $t$; a Gaussian process models any finite set of unknown function values as jointly Gaussian, Module 3); a prior over $f$ (Bayesian bounds, Primer C); or the calibration data together with the fresh test point (conformal prediction: marginal coverage, which needs the calibration and test examples to be jointly exchangeable, Primer C; theorem below). Example: the quadrotor stays inside the flight cage in at least 99% of flights.
Theorem — Split-conformal marginal coverage (Angelopoulos & Bates 2023)

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

$$\mathbb P\{Y_{n+1}\in\widehat C(X_{n+1})\}\ge1-\delta.$$

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).

Definition — (c) Expected-cost constraints: the CMDP
A constrained MDP (Primer E) adds cost functions $c_i$ and budgets $d_i$ to an MDP and restricts the policy class (Altman, 1999; notation of Achiam et al., ICML 2017; $\operatorname{arg\,max}$: Primer B):
$$\pi^\star=\operatorname*{arg\,max}_{\pi}\ J(\pi)\quad\text{s.t.}\quad J_{c_i}(\pi)=\mathbb E_{\tau\sim\pi}\Big[\sum_{t=0}^{\infty}\gamma^t c_i(s_t,a_t,s_{t+1})\Big]\le d_i .$$
The constraint is an expectation over episodes of a discounted sum; single episodes may violate arbitrarily. Altman minimises a cost with discount $\alpha$ and initial law $\beta$; Paternain et al., NeurIPS 2019 maximise with reward-type constraints $V_i(\pi)\ge c_i$. We use the reward-max, cost-$\le d$ form everywhere. Example: Safety Gym's budget $d=25$: expected (undiscounted) cost per 1000-step episode, one unit for every step spent in a hazard or other unsafe contact (Ray, Achiam & Amodei, 2019).

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.

Definition — (d) Risk-sensitive constraints: CVaR
For an integrable cost $Z$ ($\mathbb E|Z|<\infty$; large is bad) and $\alpha\in(0,1)$, the conditional value-at-risk in the Rockafellar–Uryasev form used by Chow, Ghavamzadeh, Janson & Pavone, JMLR 2018 is
$$\operatorname{CVaR}_\alpha(Z)=\min_{\nu\in\mathbb R}\Big\{\nu+\frac{1}{1-\alpha}\,\mathbb E\big[(Z-\nu)^+\big]\Big\},$$
the average of the worst $(1-\alpha)$-fraction of outcomes: $\alpha\to1$ is the tail, $\alpha\to0$ recovers $\mathbb E[Z]$. A risk constraint reads $\operatorname{CVaR}_\alpha(\sum_t c_t)\le d$. Example: the 5% worst episodes must average fewer than $d$ contacts. It controls frequency and magnitude of bad episodes, which neither (b) nor (c) does alone (first walkthrough below, Step 5).
Caveat — two conventions for $\alpha$
Chow et al. (and this section) use $\alpha$ as the confidence level: the worst $1-\alpha$ fraction is averaged and $\alpha\to1$ is risk-averse. Their prose says "worst-case $\alpha$-fraction" while their formula, with $1/(1-\alpha)$, averages the worst $(1-\alpha)$-fraction; the formula is authoritative. WCSAC-type deep RL papers use $\alpha$ for the tail fraction, so there $\alpha\to0$ is risk-averse. Check the formula, not the words.
Definition — (e) Stability and regions of attraction
An equilibrium $x^\ast$ is asymptotically stable if it is Lyapunov stable (trajectories that start close to $x^\ast$ stay close) and attractive (Primer D); its region of attraction $\mathcal R$ is the set of initial states whose trajectories converge to $x^\ast$. A Lyapunov function (continuous, positive definite about $x^\ast$) certifies a subset: if the closed-loop map $F(x)=f(x,\pi(x))$ is continuous with $F(x^\ast)=x^\ast$ and $V(F(x))-V(x)\lt0$ for all $x\ne x^\ast$ in a compact sublevel set $\mathcal V(c)=\{x:V(x)\le c\}$ (compact means closed and bounded in $\mathbb R^n$, Primer 0), then $\mathcal V(c)$ is forward invariant and $\mathcal V(c)\subseteq\mathcal R$ (continuity of $F$ is what makes the limit set, the points that $x_t$ approaches along some sequence of times $t_k\to\infty$, invariant; without it $V$ can decrease forever without reaching $x^\ast$). Berkenkamp et al., NeurIPS 2017 define the safety constraint as never leaving the region of attraction and certify it through a Lyapunov sublevel set: the pendulum may move but never falls. Deterministic given a model; with a GP model the decrease condition is checked on an upper confidence bound and holds with probability $1-\delta$ (Module 11).
Definition — (f) Robustness of a learned model
A network $\varphi:\mathbb R^n\to\mathbb R^m$ (Primer E) is $L$-Lipschitz in $\ell_2$ (Primer B; norms: Primer A) if $\|\varphi(x)-\varphi(y)\|_2\le L\|x-y\|_2$ for all $x,y$. For a classifier with logits $\varphi_j$ and predicted class $c$ (Primer E), with margin $M(x)=\varphi_c(x)-\max_{j\ne c}\varphi_j(x)\gt0$ this gives a deterministic certified radius: the label cannot change for $\|\delta\|_2\lt M(x)/(\sqrt2L)$, because $\varphi_c-\varphi_j=(e_c-e_j)^{\top}\varphi$ is $\sqrt2L$-Lipschitz ($\|e_c-e_j\|_2=\sqrt2$). If $L=0$, the network is constant and its positive-margin label is unchanged everywhere. Randomized smoothing (Gaussian noise: Primer C) certifies a different object, the Gaussian-smoothed classifier $g(x)=\operatorname*{arg\,max}_c\mathbb P_{\varepsilon\sim\mathcal N(0,\sigma^2I)}\big(\text{label}(x+\varepsilon)=c\big)$: whenever a lower confidence bound $\underline{p_A}\gt1/2$ on the top-class probability is available, $g$ keeps its label for $\|\delta\|_2\lt\sigma\,\Phi^{-1}(\underline{p_A})$, a radius that holds only with the Monte-Carlo confidence of $\underline{p_A}$ (Cohen et al.'s CERTIFY, which abstains otherwise; Cohen, Rosenfeld & Kolter, ICML 2019). This is a property of a function, not a trajectory; it enters closed-loop safety through small-gain (Primer D) and IQC arguments (integral quadratic constraints: quadratic inequalities on whole input/output signals, Module 2; used in Module 14). Example: a perception network whose output moves by at most $0.3$ under any input perturbation of norm at most $0.1$ (guaranteed, for instance, by $L\le3$).
Derivation — The certified radius $M(x)/(\sqrt2L)$

$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

$$|d_j(x+\delta)-d_j(x)|=\big|(e_c-e_j)^{\top}\big(\varphi(x+\delta)-\varphi(x)\big)\big|\le\|e_c-e_j\|_2\,L\|\delta\|_2=\sqrt2L\|\delta\|_2 .$$

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.

Definition — (g) Viability
Given a failure set $X_F$, the viability kernel is the set of states from which failure can be avoided forever (Massiani, Heim, Solowjow & Trimpe, TAC 2023, Def. 1):
$$X_V=\{x\in X:\ \exists u\in\mathcal U,\ \forall t\in\mathcal T,\ \varphi^u_x(t)\notin X_F\},$$
with $\varphi^u_x$ the trajectory from $x$ under controller $u$. The complement $X_U=X\setminus X_V$ is the unviability kernel; it contains the failure set itself (a state in $X_F$ has failed at $t=0$) and the doomed states $X_U\setminus X_F$: not yet failed, but unable to avoid failure. $X_V$ is the largest controlled-invariant subset (Primer D; defined below) of $X\setminus X_F$, so a hard-constraint problem with constraint set $X\setminus X_F$ is feasible from $x_0$ iff $x_0\in X_V$. Example: a car at 100 km/h one metre from a wall is in $X_U$. The guarantee is one of existence; computing $X_V$ needs a model (HJ reachability, Primer D, computes $X_U$ as a backward reachable tube) or a learned safety measure (Module 7).

$\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.

FormalisationTypical guaranteeTypical toolsModules
(a) Hard constraint / invariancedeterministic, for all $w\in W$ and all $t$Nagumo (Primer D), CBF-QP (QPs: Primer B), HJ reachability, robust and tube MPC, shields10, 11
(b) Chance constraint$1-\delta$ over noise, data or prior; joint or per stepstochastic MPC, GP confidence bounds plus Lipschitz continuity (SafeOpt), conformal prediction, scenario approach4, 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 critics8
(e) Stability / ROAdeterministic given the model; $1-\delta$ with a GP modelLyapunov functions, contraction, LMIs11, 14
(f) Robustness of a modeldeterministic Lipschitz / reachable-set bounds; probabilistic smoothing radiiLipSDP, direct parameterizations, bound propagation, IQCs12, 13, 15
(g) Viabilityexistence of a safe controller; largest safe setviability theory, HJ backward reachable tubes, safe value functions7, 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.

Theorem — Scenario approach (Campi & Garatti 2008, Thm. 2.4)

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$,

$$\mathbb P_{w_1,\ldots,w_N}\{V(z_N)>\epsilon\}\le\sum_{j=0}^{q-1}\binom Nj\epsilon^j(1-\epsilon)^{N-j}.$$

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).

Theorem — CPO near-satisfaction, finite-MDP case (Achiam et al. 2017, Prop. 2)

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:

$$J_c(\pi)+\frac{\mathbb E_{s\sim d^\pi,a\sim\pi'}A_c^\pi(s,a)}{1-\gamma}\le d,\qquad \mathbb E_{s\sim d^\pi}D_{\rm KL}(\pi'(\cdot|s)\|\pi(\cdot|s))\le\eta.$$

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

$$J_c(\pi')\le d+\frac{\gamma\varepsilon_c\sqrt{2\eta}}{(1-\gamma)^2}.$$

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.

Key insight
The seven formalisations are only partially ordered. The first walkthrough derives the implications that hold (hard $\Rightarrow$ chance, CVaR $\Rightarrow$ chance, chance $\Rightarrow$ expected cost up to the factor $T+1$, expected cost $\Rightarrow$ chance only through Markov's inequality, which is vacuous for budgets $d\ge1$) and those that fail (a positive discounted budget alone gives no nontrivial bound on infinite-horizon eventual failure; finite-horizon and zero-budget cases are different). The explorer shows one policy being "safe" under one formalisation and "unsafe" under another.
Lemma — A finite failure penalty suffices when failure times are bounded (elementary special case of Massiani et al. 2023, Thm. 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

$$p\gt2R\tau_d\,e^{T_f/\tau_d}$$

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

$$G(u)-p\,e^{-t_f/\tau_d}\le R\tau_d-p\,e^{-T_f/\tau_d}\lt R\tau_d-2R\tau_d=-R\tau_d\le G(u_{\rm safe}),$$

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).

Background — One-sided derivatives and minima at corners

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.

Background — Limits inside expectations

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.

Going deeper — Where each formalisation comes from

(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.

TraditionAssumesGuaranteesTypical failure modeModules
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 errorviolations 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 timedeterministic invariance or stability, or $1-\delta$ jointly for all $t$; active during learning (filters, SafeOpt) and at deploymentmodel misspecification; an RKHS-norm bound nobody can verify; infeasible QP/MPC; sampled-data effects4–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 1412–15
Theorem — Zero duality gap, finite-MDP case (Paternain et al. 2019, Thm. 1)

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

$$\mathcal L(\pi,\lambda)=J(\pi)-\sum_i\lambda_i(J_{c_i}(\pi)-d_i),\qquad D^*=\inf_{\lambda\ge0}\sup_\pi\mathcal L(\pi,\lambda).$$

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).

Foundations 1 The landscape · 2 Duality, LMIs & the S-procedure · 3 Kernels, GPs & uncertainty bounds 3, 22, 322 Safe exploration (Trimpe lens)Control-theoretic safetyConstrained deep RLCertified NNs (Pauli lens) 4 Safe Bayesian opt.5 Is safe BO safe?6 GoSafe, GoSafeOpt7 Viability 10 Barriers, reachability11 Lyapunov, safe MBRL 8 CMDPs, duality9 Trust regions, CPO 12 Lipschitz via SDP13 Lipschitz by design14 NNs in the loop15 Verification SafeOpt, controller tuningReal-β-SafeOpt, LoSBOglobal safe explorationsafe value functions, UPSi CBF-QP, HJ, safety filterslearning-based MPC Lagrangian methodsmodern safe policy opt. LipSDP and beyonddirect parameterizationsQCs, IQCs, dissipativitydistribution-free guarantees viability = complement of the BRTbackups as filtersNN controllers in closed loop

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.

Why it matters
The traditions are converging. Safety filters (Wabersich et al., IEEE CSM 2023) wrap any RL policy in a control-theoretic certificate; Lipschitz-bounded training (Pauli et al., L-CSS 2022) gives a learned model a robustness margin that closed-loop analyses of NN controllers can build on (Module 14); and the Trimpe group's critique of safe BO (Fiedler et al., TMLR 2024) applies the control question "which assumptions can an engineer check?" to a learning algorithm.

3. Types of Guarantees

Independently of what is guaranteed, guarantees differ in how strongly and when they hold.

TypeStatementRandomnessExamples here
Deterministicholds for every admissible disturbance and initial state, given the assumptionsnoneCBF 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 policyevery CMDP method
Asymptotica property of the limit only (convergence, vanishing average regret, Primer E)variesprimal-dual convergence; GP-UCB's no-regret property (its regret bound itself holds w.h.p. for every finite $T$)
Finite-sampleafter $t^\ast(\epsilon,\delta)$ samples the property holdsas aboveSafeOpt'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.

Background — Open neighbourhoods, boundaries and regular values

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).

Theorem — Forward invariance from a zeroing CBF (Ames, Xu, Grizzle & Tabuada, TAC 2017, Def. 5 and Cor. 2)
Assumptions. Control-affine dynamics $\dot x=f(x)+g(x)u$ (Primer D) with $f,g$ locally Lipschitz and known; $C=\{x:h(x)\ge0\}$ for a continuously differentiable ($C^1$) $h$ (gradients: Primer B) with $C\subseteq D\subset\mathbb R^n$, where either $D$ is an open neighbourhood of $C$ or $0$ is a regular value of $h$ ($\nabla h(x)\ne0$ for all $x\in\partial C$: no boundary point has a vanishing gradient; the condition the ECC 2019 tutorial adds in its Theorem 2); $h$ is a zeroing control barrier function on $D$: there is an extended class-$\mathcal K$ function $\alpha$ (continuous, strictly increasing, $\alpha(0)=0$; Primer D) with
$$\sup_{u\in U}\big[L_fh(x)+L_gh(x)\,u+\alpha(h(x))\big]\ge0\quad\forall x\in D.$$
Statement. Every Lipschitz continuous controller $u:D\to U$ with $u(x)\in K_{\rm zcbf}(x)=\{u\in U:\ L_fh(x)+L_gh(x)u+\alpha(h(x))\ge0\}$ renders $C$ forward invariant (Ames et al., TAC 2017; tutorial in Ames et al., ECC 2019).
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.
Derivation — Lie derivatives: why the barrier condition is affine in $u$

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

$$\dot h=\frac{d}{dt}h(x(t))=\nabla h(x)^{\top}\dot x=\underbrace{\nabla h(x)^{\top}f(x)}_{L_fh(x)}+\underbrace{\nabla h(x)^{\top}g(x)}_{L_gh(x)}\,u ,$$

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.)

Derivation — Checking the counterexample $h(x)=-x^3$

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.

Theorem — SafeOpt is safe with high probability (Sui, Gotovos, Burdick & Krause, ICML 2015, Thm 1)
Assumptions. $f:D\to\mathbb R$ on a finite $D$ is $L$-Lipschitz for a known metric $d$; $\|f\|_k^2\le B$ for a known kernel $k$ and known $B$ ($B$ bounds the squared RKHS norm in this paper; RKHS norm: first box below and Primer A); the noise $n_t$ is zero-mean conditioned on the history (see Primer C) and uniformly bounded by $\sigma_0$; the posterior $\mu_t,\sigma_t$ is that of a zero-mean GP prior with kernel $k$ and Gaussian likelihood variance $\lambda=\sigma_0^2$, the regulariser in $(K_t+\lambda I)^{-1}$ (a larger $\lambda$ is also valid); a non-empty safe seed $S_0$ with $f(x)\ge h$ on $S_0$ is given; $\beta_t=2B+300\gamma_t\log^3(t/\delta)$ with $\gamma_t$ the maximum information gain (the most information about $f$ that $t$ noisy measurements can provide; third box below, mutual information in Primer C), computed for the same $\lambda$.
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.
Background — The RKHS norm in one paragraph

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.

Background — The GP posterior mean and variance

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.

Background — The maximum information gain $\gamma_t$

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

$$\gamma_t=\max_{(x_1,\dots,x_t)\in D^t}\ \tfrac12\log\det\big(I+\lambda^{-1}K\big),\qquad K_{ij}=k(x_i,x_j),$$

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.

Derivation — How Lipschitz continuity extends certified safety

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.

Background — $\epsilon$-optimality and the $\epsilon$-reachable safe region

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:

AssumptionWhere it appearsCan 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 filterspartly: physics and identification, with explicit uncertainty margins
Lipschitz constant $L$ of the unknown functionSafeOpt, SafeMDP, LoSBO, Berkenkamp 2017plausibly: rate limits, actuator bandwidth, physical gradient bounds
noise bound $E$ (LoSBO) or sub-Gaussian parameter $R$ (see Primer C)LoSBO, GP confidence boundsonly 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 kernelGP-UCB, SafeOpt, Real-$\beta$-SafeOpt, GP-based safe MBRLno: 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 controllerSafeOpt family, GoSafe, safety filtersyes: a conservative default controller
calibration and test data jointly exchangeable; i.i.d. scenariosconformal prediction, scenario approachonly 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 extensionsLipSDP and the SDP certificates built on ityes, by construction of the network
a simulator faithful enough that training violations are acceptableconstrained deep RLrarely quantified
Pitfall — a guarantee is only as good as its assumptions: the $\beta$ heuristic
SafeOpt's theorem needs $\beta_t=2B+300\gamma_t\log^3(t/\delta)$ with a valid bound $B$ on the squared RKHS norm; the resulting intervals are so wide that the safe set barely grows, so implementations replaced $\beta_t$ by a constant. Fiedler et al. list $\beta\equiv2$ (the quadrotor experiments of Berkenkamp, Schoellig & Krause, ICRA 2016, and SafeMDP), $3$ (GoSafe) and $4$ (GoSafeOpt). Read such constants with care, because the papers put them in different places: the quadrotor paper writes its band as $\mu_{n-1}\pm\beta_n\sigma_{n-1}$ with $\beta_n=2$; SafeOpt-MC and GoSafeOpt keep Sui et al.'s $\mu_{n-1}\pm\beta_n^{1/2}\sigma_{n-1}$ but fix the multiplier $\beta_n^{1/2}$ itself ($2$ in SafeOpt-MC; $4$ in GoSafeOpt's 8-D simulation, $3$ in its other experiments); SafeMDP sets $\beta_t=2$ under the square root, a band of only $1.41\,\sigma_t$. The experiment below uses $\mu_t\pm\beta\sigma_t$, so $\beta\equiv2$ there means $2\sigma_t$. Fiedler, Menn, Kreisköther & Trimpe (TMLR 2024) measured the cost: 100 functions sampled from a squared-exponential RKHS (the function space of the smooth kernel $k(x,y)=a^2\exp(-\|x-y\|_2^2/(2\ell^2))$, with amplitude $a>0$ and length scale $\ell>0$; explained in Module 3) with norm $10$, each algorithm run $10^4$ times per function from two safe points (their Table 1). SafeOpt with $\beta\equiv2$ made unsafe queries in 3.95% of runs on average and 28.62% on the worst function. Real-$\beta$-SafeOpt, which evaluates the rigorous bound (in the norm convention, $\|f\|_k\le B$), with an under-estimated norm bound $B=2.5$: 0.859% (13.38% worst). With the true norm $B=10$ or a conservative $B=20$: 0% violations, but the algorithm never left its two initial points in 30.40% and 68.34% of runs. LoSBO, whose safe set uses only a Lipschitz constant and a hard noise bound: 0% violations, 0.018% not started, and the best final performance (90.9% versus 88.75% for $\beta\equiv2$). The lesson is not "use a larger $\beta$" but "build safety on an assumption you can verify" (Module 5).
Key insight — reading a safety theorem in four questions
(1) What object is constrained: a state at each time, a trajectory, an expectation over episodes, a tail average, a function's gain, or the existence of a controller? (2) With what strength: deterministic, $1-\delta$ over which randomness and jointly or per step, in expectation, asymptotic, finite-sample? (3) When: during data collection, every iteration, at convergence, or for the deployed model only? (4) Under which assumptions, and which can I check? Most disagreements in the literature answer (2) or (3) differently: CPO's bound is a per-iteration near-satisfaction statement for the exact trust-region update with exact expectations, while Safety Gym reports that "it appears to be the case that approximation errors in CPO prevent it from fully satisfying constraints on virtually all" of its environments (Ray et al. 2019). Both are right.

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.

WhoWhereThemesLandmarks hereModules
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 Systemslearning-based control with guarantees: safe BO, rigorous GP bounds, viability-based safe RL, event-triggered learning, approximate MPC, uncertainty-aware model-based RLMarco 2016; Fiedler 2021; Massiani 2023; Fiedler 2024; UPSi 20263–7
Patricia PauliAssistant 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 2022safe AI-based control for high-tech systems: Lipschitz-bounded networks via SDP and dissipativity, LMI certificates for NN controllers, CNN parameterizationsPauli 2021 (CDC), 2022 (L-CSS), 2024 (ICLR); LipKernel 202612–14
Frank AllgöwerIST, University of StuttgartMPC, data-driven control, NN certification (Pauli's advisor)co-author of the Pauli papers and of Hertneck et al. 2018 with Trimpe11–14
Carsten SchererUniversity of StuttgartIQCs, robust control, LMIsFiedler, Scherer & Trimpe 20212, 3, 11, 14
Andreas Krause (LAS)ETH ZürichGP bandits, SafeOpt, SafeMDP, GoSafeOptSrinivas 2010; Sui 2015; Turchetta 2016; Berkenkamp 2017; Sukhija et al. 20233–6, 11
Melanie Zeilinger (IDSC)ETH Zürichpredictive safety filters, learning-based MPCWabersich & Zeilinger 2021; Hewing et al. 202010, 11
Aaron AmesCaltechcontrol barrier functionsAmes, Grizzle & Tabuada 2014; Ames et al. 2017, 201910
Claire Tomlin / Jaime FisacUC Berkeley / PrincetonHJ reachability, safety filters, reachability via RLMitchell et al. 2005; Fisac et al. 201910
Angela SchoelligTU Munich (Humboldt Professor, since 2022); also UTIAS, University of Torontosafe learning in robotics, benchmarksBerkenkamp 2017; Brunke 20224, 11
Ian Manchester & Ruigang WangUniversity of SydneyRENs, Sandwich layers, LipKernel co-authorsWang & Manchester 2023; Revay et al. 202413
Bin HuUIUCLipSDP extensions, control-theoretic MLco-author of Pauli et al. ICLR 202412
Mahyar FazlyabJohns Hopkins (formerly UPenn)LipSDP, DeepSDPFazlyab 2019; Fazlyab et al. 202212, 15
Dominik BaumannAalto UniversityGoSafe, safe RL in uncertain contexts, lightweight safe learningGoSafeOpt 20236
Christian FiedlerTU Munich (Munich Center for Machine Learning); formerly RWTH Aachen (DSME)rigorous GP bounds, LoSBOFiedler 2021, 20243, 5
Key insight — there is no joint Pauli–Trimpe paper
The arXiv query 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.

AreaSymbolMeaning
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)
Common mistake — symbol clashes across traditions
  • $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.

Constraint Semantics Explorer
seed 1, 200 episodes

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.

Top: every second one of the 200 sampled episodes (orange = at least one violation). Bottom: histogram of the signed maximum excursion $Z$; purple lines mark $\operatorname{VaR}_\alpha$ (dashed) and $\operatorname{CVaR}_\alpha$ (solid), grey the mean.

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.

Key insight
With the defaults the CMDP verdict passes (exact $\mathbb E[N]\approx0.23$ violating steps per episode, well under $d=1$) while the chance, risk and hard verdicts fail: about one episode in five brushes past the boundary at least once. The behaviour is the same in all four rows; only the question asked of it differs. Raise $\sigma$ and the CMDP verdict flips too (the exact $\mathbb E[N]$ crosses $1$ near $\sigma\approx0.09$). Lower $k$ and, down to about $k=0.2$, every verdict gets worse: a sluggish controller lets the noise accumulate, since the stationary spread $\sigma/\sqrt{k(2-k)}$ grows as $k$ falls below $1$, and for $k$ between $0.1$ and $0.2$ even the CMDP verdict fails. At the bottom of the slider the trend reverses because the transient takes over: with $k=0.05$ the mean has only reached $m_{40}\approx0.70$ when the episode ends, so the gain acts non-monotonically. Raise $k$ towards $1$, the deadbeat gain (see Primer D) that removes the error in one step, and the stationary spread falls to its minimum $\sigma$; every number improves up to about $k=0.8$, but not monotonically beyond, because over a finite horizon the transient mean matters too: the exact $\mathbb E[N]$ bottoms out near $k\approx0.96$ ($0.0843$) and is $0.0855$ at $k=1$, and with the default seed the sampled violation probability rises from $0.035$ at $k=0.9$ to $0.040$ at $k=1$ (the sampled CVaR keeps falling). Even at $k=1$ the states $x_t\sim\mathcal N(0.8,\sigma^2)$, $t\ge1$, are i.i.d. and an episode violates with probability $1-(1-0.0021)^{40}\approx0.08\gt\delta$ (200 samples may still show SAMPLE PASSES: the chance, risk and hard badges are statistics, not certificates). Beyond $k=1$ the controller overshoots the goal: at $k=1.5$ the mean jumps to $m_1=1.2$ and almost every episode crosses the boundary at $t=1$. Shorten $T$ and every verdict improves, because all four are horizon-dependent; since the noise sequences are reused, this holds episode by episode.

From the mathematics to a real decision

Learning objectives

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.

$$T_{t+1}=0.8T_t+4+0.5u_t+w_t.$$

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

Common mistake — One successful summary statistic

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.

Exercise 1.1 — Classify the safety statements

Assign each statement to a formalisation (a)–(g) of Section 1 and name its guarantee type (Section 3).
1. "The quadrotor remains inside the flight cage in at least 99% of test flights."
2. "Over training, the average number of hazard contacts per episode must not exceed 25."
3. "No admissible wind gust ($\|w\|\le2$ m/s) may push the drone outside the cage."
4. "The average cost of the 5% worst episodes stays below 10."
5. "From every initial condition in the certified set the tracking error converges to zero."
6. "The perception network's output changes by at most 0.3 for any input perturbation of $\ell_2$-norm at most 0.1."
7. "From the current state some control sequence avoids the obstacle forever."
8. "With probability at least $1-\delta$ over the measurement noise, every controller SafeOpt evaluates satisfies $f(x_t)\ge h$."

Read the percentages and averages as claims about the underlying trajectory distribution. If they only summarize observed episodes they are empirical statistics, and turning them into an expected-cost or chance guarantee needs a sampling model and an uncertainty bound.

Show answer
1. (b) joint chance constraint over the flight, $\delta=0.01$; high probability over process noise. 2. (c) CMDP expected cost with $d=25$; in expectation; a training-time statement (Safety Gym). 3. (a) hard constraint / robust forward invariance with $W=\{\|w\|\le2\}$; deterministic. 4. (d) CVaR with $\alpha=0.95$, $d=10$; a tail expectation. 5. (e) the certified set lies in the region of attraction; as stated this is attractivity (convergence) only, and it becomes asymptotic stability once Lyapunov stability of the zero-error equilibrium is added, which a positive-level Lyapunov sublevel-set certificate provides; deterministic given the model. 6. (f) robustness of a learned model: a certified output-deviation bound of $0.3$ on the input ball of radius $0.1$; deterministic. A Lipschitz bound $L\le3$ would imply it, but it does not imply $L\le3$ (a steep function with a small range, e.g. $\operatorname{clip}(30z,-0.15,0.15)$, never moves by more than $0.3$ yet has $L=30$). 7. (g) viability: the state lies in $X_V$; an existence statement. 8. (b) again, but the probability is over the learner's data, not the plant, it holds jointly for all $t$, and it is active during learning; the constraint itself ($f\ge h$ at every query) is a hard per-query constraint made probabilistic only by the uncertainty about $f$.
Exercise 1.2 — CVaR by hand

Ten episodes have signed maximum excursions $Z\in\{-0.6,-0.5,-0.4,-0.3,-0.2,-0.1,0,0.2,0.5,1.5\}$, each with probability $0.1$ (positive means the boundary was crossed). Compute $\mathbb E[Z]$, $\mathbb P(Z\gt0)$, $\operatorname{VaR}_\alpha(Z)$ and $\operatorname{CVaR}_\alpha(Z)$ for $\alpha=0.75$ and $\alpha=0.9$, once as a tail average and once from the Rockafellar–Uryasev formula. Which of the verdicts (mean excursion with budget $\mathbb E[Z]\le0.05$, chance with $\delta=0.2$, CVaR $\le0$, hard) call this behaviour safe?

Show answer

$\mathbb E[Z]=(-2.1+2.2)/10=0.01$ and $\mathbb P(Z\gt0)=0.3$.

$\alpha=0.9$. $\operatorname{VaR}_{0.9}=\inf\{z:\mathbb P(Z\le z)\ge0.9\}=0.5$ since $\mathbb P(Z\le0.5)=0.9$. The worst 10% is the single atom $1.5$, so $\operatorname{CVaR}_{0.9}=1.5$. Rockafellar–Uryasev at $\nu=0.5$: $0.5+\tfrac1{0.1}\cdot0.1\cdot(1.5-0.5)=1.5$.

$\alpha=0.75$. $\mathbb P(Z\le0)=0.7\lt0.75\le\mathbb P(Z\le0.2)=0.8$, so $\operatorname{VaR}_{0.75}=0.2$. The worst quarter is $2.5$ atoms: $1.5$ and $0.5$ in full and half of the atom $0.2$:

$$\operatorname{CVaR}_{0.75}=\frac{0.1\cdot1.5+0.1\cdot0.5+0.05\cdot0.2}{0.25}=\frac{0.21}{0.25}=0.84 .$$
Rockafellar–Uryasev at $\nu=0.2$: $0.2+\tfrac1{0.25}\big(0.1\cdot0.3+0.1\cdot1.3\big)=0.2+4\cdot0.16=0.84$. The minimisation handles the split atom automatically.

Verdicts: the mean excursion $\mathbb E[Z]=0.01$ is within the budget $0.05$, so the CMDP-style average says "safe" (with a zero budget, $\mathbb E[Z]\le0$, it would fail, but only by $0.01$, even though three episodes in ten cross the boundary); $\mathbb P(Z\gt0)=0.3\gt0.2$ says unsafe; $\operatorname{CVaR}_{0.75}=0.84\gt0$ and $\operatorname{CVaR}_{0.9}=1.5\gt0$ say unsafe; the hard view is unsafe because $\max Z=1.5\gt0$. Only the average calls it safe.

Exercise 1.3 — An expected-cost constraint does not bound the violation probability

Let $c_t=\mathbf 1\{x_t\notin C\}$, $N=\sum_{t=0}^{T}c_t$ and $E=\{N\ge1\}$. (i) Prove $\mathbb P(E)\le\mathbb E[N]$ and show the bound is tight. (ii) For any $d\ge1$, construct a trajectory distribution with $\mathbb E[N]\le d$ and $\mathbb P(E)=1$. (iii) With the discounted cost $J_c^\gamma=\mathbb E[\sum_{t\ge0}\gamma^tc_t]$ and infinite horizon, with $0<\gamma<1$ and $E$ now meaning eventual failure, construct for every $d\gt0$ a policy with $J_c^\gamma\le d$ and $\mathbb P(E)=1$. (iv) Show conversely that $\mathbb P(E)\le\delta$ only gives $\mathbb E[N]\le(T+1)\delta$, and that this is tight.

Show answer

(i) $N$ is a non-negative integer, so $N\ge\mathbf 1\{N\ge1\}$ pointwise; taking expectations, $\mathbb E[N]\ge\mathbb P(N\ge1)=\mathbb P(E)$ (Markov's inequality at level $1$). Tightness: violate exactly one step with probability $p$ and never otherwise; then $N\in\{0,1\}$ and $\mathbb E[N]=p=\mathbb P(E)$.

(ii) Let every episode violate exactly once, at a random time. Then $N\equiv1$, $\mathbb E[N]=1\le d$, and $\mathbb P(E)=1$: the CMDP constraint is met by a policy that fails in every episode.

(iii) Take a policy inside $C$ for $t\lt t_0$ and outside for all $t\ge t_0$, surely. Then

$$J_c^\gamma=\sum_{t\ge t_0}\gamma^t=\frac{\gamma^{t_0}}{1-\gamma}\le d\iff t_0\ge\frac{\log\big(d(1-\gamma)\big)}{\log\gamma},$$
a finite time for every $d\gt0$ (both logarithms are negative when $d(1-\gamma)\lt1$; otherwise any $t_0\ge0$ works), yet $\mathbb P(E)=1$. Discounting weights violations by $\gamma^t$, so a sufficiently delayed certain failure is invisible to the constraint; this is the mechanism behind the $e^{T_f/\tau}$ growth of the penalty threshold in Safe Value Functions (Module 7).

(iv) $N\le T+1$ pointwise and $N=0$ on $E^c$, so $\mathbb E[N]=\mathbb E[N\mathbf 1_E]\le(T+1)\mathbb P(E)\le(T+1)\delta$. Tight: with probability $\delta$ violate at every step, otherwise never. The two formalisations control each other only up to the horizon. With discounting only this direction survives: $\sum_{t\ge0}\gamma^tc_t\le\mathbf 1_E/(1-\gamma)$ pointwise, so $\mathbb P(E)\le\delta$ still gives $J_c^\gamma\le\delta/(1-\gamma)$, whereas by (iii) no discounted budget $d\gt0$ bounds $\mathbb P(E)$. None of this involves the magnitude of a violation: an indicator cost counts a millimetre and a crash alike, which is what CVaR of the excursion (Exercise 1.2) adds.

Exercise 1.4 — What a SafeOpt guarantee needs versus what a CBF guarantee needs

List the assumptions behind SafeOpt's Theorem 1 and behind the ZCBF invariance theorem. For each say (i) whether the guarantee is deterministic or probabilistic and over what, (ii) whether it protects the learning phase, (iii) which assumptions an engineer can check and what happens when one silently fails.

Show answer

SafeOpt needs a finite $D$; $f$ $L$-Lipschitz for a known $L$; $\|f\|_k^2\le B$ for a known kernel and known $B$; noise zero-mean given the past and bounded by $\sigma_0$, with the GP posterior (and $\gamma_t$) computed for likelihood variance $\lambda=\sigma_0^2$ or larger; a non-empty safe seed $S_0$ with $f\ge h$; $\beta_t=2B+300\gamma_t\log^3(t/\delta)$. It gives, with probability $\ge1-\delta$ over the noise and jointly for all $t$, $f(x_t)\ge h$ at every query, with a separate finite-sample optimality result previewed in Module 4. It protects the learning phase: exploration never leaves the certified set. Checkable: $S_0$ (a conservative controller), $L$ (physical rate limits, plausibly), the noise bound (a justified sensor specification; finite sensor data alone cannot prove it). Difficult to justify for an unknown $f$: $B$ and the kernel. Too small a $B$, or a heuristic constant in place of $\beta_t$, can produce intervals that are too narrow and admit unsafe points. Fiedler et al. (2024, Table 1) report 3.95% unsafe runs on average (28.62% worst) with $\beta\equiv2$, and 0.859% (13.38% worst) for Real-$\beta$-SafeOpt using their data-dependent formula (7) in arXiv v1, with a norm bound $\|f\|_k\le2.5$ against a true norm of $10$. Too small an $L$ can wrongly certify unevaluated points; if an unsafe seed point is selected at $t=1$, that first query violates safety. LoSBO drops $B$ and the kernel (safety from $L$ and a noise bound $E$ alone) and is exactly the "checkable assumptions" repair.

ZCBF needs known control-affine $f,g$, locally Lipschitz; a $C^1$ function $h$ with $C=\{h\ge0\}\subseteq D$, where $D$ is an open ambient neighbourhood of $C$ for the stated locally Lipschitz closed loop; for a boundary-only check, $0$ must additionally be a regular value of $h$ (with an open $D$ the inequality on $D$ already excludes leaving $C$; a check on $\partial C$ alone, Nagumo's condition, needs $\nabla h\ne0$ on $\partial C$; with neither, $h=-x^3$ on $D=C=(-\infty,0]$ with $\dot x=1$ satisfies the inequality and still leaves $C$); an extended class-$\mathcal K$ $\alpha$ with $\sup_u[L_fh+L_ghu+\alpha(h)]\ge0$ on $D$, feasible inputs $K_{\rm zcbf}(x)\ne\emptyset$ (automatic for $U=\mathbb R^m$, a closed polyhedron or a compact $U$; for an open $U$ a zero supremum need not be attained, see the theorem in Section 3); a Lipschitz continuous controller $u:D\to U$ with values in $K_{\rm zcbf}(x)$. It gives deterministic forward invariance of $C$ from every $x_0\in C$, no probability at all, on the maximal interval of existence of the closed-loop solution (for all $t\ge0$ when the closed loop is forward complete, e.g. for compact $C$), for the deployed controller and equally for a learning policy filtered through the CBF-QP (so it protects learning whenever the filter is active). Checkable: the structure of $h$ and $\alpha$ and the regular-value condition (by construction); the barrier inequality with $K_{\rm zcbf}(x)\ne\emptyset$ on all of $D$ (analytically, by an SOS certificate, or by gridding plus Lipschitz bounds with a margin that covers the space between grid points; a plain grid check certifies only the grid points); Lipschitz continuity of the QP solution (regularity conditions in Ames et al. 2017). Not directly checkable: the model. If $f,g$ are wrong, $\dot h$ is mis-evaluated and $C$ can be left; the repair is a robust or input-to-state-safe CBF with an uncertainty margin, or a learned residual with a GP bound, which re-imports SafeOpt's kind of assumptions (Module 10).

Background — SOS certificates and grid margins

An SOS certificate writes a polynomial as a sum of squared polynomials, which proves it is nonnegative; certifying only a constrained domain requires additional domain conditions. For a grid argument, suppose every state $x$ is within distance $r$ of some grid point $x_i$ and the residual $b(x)$ of the inequality to be certified (for example the barrier inequality, $b\ge0$ wanted) is $L_b$-Lipschitz. If every grid value satisfies $b(x_i)\ge L_b r$, then $b(x)\ge b(x_i)-L_b\|x-x_i\|\ge L_br-L_br=0$ throughout the domain. Checking only $b(x_i)\ge0$ is insufficient.

For example, $x^4+2x^2+1=(x^2+1)^2\ge0$. With grid radius $r=0.1$ and residual Lipschitz bound $L_b=2$, every grid residual must be at least $0.2$ to certify the intervening states.

Summary: SafeOpt buys "no model needed" with statistical and function-class assumptions that can be difficult to justify for an unknown target; the CBF buys a deterministic guarantee with a model assumption engineers are used to quantifying. LoSBO and rigorous GP bounds on one side, learned residuals with bounds on the other, meet in the middle.

Exercise 1.5 — Exact expected violations for the explorer's system

For $x_{t+1}=x_t-k(x_t-x_{\rm goal})+\sigma w_t$, $w_t\sim\mathcal N(0,1)$ i.i.d., $x_0=0$, $0\lt k\lt2$: (i) derive the mean $m_t$ and variance $v_t$ of $x_t$ and the stationary variance; (ii) give the exact expected number of violating steps $\mathbb E[N]=\sum_{t=1}^T\mathbb P(x_t\gt1)$; (iii) evaluate it for $k=0.5$, $\sigma=0.1$, $T=40$, $x_{\rm goal}=0.8$ and compare with the Markov bound on the violation probability.

Show answer

(i) With $e_t=x_t-x_{\rm goal}$, $e_{t+1}=(1-k)e_t+\sigma w_t$ and $e_0=-x_{\rm goal}$: a stable scalar AR(1) recursion since $|1-k|\lt1$. Unrolling, $e_t=(1-k)^te_0+\sigma\sum_{j=0}^{t-1}(1-k)^{t-1-j}w_j$; the noise terms are independent, so

$$m_t=x_{\rm goal}\big(1-(1-k)^t\big),\qquad v_t=\sigma^2\sum_{i=0}^{t-1}(1-k)^{2i}=\sigma^2\,\frac{1-(1-k)^{2t}}{1-(1-k)^2}\ \xrightarrow{t\to\infty}\ \sigma_\infty^2=\frac{\sigma^2}{k(2-k)},$$
using $1-(1-k)^2=k(2-k)$. The mean approaches the goal geometrically; the variance grows to its stationary value.

Derivation — Unrolling the AR(1) recursion

AR(1) (autoregressive of order 1) means that the next value is a fixed multiple of the current value plus fresh noise. Set $a=1-k$. Then $e_1=ae_0+\sigma w_0$ and $e_2=ae_1+\sigma w_1=a^2e_0+\sigma(aw_0+w_1)$; continuing gives $e_t=a^te_0+\sigma\sum_{j=0}^{t-1}a^{t-1-j}w_j$. Since $\mathbb E[w_j]=0$, only $a^te_0$ contributes to the mean. Independence makes all cross-covariances zero, so $\operatorname{Var}(\sum_j b_jw_j)=\sum_j b_j^2$ for unit-variance noises; with $b_j=\sigma a^{t-1-j}$ this is $\sigma^2\sum_{i=0}^{t-1}a^{2i}$, the geometric series above.

(ii) $x_t\sim\mathcal N(m_t,v_t)$ exactly (a linear function of Gaussians), so $\mathbb P(x_t\gt1)=1-\Phi\big((1-m_t)/\sqrt{v_t}\big)$ and, by linearity of expectation (no independence needed),

$$\mathbb E[N]=\sum_{t=1}^{T}\Big(1-\Phi\Big(\frac{1-m_t}{\sqrt{v_t}}\Big)\Big),$$
which is also the union bound on the violation probability, $\mathbb P(\exists t:x_t\gt1)\le\mathbb E[N]$. Numerically, evaluate each term as the upper tail $Q(z)=\tfrac12\operatorname{erfc}(z/\sqrt2)$ rather than as $1-\Phi(z)$: in double precision $1-\Phi(z)$ cancels to exactly $0$ for $z$ above about $8.3$, and a sum of such false zeros would pass a budget $d=0$ that every $\sigma\gt0$ violates, since each term is strictly positive (the explorer uses $Q$).

Background — Gaussian tails and numerical cancellation

The complementary error function is $\operatorname{erfc}(a)=\frac{2}{\sqrt\pi}\int_a^\infty e^{-s^2}\,ds$. For $G\sim\mathcal N(0,1)$, substituting $x=\sqrt2\,s$ gives $\mathbb P(G\gt z)=\int_z^\infty\frac{e^{-x^2/2}}{\sqrt{2\pi}}\,dx=\frac1{\sqrt\pi}\int_{z/\sqrt2}^\infty e^{-s^2}\,ds=Q(z)$. Computers store finitely many digits: subtracting a number rounded to 1 from 1 can erase a tiny positive tail. Evaluating the upper tail directly avoids that subtraction. 'Exact expectation' here means that an analytical formula is available; its displayed value is a floating-point approximation.

For example, $Q(0)=1/2$ by Gaussian symmetry. If a stored approximation to $\Phi(9)$ rounds to 1, the subtraction $1-\Phi(9)$ gives zero even though the Gaussian tail is positive. A direct tail routine retains that small number.

Standardizing requires $v_t\gt0$. If $v_t=0$ (the case $\sigma=0$) the state is deterministic and $\mathbb P(x_t\gt1)=\mathbf1\{m_t\gt1\}$; equality $m_t=1$ is safe because the constraint is $x_t\le1$. The sum starts at $t=1$ because $x_0=0$ never violates.

(iii) $\sigma_\infty^2=0.01/0.75$, $\sigma_\infty=\sqrt{0.01/0.75}\approx0.1155$, so the stationary per-step violation probability is $p_\infty=1-\Phi(0.2/\sqrt{0.01/0.75})=1-\Phi(\sqrt3)\approx0.0416$ ($\sqrt3\approx1.732$). The transient is short: $p_1\approx0$ ($m_1=0.4$, $\sqrt{v_1}=0.1$, six standard deviations away), $p_3\approx0.0044$, $p_5\approx0.0256$, $p_{10}\approx0.0410$. Summing the exact terms gives $\mathbb E[N]\approx1.484$, slightly below the stationary approximation $Tp_\infty\approx1.665$. The Markov bound $\mathbb P(\exists t:x_t\gt1)\le\mathbb E[N]\lt1.485$ is vacuous; the explorer (set $\sigma=0.1$) estimates the actual joint probability, about $0.69$ in a large simulation, which individual marginal probabilities alone do not determine. This is the quantitative face of Exercise 1.3: the CMDP number is analytic and cheap, the chance-constraint number needs the joint law.

What the marginals miss is the dependence: $(x_1,\ldots,x_T)$ is jointly Gaussian with $\operatorname{Cov}(x_s,x_t)=(1-k)^{t-s}v_s$ for $s\le t$ (the noise after time $s$ is independent of $x_s$), so $\mathbb P(\exists t:x_t\gt1)$ is a $T$-dimensional Gaussian probability that can be computed numerically; simulation is simply the explorer's convenient estimate of it.

Key Papers

PaperVenueContributionWhy read it
Brunke, Greeff, Hall, Yuan, Zhou, Panerati & Schoellig, Safe Learning in Robotics: From Learning-Based Control to Safe Reinforcement LearningAnnu. Rev. Control Robot. Auton. Syst. 5, 2022unifies safe learning control and safe RL; Level I/II/III taxonomy; safe-control-gymthe best single entry survey; its taxonomy maps onto (c)/(b)/(a)
Fiedler, Menn, Kreisköther & Trimpe, On Safety in Safe Bayesian OptimizationTMLR 2024why SafeOpt implementations lose their guarantees; Real-$\beta$-SafeOpt, LoSBO, LoS-GP-UCBthe 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 SystemsIEEE Control Systems Magazine 43(5), 2023HJ, CBF and predictive filters as approximations of one ideal minimally invasive filterthe control tradition in one tutorial
García & Fernández, A Comprehensive Survey on Safe Reinforcement LearningJMLR 16(42), 2015the two-branch taxonomy: optimality criterion versus exploration processhistorical baseline of the RL view
Altman, Constrained Markov Decision ProcessesChapman & Hall/CRC, 1999occupation-measure LPs, Lagrangian duality, optimal stationary randomised policiesthe reference for formalisation (c)
Achiam, Held, Tamar & Abbeel, Constrained Policy OptimizationICML 2017trust-region policy search for CMDPs with per-iteration guaranteesfixes the deep-RL CMDP notation used here
Chow, Ghavamzadeh, Janson & Pavone, Risk-Constrained Reinforcement Learning with Percentile Risk CriteriaJMLR 18(167), 2018chance- and CVaR-constrained MDPs; Lagrangian gradients with the VaR parameterformalisation (d) and the $\alpha$ convention
Ames, Xu, Grizzle & Tabuada, Control Barrier Function Based Quadratic Programs for Safety Critical SystemsIEEE TAC 62(8), 2017reciprocal and zeroing CBFs, the CLF-CBF QP, Lipschitz continuity of the QP controllerthe deterministic invariance theorem quoted above
Massiani, Heim, Solowjow & Trimpe, Safe Value FunctionsIEEE TAC 68(5), 2023when failure penalties give safe and optimal value functions; the finite threshold and its $e^{T_f/\tau}$ scalingformalisation (g) and the bridge from viability to RL
Sui, Gotovos, Burdick & Krause, Safe Exploration for Optimization with Gaussian ProcessesICML 2015SafeOpt: 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 DesignICML 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 GuaranteesNeurIPS 2017safe = inside a certified region of attraction; GP plus Lipschitz discretisationformalisation (e) as a learning problem
Fazlyab, Robey, Hassani, Morari & Pappas, Efficient and Accurate Estimation of Lipschitz Constants for Deep Neural NetworksNeurIPS 2019LipSDP: slope restriction as an incremental quadratic constraint, Lipschitz bound by SDPentry point of the certified-model tradition (read with Pauli et al.'s correction)
Paternain, Chamon, Calvo-Fullana & Ribeiro, Constrained Reinforcement Learning Has Zero Duality GapNeurIPS 2019CMDPs have zero duality gap under Slater's conditionwhy Lagrangian methods are principled despite non-convexity

The full atlas of verified papers for the section is in the Paper Atlas.

Flashcards