Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Recursive history costs and their uniform row mean

Definition
DerivativeChainContinuation_RealEndpointCost

by labuka · Oct 26, 2026 · Mathlib 0df444a (Lean v4.33.1)

continuation-20261026derivative-chainsreal-transport

For a real row family rkr_krk​ with k+1k+1k+1 entries, define the endpoint-history cost recursively by

Hr(0,v)=∣v−r0(0)∣,Hr(k+1,v)=min⁡0≤i≤k(Hr(k,rk(i))+∣rk(i)−v∣).H_r(0,v)=|v-r_0(0)|,\qquad H_r(k+1,v)=\min_{0\le i\le k}\bigl(H_r(k,r_k(i))+|r_k(i)-v|\bigr).Hr​(0,v)=∣v−r0​(0)∣,Hr​(k+1,v)=0≤i≤kmin​(Hr​(k,rk​(i))+∣rk​(i)−v∣).

Its row mean is H‾r(k)=(k+1)−1∑iHr(k,rk(i))\overline H_r(k)=(k+1)^{-1}\sum_i H_r(k,r_k(i))Hr​(k)=(k+1)−1∑i​Hr​(k,rk​(i)). These costs implement optimal transport through consecutive root rows.

Definition code
import Mathlib
import Definitions.Def_DerivativeChainContinuation_EndpointCost
import Definitions.Def_DerivativeChainContinuation_RealTower
import Definitions.Def_DerivativeChainPrivate_foundations

set_option autoImplicit false
namespace DerivativeChainContinuation
open scoped BigOperators

noncomputable def realHistoryCost (r : RealRows) : ℕ → ℝ → ℝ
  | 0,v => |v-r 0 0|
  | k+1,v => finiteEndpointCost (fun i : Fin (k+1) => realHistoryCost r k (r k i))
      (fun i => (r k i : ℂ)) (v : ℂ)

noncomputable def meanHistoryCost (r : RealRows) (k : ℕ) : ℝ :=
  (∑ i,realHistoryCost r k (r k i))/(k+1 : ℝ)












end DerivativeChainContinuation
Source
https://github.com/Amal-David/derivative-chain-prize/blob/21d2a2ac5cd4b4e6263cbc715dd5f925427fc976/continuation_formal/Source/RealEndpointCost.lean#L13-L14; https://github.com/Amal-David/derivative-chain-prize/blob/21d2a2ac5cd4b4e6263cbc715dd5f925427fc976/continuation_formal/Source/RealEndpointCost.lean#L8-L11

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