1 Introduction

Many applications like, e.g., controller synthesis, state estimation, and formal verification, are based on algorithms that compute with sets [7, 11, 12, 28]. The performance of these algorithms therefore mainly depends on efficient set representations. Ideally, a set representation is not only closed under all relevant set operations, but can also compute these efficiently. We introduce constrained polynomial zonotopes, a novel non-convex set representation that is closed under linear map, Minkowski sum, Cartesian product, convex hull, intersection, union, and quadratic as well as higher-order maps. The computational complexity for these operations is at most polynomial in the representation size. Together with our efficient methods for representation size reduction, constrained polynomial zonotopes are well suited for many algorithms computing with sets.

1.1 Related work

Over the past years, many different set representations have been used in or developed for set-based computations. Relations between typical set representations are illustrated in Fig. 1. Moreover, Table 1 shows which set representations are closed under relevant set operations.

Fig. 1
figure 1

Visualization of the relations between the different set representations, where A \(\rightarrow \) B denotes that B is a generalization of A

Table 1 Relation between set representations and set operations

All convex sets can equivalently be represented by their support function [17, Chapter C.2]. In addition, linear map, Minkowski sum, Cartesian product, and convex hull are trivial to compute for support functions [16, Prop. 2]. Even though support functions are closed under intersection, there exists no closed-form expression for the computation of this operation, and support functions are not closed under union and quadratic maps. Ellipsoids and polytopes are special cases of sets represented by support functions [16, Prop. 1]. While ellipsoids are only closed under linear map (see Table 1), polytopes are closed under linear map, Minkowski sum, Cartesian product, convex hull, and intersection [15, Chapter 3.1]. The computational complexity of the set operations for polytopes depends on the used representation [30], where the two main representations for polytopes are the halfspace representation and the vertex representation: Linear maps represented by invertible matrices and intersections are cheap to compute for the halfspace representation, while linear maps represented by non-invertible matrices, Minkowski sums, and convex hulls are computationally expensive [30]. If redundant points are not removed, computation of linear maps, Minkowski sums, and convex hulls is trivial for the vertex representation, whereas calculating intersections is NP-hard [30].

An important subclass of polytopes are zonotopes [31, Chapter 7.3]. Since zonotopes can be represented compactly by so-called generators, they are well suited for the representation of high-dimensional sets. In addition, linear maps, Minkowski sums, and Cartesian products can be computed exactly and efficiently [4, Table 1]. Two extensions of zonotopes are zonotope bundles [6] and constrained zonotopes [29], which are both able to represent any bounded polytope. Constrained zonotopes additionally consider linear equality constraints for the zonotope factors, whereas zonotope bundles represent the set implicitly by the intersection of several zonotopes. Two special cases of zonotopes are parallelotopes, which are zonotopes with linearly independent generators, and multi-dimensional intervals. Since intervals are not closed under linear map, algorithms computing with intervals often split them to obtain a desired accuracy [18].

Common non-convex set representations are star sets, level sets, Taylor models, and polynomial zonotopes. The concept of star sets [8, 13] is similar to the one of constrained zonotopes, but logical predicates instead of linear equality constraints are used to constrain the values of the zonotope factors. Level sets of nonlinear functions [25] can represent any shape. While star sets and level sets are very expressive (see Fig. 1), it is for many of the relevant operations unclear how they are computed (see Table 1). Taylor models [24] consist of a polynomial and an interval remainder part. A set representation that is very similar to Taylor models are polynomial zonotopes, which were first introduced in [2]. A computationally efficient sparse representation of polynomial zonotopes was recently proposed in [21]. Due to their polynomial nature, Taylor models and polynomial zonotopes are both closed under quadratic and higher-order maps (see Table 1).

In this work we introduce constrained polynomial zonotopes, a novel non-convex set representation that combines the concept of adding equality constraints for the zonotope factors used by constrained zonotopes [29] with the sparse polynomial zonotope representation in [21]. Constrained polynomial zonotopes are closed under all relevant set operations (see Table 1) and can represent any set in Fig. 1, except star sets, level sets, and sets defined by their support function. As shown in Table 1, constrained polynomial zonotopes are the only set representation for which closed-form expressions for the calculation of all relevant set operations are known.

1.2 Notation and assumptions

In the remainder of this work, we use the following notations: Sets are denoted by calligraphic letters, matrices by uppercase letters, and vectors by lowercase letters. Moreover, the set of natural numbers is denoted by \({\mathbb {N}} = \{1, 2,\dots \}\), the set of natural numbers including zero is denoted by \({\mathbb {N}}_0 = \{0, 1, 2, \dots \}\), and the set of real numbers is denoted by \({\mathbb {R}}\). Given a set \({\mathcal {H}} = \{h_1,\dots ,h_n\}\), \(|{\mathcal {H}}| = n\) denotes the cardinality of the set. Given a vector \(b \in {\mathbb {R}}^n\), \(b_{(i)}\) refers to the i-th entry. Likewise, given a matrix \(A \in {\mathbb {R}}^{n \times w}\), \(A_{(i,\cdot )}\) represents the i-th matrix row, \(A_{(\cdot ,j)}\) the j-th column, and \(A_{(i,j)}\) the j-th entry of matrix row i. Given a set of positive integer indices \({\mathcal {H}} = \{h_1,\dots ,h_{|{\mathcal {H}}|} \}\) with \(\forall i \in \{ 1, \dots , |{\mathcal {H}}| \},~1 \le h_i \le w\), notation \(A_{(\cdot ,{\mathcal {H}})}\) is used for \([ A_{( \cdot ,h_1 )} ~ \dots ~ A_{( \cdot , h_{|{\mathcal {H}}|} )} ]\), where [C D] denotes the concatenation of two matrices C and D. The symbols \({\textbf{0}}\) and \({\textbf{1}}\) represent matrices and vectors of zeros and ones of proper dimension, and \(\text {diag}(a)\) returns a square matrix with \(a \in {\mathbb {R}}^n\) on the diagonal. The empty matrix is denoted by [ ] and the identity matrix of dimension \(n \times n\) is denoted by \(I_n \in {\mathbb {R}}^{n \times n}\). Moreover, we use the shorthand \({\mathcal {I}} = [l,u]\) for an n-dimensional interval \({\mathcal {I}}:= \{x \in {\mathbb {R}}^n~|~l_{(i)} \le x_{(i)} \le u_{(i)},~i = 1,\dots ,n\}\). For the derivation of computational complexity, we consider all binary operations, except concatenations; initializations are also not considered.

2 Definitions

Let us first provide some definitions that are important for the remainder of the paper. We begin with zonotopes:

Definition 1

(Zonotope) [14, Def. 1] Given a constant offset \(c \in {\mathbb {R}}^n\) and a generator matrix \(G \in {\mathbb {R}}^{n \times p}\), a zonotope \({\mathcal {Z}} \subset {\mathbb {R}}^n\) is defined as

The scalars \(\alpha _k\) are called factors and we use the shorthand \({\mathcal {Z}} = \langle c,G \rangle _Z\). \(\square \)

Constrained zonotopes [29] can represent arbitrary bounded polytopes:

Definition 2

(Constrained zonotope) [29, Def. 3] Given a constant offset \(c \in {\mathbb {R}}^n\), a generator matrix \(G \in {\mathbb {R}}^{n \times p}\), a constraint matrix \(A \in {\mathbb {R}}^{m \times p}\), and a constraint vector \(b \in {\mathbb {R}}^m\), a constrained zonotope \(\mathcal{C}\mathcal{Z} \subset {\mathbb {R}}^n\) is defined as

We use the shorthand \(\mathcal{C}\mathcal{Z} = \langle c,G,A,b \rangle _{CZ}\). \(\square \)

Polynomial zonotopes are a non-convex set representation first introduced in [2]. We use the sparse representation of polynomial zonotopes [21]:

Definition 3

(Polynomial zonotope) [21, Def. 1] Given a constant offset \(c \in {\mathbb {R}}^n\), a generator matrix \(G \in {\mathbb {R}}^{n \times h}\), and an exponent matrix \(E \in {\mathbb {N}}_{0}^{p \times h}\), a polynomial zonotope \(\mathcal{P}\mathcal{Z} \subset {\mathbb {R}}^n\) is defined as

In contrast to [21, Def. 1], we explicitly do not integrate the constant offset c in G, and we do not consider independent generators since each polynomial zonotope with independent generators can be equivalently represented as a polynomial zonotope without independent generators [22, Prop. 1]. We use the shorthand \(\mathcal{P}\mathcal{Z} = \langle c,G,E \rangle _{PZ}\). \(\square \)

An ellipsoid is defined as follows:

Definition 4

(Ellipsoid) [10, Eq. 2.3] Given a constant offset \(c \in {\mathbb {R}}^n\) and a symmetric and positive definite matrix \(Q \in {\mathbb {R}}^{n \times n}\), an ellipsoid \({\mathcal {E}} \subset {\mathbb {R}}^n\) is defined as

$$\begin{aligned} {\mathcal {E}}:= \big \{ x ~ \big | ~ (x-c)^T Q^{-1} (x-c) \le 1 \big \}. \end{aligned}$$

We use the shorthand \({\mathcal {E}} = \langle c,Q \rangle _{E}\). \(\square \)

In this paper we consider the standard set operations listed in Table 1. Given two sets \({\mathcal {S}}_1, {\mathcal {S}}_2 \subset {\mathbb {R}}^n\), a set \({\mathcal {S}}_3 \subset {\mathbb {R}}^w\), a matrix \(M \in {\mathbb {R}}^{w \times n}\), and a discrete set of matrices \({\mathcal {Q}} = \{Q_1,\dots ,Q_w\}\) with \(Q_i \in {\mathbb {R}}^{n \times n}\), \(i = 1, \dots , w\), these operations are defined as follows:

