BT00K5 · Bertrand theorem

beta_sum_pointwise_add

Alpha v34 checked-use theorem · independently kernel and Lean verified; not Stable

Pointwise sums of decoded entries induce exact addition of finite sums.

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.

Statement with defined notation

∀ b. ∀ c. ∀ d. ∀ e. ∀ f. ∀ g. ∀ l. ∀ n. ∀ m. ∀ q. Sum(b,c,l,n)Sum(d,e,l,m)Sum(f,g,l,q) → (∀ x. ∀ y. ∀ z. ∀ k. Lt(x,l)BetaAt(b,c,x,y)BetaAt(d,e,x,z)BetaAt(f,g,x,k) → k = y + z) → n + m = q

Every purple notation token opens its conservative definition. Expanding the displayed statement recovers the exact first-order Peano-arithmetic formula checked by the unchanged kernel.

Definitions used by this theorem

In the theorem statement

7 occurrences

In local proof propositions

10 occurrences

Exact expanded native-PA statement
forall b c d e f g l n m q. (exists ff_u_pointadd_left ff_v_pointadd_left. ((((exists ff_h_pointadd_left_start. ff_h_pointadd_left_start + S (0) = S ((S (0)) * ff_v_pointadd_left)) /\ exists ff_q_pointadd_left_start. ff_u_pointadd_left = ff_q_pointadd_left_start * S ((S (0)) * ff_v_pointadd_left) + (0))) /\ ((((exists ff_h_pointadd_left_terminal. ff_h_pointadd_left_terminal + S (n) = S ((S (l)) * ff_v_pointadd_left)) /\ exists ff_q_pointadd_left_terminal. ff_u_pointadd_left = ff_q_pointadd_left_terminal * S ((S (l)) * ff_v_pointadd_left) + (n))) /\ forall ff_i_pointadd_left. (exists ff_lt_pointadd_left_bound. ff_lt_pointadd_left_bound + S ff_i_pointadd_left = l) -> exists ff_a_pointadd_left ff_r_pointadd_left ff_s_pointadd_left. ((((exists ff_h_pointadd_left_summand. ff_h_pointadd_left_summand + S (ff_a_pointadd_left) = S ((S (ff_i_pointadd_left)) * c)) /\ exists ff_q_pointadd_left_summand. b = ff_q_pointadd_left_summand * S ((S (ff_i_pointadd_left)) * c) + (ff_a_pointadd_left))) /\ ((((exists ff_h_pointadd_left_partial. ff_h_pointadd_left_partial + S (ff_r_pointadd_left) = S ((S (ff_i_pointadd_left)) * ff_v_pointadd_left)) /\ exists ff_q_pointadd_left_partial. ff_u_pointadd_left = ff_q_pointadd_left_partial * S ((S (ff_i_pointadd_left)) * ff_v_pointadd_left) + (ff_r_pointadd_left))) /\ ((((exists ff_h_pointadd_left_successor. ff_h_pointadd_left_successor + S (ff_s_pointadd_left) = S ((S (S ff_i_pointadd_left)) * ff_v_pointadd_left)) /\ exists ff_q_pointadd_left_successor. ff_u_pointadd_left = ff_q_pointadd_left_successor * S ((S (S ff_i_pointadd_left)) * ff_v_pointadd_left) + (ff_s_pointadd_left))) /\ ff_s_pointadd_left = ff_r_pointadd_left + ff_a_pointadd_left)))))) -> (exists ff_u_pointadd_right ff_v_pointadd_right. ((((exists ff_h_pointadd_right_start. ff_h_pointadd_right_start + S (0) = S ((S (0)) * ff_v_pointadd_right)) /\ exists ff_q_pointadd_right_start. ff_u_pointadd_right = ff_q_pointadd_right_start * S ((S (0)) * ff_v_pointadd_right) + (0))) /\ ((((exists ff_h_pointadd_right_terminal. ff_h_pointadd_right_terminal + S (m) = S ((S (l)) * ff_v_pointadd_right)) /\ exists ff_q_pointadd_right_terminal. ff_u_pointadd_right = ff_q_pointadd_right_terminal * S ((S (l)) * ff_v_pointadd_right) + (m))) /\ forall ff_i_pointadd_right. (exists ff_lt_pointadd_right_bound. ff_lt_pointadd_right_bound + S ff_i_pointadd_right = l) -> exists ff_a_pointadd_right ff_r_pointadd_right ff_s_pointadd_right. ((((exists ff_h_pointadd_right_summand. ff_h_pointadd_right_summand + S (ff_a_pointadd_right) = S ((S (ff_i_pointadd_right)) * e)) /\ exists ff_q_pointadd_right_summand. d = ff_q_pointadd_right_summand * S ((S (ff_i_pointadd_right)) * e) + (ff_a_pointadd_right))) /\ ((((exists ff_h_pointadd_right_partial. ff_h_pointadd_right_partial + S (ff_r_pointadd_right) = S ((S (ff_i_pointadd_right)) * ff_v_pointadd_right)) /\ exists ff_q_pointadd_right_partial. ff_u_pointadd_right = ff_q_pointadd_right_partial * S ((S (ff_i_pointadd_right)) * ff_v_pointadd_right) + (ff_r_pointadd_right))) /\ ((((exists ff_h_pointadd_right_successor. ff_h_pointadd_right_successor + S (ff_s_pointadd_right) = S ((S (S ff_i_pointadd_right)) * ff_v_pointadd_right)) /\ exists ff_q_pointadd_right_successor. ff_u_pointadd_right = ff_q_pointadd_right_successor * S ((S (S ff_i_pointadd_right)) * ff_v_pointadd_right) + (ff_s_pointadd_right))) /\ ff_s_pointadd_right = ff_r_pointadd_right + ff_a_pointadd_right)))))) -> (exists ff_u_pointadd_total ff_v_pointadd_total. ((((exists ff_h_pointadd_total_start. ff_h_pointadd_total_start + S (0) = S ((S (0)) * ff_v_pointadd_total)) /\ exists ff_q_pointadd_total_start. ff_u_pointadd_total = ff_q_pointadd_total_start * S ((S (0)) * ff_v_pointadd_total) + (0))) /\ ((((exists ff_h_pointadd_total_terminal. ff_h_pointadd_total_terminal + S (q) = S ((S (l)) * ff_v_pointadd_total)) /\ exists ff_q_pointadd_total_terminal. ff_u_pointadd_total = ff_q_pointadd_total_terminal * S ((S (l)) * ff_v_pointadd_total) + (q))) /\ forall ff_i_pointadd_total. (exists ff_lt_pointadd_total_bound. ff_lt_pointadd_total_bound + S ff_i_pointadd_total = l) -> exists ff_a_pointadd_total ff_r_pointadd_total ff_s_pointadd_total. ((((exists ff_h_pointadd_total_summand. ff_h_pointadd_total_summand + S (ff_a_pointadd_total) = S ((S (ff_i_pointadd_total)) * g)) /\ exists ff_q_pointadd_total_summand. f = ff_q_pointadd_total_summand * S ((S (ff_i_pointadd_total)) * g) + (ff_a_pointadd_total))) /\ ((((exists ff_h_pointadd_total_partial. ff_h_pointadd_total_partial + S (ff_r_pointadd_total) = S ((S (ff_i_pointadd_total)) * ff_v_pointadd_total)) /\ exists ff_q_pointadd_total_partial. ff_u_pointadd_total = ff_q_pointadd_total_partial * S ((S (ff_i_pointadd_total)) * ff_v_pointadd_total) + (ff_r_pointadd_total))) /\ ((((exists ff_h_pointadd_total_successor. ff_h_pointadd_total_successor + S (ff_s_pointadd_total) = S ((S (S ff_i_pointadd_total)) * ff_v_pointadd_total)) /\ exists ff_q_pointadd_total_successor. ff_u_pointadd_total = ff_q_pointadd_total_successor * S ((S (S ff_i_pointadd_total)) * ff_v_pointadd_total) + (ff_s_pointadd_total))) /\ ff_s_pointadd_total = ff_r_pointadd_total + ff_a_pointadd_total)))))) -> (forall i a z s. (exists h. h + S i = l) -> (((exists ff_h_pointadd_left_entry. ff_h_pointadd_left_entry + S (a) = S ((S (i)) * c)) /\ exists ff_q_pointadd_left_entry. b = ff_q_pointadd_left_entry * S ((S (i)) * c) + (a))) -> (((exists ff_h_pointadd_right_entry. ff_h_pointadd_right_entry + S (z) = S ((S (i)) * e)) /\ exists ff_q_pointadd_right_entry. d = ff_q_pointadd_right_entry * S ((S (i)) * e) + (z))) -> (((exists ff_h_pointadd_total_entry. ff_h_pointadd_total_entry + S (s) = S ((S (i)) * g)) /\ exists ff_q_pointadd_total_entry. f = ff_q_pointadd_total_entry * S ((S (i)) * g) + (s))) -> s = a + z) -> n + m = q

