AFTD Auto-Formalizing Theoretical Domains

crossing_shore_family_opposite_incidence_bound

theoremverified

For the displayed family of crossing shores with a selected shore meeting all others, the selected-root and opposite-shore cardinalities obey the stated degree-budget inequality.

Statement

theorem crossing_shore_family_opposite_incidence_bound
    {V : Type*} [Fintype V] [DecidableEq V]
    (H : SimpleGraph V) [DecidableRel H.Adj]
    (d t : ℕ) (S C F : Finset V) (hSC : Disjoint S C)
    (hF : F ⊆ C) (hS : S.card + 1 = d)
    (hmax : ∀ a, (H.neighborFinset a).card ≤ d)
    (Q W : V → Finset V)
    (hW : ∀ z ∈ F, W z ⊆ S)
    (hzQ : ∀ z ∈ F, ∀ q ∈ Q z, H.Adj z q)
    (hcross : ∀ z ∈ F, ∀ q ∈ Q z, ∀ w ∈ W z, H.Adj q w)
    (hcut : ∀ z ∈ F, ∀ z' ∈ F, (W z ∩ W z').Nonempty →
      (W z ∪ W z').card + (Q z ∩ Q z').card = d + 1)
    (z : V) (hz : z ∈ F) (hwt : (W z).card + t = d)
    (hmeets : ∀ z' ∈ F, (W z ∩ W z').Nonempty) :
    2 * F.card + (Q z).card ≤ (Q z).card * t + 2
Source
OP-1957 crossing-shore structural reduction, session IN-1122.
Verified
22 Nov 2026
Axioms
Classical.choiceQuot.soundpropext

The proof, explained

