AFTD Auto-Formalizing Theoretical Domains

eight_vertex_nested_shore_endpoint_weight_bound

theoremverified

Consider a family of four- and six-subsets of an eight-element set. Assign each a weight between one and two. If every pair of distinct members has union size at most six, intersection size at least four, and weights summing to at most two, then the total weight is at most two.

Statement

theorem eight_vertex_nested_shore_endpoint_weight_bound
    (F : Finset (Finset (Fin 8))) (m : Finset (Fin 8) → ℕ)
    (hmember : ∀ W ∈ F, (W.card = 4 ∨ W.card = 6) ∧ 1 ≤ m W ∧ m W ≤ 2)
    (hpairs : ∀ A ∈ F, ∀ B ∈ F, A ≠ B →
      (A ∪ B).card ≤ 6 ∧ 4 ≤ (A ∩ B).card ∧ m A + m B ≤ 2) :
    (∑ W ∈ F, m W) ≤ 2
Source
Finite d=9 strict-interior bridge-shore step in the OP-1957 campaign.
Verified
20 Nov 2026
Axioms
Classical.choiceQuot.soundpropext

The proof, explained

First, the argument shows that distinct sets in F cannot have the same cardinality: if two sets both have size 4, their intersection must also have size 4, forcing them to be identical; likewise, if both have size 6, their union must have size 6, again forcing them to coincide. Because each member of F has cardinality 4 or 6, F can contain at most two sets. If |F| ≤ 1, the sum of weights is at most 1 × 2 = 2 since each weight is at most 2. If |F| > 1, the pairwise constraint m(A) + m(B) ≤ 2 together with m ≥ 1 forces every set in F to have weight 1, so the sum of weights equals |F| ≤ 2.

  1. Distinct sets in F cannot have the same cardinality

    Assume for contradiction that two distinct sets A, B ∈ F have |A| = |B|. By the pairwise hypothesis, |A ∪ B| ≤ 6 and 4 ≤ |A ∩ B|. By assumption on members of F, |A| is either 4 or 6. If |A| = 4, then |B| = 4; since A ∩ B ⊆ A, we have |A ∩ B| ≤ 4, which combined with 4 ≤ |A ∩ B| forces |A ∩ B| = |A| = 4. Hence A ∩ B = A, giving A ⊆ B, which with |A| = |B| implies A = B, contradicting A ≠ B. If |A| = 6, then |B| = 6; since A ⊆ A ∪ B and |A ∪ B| ≤ 6, we have |A ∪ B| = |A| = 6, so A ∪ B = A, which gives B ⊆ A and hence B = A, again contradicting A ≠ B.

    lines 7–30

    uses Finset.card_le_card, Finset.inter_subset_left, Finset.eq_of_subset_of_card_le, Finset.mem_inter.mp, Eq.symm, Finset.subset_union_left, Finset.mem_union.mpr, Or.inr

      classical
      have hinj : ∀ A ∈ F, ∀ B ∈ F, A.card = B.card → A = B := by
        intro A hA B hB hcard
        by_contra hne
        obtain ⟨hu, hi, hm⟩ := hpairs A hA B hB hne
        rcases (hmember A hA).1 with hA4 | hA6
        · have hI : (A ∩ B).card = A.card := by
            have hle := Finset.card_le_card (Finset.inter_subset_left : A ∩ B ⊆ A)
            omega
          have hIA : A ∩ B = A := Finset.eq_of_subset_of_card_le Finset.inter_subset_left (by omega)
          have hAB : A ⊆ B := by
            intro x hx
            have : x ∈ A ∩ B := by rwa [hIA]
            exact (Finset.mem_inter.mp this).2
          exact hne (Finset.eq_of_subset_of_card_le hAB (by omega))
        · have hUA : A ∪ B = A := by
            apply Eq.symm
            apply Finset.eq_of_subset_of_card_le Finset.subset_union_left
            omega
          have hBA : B ⊆ A := by
            intro x hx
            have : x ∈ A ∪ B := Finset.mem_union.mpr (Or.inr hx)
            rwa [hUA] at this
          exact hne (Finset.eq_of_subset_of_card_le hBA (by omega)).symm
  2. The family F contains at most two sets (|F| ≤ 2)

    Every set in F has cardinality 4 or 6, so the cardinality map W ↦ |W| sends F into {4, 6}. Because this map is injective on F by the previous step, |F| ≤ |{4, 6}| = 2.

    lines 31–36

    uses Finset.card_le_card_of_injOn

      have hF : F.card ≤ 2 := by
        have h := Finset.card_le_card_of_injOn (fun W : Finset (Fin 8) => W.card)
          (s := F) (t := ({4,6} : Finset ℕ))
          (by intro W hW; rcases (hmember W hW).1 with h | h <;> simp [h])
          (by intro A hA B hB h; exact hinj A hA B hB h)
        simpa using h
  3. If |F| ≤ 1, the total weight is at most 2

    Each member W ∈ F has weight m(W) ≤ 2. Summing this upper bound gives ∑_{W ∈ F} m(W) ≤ 2|F|. Since |F| ≤ 1, the total weight is at most 2.

    lines 37–42

    uses Finset.sum_le_sum

      by_cases hsmall : F.card ≤ 1
      · have hs : (∑ W ∈ F, m W) ≤ ∑ W ∈ F, (2 : ℕ) := by
          exact Finset.sum_le_sum (fun W hW => (hmember W hW).2.2)
        have hsum : (∑ W ∈ F, (2 : ℕ)) = F.card * 2 := by simp
        rw [hsum] at hs
        omega
  4. If |F| > 1, then every set in F has weight exactly 1

    Since |F| > 1, there exist two distinct members A, B ∈ F. Any member W ∈ F is distinct from at least one of A or B: if W = A, then W ≠ B; otherwise W ≠ A. By the pairwise hypothesis, the sum of weights of W and the other member is at most 2. Since every member has weight at least 1, this forces m(W) = 1.

    lines 43–54

    uses Finset.one_lt_card.mp

      · obtain ⟨A, hA, B, hB, hAB⟩ := Finset.one_lt_card.mp (by omega : 1 < F.card)
        have hone : ∀ W ∈ F, m W = 1 := by
          intro W hW
          by_cases hWA : W = A
          · have hp := (hpairs W hW B hB (by simpa [hWA] using hAB)).2.2
            have hpos := (hmember B hB).2.1
            have hposW := (hmember W hW).2.1
            omega
          · have hp := (hpairs W hW A hA hWA).2.2
            have hpos := (hmember A hA).2.1
            have hposW := (hmember W hW).2.1
            omega
  5. When |F| > 1, the total weight is at most 2

    Since every member W ∈ F has m(W) = 1, the sum of weights ∑_{W ∈ F} m(W) equals ∑_{W ∈ F} 1 = |F|. Because |F| ≤ 2, the total weight is at most 2.

    lines 55–59

    uses Finset.sum_congr

        have hsum : (∑ W ∈ F, m W) = F.card := by
          calc
            (∑ W ∈ F, m W) = ∑ W ∈ F, (1 : ℕ) := Finset.sum_congr rfl hone
            _ = F.card := by simp
        omega