$$\begin{aligned}&\text {Linear map:} ~~{} & {} M \otimes {\mathcal {S}}_1 := \big \{ M s_1 ~\big |~ s_1 \in {\mathcal {S}}_1 \big \} \end{aligned}$$
(1)
$$\begin{aligned}&\text {Minkowski sum:}{} & {} {\mathcal {S}}_1 \oplus {\mathcal {S}}_2 := \big \{ s_1 + s_2 ~\big |~ s_1 \in {\mathcal {S}}_1,~ s_2 \in {\mathcal {S}}_2 \big \} \end{aligned}$$
(2)
$$\begin{aligned}&\text {Cartesian prod.:} ~~~{} & {} {\mathcal {S}}_1 \times {\mathcal {S}}_3 := \big \{ [s_1^T ~ s_3^T ]^T ~\big |~ s_1 \in {\mathcal {S}}_1,~ s_3 \in {\mathcal {S}}_3 \big \} \end{aligned}$$
(3)
$$\begin{aligned}&\text {Convex hull}:{} & {} conv({\mathcal {S}}_1,{\mathcal {S}}_2) := \left\{ \sum _{i=1}^{n+1} \lambda _i\,s_i~\bigg |~s_i \in {\mathcal {S}}_1 \cup {\mathcal {S}}_2,~\lambda _i \ge 0,~\sum _{i=1}^{n+1} \lambda _i = 1 \right\} \end{aligned}$$
(4)
$$\begin{aligned}&\text {Quadratic map:}{} & {} sq({\mathcal {Q}},{\mathcal {S}}_1) := \big \{ x ~\big |~ x_{(i)} = s_1^T Q_i s_1, ~s_1 \in {\mathcal {S}}_1,~ i = 1, \dots , w \big \} \end{aligned}$$
(5)
$$\begin{aligned}&\text {Intersection:}{} & {} {\mathcal {S}}_1 \cap {\mathcal {S}}_2 := \big \{ s ~\big |~ s \in {\mathcal {S}}_1,~ s \in {\mathcal {S}}_2 \big \} \end{aligned}$$
(6)
$$\begin{aligned}&\text {Union:}{} & {} {\mathcal {S}}_1 \cup {\mathcal {S}}_2 := \big \{ s ~\big |~ s \in {\mathcal {S}}_1 \vee s \in {\mathcal {S}}_2 \big \} \end{aligned}$$
(7)

Moreover,Footnote 1 we consider another set operation that we refer to as the linear combination of two sets:

(8)

For convex sets, the convex hull and the linear combination are identical. However, for non-convex sets as considered in this paper, the two operations differ.Footnote 2 We consider both operations since for many algorithms, such as reachability analysis [1, Eq. (3.4)], it is sufficient to compute the linear combination instead of the convex hull.

3 Constrained polynomial zonotopes

In this section, we introduce constrained polynomial zonotopes (CPZs). A CPZ is constructed by adding polynomial equality constraints to a polynomial zonotope:

Definition 5

(Constrained polynomial zonotope) Given a constant offset \(c \in {\mathbb {R}}^n\), a generator matrix \(G \in {\mathbb {R}}^{n \times h}\), an exponent matrix \(E \in {\mathbb {N}}_{0}^{p \times h}\), a constraint generator matrix \(A \in {\mathbb {R}}^{m \times q}\), a constraint vector \(b \in {\mathbb {R}}^m\), and a constraint exponent matrix \(R\in {\mathbb {N}}_{0}^{p \times q}\), a constrained polynomial zonotope is defined as

The constrained polynomial zonotope is regular if the exponent matrix E and the constrained exponent matrix R do not contain duplicate columns or all-zero columns:

$$\begin{aligned} \forall i,j \in \{1,\dots ,h\}, ~ (i \ne j) \Rightarrow \big (E_{(\cdot ,i)} \ne E_{(\cdot ,j)}\big ) ~~ \textrm{and} ~~ \forall i \in \{1,\dots ,h\}, ~ E_{(\cdot ,i)} \ne {\textbf{0}}, \end{aligned}$$

and

$$\begin{aligned} \forall i,j \in \{1,\dots ,q \},~ (i \ne j) \Rightarrow \big (R_{(\cdot ,i)} \ne R_{(\cdot ,j)}\big ) ~~ \textrm{and} ~~ \forall i \in \{1,\dots ,q \}, ~ R_{(\cdot ,i)} \ne {\textbf{0}}. \end{aligned}$$

The scalars \(\alpha _k\) are called factors, where the number of factors is p, the number of generators \(G_{(\cdot ,i)}\) is h, the number of constraints is m, and the number of constraint generators \(A_{(\cdot ,i)}\) is q. The order \(\rho = \frac{h+q}{n}\) estimates the complexity of a constrained polynomial zonotope. We use the shorthand \(\mathcal {CPZ} = \langle c,G,E,A,b,R\rangle _{CPZ}\). \(\square \)

All components of a set \(\square _i\) have index i, e.g., the parameter \(p_i\), \(h_i\), \(m_i\), and \(q_i\) as defined in Definition 5 belong to \(\mathcal {CPZ}_i\). The quantity of scalar numbers \(\mu \) required to store a CPZ is

$$\begin{aligned} \mu = (n+p)h + n + (m+p)q + m \end{aligned}$$
(9)

since c has n entries, G has nh entries, E has ph entries, A has mq entries, b has m entries, and \(R\) has pq entries. We call \(\mu \) the representation size of the CPZ. Moreover, we call the polynomial zonotope \(\mathcal{P}\mathcal{Z} = \langle c,G,E \rangle _{PZ}\) corresponding to \(\mathcal {CPZ} = \langle c,G,E,A,b,R\rangle _{CPZ}\) the constructing polynomial zonotope. For the derivation of the computational complexity of set operations with respect to the dimension n, we make the assumption that

$$\begin{aligned} p = a_p n, ~ h = a_h n, ~ q = a_q n, ~ m = a_m n, \end{aligned}$$
(10)

with \(a_p,a_h,a_q,a_m \in {\mathbb {R}}_{\ge 0}\). This assumption is justified by the fact that one usually reduces the representation size to a desired upper bound when computing with CPZs.

We demonstrate the concept of CPZs by an example:

Example 1

The CPZ

defines the set

which is visualized in Fig. 2.

Fig. 2
figure 2

Visualization of the polynomial constraint (left), the constrained polynomial zonotope (right, red), and the corresponding constructing polynomial zonotope (right, blue) for \(\mathcal {CPZ}\) from Example 1

4 Preliminaries

We begin with some preliminary results that are required throughout this paper.

4.1 Identities

Let us first establish some identities that are useful for subsequent derivations. According to the definition of CPZs in Definition 5, it holds that

(11)

and

(12)

4.2 Transformation to a regular representation

Some set operations result in a CPZ that is not regular. We therefore introduce operations that transform a non-regular CPZ into a regular one. The compactGen operation returns a CPZ with a regular exponent matrix:

Proposition 1

(Compact generators) Given \(\mathcal {CPZ} = \langle c,G,E,A,b,R\rangle _{CPZ} \subset {\mathbb {R}}^n\), the operation compactGen returns a representation of \(\mathcal {CPZ}\) with a regular exponent matrix and has complexity \({\mathcal {O}}(p h \log (h) + nh)\):

$$\begin{aligned} { \texttt {compactGen}}(\mathcal {CPZ}) = \left\langle \underbrace{c + \sum _{i \in {\mathcal {K}}} G_{(\cdot ,i)}}_{{\overline{c}}}, \underbrace{\bigg [ \sum _{i \in {\mathcal {H}}_1} G_{(\cdot ,i)} \dots \sum _{i \in {\mathcal {H}}_w} G_{(\cdot ,i)} \bigg ]}_{{\overline{G}}}, {\overline{E}}, A,b,R\right\rangle \raisebox {-8pt}{CPZ} \end{aligned}$$

with

$$\begin{aligned}{} & {} {\mathcal {K}} = \big \{i~\big |~\forall k \in \{1,\dots ,p\},~ E_{(k,i)} = 0 \big \}, ~~ {\overline{E}} = { \texttt {uniqueColumns}}\big ( E_{(\cdot ,{\mathcal {N}})} \big ) \in {\mathbb {N}}_{0}^{p \times w}, \\{} & {} {\mathcal {N}} = \{1,\dots ,h\} \setminus {\mathcal {K}},~~ {\mathcal {H}}_j = \big \{ i~ \big |~ \forall k \in \{1, \dots , p\}, ~ {\overline{E}}_{(k,j)} = E_{(k,i)} \big \},~~ j = 1,\dots ,w, \end{aligned}$$

where the operation uniqueColumns removes identical matrix columns until all columns are unique.

Proof

For a CPZ where the exponent matrix \(E = [e ~ e]\) consists of two identical columns \(e \in {\mathbb {N}}_{0}^{p}\), it holds that

Summation of the generators for terms \(\alpha _1^{e_{(1)}} \cdot \ldots \cdot \alpha _p^{e_{(p)}}\) with identical exponents therefore does not change the set, which proves that \({ \texttt {compactGen}}(\mathcal {CPZ}) = \mathcal {CPZ}\). In addition, since the operation uniqueColomns removes all identical matrix columns and we add all-zero columns to the constant offset, it holds that the resulting exponent matrix \({\overline{E}}\) is regular according to Definition 5.

Complexity We assume that the operation uniqueColumns in combination with the construction of the sets \({\mathcal {H}}_j\) is implemented by first sorting the matrix columns, followed by an identification of identical neighbors. Moreover, we assume that in order to sort the matrix columns one first sorts the entries in the first row. For all columns with identical entries in the first row one then sorts the columns according to the entries in the second row. Since this process is continued for all p matrix rows and the complexity for sorting one row of the matrix \(E_{(\cdot ,{\mathcal {N}})} \in {\mathbb {R}}^{p \times |{\mathcal {N}}|}\) is \({\mathcal {O}}(|{\mathcal {N}}| \log (|{\mathcal {N}}|))\) [19, Chapter 5], sorting the matrix columns has a worst-case complexity of \({\mathcal {O}}(p |{\mathcal {N}}| \log (|{\mathcal {N}}|))\), which is \({\mathcal {O}}(ph \log (h))\) since \(|{\mathcal {N}}| \le h\). The identification and removal of identical neighbors requires at most \(p(h-1)\) comparison operations and therefore has worst-case complexity \({\mathcal {O}}(p(h-1))\). Moreover, construction of the sets \({\mathcal {K}}\) and \({\mathcal {N}}\) has complexity \({\mathcal {O}}(ph)\) in the worst case. Finally, the construction of the constant offset \({\overline{c}}\) and the generator matrix \({\overline{G}}\) has complexity \({\mathcal {O}}(nh)\) in the worst case. The overall complexity is therefore \({\mathcal {O}}(p h \log (h)) + {\mathcal {O}}(p(h-1)) + {\mathcal {O}}(ph) + {\mathcal {O}}(nh) = {\mathcal {O}}(p h \log (h) + nh)\). \(\square \)

The compactCon operation returns a CPZ with a regular constraint exponent matrix:

Proposition 2

(Compact constraints) Given \(\mathcal {CPZ} = \langle c,G,E,A,b,R\rangle _{CPZ} \subset {\mathbb {R}}^n\), the operation compactCon returns a representation of \(\mathcal {CPZ}\) with a regular constraint exponent matrix and has complexity \({\mathcal {O}}(p q \log (q) + mq)\):

$$\begin{aligned} { \texttt {compactCon}}(\mathcal {CPZ}) = \bigg \langle c, G, E, \bigg [ \sum _{i \in {\mathcal {H}}_1} A_{(\cdot ,i)} ~ \dots ~ \sum _{i \in {\mathcal {H}}_w} A_{(\cdot ,i)} \bigg ], b - \sum _{i\in {\mathcal {K}}} A_{(\cdot ,i)}, {\overline{R}} \bigg \rangle _{CPZ} \end{aligned}$$

