AFTD Auto-Formalizing Theoretical Domains

in1122_saturated_small_explicit_critical_arithmetic

theoremverified

The displayed natural-number endpoint, degree, separator and B-component inequalities force one of the two stated small-shore count patterns.

Statement

theorem in1122_saturated_small_explicit_critical_arithmetic
    (k c m eb a b0 b1 b2 b3 c0 c1 c2 c3 d : ℕ)
    (hc : 7 ≤ c) (hkc : c ≤ k) (heb : m ≤ eb)
    (ha : 1 ≤ a ∧ a ≤ 2) (hc1 : 1 ≤ c1)
    (he2 : (c2 = 0 ∧ b2 = 0) ∨ (1 ≤ c2 ∧ Odd (b2+c2)))
    (he3 : (c3 = 0 ∧ b3 = 0) ∨ (1 ≤ c3 ∧ Odd (b3+c3)))
    (hs : m + (if 1 ≤ c2 then 1 else 0) + (if 1 ≤ c3 then 1 else 0) + 1 ≤ c)
    (hb : b0+b1+b2+b3+eb+5 ≤ 2*k)
    (htotal : a+b0+b1+b2+b3+eb+c0+c1+c2+c3+d+m+
      (if 1 ≤ c2 then 1 else 0) + (if 1 ≤ c3 then 1 else 0) = 2*k)
    (hsmall : c1+c2+c3 ≤ 3)
    (hrooty : a+b0+c0+b2+c2+b3+c3+eb+2 ≤ c)
    (hrepA : 2 ≤ a → c1+c2+c3 ≤ 2)
    (hrep0C : 1 ≤ c0 → b1+b2+b3+eb+c1+c2+c3+3 ≤ c)
    (hcutD : 1 ≤ d → d+b1+b2+b3+eb+c ≤ 2*k)
    (hrep1C : 2 ≤ c1 → a+b0+b2+b3+eb+c0+c2+c3+3 ≤ c)
    (hrep2C : 1 ≤ c2 → a+b0+b1+b3+eb+c0+c1+c3+3 ≤ c)
    (hrep3C : 1 ≤ c3 → a+b0+b1+b2+eb+c0+c1+c2+3 ≤ c)
    (hcrit : (b0+b1+b2+b3+eb+5 < 2*k →
        m+b0+b1+b2+b3+eb+6 ≤ 2*k) ∧
      (b0+b1+b2+b3+eb+5 = 2*k → m ≤ 1 ∧
        (if 1 ≤ b0 then 1 else 0) + (if 1 ≤ b1 then 1 else 0) +
        (if 1 ≤ b2 then 1 else 0) + (if 1 ≤ b3 then 1 else 0) + m ≤ 1))
    (hxconn : a=1 → c0+d=0 → b0=0) :
    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)))
Source
OP-1957: small arithmetic core for the unbounded saturated small-shore count reduction.
Verified
24 Nov 2026
Axioms
Classical.choiceQuot.soundpropext

The proof, explained

The proof begins by deriving a sharp dichotomy from the criticality hypothesis: either the endpoint sum with its buffer is strictly below 2k (yielding an upper bound on m plus the parameters), or it meets 2k exactly (sharply restricting m and the indicator functions). The argument then splits into eight subcases combining this dichotomy with the zero-versus-odd alternatives for (b₂, c₂) and (b₃, c₃), introducing explicit witnesses for each odd sum. Finally, simplification and automated Presburger arithmetic (`omega`), assisted by case-splitting on remaining indicator conditionals, show that all branches either yield an arithmetic contradiction or force a = 1 and one of the two desired small-shore configurations.

  1. Either m + b₀ + b₁ + b₂ + b₃ + eb + 6 ≤ 2k or b₀ + b₁ + b₂ + b₃ + eb + 5 = 2k with m ≤ 1 and the sum of indicator variables plus m bounded by 1.

    We perform a case split on whether b₀ + b₁ + b₂ + b₃ + eb + 5 < 2k. If it is strictly less, the first clause of the criticality hypothesis hcrit immediately gives the strengthened inequality m + b₀ + b₁ + b₂ + b₃ + eb + 6 ≤ 2k. If not, since the sum is at most 2k by hypothesis hb, linear arithmetic forces equality with 2k, and the second clause of hcrit provides the bounds on m and the indicator variables.

    lines 30–37

    uses Or.inl, Or.inr

      have hcritical : (m+b0+b1+b2+b3+eb+6 ≤ 2*k) ∨
          (b0+b1+b2+b3+eb+5 = 2*k ∧ m ≤ 1 ∧
            (if 1 ≤ b0 then 1 else 0) + (if 1 ≤ b1 then 1 else 0) +
            (if 1 ≤ b2 then 1 else 0) + (if 1 ≤ b3 then 1 else 0) + m ≤ 1) := by
        by_cases h : b0+b1+b2+b3+eb+5 < 2*k
        · exact Or.inl (hcrit.1 h)
        · have heq : b0+b1+b2+b3+eb+5 = 2*k := by omega
          exact Or.inr ⟨heq, hcrit.2 heq⟩
  2. The goal is split into eight subcases according to the criticality dichotomy and whether (b₂, c₂) and (b₃, c₃) are zero or have odd sum.

    We discard the original hypothesis hcrit and destruct the derived dichotomy into its two alternatives. We then branch on the hypotheses he2 and he3, which each specify that the pair (bᵢ, cᵢ) is either (0, 0) or satisfies cᵢ ≥ 1 with bᵢ + cᵢ odd. In the odd cases, unpacking the definition of Odd provides an integer witness tᵢ such that bᵢ + cᵢ = 2 * tᵢ + 1.

    lines 38–42

      clear hcrit
      rcases hcritical with hpos | hfull
      all_goals rcases he2 with h2 | h2 <;> rcases he3 with h3 | h3
      all_goals try obtain ⟨h2lo, t2, ht2⟩ := h2
      all_goals try obtain ⟨h3lo, t3, ht3⟩ := h3
  3. In every subcase, a = 1 and one of the two small-shore count patterns holds. automation

    All hypotheses and substitutions are simplified across all branches, replacing known zeros and odd-sum representations. The decision procedure for Presburger arithmetic (`omega`), combined with splitting on the remaining if-then-else conditions on indices, automatically shows that non-conforming parameter assignments are contradictory and verifies the conclusion in the remaining valid cases.

    lines 43–44

      all_goals simp_all
      all_goals first | omega | (split_ifs at * <;> omega)
