SS000B

divisor_signed_sum_exists_from_components

Both natural folds and signed normalization are genuinely constructed; no supplied sum or sign oracle is required.

Alpha v34 checked-use · first admitted v31 · 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.

These are actual signed-table and finite-sum foundations. Equality compares represented signed values, not arbitrary encodings. MatrixMinorFourCode is reused solely as generic nested pairing, without a matrix hypothesis. Full finite signed G007 is established separately in the Möbius-inversion family.

Exact theorem in conservative defined notation

∀ F. ∀ pb. ∀ pc. ∀ nb. ∀ nc. ∀ l. MatrixMinorFourCode(F,pb,pc,nb,nc) → ∃ x. SignedPrefixSum(F,l,x)

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

Definition DAG

Actual proof prerequisites

Original expanded first-order statement
forall F pb pc nb nc l. ((F) = (((((pb) + (pc)) * S ((pb) + (pc)) + ((pc) + (pc))) + (((nb) + (nc)) * S ((nb) + (nc)) + ((nc) + (nc)))) * S ((((pb) + (pc)) * S ((pb) + (pc)) + ((pc) + (pc))) + (((nb) + (nc)) * S ((nb) + (nc)) + ((nc) + (nc)))) + ((((nb) + (nc)) * S ((nb) + (nc)) + ((nc) + (nc))) + (((nb) + (nc)) * S ((nb) + (nc)) + ((nc) + (nc)))))) -> exists z. (exists dst_positive_code_sum_exists_result dst_positive_scale_sum_exists_result dst_negative_code_sum_exists_result dst_negative_scale_sum_exists_result dst_positive_sum_sum_exists_result dst_negative_sum_sum_exists_result. (((F) = (((((dst_positive_code_sum_exists_result) + (dst_positive_scale_sum_exists_result)) * S ((dst_positive_code_sum_exists_result) + (dst_positive_scale_sum_exists_result)) + ((dst_positive_scale_sum_exists_result) + (dst_positive_scale_sum_exists_result))) + (((dst_negative_code_sum_exists_result) + (dst_negative_scale_sum_exists_result)) * S ((dst_negative_code_sum_exists_result) + (dst_negative_scale_sum_exists_result)) + ((dst_negative_scale_sum_exists_result) + (dst_negative_scale_sum_exists_result)))) * S ((((dst_positive_code_sum_exists_result) + (dst_positive_scale_sum_exists_result)) * S ((dst_positive_code_sum_exists_result) + (dst_positive_scale_sum_exists_result)) + ((dst_positive_scale_sum_exists_result) + (dst_positive_scale_sum_exists_result))) + (((dst_negative_code_sum_exists_result) + (dst_negative_scale_sum_exists_result)) * S ((dst_negative_code_sum_exists_result) + (dst_negative_scale_sum_exists_result)) + ((dst_negative_scale_sum_exists_result) + (dst_negative_scale_sum_exists_result)))) + ((((dst_negative_code_sum_exists_result) + (dst_negative_scale_sum_exists_result)) * S ((dst_negative_code_sum_exists_result) + (dst_negative_scale_sum_exists_result)) + ((dst_negative_scale_sum_exists_result) + (dst_negative_scale_sum_exists_result))) + (((dst_negative_code_sum_exists_result) + (dst_negative_scale_sum_exists_result)) * S ((dst_negative_code_sum_exists_result) + (dst_negative_scale_sum_exists_result)) + ((dst_negative_scale_sum_exists_result) + (dst_negative_scale_sum_exists_result)))))) /\ (((exists fs_u_dst_sum_exists_resultpositive fs_v_dst_sum_exists_resultpositive. ((((exists fs_h_dst_sum_exists_resultpositive_body_start. fs_h_dst_sum_exists_resultpositive_body_start + S (0) = S ((S (0)) * fs_v_dst_sum_exists_resultpositive)) /\ exists fs_q_dst_sum_exists_resultpositive_body_start. fs_u_dst_sum_exists_resultpositive = fs_q_dst_sum_exists_resultpositive_body_start * S ((S (0)) * fs_v_dst_sum_exists_resultpositive) + (0))) /\ ((((exists fs_h_dst_sum_exists_resultpositive_body_terminal. fs_h_dst_sum_exists_resultpositive_body_terminal + S (dst_positive_sum_sum_exists_result) = S ((S (l)) * fs_v_dst_sum_exists_resultpositive)) /\ exists fs_q_dst_sum_exists_resultpositive_body_terminal. fs_u_dst_sum_exists_resultpositive = fs_q_dst_sum_exists_resultpositive_body_terminal * S ((S (l)) * fs_v_dst_sum_exists_resultpositive) + (dst_positive_sum_sum_exists_result))) /\ forall fs_i_dst_sum_exists_resultpositive_body_steps. (exists fs_lt_dst_sum_exists_resultpositive_body_steps_bound. fs_lt_dst_sum_exists_resultpositive_body_steps_bound + S fs_i_dst_sum_exists_resultpositive_body_steps = l) -> exists fs_a_dst_sum_exists_resultpositive_body_steps fs_r_dst_sum_exists_resultpositive_body_steps fs_s_dst_sum_exists_resultpositive_body_steps. ((((exists fs_h_dst_sum_exists_resultpositive_body_steps_summand. fs_h_dst_sum_exists_resultpositive_body_steps_summand + S (fs_a_dst_sum_exists_resultpositive_body_steps) = S ((S (fs_i_dst_sum_exists_resultpositive_body_steps)) * dst_positive_scale_sum_exists_result)) /\ exists fs_q_dst_sum_exists_resultpositive_body_steps_summand. dst_positive_code_sum_exists_result = fs_q_dst_sum_exists_resultpositive_body_steps_summand * S ((S (fs_i_dst_sum_exists_resultpositive_body_steps)) * dst_positive_scale_sum_exists_result) + (fs_a_dst_sum_exists_resultpositive_body_steps))) /\ ((((exists fs_h_dst_sum_exists_resultpositive_body_steps_partial. fs_h_dst_sum_exists_resultpositive_body_steps_partial + S (fs_r_dst_sum_exists_resultpositive_body_steps) = S ((S (fs_i_dst_sum_exists_resultpositive_body_steps)) * fs_v_dst_sum_exists_resultpositive)) /\ exists fs_q_dst_sum_exists_resultpositive_body_steps_partial. fs_u_dst_sum_exists_resultpositive = fs_q_dst_sum_exists_resultpositive_body_steps_partial * S ((S (fs_i_dst_sum_exists_resultpositive_body_steps)) * fs_v_dst_sum_exists_resultpositive) + (fs_r_dst_sum_exists_resultpositive_body_steps))) /\ ((((exists fs_h_dst_sum_exists_resultpositive_body_steps_successor. fs_h_dst_sum_exists_resultpositive_body_steps_successor + S (fs_s_dst_sum_exists_resultpositive_body_steps) = S ((S (S fs_i_dst_sum_exists_resultpositive_body_steps)) * fs_v_dst_sum_exists_resultpositive)) /\ exists fs_q_dst_sum_exists_resultpositive_body_steps_successor. fs_u_dst_sum_exists_resultpositive = fs_q_dst_sum_exists_resultpositive_body_steps_successor * S ((S (S fs_i_dst_sum_exists_resultpositive_body_steps)) * fs_v_dst_sum_exists_resultpositive) + (fs_s_dst_sum_exists_resultpositive_body_steps))) /\ fs_s_dst_sum_exists_resultpositive_body_steps = fs_r_dst_sum_exists_resultpositive_body_steps + fs_a_dst_sum_exists_resultpositive_body_steps)))))) /\ (((exists fs_u_dst_sum_exists_resultnegative fs_v_dst_sum_exists_resultnegative. ((((exists fs_h_dst_sum_exists_resultnegative_body_start. fs_h_dst_sum_exists_resultnegative_body_start + S (0) = S ((S (0)) * fs_v_dst_sum_exists_resultnegative)) /\ exists fs_q_dst_sum_exists_resultnegative_body_start. fs_u_dst_sum_exists_resultnegative = fs_q_dst_sum_exists_resultnegative_body_start * S ((S (0)) * fs_v_dst_sum_exists_resultnegative) + (0))) /\ ((((exists fs_h_dst_sum_exists_resultnegative_body_terminal. fs_h_dst_sum_exists_resultnegative_body_terminal + S (dst_negative_sum_sum_exists_result) = S ((S (l)) * fs_v_dst_sum_exists_resultnegative)) /\ exists fs_q_dst_sum_exists_resultnegative_body_terminal. fs_u_dst_sum_exists_resultnegative = fs_q_dst_sum_exists_resultnegative_body_terminal * S ((S (l)) * fs_v_dst_sum_exists_resultnegative) + (dst_negative_sum_sum_exists_result))) /\ forall fs_i_dst_sum_exists_resultnegative_body_steps. (exists fs_lt_dst_sum_exists_resultnegative_body_steps_bound. fs_lt_dst_sum_exists_resultnegative_body_steps_bound + S fs_i_dst_sum_exists_resultnegative_body_steps = l) -> exists fs_a_dst_sum_exists_resultnegative_body_steps fs_r_dst_sum_exists_resultnegative_body_steps fs_s_dst_sum_exists_resultnegative_body_steps. ((((exists fs_h_dst_sum_exists_resultnegative_body_steps_summand. fs_h_dst_sum_exists_resultnegative_body_steps_summand + S (fs_a_dst_sum_exists_resultnegative_body_steps) = S ((S (fs_i_dst_sum_exists_resultnegative_body_steps)) * dst_negative_scale_sum_exists_result)) /\ exists fs_q_dst_sum_exists_resultnegative_body_steps_summand. dst_negative_code_sum_exists_result = fs_q_dst_sum_exists_resultnegative_body_steps_summand * S ((S (fs_i_dst_sum_exists_resultnegative_body_steps)) * dst_negative_scale_sum_exists_result) + (fs_a_dst_sum_exists_resultnegative_body_steps))) /\ ((((exists fs_h_dst_sum_exists_resultnegative_body_steps_partial. fs_h_dst_sum_exists_resultnegative_body_steps_partial + S (fs_r_dst_sum_exists_resultnegative_body_steps) = S ((S (fs_i_dst_sum_exists_resultnegative_body_steps)) * fs_v_dst_sum_exists_resultnegative)) /\ exists fs_q_dst_sum_exists_resultnegative_body_steps_partial. fs_u_dst_sum_exists_resultnegative = fs_q_dst_sum_exists_resultnegative_body_steps_partial * S ((S (fs_i_dst_sum_exists_resultnegative_body_steps)) * fs_v_dst_sum_exists_resultnegative) + (fs_r_dst_sum_exists_resultnegative_body_steps))) /\ ((((exists fs_h_dst_sum_exists_resultnegative_body_steps_successor. fs_h_dst_sum_exists_resultnegative_body_steps_successor + S (fs_s_dst_sum_exists_resultnegative_body_steps) = S ((S (S fs_i_dst_sum_exists_resultnegative_body_steps)) * fs_v_dst_sum_exists_resultnegative)) /\ exists fs_q_dst_sum_exists_resultnegative_body_steps_successor. fs_u_dst_sum_exists_resultnegative = fs_q_dst_sum_exists_resultnegative_body_steps_successor * S ((S (S fs_i_dst_sum_exists_resultnegative_body_steps)) * fs_v_dst_sum_exists_resultnegative) + (fs_s_dst_sum_exists_resultnegative_body_steps))) /\ fs_s_dst_sum_exists_resultnegative_body_steps = fs_r_dst_sum_exists_resultnegative_body_steps + fs_a_dst_sum_exists_resultnegative_body_steps)))))) /\ (exists ge_balance_positive_sum_exists_resultresult ge_balance_negative_sum_exists_resultresult. (((((z) = 2 * (ge_balance_positive_sum_exists_resultresult) /\ (ge_balance_negative_sum_exists_resultresult) = 0) \/ exists ge_signed_half_sum_exists_resultresultdecode. (((z) = 2 * ge_signed_half_sum_exists_resultresultdecode + 1 /\ (ge_balance_positive_sum_exists_resultresult) = 0) /\ (ge_balance_negative_sum_exists_resultresult) = S ge_signed_half_sum_exists_resultresultdecode))) /\ ((dst_positive_sum_sum_exists_result) + ge_balance_negative_sum_exists_resultresult = (dst_negative_sum_sum_exists_result) + ge_balance_positive_sum_exists_resultresult)))))))))

