Skip to content

Commit 3ee3390

Browse files
committed
feat(Analysis/ODE): add discrete Grönwall inequality (#34709)
## Summary Add discrete Grönwall inequality to `Mathlib/Analysis/ODE/DiscreteGronwall.lean` Provides bounds for recurrence inequalities of the form `u(n+1) ≤ c(n) * u(n) + b(n)` ### Main results - `discrete_gronwall_prod_general`: Product form working over any linearly ordered commutative ring - `discrete_gronwall`: Classical exponential bound `u(n) ≤ (u(n₀) + ∑ b(k)) * exp(∑ c(i))` (ℝ-specific) - `discrete_gronwall_Ico`: Uniform bound over a finite interval (ℝ-specific) ## Related work Complements the continuous Grönwall inequality in `Mathlib.Analysis.ODE.Gronwall` ## References * Grönwall, T. H. (1919). "Note on the derivatives with respect to a parameter of the solutions of a system of differential equations". *Annals of Mathematics*, 20(4), 292–296. This is human-made PR with AI help in golfing proof and documenting the code.
1 parent a34dc90 commit 3ee3390

3 files changed

Lines changed: 109 additions & 0 deletions

File tree

Mathlib.lean

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2223,6 +2223,7 @@ public import Mathlib.Analysis.NormedSpace.PiTensorProduct.InjectiveSeminorm
22232223
public import Mathlib.Analysis.NormedSpace.PiTensorProduct.ProjectiveSeminorm
22242224
public import Mathlib.Analysis.NormedSpace.RieszLemma
22252225
public import Mathlib.Analysis.ODE.Basic
2226+
public import Mathlib.Analysis.ODE.DiscreteGronwall
22262227
public import Mathlib.Analysis.ODE.Gronwall
22272228
public import Mathlib.Analysis.ODE.PicardLindelof
22282229
public import Mathlib.Analysis.ODE.Transform
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
/-
2+
Copyright (c) 2026 Dennj Osele. All rights reserved.
3+
Released under Apache 2.0 license as described in the file LICENSE.
4+
Authors: Dennj Osele
5+
-/
6+
module
7+
8+
public import Mathlib.Analysis.SpecialFunctions.ExpDeriv
9+
10+
/-!
11+
# Discrete Grönwall inequality
12+
13+
Various forms of the discrete Grönwall inequality, bounding solutions to recurrence
14+
inequalities `u (n+1) ≤ c n * u n + b n` and `u (n+1) ≤ (1 + c n) * u n + b n`.
15+
16+
## Main results
17+
18+
* `discrete_gronwall_prod_general`: product form, over any ordered commutative semiring.
19+
* `discrete_gronwall`: classical exponential bound for the `(1 + c)` form, over `ℝ`.
20+
* `discrete_gronwall_Ico`: uniform bound over an interval, over `ℝ`.
21+
22+
## References
23+
24+
* [T. H. Grönwall, *Note on the derivatives with respect to a parameter of the solutions of a
25+
system of differential equations*][Gronwall_1919]
26+
27+
## See also
28+
29+
* `Mathlib.Analysis.ODE.Gronwall` for the continuous Grönwall inequality for ODEs.
30+
-/
31+
32+
@[expose] public section
33+
34+
open Real Finset
35+
36+
section General
37+
38+
/-! ### Generalized product form -/
39+
40+
variable {R : Type*} [CommSemiring R] [PartialOrder R] [IsOrderedRing R] {u b c : ℕ → R}
41+
42+
/-- Discrete Grönwall inequality, product form: if `u (n+1) ≤ c n * u n + b n` and `0 ≤ c n`
43+
then `u n ≤ u n₀ * ∏ c i + ∑ b k * ∏ c i` over the appropriate ranges. -/
44+
theorem discrete_gronwall_prod_general {n₀ : ℕ} (hu : ∀ n ≥ n₀, u (n + 1) ≤ c n * u n + b n)
45+
(hc : ∀ n ≥ n₀, 0 ≤ c n) ⦃n : ℕ⦄ (hn : n₀ ≤ n) :
46+
u n ≤ u n₀ * ∏ i ∈ Ico n₀ n, c i +
47+
∑ k ∈ Ico n₀ n, b k * ∏ i ∈ Ico (k + 1) n, c i := by
48+
induction n, hn using Nat.le_induction with
49+
| base => simp
50+
| succ k hk ih =>
51+
have hck : 0 ≤ c k := hc k hk
52+
have heq : c k * ∑ j ∈ Ico n₀ k, b j * ∏ i ∈ Ico (j + 1) k, c i + b k =
53+
∑ j ∈ Ico n₀ (k + 1), b j * ∏ i ∈ Ico (j + 1) (k + 1), c i := by
54+
rw [sum_Ico_succ_top hk, mul_sum, Ico_self, prod_empty, mul_one]
55+
refine congr_arg (· + b k) (sum_congr rfl fun j hj ↦ ?_)
56+
rw [prod_Ico_succ_top (by have := mem_Ico.mp hj; omega)]; ring
57+
calc u (k + 1)
58+
_ ≤ c k * u k + b k := hu k hk
59+
_ ≤ c k * (u n₀ * ∏ i ∈ Ico n₀ k, c i +
60+
∑ j ∈ Ico n₀ k, b j * ∏ i ∈ Ico (j + 1) k, c i) + b k := by gcongr
61+
_ = u n₀ * ∏ i ∈ Ico n₀ (k + 1), c i +
62+
∑ j ∈ Ico n₀ (k + 1), b j * ∏ i ∈ Ico (j + 1) (k + 1), c i := by
63+
rw [← heq, ← prod_Ico_mul_eq_prod_Ico_add_one hk]; ring
64+
65+
end General
66+
67+
/-! ### Real-valued exponential form -/
68+
69+
variable {u b c : ℕ → ℝ}
70+
71+
/-- Discrete Grönwall inequality, exponential form: if `u (n+1) ≤ (1 + c n) * u n + b n` with
72+
`b`, `c`, and `u n₀` non-negative, then `u n ≤ (u n₀ + ∑ b k) * exp (∑ c i)`. -/
73+
theorem discrete_gronwall {n₀ : ℕ} (hun₀ : 0 ≤ u n₀)
74+
(hu : ∀ n ≥ n₀, u (n + 1) ≤ (1 + c n) * u n + b n) (hc : ∀ n ≥ n₀, 0 ≤ c n)
75+
(hb : ∀ n ≥ n₀, 0 ≤ b n) ⦃n : ℕ⦄ (hn : n₀ ≤ n) :
76+
u n ≤ (u n₀ + ∑ k ∈ Ico n₀ n, b k) * exp (∑ i ∈ Ico n₀ n, c i) := by
77+
calc u n
78+
_ ≤ u n₀ * ∏ i ∈ Ico n₀ n, (1 + c i) +
79+
∑ k ∈ Ico n₀ n, b k * ∏ i ∈ Ico (k + 1) n, (1 + c i) :=
80+
discrete_gronwall_prod_general hu (by grind) hn
81+
_ ≤ u n₀ * ∏ i ∈ Ico n₀ n, (1 + c i) +
82+
∑ k ∈ Ico n₀ n, b k * ∏ i ∈ Ico n₀ n, (1 + c i) := by
83+
gcongr <;> grind
84+
_ = (u n₀ + ∑ k ∈ Ico n₀ n, b k) * ∏ i ∈ Ico n₀ n, (1 + c i) := by rw [add_mul, sum_mul]
85+
_ ≤ (u n₀ + ∑ k ∈ Ico n₀ n, b k) * exp (∑ i ∈ Ico n₀ n, c i) := by
86+
gcongr <;> try exact add_nonneg hun₀ <| sum_nonneg <| by grind
87+
simpa [exp_sum] using prod_le_prod (by grind) (by grind [add_one_le_exp])
88+
89+
/-- Discrete Grönwall inequality, uniform bound: a single bound holding for all `n ∈ [n₀, n₁)`. -/
90+
theorem discrete_gronwall_Ico {n₀ n₁ : ℕ} (hun₀ : 0 ≤ u n₀)
91+
(hu : ∀ n ≥ n₀, u (n + 1) ≤ (1 + c n) * u n + b n)
92+
(hc : ∀ n ≥ n₀, 0 ≤ c n) (hb : ∀ n ≥ n₀, 0 ≤ b n) ⦃n : ℕ⦄ (hn : n ∈ Ico n₀ n₁) :
93+
u n ≤ (u n₀ + ∑ k ∈ Ico n₀ n₁, b k) * exp (∑ i ∈ Ico n₀ n₁, c i) := by
94+
have : 0 ≤ ∑ k ∈ Ico n₀ n₁, b k := sum_nonneg <| by grind
95+
exact (discrete_gronwall hun₀ hu hc hb (mem_Ico.mp hn).1).trans (by gcongr <;> grind)

docs/references.bib

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2572,6 +2572,19 @@ @Unpublished{ grinberg_clifford_2016
25722572
year = {2016}
25732573
}
25742574

2575+
@Article{ Gronwall_1919,
2576+
author = {Gronwall, T. H.},
2577+
title = {Note on the derivatives with respect to a parameter of the
2578+
solutions of a system of differential equations},
2579+
journal = {Annals of Mathematics. Second Series},
2580+
volume = {20},
2581+
number = {4},
2582+
year = {1919},
2583+
pages = {292--296},
2584+
doi = {10.2307/1967124},
2585+
url = {https://doi.org/10.2307/1967124}
2586+
}
2587+
25752588
@Article{ grothendieck-1957,
25762589
author = {Grothendieck, Alexander},
25772590
title = {Sur quelques points d'alg\`ebre homologique},

0 commit comments

Comments
 (0)