Problem reference
A problem fixes the edge inequality, and owns the type of its certificate. See How a certificate works and Reading a certificate for the concepts. A certificate c is callable: c(x) evaluates its common certificate, common.
The interface
PathCompleteCertificates.AbstractProblem — Type
AbstractProblemA property to certify, defined by its edge inequality.
PathCompleteCertificates.certify — Function
certify(template, graph, problem; optimizer, kwargs...)Build and solve the model, and return the best AbstractCertificate on graph: the smallest rate for stability, the largest margin for safety, and a policy with a small cost bound for optimal control. Check is_feasible before reading it. refine calls it on every graph it visits.
PathCompleteCertificates.dual — Method
dual(problem)The dual of problem. Throws for a problem that defines no dual.
PathCompleteCertificates.node_value — Method
node_value(problem, V, x)The value $V(x)$ of the node function V at the state x. A problem whose node functions are SetProg sets, rather than callables, defines its own method to read the value off the set.
PathCompleteCertificates.optimization_model — Function
optimization_model(template, graph, problem; optimizer, kwargs...)Build, without solving, the JuMP model that certify solves.
Certificates
PathCompleteCertificates.AbstractCertificate — Type
AbstractCertificateThe result of certify: node functions on a graph, and what the problem certifies. A certificate c is callable: c(x) returns its common certificate at x (see common).
PathCompleteCertificates.AbstractCertificate — Method
(certificate::AbstractCertificate)(x)The common certificate at x, as common computes it. Throws on an infeasible certificate.
PathCompleteCertificates.CertificateData — Type
CertificateData(problem, template, graph, functions, status, feasible)The fields shared by every certificate:
problem, the problem certified.template, the template the node functions are drawn from.graph, the path-complete graph they sit on.functions, the node function at each node, empty after a failed solve.status, the solver's termination status.feasible, whether the solve produced a certificate, read byis_feasible.
PathCompleteCertificates.common — Method
common(graph, problem, Vs, x)The common certificate of the node functions Vs on graph, evaluated at x: a minimum of maxima of the Vs (Philippe et al., 2019). Depending on problem, a common Lyapunov function, a common barrier function or a bound on the value function.
PathCompleteCertificates.dual — Method
dual(certificate)The certificate on the dual graph made of the dual norms of the node functions. Throws for a certificate whose problem defines no dual.
PathCompleteCertificates.edge_slacks — Function
edge_slacks(certificate)The slack of every edge inequality, in edges(get_graph(certificate)) order. Zero means tight. For stability, slacks are relative to the scale of the node functions, so they do not depend on their normalization, and a tight edge has a slack of the order of rtol. Throws on an infeasible certificate.
PathCompleteCertificates.functions — Method
functions(certificate)The node function at each node, indexed by node, and empty after a failed solve.
PathCompleteCertificates.get_graph — Method
get_graph(certificate)The path-complete graph the certificate is built on.
PathCompleteCertificates.get_problem — Method
get_problem(certificate)The problem the certificate was produced for.
PathCompleteCertificates.get_template — Method
get_template(certificate)The template its node functions are drawn from.
PathCompleteCertificates.is_feasible — Method
is_feasible(certificate) -> BoolWhether the solve produced a certificate. false means none exists in this template on this graph, not that the property fails.
PathCompleteCertificates.objective — Function
objective(certificate) -> RealThe number refine aims to lower from one graph to the next, such as the rate of a StabilityCertificate.
PathCompleteCertificates.optimality_gap — Method
optimality_gap(certificate; kwargs...) -> RealAn upper bound on how far objective is from the best any graph could reach: 0 when proved optimal, Inf by default.
PathCompleteCertificates.status — Method
status(certificate)The solver's termination status, for diagnosis. Read is_feasible to know whether the certificate holds: it may accept an almost-optimal solve, or reject a solution the solver reported optimal.
Tight edges
PathCompleteCertificates.tight_edges — Method
tight_edges(certificate; atol = 1e-4)The edges of the certificate's graph whose slack is at most atol, in edges(get_graph(certificate)) order. For stability, slacks are relative to the scale of the node functions, so atol compares with the rtol of certify: read them with atol at least ten times rtol.
PathCompleteCertificates.tight_subgraph — Method
tight_subgraph(certificate; atol = 1e-4)The subgraph, on the same nodes, of the edges whose slack is at most atol.
Stability
PathCompleteCertificates.StabilityCertificate — Type
StabilityCertificateA path-complete Lyapunov function and its rate, an upper bound on the joint spectral radius.
PathCompleteCertificates.StabilityProblem — Type
StabilityProblem(system)The stability problem of an input-free switched linear system: bound its joint spectral radius. certify finds the smallest rate, or checks a given one.
PathCompleteCertificates.certify — Method
certify(template, graph, problem::StabilityProblem; optimizer, rate = nothing,
rtol = 1e-6, max_iterations = 100, initial_upper = 1.0,
check_path_complete = true, conditioning_bound = Inf)The StabilityCertificate of the smallest feasible rate, an upper bound on the joint spectral radius, found by bisection to relative tolerance rtol, using a SetProg family or a vector of families, one per node. initial_upper is a first guess of a feasible rate. Given a rate, solve at that rate only. A finite conditioning_bound bounds ellipsoid gauge matrices between I and conditioning_bound * I.
rtol is that of refine, so that the default atol of tight_edges is at least ten times it: a certificate read at a coarser rtol needs a larger atol.
PathCompleteCertificates.dual — Method
dual(certificate::StabilityCertificate)The certificate on the dual graph made of the dual norms of the node functions, at the same rate. Requires a template that has_dual.
PathCompleteCertificates.is_jsr_exact — Method
is_jsr_exact(certificate; atol = 1e-4) -> BoolWhether the tight_subgraph proves that the rate is the joint spectral radius: every node has at most one outgoing tight edge (Ninite and Jungers, 2026; Thm. 4), and the tight edges contain a cycle. false means unknown. At the optimal rate the tight subgraph keeps the rate (Ninite and Jungers, 2026; Prop. 1), so it contains a cycle, and a tight subgraph without one means that atol was too small to see the active edges. Throws on a graph with words: use expanded_form.
PathCompleteCertificates.jsr_lower_bound — Method
jsr_lower_bound(certificate; atol = 1e-4, max_length = nothing)A lower bound on the joint spectral radius, valid for any atol: the largest $\rho(A_w)^{1/|w|}$ over the words $w$ read along the simple cycles of at most max_length edges of the tight_subgraph, or 0 if there are none.
PathCompleteCertificates.optimality_gap — Method
optimality_gap(certificate::StabilityCertificate; atol = 1e-4, max_length = nothing)How far the rate is known to be from the joint spectral radius: 0 when is_jsr_exact holds, otherwise the rate minus jsr_lower_bound.
PathCompleteCertificates.optimization_model — Method
optimization_model(template, graph, problem::StabilityProblem; optimizer,
rate = 1, check_path_complete = true, conditioning_bound = Inf)Build, without solving, the SetProg model of the feasibility problem $V_d(A_w x) \le \gamma^{\delta |w|} V_s(x)$ for every edge $(s, d, w)$, with $\gamma$ the rate, $\delta$ the degree of the template and $|w|$ the length of the word.
Safety
PathCompleteCertificates.SafetyCertificate — Type
SafetyCertificateA path-complete barrier certificate, its margin of separation between $X_0$ and $X_u$, positive when safety is certified, and the multipliers of the S-procedure, initial_multipliers and unsafe_multipliers, one per node. With the piecewise quadratic template, each entry holds one multiplier per cone. The polyhedral templates need no multipliers, so their entries are nothing, and their margin is in the units of their gauges.
PathCompleteCertificates.SafetyProblem — Type
SafetyProblem(system, S0, Su)The safety problem of an input-free switched linear system (Anand et al., 2024): no trajectory from the initial set $X_0$ reaches the unsafe set $X_u$. Each set is $\{x : [x; 1]^\top S [x; 1] \ge 0\}$, for S = S0 and S = Su.
With the quadratic template, the barrier at node $s$ is $V_s(x) = [x; 1]^\top P_s [x; 1]$, with $P_s$ symmetric, possibly indefinite. With SumOfSquaresTemplate(r), it is a polynomial of degree at most $2r$. With the piecewise quadratic template, it is $x^\top P_{s,k} x - 1$ on each cone, with $P_{s,k}$ positive semidefinite.
PathCompleteCertificates.certify — Method
certify(template, graph, problem; optimizer, check_path_complete = true)Solve the barrier program, which maximizes the margin, and return a SafetyCertificate.
PathCompleteCertificates.optimization_model — Method
optimization_model(template, graph, problem; optimizer, check_path_complete = true)Build, without solving, the barrier program. The quadratic, sum-of-squares and piecewise quadratic templates impose the node conditions by the S-procedure, with one multiplier per cone for the piecewise quadratic template. The polyhedral templates impose them with linear and second-order cone constraints, for an ellipsoidal $X_0$ and an $X_u$ outside an ellipsoid.
Optimal control
PathCompleteCertificates.OptimalControlCertificate — Type
OptimalControlCertificateA node function $V_s$ and a gain $K_s$ at each node $s$. With QuadraticTemplate(), certify computes both. With the other templates, the gains are fixed.
- The policy applies $u = K_s x$, where $s$ minimizes $V_s(x)$.
simulateruns it. - Its worst-case cost $J_\phi(x)$, and so the robust value function $J^\star(x)$, is at most $\min_s V_s(x)$, which calling the certificate at
xreturns.
PathCompleteCertificates.OptimalControlProblem — Type
OptimalControlProblem(system, Q, R; p = 2)The optimal-control problem of a switched linear system with an input (Ninite et al., 2026), with the stage cost $\ell(x, u) = (x^\top Q x)^{p/2} + (u^\top R u)^{p/2}$, for Q and R symmetric positive definite. The default p = 2 gives the quadratic cost, and p = 4 a quartic one.
Q and R may instead be polytopes $\mathcal Q$ and $\mathcal R$, or convex SetProg.Sets.Piecewise sets with linear pieces. The stage cost is then $\ell(x, u) = g_{\mathcal Q}(x)^p + g_{\mathcal R}(u)^p$, with p = 1 by default. What works with what says which templates each cost accepts.
PathCompleteCertificates.certify — Method
certify(template, graph, problem; optimizer, psd_margin = 1e-4)A state-feedback policy and an upper bound on its worst-case cost, as an OptimalControlCertificate. With QuadraticTemplate() and p = 2, the node functions $V_s(x) = x^\top P_s x$ and the gains are computed together, and the program maximizes $\sum_s \log\det P_s^{-1}$.
PathCompleteCertificates.optimization_model — Method
optimization_model(template, graph, problem; optimizer, psd_margin = 1e-4)Build, without solving, the program that computes the node functions and the gains together, for QuadraticTemplate() and p = 2. The edge inequality is convex in the variables S = P⁻¹ and Y = KS, and is imposed as a SetProg inclusion through the polar $L_2$ sum.
PathCompleteCertificates.simulate — Method
simulate(certificate::OptimalControlCertificate, x0, modes)
simulate(certificate::OptimalControlCertificate, x0, horizon::Integer;
rng = Random.default_rng())Run the closed loop under the policy of certificate along modes, or along horizon modes drawn uniformly at random, and return a Trajectory. At each state x, the policy applies the gain of the node whose function is smallest at x: u = K_s x with s ∈ argmin V_s(x) (Ninite et al., 2026).
PathCompleteCertificates.certify — Method
certify(template, graph, problem::OptimalControlProblem;
optimizer, gains = nothing, margin = 0,
initialization_optimizer = optimizer,
initialization_psd_margin = 1e-4, psd_margin = 1e-4)The best node functions for fixed gains, with the templates of the fixed-gain optimization_model, as an OptimalControlCertificate. Without gains, they are the gains of the quadratic certificate for the same Q and R and p = 2, or for identity costs when Q and R are polytopes. initialization_optimizer computes them, so it must solve semidefinite programs, and certify throws if that certificate is infeasible.
edge_slacks reads the smallest eigenvalue of the certificate of each edge, or its linear or second-order cone slack for the piecewise linear template.
PathCompleteCertificates.optimization_model — Method
optimization_model(template, graph, problem::OptimalControlProblem;
optimizer, gains, margin = 0, psd_margin = 1e-4)Build, without solving, the program of the node functions for fixed gains, one matrix $K_s$ per node. The degree $\delta$ of the node functions must be the exponent p of the cost:
SumOfSquaresTemplate(r; convex = true)withp = 2r, a semidefinite program.PiecewiseQuadraticTemplatewithp = 2, a semidefinite program.PiecewiseLinearTemplatewithp = 1, a linear program, orp = 2, a second-order cone program. The node functions are then $g_{\Omega_s}^p$.
A vector of templates gives a different partition at each node. The edge inequality is imposed as a SetProg inclusion through the polar $L_p$ sum. The objective minimizes the integrals of the node functions, or of their gauges for the piecewise linear template, over a bounded region. margin adds a multiple of $\|x\|^p$ to the stage cost.