AFTD Auto-Formalizing Theoretical Domains

dense_four_block_matching_barrier_arithmetic

theoremverified

The displayed odd group sizes and separator inequalities are incompatible with both the small- and large-separator degree alternatives.

Statement

theorem dense_four_block_matching_barrier_arithmetic
    (k u d s q : ℕ) (n : Fin q → ℕ)
    (hk : 7 ≤ k) (hu : u ≤ k-4) (hsmall : u+d ≤ k)
    (hslo : 2*k ≤ s+u+d+5) (hshi : s ≤ k-1)
    (hq : 2*k+s ≤ q+u+d+3)
    (hodd : ∀ i, Odd (n i))
    (htotal : (∑ i : Fin q, n i) + s+u+d+5 = 4*k)
    (hnosingle : s ≤ k-4 → ∀ i, 2 ≤ n i)
    (hBC : k-3 ≤ s → 7 ≤ ∑ i : Fin q, if 3 ≤ n i then n i else 0) : False
Source
OP-1957; arithmetic for the generalized deleted-four-block matching barrier, experiment 39978.
Verified
26 Nov 2026
Axioms
Classical.choiceQuot.soundpropext
Used by 1

The proof, explained

The proof derives a contradiction (False) from the given parameter bounds and component sizes by splitting into two cases based on the separator size s. In the small-separator branch (s ≤ k - 4), no component can have size 1, so the odd component sizes satisfy n i ≥ 3, implying the total component sum is at least 3q, which is incompatible with the upper bounds on q, s, and the total size. In the large-separator branch (k - 3 ≤ s), components of size at least 3 contribute at least 7 to the total, and summing the identity 2 * (if 3 ≤ n i then n i else 0) ≤ 3 * (n i - 1) yields 14 ≤ 3 * ((∑ n i) - q), which forces s ≤ k - 4 and contradicts k - 3 ≤ s.

  1. Every component size satisfies 1 ≤ n i.

    Because each n i is assumed to be odd, it has the form 2t + 1 for some natural number t. Since t ≥ 0, each component size n i is at least 1.

    lines 12–16

      classical
      have hn1 : ∀ i, 1 ≤ n i := by
        intro i
        obtain ⟨t,ht⟩ := hodd i
        omega
  2. Under the small-separator hypothesis s ≤ k - 4, every component size satisfies 3 ≤ n i.

    We split into cases based on whether s ≤ k - 4. When s ≤ k - 4 holds, hypothesis `hnosingle` gives 2 ≤ n i for all i. Because n i is odd, it cannot equal 2, leaving 3 ≤ n i.

    lines 17–22

      by_cases hs : s ≤ k-4
      · have hn3 : ∀ i, 3 ≤ n i := by
          intro i
          have hh := hnosingle hs i
          obtain ⟨t,ht⟩ := hodd i
          omega
  3. The small-separator case s ≤ k - 4 leads to a contradiction.

    Summing the lower bound 3 ≤ n i over all q components yields 3q ≤ ∑ i, n i. Combined with the total sum identity (∑ i, n i) + s + u + d + 5 = 4k, the lower bound 2k + s ≤ q + u + d + 3, and the constraints u + d ≤ k and s ≤ k - 4, this forces k ≤ 6, contradicting the assumption 7 ≤ k.

    lines 23–26

    uses Finset.sum_le_sum, Nat.mul_comm

        have hb : 3*q ≤ ∑ i : Fin q, n i := by
          have hh := Finset.sum_le_sum (s := (Finset.univ : Finset (Fin q))) (fun i _ => hn3 i)
          simpa [Nat.mul_comm] using hh
        omega
  4. In the complementary case s > k - 4, we have k - 3 ≤ s, which implies 7 ≤ ∑ i, if 3 ≤ n i then n i else 0.

    Since s is an integer and s ≤ k - 4 is false, we have k - 3 ≤ s. Applying the hypothesis `hBC` to this inequality shows that the sum of all component sizes that are at least 3 is at least 7.

    lines 27–28

      · have hs' : k-3 ≤ s := by omega
        have hlarge := hBC hs'
  5. For each component, 2 * (if 3 ≤ n i then n i else 0) ≤ 3 * (n i - 1), and this inequality holds after summing over all components.

    We verify the inequality for each component by testing whether 3 ≤ n i. If 3 ≤ n i, the inequality is 2 * n i ≤ 3 * n i - 3, which holds because n i ≥ 3. If n i < 3, then since 1 ≤ n i, the left side is 0 and the right side is 3 * (n i - 1) ≥ 0. Summing this pointwise inequality across all q components preserves the inequality.

    lines 29–35

    uses Finset.sum_le_sum

        have hterm : ∀ i : Fin q, 2 * (if 3 ≤ n i then n i else 0) ≤ 3 * (n i - 1) := by
          intro i
          have hn := hn1 i
          split_ifs with h
          · omega
          · omega
        have hsum := Finset.sum_le_sum (s := (Finset.univ : Finset (Fin q))) (fun i _ => hterm i)
  6. The sum of the decremented component sizes satisfies (∑ i, (n i - 1)) + q = ∑ i, n i.

    Since each n i ≥ 1, natural number arithmetic gives (n i - 1) + 1 = n i. Summing both sides and distributing the sum over addition splits the sum into (∑ i, (n i - 1)) + ∑ i, 1, where the constant sum of 1 over the q indices evaluates to q.

    lines 36–42

    uses Finset.sum_congr, Finset.sum_add_distrib

        have hsumn : (∑ i : Fin q, (n i - 1)) + q = ∑ i : Fin q, n i := by
          have hh : (∑ i : Fin q, (n i - 1 + 1)) = ∑ i : Fin q, n i := by
            apply Finset.sum_congr rfl
            intro i _
            have hi := hn1 i
            omega
          simpa [Finset.sum_add_distrib] using hh
  7. The large-separator case k - 3 ≤ s is also impossible, completing the refutation.

    Factoring out the scalar multipliers 2 and 3 converts the summed inequality to 2 * (∑ i, if 3 ≤ n i then n i else 0) ≤ 3 * ∑ i, (n i - 1). Using 7 ≤ ∑ i, (if 3 ≤ n i then n i else 0) and ∑ i, (n i - 1) = (∑ i, n i) - q, this yields 14 ≤ 3 * ((∑ i, n i) - q). Together with the total sum identity and the upper and lower bounds on s, q, and u + d, this forces s ≤ k - 4, contradicting k - 3 ≤ s.

    lines 43–44

    uses Finset.mul_sum

        rw [← Finset.mul_sum, ← Finset.mul_sum] at hsum
        omega