Complete tactic proof in conservative notation

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

39 script commands · 10 reading checkpoints · 3 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 (1)
01Fix variables and assumptionsL1–7

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

  1. L1
    intro F
  2. L2
    intro pb
  3. L3
    intro pc
  4. L4
    intro nb
  5. L5
    intro nc
  6. L6
    intro l
  7. L7
    intro hrep
02Establish hpL8–12

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

  1. L8
    have hp : ∃ p. Sum(pb,pc,l,p)Definitions: Sum(pb,pc,l,p)Original native command in the exact edition
  2. L9
    specialize beta_sum_exists (pb)
  3. L10
    specialize beta_sum_exists (pc)
  4. L11
    specialize beta_sum_exists (l)
  5. L12
    apply beta_sum_exists
03Separate the logical casesL13–13

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

  1. L13
    cases hp
04Establish hnL14–18

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

  1. L14
    have hn : ∃ n. Sum(nb,nc,l,n)Definitions: Sum(nb,nc,l,n)Original native command in the exact edition
  2. L15
    specialize beta_sum_exists (nb)
  3. L16
    specialize beta_sum_exists (nc)
  4. L17
    specialize beta_sum_exists (l)
  5. L18
    apply beta_sum_exists
05Separate the logical casesL19–19

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

  1. L19
    cases hn