The proof double-counts incidences (q, r) with q ∈ Q(z) and r ∈ F such that q ∈ Q(r), bounding the sum ∑_{r ∈ F} |Q(z) ∩ Q(r)| from below and above. The cut condition ensures |W(z) ∪ W(r)| ≤ |S| = d - 1, which implies each pairwise intersection |Q(z) ∩ Q(r)| is at least 2, yielding a lower bound of 2 * |F| + |Q(z)| - 2. On the other hand, the neighbors of each q ∈ Q(z) contain the disjoint union of W(z) and {r ∈ F | q ∈ Q(r)}, bounding the number of shores containing q by d - |W(z)| = t and giving an upper bound of |Q(z)| * t. Comparing the two bounds gives the desired inequality.

  1. For every r ∈ F, the intersection Q(z) ∩ Q(r) has cardinality at least 2.

    Both W(z) and W(r) are subsets of S, so their union W(z) ∪ W(r) is contained in S, which has size d - 1. Because W(z) and W(r) meet, the cut equation gives |W(z) ∪ W(r)| + |Q(z) ∩ Q(r)| = d + 1. It follows that |Q(z) ∩ Q(r)| ≥ (d + 1) - (d - 1) = 2.

    lines 16–22

    uses Finset.union_subset, Finset.card_le_card

      classical
      have hint : ∀ r ∈ F, 2 ≤ (Q z ∩ Q r).card := by
        intro r hr
        have hsub : W z ∪ W r ⊆ S := Finset.union_subset (hW z hz) (hW r hr)
        have hc := Finset.card_le_card hsub
        have heq := hcut z hz r hr (hmeets r hr)
        omega
  2. 2 * |F| + |Q(z)| ≤ (∑_{r ∈ F} |Q(z) ∩ Q(r)|) + 2.

    We isolate the term r = z from the sum over F, which equals |Q(z) ∩ Q(z)| = |Q(z)|. For the remaining |F| - 1 elements r ∈ F \ {z}, each term |Q(z) ∩ Q(r)| is at least 2, giving a sum of at least 2 * (|F| - 1). Adding |Q(z)| yields ∑_{r ∈ F} |Q(z) ∩ Q(r)| ≥ 2 * |F| - 2 + |Q(z)|, which rearranges to the claim.

    lines 23–34

    uses Finset.sum_le_sum, Finset.mem_of_mem_erase, Finset.card_pos.mpr, Finset.card_erase_of_mem, Finset.add_sum_erase, Nat.mul_comm, Finset.inter_self

      have hlower : 2 * F.card + (Q z).card ≤
          (∑ r ∈ F, (Q z ∩ Q r).card) + 2 := by
        have hsum := Finset.sum_le_sum (s := F.erase z)
          (f := fun _ => 2) (g := fun r => (Q z ∩ Q r).card)
          (by intro r hr; exact hint r (Finset.mem_of_mem_erase hr))
        have hpos : 0 < F.card := Finset.card_pos.mpr ⟨z, hz⟩
        have herase : (F.erase z).card + 1 = F.card := by rw [Finset.card_erase_of_mem hz]; omega
        have hsplit := Finset.add_sum_erase F (fun r => (Q z ∩ Q r).card) hz
        have hsum' : 2 * (F.erase z).card ≤ ∑ r ∈ F.erase z, (Q z ∩ Q r).card := by
          simpa [Nat.mul_comm] using hsum
        simp only [Finset.inter_self] at hsplit
        omega
  3. For each q ∈ Q(z), the number of r ∈ F such that q ∈ Q(r) is at most t.

    Let R = {r ∈ F | q ∈ Q(r)}. The sets W(z) and R are disjoint because W(z) ⊆ S, R ⊆ F ⊆ C, and S and C are disjoint. Moreover, every element of W(z) is adjacent to q by the crossing property, and every element r ∈ R is adjacent to q by the definition of Q(r) and graph symmetry. Thus W(z) ∪ R is a subset of the neighbors of q, giving |W(z)| + |R| ≤ d. Since |W(z)| + t = d, we have |R| ≤ t.

    lines 35–55

    uses Finset.disjoint_left.mpr, Finset.mem_filter.mp, Finset.disjoint_left.mp, H.mem_neighborFinset, Finset.mem_union.mp, Finset.card_le_card, Finset.card_union_of_disjoint

      have hdegree : ∀ q ∈ Q z, (F.filter (fun r => q ∈ Q r)).card ≤ t := by
        intro q hq
        let R := F.filter (fun r => q ∈ Q r)
        have hdis : Disjoint (W z) R := by
          apply Finset.disjoint_left.mpr
          intro a ha hr
          have haS := hW z hz ha
          have haF : a ∈ F := (Finset.mem_filter.mp (show a ∈ F.filter (fun r => q ∈ Q r) from hr)).1
          have haC := hF haF
          exact (Finset.disjoint_left.mp hSC) haS haC
        have hsub : W z ∪ R ⊆ H.neighborFinset q := by
          intro a ha
          rw [H.mem_neighborFinset]
          rcases Finset.mem_union.mp ha with ha | ha
          · exact hcross z hz q hq a ha
          · have ha' := Finset.mem_filter.mp ha
            exact (hzQ a ha'.1 q ha'.2).symm
        have hc := (Finset.card_le_card hsub).trans (hmax q)
        rw [Finset.card_union_of_disjoint hdis] at hc
        change R.card ≤ t
        omega
  4. The sum ∑_{r ∈ F} |Q(z) ∩ Q(r)| equals ∑_{q ∈ Q(z)} |{r ∈ F | q ∈ Q(r)}|.

    Writing each intersection size |Q(z) ∩ Q(r)| as the sum over q ∈ Q(z) of the indicator that q ∈ Q(r), we swap the two summations using Finset.sum_comm. The inner sum over r ∈ F then evaluates to the cardinality of {r ∈ F | q ∈ Q(r)}.

    lines 56–69

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

      have hswap : (∑ r ∈ F, (Q z ∩ Q r).card) =
          ∑ q ∈ Q z, (F.filter (fun r => q ∈ Q r)).card := by
        calc
          (∑ r ∈ F, (Q z ∩ Q r).card) =
              ∑ r ∈ F, ∑ q ∈ Q z, if q ∈ Q r then 1 else 0 := by
                apply Finset.sum_congr rfl
                intro r hr
                rw [← Finset.card_filter]
                congr 1
          _ = ∑ q ∈ Q z, ∑ r ∈ F, if q ∈ Q r then 1 else 0 := Finset.sum_comm
          _ = ∑ q ∈ Q z, (F.filter (fun r => q ∈ Q r)).card := by
                apply Finset.sum_congr rfl
                intro q hq
                rw [Finset.card_filter]
  5. 2 * |F| + |Q(z)| ≤ |Q(z)| * t + 2.

    Summing the upper bound |{r ∈ F | q ∈ Q(r)}| ≤ t over all q ∈ Q(z) gives ∑_{r ∈ F} |Q(z) ∩ Q(r)| ≤ |Q(z)| * t. Combining this with the lower bound 2 * |F| + |Q(z)| ≤ (∑_{r ∈ F} |Q(z) ∩ Q(r)|) + 2 directly yields the degree-budget inequality by linear arithmetic.

    lines 70–75

    uses Finset.sum_le_sum

      have hupper := Finset.sum_le_sum (s := Q z)
        (f := fun q => (F.filter (fun r => q ∈ Q r)).card) (g := fun _ => t) hdegree
      rw [← hswap] at hupper
      have hupper' : (∑ r ∈ F, (Q z ∩ Q r).card) ≤ (Q z).card * t := by
        simpa using hupper
      omega