Proof neighborhood

Direct theorem prerequisites

Direct theorem dependents

Definition-aware tactic body

Only local propositions introduced by have or suffices are compacted. Every changed line has an exact-AST conservative-expansion receipt; the kernel still receives the immutable original tactic script.

Read the argument

Proof checkpoints

127 script commands · 21 reading checkpoints · 9 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 (5)
01Fix variables and assumptionsL1–6

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

  1. L1
    intro b
  2. L2
    intro c
  3. L3
    intro d
  4. L4
    intro e
  5. L5
    intro f
  6. L6
    intro g
02Induction on lL7–14

Split the argument into the base and successor obligations. The induction hypothesis is available only in the successor branch.

  1. L7
    induction l
  2. L8
    intro n
  3. L9
    intro m
  4. L10
    intro q
  5. L11
    intro hleft
  6. L12
    intro hright
  7. L13
    intro htotal
  8. L14
    intro hpointwise
03Establish hnL15–20

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

  1. L15
    have hn : n = 0
  2. L16
    specialize beta_sum_zero b
  3. L17
    specialize beta_sum_zero c
  4. L18
    specialize beta_sum_zero n
  5. L19
    apply beta_sum_zero
  6. L20
    exact hleft
04Establish hmL21–26

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

  1. L21
    have hm : m = 0
  2. L22
    specialize beta_sum_zero d
  3. L23
    specialize beta_sum_zero e
  4. L24
    specialize beta_sum_zero m
  5. L25
    apply beta_sum_zero
  6. L26
    exact hright
