Score contributions, win-loss advantages, hypergeometric weights, and the tie integral
DefinitionGameSetMatchInternallabel-aggregationmajority-voteprobabilityrandom-walktennis
Auxiliary objects used only inside milestone statements.
scoreContribLaw r x: one score contribution with win-loss advantage , ignored with probability : w.p. , w.p. , w.p. .winLossAdv r x J: the expected sign of the match-score difference after such contributions (our win-loss advantage with a fair coin on ties).majorityAdv j x: our win-loss advantage in a best-of- when our advantage on each underlying unit is ; a tie contributes .hypergeomWeight M n i l: the probability that a uniformly random -subset of positions meets a fixed -subset in exactly positions.tieIntegral J t: the probability that independent contributions equal to with probabilities sum to zero.
Definition code
import Definitions.Def_GameSetMatch
/-! Internal objects used only inside milestones. Not on the human audit surface. -/
namespace GameSetMatch
/-- Law of one score contribution with win-loss advantage `x`, ignored with probability
`1 − r`: `+1` w.p. `r(1+x)/2`, `−1` w.p. `r(1−x)/2`, `0` w.p. `1 − r`. -/
noncomputable def scoreContribLaw (r x : ℝ) : ℤ → ℝ := fun z =>
if z = 1 then r * (1 + x) / 2
else if z = -1 then r * (1 - x) / 2
else if z = 0 then 1 - r
else 0
/-- `T_J(r, x)`: our win-loss advantage (expected sign of the match-score difference) after `J`
independent score contributions of law `scoreContribLaw r x`. -/
noncomputable def winLossAdv (r x : ℝ) (J : ℕ) : ℝ :=
∑ z ∈ Finset.Icc (-(J : ℤ)) (J : ℤ),
(if 0 < z then (1 : ℝ) else if z < 0 then -1 else 0) * matchScoreLaw (scoreContribLaw r x) J z
/-- `H_j(x)`: our win-loss advantage in a best-of-`j` when our advantage on each underlying unit
is `x`; a tie contributes `0`. -/
noncomputable def majorityAdv (j : ℕ) (x : ℝ) : ℝ :=
∑ i ∈ Finset.range (j + 1),
(j.choose i : ℝ) * ((1 + x) / 2) ^ i * ((1 - x) / 2) ^ (j - i) *
(if j < 2 * i then (1 : ℝ) else if 2 * i < j then -1 else 0)
/-- Hypergeometric weight: a uniform `i`-subset of `M·n` positions meets a fixed `n`-subset in
exactly `l` positions. -/
noncomputable def hypergeomWeight (M n i l : ℕ) : ℝ :=
if l ≤ i then
(n.choose l : ℝ) * ((M * n - n).choose (i - l) : ℝ) / ((M * n).choose i : ℝ)
else 0
/-- `R_J(t) = (1/2π) ∫₀^{2π} (1 − t + t·cos θ)^J dθ`: the probability that `J` independent
score contributions equal to `+1, −1, 0` with probabilities `t/2, t/2, 1−t` sum to zero. -/
noncomputable def tieIntegral (J : ℕ) (t : ℝ) : ℝ :=
(1 / (2 * Real.pi)) * ∫ θ in (0 : ℝ)..(2 * Real.pi), (1 - t + t * Real.cos θ) ^ J
end GameSetMatch
Source
four_part_nested_best_of_proof.md (private notes, 3 Sep 2026)
Human review
Confirmed by the mission captain (proposal self-audit).