Documentation

CslibFrontier.Algorithms.LinearAlgebra.FrequencyCertificate

Kernel-checked gain bounds on frequency intervals #

For a rational model G : Cslib.LinearAlgebra.RatLTI n m p and a SISO entry h = H i j of its transfer function H s = C (s I - A)⁻¹ B + D (LTISystem.transferFunction), this module computes, exactly over ℚ, real polynomials N and Q with

‖H (ω * I) i j‖² = N (ω²) / Q (ω²), Q (ω²) = |χ (i ω)|²,

and checks gain specifications on frequency bands with the Sturm sign checks of CslibFrontier.Foundations.Algebra.Polynomial.RealRoot.IntervalSign. Every check is a Boolean function that the kernel evaluates by decide +kernel.

The resolvent #

The Faddeev–LeVerrier recurrence (Cslib.LinearAlgebra.resolvent) computes matrices Y₀, …, Yₙ₋₁ and coefficients c₀, …, cₙ (with cₙ = 1) such that, in exact arithmetic, Σ Yₖ sᵏ = adj (s I - A) and Σ cₖ sᵏ = det (s I - A). Its correctness is not proved here. Instead Cslib.LinearAlgebra.resolventCheck checks the coefficients of the polynomial identity (s I - A) (Σ Yₖ sᵏ) = (Σ cₖ sᵏ) I, that is Yₖ₋₁ - A Yₖ = cₖ I for k = 0, …, n, together with the trace identities tr Yₖ = (k + 1) cₖ₊₁ that the recurrence also satisfies. Whenever the check passes, χ = Σ cₖ sᵏ is the characteristic polynomial of A (Cslib.LinearAlgebra.resolventCheck_charpoly, from the trace identities and Jacobi's formula Matrix.derivative_det_adjugate), at every complex s with χ(s) ≠ 0 the matrix s I - A has the inverse χ(s)⁻¹ Σ Yₖ sᵏ (Cslib.LinearAlgebra.resolventCheck_inv), and H s i j = num(s) / χ(s) for the numerator num = c_i Y b_j + d_ij χ (Cslib.LinearAlgebra.RatLTI.transferFunction_apply_eq).

Squared gain on the imaginary axis #

A real polynomial f (s) = E (s²) + s O (s²) takes the value E (-ω²) + i ω O (-ω²) at s = i ω; Cslib.LinearAlgebra.evenOdd computes the coefficient lists of u ↦ E (-u) and u ↦ O (-u), so that |f (i ω)|² = E² + u O² at u = ω² (Cslib.LinearAlgebra.sqAbsImag). The gain polynomials RatLTI.gainNum and RatLTI.gainDen are these for the numerator and for χ. They are polynomials in u = ω², which halves the degree that the Sturm checks see and makes |h|² even in ω, so a band constrains |ω|.

Gain checks #

A Cslib.LinearAlgebra.FreqBand is lo ≤ |ω| ≤ hi, or lo ≤ |ω| when hi = none, with rational 0 ≤ lo. RatLTI.gainLe G i j B γ² checks that Q has no root for ω² in the band (so iωI - A is invertible there) and γ² Q - N ≥ 0; RatLTI.gainGe checks N - γ² Q ≥ 0 instead. Acceptance gives ‖H (ω * I) i j‖ ≤ γ (RatLTI.norm_le_of_gainLe) or γ ≤ ‖H (ω * I) i j‖ (RatLTI.le_norm_of_gainGe) on the band. A bound that the gain attains in the interior of the band, or at an endpoint where γ² Q - N has a multiple root, is rejected (see nonnegOn), so a tight bound may need a slightly larger γ.

Decibels #

A rational level L = p / q dB bounds the gain by 10 ^ (L / 20), which is irrational in general. The bound goes through a rational γ²: Cslib.LinearAlgebra.dbLe γ² L checks (γ²) ^ (10 q) ≤ 10 ^ p exactly, so γ² ≤ 10 ^ (L / 10), and RatLTI.norm_le_db_of_gainLe gives ‖H (ω * I) i j‖ ≤ 10 ^ (L / 20), the statement 20 log₁₀ ‖H‖ ≤ L without the junk value log 0 = 0. Lower bounds are stated as L ≤ 20 * Real.logb 10 ‖H (ω * I) i j‖ (RatLTI.db_le_of_gainGe).

Violation witnesses #

A rejected check does not by itself tell a violated specification from a certificate that is only too tight, such as a bound that the gain touches. RatLTI.gainLeVerdict, RatLTI.gainGeVerdict, RatLTI.dbLeVerdict and RatLTI.dbGeVerdict return a Cslib.LinearAlgebra.GainVerdict: proved when the check accepts, violated ω for a rational ω in the band at which the specification fails, or inconclusive. The witness is searched (untrusted) where the checked polynomial P (ω²) is negative, at the band's edges and near the roots of P (ω²) from Cslib.RealRoot.isolateRoots (Cslib.LinearAlgebra.witnessCandidates). Only the final check is trusted: RatLTI.pointOk checks that ω is in the band and Q (ω²) ≠ 0, and then i ω I - A is invertible and ‖H (ω * I) i j‖² = N (ω²) / Q (ω²) is the rational RatLTI.sqGainAt i j ω (RatLTI.sq_norm_eq_sqGainAt), which is compared with γ², or with the decibel level through dbLe and dbGe, exactly. At a root of Q the matrix inverse in H is a junk value, so no witness is reported there. GainVerdict.Holds states what each outcome means. A bound attained exactly, like the 0 dB bound of a low-pass at ω = 0, has no witness and is reported inconclusive.

DC gain #

RatLTI.dcGain is D + c₀⁻¹ C Y₀ B, which is D - C A⁻¹ B since -A Y₀ = c₀ I. RatLTI.dcCheck checks the resolvent and c₀ ≠ 0; acceptance proves that A is invertible, that D - C A⁻¹ B is dcGain exactly (RatLTI.dcGain_eq) and that H 0 is its image in ℂ (RatLTI.transferFunction_zero_eq).

Main definitions #

Main results #

The resolvent adj (s I - A) and its check #

The rows of the n × n matrix c • 1.

The Faddeev–LeVerrier loop: with Y = Yᵣ and r + 1 steps left, it records cᵣ = -tr (A Yᵣ) / (n - r) and Yᵣ, and continues with Yᵣ₋₁ = A Yᵣ + cᵣ I.

The Faddeev–LeVerrier data of the n × n matrix with rows A: the matrices [Y₀, …, Yₙ₋₁], with Σ Yₖ sᵏ = adj (s I - A), and the coefficients [c₀, …, cₙ] of det (s I - A) in exact arithmetic. Only resolventCheck is trusted.

The rows of Yₖ₋₁, with Y₋₁ = 0.

def Cslib.LinearAlgebra.resolventResidual (n : ℕ) (A : List (List ℚ)) (Ys : List (List (List ℚ))) (cs : List ℚ) (k : ℕ) :

The rows of Yₖ₋₁ - A Yₖ - cₖ I.

The resolvent check. Ys has n matrices, cs has n + 1 coefficients ending in 1, Yₖ₋₁ - A Yₖ = cₖ I for k = 0, …, n (with Y₋₁ = Yₙ = 0), and tr Yₖ = (k + 1) cₖ₊₁.

@[reducible, inline]
noncomputable abbrev Cslib.LinearAlgebra.ratMat (R : Type u_2) [CommRing R] [Algebra ℚ R] (k l : ℕ) (rows : List (List ℚ)) :
Matrix (Fin k) (Fin l) R

The matrix of rational rows, read in a ℚ-algebra R.

@[reducible, inline]
noncomputable abbrev Cslib.LinearAlgebra.cplx (k l : ℕ) (rows : List (List ℚ)) :
Matrix (Fin k) (Fin l) ℂ

The complex matrix of rational rows.

theorem Cslib.LinearAlgebra.resolventCheck_mul {n : ℕ} {A : List (List ℚ)} {Ys : List (List (List ℚ))} {cs : List ℚ} {R : Type u_1} [CommRing R] [Algebra ℚ R] (h : resolventCheck n A Ys cs = true) (s : R) :
(s • 1 - ratMat R n n A) * ∑ k ∈ Finset.range n, s ^ k • ratMat R n n (Ys.getD k []) = (Polynomial.aeval s) (Polynomial.ofCoeffList cs) • 1

The resolvent identity. If the resolvent check accepts, then for every s in a commutative ℚ-algebra, (s I - A) (Σₖ sᵏ Yₖ) = χ(s) I with χ = ofCoeffList cs.

theorem Cslib.LinearAlgebra.resolventCheck_inv {n : ℕ} {A : List (List ℚ)} {Ys : List (List (List ℚ))} {cs : List ℚ} {K : Type u_2} [Field K] [Algebra ℚ K] (h : resolventCheck n A Ys cs = true) {s : K} (hs : (Polynomial.aeval s) (Polynomial.ofCoeffList cs) ≠ 0) :
(s • 1 - ratMat K n n A)⁻¹ = ((Polynomial.aeval s) (Polynomial.ofCoeffList cs))⁻¹ • ∑ k ∈ Finset.range n, s ^ k • ratMat K n n (Ys.getD k [])

At every s in a field with χ(s) ≠ 0, an accepted resolvent inverts s I - A: (s I - A)⁻¹ = χ(s)⁻¹ Σₖ sᵏ Yₖ.

The resolvent check pins down the characteristic polynomial. If it accepts, then ofCoeffList cs is the characteristic polynomial of A: multiplying the identity (X I - A) Y = χ I by adj (X I - A) gives charpoly A • Y = χ • adj (X I - A); its trace, with Jacobi's formula tr adj (X I - A) = (charpoly A)' and the checked tr Y = χ', gives charpoly A * χ' = χ * (charpoly A)', and both polynomials are monic of degree n.

Squared modulus on the imaginary axis #

The coefficient lists of u ↦ E (-u) and u ↦ O (-u) for f (s) = E (s²) + s O (s²), so that f (i ω) = E' (ω²) + i ω O' (ω²) (Cslib.LinearAlgebra.aeval_evenOdd).

The coefficient list, in u = ω², of |f (i ω)|² for a real polynomial f.

The value of a real polynomial at i ω from its even and odd parts.

Transfer functions of rational models #

The Faddeev–LeVerrier data of A.

The coefficients of χ (s) = det (s I - A), as computed by resolvent.

Whether the resolvent of A passes resolventCheck.

def Cslib.LinearAlgebra.RatLTI.numCoeffs {n m p : ℕ} (G : RatLTI n m p) (i j : ℕ) :

The coefficients of the numerator num (s) = c_i (Σ Yₖ sᵏ) b_j + d_ij χ (s) of H s i j = num (s) / χ (s).

def Cslib.LinearAlgebra.RatLTI.gainNum {n m p : ℕ} (G : RatLTI n m p) (i j : ℕ) :

The gain numerator N, in u = ω²: N (ω²) = |num (i ω)|².

The gain denominator Q, in u = ω²: Q (ω²) = |χ (i ω)|².

The transfer function from the resolvent. If the resolvent check accepts and χ (s) ≠ 0, then H s i j = num (s) / χ (s).

χ is the characteristic polynomial of A, for an accepted resolvent.

Q (ω²) = |det (i ω I - A)|², for an accepted resolvent.

Q (ω²) ≠ 0 exactly where i ω I - A is invertible, for an accepted resolvent.

Squared gain as a ratio of polynomials. If the resolvent check accepts, then at every real ω where i ω I - A is invertible, ‖H (ω * I) i j‖² = N (ω²) / Q (ω²), and Q (ω²) > 0.

Gain checks on frequency bands #

A frequency band lo ≤ |ω| ≤ hi, or lo ≤ |ω| when hi = none. The checks require 0 ≤ lo.

  • lo : ℚ

    The lower edge, in the model's angular-frequency unit.

  • hi : Option ℚ

    The upper edge, or none for a half-line.

Membership of a real angular frequency in a band.

theorem Cslib.LinearAlgebra.FreqBand.sq_mem_bandSet {B : FreqBand} (hlo : 0 ≤ B.lo) {ω : ℝ} (hω : B.Mem ω) :
def Cslib.LinearAlgebra.RatLTI.gainLe {n m p : ℕ} (G : RatLTI n m p) (i : Fin p) (j : Fin m) (B : FreqBand) (γsq : ℚ) :

Upper gain check. On the band B: the resolvent check, 0 ≤ B.lo, no root of Q, and γ² Q - N ≥ 0, for the entry (i, j) and γsq = γ².

def Cslib.LinearAlgebra.RatLTI.gainGe {n m p : ℕ} (G : RatLTI n m p) (i : Fin p) (j : Fin m) (B : FreqBand) (γsq : ℚ) :

Lower gain check. As gainLe, with N - γ² Q ≥ 0.

theorem Cslib.LinearAlgebra.RatLTI.sq_norm_le_of_gainLe {n m p : ℕ} (G : RatLTI n m p) {i : Fin p} {j : Fin m} {B : FreqBand} {γsq : ℚ} (h : G.gainLe i j B γsq = true) {ω : ℝ} (hω : B.Mem ω) :

Soundness of the upper gain check: ‖H (ω * I) i j‖² ≤ γ² on the band.

theorem Cslib.LinearAlgebra.RatLTI.le_sq_norm_of_gainGe {n m p : ℕ} (G : RatLTI n m p) {i : Fin p} {j : Fin m} {B : FreqBand} {γsq : ℚ} (h : G.gainGe i j B γsq = true) {ω : ℝ} (hω : B.Mem ω) :

Soundness of the lower gain check: γ² ≤ ‖H (ω * I) i j‖² on the band.

theorem Cslib.LinearAlgebra.RatLTI.norm_le_of_gainLe {n m p : ℕ} (G : RatLTI n m p) {i : Fin p} {j : Fin m} {B : FreqBand} {γ : ℚ} (hγ : 0 ≤ γ) (h : G.gainLe i j B (γ ^ 2) = true) {ω : ℝ} (hω : B.Mem ω) :

Upper gain bound ‖H (ω * I) i j‖ ≤ γ on the band, from gainLe with γ².

theorem Cslib.LinearAlgebra.RatLTI.le_norm_of_gainGe {n m p : ℕ} (G : RatLTI n m p) {i : Fin p} {j : Fin m} {B : FreqBand} {γ : ℚ} (hγ : 0 ≤ γ) (h : G.gainGe i j B (γ ^ 2) = true) {ω : ℝ} (hω : B.Mem ω) :

Lower gain bound γ ≤ ‖H (ω * I) i j‖ on the band, from gainGe with γ².

Decibels #

Whether 0 ≤ x ≤ 10 ^ (L / 10), decided in ℚ as x ^ (10 q) ≤ 10 ^ p for L = p / q in lowest terms.

Whether 10 ^ (L / 10) ≤ x, decided in ℚ as 10 ^ p ≤ x ^ (10 q) for L = p / q in lowest terms (and 0 < x).

theorem Cslib.LinearAlgebra.dbLe_eq_true_iff {x L : ℚ} :
dbLe x L = true ↔ 0 ≤ ↑x ∧ ↑x ≤ 10 ^ (↑L / 10)

dbLe decides 0 ≤ x ≤ 10 ^ (L / 10).

theorem Cslib.LinearAlgebra.dbGe_eq_true_iff {x L : ℚ} :
dbGe x L = true ↔ 0 < ↑x ∧ 10 ^ (↑L / 10) ≤ ↑x

dbGe decides 0 < x and 10 ^ (L / 10) ≤ x.

theorem Cslib.LinearAlgebra.RatLTI.norm_le_db_of_gainLe {n m p : ℕ} (G : RatLTI n m p) {i : Fin p} {j : Fin m} {B : FreqBand} {γsq L : ℚ} (h : G.gainLe i j B γsq = true) (hdb : dbLe γsq L = true) {ω : ℝ} (hω : B.Mem ω) :
‖G.toSystem.transferFunction (↑ω * Complex.I) i j‖ ≤ 10 ^ (↑L / 20)

Upper gain bound in decibels: ‖H (ω * I) i j‖ ≤ 10 ^ (L / 20), that is 20 log₁₀ ‖H (ω * I) i j‖ ≤ L where the gain is nonzero, on the band, from gainLe with a rational γ² accepted by dbLe γ² L.

theorem Cslib.LinearAlgebra.RatLTI.rpow_le_norm_of_gainGe {n m p : ℕ} (G : RatLTI n m p) {i : Fin p} {j : Fin m} {B : FreqBand} {γsq L : ℚ} (h : G.gainGe i j B γsq = true) (hdb : dbGe γsq L = true) {ω : ℝ} (hω : B.Mem ω) :
10 ^ (↑L / 20) ≤ ‖G.toSystem.transferFunction (↑ω * Complex.I) i j‖

Lower gain bound in decibels: 10 ^ (L / 20) ≤ ‖H (ω * I) i j‖ on the band, from gainGe with a rational γ² accepted by dbGe γ² L.

theorem Cslib.LinearAlgebra.RatLTI.db_le_of_gainGe {n m p : ℕ} (G : RatLTI n m p) {i : Fin p} {j : Fin m} {B : FreqBand} {γsq L : ℚ} (h : G.gainGe i j B γsq = true) (hdb : dbGe γsq L = true) {ω : ℝ} (hω : B.Mem ω) :

Lower gain bound in decibels, logarithmic form: L ≤ 20 log₁₀ ‖H (ω * I) i j‖.

DC gain #

The rows of the DC gain D + c₀⁻¹ C Y₀ B, which is D - C A⁻¹ B when the resolvent is accepted and c₀ ≠ 0.

DC-gain check: the resolvent check, and c₀ = χ (0) ≠ 0.

The DC gain. An accepted DC-gain check proves that A is invertible and that D - C A⁻¹ B is the rational matrix dcGain, read over ℝ.

The transfer function at s = 0 is the DC gain: H 0 = D - C A⁻¹ B, computed exactly over ℚ.

Violation witnesses #

Whether a rational frequency lies in the band.

The outcome of a gain check on a band: the specification is proved on the whole band, it is violated at a stated rational frequency, or neither is established.

  • proved : GainVerdict

    The specification holds on the whole band.

  • violated (ω : ℚ) : GainVerdict

    The specification fails at the rational frequency ω of the band.

  • inconclusive : GainVerdict

    Neither a proof nor a violation was found.

Instances For
    def Cslib.LinearAlgebra.GainVerdict.Holds {n m p : ℕ} (v : GainVerdict) (G : RatLTI n m p) (B : FreqBand) (spec : ℝ → Prop) :

    What a verdict asserts about a specification spec ω of the frequency response of G on the band B. proved: spec holds on the whole band. violated ω: ω is in the band, i ω I - A is invertible (so H (ω * I) is the value of the transfer function, not a junk value of the matrix inverse), and spec fails at ω. inconclusive: nothing.

    proved if the check ok accepts, otherwise violated ω for a witness ω returned by the search w, otherwise inconclusive. The search is a thunk, run only when ok is false.

    The coefficient list of ω ↦ P (ω²) from that of P.

    Sign bisection of [a, b] for the polynomial with coefficient list P: while the values at the ends have strictly opposite signs, keep the half on which they still do, for at most fuel steps; the result is the final pair of ends.

    Candidate witnesses (untrusted sampling heuristic). Rational frequencies at which to look for a negative value of P (ω²) on the band B: the band's edges (for a half-line, a point beyond the Cauchy bound of P (ω²), past which its sign is constant), the ends inside the band of the isolating intervals of the real roots of P (ω²) (Cslib.RealRoot.isolateRoots), each refined by 32 steps of bisectSign, and the midpoints of consecutive such points. The refined ends lie close to the roots, which matters where the negative values are confined near a pole of the gain. The samples need not meet every sign of P (ω²) on the band: a rational point never attains a zero at an irrational root, such as ω = √2 for P (u) = u - 2 on [0, 2], and the completeness theorem for isolateRoots assumes a separable polynomial, which is not required here. Nothing about the list is proved: every candidate is checked by RatLTI.pointOk.

    def Cslib.LinearAlgebra.RatLTI.sqGainAt {n m p : ℕ} (G : RatLTI n m p) (i : Fin p) (j : Fin m) (ω : ℚ) :

    The squared gain N (ω²) / Q (ω²) at a rational frequency, computed in ℚ.

    def Cslib.LinearAlgebra.RatLTI.pointOk {n m p : ℕ} (G : RatLTI n m p) (B : FreqBand) (ω : ℚ) :

    Witness-point check. The resolvent check, ω in the band B, and Q (ω²) ≠ 0, so that i ω I - A is invertible.

    theorem Cslib.LinearAlgebra.RatLTI.sq_norm_eq_sqGainAt {n m p : ℕ} (G : RatLTI n m p) {B : FreqBand} {ω : ℚ} (h : G.pointOk B ω = true) (i : Fin p) (j : Fin m) :
    B.Mem ↑ω ∧ IsUnit ((↑↑ω * Complex.I) • 1 - G.toSystem.A.map ⇑(algebraMap ℝ ℂ)) ∧ ‖G.toSystem.transferFunction (↑↑ω * Complex.I) i j‖ ^ 2 = ↑(G.sqGainAt i j ω)

    Soundness of the witness-point check. At an accepted rational ω: ω is in the band, i ω I - A is invertible, and ‖H (ω * I) i j‖² = sqGainAt i j ω exactly.

    def Cslib.LinearAlgebra.RatLTI.findWitness {n m p : ℕ} (G : RatLTI n m p) (i : Fin p) (j : Fin m) (P : List ℚ) (B : FreqBand) (bad : ℚ → Bool) :

    The first candidate ω of witnessCandidates P B that passes pointOk and at which the squared gain satisfies bad.

    def Cslib.LinearAlgebra.RatLTI.gainLeVerdict {n m p : ℕ} (G : RatLTI n m p) (i : Fin p) (j : Fin m) (B : FreqBand) (γsq : ℚ) :

    Upper gain verdict: gainLe, or a rational ω in the band with γ² < N (ω²) / Q (ω²), searched where γ² Q - N is negative.

    def Cslib.LinearAlgebra.RatLTI.gainGeVerdict {n m p : ℕ} (G : RatLTI n m p) (i : Fin p) (j : Fin m) (B : FreqBand) (γsq : ℚ) :

    Lower gain verdict: gainGe, or a rational ω in the band with N (ω²) / Q (ω²) < γ², searched where N - γ² Q is negative.

    def Cslib.LinearAlgebra.RatLTI.dbLeVerdict {n m p : ℕ} (G : RatLTI n m p) (i : Fin p) (j : Fin m) (B : FreqBand) (γsq L : ℚ) :

    Upper decibel verdict for the level L: gainLe with γ² and dbLe γ² L, or a rational ω in the band whose squared gain g fails dbLe g L, that is 10 ^ (L / 10) < g, searched as in gainLeVerdict.

    def Cslib.LinearAlgebra.RatLTI.dbGeVerdict {n m p : ℕ} (G : RatLTI n m p) (i : Fin p) (j : Fin m) (B : FreqBand) (γsq L : ℚ) :

    Lower decibel verdict for the level L: gainGe with γ² and dbGe γ² L, or a rational ω in the band whose squared gain g > 0 fails dbGe g L, that is g < 10 ^ (L / 10), searched as in gainGeVerdict.

    theorem Cslib.LinearAlgebra.RatLTI.gainLeVerdict_holds {n m p : ℕ} (G : RatLTI n m p) (i : Fin p) (j : Fin m) (B : FreqBand) (γsq : ℚ) :
    (G.gainLeVerdict i j B γsq).Holds G B fun (ω : ℝ) => ‖G.toSystem.transferFunction (↑ω * Complex.I) i j‖ ^ 2 ≤ ↑γsq

    The upper gain verdict is correct: proved means ‖H (ω * I) i j‖² ≤ γ² on the band; violated ω means γ² < ‖H (ω * I) i j‖² at ω in the band, where i ω I - A is invertible.

    theorem Cslib.LinearAlgebra.RatLTI.gainGeVerdict_holds {n m p : ℕ} (G : RatLTI n m p) (i : Fin p) (j : Fin m) (B : FreqBand) (γsq : ℚ) :
    (G.gainGeVerdict i j B γsq).Holds G B fun (ω : ℝ) => ↑γsq ≤ ‖G.toSystem.transferFunction (↑ω * Complex.I) i j‖ ^ 2

    The lower gain verdict is correct: proved means γ² ≤ ‖H (ω * I) i j‖² on the band; violated ω means ‖H (ω * I) i j‖² < γ² at ω in the band, where i ω I - A is invertible.

    theorem Cslib.LinearAlgebra.RatLTI.dbLeVerdict_holds {n m p : ℕ} (G : RatLTI n m p) (i : Fin p) (j : Fin m) (B : FreqBand) (γsq L : ℚ) :
    (G.dbLeVerdict i j B γsq L).Holds G B fun (ω : ℝ) => ‖G.toSystem.transferFunction (↑ω * Complex.I) i j‖ ≤ 10 ^ (↑L / 20)

    The upper decibel verdict is correct: proved means ‖H (ω * I) i j‖ ≤ 10 ^ (L / 20) on the band; violated ω means 10 ^ (L / 20) < ‖H (ω * I) i j‖ at ω in the band, where i ω I - A is invertible.

    theorem Cslib.LinearAlgebra.RatLTI.dbGeVerdict_holds {n m p : ℕ} (G : RatLTI n m p) (i : Fin p) (j : Fin m) (B : FreqBand) (γsq L : ℚ) :
    (G.dbGeVerdict i j B γsq L).Holds G B fun (ω : ℝ) => ↑L ≤ 20 * Real.logb 10 ‖G.toSystem.transferFunction (↑ω * Complex.I) i j‖

    The lower decibel verdict is correct: proved means L ≤ 20 log₁₀ ‖H (ω * I) i j‖ on the band; violated ω means that this fails at ω in the band, where i ω I - A is invertible. Since Real.logb 10 0 = 0, the failure alone does not exclude a zero gain; dbGeVerdict_violated adds that the gain at ω is positive and below 10 ^ (L / 20).

    theorem Cslib.LinearAlgebra.RatLTI.dbGeVerdict_violated {n m p : ℕ} (G : RatLTI n m p) {i : Fin p} {j : Fin m} {B : FreqBand} {γsq L ω : ℚ} (h : G.dbGeVerdict i j B γsq L = GainVerdict.violated ω) :
    B.Mem ↑ω ∧ IsUnit ((↑↑ω * Complex.I) • 1 - G.toSystem.A.map ⇑(algebraMap ℝ ℂ)) ∧ 0 < ‖G.toSystem.transferFunction (↑↑ω * Complex.I) i j‖ ∧ ‖G.toSystem.transferFunction (↑↑ω * Complex.I) i j‖ < 10 ^ (↑L / 20)

    A lower decibel violation has a positive gain: if dbGeVerdict returns violated ω, then ω is in the band, i ω I - A is invertible and 0 < ‖H (ω * I) i j‖ < 10 ^ (L / 20).