05Establish hqL27–36

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

  1. L27
    have hq : q = 0
  2. L28
    specialize beta_sum_zero f
  3. L29
    specialize beta_sum_zero g
  4. L30
    specialize beta_sum_zero q
  5. L31
    apply beta_sum_zero
  6. L32
    exact htotal
  7. L33
    rewrite hn
  8. L34
    rewrite hm
  9. L35
    rewrite hq
  10. L36
    simp
06Fix variables and assumptionsL37–43

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

  1. L37
    intro n
  2. L38
    intro m
  3. L39
    intro q
  4. L40
    intro hleft
  5. L41
    intro hright
  6. L42
    intro htotal
  7. L43
    intro hpointwise
07Establish hleft_decompL44–50

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

  1. L44
    have hleft_decomp : ∃ a. ∃ r. BetaAt(b,c,l,a) ∧ (Sum(b,c,l,r) ∧ n = r + a)Definitions: BetaAt(b,c,l,a)Sum(b,c,l,r)Original native command in the exact edition
  2. L45
    specialize beta_sum_succ_decompose b
  3. L46
    specialize beta_sum_succ_decompose c
  4. L47
    specialize beta_sum_succ_decompose l
  5. L48
    specialize beta_sum_succ_decompose n
  6. L49
    apply beta_sum_succ_decompose
  7. L50
    exact hleft
08Separate the logical casesL51–54

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

  1. L51
    cases hleft_decomp
  2. L52
    cases hleft_decomp_witness
  3. L53
    cases hleft_decomp_witness_witness
  4. L54
    cases hleft_decomp_witness_witness_right
09Establish hright_decompL55–61

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

  1. L55
    have hright_decomp : ∃ a. ∃ r. BetaAt(d,e,l,a) ∧ (Sum(d,e,l,r) ∧ m = r + a)Definitions: BetaAt(d,e,l,a)Sum(d,e,l,r)Original native command in the exact edition
  2. L56
    specialize beta_sum_succ_decompose d
  3. L57
    specialize beta_sum_succ_decompose e
  4. L58
    specialize beta_sum_succ_decompose l
  5. L59
    specialize beta_sum_succ_decompose m
  6. L60
    apply beta_sum_succ_decompose
  7. L61
    exact hright
10Separate the logical casesL62–65

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

  1. L62
    cases hright_decomp
  2. L63
    cases hright_decomp_witness
  3. L64
    cases hright_decomp_witness_witness
  4. L65
    cases hright_decomp_witness_witness_right
