AFTD Auto-Formalizing Theoretical Domains

op861_partition_profile_obstruction

theoremverified

Numerical coverage and disjointness conditions for two palette-block profiles are inconsistent. The four count functions represent eligible colors in each block on each side; the first-transition argument yields incompatible eligible counts.

Statement

theorem op861_partition_profile_obstruction (k p q : ℕ)
    (hp : 1 ≤ p) (hpk : p < k) (hpq : p + q + 1 = 2 * k)
    (ap aq bp bq : ℕ → ℕ)
    (hbound : ∀ x ≤ p, ap x ≤ p ∧ bp x ≤ p)
    (ha : ∀ x ≤ p, p + 1 ≤ ap x + x ∨ q + 1 + x ≤ aq x + k)
    (hb : ∀ x ≤ p, p + 1 ≤ bp x + x ∨ q + 1 + x ≤ bq x + k)
    (hqsep : ∀ x z, x ≤ p → z ≤ p → x + z = p → aq x + bq z ≤ q)
    (hpsep : ∀ x z, x ≤ p → z ≤ p → x + z = p + 1 → ap x + bp z ≤ p) : False
Source
Numerical counting step for the OP-861 two-block eligibility obstruction.
Verified
18 Nov 2026
Axioms
Classical.choiceQuot.soundpropext
Used by 1

The proof, explained

The proof derives a contradiction from the coverage and separation hypotheses using a first-transition argument on the sequence of indices 0 ≤ x ≤ p. By well-ordering, let x be the minimal index where the first coverage condition for a holds (p + 1 ≤ ap x + x); nonemptiness is witnessed at x = p, and x > 0 because ap 0 ≤ p. Minimality forces the second coverage condition to hold at x - 1, providing a lower bound on aq(x - 1). Applying q-separation to the pair (x - 1, p - x + 1) then rules out the second coverage condition for b at p - x + 1, forcing x ≤ bp(p - x + 1). Finally, p-separation at (x, p - x + 1) demands ap x + bp(p - x + 1) ≤ p, which contradicts the combined lower bounds ap x ≥ p + 1 - x and bp(p - x + 1) ≥ x.

  1. At x = 0, the second coverage condition for b holds: q + 1 ≤ bq(0) + k, and cross-separation gives aq(p) + bq(0) ≤ q.

    Applying the q-separation hypothesis (hqsep) to the pair (p, 0) establishes aq(p) + bq(0) ≤ q. For x = 0, the coverage hypothesis for b (hb) asserts that either p + 1 ≤ bp(0) + 0 or q + 1 + 0 ≤ bq(0) + k. Since bp(0) ≤ p by the uniform bound (hbound), the first alternative p + 1 ≤ bp(0) is impossible. Therefore, the second alternative q + 1 ≤ bq(0) + k must hold.

    lines 9–15

    uses Nat.zero_le, le_rfl

      have hzero : 0 ≤ p := Nat.zero_le _
      have hpair := hqsep p 0 le_rfl hzero (by omega)
      have hbound0 := hbound 0 hzero
      have hbq : q + 1 ≤ bq 0 + k := by
        rcases hb 0 hzero with h | h
        · omega
        · simpa using h
  2. At x = p, the first coverage condition for a holds: p + 1 ≤ ap(p) + p.

    The coverage hypothesis for a (ha) evaluated at x = p presents two alternatives: either p + 1 ≤ ap(p) + p or q + 1 + p ≤ aq(p) + k. If the second alternative held, combining it with aq(p) + bq(0) ≤ q and q + 1 ≤ bq(0) + k from the previous step, along with p + q + 1 = 2k, would force 2k + 1 ≤ 2k by linear arithmetic. Thus only the first alternative can hold.

    lines 16–19

    uses le_rfl

      have haplast : p + 1 ≤ ap p + p := by
        rcases ha p le_rfl with h | h
        · exact h
        · omega
  3. There exists a strictly positive minimal index x ≤ p satisfying p + 1 ≤ ap(x) + x.

    Since p witnesses that the set of such indices is nonempty, we let x be the smallest witness using Nat.find. By Nat.find_spec, x ≤ p and p + 1 ≤ ap(x) + x. If x were 0, this would imply p + 1 ≤ ap(0), contradicting the bound ap(0) ≤ p from hbound. Thus x > 0.

    lines 20–27

    uses le_rfl, Nat.find, Nat.find_spec

      have hex : ∃ x, x ≤ p ∧ p + 1 ≤ ap x + x := ⟨p, le_rfl, haplast⟩
      let x := Nat.find hex
      have hx : x ≤ p ∧ p + 1 ≤ ap x + x := Nat.find_spec hex
      have hxpos : 0 < x := by
        by_contra hn
        have : x = 0 := by omega
        rw [this] at hx
        omega
  4. At x - 1, the second coverage condition for a holds: q + x ≤ aq(x - 1) + k.

    Since x > 0, the predecessor x - 1 satisfies x - 1 < x and x - 1 ≤ p. By the minimality of x (Nat.find_min), the condition p + 1 ≤ ap(x - 1) + (x - 1) fails. The coverage dichotomy for a (ha) at x - 1 then forces its second alternative, q + 1 + (x - 1) ≤ aq(x - 1) + k, which simplifies to q + x ≤ aq(x - 1) + k.

    lines 28–34

    uses Nat.find_min, False.elim

      have hprev : ¬ (x - 1 ≤ p ∧ p + 1 ≤ ap (x - 1) + (x - 1)) :=
        Nat.find_min hex (by omega)
      have hprevlt : x - 1 ≤ p := by omega
      have haq : q + x ≤ aq (x - 1) + k := by
        rcases ha (x-1) hprevlt with h | h
        · exact False.elim (hprev ⟨hprevlt, h⟩)
        · omega
  5. For z = p - x + 1, the first coverage condition for b holds: x ≤ bp(z).

    Setting z = p - x + 1, we have z ≤ p (since x ≥ 1) and (x - 1) + z = p. The q-separation hypothesis (hqsep) on (x - 1, z) gives aq(x - 1) + bq(z) ≤ q. The coverage condition for b (hb) at z offers two cases: either p + 1 ≤ bp(z) + z (which simplifies to x ≤ bp(z)) or q + 1 + z ≤ bq(z) + k. In the latter case, combining the lower bound on bq(z) with q + x ≤ aq(x - 1) + k, aq(x - 1) + bq(z) ≤ q, and p + q + 1 = 2k yields 2k + 1 ≤ 2k, a contradiction. Hence x ≤ bp(p - x + 1) must hold.

    lines 35–40

      have hzlt : p - x + 1 ≤ p := by omega
      have hcross := hqsep (x-1) (p-x+1) hprevlt hzlt (by omega)
      have hbp : x ≤ bp (p-x+1) := by
        rcases hb (p-x+1) hzlt with h | h
        · omega
        · omega
  6. A contradiction (False) follows from the incompatible bounds on ap(x) + bp(p - x + 1). automation

    Because x + (p - x + 1) = p + 1, the p-separation hypothesis (hpsep) requires ap(x) + bp(p - x + 1) ≤ p. However, the choice of x guarantees ap(x) ≥ p + 1 - x, and the previous step established bp(p - x + 1) ≥ x. Summing these yields ap(x) + bp(p - x + 1) ≥ p + 1, contradicting the upper bound p. Linear arithmetic (omega) detects this contradiction and closes the proof.

    lines 41–42

      have hlastcross := hpsep x (p-x+1) hx.1 hzlt (by omega)
      omega