with

$$\begin{aligned}{} & {} {\mathcal {K}} = \big \{ i~ \big | ~ \forall k \in \{1,\dots ,p\},~ R_{(k,i)} = 0 \big \},~~ {\overline{R}} = { \texttt {uniqueColumns}}( R_{(\cdot ,{\mathcal {N}})} ) \in {\mathbb {N}}_{0}^{p \times w},\\{} & {} {\mathcal {N}} = \{1,\dots ,q\} \setminus {\mathcal {K}}, ~~ {\mathcal {H}}_j = \big \{ i~ \big |~ \forall k \in \{1, \dots , p\}, ~ {\overline{R}}_{(k,j)} = R_{(k,i)} \big \},~~ j = 1,\dots ,w, \end{aligned}$$

where the operation uniqueColumns removes identical matrix columns until all columns are unique.

Proof

The proof is analogous to the proof for Proposition 1. \(\square \)

4.3 Lifted polynomial zonotopes

Finally, we introduce the lifted polynomial zonotope corresponding to a CPZ in the following lemma, which is inspired by [29, Prop. 3]:

Lemma 1

(Lifted polynomial zonotope) Given \(\mathcal {CPZ} = \langle c,G,E,A,b,R\rangle _{CPZ} \subset {\mathbb {R}}^n\), the corresponding lifted polynomial zonotope \(\mathcal{P}\mathcal{Z}^+ \subset {\mathbb {R}}^{n+m}\) defined as

(13)

satisfies

$$\begin{aligned} \forall x \in {\mathbb {R}}^n,~~ \big ( x \in \mathcal {CPZ} \big ) \Leftrightarrow \bigg ( \begin{bmatrix} x \\ {\textbf{0}} \end{bmatrix} \in \mathcal{P}\mathcal{Z}^+ \bigg ). \end{aligned}$$

Proof

With the definition of CPZs in Definition 5 we obtain

where \(\alpha = [\alpha _1 ~\dots ~\alpha _p]^T\). \(\square \)

According to Lemma 1, a CPZ can be interpreted as the intersection of the lifted polynomial zonotope \(\mathcal{P}\mathcal{Z}^+\) with the subspace \(\{x \in {\mathbb {R}}^{n+m}~|~ x_{(n+1)},\dots ,x_{(n+m)} = 0 \}\). Moreover, with the lifted polynomial zonotope we can transfer results for polynomial zonotopes to CPZs, as we demonstrate later. Potential redundancies in the lifted polynomial zonotope due to common columns in the exponent and the constraint exponent matrix can be removed using the compact operation for polynomial zonotopes in [21, Prop. 2].

4.4 Rescaling

Later, in Sects. 6 and 8, we describe how to enclose CPZs by other set representations and how to reduce the representation size of a CPZ by enclosing it with a simpler CPZ. The tightness of these enclosures mainly depends on the size of the corresponding constructing polynomial zonotope. Since the constraints often intersect only part of the factor hypercube , we can reduce the size of the constructing polynomial zonotope in advance to obtain tighter results. This can be achieved with a contractor:

Definition 6

(Contractor) [18, Chapter 4.1] Given an interval \({\mathcal {I}} \subset {\mathbb {R}}^p\) and a vector field \(f:~{\mathbb {R}}^p \rightarrow {\mathbb {R}}^m\) which defines the constraint \(f(x) = {\textbf{0}}\), the operation \({ \texttt {contract}}\) returns an interval that satisfies

$$\begin{aligned} { \texttt {contract}}\big (f(x),{\mathcal {I}}\big ) \subseteq {\mathcal {I}} \end{aligned}$$

and

$$\begin{aligned} \forall x \in {\mathcal {I}}, ~~ \big ( f(x) = {\textbf{0}}\big ) \Rightarrow \big ( x \in { \texttt {contract}}\big (f(x),{\mathcal {I}}\big )\big ), \end{aligned}$$

so that it is guaranteed that all solutions for \(f(x) = {\textbf{0}}\) contained in \({\mathcal {I}}\) are also contained in the contracted interval.

There exist many sophisticated approaches for implementing a contractor, an overview of which is provided in [18, Chapter 4]. Given \(\mathcal {CPZ} = \langle c,G,E,A,b,R\rangle _{CPZ} \subset {\mathbb {R}}^n\), we can compute a tighter domain for the factors by applying a contractor to the polynomial constraint of the CPZ:

Using the contracted domain [lu], the \(\mathcal {CPZ}\) can be equivalently represented as

$$\begin{aligned} \mathcal {CPZ} = \bigg \{ c + \sum _{i=1}^{h} \bigg ( \prod _{k=1}^p \alpha _k^{E_{(k,i)}} \bigg ) G_{(\cdot ,i)} \, \bigg | \, \sum _{i=1}^{q} \bigg ( \prod _{k=1}^p \alpha _k^{R_{(k,i)}} \bigg ) A_{(\cdot ,i)} = b, \, [\alpha _1~\dots ~\alpha _p]^T \in [l,u] \bigg \}. \end{aligned}$$

We show in Appendix B that this set can be represented as a CPZ. Let us demonstrate rescaling by an example:

Example 2

We consider the CPZ

which is visualized in Fig. 3. As depicted on the left side of Fig. 3, the constraint only intersects a small part of the factor domain , so that the domain can be contracted to . Rescaling therefore significantly reduces the size of the constructing polynomial zonotope, as visualized on the right side of Fig. 3.

Fig. 3
figure 3

Visualization of rescaling for \(\mathcal {CPZ}\) from Example  (red, right), where the corresponding constraint is visualized on the left. The constructing polynomial zonotope before rescaling is shown in blue, and the constructing polynomial zonotope after rescaling is shown in green

5 Conversion from other set representations

This section shows how other set representations can be converted to CPZs.

5.1 Taylor models, intervals, and zonotopic set representations

Since a polynomial zonotope is simply a CPZ without constraints, the conversion is trivial in this case. For polynomial zonotopes that are defined with additional independent generators as in [21, Def. 1], one can first convert the polynomial zonotope to a polynomial zonotope without independent generators using [22, Prop. 1]. According to [21, Prop. 4], the set defined by a Taylor model can be equivalently represented as a polynomial zonotope. Moreover, according to [21, Prop. 3] any zonotope can be represented as a polynomial zonotope, and any interval can be represented as a zonotope [1, Prop. 2.1]. Finally, a constrained zonotope is a special case of a CPZ where all polynomial functions are linear, so the conversion is straightforward. In summary, we therefore obtain the following conversion rules:

$$\begin{aligned}&\text {Interval:}{} & {} {\mathcal {I}} = [l,u] = \langle 0.5(u+l),0.5 \, \text {diag}(u-l),I_n,[~],[~],[~] \rangle _{CPZ} \end{aligned}$$
(14)
$$\begin{aligned}&\text {Zonotope:}{} & {} {\mathcal {Z}} = \langle c,G \rangle _Z = \langle c,G,I_p,[~],[~],[~] \rangle _{CPZ} \end{aligned}$$
(15)
$$\begin{aligned}&\text {Constrained zonotope:} ~~~{} & {} \mathcal{C}\mathcal{Z} = \langle c,G,A,b \rangle _{CZ} = \langle c, G, I_p, A, b, I_p \big \rangle _{CPZ} \end{aligned}$$
(16)
$$\begin{aligned}&\text {Polynomial zonotope:} ~~{} & {} \mathcal{P}\mathcal{Z} = \langle c,G,E \rangle _{PZ} = \langle c,G,E,[~],[~],[~] \rangle _{CPZ} \end{aligned}$$
(17)

The conversion of an interval has complexity \({\mathcal {O}}(n)\) with respect to the dimension n due to the summation and subtraction of the vectors l and u, while all other conversions have constant complexity \({\mathcal {O}}(1)\) since no computations are required.

5.2 Polytopes

There are two possibilities to represent a bounded polytope as a CPZ. According to [20] and [21, Theorem 1], every bounded polytope can be represented as a polynomial zonotope. Therefore, any bounded polytope can be converted to a CPZ by first representing it as a polynomial zonotope followed by a conversion of the polynomial zonotope to a CPZ using (17). Moreover, it holds according to [29, Theorem 1] that any bounded polytope can be represented as a constrained zonotope. Consequently, the second possibility for the conversion of a bounded polytope to a CPZ is to first represent the polytope as a constrained zonotope, and then convert the constrained zonotope to a CPZ using (16). Which of the two methods results in a more compact representation depends on the polytope.

5.3 Ellipsoids

Any ellipsoid can be converted to a CPZ:

Proposition 3

(Conversion ellipsoid) An ellipsoid \({\mathcal {E}} = \langle c,Q \rangle _E \subset {\mathbb {R}}^n\) can be equivalently represented by a CPZ:

(18)

where the eigenvalues \(\lambda _1,\dots ,\lambda _n\), the matrix of eigenvalues D, and the matrix of eigenvectors V are obtained by the eigenvalue decomposition

$$\begin{aligned} Q = V \underbrace{\begin{bmatrix} \lambda _1 &{}\quad &{}\quad 0 \\ {} &{}\quad \ddots &{}\quad \\ 0 &{}\quad &{}\quad \lambda _n \end{bmatrix}}_{D} V^T. \end{aligned}$$
(19)

The complexity of the conversion is \({\mathcal {O}}(n^3)\).

Proof

The matrices \(A,R\) and the vector b in (18) define the constraint

(20)

Since , (20) is equivalent to the constraint

$$\begin{aligned} 0 \le \alpha _1^2 + \dotsc + \alpha _n^2 \le 1. \end{aligned}$$
(21)

Using the eigenvalue decomposition of the matrix Q from (19) it holds that

$$\begin{aligned} Q^{-1} \overset{(19)}{=} (VDV^T)^{-1} = V D^{-1} V^T \end{aligned}$$
(22)

since V is an orthonormal matrix satisfying \(V^{-1} = V^T\). Inserting (22) into the definition of an ellipsoid in Definition 4 yields

$$\begin{aligned} \begin{aligned} {\mathcal {E}} \overset{\begin{array}{c} \text {Def.}~4\\ \vspace{-3pt} \end{array}}{=}&\big \{ x ~ \big | ~ (x-c)^T Q^{-1} (x-c) \le 1 \big \} = \big \{ c + x ~ \big | ~ x^T Q^{-1} x \le 1 \big \}\\ \overset{\tiny \begin{array}{c} (22) \\ \vspace{-3pt} \end{array}}{=}&\big \{ c + x ~ \big | ~ (V^T x)^T D^{-1} (V^T x) \le 1 \big \}\\ \overset{\begin{array}{c} z:=V^Tx \\ \end{array}}{=}&\big \{ c + Vz ~ \big | ~ z^T D^{-1} z \le 1 \big \} \overset{\tiny \begin{array}{c} (19) \\ \vspace{-3pt} \end{array}}{=} \bigg \{ c + Vz ~ \bigg | ~ \frac{z_{(1)}^2}{\lambda _1} + \dotsc + \frac{z_{(n)}^2}{\lambda _n} \le 1 \bigg \}. \end{aligned} \end{aligned}$$
(23)

