op874_four_two_incidence_count
In a four-by-two incidence system, the total number of incidences of any finite set of right vertices is twice its cardinality.
Statement
theorem op874_four_two_incidence_count {L E : Type*} [Fintype L] [Fintype E] [DecidableEq L] [DecidableEq E] (inc : L → E → Prop) [DecidableRel inc] (hright : ∀ e, (univ.filter fun l => inc l e).card = 2) (X : Finset E) : (∑ l : L, (X.filter fun e => inc l e).card) = 2 * X.card
- Source
- Incidence and matching reduction for OP-874, https://arxiv.org/abs/2610.41950, Section 2.
- Verified
- 27 Nov 2026
- Axioms
Classical.choiceQuot.soundpropext- Used by 2
- op874_four_two_slot_hallIn a four-by-two incidence system with at most two required edges at each left vertex, every edge set has enough allowed first and second…
- op874_four_two_incidence_two_pseudoforest_coverIn a finite four-by-two incidence system, if every left vertex meets at most two required edges, the edges split into two injective…
The proof, explained
The theorem is proved by double counting the incidences between the full set of left vertices L and the chosen subset of right vertices X. Grouping incidences by right vertex expresses the total count as a sum over e ∈ X of the number of left vertices incident to e. Because every right vertex has degree 2, this sum equals 2 * |X|.
The sum over all l ∈ L of the number of elements in X incident to l equals the sum over all e ∈ X of the number of elements in L incident to e.
By bipartite double counting (Finset.sum_card_bipartiteAbove_eq_sum_card_bipartiteBelow applied to s = univ and t = X), counting the incidences between the entire set of left vertices L and the subset of right vertices X by grouping by left vertex gives the same total as grouping by right vertex.
uses
Finset.sum_card_bipartiteAbove_eq_sum_card_bipartiteBelowhave h := @Finset.sum_card_bipartiteAbove_eq_sum_card_bipartiteBelow L E inc univ X _The total incidence count ∑ l : L, |{e ∈ X | inc l e}| equals 2 * |X|.
Unfolding the definitions of bipartiteAbove and bipartiteBelow converts the identity into an equality between the desired sum and the sum over e ∈ X of the degree of e in L. By hypothesis (hright), every vertex e has degree exactly 2 in L, so the sum over X evaluates to |X| * 2. Commuting the product using mul_comm yields 2 * |X|, concluding the proof.
uses
Finset.bipartiteAbove,Finset.bipartiteBelow,mul_commsimpa [Finset.bipartiteAbove, Finset.bipartiteBelow, hright, mul_comm] using h
Finset.sum_card_bipartiteAbove_eq_sum_card_bipartiteBelow- For any relation r between finite sets s and t, the sum over a ∈ s of the number of elements in t related to a equals the sum over b ∈ t of the number of elements in s related to b (bipartite double counting).
Finset.bipartiteAbove- The sub-finset of elements b ∈ t that satisfy r a b for a given element a.
Finset.bipartiteBelow- The sub-finset of elements a ∈ s that satisfy r a b for a given element b.
mul_comm- Multiplication is commutative: a * b = b * a.
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.
open Finsetset_option maxHeartbeats 4000000set_option maxRecDepth 8192theorem op874_four_two_incidence_count {L E : Type*} [Fintype L] [Fintype E] [DecidableEq L] [DecidableEq E] (inc : L → E → Prop) [DecidableRel inc] (hright : ∀ e, (univ.filter fun l => inc l e).card = 2) (X : Finset E) : (∑ l : L, (X.filter fun e => inc l e).card) = 2 * X.card := by have h := @Finset.sum_card_bipartiteAbove_eq_sum_card_bipartiteBelow L E inc univ X _ simpa [Finset.bipartiteAbove, Finset.bipartiteBelow, hright, mul_comm] using h