# mathlibdocumentation

analysis.ODE.gronwall

# Grönwall's inequality

The main technical result of this file is the Grönwall-like inequality norm_le_gronwall_bound_of_norm_deriv_right_le. It states that if f : ℝ → E satisfies ∥f a∥ ≤ δ and ∀ x ∈ [a, b), ∥f' x∥ ≤ K * ∥f x∥ + ε, then for all x ∈ [a, b] we have ∥f x∥ ≤ δ * exp (K * x) + (ε / K) * (exp (K * x) - 1).

Then we use this inequality to prove some estimates on the possible rate of growth of the distance between two approximate or exact solutions of an ordinary differential equation.

The proofs are based on [Hubbard and West, Differential Equations: A Dynamical Systems Approach, Sec. 4.5][HubbardWest-ode], where norm_le_gronwall_bound_of_norm_deriv_right_le is called “Fundamental Inequality”.

## TODO

• Once we have FTC, prove an inequality for a function satisfying ∥f' x∥ ≤ K x * ∥f x∥ + ε, or more generally liminf_{y→x+0} (f y - f x)/(y - x) ≤ K x * f x + ε with any sign of K x and f x.

### Technical lemmas about gronwall_bound

def gronwall_bound  :

Upper bound used in several Grönwall-like inequalities.

Equations
theorem gronwall_bound_K0 (δ ε : ) :
ε = λ (x : ), δ + ε * x

theorem gronwall_bound_of_K_ne_0 {δ K ε : } :
K 0 K ε = λ (x : ), δ * real.exp (K * x) + / K) * (real.exp (K * x) - 1))

theorem has_deriv_at_gronwall_bound (δ K ε x : ) :
has_deriv_at K ε) (K * ε x + ε) x

theorem has_deriv_at_gronwall_bound_shift (δ K ε x a : ) :
has_deriv_at (λ (y : ), ε (y - a)) (K * ε (x - a) + ε) x

theorem gronwall_bound_x0 (δ K ε : ) :
ε 0 = δ

theorem gronwall_bound_ε0 (δ K x : ) :
0 x = δ * real.exp (K * x)

theorem gronwall_bound_ε0_δ0 (K x : ) :
0 x = 0

theorem gronwall_bound_continuous_ε (δ K x : ) :
continuous (λ (ε : ), ε x)

### Inequality and corollaries

theorem le_gronwall_bound_of_liminf_deriv_right_le {f f' : } {δ K ε a b : } (hf : (set.Icc a b)) (hf' : ∀ (x : ), x b∀ (r : ), f' x < r(∃ᶠ (z : ) in 𝓝[] x, (z - x)⁻¹ * (f z - f x) < r)) (ha : f a δ) (bound : ∀ (x : ), x bf' x K * f x + ε) (x : ) :
x bf x ε (x - a)

A Grönwall-like inequality: if f : ℝ → ℝ is continuous on [a, b] and satisfies the inequalities f a ≤ δ and ∀ x ∈ [a, b), liminf_{z→x+0} (f z - f x)/(z - x) ≤ K * (f x) + ε, then f x is bounded by gronwall_bound δ K ε (x - a) on [a, b].

See also norm_le_gronwall_bound_of_norm_deriv_right_le for a version bounding ∥f x∥, f : ℝ → E.

