AFTD Auto-Formalizing Theoretical Domains

block_snake_two_agent_spe_nel_ef1_three_items

theoremverified

For two agents with positive additive values that are distinct across three items for each agent, every subgame-perfect continuation profile of the two-agent block-snake picking game has a root allocation satisfying both NEL and EF1 in pairwise dominance for the item rankings induced by those values.

Statement

theorem block_snake_two_agent_spe_nel_ef1_three_items (u : Fin 2 → Fin 3 → ℝ)
    (hu : ∀ i x, 0 < u i x)
    (hd : ∀ i x y, x ≠ y → u i x ≠ u i y)
    (F : List (Fin 3) → Finset (Fin 3))
    (hF : pick_game_is_spe u (block_snake_seq_two 1) F) :
    is_nel_pd (fun i x y => u i x ≤ u i y) (pick_game_root_allocation F) ∧
    is_ef1_pd (fun i x y => u i x ≤ u i y) (pick_game_root_allocation F)
Source
Three-item special case of OP-1323; arXiv:2611.09685, Section 7.
Verified
10 Nov 2026
Axioms
Classical.choiceQuot.soundpropext
Built on 7
  • pick_game_is_speAn outcome-continuation function is subgame-perfect for a fixed finite two-agent picking order if, after every duplicate-free history, its…
  • pick_game_root_allocationThe root allocation from the continuation assigns its root bundle to agent 0 and all remaining objects to agent 1.
  • block_snake_seq_twoThe block-snake picking sequence for two agents (Fin 2) dividing 2k + 1 items, represented as a List (Fin 2) of length 2k + 1 constructed…
  • is_nel_pdAn allocation A : Agent → Finset Object satisfies NEL under pairwise dominance with respect to item preferences le : Agent → Object →…
  • is_ef1_pdAn allocation A : Agent → Finset Object satisfies EF1 under pairwise dominance with respect to item preferences le : Agent → Object →…
  • pick_game_move_zeroFor a history and a legal next choice, the resulting agent-0 continuation bundle consists of the selected object together with the…
  • pick_game_move_payoffThe mover’s additive payoff from the current remaining objects if the specified item is chosen, followed by the given continuations: agent…

The proof, explained

