import Mathlib /-! # Backward Grönwall inequality (differential form) **Stated.** Let `φ : ℝ → ℝ` be continuous on `[0, T]`, differentiable on `(0, T)`, with `φ T ≤ M₀` and the backward differential inequality `-φ'(t) ≤ L · φ(t)` on `(0, T)`. Then `φ t ≤ exp (L · (T - t)) · M₀` for every `t ∈ [0, T]`. This is the (only) genuine content of "Problem 2" of the audited HJB-tractability files: there, the inequality `-d/dt ‖u(t)‖_{B_d} ≤ L ‖u(t)‖_{B_d}` along the HJB flow was *assumed*, so the "flow regularity" theorem reduced to this lemma. **Not stated.** Nothing here is about the HJB equation, Barron norms or any PDE flow: proving that a structured norm of the HJB solution satisfies such a differential inequality with polynomial-in-`d` constants is an open research question and is NOT part of this problem. The sign of `L` is unrestricted (the lemma holds for every real `L`). -/ namespace NSHJB.BackwardGronwall /-- Backward Grönwall lemma, differential form. -/ theorem backward_gronwall {T L M₀ : ℝ} (hT : 0 ≤ T) (φ : ℝ → ℝ) (hcont : ContinuousOn φ (Set.Icc 0 T)) (hdiff : ∀ t ∈ Set.Ioo 0 T, DifferentiableAt ℝ φ t) (hineq : ∀ t ∈ Set.Ioo 0 T, -deriv φ t ≤ L * φ t) (hterm : φ T ≤ M₀) : ∀ t ∈ Set.Icc 0 T, φ t ≤ Real.exp (L * (T - t)) * M₀ := by sorry end NSHJB.BackwardGronwall