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

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

source

Certificates

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 by is_feasible.
source
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.

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

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

source
PathCompleteCertificates.is_feasible — Method
is_feasible(certificate) -> Bool

Whether the solve produced a certificate. false means none exists in this template on this graph, not that the property fails.

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

source

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.

source

Stability

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.

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

source
PathCompleteCertificates.is_jsr_exact — Method
is_jsr_exact(certificate; atol = 1e-4) -> Bool

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

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

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

source

Safety

PathCompleteCertificates.SafetyCertificate — Type
SafetyCertificate

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

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

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

source

Optimal control

PathCompleteCertificates.OptimalControlCertificate — Type
OptimalControlCertificate

A 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)$. simulate runs 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 x returns.
source
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.

source
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}$.

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

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

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

source
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) with p = 2r, a semidefinite program.
  • PiecewiseQuadraticTemplate with p = 2, a semidefinite program.
  • PiecewiseLinearTemplate with p = 1, a linear program, or p = 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.

source