AFTD Auto-Formalizing Theoretical Domains

op1957_ambient_odd_shores_to_component_barrier

theoremverified

An ambient odd-shore obstruction can be represented as disjoint odd endpoint shores, odd anticomplete groups, and a disjoint barrier of the same cardinality as the group family, with the total size preserved.

Statement

theorem op1957_ambient_odd_shores_to_component_barrier
    (k : ℕ) (G : SimpleGraph (Fin (4*k)))
    (X Y U : Finset (Fin (4*k))) (s : ℕ) (x y : Fin (4*k))
    (hXY : Disjoint X Y) (hXU : Disjoint X U) (hYU : Disjoint Y U)
    (hx : x ∈ X) (hy : y ∈ Y) (hoddX : Odd X.card) (hoddY : Odd Y.card)
    (hsize : X.card+Y.card+U.card+s=2*k)
    (hUodd : s ≤ (G.induce {v | v ∈ U}).oddComponents.ncard)
    (hUpar : U.card % 2 = s % 2)
    (hcross : ∀ a ∈ X, ∀ b ∈ Y, G.Adj a b → a=x ∧ b=y)
    (hantiX : ∀ a ∈ X, ∀ u ∈ U, ¬ G.Adj a u)
    (hantiY : ∀ b ∈ Y, ∀ u ∈ U, ¬ G.Adj b u) :
    ∃ (Y' S : Finset (Fin (4*k))) (t : ℕ) (T : Fin t → Finset (Fin (4*k))),
      x ∈ X ∧ y ∈ Y' ∧ Disjoint X Y' ∧ Disjoint X S ∧ Disjoint Y' S ∧
      (∀ i, Disjoint X (T i)) ∧ (∀ i, Disjoint Y' (T i)) ∧
      (∀ i, Disjoint S (T i)) ∧ (∀ i j, i ≠ j → Disjoint (T i) (T j)) ∧
      Odd X.card ∧ Odd Y'.card ∧ (∀ i, Odd (T i).card) ∧ S.card=t ∧
      (X ∪ Y' ∪ Finset.univ.biUnion T ∪ S).card=2*k ∧
      (∀ a ∈ X, ∀ b ∈ Y', G.Adj a b → a=x ∧ b=y) ∧
      (∀ i, ∀ a ∈ X, ∀ u ∈ T i, ¬ G.Adj a u) ∧
      (∀ i, ∀ b ∈ Y', ∀ u ∈ T i, ¬ G.Adj b u) ∧
      (∀ i j, i ≠ j → ∀ u ∈ T i, ∀ v ∈ T j, ¬ G.Adj u v)
Source
OP-1957: transfer from ambient odd shores to a component barrier
Verified
29 Nov 2026
Axioms
Classical.choiceQuot.soundpropext
Built on 2
Used by 1

The proof, explained

The proof proceeds by case distinction on whether the barrier parameter s is zero or positive. When s = 0, the reservoir U has even cardinality and is absorbed directly into the shore Y via in1159_absorb_even_reservoir_of_even_total, setting the barrier S to empty and the family T to the empty family. When s ≥ 1, lemma op1957_odd_components_ambient_partition partitions U into s mutually anticomplete odd-sized groups T_i, and a disjoint barrier S of cardinality s is selected from the complement of X ∪ Y ∪ U in the 4k-element ambient vertex set.

  1. We split into cases based on whether s = 0 or s ≥ 1.

    The argument branches on whether the required number of odd components s is zero or positive. When s = 0, no barrier or odd groups are needed, whereas when s ≥ 1, U provides s odd groups and a barrier of size s must be selected from the ambient graph.

    lines 24–25

      classical
      by_cases hs : s=0
  2. When s = 0, the set U has even cardinality and can be absorbed into Y to form a single odd shore Y ∪ U.

    Since s = 0, the size equation reduces to |X| + |Y| + |U| = 2k, and the parity condition |U| ≡ s (mod 2) implies that |U| is even. By lemma in1159_absorb_even_reservoir_of_even_total, Y ∪ U is disjoint from X, has odd cardinality, contains y, preserves the unique cross-edge condition between X and Y ∪ U, and satisfies |X| + |Y ∪ U| = 2k.

    lines 26–31

    uses in1159_absorb_even_reservoir_of_even_total

      · have hsize0 : X.card+Y.card+U.card=2*k := by omega
        have hanti : ∀ u ∈ U, ∀ a ∈ X, ¬ G.Adj u a := by
          intro u hu a ha h
          exact hantiX a ha u hu h.symm
        obtain ⟨hXYU,hXYUsize,_,hyYU,hoddYU,hcrossYU⟩ :=
          in1159_absorb_even_reservoir_of_even_total G X Y U x y k hXY hXU hYU hsize0 hx hy hcross hanti hoddX hoddY
  3. When s = 0, the conclusion holds by choosing Y' = Y ∪ U, barrier S = ∅, and the empty family T on Fin 0.

    We instantiate the existential quantifiers with Y' = Y ∪ U, S = ∅, t = 0, and T as the unique empty map from Fin 0. The barrier size condition |S| = 0 = t holds trivially, all conditions involving elements of Fin 0 are vacuously true by Fin.elim0, and the union cardinality |(X ∪ (Y ∪ U)) ∪ ∅| = 2k follows from Finset.card_union_of_disjoint.

    lines 32–41

    uses Fin.elim0, Finset.card_union_of_disjoint

        refine ⟨Y ∪ U,∅,0,fun i => Fin.elim0 i, hx,hyYU,hXYU,by simp,by simp,?_,?_,?_,?_,hoddX,hoddYU,?_,by simp,?_,hcrossYU,?_,?_,?_⟩
        · intro i; exact Fin.elim0 i
        · intro i; exact Fin.elim0 i
        · intro i; exact Fin.elim0 i
        · intro i; exact Fin.elim0 i
        · intro i; exact Fin.elim0 i
        · simpa [Finset.card_union_of_disjoint hXYU] using hXYUsize
        · intro i; exact Fin.elim0 i
        · intro i; exact Fin.elim0 i
        · intro i; exact Fin.elim0 i
  4. When s ≥ 1, U can be partitioned into s pairwise disjoint, mutually anticomplete odd-sized subsets T_i.

    Since s ≥ 1, the hypothesis s ≤ oddComponents(G[U]) and parity condition |U| ≡ s (mod 2) allow applying lemma op1957_odd_components_ambient_partition. This decomposes U into a family T : Fin s → Finset (Fin (4*k)) of s odd subsets that partition U and have no edges between distinct parts.

    lines 42–43

    uses op1957_odd_components_ambient_partition

      · have hspos : 1 ≤ s := by omega
        obtain ⟨T,hTodd,hTdis,hTcover⟩ := op1957_odd_components_ambient_partition G U s hspos hUodd hUpar
  5. The union W = X ∪ Y ∪ U has cardinality |W| = |X| + |Y| + |U|.

    Since X and Y are disjoint from U, their union X ∪ Y is disjoint from U by Finset.disjoint_union_left.mpr. Applying Finset.card_union_of_disjoint twice confirms that |W| = |X| + |Y| + |U|.

    lines 44–47

    uses Finset.disjoint_union_left.mpr, Finset.card_union_of_disjoint

        let W := X ∪ Y ∪ U
        have hXYU : Disjoint (X ∪ Y) U := Finset.disjoint_union_left.mpr ⟨hXU,hYU⟩
        have hWcard : W.card=X.card+Y.card+U.card := by
          simp only [W,Finset.card_union_of_disjoint hXYU,Finset.card_union_of_disjoint hXY]
  6. There exists a barrier subset S ⊆ univ \ W of size s.

    The ambient graph has 4k vertices, so |univ| = 4k. Since |W| = 2k - s ≤ 2k, the complement univ \ W has cardinality 4k - |W| = 2k + s ≥ s by Finset.card_sdiff_of_subset, Finset.subset_univ, Finset.card_univ, and Fintype.card_fin. Lemma Finset.exists_subset_card_eq then supplies a subset S ⊆ univ \ W with |S| = s.

    lines 48–52

    uses Finset.card_sdiff_of_subset, Finset.subset_univ, Finset.card_univ, Fintype.card_fin, Finset.exists_subset_card_eq

        have hscard : s ≤ ((Finset.univ : Finset (Fin (4*k))) \ W).card := by
          rw [Finset.card_sdiff_of_subset (Finset.subset_univ W)]
          simp only [Finset.card_univ,Fintype.card_fin]
          omega
        obtain ⟨S,hSsub,hSsize⟩ := Finset.exists_subset_card_eq hscard
  7. The barrier S is disjoint from W, and consequently disjoint from X, Y, and U.

    Because S ⊆ univ \ W, no element of S belongs to W by Finset.mem_sdiff.mp, so W and S are disjoint by Finset.disjoint_left.mpr. Since X, Y, and U are subsets of W (using Finset.subset_union_left, Finset.subset_union_right, and Finset.Subset.trans), Finset.disjoint_of_subset_left implies that X, Y, and U are each disjoint from S.

    lines 53–61

    uses Finset.disjoint_left.mpr, Finset.mem_sdiff.mp, Finset.disjoint_of_subset_left, Finset.Subset.trans, Finset.subset_union_left, Finset.subset_union_right

        have hWS : Disjoint W S := by
          apply Finset.disjoint_left.mpr
          intro v hvw hvs
          exact (Finset.mem_sdiff.mp (hSsub hvs)).2 hvw
        have hXS : Disjoint X S := Finset.disjoint_of_subset_left
          (Finset.Subset.trans (Finset.subset_union_left : X ⊆ X ∪ Y) Finset.subset_union_left) hWS
        have hYS : Disjoint Y S := Finset.disjoint_of_subset_left
          (Finset.Subset.trans (Finset.subset_union_right : Y ⊆ X ∪ Y) Finset.subset_union_left) hWS
        have hUS : Disjoint U S := Finset.disjoint_of_subset_left Finset.subset_union_right hWS
  8. Each part T_i is disjoint from X, Y, and S.

    Since each T_i ⊆ U and U is disjoint from X, Y, and S, Finset.disjoint_of_subset_right shows that every T_i is disjoint from X, Y, and S.

    lines 62–67

    uses Finset.disjoint_of_subset_right

        have hXT : ∀ i, Disjoint X (T i) := by
          intro i; exact Finset.disjoint_of_subset_right (hTodd i).1 hXU
        have hYT : ∀ i, Disjoint Y (T i) := by
          intro i; exact Finset.disjoint_of_subset_right (hTodd i).1 hYU
        have hST : ∀ i, Disjoint S (T i) := by
          intro i; exact Finset.disjoint_of_subset_right (hTodd i).1 hUS.symm
  9. The choices Y' = Y, barrier S, count t = s, and family T satisfy all required conditions.

    We instantiate the existential witness with Y' = Y, S, t = s, and T. The endpoints x ∈ X and y ∈ Y, parity of |X| and |Y|, and the unique cross-edge condition between X and Y hold by hypothesis. All mutual disjointness conditions were proven in the preceding steps. Since the union of the T_i is U, the total union is W ∪ S, which has size |W| + |S| = (|X| + |Y| + |U|) + s = 2k by Finset.card_union_of_disjoint. The oddness and mutual anticompleteness of the T_i, as well as anticompleteness from X and Y to T_i ⊆ U, follow directly from the construction of T and the hypotheses on U.

    lines 68–77

    uses Finset.card_union_of_disjoint

        refine ⟨Y,S,s,T,hx,hy,hXY,hXS,hYS,hXT,hYT,hST,?_,hoddX,hoddY,?_,hSsize,?_,hcross,?_,?_,?_⟩
        · intro i j hij; exact (hTdis i j hij).1
        · intro i; exact (hTodd i).2
        · rw [hTcover]
          change (W ∪ S).card=2*k
          rw [Finset.card_union_of_disjoint hWS,hWcard,hSsize]
          omega
        · intro i a ha u hu; exact hantiX a ha u ((hTodd i).1 hu)
        · intro i b hb u hu; exact hantiY b hb u ((hTodd i).1 hu)
        · intro i j hij; exact (hTdis i j hij).2
in1159_absorb_even_reservoir_of_even_total
If X, Y, U are pairwise disjoint with x ∈ X, y ∈ Y, |X| and |Y| odd, |X| + |Y| + |U| = 2k, with only (x, y) crossing between X and Y and U anticomplete to X, then Y ∪ U is an odd shore disjoint from X satisfying the same cross-edge property and |X| + |Y ∪ U| = 2k.
Fin.elim0
Principle of explosion for the empty type Fin 0: given an element of Fin 0, any proposition holds.
Finset.card_union_of_disjoint
The cardinality of the union of two disjoint finite sets is the sum of their cardinalities: |A ∪ B| = |A| + |B|.
op1957_odd_components_ambient_partition
If 1 ≤ s ≤ oddComponents(G[U]) and |U| ≡ s (mod 2), then U can be partitioned into s pairwise disjoint, mutually anticomplete odd-sized subsets.
Finset.disjoint_union_left.mpr
If A and B are both disjoint from C, then A ∪ B is disjoint from C.
Finset.card_sdiff_of_subset
If A ⊆ B, the cardinality of set difference is |B \ A| = |B| - |A|.
Finset.subset_univ
Any finite set of elements of a type is a subset of the universal finset of that type.
Finset.card_univ
The cardinality of the universal finset of a finite type equals the cardinality of the type.
Fintype.card_fin
The cardinality of the standard finite type Fin n is n.
Finset.exists_subset_card_eq
If n ≤ |A|, there exists a subset of A of cardinality n.
Finset.disjoint_left.mpr
Two sets are disjoint if no element of the first belongs to the second.
Finset.mem_sdiff.mp
If an element belongs to A \ B, then it belongs to A and does not belong to B.
Finset.disjoint_of_subset_left
If A ⊆ C and C is disjoint from B, then A is disjoint from B.
Finset.Subset.trans
Subset inclusion is transitive: if A ⊆ B and B ⊆ C, then A ⊆ C.
Finset.subset_union_left
A set is a subset of its union with another set: A ⊆ A ∪ B.
Finset.subset_union_right
A set is a subset of the union of another set with it: B ⊆ A ∪ B.
Finset.disjoint_of_subset_right
If B ⊆ C and A is disjoint from C, then A is disjoint from B.

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

set_option maxHeartbeats 2000000theorem op1957_ambient_odd_shores_to_component_barrier    (k : ℕ) (G : SimpleGraph (Fin (4*k)))    (X Y U : Finset (Fin (4*k))) (s : ℕ) (x y : Fin (4*k))    (hXY : Disjoint X Y) (hXU : Disjoint X U) (hYU : Disjoint Y U)    (hx : x ∈ X) (hy : y ∈ Y) (hoddX : Odd X.card) (hoddY : Odd Y.card)    (hsize : X.card+Y.card+U.card+s=2*k)    (hUodd : s ≤ (G.induce {v | v ∈ U}).oddComponents.ncard)    (hUpar : U.card % 2 = s % 2)    (hcross : ∀ a ∈ X, ∀ b ∈ Y, G.Adj a b → a=x ∧ b=y)    (hantiX : ∀ a ∈ X, ∀ u ∈ U, ¬ G.Adj a u)    (hantiY : ∀ b ∈ Y, ∀ u ∈ U, ¬ G.Adj b u) :    ∃ (Y' S : Finset (Fin (4*k))) (t : ℕ) (T : Fin t → Finset (Fin (4*k))),      x ∈ X ∧ y ∈ Y' ∧ Disjoint X Y' ∧ Disjoint X S ∧ Disjoint Y' S ∧      (∀ i, Disjoint X (T i)) ∧ (∀ i, Disjoint Y' (T i)) ∧      (∀ i, Disjoint S (T i)) ∧ (∀ i j, i ≠ j → Disjoint (T i) (T j)) ∧      Odd X.card ∧ Odd Y'.card ∧ (∀ i, Odd (T i).card) ∧ S.card=t ∧      (X ∪ Y' ∪ Finset.univ.biUnion T ∪ S).card=2*k ∧      (∀ a ∈ X, ∀ b ∈ Y', G.Adj a b → a=x ∧ b=y) ∧      (∀ i, ∀ a ∈ X, ∀ u ∈ T i, ¬ G.Adj a u) ∧      (∀ i, ∀ b ∈ Y', ∀ u ∈ T i, ¬ G.Adj b u) ∧      (∀ i j, i ≠ j → ∀ u ∈ T i, ∀ v ∈ T j, ¬ G.Adj u v) := by  classical  by_cases hs : s=0  · have hsize0 : X.card+Y.card+U.card=2*k := by omega    have hanti : ∀ u ∈ U, ∀ a ∈ X, ¬ G.Adj u a := by      intro u hu a ha h      exact hantiX a ha u hu h.symm    obtain ⟨hXYU,hXYUsize,_,hyYU,hoddYU,hcrossYU⟩ :=      in1159_absorb_even_reservoir_of_even_total G X Y U x y k hXY hXU hYU hsize0 hx hy hcross hanti hoddX hoddY    refine ⟨Y ∪ U,∅,0,fun i => Fin.elim0 i, hx,hyYU,hXYU,by simp,by simp,?_,?_,?_,?_,hoddX,hoddYU,?_,by simp,?_,hcrossYU,?_,?_,?_⟩    · intro i; exact Fin.elim0 i    · intro i; exact Fin.elim0 i    · intro i; exact Fin.elim0 i    · intro i; exact Fin.elim0 i    · intro i; exact Fin.elim0 i    · simpa [Finset.card_union_of_disjoint hXYU] using hXYUsize    · intro i; exact Fin.elim0 i    · intro i; exact Fin.elim0 i    · intro i; exact Fin.elim0 i  · have hspos : 1 ≤ s := by omega    obtain ⟨T,hTodd,hTdis,hTcover⟩ := op1957_odd_components_ambient_partition G U s hspos hUodd hUpar    let W := X ∪ Y ∪ U    have hXYU : Disjoint (X ∪ Y) U := Finset.disjoint_union_left.mpr ⟨hXU,hYU⟩    have hWcard : W.card=X.card+Y.card+U.card := by      simp only [W,Finset.card_union_of_disjoint hXYU,Finset.card_union_of_disjoint hXY]    have hscard : s ≤ ((Finset.univ : Finset (Fin (4*k))) \ W).card := by      rw [Finset.card_sdiff_of_subset (Finset.subset_univ W)]      simp only [Finset.card_univ,Fintype.card_fin]      omega    obtain ⟨S,hSsub,hSsize⟩ := Finset.exists_subset_card_eq hscard    have hWS : Disjoint W S := by      apply Finset.disjoint_left.mpr      intro v hvw hvs      exact (Finset.mem_sdiff.mp (hSsub hvs)).2 hvw    have hXS : Disjoint X S := Finset.disjoint_of_subset_left      (Finset.Subset.trans (Finset.subset_union_left : X ⊆ X ∪ Y) Finset.subset_union_left) hWS    have hYS : Disjoint Y S := Finset.disjoint_of_subset_left      (Finset.Subset.trans (Finset.subset_union_right : Y ⊆ X ∪ Y) Finset.subset_union_left) hWS    have hUS : Disjoint U S := Finset.disjoint_of_subset_left Finset.subset_union_right hWS    have hXT : ∀ i, Disjoint X (T i) := by      intro i; exact Finset.disjoint_of_subset_right (hTodd i).1 hXU    have hYT : ∀ i, Disjoint Y (T i) := by      intro i; exact Finset.disjoint_of_subset_right (hTodd i).1 hYU    have hST : ∀ i, Disjoint S (T i) := by      intro i; exact Finset.disjoint_of_subset_right (hTodd i).1 hUS.symm    refine ⟨Y,S,s,T,hx,hy,hXY,hXS,hYS,hXT,hYT,hST,?_,hoddX,hoddY,?_,hSsize,?_,hcross,?_,?_,?_⟩    · intro i j hij; exact (hTdis i j hij).1    · intro i; exact (hTodd i).2    · rw [hTcover]      change (W ∪ S).card=2*k      rw [Finset.card_union_of_disjoint hWS,hWcard,hSsize]      omega    · intro i a ha u hu; exact hantiX a ha u ((hTodd i).1 hu)    · intro i b hb u hu; exact hantiY b hb u ((hTodd i).1 hu)    · intro i j hij; exact (hTdis i j hij).2
See it in the graphDiscuss this resultChallenge it