Integer Factorization: Why Two-Item Joint Replenishment Is Hard 3: M Has a Divisor in [L, U] iff an Explicit Two-Item Periodic JRP Instance Has a Plan of Cost at Most L + U + 2M²(M + 1)Research Paper
Why the two-item periodic JRP is hard
The joint replenishment problem (JRP) is the multi-item extension of the economic order quantity (EOQ) model. Each item is reordered periodically and pays its own ordering and holding costs, and a joint ordering cost is shared by items ordered at the same time. Before this work no hardness result was known for the periodic JRP (p. 10), even though no exact polynomial-time algorithm was known either (Schulz and Telha, arXiv:2007.09045; Operations Research, 2024, as Integer Factorization: Why Two-Item Joint Replenishment Is Hard).
The paper explains this through number theory. In the periodic JRP the joint cost is incurred every periods, so the objective contains a greatest common divisor of the decision variables. The paper's Theorem 2 states that, assuming the Riemann hypothesis, the two-item periodic JRP is NP-hard under randomized reductions. The proof composes two reductions:
- Shor's reduction from Partition to RangeDivisor ("does have a divisor in ?"), given in the paper's appendix and based on Shor (2011); this is where the Riemann hypothesis enters;
- a reduction from RangeDivisor to the two-item periodic JRP, whose correctness is Lemma 3 (pp. 13–14).
This mission formalizes Lemma 3. Mission 4 of this series formalizes the Partition half; missions 1 and 2 formalize the integer-factorization reductions behind Theorem 1.
Setting
A period is a positive integer . An item with ordering cost and holding cost costs
per unit time. The two-item periodic JRP (objective (3), p. 10) minimizes, over ,
As a decision problem (p. 13), it asks whether some has cost at most a threshold .
An instance of RangeDivisor (p. 12) is a triple of integers satisfying
it is a yes-instance when has a divisor with .
Given such a triple, the instance sets
and the threshold is , where . Once item 2 is fixed at , item 1 solves problem (5):
In Lean these objects are JRPHard.Aperiodic.eoq, JRPHard.Periodic.periodicCost, JRPHard.Periodic.coefK2, JRPHard.Periodic.coefH2 (shared with missions 1 and 2), and IsRangeDivisorInstance, HasDivisorIn, coefK0, rangeCost, threshold, obj5 and fConv in the namespace JRPHard.RangeDiv.
Formalization targets
Goal: Lemma 3
For every RangeDivisor instance ,
Milestones (the steps of the proof, pp. 14–15)
- Item 2 is pinned: every plan with costs more than .
- is a lower bound on problem (5)'s objective, , and is minimized at .
- .
- If , the objective of (5) at is at least .
- A divisor of has objective at most .
- A period with objective at most divides and lies in .
Significance
Lemma 3 is the step that carries hardness from number theory to inventory theory. With Shor's result it shows that, under the Riemann hypothesis, no polynomial-time exact algorithm for the two-item periodic JRP exists unless NP problems can be solved in randomized polynomial time. The paper concludes (p. 15) that no algorithm for the two-item problem may be simultaneously exact and polynomial on all inputs, so some concession, such as heuristics, must be made.
The result is proved in the paper; it has not been machine-checked. The mission produces a checked statement of the reduction's correctness with every coefficient explicit, and it corrects two imprecisions in the printed lemma (the threshold and the unspecified "sufficiently large" coefficients of item 2; see below). The objects (eoq, periodicCost) are the same ones used in mission 2 of this series.
Difficulty
Each step is elementary, but the statement mixes integer and real reasoning. The objective of (5) is not monotone or convex in : its value jumps between at divisors of and at least elsewhere. The argument must show that the gap between these two curves exceeds the window around , and this is exactly what RangeDivisor's condition provides. Without that condition a non-divisor can be cheaper than (for , , , the period has objective ). The pinning of also has to beat the slack against , which is where is used.
Formalization scope
This mission formalizes the correctness of the reduction behind Theorem 2 (its JRP half, Lemma 3); polynomial running time is not formalized. Theorem 2 itself, Shor's NP-completeness of RangeDivisor under randomized reductions, and "one can construct in polynomial time" are not stated. What remains of the polynomial-time claim is the explicit coefficients and the bound (bit length at most ).
Conventions:
- periods are natural numbers, and every quantified period is assumed positive (Lean's and would otherwise create spurious cheap plans);
- costs are real numbers; , , and the coefficients are natural numbers cast to ;
- RangeDivisor's condition is stated with
Real.sqrtexactly as printed; - "the optimal value is at most " is the decision form "some plan has cost at most " (p. 13); the minimum is attained, so the two agree.
Two disclosed departures from the printed lemma:
- The threshold. The page writes "the optimal value of ". The two-item cost also contains item 2's term , so the literal comparison never holds and would make the lemma false. The threshold is , the announced in §3.1.
- The item-2 coefficients. The page chooses "sufficiently large values of and , as in … Lemma 2". The statement fixes Lemma 2's values , rather than quantifying existentially, which would let any instance satisfy the lemma.
A formalization that drops the positivity of periods, states the threshold as on the full two-item cost, or leaves existential does not capture Lemma 3 and is ruled out.
No library beyond Mathlib (Nat.gcd, Real.sqrt) is needed. Proofs of the milestones, and alternative proofs of the goal, are welcome.
Selected references
- A. S. Schulz and C. Telha, Integer factorization and Riemann's hypothesis: Why two-item joint replenishment is hard, arXiv:2007.09045v1, 2020; published as Integer Factorization: Why Two-Item Joint Replenishment Is Hard, Operations Research, 2024. https://arxiv.org/abs/2007.09045
- P. W. Shor, An NP-complete variant of factoring, Theoretical Computer Science Stack Exchange, 2011 (version 2011-03-01, as cited by the paper). https://cstheory.stackexchange.com/q/4785
- S. Arora and B. Barak, Computational Complexity: A Modern Approach, Cambridge University Press, 2009. https://doi.org/10.1017/CBO9780511804090