Current library: Alpha v34, 4,223 checked-use theorems; Stable remains 432. Historical first admissions, original proof editions, and non-admitted aliases are preserved. Exact original first-admission records.
The natural-code carrier consists of genuine pairs of the existing signed integers; no new primitive arithmetic is trusted. The theorem constructs quotient, remainder, and actual norm witnesses. Gaussian gcd, unique factorization, and prime classification are separate targets.
Exact theorem in conservative defined notation
∀ p. ∀ n. ∀ q. ∀ m. ∀ s. p + m = q + n → SignedDifferenceSquare(p,n,s) → SignedDifferenceSquare(q,m,s)
Every linked abbreviation expands hygienically to the identical original native formula.
Definition DAG
Actual proof prerequisites
Complete tactic proof in conservative notation
All 28 original proof lines are preserved. Only local proposition formulas are abbreviated; every abbreviation has an exact binder-safe expansion check. The linked exact edition contains the unchanged replay script.
Read the argument
Proof checkpoints
This is a reading aid, not a new proof or a proof-tree certificate. Checkpoint groups are consecutive commands, not inferred branch boundaries. Every step links to the preserved script.
01Fix variables and assumptionsL1–7
02Establish hproductL8–17
Establish this local claim before using it. It is not an additional assumption. The following proof commands apply matrix integer pair product balance.
- L8
have hproduct : ((((((p) * (p))) + (((n) * (n))))) + (((((q) * (m))) + (((m) * (q)))))) = ((((((q) * (q))) + (((m) * (m))))) + (((((p) * (n))) + (((n) * (p)))))) - L9
specialize matrix_integer_pair_product_balance p - L10
specialize matrix_integer_pair_product_balance n - L11
specialize matrix_integer_pair_product_balance q - L12
specialize matrix_integer_pair_product_balance m - L13
specialize matrix_integer_pair_product_balance p - L14
specialize matrix_integer_pair_product_balance n - L15
specialize matrix_integer_pair_product_balance q - L16
specialize matrix_integer_pair_product_balance m - L17
apply matrix_integer_pair_product_balance
03Use earlier factsL18–23
Instantiate or apply named facts and discharge the corresponding proof obligations.
04Calculate and transport equalitiesL24–25
05Use earlier factsL26–26
Instantiate or apply named facts and discharge the corresponding proof obligations.
- L26
exact hproduct
Original defined command ledger · 28 lines
- 0001
intro p - 0002
intro n - 0003
intro q - 0004
intro m - 0005
intro s - 0006
intro hequal - 0007
intro hsquare - 0008
have hproduct : ((((((p) * (p))) + (((n) * (n))))) + (((((q) * (m))) + (((m) * (q)))))) = ((((((q) * (q))) + (((m) * (m))))) + (((((p) * (n))) + (((n) * (p)))))) - 0009
specialize matrix_integer_pair_product_balance p - 0010
specialize matrix_integer_pair_product_balance n - 0011
specialize matrix_integer_pair_product_balance q - 0012
specialize matrix_integer_pair_product_balance m - 0013
specialize matrix_integer_pair_product_balance p - 0014
specialize matrix_integer_pair_product_balance n - 0015
specialize matrix_integer_pair_product_balance q - 0016
specialize matrix_integer_pair_product_balance m - 0017
apply matrix_integer_pair_product_balance - 0018
exact hequal - 0019
exact hequal - 0020
specialize add_right_cancel ((((q) * (q))) + (((m) * (m)))) - 0021
specialize add_right_cancel ((s) + (((((q) * (m))) + (((m) * (q)))))) - 0022
specialize add_right_cancel ((((p) * (n))) + (((n) * (p)))) - 0023
apply add_right_cancel - 0024
trans ((((((p) * (p))) + (((n) * (n))))) + (((((q) * (m))) + (((m) * (q)))))) - 0025
symm - 0026
exact hproduct - 0027
rewrite hsquare - 0028
simp [add_assoc, add_comm, four_square_add_swap_right_tail]