Documentation

CslibFrontier.Algorithms.LinearAlgebra.DescriptorCertificate

Kernel-checked index-one decouplings of rational descriptor systems #

A rational descriptor system E ż = F z + G u + b with N unknowns is given by the rows of E, F and G and the list b, read with Mathlib.Tactic.Matrix.ofLists and cast to ℝ (Cslib.LinearAlgebra.descriptorOfRows). An untrusted tool proposes an index-one decoupling (Cslib.LinearAlgebra.DecouplingCert): the blocks P₁, P₂ of a row transformation with a left inverse [P₁' P₂'], and the blocks Q₁, Q₂ of a change of unknowns with inverse [Q₁'; Q₂']. The checker DecouplingCert.check recomputes, exactly over ℚ, the products

P E Q = [[1, 0], [0, 0]], P₁ F Q₂ = 0, P₂ F Q₁ = 0, P₂ F Q₂ = 1, P₁' P₁ + P₂' P₂ = 1, Q₁ Q₁' + Q₂ Q₂' = 1, Q₁' Q₁ = 1, Q₁' Q₂ = 0,

and acceptance yields a DescriptorSystem.IndexOneDecoupling of the real system (DecouplingCert.toDecoupling), whose reduced ODE ẋ = A x + B u + c has the state matrix A = P₁ F Q₁, supplied as DecouplingCert.A and checked. Nothing is assumed about E, and no algebraic equation is dropped: the decoupling theorems of CslibFrontier.Foundations.Analysis.ODE.Descriptor reconstruct every unknown.

A system of higher index, or one whose algebraic equations are singular (inconsistent or underdetermined), has no accepted certificate, because acceptance implies the existence and uniqueness theorems of the decoupling. Rejection of a particular certificate, however, says nothing about the system.

An equilibrium F z₀ + b = 0 is checked exactly (Cslib.LinearAlgebra.isEquilibriumRows), and DecouplingCert.isExponentiallyStableAt_of_check transfers exponential stability of the reduced matrix DecouplingCert.A, for instance from an accepted dense Lyapunov certificate (Cslib.LinearAlgebra.LyapunovCert.isExponentiallyStable_of_check) or a sparse one (Cslib.LinearAlgebra.SparseLyapunovCert.isExponentiallyStable_of_check with Cslib.LinearAlgebra.ofSparse_toSparse), to every solution of the descriptor system with zero input.

Main definitions #

Main results #

@[reducible, inline]
abbrev Cslib.LinearAlgebra.realOfRows (m n : ℕ) (rows : List (List ℚ)) :
Matrix (Fin m) (Fin n) ℝ

The real m × n matrix of rational rows.

@[reducible, inline]
abbrev Cslib.LinearAlgebra.realOfList (n : ℕ) (l : List ℚ) :
Fin n → ℝ

The real vector of a list of rationals, read with ofList.

noncomputable def Cslib.LinearAlgebra.descriptorOfRows (N m : ℕ) (E F G : List (List ℚ)) (b : List ℚ) :

The real descriptor system E ż = F z + G u + b with N unknowns and m inputs, from the rational rows of E, F, G and the entries of b.

Exact checks on rows #

Whether rows, read as an m × n matrix, is zero.

Whether rows, read as an n × n matrix, is the identity.

rowDot that skips the products with a zero factor, so that the kernel does no rational arithmetic for them.

rowsMul with rowDotNZ: the same product (rowsMulNZ_eq), cheaper on sparse rows.

theorem Cslib.LinearAlgebra.rowsMulNZ_eq (l m n : ℕ) (A B : List (List ℚ)) :
rowsMulNZ l m n A B = rowsMul l m n A B

The rows of A *ᵥ v for A read as m × n and v read as a length-n vector.

Whether the first n entries of v + w, padded with zeros, vanish.

Whether z₀ is an equilibrium, F z₀ + b = 0, of the system with N unknowns.

theorem Cslib.LinearAlgebra.isEquilibrium_of_isEquilibriumRows {N m : ℕ} {E F G : List (List ℚ)} {b z₀ : List ℚ} (h : isEquilibriumRows N F b z₀ = true) :

Soundness of the equilibrium check.

Decoupling certificates #

A proposed index-one decoupling of a descriptor system with N unknowns into k differential and r algebraic coordinates; see the module documentation for the identities the checker verifies. All blocks are lists of rational rows.

  • k : ℕ

    The number of differential coordinates.

  • r : ℕ

    The number of algebraic coordinates.

  • P₁ : List (List ℚ)

    k × N: rows producing the differential equations.

  • P₂ : List (List ℚ)

    r × N: rows producing the algebraic equations.

  • P₁' : List (List ℚ)

    N × k: left inverse of P, first block.

  • P₂' : List (List ℚ)

    N × r: left inverse of P, second block.

  • Q₁ : List (List ℚ)

    N × k: unknowns from the differential coordinates.

  • Q₂ : List (List ℚ)

    N × r: unknowns from the algebraic coordinates.

  • Q₁' : List (List ℚ)

    k × N: differential coordinates of the unknowns.

  • Q₂' : List (List ℚ)

    r × N: algebraic coordinates of the unknowns.

  • A : List (List ℚ)

    k × k: the reduced state matrix P₁ F Q₁, checked.

The rows of the reduced input matrix B = P₁ G, for m inputs.

The rows of the output matrix C = H Q₁ of the output map H with p rows.

The rows of the feedthrough matrix D = -(H Q₂ P₂ G).

Whether c is an index-one decoupling of the pencil (E, F) with N unknowns. All products are recomputed exactly over ℚ.

noncomputable def Cslib.LinearAlgebra.DecouplingCert.toDecoupling {c : DecouplingCert} {N m : ℕ} {E F G : List (List ℚ)} {b : List ℚ} (h : c.check N E F = true) :

Soundness. An accepted certificate is an index-one decoupling of the real descriptor system.

theorem Cslib.LinearAlgebra.DecouplingCert.A_toDecoupling {c : DecouplingCert} {N m : ℕ} {E F G : List (List ℚ)} {b : List ℚ} (h : c.check N E F = true) :

The state matrix of the decoupling is the matrix of the checked DecouplingCert.A.

theorem Cslib.LinearAlgebra.DecouplingCert.realization_toDecoupling {c : DecouplingCert} {N m : ℕ} {E F G : List (List ℚ)} {b : List ℚ} (h : c.check N E F = true) (p : ℕ) (H : List (List ℚ)) :
DescriptorSystem.IndexOneDecoupling.realization (realOfRows p N H) = { A := realOfRows c.k c.k c.A, B := realOfRows c.k m (c.reducedB N m G), C := realOfRows p c.k (c.outputC N p H), D := realOfRows p m (c.feedthroughD N p m H G) }

The checked realization. The proper realization of an accepted decoupling with output map H has the rational matrices A, reducedB, outputC and feedthroughD.

Descriptor stability from the reduced matrix. If c is an accepted decoupling of (E, F), z₀ passes the exact equilibrium check and ẋ = A x is exponentially stable for the checked reduced matrix c.A (for instance by an accepted Lyapunov certificate), then every solution with zero input of the real descriptor system converges to z₀ exponentially, in the Euclidean norm.