AFTD Auto-Formalizing Theoretical Domains

four_point_intersections_with_low_overlap_bound_family

theoremverified

Let F be a finite family of sets of at most six elements, each two of which meet in exactly four elements. Suppose every element of any pairwise intersection belongs to at most one further member of F. Then F has at most four members.

Statement

theorem four_point_intersections_with_low_overlap_bound_family : ∀ {I V : Type*} [DecidableEq I] [DecidableEq V] (F : Finset I) (Q : I → Finset V),
    (∀ i ∈ F, (Q i).card ≤ 6) →
    (∀ i ∈ F, ∀ j ∈ F, i ≠ j → (Q i ∩ Q j).card = 4) →
    (∀ i ∈ F, ∀ j ∈ F, i ≠ j → ∀ q ∈ Q i ∩ Q j,
      (((F.erase i).erase j).filter (fun l => q ∈ Q l)).card ≤ 1) →
    F.card ≤ 4
Source
d=9 pair-intersection degree budget in the OP-1957 crossing-cut campaign.
Verified
20 Nov 2026
Axioms
Classical.choiceQuot.soundpropext

The proof, explained

The proof uses double counting on the incidences between the remaining sets and a fixed intersection of two sets. Assuming $|F| > 1$, we choose distinct $i, j \in F$ and set $R = Q(i) \cap Q(j)$, which has size 4. For every other index $l \in T = F \setminus \{i, j\}$, inclusion-exclusion inside $Q(i)$ forces $|R \cap Q(l)| \ge 2$, giving a total incidence of at least $2|T|$. On the other hand, each point of $R$ belongs to at most one other set, bounding the total incidence from above by $|R| = 4$. Comparing $2|T| \le 4$ gives $|T| \le 2$, whence $|F| = |T| + 2 \le 4$.

  1. If $|F| \le 1$, then $|F| \le 4$ holds trivially.

    Introduce the family of sets $F$, the indexing map $Q$, and the three assumptions: sets have size at most 6 (`hsize`), distinct sets meet in 4 elements (`hpair`), and points in pairwise intersections belong to at most one other set (`hload`). If $|F| \le 1$, the conclusion $|F| \le 4$ is immediate by linear arithmetic.

    lines 7–10

      intro I V instI instV F Q hsize hpair hload
      classical
      by_cases hsmall : F.card ≤ 1
      · omega
  2. There exist distinct indices $i, j \in F$ such that their intersection $R = Q(i) \cap Q(j)$ has cardinality 4, and the remaining index set $T = (F \setminus \{i\}) \setminus \{j\}$ satisfies $|T| + 2 = |F|$.

    Assuming $|F| > 1$, we pick distinct $i, j \in F$ via `Finset.one_lt_card.mp`. Set $R = Q(i) \cap Q(j)$ and $T = (F \setminus \{i\}) \setminus \{j\}$. By the pairwise intersection hypothesis (`hpair`), $|R| = 4$. Removing the two distinct elements $i$ and $j$ from $F$ one by one via `Finset.card_erase_of_mem` and `Finset.mem_erase.mpr` shows that $|T| = |F| - 2$, so $|T| + 2 = |F|$.

    lines 11–19

    uses Finset.one_lt_card.mp, Finset.mem_erase.mpr, Finset.card_erase_of_mem

      obtain ⟨i, hi, j, hj, hij⟩ := Finset.one_lt_card.mp (by omega : 1 < F.card)
      let R := Q i ∩ Q j
      let T := (F.erase i).erase j
      have hR : R.card = 4 := hpair i hi j hj hij
      have hj' : j ∈ F.erase i := Finset.mem_erase.mpr ⟨hij.symm, hj⟩
      have hT : T.card + 2 = F.card := by
        dsimp [T]
        rw [Finset.card_erase_of_mem hj', Finset.card_erase_of_mem hi]
        omega
  3. Every index $l \in T$ belongs to $F$ and is distinct from both $i$ and $j$.

    Unfolding the definition of $T$ using `Finset.mem_erase` shows that any $l \in T$ satisfies $l \in F$, $l \ne i$, and $l \ne j$.

    lines 20–23

    uses Finset.mem_erase

      have hother : ∀ l ∈ T, l ∈ F ∧ l ≠ i ∧ l ≠ j := by
        intro l hl
        simp only [T, Finset.mem_erase] at hl
        exact ⟨hl.2.2, hl.2.1, hl.1⟩
  4. For every index $l \in T$, the intersection $R \cap Q(l)$ has cardinality at least 2.

    For any $l \in T$, both $Q(i) \cap Q(j)$ and $Q(i) \cap Q(l)$ are 4-element subsets of $Q(i)$ by `hpair`. By inclusion-exclusion (`Finset.card_inter_add_card_union`), the size of their intersection plus the size of their union is $4 + 4 = 8$. Their intersection is $(Q(i) \cap Q(j)) \cap (Q(i) \cap Q(l)) = R \cap Q(l)$, and their union is a subset of $Q(i)$ (verified via `Finset.card_le_card`, `Finset.mem_union.mp`, and `Finset.mem_inter.mp`), so its cardinality is at most $|Q(i)| \le 6$ by `hsize`. Thus $|R \cap Q(l)| \ge 8 - 6 = 2$.

    lines 24–40

    uses Finset.card_inter_add_card_union, Finset.card_le_card, Finset.mem_union.mp, Finset.mem_inter.mp

      have htwo : ∀ l ∈ T, 2 ≤ (R ∩ Q l).card := by
        intro l hl
        obtain ⟨hlF, hli, hlj⟩ := hother l hl
        have hil : i ≠ l := hli.symm
        have hcard := Finset.card_inter_add_card_union (Q i ∩ Q j) (Q i ∩ Q l)
        have hunion : ((Q i ∩ Q j) ∪ (Q i ∩ Q l)).card ≤ (Q i).card := by
          apply Finset.card_le_card
          intro x hx
          rcases Finset.mem_union.mp hx with hx | hx
          · exact (Finset.mem_inter.mp hx).1
          · exact (Finset.mem_inter.mp hx).1
        have heq : (Q i ∩ Q j) ∩ (Q i ∩ Q l) = R ∩ Q l := by
          ext x
          simp [R] <;> tauto
        rw [heq, hpair i hi j hj hij, hpair i hi l hlF hil] at hcard
        have hqi := hsize i hi
        omega
  5. The total incidence sum $\sum_{l \in T} |R \cap Q(l)|$ equals $\sum_{q \in R} |\{l \in T : q \in Q(l)\}|$.

    Writing each cardinality $|R \cap Q(l)|$ as the sum of indicator variables $\sum_{q \in R} [q \in Q(l)]$ using `Finset.card_filter` and `Finset.sum_congr`, interchanging the summation order via `Finset.sum_comm`, and rewriting the inner sum back as the cardinality of $\{l \in T : q \in Q(l)\}$ yields the double counting identity.

    lines 41–54

    uses Finset.sum_congr, Finset.card_filter, Finset.sum_comm

      have hswap : (∑ l ∈ T, (R ∩ Q l).card) =
          ∑ q ∈ R, (T.filter (fun l => q ∈ Q l)).card := by
        calc
          (∑ l ∈ T, (R ∩ Q l).card) =
              ∑ l ∈ T, ∑ q ∈ R, if q ∈ Q l then 1 else 0 := by
                apply Finset.sum_congr rfl
                intro l hl
                rw [← Finset.card_filter]
                congr 1
          _ = ∑ q ∈ R, ∑ l ∈ T, if q ∈ Q l then 1 else 0 := Finset.sum_comm
          _ = ∑ q ∈ R, (T.filter (fun l => q ∈ Q l)).card := by
                apply Finset.sum_congr rfl
                intro q hq
                rw [Finset.card_filter]
  6. $2|T| \le \sum_{q \in R} |\{l \in T : q \in Q(l)\}|$.

    Since each $l \in T$ satisfies $|R \cap Q(l)| \ge 2$, summing this inequality over $T$ via `Finset.sum_le_sum` gives $2|T| \le \sum_{l \in T} |R \cap Q(l)|$. Rewriting with the double counting identity `hswap` gives the lower bound $2|T| \le \sum_{q \in R} |\{l \in T : q \in Q(l)\}|$.

    lines 55–57

    uses Finset.sum_le_sum

      have hlower := Finset.sum_le_sum htwo
      have hconstant : (∑ l ∈ T, (2 : ℕ)) = T.card * 2 := by simp
      rw [hconstant, hswap] at hlower
  7. $\sum_{q \in R} |\{l \in T : q \in Q(l)\}| \le 4$.

    By the low overlap hypothesis (`hload`), each element $q \in R = Q(i) \cap Q(j)$ belongs to at most 1 set $Q(l)$ with $l \in T$. Summing this over all $q \in R$ via `Finset.sum_le_sum` yields $\sum_{q \in R} |\{l \in T : q \in Q(l)\}| \le \sum_{q \in R} 1 = |R| = 4$.

    lines 58–63

    uses Finset.sum_le_sum

      have hupper : (∑ q ∈ R, (T.filter (fun l => q ∈ Q l)).card) ≤ ∑ q ∈ R, (1 : ℕ) := by
        apply Finset.sum_le_sum
        intro q hq
        exact hload i hi j hj hij q hq
      have hconstant' : (∑ q ∈ R, (1 : ℕ)) = R.card := by simp
      rw [hconstant', hR] at hupper
  8. The family $F$ has cardinality at most 4.

    Chaining the lower and upper bounds gives $2|T| \le 4$, which implies $|T| \le 2$. Since $|F| = |T| + 2$, linear arithmetic concludes that $|F| \le 4$.

    line 64

      omega
Finset.one_lt_card.mp
A finite set has cardinality greater than 1 if and only if it contains at least two distinct elements (forward implication).
Finset.mem_erase.mpr
An element $a$ belongs to $s \setminus \{b\}$ if $a \ne b$ and $a \in s$.
Finset.card_erase_of_mem
Removing an element $a$ from a finite set $s$ decreases its cardinality by 1, provided $a \in s$.
Finset.mem_erase
An element $a$ belongs to $s \setminus \{b\}$ if and only if $a \ne b$ and $a \in s$.
Finset.card_inter_add_card_union
For any two finite sets $s$ and $t$, $|s \cap t| + |s \cup t| = |s| + |t|$.
Finset.card_le_card
If $s \subseteq t$ for finite sets $s$ and $t$, then $|s| \le |t|$.
Finset.mem_union.mp
An element belongs to $s \cup t$ only if it belongs to $s$ or to $t$.
Finset.mem_inter.mp
An element belongs to $s \cap t$ only if it belongs to both $s$ and $t$.
Finset.sum_congr
Two finite sums are equal if their index sets are equal and their summands agree on all elements.
Finset.card_filter
The cardinality of the subset $\{x \in s : p(x)\}$ equals the sum over $x \in s$ of the indicator function of $p$.
Finset.sum_comm
The order of summation in a double sum over finite sets can be interchanged.
Finset.sum_le_sum
If $f(x) \le g(x)$ for all $x \in s$, then $\sum_{x \in s} f(x) \le \sum_{x \in s} g(x)$.

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

theorem four_point_intersections_with_low_overlap_bound_family : ∀ {I V : Type*} [DecidableEq I] [DecidableEq V] (F : Finset I) (Q : I → Finset V),    (∀ i ∈ F, (Q i).card ≤ 6) →    (∀ i ∈ F, ∀ j ∈ F, i ≠ j → (Q i ∩ Q j).card = 4) →    (∀ i ∈ F, ∀ j ∈ F, i ≠ j → ∀ q ∈ Q i ∩ Q j,      (((F.erase i).erase j).filter (fun l => q ∈ Q l)).card ≤ 1) →    F.card ≤ 4 := by  intro I V instI instV F Q hsize hpair hload  classical  by_cases hsmall : F.card ≤ 1  · omega  obtain ⟨i, hi, j, hj, hij⟩ := Finset.one_lt_card.mp (by omega : 1 < F.card)  let R := Q i ∩ Q j  let T := (F.erase i).erase j  have hR : R.card = 4 := hpair i hi j hj hij  have hj' : j ∈ F.erase i := Finset.mem_erase.mpr ⟨hij.symm, hj⟩  have hT : T.card + 2 = F.card := by    dsimp [T]    rw [Finset.card_erase_of_mem hj', Finset.card_erase_of_mem hi]    omega  have hother : ∀ l ∈ T, l ∈ F ∧ l ≠ i ∧ l ≠ j := by    intro l hl    simp only [T, Finset.mem_erase] at hl    exact ⟨hl.2.2, hl.2.1, hl.1⟩  have htwo : ∀ l ∈ T, 2 ≤ (R ∩ Q l).card := by    intro l hl    obtain ⟨hlF, hli, hlj⟩ := hother l hl    have hil : i ≠ l := hli.symm    have hcard := Finset.card_inter_add_card_union (Q i ∩ Q j) (Q i ∩ Q l)    have hunion : ((Q i ∩ Q j) ∪ (Q i ∩ Q l)).card ≤ (Q i).card := by      apply Finset.card_le_card      intro x hx      rcases Finset.mem_union.mp hx with hx | hx      · exact (Finset.mem_inter.mp hx).1      · exact (Finset.mem_inter.mp hx).1    have heq : (Q i ∩ Q j) ∩ (Q i ∩ Q l) = R ∩ Q l := by      ext x      simp [R] <;> tauto    rw [heq, hpair i hi j hj hij, hpair i hi l hlF hil] at hcard    have hqi := hsize i hi    omega  have hswap : (∑ l ∈ T, (R ∩ Q l).card) =      ∑ q ∈ R, (T.filter (fun l => q ∈ Q l)).card := by    calc      (∑ l ∈ T, (R ∩ Q l).card) =          ∑ l ∈ T, ∑ q ∈ R, if q ∈ Q l then 1 else 0 := by            apply Finset.sum_congr rfl            intro l hl            rw [← Finset.card_filter]            congr 1      _ = ∑ q ∈ R, ∑ l ∈ T, if q ∈ Q l then 1 else 0 := Finset.sum_comm      _ = ∑ q ∈ R, (T.filter (fun l => q ∈ Q l)).card := by            apply Finset.sum_congr rfl            intro q hq            rw [Finset.card_filter]  have hlower := Finset.sum_le_sum htwo  have hconstant : (∑ l ∈ T, (2 : ℕ)) = T.card * 2 := by simp  rw [hconstant, hswap] at hlower  have hupper : (∑ q ∈ R, (T.filter (fun l => q ∈ Q l)).card) ≤ ∑ q ∈ R, (1 : ℕ) := by    apply Finset.sum_le_sum    intro q hq    exact hload i hi j hj hij q hq  have hconstant' : (∑ q ∈ R, (1 : ℕ)) = R.card := by simp  rw [hconstant', hR] at hupper  omega
See it in the graphDiscuss this resultChallenge it