AFTD Auto-Formalizing Theoretical Domains

empty_barrier_even_reservoir_absorb

theoremverified

For two odd anticomplete shores with a single permitted crossing edge and an anticomplete reservoir whose union has even size, absorbing the reservoir into the second shore preserves its odd cardinality and the crossing property.

Statement

theorem empty_barrier_even_reservoir_absorb
    {V : Type*} [Fintype V] [DecidableEq V] (G : SimpleGraph V)
    (X Y U : Finset V) (x y : V)
    (hXY : Disjoint X Y) (hXU : Disjoint X U) (hYU : Disjoint Y U)
    (hcover : X ∪ Y ∪ U = Finset.univ)
    (hx : x ∈ X) (hy : y ∈ Y)
    (hcross : ∀ a ∈ X, ∀ b ∈ Y, G.Adj a b → a=x ∧ b=y)
    (hanti : ∀ a ∈ U, ∀ b ∈ X, ¬ G.Adj a b)
    (hoddX : Odd X.card) (hoddY : Odd Y.card)
    (heven : Even (Fintype.card V)) :
    Disjoint X (Y ∪ U) ∧ X ∪ (Y ∪ U) = Finset.univ ∧
    x ∈ X ∧ y ∈ Y ∪ U ∧ Odd (Y ∪ U).card ∧
    (∀ a ∈ X, ∀ b ∈ Y ∪ U, G.Adj a b → a=x ∧ b=y)
Source
OP-1957; forced-edge saturated barrier reduction.
Verified
26 Nov 2026
Axioms
Classical.choiceQuot.soundpropext

The proof, explained

The theorem absorbs an anticomplete reservoir $U$ into the shore $Y$ in a partition $V = X ∪ Y ∪ U$ of an even-sized graph, where $|X|$ and $|Y|$ are odd and the only edge between $X$ and $Y$ is $\{x, y\}$. First, parity arithmetic ($|X| + |Y| + |U| = |V|$) forces $|U|$ to be even, so the enlarged shore $Y ∪ U$ remains of odd cardinality. Set-theoretic disjointness and covering for $X$ and $Y ∪ U$ follow from the pairwise disjointness and covering of the original partition. Finally, because $U$ has no edges to $X$, any edge between $X$ and $Y ∪ U$ must connect $X$ and $Y$, and is therefore $\{x, y\}$.

  1. $X ∪ Y$ and $U$ are disjoint.

    Working classically, suppose some $z \in X ∪ Y$ also satisfies $z \in U$. If $z \in X$, this contradicts the disjointness of $X$ and $U$; if $z \in Y$, it contradicts the disjointness of $Y$ and $U$.

    lines 14–20

    uses Finset.disjoint_left.mpr, Finset.mem_union.mp, Finset.disjoint_left.mp

      classical
      have hXYU : Disjoint (X ∪ Y) U := by
        apply Finset.disjoint_left.mpr
        intro z hz hzu
        rcases Finset.mem_union.mp hz with hzx | hzy
        · exact Finset.disjoint_left.mp hXU hzx hzu
        · exact Finset.disjoint_left.mp hYU hzy hzu
  2. $|X| + |Y| + |U| = |V|$.

    Because $X$ and $Y$ are disjoint, $|X| + |Y| = |X ∪ Y|$. Because $X ∪ Y$ and $U$ are disjoint, $|X ∪ Y| + |U| = |(X ∪ Y) ∪ U|$. Since the three sets cover $V$, the total cardinality equals $|V|$.

    lines 21–22

    uses Finset.card_union_of_disjoint, Finset.card_univ

      have hcard : X.card + Y.card + U.card = Fintype.card V := by
        rw [← Finset.card_union_of_disjoint hXY, ← Finset.card_union_of_disjoint hXYU, hcover, Finset.card_univ]
  3. The reservoir $U$ has even cardinality. automation

    Since $|V|$ is even and $|X|, |Y|$ are odd, we write $|V| = 2m$, $|X| = 2a + 1$, and $|Y| = 2b + 1$. By excluded middle, $|U|$ is either even or odd. If $|U|$ were odd, say $2c + 1$, then $|X| + |Y| + |U| = 2(a + b + c + 1) + 1$, an odd number, contradicting the equality with the even number $|V|$.

    lines 23–30

    uses Nat.even_or_odd

      have hu : Even U.card := by
        obtain ⟨m, hm⟩ := heven
        obtain ⟨a, ha⟩ := hoddX
        obtain ⟨b, hb⟩ := hoddY
        rcases Nat.even_or_odd U.card with h | h
        · exact h
        · obtain ⟨c,hc⟩ := h
          omega
  4. The union $Y ∪ U$ has odd cardinality.

    Because $Y$ and $U$ are disjoint, $|Y ∪ U| = |Y| + |U|$. The sum of the odd integer $|Y|$ and the even integer $|U|$ is odd.

    lines 31–33

    uses Finset.card_union_of_disjoint

      have hyu : Odd (Y ∪ U).card := by
        rw [Finset.card_union_of_disjoint hYU]
        exact hoddY.add_even hu
  5. It suffices to show that $X$ and $Y ∪ U$ are disjoint, cover $V$, and have $\{x, y\}$ as their sole crossing edge.

    We supply the witnesses and already-established facts for the conjunction: $x \in X$ holds by assumption, $y \in Y ∪ U$ holds because $y \in Y$, and $|Y ∪ U|$ is odd as shown above. This leaves three claims to verify.

    line 34

    uses Finset.mem_union_left

      refine ⟨?_, ?_, hx, Finset.mem_union_left U hy, hyu, ?_⟩
  6. $X$ and $Y ∪ U$ are disjoint.

    Take any $z \in X$ and suppose $z \in Y ∪ U$. Then either $z \in Y$, which contradicts the disjointness of $X$ and $Y$, or $z \in U$, which contradicts the disjointness of $X$ and $U$.

    lines 35–39

    uses Finset.disjoint_left.mpr, Finset.mem_union.mp, Finset.disjoint_left.mp

      · apply Finset.disjoint_left.mpr
        intro z hzx hz
        rcases Finset.mem_union.mp hz with hzy | hzu
        · exact Finset.disjoint_left.mp hXY hzx hzy
        · exact Finset.disjoint_left.mp hXU hzx hzu
  7. $X ∪ (Y ∪ U) = V$.

    By associativity of set union, $X ∪ (Y ∪ U) = (X ∪ Y) ∪ U$, which equals $V$ by the covering hypothesis.

    line 40

    uses Finset.union_assoc

      · simpa [Finset.union_assoc] using hcover
  8. Every edge between $X$ and $Y ∪ U$ connects $x$ and $y$.

    Let $a \in X$ and $b \in Y ∪ U$ be adjacent. Then either $b \in Y$ or $b \in U$. If $b \in Y$, then $a = x$ and $b = y$ by the crossing-edge assumption between $X$ and $Y$. If $b \in U$, this contradicts the assumption that there are no edges between $U$ and $X$.

    lines 41–44

    uses Finset.mem_union.mp, False.elim

      · intro a ha b hb hab
        rcases Finset.mem_union.mp hb with hb | hb
        · exact hcross a ha b hb hab
        · exact False.elim (hanti b hb a ha hab.symm)
