Theorem 3.12 — variation of constants formula (3.97)
ProvedTeschlODE.Linear.variation_of_constantsLet be an interval, , , , , and let be the principal matrix solution of on . Then the solution of the inhomogeneous system
is
The formula reduces every inhomogeneous linear problem to the homogeneous one and underlies the perturbation results of Section 3.7.
Formalization Note. "The solution … is given by" is stated in both directions: the right-hand side of (3.97) solves (3.92) on (derivative relative to ), and every solution of (3.92) on with equals it at every . The integral is Mathlib's interval integral of an -valued function; it only uses for between and , hence in .
import Mathlib import Definitions.Def_TeschlODE_Linear_IsPrincipalMatrixSolution
namespace TeschlODE.Linear
/-- Teschl, Theorem 3.12 (p. 84), variation of constants (3.97): for `A ∈ C(I, ℝ^{n×n})`,
`g ∈ C(I, ℝⁿ)` and the principal matrix solution `Φ` of `ẋ = A(t) x` on `I`, the function
`x(t) = Φ(t, t₀) x₀ + ∫_{t₀}^{t} Φ(t, s) g(s) ds` solves the inhomogeneous system (3.92)
`ẋ = A(t) x + g(t)` on `I` with `x(t₀) = x₀`, and every solution of that initial value problem
coincides with it on `I`. -/
theorem variation_of_constants {n : ℕ} (A : ℝ → Matrix (Fin n) (Fin n) ℝ) (I : Set ℝ)
(hI : I.OrdConnected) (hA : ContinuousOn A I) (g : ℝ → Fin n → ℝ) (hg : ContinuousOn g I)
(Φ : ℝ → ℝ → Matrix (Fin n) (Fin n) ℝ) (hΦ : IsPrincipalMatrixSolution A I Φ)
(t₀ : ℝ) (ht₀ : t₀ ∈ I) (x₀ : Fin n → ℝ) :
(∀ t ∈ I, HasDerivWithinAt
(fun τ => Matrix.mulVec (Φ τ t₀) x₀ + ∫ s in t₀..τ, Matrix.mulVec (Φ τ s) (g s))
(Matrix.mulVec (A t) (Matrix.mulVec (Φ t t₀) x₀ +
∫ s in t₀..t, Matrix.mulVec (Φ t s) (g s)) + g t) I t) ∧
(∀ y : ℝ → Fin n → ℝ,
(∀ t ∈ I, HasDerivWithinAt y (Matrix.mulVec (A t) (y t) + g t) I t) → y t₀ = x₀ →
∀ t ∈ I, y t = Matrix.mulVec (Φ t t₀) x₀ + ∫ s in t₀..t, Matrix.mulVec (Φ t s) (g s)) := by sorry
end TeschlODE.Linear
Read-back
What the Lean code literally says, in plain math · claude-opus-5-5
Setting. Let , let , and let . The theorem assumes:
- is order-connected (an interval of any kind);
- is continuous on ;
- is continuous on ;
- is a principal matrix solution for on . That is, for every :
- ;
- for all and all indices , the function has derivative at relative to (limits along points of only, so one-sided at an endpoint in );
- and are given.
Define, for real ,
The integral is the oriented Lebesgue (Bochner) integral of an -valued function of : over if , and minus the integral over otherwise.
Claim. Two statements hold together.
(a) solves the inhomogeneous equation. For every , the function has derivative relative to at equal to
(b) Every solution of the initial value problem coincides with on . Suppose has, at every , derivative at relative to , and satisfies . Then
The claim does not state separately. It follows from the formula, since and the integral from to is .
Degenerate cases.
- Non-integrable integrand: the hypotheses state nothing directly about how depends on its second argument (no continuity or measurability in ). If, for some , the map is not integrable on the segment between and , the integral is by convention the zero vector. The formula above is then read with that value.
- : derivatives relative to a single point impose no condition. Part (a) holds automatically, and part (b) reduces to .
- : has a single element, and everything holds trivially.
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.