AFTD Auto-Formalizing Theoretical Domains

op1957_one_defect_endpoint_numeric_bounds

theoremverified

Under the displayed five-by-odd block partition, degree and one-defect shore hypotheses, the endpoint and nonendpoint representative intersection counts satisfy the listed inequalities.

Statement

theorem op1957_one_defect_endpoint_numeric_bounds
    (k c : ℕ) (hc : 5 ≤ c) (hkc : c ≤ k)
    (G : SimpleGraph (Fin (4*k))) [DecidableRel G.Adj]
    (A B C D X Y U : Finset (Fin (4*k)))
    (hAB : Disjoint A B) (hAC : Disjoint A C) (hAD : Disjoint A D)
    (hBC : Disjoint B C) (hBD : Disjoint B D) (hCD : Disjoint C D)
    (hcover : A ∪ B ∪ C ∪ D = Finset.univ)
    (hA : A.card=5) (hB : B.card=2*k-5) (hC : C.card=c) (hD : D.card=2*k-c)
    (hnoAB : ∀ a ∈ A, ∀ b ∈ B, ¬ G.Adj a b)
    (hnoCD : ∀ a ∈ C, ∀ b ∈ D, ¬ G.Adj a b)
    (hdegree : ∀ v, 2*k+2 ≤ (G.neighborFinset v).card)
    (x y : Fin (4*k)) (hxA : x ∈ A) (hyC : y ∈ C) (hxX : x ∈ X) (hyY : y ∈ Y)
    (hXY : Disjoint X Y) (hXU : Disjoint X U) (hYU : Disjoint Y U)
    (hcross : ∀ a ∈ X, ∀ b ∈ Y, G.Adj a b → a=x ∧ b=y)
    (hantiX : ∀ a ∈ X, ∀ u ∈ U, ¬ G.Adj a u)
    (hantiY : ∀ a ∈ Y, ∀ u ∈ U, ¬ G.Adj a u)
    (hdefect : (C.filter (fun w => ¬ G.Adj x w)).card ≤ 1) :
    let a0 := (X ∩ A).card; let b0 := (X ∩ B).card; let c0 := (X ∩ C).card; let d0 := (X ∩ D).card
    let a1 := (Y ∩ A).card; let b1 := (Y ∩ B).card; let c1 := (Y ∩ C).card; let d1 := (Y ∩ D).card
    let a2 := (U ∩ A).card; let b2 := (U ∩ B).card; let c2 := (U ∩ C).card; let d2 := (U ∩ D).card
    1 ≤ a0 ∧ 1 ≤ c1 ∧ c1+c2 ≤ 2 ∧
    a1+c1+d1+a2+c2+d2 ≤ 3 ∧ a0+b0+c0+a2+b2+c2+2 ≤ c ∧
    (2 ≤ a0 → a1+c1+d1+a2+c2+d2 ≤ 2) ∧
    (1 ≤ c0 → a1+b1+c1+a2+b2+c2+3 ≤ c) ∧
    (1 ≤ d0 → a1+b1+d1+a2+b2+d2+c+3 ≤ 2*k) ∧
    (1 ≤ a1 → a0+c0+d0+a2+c2+d2 ≤ 2) ∧
    (2 ≤ c1 → a0+b0+c0+a2+b2+c2+3 ≤ c)
Source
OP-1957: five-by-odd boundary reduction, arXiv:2611.22690
Verified
29 Nov 2026
Axioms
Classical.choiceQuot.soundpropext
Built on 4
Used by 1

The proof, explained