Under the block-snake sequence for two agents and three items, the order of pickers is Agent 0, Agent 1, Agent 1. By backward induction, Agent 1 claims the last two items in steps 1 and 2, so Agent 0 receives no items after the first round. Consequently, Agent 0 simply chooses their most preferred item x at step 0, resulting in the allocation where Agent 0 gets {x} and Agent 1 gets the remaining two items. Because Agent 0's bundle consists of their top-ranked item, removing any item from Agent 1's bundle leaves a single item that Agent 0 likes no more than x, establishing both NEL and EF1 in pairwise dominance.

  1. The subgame-perfect equilibrium specification is unpacked, and the picking order is determined to be agent 0, then agent 1, then agent 1.

    From the assumption that F is a subgame-perfect continuation profile, we extract the picking sequence length (3) and the per-history optimality specification. Evaluating the block-snake sequence for two agents and parameter 1 at indices 0, 1, and 2 by computation (`decide`) shows that agent 0 picks at step 0, agent 1 picks at step 1, and agent 1 picks at step 2.

    lines 8–11

      obtain ⟨hlen, hspec⟩ := hF
      have hs0 : (block_snake_seq_two 1).getD 0 0 = 0 := by decide
      have hs1 : (block_snake_seq_two 1).getD 1 0 = 1 := by decide
      have hs2 : (block_snake_seq_two 1).getD 2 0 = 1 := by decide
  2. At any history of length 2 where two distinct items have been picked, agent 0 receives no additional items: F [a, b] = ∅.

    Let a and b be two distinct items picked so far. Since there are 3 items in total, exactly one item c remains, so the remaining set is nonempty. At step 2, the picker is agent 1. By the equilibrium condition, agent 1 picks c, so agent 0 receives no items from this step, giving F [a, b] = F [a, b, c]. At history [a, b, c], all 3 items have been exhausted, so the remaining set is empty by cardinality (3 items in Fin 3), which implies F [a, b, c] = ∅ and thus F [a, b] = ∅.

    lines 12–46

    uses Finset.card_pos, Finset.card_sdiff_of_subset, Finset.subset_iff, if_pos, Finset.mem_sdiff.mp, Finset.card_insert_of_notMem, Finset.eq_univ_of_card, Finset.sdiff_self, if_neg, Finset.not_nonempty_empty

      have hpair : ∀ a b : Fin 3, a ≠ b → F [a, b] = ∅ := by
        intro a b hab
        have hh : ([a, b] : List (Fin 3)).Nodup := by simp [hab]
        have hy := hspec [a, b] hh
        simp only [List.toFinset_cons, List.toFinset_nil] at hy
        obtain ⟨-, hif⟩ := hy
        have hne : (Finset.univ \ (insert a (insert b ∅)) : Finset (Fin 3)).Nonempty := by
          rw [← Finset.card_pos]
          rw [Finset.card_sdiff_of_subset (by simp [Finset.subset_iff])]
          simp [hab]
        rw [if_pos hne] at hif
        obtain ⟨c, hc, hFc, -⟩ := hif
        simp only [pick_game_move_zero, List.length_cons, List.length_nil, hs2] at hFc
        have hc3 : ([a, b] ++ [c] : List (Fin 3)) = [a, b, c] := rfl
        rw [hc3] at hFc
        have hcad : a ≠ c := fun h => (Finset.mem_sdiff.mp hc).2 (by simp [h])
        have hcbd : b ≠ c := fun h => (Finset.mem_sdiff.mp hc).2 (by simp [h])
        have hnodup3 : ([a, b, c] : List (Fin 3)).Nodup := by simp [hab, hcad, hcbd]
        have hz := hspec [a, b, c] hnodup3
        simp only [List.toFinset_cons, List.toFinset_nil] at hz
        obtain ⟨-, hif3⟩ := hz
        have hempty : (Finset.univ \ (insert a (insert b (insert c ∅))) : Finset (Fin 3)) = ∅ := by
          have hcard : (insert a (insert b (insert c ∅)) : Finset (Fin 3)).card = 3 := by
            rw [Finset.card_insert_of_notMem, Finset.card_insert_of_notMem]
            · simp
            · simp [hcbd]
            · simp [hab, hcad]
          have huniv : (insert a (insert b (insert c ∅)) : Finset (Fin 3)) = Finset.univ := by
            apply Finset.eq_univ_of_card
            simpa using hcard
          rw [huniv, Finset.sdiff_self]
        rw [hempty] at hif3
        rw [if_neg Finset.not_nonempty_empty] at hif3
        rw [hif3] at hFc
        exact hFc
  3. At any history of length 1 where one item has been picked, agent 0 receives no additional items: F [y] = ∅.

    For any single item y, two items remain, so the remaining set is nonempty. The picker at step 1 is agent 1, who selects some remaining item c ≠ y. Agent 0 receives no item at this step, giving F [y] = F [y, c]. Since y ≠ c, the previous step applies to show F [y, c] = ∅, hence F [y] = ∅.

    lines 47–63

    uses Finset.card_pos, Finset.card_sdiff_of_subset, Finset.subset_iff, if_pos, Finset.mem_sdiff.mp

      have hsing : ∀ y : Fin 3, F [y] = ∅ := by
        intro y
        have hy := hspec [y] (by simp)
        simp only [List.toFinset_cons, List.toFinset_nil] at hy
        obtain ⟨-, hif⟩ := hy
        have hne : (Finset.univ \ (insert y ∅) : Finset (Fin 3)).Nonempty := by
          rw [← Finset.card_pos]
          rw [Finset.card_sdiff_of_subset (by simp [Finset.subset_iff])]
          simp
        rw [if_pos hne] at hif
        obtain ⟨c, hc, hFc, -⟩ := hif
        simp only [pick_game_move_zero, List.length_cons, List.length_nil, hs1] at hFc
        have hc1 : ([y] ++ [c] : List (Fin 3)) = [y, c] := rfl
        rw [hc1] at hFc
        have hyc : y ≠ c := fun h => (Finset.mem_sdiff.mp hc).2 (by simp [h])
        rw [hpair y c hyc] at hFc
        exact hFc
  4. At the root, agent 0 picks their most preferred item x, receiving payoff u 0 x, so F [] = {x}.

    At the root history [], all 3 items are available, and agent 0 is the picker. If agent 0 picks an item z, agent 0 receives {z} ∪ F [z] = {z} ∪ ∅ = {z}, earning payoff u 0 z. By equilibrium optimality, agent 0 chooses an item x that maximizes u 0 x over all items y in Fin 3, yielding F [] = {x} and u 0 y ≤ u 0 x for all y.

    lines 64–82

    uses List.nodup_nil, List.toFinset_nil, Finset.sdiff_empty, if_pos, Finset.univ_nonempty, List.nil_append, if_true, Finset.mem_univ

      have hroot := hspec [] List.nodup_nil
      simp only [List.toFinset_nil, Finset.sdiff_empty] at hroot
      obtain ⟨-, hif0⟩ := hroot
      rw [if_pos Finset.univ_nonempty] at hif0
      obtain ⟨x, -, hFx, hopt⟩ := hif0
      simp only [pick_game_move_zero, List.length_nil, hs0, List.nil_append] at hFx
      have hFroot : F [] = {x} := by
        rw [hFx, hsing x]
        rfl
      have hpay : ∀ z : Fin 3, pick_game_move_payoff u (block_snake_seq_two 1) F [] z = u 0 z := by
        intro z
        simp only [pick_game_move_payoff, pick_game_move_zero, List.length_nil, hs0, hsing z,
          if_true, List.nil_append]
        simp
      have hopt' : ∀ y : Fin 3, u 0 y ≤ u 0 x := by
        intro y
        have h := hopt y (Finset.mem_univ y)
        rw [hpay y, hpay x] at h
        exact h
  5. The root allocation assigns {x} to agent 0 and the remaining two items to agent 1, and removing any item from agent 1's bundle leaves at most one item.

    By definition of the root allocation, agent 0 receives A 0 = F [] = {x} (size 1) and agent 1 receives A 1 = Finset.univ \ {x} (size 2). For any item y in A 1, erasing y leaves a set of size 2 - 1 = 1 ≤ 1.

    lines 83–98

    uses Finset.card_sdiff_of_subset, Finset.subset_iff, Finset.card_erase_add_one

      have hA0 : pick_game_root_allocation F 0 = {x} := by
        simp [pick_game_root_allocation, hFroot]
      have hA1 : pick_game_root_allocation F 1 = Finset.univ \ {x} := by
        simp [pick_game_root_allocation, hFroot]
      have hc1 : (Finset.univ \ ({x} : Finset (Fin 3))).card = 2 := by
        rw [Finset.card_sdiff_of_subset (by simp [Finset.subset_iff])]
        simp
      have hA0card : (pick_game_root_allocation F 0).card = 1 := by
        rw [hA0]; simp
      have hA1card : (pick_game_root_allocation F 1).card = 2 := by
        rw [hA1]; exact hc1
      have hc1e : ∀ y ∈ (Finset.univ \ ({x} : Finset (Fin 3))),
          ((Finset.univ \ ({x} : Finset (Fin 3))).erase y).card ≤ 1 := by
        intro y hy
        have h := Finset.card_erase_add_one hy
        omega
  6. Any subset S with |S| ≤ 1 whose elements are all weakly less preferred by agent i than x embeds injectively into {x} with weakly greater utility.

    Define f by f(z) = x for all z. Its image is contained in {x}. Because S has cardinality at most 1, any two elements in S are equal, so f is injective on S. Furthermore, every z in S satisfies u i z ≤ u i x = u i (f z) by assumption.

    lines 99–108

    uses Finset.card_le_one.mp

      have key : ∀ (i : Fin 2) (S : Finset (Fin 3)), S.card ≤ 1 →
          (∀ z ∈ S, u i z ≤ u i x) →
          ∃ f : Fin 3 → Fin 3, (∀ z ∈ S, f z ∈ ({x} : Finset (Fin 3))) ∧
            (∀ z₁ ∈ S, ∀ z₂ ∈ S, f z₁ = f z₂ → z₁ = z₂) ∧
            ∀ z ∈ S, u i z ≤ u i (f z) := by
        intro i S hS hpref
        refine ⟨fun _ => x, ?_, ?_, ?_⟩
        · intro z _; simp
        · intro z1 hz1 z2 hz2 _; exact Finset.card_le_one.mp hS z1 hz1 z2 hz2
        · intro z hz; simpa using hpref z hz
  7. The root allocation satisfies non-envious lower quota in pairwise dominance (NEL-PD).

    NEL-PD requires that whenever |A i| < |A j| and y ∈ A j, the bundle A j \ {y} pairwise-dominates into A i for agent i. Since |A 0| = 1 and |A 1| = 2, the condition |A i| < |A j| holds only when i = 0 and j = 1; the other combinations are impossible by irreflexivity or arithmetic. For any y ∈ A 1, the set S = A 1 \ {y} has size at most 1, and agent 0 weakly prefers x to every element in S because x is agent 0's top choice across all items. Applying the embedding lemma gives an injection from S into A 0 = {x} preserving weak utility.

    lines 109–120

    uses lt_irrefl

      constructor
      · intro i j hij y hy
        have hi01 : i = 0 ∨ i = 1 := by fin_cases i <;> simp
        have hj01 : j = 0 ∨ j = 1 := by fin_cases j <;> simp
        rcases hi01 with rfl | rfl <;> rcases hj01 with rfl | rfl
        · exact absurd hij (lt_irrefl _)
        · rw [hA1] at hy
          rw [hA0, hA1]
          exact key 0 _ (hc1e y hy) (fun z _ => hopt' z)
        · rw [hA1card, hA0card] at hij
          omega
        · exact absurd hij (lt_irrefl _)
  8. The root allocation satisfies envy-freeness up to one item in pairwise dominance (EF1-PD).

    For i = j, the identity map witnesses that neither agent envies themselves. For i = 0 and j = 1, choose any item y from the nonempty set A 1; erasing y leaves at most one item, and the embedding lemma shows A 1 \ {y} pairwise-dominates into A 0 = {x}. For i = 1 and j = 0, choosing y = x leaves A 0 \ {x} = ∅, which embeds vacuously into A 1.

    lines 121–154

    uses le_refl, Finset.card_pos, Finset.mem_erase, Finset.mem_singleton

      · intro i j
        have hi01 : i = 0 ∨ i = 1 := by fin_cases i <;> simp
        have hj01 : j = 0 ∨ j = 1 := by fin_cases j <;> simp
        rcases hi01 with rfl | rfl <;> rcases hj01 with rfl | rfl
        · left
          exact ⟨fun z => z, by intro z hz; exact hz,
            by intro z1 _ z2 _ h; exact h,
            by intro z _; exact le_refl _⟩
        · right
          have hne : (Finset.univ \ ({x} : Finset (Fin 3))).Nonempty := by
            rw [← Finset.card_pos, hc1]; norm_num
          obtain ⟨y, hy⟩ := hne
          refine ⟨y, ?_, ?_⟩
          · rw [hA1]; exact hy
          · rw [hA0, hA1]
            exact key 0 _ (hc1e y hy) (fun z _ => hopt' z)
        · right
          refine ⟨x, ?_, ?_⟩
          · rw [hA0]; simp
          · rw [hA0, hA1]
            refine ⟨fun _ => x, ?_, ?_, ?_⟩
            · intro z hz
              simp only [Finset.mem_erase, Finset.mem_singleton] at hz
              exact absurd hz.2 hz.1
            · intro z1 hz1 z2 hz2 _
              simp only [Finset.mem_erase, Finset.mem_singleton] at hz1
              exact absurd hz1.2 hz1.1
            · intro z hz
              simp only [Finset.mem_erase, Finset.mem_singleton] at hz
              exact absurd hz.2 hz.1
        · left
          exact ⟨fun z => z, by intro z hz; exact hz,
            by intro z1 _ z2 _ h; exact h,
            by intro z _; exact le_refl _⟩
Finset.card_pos
A finite set has strictly positive cardinality if and only if it is nonempty.
Finset.card_sdiff_of_subset
If s is a subset of t, then the cardinality of t \ s is the cardinality of t minus the cardinality of s.
Finset.subset_iff
s₁ is a subset of s₂ if and only if every element of s₁ belongs to s₂.
if_pos
An if-then-else expression evaluates to the then-branch when the condition is true.
if_neg
An if-then-else expression evaluates to the else-branch when the condition is false.
Finset.card_insert_of_notMem
Inserting an element not already in a finite set increases its cardinality by 1.
Finset.eq_univ_of_card
A subset of a finite type whose cardinality equals the cardinality of the type is the universal set.
Finset.sdiff_self
The set difference of any finite set with itself is the empty set.
Finset.not_nonempty_empty
The empty set is not nonempty.
Finset.mem_sdiff.mp
If an element belongs to A \ B, then it belongs to A and does not belong to B.
List.nodup_nil
The empty list contains no duplicate elements.
List.toFinset_nil
The set of elements of the empty list is the empty set.
Finset.sdiff_empty
Subtracting the empty set from any set leaves the set unchanged.
Finset.univ_nonempty
The universal set of an inhabited finite type is nonempty.
List.nil_append
Appending any list to the empty list yields the list itself.
if_true
An if-then-else expression with condition True evaluates to the then-branch.
Finset.mem_univ
Every element of a finite type belongs to the universal set.
Finset.card_erase_add_one
Erasing an element from a finite set decreases its cardinality by 1.
Finset.card_le_one.mp
In a finite set with at most one element, any two elements are equal.
lt_irrefl
Strict inequality is irreflexive: no element is strictly less than itself.
le_refl
Inequality is reflexive: every element is weakly less than itself.
Finset.mem_erase
An element belongs to s \ {b} if and only if it belongs to s and is not equal to b.
Finset.mem_singleton
An element belongs to the singleton {a} if and only if it equals 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

theorem block_snake_two_agent_spe_nel_ef1_three_items (u : Fin 2 → Fin 3 → ℝ)    (hu : ∀ i x, 0 < u i x)    (hd : ∀ i x y, x ≠ y → u i x ≠ u i y)    (F : List (Fin 3) → Finset (Fin 3))    (hF : pick_game_is_spe u (block_snake_seq_two 1) F) :    is_nel_pd (fun i x y => u i x ≤ u i y) (pick_game_root_allocation F) ∧    is_ef1_pd (fun i x y => u i x ≤ u i y) (pick_game_root_allocation F) := by  obtain ⟨hlen, hspec⟩ := hF  have hs0 : (block_snake_seq_two 1).getD 0 0 = 0 := by decide  have hs1 : (block_snake_seq_two 1).getD 1 0 = 1 := by decide  have hs2 : (block_snake_seq_two 1).getD 2 0 = 1 := by decide  have hpair : ∀ a b : Fin 3, a ≠ b → F [a, b] = ∅ := by    intro a b hab    have hh : ([a, b] : List (Fin 3)).Nodup := by simp [hab]    have hy := hspec [a, b] hh    simp only [List.toFinset_cons, List.toFinset_nil] at hy    obtain ⟨-, hif⟩ := hy    have hne : (Finset.univ \ (insert a (insert b ∅)) : Finset (Fin 3)).Nonempty := by      rw [← Finset.card_pos]      rw [Finset.card_sdiff_of_subset (by simp [Finset.subset_iff])]      simp [hab]    rw [if_pos hne] at hif    obtain ⟨c, hc, hFc, -⟩ := hif    simp only [pick_game_move_zero, List.length_cons, List.length_nil, hs2] at hFc    have hc3 : ([a, b] ++ [c] : List (Fin 3)) = [a, b, c] := rfl    rw [hc3] at hFc    have hcad : a ≠ c := fun h => (Finset.mem_sdiff.mp hc).2 (by simp [h])    have hcbd : b ≠ c := fun h => (Finset.mem_sdiff.mp hc).2 (by simp [h])    have hnodup3 : ([a, b, c] : List (Fin 3)).Nodup := by simp [hab, hcad, hcbd]    have hz := hspec [a, b, c] hnodup3    simp only [List.toFinset_cons, List.toFinset_nil] at hz    obtain ⟨-, hif3⟩ := hz    have hempty : (Finset.univ \ (insert a (insert b (insert c ∅))) : Finset (Fin 3)) = ∅ := by      have hcard : (insert a (insert b (insert c ∅)) : Finset (Fin 3)).card = 3 := by        rw [Finset.card_insert_of_notMem, Finset.card_insert_of_notMem]        · simp        · simp [hcbd]        · simp [hab, hcad]      have huniv : (insert a (insert b (insert c ∅)) : Finset (Fin 3)) = Finset.univ := by        apply Finset.eq_univ_of_card        simpa using hcard      rw [huniv, Finset.sdiff_self]    rw [hempty] at hif3    rw [if_neg Finset.not_nonempty_empty] at hif3    rw [hif3] at hFc    exact hFc  have hsing : ∀ y : Fin 3, F [y] = ∅ := by    intro y    have hy := hspec [y] (by simp)    simp only [List.toFinset_cons, List.toFinset_nil] at hy    obtain ⟨-, hif⟩ := hy    have hne : (Finset.univ \ (insert y ∅) : Finset (Fin 3)).Nonempty := by      rw [← Finset.card_pos]      rw [Finset.card_sdiff_of_subset (by simp [Finset.subset_iff])]      simp    rw [if_pos hne] at hif    obtain ⟨c, hc, hFc, -⟩ := hif    simp only [pick_game_move_zero, List.length_cons, List.length_nil, hs1] at hFc    have hc1 : ([y] ++ [c] : List (Fin 3)) = [y, c] := rfl    rw [hc1] at hFc    have hyc : y ≠ c := fun h => (Finset.mem_sdiff.mp hc).2 (by simp [h])    rw [hpair y c hyc] at hFc    exact hFc  have hroot := hspec [] List.nodup_nil  simp only [List.toFinset_nil, Finset.sdiff_empty] at hroot  obtain ⟨-, hif0⟩ := hroot  rw [if_pos Finset.univ_nonempty] at hif0  obtain ⟨x, -, hFx, hopt⟩ := hif0  simp only [pick_game_move_zero, List.length_nil, hs0, List.nil_append] at hFx  have hFroot : F [] = {x} := by    rw [hFx, hsing x]    rfl  have hpay : ∀ z : Fin 3, pick_game_move_payoff u (block_snake_seq_two 1) F [] z = u 0 z := by    intro z    simp only [pick_game_move_payoff, pick_game_move_zero, List.length_nil, hs0, hsing z,      if_true, List.nil_append]    simp  have hopt' : ∀ y : Fin 3, u 0 y ≤ u 0 x := by    intro y    have h := hopt y (Finset.mem_univ y)    rw [hpay y, hpay x] at h    exact h  have hA0 : pick_game_root_allocation F 0 = {x} := by    simp [pick_game_root_allocation, hFroot]  have hA1 : pick_game_root_allocation F 1 = Finset.univ \ {x} := by    simp [pick_game_root_allocation, hFroot]  have hc1 : (Finset.univ \ ({x} : Finset (Fin 3))).card = 2 := by    rw [Finset.card_sdiff_of_subset (by simp [Finset.subset_iff])]    simp  have hA0card : (pick_game_root_allocation F 0).card = 1 := by    rw [hA0]; simp  have hA1card : (pick_game_root_allocation F 1).card = 2 := by    rw [hA1]; exact hc1  have hc1e : ∀ y ∈ (Finset.univ \ ({x} : Finset (Fin 3))),      ((Finset.univ \ ({x} : Finset (Fin 3))).erase y).card ≤ 1 := by    intro y hy    have h := Finset.card_erase_add_one hy    omega  have key : ∀ (i : Fin 2) (S : Finset (Fin 3)), S.card ≤ 1 →      (∀ z ∈ S, u i z ≤ u i x) →      ∃ f : Fin 3 → Fin 3, (∀ z ∈ S, f z ∈ ({x} : Finset (Fin 3))) ∧        (∀ z₁ ∈ S, ∀ z₂ ∈ S, f z₁ = f z₂ → z₁ = z₂) ∧        ∀ z ∈ S, u i z ≤ u i (f z) := by    intro i S hS hpref    refine ⟨fun _ => x, ?_, ?_, ?_⟩    · intro z _; simp    · intro z1 hz1 z2 hz2 _; exact Finset.card_le_one.mp hS z1 hz1 z2 hz2    · intro z hz; simpa using hpref z hz  constructor  · intro i j hij y hy    have hi01 : i = 0 ∨ i = 1 := by fin_cases i <;> simp    have hj01 : j = 0 ∨ j = 1 := by fin_cases j <;> simp    rcases hi01 with rfl | rfl <;> rcases hj01 with rfl | rfl    · exact absurd hij (lt_irrefl _)    · rw [hA1] at hy      rw [hA0, hA1]      exact key 0 _ (hc1e y hy) (fun z _ => hopt' z)    · rw [hA1card, hA0card] at hij      omega    · exact absurd hij (lt_irrefl _)  · intro i j    have hi01 : i = 0 ∨ i = 1 := by fin_cases i <;> simp    have hj01 : j = 0 ∨ j = 1 := by fin_cases j <;> simp    rcases hi01 with rfl | rfl <;> rcases hj01 with rfl | rfl    · left      exact ⟨fun z => z, by intro z hz; exact hz,        by intro z1 _ z2 _ h; exact h,        by intro z _; exact le_refl _⟩    · right      have hne : (Finset.univ \ ({x} : Finset (Fin 3))).Nonempty := by        rw [← Finset.card_pos, hc1]; norm_num      obtain ⟨y, hy⟩ := hne      refine ⟨y, ?_, ?_⟩      · rw [hA1]; exact hy      · rw [hA0, hA1]        exact key 0 _ (hc1e y hy) (fun z _ => hopt' z)    · right      refine ⟨x, ?_, ?_⟩      · rw [hA0]; simp      · rw [hA0, hA1]        refine ⟨fun _ => x, ?_, ?_, ?_⟩        · intro z hz          simp only [Finset.mem_erase, Finset.mem_singleton] at hz          exact absurd hz.2 hz.1        · intro z1 hz1 z2 hz2 _          simp only [Finset.mem_erase, Finset.mem_singleton] at hz1          exact absurd hz1.2 hz1.1        · intro z hz          simp only [Finset.mem_erase, Finset.mem_singleton] at hz          exact absurd hz.2 hz.1    · left      exact ⟨fun z => z, by intro z hz; exact hz,        by intro z1 _ z2 _ h; exact h,        by intro z _; exact le_refl _⟩
See it in the graphDiscuss this resultChallenge it