Documentation

LeanForControl.ODEs.ComparisonLemma

ODEs.ComparisonLemma #

The comparison lemma for scalar ODEs: if u is an exact solution of u̇ = f(t, u) with u(t₀) = u₀, and v is continuous with upper Dini derivative satisfying D⁺v(t) ≤ f(t, v(t)) and v(t₀) ≤ u₀, then v(t) ≤ u(t) for all t ∈ [t₀, t₁].

Proof strategy (Khalil) #

Main declarations #

comparison_claim_1 is a private step of the proof of comparison_lemma.

Integral solution helper #

theorem isIntegralSolution_of_hasDerivAt {f : ℝ → ℝ → ℝ} {u : ℝ → ℝ} {t₀ t₁ u₀ : ℝ} (ht : t₀ ≤ t₁) (hu_deriv : ∀ t ∈ Set.Ioo t₀ t₁, HasDerivAt u (f t (u t)) t) (hu_cont : ContinuousOn u (Set.Icc t₀ t₁)) (hf_cont : Continuous fun (p : ℝ × ℝ) => f p.1 p.2) (hu₀ : u t₀ = u₀) :
IsIntegralSolution t₀ t₁ u u₀ f

Converts a classical (pointwise) ODE solution into an integral solution.

If u has derivative f(t, u(t)) at every interior point of [t₀, t₁], is continuous on [t₀, t₁], and satisfies u(t₀) = u₀, then u is an integral solution in the sense of IsIntegralSolution.

The comparison lemma #

theorem comparison_lemma {f : ℝ → ℝ → ℝ} {u v : ℝ → ℝ} {t₀ t₁ u₀ L : ℝ} (ht : t₀ < t₁) (hL : 0 < L) (hf_cont : Continuous fun (p : ℝ × ℝ) => f p.1 p.2) (hLip : ∀ t ∈ Set.Icc t₀ t₁, LipschitzWith ⟨L, ⋯⟩ (f t)) (hu_deriv : ∀ t ∈ Set.Ioo t₀ t₁, HasDerivAt u (f t (u t)) t) (hu_cont : ContinuousOn u (Set.Icc t₀ t₁)) (hu₀ : u t₀ = u₀) (hv_cont : ContinuousOn v (Set.Icc t₀ t₁)) (hDv : ∀ t ∈ Set.Ico t₀ t₁, D⁺ v t ≤ ↑(f t (v t))) (hv₀ : v t₀ ≤ u₀) (hz_exists : ∀ (lam : ℝ), 0 < lam → ∃ (z : ℝ → ℝ), (IsIntegralSolution t₀ t₁ z u₀ fun (s x : ℝ) => f s x + lam) ∧ ContinuousOn z (Set.Icc t₀ t₁) ∧ ∀ s ∈ Set.Ico t₀ t₁, HasDerivWithinAt z (f s (z s) + lam) (Set.Ici s) s) (t : ℝ) :
t ∈ Set.Icc t₀ t₁ → v t ≤ u t

Comparison lemma. If u solves u̇ = f(t, u) with u(t₀) = u₀, and v is continuous with D⁺v(t) ≤ f(t, v(t)) and v(t₀) ≤ u₀, then v(t) ≤ u(t) on [t₀, t₁].

Hypotheses:

  • f is jointly continuous and globally Lipschitz in the state variable on [t₀, t₁].
  • u solves the ODE classically (pointwise derivative).
  • v satisfies the Dini subsolution inequality.
  • For each λ > 0, a perturbed solution z_λ of ż = f(t, z) + λ exists on [t₀, t₁] (the existence hypothesis hz_exists, kept for generality; it is always discharged by exists_isIntegralSolution_Icc_of_lipschitz).

The proof uses comparison_claim_1 to get v ≤ z_λ, then continuous_dependence_parameters to bound ‖u - z_λ‖ ≤ ε/2, and concludes v(t) < u(t) + ε for all ε > 0.

For an absolutely continuous v satisfying the inequality only almost everywhere, as along a Carathéodory trajectory, see AbsolutelyContinuousOnInterval.comparison_lemma.

Reference: Khalil, Nonlinear Systems (3rd ed.), the comparison lemma.

The comparison lemma for absolutely continuous functions #

theorem AbsolutelyContinuousOnInterval.comparison_lemma {f : ℝ → ℝ → ℝ} {u v : ℝ → ℝ} {a b L : ℝ} (hv : AbsolutelyContinuousOnInterval v a b) (hu : AbsolutelyContinuousOnInterval u a b) (hf : ∀ᵐ (t : ℝ), t ∈ Set.Ioo a b → u t < v t → f t (v t) - f t (u t) ≤ L * (v t - u t)) (hv' : ∀ᵐ (t : ℝ), t ∈ Set.Ioo a b → deriv v t ≤ f t (v t)) (hu' : ∀ᵐ (t : ℝ), t ∈ Set.Ioo a b → f t (u t) ≤ deriv u t) (h₀ : v a ≤ u a) (t : ℝ) :
t ∈ Set.Icc a b → v t ≤ u t

Comparison lemma, absolutely continuous form. Let v and u be absolutely continuous on [a, b] with v̇ ≤ f(t, v) and f(t, u) ≤ u̇ almost everywhere, and v(a) ≤ u(a). If f is one-sided Lipschitz along the two curves, f(t, v(t)) - f(t, u(t)) ≤ L (v(t) - u(t)) for almost every t with u(t) < v(t), then v ≤ u on [a, b].

The one-sided bound holds when f t is L-Lipschitz; L is any real, and f needs no regularity in time. In particular u may be a solution, u̇ = f(t, u).

This is the form that applies along Carathéodory trajectories. The textbook form, comparison_lemma, asks v only continuous with the Dini inequality D⁺v ≤ f(t, v) at every point, and f continuous and Lipschitz; neither form implies the other.

Reference: Khalil, Nonlinear Systems (3rd ed.), the comparison lemma, there for a continuous v and the upper right Dini derivative.