GI0009

gaussian_signed_square_integer_transport

Squaring respects equality of represented integers, not equality of positive and negative components.

Alpha v34 checked-use · first admitted v28 · independently kernel and Lean verified; not Stable

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

matrix_integer_pair_product_balance · checked external prerequisiteadd_right_cancel · checked external prerequisiteadd_assoc · checked external prerequisiteadd_comm · checked external prerequisitefour_square_add_swap_right_tail · checked external prerequisite
Original expanded first-order statement
forall p n q m s. (((p) + (m)) = ((q) + (n))) -> (((((p) * (p))) + (((n) * (n)))) = ((s) + (((((p) * (n))) + (((n) * (p))))))) -> (((((q) * (q))) + (((m) * (m)))) = ((s) + (((((q) * (m))) + (((m) * (q)))))))

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

28 script commands · 6 reading checkpoints · 1 local claims

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.

Definition notation is shown below. Open the paired exact edition for the original native formulas. Source pairing is not a new equivalence certificate.

01Fix variables and assumptionsL1–7

Work with arbitrary variables or the premises of the current implication.

  1. L1
    intro p
  2. L2
    intro n
  3. L3
    intro q
  4. L4
    intro m
  5. L5
    intro s
  6. L6
    intro hequal
  7. L7
    intro hsquare
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.

  1. L8
    have hproduct : ((((((p) * (p))) + (((n) * (n))))) + (((((q) * (m))) + (((m) * (q)))))) = ((((((q) * (q))) + (((m) * (m))))) + (((((p) * (n))) + (((n) * (p))))))
  2. L9
    specialize matrix_integer_pair_product_balance p
  3. L10
    specialize matrix_integer_pair_product_balance n
  4. L11
    specialize matrix_integer_pair_product_balance q
  5. L12
    specialize matrix_integer_pair_product_balance m
  6. L13
    specialize matrix_integer_pair_product_balance p
  7. L14
    specialize matrix_integer_pair_product_balance n
  8. L15
    specialize matrix_integer_pair_product_balance q
  9. L16
    specialize matrix_integer_pair_product_balance m
  10. L17
    apply matrix_integer_pair_product_balance
03Use earlier factsL18–23

Instantiate or apply named facts and discharge the corresponding proof obligations.

  1. L18
    exact hequal
  2. L19
    exact hequal
  3. L20
    specialize add_right_cancel ((((q) * (q))) + (((m) * (m))))
  4. L21
    specialize add_right_cancel ((s) + (((((q) * (m))) + (((m) * (q))))))
  5. L22
    specialize add_right_cancel ((((p) * (n))) + (((n) * (p))))
  6. L23
    apply add_right_cancel
04Calculate and transport equalitiesL24–25

Carry out the recorded arithmetic or equality steps; inspect the exact commands for their direction and premises.

  1. L24
    trans ((((((p) * (p))) + (((n) * (n))))) + (((((q) * (m))) + (((m) * (q))))))
  2. L25
    symm
05Use earlier factsL26–26

Instantiate or apply named facts and discharge the corresponding proof obligations.

  1. L26
    exact hproduct
06Calculate and transport equalitiesL27–28

Carry out the recorded arithmetic or equality steps; inspect the exact commands for their direction and premises.

  1. L27
    rewrite hsquare
  2. L28
    simp [add_assoc, add_comm, four_square_add_swap_right_tail]

Library-wide reading audit

Original defined command ledger · 28 lines
  1. 0001intro p
  2. 0002intro n
  3. 0003intro q
  4. 0004intro m
  5. 0005intro s
  6. 0006intro hequal
  7. 0007intro hsquare
  8. 0008have hproduct : ((((((p) * (p))) + (((n) * (n))))) + (((((q) * (m))) + (((m) * (q)))))) = ((((((q) * (q))) + (((m) * (m))))) + (((((p) * (n))) + (((n) * (p))))))
  9. 0009specialize matrix_integer_pair_product_balance p
  10. 0010specialize matrix_integer_pair_product_balance n
  11. 0011specialize matrix_integer_pair_product_balance q
  12. 0012specialize matrix_integer_pair_product_balance m
  13. 0013specialize matrix_integer_pair_product_balance p
  14. 0014specialize matrix_integer_pair_product_balance n
  15. 0015specialize matrix_integer_pair_product_balance q
  16. 0016specialize matrix_integer_pair_product_balance m
  17. 0017apply matrix_integer_pair_product_balance
  18. 0018exact hequal
  19. 0019exact hequal
  20. 0020specialize add_right_cancel ((((q) * (q))) + (((m) * (m))))
  21. 0021specialize add_right_cancel ((s) + (((((q) * (m))) + (((m) * (q))))))
  22. 0022specialize add_right_cancel ((((p) * (n))) + (((n) * (p))))
  23. 0023apply add_right_cancel
  24. 0024trans ((((((p) * (p))) + (((n) * (n))))) + (((((q) * (m))) + (((m) * (q))))))
  25. 0025symm
  26. 0026exact hproduct
  27. 0027rewrite hsquare
  28. 0028simp [add_assoc, add_comm, four_square_add_swap_right_tail]