Drafts under positive Borda scores: sincere runs, bundles, EFX on graph arcs, defects
DefinitionAnholcerEtAl2026_DefsAgents are and items ; a profile gives each agent a permutation and the value (positive Borda scores). A word is a picking order; at turn (from ) agent takes her most valuable remaining item (best, rem, taken), and (bundle) is the set of items she takes; worth is the additive value. EFXArc: for every . Universal G w: EFX on every arc of for every profile; spectrum G is the set of lengths of universal words. cval , F , lastTurns , efhxDefect and maxDefect , eps, walk, liftGain, Lam (Definition 2.5). Explicit words snake, snake', roundRobin, thueMorse; EnvyFreeUniversal, IsSincereRun, UniversalAdditive (arbitrary nonnegative additive values, any tie-breaking), HasK2Component, Interlaced.
import Mathlib
/-!
# Picking orders that guarantee EFX for every Borda profile
Definitions for M. Anholcer, M. Bartkowiak, B. Bosek, J. Grytczuk, "How long can a draft be fair?
Picking orders that guarantee EFX for every Borda profile", arXiv:2611.41596v1 (2026), Section 2.1.
Conventions. Agents are `Fin n`, a picking order (word) is `w : List (Fin n)` with `m = w.length`
goods, and turns are indexed from `0`: the paper's turn `t` is our turn `t - 1`, so the paper's
chronological value `c(t) = m + 1 - t` is our `cval w t = m - t`. Goods are `Fin m`. A
positive-Borda profile is `σ : Fin n → Equiv.Perm (Fin m)`; agent `a` values good `g` at
`σ a g + 1 ∈ {1, …, m}`.
-/
namespace AnholcerEtAl2026
open Finset
variable {n m : ℕ}
/-- Borda value of good `g` to agent `a`. -/
def val (σ : Fin n → Equiv.Perm (Fin m)) (a : Fin n) (g : Fin m) : ℕ := (σ a g : ℕ) + 1
/-- The most valuable good of `S` for agent `a` (`fallback` if `S` is empty). -/
def best (σ : Fin n → Equiv.Perm (Fin m)) (a : Fin n) (S : Finset (Fin m)) (fallback : Fin m) :
Fin m :=
if h : S.Nonempty then (σ a).symm ((S.map (σ a).toEmbedding).max' (by simpa using h))
else fallback
/-- The goods still available after the first `k` turns of the picking order `w`. -/
def rem (σ : Fin n → Equiv.Perm (Fin m)) (w : Fin m → Fin n) : ℕ → Finset (Fin m)
| 0 => univ
| k + 1 => if h : k < m then rem σ w k \ {best σ (w ⟨k, h⟩) (rem σ w k) ⟨k, h⟩} else rem σ w k
/-- The good taken at turn `t` (sincere picking: the picker takes her most valuable remaining
good). -/
def taken (σ : Fin n → Equiv.Perm (Fin m)) (w : Fin m → Fin n) (t : Fin m) : Fin m :=
best σ (w t) (rem σ w t) t
/-- The bundle `X_a` of agent `a`: the goods taken at her turns. -/
def bundle (σ : Fin n → Equiv.Perm (Fin m)) (w : Fin m → Fin n) (a : Fin n) : Finset (Fin m) :=
(univ.filter fun t => w t = a).image (taken σ w)
/-- Additive value of a set of goods to agent `i`. -/
def worth (σ : Fin n → Equiv.Perm (Fin m)) (i : Fin n) (S : Finset (Fin m)) : ℕ :=
∑ g ∈ S, val σ i g
/-- The word `w` read as a function of the turn. -/
def turnFn (w : List (Fin n)) : Fin w.length → Fin n := fun t => w.get t
/-- EFX along the arc `i → j`: for every good `g` of `X_j`, `v_i(X_j \ {g}) ≤ v_i(X_i)` (vacuous if
`X_j = ∅`). -/
def EFXArc (w : List (Fin n)) (σ : Fin n → Equiv.Perm (Fin w.length)) (i j : Fin n) : Prop :=
∀ g ∈ bundle σ (turnFn w) j,
worth σ i (bundle σ (turnFn w) j \ {g}) ≤ worth σ i (bundle σ (turnFn w) i)
/-- `w` is universal for the comparison graph `G`: for every positive-Borda profile, sincere
picking along `w` gives an allocation that is EFX along every arc of `G`. -/
def Universal (G : SimpleGraph (Fin n)) (w : List (Fin n)) : Prop :=
∀ σ : Fin n → Equiv.Perm (Fin w.length), ∀ i j, G.Adj i j → EFXArc w σ i j
/-- The length spectrum `σ(G)`: all `m` for which some word of length `m` is universal for `G`. -/
def spectrum (G : SimpleGraph (Fin n)) : Set ℕ :=
{m | ∃ w : List (Fin n), w.length = m ∧ Universal G w}
/-! ### Chronological values, the exact defect -/
/-- The turns of agent `a` (paper: `X_a`, goods named by turns). -/
def turnsOf (w : List (Fin n)) (a : Fin n) : Finset (Fin w.length) :=
univ.filter fun t => w.get t = a
/-- Chronological value of turn `t`: `c = m - t` (paper: `m + 1 - t` with turns from `1`). -/
def cval (w : List (Fin n)) (t : Fin w.length) : ℕ := w.length - t
/-- `F_a = c(X_a)`. -/
def F (w : List (Fin n)) (a : Fin n) : ℕ := ∑ t ∈ turnsOf w a, cval w t
/-- `D^h_j`: the last `min{h, b_j}` turns of `j`. -/
def lastTurns (w : List (Fin n)) (h : ℕ) (j : Fin n) : Finset (Fin w.length) :=
(turnsOf w j).filter fun t => ((turnsOf w j).filter fun s => t < s).card < h
/-- The EF`h`X defect of the arc `i → j` in the profile `σ`:
`v_i(X_j) - v_i(E) - v_i(X_i)`, where `E` is the set of the `min{h, |X_j|}` goods of `X_j` least
valuable to `i`; equivalently the largest value to `i` of a subset of `X_j` of size
`|X_j| - min{h, |X_j|}`, minus `v_i(X_i)`. -/
def efhxDefect (w : List (Fin n)) (σ : Fin n → Equiv.Perm (Fin w.length)) (h : ℕ) (i j : Fin n) :
ℤ :=
((bundle σ (turnFn w) j).powersetCard
((bundle σ (turnFn w) j).card - min h (bundle σ (turnFn w) j).card)).sup'
(Finset.powersetCard_nonempty.mpr (Nat.sub_le _ _)) (fun S => (worth σ i S : ℤ)) -
(worth σ i (bundle σ (turnFn w) i) : ℤ)
/-- `δ^h_ij(W)`: the largest EF`h`X defect over all positive-Borda profiles. -/
def maxDefect (w : List (Fin n)) (h : ℕ) (i j : Fin n) : ℤ :=
(univ : Finset (Fin n → Equiv.Perm (Fin w.length))).sup' univ_nonempty
(fun σ => efhxDefect w σ h i j)
/-- The weight `ε(t)` of Definition 2.5: `-1` on own turns, `+1` on retained target turns. -/
def eps (w : List (Fin n)) (h : ℕ) (i j : Fin n) (t : Fin w.length) : ℤ :=
if w.get t = i then -1 else if t ∈ turnsOf w j ∧ t ∉ lastTurns w h j then 1 else 0
/-- The walk `H(y) = ∑_{t ≤ y} ε(t)` (paper turns), i.e. the sum of `ε` over our turns `< y`. -/
def walk (w : List (Fin n)) (h : ℕ) (i j : Fin n) (y : ℕ) : ℤ :=
∑ t ∈ univ.filter (fun t : Fin w.length => (t : ℕ) < y), eps w h i j t
/-- The lift gain `λ^h_ij(g) = max_{g ≤ y ≤ m} H(y) - H(g)` of the paper turn `g = t + 1`. -/
def liftGain (w : List (Fin n)) (h : ℕ) (i j : Fin n) (t : Fin w.length) : ℤ :=
(Icc ((t : ℕ) + 1) w.length).sup' (nonempty_Icc.mpr t.isLt) (walk w h i j) -
walk w h i j ((t : ℕ) + 1)
/-- `Λ^h_ij`: the sum of the lift gains of the third-party turns. -/
def Lam (w : List (Fin n)) (h : ℕ) (i j : Fin n) : ℤ :=
∑ t ∈ univ.filter (fun t : Fin w.length => w.get t ≠ i ∧ w.get t ≠ j), liftGain w h i j t
/-! ### Specific words -/
/-- The snake `1 2 … n n … 2 1` (agents numbered from `0`). -/
def snake (n : ℕ) : List (Fin n) :=
List.ofFn fun t : Fin (2 * n) => ⟨if (t : ℕ) < n then t else 2 * n - 1 - t, by split_ifs <;> omega⟩
/-- The order `n 1 2 … (n-1) (n-1) … 2 1` of length `2n - 1` (agents numbered from `0`). -/
def snake' (n : ℕ) (hn : 0 < n) : List (Fin n) :=
List.ofFn fun t : Fin (2 * n - 1) =>
⟨if (t : ℕ) = 0 then n - 1 else if (t : ℕ) ≤ n - 1 then t - 1 else 2 * n - 2 - t, by
split_ifs <;> omega⟩
/-- Round robin `1 2 … n 1 2 …` cut at length `m` (agents numbered from `0`). -/
def roundRobin (n m : ℕ) (hn : 0 < n) : List (Fin n) :=
List.ofFn fun t : Fin m => ⟨t % n, Nat.mod_lt _ hn⟩
/-- The Thue–Morse word over `A = 0`, `B = 1`: `t_k` is the parity of the binary digit sum of `k`
(the fixed point `ABBABAAB…` of `A ↦ ABBA`, `B ↦ BAAB`). -/
def thueMorse (k : ℕ) : Fin 2 := ⟨(Nat.digits 2 k).sum % 2, Nat.mod_lt _ (by norm_num)⟩
/-! ### Envy-freeness and arbitrary additive valuations (Section 4) -/
/-- `w` is envy-free along every arc of `G` for every positive-Borda profile. -/
def EnvyFreeUniversal (G : SimpleGraph (Fin n)) (w : List (Fin n)) : Prop :=
∀ σ : Fin n → Equiv.Perm (Fin w.length), ∀ i j, G.Adj i j →
worth σ i (bundle σ (turnFn w) j) ≤ worth σ i (bundle σ (turnFn w) i)
/-- A sincere run under arbitrary values `v` with arbitrary tie-breaking: `pick t` is the good taken
at turn `t`; it was still available and no available good is worth more to the picker. -/
def IsSincereRun (w : List (Fin n)) (v : Fin n → Fin w.length → ℝ) (pick : Fin w.length → Fin w.length) :
Prop :=
Function.Injective pick ∧
∀ t g, (∀ s, s < t → pick s ≠ g) → v (w.get t) g ≤ v (w.get t) (pick t)
/-- `w` is universal for `G` under arbitrary nonnegative additive valuations (for every
tie-breaking). -/
def UniversalAdditive (G : SimpleGraph (Fin n)) (w : List (Fin n)) : Prop :=
∀ v : Fin n → Fin w.length → ℝ, (∀ a g, 0 ≤ v a g) →
∀ pick, IsSincereRun w v pick → ∀ i j, G.Adj i j →
∀ g ∈ (turnsOf w j).image pick,
∑ x ∈ (turnsOf w j).image pick \ {g}, v i x ≤ ∑ x ∈ (turnsOf w i).image pick, v i x
/-- `G` has a connected component isomorphic to `K_2`: an edge `{u, v}` with no other neighbours. -/
def HasK2Component (G : SimpleGraph (Fin n)) : Prop :=
∃ u v, G.Adj u v ∧ (∀ x, G.Adj u x → x = v) ∧ (∀ x, G.Adj v x → x = u)
/-- The condition of Theorem 4.5: for every arc `i → j` and every `r ≤ b_j - 1`, agent `i` picks
at least `r` times and `p_i(r) < p_j(r)`. With `t = p_j(r)` (a turn of `j` that is not her last),
`r` is the number of turns of `j` up to `t`, and the condition says that `i` has at least `r` turns
before `t`. -/
def Interlaced (G : SimpleGraph (Fin n)) (w : List (Fin n)) : Prop :=
∀ i j, G.Adj i j → ∀ t : Fin w.length, w.get t = j → (∃ s, t < s ∧ w.get s = j) →
((turnsOf w j).filter (· ≤ t)).card ≤ ((turnsOf w i).filter (· < t)).card
end AnholcerEtAl2026
Read-back
What the Lean code literally says, in plain math · claude-opus-5-5
The bundle defines, for agents , sincere picking along a word and several derived notions; it states no theorem.
Setting (from the definition bundle). Agents are . A word (picking order) is a finite sequence of agents; is its length. Turns are numbered from : turn belongs to agent . There are exactly goods, also labelled . A profile gives each agent a permutation of the goods, and agent values good at
so each agent's values are the numbers in some order (no ties). Sincere picking: at turn agent takes the still available good of largest value to her (unique, since values are distinct). is the set of goods taken at the turns of (the bundle of ), and for a set of goods.
Formally, is the good of with the largest value (a fixed fallback good if is empty); is all goods and for ( otherwise); the good taken at turn is . Since for , the fallback is never used.
EFX arc, Universal, spectrum. means for every . A word is universal for a simple graph on the agents if for every profile on the goods and every ordered pair with adjacent to in (adjacency is symmetric and irreflexive, so both directions and are required), EFX holds along :
(vacuous when ). .
Chronological quantities. is the set of turns of agent and the number of occurrences of in . The chronological value of turn is (so , ..., ), and
For , is the set of turns of such that fewer than turns of come strictly after , i.e. the last turns of (empty when ).
Defect. For a profile , and agents , the integer
(the max is over a nonempty family; for it is , and for it is ). , the maximum over all (finitely many) profiles on the goods.
Walk and lift gains. For agents and , define the weight of turn :
the walk for (sum over turns with index strictly below ), the lift gain of turn
and , the sum of lift gains over third-party turns.
Specific words (agents numbered from ):
- (length ; empty for ).
- for : length , turn is agent , turns are agents , and turn is agent ; e.g. and .
- for : turn is agent , length .
- Thue Morse: where is the binary digit sum, so
Envy freeness. is envy-free universal for if for every profile and every adjacent : .
Arbitrary additive valuations. For real values (agent , good ) and a map from turns to goods, a sincere run means: is injective (hence a bijection of ), and for every turn and every good not picked at any turn , (ties may be broken arbitrarily). is universal-additive for if for every nonnegative , every sincere run, every adjacent and every :
Graph conditions. has a component if there are adjacent such that 's only neighbour is and 's only neighbour is . is interlaced for if for every adjacent and every turn of that is not the last turn of :
Auditor concerns: Turns and goods are 0-indexed; chronological value is m - t (values 1..m). Number of goods always equals the word length. Profiles are strict rankings only (no ties, values exactly 1..m). The best fallback is never used for t < m. Universal ranges over all profiles independently per agent; since G is a simple graph, both arc directions are checked and there are no loops. For n = 0 the only word is the empty word. efhxDefect: for h = 0 it is plain envy v_i(X_j) - v_i(X_i); for h >= |X_j| it is -v_i(X_i). walk H(y) sums turns with index < y, liftGain maximises over y in [t+1, m]. eps tests w_t = i before membership in T_j. snake' requires n >= 1 and starts with agent n-1. IsSincereRun allows arbitrary tie breaking and real (possibly zero) values; UniversalAdditive requires nonnegative values only.
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.