We define the factors \(\alpha _k\) of the CPZ as \(\alpha _k = \frac{z_{(k)}}{\sqrt{\lambda _k}}\), \(k = 1,\dots ,n\), so that

$$\begin{aligned} z_{(k)} = \sqrt{\lambda _k} ~ \alpha _k. \end{aligned}$$
(24)

Inserting (24) into (23) finally yields

which concludes the proof.

Complexity Computation of the eigenvalue decomposition \(Q = V^T D V\) in (19) has complexity \({\mathcal {O}}(n^3)\) [26]. The computation of G in (18) requires \(n^2\) multiplications and the calculation of n square roots and therefore has complexity \({\mathcal {O}}(n^2) + {\mathcal {O}}(n) = {\mathcal {O}}(n^2)\). Since all other required operations are concatenations, the overall complexity results by adding the complexity of the eigenvalue decomposition and the complexity of computing G, which yields \({\mathcal {O}}(n^2) + {\mathcal {O}}(n^3) = {\mathcal {O}}(n^3)\). \(\square \)

6 Enclosure by other set representations

To speed up computations, one often encloses sets by simpler set representations in set-based computing. In this section, we therefore show how to enclose CPZs by constrained zonotopes, polynomial zonotopes, zonotopes, and intervals. The over-approximation error for all enclosures can be reduced by applying rescaling as described in Sect. 4.4 in advance. To demonstrate the tightness of the enclosures, we use the CPZ

(25)

as a running example throughout this section.

6.1 Constrained zonotopes

We first show how to enclose a CPZ by a constrained zonotope:

Proposition 4

(Constrained zonotope enclosure) Given \(\mathcal {CPZ} = \langle c,G,E,A,b,[3] R\rangle _{CPZ} \subset {\mathbb {R}}^n\), the operation conZono returns a constrained zonotope that encloses \(\mathcal {CPZ}\):

with

where the compact operation as defined in [21, Prop. 2] returns a regular polynomial zonotope and the zono operation as defined in [21, Prop. 5] returns a zonotope that encloses a polynomial zonotope. The computational complexity is \({\mathcal {O}}(\mu ^2)\) with respect to the representation size \(\mu \) and \({\mathcal {O}}(n^2 \log (n))\) with respect to the dimension n.

Proof

To obtain an enclosing constrained zonotope we calculate a zonotope enclosure of the corresponding lifted polynomial zonotope as defined in Lemma 1. Back-transformation of the lifted zonotope to the original state space then yields an enclosing constrained zonotope:

$$\begin{aligned} \begin{aligned} \forall x \in {\mathbb {R}}^n, ~~ (x \in \mathcal {CPZ})&\overset{\begin{array}{c} \text {Lemma}~1\\ \end{array}}{\Rightarrow } \bigg ( \begin{bmatrix} x \\ {\textbf{0}} \end{bmatrix} \in \mathcal{P}\mathcal{Z}^+ \bigg ) \\&\overset{\begin{array}{c} \mathcal{P}\mathcal{Z}^+ \subseteq {\mathcal {Z}}^+\\ \end{array}}{\Rightarrow } \bigg ( \begin{bmatrix} x \\ {\textbf{0}} \end{bmatrix} \in {\mathcal {Z}}^+ \bigg ) \overset{\begin{array}{c} \text {Lemma}~1\\ \vspace{-2pt} \end{array}}{\Rightarrow } (x \in \mathcal{C}\mathcal{Z}), \end{aligned} \end{aligned}$$

where we omitted the compact operation since it only changes the representation of the set, but not the set itself.

Complexity Let \(n^+ = n+m\), \(p^+ = p\), and \(h^+ = h + q\) denote the dimension, the number of factors, and the number of generators of the lifted polynomial zonotope \(\mathcal{P}\mathcal{Z}^+\). According to [21, Prop. 2], the compact operation for polynomial zonotopes has complexity \({\mathcal {O}}( p^+ h^+ \log (h^+)) = {\mathcal {O}}(p(h+q)\log (h+q))\). Moreover, the complexity for the zono operation is \({\mathcal {O}}(p^+ h^+) + {\mathcal {O}}(n^+ h^+) = {\mathcal {O}}(p(h+q)) + {\mathcal {O}}((n+m)(h+q))\) according to [21, Prop. 5]. The overall computational complexity is therefore

$$\begin{aligned} {\mathcal {O}}\big (\underbrace{p(h+q)\log (h+q)}_{\overset{(9)}{\le } \mu \log (\mu )}\big ) + {\mathcal {O}}\big (\underbrace{p(h+q)}_{\overset{(9)}{\le } \mu }\big ) + {\mathcal {O}}\big (\underbrace{(n+m)(h+q)}_{\overset{(9)}{\le } \mu ^2}\big ) = {\mathcal {O}}(\mu ^2), \end{aligned}$$

which is \({\mathcal {O}}(n^2 \log (n))\) using (10). \(\square \)

The enclosing constrained zonotope for the CPZ in (25) is shown in Fig. 4.

6.2 Polynomial zonotopes

Clearly, an enclosing polynomial zonotope for a CPZ can simply be obtained by drop** the constraints. However, this might yield large over-approximation errors. Another possibility is to reduce all constraints using Proposition 13 introduced later in Sect. 8. Which method results in the tighter enclosure depends on the CPZ. The resulting enclosing polynomial zonotope for the CPZ in (25) obtained by drop** the constraints is visualized in Fig. 4.

6.3 Zonotopes and intervals

An enclosure of a CPZ by a zonotope or interval can be computed using the previously presented enclosures by constrained zonotopes or polynomial zonotopes. For polynomial zonotopes, an enclosing zonotope can be computed using [21, Prop. 5], and an enclosing interval can be computed based on the support function enclosure in [21, Prop. 7]. For constrained zonotopes, an enclosing zonotope can be calculated by reducing all constraints as described in [29, Sect. 4.2], and an enclosing interval can be computed using linear programming [27, Prop. 1].

Fig. 4
figure 4

Enlosing constrained zonotope (left) and enclosing polynomial zonotope (right) for \(\mathcal {CPZ}\) in (25)

7 Set operations

In this section, we derive closed-form expressions for all set operations introduced in Sect. 2 on CPZs. We begin with the linear map:

Proposition 5

(Linear map) Given \(\mathcal {CPZ} = \langle c,G,E,A,b,R\rangle _{CPZ} \subset {\mathbb {R}}^n\) and a matrix \(M \in {\mathbb {R}}^{w \times n}\), the linear map is

$$\begin{aligned} M \otimes \mathcal {CPZ} = \langle M c, M G,E,A,b,R\rangle _{CPZ}, \end{aligned}$$

which has complexity \({\mathcal {O}}(w \mu )\) with respect to the representation size \(\mu \) and complexity \({\mathcal {O}}(w n^2)\) with respect to the dimension n. The resulting CPZ is regular if \(\mathcal {CPZ}\) is regular.

Proof

The result follows directly from inserting the definition of CPZs in Definition 5 into the definition of the operator \(\otimes \) in (1).

Complexity The complexity results from the complexity of matrix multiplications and is therefore \({\mathcal {O}}(wnh) + {\mathcal {O}}(wn) = {\mathcal {O}}(wnh)\). Since \(nh \le \mu \) according to (9), it holds that \({\mathcal {O}}(wnh) = {\mathcal {O}}(w\mu )\). Using (10), it furthermore holds that \({\mathcal {O}}(wnh) = {\mathcal {O}}(w n^2)\). \(\square \)

Next, we consider the Minkowski sum:

Proposition 6

(Minkowski sum) Given \(\mathcal {CPZ}_1 = \langle c_1,G_1, E_1, A_1, b_1, R_1 \rangle _{CPZ} \subset {\mathbb {R}}^n\) and \(\mathcal {CPZ}_2 = \langle c_2, G_2, E_2, A_2,b_2, R_2 \rangle _{CPZ} \subset {\mathbb {R}}^n\), their Minkowski sum is

$$\begin{aligned} \mathcal {CPZ}_1 \oplus \mathcal {CPZ}_2 = \bigg \langle c_1 + c_2, \begin{bmatrix} G_1&\quad G_2 \end{bmatrix}, \begin{bmatrix} E_1 &{}\quad {\textbf{0}} \\ {\textbf{0}} &{}\quad E_2 \end{bmatrix}, \begin{bmatrix} A_1 &{}\quad {\textbf{0}} \\ {\textbf{0}} &{}\quad A_2 \end{bmatrix}, \begin{bmatrix} b_1 \\ b_2 \end{bmatrix}, \begin{bmatrix} R_1 &{}\quad {\textbf{0}} \\ {\textbf{0}} &{}\quad R_2 \end{bmatrix} \bigg \rangle _{CPZ}, \end{aligned}$$

which has complexity \({\mathcal {O}}(n)\) with respect to the dimension n. The resulting CPZ is regular if \(\mathcal {CPZ}_1\) and \(\mathcal {CPZ}_2\) are regular.

Proof

The result is obtained by inserting the definition of CPZs in Definition 5 into the definition of the Minkowski sum in (2):

where we used the identities (11) and (12).

Complexity The computation of the new constant offset \(c_1 + c_2\) has complexity \({\mathcal {O}}(n)\). Since all other operations required for the construction of the resulting CPZ are concatenations, it holds that the overall complexity is \({\mathcal {O}}(n)\). \(\square \)

Now, we provide a closed-form expression for the Cartesian product:

Proposition 7

(Cartesian product) Given \(\mathcal {CPZ}_1 = \langle c_1, G_1, E_1, A_1,b_1, R_1 \rangle _{CPZ} [3] \subset {\mathbb {R}}^n\) and \(\mathcal {CPZ}_2 = \langle c_2, G_2, E_2, A_2, b_2, R_2 \rangle _{CPZ} \subset {\mathbb {R}}^w\), their Cartesian product is

$$\begin{aligned} \mathcal {CPZ}_1 \times \mathcal {CPZ}_2 = \bigg \langle \begin{bmatrix} c_1 \\ c_2 \end{bmatrix} \begin{bmatrix} G_1 &{}\quad {\textbf{0}} \\ {\textbf{0}} &{}\quad G_2 \end{bmatrix}, \begin{bmatrix} E_1 &{}\quad {\textbf{0}} \\ {\textbf{0}} &{}\quad E_2 \end{bmatrix}, \begin{bmatrix} A_1 &{}\quad {\textbf{0}} \\ {\textbf{0}} &{}\quad A_2 \end{bmatrix}, \begin{bmatrix} b_1 \\ b_2 \end{bmatrix}, \begin{bmatrix} R_1 &{}\quad {\textbf{0}} \\ {\textbf{0}} &{}\quad R_2 \end{bmatrix} \bigg \rangle _{CPZ}, \end{aligned}$$

