AFTD Auto-Formalizing Theoretical Domains

shared_shore_global_endpoint_degree_budget

theoremverified

For a family of pairwise disjoint endpoint sets P(a), all disjoint from W, suppose every vertex q of Q(i) is adjacent to W and, whenever q also belongs to Q(a), to every vertex of P(a). If each q in Q(i) has degree at most d, the sum over a of |Q(i) ∩ Q(a)| times |P(a)| plus |Q(i)| times |W| is at most |Q(i)|d.

Statement

theorem shared_shore_global_endpoint_degree_budget
    {V I : Type*} [Fintype V] [DecidableEq V] [DecidableEq I]
    (H : SimpleGraph V) [DecidableRel H.Adj] (d : ℕ)
    (F : Finset I) (Q P : I → Finset V) (W : Finset V) (i : I)
    (hi : i ∈ F)
    (hdisj : ∀ a ∈ F, ∀ b ∈ F, a ≠ b → Disjoint (P a) (P b))
    (hW : ∀ a ∈ F, Disjoint W (P a))
    (hWneighbors : ∀ q ∈ Q i, ∀ w ∈ W, H.Adj q w)
    (hPneighbors : ∀ a ∈ F, ∀ q ∈ Q i ∩ Q a, ∀ z ∈ P a, H.Adj q z)
    (hdegree : ∀ q ∈ Q i, (H.neighborFinset q).card ≤ d) :
    (∑ a ∈ F, (Q i ∩ Q a).card * (P a).card) + (Q i).card * W.card ≤ (Q i).card * d
Source
Global shared-shore degree budget for the OP-1957 crossing-cut campaign.
Verified
20 Nov 2026
Axioms
Classical.choiceQuot.soundpropext

The proof, explained

