AFTD Auto-Formalizing Theoretical Domains

op1957_small_patterns_force_sharp_separator_bound

theoremverified

Small patterns force sharp separator bound.

Statement

theorem op1957_small_patterns_force_sharp_separator_bound
    (c m eb a b0 b1 b2 b3 c0 c1 c2 c3 : ℕ)
    (hEB : m ≤ eb)
    (hpatterns : a=1 ∧
      ((c1=3 ∧ c2+c3=0 ∧ b0+c0+b2+c2+b3+c3+eb+4=c) ∨
       (c1=1 ∧ c2+c3=2 ∧ (1≤c2 → c2=1 ∧ b2+c2=1) ∧
         (1≤c3 → c3=1 ∧ b3+c3=1))))
    (hrep2C : 1≤c2 → a+b0+b1+b3+eb+c0+c1+c3+3≤c) :
    m+(if 1≤c2 then 1 else 0)+(if 1≤c3 then 1 else 0)+4≤c
Source
OP-1957; positive-separator graph-to-count transfer.
Verified
26 Nov 2026
Axioms
Quot.soundpropext

The proof, explained

The proof proceeds by case analysis on the two small patterns provided by `hpatterns`. In the first pattern, $c_2 + c_3 = 0$ forces $c_2 = 0$ and $c_3 = 0$, so both indicator terms vanish and the claim reduces to $m + 4 \le c$, which follows from $m \le eb$ and the exact sum formula for $c$. In the second pattern, where $c_2 + c_3 = 2$, the pattern's conditional implications force $c_2 = 1$ and $c_3 = 1$, evaluating both indicator terms to 1; the hypothesis `hrep2C` then supplies the sharp upper bound $m + 6 \le c$.

  1. Case split on the pattern hypothesis.

    The hypothesis `hpatterns` asserts that $a = 1$ and provides a disjunction between two possible parameter configurations: the first pattern (`hfirst`) and the second pattern (`hsecond`). We decompose this into the equality $a = 1$ and two cases to analyze separately.

    line 12

      rcases hpatterns with ⟨ha,hfirst | hsecond⟩
  2. In the first pattern case, the desired inequality $m + [1 \le c_2] + [1 \le c_3] + 4 \le c$ holds.

    Under the first pattern, $c_2 + c_3 = 0$. Since natural numbers are non-negative, this implies $c_2 = 0$ and $c_3 = 0$. Substituting these values simplifies both indicator terms `if 1 ≤ c2 then 1 else 0` and `if 1 ≤ c3 then 1 else 0` to $0$, leaving the goal $m + 4 \le c$. This bound follows by linear arithmetic from $m \le eb$ (`hEB`) and the equation $b_0 + c_0 + b_2 + c_2 + b_3 + c_3 + eb + 4 = c$.

    lines 13–16

      · have h2 : c2=0 := by omega
        have h3 : c3=0 := by omega
        simp [h2,h3]
        omega
  3. In the second pattern case, $c_2 = 1$.

    We split into cases based on whether $c_2 = 0$: - If $c_2 = 0$, then $c_2 + c_3 = 2$ implies $c_3 = 2 \ge 1$. Applying the pattern condition $1 \le c_3 \implies c_3 = 1 \land b_3 + c_3 = 1$ (`hsecond.2.2.2`) yields $c_3 = 1$, which contradicts $c_3 = 2$. - If $c_2 \ne 0$, then $1 \le c_2$. Applying the pattern condition $1 \le c_2 \implies c_2 = 1 \land b_2 + c_2 = 1$ (`hsecond.2.2.1`) directly gives $c_2 = 1$. In either case, we conclude $c_2 = 1$.

    lines 17–22

      · have h2 : c2=1 := by
          by_cases hz : c2=0
          · have hh := hsecond.2.2.2 (by omega)
            omega
          · have hh := hsecond.2.2.1 (by omega)
            omega
  4. $c_3 = 1$.

    From the second pattern we have $c_2 + c_3 = 2$. Since $c_2 = 1$, linear arithmetic immediately gives $c_3 = 1$.

    line 23

        have h3 : c3=1 := by omega
  5. In the second pattern case, the desired inequality $m + [1 \le c_2] + [1 \le c_3] + 4 \le c$ holds.

    Since $c_2 = 1 \ge 1$, the hypothesis `hrep2C` applies and yields $a + b_0 + b_1 + b_3 + eb + c_0 + c_1 + c_3 + 3 \le c$. Substituting $c_2 = 1$ and $c_3 = 1$ evaluates each indicator term to $1$, simplifying the goal to $m + 1 + 1 + 4 \le c$, or $m + 6 \le c$. This inequality follows by linear arithmetic from `hrep2C`, using $m \le eb$ (`hEB`), $a = 1$, $c_1 = 1$, and $c_3 = 1$.

    lines 24–26

        have hh := hrep2C (by omega)
        simp [h2,h3]
        omega

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_small_patterns_force_sharp_separator_bound    (c m eb a b0 b1 b2 b3 c0 c1 c2 c3 : ℕ)    (hEB : m ≤ eb)    (hpatterns : a=1 ∧      ((c1=3 ∧ c2+c3=0 ∧ b0+c0+b2+c2+b3+c3+eb+4=c) ∨       (c1=1 ∧ c2+c3=2 ∧ (1≤c2 → c2=1 ∧ b2+c2=1) ∧         (1≤c3 → c3=1 ∧ b3+c3=1))))    (hrep2C : 1≤c2 → a+b0+b1+b3+eb+c0+c1+c3+3≤c) :    m+(if 1≤c2 then 1 else 0)+(if 1≤c3 then 1 else 0)+4≤c := by  rcases hpatterns with ⟨ha,hfirst | hsecond⟩  · have h2 : c2=0 := by omega    have h3 : c3=0 := by omega    simp [h2,h3]    omega  · have h2 : c2=1 := by      by_cases hz : c2=0      · have hh := hsecond.2.2.2 (by omega)        omega      · have hh := hsecond.2.2.1 (by omega)        omega    have h3 : c3=1 := by omega    have hh := hrep2C (by omega)    simp [h2,h3]    omega
See it in the graphDiscuss this resultChallenge it