Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Eq. (25), pp. 38–39 — no-storage optimum Q*_F(K=0) and the marginal value of storage there

Proved
OffGridStorage.TechChoice.eq_25_marginal_storage

by mikedeng1 · Oct 20, 2026 · Mathlib 0df444a (Lean v4.33.1)

energy-storagefirst-order-conditionp2o-batch-pfp2ap2o-gran-per-chapterp2o-plan-paperp2o-v1threshold

Under the standing assumptions, let Q0=DHg/(2cQ)=(g/cQ)DH2/2Q_0=D_H\sqrt{g/(2c_Q)}=\sqrt{(g/c_Q)D_H^2/2}Q0​=DH​g/(2cQ​)​=(g/cQ​)DH2​/2​. Then:

  1. Q0Q_0Q0​ maximizes the no-storage full-discharge profit: ΠF(Q,0)≤ΠF(Q0,0)\Pi_F(Q,0)\le \Pi_F(Q_0,0)ΠF​(Q,0)≤ΠF​(Q0​,0) for every Q≥0Q\ge 0Q≥0.
  2. For every Q>0Q>0Q>0 and every KKK, the closed form (20) (times TTT) has partial derivative in KKK
∂∂K=T(gQ[−DH−Ke]+g−cKe).\frac{\partial}{\partial K}=T\Bigl(\frac{g}{Q}\Bigl[-D_H-\frac{K}{e}\Bigr]+g-\frac{c_K}{e}\Bigr).∂K∂​=T(Qg​[−DH​−eK​]+g−ecK​​).
  1. At (Q0,0)(Q_0,0)(Q0​,0) this derivative equals
T(−2cQg+g−cKe).T\Bigl(-\sqrt{2c_Qg}+g-\frac{c_K}{e}\Bigr).T(−2cQ​g​+g−ecK​​).

The sign of the last expression decides whether adding a first unit of storage to the best no-storage plan pays; setting it to zero yields the threshold g0g_0g0​.

Formalization Note The paper's derivatives are per period; here the closed form carries the factor TTT, so each derivative carries it too. The derivative in item 2 is a two-sided derivative of the closed-form expression, which is a polynomial in KKK for fixed Q>0Q>0Q>0.

Preamble
import Mathlib
import Definitions.Def_OffGridStorage_TechChoice_Model
Formal statement
namespace OffGridStorage.TechChoice

/-- Eq. (25), pp. 38–39: (i) `Q0 = D_H √(g/(2c_Q))` maximizes the no-storage full-discharge
profit over `Q ≥ 0`; (ii) the partial derivative of the closed form in `K` is
`T((g/Q)(-D_H - K/e) + g - c_K/e)`; (iii) at `(Q0, 0)` it equals `T(-√(2 c_Q g) + g - c_K/e)`. -/
theorem eq_25_marginal_storage (p : Params) (hp : Standing p) :
    (0 ≤ Q0 p ∧ ∀ Q : ℝ, 0 ≤ Q → profitF p Q 0 ≤ profitF p (Q0 p) 0) ∧
    (∀ Q K : ℝ, 0 < Q →
      HasDerivAt (fun K' => closedFormF p Q K')
        ((p.T : ℝ) * (p.g / Q * (-p.DH - K / p.e) + p.g - p.cK / p.e)) K) ∧
    HasDerivAt (fun K' => closedFormF p (Q0 p) K')
      ((p.T : ℝ) * (-Real.sqrt (2 * p.cQ * p.g) + p.g - p.cK / p.e)) 0 := by sorry

end OffGridStorage.TechChoice
Source
Kaps, Marinesi & Netessine, When Should the Off-grid Sun Shine at Night?, SSRN 3761397 (version of May 11, 2023), pp. 38–39, Appendix A.4.1, eq. (25)
Human review
  • Endorsed by Shuze Chen · Oct 20, 2026

    Confirmed by the moderator at approval.

  • Endorsed by mikedeng1 · Oct 20, 2026

    Confirmed by the mission captain (proposal self-audit).

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