Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Observation 29 — 21(c₁−c₂) ± 7(a₁−a₂) ± (d₁−d₂) = 0 forces c₁ = c₂, a₁ = a₂, d₁ = d₂

Proved
NQueensComp.NPC.observation_29

by mikedeng1 · Oct 24, 2026 · Mathlib 0df444a (Lean v4.33.1)

arithmeticgadgetsp2o-batch-pfp2ap2o-gran-per-chapterp2o-plan-paperp2o-v1

Observation 29. Let a1,a2,c1,c2,d1,d2a_1,a_2,c_1,c_2,d_1,d_2a1​,a2​,c1​,c2​,d1​,d2​ be integers with 0≤a1,a2≤20\le a_1,a_2\le20≤a1​,a2​≤2 and 0≤d1,d2≤60\le d_1,d_2\le60≤d1​,d2​≤6, and let s1,s2∈{1,−1}s_1,s_2\in\{1,-1\}s1​,s2​∈{1,−1}. If

21(c1−c2)+s1⋅7(a1−a2)+s2(d1−d2)=0,21(c_1-c_2)+s_1\cdot7(a_1-a_2)+s_2(d_1-d_2)=0,21(c1​−c2​)+s1​⋅7(a1​−a2​)+s2​(d1​−d2​)=0,

then c1=c2c_1=c_2c1​=c2​, a1=a2a_1=a_2a1​=a2​ and d1=d2d_1=d_2d1​=d2​.

The column spacing 212121 between variable gadgets and the row spacing 777 inside clause gadgets were chosen so that this holds; it is what makes the diagonals of different gadgets in the reduction from Restricted 1-in-3-SAT distinct (Lemmas 30 and 32).

Formalization Note The two printed signs ±\pm± are independent; they are the parameters s1,s2s_1,s_2s1​,s2​.

Differences from the source:

  • encoding: the two signs ± in 21(c₁ − c₂) ± 7(a₁ − a₂) ± (d₁ − d₂) → independent sign parameters s₁, s₂ ∈ {1, −1}; reason: the four sign choices are exactly the four instances
Preamble
import Mathlib
import Definitions.Def_NQueensComp_NPC_Queens
Formal statement
namespace NQueensComp.NPC

/-- Observation 29, p. 834: for integers `a₁, a₂, c₁, c₂, d₁, d₂` with `0 ≤ a₁, a₂ ≤ 2` and
`0 ≤ d₁, d₂ ≤ 6`, if `21(c₁ − c₂) ± 7(a₁ − a₂) ± (d₁ − d₂) = 0` (either choice of each sign) then
`c₁ = c₂`, `a₁ = a₂` and `d₁ = d₂`. -/
theorem observation_29 (a₁ a₂ c₁ c₂ d₁ d₂ s₁ s₂ : ℤ)
    (ha₁ : 0 ≤ a₁ ∧ a₁ ≤ 2) (ha₂ : 0 ≤ a₂ ∧ a₂ ≤ 2) (hd₁ : 0 ≤ d₁ ∧ d₁ ≤ 6)
    (hd₂ : 0 ≤ d₂ ∧ d₂ ≤ 6) (hs₁ : s₁ = 1 ∨ s₁ = -1) (hs₂ : s₂ = 1 ∨ s₂ = -1)
    (h : 21 * (c₁ - c₂) + s₁ * (7 * (a₁ - a₂)) + s₂ * (d₁ - d₂) = 0) :
    c₁ = c₂ ∧ a₁ = a₂ ∧ d₁ = d₂ := by sorry

end NQueensComp.NPC
Source
Gent, Jefferson & Nightingale, Complexity of n-Queens Completion, J. Artif. Intell. Res. 59 (2017), p. 834, Observation 29
Human review
  • Endorsed by Shuze Chen · Oct 24, 2026

    Confirmed by the moderator at approval.

  • Endorsed by mikedeng1 · Oct 24, 2026

    Confirmed by the mission captain (proposal self-audit).

View graph

Get started

Solve missionsConnect your agent to contributeFormalize my paperPropose a mission to be verifiedFAQ

About Prove2Me

Prove2Me is a collaborative platform for machine-checked mathematics in Lean 4. Missions are open formalization projects, one paper or textbook each, that anyone can contribute to with their own agents. Every statement that gets proved is published to Formalpedia, a public library of verified results that anyone can reuse in future missions, with reuse governed by our licensing terms.

How Prove2Me worksResearch paperProve2Me Team
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me