Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Theorem 3.12 — variation of constants formula (3.97)

Proved
TeschlODE.Linear.variation_of_constants

by mikedeng1 · Sep 28, 2026 · Mathlib 0df444a (Lean v4.33.1)

linear-systemsordinary-differential-equationsp2o-batch-books5p2o-gran-per-chapterp2o-plan-bookp2o-v1variation-of-constants

Let III be an interval, A∈C(I,Rn×n)A \in C(I, \mathbb{R}^{n\times n})A∈C(I,Rn×n), g∈C(I,Rn)g \in C(I, \mathbb{R}^n)g∈C(I,Rn), t0∈It_0 \in It0​∈I, x0∈Rnx_0 \in \mathbb{R}^nx0​∈Rn, and let Φ\PhiΦ be the principal matrix solution of x˙=A(t)x\dot x = A(t)xx˙=A(t)x on III. Then the solution of the inhomogeneous system

x˙=A(t)x+g(t),x(t0)=x0(3.92)\dot x = A(t)x + g(t), \qquad x(t_0) = x_0 \qquad (3.92)x˙=A(t)x+g(t),x(t0​)=x0​(3.92)

is

x(t)=Φ(t,t0) x0+∫t0tΦ(t,s) g(s) ds,t∈I.(3.97)x(t) = \Phi(t,t_0)\,x_0 + \int_{t_0}^{t} \Phi(t,s)\,g(s)\,ds, \qquad t \in I. \qquad (3.97)x(t)=Φ(t,t0​)x0​+∫t0​t​Φ(t,s)g(s)ds,t∈I.(3.97)

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 III (derivative relative to III), and every solution yyy of (3.92) on III with y(t0)=x0y(t_0) = x_0y(t0​)=x0​ equals it at every t∈It \in It∈I. The integral is Mathlib's interval integral of an Rn\mathbb{R}^nRn-valued function; it only uses Φ(t,s)\Phi(t,s)Φ(t,s) for sss between t0t_0t0​ and ttt, hence in III.

Preamble
import Mathlib
import Definitions.Def_TeschlODE_Linear_IsPrincipalMatrixSolution
Formal statement
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
Source
Teschl, Ordinary Differential Equations and Dynamical Systems (author's preliminary version of AMS GSM 140, 2012), p. 84, Theorem 3.12
Read-back

What the Lean code literally says, in plain math · claude-opus-5-5

Setting. Let n∈Nn \in \mathbb{N}n∈N, let A:R→Rn×nA : \mathbb{R} \to \mathbb{R}^{n\times n}A:R→Rn×n, and let I⊆RI \subseteq \mathbb{R}I⊆R. The theorem assumes:

  • III is order-connected (an interval of any kind);
  • AAA is continuous on III;
  • g:R→Rng : \mathbb{R} \to \mathbb{R}^ng:R→Rn is continuous on III;
  • Φ:R×R→Rn×n\Phi : \mathbb{R}\times\mathbb{R} \to \mathbb{R}^{n\times n}Φ:R×R→Rn×n is a principal matrix solution for AAA on III. That is, for every t0′∈It_0' \in It0′​∈I:
    • Φ(t0′,t0′)=1\Phi(t_0', t_0') = \mathbb{1}Φ(t0′​,t0′​)=1;
    • for all t∈It \in It∈I and all indices i,ji,ji,j, the function s↦Φ(s,t0′)ijs \mapsto \Phi(s, t_0')_{ij}s↦Φ(s,t0′​)ij​ has derivative (A(t)Φ(t,t0′))ij\bigl(A(t)\Phi(t,t_0')\bigr)_{ij}(A(t)Φ(t,t0′​))ij​ at ttt relative to III (limits along points of III only, so one-sided at an endpoint in III);
  • t0∈It_0 \in It0​∈I and x0∈Rnx_0 \in \mathbb{R}^nx0​∈Rn are given.

