op869_incidence_degree_count
For a finite incidence relation in which each element of A is incident with at least d elements of B, and 1 ≤ r ≤ |A|, the incidence count |A|d is at most |B|(r−1) plus (|A|−(r−1)) times the number of elements of B incident with at least r elements of A.
Statement
theorem op869_incidence_degree_count {α β : Type} [DecidableEq α] [DecidableEq β] (A : Finset α) (B : Finset β) (R : α → β → Prop) [DecidableRel R] (d r : ℕ) : 1 ≤ r → r ≤ A.card → (∀ a ∈ A, d ≤ (B.filter (R a)).card) → A.card * d ≤ B.card * (r - 1) + (A.card - (r - 1)) * (B.filter (fun b => r ≤ (A.filter (fun a => R a b)).card)).card
- Source
- arXiv:2610.41516, Lemma 2.2; double-counting step toward the three-colorable adversary construction.
- Verified
- 18 Nov 2026
- Axioms
Classical.choiceQuot.soundpropext- Built on 1
- op869_double_countDouble counting in a bipartite incidence: if every element x of A meets at least d elements of B, then for i ≤ |A|, |A|·d ≤ |B|·(i-1) +…
- Used by 1
- op869_repeated_color_incidenceSuppose there are KqD copies and fewer than K colors, and every copy contains at least q colors. If 1 ≤ q ≤ K and D ≥ 1, at least q colors…
The proof, explained
The theorem is proven by reducing the incidence relation to an abstract family of subsets and invoking a double-counting lemma (op869_double_count). For each element a ∈ A, its neighborhood in B is represented by the subset E(a) = {b ∈ B | R a b}. Applying the double-counting lemma bounds the incidence count |A|d in terms of |B|(r - 1) and the number of elements of B incident to at least r elements of A, after which a natural number arithmetic simplification completes the argument.
Define the neighborhood family E(a) = {b ∈ B | R a b} for each a ∈ A; then each E(a) ⊆ B and |E(a)| ≥ d.
We introduce the hypotheses 1 ≤ r, r ≤ |A|, and the degree condition ∀ a ∈ A, d ≤ |{b ∈ B | R a b}|. We define E(a) to be the set of elements of B related to a. By definition of filtering (Finset.mem_filter.mp), every element of E(a) belongs to B, establishing E(a) ⊆ B.
uses
Finset.mem_filter.mpintro hr hrA hd let E : α → Finset β := fun a => B.filter (R a) have hE : ∀ a ∈ A, E a ⊆ B := by intro a ha b hb exact (Finset.mem_filter.mp hb).1
The set of elements in B belonging to at least r sets E(a) coincides with the set of elements in B incident to at least r elements of A under R.
By Finset.filter_congr, two filtered subsets of B are equal if their filtering conditions are equivalent for every b ∈ B. For any fixed b ∈ B, the fiber {a ∈ A | b ∈ E(a)} equals {a ∈ A | R a b} by extensionality, since b ∈ E(a) means b ∈ B ∧ R a b, which simplifies to R a b using b ∈ B. Rewriting by this fiber equality equates the two filtering conditions.
uses
Finset.filter_congrhave hcard : (B.filter (fun b => r ≤ (A.filter (fun a => b ∈ E a)).card)) = B.filter (fun b => r ≤ (A.filter (fun a => R a b)).card) := by apply Finset.filter_congr intro b hb have heq : (A.filter (fun a => b ∈ E a)) = A.filter (fun a => R a b) := by ext a simp [E, hb] rw [heq]
|A| · d ≤ |B|(r - 1) + (|A| - r + 1) · |{b ∈ B | r ≤ |{a ∈ A | R a b}|}|
We apply the double-counting lemma op869_double_count with sets A and B and family E, using the verified conditions E(a) ⊆ B, |E(a)| ≥ d, and r ≤ |A|. We then rewrite the count of elements with degree at least r using the set equality proved in the previous step.
uses
op869_double_counthave h := op869_double_count A B E d r hE hd hrA rw [hcard] at h
|A| · d ≤ |B|(r - 1) + (|A| - (r - 1)) · |{b ∈ B | r ≤ |{a ∈ A | R a b}|}|
Since 1 ≤ r ≤ |A|, linear natural number arithmetic shows |A| - r + 1 = |A| - (r - 1) (dispatched by omega). Rewriting this identity into the inequality established by double-counting completes the proof.
have harith : A.card - r + 1 = A.card - (r - 1) := by omega rwa [harith] at h
Finset.mem_filter.mp- If an element belongs to a filtered set {x ∈ s | p x}, then it belongs to s (and satisfies p).
Finset.filter_congr- If two predicates agree on every element of a finite set s, then filtering s by either predicate yields the same subset.
op869_double_count- For finite sets A and B, a family of subsets E(x) ⊆ B with |E(x)| ≥ d for all x ∈ A, and i ≤ |A|, the total size |A|d is at most |B|(i - 1) plus (|A| - i + 1) times the number of elements of B belonging to at least i sets E(x).
- In step 4, the identity |A| - r + 1 = |A| - (r - 1) involves natural number subtraction; it is valid because 1 ≤ r ≤ |A| and is proved by the omega tactic.
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
Choose a tactic — a marked line — to see the goals Lean had before and after it, as in Lean’s infoview. Step with ← → or j k.
theorem op869_incidence_degree_count {α β : Type} [DecidableEq α] [DecidableEq β] (A : Finset α) (B : Finset β) (R : α → β → Prop) [DecidableRel R] (d r : ℕ) : 1 ≤ r → r ≤ A.card → (∀ a ∈ A, d ≤ (B.filter (R a)).card) → A.card * d ≤ B.card * (r - 1) + (A.card - (r - 1)) * (B.filter (fun b => r ≤ (A.filter (fun a => R a b)).card)).card := by intro hr hrA hd let E : α → Finset β := fun a => B.filter (R a) have hE : ∀ a ∈ A, E a ⊆ B := by intro a ha b hb exact (Finset.mem_filter.mp hb).1 have hcard : (B.filter (fun b => r ≤ (A.filter (fun a => b ∈ E a)).card)) = B.filter (fun b => r ≤ (A.filter (fun a => R a b)).card) := by apply Finset.filter_congr intro b hb have heq : (A.filter (fun a => b ∈ E a)) = A.filter (fun a => R a b) := by ext a simp [E, hb] rw [heq] have h := op869_double_count A B E d r hE hd hrA rw [hcard] at h have harith : A.card - r + 1 = A.card - (r - 1) := by omega rwa [harith] at h