GI0010

gaussian_signed_square_sum_compensation

Exact signed cross-term compensation for a squared sum, with no unproved norm premise.

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. ∀ t. ∀ z. SignedDifferenceSquare(p,n,s)SignedDifferenceSquare(q,m,t)SignedDifferenceSquare(p + q,n + m,z) → z + (p · m + n · q + (p · m + n · q)) = s + t + (p · q + n · m + (p · q + n · m))

Every linked abbreviation expands hygienically to the identical original native formula.

Definition DAG

Actual proof prerequisites

gaussian_signed_sum_square_positivegaussian_signed_sum_square_negativeadd_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 t z. (((((p) * (p))) + (((n) * (n)))) = ((s) + (((((p) * (n))) + (((n) * (p))))))) -> (((((q) * (q))) + (((m) * (m)))) = ((t) + (((((q) * (m))) + (((m) * (q))))))) -> (((((((p) + (q))) * (((p) + (q))))) + (((((n) + (m))) * (((n) + (m)))))) = ((z) + (((((((p) + (q))) * (((n) + (m))))) + (((((n) + (m))) * (((p) + (q))))))))) -> ((z) + (((((((p) * (m))) + (((n) * (q))))) + (((((p) * (m))) + (((n) * (q)))))))) = ((s + t) + (((((((p) * (q))) + (((n) * (m))))) + (((((p) * (q))) + (((n) * (m))))))))

Complete tactic proof in conservative notation

All 29 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

29 script commands · 9 reading checkpoints · 0 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.

Named ingredients (2)
01Fix variables and assumptionsL1–10

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 t
  7. L7
    intro z
  8. L8
    intro hfirst
  9. L9
    intro hsecond
  10. L10
    intro hsum
02Use earlier factsL11–14

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

  1. L11
    specialize add_right_cancel ((z) + (((((((p) * (m))) + (((n) * (q))))) + (((((p) * (m))) + (((n) * (q))))))))
  2. L12
    specialize add_right_cancel ((s + t) + (((((((p) * (q))) + (((n) * (m))))) + (((((p) * (q))) + (((n) * (m))))))))
  3. L13
    specialize add_right_cancel ((((((p) * (n))) + (((n) * (p))))) + (((((q) * (m))) + (((m) * (q))))))
  4. L14
    apply add_right_cancel
03Calculate and transport equalitiesL15–20

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

  1. L15
    trans ((z) + (((((((((p) * (n))) + (((n) * (p))))) + (((((q) * (m))) + (((m) * (q))))))) + (((((((p) * (m))) + (((n) * (q))))) + (((((p) * (m))) + (((n) * (q))))))))))
  2. L16
    simp [add_assoc, add_comm, four_square_add_swap_right_tail]
  3. L17
    trans ((z) + (((((((p) + (q))) * (((n) + (m))))) + (((((n) + (m))) * (((p) + (q))))))))
  4. L18
    congr
  5. L19
    refl
  6. L20
    symm
04Use earlier factsL21–21

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

  1. L21
    apply gaussian_signed_sum_square_negative
05Calculate and transport equalitiesL22–23

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

  1. L22
    trans ((((((p) + (q))) * (((p) + (q))))) + (((((n) + (m))) * (((n) + (m))))))
  2. L23
    symm
06Use earlier factsL24–24

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

  1. L24
    exact hsum
07Calculate and transport equalitiesL25–25

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

  1. L25
    trans ((((((((p) * (p))) + (((n) * (n))))) + (((((q) * (q))) + (((m) * (m))))))) + (((((((p) * (q))) + (((n) * (m))))) + (((((p) * (q))) + (((n) * (m))))))))
08Use earlier factsL26–26

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

  1. L26
    apply gaussian_signed_sum_square_positive
09Calculate and transport equalitiesL27–29

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

  1. L27
    rewrite hfirst
  2. L28
    rewrite hsecond
  3. L29
    simp [add_assoc, add_comm, four_square_add_swap_right_tail]

Library-wide reading audit

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