AFTD Auto-Formalizing Theoretical Domains

knapsack5_deterministic_menu_exists_attaining

theoremverifiedformalization

There exists a deterministic menu M : deterministic_menu (Fin 5) such that for all η : ℝ with 0 < η and η < 1, there exists an agent best response choice for which knapsack5_expected_payoff choice = 10.

Statement

theorem knapsack5_deterministic_menu_exists_attaining :
    ∃ (M : deterministic_menu (Fin 5)), ∀ (η : ℝ), 0 < η → η < 1 →
      ∃ (choice : Bool × Bool × Bool → Option (Finset (Fin 5))),
        (∀ ω : Bool × Bool × Bool,
          is_menu_best_response
            (accepted_reports {S | knapsack5_feasible S} M (knapsack5_principal_val ω))
            (knapsack5_agent_val η)
            (choice ω)) ∧
        knapsack5_expected_payoff choice = 10
Formalizes
arXiv:2611.33095 Proposition 3.1
Verified
29 Nov 2026
Axioms
Classical.choiceQuot.soundpropext
Built on 9
  • knapsack5_feasibleA subset of items in Fin 5 is feasible in the knapsack instance if the sum of its item weights does not exceed the knapsack capacity of 3.
  • knapsack5_agent_valAgent valuations in the five-item knapsack instance with parameter eta: item 0 (A) has value 3, item 1 (B) has value 2, item 2 (E) has…
  • knapsack5_principal_valThe function knapsack5_principal_val : Bool × Bool × Bool → Fin 5 → ℝ maps an uncurried state tuple (a, b, j) and an item i : Fin 5 to the…
  • knapsack5_expected_payoffThe expected principal payoff knapsack5_expected_payoff from an agent choice function choice : Bool × Bool × Bool → Option (Finset (Fin…
  • deterministic_menuA deterministic menu on a type E is a set of dependent pairs ⟨S, x_S⟩ where S : Finset E is a finite subset of items and x_S : S → ℝ is…
  • accepted_reportsGiven a family of finite sets F : Set (Finset E), a deterministic menu M : deterministic_menu E, and principal values x : E → ℝ, the…
  • is_menu_best_responseGiven a set of finite sets A : Set (Finset E), an agent valuation y : E → ℝ, and an action a : Option (Finset E), is_menu_best_response A…
  • knapsack5_probThe rational probability mass function knapsack5_prob : Bool × Bool × Bool → ℚ assigns to each state (a, b, j) the product of (if a then 1…
  • menu_principal_payoffGiven an item valuation x : E → ℝ, the principal's payoff from an agent action a : Option (Finset E) is ∑ i ∈ S, x i if a = some S and 0…

Read back from the Lean

There exists a deterministic menu M on the item set Fin 5 such that for every real number η with 0 < η < 1, there exists a choice function choice : Bool × Bool × Bool → Option (Finset (Fin 5)) such that: 1. For every state ω : Bool × Bool × Bool, choice ω is an agent best response (is_menu_best_response) among the reports accepted by M given the principal's valuation in state ω (knapsack5_principal_val ω), evaluated under the agent's valuation knapsack5_agent_val η. 2. The expected principal payoff of choice (knapsack5_expected_payoff choice) is equal to 10.

Written by a model that saw only the Lean, never the English above. If the two disagree, that is worth a challenge.

The proof, explained

The proof constructs a deterministic menu consisting solely of the singleton item 3, which has feasible knapsack weight 3. Item 3 provides the principal with a constant valuation of 10 across all states and gives the agent a strictly positive valuation of 8. Since the menu offers no alternative items, selecting item 3 is the agent's unique optimal choice in every state, ensuring that the principal achieves an expected payoff of 10.

  1. We define the candidate deterministic menu M offering only the singleton bundle {3}, and show that the principal's valuation of item 3 is 10 in all states.

    We define M as the menu of contracts whose bundle is {3}. By exhausting all eight combinations of the Boolean state variables (a, b, j), simplifying the definition of `knapsack5_principal_val` confirms that the principal always values item 3 at 10.

    lines 11–14

      let M : deterministic_menu (Fin 5) := {p | p.1 = ({3} : Finset (Fin 5))}
      have hval3 : ∀ ω : Bool × Bool × Bool, knapsack5_principal_val ω (3 : Fin 5) = 10 := by
        rintro ⟨a, b, j⟩
        cases a <;> cases b <;> cases j <;> simp [knapsack5_principal_val]
  2. It suffices to show that for any η ∈ (0, 1), the constant choice of {3} is an agent best response and yields expected payoff 10.

    We provide the menu M as the existential witness. For an arbitrary η ∈ (0, 1), we propose the constant strategy that selects {3} in every state, leaving two obligations: best-response optimality for the agent and expected payoff 10 for the principal.

    lines 15–17

      refine ⟨M, ?_⟩
      intro η hη0 hη1
      refine ⟨fun _ => some {3}, ?_, ?_⟩
  3. The best-response condition for choice {3} in state ω reduces to feasibility/acceptance, optimality among accepted reports, and individual rationality.

    Unfolding the definition of `is_menu_best_response` for the choice `some {3}` yields three requirements: (1) {3} is an accepted report, (2) any accepted report gives the agent at most as much utility as {3}, and (3) the agent's utility from {3} is non-negative.

    lines 18–24

      · intro ω
        unfold is_menu_best_response
        change ({3} : Finset (Fin 5)) ∈ accepted_reports {S | knapsack5_feasible S} M (knapsack5_principal_val ω) ∧
          (∀ S ∈ accepted_reports {S | knapsack5_feasible S} M (knapsack5_principal_val ω),
            (∑ i ∈ S, knapsack5_agent_val η i) ≤ ∑ i ∈ ({3}:Finset (Fin 5)), knapsack5_agent_val η i) ∧
          (0 ≤ ∑ i ∈ ({3}:Finset (Fin 5)), knapsack5_agent_val η i)
        refine ⟨?_, ?_, ?_⟩
  4. The bundle {3} is an accepted report for the principal in state ω.

    Unfolding `accepted_reports`, item 3 has weight 3, which satisfies the knapsack capacity (≤ 3), the set {3} is nonempty, and by definition of M it belongs to the menu.

    lines 25–26

        · unfold accepted_reports
          simp [M, knapsack5_feasible, knapsack5_weight]
  5. The bundle {3} yields maximal utility to the agent among all accepted reports.

    For any accepted report S, membership in the menu M requires S = {3}. Because S is forced to be {3}, the optimality inequality holds trivially as an equality.

    lines 27–31

    uses Set.mem_setOf_eq

        · intro S hS
          unfold accepted_reports at hS
          simp only [Set.mem_setOf_eq] at hS
          have hSeq : S = {3} := by simpa [M] using hS.2.2
          rw [hSeq]
  6. The bundle {3} satisfies individual rationality for the agent.

    The agent's valuation sum over the singleton {3} simplifies by `Finset.sum_singleton` to `knapsack5_agent_val η 3`, which equals 8. Since 8 ≥ 0, individual rationality holds.

    lines 32–33

    uses Finset.sum_singleton

        · rw [Finset.sum_singleton]
          norm_num [knapsack5_agent_val]
  7. In every state ω, the principal's payoff from the bundle {3} is 10.

    Unfolding the payoff definitions, the principal's payoff from {3} in state ω is the sum of the principal's valuations over {3}. By `Finset.sum_singleton` and the lemma `hval3` proved earlier, this sum equals 10 in every state.

    lines 34–40

    uses Finset.sum_singleton

      · unfold knapsack5_expected_payoff
        simp only [menu_principal_payoff]
        have hpay : ∀ ω : Bool × Bool × Bool,
            (∑ i ∈ ({3} : Finset (Fin 5)), knapsack5_principal_val ω i) = 10 := by
          intro ω
          rw [Finset.sum_singleton]
          exact hval3 ω
  8. The principal's expected payoff across all states is 10.

    The universe of eight states is explicitly enumerated by exhaustive decision (`decide`). Substituting the constant payoff of 10 and the state probabilities, the rational arithmetic sum simplifies to 10.

    lines 41–47

        have huniv : (Finset.univ : Finset (Bool × Bool × Bool)) =
            {(true,(true,true)),(true,(true,false)),(true,(false,true)),(true,(false,false)),
             (false,(true,true)),(false,(true,false)),(false,(false,true)),(false,(false,false))} := by
          decide
        rw [huniv]
        simp [hpay, knapsack5_prob]
        norm_num
Set.mem_setOf_eq
An element x belongs to the set comprehension {y | p y} if and only if p x holds.
Finset.sum_singleton
The sum of a function over a singleton set {a} is equal to the value of the function at a.

Written by a model (gemini-3.8-flash) from the Lean proof and the goal states Lean reported at each step. Lean verified the proof; this explanation is a reading aid and is not itself machine-checked.

Lean source view module on GitHub

/-- Payoff 10 is attainable by a deterministic menu. -/theorem knapsack5_deterministic_menu_exists_attaining :    ∃ (M : deterministic_menu (Fin 5)), ∀ (η : ℝ), 0 < η → η < 1 →      ∃ (choice : Bool × Bool × Bool → Option (Finset (Fin 5))),        (∀ ω : Bool × Bool × Bool,          is_menu_best_response            (accepted_reports {S | knapsack5_feasible S} M (knapsack5_principal_val ω))            (knapsack5_agent_val η)            (choice ω)) ∧        knapsack5_expected_payoff choice = 10 := by  let M : deterministic_menu (Fin 5) := {p | p.1 = ({3} : Finset (Fin 5))}  have hval3 : ∀ ω : Bool × Bool × Bool, knapsack5_principal_val ω (3 : Fin 5) = 10 := by    rintro ⟨a, b, j⟩    cases a <;> cases b <;> cases j <;> simp [knapsack5_principal_val]  refine ⟨M, ?_⟩  intro η hη0 hη1  refine ⟨fun _ => some {3}, ?_, ?_⟩  · intro ω    unfold is_menu_best_response    change ({3} : Finset (Fin 5)) ∈ accepted_reports {S | knapsack5_feasible S} M (knapsack5_principal_val ω) ∧      (∀ S ∈ accepted_reports {S | knapsack5_feasible S} M (knapsack5_principal_val ω),        (∑ i ∈ S, knapsack5_agent_val η i) ≤ ∑ i ∈ ({3}:Finset (Fin 5)), knapsack5_agent_val η i) ∧      (0 ≤ ∑ i ∈ ({3}:Finset (Fin 5)), knapsack5_agent_val η i)    refine ⟨?_, ?_, ?_⟩    · unfold accepted_reports      simp [M, knapsack5_feasible, knapsack5_weight]    · intro S hS      unfold accepted_reports at hS      simp only [Set.mem_setOf_eq] at hS      have hSeq : S = {3} := by simpa [M] using hS.2.2      rw [hSeq]    · rw [Finset.sum_singleton]      norm_num [knapsack5_agent_val]  · unfold knapsack5_expected_payoff    simp only [menu_principal_payoff]    have hpay : ∀ ω : Bool × Bool × Bool,        (∑ i ∈ ({3} : Finset (Fin 5)), knapsack5_principal_val ω i) = 10 := by      intro ω      rw [Finset.sum_singleton]      exact hval3 ω    have huniv : (Finset.univ : Finset (Bool × Bool × Bool)) =        {(true,(true,true)),(true,(true,false)),(true,(false,true)),(true,(false,false)),         (false,(true,true)),(false,(true,false)),(false,(false,true)),(false,(false,false))} := by      decide    rw [huniv]    simp [hpay, knapsack5_prob]    norm_num
See it in the graphDiscuss this resultChallenge it