GI003C

gaussian_signed_balance_same_code

Two signed pairs represented by the same historic canonical integer code are genuinely equal integers.

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

∀ code. ∀ p. ∀ n. ∀ q. ∀ m. SignedBalance(code,p,n)SignedBalance(code,q,m) → p + m = q + n

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

Definition DAG

Actual proof prerequisites

signed_decode_functional · checked external prerequisiteadd_cross_sum_chain · checked external prerequisiteadd_comm · checked external prerequisite
Original expanded first-order statement
forall code p n q m. (exists ge_balance_positive_same_code_first ge_balance_negative_same_code_first. (((((code) = 2 * (ge_balance_positive_same_code_first) /\ (ge_balance_negative_same_code_first) = 0) \/ exists ge_signed_half_same_code_firstdecode. (((code) = 2 * ge_signed_half_same_code_firstdecode + 1 /\ (ge_balance_positive_same_code_first) = 0) /\ (ge_balance_negative_same_code_first) = S ge_signed_half_same_code_firstdecode))) /\ ((p) + ge_balance_negative_same_code_first = (n) + ge_balance_positive_same_code_first))) -> (exists ge_balance_positive_same_code_second ge_balance_negative_same_code_second. (((((code) = 2 * (ge_balance_positive_same_code_second) /\ (ge_balance_negative_same_code_second) = 0) \/ exists ge_signed_half_same_code_seconddecode. (((code) = 2 * ge_signed_half_same_code_seconddecode + 1 /\ (ge_balance_positive_same_code_second) = 0) /\ (ge_balance_negative_same_code_second) = S ge_signed_half_same_code_seconddecode))) /\ ((q) + ge_balance_negative_same_code_second = (m) + ge_balance_positive_same_code_second))) -> (((p) + (m)) = ((q) + (n)))

Complete tactic proof in conservative notation

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

43 script commands · 11 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–7

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

  1. L1
    intro code
  2. L2
    intro p
  3. L3
    intro n
  4. L4
    intro q
  5. L5
    intro m
  6. L6
    intro hfirst
  7. L7
    intro hsecond
02Separate the logical casesL8–13

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

  1. L8
    cases hfirst
  2. L9
    cases hfirst_witness
  3. L10
    cases hfirst_witness_witness
  4. L11
    cases hsecond
  5. L12
    cases hsecond_witness
  6. L13
    cases hsecond_witness_witness
03Establish hdecodedL14–22

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

  1. L14
    have hdecoded : x = x2 /\ x1 = x3
  2. L15
    specialize signed_decode_functional code
  3. L16
    specialize signed_decode_functional x
  4. L17
    specialize signed_decode_functional x1
  5. L18
    specialize signed_decode_functional x2
  6. L19
    specialize signed_decode_functional x3
  7. L20
    apply signed_decode_functional
  8. L21
    exact hfirst_witness_witness_left
  9. L22
    exact hsecond_witness_witness_left
04Separate the logical casesL23–23

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

  1. L23
    cases hdecoded
05Calculate and transport equalitiesL24–25

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

  1. L24
    rewrite hdecoded_left at hfirst_witness_witness_right
  2. L25
    rewrite hdecoded_right at hfirst_witness_witness_right
06Establish hcrossL26–35

Establish this local claim before using it. It is not an additional assumption. The following proof commands apply add cross sum chain.

  1. L26
    have hcross : p + m = n + q
  2. L27
    specialize add_cross_sum_chain p
  3. L28
    specialize add_cross_sum_chain n
  4. L29
    specialize add_cross_sum_chain x3
  5. L30
    specialize add_cross_sum_chain x2
  6. L31
    specialize add_cross_sum_chain m
  7. L32
    specialize add_cross_sum_chain q
  8. L33
    apply add_cross_sum_chain
  9. L34
    exact hfirst_witness_witness_right
  10. L35
    trans m + x2
07Use earlier factsL36–36

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

  1. L36
    apply add_comm
08Calculate and transport equalitiesL37–38

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

  1. L37
    trans q + x3
  2. L38
    symm
09Use earlier factsL39–40

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

  1. L39
    exact hsecond_witness_witness_right
  2. L40
    apply add_comm
10Calculate and transport equalitiesL41–41

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

  1. L41
    trans n + q
11Use earlier factsL42–43

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

  1. L42
    exact hcross
  2. L43
    apply add_comm

Library-wide reading audit

Original defined command ledger · 43 lines
  1. 0001intro code
  2. 0002intro p
  3. 0003intro n
  4. 0004intro q
  5. 0005intro m
  6. 0006intro hfirst
  7. 0007intro hsecond
  8. 0008cases hfirst
  9. 0009cases hfirst_witness
  10. 0010cases hfirst_witness_witness
  11. 0011cases hsecond
  12. 0012cases hsecond_witness
  13. 0013cases hsecond_witness_witness
  14. 0014have hdecoded : x = x2 /\ x1 = x3
  15. 0015specialize signed_decode_functional code
  16. 0016specialize signed_decode_functional x
  17. 0017specialize signed_decode_functional x1
  18. 0018specialize signed_decode_functional x2
  19. 0019specialize signed_decode_functional x3
  20. 0020apply signed_decode_functional
  21. 0021exact hfirst_witness_witness_left
  22. 0022exact hsecond_witness_witness_left
  23. 0023cases hdecoded
  24. 0024rewrite hdecoded_left at hfirst_witness_witness_right
  25. 0025rewrite hdecoded_right at hfirst_witness_witness_right
  26. 0026have hcross : p + m = n + q
  27. 0027specialize add_cross_sum_chain p
  28. 0028specialize add_cross_sum_chain n
  29. 0029specialize add_cross_sum_chain x3
  30. 0030specialize add_cross_sum_chain x2
  31. 0031specialize add_cross_sum_chain m
  32. 0032specialize add_cross_sum_chain q
  33. 0033apply add_cross_sum_chain
  34. 0034exact hfirst_witness_witness_right
  35. 0035trans m + x2
  36. 0036apply add_comm
  37. 0037trans q + x3
  38. 0038symm
  39. 0039exact hsecond_witness_witness_right
  40. 0040apply add_comm
  41. 0041trans n + q
  42. 0042exact hcross
  43. 0043apply add_comm