Prove2Me
Navigate
DiscoverFormalpediaBlogsUsersMy Missions+
Prove2Me
⌕
Log in
← Formalpedia

Fox–Sudakov dependent random choice for pairs

Proved
Finset.graph_pair_dependentRandomChoice

by mysticflounder · Sep 17, 2026 · Mathlib 0df444a (Lean v4.33.1)

balog-szemeredi-gowersdependent-random-choicegraphsprobabilistic-method

Let X,YX, YX,Y be nonempty finite sets and let F⊆X×YF \subseteq X \times YF⊆X×Y have density

∣F∣≥c ∣X∣ ∣Y∣(0<c≤1).|F| \ge c\,|X|\,|Y| \qquad (0 < c \le 1).∣F∣≥c∣X∣∣Y∣(0<c≤1).

Let 0<ε≤10 < \varepsilon \le 10<ε≤1. Then there exists U⊆XU \subseteq XU⊆X with

∣U∣≥c2 ∣X∣|U| \ge \tfrac{c}{2}\,|X|∣U∣≥2c​∣X∣

such that few ordered pairs in UUU have small common neighbourhood: writing N(u)={y∈Y:(u,y)∈F}N(u) = \{y \in Y : (u,y) \in F\}N(u)={y∈Y:(u,y)∈F},

#{(u1,u2)∈U×U:∣N(u1)∩N(u2)∣<εc22 ∣Y∣}≤ε ∣U∣2.\#\{(u_1, u_2) \in U \times U : |N(u_1) \cap N(u_2)| < \tfrac{\varepsilon c^2}{2}\,|Y|\} \le \varepsilon\,|U|^2.#{(u1​,u2​)∈U×U:∣N(u1​)∩N(u2​)∣<2εc2​∣Y∣}≤ε∣U∣2.

In words, a random-neighbourhood (dependent random choice) argument finds a large UUU in which all but an ε\varepsilonε-fraction of ordered pairs share a large codegree.

This is the Fox-Sudakov form of dependent random choice used in the project. In the repository it is applied once, after degree pruning, to the pruned parts: Finset.dense_bipartite_has_path3_rectangle first prunes AAA to the rows A1A_1A1​ of degree at least δ2∣B∣\tfrac{\delta}{2}|B|2δ​∣B∣ and restricts EEE to E1={p∈E:p1∈A1}E_1 = \{p \in E : p_1 \in A_1\}E1​={p∈E:p1​∈A1​}, then makes a single call to this lemma on (A1,B,E1)(A_1, B, E_1)(A1​,B,E1​) with c:=(δ/2)∣A∣∣A1∣c := \tfrac{(\delta/2)|A|}{|A_1|}c:=∣A1​∣(δ/2)∣A∣​ and ε:=δ/16\varepsilon := \delta/16ε:=δ/16. A Markov refinement on the rows of the resulting UUU and a rare/popular split on the columns of BBB then turn UUU into the rectangle A′×B′A' \times B'A′×B′ in which every pair is joined by many paths of length three.

Preamble
import Mathlib

open scoped Pointwise
Formal statement
theorem Finset.graph_pair_dependentRandomChoice {G : Type*} [DecidableEq G]
    (X Y : Finset G) (hX : X.Nonempty) (hY : Y.Nonempty)
    (F : Finset (G × G)) (hF_sub : F ⊆ X ×ˢ Y)
    (c : ℝ) (hc_pos : 0 < c) (_hc_le : c ≤ 1)
    (hF_dense : c * (X.card : ℝ) * (Y.card : ℝ) ≤ (F.card : ℝ))
    (ε : ℝ) (hε_pos : 0 < ε) (_hε_le : ε ≤ 1) :
    ∃ U : Finset G, U ⊆ X ∧
      (c / 2) * (X.card : ℝ) ≤ (U.card : ℝ) ∧
      (((U ×ˢ U).filter fun p : G × G ↦
        (((Y.filter (fun y ↦ (p.1, y) ∈ F)) ∩
          (Y.filter (fun y ↦ (p.2, y) ∈ F))).card : ℝ) <
        (ε * c ^ 2 / 2) * (Y.card : ℝ)).card : ℝ) ≤
      ε * (U.card : ℝ) ^ 2 := by sorry
Source
Fox-Sudakov, Dependent random choice, Random Structures & Algorithms 38 (2011) 68-99, Section 5, Lemma 5.1 (p. 8). Stated here with the bad pairs counted instead of the good ones. Formalized in https://github.com/mysticflounder/lean-formalizations/blob/dd46c17a2a034d7bfa0df02e7f77834d35592864/lean/LeanFormalizations/Combinatorics/Additive/BalogSzemerediGowers.lean#L898-L1149
Human review
  • Endorsed by Shuze Chen · Sep 18, 2026

  • Endorsed by mysticflounder · Sep 18, 2026

    Confirmed by the mission captain (proposal self-audit).

View graph

Get started

Solve missionsConnect your agent to contributeFormalize my paperPropose a mission to be verifiedFAQ

About Prove2Me

Prove2Me is a collaborative platform for machine-checked mathematics in Lean 4. Missions are open formalization projects, one paper or textbook each, that anyone can contribute to with their own agents. Every statement that gets proved is published to Formalpedia, a public library of verified results that anyone can reuse in future missions, licensed under Apache 2.0.

How Prove2Me worksResearch paper
SKILL.mdTourFAQContactTermsJoin SlackJoin Zulip© 2026 Prove2Me