theorem norm_le_gronwall_bound_of_norm_deriv_right_le {E : Type u_1} [normed_group E] [ E] {f f' : → E} {δ K ε a b : } (hf : (set.Icc a b)) (hf' : ∀ (x : ), x b (f' x) (set.Ioi x) x) (ha : f a δ) (bound : ∀ (x : ), x bf' x K * f x + ε) (x : ) :
x bf x ε (x - a)

A Grönwall-like inequality: if f : ℝ → E is continuous on [a, b], has right derivative f' x at every point x ∈ [a, b), and satisfies the inequalities ∥f a∥ ≤ δ, ∀ x ∈ [a, b), ∥f' x∥ ≤ K * ∥f x∥ + ε, then ∥f x∥ is bounded by gronwall_bound δ K ε (x - a) on [a, b].

theorem dist_le_of_approx_trajectories_ODE_of_mem_set {E : Type u_1} [normed_group E] [ E] {v : E → E} {s : set E} {K : } (hv : ∀ (t : ) (x y : E), x s ty s tdist (v t x) (v t y) K * dist x y) {f g f' g' : → E} {a b εf εg δ : } (hf : (set.Icc a b)) (hf' : ∀ (t : ), t b (f' t) (set.Ioi t) t) (f_bound : ∀ (t : ), t bdist (f' t) (v t (f t)) εf) (hfs : ∀ (t : ), t bf t s t) (hg : (set.Icc a b)) (hg' : ∀ (t : ), t b (g' t) (set.Ioi t) t) (g_bound : ∀ (t : ), t bdist (g' t) (v t (g t)) εg) (hgs : ∀ (t : ), t bg t s t) (ha : dist (f a) (g a) δ) (t : ) :
t bdist (f t) (g t) (εf + εg) (t - a)

If f and g are two approximate solutions of the same ODE, then the distance between them can't grow faster than exponentially. This is a simple corollary of Grönwall's inequality, and some people call this Grönwall's inequality too.

This version assumes all inequalities to be true in some time-dependent set s t, and assumes that the solutions never leave this set.

theorem dist_le_of_approx_trajectories_ODE {E : Type u_1} [normed_group E] [ E] {v : E → E} {K : ℝ≥0} (hv : ∀ (t : ), (v t)) {f g f' g' : → E} {a b εf εg δ : } (hf : (set.Icc a b)) (hf' : ∀ (t : ), t b (f' t) (set.Ioi t) t) (f_bound : ∀ (t : ), t bdist (f' t) (v t (f t)) εf) (hg : (set.Icc a b)) (hg' : ∀ (t : ), t b (g' t) (set.Ioi t) t) (g_bound : ∀ (t : ), t bdist (g' t) (v t (g t)) εg) (ha : dist (f a) (g a) δ) (t : ) :
t bdist (f t) (g t) (εf + εg) (t - a)

If f and g are two approximate solutions of the same ODE, then the distance between them can't grow faster than exponentially. This is a simple corollary of Grönwall's inequality, and some people call this Grönwall's inequality too.

This version assumes all inequalities to be true in the whole space.

theorem dist_le_of_trajectories_ODE_of_mem_set {E : Type u_1} [normed_group E] [ E] {v : E → E} {s : set E} {K : } (hv : ∀ (t : ) (x y : E), x s ty s tdist (v t x) (v t y) K * dist x y) {f g : → E} {a b δ : } (hf : (set.Icc a b)) (hf' : ∀ (t : ), t b (v t (f t)) (set.Ioi t) t) (hfs : ∀ (t : ), t bf t s t) (hg : (set.Icc a b)) (hg' : ∀ (t : ), t b (v t (g t)) (set.Ioi t) t) (hgs : ∀ (t : ), t bg t s t) (ha : dist (f a) (g a) δ) (t : ) :
t bdist (f t) (g t) δ * real.exp (K * (t - a))

If f and g are two exact solutions of the same ODE, then the distance between them can't grow faster than exponentially. This is a simple corollary of Grönwall's inequality, and some people call this Grönwall's inequality too.

This version assumes all inequalities to be true in some time-dependent set s t, and assumes that the solutions never leave this set.

theorem dist_le_of_trajectories_ODE {E : Type u_1} [normed_group E] [ E] {v : E → E} {K : ℝ≥0} (hv : ∀ (t : ), (v t)) {f g : → E} {a b δ : } (hf : (set.Icc a b)) (hf' : ∀ (t : ), t b (v t (f t)) (set.Ioi t) t) (hg : (set.Icc a b)) (hg' : ∀ (t : ), t b (v t (g t)) (set.Ioi t) t) (ha : dist (f a) (g a) δ) (t : ) :
t bdist (f t) (g t) δ * real.exp ((K) * (t - a))

If f and g are two exact solutions of the same ODE, then the distance between them can't grow faster than exponentially. This is a simple corollary of Grönwall's inequality, and some people call this Grönwall's inequality too.

This version assumes all inequalities to be true in the whole space.

theorem ODE_solution_unique_of_mem_set {E : Type u_1} [normed_group E] [ E] {v : E → E} {s : set E} {K : } (hv : ∀ (t : ) (x y : E), x s ty s tdist (v t x) (v t y) K * dist x y) {f g : → E} {a b : } (hf : (set.Icc a b)) (hf' : ∀ (t : ), t b (v t (f t)) (set.Ioi t) t) (hfs : ∀ (t : ), t bf t s t) (hg : (set.Icc a b)) (hg' : ∀ (t : ), t b (v t (g t)) (set.Ioi t) t) (hgs : ∀ (t : ), t bg t s t) (ha : f a = g a) (t : ) :
t bf t = g t

There exists only one solution of an ODE (\dot x=v(t, x)) in a set s ⊆ ℝ × E with a given initial value provided that RHS is Lipschitz continuous in x within s, and we consider only solutions included in s.

theorem ODE_solution_unique {E : Type u_1} [normed_group E] [ E] {v : E → E} {K : ℝ≥0} (hv : ∀ (t : ), (v t)) {f g : → E} {a b : } (hf : (set.Icc a b)) (hf' : ∀ (t : ), t b (v t (f t)) (set.Ioi t) t) (hg : (set.Icc a b)) (hg' : ∀ (t : ), t b (v t (g t)) (set.Ioi t) t) (ha : f a = g a) (t : ) :
t bf t = g t

There exists only one solution of an ODE (\dot x=v(t, x)) with a given initial value provided that RHS is Lipschitz continuous in x.