which has complexity \({\mathcal {O}}(1)\). The resulting CPZ is regular if \(\mathcal {CPZ}_1\) and \(\mathcal {CPZ}_2\) are regular.

Proof

The result is obtained by inserting the definition of CPZs in Definition 5 into the definition of the Cartesian product in (3):

where we used the identities in (11) and (12).

Complexity The construction of the resulting CPZ only involves concatenations and therefore has constant complexity \({\mathcal {O}}(1)\). \(\square \)

Before we examine the convex hull, we first derive a closed-form expression for the linear combination since we can reuse this result for the convex hull:

Proposition 8

(Linear combination) Given \(\mathcal {CPZ}_1 = \langle c_1, G_1, E_1, A_1, b_1, [3]R_1 \rangle _{CPZ} \subset {\mathbb {R}}^n\) and \(\mathcal {CPZ}_2 = \langle c_2, G_2, E_2,A_2, b_2, R_2 \rangle _{CPZ} \subset {\mathbb {R}}^n\), their linear combination is

which has complexity \({\mathcal {O}}(\mu _1 + \mu _2)\) with respect to the representation sizes \(\mu _1\) and \(\mu _2\) and complexity \({\mathcal {O}}(n^2)\) with respect to the dimension n. The resulting CPZ is regular if \(\mathcal {CPZ}_1\) and \(\mathcal {CPZ}_2\) are regular.

Proof

The result is obtained by inserting the definition of CPZs in Definition 5 into the definition of the linear combination in (8):

where we used the identities in (11) and (12). For the transformation in the last line, we substituted \(\lambda \) with an additional factor \(\alpha _{p_1 + p_2 + 1}\). Since and , the substitution does not change the set.

Complexity The construction of the constant offset \(c = 0.5(c_1 + c_2)\) requires n additions and n multiplications. Moreover, the construction of the generator matrix requires n subtractions and \(n (2 h_1+2 h_2+ 1)\) multiplications. The overall complexity is therefore

$$\begin{aligned} {\mathcal {O}}(2n) + {\mathcal {O}}\big (n (2h_1 + 2 h_2 + 2)\big ) = {\mathcal {O}}\big (\underbrace{n (h_1 + h_2)}_{\overset{(9)}{\le } \mu _1 + \mu _2}\big ) = {\mathcal {O}}(\mu _1 + \mu _2), \end{aligned}$$
(26)

which is \({\mathcal {O}}(n^2)\) using (10). \(\square \)

The convex hull can be computed based on the linear combination:

Proposition 9

(Convex hull) Given \(\mathcal {CPZ}_1 = \langle c_1, G_1, E_1, A_1, b_1, R_1 \rangle _{CPZ} \subset {\mathbb {R}}^n\) and \(\mathcal {CPZ}_2 [3] = \langle c_2, G_2, E_2,A_2, b_2, R_2 \rangle _{CPZ} \subset {\mathbb {R}}^n\), their convex hull is

with

$$\begin{aligned}{} & {} \langle c,G,E,A,b,R\rangle _{CPZ} = comb(\mathcal {CPZ}_1,\mathcal {CPZ}_2),~ a = n +1, ~ {\overline{c}} = \begin{bmatrix} c&\quad \dots&\quad c \end{bmatrix} \in {\mathbb {R}}^{n \times a}, ~\nonumber \\{} & {} \quad {\overline{G}} = \begin{bmatrix} G&\quad \dots&\quad G \end{bmatrix} \in {\mathbb {R}}^{n \times ah},~{\overline{E}} = \begin{bmatrix} E &{}\quad &{}\quad {\textbf{0}} \\ &{}\quad \ddots &{} &{}\quad \\ {\textbf{0}} &{}\quad &{}\quad E \end{bmatrix} \in {\mathbb {R}}^{ap \times ah},\nonumber \\{} & {} {\widehat{E}} = \begin{bmatrix} {\textbf{1}} &{}\quad &{}\quad {\textbf{0}} \\ &{}\quad \ddots &{}\quad \\ {\textbf{0}} &{}\quad &{}\quad {\textbf{1}} \end{bmatrix} \in {\mathbb {R}}^{a \times ah}, ~~~~ {\overline{A}} = \begin{bmatrix} A &{}\quad &{}\quad {\textbf{0}} \\ &{}\quad \dots &{}&{}\quad \\ {\textbf{0}} &{}\quad &{}\quad A \end{bmatrix} \in {\mathbb {R}}^{a m \times a q},~\nonumber \\{} & {} {\overline{b}} = \begin{bmatrix} b \\ \vdots \\ b \end{bmatrix} \in {\mathbb {R}}^{am},{\overline{R}} = \begin{bmatrix} R&{}\quad &{}\quad {\textbf{0}}\\ &{}&{}\quad \ddots &{}\quad \\ {\textbf{0}} &{}\quad &{}\quad R\end{bmatrix} \in {\mathbb {R}}^{ap \times a q}, \end{aligned}$$
(27)

where the linear combination \(comb(\mathcal {CPZ}_1,\mathcal {CPZ}_2)\) is calculated using Proposition 8 and the scalars p, h, q, and m denote respectively the number of factors, the number of generators, the number of constraint generators, and the number of constraints of the CPZ \(\langle c,G,E,A,b,R\rangle _{CPZ}\). The complexity is \({\mathcal {O}}(\mu _1 + \mu _2)\) with respect to the representation sizes \(\mu _1\) and \(\mu _2\) and \({\mathcal {O}}(n^2)\) with respect to the dimension n. The resulting CPZ is regular if \(\mathcal {CPZ}_1\) and \(\mathcal {CPZ}_2\) are regular.

Proof

According to the definition of the convex hull in (4), the definition of the union in (7), and the definition of the linear combination in (8), it holds that

$$\begin{aligned} \mathcal {CPZ}_1 \cup \mathcal {CPZ}_2 \subseteq comb(\mathcal {CPZ}_1,\mathcal {CPZ}_2) \subseteq conv(\mathcal {CPZ}_1,\mathcal {CPZ}_2). \end{aligned}$$
(28)

The relation in (28) allows us to substitute the union in the definition of the convex hull in (4) with the linear combination. This yields a resulting CPZ with fewer factors compared to using the union according to Theorem 1, which is often advantageous:

where we used the identities in (11) and (12). For the transformation in the last line, we substituted the scalars \({\widehat{\lambda }}_j\) by additional factors \(\alpha _{ap + j}\). Since and , the substitution does not change the set.

Complexity The calculation of the linear combination \(comb(\mathcal {CPZ}_1,\mathcal {CPZ}_2)\) using Proposition 8 has complexity \({\mathcal {O}}(n (h_1 + h_2))\) according to (26). Moreover, the construction of the constant offset \(a \, c\) requires n multiplications and therefore has complexity \({\mathcal {O}}(n)\). Since all other operations that are required are initializations and concatenations which have constant complexity \({\mathcal {O}}(1)\), the overall complexity for the computation of the convex hull is

$$\begin{aligned} {\mathcal {O}}\big (n (h_1 + h_2)\big ) + {\mathcal {O}}(n) + {\mathcal {O}}(1) = {\mathcal {O}}\big (\underbrace{n (h_1 + h_2)}_{\overset{(9)}{\le } \mu _1 + \mu _2}\big ) = {\mathcal {O}}(\mu _1 + \mu _2), \end{aligned}$$

which is \({\mathcal {O}}(n^2)\) using (10). \(\square \)

For the convex hull \(conv(\mathcal {CPZ}) = conv(\mathcal {CPZ},\mathcal {CPZ})\) of a single set \(\mathcal {CPZ}\), we can exploit that \(\mathcal {CPZ} \cup \mathcal {CPZ} = \mathcal {CPZ}\) holds to obtain a more compact representation. Next, we consider the quadratic map:

Proposition 10

(Quadratic map) Given \(\mathcal {CPZ} = \langle c,G,E,A,b,R\rangle _{CPZ} \subset {\mathbb {R}}^n\) and a discrete set of matrices \({\mathcal {Q}} = \{ Q_1,\dots ,Q_w \}\) with \(Q_{i} \in {\mathbb {R}}^{n \times n}, i = 1, \dots , w\), the quadratic map is

$$\begin{aligned} sq({\mathcal {Q}},\mathcal {CPZ}) = \bigg \langle {\overline{c}}, \begin{bmatrix} {\widehat{G}}_1 + {\widehat{G}}_2&\quad {\overline{G}}_1&\quad \dots&\quad {\overline{G}}_{h} \end{bmatrix}, \begin{bmatrix} E&\quad {\overline{E}}_1&\quad \dots&\quad {\overline{E}}_{h} \end{bmatrix},A,b,R\bigg \rangle _{CPZ} \end{aligned}$$

with

$$\begin{aligned} {\overline{c}} = \begin{bmatrix} c^T Q_{1} c \\ \vdots \\ c^T Q_{w} c \end{bmatrix}, ~~ {\widehat{G}}_1 = \begin{bmatrix} c^T Q_{1} G \\ \vdots \\ c^T Q_{w} G \end{bmatrix}, ~~ {\widehat{G}}_2 = \begin{bmatrix} c^T Q_{1}^T G \\ \vdots \\ c^T Q_{w}^T G \end{bmatrix}, \\ {\overline{E}}_j = E + E_{(\cdot ,j)} \, {\textbf{1}}, ~~ {\overline{G}}_j = \begin{bmatrix} G_{(\cdot ,j)}^T Q_{1} G \\ \vdots \\ G_{(\cdot ,j)}^T Q_{w} G \end{bmatrix}, ~ j = 1, \dots , h. \end{aligned}$$

The compactGen operation is applied to obtain a regular CPZ. The complexity is \({\mathcal {O}}(\mu ^2 w) + {\mathcal {O}}(\mu ^2 \log (\mu ))\) with respect to the representation size \(\mu \) and \({\mathcal {O}}(n^3( w + \log (n)))\) with respect to the dimension n.

Proof

The result is obtained by inserting the definition of CPZs in Definition  5 into the definition of the quadratic map in (5), which yields

Note that only the generator matrix, but not the exponent matrix, is different for each dimension \(x_{(i)}\).

Complexity The construction of the constant offset \({\overline{c}}\) has complexity \({\mathcal {O}}(w n^2)\) and the construction of the matrices \({\widehat{G}}_1\) and \({\widehat{G}}_2\) has complexity \({\mathcal {O}}(n^2\,h w)\). Moreover, the construction of the matrices \({\overline{E}}_j\) has complexity \({\mathcal {O}}(h^2 p)\), and the construction of the matrices \({\overline{G}}_j\) has complexity \({\mathcal {O}}(n^2\,h w) + {\mathcal {O}}(n h^2 w)\) if the results for \(Q_i G\) are stored and reused. The resulting CPZ has dimension \({\overline{n}} = w\) and consists of \({\overline{h}} = h^2 + h\) generators. Consequently, subsequent application of the compactGen operation has complexity \({\mathcal {O}}(p {\overline{h}} \log ({\overline{h}}) + {\overline{n}}{\overline{h}}) = {\mathcal {O}}(p (h^2 + h) \log (h^2 + h) + w(h^2 + h))\) according to Proposition 1. The resulting overall complexity is