11Establish htotal_decompL66–72

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

  1. L66
    have htotal_decomp : ∃ a. ∃ r. BetaAt(f,g,l,a) ∧ (Sum(f,g,l,r) ∧ q = r + a)Definitions: BetaAt(f,g,l,a)Sum(f,g,l,r)Original native command in the exact edition
  2. L67
    specialize beta_sum_succ_decompose f
  3. L68
    specialize beta_sum_succ_decompose g
  4. L69
    specialize beta_sum_succ_decompose l
  5. L70
    specialize beta_sum_succ_decompose q
  6. L71
    apply beta_sum_succ_decompose
  7. L72
    exact htotal
12Separate the logical casesL73–76

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

  1. L73
    cases htotal_decomp
  2. L74
    cases htotal_decomp_witness
  3. L75
    cases htotal_decomp_witness_witness
  4. L76
    cases htotal_decomp_witness_witness_right
13Establish hprefix_pointwiseL77–86

Establish this local claim before using it. It is not an additional assumption.

  1. L77
    have hprefix_pointwise : ∀ i. ∀ a. ∀ z. ∀ s. Lt(i,l) → BetaAt(b,c,i,a) → BetaAt(d,e,i,z) → BetaAt(f,g,i,s) → s = a + zDefinitions: Lt(i,l)BetaAt(b,c,i,a)BetaAt(d,e,i,z)BetaAt(f,g,i,s)Original native command in the exact edition
  2. L78
    intro i
  3. L79
    intro a
  4. L80
    intro z
  5. L81
    intro s
  6. L82
    intro hi
  7. L83
    intro ha
  8. L84
    intro hz
  9. L85
    intro hs
  10. L86
    specialize hpointwise i
14Use earlier factsL87–96

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

  1. L87
    specialize hpointwise a
  2. L88
    specialize hpointwise z
  3. L89
    specialize hpointwise s
  4. L90
    apply hpointwise
  5. L91
    specialize le_succ (S i)
  6. L92
    specialize le_succ l
  7. L93
    apply le_succ
  8. L94
    exact hi
  9. L95
    exact ha
  10. L96
    exact hz
15Use earlier factsL97–97

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

  1. L97
    exact hs
16Establish hprefixL98–106

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

  1. L98
    have hprefix : x1 + x3 = x5
  2. L99
    specialize IH x1
  3. L100
    specialize IH x3
  4. L101
    specialize IH x5
  5. L102
    apply IH
  6. L103
    exact hleft_decomp_witness_witness_right_left
  7. L104
    exact hright_decomp_witness_witness_right_left
  8. L105
    exact htotal_decomp_witness_witness_right_left
  9. L106
    exact hprefix_pointwise
17Establish hlastL107–116

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

  1. L107
    have hlast : x4 = x + x2
  2. L108
    specialize hpointwise l
  3. L109
    specialize hpointwise x
  4. L110
    specialize hpointwise x2
  5. L111
    specialize hpointwise x4
  6. L112
    apply hpointwise
  7. L113
    specialize le_refl (S l)
  8. L114
    exact le_refl
  9. L115
    exact hleft_decomp_witness_witness_left
  10. L116
    exact hright_decomp_witness_witness_left
18Use earlier factsL117–117

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

  1. L117
    exact htotal_decomp_witness_witness_left
19Calculate and transport equalitiesL118–124

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

  1. L118
    rewrite hleft_decomp_witness_witness_right_right
  2. L119
    rewrite hright_decomp_witness_witness_right_right
  3. L120
    rewrite htotal_decomp_witness_witness_right_right
  4. L121
    rewrite hlast
  5. L122
    simp [add_assoc, add_comm]
  6. L123
    trans (x1 + x3) + (x2 + x)
  7. L124
    symm
20Use earlier factsL125–125

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

  1. L125
    apply add_assoc
21Calculate and transport equalitiesL126–127

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

  1. L126
    rewrite hprefix
  2. L127
    refl

Library-wide reading audit

