Parity alignment after at most one interchange of the right-hand entries
ProvedEqualTwoSquares.parity_alignmentLet a, b, c and d be integers with a^2 + b^2 = c^2 + d^2. Then either a - c and b - d are both even, or a - d and b - c are both even. Equivalently, either a agrees with c modulo 2 and b agrees with d modulo 2, or the same holds after c and d are interchanged.
import Mathlib
namespace EqualTwoSquares
/-- Objective 4, parity: after possibly swapping c and d, matching entries have equal parity. -/
theorem parity_alignment {a b c d : ℤ} (h : a^2 + b^2 = c^2 + d^2) :
(Even (a - c) ∧ Even (b - d)) ∨ (Even (a - d) ∧ Even (b - c)) := by sorry
end EqualTwoSquaresRead-back
What the Lean code literally says, in plain math · independent-agent
Read-back: parity_alignment
Declared in namespace EqualTwoSquares (file items/parity_alignment.lean); the name agrees with the file name. Its own doc line reads "Objective 4, parity: after possibly swapping c and d, matching entries have equal parity."
What the declaration literally says
Let satisfy the single hypothesis
Then at least one of the following two alternatives holds:
- is even and is even; or
- is even and is even.
Here "even" means divisible by inside , i.e. the difference is for some integer ; this is symmetric in sign, so it is the same as saying that the two entries have the same parity. The disjunction is inclusive. Note carefully which pairings occur: the first branch pairs with and with (the pairing given by the order of the two sides of the equation ), and the second branch pairs with and with (the pairing obtained after swapping the roles of and ), matching the doc line. Nothing is assumed about the entries: they may be zero, negative, or coincide, and no coprimality or non-degeneracy is required.
Cases covered silently: ; all entries odd; all entries even; and mixed cases where exactly one entry on each side is odd — including the genuinely mixed sub-case (e.g. : ), where the first alternative fails ( and are odd) and the conclusion survives only through the second alternative ( and are even). So neither disjunct alone is implied by the hypothesis, and the disjunction is genuinely needed.
Audit notes
- Truth. TRUE. Proof of the (mod ) content: a square is when its base is even and when odd; hence, writing for the number of odd entries among and for the number of odd entries among , the hypothesis gives . Since , this forces . If then are all even or all odd, so and are even (branch 1). If : when the odd entry on the left and the odd entry on the right occupy corresponding positions ( odd and odd, or odd and odd) branch 1 again gives even differences; when they occupy crossed positions ( odd, odd, even, or odd, odd, even) then and are even, i.e. branch 2. Note that the naive mod- argument would be insufficient (it only gives that and have equal parity); the count of odd entries, obtained from the stronger mod- information, is what makes the statement true — and, indeed, the case analysis above shows no counterexample can hide in the "both differences odd" corner, because then the cross differences are automatically even. Exhaustive verification: all quadruples with satisfying the hypothesis (checked side by side with the conclusion) produce zero failures. An additional random/high-value search for entries beyond that box likewise produced none. No counterexample.
- Faithfulness. Name matches file name. The doc line "after possibly swapping and , matching entries have equal parity" corresponds exactly to the two-branch structure with the two pairings and . All four variables are implicit arguments bound by the statement, all appear in the hypothesis, and all appear in the conclusion; nothing is free.
- Trivializing premise. None: is the object of study, not a restatement of the parity conclusion, and it is neither contradictory nor strong enough to make the conclusion vacuous. Interesting instances are plentiful (see above, where only one branch survives).
- Satisfiability. Satisfiable, non-vacuously and with rich instances: , , , and every member of the explicit family . Infinitely many witnesses.
- Elaboration. Included in
statements/All.lean; elaborates with only the expecteddeclaration uses 'sorry'warning.
FAITHFUL
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.