GI0040

gaussian_representation_functional

The canonical Gaussian natural code representing two specified integer differences is unique.

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

∀ z. ∀ w. ∀ a. ∀ b. ∀ c. ∀ d. ZPairRep(z,a,b,c,d)ZPairRep(w,a,b,c,d) → z = w

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

Definition DAG

Actual proof prerequisites

signed_balance_functional · checked external prerequisite
Original expanded first-order statement
forall z w a b c d. (exists ge_representation_real_code_representation_first ge_representation_imaginary_code_representation_first. (((z) = ((ge_representation_real_code_representation_first) + (ge_representation_imaginary_code_representation_first)) * S ((ge_representation_real_code_representation_first) + (ge_representation_imaginary_code_representation_first)) + ((ge_representation_imaginary_code_representation_first) + (ge_representation_imaginary_code_representation_first))) /\ ((exists ge_balance_positive_representation_firstreal ge_balance_negative_representation_firstreal. (((((ge_representation_real_code_representation_first) = 2 * (ge_balance_positive_representation_firstreal) /\ (ge_balance_negative_representation_firstreal) = 0) \/ exists ge_signed_half_representation_firstrealdecode. (((ge_representation_real_code_representation_first) = 2 * ge_signed_half_representation_firstrealdecode + 1 /\ (ge_balance_positive_representation_firstreal) = 0) /\ (ge_balance_negative_representation_firstreal) = S ge_signed_half_representation_firstrealdecode))) /\ ((a) + ge_balance_negative_representation_firstreal = (b) + ge_balance_positive_representation_firstreal))) /\ (exists ge_balance_positive_representation_firstimaginary ge_balance_negative_representation_firstimaginary. (((((ge_representation_imaginary_code_representation_first) = 2 * (ge_balance_positive_representation_firstimaginary) /\ (ge_balance_negative_representation_firstimaginary) = 0) \/ exists ge_signed_half_representation_firstimaginarydecode. (((ge_representation_imaginary_code_representation_first) = 2 * ge_signed_half_representation_firstimaginarydecode + 1 /\ (ge_balance_positive_representation_firstimaginary) = 0) /\ (ge_balance_negative_representation_firstimaginary) = S ge_signed_half_representation_firstimaginarydecode))) /\ ((c) + ge_balance_negative_representation_firstimaginary = (d) + ge_balance_positive_representation_firstimaginary)))))) -> (exists ge_representation_real_code_representation_second ge_representation_imaginary_code_representation_second. (((w) = ((ge_representation_real_code_representation_second) + (ge_representation_imaginary_code_representation_second)) * S ((ge_representation_real_code_representation_second) + (ge_representation_imaginary_code_representation_second)) + ((ge_representation_imaginary_code_representation_second) + (ge_representation_imaginary_code_representation_second))) /\ ((exists ge_balance_positive_representation_secondreal ge_balance_negative_representation_secondreal. (((((ge_representation_real_code_representation_second) = 2 * (ge_balance_positive_representation_secondreal) /\ (ge_balance_negative_representation_secondreal) = 0) \/ exists ge_signed_half_representation_secondrealdecode. (((ge_representation_real_code_representation_second) = 2 * ge_signed_half_representation_secondrealdecode + 1 /\ (ge_balance_positive_representation_secondreal) = 0) /\ (ge_balance_negative_representation_secondreal) = S ge_signed_half_representation_secondrealdecode))) /\ ((a) + ge_balance_negative_representation_secondreal = (b) + ge_balance_positive_representation_secondreal))) /\ (exists ge_balance_positive_representation_secondimaginary ge_balance_negative_representation_secondimaginary. (((((ge_representation_imaginary_code_representation_second) = 2 * (ge_balance_positive_representation_secondimaginary) /\ (ge_balance_negative_representation_secondimaginary) = 0) \/ exists ge_signed_half_representation_secondimaginarydecode. (((ge_representation_imaginary_code_representation_second) = 2 * ge_signed_half_representation_secondimaginarydecode + 1 /\ (ge_balance_positive_representation_secondimaginary) = 0) /\ (ge_balance_negative_representation_secondimaginary) = S ge_signed_half_representation_secondimaginarydecode))) /\ ((c) + ge_balance_negative_representation_secondimaginary = (d) + ge_balance_positive_representation_secondimaginary)))))) -> z = w

Complete tactic proof in conservative notation

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

42 script commands · 8 reading checkpoints · 2 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–8

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

  1. L1
    intro z
  2. L2
    intro w
  3. L3
    intro a
  4. L4
    intro b
  5. L5
    intro c
  6. L6
    intro d
  7. L7
    intro hfirst
  8. L8
    intro hsecond
