Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Chapter II, Theorem 4 — the index rule Di(x)=(∑kpikcik)xi/(1−∑kpik)D_i(x)=(\sum_k p_{ik}c_{ik})x_i/(1-\sum_k p_{ik})Di​(x)=(∑k​pik​cik​)xi​/(1−∑k​pik​) for nnn mines

Proved
BellmanDP.GoldMining.index_rule_n_mines

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

dynamic-programmingfunctional-equationsgold-miningindex-policyp2o-batch-b23bp2o-gran-per-chapterp2o-plan-bookp2o-v1

Consider n≥1n \ge 1n≥1 mines holding amounts x=(x1,…,xn)x = (x_1, \dots, x_n)x=(x1​,…,xn​), xi≥0x_i \ge 0xi​≥0, and KKK possible outcomes for each use of the machine. Using mine iii produces outcome kkk with probability pikp_{ik}pik​, yields the gold cikxic_{ik}x_icik​xi​ and leaves cik′xic'_{ik}x_icik′​xi​ in mine iii; with the remaining probability 1−∑kpik1 - \sum_k p_{ik}1−∑k​pik​ the machine is destroyed. Assume

(a)  pik≥0,  ∑k=1Kpik<1 (i=1,…,n);(b)  1≥cik≥0,  cik+cik′=1.\text{(a)}\ \ p_{ik} \ge 0,\ \ \sum_{k=1}^{K} p_{ik} < 1 \ (i = 1,\dots,n);\qquad \text{(b)}\ \ 1 \ge c_{ik} \ge 0,\ \ c_{ik} + c'_{ik} = 1.(a)  pik​≥0,  k=1∑K​pik​<1 (i=1,…,n);(b)  1≥cik​≥0,  cik​+cik′​=1.

Then the functional equation

f(x1,…,xn)=max⁡i ∑k=1Kpik[cikxi+f(x1,…,cik′xi,…,xn)](4)f(x_1,\dots,x_n) = \max_{i}\ \sum_{k=1}^{K} p_{ik}\bigl[c_{ik}x_i + f(x_1,\dots,c'_{ik}x_i,\dots,x_n)\bigr] \tag{4}f(x1​,…,xn​)=imax​ k=1∑K​pik​[cik​xi​+f(x1​,…,cik′​xi​,…,xn​)](4)

has a solution fff bounded on every box 0≤xi≤Xˉi0 \le x_i \le \bar X_i0≤xi​≤Xˉi​, any two such solutions coincide on the orthant, and the solution obeys the index rule: with the decision functions

Di(x)=∑k=1Kpikcik1−∑k=1Kpik xi,D_i(x) = \frac{\sum_{k=1}^{K} p_{ik}c_{ik}}{1-\sum_{k=1}^{K} p_{ik}}\,x_i,Di​(x)=1−∑k=1K​pik​∑k=1K​pik​cik​​xi​,

at every state xxx in the orthant, every index iii that maximizes Di(x)D_i(x)Di​(x) over i=1,…,ni = 1, \dots, ni=1,…,n attains the maximum in (4). In case of equality among the DiD_iDi​, it is a matter of indifference which maximizing index is used.

This is the most general index rule of the chapter; Theorem 2 (n=2n = 2n=2, one outcome) and Theorem 3 (n=2n = 2n=2) are special cases.

Formalization Note Mines are indexed by Fin n and outcomes by Fin K. The hypothesis n≥1n \ge 1n≥1 is added: with no mine the maximum in (4) is over an empty set. "The solution" is the unique solution in the class of functions bounded on every box (the nnn-mine form of Theorem 1's class, per the book's footnote 7), and its existence and uniqueness in that class are part of the statement. The conclusion is the book's: a maximizer of DDD is an optimal choice; the statement does not assert that non-maximizers are suboptimal.

Preamble
import Mathlib
import Definitions.Def_BellmanDP_GoldMining_MultiOutcome
Formal statement
namespace BellmanDP.GoldMining

/-- Bellman, *Dynamic Programming*, Ch. II, Theorem 4, p. 70: `n ≥ 1` mines, `K` outcomes per use.
Under (5): `p_ik ≥ 0`, `Σ_k p_ik < 1` for each `i`, `0 ≤ c_ik ≤ 1`, `c_ik + c'_ik = 1`, the
equation (4) has a solution bounded on every box `0 ≤ x_i ≤ X̄_i`, unique there on the orthant,
and at every state `x ≥ 0` any index `i` maximizing the decision function
`D_i(x) = (Σ_k p_ik c_ik) x_i / (1 − Σ_k p_ik)` attains the maximum in (4) (in case of equality
among maximizers, any of them may be used). -/
theorem index_rule_n_mines (n K : ℕ) (hn : 0 < n) (p c c' : Fin n → Fin K → ℝ)
    (hp : ∀ i k, 0 ≤ p i k) (hps : ∀ i, ∑ k, p i k < 1)
    (hc0 : ∀ i k, 0 ≤ c i k) (hc1 : ∀ i k, c i k ≤ 1) (hc' : ∀ i k, c i k + c' i k = 1) :
    ∃ f : (Fin n → ℝ) → ℝ, IsNMineSolution p c c' f ∧ BoundedOnBoxes f ∧
      (∀ g : (Fin n → ℝ) → ℝ, IsNMineSolution p c c' g → BoundedOnBoxes g →
        ∀ x : Fin n → ℝ, (∀ i, 0 ≤ x i) → g x = f x) ∧
      ∀ x : Fin n → ℝ, (∀ i, 0 ≤ x i) → ∀ i : Fin n,
        (∀ j : Fin n, decisionFunction p c x j ≤ decisionFunction p c x i) →
          f x = mineOption p c c' f x i := by sorry

end BellmanDP.GoldMining
Source
Bellman, Dynamic Programming, Princeton University Press (1957; Princeton Landmarks ed. 2010), DOI 10.2307/j.ctv1nxcw0f, Chapter II, § 10, Theorem 4, p. 70
Human review
  • Endorsed by Shuze Chen · Oct 5, 2026

    Confirmed by the moderator at approval.

  • Endorsed by mikedeng1 · Oct 5, 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