AFTD Auto-Formalizing Theoretical Domains

four_vertex_shores_force_many_complement_walks

theoremverified

If a,b are at least four and a+b=d+1, their product is at least 4(d−3).

Statement

theorem four_vertex_shores_force_many_complement_walks
    (d a b : ℕ) (ha : 4 ≤ a) (hb : 4 ≤ b)
    (hs : a + b = d + 1) : 4 * (d - 3) ≤ a * b
Source
Arithmetic step in the saturated-twin bridge-count route for OP-1957.
Verified
20 Nov 2026
Axioms
Classical.choiceQuot.soundpropext
Built on 2
  • LinearOrder.toTotalPreorderEvery LinearOrder is a TotalPreorder.
  • TotalPreorderA total preorder: a preorder where ≤ is total (complete). This is weaker than LinearOrder — it does NOT require antisymmetry or…
Used by 3

The proof, explained

The inequality is proved by working in the integers to avoid natural-number subtraction underflow. Since a, b ≥ 4, the product (a - 4)(b - 4) = ab - 4(a + b) + 16 is nonnegative; substituting a + b = d + 1 yields ab - 4(d - 3) ≥ 0, or 4(d - 3) ≤ ab. Finally, because a, b ≥ 4 implies d ≥ 7 ≥ 3, integer subtraction coincides with natural-number subtraction, allowing the inequality to be pulled back to ℕ.

  1. 3 ≤ d

    Since a ≥ 4 and b ≥ 4, their sum satisfies d + 1 = a + b ≥ 8, which implies d ≥ 7 ≥ 3. Linear arithmetic over ℕ (`omega`) proves this directly from the hypotheses.

    line 4

      have hd3 : 3 ≤ d := by omega
  2. (a - 4)(b - 4) ≥ 0 in the integers

    The bounds 4 ≤ a and 4 ≤ b are cast to ℤ, giving a - 4 ≥ 0 and b - 4 ≥ 0 by linear arithmetic (`linarith`). Since both factors are nonnegative, their product (a - 4)(b - 4) is nonnegative by `mul_nonneg`.

    lines 5–8

    uses mul_nonneg

      have ha' : (4:ℤ) ≤ (a:ℤ) := by exact_mod_cast ha
      have hb' : (4:ℤ) ≤ (b:ℤ) := by exact_mod_cast hb
      have hnon : (0:ℤ) ≤ ((a:ℤ)-4)*((b:ℤ)-4) := by
        apply mul_nonneg <;> linarith
  3. 4(d - 3) ≤ ab in the integers

    Casting the relation a + b = d + 1 to ℤ and expanding (a - 4)(b - 4) ≥ 0 gives ab - 4(a + b) + 16 ≥ 0. Substituting a + b = d + 1 transforms this into ab - 4(d + 1) + 16 = ab - 4(d - 3) ≥ 0, which rearranges to 4(d - 3) ≤ ab; the non-linear arithmetic tactic `nlinarith` verifies this deduction.

    lines 9–11

      have hs' : (a:ℤ)+(b:ℤ) = (d:ℤ)+1 := by exact_mod_cast hs
      have hgoal : 4 * ((d:ℤ) - 3) ≤ (a:ℤ)*(b:ℤ) := by
        nlinarith
  4. 4(d - 3) ≤ ab in the natural numbers

    Because 3 ≤ d, natural-number subtraction d - 3 coincides with integer subtraction via `Nat.cast_sub`. Pushing the integer coercion through the operations (`push_cast`) and rewriting with this equality matches the cast of 4(d - 3) ≤ ab to the integer inequality proved above, which then reflects back to ℕ (`exact_mod_cast`).

    lines 12–17

    uses Nat.cast_sub

      have hsub : ((d - 3 : ℕ) : ℤ) = (d:ℤ) - 3 := Nat.cast_sub hd3
      have hmain : ((4*(d-3):ℕ):ℤ) ≤ ((a*b:ℕ):ℤ) := by
        push_cast
        rw [hsub]
        exact hgoal
      exact_mod_cast hmain
mul_nonneg
The product of two nonnegative numbers is nonnegative.
Nat.cast_sub
The cast of a difference of natural numbers n - m into an additive group with one equals the difference of their casts ↑n - ↑m, provided m ≤ n.

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 four_vertex_shores_force_many_complement_walks    (d a b : ℕ) (ha : 4 ≤ a) (hb : 4 ≤ b)    (hs : a + b = d + 1) : 4 * (d - 3) ≤ a * b := by  have hd3 : 3 ≤ d := by omega  have ha' : (4:ℤ) ≤ (a:ℤ) := by exact_mod_cast ha  have hb' : (4:ℤ) ≤ (b:ℤ) := by exact_mod_cast hb  have hnon : (0:ℤ) ≤ ((a:ℤ)-4)*((b:ℤ)-4) := by    apply mul_nonneg <;> linarith  have hs' : (a:ℤ)+(b:ℤ) = (d:ℤ)+1 := by exact_mod_cast hs  have hgoal : 4 * ((d:ℤ) - 3) ≤ (a:ℤ)*(b:ℤ) := by    nlinarith  have hsub : ((d - 3 : ℕ) : ℤ) = (d:ℤ) - 3 := Nat.cast_sub hd3  have hmain : ((4*(d-3):ℕ):ℤ) ≤ ((a*b:ℕ):ℤ) := by    push_cast    rw [hsub]    exact hgoal  exact_mod_cast hmain
See it in the graphDiscuss this resultChallenge it