Necessary and Suﬃcient Conditions for the Linearizability of Two-Input Systems by a Two-Dimensional Endogenous Dynamic Feedback

We propose easily veriﬁable necessary and suﬃcient conditions for the linearizability of two-input systems by an endogenous dynamic feedback with a dimension of at most two.


Introduction
The concept of flatness has been introduced in control theory by Fliess, Lévine, Martin and Rouchon, see e. g. Rouchon (1992, 1995). For flat systems, many feed-forward and feedback problems can be solved systematically and elegantly, see e. g. Fliess et al. (1995). Roughly speaking, a nonlinear control system of the formẋ = f (x, u) with dim(x) = n states and dim(u) = m inputs is flat, if there exist m differentially independent functions y j = ϕ j (x, u, u 1 , . . . , u q ), where u k denotes the k-th time derivative of u, such that x and u can locally be parameterized by y and its time derivatives. For this flat parameterization, we write x = F x (y, y 1 , . . . , y r−1 ) , u = F u (y, y 1 , . . . , y r ) and refer to it as the parameterizing map with respect to the flat output y. If the parameterizing map is invertible, i. e. y and all its time derivatives which explicitly occur in the parameterizing map can be expressed solely as functions of x and u, the system is exactly linearizable by static feedback. In this case we call y a linearizing output of the static feedback linearizable system. The static feedback linearization problem has been solved completely, see Jakubczyk and Respondek (1980); Nijmeijer and van der Schaft (1990). However, for flatness there do not exist easily verifiable necessary and sufficient conditions, except for certain classes of systems, including two-input driftless systems, see Martin and Rouchon (1994) and systems which are linearizable by a one-fold prolongation of a suitably chosen control, see Nicolau and Respondek (2017). Necessary and sufficient conditions for (x, u)-flatness of control affine systems with two inputs and four states can be found in Pomet (1997).
It is well known that every flat system can be rendered static feedback linearizable by an endogenous dynamic feedback, and conversely, every system linearizable by an endogenous dynamic feedback is flat. If a flat output is known, such a linearizing feedback can be constructed systematically, see e. g. Fliess, Lévine, Martin, and Rouchon (1999). In this contribution we propose easily verifiable necessary and sufficient conditions for the linearizability of two-input systems by an endogenous dynamic feedback with a dimension of at most two. In Gstöttner, Kolar, and Schöberl (2021), a sequential test for checking whether a two-input system is linearizable by an endogenous dynamic feedback with a dimension of at most two has been proposed recently. The main idea of the sequential test in Gstöttner et al. (2021) is to successively split off or add endogenous dynamic feedbacks to the system in such a way that eventually a static feedback linearizable system is obtained and it is shown that the proposed algorithm succeeds if and only if the original system is indeed linearizable by an at most two-dimensional endogenous dynamic feedback. However, a major drawback of this sequential test is that it requires straightening out involutive distributions, which from a computational point of view is unfavorable. The necessary and sufficient conditions which we propose in the present contribution overcome this computational drawback. Instead of a sequence of systems a certain sequence of distributions is constructed, based on which it can be decided whether the two-input system is linearizable by an endogenous dynamic feedback with a dimension of at most two or not. Constructing these distributions and verifying the proposed conditions requires differentiation and algebraic operations only.
It turns out that systems which are linearizable by an endogenous dynamic feedback with a dimension of at most two are actually linearizable by a special kind of endogenous dynamic feedback, namely prolongations of a suitably chosen input after a suitable static feedback transformation has been applied to the system. A complete solution for the flatness problem for the class of two-input systems which are linearizable by a one-fold prolongation of a suitably chosen control is provided in Nicolau and Respondek (2016b). Two-input systems which are linearizable by a two-fold prolongation of a suitable chosen control are considered in Nicolau and Respondek (2016a). However, no complete solution for the flatness problem of this class of systems is provided in Nicolau and Respondek (2016a), due to Assumption 2 therein. In Section 6, we apply our results to some examples, to none of which the results in Nicolau and Respondek (2016a) are applicable. Normal forms for systems which are linearizable by a one-fold prolongation can be found in Nicolau and Respondek (2019), and normal forms for control affine two-input systems linearizable by a two-fold prolongation have recently been proposed in Nicolau and Respondek (2020). The present contribution is greatly influenced by all these results. The novelty of our contribution are easily verifiable necessary and sufficient conditions for linearizability by a two-fold prolongation, covering also the cases to which the results in Nicolau and Respondek (2016a) do not apply. These necessary and sufficient conditions are also a major improvement over the in principal verifiable but computationally inefficient necessary and sufficient conditions in Gstöttner et al. (2021).
The paper is organized as follows. In Section 2 we introduce the notation used throughout the paper. In Section 3, some preliminaries regarding flatness of two-input systems are presented, and in Section 4 the sequential test from Gstöttner et al. (2021) is recapitulated briefly. The main results of this contribution are presented in Section 5, and in Section 6 they are applied to practical and academic examples.

Notation
Let X be an n-dimensional smooth manifold, equipped with local coordinates x i , i = 1, . . . , n. Its tangent bundle is denoted by (T (X ), τ X , X ), for which we have the induced local coordinates (x i ,ẋ i ) with respect to the basis {∂ x i }. We make use of the Einstein summation convention. By ∂ x h we denote the m × n Jacobian matrix of h = (h 1 , . . . , h m ) with respect to x = (x 1 , . . . , x n ). The k-fold Lie derivative of a function ϕ along a vector field v is denoted by L k v ϕ. Let v and w be two vector fields. Their Lie bracket is denoted by [v, w], for the repeated application of the Lie bracket, we use the common notation ad k v w = [v, ad k−1 v w], k ≥ 1 and ad 0 v w = w. Let furthermore D 1 and D 2 be two distributions. By [v, D 1 ] we denote the distribution spanned by the Lie bracket of v with all basis vector fields of D 1 , and by [D 1 , D 2 ] the distribution spanned by the Lie brackets of all possible pairs of basis vector fields of D 1 and D 2 . The first derived flag of a distribution D is denoted by D (1) and defined by D (1) = D + [D, D]. By C(D), we denote the Cauchy characteristic distribution of D. It is spanned by all vector fields c ∈ D which satisfy [c, D] ⊂ D. The symbols ⊂ and ⊃ are used in the sense that they also include equality. An integer beneath the symbol ⊂ denotes the difference of the dimensions of the distributions involved, e. g. D 1 ⊂ k D 2 means that D 1 ⊂ D 2 and dim(D 2 ) = dim(D 1 ) + k. We make use of multi-indices, in particular, by R = (r 1 , r 2 ) we denote the unique multi-index associated to a flat output of a system with two inputs, where r j denotes the order of the highest derivative of y j needed to parameterize x and u by this flat output, i. e. y [R] = (y 1 , y 1 1 , . . . , y 1 r1 , y 2 , y 2 1 , . . . , y 2 r2 ). Furthermore, we define R ± c = (r 1 ± c, r 2 ± c) with an integer c, and #R = r 1 + r 2 .