$$\begin{aligned} \begin{aligned}&{\mathcal {O}}(w n^2) + {\mathcal {O}}(n^2 h w) + {\mathcal {O}}(h^2 p) + {\mathcal {O}}(n^2 h w) + {\mathcal {O}}(n h^2 w) \\&\qquad + {\mathcal {O}}\big (p (h^2 + h) \log (h^2 + h) + w(h^2 + h)\big ) \\&\quad = {\mathcal {O}}(\underbrace{n^2 h w}_{\overset{(9)}{\le } \mu ^2 w}) + {\mathcal {O}}(\underbrace{n h^2 w}_{\overset{(9)}{\le } \mu ^2 w}) + {\mathcal {O}}\big (\underbrace{p (h^2 + h)}_{\overset{(9)}{\le } \mu ^2} \log (\underbrace{h^2 + h}_{\overset{(9)}{\le } \mu ^2 }) + \underbrace{ w(h^2 + h)}_{\overset{(9)}{\le } \mu ^2 w}\big ) \\&\quad = {\mathcal {O}}(\mu ^2 w) + {\mathcal {O}}(\mu ^2 \log (\mu )), \end{aligned} \end{aligned}$$

which is \({\mathcal {O}}(n^3( w + \log (n)))\) using (10). \(\square \)

The extension to cubic or higher-order maps of sets as well as the extension to mixed quadratic maps involving two different CPZs are straightforward and therefore omitted. We continue with the intersection:

Proposition 11

(Intersection) Given \(\mathcal {CPZ}_1 = \langle c_1,G_1, E_1, A_1, b_1, R_1 \rangle _{CPZ} \subset {\mathbb {R}}^n\) and \(\mathcal {CPZ}_2 = \langle c_2, G_2, E_2,A_2, b_2, R_2 \rangle _{CPZ} \subset {\mathbb {R}}^n\), their intersection is

which has complexity \({\mathcal {O}}\left( (\mu _1 + \mu _2)^2 \log (\mu _1 + \mu _2)\right) \) with respect to the representation sizes \(\mu _1\) and \(\mu _2\) and complexity \({\mathcal {O}}(n^2 \log (n))\) with respect to the dimension n. The compactCon operation is applied to obtain a regular CPZ.

Proof

The outline of the proof is inspired by [29, Prop. 1]. We compute the intersection by restricting the factors \(\alpha _k\) of \(\mathcal {CPZ}_1\) to values that belong to points that are located inside \(\mathcal {CPZ}_2\), which is identical to adding the equality constraint

$$\begin{aligned} \underbrace{c_1 + \sum _{i=1}^{h_1} \bigg ( \prod _{k=1}^{p_1} \alpha _k^{E_{1(k,i)}} \bigg ) G_{1(\cdot ,i)}}_{x \, \in \, \mathcal {CPZ}_1} = \underbrace{c_2 + \sum _{i=1}^{h_2} \bigg ( \prod _{k=1}^{p_2} \alpha _{p_1+k}^{E_{2(k,i)}} \bigg ) G_{2(\cdot ,i)}}_{x \, \in \, \mathcal {CPZ}_2} \end{aligned}$$

to \(\mathcal {CPZ}_1\):

where we used the identity in (12).

Complexity Computation of \(c_2-c_1\) has complexity \({\mathcal {O}}(n)\). The resulting CPZ has \(p = p_1 + p_2\) factors, \(q = q_1 + q_2 + h_1 + h_2\) constraint generators, and \(m = m_1 + m_2 + n\) constraints. Since the subsequent application of the compactCon operation has complexity \({\mathcal {O}}(p q \log (q) + m q)\) according to Proposition 2, we therefore obtain an overall complexity of

$$\begin{aligned} \begin{aligned} {\mathcal {O}}(n)&+ {\mathcal {O}}\big ((\underbrace{p_1 + p_2}_{\overset{(9)}{\le } \mu _1 + \mu _2})(\underbrace{q_1 + q_2 + h_1 + h_2}_{\overset{(9)}{\le } \mu _1 + \mu _2}) \log (\underbrace{q_1 + q_2 + h_1 + h_2}_{\overset{(9)}{\le } \mu _1 + \mu _2})\big ) \\&+ {\mathcal {O}}\big ( (\underbrace{m_1 + m_2 + n}_{\overset{(9)}{\le } \mu _1 + \mu _2})(\underbrace{q_1 + q_2 + h_1 + h_2}_{\overset{(9)}{\le } \mu _1 + \mu _2})\big ) = {\mathcal {O}}\big ((\mu _1 + \mu _2)^2 \log (\mu _1 + \mu _2)\big ), \end{aligned} \end{aligned}$$

which is \({\mathcal {O}}(n^2 \log (n))\) using (10). \(\square \)

As a last operation, we consider the union:

Theorem 1

(Union) Given \(\mathcal {CPZ}_1 = \langle c_1, G_1, E_1, A_1,b_1 R_1 \rangle _{CPZ} \subset {\mathbb {R}}^n\) and \(\mathcal {CPZ}_2 = \langle c_2, G_2, [3] E_2, A_2,b_2, R_2 \rangle _{CPZ} \subset {\mathbb {R}}^n\), their union is

with

which has complexity \({\mathcal {O}}\left( (\mu _1 + \mu _2)\mu _1 \mu _2 \log (\mu _1 \mu _2) \right) \) with respect to the representation sizes \(\mu _1\) and \(\mu _2\) and \({\mathcal {O}}(n^3 \log (n))\) with respect to the dimension n. The compactCon operation is applied to obtain a regular CPZ.

Proof

The proof is provided in Appendix A.

Complexity We first consider the assembly of the resulting CPZ. The computation of the vectors \(0.5(c_1 + c_2)\) and \(0.5(c_1 - c_2)\) requires n additions, n subtractions, and 2n multiplications. Moreover, computation of , \(0.5\, b_1\) and \(0.5 \, b_2\) requires \(2m_1 + m_2\) multiplications. Computation of the matrix \({\overline{A}}\) requires 3 multiplications and 2 divisions. Since the construction of the remaining matrices only involves concatenations, the resulting complexity for the construction of the CPZ is

$$\begin{aligned} {\mathcal {O}}(4n + 2m_1 + m_2 + 5) = {\mathcal {O}}(\underbrace{n + m_1 + m_2}_{\overset{(9)}{\le } \mu _1 + \mu _2}) = {\mathcal {O}}(\mu _1 + \mu _2). \end{aligned}$$
(29)

Next, we consider the subsequent application of the compactCon operation. The constraint generator matrix A for the resulting CPZ has \(q = 1 + {\widehat{q}} + {\overline{q}} + q_1 + q_2 = 4 + 2p_1 + 2p_2 + 2 p_1 p_2 + q_1 + q_2\) columns since \({\widehat{A}}\) has one column (\({\widehat{q}} = 1\)), \({\overline{A}}\) has \({\overline{q}} = 2 + 2p_1 + 2p_2 + 2p_1 p_2\) columns, \(A_1\) has \(q_1\) columns, and \(A_2\) has \(q_2\) columns. Moreover, the matrix A has \(m = {\widehat{m}} + {\overline{m}} + m_1 + m_2 = 2 + m_1 + m_2\) rows since \({\widehat{A}}\) has one row (\({\widehat{m}} = 1\)), \({\overline{A}}\) has one row (\({\overline{m}} = 1\)), \(A_1\) has \(m_1\) rows, and \(A_2\) has \(m_2\) rows. The number of factors of the resulting CPZ is \(p = p_1 + p_2 + 2\). Since the complexity of the compactCon operation is \({\mathcal {O}}(pq\log (q) + m q)\) according to Proposition 2, subsequent application of compactCon has complexity

$$\begin{aligned}{} & {} {\mathcal {O}}\big ((p_1 + p_2 + 2)(4 + 2p_1 + 2p_2 + 2 p_1 p_2 + q_1 + q_2)\log (4 + 2p_1 + 2p_2 + 2 p_1 p_2 + q_1 + q_2) \big ) \nonumber \\{} & {} \qquad + {\mathcal {O}} \big ((2 + m_1 + m_2) (2 + 2p_1 + 2p_2 + 2 p_1 p_2 + q_1 + q_2)\big ) \nonumber \\{} & {} \quad = {\mathcal {O}}\big ((\underbrace{p_1 + p_2}_{\overset{(9)}{\le } \mu _1 + \mu _2})(\underbrace{p_1 + p_2 + p_1 p_2 + q_1 + q_2}_{\overset{(9)}{\le } \mu _1 \mu _2})\log (\underbrace{p_1 + p_2 + p_1 p_2 + q_1 + q_2}_{\overset{(9)}{\le } \mu _1 \mu _2})\big ) \nonumber \\{} & {} \qquad + {\mathcal {O}}\big ( (\underbrace{m_1 + m_2}_{\overset{(9)}{\le } \mu _1 + \mu _2}) (\underbrace{p_1 + p_2 + p_1 p_2 + q_1 + q_2}_{\overset{(9)}{\le } \mu _1 \mu _2})\big ) = {\mathcal {O}}\big ( (\mu _1 + \mu _2)\mu _1 \mu _2 \log (\mu _1 \mu _2) \big ). \end{aligned}$$
(30)

Combining (29) and (30) yields

$$\begin{aligned} {\mathcal {O}}(\mu _1 + \mu _2) + {\mathcal {O}}\big ( (\mu _1 + \mu _2)\mu _1 \mu _2 \log (\mu _1 \mu _2) \big ) = {\mathcal {O}}\big ( (\mu _1 + \mu _2)\mu _1 \mu _2 \log (\mu _1 \mu _2) \big ) \end{aligned}$$

for the overall complexity with respect to the representation sizes \(\mu _1\) and \(\mu _2\). Using (10) it furthermore holds that the overall complexity resulting from the combination of (29) and (30) is identical to \({\mathcal {O}}(n^3 \log (n))\). \(\square \)

Table 2 Growth of the number of generators h, the number of factors p, the number of constraints m, and the number of constraint generators q for basic set operations on n-dimensional CPZs

8 Representation size reduction

As shown in Table 2, many operations on CPZs significantly increase the number of factors, generators, constraints, and constraint generators, and consequently also the representation size. For computational reasons, an efficient strategy for representation size reduction is therefore crucial when computing with CPZs. Thus, we now introduce the operations reduce and reduceCon for reducing the number of generators and the number of constraints of a CPZ. For both operations the tightness of the result can be improved by applying rescaling as described in Sect. 4.4 in advance.

