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