06Establish hzL20–23

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

  1. L20
    have hz : ∃ z. SignedBalance(z,x,x1)Definitions: SignedBalance(z,x,x1)Original native command in the exact edition
  2. L21
    specialize signed_balance_total (x)
  3. L22
    specialize signed_balance_total (x1)
  4. L23
    apply signed_balance_total
07Separate the logical casesL24–24

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

  1. L24
    cases hz
08Construct an explicit witnessL25–25

Supply the displayed value, then prove that it has the required property.

  1. L25
    exists x2
09Use earlier factsL26–35

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

  1. L26
    specialize divisor_signed_sum_from_components (F)
  2. L27
    specialize divisor_signed_sum_from_components (pb)
  3. L28
    specialize divisor_signed_sum_from_components (pc)
  4. L29
    specialize divisor_signed_sum_from_components (nb)
  5. L30
    specialize divisor_signed_sum_from_components (nc)
  6. L31
    specialize divisor_signed_sum_from_components (l)
  7. L32
    specialize divisor_signed_sum_from_components (x)
  8. L33
    specialize divisor_signed_sum_from_components (x1)
  9. L34
    specialize divisor_signed_sum_from_components (x2)
  10. L35
    apply divisor_signed_sum_from_components
10Use earlier factsL36–39

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

  1. L36
    exact hrep
  2. L37
    exact hp_witness
  3. L38
    exact hn_witness
  4. L39
    exact hz_witness