Nat.zero_le
Zero is less than or equal to any natural number (0 ≤ n).
le_rfl
The ordering relation ≤ is reflexive (a ≤ a).
Nat.find
Given an existential proof for a decidable predicate on ℕ, returns the least natural number satisfying that predicate.
Nat.find_spec
The value returned by Nat.find satisfies the given predicate.
Nat.find_min
Any natural number strictly smaller than Nat.find does not satisfy the predicate.
False.elim
From a contradiction (False), any conclusion 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 op861_partition_profile_obstruction (k p q : ℕ)    (hp : 1 ≤ p) (hpk : p < k) (hpq : p + q + 1 = 2 * k)    (ap aq bp bq : ℕ → ℕ)    (hbound : ∀ x ≤ p, ap x ≤ p ∧ bp x ≤ p)    (ha : ∀ x ≤ p, p + 1 ≤ ap x + x ∨ q + 1 + x ≤ aq x + k)    (hb : ∀ x ≤ p, p + 1 ≤ bp x + x ∨ q + 1 + x ≤ bq x + k)    (hqsep : ∀ x z, x ≤ p → z ≤ p → x + z = p → aq x + bq z ≤ q)    (hpsep : ∀ x z, x ≤ p → z ≤ p → x + z = p + 1 → ap x + bp z ≤ p) : False := by  have hzero : 0 ≤ p := Nat.zero_le _  have hpair := hqsep p 0 le_rfl hzero (by omega)  have hbound0 := hbound 0 hzero  have hbq : q + 1 ≤ bq 0 + k := by    rcases hb 0 hzero with h | h    · omega    · simpa using h  have haplast : p + 1 ≤ ap p + p := by    rcases ha p le_rfl with h | h    · exact h    · omega  have hex : ∃ x, x ≤ p ∧ p + 1 ≤ ap x + x := ⟨p, le_rfl, haplast⟩  let x := Nat.find hex  have hx : x ≤ p ∧ p + 1 ≤ ap x + x := Nat.find_spec hex  have hxpos : 0 < x := by    by_contra hn    have : x = 0 := by omega    rw [this] at hx    omega  have hprev : ¬ (x - 1 ≤ p ∧ p + 1 ≤ ap (x - 1) + (x - 1)) :=    Nat.find_min hex (by omega)  have hprevlt : x - 1 ≤ p := by omega  have haq : q + x ≤ aq (x - 1) + k := by    rcases ha (x-1) hprevlt with h | h    · exact False.elim (hprev ⟨hprevlt, h⟩)    · omega  have hzlt : p - x + 1 ≤ p := by omega  have hcross := hqsep (x-1) (p-x+1) hprevlt hzlt (by omega)  have hbp : x ≤ bp (p-x+1) := by    rcases hb (p-x+1) hzlt with h | h    · omega    · omega  have hlastcross := hpsep x (p-x+1) hx.1 hzlt (by omega)  omega
See it in the graphDiscuss this resultChallenge it