EconCSLib.MechanismDesign.Auction.Knapsack #
Knapsack auctions in the single-parameter setting.
This file specializes Auction.SingleParameterMechanism to a standard
knapsack-auction environment:
- each agent
ireports a scalar value inU - agent
ihas public weightw i - the mechanism chooses an allocation vector
x : I → U - the total weighted allocation must respect the capacity bound
W
Structure hierarchy #
MechanismWithTransfers I (fun _ => U) (I → U) U -- scalar reports and allocations
└─ SingleParameterMechanism I U -- single-parameter transfer layer
└─ KnapsackAuction I U -- public weights + total capacity
└─ welfareMaximizingMechanism hW -- Myerson-payment implementation
Main definitions #
KnapsackAuction— a single-parameter mechanism with public weights and a total capacity boundRespectsCapacity,IsFeasible— feasibility predicates forU-valued allocationsBinaryAllocation,binaryToAllocation,binaryLoad,binaryRespectsCapacity—0/1allocation profiles and their induced loadfeasibleBinaryAllocations,binarySocialWelfare— the finite feasible allocation space and its welfare objectivewelfareMaximizer,maximalSocialWelfare— a chosen welfare-maximizing feasible binary allocation and its objective valuewelfareMaximizingAllocationRule,welfareMaximizingPaymentRule,welfareMaximizingMechanism— the induced single-parameter mechanism with Myerson paymentsdpSolveList,dynamicProgrammingOptimalAllocation,dynamicProgrammingOptimalValue— a dynamic-programming solver for the natural-number0/1knapsack specialization
Main proofs #
- existence of a welfare-maximizing feasible binary allocation
- monotonicity of the welfare-maximizing allocation rule
- DSIC of the welfare-maximizing mechanism via
SingleParameterMechanism.withMyersonPayment_isDSIC_of_isMonotone - correctness of the dynamic-programming solver in the natural-number setting:
dynamicProgrammingOptimalAllocation_feasibleproves the DP output satisfies the capacity constraint, anddynamicProgrammingOptimalAllocation_optimalproves it maximizes social welfare among all feasible binary allocations
A knapsack auction with public weights w i and total capacity W.
The underlying strategic object is a SingleParameterMechanism I U, where the
value type U is a linearly ordered field ([Field U] [LinearOrder U] [IsStrictOrderedRing U]; e.g. ℚ, ℝ): each agent reports a single scalar
value in U, receives an allocation level xᵢ ∈ U, and makes a U-valued
payment. The pointwise allocation bounds are inherited from
SingleParameterMechanism.IsAllocFeasible; the knapsack constraint is recorded
separately below.
- allocationRule : (I → U) → I → U
- paymentRule : (I → U) → I → U
- weight : I → U
Public weight / size of agent
iin the knapsack constraint. - totalCapacity : U
Total knapsack capacity.
Instances For
The allocation rule respects the knapsack capacity constraint.
Equations
- A.RespectsCapacity = ∀ (b : I → U), ∑ i : I, A.weight i * A.allocationRule b i ≤ A.totalCapacity
Instances For
Feasibility for a knapsack auction:
- each agent's allocation lies in
[0,1] - the weighted allocation satisfies the total capacity bound
Equations
- A.IsFeasible = (A.IsAllocFeasible ∧ A.RespectsCapacity)
Instances For
Every public weight is nonnegative.
Equations
- A.NonnegativeWeights = ∀ (i : I), 0 ≤ A.weight i
Instances For
Every public weight is strictly positive.
Equations
- A.PositiveWeights = ∀ (i : I), 0 < A.weight i
Instances For
The knapsack capacity is nonnegative.
Equations
- A.NonnegativeCapacity = (0 ≤ A.totalCapacity)
Instances For
A discrete knapsack allocation profile: each agent is either selected or not.
Equations
- KnapsackAuction.BinaryAllocation I = (I → Bool)
Instances For
The 0/1 allocation vector associated with a binary allocation profile.
Instances For
The weighted load induced by a binary allocation profile.
Equations
- A.binaryLoad x = ∑ i : I, A.weight i * KnapsackAuction.binaryToAllocation x i
Instances For
Capacity feasibility for a binary allocation profile.
Equations
- A.binaryRespectsCapacity x = (A.binaryLoad x ≤ A.totalCapacity)
Instances For
The finite list of binary allocations satisfying the knapsack constraint.
Equations
Instances For
Social welfare of a binary allocation profile at valuation profile b.
Equations
- KnapsackAuction.binarySocialWelfare b x = ∑ i : I, b i * KnapsackAuction.binaryToAllocation x i
Instances For
A welfare-maximizing feasible binary allocation, chosen using List.argMaxOn
on the finite space of feasible 0/1 allocations.
Equations
- A.welfareMaximizer b hW = Classical.choose ⋯
Instances For
The maximal social welfare over the feasible binary allocation space.
Equations
- A.maximalSocialWelfare b hW = KnapsackAuction.binarySocialWelfare b (A.welfareMaximizer b hW)
Instances For
The welfare-maximizing allocation rule for the knapsack auction, obtained by
choosing a feasible binary allocation with maximal social welfare and then
viewing it as an I → ℝ allocation vector.
Equations
Instances For
The Myerson payment formula associated with the welfare-maximizing knapsack allocation rule.
Equations
Instances For
The canonical welfare-maximizing single-parameter knapsack mechanism, with payments given by the Myerson formula.
Equations
- A.welfareMaximizingMechanism hW = { allocationRule := A.welfareMaximizingAllocationRule hW, paymentRule := A.welfareMaximizingPaymentRule hW }
Instances For
Fractional social welfare for a U-valued allocation vector.
Equations
- KnapsackAuction.fractionalSocialWelfare b x = ∑ i : I, b i * x i
Instances For
Feasibility of a fractional knapsack allocation:
pointwise fractions lie in [0,1] and the weighted load respects capacity.
Equations
- A.fractionalFeasible x = ((∀ (i : I), 0 ≤ x i ∧ x i ≤ 1) ∧ ∑ i : I, A.weight i * x i ≤ A.totalCapacity)
Instances For
Value-to-weight ratio used by the fractional greedy rule.
Instances For
Sorting key for the fractional greedy rule:
higher ratio first, ties broken by the ambient linear order on I.
Instances For
Agents sorted by decreasing value-to-weight ratio, with lexicographic
tie-breaking via the ambient order on I.
Equations
- A.sortedAgentsByRatio b = Finset.univ.toList.mergeSort fun (i j : I) => decide (A.ratioTieKey b i ≤ A.ratioTieKey b j)
Instances For
Greedy fractional allocation along a fixed list order. If the next item does not fully fit, the algorithm takes exactly the remaining fraction and halts.
Equations
- One or more equations did not get rendered due to their size.
- A.fractionalGreedyList b [] x✝ = fun (x : I) => 0
Instances For
The greedy fractional knapsack allocation obtained by sorting agents by value-to-weight ratio and then filling capacity in that order.
Equations
- A.fractionalGreedyAllocation b = A.fractionalGreedyList b (A.sortedAgentsByRatio b) A.totalCapacity
Instances For
If the ratio-sorted greedy fractional allocation is optimal for the
fractional relaxation, then its welfare dominates the welfare of the optimal
0/1 knapsack allocation. This is the standard relaxation comparison:
every feasible binary allocation is also a feasible fractional allocation.
Integer-valued welfare of a binary allocation profile.
Instances For
Integer-valued load of a binary allocation profile.
Instances For
An allocation is supported on a list of agents if every selected agent appears in that list.
Equations
- KnapsackAuction.supportedOn items x = ∀ (i : I), x i = true → i ∈ items
Instances For
A computable dynamic-programming solver for finite 0/1 knapsack instances.
The solver processes the agents in the given list order and uses the standard "skip or take" recursion on the remaining capacity. This is the algorithmic counterpart to the abstract welfare-maximizer above, specialized to natural weights, natural capacity, and natural reported values.
Equations
- One or more equations did not get rendered due to their size.
- KnapsackAuction.dpSolveList w b [] x✝ = fun (x : I) => false
Instances For
The computable knapsack allocation obtained by running the dynamic program on the full finite agent list.
Equations
- KnapsackAuction.dynamicProgrammingOptimalAllocation w b capacity = KnapsackAuction.dpSolveList w b Finset.univ.toList capacity
Instances For
The social welfare achieved by the dynamic-programming allocation.
Equations
Instances For
The dynamic-programming allocation always satisfies the knapsack capacity constraint in the natural-number specialization.
The dynamic-programming allocation maximizes integer social welfare among all feasible binary allocations.
The knapsack-auction data obtained from natural-number weights and capacity, with dummy zero allocation/payment rules. This is only used to instantiate the fractional greedy construction.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Natural-number bids viewed as real-valued bids.
Equations
- KnapsackAuction.realBidOfNat b i = ↑(b i)
Instances For
The integral greedy prefix algorithm: process items in a fixed order, take each whole item if it fits, and halt when the first item fails to fit.
Equations
- KnapsackAuction.integralGreedyList w [] x✝ = fun (x : I) => false
- KnapsackAuction.integralGreedyList w (i :: is) x✝ = if w i ≤ x✝ then Function.update (KnapsackAuction.integralGreedyList w is (x✝ - w i)) i true else fun (x : I) => false
Instances For
The ratio-sorted integral greedy allocation.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Welfare of the ratio-sorted integral greedy allocation.
Equations
- KnapsackAuction.integralGreedyValue w b capacity = KnapsackAuction.natBinarySocialWelfare b (KnapsackAuction.integralGreedyAllocation w b capacity)
Instances For
Highest single-item value.
Equations
Instances For
Fractional greedy prefix algorithm on a natural-number remaining capacity: take each whole item if it fits, and otherwise take exactly the remaining fraction of the current item and halt.
Equations
- One or more equations did not get rendered due to their size.
- KnapsackAuction.natFractionalGreedyList w [] x✝ = fun (x : I) => 0
Instances For
The ratio-sorted fractional greedy allocation on natural-number data.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Welfare of the ratio-sorted fractional greedy allocation.
Equations
Instances For
A real-valued allocation is supported on a list if every nonzero coordinate appears in that list.
Equations
- KnapsackAuction.fractionalSupportedOn items x = ∀ (i : I), x i ≠ 0 → i ∈ items
Instances For
The ratio-sorted integral greedy algorithm, compared with the highest
single-value item, achieves a 1/2-approximation to the DP-optimal 0/1
knapsack welfare, provided the fractional greedy allocation is optimal for the
fractional relaxation and every item fits individually in the knapsack.