Library-wide reading audit

Original defined command ledger · 39 lines
  1. 0001intro F
  2. 0002intro pb
  3. 0003intro pc
  4. 0004intro nb
  5. 0005intro nc
  6. 0006intro l
  7. 0007intro hrep
  8. 0008have hp : ∃ p. Sum(pb,pc,l,p)
  9. 0009specialize beta_sum_exists (pb)
  10. 0010specialize beta_sum_exists (pc)
  11. 0011specialize beta_sum_exists (l)
  12. 0012apply beta_sum_exists
  13. 0013cases hp
  14. 0014have hn : ∃ n. Sum(nb,nc,l,n)
  15. 0015specialize beta_sum_exists (nb)
  16. 0016specialize beta_sum_exists (nc)
  17. 0017specialize beta_sum_exists (l)
  18. 0018apply beta_sum_exists
  19. 0019cases hn
  20. 0020have hz : ∃ z. SignedBalance(z,x,x1)
  21. 0021specialize signed_balance_total (x)
  22. 0022specialize signed_balance_total (x1)
  23. 0023apply signed_balance_total
  24. 0024cases hz
  25. 0025exists x2
  26. 0026specialize divisor_signed_sum_from_components (F)
  27. 0027specialize divisor_signed_sum_from_components (pb)
  28. 0028specialize divisor_signed_sum_from_components (pc)
  29. 0029specialize divisor_signed_sum_from_components (nb)
  30. 0030specialize divisor_signed_sum_from_components (nc)
  31. 0031specialize divisor_signed_sum_from_components (l)
  32. 0032specialize divisor_signed_sum_from_components (x)
  33. 0033specialize divisor_signed_sum_from_components (x1)
  34. 0034specialize divisor_signed_sum_from_components (x2)
  35. 0035apply divisor_signed_sum_from_components
  36. 0036exact hrep
  37. 0037exact hp_witness
  38. 0038exact hn_witness
  39. 0039exact hz_witness