Finset.card_le_card
A subset of a finite set has cardinality at most that of the ambient set
Finset.inter_subset_left
The intersection of two finite sets is a subset of the first set
Finset.eq_of_subset_of_card_le
If s ⊆ t and |t| ≤ |s| for finite sets s and t, then s = t
Finset.mem_inter.mp
If an element belongs to the intersection of two sets, it belongs to both sets
Eq.symm
Equality is symmetric: if a = b, then b = a
Finset.subset_union_left
A finite set is a subset of its union with another set
Finset.mem_union.mpr
An element in either set belongs to their union
Or.inr
From a proof of B, infer A ∨ B
Finset.card_le_card_of_injOn
If a function maps a finite set s into a finite set t injectively, then |s| ≤ |t|
Finset.sum_le_sum
If f(i) ≤ g(i) for all i in a finite set s, then ∑_{i ∈ s} f(i) ≤ ∑_{i ∈ s} g(i)
Finset.one_lt_card.mp
If a finite set has cardinality strictly greater than 1, it contains at least two distinct elements
Finset.sum_congr
If two finite sets are equal and two summands agree on every element, their sums are equal

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 eight_vertex_nested_shore_endpoint_weight_bound    (F : Finset (Finset (Fin 8))) (m : Finset (Fin 8) → ℕ)    (hmember : ∀ W ∈ F, (W.card = 4 ∨ W.card = 6) ∧ 1 ≤ m W ∧ m W ≤ 2)    (hpairs : ∀ A ∈ F, ∀ B ∈ F, A ≠ B →      (A ∪ B).card ≤ 6 ∧ 4 ≤ (A ∩ B).card ∧ m A + m B ≤ 2) :    (∑ W ∈ F, m W) ≤ 2 := by  classical  have hinj : ∀ A ∈ F, ∀ B ∈ F, A.card = B.card → A = B := by    intro A hA B hB hcard    by_contra hne    obtain ⟨hu, hi, hm⟩ := hpairs A hA B hB hne    rcases (hmember A hA).1 with hA4 | hA6    · have hI : (A ∩ B).card = A.card := by        have hle := Finset.card_le_card (Finset.inter_subset_left : A ∩ B ⊆ A)        omega      have hIA : A ∩ B = A := Finset.eq_of_subset_of_card_le Finset.inter_subset_left (by omega)      have hAB : A ⊆ B := by        intro x hx        have : x ∈ A ∩ B := by rwa [hIA]        exact (Finset.mem_inter.mp this).2      exact hne (Finset.eq_of_subset_of_card_le hAB (by omega))    · have hUA : A ∪ B = A := by        apply Eq.symm        apply Finset.eq_of_subset_of_card_le Finset.subset_union_left        omega      have hBA : B ⊆ A := by        intro x hx        have : x ∈ A ∪ B := Finset.mem_union.mpr (Or.inr hx)        rwa [hUA] at this      exact hne (Finset.eq_of_subset_of_card_le hBA (by omega)).symm  have hF : F.card ≤ 2 := by    have h := Finset.card_le_card_of_injOn (fun W : Finset (Fin 8) => W.card)      (s := F) (t := ({4,6} : Finset ℕ))      (by intro W hW; rcases (hmember W hW).1 with h | h <;> simp [h])      (by intro A hA B hB h; exact hinj A hA B hB h)    simpa using h  by_cases hsmall : F.card ≤ 1  · have hs : (∑ W ∈ F, m W) ≤ ∑ W ∈ F, (2 : ℕ) := by      exact Finset.sum_le_sum (fun W hW => (hmember W hW).2.2)    have hsum : (∑ W ∈ F, (2 : ℕ)) = F.card * 2 := by simp    rw [hsum] at hs    omega  · obtain ⟨A, hA, B, hB, hAB⟩ := Finset.one_lt_card.mp (by omega : 1 < F.card)    have hone : ∀ W ∈ F, m W = 1 := by      intro W hW      by_cases hWA : W = A      · have hp := (hpairs W hW B hB (by simpa [hWA] using hAB)).2.2        have hpos := (hmember B hB).2.1        have hposW := (hmember W hW).2.1        omega      · have hp := (hpairs W hW A hA hWA).2.2        have hpos := (hmember A hA).2.1        have hposW := (hmember W hW).2.1        omega    have hsum : (∑ W ∈ F, m W) = F.card := by      calc        (∑ W ∈ F, m W) = ∑ W ∈ F, (1 : ℕ) := Finset.sum_congr rfl hone        _ = F.card := by simp    omega
See it in the graphDiscuss this resultChallenge it