AFTD Auto-Formalizing Theoretical Domains

fair_max_weight_lineup_majority_probability_three

theoremverifiedformalization

For n = 3 players, every 3 × 3 matrix P of probabilities in [0, 1] with an all-fair maximum-weight matching M satisfies team_winProb P σ ≤ 9/16 for every lineup permutation σ.

Statement

theorem fair_max_weight_lineup_majority_probability_three
    (P : Fin 3 → Fin 3 → ℝ) (hP : ∀ i j, 0 ≤ P i j ∧ P i j ≤ 1)
    (M : Equiv.Perm (Fin 3)) (hM_max : team_isMaxWeight P M)
    (hM_half : ∀ i, P i (M i) = 1 / 2)
    (σ : Equiv.Perm (Fin 3)) :
    team_winProb P σ ≤ 9 / 16
Formalizes
arXiv:2605.21234, Team Order
Verified
19 Nov 2026
Axioms
Classical.choiceQuot.soundpropext
Built on 4
  • team_winProbWinning probability of a line-up in the Team Order problem of arXiv:2605.21234: team 1 wins if it wins at least ⌊n/2⌋ + 1 of the n…
  • team_isMaxWeightπ is a maximum-weight perfect matching.
  • team_weightA line-up of team 1 against the fixed line-up of team 2 is a perfect matching, i.e. a permutation π of the n positions (player i of team 1…
  • team_tailPoisson-binomial upper tail: team_tail [q₁, …, qₙ] t is the probability that at least t of n independent events with success probabilities…

Read back from the Lean

For any $3 \times 3$ matrix of probabilities $P : \mathrm{Fin}\ 3 \to \mathrm{Fin}\ 3 \to \mathbb{R}$ such that $0 \le P(i, j) \le 1$ for all $i, j \in \mathrm{Fin}\ 3$, any permutation $M$ of $\mathrm{Fin}\ 3$ such that $M$ maximizes the sum of entries $\sum_{i \in \mathrm{Fin}\ 3} P(i, \tau(i))$ over all permutations $\tau$ of $\mathrm{Fin}\ 3$ and satisfies $P(i, M(i)) = 1/2$ for all $i \in \mathrm{Fin}\ 3$, and any permutation $\sigma$ of $\mathrm{Fin}\ 3$, the probability of winning a strict majority of games (at least 2 out of 3 independent matches with win probabilities $P(0, \sigma(0))$, $P(1, \sigma(1))$, and $P(2, \sigma(2))$) is at most $9/16$.

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 theorem proves that for n = 3 players, any lineup permutation σ in an instance with an all-fair maximum-weight matching M satisfies team_winProb P σ ≤ 9/16. Because M is a maximum-weight matching whose edges all have probability 1/2, the sum of matchup probabilities in the lineup is at most 3/2. The win probability for winning a majority of 3 games evaluates to the elementary symmetric polynomial q0*q1 + q0*q2 + q1*q2 - 2*q0*q1*q2; since at least one qi must be at most 1/2, an SOS-style algebraic identity decomposes 9/16 minus this polynomial into a sum of manifestly non-negative terms.

  1. For any function f on Fin 3, converting it to a list yields [f 0, f 1, f 2].

    Expanding List.ofFn recursively via List.ofFn_succ computes the explicit three-element list [f 0, f 1, f 2].

    line 3

    uses List.ofFn_succ

      simp [List.ofFn_succ]
  2. 9/16 - (ab + ac + bc - 2abc) = c * (4c^2 + 3(1 - 2c)) / 8 + (3/2 - c - (a + b)) * ((3/2 - c + (a + b)) / 4 * (1 - 2c) + c) + ((a - b)^2 / 4) * (1 - 2c)

    The difference between 9/16 and the win probability expression ab + ac + bc - 2abc is rewritten algebraically as a sum of three structured terms, verified by polynomial expansion (ring).

    lines 9–12

      have h_id : 9 / 16 - (a * b + a * c + b * c - 2 * a * b * c) =
          c * (4 * c ^ 2 + 3 * (1 - 2 * c)) / 8 +
          (3 / 2 - c - (a + b)) * ((3 / 2 - c + (a + b)) / 4 * (1 - 2 * c) + c) +
          ((a - b) ^ 2 / 4) * (1 - 2 * c) := by ring
  3. If a, b, c ≥ 0, a + b + c ≤ 3/2, and c ≤ 1/2, then ab + ac + bc - 2abc ≤ 9/16.

    Since c ≤ 1/2, the factor 1 - 2c is non-negative. Together with c ≥ 0 and a + b + c ≤ 3/2, each of the three terms in the algebraic identity is non-negative: the first by positivity, the second as a product of two non-negative factors (using mul_nonneg), and the third as the product of a square and 1 - 2c. Linear arithmetic then implies ab + ac + bc - 2abc ≤ 9/16.

    lines 13–24

    uses mul_nonneg

      have h_c1 : 0 ≤ 1 - 2 * c := by linarith
      have h_t1 : 0 ≤ c * (4 * c ^ 2 + 3 * (1 - 2 * c)) / 8 := by
        have : 0 ≤ 4 * c ^ 2 + 3 * (1 - 2 * c) := by positivity
        positivity
      have h_t2 : 0 ≤ (3 / 2 - c - (a + b)) * ((3 / 2 - c + (a + b)) / 4 * (1 - 2 * c) + c) := by
        have h1 : 0 ≤ 3 / 2 - c - (a + b) := by linarith
        have h2 : 0 ≤ (3 / 2 - c + (a + b)) / 4 * (1 - 2 * c) + c := by
          have : 0 ≤ 3 / 2 - c + (a + b) := by linarith
          positivity
        exact mul_nonneg h1 h2
      have h_t3 : 0 ≤ ((a - b) ^ 2 / 4) * (1 - 2 * c) := by positivity
      linarith
  4. For all non-negative q0, q1, q2 with q0 + q1 + q2 ≤ 3/2, q0*q1 + q0*q2 + q1*q2 - 2*q0*q1*q2 ≤ 9/16.

    At least one of the three variables must be at most 1/2, since if all three were strictly greater than 1/2, their sum would exceed 3/2. In each case, by the permutation symmetry of the polynomial (verified by ring), the variable that is ≤ 1/2 is placed in the third position and the auxiliary lemma fair_max_weight_lineup_majority_probability_three_aux is applied.

    lines 30–44

    uses fair_max_weight_lineup_majority_probability_three_aux

      by_cases hc : q2 ≤ 1 / 2
      · exact fair_max_weight_lineup_majority_probability_three_aux q0 q1 q2 h0 h1 h2 hsum hc
      · by_cases hb : q1 ≤ 1 / 2
        · have h_symm : q0 * q1 + q0 * q2 + q1 * q2 - 2 * q0 * q1 * q2 =
              q0 * q2 + q0 * q1 + q2 * q1 - 2 * q0 * q2 * q1 := by ring
          rw [h_symm]
          have hsum' : q0 + q2 + q1 ≤ 3 / 2 := by linarith
          exact fair_max_weight_lineup_majority_probability_three_aux q0 q2 q1 h0 h2 h1 hsum' hb
        · by_cases ha : q0 ≤ 1 / 2
          · have h_symm : q0 * q1 + q0 * q2 + q1 * q2 - 2 * q0 * q1 * q2 =
                q1 * q2 + q1 * q0 + q2 * q0 - 2 * q1 * q2 * q0 := by ring
            rw [h_symm]
            have hsum' : q1 + q2 + q0 ≤ 3 / 2 := by linarith
            exact fair_max_weight_lineup_majority_probability_three_aux q1 q2 q0 h1 h2 h0 hsum' ha
          · linarith
  5. The sum of the lineup probabilities P 0 (σ 0) + P 1 (σ 1) + P 2 (σ 2) is at most 3/2.

    Because M is a maximum-weight matching, the weight of lineup σ is at most the weight of M. Expanding the sum over Fin 3 via Fin.sum_univ_three and using the fact that every entry of M has probability 1/2, the total weight of M is 1/2 + 1/2 + 1/2 = 3/2, which bounds the sum of the lineup probabilities.

    lines 53–61

    uses Fin.sum_univ_three

      have h1 : team_weight P σ ≤ team_weight P M := hM_max σ
      unfold team_weight at h1
      have h2 : (∑ i : Fin 3, P i (M i)) = 3 / 2 := by
        rw [Fin.sum_univ_three]
        rw [hM_half 0, hM_half 1, hM_half 2]
        norm_num
      have h_sum : P 0 (σ 0) + P 1 (σ 1) + P 2 (σ 2) ≤ 3 / 2 := by
        rw [Fin.sum_univ_three] at h1
        linarith
  6. The team win probability team_winProb P σ equals P 0 (σ 0) * P 1 (σ 1) + P 0 (σ 0) * P 2 (σ 2) + P 1 (σ 1) * P 2 (σ 2) - 2 * P 0 (σ 0) * P 1 (σ 1) * P 2 (σ 2).

    Winning a majority out of 3 matches requires at least 3 / 2 + 1 = 2 wins. Unfolding team_winProb, applying fair_max_weight_lineup_majority_probability_three_ofFn to convert the matchup probabilities into an explicit list, and evaluating the tail recursion team_tail yields the exact probability of winning at least 2 matches.

    lines 62–69

    uses fair_max_weight_lineup_majority_probability_three_ofFn

      have h_tail : team_winProb P σ =
          P 0 (σ 0) * P 1 (σ 1) + P 0 (σ 0) * P 2 (σ 2) + P 1 (σ 1) * P 2 (σ 2) -
          2 * P 0 (σ 0) * P 1 (σ 1) * P 2 (σ 2) := by
        unfold team_winProb
        change team_tail (List.ofFn fun i => P i (σ i)) 2 = _
        rw [fair_max_weight_lineup_majority_probability_three_ofFn]
        dsimp [team_tail]
        ring
  7. team_winProb P σ ≤ 9/16

    Rewriting the win probability as the elementary symmetric expression in the three matchup probabilities, the upper bound 9/16 follows directly from the symmetric inequality fair_max_weight_lineup_majority_probability_three_symm, since all three probabilities are non-negative and their sum is at most 3/2.

    lines 70–73

    uses fair_max_weight_lineup_majority_probability_three_symm

      rw [h_tail]
      exact fair_max_weight_lineup_majority_probability_three_symm
        (P 0 (σ 0)) (P 1 (σ 1)) (P 2 (σ 2))
        (hP 0 (σ 0)).1 (hP 1 (σ 1)).1 (hP 2 (σ 2)).1 h_sum
List.ofFn_succ
For a function f on n + 1 elements, List.ofFn f evaluates to f 0 followed by List.ofFn on the remaining elements.
mul_nonneg
If a ≥ 0 and b ≥ 0, then a * b ≥ 0.
fair_max_weight_lineup_majority_probability_three_aux
For non-negative real numbers a, b, c with a + b + c ≤ 3/2 and c ≤ 1/2, the polynomial ab + ac + bc - 2abc is at most 9/16.
Fin.sum_univ_three
The sum of a function f over Fin 3 equals f 0 + f 1 + f 2.
fair_max_weight_lineup_majority_probability_three_ofFn
For any function f on Fin 3, List.ofFn f equals the list [f 0, f 1, f 2].
fair_max_weight_lineup_majority_probability_three_symm
For any non-negative real numbers q0, q1, q2 with sum at most 3/2, the polynomial q0*q1 + q0*q2 + q1*q2 - 2*q0*q1*q2 is at most 9/16.

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

lemma fair_max_weight_lineup_majority_probability_three_ofFn {α : Type*} (f : Fin 3 → α) :    List.ofFn f = [f 0, f 1, f 2] := by  simp [List.ofFn_succ]lemma fair_max_weight_lineup_majority_probability_three_aux (a b c : ℝ)    (ha : 0 ≤ a) (hb : 0 ≤ b) (hc : 0 ≤ c)    (h_sum : a + b + c ≤ 3 / 2) (hc_half : c ≤ 1 / 2) :    a * b + a * c + b * c - 2 * a * b * c ≤ 9 / 16 := by  have h_id : 9 / 16 - (a * b + a * c + b * c - 2 * a * b * c) =      c * (4 * c ^ 2 + 3 * (1 - 2 * c)) / 8 +      (3 / 2 - c - (a + b)) * ((3 / 2 - c + (a + b)) / 4 * (1 - 2 * c) + c) +      ((a - b) ^ 2 / 4) * (1 - 2 * c) := by ring  have h_c1 : 0 ≤ 1 - 2 * c := by linarith  have h_t1 : 0 ≤ c * (4 * c ^ 2 + 3 * (1 - 2 * c)) / 8 := by    have : 0 ≤ 4 * c ^ 2 + 3 * (1 - 2 * c) := by positivity    positivity  have h_t2 : 0 ≤ (3 / 2 - c - (a + b)) * ((3 / 2 - c + (a + b)) / 4 * (1 - 2 * c) + c) := by    have h1 : 0 ≤ 3 / 2 - c - (a + b) := by linarith    have h2 : 0 ≤ (3 / 2 - c + (a + b)) / 4 * (1 - 2 * c) + c := by      have : 0 ≤ 3 / 2 - c + (a + b) := by linarith      positivity    exact mul_nonneg h1 h2  have h_t3 : 0 ≤ ((a - b) ^ 2 / 4) * (1 - 2 * c) := by positivity  linarithlemma fair_max_weight_lineup_majority_probability_three_symm (q0 q1 q2 : ℝ)    (h0 : 0 ≤ q0) (h1 : 0 ≤ q1) (h2 : 0 ≤ q2)    (hsum : q0 + q1 + q2 ≤ 3 / 2) :    q0 * q1 + q0 * q2 + q1 * q2 - 2 * q0 * q1 * q2 ≤ 9 / 16 := by  by_cases hc : q2 ≤ 1 / 2  · exact fair_max_weight_lineup_majority_probability_three_aux q0 q1 q2 h0 h1 h2 hsum hc  · by_cases hb : q1 ≤ 1 / 2    · have h_symm : q0 * q1 + q0 * q2 + q1 * q2 - 2 * q0 * q1 * q2 =          q0 * q2 + q0 * q1 + q2 * q1 - 2 * q0 * q2 * q1 := by ring      rw [h_symm]      have hsum' : q0 + q2 + q1 ≤ 3 / 2 := by linarith      exact fair_max_weight_lineup_majority_probability_three_aux q0 q2 q1 h0 h2 h1 hsum' hb    · by_cases ha : q0 ≤ 1 / 2      · have h_symm : q0 * q1 + q0 * q2 + q1 * q2 - 2 * q0 * q1 * q2 =            q1 * q2 + q1 * q0 + q2 * q0 - 2 * q1 * q2 * q0 := by ring        rw [h_symm]        have hsum' : q1 + q2 + q0 ≤ 3 / 2 := by linarith        exact fair_max_weight_lineup_majority_probability_three_aux q1 q2 q0 h1 h2 h0 hsum' ha      · linarith/-- The 9/16 lineup upper bound holds for the smallest open instance size n = 3. -/theorem fair_max_weight_lineup_majority_probability_three    (P : Fin 3 → Fin 3 → ℝ) (hP : ∀ i j, 0 ≤ P i j ∧ P i j ≤ 1)    (M : Equiv.Perm (Fin 3)) (hM_max : team_isMaxWeight P M)    (hM_half : ∀ i, P i (M i) = 1 / 2)    (σ : Equiv.Perm (Fin 3)) :    team_winProb P σ ≤ 9 / 16 := by  have h1 : team_weight P σ ≤ team_weight P M := hM_max σ  unfold team_weight at h1  have h2 : (∑ i : Fin 3, P i (M i)) = 3 / 2 := by    rw [Fin.sum_univ_three]    rw [hM_half 0, hM_half 1, hM_half 2]    norm_num  have h_sum : P 0 (σ 0) + P 1 (σ 1) + P 2 (σ 2) ≤ 3 / 2 := by    rw [Fin.sum_univ_three] at h1    linarith  have h_tail : team_winProb P σ =      P 0 (σ 0) * P 1 (σ 1) + P 0 (σ 0) * P 2 (σ 2) + P 1 (σ 1) * P 2 (σ 2) -      2 * P 0 (σ 0) * P 1 (σ 1) * P 2 (σ 2) := by    unfold team_winProb    change team_tail (List.ofFn fun i => P i (σ i)) 2 = _    rw [fair_max_weight_lineup_majority_probability_three_ofFn]    dsimp [team_tail]    ring  rw [h_tail]  exact fair_max_weight_lineup_majority_probability_three_symm    (P 0 (σ 0)) (P 1 (σ 1)) (P 2 (σ 2))    (hP 0 (σ 0)).1 (hP 1 (σ 1)).1 (hP 2 (σ 2)).1 h_sum
See it in the graphDiscuss this resultChallenge it