Erdős Matching Conjecture, s = 2 (Erdős #1020): Unconditional D(5) = 2,366, All-r Bounds, and a Conjecture H Refutation

AI-generated · No human mathematician has yet refereed the proof.

Erdős asked how many r-point sets can be picked from n points so that among any three, two share a point. Lean proves the predicted answer for r ≤ 5 when n ≥ 3r − 1, and for r = 5 and n ≥ 16 only the 2-stars reach it.

For 1 ≤ r ≤ 5 and every n ≥ 3r − 1, every family of r-sets of n points with no three disjoint members has at most max{C(3r − 1, r), C(n, r) − C(n − 2, r)} members, a number that some such family reaches; and for r = 5 and n ≥ 16, a family of 5-sets with no three disjoint members has C(n, 5) − C(n − 2, 5) members exactly when it is a 2-star, all 5-sets that contain at least one of two fixed points.

Erdős (1965) asked how large a family of r-sets can be if it has no s + 1 members that are pairwise disjoint; this is Erdős Problem #1020. For s = 2 the Erdős Matching Conjecture predicts that, when n ≥ 3r − 1, no family is larger than the bigger of two: all r-sets inside 3r − 1 of the points, and all r-sets that contain at least one of two fixed points. The case r = 2 goes back to Erdős and Gallai (1959) and the case r = 3 to Frankl (2017).

Certificates checked in Lean settle D(4) and D(5), giving the prediction for every r ≤ 5; counting bounds on 3r + 1 points, and a working guess that fails

Walkthrough: 14 of 14 main results in Lean

Lean assumes none of these. Each use is proved again inside the package, except Hall’s marriage theorem, which comes from Mathlib, Lean’s library of proved mathematics.

Published inputs

  • Frankl (2017) (Re-proved in Lean): Link induction, which turns the bounds D(1), …, D(K) on 3r + 1 points into the prediction for every r ≤ K and every n ≥ 3r − 1; the same paper proves the case r = 3. Lean proves the induction again.
  • Kleitman (1968) (not fully read) (Re-proved in Lean): Treated the problem for sets of mixed sizes; the paper names its count for r-sets on 3r points after him and gives that count directly, with the clique family reaching it. Lean proves it.
  • Katona (1972) (Re-proved in Lean): Ordering the points around a circle and counting arcs, used for Theorem 7.
  • Łuczak & Mieczkowska (2014) (Re-proved in Lean): The Kneser graph is connected through single-point swaps, used to lift uniqueness from shifted families to all families.
  • Raney (1960) (Re-proved in Lean): The cycle lemma, which counts the Raney sets on 3r + 1 points, used for the two weights.
  • Gale (1968) (not fully read) (Re-proved in Lean): The Gale order on r-sets; a shifted family is one closed downward in this order.
  • Bollobás, Daykin & Erdős (1976); Frankl & Kupavskii (2019) (Re-proved in Lean): Cited for the Hilton–Milner family, all r-sets that contain p, or contain q and meet a fixed r-set E₀ avoiding both, together with E₀; Frankl and Kupavskii establish its n − r − 2 count, as the paper puts it, and Lean proves its exact size again. Bollobás, Daykin and Erdős also gave one of the progressive bounds for large n.
  • Hall (1935) (Ported into Lean): The marriage theorem, used to show that a shifted family with no three disjoint members contains no Raney set.

What this paper adds

  • Counting bounds on 3r + 1 points, for every r: The Katona-cycle bound (Theorem 7); The Hilton–Milner gap (Theorem 8); The Hilton–Milner separation (Theorem 9); The slice bound (Theorem 12)
  • Certificates for r ≤ 5, and uniqueness: Every r ≤ 5 and every n ≥ 3r − 1 (Theorem 4); 5-sets on 14 or more points (Theorems 1 and 3); Only the 2-stars, for 5-sets on 16 or more points (Theorem 2); Only the 2-stars, for pairs and 3-sets (Theorems 5 and 6)
  • A working guess that fails, and weights above the 2-star: Conjecture H fails at j = 2 for every r ≥ 8 (Theorem 10); Conjecture H fails at j = 1 for every r ≥ 6 (Theorem 11); The Raney-star weight, r ≥ 4 (Theorem 13); The linear-ramp weight, r ≥ 7 (Theorem 14)

The prediction for every r ≤ 5 and n ≥ 3r − 1, and only the 2-stars for 5-sets from 16 points

For 1 ≤ r ≤ 5 and every n ≥ 3r − 1, a family of r-sets of n points with no three disjoint members has at most max{C(3r − 1, r), C(n, r) − C(n − 2, r)} members, so D(5) = 2,366; for 5-sets and n ≥ 16 the families of that size are exactly the 2-stars, as they are for pairs from 7 points and 3-sets from 10.

All 14 of 14 main results proved unconditionally in Lean; the 13 certificates are checked inside Lean, and no certificate outside Lean is used.

Listed as open in the paper

  • D(r) for every r ≥ 6 (Conjecture 15); Theorems 7 and 12 reduce it to shifted families with 2 ≤ J ≤ r − 3.
  • Whether every shifted family of r-sets on 3r + 1 points with no three disjoint members and J ≥ 2 has at most max{|A₃(3r + 1, r)|, |H(r, 2)|} members.
  • Nonlinear constraints that overcome the barriers of Theorems 13 and 14, or scaled certificates for r = 6 (2 ≤ J ≤ 3).

Adjacent prior work (not used as inputs)

  • Erdős (1965)
  • Erdős & Gallai (1959)
  • Erdős, Ko & Rado (1961)
  • Huang, Loh & Sudakov (2012); Frankl, Łuczak & Mieczkowska (2012)
  • Frankl (2013)
  • Frankl & Kupavskii (2022) (not fully read); Cao, Liu & Zhang (2026) (not fully read); Chi, Sun & Wang (2026) (not fully read)
  • Martin & Patkós (2025)
  • Hou, Hu & Liu (2026)
  • Babanskyy (2026)
  • Han, Liu & Wang (2026) (not fully read)

Pairs of points on 7 points

Take r = 2, so the sets are pairs of points, and n = 7, with points 0 to 6. Three disjoint pairs, no two sharing a point, use 6 different points.

The 10 pairs inside the points 0 to 4 have no three disjoint pairs, because 5 points are too few. The pairs that contain point 0 or point 1 are 6 + 6 − 1 = 11, all 21 pairs minus the 10 that avoid both. Among any three of them, two contain the same one of the points 0 and 1, so they share it. The second family is larger: 11 against 10.

The prediction is max{C(5, 2), C(7, 2) − C(5, 2)} = max{10, 11} = 11. Lean proves that no family of pairs on 7 points with no three disjoint pairs has more than 11 pairs, and that such a family with exactly 11 pairs is always the family of pairs that contain p or q, for some two points p and q. On 5 or 6 points the 10 pairs win instead, against 7 or 9.

The interactive page explains each key step in full.

Families with no three disjoint members

A family is a set of r-sets, and it has no three disjoint members when among any three members two share a point. Two families of this kind compete for the most members: all r-sets inside the points 0 to 3r − 2, and the 2-star of all r-sets that contain point 0 or point 1. For every r ≥ 1 and n ≥ 3r − 1, one of them has max{C(3r − 1, r), C(n, r) − C(n − 2, r)} members, which is the predicted largest size.

  • For r ≥ 1 and n ≥ 3r − 1, the predicted size is reached

Shifting, and the step from 3r + 1 points to every n

A shift replaces a point j of a member by a smaller point i, unless the result is already in the family, and it never creates three disjoint members. Repeated shifts give a shifted family of the same size, and Kleitman's count settles n = 3r. Frankl's induction then shows that if the bound D(j) holds on 3j + 1 points for every j up to K, the prediction holds for every r ≤ K and every n ≥ 3r − 1.

  • From the diagonal bounds to every n
  • A shift never creates three disjoint members
  • Every family can be shifted without loss
  • For s · r ≤ n, when s sets can be pushed down into s disjoint low sets
  • For r ≥ 1, on 3r points the answer is C(3r − 1, r)

Bounds on 3r + 1 points

Take a family F of r-sets on 3r + 1 points with no three disjoint members, with r ≥ 2, fix two points p and q, and sort the members by how many of p and q they contain. If the members avoiding both always share a point, counting arcs on all circular orders of the other points shows F is no larger than the 2-star; if some member avoids both, |F| is at most |A₁(3r + 1, r)| plus the number of such members minus C(2r − 1, r − 1). For r ≥ 5, if F is also shifted and has two disjoint members avoiding the points 0 to r − 3, it is smaller than the 2-star. For r ≥ 4 the Hilton-Milner family, all r-sets that contain p, or contain q and share a point with one fixed r-set E₀ avoiding both, together with E₀, is larger than the family H(r, 1) of the chapter on Conjecture H.

  • For r ≥ 2, on 3r + 1 points, if the members avoiding p and q always meet, |F| ≤ |A₁|

    Let r ≥ 2, let F be a family of r-sets of 3r + 1 points with no three disjoint members, and let p ≠ q be points. If every two members of F that contain neither p nor q share a point, then F has at most as many members as the 2-star A₁(3r + 1, r).

    theorem ErdosMatching5.theorem_K_unshifted {r : ℕ} (hr : 2 ≤ r) (F : Finset (Finset (Fin (3 * r + 1)))) (hU : IsUniform r F) (hN : NoThreeMatching F) (p : Fin (3 * r + 1)) (q : Fin (3 * r + 1)) (hpq : p ≠ q) (hpwi : ∀ E₁ ∈ F, ∀ E₂ ∈ F, p ∉ E₁ → q ∉ E₁ → p ∉ E₂ → q ∉ E₂ → ¬Disjoint E₁ E₂) :
      F.card ≤ (starTwoFamily (3 * r + 1) r).card
  • For r ≥ 2, on 3r + 1 points, if some member avoids p and q, |F| + C(2r − 1, r − 1) ≤ |A₁| + |F₀|

    Let r ≥ 2, let F be a family of r-sets of 3r + 1 points with no three disjoint members, let p ≠ q be points, and let F₀ be the members of F that contain neither p nor q. If F₀ has a member, then |F| + C(2r − 1, r − 1) ≤ |A₁(3r + 1, r)| + |F₀|.

    theorem ErdosMatching5.as6_hilton_milner_gap {r : ℕ} (hr : 2 ≤ r) (F : Finset (Finset (Fin (3 * r + 1)))) (hU : IsUniform r F) (hN : NoThreeMatching F) (p : Fin (3 * r + 1)) (q : Fin (3 * r + 1)) (hpq : p ≠ q) (havoid : {E ∈ F | p ∉ E ∧ q ∉ E}.Nonempty) :
      F.card + (2 * r - 1).choose (r - 1) ≤ (starTwoFamily (3 * r + 1) r).card + {E ∈ F | p ∉ E ∧ q ∉ E}.card
  • For r ≥ 5, on 3r + 1 points, a shifted F with no three disjoint members and two disjoint ones avoiding 0 to r − 3 has |F| < |A₁|

    Let r ≥ 5, and let F be a shifted family of r-sets of 3r + 1 points with no three disjoint members. If two disjoint members of F avoid the points 0 to r − 3, then F has fewer members than the 2-star A₁(3r + 1, r).

    theorem ErdosMatching5.as6_j_ge_r_sub_2_lt_starTwo {r : ℕ} (hr : 5 ≤ r) (F : Finset (Finset (Fin (3 * r + 1)))) (hSh : IsShifted F) (hU : IsUniform r F) (hN : NoThreeMatching F) (hJ : HasDisjointAvoiders (r - 2) F) :
      F.card < (starTwoFamily (3 * r + 1) r).card
  • For r ≥ 4, the Hilton-Milner family is larger than H(r, 1)

    Let r ≥ 4, let p ≠ q be points of 3r + 1 points, and let E₀ be an r-set containing neither p nor q. Then H(r, 1) has fewer members than the Hilton-Milner family HM(3r + 1, r; p, q, E₀).

    theorem ErdosMatching5.hiltonMilnerTwo_diag_gt_hybridH1 {r : ℕ} (hr : 4 ≤ r) {p : Fin (3 * r + 1)} {q : Fin (3 * r + 1)} (hpq : p ≠ q) {E₀ : Finset (Fin (3 * r + 1))} (hE₀ : E₀.card = r) (hp : p ∉ E₀) (hq : q ∉ E₀) :
      (hybridH r 1).card < (hiltonMilnerTwo (3 * r + 1) r p q E₀).card
  • The arc count on one circular order
  • The slice count
  • The size of the Hilton-Milner family

Certificates for r = 2 and 3, and a route through formulas

On 3r + 1 points, a shifted family is bounded by a weighted count on the points 0 to 3r − 1, and a list of whole-number weights on simple rules, checked by computation, then bounds every family of r-sets with no three disjoint members. Such certificates prove D(2) and D(3), so the prediction holds for r ≤ 3, and Kleitman's count gives 2,002 for 5-sets on 15 points. Lean also proves that D(4) and D(5) are each equivalent to a formula having no solution, and that a list of clauses accepted by a small checking program written in Lean, the RUP checker, shows a formula has none. No accepted list is supplied for these two formulas; once the next chapter proves D(4) and D(5), the formulas follow as having no solution, without the checker.

  • Sets of 5 points on 15 points, the largest size is 2,002

    Every family of 5-sets of 15 points with no three disjoint members has at most 2,002 members, and some such family has exactly 2,002.

    theorem ErdosMatching5.erdos_1020_r5_s2_n15 :
      (∀ (F : Finset (Finset (Fin 15))), IsUniform 5 F → NoThreeMatching F → F.card ≤ 2002) ∧
      ∃ F, IsUniform 5 F ∧ NoThreeMatching F ∧ F.card = 2002
  • For r ≥ 1, a shifted family is bounded by a weighted count on 3r points
  • An accepted board certificate bounds every family
  • D(2) holds
  • D(3) holds

Scaled certificates that prove D(4) and D(5)

A scaled certificate is a list of whole-number multiples of simple rules that every shifted family with no three disjoint members obeys, with a common scale and lists of sets forced in or out. Lean evaluates the check of a certificate, and proves that when it returns true, every such family that meets the certificate's conditions has at most the stated number of members. For D(4), a shifted family of 4-sets on 13 points either has no two disjoint members avoiding the points 0 and 1, and Theorem 7 bounds it by the 2-star, or one certificate bounds it by 384. For D(5) on 16 points, Theorem 7 covers the first case, Theorem 12 the case of two disjoint members avoiding the points 0 to 2, and eleven certificates with the bound 2,365 the case in between. With D(1) to D(5), Frankl's induction gives the prediction for every r ≤ 5 and every n ≥ 3r − 1.

  • Sets of 5 points on 14 or more points, the prediction holds

    For every n ≥ 14, every family of 5-sets of n points with no three disjoint members has at most max{2,002, C(n, 5) − C(n − 2, 5)} members, and some such family has exactly that many.

    theorem ErdosMatching5.UnconditionalR5.erdos_1020_r5_s2_all_n_unconditional {n : ℕ} (hn : 14 ≤ n) :
      (∀ (F : Finset (Finset (Fin n))),
        IsUniform 5 F → NoThreeMatching F → F.card ≤ max 2002 (n.choose 5 - (n - 2).choose 5)) ∧
      ∃ F, IsUniform 5 F ∧ NoThreeMatching F ∧ F.card = max 2002 (n.choose 5 - (n - 2).choose 5)
  • For 1 ≤ r ≤ 5 and n ≥ 3r − 1, the predicted bound holds

    Let 1 ≤ r ≤ 5 and n ≥ 3r − 1. Every family of r-sets of n points with no three disjoint members has at most max{C(3r − 1, r), C(n, r) − C(n − 2, r)} members.

    theorem ErdosMatching5.UnconditionalR5.erdos_1020_s2_r_le_5_all_n_unconditional {r : ℕ} {n : ℕ} (hr1 : 1 ≤ r) (hr5 : r ≤ 5) (hn : 3 * r - 1 ≤ n) (F : Finset (Finset (Fin n))) (hU : IsUniform r F) (hN : NoThreeMatching F) :
      F.card ≤ max ((3 * r - 1).choose r) (n.choose r - (n - 2).choose r)
  • A set with two disjoint avoiders below it is not a member
  • An accepted scaled certificate bounds every family it covers
  • Two disjoint avoiders of 0 and 1 packed into 2 to 2r + 1
  • Avoiders of 0 and 1 exclude every set at or above {0, 1, 2r + 2, …}
  • In a shifted family on 3r + 1 points, every r-set of the points 0 to 3r − 1 at or below a list that lies below a member is a member
  • 4-sets on 13 points with J ≥ 2: at most 384
  • D(4) holds, with no conditions
  • 5-sets on 16 points with J = 2: at most 2,365
  • D(5) holds, with no conditions

For r = 2, 3 and 5, on 3r + 1 or more points, only the 2-stars reach the largest size

For r ≥ 2 and n ≥ 3r, if one shift turns a family with no three disjoint members into a 2-star, the family was already a 2-star, so uniqueness among shifted families lifts to all families. Uniqueness on 3r + 1 points then passes to every larger n through Frankl's induction. The certificates for r = 2 and r = 3 give it on 7 and 10 points. On 16 points, a shifted family of 5-sets with 2,366 members is ruled out when two disjoint members avoid the points 0 and 1, by the bounds of the previous chapter. When some member avoids them but no two disjoint ones do, either every member has a point among 0, 1 and 2, and a bound proved for every r ≥ 2 makes the family smaller than the 2-star, or one more certificate bounds it by 2,365.

  • Sets of 5 points on 16 or more points, only 2-stars are largest

    Let n ≥ 16. A family of 5-sets of n points with no three disjoint members has exactly C(n, 5) − C(n − 2, 5) members if and only if it is a 2-star.

    theorem ErdosMatching5.UnconditionalR5.uniqueness_unshifted_starTwo_ge_16_5_unconditional {n : ℕ} (hn : 16 ≤ n) (F : Finset (Finset (Fin n))) (hU : IsUniform 5 F) (hN : NoThreeMatching F) :
      F.card = n.choose 5 - (n - 2).choose 5 ↔ IsStarTwo n 5 F
  • Pairs on 7 or more points, only the 2-stars reach the largest size

    Let n ≥ 7. A family of pairs of n points with no three disjoint members has exactly C(n, 2) − C(n − 2, 2) members if and only if it is a 2-star.

    theorem ErdosMatching5.uniqueness_unshifted_starTwo_ge_7_2 {n : ℕ} (hn : 7 ≤ n) (F : Finset (Finset (Fin n))) (hU : IsUniform 2 F) (hN : NoThreeMatching F) :
      F.card = n.choose 2 - (n - 2).choose 2 ↔ IsStarTwo n 2 F
  • Sets of 3 points on 10 or more points, only the 2-stars reach the largest size

    Let n ≥ 10. A family of 3-sets of n points with no three disjoint members has exactly C(n, 3) − C(n − 2, 3) members if and only if it is a 2-star.

    theorem ErdosMatching5.uniqueness_unshifted_starTwo_ge_10_3 {n : ℕ} (hn : 10 ≤ n) (F : Finset (Finset (Fin n))) (hU : IsUniform 3 F) (hN : NoThreeMatching F) :
      F.card = n.choose 3 - (n - 2).choose 3 ↔ IsStarTwo n 3 F
  • For r ≥ 2 and n ≥ 3r, a family with no three disjoint members that shifts into a 2-star is one
  • For r ≥ 2, uniqueness on 3r + 1 points gives uniqueness for every larger n
  • 5-sets on 16 points with J ≤ 1 and an avoider: below 2,366
  • On 16 points, only A₁(16, 5) is shifted with 2,366 members
  • Covered by 0, 1 and 2, with an avoider: below the 2-star

A guess that fails, and weights that beat the 2-star

J(F) is the largest j below r such that two disjoint members of F avoid the points 0 to j − 1. The paper's guess, Conjecture H, said a shifted family of r-sets on 3r + 1 points with no three disjoint members and J(F) ≥ j has at most |Aⱼ₊₁(3r + 1, r)| members. For 1 ≤ j ≤ r − 1 the family H(r, j), the union of two explicit families, is shifted, has no three disjoint members and has J = j, and for j = 2 and r ≥ 8, and for j = 1 and r ≥ 6, it is larger than Aⱼ₊₁(3r + 1, r). A weight gives each r-set of 3r + 1 points a number. The Raney-star weight is 1 on r-sets containing point 0, 0 on the Raney sets and 1/2 on the rest, and the linear-ramp weight grows with how many points an r-set has among the points 0 to 2r + 1. For r ≥ 3, each lies between 0 and 1, is 0 on the Raney sets, which no shifted family with no three disjoint members contains, never drops when an r-set is shifted down, gives at most 2 to any three disjoint r-sets and at most C(3r − 1, r) to the r-sets missing any one point. Yet the total of the Raney-star weight is more than the size of the 2-star for r ≥ 4, and that of the linear ramp for r ≥ 7.

  • Conjecture H fails at j = 2 for every r ≥ 8

    Let r ≥ 8. The family H(r, 2) on 3r + 1 points is shifted, consists of r-sets, has no three disjoint members and has J = 2, and |A₃(3r + 1, r)| < |H(r, 2)| < |A₂(3r + 1, r)| and |H(r, 2)| < |A₁(3r + 1, r)|.

    theorem ErdosMatching5.refutation_conjecture_H_ge_8 {r : ℕ} (hr : 8 ≤ r) :
      IsShifted (hybridH r 2) ∧
      IsUniform r (hybridH r 2) ∧
        NoThreeMatching (hybridH r 2) ∧
          jInvariant r (hybridH r 2) = 2 ∧
            (franklA (3 * r + 1) r 3).card < (hybridH r 2).card ∧
              (hybridH r 2).card < (franklA (3 * r + 1) r 2).card ∧ (hybridH r 2).card < (starTwoFamily (3 * r + 1) r).card
  • Conjecture H fails at j = 1 for every r ≥ 6

    Let r ≥ 6. The family H(r, 1) on 3r + 1 points is shifted, consists of r-sets, has no three disjoint members and has J = 1, and |A₂(3r + 1, r)| < |H(r, 1)| < |A₁(3r + 1, r)|.

    theorem ErdosMatching5.refutation_conjecture_H_j1_ge_6 {r : ℕ} (hr : 6 ≤ r) :
      IsShifted (hybridH r 1) ∧
      IsUniform r (hybridH r 1) ∧
        NoThreeMatching (hybridH r 1) ∧
          jInvariant r (hybridH r 1) = 1 ∧
            (franklA (3 * r + 1) r 2).card < (hybridH r 1).card ∧ (hybridH r 1).card < (starTwoFamily (3 * r + 1) r).card
  • The size of H(r, j)
  • For r ≥ 4, the Raney-star weight totals more than the 2-star

    Let r ≥ 4. The Raney-star weights of all r-sets of 3r + 1 points add up to more than |A₁(3r + 1, r)|.

    theorem ErdosMatching5.raneyStarWeight_gt_starTwo {r : ℕ} (hr : 4 ≤ r) :
      ↑(starTwoFamily (3 * r + 1) r).card < ∑ E ∈ Finset.powersetCard r Finset.univ, raneyStarWeight r E
  • For r ≥ 7, the linear-ramp weight totals more than the 2-star

    Let r ≥ 7. The linear-ramp weights of all r-sets of 3r + 1 points add up to more than |A₁(3r + 1, r)|.

    theorem ErdosMatching5.linearRampWeight_gt_starTwo {r : ℕ} (hr : 7 ≤ r) :
      ↑(starTwoFamily (3 * r + 1) r).card < ∑ E ∈ Finset.powersetCard r Finset.univ, linearRampWeight r E
  • The number of Raney sets
  • The total Raney-star weight
  • A lower bound on how much the linear ramp exceeds the 2-star
Short

Watch on YouTube ↗