Finset.add_sum_erase
For an element a of s, the sum of f over s equals f(a) plus the sum of f over s with a removed.
Finset.card_erase_of_mem
Removing an element from a finite set decreases its cardinality by 1.
Finset.card_filter
The cardinality of a filtered subset equals the sum over the set of the indicator of the predicate.
Finset.card_le_card
If one finite set is a subset of another, its cardinality is less than or equal to the other's.
Finset.card_pos.mpr
A finite set has strictly positive cardinality if and only if it is nonempty.
Finset.card_union_of_disjoint
The cardinality of the union of two disjoint finite sets is the sum of their cardinalities.
Finset.disjoint_left.mp
If two finite sets are disjoint, no element of the first belongs to the second.
Finset.disjoint_left.mpr
If no element of s belongs to t, then s and t are disjoint.
Finset.inter_self
The intersection of a finite set with itself is the set itself.
Finset.mem_filter.mp
An element belongs to a filtered subset if and only if it belongs to the base set and satisfies the predicate.
Finset.mem_of_mem_erase
An element belonging to a set with one element removed belongs to the original set.
Finset.mem_union.mp
An element belongs to the union of two sets if and only if it belongs to the first or the second.
Finset.sum_comm
Sums over two finite sets can be exchanged in order.
Finset.sum_congr
Two sums are equal if their index sets are equal and their summands agree on every element.
Finset.sum_le_sum
If f(i) ≤ g(i) for all elements i in a finite set, the sum of f is at most the sum of g.
Finset.union_subset
The union of two subsets of u is also a subset of u.
H.mem_neighborFinset
A vertex belongs to the neighbor finset of q in H if and only if it is adjacent to q in H.
Nat.mul_comm
Multiplication 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 crossing_shore_family_opposite_incidence_bound    {V : Type*} [Fintype V] [DecidableEq V]    (H : SimpleGraph V) [DecidableRel H.Adj]    (d t : ℕ) (S C F : Finset V) (hSC : Disjoint S C)    (hF : F ⊆ C) (hS : S.card + 1 = d)    (hmax : ∀ a, (H.neighborFinset a).card ≤ d)    (Q W : V → Finset V)    (hW : ∀ z ∈ F, W z ⊆ S)    (hzQ : ∀ z ∈ F, ∀ q ∈ Q z, H.Adj z q)    (hcross : ∀ z ∈ F, ∀ q ∈ Q z, ∀ w ∈ W z, H.Adj q w)    (hcut : ∀ z ∈ F, ∀ z' ∈ F, (W z ∩ W z').Nonempty →      (W z ∪ W z').card + (Q z ∩ Q z').card = d + 1)    (z : V) (hz : z ∈ F) (hwt : (W z).card + t = d)    (hmeets : ∀ z' ∈ F, (W z ∩ W z').Nonempty) :    2 * F.card + (Q z).card ≤ (Q z).card * t + 2 := by  classical  have hint : ∀ r ∈ F, 2 ≤ (Q z ∩ Q r).card := by    intro r hr    have hsub : W z ∪ W r ⊆ S := Finset.union_subset (hW z hz) (hW r hr)    have hc := Finset.card_le_card hsub    have heq := hcut z hz r hr (hmeets r hr)    omega  have hlower : 2 * F.card + (Q z).card ≤      (∑ r ∈ F, (Q z ∩ Q r).card) + 2 := by    have hsum := Finset.sum_le_sum (s := F.erase z)      (f := fun _ => 2) (g := fun r => (Q z ∩ Q r).card)      (by intro r hr; exact hint r (Finset.mem_of_mem_erase hr))    have hpos : 0 < F.card := Finset.card_pos.mpr ⟨z, hz⟩    have herase : (F.erase z).card + 1 = F.card := by rw [Finset.card_erase_of_mem hz]; omega    have hsplit := Finset.add_sum_erase F (fun r => (Q z ∩ Q r).card) hz    have hsum' : 2 * (F.erase z).card ≤ ∑ r ∈ F.erase z, (Q z ∩ Q r).card := by      simpa [Nat.mul_comm] using hsum    simp only [Finset.inter_self] at hsplit    omega  have hdegree : ∀ q ∈ Q z, (F.filter (fun r => q ∈ Q r)).card ≤ t := by    intro q hq    let R := F.filter (fun r => q ∈ Q r)    have hdis : Disjoint (W z) R := by      apply Finset.disjoint_left.mpr      intro a ha hr      have haS := hW z hz ha      have haF : a ∈ F := (Finset.mem_filter.mp (show a ∈ F.filter (fun r => q ∈ Q r) from hr)).1      have haC := hF haF      exact (Finset.disjoint_left.mp hSC) haS haC    have hsub : W z ∪ R ⊆ H.neighborFinset q := by      intro a ha      rw [H.mem_neighborFinset]      rcases Finset.mem_union.mp ha with ha | ha      · exact hcross z hz q hq a ha      · have ha' := Finset.mem_filter.mp ha        exact (hzQ a ha'.1 q ha'.2).symm    have hc := (Finset.card_le_card hsub).trans (hmax q)    rw [Finset.card_union_of_disjoint hdis] at hc    change R.card ≤ t    omega  have hswap : (∑ r ∈ F, (Q z ∩ Q r).card) =      ∑ q ∈ Q z, (F.filter (fun r => q ∈ Q r)).card := by    calc      (∑ r ∈ F, (Q z ∩ Q r).card) =          ∑ r ∈ F, ∑ q ∈ Q z, if q ∈ Q r then 1 else 0 := by            apply Finset.sum_congr rfl            intro r hr            rw [← Finset.card_filter]            congr 1      _ = ∑ q ∈ Q z, ∑ r ∈ F, if q ∈ Q r then 1 else 0 := Finset.sum_comm      _ = ∑ q ∈ Q z, (F.filter (fun r => q ∈ Q r)).card := by            apply Finset.sum_congr rfl            intro q hq            rw [Finset.card_filter]  have hupper := Finset.sum_le_sum (s := Q z)    (f := fun q => (F.filter (fun r => q ∈ Q r)).card) (g := fun _ => t) hdegree  rw [← hswap] at hupper  have hupper' : (∑ r ∈ F, (Q z ∩ Q r).card) ≤ (Q z).card * t := by    simpa using hupper  omega
See it in the graphDiscuss this resultChallenge it