Preliminaries
In this section, we summarize some results regarding flatness of two-input systems. Throughout, all functions and vector fields are assumed to be be smooth and all distributions are assumed to have locally constant dimension, we consider generic points only. Consider a nonlinear two-input system of the forṁ with dim(x) = n, dim(u) = 2 and rank(∂ u f ) = 2.
Let y = ϕ(x, u, u 1 , . . . , u q ) be a flat output of (1). We define the multi-index R = (r 1 , r 2 ) where r j is the order of the highest derivative of the component y j of the flat output which explicitly occurs in (2). This multi-index can be shown to be unique and with this multi-index, the flat parameterization can be written in the form The flat parameterization is a submersion (it degenerates to a diffeomorphism if and only if y is a linearizing output). The difference of the dimensions of the domain and the codomain of (3) is denoted by d, i. e. d = #R + 2 − (n + 2) = #R − n.
In Nicolau and Respondek (2016b) and Nicolau and Respondek (2016a), the number #R + 2 is called the differential weight of the flat output. (The differential weight of a flat output with difference d is thus given by n + 2 + d.) The difference d is the minimal dimension of an endogenous dynamic feedback needed to render (1) static feedback linearizable such that y forms a linearizing output of the closed loop system. Such a linearizing endogenous feedback can be constructed systematically, see e. g. Fliess et al. (1999). If we have d = 0, the map (3) degenerates to a diffeomorphism and the system is static feedback linearizable with y being a linearizing output. A flat output y is called a minimal flat output if its difference is minimal compared to all other possible flat outputs of the system. We define the difference d of a flat system to be the difference of a minimal flat output of the system. The difference d of a system therefore measures its distance from static feedback linearizability, i. e. d is the minimal possible dimension of an endogenous dynamic feedback needed to render the system static feedback linearizable. For (1), we define the distributions D 0 = span{∂ u 1 , ∂ u 2 } and Theorem 3.2. The two-input system (1) is linearizable by static feedback if and only if all the distributions D i are involutive and dim(D n−1 ) = n + 2.
For a proof of this theorem, we refer to Nijmeijer and van der Schaft (1990). For a system which meets the conditions of Theorem 3.2, the linearizing outputs can be computed as follows. Let s be the smallest integer such that D s = T (X × U ). In case of dim(D s−1 ) = n (i. e. D s−1 is of codimension 2), the sequence of involutive distributions is of the form and linearizing outputs are all pairs of functions (ϕ 1 , ϕ 2 ) which satisfy span{dϕ 1 , dϕ 2 } = D ⊥ s−1 . However, if dim(D s−1 ) = n + 1 (i. e. D s−1 is of codimen-sion 1), the sequence is of the form i. e. there exists an integer l from which on the sequence grows in steps of one. Linearizing outputs are then all pairs of functions (ϕ 1 , ϕ 2 ) which satisfy span{dϕ 1 } = D ⊥ s−1 The sequential test for flatness with d ≤ 2 proposed in Gstöttner et al. (2021), as well as the distribution test for flatness with d ≤ 2 which we propose in this contribution, both rely on the following crucial result regarding flat two-input systems with d ≤ 2.
Theorem 3.3. A system (1) with d ≤ 2 can be rendered static feedback linearizable by d-fold prolonging a suitably chosen (new) input after a suitable input transformation u = Φ u (x, u) has been applied.
A proof of this result is provided in Appendix A.

Sequential Test
In this section, we briefly recapitulate the main idea of the necessary and sufficient condition for flatness with d ≤ 2 in form of the sequential test proposed in Gstöttner et al. (2021). For details, proofs and examples, we refer to Gstöttner et al. (2021). Let y be a minimal flat output with difference 0 < d ≤ 2 of the system (1). It can be shown that the assumption 0 < d ≤ 2 implies the existence of an input transformation u = Φ u (x, u) such that the flat parameterization of the new inputs by the flat output y is of the formū 1 =F 1 ). Consider the system obtained by one-fold prolongingū 1 , i. e.
with the state (x,ū 1 ) and the input (ū 1 1 ,ū 2 ). The flat output y of the original system is also a flat output of the prolonged system (and conversely, it can be shown that every flat output of the prolonged system is also a flat output of the original system). Sinceū 1 =F 1 u (y [R−1] ), we haveū 1 1 =F 1 u1 (y [R] ) and thus, the domain of the parameterizing map of the prolonged system with respect to the flat output y is still of dimension #R + 2, but its codomain grew by one, i. e. y as a minimal flat output of the prolonged system only has a difference of d − 1. The main idea of the sequential test in Gstöttner et al. (2021) is to find such an input (they can indeed be found systematically), prolong it in order to obtain a system whose difference is d − 1 (where d ≤ 2 is the difference of the original system), and since by assumption d ≤ 2, after at most two such steps, the procedure must yield a static feedback linearizable system, otherwise, the original system must have had a difference of d ≥ 3.
When applying the sequential test to a system (1), in every step, a new system is derived by either splitting off a two-dimensional endogenous dynamic feedback or by adding a one-dimensional endogenous dynamic feedback (in form of a one-fold prolongation of a certain input). How the next system is derived from the current one is decided based on the distributions D 0 = span{∂ū1, ∂ū2} and D 1 = D 0 + [f, D 0 ] of the current system. If D 1 is involutive, it can be straightened out by a suitable state transformationx = Φ x (x) in order to obtain a decomposition of the system into the form The procedure is then continued with the subsystem Σ 2 with the statex 2 and the inputx 1 , i. e. we split off a two-dimensional endogenous dynamic feedback. It follows that Σ 2 has the same flat outputs with the same differences as the original system.
If D 1 is non-involutive but D 0 ⊂ C(D 1 ), it can be shown that the system allows an affine input representation (AI representation) with a non-involutive input distribution span{b 1 , b 2 }. Based on such an AI representation, an input transformationū j = m j l (x)u l , j, l = 1, 2 can be derived such that if the system indeed has a difference of d ≤ 2, the system obtained by one-fold prolonging the new inputū 1 has a difference of d − 1, i. e. in such a step a one-dimensional endogenous dynamic feedback is added to the system, and under the assumption d ≤ 2, it can be show that the feedback modified system has a difference of d − 1 only.
Finally, if D 1 is non-involutive and D 0 ⊂ C(D 1 ), the system allows at most a so called partial affine input representation (PAI representation) This form was introduced in Schlacher and Schöberl (2013). In Kolar, Schöberl, and Schlacher (2016), it has been shown that the existence of a PAI representation is a necessary condition for flatness. For two input systems, an input transformation such that the system takes PAI form can be derived systematically (provided the system indeed allows a PAI representation, otherwise, we can conclude that the system is not flat). It can be shown that a system which does not allow an AI representation allows at most two fundamentally different PAI representations and that in case of d ≤ 2, the non-affine occurring inputsū 1 of these possibly existing two PAI representations are the candidates for inputs whose flat parameterization with respect to a minimal flat output involves derivatives up to order R − 1 only. So in this case, the procedure is continued with the system obtained by one-fold prolonging the non-affine occurring inputū 1 (if the system indeed allows two fundamentally different PAI representations, we have to continue the procedure with both of them, i. e. there may occur a branching point).
As already mentioned, the sequential test has the drawback that it requires straightening out involutive distributions in order to achieve decompositions of the form (4). In fact, also the explicit computation of an input transformation such that a system takes PAI form requires straightening out an involutive distribution.