Original defined command ledger · 127 lines
  1. 0001intro b
  2. 0002intro c
  3. 0003intro d
  4. 0004intro e
  5. 0005intro f
  6. 0006intro g
  7. 0007induction l
  8. 0008intro n
  9. 0009intro m
  10. 0010intro q
  11. 0011intro hleft
  12. 0012intro hright
  13. 0013intro htotal
  14. 0014intro hpointwise
  15. 0015have hn : n = 0
  16. 0016specialize beta_sum_zero b
  17. 0017specialize beta_sum_zero c
  18. 0018specialize beta_sum_zero n
  19. 0019apply beta_sum_zero
  20. 0020exact hleft
  21. 0021have hm : m = 0
  22. 0022specialize beta_sum_zero d
  23. 0023specialize beta_sum_zero e
  24. 0024specialize beta_sum_zero m
  25. 0025apply beta_sum_zero
  26. 0026exact hright
  27. 0027have hq : q = 0
  28. 0028specialize beta_sum_zero f
  29. 0029specialize beta_sum_zero g
  30. 0030specialize beta_sum_zero q
  31. 0031apply beta_sum_zero
  32. 0032exact htotal
  33. 0033rewrite hn
  34. 0034rewrite hm
  35. 0035rewrite hq
  36. 0036simp
  37. 0037intro n
  38. 0038intro m
  39. 0039intro q
  40. 0040intro hleft
  41. 0041intro hright
  42. 0042intro htotal
  43. 0043intro hpointwise
  44. 0044have hleft_decomp : ∃ a. ∃ r. BetaAt(b,c,l,a) ∧ (Sum(b,c,l,r) ∧ n = r + a)
    Exact native replay linehave hleft_decomp : exists a r. (((exists ff_h_pointadd_left_decomp_entry. ff_h_pointadd_left_decomp_entry + S (a) = S ((S (l)) * c)) /\ exists ff_q_pointadd_left_decomp_entry. b = ff_q_pointadd_left_decomp_entry * S ((S (l)) * c) + (a))) /\ ((exists ff_u_pointadd_left_decomp_prefix ff_v_pointadd_left_decomp_prefix. ((((exists ff_h_pointadd_left_decomp_prefix_start. ff_h_pointadd_left_decomp_prefix_start + S (0) = S ((S (0)) * ff_v_pointadd_left_decomp_prefix)) /\ exists ff_q_pointadd_left_decomp_prefix_start. ff_u_pointadd_left_decomp_prefix = ff_q_pointadd_left_decomp_prefix_start * S ((S (0)) * ff_v_pointadd_left_decomp_prefix) + (0))) /\ ((((exists ff_h_pointadd_left_decomp_prefix_terminal. ff_h_pointadd_left_decomp_prefix_terminal + S (r) = S ((S (l)) * ff_v_pointadd_left_decomp_prefix)) /\ exists ff_q_pointadd_left_decomp_prefix_terminal. ff_u_pointadd_left_decomp_prefix = ff_q_pointadd_left_decomp_prefix_terminal * S ((S (l)) * ff_v_pointadd_left_decomp_prefix) + (r))) /\ forall ff_i_pointadd_left_decomp_prefix. (exists ff_lt_pointadd_left_decomp_prefix_bound. ff_lt_pointadd_left_decomp_prefix_bound + S ff_i_pointadd_left_decomp_prefix = l) -> exists ff_a_pointadd_left_decomp_prefix ff_r_pointadd_left_decomp_prefix ff_s_pointadd_left_decomp_prefix. ((((exists ff_h_pointadd_left_decomp_prefix_summand. ff_h_pointadd_left_decomp_prefix_summand + S (ff_a_pointadd_left_decomp_prefix) = S ((S (ff_i_pointadd_left_decomp_prefix)) * c)) /\ exists ff_q_pointadd_left_decomp_prefix_summand. b = ff_q_pointadd_left_decomp_prefix_summand * S ((S (ff_i_pointadd_left_decomp_prefix)) * c) + (ff_a_pointadd_left_decomp_prefix))) /\ ((((exists ff_h_pointadd_left_decomp_prefix_partial. ff_h_pointadd_left_decomp_prefix_partial + S (ff_r_pointadd_left_decomp_prefix) = S ((S (ff_i_pointadd_left_decomp_prefix)) * ff_v_pointadd_left_decomp_prefix)) /\ exists ff_q_pointadd_left_decomp_prefix_partial. ff_u_pointadd_left_decomp_prefix = ff_q_pointadd_left_decomp_prefix_partial * S ((S (ff_i_pointadd_left_decomp_prefix)) * ff_v_pointadd_left_decomp_prefix) + (ff_r_pointadd_left_decomp_prefix))) /\ ((((exists ff_h_pointadd_left_decomp_prefix_successor. ff_h_pointadd_left_decomp_prefix_successor + S (ff_s_pointadd_left_decomp_prefix) = S ((S (S ff_i_pointadd_left_decomp_prefix)) * ff_v_pointadd_left_decomp_prefix)) /\ exists ff_q_pointadd_left_decomp_prefix_successor. ff_u_pointadd_left_decomp_prefix = ff_q_pointadd_left_decomp_prefix_successor * S ((S (S ff_i_pointadd_left_decomp_prefix)) * ff_v_pointadd_left_decomp_prefix) + (ff_s_pointadd_left_decomp_prefix))) /\ ff_s_pointadd_left_decomp_prefix = ff_r_pointadd_left_decomp_prefix + ff_a_pointadd_left_decomp_prefix)))))) /\ n = r + a)
  45. 0045specialize beta_sum_succ_decompose b
  46. 0046specialize beta_sum_succ_decompose c
  47. 0047specialize beta_sum_succ_decompose l
  48. 0048specialize beta_sum_succ_decompose n
  49. 0049apply beta_sum_succ_decompose
  50. 0050exact hleft
  51. 0051cases hleft_decomp
  52. 0052cases hleft_decomp_witness
  53. 0053cases hleft_decomp_witness_witness
  54. 0054cases hleft_decomp_witness_witness_right
  55. 0055have hright_decomp : ∃ a. ∃ r. BetaAt(d,e,l,a) ∧ (Sum(d,e,l,r) ∧ m = r + a)
    Exact native replay linehave hright_decomp : exists a r. (((exists ff_h_pointadd_right_decomp_entry. ff_h_pointadd_right_decomp_entry + S (a) = S ((S (l)) * e)) /\ exists ff_q_pointadd_right_decomp_entry. d = ff_q_pointadd_right_decomp_entry * S ((S (l)) * e) + (a))) /\ ((exists ff_u_pointadd_right_decomp_prefix ff_v_pointadd_right_decomp_prefix. ((((exists ff_h_pointadd_right_decomp_prefix_start. ff_h_pointadd_right_decomp_prefix_start + S (0) = S ((S (0)) * ff_v_pointadd_right_decomp_prefix)) /\ exists ff_q_pointadd_right_decomp_prefix_start. ff_u_pointadd_right_decomp_prefix = ff_q_pointadd_right_decomp_prefix_start * S ((S (0)) * ff_v_pointadd_right_decomp_prefix) + (0))) /\ ((((exists ff_h_pointadd_right_decomp_prefix_terminal. ff_h_pointadd_right_decomp_prefix_terminal + S (r) = S ((S (l)) * ff_v_pointadd_right_decomp_prefix)) /\ exists ff_q_pointadd_right_decomp_prefix_terminal. ff_u_pointadd_right_decomp_prefix = ff_q_pointadd_right_decomp_prefix_terminal * S ((S (l)) * ff_v_pointadd_right_decomp_prefix) + (r))) /\ forall ff_i_pointadd_right_decomp_prefix. (exists ff_lt_pointadd_right_decomp_prefix_bound. ff_lt_pointadd_right_decomp_prefix_bound + S ff_i_pointadd_right_decomp_prefix = l) -> exists ff_a_pointadd_right_decomp_prefix ff_r_pointadd_right_decomp_prefix ff_s_pointadd_right_decomp_prefix. ((((exists ff_h_pointadd_right_decomp_prefix_summand. ff_h_pointadd_right_decomp_prefix_summand + S (ff_a_pointadd_right_decomp_prefix) = S ((S (ff_i_pointadd_right_decomp_prefix)) * e)) /\ exists ff_q_pointadd_right_decomp_prefix_summand. d = ff_q_pointadd_right_decomp_prefix_summand * S ((S (ff_i_pointadd_right_decomp_prefix)) * e) + (ff_a_pointadd_right_decomp_prefix))) /\ ((((exists ff_h_pointadd_right_decomp_prefix_partial. ff_h_pointadd_right_decomp_prefix_partial + S (ff_r_pointadd_right_decomp_prefix) = S ((S (ff_i_pointadd_right_decomp_prefix)) * ff_v_pointadd_right_decomp_prefix)) /\ exists ff_q_pointadd_right_decomp_prefix_partial. ff_u_pointadd_right_decomp_prefix = ff_q_pointadd_right_decomp_prefix_partial * S ((S (ff_i_pointadd_right_decomp_prefix)) * ff_v_pointadd_right_decomp_prefix) + (ff_r_pointadd_right_decomp_prefix))) /\ ((((exists ff_h_pointadd_right_decomp_prefix_successor. ff_h_pointadd_right_decomp_prefix_successor + S (ff_s_pointadd_right_decomp_prefix) = S ((S (S ff_i_pointadd_right_decomp_prefix)) * ff_v_pointadd_right_decomp_prefix)) /\ exists ff_q_pointadd_right_decomp_prefix_successor. ff_u_pointadd_right_decomp_prefix = ff_q_pointadd_right_decomp_prefix_successor * S ((S (S ff_i_pointadd_right_decomp_prefix)) * ff_v_pointadd_right_decomp_prefix) + (ff_s_pointadd_right_decomp_prefix))) /\ ff_s_pointadd_right_decomp_prefix = ff_r_pointadd_right_decomp_prefix + ff_a_pointadd_right_decomp_prefix)))))) /\ m = r + a)
  56. 0056specialize beta_sum_succ_decompose d
  57. 0057specialize beta_sum_succ_decompose e
  58. 0058specialize beta_sum_succ_decompose l
  59. 0059specialize beta_sum_succ_decompose m
  60. 0060apply beta_sum_succ_decompose
  61. 0061exact hright
  62. 0062cases hright_decomp
  63. 0063cases hright_decomp_witness
  64. 0064cases hright_decomp_witness_witness
  65. 0065cases hright_decomp_witness_witness_right
  66. 0066have htotal_decomp : ∃ a. ∃ r. BetaAt(f,g,l,a) ∧ (Sum(f,g,l,r) ∧ q = r + a)
    Exact native replay linehave htotal_decomp : exists a r. (((exists ff_h_pointadd_total_decomp_entry. ff_h_pointadd_total_decomp_entry + S (a) = S ((S (l)) * g)) /\ exists ff_q_pointadd_total_decomp_entry. f = ff_q_pointadd_total_decomp_entry * S ((S (l)) * g) + (a))) /\ ((exists ff_u_pointadd_total_decomp_prefix ff_v_pointadd_total_decomp_prefix. ((((exists ff_h_pointadd_total_decomp_prefix_start. ff_h_pointadd_total_decomp_prefix_start + S (0) = S ((S (0)) * ff_v_pointadd_total_decomp_prefix)) /\ exists ff_q_pointadd_total_decomp_prefix_start. ff_u_pointadd_total_decomp_prefix = ff_q_pointadd_total_decomp_prefix_start * S ((S (0)) * ff_v_pointadd_total_decomp_prefix) + (0))) /\ ((((exists ff_h_pointadd_total_decomp_prefix_terminal. ff_h_pointadd_total_decomp_prefix_terminal + S (r) = S ((S (l)) * ff_v_pointadd_total_decomp_prefix)) /\ exists ff_q_pointadd_total_decomp_prefix_terminal. ff_u_pointadd_total_decomp_prefix = ff_q_pointadd_total_decomp_prefix_terminal * S ((S (l)) * ff_v_pointadd_total_decomp_prefix) + (r))) /\ forall ff_i_pointadd_total_decomp_prefix. (exists ff_lt_pointadd_total_decomp_prefix_bound. ff_lt_pointadd_total_decomp_prefix_bound + S ff_i_pointadd_total_decomp_prefix = l) -> exists ff_a_pointadd_total_decomp_prefix ff_r_pointadd_total_decomp_prefix ff_s_pointadd_total_decomp_prefix. ((((exists ff_h_pointadd_total_decomp_prefix_summand. ff_h_pointadd_total_decomp_prefix_summand + S (ff_a_pointadd_total_decomp_prefix) = S ((S (ff_i_pointadd_total_decomp_prefix)) * g)) /\ exists ff_q_pointadd_total_decomp_prefix_summand. f = ff_q_pointadd_total_decomp_prefix_summand * S ((S (ff_i_pointadd_total_decomp_prefix)) * g) + (ff_a_pointadd_total_decomp_prefix))) /\ ((((exists ff_h_pointadd_total_decomp_prefix_partial. ff_h_pointadd_total_decomp_prefix_partial + S (ff_r_pointadd_total_decomp_prefix) = S ((S (ff_i_pointadd_total_decomp_prefix)) * ff_v_pointadd_total_decomp_prefix)) /\ exists ff_q_pointadd_total_decomp_prefix_partial. ff_u_pointadd_total_decomp_prefix = ff_q_pointadd_total_decomp_prefix_partial * S ((S (ff_i_pointadd_total_decomp_prefix)) * ff_v_pointadd_total_decomp_prefix) + (ff_r_pointadd_total_decomp_prefix))) /\ ((((exists ff_h_pointadd_total_decomp_prefix_successor. ff_h_pointadd_total_decomp_prefix_successor + S (ff_s_pointadd_total_decomp_prefix) = S ((S (S ff_i_pointadd_total_decomp_prefix)) * ff_v_pointadd_total_decomp_prefix)) /\ exists ff_q_pointadd_total_decomp_prefix_successor. ff_u_pointadd_total_decomp_prefix = ff_q_pointadd_total_decomp_prefix_successor * S ((S (S ff_i_pointadd_total_decomp_prefix)) * ff_v_pointadd_total_decomp_prefix) + (ff_s_pointadd_total_decomp_prefix))) /\ ff_s_pointadd_total_decomp_prefix = ff_r_pointadd_total_decomp_prefix + ff_a_pointadd_total_decomp_prefix)))))) /\ q = r + a)
  67. 0067specialize beta_sum_succ_decompose f
  68. 0068specialize beta_sum_succ_decompose g
  69. 0069specialize beta_sum_succ_decompose l
  70. 0070specialize beta_sum_succ_decompose q
  71. 0071apply beta_sum_succ_decompose
  72. 0072exact htotal
  73. 0073cases htotal_decomp
  74. 0074cases htotal_decomp_witness
  75. 0075cases htotal_decomp_witness_witness
  76. 0076cases htotal_decomp_witness_witness_right
  77. 0077have hprefix_pointwise : ∀ i. ∀ a. ∀ z. ∀ s. Lt(i,l)BetaAt(b,c,i,a)BetaAt(d,e,i,z)BetaAt(f,g,i,s) → s = a + z
    Exact native replay linehave hprefix_pointwise : forall i a z s. (exists h. h + S i = l) -> (((exists ff_h_pointadd_prefix_left_entry. ff_h_pointadd_prefix_left_entry + S (a) = S ((S (i)) * c)) /\ exists ff_q_pointadd_prefix_left_entry. b = ff_q_pointadd_prefix_left_entry * S ((S (i)) * c) + (a))) -> (((exists ff_h_pointadd_prefix_right_entry. ff_h_pointadd_prefix_right_entry + S (z) = S ((S (i)) * e)) /\ exists ff_q_pointadd_prefix_right_entry. d = ff_q_pointadd_prefix_right_entry * S ((S (i)) * e) + (z))) -> (((exists ff_h_pointadd_prefix_total_entry. ff_h_pointadd_prefix_total_entry + S (s) = S ((S (i)) * g)) /\ exists ff_q_pointadd_prefix_total_entry. f = ff_q_pointadd_prefix_total_entry * S ((S (i)) * g) + (s))) -> s = a + z
  78. 0078intro i
  79. 0079intro a
  80. 0080intro z
  81. 0081intro s
  82. 0082intro hi
  83. 0083intro ha
  84. 0084intro hz
  85. 0085intro hs
  86. 0086specialize hpointwise i
  87. 0087specialize hpointwise a
  88. 0088specialize hpointwise z
  89. 0089specialize hpointwise s
  90. 0090apply hpointwise
  91. 0091specialize le_succ (S i)
  92. 0092specialize le_succ l
  93. 0093apply le_succ
  94. 0094exact hi
  95. 0095exact ha
  96. 0096exact hz
  97. 0097exact hs
  98. 0098have hprefix : x1 + x3 = x5
  99. 0099specialize IH x1
  100. 0100specialize IH x3
  101. 0101specialize IH x5
  102. 0102apply IH
  103. 0103exact hleft_decomp_witness_witness_right_left
  104. 0104exact hright_decomp_witness_witness_right_left
  105. 0105exact htotal_decomp_witness_witness_right_left
  106. 0106exact hprefix_pointwise
  107. 0107have hlast : x4 = x + x2
  108. 0108specialize hpointwise l
  109. 0109specialize hpointwise x
  110. 0110specialize hpointwise x2
  111. 0111specialize hpointwise x4
  112. 0112apply hpointwise
  113. 0113specialize le_refl (S l)
  114. 0114exact le_refl
  115. 0115exact hleft_decomp_witness_witness_left
  116. 0116exact hright_decomp_witness_witness_left
  117. 0117exact htotal_decomp_witness_witness_left
  118. 0118rewrite hleft_decomp_witness_witness_right_right
  119. 0119rewrite hright_decomp_witness_witness_right_right
  120. 0120rewrite htotal_decomp_witness_witness_right_right
  121. 0121rewrite hlast
  122. 0122simp [add_assoc, add_comm]
  123. 0123trans (x1 + x3) + (x2 + x)
  124. 0124symm
  125. 0125apply add_assoc
  126. 0126rewrite hprefix
  127. 0127refl