Or.inl
Injects a proof of the left disjunct into a disjunction: from a proof of P, produces P ∨ Q.
Or.inr
Injects a proof of the right disjunct into a disjunction: from a proof of Q, produces P ∨ Q.

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 in1122_saturated_small_explicit_critical_arithmetic    (k c m eb a b0 b1 b2 b3 c0 c1 c2 c3 d : ℕ)    (hc : 7 ≤ c) (hkc : c ≤ k) (heb : m ≤ eb)    (ha : 1 ≤ a ∧ a ≤ 2) (hc1 : 1 ≤ c1)    (he2 : (c2 = 0 ∧ b2 = 0) ∨ (1 ≤ c2 ∧ Odd (b2+c2)))    (he3 : (c3 = 0 ∧ b3 = 0) ∨ (1 ≤ c3 ∧ Odd (b3+c3)))    (hs : m + (if 1 ≤ c2 then 1 else 0) + (if 1 ≤ c3 then 1 else 0) + 1 ≤ c)    (hb : b0+b1+b2+b3+eb+5 ≤ 2*k)    (htotal : a+b0+b1+b2+b3+eb+c0+c1+c2+c3+d+m+      (if 1 ≤ c2 then 1 else 0) + (if 1 ≤ c3 then 1 else 0) = 2*k)    (hsmall : c1+c2+c3 ≤ 3)    (hrooty : a+b0+c0+b2+c2+b3+c3+eb+2 ≤ c)    (hrepA : 2 ≤ a → c1+c2+c3 ≤ 2)    (hrep0C : 1 ≤ c0 → b1+b2+b3+eb+c1+c2+c3+3 ≤ c)    (hcutD : 1 ≤ d → d+b1+b2+b3+eb+c ≤ 2*k)    (hrep1C : 2 ≤ c1 → a+b0+b2+b3+eb+c0+c2+c3+3 ≤ c)    (hrep2C : 1 ≤ c2 → a+b0+b1+b3+eb+c0+c1+c3+3 ≤ c)    (hrep3C : 1 ≤ c3 → a+b0+b1+b2+eb+c0+c1+c2+3 ≤ c)    (hcrit : (b0+b1+b2+b3+eb+5 < 2*k →        m+b0+b1+b2+b3+eb+6 ≤ 2*k) ∧      (b0+b1+b2+b3+eb+5 = 2*k → m ≤ 1 ∧        (if 1 ≤ b0 then 1 else 0) + (if 1 ≤ b1 then 1 else 0) +        (if 1 ≤ b2 then 1 else 0) + (if 1 ≤ b3 then 1 else 0) + m ≤ 1))    (hxconn : a=1 → c0+d=0 → b0=0) :    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))) := by  have hcritical : (m+b0+b1+b2+b3+eb+6 ≤ 2*k) ∨      (b0+b1+b2+b3+eb+5 = 2*k ∧ m ≤ 1 ∧        (if 1 ≤ b0 then 1 else 0) + (if 1 ≤ b1 then 1 else 0) +        (if 1 ≤ b2 then 1 else 0) + (if 1 ≤ b3 then 1 else 0) + m ≤ 1) := by    by_cases h : b0+b1+b2+b3+eb+5 < 2*k    · exact Or.inl (hcrit.1 h)    · have heq : b0+b1+b2+b3+eb+5 = 2*k := by omega      exact Or.inr ⟨heq, hcrit.2 heq⟩  clear hcrit  rcases hcritical with hpos | hfull  all_goals rcases he2 with h2 | h2 <;> rcases he3 with h3 | h3  all_goals try obtain ⟨h2lo, t2, ht2⟩ := h2  all_goals try obtain ⟨h3lo, t3, ht3⟩ := h3  all_goals simp_all  all_goals first | omega | (split_ifs at * <;> omega)
See it in the graphDiscuss this resultChallenge it