Main Results
In this section we present our main results, which are easily verifiable necessary and sufficient conditions for flatness with a difference of d ≤ 2, in the form of Theorem 5.1 for the case d = 2 and Theorem 5.2 for the case d = 1 below. These necessary and sufficient conditions overcome the computational drawbacks of the sequential test described in the previous section, instead of a sequence of systems, a certain sequence of distributions is constructed. The distributions constructed when applying these theorems are actually closely related with the distributions D 0 and D 1 of the individual systems constructed in the sequential test, based on which in the sequential test it is decided how the next system is computed from the current one. There is actually a one-to-one correspondence between the sequential test and the conditions of Theorem 5.1 and 5.2. One could prove these theorems via this one-to-one correspondence, however, in this contribution, we provide self-contained proofs which do not rely on the sequential test. A detailed proof of Theorem 5.1 is provided in Section 7, for Theorem 5.2, a brief sketch of a proof is provided in Section 8. As already mentioned, the case d = 1 has been solved completely in Nicolau and Respondek (2016b), below we explain how our necessary and sufficient conditions in the form of Theorem 5.2 are related with those provided in Nicolau and Respondek (2016b). The computation of flat outputs with d ≤ 2 of systems which meet our conditions for flatness with d ≤ 2 is addressed in Section 5.2. Assume that the system (1) is not static feedback linearizable. We then have the involutive distribution D 0 = span{∂ u 1 , ∂ u 2 } and can calculate the distributions D i = D i−1 + [f, D i−1 ], i = 1, . . . , k 1 where k 1 is defined to be the smallest integer such that D k1 is non-involutive (its existence is assured by the assumption that the system is not static feedback linearizable).
can yield a non-involutive distribution E k1 ) and then: 3b. Or E k1 is involutive and then: 1 There exist at most two distinct such pairs of distributions, the construction is explained below. If indeed two exist, a branching point occurs and we have to continue with both of them.
I. There exists a minimal integer k 2 such that E k2 is non-involutive where 4a. Either E k2−1 ⊂ C(E k2 ) and then: are involutive and there exists an integer s such that F s = T (X × U ).
In Theorem 5.1, we have several junctions, which is graphically illustrated in Figure  1. Regarding flatness with a difference of d = 1, we have the following result. 2a. Either D k1−1 ⊂ C(D k1 ) and then: are involutive and there exists an integer s such that E s = T (X × U ).
In Theorem 5.2, we have exactly one junction, which is graphically illustrated in Figure 2.
Note that the items 3b. to 5. of Theorem 5.1 in fact coincide with the items 1. to 3. of Theorem 5.2 when D i and k 1 are replaced by E i and k 2 . In Nicolau and Respondek (2016b), necessary and sufficient conditions for the case d = 1 are provided via the Theorems 3.3 and 3.4 therein. These theorems are stated for the control affine case, but this is actually no restriction. It can be shown that the control affine system obtained by prolonging both inputs of a general nonlinear control system of the form (1), i. e.
with the state (x, u 1 , u 2 ) and the input (u 1 1 , u 2 1 ), is flat with a certain difference d if and only if the original system is flat with the same difference d. In fact, a flat output of the original system with a certain difference d is also a flat output of the prolonged system with the same difference d and vice versa. In Theorem 5.2, we have exactly one junction (see Figure 2). This distinction of cases between D k1−1 ⊂ C(D k1 ) and D k1−1 ⊂ C(D k1 ) is motivated by the sequential test of the previous section (it corresponds to the distinction between AI form and PAI form in the sequential test). Our necessary and sufficient conditions for flatness with d = 1 as stated in Theorem 5.2 are very similar to those stated in Nicolau and Respondek (2016b). The main difference is in fact that in Nicolau and Respondek (2016b) a distinction of cases is done between D k1 = T (X × U ) (Theorem 3.3 therein) and D k1 = T (X × U ) (Theorem 3.4 therein), instead of a distinction of cases between D k1−1 ⊂ C(D k1 ) and D k1−1 ⊂ C(D k1 ) as it is done in Theorem 5.2.
It can easily be shown that all the distributions and all the conditions in Theorem 5.1 and 5.2 are invariant with respect to regular input transformationsū = Φ u (x, u), i. e. although the vector field f = f i (x, u)∂ x i associated with (1) and the vector field f =f i (x,ū)∂ x i associated with the feedback modified systemẋ i =f i (x,ū), wherē f i (x,ū) = f i (x,Φ u (x,ū)) with the inverse u =Φ u (x,ū) of the input transformation u = Φ u (x, u), are in general only equal modulo D 0 = span{∂ u } = span{∂ū}, the distributions D i , E i and F i constructed from them in the above theorems coincide.

Verification of the Conditions
All the conditions of Theorem 5.1 and 5.2 are easily verifiable and require differentiation and algebraic operations only. Item 2b. of Theorem 5.1 can be verified as follows. Choose any pair of vector fields v 1 , v 2 ∈ D k1−1 such that D k1−1 = D k1−2 +span{v 1 , v 2 }. Any vector field v c ∈ D k1−1 , v c / ∈ D k1−2 can then be written as a non-trivial linear (where we have used that D k1−2 ⊂ C(D k1 ), which can be shown based on the Jacobi identity). The following lemma states a crucial property of (5).
Lemma 5.3. The condition (5) admits at most two independent non-trivial solutions α j .
A proof of this lemma is provided in Appendix A. (A similar result has been proven in Gstöttner, Kolar, and Schöberl (2020c) in the context of a certain structurally flat triangular form. The result which we prove here is more general.) Since (5) admits at most two independent non-trivial solutions, there also exist at most two vector fields v c = α 1 v 1 + α 2 v 2 which are not collinear mod D k1−2 and meet the above criterion.
of v c and only the part of v c which is not contained in D k1−2 matters, there also exist at most two distinct such pairs of distributions.

