Zulip Chat Archive
Stream: mathlib4
Topic: docstring error in image_le_of_deriv_right_le_deriv_boundary
dopamine (Aug 05 2025 at 10:23):
I found an error in the docstring for image_le_of_deriv_right_le_deriv_boundary in Mathlib.Analysis.Calculus.MeanValue.
see : https://leanprover-community.github.io/mathlib4_docs/Mathlib/Analysis/Calculus/MeanValue.html#image_le_of_deriv_right_le_deriv_boundary
The current docstring states:
/-- General fencing theorem for continuous functions with an estimate on the derivative.
Let `f` and `B` be continuous functions on `[a, b]` such that
* `f a ≤ B a`;
* `B` has derivative `B'` everywhere on `ℝ`;
* `f` has right derivative `f'` at every point of `[a, b)`;
* we have `f' x ≤ B' x` on `[a, b)`.
Then `f x ≤ B x` everywhere on `[a, b]`. -/
theorem image_le_of_deriv_right_le_deriv_boundary {f f' : ℝ → ℝ} {a b : ℝ}
(hf : ContinuousOn f (Icc a b)) (hf' : ∀ x ∈ Ico a b, HasDerivWithinAt f (f' x) (Ici x) x)
{B B' : ℝ → ℝ} (ha : f a ≤ B a) (hB : ContinuousOn B (Icc a b))
(hB' : ∀ x ∈ Ico a b, HasDerivWithinAt B (B' x) (Ici x) x)
(bound : ∀ x ∈ Ico a b, f' x ≤ B' x) : ∀ ⦃x⦄, x ∈ Icc a b → f x ≤ B x := ...
But it should be:
/-- General fencing theorem for continuous functions with an estimate on the derivative.
Let `f` and `B` be continuous functions on `[a, b]` such that
* `f a ≤ B a`;
* `B` has right derivative `B'` at every point of `[a, b)`;
* `f` has right derivative `f'` at every point of `[a, b)`;
* we have `f' x ≤ B' x` on `[a, b)`.
Then `f x ≤ B x` everywhere on `[a, b]`. -/
theorem image_le_of_deriv_right_le_deriv_boundary {f f' : ℝ → ℝ} {a b : ℝ}
(hf : ContinuousOn f (Icc a b)) (hf' : ∀ x ∈ Ico a b, HasDerivWithinAt f (f' x) (Ici x) x)
{B B' : ℝ → ℝ} (ha : f a ≤ B a) (hB : ContinuousOn B (Icc a b))
(hB' : ∀ x ∈ Ico a b, HasDerivWithinAt B (B' x) (Ici x) x)
(bound : ∀ x ∈ Ico a b, f' x ≤ B' x) : ∀ ⦃x⦄, x ∈ Icc a b → f x ≤ B x := ...
The issue is in the second bullet point - it currently says "B has derivative B' everywhere on ℝ" but should say "B has right derivative B' at every point of [a, b)" to match the actual theorem conditions.
Should I open a PR to fix this?
Kenny Lau (Aug 05 2025 at 10:30):
dopamine said:
Should I open a PR to fix this?
yes
dopamine (Aug 05 2025 at 13:09):
I've opened a PR to fix a documentation error: https://github.com/leanprover-community/mathlib4/pull/27985
Looking for review and approval from a maintainer!
Last updated: Dec 20 2025 at 21:32 UTC