The proof establishes ten numeric bounds on the intersection counts of two shores X, Y and an outside pool U with four partitioning blocks A, B, C, D of a graph with minimum degree 2k + 2. It embeds the configuration into a four-shore, four-block framework where cross-shore edges between X and Y are restricted to a single endpoint pair (x, y) and x has at most one non-neighbor in block C. The unconditional bounds follow by applying a vertex non-neighbor counting lemma to x and y, and bounding non-neighbors in C using the one-defect hypothesis. The conditional bounds follow by specializing a general four-shore representative budget theorem to each block when the respective representative threshold is reached.

  1. The shores X, Y and partition blocks A, B, C, D are embedded into a four-shore, four-block framework satisfying pairwise disjointness, crossing-edge, and forbidden-block conditions.

    We define the four-shore family F = [X, Y, ∅, ∅], the four-block partition L = [A, B, C, D], and the forbidden block pairing forb = [1, 0, 3, 2] pairing A with B and C with D. Helper lemmas establish that the shores and blocks are pairwise disjoint, no shore has edges to pool U, the only cross-shore edges are between x and y, and no edges exist between forbidden block pairs. We also check by case analysis and arithmetic that each block has size at least 3, paired blocks sum to 2k, and x ∈ A = L 0 while y ∈ C = L 2.

    lines 28–52

    uses in1245_shores_disjoint, in1245_shores_pool_disjoint, in1245_blocks_disjoint, in1245_shores_cross, in1245_shores_pool_anti, Matrix.cons_val_zero, Matrix.cons_val_one, Matrix.cons_val_fin_one

      classical
      dsimp only
      let F : Fin 4 → Finset (Fin (4*k)) := in1245_shores X Y
      let L : Fin 4 → Finset (Fin (4*k)) := in1245_blocks A B C D
      let forb : Fin 4 → Fin 4 := ![1,0,3,2]
      have hFdis : ∀ i j, i ≠ j → Disjoint (F i) (F j) := in1245_shores_disjoint X Y hXY
      have hEdis : ∀ i, Disjoint (F i) U := in1245_shores_pool_disjoint X Y U hXU hYU
      have hBdis : ∀ i j, i ≠ j → Disjoint (L i) (L j) := in1245_blocks_disjoint A B C D hAB hAC hAD hBC hBD hCD
      have hcross4 : ∀ i j : Fin 4, i ≠ j → ∀ a ∈ F i, ∀ b ∈ F j, G.Adj a b →
          (i=0 ∧ j=1 ∧ a=x ∧ b=y) ∨ (i=1 ∧ j=0 ∧ a=y ∧ b=x) := in1245_shores_cross G X Y x y hcross
      have hEanti : ∀ i, ∀ a ∈ F i, ∀ u ∈ U, ¬ G.Adj a u := in1245_shores_pool_anti G X Y U hantiX hantiY
      have hforbid : ∀ b, ∀ a ∈ L b, ∀ w ∈ L (forb b), ¬ G.Adj a w := by
        intro i a ha v hv h
        fin_cases i <;> simp only [L,forb,in1245_blocks,Matrix.cons_val_zero,Matrix.cons_val_one,Matrix.cons_val_fin_one] at ha hv
        · exact hnoAB a ha v hv h
        · exact hnoAB v hv a ha h.symm
        · exact hnoCD a ha v hv h
        · exact hnoCD v hv a ha h.symm
      have hbf : ∀ b, b ≠ forb b := by intro i; fin_cases i <;> decide
      have hblocks : ∀ b, (L b).card+(L (forb b)).card=2*k := by
        intro i; fin_cases i <;> simp [L,forb,in1245_blocks,hA,hB,hC,hD] <;> omega
      have hmin : ∀ b, 3 ≤ (L b).card := by
        intro i; fin_cases i <;> simp [L,in1245_blocks,hA,hB,hC,hD] <;> omega
      have hxL : x ∈ L 0 := by simpa [L,in1245_blocks] using hxA
      have hyL : y ∈ L 2 := by simpa [L,in1245_blocks] using hyC
  2. A general four-shore representative budget inequality is established for any shore j and block b meeting the representative threshold.

    We instantiate the library theorem op1957_four_shore_representative_budget with the graph, shores F, blocks L, pool U, endpoints x and y, forbidden block pairing forb b, block sizes, and vertex degree bounds. This guarantees that if shore j has sufficiently many representatives in block b, the sum of the sizes of the other shores minus the forbidden block, plus the pool minus the forbidden block, plus 3, is at most the size of block b.

    lines 53–57

    uses op1957_four_shore_representative_budget, Fintype.card_fin

      have hrep (j b : Fin 4)
          (hh : (if (j=0 ∧ b=0) ∨ (j=1 ∧ b=2) then 2 else 1) ≤ (F j ∩ L b).card) :=
        op1957_four_shore_representative_budget G F L U x y hFdis hEdis hBdis hxL hyL hcross4 hEanti
          j b (forb b) (hbf b) (hforbid b) (2*k) (hmin b)
          (by have hb := hblocks b; have hm := hmin b; simp only [Fintype.card_fin]; omega) hdegree hh
  3. For any vertex set P, its size is the sum of its intersection sizes with A, B, C, D, and its difference with any block equals the sum of its intersections with the other three blocks.

    Because A, B, C, D partition the vertex set, finset_card_eq_sum_four_block_inter expresses |P| as the sum of its four block intersections. Subtracting the intersection with block B, C, or D using Finset.card_inter_add_card_sdiff expresses the cardinality of the set difference as the sum of the remaining three block intersections.

    lines 58–64

    uses finset_card_eq_sum_four_block_inter, Finset.card_inter_add_card_sdiff

      have hparts (P : Finset (Fin (4*k))) := finset_card_eq_sum_four_block_inter A B C D P hAB hAC hAD hBC hBD hCD hcover
      have hdiffB (P : Finset (Fin (4*k))) : (P \ B).card = (P ∩ A).card+(P ∩ C).card+(P ∩ D).card := by
        have hs := hparts P; have hd := Finset.card_inter_add_card_sdiff P B; omega
      have hdiffC (P : Finset (Fin (4*k))) : (P \ C).card = (P ∩ A).card+(P ∩ B).card+(P ∩ D).card := by
        have hs := hparts P; have hd := Finset.card_inter_add_card_sdiff P C; omega
      have hdiffD (P : Finset (Fin (4*k))) : (P \ D).card = (P ∩ A).card+(P ∩ B).card+(P ∩ C).card := by
        have hs := hparts P; have hd := Finset.card_inter_add_card_sdiff P D; omega
  4. Endpoints x and y do not belong to the non-host blocks or shores, so y ∈ Y \ B and x ∈ X \ D, and element erasures commute with set differences.

    Pairwise disjointness of blocks and shores ensures x does not belong to B, D, Y, or U, and y does not belong to B, D, X, or U. Therefore y ∈ Y \ B and x ∈ X \ D. By set extensionality and propositional logic, erasing y from Y \ B coincides with (Y \ {y}) \ B, and similarly for x and X \ D.

    lines 65–76

    uses Finset.disjoint_left.mp, Finset.mem_sdiff.mpr, and_assoc, and_left_comm, and_comm

      have hxB : x ∉ B := fun h => Finset.disjoint_left.mp hAB hxA h
      have hyB : y ∉ B := fun h => Finset.disjoint_left.mp hBC h hyC
      have hxD : x ∉ D := fun h => Finset.disjoint_left.mp hAD hxA h
      have hyD : y ∉ D := fun h => Finset.disjoint_left.mp hCD hyC h
      have hxY : x ∉ Y := fun h => Finset.disjoint_left.mp hXY hxX h
      have hyX : y ∉ X := fun h => Finset.disjoint_left.mp hXY h hyY
      have hxU : x ∉ U := fun h => Finset.disjoint_left.mp hXU hxX h
      have hyU : y ∉ U := fun h => Finset.disjoint_left.mp hYU hyY h
      have hyQB : y ∈ Y \ B := Finset.mem_sdiff.mpr ⟨hyY,hyB⟩
      have hxQD : x ∈ X \ D := Finset.mem_sdiff.mpr ⟨hxX,hxD⟩
      have hYerase : (Y.erase y) \ B = (Y \ B).erase y := by ext z; simp [and_assoc,and_left_comm,and_comm]
      have hXerase : (X.erase x) \ D = (X \ D).erase x := by ext z; simp [and_assoc,and_left_comm,and_comm]
  5. The non-neighbors of x outside B in Y \ {y} and U satisfy |(Y \ {y}) \ B| + |U \ B| ≤ 2.

    Vertex x has no neighbors in B by hypothesis, no neighbors in U by hantiX, and no neighbors in Y \ {y} because y is its only neighbor in Y. Applying the four-set non-neighbor bound theorem to x with forbidden set B of size 2k - 5 and minimum degree 2k + 2 bounds the sum of disjoint non-neighbor sets outside B by (4k - 1) - (2k - 5) - (2k + 2) = 2.

    lines 77–89

    uses Finset.mem_erase.mp, anticomplete_vertex_four_disjoint_nonneighbor_sets_bound, Fintype.card_fin, Finset.disjoint_of_subset_left, Finset.erase_subset

      have hbudgetX : ((Y.erase y) \ B).card + (U \ B).card ≤ 2 := by
        have hs : ∀ z, (z ∈ Y.erase y ∨ z ∈ U ∨ z ∈ (∅ : Finset (Fin (4*k))) ∨ z ∈ (∅ : Finset (Fin (4*k)))) → z ≠ x ∧ ¬ G.Adj x z := by
          intro z hz
          rcases hz with hz | hz | hz | hz
          · have hz' := Finset.mem_erase.mp hz
            exact ⟨fun he => hxY (he ▸ hz'.2),fun h => hz'.1 (hcross x hxX z hz'.2 h).2⟩
          · exact ⟨fun he => hxU (he ▸ hz),hantiX x hxX z hz⟩
          · simp at hz
          · simp at hz
        have hh := anticomplete_vertex_four_disjoint_nonneighbor_sets_bound G B x hxB (hnoAB x hxA) (2*k+4) 2
          (by simp only [Fintype.card_fin]; omega) (by have := hdegree x; omega)
          (Y.erase y) U ∅ ∅ hs (Finset.disjoint_of_subset_left (Finset.erase_subset y Y) hYU) (by simp) (by simp) (by simp) (by simp) (by simp)
        simpa using hh
  6. The non-neighbors of y outside D in X \ {x} and U satisfy |(X \ {x}) \ D| + |U \ D| ≤ c - 3.

    Similarly, vertex y has no neighbors in D by hypothesis, no neighbors in U by hantiY, and no neighbors in X \ {x} because x is its only neighbor in X. Applying the four-set non-neighbor bound theorem to y with forbidden set D of size 2k - c and minimum degree 2k + 2 bounds the sum of disjoint non-neighbor sets outside D by (4k - 1) - (2k - c) - (2k + 2) = c - 3.

    lines 90–102

    uses Finset.mem_erase.mp, anticomplete_vertex_four_disjoint_nonneighbor_sets_bound, Fintype.card_fin, Finset.disjoint_of_subset_left, Finset.erase_subset

      have hbudgetY : ((X.erase x) \ D).card + (U \ D).card ≤ c-3 := by
        have hs : ∀ z, (z ∈ X.erase x ∨ z ∈ U ∨ z ∈ (∅ : Finset (Fin (4*k))) ∨ z ∈ (∅ : Finset (Fin (4*k)))) → z ≠ y ∧ ¬ G.Adj y z := by
          intro z hz
          rcases hz with hz | hz | hz | hz
          · have hz' := Finset.mem_erase.mp hz
            exact ⟨fun he => hyX (he ▸ hz'.2),fun h => hz'.1 (hcross z hz'.2 y hyY h.symm).1⟩
          · exact ⟨fun he => hyU (he ▸ hz),hantiY y hyY z hz⟩
          · simp at hz
          · simp at hz
        have hh := anticomplete_vertex_four_disjoint_nonneighbor_sets_bound G D y hyD (hnoCD y hyC) (2*k+c-1) (c-3)
          (by simp only [Fintype.card_fin]; omega) (by have := hdegree y; omega)
          (X.erase x) U ∅ ∅ hs (Finset.disjoint_of_subset_left (Finset.erase_subset x X) hXU) (by simp) (by simp) (by simp) (by simp) (by simp)
        simpa using hh
  7. The endpoint non-neighbor bounds expand to a1 + c1 + d1 + a2 + c2 + d2 ≤ 3 and a0 + b0 + c0 + a2 + b2 + c2 + 2 ≤ c.

    Because y ∈ Y \ B, erasing y reduces the size of Y \ B by 1. Expanding |Y \ B| and |U \ B| into block intersection sums transforms the non-neighbor bound for x into a1 + c1 + d1 + a2 + c2 + d2 ≤ 3. By identical reasoning with x ∈ X \ D, the non-neighbor bound for y expands to a0 + b0 + c0 + a2 + b2 + c2 + 2 ≤ c.

    lines 103–112

    uses Finset.card_erase_of_mem, Finset.card_pos.mpr

      have hxcount : (Y ∩ A).card+(Y ∩ C).card+(Y ∩ D).card+(U ∩ A).card+(U ∩ C).card+(U ∩ D).card ≤ 3 := by
        rw [hYerase,Finset.card_erase_of_mem hyQB,hdiffB Y,hdiffB U] at hbudgetX
        have hp := Finset.card_pos.mpr ⟨y,hyQB⟩
        rw [hdiffB Y] at hp
        omega
      have hycount : (X ∩ A).card+(X ∩ B).card+(X ∩ C).card+(U ∩ A).card+(U ∩ B).card+(U ∩ C).card+2 ≤ c := by
        rw [hXerase,Finset.card_erase_of_mem hxQD,hdiffD X,hdiffD U] at hbudgetY
        have hp := Finset.card_pos.mpr ⟨x,hxQD⟩
        rw [hdiffD X] at hp
        omega
  8. The intersection sizes with block C satisfy c1 + c2 ≤ 2.

    The defect condition states that the set P of non-neighbors of x in C has cardinality at most 1. The sets (Y ∩ C) \ {y} and U ∩ C are disjoint and both consist of non-neighbors of x lying in C, so their union is a subset of P. Hence |(Y ∩ C) \ {y}| + |U ∩ C| ≤ |P| ≤ 1. Since y ∈ Y ∩ C, this yields (c1 - 1) + c2 ≤ 1, so c1 + c2 ≤ 2.

    lines 113–132

    uses Finset.mem_union.mp, Finset.mem_erase.mp, Finset.mem_inter.mp, Finset.mem_filter.mpr, Finset.disjoint_of_subset_left, Finset.Subset.trans, Finset.erase_subset, Finset.inter_subset_left, Finset.disjoint_of_subset_right, Finset.mem_inter.mpr, Finset.card_le_card, Finset.card_union_of_disjoint, Finset.card_erase_of_mem, Finset.card_pos.mpr

      let P := C.filter (fun w => ¬ G.Adj x w)
      have hCsub : ((Y ∩ C).erase y) ∪ (U ∩ C) ⊆ P := by
        intro z hz
        rcases Finset.mem_union.mp hz with hz | hz
        · have he := Finset.mem_erase.mp hz
          have hyc := Finset.mem_inter.mp he.2
          have hn : ¬ G.Adj x z := fun h => he.1 (hcross x hxX z hyc.1 h).2
          exact Finset.mem_filter.mpr ⟨hyc.2,hn⟩
        · have hu := Finset.mem_inter.mp hz
          exact Finset.mem_filter.mpr ⟨hu.2,hantiX x hxX z hu.1⟩
      have hCdis : Disjoint ((Y ∩ C).erase y) (U ∩ C) :=
        Finset.disjoint_of_subset_left (Finset.Subset.trans (Finset.erase_subset y (Y ∩ C)) Finset.inter_subset_left)
          (Finset.disjoint_of_subset_right Finset.inter_subset_left hYU)
      have hyYC : y ∈ Y ∩ C := Finset.mem_inter.mpr ⟨hyY,hyC⟩
      have hcsmall : (Y ∩ C).card+(U ∩ C).card ≤ 2 := by
        have hh := Finset.card_le_card hCsub
        rw [Finset.card_union_of_disjoint hCdis,Finset.card_erase_of_mem hyYC] at hh
        have hp := Finset.card_pos.mpr ⟨y,hyYC⟩
        dsimp [P] at hh
        omega
  9. The base endpoint intersections are nonempty: 1 ≤ a0 and 1 ≤ c1.

    Because x ∈ X ∩ A and y ∈ Y ∩ C, both intersection sets are nonempty, ensuring their cardinalities are at least 1. We also precompute the complement index sets {1, 2, 3} and {0, 2, 3} in Fin 4 by exhaustive evaluation.

    lines 133–136

    uses Finset.card_pos.mpr, Finset.mem_inter.mpr

      have ha0 : 1 ≤ (X ∩ A).card := Finset.card_pos.mpr ⟨x,Finset.mem_inter.mpr ⟨hxX,hxA⟩⟩
      have hc1 : 1 ≤ (Y ∩ C).card := Finset.card_pos.mpr ⟨y,hyYC⟩
      have hE0 : (Finset.univ : Finset (Fin 4)).erase 0 = {1,2,3} := by decide
      have hE1 : (Finset.univ : Finset (Fin 4)).erase 1 = {0,2,3} := by decide
  10. The five conditional representative budget inequalities hold.

    For each condition, the representative threshold allows applying hrep to the appropriate shore and block. Evaluating the sum of the remaining three shores with Fin.sum_univ_four and expanding set differences into block intersections yields the desired bound via linear arithmetic: 2 ≤ a0 implies a1 + c1 + d1 + a2 + c2 + d2 ≤ 2; 1 ≤ c0 implies a1 + b1 + c1 + a2 + b2 + c2 + 3 ≤ c; 1 ≤ d0 implies a1 + b1 + d1 + a2 + b2 + d2 + c + 3 ≤ 2k; 1 ≤ a1 implies a0 + c0 + d0 + a2 + c2 + d2 ≤ 2; and 2 ≤ c1 implies a0 + b0 + c0 + a2 + b2 + c2 + 3 ≤ c.

    lines 137–161

    uses Fin.sum_univ_four

      have hrepA0 : 2 ≤ (X ∩ A).card → (Y ∩ A).card+(Y ∩ C).card+(Y ∩ D).card+(U ∩ A).card+(U ∩ C).card+(U ∩ D).card ≤ 2 := by
        intro hh
        have hr := hrep 0 0 (by simpa [F,L,in1245_shores,in1245_blocks] using hh)
        simp [F,L,forb,in1245_shores,in1245_blocks,Fin.sum_univ_four,hE0,hE1,hA,hdiffB] at hr
        omega
      have hrepC0 : 1 ≤ (X ∩ C).card → (Y ∩ A).card+(Y ∩ B).card+(Y ∩ C).card+(U ∩ A).card+(U ∩ B).card+(U ∩ C).card+3 ≤ c := by
        intro hh
        have hr := hrep 0 2 (by simpa [F,L,in1245_shores,in1245_blocks] using hh)
        simp [F,L,forb,in1245_shores,in1245_blocks,Fin.sum_univ_four,hE0,hE1,hC,hdiffD] at hr
        omega
      have hrepD0 : 1 ≤ (X ∩ D).card → (Y ∩ A).card+(Y ∩ B).card+(Y ∩ D).card+(U ∩ A).card+(U ∩ B).card+(U ∩ D).card+c+3 ≤ 2*k := by
        intro hh
        have hr := hrep 0 3 (by simpa [F,L,in1245_shores,in1245_blocks] using hh)
        simp [F,L,forb,in1245_shores,in1245_blocks,Fin.sum_univ_four,hE0,hE1,hD,hdiffC] at hr
        omega
      have hrepA1 : 1 ≤ (Y ∩ A).card → (X ∩ A).card+(X ∩ C).card+(X ∩ D).card+(U ∩ A).card+(U ∩ C).card+(U ∩ D).card ≤ 2 := by
        intro hh
        have hr := hrep 1 0 (by simpa [F,L,in1245_shores,in1245_blocks] using hh)
        simp [F,L,forb,in1245_shores,in1245_blocks,Fin.sum_univ_four,hE0,hE1,hA,hdiffB] at hr
        omega
      have hrepC1 : 2 ≤ (Y ∩ C).card → (X ∩ A).card+(X ∩ B).card+(X ∩ C).card+(U ∩ A).card+(U ∩ B).card+(U ∩ C).card+3 ≤ c := by
        intro hh
        have hr := hrep 1 2 (by simpa [F,L,in1245_shores,in1245_blocks] using hh)
        simp [F,L,forb,in1245_shores,in1245_blocks,Fin.sum_univ_four,hE0,hE1,hC,hdiffD] at hr
        omega
  11. All ten numeric bounds of the theorem statement hold simultaneously.

    We assemble the ten established bounds into a single conjunction to conclude the proof.

    line 162

      exact ⟨ha0,hc1,hcsmall,hxcount,hycount,hrepA0,hrepC0,hrepD0,hrepA1,hrepC1⟩
Fin.sum_univ_four
A sum of a function over the four-element index set Fin 4 equals the sum of its values at 0, 1, 2, and 3.
Finset.card_erase_of_mem
Removing an element that belongs to a finite set decreases its cardinality by 1.
Finset.card_inter_add_card_sdiff
The cardinality of a finite set is the sum of the cardinalities of its intersection and its set difference with another set.
Finset.card_le_card
If a finite set is a subset of another finite set, its cardinality is at most the other set's cardinality.
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 sets are disjoint, any element belonging to the first set does not belong to the second set.
Finset.disjoint_of_subset_left
A subset of a set disjoint from a third set is also disjoint from that third set.
Finset.disjoint_of_subset_right
If a set is disjoint from a second set, it is also disjoint from any subset of that second set.
Finset.erase_subset
Removing an element from a set yields a subset of the original set.
Finset.inter_subset_left
The intersection of two sets is a subset of the first set.
Finset.mem_erase.mp
An element of a set with an element removed belongs to the set and is not equal to that element.
Finset.mem_filter.mpr
An element in a set that satisfies a predicate belongs to the filtered subset.
Finset.mem_inter.mp
An element of the intersection of two sets belongs to both sets.
Finset.mem_inter.mpr
If an element belongs to both of two sets, it belongs to their intersection.
Finset.mem_sdiff.mpr
An element belongs to the set difference of two sets if it belongs to the first and not to the second.
Finset.mem_union.mp
An element of the union of two sets belongs to at least one of them.
Finset.Subset.trans
The subset relation on sets is transitive.
Fintype.card_fin
The cardinality of the standard finite set Fin n of n elements is n.
Matrix.cons_val_one
The first component of a vector formed by prepending an element to a vector is the zeroth component of the tail vector.
Matrix.cons_val_zero
The zeroth component of a vector formed by prepending an element to another vector is that prepended element.
Matrix.cons_val_fin_one
Evaluating a one-element vector at its unique index yields that element.
and_assoc
Logical conjunction is associative.
and_comm
Logical conjunction is commutative.
and_left_comm
The first two conjuncts in a conjunction can be swapped.
anticomplete_vertex_four_disjoint_nonneighbor_sets_bound
For a vertex anticomplete to a set Q, if the graph order is |Q| + d + 1 and the vertex has degree at least d - r, then the sum of sizes of any four disjoint non-neighbor sets outside Q is at most r.
finset_card_eq_sum_four_block_inter
If four sets partition the vertex universe, the cardinality of any set equals the sum of the cardinalities of its intersections with the four partition blocks.
in1245_blocks_disjoint
If four sets are pairwise disjoint, then the four-element vector formed from them has pairwise disjoint components.
in1245_shores_cross
If cross edges between two shores are restricted to a single endpoint pair, then cross edges between the components of the padded four-shore vector are restricted to that same pair.
in1245_shores_disjoint
If two shores are disjoint, the padded four-shore vector has pairwise disjoint components.
in1245_shores_pool_anti
If two shores have no edges to a pool set, no component of the padded four-shore vector has edges to that pool set.
in1245_shores_pool_disjoint
If two shores are each disjoint from a pool set, every component of the padded four-shore vector is disjoint from that pool set.
op1957_four_shore_representative_budget
In a graph with four shores and four blocks, if a shore-block pair meets the representative threshold, the sum of the remaining shore differences with the paired forbidden block plus the pool difference plus 3 is at most the block size.

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 op1957_one_defect_endpoint_numeric_bounds    (k c : ℕ) (hc : 5 ≤ c) (hkc : c ≤ k)    (G : SimpleGraph (Fin (4*k))) [DecidableRel G.Adj]    (A B C D X Y U : Finset (Fin (4*k)))    (hAB : Disjoint A B) (hAC : Disjoint A C) (hAD : Disjoint A D)    (hBC : Disjoint B C) (hBD : Disjoint B D) (hCD : Disjoint C D)    (hcover : A ∪ B ∪ C ∪ D = Finset.univ)    (hA : A.card=5) (hB : B.card=2*k-5) (hC : C.card=c) (hD : D.card=2*k-c)    (hnoAB : ∀ a ∈ A, ∀ b ∈ B, ¬ G.Adj a b)    (hnoCD : ∀ a ∈ C, ∀ b ∈ D, ¬ G.Adj a b)    (hdegree : ∀ v, 2*k+2 ≤ (G.neighborFinset v).card)    (x y : Fin (4*k)) (hxA : x ∈ A) (hyC : y ∈ C) (hxX : x ∈ X) (hyY : y ∈ Y)    (hXY : Disjoint X Y) (hXU : Disjoint X U) (hYU : Disjoint Y U)    (hcross : ∀ a ∈ X, ∀ b ∈ Y, G.Adj a b → a=x ∧ b=y)    (hantiX : ∀ a ∈ X, ∀ u ∈ U, ¬ G.Adj a u)    (hantiY : ∀ a ∈ Y, ∀ u ∈ U, ¬ G.Adj a u)    (hdefect : (C.filter (fun w => ¬ G.Adj x w)).card ≤ 1) :    let a0 := (X ∩ A).card; let b0 := (X ∩ B).card; let c0 := (X ∩ C).card; let d0 := (X ∩ D).card    let a1 := (Y ∩ A).card; let b1 := (Y ∩ B).card; let c1 := (Y ∩ C).card; let d1 := (Y ∩ D).card    let a2 := (U ∩ A).card; let b2 := (U ∩ B).card; let c2 := (U ∩ C).card; let d2 := (U ∩ D).card    1 ≤ a0 ∧ 1 ≤ c1 ∧ c1+c2 ≤ 2 ∧    a1+c1+d1+a2+c2+d2 ≤ 3 ∧ a0+b0+c0+a2+b2+c2+2 ≤ c ∧    (2 ≤ a0 → a1+c1+d1+a2+c2+d2 ≤ 2) ∧    (1 ≤ c0 → a1+b1+c1+a2+b2+c2+3 ≤ c) ∧    (1 ≤ d0 → a1+b1+d1+a2+b2+d2+c+3 ≤ 2*k) ∧    (1 ≤ a1 → a0+c0+d0+a2+c2+d2 ≤ 2) ∧    (2 ≤ c1 → a0+b0+c0+a2+b2+c2+3 ≤ c) := by  classical  dsimp only  let F : Fin 4 → Finset (Fin (4*k)) := in1245_shores X Y  let L : Fin 4 → Finset (Fin (4*k)) := in1245_blocks A B C D  let forb : Fin 4 → Fin 4 := ![1,0,3,2]  have hFdis : ∀ i j, i ≠ j → Disjoint (F i) (F j) := in1245_shores_disjoint X Y hXY  have hEdis : ∀ i, Disjoint (F i) U := in1245_shores_pool_disjoint X Y U hXU hYU  have hBdis : ∀ i j, i ≠ j → Disjoint (L i) (L j) := in1245_blocks_disjoint A B C D hAB hAC hAD hBC hBD hCD  have hcross4 : ∀ i j : Fin 4, i ≠ j → ∀ a ∈ F i, ∀ b ∈ F j, G.Adj a b →      (i=0 ∧ j=1 ∧ a=x ∧ b=y) ∨ (i=1 ∧ j=0 ∧ a=y ∧ b=x) := in1245_shores_cross G X Y x y hcross  have hEanti : ∀ i, ∀ a ∈ F i, ∀ u ∈ U, ¬ G.Adj a u := in1245_shores_pool_anti G X Y U hantiX hantiY  have hforbid : ∀ b, ∀ a ∈ L b, ∀ w ∈ L (forb b), ¬ G.Adj a w := by    intro i a ha v hv h    fin_cases i <;> simp only [L,forb,in1245_blocks,Matrix.cons_val_zero,Matrix.cons_val_one,Matrix.cons_val_fin_one] at ha hv    · exact hnoAB a ha v hv h    · exact hnoAB v hv a ha h.symm    · exact hnoCD a ha v hv h    · exact hnoCD v hv a ha h.symm  have hbf : ∀ b, b ≠ forb b := by intro i; fin_cases i <;> decide  have hblocks : ∀ b, (L b).card+(L (forb b)).card=2*k := by    intro i; fin_cases i <;> simp [L,forb,in1245_blocks,hA,hB,hC,hD] <;> omega  have hmin : ∀ b, 3 ≤ (L b).card := by    intro i; fin_cases i <;> simp [L,in1245_blocks,hA,hB,hC,hD] <;> omega  have hxL : x ∈ L 0 := by simpa [L,in1245_blocks] using hxA  have hyL : y ∈ L 2 := by simpa [L,in1245_blocks] using hyC  have hrep (j b : Fin 4)      (hh : (if (j=0 ∧ b=0) ∨ (j=1 ∧ b=2) then 2 else 1) ≤ (F j ∩ L b).card) :=    op1957_four_shore_representative_budget G F L U x y hFdis hEdis hBdis hxL hyL hcross4 hEanti      j b (forb b) (hbf b) (hforbid b) (2*k) (hmin b)      (by have hb := hblocks b; have hm := hmin b; simp only [Fintype.card_fin]; omega) hdegree hh  have hparts (P : Finset (Fin (4*k))) := finset_card_eq_sum_four_block_inter A B C D P hAB hAC hAD hBC hBD hCD hcover  have hdiffB (P : Finset (Fin (4*k))) : (P \ B).card = (P ∩ A).card+(P ∩ C).card+(P ∩ D).card := by    have hs := hparts P; have hd := Finset.card_inter_add_card_sdiff P B; omega  have hdiffC (P : Finset (Fin (4*k))) : (P \ C).card = (P ∩ A).card+(P ∩ B).card+(P ∩ D).card := by    have hs := hparts P; have hd := Finset.card_inter_add_card_sdiff P C; omega  have hdiffD (P : Finset (Fin (4*k))) : (P \ D).card = (P ∩ A).card+(P ∩ B).card+(P ∩ C).card := by    have hs := hparts P; have hd := Finset.card_inter_add_card_sdiff P D; omega  have hxB : x ∉ B := fun h => Finset.disjoint_left.mp hAB hxA h  have hyB : y ∉ B := fun h => Finset.disjoint_left.mp hBC h hyC  have hxD : x ∉ D := fun h => Finset.disjoint_left.mp hAD hxA h  have hyD : y ∉ D := fun h => Finset.disjoint_left.mp hCD hyC h  have hxY : x ∉ Y := fun h => Finset.disjoint_left.mp hXY hxX h  have hyX : y ∉ X := fun h => Finset.disjoint_left.mp hXY h hyY  have hxU : x ∉ U := fun h => Finset.disjoint_left.mp hXU hxX h  have hyU : y ∉ U := fun h => Finset.disjoint_left.mp hYU hyY h  have hyQB : y ∈ Y \ B := Finset.mem_sdiff.mpr ⟨hyY,hyB⟩  have hxQD : x ∈ X \ D := Finset.mem_sdiff.mpr ⟨hxX,hxD⟩  have hYerase : (Y.erase y) \ B = (Y \ B).erase y := by ext z; simp [and_assoc,and_left_comm,and_comm]  have hXerase : (X.erase x) \ D = (X \ D).erase x := by ext z; simp [and_assoc,and_left_comm,and_comm]  have hbudgetX : ((Y.erase y) \ B).card + (U \ B).card ≤ 2 := by    have hs : ∀ z, (z ∈ Y.erase y ∨ z ∈ U ∨ z ∈ (∅ : Finset (Fin (4*k))) ∨ z ∈ (∅ : Finset (Fin (4*k)))) → z ≠ x ∧ ¬ G.Adj x z := by      intro z hz      rcases hz with hz | hz | hz | hz      · have hz' := Finset.mem_erase.mp hz        exact ⟨fun he => hxY (he ▸ hz'.2),fun h => hz'.1 (hcross x hxX z hz'.2 h).2⟩      · exact ⟨fun he => hxU (he ▸ hz),hantiX x hxX z hz⟩      · simp at hz      · simp at hz    have hh := anticomplete_vertex_four_disjoint_nonneighbor_sets_bound G B x hxB (hnoAB x hxA) (2*k+4) 2      (by simp only [Fintype.card_fin]; omega) (by have := hdegree x; omega)      (Y.erase y) U ∅ ∅ hs (Finset.disjoint_of_subset_left (Finset.erase_subset y Y) hYU) (by simp) (by simp) (by simp) (by simp) (by simp)    simpa using hh  have hbudgetY : ((X.erase x) \ D).card + (U \ D).card ≤ c-3 := by    have hs : ∀ z, (z ∈ X.erase x ∨ z ∈ U ∨ z ∈ (∅ : Finset (Fin (4*k))) ∨ z ∈ (∅ : Finset (Fin (4*k)))) → z ≠ y ∧ ¬ G.Adj y z := by      intro z hz      rcases hz with hz | hz | hz | hz      · have hz' := Finset.mem_erase.mp hz        exact ⟨fun he => hyX (he ▸ hz'.2),fun h => hz'.1 (hcross z hz'.2 y hyY h.symm).1⟩      · exact ⟨fun he => hyU (he ▸ hz),hantiY y hyY z hz⟩      · simp at hz      · simp at hz    have hh := anticomplete_vertex_four_disjoint_nonneighbor_sets_bound G D y hyD (hnoCD y hyC) (2*k+c-1) (c-3)      (by simp only [Fintype.card_fin]; omega) (by have := hdegree y; omega)      (X.erase x) U ∅ ∅ hs (Finset.disjoint_of_subset_left (Finset.erase_subset x X) hXU) (by simp) (by simp) (by simp) (by simp) (by simp)    simpa using hh  have hxcount : (Y ∩ A).card+(Y ∩ C).card+(Y ∩ D).card+(U ∩ A).card+(U ∩ C).card+(U ∩ D).card ≤ 3 := by    rw [hYerase,Finset.card_erase_of_mem hyQB,hdiffB Y,hdiffB U] at hbudgetX    have hp := Finset.card_pos.mpr ⟨y,hyQB⟩    rw [hdiffB Y] at hp    omega  have hycount : (X ∩ A).card+(X ∩ B).card+(X ∩ C).card+(U ∩ A).card+(U ∩ B).card+(U ∩ C).card+2 ≤ c := by    rw [hXerase,Finset.card_erase_of_mem hxQD,hdiffD X,hdiffD U] at hbudgetY    have hp := Finset.card_pos.mpr ⟨x,hxQD⟩    rw [hdiffD X] at hp    omega  let P := C.filter (fun w => ¬ G.Adj x w)  have hCsub : ((Y ∩ C).erase y) ∪ (U ∩ C) ⊆ P := by    intro z hz    rcases Finset.mem_union.mp hz with hz | hz    · have he := Finset.mem_erase.mp hz      have hyc := Finset.mem_inter.mp he.2      have hn : ¬ G.Adj x z := fun h => he.1 (hcross x hxX z hyc.1 h).2      exact Finset.mem_filter.mpr ⟨hyc.2,hn⟩    · have hu := Finset.mem_inter.mp hz      exact Finset.mem_filter.mpr ⟨hu.2,hantiX x hxX z hu.1⟩  have hCdis : Disjoint ((Y ∩ C).erase y) (U ∩ C) :=    Finset.disjoint_of_subset_left (Finset.Subset.trans (Finset.erase_subset y (Y ∩ C)) Finset.inter_subset_left)      (Finset.disjoint_of_subset_right Finset.inter_subset_left hYU)  have hyYC : y ∈ Y ∩ C := Finset.mem_inter.mpr ⟨hyY,hyC⟩  have hcsmall : (Y ∩ C).card+(U ∩ C).card ≤ 2 := by    have hh := Finset.card_le_card hCsub    rw [Finset.card_union_of_disjoint hCdis,Finset.card_erase_of_mem hyYC] at hh    have hp := Finset.card_pos.mpr ⟨y,hyYC⟩    dsimp [P] at hh    omega  have ha0 : 1 ≤ (X ∩ A).card := Finset.card_pos.mpr ⟨x,Finset.mem_inter.mpr ⟨hxX,hxA⟩⟩  have hc1 : 1 ≤ (Y ∩ C).card := Finset.card_pos.mpr ⟨y,hyYC⟩  have hE0 : (Finset.univ : Finset (Fin 4)).erase 0 = {1,2,3} := by decide  have hE1 : (Finset.univ : Finset (Fin 4)).erase 1 = {0,2,3} := by decide  have hrepA0 : 2 ≤ (X ∩ A).card → (Y ∩ A).card+(Y ∩ C).card+(Y ∩ D).card+(U ∩ A).card+(U ∩ C).card+(U ∩ D).card ≤ 2 := by    intro hh    have hr := hrep 0 0 (by simpa [F,L,in1245_shores,in1245_blocks] using hh)    simp [F,L,forb,in1245_shores,in1245_blocks,Fin.sum_univ_four,hE0,hE1,hA,hdiffB] at hr    omega  have hrepC0 : 1 ≤ (X ∩ C).card → (Y ∩ A).card+(Y ∩ B).card+(Y ∩ C).card+(U ∩ A).card+(U ∩ B).card+(U ∩ C).card+3 ≤ c := by    intro hh    have hr := hrep 0 2 (by simpa [F,L,in1245_shores,in1245_blocks] using hh)    simp [F,L,forb,in1245_shores,in1245_blocks,Fin.sum_univ_four,hE0,hE1,hC,hdiffD] at hr    omega  have hrepD0 : 1 ≤ (X ∩ D).card → (Y ∩ A).card+(Y ∩ B).card+(Y ∩ D).card+(U ∩ A).card+(U ∩ B).card+(U ∩ D).card+c+3 ≤ 2*k := by    intro hh    have hr := hrep 0 3 (by simpa [F,L,in1245_shores,in1245_blocks] using hh)    simp [F,L,forb,in1245_shores,in1245_blocks,Fin.sum_univ_four,hE0,hE1,hD,hdiffC] at hr    omega  have hrepA1 : 1 ≤ (Y ∩ A).card → (X ∩ A).card+(X ∩ C).card+(X ∩ D).card+(U ∩ A).card+(U ∩ C).card+(U ∩ D).card ≤ 2 := by    intro hh    have hr := hrep 1 0 (by simpa [F,L,in1245_shores,in1245_blocks] using hh)    simp [F,L,forb,in1245_shores,in1245_blocks,Fin.sum_univ_four,hE0,hE1,hA,hdiffB] at hr    omega  have hrepC1 : 2 ≤ (Y ∩ C).card → (X ∩ A).card+(X ∩ B).card+(X ∩ C).card+(U ∩ A).card+(U ∩ B).card+(U ∩ C).card+3 ≤ c := by    intro hh    have hr := hrep 1 2 (by simpa [F,L,in1245_shores,in1245_blocks] using hh)    simp [F,L,forb,in1245_shores,in1245_blocks,Fin.sum_univ_four,hE0,hE1,hC,hdiffD] at hr    omega  exact ⟨ha0,hc1,hcsmall,hxcount,hycount,hrepA0,hrepC0,hrepD0,hrepA1,hrepC1⟩
See it in the graphDiscuss this resultChallenge it