Computation of Flat Outputs
The Theorems 5.1 and 5.2 allow us to check whether a system is flat with a difference of d ≤ 2. Regarding the computation of the corresponding flat outputs with d ≤ 2, we have the following result.
Theorem 5.4. Assume that the system (1) meets the conditions of Theorem 5.1 or 5.2. Flat outputs with d = 1 or d = 2 of the system can then be determined from the sequence of involutive distributions E i or F i the same way as linearizing outputs are determined form the sequence of involutive distributions D i involved in the test for static feedback linearizability in Theorem 3.2.
Proof. The sufficiency parts of the proofs of Theorem 5.1 and 5.2 are done constructively. Based on the distributions involved in the conditions of the theorems, for each case a certain coordinate transformation such that the system takes a structurally flat triangular form is derived. The top variables in these triangular forms are then flat outputs with d = 1 or d = 2. For details, see sufficiency parts of the proofs of Theorem 5.1 and 5.2.
It may happen that for the computation of flat outputs as stated in Theorem 5.4, a distribution which does not explicitly occur in Theorem 5.1 or 5.2 is needed. To be precise, if in Theorem 5.2, the conditions 2a. apply and we have E k1+1 = T (X × U ) or E k1+1 ⊂ 1 E k1+2 , we have to construct an involutive distribution E k1 which satisfies for the computation of flat outputs. Such a distribution always exists and despite from the case E k1+1 = T (X × U ), it is also unique.
The construction is as follows. In case of E k1+1 = T (X × U ), choose any function ψ whose differential dψ = 0 annihilates D k1−1 and choose furthermore any pair of vector can then be shown to be involutive, different choices for ψ lead in general to different distributions E k1 (but different choices for v 1 , v 2 have no effect). (A flat output with d = 1 is then formed by any pair of functions (ϕ 1 , ϕ 2 ) satisfying span{dϕ 1 , dϕ 2 } = E ⊥ k1 , where we can always choose one of the components equal to ψ since by construction dψ . The direction of v is modulo D k1−1 unique and it follows that the distribution E k1 = D k1−1 + span{v} constructed from it is involutive. (A flat output with d = 1 is then formed by any pair of functions (ϕ 1 , ϕ 2 ) satisfying span{dϕ 1 } = E ⊥ s−1 and Similarly, if in Theorem 5.1, the conditions 4a. (or 2a.B. and 4a.II., in which case for the computation of flat outputs. This can be done as just explained for Theorem 5.2, simply replace D k1−1 and D k1 by E k2−1 and E k2 .
Finally, if in Theorem 5.1, the conditions 3a. apply and we have for the computation of flat outputs. The construction is again the same as just explained for Theorem 5.2, simply replace D k1−1 and D k1 by E k1−1 and E k1 . Since we always have E k1 = T (X × U ) in this case, the distribution F k1 is always unique.

Examples
In the following we apply our results to some examples. We focus on the case d = 2, as the novelty of this contribution are the results regarding the case d = 2, which also cover the cases which cannot be handled with the results in Nicolau and Respondek (2016a) (none of the following examples meets Assumption 2 therein). It should again be pointed out that from a computational point of view, the necessary and sufficient conditions for flatness with d ≤ 2 in the form of Theorem 5.1 and 5.2 are a major improvement over the necessary and sufficient conditions in form of the sequential test proposed in Gstöttner et al. (2021).

VTOL
Consider the model of a planar VTOL aircrafṫ This system is also treated in e. g. Fliess et al. (1999), Schöberl, Rieger, and Schlacher (2010), Schöberl andSchlacher (2011), Gstöttner et al. (2020c) or Gstöttner et al. (2021). The distributions D 0 = span{∂ u 1 , ∂ u 2 } and is non-involutive, so we have k 1 = 2. With these distributions, item 1. of Theorem 5.1 is met. The Cauchy characteristic distribution of D 2 follows as C(D 2 ) = span{∂ u 1 , ∂ u 2 } = D 0 and thus D 1 ⊂ C(D 2 ). So we are in item 2b. and have to construct a vector (5), which in the particular case reads and admits the two independent solutions α 1 = λ, α 2 = 0 and α 1 = 0, α 2 = λ, both with an arbitrary function λ = 0. We can choose λ = 1 since only the direction of and We thus have a branching point and have to continue with both of these distributions (we will be able to discard one of them in just a moment). The distributions E 2,j are non-involutive, so we are in item 3a. Both meet the condition 3a.I., i. e. dim(E 2,j ) = dim(E 2,j ) + 1. However, 3a.II. is only satisfied by E 2,2 , for E 2,1 we have dim([f, E 2,1 ] + E 2,1 ) = dim(E 2,1 ) + 2, so we can discard this branch and continue with E 2,2 only, where for ease of notation, we drop the second subscript from now on, i. e. E 2 = E 2,2 . According to item 3a.II., we have Continuing this sequence as stated in item 5., we obtain F 4 = T (X × U ), so the conditions of item 5. are also met and we conclude that the system (6) is flat with a difference of d = 2. In conclusion, the system meets the items 1., 2b., 3a., 5. (which corresponds to the 4th path from the left in Figure 1).
For that, we solve (5), which in the particular case yields and admits the two independent solutions α 1 = λu 1 , α 2 = λu 2 and α 1 = λ(u 1 tan( u 1 u 2 ) − 2u 2 ), α 2 = λu 2 tan( u 1 u 2 ), both with an arbitrary function λ = 0, e. g. λ = 1 since only the direction of v c = α 1 ∂ u 1 + α 2 ∂ u 2 matters. It can easily be checked that only the vector field According to item 3a.II., we have F 2 = E 1 . Continuing this sequence as state in item 5., we obtain F 3 = T (X × U ), so the conditions of item 5. are also met and we conclude that the system (10) is flat with a difference of d = 2. In conclusion, the system meets the items 1., 2b., 3a., 5. (which corresponds to the 4th path from the left in Figure 1).
According to Theorem 5.4, flat outputs with d = 2 of the the system (10) can thus be computed from the distributions F i the same way as linearizing outputs are determined from the sequence of involutive distributions involved in the test for static feedback linearizability. However, in contrast to the previous example, not all the distributions needed for computing flat outputs explicitly occur in Theorem 5.1. We have F 2 ⊂ 1 F 3 = T (X × U ), from which we find only one component ϕ 1 of the flat outputs, i. e. span{dϕ 1 } = F ⊥ 2 = span{dx 3 } from which e. g. ϕ 1 = x 3 follows. In order to find a second component ϕ 2 , we have to complete the sequence to as stated below Theorem 5.4 and then, we find ϕ 2 from span{dϕ 1 , dL f ϕ 1 , Consider the following two exampleṡ also treated in e. g.  and Schöberl and Schlacher (2015). The first one of these two systems can be shown to be flat with a difference of d = 2, where again the items 1., 2b., 3a., 5. (which again corresponds to the 4th path from the left in Figure 1) are met. Item 2b. yields two different pairs of distributions E 0 and E 1 for this system, namely For both branches the items 3a. and 5. are met, and we obtain (x 2 , x 3 − x 1 u 2 ) and (x 1 , x 3 − x 2 u 1 ) as possible flat outputs with d = 2. However, the second systems in (11) is a negative example, it does not meet the conditions for flatness with d ≤ 2 2 , so we can conclude that if the system is flat, it must have a difference of d ≥ 3. (The system is indeed flat with a difference of d = 3, in e. g. Schöberl and Schlacher (2015) a corresponding flat output with d = 3 has been derived.)

Academic Example 2
Consider the systemẋ The distribution D 0 = span{∂ u 1 , ∂ u 2 } is involutive, For that, we solve (5), which in the particular case yields and has the up to a multiplicative factor unique solution α 1 = 1, α 2 = −1. The vector field v c = ∂ u 1 − ∂ u 2 obtained from this solution indeed meets v c ∈ C(E 1 ) with is non-involutive, i. e. k 2 = 2 and item 3b.II. is met. We have E 1 ⊂ C(E 2 ), so we are in item 4b. According to this item, we have F 2 = E 1 + C(E 2 ), which evaluates to and is indeed involutive. Continuing this sequence as stated in item 5., we obtain F 3 = T (X × U ), so the conditions of item 5. are also met and we conclude that the system (12) is flat with a difference of d = 2. In conclusion, the system meets the items 1., 2b., 3b., 4b., 5. (which corresponds to the 6th path from the left in Figure 1).

Proof of Theorem 5.1
Necessity Consider a two-input system of the form (1) and assume that it is flat with a difference of d = 2. Let k 1 be defined as in Theorem 5.1, i. e. the smallest integer such that D k1 is non-involutive (if D k1 would not exist, the system would be static feedback linearizable, which contradicts with the assumption that d = 2). According to Theorem 3.3, there exists an input transformationū = Φ u (x, u) with inverse u =Φ(x,ū) such that the system obtained by two-fold prolonging the new inputū 1 , i. e. the systeṁ with the state (x,ū 1 ,ū 1 1 ) and the input (ū 1 2 ,ū 2 ), is static feedback linearizable. Therefore, according to Theorem 3.2, with the vector field f p =f i (x,ū)∂ x i +ū 1 1 ∂ū1 +ū 1 2 ∂ū1 1 , the distributions are all involutive (that the integer s in the last line of (15) coincides with s in item 5. is shown later). Some simplifications can be made, i. e. there exist simpler bases for these distributions, as the following lemma asserts.
Lemma 7.1. The distributions (15) can be simplified to either or It follows from the proof of Lemma 7.1, which is provided in Appendix B, that in case of k 1 ≥ 2 we always have the form (16). The form (17) is only relevant if in the case k 1 = 1 we have ad 2 f ∂ū2 ∈ span{∂ū1 2 , ∂ū1 1 , ∂ū1, ∂ū2, [f , ∂ū2]}. In all other cases, the distributions ∆ i are indeed of the form (16).
Necessity of Item 1. From the assumption rank(∂ u f ) = 2 (i. e. the assumption that the system has no redundant inputs), it immediately follows that dim(D 1 ) = 4, which in case of k 1 = 1 already shows the necessity of item 1. For k 1 ≥ 2, the involutive distributions ∆ i can always be written in the form (16) (see below Lemma 7.1), based on which dim(D i ) = 2(i + 1), i = 2, . . . , k 1 can be shown by contradiction. Assume that dim(D i ) < 2(i + 1) for some i where 2 ≤ i ≤ k 1 and let 2 ≤ l ≤ k 1 be the smallest integer such that dim(D l ) < 2(l + 1). Thus, ad lf ∂ū1 and ad lf ∂ū2 are collinear modulo D l−1 . Both of these vector fields being contained in D l−1 , i. e. ad lf ∂ū1 ∈ D l−1 and ad lf ∂ū2 ∈ D l−1 , contradicts with D k1 being non-involutive, it would lead to D k1 = D l−1 , i. e. the sequence would stop growing from D l−1 on.
If ad lf ∂ū2 / ∈ D l−1 , we necessarily have D l = D l−1 + span{ad lf ∂ū2} (since by assumption dim(D l ) < 2(l + 1) and dim(D l−1 ) = 2l), which leads to , which together with the involutivity of D k1−1 and the fact that ad k1−1 , which because of the involutivity of D k1−1 implies that ad k1−1 f ∂ū1 ∈ C(D k1 ). Since also D k1−2 ⊂ C(D k1 ) (which can be shown based on the Jacobi identity), it follows that D k1−1 ⊂ C(D k1 ) which would imply that D k1 = D k1−1 + span{ad k1 f ∂ū2} is involutive, contradicting with D k1 being non-involutive and completing the proof of the necessity of item 1.
In the following we show the necessity of the remaining items. We distinguish between two cases, namely the case that the involutive distributions ∆ i in (15) can be written in the form (16), and the case that these distributions can only be written in the form (17). As already mentioned, the form (17) is only relevant if in the case k 1 = 1 we have ad 2 f ∂ū2 ∈ span{∂ū1 2 , ∂ū1 1 , ∂ū1, ∂ū2, [f , ∂ū2]}, in all other cases, the distributions ∆ i are indeed of the form (16). We treat this special case in Appendix A, so that for the rest of the proof, we can assume that the involutive distributions ∆ i in (15) can be written in the form (16).
Necessity of Item 2. We either have D k1−1 ⊂ C(D k1 ) or D k1−1 ⊂ C(D k1 ). We have to show the necessity of item 2a. under the assumption that D k1−1 ⊂ C(D k1 ), and the necessity of item 2b. under the assumption that D k1−1 ⊂ C(D k1 ).
3 Indeed, for D k 1 −1 ⊂ C(D k 1 ) with dim(D k 1 ) = dim(D k 1 ) + 1 and D k 1 = T (X × U ), the conditions of Theorem 5.2 would be met. 4 The autonomous subsystems occurs explicitly in coordinates in which the distribution D k 1 is straightened out (see also Theorem 3.49 in Nijmeijer and van der Schaft (1990)).
In item 2a.A., the distribution E k1+1 is by construction involutive, so we have to show the necessity of item 3b. in this case. (In item 2a.B., the item 3. is not relevant as it is skipped in the corresponding conditions.) E k1 of item 2b. being non-involutive We have to show the necessity of item 3a. From E k1 ⊂ ∆ k1+1 ∩ T (X × U ) (see (16)), it immediately follows that E k1 = ∆ k1+1 ∩T (X ×U ) = D k1−1 +span{ad k1 f ∂ū2, ad k1+1 f ∂ū2} and in turn the necessity of the condition dim(E k1 ) = dim(E k1 )+1, which corresponds to 3a.I. follows. 5 Next, let us show the necessity of item 3a.II., i. e. dim([f , E k1 ] + E k1 ) = dim(E k1 ) + 1. Recall that we have E k1 = D k1−1 + span{ad k1 f ∂ū2} and E k1 = D k1−1 + span{ad k1 f ∂ū2, ad k1+1 f ∂ū2}. Since ad k1+1 f ∂ū2 ∈ E k1 , the condition holds if and only if ad k1 f ∂ū1 / ∈ E k1 , which can be shown by contradiction. Assume that ad k1 f ∂ū1 ∈ E k1 and thus [f , E k1 ] + E k1 = E k1 . Based on the Jacobi identity, it can then be shown that this would imply [f , E k1 ] ⊂ E k1 . However, since E k1 = T (X × U ), this would in turn imply that the system contains an autonomous subsystem, which is in contradiction with the assumption that the system is flat. By definition, we have In this case, the distributions E i = E i−1 + [f , E i−1 ] are defined and we have to show the necessity of item 3b.
Let us first show the necessity of 3b.I., i. e. that there necessarily exists an index k 2 such that E k2 is non-involutive. We show the existence of k 2 by contradiction. Assume that all the distributions E i are involutive. If there does not exist an integer s such that E s = T (X × U ), there exists an integer l such that [f , E l ] ⊂ E l , which would imply that the system contains an autonomous subsystem and be in contradiction with the assumption that the system is flat. If all the distributions E i are involutive and there exists an integer s such that E s = T (X × U ), it can be shown that the system would meet the conditions for flatness with d = 1, which contradicts with the assumption that d = 2.
To show the condition on the dimensions of the distributions E i , note that actually in any case, i. e. independent of whether 2a.A. or 2b. applies, we have which turned out to be E k1+1 = D k1 + span{ad k1+1 f ∂ū2}. In 2b., we found that E k1 = D k1−1 + span{ad k1 f ∂ū2} (assumed to be involutive here) and thus again and with the distributions (16), they are related via The necessity of the condition dim(E i ) = 2i + 1, i = k 1 + 1, . . . , k 2 can now be shown by contradiction. Assume that dim(E i ) ≤ 2i for some i where k 1 + 1 ≤ i ≤ k 2 and let k 1 + 1 ≤ l ≤ k 2 be the smallest integer such that dim(E l ) ≤ 2l. We have and by assumption dim(E l−1 ) = 2l − 1 and dim(E l ) ≤ 2l. Thus, ad l−1 f ∂ū1 and ad lf ∂ū2 are collinear modulo E l−1 . Both of these vector fields being contained in E l−1 , contradicts with E k2 being non-involutive, it would lead to E k2 = E l−1 , i. e. the sequence would stop growing from E l−1 on. If ad lf ∂ū2 ∈ E l−1 , due to ∆ l = span{∂ū1 2 , ∂ū1 1 } + E l−1 + span{ad lf ∂ū2} (see (20)), we have ∆ l = span{∂ū1 2 , ∂ū1 1 } + E l−1 and it follows that also ∆ i = span{∂ū1 2 , ∂ū1 1 } + E i−1 for i > l. The involutivity of ∆ k2+1 would then imply that E k2 is involutive, which again contradicts with E k2 being non-involutive.
If adf ∂ū2 / ∈ E l−1 , we necessarily have ad l−1 f ∂ū1 ∈ E l−1 + span{ad lf ∂ū2} and thus E l = E l−1 + span{ad lf ∂ū2} and in turn ∆ l = span{∂ū1 2 , ∂ū1 1 } + E l and it follows that also ∆ i = span{∂ū1 2 , ∂ū1 1 } + E i for i > l. The involutivity of ∆ k2 would then imply that E k2 is involutive, which again contradicts with E k2 being non-involutive. Thus, ad l−1 f ∂ū1 and ad lf ∂ū2 cannot be collinear modulo E l−1 for any k 1 + 1 ≤ l ≤ k 2 which shows that dim(E i ) = 2i + 1 for i = k 1 + 1, . . . , k 2 . 6 Necessity of Item 4. For the distributions E k2−1 and E k2 of item 3b., we either have E k2−1 ⊂ C(E k2 ) or E k2−1 ⊂ C(E k2 ). We have to show the necessity of item 4a. under the assumption that E k2−1 ⊂ C(E k2 ), and the necessity of item 4b. under the assumption that E k2−1 ⊂ C(E k2 ). Furthermore, under the assumption that the conditions of 2a.B. are met, we have to show the necessity of item 4a.II.
For E k2 = T (X × U ), there are no additional conditions whose necessity has to be shown. For E k2 = T (X × U ), the necessity of dim ([f , E k2 ] + E k2 ) = dim(E k2 ) + 1 has to be shown. Since ad k2+1 f ∂ū2 ∈ E k2 , the condition holds if and only if ad k2 f ∂ū1 / ∈ E k2 , which can be shown by contradiction. Assume that ad k2 f ∂ū1 ∈ E k2 and thus [f , E k2 ] + E k2 = E k2 . Based on the Jacobi identity, it can then be shown that this would imply [f , E k2 ] ⊂ E k2 , which would in turn imply that the system contains an autonomous subsystem and contradict with the system being flat. By definition, we have F k2+1 = E k2 = E k2 + span{ad k2+1 f ∂ū2} in this case.
The necessity of item 4a.II. under the assumption that the conditions of 2a.B. are met can be shown analogously. By definition, we have E k2 = D (1) k1 (where k 2 = k 1 + 1), which according to Lemma 7.2 evaluates to E k2 = D k1 + span{ad k1+1 f ∂ū2} and is by assumption non-involutive. We have E k2 ⊂ ∆ k1+2 ∩ T (X × U ) (see (16) there are again no additional conditions whose necessity has to be shown. For E k2 = T (X × U ), the necessity of dim ([f , E k2 ] + E k2 ) = dim(E k2 ) + 1 can be shown analogously as above. By definition, we have F k2+1 = E k2 = E k2 + span{ad k2+1 f ∂ū2} in this case.
We have to show the necessity of item 4b., i. e. we have to show that the distribution F k2 , defined as F k2 = E k2−1 + C(E k2 ), is involutive. Regarding the Cauchy characteristic distribution of E k2 we have the following result, a proof of which is provided in Appendix B.
Necessity of Item 5. In conclusion, in 3a., i. e. for E k1 being non-involutive (in which case we define , in any case we thus have F k2+1 = E k2 + span{ad k2+1 f ∂ū2}. To complete the necessity part of the proof, we have to show that all the distributions F i , i ≥ k 2 + 1 are involutive and that there exists an integer s such that F s = T (X × U ), which is indeed the case since in any case, it follows that the distributions F i and ∆ i are related via ∆ i = span{∂ū1 2 , ∂ū1 1 } + F i and thus

Sufficiency
Consider a two-input system of the form (1) and assume that it meets the conditions of Theorem 5.1. To cover all the possible paths which are illustrated in Figure 1, we again have to distinguish between several cases. The distinction is done based on the difference of the integers k 1 and k 2 , i. e. the indices of the first non-involutive distribution D k1 and the second non-involutive distribution E k2 . The cases in which k 2 ≥ k 1 + 2, and thus E k1+1 is involutive, are similar an can be proven together. The cases in which E k1 is involutive but E k1+1 is non-involutive, are also similar and can be proven together. The remaining case in which E k1 is non-involutive (in which case we define k 2 = k 1 ), is proven separately. For each case, a coordinate transformation such that the system takes a certain structurally flat triangular form can be derived. For the cases k 2 = k 1 + 1 and k 2 = k 1 we derive such a transformation explicitly, the case k 2 ≥ k 1 + 2 can be handled analogously, it is in fact slightly simpler than the other two cases and we do not treat this case in detail here. In each case, we will need the following result, proven in Appendix B.
Lemma 7.4. Let G k−1 be an involutive distribution and G k a non-involutive distribution on X × U such that and for some vector field f on X × U , we have The Case k 2 ≥ k 1 + 2. In total, four different subcases are possible, namely (a) 2a.A. followed by 4a., corresponding to D k1−1 ⊂ C(D k1 ) and E k2−1 ⊂ C(E k2 ).
In any of these cases, we have the following sequence of involutive distributions In the cases in which D k1−1 ⊂ C(D k1 ) and/or E k2−1 ⊂ C(E k2 ), the existence of E k1 and/or F k2 is guaranteed by Lemma 7.4. That the inclusion F k2 ⊂ 2 F k2+1 is indeed of In case of D k1−1 ⊂ C(D k1 ), the distribution E k1 occurs explicitly in the corresponding conditions of Theorem 5.1, E k1+1 = D k1 follows from the assumption that E k1+1 is involutive. Indeed, we have Similarly, in case of E k2−1 ⊂ C(E k2 ), F k2+1 = E k2 can be shown as follows. By assumption, F k2 = E k2−1 + C(E k2 ) and F k2+1 = F k2 + [f, F k2 ] are involutive and E k2 is non-involutive. It is immediate, that C(E k2 ) necessarily contains a vector field v c ∈ E k2 , v c / ∈ E k2−1 , otherwise, F k2 = E k2−1 which would lead to F k2+1 = E k2 and contradict with E k2 being non-involutive. On the other hand, C(E k2 ) can only contain one vector field which is not already contained in E k2−1 , otherwise, F k2 = E k2 which again contradicts with E k2 being non-involutive. Thus, F k2+1 follows readily from these considerations in this case.
Based on the distributions (21), a coordinate transformation such that the system takes the structurally flat triangular forṁ . . .
x 2 =f 2 (x s , . . . ,x 1 ) can be derived (in case of k 1 = 1, the variablesx k1−1 are actually inputs instead of states). It follows that y =x s forms a flat output with a difference of d = 2. If dim(x s ) = 1, we necessarily have dim(x l ) = 2 but dim(f l+1 ) = 1 for some l ∈ {k 2 + 1, . . . , s−1}. In this case, a flat output with a difference of d = 2 is given by y = (x s , ϕ) where ϕ = ϕ(x s , . . . ,x l ) is an arbitrary function such that rank(∂x l (f l+1 , ϕ)) = 2. Furthermore, it follows that there cannot exist a flat output with d ≤ 1. The conditions of Theorem 3.2 cannot be met due to the non-involutivity of D k1 and it can easily be shown that the conditions of Theorem 5.2 cannot be met either.
In all of these cases, we have the following sequence of involutive distributions Let us show this in detail for the three possible cases (a) -(c).
(a) In 2a.B., only E k1+1 is defined explicitly. We set E k1 = C(D (1) k1 ) in this case. We have the following results on this Cauchy characteristic distribution, see Appendix B for a proof. By definition, we have E k1+1 = D (1) k1 and according to Lemma 7.5, we have ). Therefore, Lemma 7.4 applies, which guarantees the existence of a distribution F k1+1 such that E k1 ⊂ (b) In 2b., the distribution E k1 occurs explicitly, the existence of an involutive is guaranteed by Lemma 7.4 (it turns out that F k1+1 is unique if and only if E k1+1 = T (X × U )).
Based on the distributions (22) we will below derive a coordinate transformation such that the system takes the structurally flat triangular forṁ . . .
x 2 =f 2 (x s , . . . ,x 1 ) (in case of k 1 = 1, the variablesx k1−1 are actually inputs instead of states) from which again flatness with a difference of d = 2 can be deduced.
The Case k 2 = k 1 . In this case, by assumption the conditions of item 2b. and item 3a. are met. We have the following sequence of involutive distributions (we assume k 1 ≥ 2 here, see Remark 3 below for the cases k 1 = 1) That E k1−1 is involutive follows from the fact that E k1−1 = C(E k1 ) in this case.
(Indeed, since E k1 is non-involutive, we necessarily have dim(C(E k1 )) ≤ dim(E k1 ) − 2. By construction we have E k1−1 ⊂ C(E k1 ) and E k1−1 ⊂ 2 E k1 , which thus implies E k1−1 = guaranteed by Lemma 7.4 (and F k1 is unique since E k1 = T (X × U ) is not possible as it would imply D k1 = T (X × U )). Based on this sequence, we will derive a coordinate transformation such that the system takes the structurally flat triangular forṁ . . .
x 2 =f 2 (x s , . . . ,x 1 ) (in case of k 1 = 2, the variablesx k1−2 are actually inputs instead of states) from which again flatness with a difference of d = 2 can be deduced.
Remark 1. In case (a), i. e. if D k1−1 ⊂ C(D k1 ), by successively introducing new coordinates in (23) from top to bottom, the system would take the triangular from proposed in Gstöttner, Kolar, and Schöberl (2020a).
Remark 3. In case of k 1 = 1, the variablesx k1−1 would correspond to inputs of the system and the variablesx k1−2 would not exist. Consider the system obtained by one-fold prolonging both of its inputs, i. e.
x = f (x, u)u 1 = u 1 1u 2 = u 2 1 with the state (x, u 1 , u 2 ) and the input (u 1 1 , u 2 1 ). By assumption, the original system meets the conditions of Theorem 5.1 with k 1 = k 2 = 1. It can easily be shown that this implies that the prolonged system also meets the conditions of Theorem 5.1, but with k 1 = k 2 = 2. (The distributions involved in the conditions of Theorem 5.1 when applying it to the original system and when applying it to the prolonged system differ only by span{∂ u 1 1 , ∂ u 2 1 }.) The prolonged system can thus be transformed into the corresponding triangular form (25) as explained above, i. e. the prolonged system can be proven to be flat with a difference of d = 2. It can be shown that the prolonged system is flat with a certain difference d if and only if the original system is flat with the same difference d. In fact, a flat output of the original system with a certain difference d is also a flat output of the prolonged system with the same difference d and vice versa. The prolonged system being flat with a difference of d = 2 thus implies that the original system is flat with a difference of d = 2.
8. Brief Sketch of the Proof of Theorem 5.2

Necessity
Consider a two-input system of the form (1) and assume that it is flat with a difference of d = 1. According to Theorem 3.3, there exists an input transformationū = Φ u (x, u) with inverse u =Φ(x,ū) such that the system obtained by one-fold prolonging the new inputū 1 , i. e. the systeṁ with the state (x,ū 1 ) and the input (ū 1 1 ,ū 2 ), is static feedback linearizable. The necessity of the conditions of Theorem 5.2 can then be shown on basis of the involutive distributions ∆ i = ∆ i−1 + [f p , ∆ i−1 ], where ∆ 0 = span{∂ū1 1 , ∂ū2} and f p =f i (x,ū)∂ x i +ū 1 1 ∂ū1, which are involved in the test for static feedback linearizability of the prolonged system (see Theorem 3.2).
The necessity part of the proof is in fact very similar to the proof of the necessity of the items 3b. to 5. of Theorem 5.1. As we have already noted above, these items in fact coincide with the items 1. to 3. of Theorem 5.2 when D i and k 1 are replaced by E i and k 2 .

Sufficiency
Consider a two-input system of the form (1) and assume that it meets the conditions of Theorem 5.2. In any of the two cases, i. e. independent of D k1−1 ⊂ C(D k1 ) (which corresponds to 2a.) or D k1−1 ⊂ C(D k1 ) (which corresponds to 2b.), it follows that we have the following sequence of involutive distributions based on which a change of coordinates such that the system takes the structurally flat triangular formẋ . . .
x 2 =f 2 (x s , . . . ,x 1 ) can be derived (in case of k 1 = 1, the variablesx k1−1 are actually inputs instead of states), from which it follows that the system is indeed flat with a difference of d = 1.
Remark 4. In case of 2a., i. e. if D k1−1 ⊂ C(D k1 ), by successively introducing new coordinates in (28) from top to bottom, the system would take the triangular from proposed in Gstöttner et al. (2020a).
are by assumption not collinear mod D k1 , the (up to a multiplicative factor) only non-trivial solution is α 1 = 1 and α 2 = 0.

A.2. Proof of Theorem 3.3
In Gstöttner et al. (2020a) the following result on the linearization of (x, u)-flat twoinput systems has been shown (corresponding to Corollary 4 therein).
Lemma A.1. If the two-input system (1) possesses an (x, u)-flat output with a certain difference d, then it can be rendered static feedback linearizable by d-fold prolonging a suitably chosen (new) input after a suitable input transformationū = Φ u (x, u) has been applied.
To prove Theorem 3.3, i. e. to show that two-input systems with d ≤ 2 can be rendered static feedback linearizable by d-fold prolonging a suitably chosen (new) input, we only have to show that d ≤ 2 implies (x, u)-flatness. To be precise, we have to show that minimal flat outputs with d ≤ 2 are (x, u)-flat outputs. Below we will show this by contradiction, i. e. we will show that a flat output with a difference of d ≤ 2 which explicitly depends on derivatives of the inputs is never a minimal flat output. For that we will utilize a certain relation between the state dimension n of the system, the difference d of a flat output and the "generalized" relative degrees of its components, which we derive in the following.
Given a flat output y, recall that r j denotes the order of the highest derivative r j of y j needed to parameterize x and u by this flat. For a component of a flat output which does not explicitly depend on a derivative of the inputs, we define the relative degree k j by The following lemma provides a relation between the state dimension n, r j and k j .
Lemma A.2. For an (x, u)-flat output y = ϕ(x, u) of a two input system of the form (1), the relations r 1 = n − k 2 and r 2 = n − k 1 hold.
With these two relations, we immediately obtain a relation between the difference d = #R − n of an (x, u)-flat output and the relative degrees k j of its components. Corollary A.3. For an (x, u)-flat output y = ϕ(x, u) of a two-input system of the form (1), the relation d = n − k 1 − k 2 holds.
The definition of the relative degree via (A2) requires that ϕ j = ϕ j (x) or ϕ j = ϕ j (x, u) and always yields k j ≥ 0. However, it turns out that Corollary A.3 (and in fact also Lemma A.2) analogously apply if one or both components of the flat output explicitly depend on derivatives of the inputs, i. e. y j = ϕ j (x, u, u 1 , . . . , u qj ) with ϕ j explicitly depending on u 1 qj or u 2 qj , by setting k j = −q j . In other words, Corollary A.3 analogously applies if we interpret an explicit dependence of y j = ϕ j (x, u, u 1 , . . . , u qj ) on the q j -th derivative of an input as a negative relative degree of k j = −q j . This can be shown as follows. Let y be a flat output of the system (1) and consider the prolonged systeṁ with the statex = (x, u, u 1 , . . . , u p−1 ), dim(x) =ñ = n + 2p and the inputũ = u p , obtained by prolonging both inputs of the system p times. The flat parameterizatioñ x = Fx(y [R−1] ),ũ = Fũ(y [R] ) of the prolonged system with respect to y is easily obtained from the corresponding flat parameterization of the original system by successive differentiation (we thus haveR = R + p) and it immediately follows that we haved = #R −ñ = #R − n = d, i. e. such total prolongations preserve the difference of every flat output.
Let us consider the case that one component of the flat output explicitly depends on derivatives of the inputs. Without loss of generality (swap the components of the flat output if necessary), we can assume that y 1 = ϕ 1 (x, u) has a relative degree of k 1 ≥ 0 (we have k 1 = 0 if ϕ 1 depends explicitly on u 1 or u 2 ) and y 2 = ϕ 2 (x, u, u 1 , . . . , u q2 ) (with ϕ 2 explicitly depending on u 1 q2 or u 2 q2 ). By prolonging both inputs of the system q 2 times, we obtain the systeṁ with the statex = (x, u, u 1 , . . . , u q2−1 ), dim(x) =ñ = n + 2q 2 and the inputũ = u q2 . For this prolonged system, the components of the flat output y = (ϕ 1 (x, u), ϕ 2 (x, u, u 1 , . . . , u q2 )) only depend on the state and the inputs and thus, Corollary A.3 directly applies. By construction, we havek 2 = 0, since ϕ 2 explicitly depends onũ. The k 1 -th derivative of ϕ 1 explicitly depends on u and therefore, we have to differentiate it another q 2 times until it explicitly depends onũ and thus,k 1 = k 1 + q 2 . According to Corollary A.3, we thus haved =ñ −k 1 −k 2 = n + 2q 2 − (k 1 + q 2 ) − 0 = n − k 1 + q 2 . Above we noticed that d =d, i. e. total prolongations preserve the difference and thus, d = n − k 1 + q 2 , i. e. exactly the same as Corollary A.3 would yield when we set k 2 = −q 2 . The case that both components of the flat output explicitly depend on derivatives of the inputs, i. e. y j = ϕ j (x, u, u 1 , . . . , u qj ) (with ϕ j explicitly depending on u 1 qj or u 2 qj ), can be handled analogously and yields d = n + q 1 + q 2 , i. e. exactly the same as Corollary A.3 would yield when we set k 1 = −q 1 and k 2 = −q 2 .
With these preliminary results at hand, we can now proof that minimal flat outputs with d ≤ 2 of a two-input system of the form (1) are actually (x, u)-flat outputs. Let y = (ϕ 1 (x, u, u 1 , . . . , u q1 ), ϕ 2 (x, u, u 1 , . . . , u q2 )) be a minimal flat output of (1) with d ≤ 2. In the following we show that q 1 , q 2 ≤ 0 by contradiction. Without loss of generality, we can assume that q 1 ≤ q 2 (swap the components of the flat output if necessary). Assume that q 2 ≥ 1. According to the above discussed generalization of Corollary A.3, we have d = n + q 1 + q 2 and thus n + q 1 + q 2 ≤ 2. Because of n + q 1 + q 2 ≤ 2, we have q 1 ≤ 2 − n − q 2 . We can assume n ≥ 3, since for n = 2, the system would be static feedback linearizable with the state of the system forming a linearizing output due to the assumption rank(∂ u f ) = 2, which is in contradiction to the minimality of y, for n = 1, the rank condition rank(∂ u f ) = 2 could not hold. Thus, n ≥ 3 and in turn, the first component of the flat output has a (positive) relative degree of k 1 = −q 1 ≥ n + q 2 − 2. This enables us to replace k 1 states of the system by ϕ 1 and its first k 1 − 1 derivatives by applying the state transformation where ψ i2 are arbitrary functions of the state, chosen such that (A4) is a regular state transformation. By additionally applying the input transformationū 1 = L k1 f ϕ 1 , u 2 = g(x, u), with g chosen such that this transformation is invertible with respect to u, we obtainẋ 1 1 =x 2 1 x 2 1 =x 3 1 . . .
x n−1 1 =ū 1 x 1 2 =f 1 2 (x 1 ,x 2 ,ū 1 ,ū 2 ) , so the system would be static feedback linearizable with (x 1 1 ,x 1 2 ) forming a linearizing output, which is in contradiction to the minimality of the flat output y. For dim(x 2 ) = 0, the system would consist of a single integrator chain of length n, which actually contradicts with rank(∂ u f ) = 2. We thus have q 2 ≤ 0 and because of q 1 ≤ q 2 , also q 1 ≤ 0. In conclusion, every minimal flat output with a difference of d ≤ 2 is an (x, u)flat output. Lemma A.1 therefore guarantees that a system with d ≤ 2 can be rendered static feedback linearizable by d-fold prolonging a suitable chosen (new) input after a suitable input transformationū = Φ u (x, u) has been applied, which completes the proof.
where f 3 = f i3 3 (z 3 , z 2 )∂ z i 3 3 . Since by assumption dim([f, G k ] + G k ) = dim(G k ) + 1, the vector fields [v 1 , f 3 ] and [v 2 , f 3 ] are collinear modulo G k . Without loss of generality, we can assume that [v 1 , f 3 ] / ∈ G k , implying that there exists a function α such that [v 2 , f 3 ] = α[v 1 , f 3 ] mod G k . This function only depends onx 2 andx 3 since the vector fields v 1 , v 2 and f 3 only depend on z 3 and z 2 , i. e. α = α(z 3 , z 2 ). Define the distribution H k = G k−1 + span{v 2 − αv 1 }. It is immediate that this distribution is involutive and since v 1 and v 2 are independent, we have G k−1 ⊂ So in any of the two cases, i. e. G k = T (X × U ) or G k = T (X × U ), we have shown that there exists an involutive distribution H k = G k−1 + span{v} with some vector field v ∈ G k , v / ∈ G k−1 . (where we have used that G k−1 ⊂ C(G k ) and that [f, v] ∈ G k implies [f, H k ] ⊂ G k as well as the involutivity of H k ). However, this implies [v, [w, f ]] ∈ G k for every w ∈ G k−1 , which in turn would imply that G k is involutive and contradict with G k being non-involutive.

B.5. Proof of Lemma 7.5
We have D k1 = D k1−1 + span{v 1 , v 2 } and since D k1−1 ⊂ C(D k1 ), we have D It follows that the direction of the vector field v = v 2 − αv 1 is modulo G k−1 uniquely determined by the conditions v ∈ G k , v / ∈ G k−1 , [v, f ] ∈ G k = T (X × U ) and thus, the distribution H k is unique in this case. Indeed, assume that there would exist another such vector field w ∈ G k , w / ∈ G k−1 , which is modulo G k−1 not collinear with v and still satisfies [w, f ] ∈ G k . Then, we would have G k = G k−1 + span{v, w} and in turn [f, G k ] ⊂ G k , which is in contradiction with dim([f, G k ] + G k ) = dim(G k ) + 1.
only if [f, v] / ∈ D k1 , which can be shown by contradiction. Assume that [f, v] ∈ D k1 . Due to the Jacobi identity, for every vector field w ∈ D k1−1 , we then have k1 )). However, this implies that [v, [w, f ]] ∈ D k1 for every w ∈ D k1−1 , which in turn would imply that D k1 is involutive and contradict with D k1 being non-involutive.