Proof of Proposition 2(ii), p. 24 — dS/dσ(0,1) = −κf(1)((1−c)/c)(β∫_c^1(1−µ)f + ∫_0^c µf) + κµ̄ (printed middle term corrected)
ProvedScarceTesting.PerfectTest.dS_dsigmaLet , , , let be a prior density on , continuous on at , and let be the planner's objective. The left derivative of at (the perfect test) is
The middle term is the loss in detected infections from the lower true positive rate; the other two are the gain from high-prior agents leaving the queue. Part (ii) of Proposition 2 is the condition that this derivative is negative.
Formalization Note The page prints the middle term as . Differentiating in produces from the first integral and from the second, so the middle term is ; the condition on that the page derives next (with in its numerator) is the one this corrected derivative gives. The derivative is one-sided (within ): true positive rates are at most .
import Mathlib import Definitions.Def_ScarceTesting_PerfectTest_Setting
namespace ScarceTesting.PerfectTest
/-- Proof of Proposition 2(ii), p. 24, corrected: the left derivative of `σ ↦ S(0,σ)` at `σ = 1` is
`−κ f(1) ((1−c)/c) β ∫_c^1 (1−μ) f + κ ∫_0^1 μ f − κ f(1) ((1−c)/c) ∫_0^c μ f`.
The printed display has `κ ∫_0^c μ f` as its middle term; differentiating the factor `−μ(1−σ)` of the
integral over `[c, t_H]` contributes `κ ∫_c^1 μ f` as well, so the middle term is `κ ∫_0^1 μ f = κ μ̄`,
which is the term the printed condition on `f(1)` uses. -/
theorem dS_dsigma (f : ℝ → ℝ) (c β κ : ℝ) (hc0 : 0 < c) (hc1 : c < 1)
(hβ0 : 0 ≤ β) (hβ1 : β < 1) (hκ0 : 0 < κ) (hκ1 : κ < 1)
(hf : IsPriorDensity f) (hf1 : ContinuousWithinAt f (Set.Icc 0 1) 1) :
HasDerivWithinAt (fun σ => S f c β κ 0 σ)
(-κ * f 1 * ((1 - c) / c) * β * (∫ μ in c..1, (1 - μ) * f μ) +
κ * (∫ μ in (0:ℝ)..1, μ * f μ) -
κ * f 1 * ((1 - c) / c) * (∫ μ in (0:ℝ)..c, μ * f μ))
(Set.Iic 1) 1 := by sorry
end ScarceTesting.PerfectTest
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.