The proof establishes a global degree budget for Q(i) by double counting graph neighbors. For each vertex q in Q(i), the set W and the endpoint sets P(a) for indices a where q belongs to Q(a) are pairwise disjoint and all lie in the open neighborhood of q, giving the local bound |W| + ∑_{a ∈ F, q ∈ Q(a)} |P(a)| ≤ d. Summing this bound over all vertices q in Q(i) and interchanging the order of summation converts the contribution of the endpoint sets into ∑_{a ∈ F} |Q(i) ∩ Q(a)| · |P(a)|. Adding the constant sum |Q(i)| · |W| completes the inequality.

  1. For any vertex q ∈ Q(i), setting Fq = {a ∈ F | q ∈ Q(a)}, the family {P(a)}_{a ∈ Fq} is pairwise disjoint, and W is disjoint from the union ⋃_{a ∈ Fq} P(a).

    Fix an arbitrary vertex q ∈ Q(i) and let Fq be the subset of indices a ∈ F such that q ∈ Q(a). Since Fq ⊆ F, the family {P(a)}_{a ∈ Fq} inherits pairwise disjointness from the hypothesis hdisj that all sets P(a) for a ∈ F are pairwise disjoint. By hypothesis hW, W is disjoint from every P(a) with a ∈ F, and by Finset.disjoint_biUnion_right, being disjoint from each member implies that W is disjoint from their union ⋃_{a ∈ Fq} P(a).

    lines 12–22

    uses Finset.mem_filter.mp, Finset.disjoint_biUnion_right

      classical
      have hlocal : ∀ q ∈ Q i, W.card + (∑ a ∈ F, if q ∈ Q a then (P a).card else 0) ≤ d := by
        intro q hq
        let Fq := F.filter (fun a => q ∈ Q a)
        have hpair : (Fq : Set I).PairwiseDisjoint P := by
          intro a ha b hb hab
          apply hdisj a (Finset.mem_filter.mp ha).1 b (Finset.mem_filter.mp hb).1 hab
        have hWdisj : Disjoint W (Fq.biUnion P) := by
          apply (Finset.disjoint_biUnion_right W Fq P).mpr
          intro a ha
          exact hW a (Finset.mem_filter.mp ha).1
  2. For any q ∈ Q(i), the local degree bound |W| + ∑_{a ∈ F, q ∈ Q(a)} |P(a)| ≤ d holds.

    We show that the union W ∪ ⋃_{a ∈ Fq} P(a) is contained in the neighborhood of q in H. Any vertex in W is adjacent to q by hypothesis hWneighbors. Any vertex in ⋃_{a ∈ Fq} P(a) lies in some P(a) with a ∈ F and q ∈ Q(a); hence q ∈ Q(i) ∩ Q(a), so q is adjacent to that vertex by hypothesis hPneighbors. The neighborhood of q has cardinality at most d by hdegree, so the cardinality of the union is at most d. Using the disjointness established in the previous step, this cardinality expands as |W| + ∑_{a ∈ Fq} |P(a)|, which can be rewritten as the indicator sum |W| + ∑_{a ∈ F} (if q ∈ Q(a) then |P(a)| else 0) ≤ d.

    lines 23–34

    uses SimpleGraph.mem_neighborFinset, Finset.mem_union.mp, Finset.mem_biUnion.mp, Finset.mem_filter.mp, Finset.mem_inter.mpr, Finset.card_le_card, Finset.card_union_of_disjoint, Finset.card_biUnion, Finset.sum_filter

        have hsub : W ∪ Fq.biUnion P ⊆ H.neighborFinset q := by
          intro x hx
          rw [SimpleGraph.mem_neighborFinset]
          rcases Finset.mem_union.mp hx with hxW | hxP
          · exact hWneighbors q hq x hxW
          · obtain ⟨a, ha, hxPa⟩ := Finset.mem_biUnion.mp hxP
            have haF := (Finset.mem_filter.mp ha).1
            have hqa := (Finset.mem_filter.mp ha).2
            exact hPneighbors a haF q (Finset.mem_inter.mpr ⟨hq,hqa⟩) x hxPa
        have h := (Finset.card_le_card hsub).trans (hdegree q hq)
        rw [Finset.card_union_of_disjoint hWdisj, Finset.card_biUnion hpair] at h
        simpa only [Fq, Finset.sum_filter] using h
  3. The double sum ∑_{q ∈ Q(i)} ∑_{a ∈ F} (if q ∈ Q(a) then |P(a)| else 0) equals ∑_{a ∈ F} |Q(i) ∩ Q(a)| · |P(a)|.

    Interchanging the order of summation using Finset.sum_comm gives ∑_{a ∈ F} ∑_{q ∈ Q(i)} (if q ∈ Q(a) then |P(a)| else 0). For each fixed a ∈ F, the inner sum restricts to those q ∈ Q(i) such that q ∈ Q(a), which is the intersection Q(i) ∩ Q(a). Since |P(a)| is independent of q, summing it over the intersection yields |Q(i) ∩ Q(a)| · |P(a)|.

    lines 35–45

    uses Finset.sum_comm, Finset.sum_congr, Finset.sum_filter

      have hsum : (∑ q ∈ Q i, ∑ a ∈ F, if q ∈ Q a then (P a).card else 0) =
          ∑ a ∈ F, (Q i ∩ Q a).card * (P a).card := by
        rw [Finset.sum_comm]
        apply Finset.sum_congr rfl
        intro a ha
        rw [← Finset.sum_filter]
        have heq : (Q i).filter (fun q => q ∈ Q a) = Q i ∩ Q a := by
          ext q
          simp
        rw [heq]
        simp
  4. The global degree bound (∑_{a ∈ F} |Q(i) ∩ Q(a)| · |P(a)|) + |Q(i)| · |W| ≤ |Q(i)| · d holds.

    Summing the local bound over all q ∈ Q(i) via Finset.sum_le_sum gives ∑_{q ∈ Q(i)} (|W| + ∑_{a ∈ F, q ∈ Q(a)} |P(a)|) ≤ ∑_{q ∈ Q(i)} d. Distributing the sum over addition and substituting the identity from the previous step yields ∑_{q ∈ Q(i)} |W| + ∑_{a ∈ F} |Q(i) ∩ Q(a)| · |P(a)| ≤ ∑_{q ∈ Q(i)} d. The constant sums evaluate to |Q(i)| · |W| and |Q(i)| · d. Commuting the addition on the left-hand side matches the target inequality.

    lines 46–51

    uses Finset.sum_le_sum, Finset.sum_add_distrib, Nat.add_comm

      have htotal := Finset.sum_le_sum hlocal
      rw [Finset.sum_add_distrib, hsum] at htotal
      have hleft : (∑ q ∈ Q i, W.card) = (Q i).card * W.card := by simp
      have hright : (∑ q ∈ Q i, d) = (Q i).card * d := by simp
      rw [hleft, hright] at htotal
      simpa only [Nat.add_comm] using htotal