8.1 Order reduction

Our method for reducing the number of generators is inspired by order reduction for constrained zonotopes [29, Sect. 4.3] and applies order reduction for polynomial zonotopes:

Proposition 12

(Order reduction) Given \(\mathcal {CPZ} = \langle c,G,E,A,b,R\rangle _{CPZ} \subset {\mathbb {R}}^n\) and a desired order \(\rho _d \ge 2 \frac{n+m}{n}\), the operation reduce returns a CPZ with an order smaller than or equal to \(\rho _d\) that encloses \(\mathcal {CPZ}\):

with

where the sets \({\mathcal {H}}\) and \({\mathcal {K}}\) defined as

$$\begin{aligned} {\mathcal {H}} = \big \{i~\big |~ \exists j \in \{1,\dots ,n\},~{\overline{G}}_{(j,i)} \ne 0 \big \}, ~~ {\mathcal {K}} = \big \{i~\big |~ \exists j \in \{1,\dots ,m \},~{\overline{A}}_{(j,i)} \ne 0 \big \} \end{aligned}$$
(31)

store the indices of non-zero generators. The compact operation as defined in [21, Prop. 2] returns a regular polynomial zonotope and the reduce operation for polynomial zonotopes as defined in [21, Prop. 16] reduces the order to \(\rho _d^+\). The resulting CPZ is regular and the complexity is \({\mathcal {O}}(\mu ^2) + {\mathcal {O}}({ \texttt {reduce}})\) with respect to the representation size \(\mu \) and \({\mathcal {O}}(n^2) + {\mathcal {O}}({ \texttt {reduce}})\) with respect to the dimension n, where \({\mathcal {O}}({ \texttt {reduce}})\) is the complexity of order reduction for zonotopes.

Proof

To calculate a reduced-order CPZ, we reduce the order of the corresponding lifted polynomial zonotope as defined in Lemma 1 using the reduce operation for polynomial zonotopes in [21, Prop. 16]. Back-transformation of the lifted polynomial zonotope to the original state space yields an over-approximative CPZ, which can be proven using Lemma 1:

$$\begin{aligned} \begin{aligned} \forall x \in {\mathbb {R}}^n,~~&(x \in \mathcal {CPZ}) \overset{\begin{array}{c} \text {Lemma}~1\\ \end{array}}{\Rightarrow } \bigg ( \begin{bmatrix} x \\ {\textbf{0}} \end{bmatrix} \in \mathcal{P}\mathcal{Z}^+ \bigg ) \overset{\begin{array}{c} \mathcal{P}\mathcal{Z}^+ \subseteq \, { \texttt {reduce}}(\mathcal{P}\mathcal{Z}^+,\rho _d^+)\\ \end{array}}{\Rightarrow } \\&\bigg ( \begin{bmatrix} x \\ {\textbf{0}} \end{bmatrix} \in { \texttt {reduce}}(\mathcal{P}\mathcal{Z}^+,\rho _d^+) \bigg ) \overset{\begin{array}{c} \text {Lemma}~1\\ \end{array}}{\Rightarrow } \big ( x \in { \texttt {reduce}}(\mathcal {CPZ},\rho _d) \big ), \end{aligned} \end{aligned}$$

where we omitted the compact operation since it only changes the representation of the set, but not the set itself. It remains to show that the order of the resulting CPZ is smaller than or equal to the desired order \(\rho _d\). According to [21, Prop. 16], we have

$$\begin{aligned} \frac{{\overline{h}}}{n^+} = \frac{{\overline{h}}}{n + m} \le \rho _d^+ = \frac{\rho _d \, n}{2(n+m)}, \end{aligned}$$
(32)

where \({\overline{h}}\) denotes the number of columns of the matrix \({\overline{G}}\) and \(n^+ = n + m\) is the dimension of the lifted polynomial zonotope \(\mathcal{P}\mathcal{Z}^+\). Solving (32) for \(\rho _d\) yields \(2 \, {\overline{h}} / n \le \rho _d\) so that

$$\begin{aligned} \rho = \frac{|{\mathcal {H}}| + |{\mathcal {K}}|}{n} \overset{\begin{array}{c} (31) \\ \end{array}}{\le } 2 \, \frac{{\overline{h}}}{n} \le \rho _d \end{aligned}$$

holds since the number of elements in the sets \({\mathcal {H}}\) and \({\mathcal {K}}\) is at most \({\overline{h}}\) according to (31).

Complexity Let \(n^+ = n+m\), \(p^+ = p\), and \(h^+ = h + q\) denote the dimension, the number of factors, and the number of generators of the lifted polynomial zonotope \(\mathcal{P}\mathcal{Z}^+\). According to [21, Prop. 2], the compact operation has complexity \({\mathcal {O}}(p^+ h^+ \log (h^+)) = {\mathcal {O}}(p+(h+q)\log (h+q))\) and the complexity of order reduction of a polynomial zonotope using [21, Prop. 16] is \({\mathcal {O}}(h^+ (n^+ + p^+ + \log (h^+))) + {\mathcal {O}}({ \texttt {reduce}}) = {\mathcal {O}}((h+q)(n+m+p+\log (h+q))) + {\mathcal {O}}({ \texttt {reduce}})\), where \({\mathcal {O}}({ \texttt {reduce}})\) denotes the complexity of order reduction for zonotopes, which depends on the method that is used. Moreover, construction of the sets \({\mathcal {H}}\) and \({\mathcal {K}}\) has complexity \({\mathcal {O}}((h+q)(n+m))\) in the worst case. The overall computational complexity is therefore

$$\begin{aligned} \begin{aligned}&{\mathcal {O}}\big (\underbrace{p+(h+q)\log (h+q)}_{\overset{(9)}{\le } \mu \log (\mu )}\big ) + {\mathcal {O}}\big (\underbrace{(h+q)(n+m+p+\log (h+q))}_{\overset{(9)}{\le } \mu ^2 + \mu \log (\mu )}\big ) + {\mathcal {O}}({ \texttt {reduce}}) \\&= {\mathcal {O}}\big (\mu \log (\mu )\big ) + {\mathcal {O}}\big (\mu ^2 + \mu \log (\mu )\big ) + {\mathcal {O}}({ \texttt {reduce}}) = {\mathcal {O}}(\mu ^2) + {\mathcal {O}}({ \texttt {reduce}}), \end{aligned} \end{aligned}$$

which is \({\mathcal {O}}(n^2) + {\mathcal {O}}({ \texttt {reduce}})\) using (10). \(\square \)

Let us demonstrate the tightness of our order reduction method for CPZs by an example:

Fig. 5
figure 5

Visualization of order reduction using Proposition 12 for the CPZ from Example 3. The original set \(\mathcal {CPZ}\) (right) and the corresponding constraint (left) are depicted in red, and the reduced order CPZ \({ \texttt {reduce}}(\mathcal {CPZ},6)\) (right) is depicted in blue

Example 3

We consider the CPZ

which has order \(\rho = 7\). The resulting CPZ after order reduction to the desired order \(\rho _d = 6\) using Proposition 12 is visualized in Fig. 5, where we used principal component analysis for order reduction of zonotopes [23, Sect. III.A], which is required for order reduction of polynomial zonotopes using [21, Prop. 16].

8.2 Constraint reduction

Next, we present an approach for reducing the number of constraints of a CPZ, which is inspired by constraint reduction for constrained zonotopes [29, Sect. 4.2]:

Proposition 13

(Constraint reduction) Given \(\mathcal {CPZ} = \langle c,G,E,A,b,R\rangle _{CPZ}[3] \subset {\mathbb {R}}^n\), the index of one constraint \(r \in \{1,\dots ,m \}\), and indices \(d,s \in {\mathbb {N}}\) satisfying

$$\begin{aligned} \forall i \in \{1,\dots ,p\},~ E_{(i,d)} = R_{(i,s)} ~~ \text {and} ~~ A_{(r,s)} \ne 0, \end{aligned}$$
(33)

the operation reduceCon removes the constraint with index r and returns a CPZ that encloses \(\mathcal {CPZ}\):

$$\begin{aligned} \mathcal {CPZ} \subseteq { \texttt {reduceCon}}(\mathcal {CPZ},r,d,s) = \big \langle {\overline{c}},{\overline{G}},{\overline{E}}_{({\mathcal {N}},\cdot )},{\overline{A}},{\overline{b}},{\overline{R}}_{({\mathcal {N}},\cdot )} \big \rangle _{CPZ}, \end{aligned}$$

where

and the sets \({\mathcal {H}}\), \({\mathcal {K}}\), and \({\mathcal {N}}\) are defined as

$$\begin{aligned} \begin{aligned}&{\mathcal {H}} = \{1,\dots ,q \} \setminus s, ~~ {\mathcal {K}} = \{1,\dots ,m \} \setminus r, \\&{\mathcal {N}} = \big \{ i ~ \big | ~ \exists j,k,~ {\overline{E}}_{(i,j)} \ne 0 \vee {\overline{R}}_{(i,k)} \ne 0 \big \}. \end{aligned} \end{aligned}$$
(34)

The compactGen operation is applied to make the resulting CPZ regular and the complexity is \({\mathcal {O}}(\mu ^2)\) with respect to the representation size \(\mu \) and \({\mathcal {O}}(n^2 \log (n))\) with respect to the dimension n.

Proof

To remove the constraint with index r, we solve the corresponding equation for the term that is multiplied with the constraint generator with index s:

$$\begin{aligned} \prod _{k=1}^p \alpha _k^{R_{(k,s)}} = \frac{1}{A_{(r,s)}} \bigg ( - \sum _{i \in {\mathcal {H}}} \bigg ( \prod _{k=1}^p \alpha _k^{R_{(k,i)}} \bigg ) A_{(r,i)} + b_{(r)} \bigg ). \end{aligned}$$
(35)

For the constraint with index r, we obtain with the substitution from (35)

$$\begin{aligned} \sum _{i \in {\mathcal {H}}} \bigg ( \prod _{k=1}^p \alpha _k^{R_{(k,i)}} \bigg ) \underbrace{\bigg ( A_{(r,i)} - \frac{1}{A_{(r,s)}} A_{(r,i)} A_{(r,s)} \bigg )}_{= 0} = \underbrace{b_{(r)} - \frac{b_{(r)}}{A_{(r,s)}} A_{(r,s)}}_{=0} \end{aligned}$$
(36)

the trivial constraint \(0 = 0\), which can be removed by restricting the indices of the constraints to the set \({\mathcal {K}}\) as defined in (34). Finally, inserting the substitution in (35) into the definition of a CPZ in Definition 5 yields

The set \({\mathcal {N}}\) as defined in (34) only removes all-zero rows from the exponent matrix and the constraint exponent matrix, and therefore does not change the set.

