Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

§2.2, p. 10 and eq. (3), p. 13 — the scheme read off a DP path is a testing scheme whose rounded expected cost is the path cost

Proved
BatchTesting.PTAS.pathCost_eq_expectedCost

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

dynamic-programmingp2o-batch-pfp2ap2o-gran-per-chapterp2o-plan-paperp2o-v1sequential-testing

Let (p,c,β)(p,c,\beta)(p,c,β) be an instance with n≥1n\ge1n≥1, pi∈[0,1]p_i\in[0,1]pi​∈[0,1], ci>0c_i>0ci​>0, β≥0\beta\ge0β≥0, let 0<ϵ≤10<\epsilon\le10<ϵ≤1, and let G⊆FG\subseteq FG⊆F be any set of states. Let 0=N(0)→⋯→N(T)=N(all)0=N^{(0)}\to\cdots\to N^{(T)}=N^{(\mathrm{all})}0=N(0)→⋯→N(T)=N(all) be a GGG-path, and let SSS be its testing scheme, whose ttt-th batch is ⨄rCr[Nr(t−1)+1,Nr(t)]\biguplus_r C_r[N^{(t-1)}_r+1,N^{(t)}_r]⨄r​Cr​[Nr(t−1)​+1,Nr(t)​]. Then SSS is a testing scheme of [n][n][n], and its expected cost under the rounded costs c^\hat cc^ is

Ec^(S) = cmin⁡⋅∑t=1TP0(N(t−1))⋅C(N(t)−N(t−1)).E_{\hat c}(S)\ =\ c_{\min}\cdot\sum_{t=1}^{T}P_0(N^{(t-1)})\cdot C(N^{(t)}-N^{(t-1)}).Ec^​(S) = cmin​⋅t=1∑T​P0​(N(t−1))⋅C(N(t)−N(t−1)).

This is the path form (3) of the recursion (1)–(2): the value of the dynamic program on any restricted state space is the expected cost of an actual testing scheme, which is how the algorithm turns its optimal path into its output.

Formalization Note. The factor cmin⁡c_{\min}cmin​ converts the normalized units of C(Δ)C(\Delta)C(Δ) (p. 8) back to the original units.

Preamble
import Mathlib
import Definitions.Def_BatchTesting_PTAS_Model
Formal statement
namespace BatchTesting.PTAS

theorem pathCost_eq_expectedCost {n : ℕ} (I : Instance n) (hI : I.Standing) (eps : ℝ) (h0 : 0 < eps) (h1 : eps ≤ 1)
    (G : Finset (State I eps)) (hG : G ⊆ F I eps) (π : List (State I eps)) (hπ : IsPath I eps G π) :
    IsTestingScheme (schemeOf I eps π) ∧
      expectedCostWith I (roundedCost I eps) (schemeOf I eps π) = cmin I * pathCost I eps π := by sorry

end BatchTesting.PTAS
Source
Segev & Shaposhnik, A Polynomial-Time Approximation Scheme for Sequential Batch Testing of Series Systems, SSRN preprint 3277805 (Nov. 2018), p. 10, §2.2, eq. (1); p. 11, eq. (2); p. 13, eq. (3)
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