Finset.disjoint_left.mpr
Two finite sets are disjoint if no element of the first belongs to the second.
Finset.disjoint_left.mp
If two finite sets are disjoint, any element of the first cannot belong to the second.
Finset.mem_union.mp
An element in the union of two finite sets belongs to at least one of them.
Finset.card_union_of_disjoint
The cardinality of the union of two disjoint finite sets is the sum of their cardinalities.
Finset.card_univ
The cardinality of the universal finset is the cardinality of the underlying finite type.
Nat.even_or_odd
Every natural number is either even or odd.
Finset.mem_union_left
An element belonging to a set belongs to its union with any other set.
Finset.union_assoc
Union of finite sets is associative: (s₁ ∪ s₂) ∪ s₃ = s₁ ∪ (s₂ ∪ s₃).
False.elim
From False (a contradiction), any proposition follows.

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 empty_barrier_even_reservoir_absorb    {V : Type*} [Fintype V] [DecidableEq V] (G : SimpleGraph V)    (X Y U : Finset V) (x y : V)    (hXY : Disjoint X Y) (hXU : Disjoint X U) (hYU : Disjoint Y U)    (hcover : X ∪ Y ∪ U = Finset.univ)    (hx : x ∈ X) (hy : y ∈ Y)    (hcross : ∀ a ∈ X, ∀ b ∈ Y, G.Adj a b → a=x ∧ b=y)    (hanti : ∀ a ∈ U, ∀ b ∈ X, ¬ G.Adj a b)    (hoddX : Odd X.card) (hoddY : Odd Y.card)    (heven : Even (Fintype.card V)) :    Disjoint X (Y ∪ U) ∧ X ∪ (Y ∪ U) = Finset.univ ∧    x ∈ X ∧ y ∈ Y ∪ U ∧ Odd (Y ∪ U).card ∧    (∀ a ∈ X, ∀ b ∈ Y ∪ U, G.Adj a b → a=x ∧ b=y) := by  classical  have hXYU : Disjoint (X ∪ Y) U := by    apply Finset.disjoint_left.mpr    intro z hz hzu    rcases Finset.mem_union.mp hz with hzx | hzy    · exact Finset.disjoint_left.mp hXU hzx hzu    · exact Finset.disjoint_left.mp hYU hzy hzu  have hcard : X.card + Y.card + U.card = Fintype.card V := by    rw [← Finset.card_union_of_disjoint hXY, ← Finset.card_union_of_disjoint hXYU, hcover, Finset.card_univ]  have hu : Even U.card := by    obtain ⟨m, hm⟩ := heven    obtain ⟨a, ha⟩ := hoddX    obtain ⟨b, hb⟩ := hoddY    rcases Nat.even_or_odd U.card with h | h    · exact h    · obtain ⟨c,hc⟩ := h      omega  have hyu : Odd (Y ∪ U).card := by    rw [Finset.card_union_of_disjoint hYU]    exact hoddY.add_even hu  refine ⟨?_, ?_, hx, Finset.mem_union_left U hy, hyu, ?_⟩  · apply Finset.disjoint_left.mpr    intro z hzx hz    rcases Finset.mem_union.mp hz with hzy | hzu    · exact Finset.disjoint_left.mp hXY hzx hzy    · exact Finset.disjoint_left.mp hXU hzx hzu  · simpa [Finset.union_assoc] using hcover  · intro a ha b hb hab    rcases Finset.mem_union.mp hb with hb | hb    · exact hcross a ha b hb hab    · exact False.elim (hanti b hb a ha hab.symm)
See it in the graphDiscuss this resultChallenge it