02Separate the logical casesL9–16

Follow the explicit conjunction, disjunction, witness, or contradiction step recorded below.

  1. L9
    cases hfirst
  2. L10
    cases hfirst_witness
  3. L11
    cases hfirst_witness_witness
  4. L12
    cases hfirst_witness_witness_right
  5. L13
    cases hsecond
  6. L14
    cases hsecond_witness
  7. L15
    cases hsecond_witness_witness
  8. L16
    cases hsecond_witness_witness_right
03Establish hrealL17–24

Establish this local claim before using it. It is not an additional assumption. The following proof commands apply signed balance functional.

  1. L17
    have hreal : x = x2
  2. L18
    specialize signed_balance_functional a
  3. L19
    specialize signed_balance_functional b
  4. L20
    specialize signed_balance_functional x
  5. L21
    specialize signed_balance_functional x2
  6. L22
    apply signed_balance_functional
  7. L23
    exact hfirst_witness_witness_right_left
  8. L24
    exact hsecond_witness_witness_right_left
04Establish himaginaryL25–34

Establish this local claim before using it. It is not an additional assumption. The following proof commands apply signed balance functional.

  1. L25
    have himaginary : x1 = x3
  2. L26
    specialize signed_balance_functional c
  3. L27
    specialize signed_balance_functional d
  4. L28
    specialize signed_balance_functional x1
  5. L29
    specialize signed_balance_functional x3
  6. L30
    apply signed_balance_functional
  7. L31
    exact hfirst_witness_witness_right_right
  8. L32
    exact hsecond_witness_witness_right_right
  9. L33
    rewrite hreal at hfirst_witness_witness_left
  10. L34
    rewrite hreal at hfirst_witness_witness_left
05Calculate and transport equalitiesL35–39

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

  1. L35
    rewrite himaginary at hfirst_witness_witness_left
  2. L36
    rewrite himaginary at hfirst_witness_witness_left
  3. L37
    rewrite himaginary at hfirst_witness_witness_left
  4. L38
    rewrite himaginary at hfirst_witness_witness_left
  5. L39
    trans ((x2) + (x3)) * S ((x2) + (x3)) + ((x3) + (x3))
06Use earlier factsL40–40

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

  1. L40
    exact hfirst_witness_witness_left
07Calculate and transport equalitiesL41–41

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

  1. L41
    symm
08Use earlier factsL42–42

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

  1. L42
    exact hsecond_witness_witness_left

Library-wide reading audit

Original defined command ledger · 42 lines
  1. 0001intro z
  2. 0002intro w
  3. 0003intro a
  4. 0004intro b
  5. 0005intro c
  6. 0006intro d
  7. 0007intro hfirst
  8. 0008intro hsecond
  9. 0009cases hfirst
  10. 0010cases hfirst_witness
  11. 0011cases hfirst_witness_witness
  12. 0012cases hfirst_witness_witness_right
  13. 0013cases hsecond
  14. 0014cases hsecond_witness
  15. 0015cases hsecond_witness_witness
  16. 0016cases hsecond_witness_witness_right
  17. 0017have hreal : x = x2
  18. 0018specialize signed_balance_functional a
  19. 0019specialize signed_balance_functional b
  20. 0020specialize signed_balance_functional x
  21. 0021specialize signed_balance_functional x2
  22. 0022apply signed_balance_functional
  23. 0023exact hfirst_witness_witness_right_left
  24. 0024exact hsecond_witness_witness_right_left
  25. 0025have himaginary : x1 = x3
  26. 0026specialize signed_balance_functional c
  27. 0027specialize signed_balance_functional d
  28. 0028specialize signed_balance_functional x1
  29. 0029specialize signed_balance_functional x3
  30. 0030apply signed_balance_functional
  31. 0031exact hfirst_witness_witness_right_right
  32. 0032exact hsecond_witness_witness_right_right
  33. 0033rewrite hreal at hfirst_witness_witness_left
  34. 0034rewrite hreal at hfirst_witness_witness_left
  35. 0035rewrite himaginary at hfirst_witness_witness_left
  36. 0036rewrite himaginary at hfirst_witness_witness_left
  37. 0037rewrite himaginary at hfirst_witness_witness_left
  38. 0038rewrite himaginary at hfirst_witness_witness_left
  39. 0039trans ((x2) + (x3)) * S ((x2) + (x3)) + ((x3) + (x3))
  40. 0040exact hfirst_witness_witness_left
  41. 0041symm
  42. 0042exact hsecond_witness_witness_left