Complexity The construction of the matrix \({\overline{G}}\) requires nq multiplications, the construction of the matrix \({\overline{A}}\) requires \((m-1)q\) multiplications and \((m-1)(q-1)\) subtractions, and the construction of the vectors \({\overline{c}}\) and \({\overline{b}}\) requires \(n+m-1\) multiplications, n additions, and \(m-1\) subtractions. Let \({\overline{p}} = p\), \({\overline{h}} = h+q - 2\), and \({\overline{q}} = q - 1\) denote the number of factors, the number of generators, and the number of constraint generators of the resulting CPZ. Subsequent application of the compactGen operation has complexity \({\mathcal {O}}({\overline{p}} {\overline{h}} \log ({\overline{h}}) + n {\overline{h}}) = {\mathcal {O}}(p (h+q-2) \log (h+q-2) + n(h+q-2))\) according to Proposition 1, and the construction of the set \({\mathcal {N}}\) in (34) has in the worst case complexity \({\mathcal {O}}({\overline{p}}({\overline{h}}+{\overline{q}})) = {\mathcal {O}}(p(h+2q-2))\). The overall complexity is therefore

$$\begin{aligned} \begin{aligned}&{\mathcal {O}}(nq) + {\mathcal {O}}\big ((m-1)(2q-1)\big ) + {\mathcal {O}}(2n+2m-2) \\&\qquad + {\mathcal {O}}\big ((h+ q - 2)(n+p \log (h + q - 2))\big ) + {\mathcal {O}}\big (p(h+2q-2)\big )\\&\quad = {\mathcal {O}}(\underbrace{mq}_{\overset{(9)}{\le }\mu }) + {\mathcal {O}}\big (\underbrace{(h+q)(n+p \log (h+q))}_{\overset{(9)}{\le }\mu ^2 + \mu \log (\mu )}\big ) = {\mathcal {O}}(\mu ) + {\mathcal {O}}(\mu ^2 + \mu \log (\mu )) = {\mathcal {O}}(\mu ^2), \end{aligned} \end{aligned}$$

which is \({\mathcal {O}}(n^2 \log (n))\) using (10). \(\square \)

The crucial point for Proposition 13 is the selection of the constraint with index r that is removed, as well as the selection of suitable indices sd that satisfy the conditions in (33) and can therefore be used for reduction. Clearly, we want to select the indices r, s, and d such that the over-approximation resulting from constraint reduction is minimized. Since it is computationally infeasible to determine the optimal indices for reduction, we instead present some heuristics on how to choose good values for r, s, and d. When removing a constraint from a CPZ using Proposition 13, there are two sources contributing to the resulting over-approximation:

  1. 1.

    Over-approximation due to lost bounds on factors.

  2. 2.

    Over-approximation due to a loss of dependency.

We now explain both sources in detail and provide illustrative examples.

Over-approximation due to lost bounds

The over-approximation due to lost bounds results from the fact that due to the replacement of the term \(\prod _{k=1}^p \alpha _k^{\begin{array}{c} R_{(k,s)} \\ \end{array}}\) with the solved constraint in (35), we lose the ability to enforce the bounds , where denotes interval multiplication and exponentiation. Consequently, constraint reduction results in an over-approximation if the solved constraint in (35) has feasible values outside the domain , which is equivalent to the condition

(37)

Let us demonstrate this by an example:

Fig. 6
figure 6

Visualization of constraint reduction using Proposition 13 for \(\mathcal {CPZ}\) from Example 4 (red, right), where the corresponding constraint is visualized on the left. While \({ \texttt {reduceCon}}(\mathcal {CPZ},1,1,1)\) (green) results in an over-approximation, \({ \texttt {reduceCon}}(\mathcal {CPZ},1,2,2)\) (blue) is exact

Example 4

We consider the CPZ

which is visualized in Fig. 6. We first choose the indices \(s=1\) and \(d=1\) that correspond to the term \(\alpha _1\) for constraint reduction. In this case, solving the constraint \(\alpha _1 + 2 \alpha _2 + 0.5 \alpha _3^3 = 0\) for \(\alpha _1\) yields \(\alpha _1 = -2 \alpha _2 - 0.5 \alpha _3^3\). As visible in Fig. 6 (left), the solved constraint has feasible values outside the domain :

Constraint reduction using Proposition 13 with the indices \(s=1\) and \(d=1\) therefore results in an over-approximation \({ \texttt {reduceCon}}(\mathcal {CPZ},1,1,1) \supset \mathcal {CPZ}\) (see Fig. 6 (right)). Next, we consider the indices \(s = 2\) and \(d = 2\) that correspond to the term \(\alpha _2\). Solving the constraint for \(\alpha _2\) yields \(\alpha _2 = -0.5 \alpha _1 - 0.25\alpha _3^3\), so that the set of feasible values for the solved constraint is a subset of the domain :

Consequently, constraint reduction using Proposition 13 with the indices \(s = 2\) and \(d = 2\) does not result in an over-approximation, so that \({ \texttt {reduceCon}}(\mathcal {CPZ},1,2,2) = \mathcal {CPZ}\) (see Fig. 6 (right)).

Computing the exact bounds for the solved constraint in (37) is in general computationally infeasible. Instead, one can use range bounding to compute over-approximations of the bounds. Another heuristic that we observed to perform well in practice is to first enclose the CPZ with a constrained zonotope using Proposition 4, and then select the constraint that is removed as well as the indices that are used for reduction based on the constrained zonotope enclosure. For constrained zonotopes, sophisticated methods for selecting the constraints and indices that result in the least over-approximation are available in [29, Appendix].

Fig. 7
figure 7

Visualization of constraint reduction using Proposition 13 for \(\mathcal {CPZ}\) from Example 5 (red, right), where the corresponding constraint is visualized on the left. Due to the loss of dependency, constraint reduction \({ \texttt {reduceCon}}(\mathcal {CPZ},1,2,2)\) (blue) results in an over-approximation

Over-approximation due to loss of dependency

The second source contributing to the over-approximation during constraint reduction is the loss of dependency. This loss arises since if we substitute the term \(\prod _{k=1}^p \alpha _k^{\begin{array}{c} R_{(k,s)} \\ \end{array}}\) with the solved constraint in (35), the dependency between the factors \(\alpha _k\) in \(\prod _{k=1}^p \alpha _k^{\begin{array}{c} R_{(k,s)} \\ \end{array}}\) and the factors \(\alpha _k\) in other terms gets lost. Let us demonstrate this by an example:

Example 5

We consider the CPZ

which is identical to the CPZ from Example 4, except that we added the term \(\alpha _2^2 \alpha _3\). Since the polynomial constraint is identical to the constraint of the CPZ in Example 4, constraint reduction using the indices \(s=2\) and \(d=2\) does not result in an over-approximation due to lost bounds, as we demonstrated in Example 4. However, with the indices \(s=2\) and \(d=2\), we substitute \(\alpha _2\) by the solved constraint \(\alpha _2 = -0.5 \alpha _1 - 0.25\alpha _3^3\), so that the dependency between \(\alpha _2\) in the term \(\alpha _2\) for the second generator and \(\alpha _2\) in the additional term \(\alpha _2^2 \alpha _3\) gets lost. Due to this loss of dependency, constraint reduction using Proposition 13 with indices \(s=2\) and \(d=2\) results in an over-approximation, as visualized in Fig. 7.

In the above example we could prevent the loss of dependency by substituting \(\alpha _2^2\) with \(\alpha _2^2 = (-0.5 \alpha _1 - 0.25\alpha _3^3)^2\), which corresponds to the square of the solved constraint \(\alpha _2 = -0.5 \alpha _1 - 0.25\alpha _3^3\). Similarly, it is possible to relax the condition in (33) to

$$\begin{aligned} \forall i \in \{1,\dots ,p\},~ R_{(i,s)}^e = E_{(i,d)}~~ \text {and} ~~ A_{(r,s)} \ne 0, \end{aligned}$$

which allows powers of the selected term with arbitrary exponents \(e \in {\mathbb {N}}\). While this relaxation often enables us to reduce constraints with less over-approximation, taking powers of the solved constraint significantly increases the number of generators of the resulting CPZ, and therefore also the computational complexity for the subsequent compactGen operation.

9 Numerical example

For the numerical experiments, we implemented CPZs in the MATLAB toolbox CORA [3], which is available at https://cora.in.tum.de. All computations are carried out on a 2.9GHz quad-core i7 processor with 32GB memory.

One often occurring task in set-based computing is to calculate the image of a given initial set under a nonlinear function. We demonstrate by a numerical example that with CPZs the image can be computed exactly if the nonlinear function is polynomial. Let us consider the nonlinear function

(38)

and the polytope \({\mathcal {P}}\) with vertices , , and \([1~0]^T\). The task is to compute the image of \({\mathcal {P}}\) under the nonlinear function f(x). First, we convert the polytope \({\mathcal {P}}\) to a CPZ according to Sect. 5.2 based on a conversion to a polynomial zonotope [20], which yields

Using the linear map in Proposition 5, the quadratic map in Proposition 10, the intersection in Proposition 11, and the union in Theorem 1, we can compute the image exactly as

$$\begin{aligned} \big \{ f(x) ~|~ x \in {\mathcal {P}} \big \} = sq({\mathcal {Q}},{\mathcal {P}} \cap \mathcal {CPZ}_1) \cup \big ( M \otimes ({\mathcal {P}} \cap \mathcal {CPZ}_2)\big ), \end{aligned}$$

where the parameter M and \({\mathcal {Q}}\) for the linear and quadratic map are

and the CPZs

represent the regions \(0.5\, x_{(1)}^2 \le x_{(2)}\) and \(0.5 \, x_{(1)}^2 > x_{(2)}\), respectively. The resulting image is visualized in Fig. 8. Computation of the image takes 0.02 seconds, and the resulting CPZ has \(p = 12\) factors, \(h = 13\) generators, \(m = 8\) constraints, and \(q = 85\) constraint generators, so that the representation size is \(\mu = 1892\).

Fig. 8
figure 8

Visualization of the polytope \({\mathcal {P}}\) (left, red), the boundary of the region \(0.5~x_1^2 \le x_2\) in (38) (left, blue), and the computed image of \({\mathcal {P}}\) under the nonlinear function f(x) in (38) (right)

10 Conclusion

We introduced constrained polynomial zonotopes, a novel non-convex set representation that is closed under linear map, Minkowski sum, Cartesian product, convex hull, intersection, union, and quadratic and higher-order maps. We derived closed-form expressions for all relevant set operations and showed that the computational complexity of all relevant set operations is at most polynomial in the representation size. In addition, we derived closed-form expressions for the representation of zonotopes, polytopes, polynomial zonotopes, Taylor models, and ellipsoids as constrained polynomial zonotopes. Moreover, we demonstrated how to enclose constrained polynomial zonotopes by simpler set representations. In combination with our efficient techniques for representation size reduction, constrained polynomial zonotopes are well suited for many algorithms that compute with sets.