Finset.sum_le_sum
If a function f is pointwise bounded by g on a finite set s (f(x) ≤ g(x) for all x ∈ s), then the sum of f over s is at most the sum of g over s.
Nat.mul_comm
Multiplication of natural numbers is commutative: n * m = m * n.
Finset.sum_congr
Two finite sums are equal if their index sets are equal and their summands are equal at every element of the index set.
Finset.sum_add_distrib
The sum of f(x) + g(x) over a finite set equals the sum of f(x) plus the sum of g(x).
Finset.mul_sum
A constant factor distributes over a finite sum: a * ∑ f(i) = ∑ (a * f(i)).

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 dense_four_block_matching_barrier_arithmetic    (k u d s q : ℕ) (n : Fin q → ℕ)    (hk : 7 ≤ k) (hu : u ≤ k-4) (hsmall : u+d ≤ k)    (hslo : 2*k ≤ s+u+d+5) (hshi : s ≤ k-1)    (hq : 2*k+s ≤ q+u+d+3)    (hodd : ∀ i, Odd (n i))    (htotal : (∑ i : Fin q, n i) + s+u+d+5 = 4*k)    (hnosingle : s ≤ k-4 → ∀ i, 2 ≤ n i)    (hBC : k-3 ≤ s → 7 ≤ ∑ i : Fin q, if 3 ≤ n i then n i else 0) : False := by  classical  have hn1 : ∀ i, 1 ≤ n i := by    intro i    obtain ⟨t,ht⟩ := hodd i    omega  by_cases hs : s ≤ k-4  · have hn3 : ∀ i, 3 ≤ n i := by      intro i      have hh := hnosingle hs i      obtain ⟨t,ht⟩ := hodd i      omega    have hb : 3*q ≤ ∑ i : Fin q, n i := by      have hh := Finset.sum_le_sum (s := (Finset.univ : Finset (Fin q))) (fun i _ => hn3 i)      simpa [Nat.mul_comm] using hh    omega  · have hs' : k-3 ≤ s := by omega    have hlarge := hBC hs'    have hterm : ∀ i : Fin q, 2 * (if 3 ≤ n i then n i else 0) ≤ 3 * (n i - 1) := by      intro i      have hn := hn1 i      split_ifs with h      · omega      · omega    have hsum := Finset.sum_le_sum (s := (Finset.univ : Finset (Fin q))) (fun i _ => hterm i)    have hsumn : (∑ i : Fin q, (n i - 1)) + q = ∑ i : Fin q, n i := by      have hh : (∑ i : Fin q, (n i - 1 + 1)) = ∑ i : Fin q, n i := by        apply Finset.sum_congr rfl        intro i _        have hi := hn1 i        omega      simpa [Finset.sum_add_distrib] using hh    rw [← Finset.mul_sum, ← Finset.mul_sum] at hsum    omega
See it in the graphDiscuss this resultChallenge it