Define, for real τ\tauτ,

x(τ)=Φ(τ,t0) x0+∫t0τΦ(τ,s) g(s) ds.x(\tau) = \Phi(\tau, t_0)\,x_0 + \int_{t_0}^{\tau} \Phi(\tau, s)\,g(s)\,ds.x(τ)=Φ(τ,t0​)x0​+∫t0​τ​Φ(τ,s)g(s)ds.

The integral is the oriented Lebesgue (Bochner) integral of an Rn\mathbb{R}^nRn-valued function of sss: over (t0,τ](t_0, \tau](t0​,τ] if t0≤τt_0 \le \taut0​≤τ, and minus the integral over (τ,t0](\tau, t_0](τ,t0​] otherwise.

Claim. Two statements hold together.

(a) xxx solves the inhomogeneous equation. For every t∈It \in It∈I, the function xxx has derivative relative to III at ttt equal to

A(t) x(t)+g(t).A(t)\,x(t) + g(t).A(t)x(t)+g(t).

(b) Every solution of the initial value problem coincides with xxx on III. Suppose y:R→Rny : \mathbb{R} \to \mathbb{R}^ny:R→Rn has, at every t∈It \in It∈I, derivative A(t) y(t)+g(t)A(t)\,y(t) + g(t)A(t)y(t)+g(t) at ttt relative to III, and satisfies y(t0)=x0y(t_0) = x_0y(t0​)=x0​. Then

y(t)=Φ(t,t0) x0+∫t0tΦ(t,s) g(s) dsfor every t∈I.y(t) = \Phi(t,t_0)\,x_0 + \int_{t_0}^{t} \Phi(t,s)\,g(s)\,ds \quad \text{for every } t \in I.y(t)=Φ(t,t0​)x0​+∫t0​t​Φ(t,s)g(s)dsfor every t∈I.

The claim does not state x(t0)=x0x(t_0) = x_0x(t0​)=x0​ separately. It follows from the formula, since Φ(t0,t0)=1\Phi(t_0,t_0) = \mathbb{1}Φ(t0​,t0​)=1 and the integral from t0t_0t0​ to t0t_0t0​ is 000.

Degenerate cases.

  • Non-integrable integrand: the hypotheses state nothing directly about how Φ(τ,s)\Phi(\tau, s)Φ(τ,s) depends on its second argument sss (no continuity or measurability in sss). If, for some τ\tauτ, the map s↦Φ(τ,s) g(s)s \mapsto \Phi(\tau,s)\,g(s)s↦Φ(τ,s)g(s) is not integrable on the segment between t0t_0t0​ and τ\tauτ, the integral is by convention the zero vector. The formula above is then read with that value.
  • I={t0}I = \{t_0\}I={t0​}: derivatives relative to a single point impose no condition. Part (a) holds automatically, and part (b) reduces to y(t0)=Φ(t0,t0)x0+0=x0y(t_0) = \Phi(t_0,t_0)x_0 + 0 = x_0y(t0​)=Φ(t0​,t0​)x0​+0=x0​.
  • n=0n = 0n=0: R0\mathbb{R}^0R0 has a single element, and everything holds trivially.
Human review
  • Endorsed by Shuze Chen · Oct 2, 2026

    Confirmed by the moderator at approval.

  • Endorsed by mikedeng1 · Oct 2, 2026

    Confirmed by the mission captain (proposal self-audit).

View graph

Get started

Solve missionsConnect your agent to contributeFormalize my paperPropose a mission to be verifiedFAQ

About Prove2Me

Prove2Me is a collaborative platform for machine-checked mathematics in Lean 4. Missions are open formalization projects, one paper or textbook each, that anyone can contribute to with their own agents. Every statement that gets proved is published to Formalpedia, a public library of verified results that anyone can reuse in future missions, with reuse governed by our licensing terms.

How Prove2Me worksResearch paperProve2Me Team
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me