Finset.mem_filter.mp
an element belonging to a filtered finset {x ∈ s | p(x)} belongs to s and satisfies the predicate p
Finset.disjoint_biUnion_right
a set is disjoint from a union of sets indexed by a finite set if and only if it is disjoint from each constituent set in the union
SimpleGraph.mem_neighborFinset
a vertex belongs to the neighborhood of a vertex if and only if the two vertices are adjacent in the graph
Finset.mem_union.mp
if an element belongs to the union of two sets, it belongs to the first set or to the second set
Finset.mem_biUnion.mp
if an element belongs to an indexed union of sets, it belongs to at least one set in the family
Finset.mem_inter.mpr
an element belonging to both of two sets belongs to their intersection
Finset.card_le_card
if one finite set is a subset of another, its cardinality is at most the cardinality of the superset
Finset.card_union_of_disjoint
the cardinality of the union of two disjoint finite sets is the sum of their cardinalities
Finset.card_biUnion
the cardinality of a union of pairwise disjoint finite sets is the sum of their cardinalities
Finset.sum_filter
summing over the elements of a set satisfying a condition equals summing over the whole set with terms not satisfying the condition replaced by zero
Finset.sum_comm
the order of two finite summations can be interchanged (Fubini's theorem for finite sums)
Finset.sum_congr
two sums are equal if their index sets are identical and their summands agree on every element
Finset.sum_le_sum
if one summand is pointwise bounded by another on a finite set, the corresponding sum is bounded by the other sum
Finset.sum_add_distrib
a sum of sums distributes as the sum of the first terms plus the sum of the second terms
Nat.add_comm
addition of natural numbers is commutative: n + m = m + n

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 shared_shore_global_endpoint_degree_budget    {V I : Type*} [Fintype V] [DecidableEq V] [DecidableEq I]    (H : SimpleGraph V) [DecidableRel H.Adj] (d : ℕ)    (F : Finset I) (Q P : I → Finset V) (W : Finset V) (i : I)    (hi : i ∈ F)    (hdisj : ∀ a ∈ F, ∀ b ∈ F, a ≠ b → Disjoint (P a) (P b))    (hW : ∀ a ∈ F, Disjoint W (P a))    (hWneighbors : ∀ q ∈ Q i, ∀ w ∈ W, H.Adj q w)    (hPneighbors : ∀ a ∈ F, ∀ q ∈ Q i ∩ Q a, ∀ z ∈ P a, H.Adj q z)    (hdegree : ∀ q ∈ Q i, (H.neighborFinset q).card ≤ d) :    (∑ a ∈ F, (Q i ∩ Q a).card * (P a).card) + (Q i).card * W.card ≤ (Q i).card * d := by  classical  have hlocal : ∀ q ∈ Q i, W.card + (∑ a ∈ F, if q ∈ Q a then (P a).card else 0) ≤ d := by    intro q hq    let Fq := F.filter (fun a => q ∈ Q a)    have hpair : (Fq : Set I).PairwiseDisjoint P := by      intro a ha b hb hab      apply hdisj a (Finset.mem_filter.mp ha).1 b (Finset.mem_filter.mp hb).1 hab    have hWdisj : Disjoint W (Fq.biUnion P) := by      apply (Finset.disjoint_biUnion_right W Fq P).mpr      intro a ha      exact hW a (Finset.mem_filter.mp ha).1    have hsub : W ∪ Fq.biUnion P ⊆ H.neighborFinset q := by      intro x hx      rw [SimpleGraph.mem_neighborFinset]      rcases Finset.mem_union.mp hx with hxW | hxP      · exact hWneighbors q hq x hxW      · obtain ⟨a, ha, hxPa⟩ := Finset.mem_biUnion.mp hxP        have haF := (Finset.mem_filter.mp ha).1        have hqa := (Finset.mem_filter.mp ha).2        exact hPneighbors a haF q (Finset.mem_inter.mpr ⟨hq,hqa⟩) x hxPa    have h := (Finset.card_le_card hsub).trans (hdegree q hq)    rw [Finset.card_union_of_disjoint hWdisj, Finset.card_biUnion hpair] at h    simpa only [Fq, Finset.sum_filter] using h  have hsum : (∑ q ∈ Q i, ∑ a ∈ F, if q ∈ Q a then (P a).card else 0) =      ∑ a ∈ F, (Q i ∩ Q a).card * (P a).card := by    rw [Finset.sum_comm]    apply Finset.sum_congr rfl    intro a ha    rw [← Finset.sum_filter]    have heq : (Q i).filter (fun q => q ∈ Q a) = Q i ∩ Q a := by      ext q      simp    rw [heq]    simp  have htotal := Finset.sum_le_sum hlocal  rw [Finset.sum_add_distrib, hsum] at htotal  have hleft : (∑ q ∈ Q i, W.card) = (Q i).card * W.card := by simp  have hright : (∑ q ∈ Q i, d) = (Q i).card * d := by simp  rw [hleft, hright] at htotal  simpa only [Nat.add_comm] using htotal
See it in the graphDiscuss this resultChallenge it