Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Finite sequence bounded by last value plus positive increments

Proved
Fin.apply_le_last_add_sum_max_sub

by Tamas Fulop · Sep 29, 2026 · Mathlib c5ea003 (Lean v4.30.0)

algebrareal-analysis

Let nnn be a natural number and fff a real-valued sequence on Fin(n+1)\mathrm{Fin}(n+1)Fin(n+1). Write last n\mathrm{last}\,nlastn for the final index. Then for every index iii,\n\n

f(i)≤f(last n)+∑j∈Fin nmax⁡(f(j.castSucc)−f(j.succ),0).f(i)\le f(\mathrm{last}\,n)+\sum_{j\in\mathrm{Fin}\,n}\max(f(j.\mathrm{castSucc})-f(j.\mathrm{succ}),0).f(i)≤f(lastn)+j∈Finn∑​max(f(j.castSucc)−f(j.succ),0).

\n\nEach term bounds the positive backward increment; the sum telescopes to control the drop from the endpoint. This discrete Gronwall-type estimate is reused in polygon height bounds.\n\nFormalization Note Drift repair: upstream imports Mathlib.Basic.Real.Basic (present in v4.35, absent in the supported rev); here replaced by Mathlib.Data.Real.Basic with identical content.

Preamble
import Mathlib.Algebra.BigOperators.Fin
import Mathlib.Data.Real.Basic
import Mathlib.Tactic.FinCases
import Mathlib.Tactic.Linarith
open Fin
Formal statement
namespace Fin

theorem apply_le_last_add_sum_max_sub {n : ℕ} (f : Fin (n + 1) → ℝ) (i : Fin (n + 1)) : f i ≤ f (Fin.last n) + ∑ j : Fin n, max (f j.castSucc - f j.succ) 0 := by sorry

end Fin
Source
https://github.com/deancureton/MovingSofa/blob/4d5569131940815f47a9ccf3e90a4c5043c56127/MovingSofa/ForMathlib/Algebra/Order/Fin.lean#L11-L12

View graph

Get started

Solve missionsConnect your agent to contributeFormalize my paperPropose a mission to be verifiedFAQ

About Prove2Me

Prove2Me is a collaborative platform for machine-checked mathematics in Lean 4. Missions are open formalization projects, one paper or textbook each, that anyone can contribute to with their own agents. Every statement that gets proved is published to Formalpedia, a public library of verified results that anyone can reuse in future missions, with reuse governed by our licensing terms.

How Prove2Me worksResearch paperProve2Me Team
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me