BT00TT · Bertrand theorem

choose_weighted_vertical

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

Adjacent rows satisfy the constructive weighted vertical identity.

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

∀ n. ∀ k. ∀ j. ∀ x. ∀ y. k + j = n → Choose(n,k,x)Choose(S n,k,y) → S j · y = S n · x

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

2 occurrences

In local proof propositions

5 occurrences

Exact expanded native-PA statement
forall n k j x y. k + j = n -> (((exists bcf_lt_gap_bcwv_lower_out_of_range. bcf_lt_gap_bcwv_lower_out_of_range + S (n) = k) /\ x = 0) \/ ((exists bcf_le_gap_bcwv_lower_in_range. bcf_le_gap_bcwv_lower_in_range + (k) = n) /\ (exists bcf_row_code_code_bcwv_lower bcf_row_code_scale_bcwv_lower bcf_row_scale_code_bcwv_lower bcf_row_scale_scale_bcwv_lower bcf_row_code_bcwv_lower bcf_row_scale_bcwv_lower. ((forall bcf_row_index_bcwv_lower_table. (exists bcf_lt_gap_bcwv_lower_table_row_bound. bcf_lt_gap_bcwv_lower_table_row_bound + S (bcf_row_index_bcwv_lower_table) = S (n)) -> exists bcf_row_code_bcwv_lower_table bcf_row_scale_bcwv_lower_table. ((((exists bcf_height_bcwv_lower_table_decoded_row_code. bcf_height_bcwv_lower_table_decoded_row_code + S (bcf_row_code_bcwv_lower_table) = S ((S (bcf_row_index_bcwv_lower_table)) * bcf_row_code_scale_bcwv_lower)) /\ exists bcf_quotient_bcwv_lower_table_decoded_row_code. bcf_row_code_code_bcwv_lower = bcf_quotient_bcwv_lower_table_decoded_row_code * S ((S (bcf_row_index_bcwv_lower_table)) * bcf_row_code_scale_bcwv_lower) + (bcf_row_code_bcwv_lower_table))) /\ ((((exists bcf_height_bcwv_lower_table_decoded_row_scale. bcf_height_bcwv_lower_table_decoded_row_scale + S (bcf_row_scale_bcwv_lower_table) = S ((S (bcf_row_index_bcwv_lower_table)) * bcf_row_scale_scale_bcwv_lower)) /\ exists bcf_quotient_bcwv_lower_table_decoded_row_scale. bcf_row_scale_code_bcwv_lower = bcf_quotient_bcwv_lower_table_decoded_row_scale * S ((S (bcf_row_index_bcwv_lower_table)) * bcf_row_scale_scale_bcwv_lower) + (bcf_row_scale_bcwv_lower_table))) /\ ((bcf_row_index_bcwv_lower_table = 0 /\ (forall bcf_index_bcwv_lower_table_zero_row. (exists bcf_lt_gap_bcwv_lower_table_zero_row_bound. bcf_lt_gap_bcwv_lower_table_zero_row_bound + S (bcf_index_bcwv_lower_table_zero_row) = S (n)) -> exists bcf_value_bcwv_lower_table_zero_row. ((((exists bcf_height_bcwv_lower_table_zero_row_entry. bcf_height_bcwv_lower_table_zero_row_entry + S (bcf_value_bcwv_lower_table_zero_row) = S ((S (bcf_index_bcwv_lower_table_zero_row)) * bcf_row_scale_bcwv_lower_table)) /\ exists bcf_quotient_bcwv_lower_table_zero_row_entry. bcf_row_code_bcwv_lower_table = bcf_quotient_bcwv_lower_table_zero_row_entry * S ((S (bcf_index_bcwv_lower_table_zero_row)) * bcf_row_scale_bcwv_lower_table) + (bcf_value_bcwv_lower_table_zero_row))) /\ ((bcf_index_bcwv_lower_table_zero_row = 0 /\ bcf_value_bcwv_lower_table_zero_row = 1) \/ exists bcf_predecessor_bcwv_lower_table_zero_row. bcf_index_bcwv_lower_table_zero_row = S bcf_predecessor_bcwv_lower_table_zero_row /\ bcf_value_bcwv_lower_table_zero_row = 0)))) \/ exists bcf_predecessor_bcwv_lower_table bcf_previous_code_bcwv_lower_table bcf_previous_scale_bcwv_lower_table. bcf_row_index_bcwv_lower_table = S bcf_predecessor_bcwv_lower_table /\ ((((exists bcf_height_bcwv_lower_table_decoded_previous_code. bcf_height_bcwv_lower_table_decoded_previous_code + S (bcf_previous_code_bcwv_lower_table) = S ((S (bcf_predecessor_bcwv_lower_table)) * bcf_row_code_scale_bcwv_lower)) /\ exists bcf_quotient_bcwv_lower_table_decoded_previous_code. bcf_row_code_code_bcwv_lower = bcf_quotient_bcwv_lower_table_decoded_previous_code * S ((S (bcf_predecessor_bcwv_lower_table)) * bcf_row_code_scale_bcwv_lower) + (bcf_previous_code_bcwv_lower_table))) /\ ((((exists bcf_height_bcwv_lower_table_decoded_previous_scale. bcf_height_bcwv_lower_table_decoded_previous_scale + S (bcf_previous_scale_bcwv_lower_table) = S ((S (bcf_predecessor_bcwv_lower_table)) * bcf_row_scale_scale_bcwv_lower)) /\ exists bcf_quotient_bcwv_lower_table_decoded_previous_scale. bcf_row_scale_code_bcwv_lower = bcf_quotient_bcwv_lower_table_decoded_previous_scale * S ((S (bcf_predecessor_bcwv_lower_table)) * bcf_row_scale_scale_bcwv_lower) + (bcf_previous_scale_bcwv_lower_table))) /\ (forall bcf_index_bcwv_lower_table_row_step. (exists bcf_lt_gap_bcwv_lower_table_row_step_bound. bcf_lt_gap_bcwv_lower_table_row_step_bound + S (bcf_index_bcwv_lower_table_row_step) = S (n)) -> exists bcf_value_bcwv_lower_table_row_step. ((((exists bcf_height_bcwv_lower_table_row_step_entry. bcf_height_bcwv_lower_table_row_step_entry + S (bcf_value_bcwv_lower_table_row_step) = S ((S (bcf_index_bcwv_lower_table_row_step)) * bcf_row_scale_bcwv_lower_table)) /\ exists bcf_quotient_bcwv_lower_table_row_step_entry. bcf_row_code_bcwv_lower_table = bcf_quotient_bcwv_lower_table_row_step_entry * S ((S (bcf_index_bcwv_lower_table_row_step)) * bcf_row_scale_bcwv_lower_table) + (bcf_value_bcwv_lower_table_row_step))) /\ ((bcf_index_bcwv_lower_table_row_step = 0 /\ bcf_value_bcwv_lower_table_row_step = 1) \/ exists bcf_predecessor_bcwv_lower_table_row_step bcf_left_bcwv_lower_table_row_step bcf_right_bcwv_lower_table_row_step. bcf_index_bcwv_lower_table_row_step = S bcf_predecessor_bcwv_lower_table_row_step /\ ((((exists bcf_height_bcwv_lower_table_row_step_previous_left. bcf_height_bcwv_lower_table_row_step_previous_left + S (bcf_left_bcwv_lower_table_row_step) = S ((S (bcf_predecessor_bcwv_lower_table_row_step)) * bcf_previous_scale_bcwv_lower_table)) /\ exists bcf_quotient_bcwv_lower_table_row_step_previous_left. bcf_previous_code_bcwv_lower_table = bcf_quotient_bcwv_lower_table_row_step_previous_left * S ((S (bcf_predecessor_bcwv_lower_table_row_step)) * bcf_previous_scale_bcwv_lower_table) + (bcf_left_bcwv_lower_table_row_step))) /\ ((((exists bcf_height_bcwv_lower_table_row_step_previous_right. bcf_height_bcwv_lower_table_row_step_previous_right + S (bcf_right_bcwv_lower_table_row_step) = S ((S (S (bcf_predecessor_bcwv_lower_table_row_step))) * bcf_previous_scale_bcwv_lower_table)) /\ exists bcf_quotient_bcwv_lower_table_row_step_previous_right. bcf_previous_code_bcwv_lower_table = bcf_quotient_bcwv_lower_table_row_step_previous_right * S ((S (S (bcf_predecessor_bcwv_lower_table_row_step))) * bcf_previous_scale_bcwv_lower_table) + (bcf_right_bcwv_lower_table_row_step))) /\ bcf_value_bcwv_lower_table_row_step = bcf_left_bcwv_lower_table_row_step + bcf_right_bcwv_lower_table_row_step))))))))))) /\ ((((exists bcf_height_bcwv_lower_decoded_row_code. bcf_height_bcwv_lower_decoded_row_code + S (bcf_row_code_bcwv_lower) = S ((S (n)) * bcf_row_code_scale_bcwv_lower)) /\ exists bcf_quotient_bcwv_lower_decoded_row_code. bcf_row_code_code_bcwv_lower = bcf_quotient_bcwv_lower_decoded_row_code * S ((S (n)) * bcf_row_code_scale_bcwv_lower) + (bcf_row_code_bcwv_lower))) /\ ((((exists bcf_height_bcwv_lower_decoded_row_scale. bcf_height_bcwv_lower_decoded_row_scale + S (bcf_row_scale_bcwv_lower) = S ((S (n)) * bcf_row_scale_scale_bcwv_lower)) /\ exists bcf_quotient_bcwv_lower_decoded_row_scale. bcf_row_scale_code_bcwv_lower = bcf_quotient_bcwv_lower_decoded_row_scale * S ((S (n)) * bcf_row_scale_scale_bcwv_lower) + (bcf_row_scale_bcwv_lower))) /\ (((exists bcf_height_bcwv_lower_decoded_value. bcf_height_bcwv_lower_decoded_value + S (x) = S ((S (k)) * bcf_row_scale_bcwv_lower)) /\ exists bcf_quotient_bcwv_lower_decoded_value. bcf_row_code_bcwv_lower = bcf_quotient_bcwv_lower_decoded_value * S ((S (k)) * bcf_row_scale_bcwv_lower) + (x))))))))) -> (((exists bcf_lt_gap_bcwv_upper_out_of_range. bcf_lt_gap_bcwv_upper_out_of_range + S (S n) = k) /\ y = 0) \/ ((exists bcf_le_gap_bcwv_upper_in_range. bcf_le_gap_bcwv_upper_in_range + (k) = S n) /\ (exists bcf_row_code_code_bcwv_upper bcf_row_code_scale_bcwv_upper bcf_row_scale_code_bcwv_upper bcf_row_scale_scale_bcwv_upper bcf_row_code_bcwv_upper bcf_row_scale_bcwv_upper. ((forall bcf_row_index_bcwv_upper_table. (exists bcf_lt_gap_bcwv_upper_table_row_bound. bcf_lt_gap_bcwv_upper_table_row_bound + S (bcf_row_index_bcwv_upper_table) = S (S n)) -> exists bcf_row_code_bcwv_upper_table bcf_row_scale_bcwv_upper_table. ((((exists bcf_height_bcwv_upper_table_decoded_row_code. bcf_height_bcwv_upper_table_decoded_row_code + S (bcf_row_code_bcwv_upper_table) = S ((S (bcf_row_index_bcwv_upper_table)) * bcf_row_code_scale_bcwv_upper)) /\ exists bcf_quotient_bcwv_upper_table_decoded_row_code. bcf_row_code_code_bcwv_upper = bcf_quotient_bcwv_upper_table_decoded_row_code * S ((S (bcf_row_index_bcwv_upper_table)) * bcf_row_code_scale_bcwv_upper) + (bcf_row_code_bcwv_upper_table))) /\ ((((exists bcf_height_bcwv_upper_table_decoded_row_scale. bcf_height_bcwv_upper_table_decoded_row_scale + S (bcf_row_scale_bcwv_upper_table) = S ((S (bcf_row_index_bcwv_upper_table)) * bcf_row_scale_scale_bcwv_upper)) /\ exists bcf_quotient_bcwv_upper_table_decoded_row_scale. bcf_row_scale_code_bcwv_upper = bcf_quotient_bcwv_upper_table_decoded_row_scale * S ((S (bcf_row_index_bcwv_upper_table)) * bcf_row_scale_scale_bcwv_upper) + (bcf_row_scale_bcwv_upper_table))) /\ ((bcf_row_index_bcwv_upper_table = 0 /\ (forall bcf_index_bcwv_upper_table_zero_row. (exists bcf_lt_gap_bcwv_upper_table_zero_row_bound. bcf_lt_gap_bcwv_upper_table_zero_row_bound + S (bcf_index_bcwv_upper_table_zero_row) = S (S n)) -> exists bcf_value_bcwv_upper_table_zero_row. ((((exists bcf_height_bcwv_upper_table_zero_row_entry. bcf_height_bcwv_upper_table_zero_row_entry + S (bcf_value_bcwv_upper_table_zero_row) = S ((S (bcf_index_bcwv_upper_table_zero_row)) * bcf_row_scale_bcwv_upper_table)) /\ exists bcf_quotient_bcwv_upper_table_zero_row_entry. bcf_row_code_bcwv_upper_table = bcf_quotient_bcwv_upper_table_zero_row_entry * S ((S (bcf_index_bcwv_upper_table_zero_row)) * bcf_row_scale_bcwv_upper_table) + (bcf_value_bcwv_upper_table_zero_row))) /\ ((bcf_index_bcwv_upper_table_zero_row = 0 /\ bcf_value_bcwv_upper_table_zero_row = 1) \/ exists bcf_predecessor_bcwv_upper_table_zero_row. bcf_index_bcwv_upper_table_zero_row = S bcf_predecessor_bcwv_upper_table_zero_row /\ bcf_value_bcwv_upper_table_zero_row = 0)))) \/ exists bcf_predecessor_bcwv_upper_table bcf_previous_code_bcwv_upper_table bcf_previous_scale_bcwv_upper_table. bcf_row_index_bcwv_upper_table = S bcf_predecessor_bcwv_upper_table /\ ((((exists bcf_height_bcwv_upper_table_decoded_previous_code. bcf_height_bcwv_upper_table_decoded_previous_code + S (bcf_previous_code_bcwv_upper_table) = S ((S (bcf_predecessor_bcwv_upper_table)) * bcf_row_code_scale_bcwv_upper)) /\ exists bcf_quotient_bcwv_upper_table_decoded_previous_code. bcf_row_code_code_bcwv_upper = bcf_quotient_bcwv_upper_table_decoded_previous_code * S ((S (bcf_predecessor_bcwv_upper_table)) * bcf_row_code_scale_bcwv_upper) + (bcf_previous_code_bcwv_upper_table))) /\ ((((exists bcf_height_bcwv_upper_table_decoded_previous_scale. bcf_height_bcwv_upper_table_decoded_previous_scale + S (bcf_previous_scale_bcwv_upper_table) = S ((S (bcf_predecessor_bcwv_upper_table)) * bcf_row_scale_scale_bcwv_upper)) /\ exists bcf_quotient_bcwv_upper_table_decoded_previous_scale. bcf_row_scale_code_bcwv_upper = bcf_quotient_bcwv_upper_table_decoded_previous_scale * S ((S (bcf_predecessor_bcwv_upper_table)) * bcf_row_scale_scale_bcwv_upper) + (bcf_previous_scale_bcwv_upper_table))) /\ (forall bcf_index_bcwv_upper_table_row_step. (exists bcf_lt_gap_bcwv_upper_table_row_step_bound. bcf_lt_gap_bcwv_upper_table_row_step_bound + S (bcf_index_bcwv_upper_table_row_step) = S (S n)) -> exists bcf_value_bcwv_upper_table_row_step. ((((exists bcf_height_bcwv_upper_table_row_step_entry. bcf_height_bcwv_upper_table_row_step_entry + S (bcf_value_bcwv_upper_table_row_step) = S ((S (bcf_index_bcwv_upper_table_row_step)) * bcf_row_scale_bcwv_upper_table)) /\ exists bcf_quotient_bcwv_upper_table_row_step_entry. bcf_row_code_bcwv_upper_table = bcf_quotient_bcwv_upper_table_row_step_entry * S ((S (bcf_index_bcwv_upper_table_row_step)) * bcf_row_scale_bcwv_upper_table) + (bcf_value_bcwv_upper_table_row_step))) /\ ((bcf_index_bcwv_upper_table_row_step = 0 /\ bcf_value_bcwv_upper_table_row_step = 1) \/ exists bcf_predecessor_bcwv_upper_table_row_step bcf_left_bcwv_upper_table_row_step bcf_right_bcwv_upper_table_row_step. bcf_index_bcwv_upper_table_row_step = S bcf_predecessor_bcwv_upper_table_row_step /\ ((((exists bcf_height_bcwv_upper_table_row_step_previous_left. bcf_height_bcwv_upper_table_row_step_previous_left + S (bcf_left_bcwv_upper_table_row_step) = S ((S (bcf_predecessor_bcwv_upper_table_row_step)) * bcf_previous_scale_bcwv_upper_table)) /\ exists bcf_quotient_bcwv_upper_table_row_step_previous_left. bcf_previous_code_bcwv_upper_table = bcf_quotient_bcwv_upper_table_row_step_previous_left * S ((S (bcf_predecessor_bcwv_upper_table_row_step)) * bcf_previous_scale_bcwv_upper_table) + (bcf_left_bcwv_upper_table_row_step))) /\ ((((exists bcf_height_bcwv_upper_table_row_step_previous_right. bcf_height_bcwv_upper_table_row_step_previous_right + S (bcf_right_bcwv_upper_table_row_step) = S ((S (S (bcf_predecessor_bcwv_upper_table_row_step))) * bcf_previous_scale_bcwv_upper_table)) /\ exists bcf_quotient_bcwv_upper_table_row_step_previous_right. bcf_previous_code_bcwv_upper_table = bcf_quotient_bcwv_upper_table_row_step_previous_right * S ((S (S (bcf_predecessor_bcwv_upper_table_row_step))) * bcf_previous_scale_bcwv_upper_table) + (bcf_right_bcwv_upper_table_row_step))) /\ bcf_value_bcwv_upper_table_row_step = bcf_left_bcwv_upper_table_row_step + bcf_right_bcwv_upper_table_row_step))))))))))) /\ ((((exists bcf_height_bcwv_upper_decoded_row_code. bcf_height_bcwv_upper_decoded_row_code + S (bcf_row_code_bcwv_upper) = S ((S (S n)) * bcf_row_code_scale_bcwv_upper)) /\ exists bcf_quotient_bcwv_upper_decoded_row_code. bcf_row_code_code_bcwv_upper = bcf_quotient_bcwv_upper_decoded_row_code * S ((S (S n)) * bcf_row_code_scale_bcwv_upper) + (bcf_row_code_bcwv_upper))) /\ ((((exists bcf_height_bcwv_upper_decoded_row_scale. bcf_height_bcwv_upper_decoded_row_scale + S (bcf_row_scale_bcwv_upper) = S ((S (S n)) * bcf_row_scale_scale_bcwv_upper)) /\ exists bcf_quotient_bcwv_upper_decoded_row_scale. bcf_row_scale_code_bcwv_upper = bcf_quotient_bcwv_upper_decoded_row_scale * S ((S (S n)) * bcf_row_scale_scale_bcwv_upper) + (bcf_row_scale_bcwv_upper))) /\ (((exists bcf_height_bcwv_upper_decoded_value. bcf_height_bcwv_upper_decoded_value + S (y) = S ((S (k)) * bcf_row_scale_bcwv_upper)) /\ exists bcf_quotient_bcwv_upper_decoded_value. bcf_row_code_bcwv_upper = bcf_quotient_bcwv_upper_decoded_value * S ((S (k)) * bcf_row_scale_bcwv_upper) + (y))))))))) -> S j * y = S n * x

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

285 script commands · 82 reading checkpoints · 25 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 (10)
01Induction on nL1–1

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

  1. L1
    induction n
02Induction on kL2–8

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

  1. L2
    induction k
  2. L3
    intro j
  3. L4
    intro x
  4. L5
    intro y
  5. L6
    intro hsum
  6. L7
    intro hlower
  7. L8
    intro hupper
03Establish hjL9–13

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

  1. L9
    have hj : j = 0
  2. L10
    trans 0 + j
  3. L11
    symm
  4. L12
    apply zero_add
  5. L13
    exact hsum
04Establish hxL14–18

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

  1. L14
    have hx : x = 1
  2. L15
    specialize choose_zero 0
  3. L16
    specialize choose_zero x
  4. L17
    apply choose_zero
  5. L18
    exact hlower
05Establish hyL19–28

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

  1. L19
    have hy : y = 1
  2. L20
    specialize choose_zero (S 0)
  3. L21
    specialize choose_zero y
  4. L22
    apply choose_zero
  5. L23
    exact hupper
  6. L24
    rewrite hj
  7. L25
    trans S 0 * 1
  8. L26
    congr
  9. L27
    refl
  10. L28
    exact hy
06Calculate and transport equalitiesL29–31

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

  1. L29
    congr
  2. L30
    refl
  3. L31
    symm
07Use earlier factsL32–32

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

  1. L32
    exact hx
08Fix variables and assumptionsL33–38

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

  1. L33
    intro j
  2. L34
    intro x
  3. L35
    intro y
  4. L36
    intro hsum
  5. L37
    intro hlower
  6. L38
    intro hupper
09Use earlier factsL39–40

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

  1. L39
    specialize add_succ_left k
  2. L40
    specialize add_succ_left j
10Calculate and transport equalitiesL41–41

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

  1. L41
    rewrite add_succ_left at hsum
11Separate the logical casesL42–42

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

  1. L42
    exfalso
12Use earlier factsL43–44

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

  1. L43
    apply PA1
  2. L44
    exact hsum
13Induction on kL45–51

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

  1. L45
    induction k
  2. L46
    intro j
  3. L47
    intro x
  4. L48
    intro y
  5. L49
    intro hsum
  6. L50
    intro hlower
  7. L51
    intro hupper
14Establish hjL52–56

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

  1. L52
    have hj : j = S n
  2. L53
    trans 0 + j
  3. L54
    symm
  4. L55
    apply zero_add
  5. L56
    exact hsum
15Establish hxL57–61

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

  1. L57
    have hx : x = 1
  2. L58
    specialize choose_zero (S n)
  3. L59
    specialize choose_zero x
  4. L60
    apply choose_zero
  5. L61
    exact hlower
16Establish hyL62–71

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

  1. L62
    have hy : y = 1
  2. L63
    specialize choose_zero (S (S n))
  3. L64
    specialize choose_zero y
  4. L65
    apply choose_zero
  5. L66
    exact hupper
  6. L67
    rewrite hj
  7. L68
    trans S (S n) * 1
  8. L69
    congr
  9. L70
    refl
  10. L71
    exact hy
17Calculate and transport equalitiesL72–74

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

  1. L72
    congr
  2. L73
    refl
  3. L74
    symm
18Use earlier factsL75–75

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

  1. L75
    exact hx
19Fix variables and assumptionsL76–81

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

  1. L76
    intro j
  2. L77
    intro x
  3. L78
    intro y
  4. L79
    intro hsum
  5. L80
    intro hlower
  6. L81
    intro hupper
20Use earlier factsL82–82

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

  1. L82
    specialize zero_or_succ j
21Separate the logical casesL83–83

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

  1. L83
    cases zero_or_succ
22Establish ha_existsL84–87

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

  1. L84
    have ha_exists : ∃ a. Choose(n,k,a)Definitions: Choose(n,k,a)Original native command in the exact edition
  2. L85
    specialize choose_exists n
  3. L86
    specialize choose_exists k
  4. L87
    exact choose_exists
23Separate the logical casesL88–88

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

  1. L88
    cases ha_exists
24Establish hb_existsL89–92

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

  1. L89
    have hb_exists : ∃ b. Choose(S n,k,b)Definitions: Choose(S n,k,b)Original native command in the exact edition
  2. L90
    specialize choose_exists (S n)
  3. L91
    specialize choose_exists k
  4. L92
    exact choose_exists
25Separate the logical casesL93–93

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

  1. L93
    cases hb_exists
26Calculate and transport equalitiesL94–95

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

  1. L94
    rewrite zero_or_succ_left at hsum
  2. L95
    rewrite PA3 at hsum
27Establish hkL96–98

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

  1. L96
    have hk : k = n
  2. L97
    apply PA2
  3. L98
    exact hsum
28Establish hprevious_sumL99–102

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

  1. L99
    have hprevious_sum : k + 0 = n
  2. L100
    trans k
  3. L101
    apply PA3
  4. L102
    exact hk
29Establish ha_oneL103–109

Establish this local claim before using it. It is not an additional assumption. The following proof commands apply choose self of eq.

  1. L103
    have ha_one : x1 = 1
  2. L104
    specialize choose_self_of_eq n
  3. L105
    specialize choose_self_of_eq k
  4. L106
    specialize choose_self_of_eq x1
  5. L107
    apply choose_self_of_eq
  6. L108
    exact hk
  7. L109
    exact ha_exists_witness
30Establish hx_oneL110–116

Establish this local claim before using it. It is not an additional assumption. The following proof commands apply choose self of eq.

  1. L110
    have hx_one : x = 1
  2. L111
    specialize choose_self_of_eq (S n)
  3. L112
    specialize choose_self_of_eq (S k)
  4. L113
    specialize choose_self_of_eq x
  5. L114
    apply choose_self_of_eq
  6. L115
    exact hsum
  7. L116
    exact hlower
31Establish hweightedL117–125

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

  1. L117
    have hweighted : S 0 * x2 = S n * x1
  2. L118
    specialize IH k
  3. L119
    specialize IH 0
  4. L120
    specialize IH x1
  5. L121
    specialize IH x2
  6. L122
    apply IH
  7. L123
    exact hprevious_sum
  8. L124
    exact ha_exists_witness
  9. L125
    exact hb_exists_witness
32Establish hy_sumL126–135

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

  1. L126
    have hy_sum : y = x2 + x
  2. L127
    specialize choose_succ_succ (S n)
  3. L128
    specialize choose_succ_succ k
  4. L129
    specialize choose_succ_succ x2
  5. L130
    specialize choose_succ_succ x
  6. L131
    specialize choose_succ_succ y
  7. L132
    apply choose_succ_succ
  8. L133
    exact hb_exists_witness
  9. L134
    exact hlower
  10. L135
    exact hupper
33Establish hsame_oneL136–140

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

  1. L136
    have hsame_one : x1 = x
  2. L137
    trans 1
  3. L138
    exact ha_one
  4. L139
    symm
  5. L140
    exact hx_one
34Establish hone_scaleL141–150

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

  1. L141
    have hone_scale : S 0 * x = x
  2. L142
    trans S 0 * 1
  3. L143
    congr
  4. L144
    refl
  5. L145
    exact hx_one
  6. L146
    trans 1
  7. L147
    trans S 0 * 0 + S 0
  8. L148
    apply PA6
  9. L149
    rewrite PA5
  10. L150
    apply zero_add
35Calculate and transport equalitiesL151–151

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

  1. L151
    symm
36Use earlier factsL152–152

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

  1. L152
    exact hx_one
37Calculate and transport equalitiesL153–156

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

  1. L153
    rewrite zero_or_succ_left
  2. L154
    trans S 0 * (x2 + x)
  3. L155
    congr
  4. L156
    refl
38Use earlier factsL157–157

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

  1. L157
    exact hy_sum
39Calculate and transport equalitiesL158–158

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

  1. L158
    trans S 0 * x2 + S 0 * x
40Use earlier factsL159–159

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

  1. L159
    apply mul_add
41Calculate and transport equalitiesL160–161

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

  1. L160
    trans S n * x1 + S 0 * x
  2. L161
    congr
42Use earlier factsL162–162

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

  1. L162
    exact hweighted
43Calculate and transport equalitiesL163–167

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

  1. L163
    refl
  2. L164
    trans S n * x + x
  3. L165
    congr
  4. L166
    congr
  5. L167
    refl
44Use earlier factsL168–171

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

  1. L168
    exact hsame_one
  2. L169
    exact hone_scale
  3. L170
    specialize mul_succ_left (S n)
  4. L171
    specialize mul_succ_left x
45Calculate and transport equalitiesL172–172

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

  1. L172
    symm
46Use earlier factsL173–173

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

  1. L173
    exact mul_succ_left
47Separate the logical casesL174–174

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

  1. L174
    cases zero_or_succ_right
48Establish ha_existsL175–178

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

  1. L175
    have ha_exists : ∃ a. Choose(n,k,a)Definitions: Choose(n,k,a)Original native command in the exact edition
  2. L176
    specialize choose_exists n
  3. L177
    specialize choose_exists k
  4. L178
    exact choose_exists
49Separate the logical casesL179–179

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

  1. L179
    cases ha_exists
50Establish hb_existsL180–183

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

  1. L180
    have hb_exists : ∃ b. Choose(n,S k,b)Definitions: Choose(n,S k,b)Original native command in the exact edition
  2. L181
    specialize choose_exists n
  3. L182
    specialize choose_exists (S k)
  4. L183
    exact choose_exists
51Separate the logical casesL184–184

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

  1. L184
    cases hb_exists
52Establish hc_existsL185–188

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

  1. L185
    have hc_exists : ∃ c. Choose(S n,k,c)Definitions: Choose(S n,k,c)Original native command in the exact edition
  2. L186
    specialize choose_exists (S n)
  3. L187
    specialize choose_exists k
  4. L188
    exact choose_exists
53Separate the logical casesL189–189

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

  1. L189
    cases hc_exists
54Calculate and transport equalitiesL190–190

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

  1. L190
    rewrite zero_or_succ_right_witness at hsum
55Establish hsecond_complementL191–196

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

  1. L191
    have hsecond_complement : S k + x1 = n
  2. L192
    apply PA2
  3. L193
    trans S k + S x1
  4. L194
    symm
  5. L195
    apply PA4
  6. L196
    exact hsum
56Establish hfirst_complementL197–203

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

  1. L197
    have hfirst_complement : k + S x1 = n
  2. L198
    trans S (k + x1)
  3. L199
    apply PA4
  4. L200
    trans S k + x1
  5. L201
    symm
  6. L202
    apply add_succ_left
  7. L203
    exact hsecond_complement
57Establish hx_sumL204–213

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

  1. L204
    have hx_sum : x = x2 + x3
  2. L205
    specialize choose_succ_succ n
  3. L206
    specialize choose_succ_succ k
  4. L207
    specialize choose_succ_succ x2
  5. L208
    specialize choose_succ_succ x3
  6. L209
    specialize choose_succ_succ x
  7. L210
    apply choose_succ_succ
  8. L211
    exact ha_exists_witness
  9. L212
    exact hb_exists_witness
  10. L213
    exact hlower
58Establish hy_sumL214–223

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

  1. L214
    have hy_sum : y = x4 + x
  2. L215
    specialize choose_succ_succ (S n)
  3. L216
    specialize choose_succ_succ k
  4. L217
    specialize choose_succ_succ x4
  5. L218
    specialize choose_succ_succ x
  6. L219
    specialize choose_succ_succ y
  7. L220
    apply choose_succ_succ
  8. L221
    exact hc_exists_witness
  9. L222
    exact hlower
  10. L223
    exact hupper
59Establish hfirst_weightL224–232

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

  1. L224
    have hfirst_weight : S (S x1) * x4 = S n * x2
  2. L225
    specialize IH k
  3. L226
    specialize IH (S x1)
  4. L227
    specialize IH x2
  5. L228
    specialize IH x4
  6. L229
    apply IH
  7. L230
    exact hfirst_complement
  8. L231
    exact ha_exists_witness
  9. L232
    exact hc_exists_witness
60Establish hsecond_weightL233–242

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

  1. L233
    have hsecond_weight : S x1 * x = S n * x3
  2. L234
    specialize IH (S k)
  3. L235
    specialize IH x1
  4. L236
    specialize IH x3
  5. L237
    specialize IH x
  6. L238
    apply IH
  7. L239
    exact hsecond_complement
  8. L240
    exact hb_exists_witness
  9. L241
    exact hlower
  10. L242
    rewrite zero_or_succ_right_witness
61Calculate and transport equalitiesL243–245

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

  1. L243
    trans S (S x1) * (x4 + x)
  2. L244
    congr
  3. L245
    refl
62Use earlier factsL246–246

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

  1. L246
    exact hy_sum
63Calculate and transport equalitiesL247–247

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

  1. L247
    trans S (S x1) * x4 + S (S x1) * x
64Use earlier factsL248–248

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

  1. L248
    apply mul_add
65Calculate and transport equalitiesL249–250

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

  1. L249
    trans S n * x2 + (S x1 * x + x)
  2. L250
    congr
66Use earlier factsL251–254

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

  1. L251
    exact hfirst_weight
  2. L252
    specialize mul_succ_left (S x1)
  3. L253
    specialize mul_succ_left x
  4. L254
    apply mul_succ_left
67Calculate and transport equalitiesL255–258

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

  1. L255
    trans S n * x2 + (S n * x3 + x)
  2. L256
    congr
  3. L257
    refl
  4. L258
    congr
68Use earlier factsL259–259

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

  1. L259
    exact hsecond_weight
69Calculate and transport equalitiesL260–261

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

  1. L260
    refl
  2. L261
    trans (S n * x2 + S n * x3) + x
70Use earlier factsL262–264

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

  1. L262
    specialize add_assoc (S n * x2)
  2. L263
    specialize add_assoc (S n * x3)
  3. L264
    specialize add_assoc x
71Calculate and transport equalitiesL265–265

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

  1. L265
    symm
72Use earlier factsL266–266

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

  1. L266
    apply add_assoc
73Calculate and transport equalitiesL267–268

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

  1. L267
    trans S n * (x2 + x3) + x
  2. L268
    congr
74Use earlier factsL269–271

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

  1. L269
    specialize mul_add (S n)
  2. L270
    specialize mul_add x2
  3. L271
    specialize mul_add x3
75Calculate and transport equalitiesL272–272

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

  1. L272
    symm
76Use earlier factsL273–273

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

  1. L273
    apply mul_add
77Calculate and transport equalitiesL274–279

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

  1. L274
    refl
  2. L275
    trans S n * x + x
  3. L276
    congr
  4. L277
    congr
  5. L278
    refl
  6. L279
    symm
78Use earlier factsL280–280

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

  1. L280
    exact hx_sum
79Calculate and transport equalitiesL281–281

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

  1. L281
    refl
80Use earlier factsL282–283

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

  1. L282
    specialize mul_succ_left (S n)
  2. L283
    specialize mul_succ_left x
81Calculate and transport equalitiesL284–284

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

  1. L284
    symm
82Use earlier factsL285–285

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

  1. L285
    exact mul_succ_left

Library-wide reading audit

Original defined command ledger · 285 lines
  1. 0001induction n
  2. 0002induction k
  3. 0003intro j
  4. 0004intro x
  5. 0005intro y
  6. 0006intro hsum
  7. 0007intro hlower
  8. 0008intro hupper
  9. 0009have hj : j = 0
  10. 0010trans 0 + j
  11. 0011symm
  12. 0012apply zero_add
  13. 0013exact hsum
  14. 0014have hx : x = 1
  15. 0015specialize choose_zero 0
  16. 0016specialize choose_zero x
  17. 0017apply choose_zero
  18. 0018exact hlower
  19. 0019have hy : y = 1
  20. 0020specialize choose_zero (S 0)
  21. 0021specialize choose_zero y
  22. 0022apply choose_zero
  23. 0023exact hupper
  24. 0024rewrite hj
  25. 0025trans S 0 * 1
  26. 0026congr
  27. 0027refl
  28. 0028exact hy
  29. 0029congr
  30. 0030refl
  31. 0031symm
  32. 0032exact hx
  33. 0033intro j
  34. 0034intro x
  35. 0035intro y
  36. 0036intro hsum
  37. 0037intro hlower
  38. 0038intro hupper
  39. 0039specialize add_succ_left k
  40. 0040specialize add_succ_left j
  41. 0041rewrite add_succ_left at hsum
  42. 0042exfalso
  43. 0043apply PA1
  44. 0044exact hsum
  45. 0045induction k
  46. 0046intro j
  47. 0047intro x
  48. 0048intro y
  49. 0049intro hsum
  50. 0050intro hlower
  51. 0051intro hupper
  52. 0052have hj : j = S n
  53. 0053trans 0 + j
  54. 0054symm
  55. 0055apply zero_add
  56. 0056exact hsum
  57. 0057have hx : x = 1
  58. 0058specialize choose_zero (S n)
  59. 0059specialize choose_zero x
  60. 0060apply choose_zero
  61. 0061exact hlower
  62. 0062have hy : y = 1
  63. 0063specialize choose_zero (S (S n))
  64. 0064specialize choose_zero y
  65. 0065apply choose_zero
  66. 0066exact hupper
  67. 0067rewrite hj
  68. 0068trans S (S n) * 1
  69. 0069congr
  70. 0070refl
  71. 0071exact hy
  72. 0072congr
  73. 0073refl
  74. 0074symm
  75. 0075exact hx
  76. 0076intro j
  77. 0077intro x
  78. 0078intro y
  79. 0079intro hsum
  80. 0080intro hlower
  81. 0081intro hupper
  82. 0082specialize zero_or_succ j
  83. 0083cases zero_or_succ
  84. 0084have ha_exists : ∃ a. Choose(n,k,a)
    Exact native replay linehave ha_exists : exists a. (((exists bcf_lt_gap_bcwv_previous_left_out_of_range. bcf_lt_gap_bcwv_previous_left_out_of_range + S (n) = k) /\ a = 0) \/ ((exists bcf_le_gap_bcwv_previous_left_in_range. bcf_le_gap_bcwv_previous_left_in_range + (k) = n) /\ (exists bcf_row_code_code_bcwv_previous_left bcf_row_code_scale_bcwv_previous_left bcf_row_scale_code_bcwv_previous_left bcf_row_scale_scale_bcwv_previous_left bcf_row_code_bcwv_previous_left bcf_row_scale_bcwv_previous_left. ((forall bcf_row_index_bcwv_previous_left_table. (exists bcf_lt_gap_bcwv_previous_left_table_row_bound. bcf_lt_gap_bcwv_previous_left_table_row_bound + S (bcf_row_index_bcwv_previous_left_table) = S (n)) -> exists bcf_row_code_bcwv_previous_left_table bcf_row_scale_bcwv_previous_left_table. ((((exists bcf_height_bcwv_previous_left_table_decoded_row_code. bcf_height_bcwv_previous_left_table_decoded_row_code + S (bcf_row_code_bcwv_previous_left_table) = S ((S (bcf_row_index_bcwv_previous_left_table)) * bcf_row_code_scale_bcwv_previous_left)) /\ exists bcf_quotient_bcwv_previous_left_table_decoded_row_code. bcf_row_code_code_bcwv_previous_left = bcf_quotient_bcwv_previous_left_table_decoded_row_code * S ((S (bcf_row_index_bcwv_previous_left_table)) * bcf_row_code_scale_bcwv_previous_left) + (bcf_row_code_bcwv_previous_left_table))) /\ ((((exists bcf_height_bcwv_previous_left_table_decoded_row_scale. bcf_height_bcwv_previous_left_table_decoded_row_scale + S (bcf_row_scale_bcwv_previous_left_table) = S ((S (bcf_row_index_bcwv_previous_left_table)) * bcf_row_scale_scale_bcwv_previous_left)) /\ exists bcf_quotient_bcwv_previous_left_table_decoded_row_scale. bcf_row_scale_code_bcwv_previous_left = bcf_quotient_bcwv_previous_left_table_decoded_row_scale * S ((S (bcf_row_index_bcwv_previous_left_table)) * bcf_row_scale_scale_bcwv_previous_left) + (bcf_row_scale_bcwv_previous_left_table))) /\ ((bcf_row_index_bcwv_previous_left_table = 0 /\ (forall bcf_index_bcwv_previous_left_table_zero_row. (exists bcf_lt_gap_bcwv_previous_left_table_zero_row_bound. bcf_lt_gap_bcwv_previous_left_table_zero_row_bound + S (bcf_index_bcwv_previous_left_table_zero_row) = S (n)) -> exists bcf_value_bcwv_previous_left_table_zero_row. ((((exists bcf_height_bcwv_previous_left_table_zero_row_entry. bcf_height_bcwv_previous_left_table_zero_row_entry + S (bcf_value_bcwv_previous_left_table_zero_row) = S ((S (bcf_index_bcwv_previous_left_table_zero_row)) * bcf_row_scale_bcwv_previous_left_table)) /\ exists bcf_quotient_bcwv_previous_left_table_zero_row_entry. bcf_row_code_bcwv_previous_left_table = bcf_quotient_bcwv_previous_left_table_zero_row_entry * S ((S (bcf_index_bcwv_previous_left_table_zero_row)) * bcf_row_scale_bcwv_previous_left_table) + (bcf_value_bcwv_previous_left_table_zero_row))) /\ ((bcf_index_bcwv_previous_left_table_zero_row = 0 /\ bcf_value_bcwv_previous_left_table_zero_row = 1) \/ exists bcf_predecessor_bcwv_previous_left_table_zero_row. bcf_index_bcwv_previous_left_table_zero_row = S bcf_predecessor_bcwv_previous_left_table_zero_row /\ bcf_value_bcwv_previous_left_table_zero_row = 0)))) \/ exists bcf_predecessor_bcwv_previous_left_table bcf_previous_code_bcwv_previous_left_table bcf_previous_scale_bcwv_previous_left_table. bcf_row_index_bcwv_previous_left_table = S bcf_predecessor_bcwv_previous_left_table /\ ((((exists bcf_height_bcwv_previous_left_table_decoded_previous_code. bcf_height_bcwv_previous_left_table_decoded_previous_code + S (bcf_previous_code_bcwv_previous_left_table) = S ((S (bcf_predecessor_bcwv_previous_left_table)) * bcf_row_code_scale_bcwv_previous_left)) /\ exists bcf_quotient_bcwv_previous_left_table_decoded_previous_code. bcf_row_code_code_bcwv_previous_left = bcf_quotient_bcwv_previous_left_table_decoded_previous_code * S ((S (bcf_predecessor_bcwv_previous_left_table)) * bcf_row_code_scale_bcwv_previous_left) + (bcf_previous_code_bcwv_previous_left_table))) /\ ((((exists bcf_height_bcwv_previous_left_table_decoded_previous_scale. bcf_height_bcwv_previous_left_table_decoded_previous_scale + S (bcf_previous_scale_bcwv_previous_left_table) = S ((S (bcf_predecessor_bcwv_previous_left_table)) * bcf_row_scale_scale_bcwv_previous_left)) /\ exists bcf_quotient_bcwv_previous_left_table_decoded_previous_scale. bcf_row_scale_code_bcwv_previous_left = bcf_quotient_bcwv_previous_left_table_decoded_previous_scale * S ((S (bcf_predecessor_bcwv_previous_left_table)) * bcf_row_scale_scale_bcwv_previous_left) + (bcf_previous_scale_bcwv_previous_left_table))) /\ (forall bcf_index_bcwv_previous_left_table_row_step. (exists bcf_lt_gap_bcwv_previous_left_table_row_step_bound. bcf_lt_gap_bcwv_previous_left_table_row_step_bound + S (bcf_index_bcwv_previous_left_table_row_step) = S (n)) -> exists bcf_value_bcwv_previous_left_table_row_step. ((((exists bcf_height_bcwv_previous_left_table_row_step_entry. bcf_height_bcwv_previous_left_table_row_step_entry + S (bcf_value_bcwv_previous_left_table_row_step) = S ((S (bcf_index_bcwv_previous_left_table_row_step)) * bcf_row_scale_bcwv_previous_left_table)) /\ exists bcf_quotient_bcwv_previous_left_table_row_step_entry. bcf_row_code_bcwv_previous_left_table = bcf_quotient_bcwv_previous_left_table_row_step_entry * S ((S (bcf_index_bcwv_previous_left_table_row_step)) * bcf_row_scale_bcwv_previous_left_table) + (bcf_value_bcwv_previous_left_table_row_step))) /\ ((bcf_index_bcwv_previous_left_table_row_step = 0 /\ bcf_value_bcwv_previous_left_table_row_step = 1) \/ exists bcf_predecessor_bcwv_previous_left_table_row_step bcf_left_bcwv_previous_left_table_row_step bcf_right_bcwv_previous_left_table_row_step. bcf_index_bcwv_previous_left_table_row_step = S bcf_predecessor_bcwv_previous_left_table_row_step /\ ((((exists bcf_height_bcwv_previous_left_table_row_step_previous_left. bcf_height_bcwv_previous_left_table_row_step_previous_left + S (bcf_left_bcwv_previous_left_table_row_step) = S ((S (bcf_predecessor_bcwv_previous_left_table_row_step)) * bcf_previous_scale_bcwv_previous_left_table)) /\ exists bcf_quotient_bcwv_previous_left_table_row_step_previous_left. bcf_previous_code_bcwv_previous_left_table = bcf_quotient_bcwv_previous_left_table_row_step_previous_left * S ((S (bcf_predecessor_bcwv_previous_left_table_row_step)) * bcf_previous_scale_bcwv_previous_left_table) + (bcf_left_bcwv_previous_left_table_row_step))) /\ ((((exists bcf_height_bcwv_previous_left_table_row_step_previous_right. bcf_height_bcwv_previous_left_table_row_step_previous_right + S (bcf_right_bcwv_previous_left_table_row_step) = S ((S (S (bcf_predecessor_bcwv_previous_left_table_row_step))) * bcf_previous_scale_bcwv_previous_left_table)) /\ exists bcf_quotient_bcwv_previous_left_table_row_step_previous_right. bcf_previous_code_bcwv_previous_left_table = bcf_quotient_bcwv_previous_left_table_row_step_previous_right * S ((S (S (bcf_predecessor_bcwv_previous_left_table_row_step))) * bcf_previous_scale_bcwv_previous_left_table) + (bcf_right_bcwv_previous_left_table_row_step))) /\ bcf_value_bcwv_previous_left_table_row_step = bcf_left_bcwv_previous_left_table_row_step + bcf_right_bcwv_previous_left_table_row_step))))))))))) /\ ((((exists bcf_height_bcwv_previous_left_decoded_row_code. bcf_height_bcwv_previous_left_decoded_row_code + S (bcf_row_code_bcwv_previous_left) = S ((S (n)) * bcf_row_code_scale_bcwv_previous_left)) /\ exists bcf_quotient_bcwv_previous_left_decoded_row_code. bcf_row_code_code_bcwv_previous_left = bcf_quotient_bcwv_previous_left_decoded_row_code * S ((S (n)) * bcf_row_code_scale_bcwv_previous_left) + (bcf_row_code_bcwv_previous_left))) /\ ((((exists bcf_height_bcwv_previous_left_decoded_row_scale. bcf_height_bcwv_previous_left_decoded_row_scale + S (bcf_row_scale_bcwv_previous_left) = S ((S (n)) * bcf_row_scale_scale_bcwv_previous_left)) /\ exists bcf_quotient_bcwv_previous_left_decoded_row_scale. bcf_row_scale_code_bcwv_previous_left = bcf_quotient_bcwv_previous_left_decoded_row_scale * S ((S (n)) * bcf_row_scale_scale_bcwv_previous_left) + (bcf_row_scale_bcwv_previous_left))) /\ (((exists bcf_height_bcwv_previous_left_decoded_value. bcf_height_bcwv_previous_left_decoded_value + S (a) = S ((S (k)) * bcf_row_scale_bcwv_previous_left)) /\ exists bcf_quotient_bcwv_previous_left_decoded_value. bcf_row_code_bcwv_previous_left = bcf_quotient_bcwv_previous_left_decoded_value * S ((S (k)) * bcf_row_scale_bcwv_previous_left) + (a)))))))))
  85. 0085specialize choose_exists n
  86. 0086specialize choose_exists k
  87. 0087exact choose_exists
  88. 0088cases ha_exists
  89. 0089have hb_exists : ∃ b. Choose(S n,k,b)
    Exact native replay linehave hb_exists : exists b. (((exists bcf_lt_gap_bcwv_successor_left_out_of_range. bcf_lt_gap_bcwv_successor_left_out_of_range + S (S n) = k) /\ b = 0) \/ ((exists bcf_le_gap_bcwv_successor_left_in_range. bcf_le_gap_bcwv_successor_left_in_range + (k) = S n) /\ (exists bcf_row_code_code_bcwv_successor_left bcf_row_code_scale_bcwv_successor_left bcf_row_scale_code_bcwv_successor_left bcf_row_scale_scale_bcwv_successor_left bcf_row_code_bcwv_successor_left bcf_row_scale_bcwv_successor_left. ((forall bcf_row_index_bcwv_successor_left_table. (exists bcf_lt_gap_bcwv_successor_left_table_row_bound. bcf_lt_gap_bcwv_successor_left_table_row_bound + S (bcf_row_index_bcwv_successor_left_table) = S (S n)) -> exists bcf_row_code_bcwv_successor_left_table bcf_row_scale_bcwv_successor_left_table. ((((exists bcf_height_bcwv_successor_left_table_decoded_row_code. bcf_height_bcwv_successor_left_table_decoded_row_code + S (bcf_row_code_bcwv_successor_left_table) = S ((S (bcf_row_index_bcwv_successor_left_table)) * bcf_row_code_scale_bcwv_successor_left)) /\ exists bcf_quotient_bcwv_successor_left_table_decoded_row_code. bcf_row_code_code_bcwv_successor_left = bcf_quotient_bcwv_successor_left_table_decoded_row_code * S ((S (bcf_row_index_bcwv_successor_left_table)) * bcf_row_code_scale_bcwv_successor_left) + (bcf_row_code_bcwv_successor_left_table))) /\ ((((exists bcf_height_bcwv_successor_left_table_decoded_row_scale. bcf_height_bcwv_successor_left_table_decoded_row_scale + S (bcf_row_scale_bcwv_successor_left_table) = S ((S (bcf_row_index_bcwv_successor_left_table)) * bcf_row_scale_scale_bcwv_successor_left)) /\ exists bcf_quotient_bcwv_successor_left_table_decoded_row_scale. bcf_row_scale_code_bcwv_successor_left = bcf_quotient_bcwv_successor_left_table_decoded_row_scale * S ((S (bcf_row_index_bcwv_successor_left_table)) * bcf_row_scale_scale_bcwv_successor_left) + (bcf_row_scale_bcwv_successor_left_table))) /\ ((bcf_row_index_bcwv_successor_left_table = 0 /\ (forall bcf_index_bcwv_successor_left_table_zero_row. (exists bcf_lt_gap_bcwv_successor_left_table_zero_row_bound. bcf_lt_gap_bcwv_successor_left_table_zero_row_bound + S (bcf_index_bcwv_successor_left_table_zero_row) = S (S n)) -> exists bcf_value_bcwv_successor_left_table_zero_row. ((((exists bcf_height_bcwv_successor_left_table_zero_row_entry. bcf_height_bcwv_successor_left_table_zero_row_entry + S (bcf_value_bcwv_successor_left_table_zero_row) = S ((S (bcf_index_bcwv_successor_left_table_zero_row)) * bcf_row_scale_bcwv_successor_left_table)) /\ exists bcf_quotient_bcwv_successor_left_table_zero_row_entry. bcf_row_code_bcwv_successor_left_table = bcf_quotient_bcwv_successor_left_table_zero_row_entry * S ((S (bcf_index_bcwv_successor_left_table_zero_row)) * bcf_row_scale_bcwv_successor_left_table) + (bcf_value_bcwv_successor_left_table_zero_row))) /\ ((bcf_index_bcwv_successor_left_table_zero_row = 0 /\ bcf_value_bcwv_successor_left_table_zero_row = 1) \/ exists bcf_predecessor_bcwv_successor_left_table_zero_row. bcf_index_bcwv_successor_left_table_zero_row = S bcf_predecessor_bcwv_successor_left_table_zero_row /\ bcf_value_bcwv_successor_left_table_zero_row = 0)))) \/ exists bcf_predecessor_bcwv_successor_left_table bcf_previous_code_bcwv_successor_left_table bcf_previous_scale_bcwv_successor_left_table. bcf_row_index_bcwv_successor_left_table = S bcf_predecessor_bcwv_successor_left_table /\ ((((exists bcf_height_bcwv_successor_left_table_decoded_previous_code. bcf_height_bcwv_successor_left_table_decoded_previous_code + S (bcf_previous_code_bcwv_successor_left_table) = S ((S (bcf_predecessor_bcwv_successor_left_table)) * bcf_row_code_scale_bcwv_successor_left)) /\ exists bcf_quotient_bcwv_successor_left_table_decoded_previous_code. bcf_row_code_code_bcwv_successor_left = bcf_quotient_bcwv_successor_left_table_decoded_previous_code * S ((S (bcf_predecessor_bcwv_successor_left_table)) * bcf_row_code_scale_bcwv_successor_left) + (bcf_previous_code_bcwv_successor_left_table))) /\ ((((exists bcf_height_bcwv_successor_left_table_decoded_previous_scale. bcf_height_bcwv_successor_left_table_decoded_previous_scale + S (bcf_previous_scale_bcwv_successor_left_table) = S ((S (bcf_predecessor_bcwv_successor_left_table)) * bcf_row_scale_scale_bcwv_successor_left)) /\ exists bcf_quotient_bcwv_successor_left_table_decoded_previous_scale. bcf_row_scale_code_bcwv_successor_left = bcf_quotient_bcwv_successor_left_table_decoded_previous_scale * S ((S (bcf_predecessor_bcwv_successor_left_table)) * bcf_row_scale_scale_bcwv_successor_left) + (bcf_previous_scale_bcwv_successor_left_table))) /\ (forall bcf_index_bcwv_successor_left_table_row_step. (exists bcf_lt_gap_bcwv_successor_left_table_row_step_bound. bcf_lt_gap_bcwv_successor_left_table_row_step_bound + S (bcf_index_bcwv_successor_left_table_row_step) = S (S n)) -> exists bcf_value_bcwv_successor_left_table_row_step. ((((exists bcf_height_bcwv_successor_left_table_row_step_entry. bcf_height_bcwv_successor_left_table_row_step_entry + S (bcf_value_bcwv_successor_left_table_row_step) = S ((S (bcf_index_bcwv_successor_left_table_row_step)) * bcf_row_scale_bcwv_successor_left_table)) /\ exists bcf_quotient_bcwv_successor_left_table_row_step_entry. bcf_row_code_bcwv_successor_left_table = bcf_quotient_bcwv_successor_left_table_row_step_entry * S ((S (bcf_index_bcwv_successor_left_table_row_step)) * bcf_row_scale_bcwv_successor_left_table) + (bcf_value_bcwv_successor_left_table_row_step))) /\ ((bcf_index_bcwv_successor_left_table_row_step = 0 /\ bcf_value_bcwv_successor_left_table_row_step = 1) \/ exists bcf_predecessor_bcwv_successor_left_table_row_step bcf_left_bcwv_successor_left_table_row_step bcf_right_bcwv_successor_left_table_row_step. bcf_index_bcwv_successor_left_table_row_step = S bcf_predecessor_bcwv_successor_left_table_row_step /\ ((((exists bcf_height_bcwv_successor_left_table_row_step_previous_left. bcf_height_bcwv_successor_left_table_row_step_previous_left + S (bcf_left_bcwv_successor_left_table_row_step) = S ((S (bcf_predecessor_bcwv_successor_left_table_row_step)) * bcf_previous_scale_bcwv_successor_left_table)) /\ exists bcf_quotient_bcwv_successor_left_table_row_step_previous_left. bcf_previous_code_bcwv_successor_left_table = bcf_quotient_bcwv_successor_left_table_row_step_previous_left * S ((S (bcf_predecessor_bcwv_successor_left_table_row_step)) * bcf_previous_scale_bcwv_successor_left_table) + (bcf_left_bcwv_successor_left_table_row_step))) /\ ((((exists bcf_height_bcwv_successor_left_table_row_step_previous_right. bcf_height_bcwv_successor_left_table_row_step_previous_right + S (bcf_right_bcwv_successor_left_table_row_step) = S ((S (S (bcf_predecessor_bcwv_successor_left_table_row_step))) * bcf_previous_scale_bcwv_successor_left_table)) /\ exists bcf_quotient_bcwv_successor_left_table_row_step_previous_right. bcf_previous_code_bcwv_successor_left_table = bcf_quotient_bcwv_successor_left_table_row_step_previous_right * S ((S (S (bcf_predecessor_bcwv_successor_left_table_row_step))) * bcf_previous_scale_bcwv_successor_left_table) + (bcf_right_bcwv_successor_left_table_row_step))) /\ bcf_value_bcwv_successor_left_table_row_step = bcf_left_bcwv_successor_left_table_row_step + bcf_right_bcwv_successor_left_table_row_step))))))))))) /\ ((((exists bcf_height_bcwv_successor_left_decoded_row_code. bcf_height_bcwv_successor_left_decoded_row_code + S (bcf_row_code_bcwv_successor_left) = S ((S (S n)) * bcf_row_code_scale_bcwv_successor_left)) /\ exists bcf_quotient_bcwv_successor_left_decoded_row_code. bcf_row_code_code_bcwv_successor_left = bcf_quotient_bcwv_successor_left_decoded_row_code * S ((S (S n)) * bcf_row_code_scale_bcwv_successor_left) + (bcf_row_code_bcwv_successor_left))) /\ ((((exists bcf_height_bcwv_successor_left_decoded_row_scale. bcf_height_bcwv_successor_left_decoded_row_scale + S (bcf_row_scale_bcwv_successor_left) = S ((S (S n)) * bcf_row_scale_scale_bcwv_successor_left)) /\ exists bcf_quotient_bcwv_successor_left_decoded_row_scale. bcf_row_scale_code_bcwv_successor_left = bcf_quotient_bcwv_successor_left_decoded_row_scale * S ((S (S n)) * bcf_row_scale_scale_bcwv_successor_left) + (bcf_row_scale_bcwv_successor_left))) /\ (((exists bcf_height_bcwv_successor_left_decoded_value. bcf_height_bcwv_successor_left_decoded_value + S (b) = S ((S (k)) * bcf_row_scale_bcwv_successor_left)) /\ exists bcf_quotient_bcwv_successor_left_decoded_value. bcf_row_code_bcwv_successor_left = bcf_quotient_bcwv_successor_left_decoded_value * S ((S (k)) * bcf_row_scale_bcwv_successor_left) + (b)))))))))
  90. 0090specialize choose_exists (S n)
  91. 0091specialize choose_exists k
  92. 0092exact choose_exists
  93. 0093cases hb_exists
  94. 0094rewrite zero_or_succ_left at hsum
  95. 0095rewrite PA3 at hsum
  96. 0096have hk : k = n
  97. 0097apply PA2
  98. 0098exact hsum
  99. 0099have hprevious_sum : k + 0 = n
  100. 0100trans k
  101. 0101apply PA3
  102. 0102exact hk
  103. 0103have ha_one : x1 = 1
  104. 0104specialize choose_self_of_eq n
  105. 0105specialize choose_self_of_eq k
  106. 0106specialize choose_self_of_eq x1
  107. 0107apply choose_self_of_eq
  108. 0108exact hk
  109. 0109exact ha_exists_witness
  110. 0110have hx_one : x = 1
  111. 0111specialize choose_self_of_eq (S n)
  112. 0112specialize choose_self_of_eq (S k)
  113. 0113specialize choose_self_of_eq x
  114. 0114apply choose_self_of_eq
  115. 0115exact hsum
  116. 0116exact hlower
  117. 0117have hweighted : S 0 * x2 = S n * x1
  118. 0118specialize IH k
  119. 0119specialize IH 0
  120. 0120specialize IH x1
  121. 0121specialize IH x2
  122. 0122apply IH
  123. 0123exact hprevious_sum
  124. 0124exact ha_exists_witness
  125. 0125exact hb_exists_witness
  126. 0126have hy_sum : y = x2 + x
  127. 0127specialize choose_succ_succ (S n)
  128. 0128specialize choose_succ_succ k
  129. 0129specialize choose_succ_succ x2
  130. 0130specialize choose_succ_succ x
  131. 0131specialize choose_succ_succ y
  132. 0132apply choose_succ_succ
  133. 0133exact hb_exists_witness
  134. 0134exact hlower
  135. 0135exact hupper
  136. 0136have hsame_one : x1 = x
  137. 0137trans 1
  138. 0138exact ha_one
  139. 0139symm
  140. 0140exact hx_one
  141. 0141have hone_scale : S 0 * x = x
  142. 0142trans S 0 * 1
  143. 0143congr
  144. 0144refl
  145. 0145exact hx_one
  146. 0146trans 1
  147. 0147trans S 0 * 0 + S 0
  148. 0148apply PA6
  149. 0149rewrite PA5
  150. 0150apply zero_add
  151. 0151symm
  152. 0152exact hx_one
  153. 0153rewrite zero_or_succ_left
  154. 0154trans S 0 * (x2 + x)
  155. 0155congr
  156. 0156refl
  157. 0157exact hy_sum
  158. 0158trans S 0 * x2 + S 0 * x
  159. 0159apply mul_add
  160. 0160trans S n * x1 + S 0 * x
  161. 0161congr
  162. 0162exact hweighted
  163. 0163refl
  164. 0164trans S n * x + x
  165. 0165congr
  166. 0166congr
  167. 0167refl
  168. 0168exact hsame_one
  169. 0169exact hone_scale
  170. 0170specialize mul_succ_left (S n)
  171. 0171specialize mul_succ_left x
  172. 0172symm
  173. 0173exact mul_succ_left
  174. 0174cases zero_or_succ_right
  175. 0175have ha_exists : ∃ a. Choose(n,k,a)
    Exact native replay linehave ha_exists : exists a. (((exists bcf_lt_gap_bcwv_previous_left_out_of_range. bcf_lt_gap_bcwv_previous_left_out_of_range + S (n) = k) /\ a = 0) \/ ((exists bcf_le_gap_bcwv_previous_left_in_range. bcf_le_gap_bcwv_previous_left_in_range + (k) = n) /\ (exists bcf_row_code_code_bcwv_previous_left bcf_row_code_scale_bcwv_previous_left bcf_row_scale_code_bcwv_previous_left bcf_row_scale_scale_bcwv_previous_left bcf_row_code_bcwv_previous_left bcf_row_scale_bcwv_previous_left. ((forall bcf_row_index_bcwv_previous_left_table. (exists bcf_lt_gap_bcwv_previous_left_table_row_bound. bcf_lt_gap_bcwv_previous_left_table_row_bound + S (bcf_row_index_bcwv_previous_left_table) = S (n)) -> exists bcf_row_code_bcwv_previous_left_table bcf_row_scale_bcwv_previous_left_table. ((((exists bcf_height_bcwv_previous_left_table_decoded_row_code. bcf_height_bcwv_previous_left_table_decoded_row_code + S (bcf_row_code_bcwv_previous_left_table) = S ((S (bcf_row_index_bcwv_previous_left_table)) * bcf_row_code_scale_bcwv_previous_left)) /\ exists bcf_quotient_bcwv_previous_left_table_decoded_row_code. bcf_row_code_code_bcwv_previous_left = bcf_quotient_bcwv_previous_left_table_decoded_row_code * S ((S (bcf_row_index_bcwv_previous_left_table)) * bcf_row_code_scale_bcwv_previous_left) + (bcf_row_code_bcwv_previous_left_table))) /\ ((((exists bcf_height_bcwv_previous_left_table_decoded_row_scale. bcf_height_bcwv_previous_left_table_decoded_row_scale + S (bcf_row_scale_bcwv_previous_left_table) = S ((S (bcf_row_index_bcwv_previous_left_table)) * bcf_row_scale_scale_bcwv_previous_left)) /\ exists bcf_quotient_bcwv_previous_left_table_decoded_row_scale. bcf_row_scale_code_bcwv_previous_left = bcf_quotient_bcwv_previous_left_table_decoded_row_scale * S ((S (bcf_row_index_bcwv_previous_left_table)) * bcf_row_scale_scale_bcwv_previous_left) + (bcf_row_scale_bcwv_previous_left_table))) /\ ((bcf_row_index_bcwv_previous_left_table = 0 /\ (forall bcf_index_bcwv_previous_left_table_zero_row. (exists bcf_lt_gap_bcwv_previous_left_table_zero_row_bound. bcf_lt_gap_bcwv_previous_left_table_zero_row_bound + S (bcf_index_bcwv_previous_left_table_zero_row) = S (n)) -> exists bcf_value_bcwv_previous_left_table_zero_row. ((((exists bcf_height_bcwv_previous_left_table_zero_row_entry. bcf_height_bcwv_previous_left_table_zero_row_entry + S (bcf_value_bcwv_previous_left_table_zero_row) = S ((S (bcf_index_bcwv_previous_left_table_zero_row)) * bcf_row_scale_bcwv_previous_left_table)) /\ exists bcf_quotient_bcwv_previous_left_table_zero_row_entry. bcf_row_code_bcwv_previous_left_table = bcf_quotient_bcwv_previous_left_table_zero_row_entry * S ((S (bcf_index_bcwv_previous_left_table_zero_row)) * bcf_row_scale_bcwv_previous_left_table) + (bcf_value_bcwv_previous_left_table_zero_row))) /\ ((bcf_index_bcwv_previous_left_table_zero_row = 0 /\ bcf_value_bcwv_previous_left_table_zero_row = 1) \/ exists bcf_predecessor_bcwv_previous_left_table_zero_row. bcf_index_bcwv_previous_left_table_zero_row = S bcf_predecessor_bcwv_previous_left_table_zero_row /\ bcf_value_bcwv_previous_left_table_zero_row = 0)))) \/ exists bcf_predecessor_bcwv_previous_left_table bcf_previous_code_bcwv_previous_left_table bcf_previous_scale_bcwv_previous_left_table. bcf_row_index_bcwv_previous_left_table = S bcf_predecessor_bcwv_previous_left_table /\ ((((exists bcf_height_bcwv_previous_left_table_decoded_previous_code. bcf_height_bcwv_previous_left_table_decoded_previous_code + S (bcf_previous_code_bcwv_previous_left_table) = S ((S (bcf_predecessor_bcwv_previous_left_table)) * bcf_row_code_scale_bcwv_previous_left)) /\ exists bcf_quotient_bcwv_previous_left_table_decoded_previous_code. bcf_row_code_code_bcwv_previous_left = bcf_quotient_bcwv_previous_left_table_decoded_previous_code * S ((S (bcf_predecessor_bcwv_previous_left_table)) * bcf_row_code_scale_bcwv_previous_left) + (bcf_previous_code_bcwv_previous_left_table))) /\ ((((exists bcf_height_bcwv_previous_left_table_decoded_previous_scale. bcf_height_bcwv_previous_left_table_decoded_previous_scale + S (bcf_previous_scale_bcwv_previous_left_table) = S ((S (bcf_predecessor_bcwv_previous_left_table)) * bcf_row_scale_scale_bcwv_previous_left)) /\ exists bcf_quotient_bcwv_previous_left_table_decoded_previous_scale. bcf_row_scale_code_bcwv_previous_left = bcf_quotient_bcwv_previous_left_table_decoded_previous_scale * S ((S (bcf_predecessor_bcwv_previous_left_table)) * bcf_row_scale_scale_bcwv_previous_left) + (bcf_previous_scale_bcwv_previous_left_table))) /\ (forall bcf_index_bcwv_previous_left_table_row_step. (exists bcf_lt_gap_bcwv_previous_left_table_row_step_bound. bcf_lt_gap_bcwv_previous_left_table_row_step_bound + S (bcf_index_bcwv_previous_left_table_row_step) = S (n)) -> exists bcf_value_bcwv_previous_left_table_row_step. ((((exists bcf_height_bcwv_previous_left_table_row_step_entry. bcf_height_bcwv_previous_left_table_row_step_entry + S (bcf_value_bcwv_previous_left_table_row_step) = S ((S (bcf_index_bcwv_previous_left_table_row_step)) * bcf_row_scale_bcwv_previous_left_table)) /\ exists bcf_quotient_bcwv_previous_left_table_row_step_entry. bcf_row_code_bcwv_previous_left_table = bcf_quotient_bcwv_previous_left_table_row_step_entry * S ((S (bcf_index_bcwv_previous_left_table_row_step)) * bcf_row_scale_bcwv_previous_left_table) + (bcf_value_bcwv_previous_left_table_row_step))) /\ ((bcf_index_bcwv_previous_left_table_row_step = 0 /\ bcf_value_bcwv_previous_left_table_row_step = 1) \/ exists bcf_predecessor_bcwv_previous_left_table_row_step bcf_left_bcwv_previous_left_table_row_step bcf_right_bcwv_previous_left_table_row_step. bcf_index_bcwv_previous_left_table_row_step = S bcf_predecessor_bcwv_previous_left_table_row_step /\ ((((exists bcf_height_bcwv_previous_left_table_row_step_previous_left. bcf_height_bcwv_previous_left_table_row_step_previous_left + S (bcf_left_bcwv_previous_left_table_row_step) = S ((S (bcf_predecessor_bcwv_previous_left_table_row_step)) * bcf_previous_scale_bcwv_previous_left_table)) /\ exists bcf_quotient_bcwv_previous_left_table_row_step_previous_left. bcf_previous_code_bcwv_previous_left_table = bcf_quotient_bcwv_previous_left_table_row_step_previous_left * S ((S (bcf_predecessor_bcwv_previous_left_table_row_step)) * bcf_previous_scale_bcwv_previous_left_table) + (bcf_left_bcwv_previous_left_table_row_step))) /\ ((((exists bcf_height_bcwv_previous_left_table_row_step_previous_right. bcf_height_bcwv_previous_left_table_row_step_previous_right + S (bcf_right_bcwv_previous_left_table_row_step) = S ((S (S (bcf_predecessor_bcwv_previous_left_table_row_step))) * bcf_previous_scale_bcwv_previous_left_table)) /\ exists bcf_quotient_bcwv_previous_left_table_row_step_previous_right. bcf_previous_code_bcwv_previous_left_table = bcf_quotient_bcwv_previous_left_table_row_step_previous_right * S ((S (S (bcf_predecessor_bcwv_previous_left_table_row_step))) * bcf_previous_scale_bcwv_previous_left_table) + (bcf_right_bcwv_previous_left_table_row_step))) /\ bcf_value_bcwv_previous_left_table_row_step = bcf_left_bcwv_previous_left_table_row_step + bcf_right_bcwv_previous_left_table_row_step))))))))))) /\ ((((exists bcf_height_bcwv_previous_left_decoded_row_code. bcf_height_bcwv_previous_left_decoded_row_code + S (bcf_row_code_bcwv_previous_left) = S ((S (n)) * bcf_row_code_scale_bcwv_previous_left)) /\ exists bcf_quotient_bcwv_previous_left_decoded_row_code. bcf_row_code_code_bcwv_previous_left = bcf_quotient_bcwv_previous_left_decoded_row_code * S ((S (n)) * bcf_row_code_scale_bcwv_previous_left) + (bcf_row_code_bcwv_previous_left))) /\ ((((exists bcf_height_bcwv_previous_left_decoded_row_scale. bcf_height_bcwv_previous_left_decoded_row_scale + S (bcf_row_scale_bcwv_previous_left) = S ((S (n)) * bcf_row_scale_scale_bcwv_previous_left)) /\ exists bcf_quotient_bcwv_previous_left_decoded_row_scale. bcf_row_scale_code_bcwv_previous_left = bcf_quotient_bcwv_previous_left_decoded_row_scale * S ((S (n)) * bcf_row_scale_scale_bcwv_previous_left) + (bcf_row_scale_bcwv_previous_left))) /\ (((exists bcf_height_bcwv_previous_left_decoded_value. bcf_height_bcwv_previous_left_decoded_value + S (a) = S ((S (k)) * bcf_row_scale_bcwv_previous_left)) /\ exists bcf_quotient_bcwv_previous_left_decoded_value. bcf_row_code_bcwv_previous_left = bcf_quotient_bcwv_previous_left_decoded_value * S ((S (k)) * bcf_row_scale_bcwv_previous_left) + (a)))))))))
  176. 0176specialize choose_exists n
  177. 0177specialize choose_exists k
  178. 0178exact choose_exists
  179. 0179cases ha_exists
  180. 0180have hb_exists : ∃ b. Choose(n,S k,b)
    Exact native replay linehave hb_exists : exists b. (((exists bcf_lt_gap_bcwv_previous_right_out_of_range. bcf_lt_gap_bcwv_previous_right_out_of_range + S (n) = S k) /\ b = 0) \/ ((exists bcf_le_gap_bcwv_previous_right_in_range. bcf_le_gap_bcwv_previous_right_in_range + (S k) = n) /\ (exists bcf_row_code_code_bcwv_previous_right bcf_row_code_scale_bcwv_previous_right bcf_row_scale_code_bcwv_previous_right bcf_row_scale_scale_bcwv_previous_right bcf_row_code_bcwv_previous_right bcf_row_scale_bcwv_previous_right. ((forall bcf_row_index_bcwv_previous_right_table. (exists bcf_lt_gap_bcwv_previous_right_table_row_bound. bcf_lt_gap_bcwv_previous_right_table_row_bound + S (bcf_row_index_bcwv_previous_right_table) = S (n)) -> exists bcf_row_code_bcwv_previous_right_table bcf_row_scale_bcwv_previous_right_table. ((((exists bcf_height_bcwv_previous_right_table_decoded_row_code. bcf_height_bcwv_previous_right_table_decoded_row_code + S (bcf_row_code_bcwv_previous_right_table) = S ((S (bcf_row_index_bcwv_previous_right_table)) * bcf_row_code_scale_bcwv_previous_right)) /\ exists bcf_quotient_bcwv_previous_right_table_decoded_row_code. bcf_row_code_code_bcwv_previous_right = bcf_quotient_bcwv_previous_right_table_decoded_row_code * S ((S (bcf_row_index_bcwv_previous_right_table)) * bcf_row_code_scale_bcwv_previous_right) + (bcf_row_code_bcwv_previous_right_table))) /\ ((((exists bcf_height_bcwv_previous_right_table_decoded_row_scale. bcf_height_bcwv_previous_right_table_decoded_row_scale + S (bcf_row_scale_bcwv_previous_right_table) = S ((S (bcf_row_index_bcwv_previous_right_table)) * bcf_row_scale_scale_bcwv_previous_right)) /\ exists bcf_quotient_bcwv_previous_right_table_decoded_row_scale. bcf_row_scale_code_bcwv_previous_right = bcf_quotient_bcwv_previous_right_table_decoded_row_scale * S ((S (bcf_row_index_bcwv_previous_right_table)) * bcf_row_scale_scale_bcwv_previous_right) + (bcf_row_scale_bcwv_previous_right_table))) /\ ((bcf_row_index_bcwv_previous_right_table = 0 /\ (forall bcf_index_bcwv_previous_right_table_zero_row. (exists bcf_lt_gap_bcwv_previous_right_table_zero_row_bound. bcf_lt_gap_bcwv_previous_right_table_zero_row_bound + S (bcf_index_bcwv_previous_right_table_zero_row) = S (n)) -> exists bcf_value_bcwv_previous_right_table_zero_row. ((((exists bcf_height_bcwv_previous_right_table_zero_row_entry. bcf_height_bcwv_previous_right_table_zero_row_entry + S (bcf_value_bcwv_previous_right_table_zero_row) = S ((S (bcf_index_bcwv_previous_right_table_zero_row)) * bcf_row_scale_bcwv_previous_right_table)) /\ exists bcf_quotient_bcwv_previous_right_table_zero_row_entry. bcf_row_code_bcwv_previous_right_table = bcf_quotient_bcwv_previous_right_table_zero_row_entry * S ((S (bcf_index_bcwv_previous_right_table_zero_row)) * bcf_row_scale_bcwv_previous_right_table) + (bcf_value_bcwv_previous_right_table_zero_row))) /\ ((bcf_index_bcwv_previous_right_table_zero_row = 0 /\ bcf_value_bcwv_previous_right_table_zero_row = 1) \/ exists bcf_predecessor_bcwv_previous_right_table_zero_row. bcf_index_bcwv_previous_right_table_zero_row = S bcf_predecessor_bcwv_previous_right_table_zero_row /\ bcf_value_bcwv_previous_right_table_zero_row = 0)))) \/ exists bcf_predecessor_bcwv_previous_right_table bcf_previous_code_bcwv_previous_right_table bcf_previous_scale_bcwv_previous_right_table. bcf_row_index_bcwv_previous_right_table = S bcf_predecessor_bcwv_previous_right_table /\ ((((exists bcf_height_bcwv_previous_right_table_decoded_previous_code. bcf_height_bcwv_previous_right_table_decoded_previous_code + S (bcf_previous_code_bcwv_previous_right_table) = S ((S (bcf_predecessor_bcwv_previous_right_table)) * bcf_row_code_scale_bcwv_previous_right)) /\ exists bcf_quotient_bcwv_previous_right_table_decoded_previous_code. bcf_row_code_code_bcwv_previous_right = bcf_quotient_bcwv_previous_right_table_decoded_previous_code * S ((S (bcf_predecessor_bcwv_previous_right_table)) * bcf_row_code_scale_bcwv_previous_right) + (bcf_previous_code_bcwv_previous_right_table))) /\ ((((exists bcf_height_bcwv_previous_right_table_decoded_previous_scale. bcf_height_bcwv_previous_right_table_decoded_previous_scale + S (bcf_previous_scale_bcwv_previous_right_table) = S ((S (bcf_predecessor_bcwv_previous_right_table)) * bcf_row_scale_scale_bcwv_previous_right)) /\ exists bcf_quotient_bcwv_previous_right_table_decoded_previous_scale. bcf_row_scale_code_bcwv_previous_right = bcf_quotient_bcwv_previous_right_table_decoded_previous_scale * S ((S (bcf_predecessor_bcwv_previous_right_table)) * bcf_row_scale_scale_bcwv_previous_right) + (bcf_previous_scale_bcwv_previous_right_table))) /\ (forall bcf_index_bcwv_previous_right_table_row_step. (exists bcf_lt_gap_bcwv_previous_right_table_row_step_bound. bcf_lt_gap_bcwv_previous_right_table_row_step_bound + S (bcf_index_bcwv_previous_right_table_row_step) = S (n)) -> exists bcf_value_bcwv_previous_right_table_row_step. ((((exists bcf_height_bcwv_previous_right_table_row_step_entry. bcf_height_bcwv_previous_right_table_row_step_entry + S (bcf_value_bcwv_previous_right_table_row_step) = S ((S (bcf_index_bcwv_previous_right_table_row_step)) * bcf_row_scale_bcwv_previous_right_table)) /\ exists bcf_quotient_bcwv_previous_right_table_row_step_entry. bcf_row_code_bcwv_previous_right_table = bcf_quotient_bcwv_previous_right_table_row_step_entry * S ((S (bcf_index_bcwv_previous_right_table_row_step)) * bcf_row_scale_bcwv_previous_right_table) + (bcf_value_bcwv_previous_right_table_row_step))) /\ ((bcf_index_bcwv_previous_right_table_row_step = 0 /\ bcf_value_bcwv_previous_right_table_row_step = 1) \/ exists bcf_predecessor_bcwv_previous_right_table_row_step bcf_left_bcwv_previous_right_table_row_step bcf_right_bcwv_previous_right_table_row_step. bcf_index_bcwv_previous_right_table_row_step = S bcf_predecessor_bcwv_previous_right_table_row_step /\ ((((exists bcf_height_bcwv_previous_right_table_row_step_previous_left. bcf_height_bcwv_previous_right_table_row_step_previous_left + S (bcf_left_bcwv_previous_right_table_row_step) = S ((S (bcf_predecessor_bcwv_previous_right_table_row_step)) * bcf_previous_scale_bcwv_previous_right_table)) /\ exists bcf_quotient_bcwv_previous_right_table_row_step_previous_left. bcf_previous_code_bcwv_previous_right_table = bcf_quotient_bcwv_previous_right_table_row_step_previous_left * S ((S (bcf_predecessor_bcwv_previous_right_table_row_step)) * bcf_previous_scale_bcwv_previous_right_table) + (bcf_left_bcwv_previous_right_table_row_step))) /\ ((((exists bcf_height_bcwv_previous_right_table_row_step_previous_right. bcf_height_bcwv_previous_right_table_row_step_previous_right + S (bcf_right_bcwv_previous_right_table_row_step) = S ((S (S (bcf_predecessor_bcwv_previous_right_table_row_step))) * bcf_previous_scale_bcwv_previous_right_table)) /\ exists bcf_quotient_bcwv_previous_right_table_row_step_previous_right. bcf_previous_code_bcwv_previous_right_table = bcf_quotient_bcwv_previous_right_table_row_step_previous_right * S ((S (S (bcf_predecessor_bcwv_previous_right_table_row_step))) * bcf_previous_scale_bcwv_previous_right_table) + (bcf_right_bcwv_previous_right_table_row_step))) /\ bcf_value_bcwv_previous_right_table_row_step = bcf_left_bcwv_previous_right_table_row_step + bcf_right_bcwv_previous_right_table_row_step))))))))))) /\ ((((exists bcf_height_bcwv_previous_right_decoded_row_code. bcf_height_bcwv_previous_right_decoded_row_code + S (bcf_row_code_bcwv_previous_right) = S ((S (n)) * bcf_row_code_scale_bcwv_previous_right)) /\ exists bcf_quotient_bcwv_previous_right_decoded_row_code. bcf_row_code_code_bcwv_previous_right = bcf_quotient_bcwv_previous_right_decoded_row_code * S ((S (n)) * bcf_row_code_scale_bcwv_previous_right) + (bcf_row_code_bcwv_previous_right))) /\ ((((exists bcf_height_bcwv_previous_right_decoded_row_scale. bcf_height_bcwv_previous_right_decoded_row_scale + S (bcf_row_scale_bcwv_previous_right) = S ((S (n)) * bcf_row_scale_scale_bcwv_previous_right)) /\ exists bcf_quotient_bcwv_previous_right_decoded_row_scale. bcf_row_scale_code_bcwv_previous_right = bcf_quotient_bcwv_previous_right_decoded_row_scale * S ((S (n)) * bcf_row_scale_scale_bcwv_previous_right) + (bcf_row_scale_bcwv_previous_right))) /\ (((exists bcf_height_bcwv_previous_right_decoded_value. bcf_height_bcwv_previous_right_decoded_value + S (b) = S ((S (S k)) * bcf_row_scale_bcwv_previous_right)) /\ exists bcf_quotient_bcwv_previous_right_decoded_value. bcf_row_code_bcwv_previous_right = bcf_quotient_bcwv_previous_right_decoded_value * S ((S (S k)) * bcf_row_scale_bcwv_previous_right) + (b)))))))))
  181. 0181specialize choose_exists n
  182. 0182specialize choose_exists (S k)
  183. 0183exact choose_exists
  184. 0184cases hb_exists
  185. 0185have hc_exists : ∃ c. Choose(S n,k,c)
    Exact native replay linehave hc_exists : exists c. (((exists bcf_lt_gap_bcwv_successor_left_out_of_range. bcf_lt_gap_bcwv_successor_left_out_of_range + S (S n) = k) /\ c = 0) \/ ((exists bcf_le_gap_bcwv_successor_left_in_range. bcf_le_gap_bcwv_successor_left_in_range + (k) = S n) /\ (exists bcf_row_code_code_bcwv_successor_left bcf_row_code_scale_bcwv_successor_left bcf_row_scale_code_bcwv_successor_left bcf_row_scale_scale_bcwv_successor_left bcf_row_code_bcwv_successor_left bcf_row_scale_bcwv_successor_left. ((forall bcf_row_index_bcwv_successor_left_table. (exists bcf_lt_gap_bcwv_successor_left_table_row_bound. bcf_lt_gap_bcwv_successor_left_table_row_bound + S (bcf_row_index_bcwv_successor_left_table) = S (S n)) -> exists bcf_row_code_bcwv_successor_left_table bcf_row_scale_bcwv_successor_left_table. ((((exists bcf_height_bcwv_successor_left_table_decoded_row_code. bcf_height_bcwv_successor_left_table_decoded_row_code + S (bcf_row_code_bcwv_successor_left_table) = S ((S (bcf_row_index_bcwv_successor_left_table)) * bcf_row_code_scale_bcwv_successor_left)) /\ exists bcf_quotient_bcwv_successor_left_table_decoded_row_code. bcf_row_code_code_bcwv_successor_left = bcf_quotient_bcwv_successor_left_table_decoded_row_code * S ((S (bcf_row_index_bcwv_successor_left_table)) * bcf_row_code_scale_bcwv_successor_left) + (bcf_row_code_bcwv_successor_left_table))) /\ ((((exists bcf_height_bcwv_successor_left_table_decoded_row_scale. bcf_height_bcwv_successor_left_table_decoded_row_scale + S (bcf_row_scale_bcwv_successor_left_table) = S ((S (bcf_row_index_bcwv_successor_left_table)) * bcf_row_scale_scale_bcwv_successor_left)) /\ exists bcf_quotient_bcwv_successor_left_table_decoded_row_scale. bcf_row_scale_code_bcwv_successor_left = bcf_quotient_bcwv_successor_left_table_decoded_row_scale * S ((S (bcf_row_index_bcwv_successor_left_table)) * bcf_row_scale_scale_bcwv_successor_left) + (bcf_row_scale_bcwv_successor_left_table))) /\ ((bcf_row_index_bcwv_successor_left_table = 0 /\ (forall bcf_index_bcwv_successor_left_table_zero_row. (exists bcf_lt_gap_bcwv_successor_left_table_zero_row_bound. bcf_lt_gap_bcwv_successor_left_table_zero_row_bound + S (bcf_index_bcwv_successor_left_table_zero_row) = S (S n)) -> exists bcf_value_bcwv_successor_left_table_zero_row. ((((exists bcf_height_bcwv_successor_left_table_zero_row_entry. bcf_height_bcwv_successor_left_table_zero_row_entry + S (bcf_value_bcwv_successor_left_table_zero_row) = S ((S (bcf_index_bcwv_successor_left_table_zero_row)) * bcf_row_scale_bcwv_successor_left_table)) /\ exists bcf_quotient_bcwv_successor_left_table_zero_row_entry. bcf_row_code_bcwv_successor_left_table = bcf_quotient_bcwv_successor_left_table_zero_row_entry * S ((S (bcf_index_bcwv_successor_left_table_zero_row)) * bcf_row_scale_bcwv_successor_left_table) + (bcf_value_bcwv_successor_left_table_zero_row))) /\ ((bcf_index_bcwv_successor_left_table_zero_row = 0 /\ bcf_value_bcwv_successor_left_table_zero_row = 1) \/ exists bcf_predecessor_bcwv_successor_left_table_zero_row. bcf_index_bcwv_successor_left_table_zero_row = S bcf_predecessor_bcwv_successor_left_table_zero_row /\ bcf_value_bcwv_successor_left_table_zero_row = 0)))) \/ exists bcf_predecessor_bcwv_successor_left_table bcf_previous_code_bcwv_successor_left_table bcf_previous_scale_bcwv_successor_left_table. bcf_row_index_bcwv_successor_left_table = S bcf_predecessor_bcwv_successor_left_table /\ ((((exists bcf_height_bcwv_successor_left_table_decoded_previous_code. bcf_height_bcwv_successor_left_table_decoded_previous_code + S (bcf_previous_code_bcwv_successor_left_table) = S ((S (bcf_predecessor_bcwv_successor_left_table)) * bcf_row_code_scale_bcwv_successor_left)) /\ exists bcf_quotient_bcwv_successor_left_table_decoded_previous_code. bcf_row_code_code_bcwv_successor_left = bcf_quotient_bcwv_successor_left_table_decoded_previous_code * S ((S (bcf_predecessor_bcwv_successor_left_table)) * bcf_row_code_scale_bcwv_successor_left) + (bcf_previous_code_bcwv_successor_left_table))) /\ ((((exists bcf_height_bcwv_successor_left_table_decoded_previous_scale. bcf_height_bcwv_successor_left_table_decoded_previous_scale + S (bcf_previous_scale_bcwv_successor_left_table) = S ((S (bcf_predecessor_bcwv_successor_left_table)) * bcf_row_scale_scale_bcwv_successor_left)) /\ exists bcf_quotient_bcwv_successor_left_table_decoded_previous_scale. bcf_row_scale_code_bcwv_successor_left = bcf_quotient_bcwv_successor_left_table_decoded_previous_scale * S ((S (bcf_predecessor_bcwv_successor_left_table)) * bcf_row_scale_scale_bcwv_successor_left) + (bcf_previous_scale_bcwv_successor_left_table))) /\ (forall bcf_index_bcwv_successor_left_table_row_step. (exists bcf_lt_gap_bcwv_successor_left_table_row_step_bound. bcf_lt_gap_bcwv_successor_left_table_row_step_bound + S (bcf_index_bcwv_successor_left_table_row_step) = S (S n)) -> exists bcf_value_bcwv_successor_left_table_row_step. ((((exists bcf_height_bcwv_successor_left_table_row_step_entry. bcf_height_bcwv_successor_left_table_row_step_entry + S (bcf_value_bcwv_successor_left_table_row_step) = S ((S (bcf_index_bcwv_successor_left_table_row_step)) * bcf_row_scale_bcwv_successor_left_table)) /\ exists bcf_quotient_bcwv_successor_left_table_row_step_entry. bcf_row_code_bcwv_successor_left_table = bcf_quotient_bcwv_successor_left_table_row_step_entry * S ((S (bcf_index_bcwv_successor_left_table_row_step)) * bcf_row_scale_bcwv_successor_left_table) + (bcf_value_bcwv_successor_left_table_row_step))) /\ ((bcf_index_bcwv_successor_left_table_row_step = 0 /\ bcf_value_bcwv_successor_left_table_row_step = 1) \/ exists bcf_predecessor_bcwv_successor_left_table_row_step bcf_left_bcwv_successor_left_table_row_step bcf_right_bcwv_successor_left_table_row_step. bcf_index_bcwv_successor_left_table_row_step = S bcf_predecessor_bcwv_successor_left_table_row_step /\ ((((exists bcf_height_bcwv_successor_left_table_row_step_previous_left. bcf_height_bcwv_successor_left_table_row_step_previous_left + S (bcf_left_bcwv_successor_left_table_row_step) = S ((S (bcf_predecessor_bcwv_successor_left_table_row_step)) * bcf_previous_scale_bcwv_successor_left_table)) /\ exists bcf_quotient_bcwv_successor_left_table_row_step_previous_left. bcf_previous_code_bcwv_successor_left_table = bcf_quotient_bcwv_successor_left_table_row_step_previous_left * S ((S (bcf_predecessor_bcwv_successor_left_table_row_step)) * bcf_previous_scale_bcwv_successor_left_table) + (bcf_left_bcwv_successor_left_table_row_step))) /\ ((((exists bcf_height_bcwv_successor_left_table_row_step_previous_right. bcf_height_bcwv_successor_left_table_row_step_previous_right + S (bcf_right_bcwv_successor_left_table_row_step) = S ((S (S (bcf_predecessor_bcwv_successor_left_table_row_step))) * bcf_previous_scale_bcwv_successor_left_table)) /\ exists bcf_quotient_bcwv_successor_left_table_row_step_previous_right. bcf_previous_code_bcwv_successor_left_table = bcf_quotient_bcwv_successor_left_table_row_step_previous_right * S ((S (S (bcf_predecessor_bcwv_successor_left_table_row_step))) * bcf_previous_scale_bcwv_successor_left_table) + (bcf_right_bcwv_successor_left_table_row_step))) /\ bcf_value_bcwv_successor_left_table_row_step = bcf_left_bcwv_successor_left_table_row_step + bcf_right_bcwv_successor_left_table_row_step))))))))))) /\ ((((exists bcf_height_bcwv_successor_left_decoded_row_code. bcf_height_bcwv_successor_left_decoded_row_code + S (bcf_row_code_bcwv_successor_left) = S ((S (S n)) * bcf_row_code_scale_bcwv_successor_left)) /\ exists bcf_quotient_bcwv_successor_left_decoded_row_code. bcf_row_code_code_bcwv_successor_left = bcf_quotient_bcwv_successor_left_decoded_row_code * S ((S (S n)) * bcf_row_code_scale_bcwv_successor_left) + (bcf_row_code_bcwv_successor_left))) /\ ((((exists bcf_height_bcwv_successor_left_decoded_row_scale. bcf_height_bcwv_successor_left_decoded_row_scale + S (bcf_row_scale_bcwv_successor_left) = S ((S (S n)) * bcf_row_scale_scale_bcwv_successor_left)) /\ exists bcf_quotient_bcwv_successor_left_decoded_row_scale. bcf_row_scale_code_bcwv_successor_left = bcf_quotient_bcwv_successor_left_decoded_row_scale * S ((S (S n)) * bcf_row_scale_scale_bcwv_successor_left) + (bcf_row_scale_bcwv_successor_left))) /\ (((exists bcf_height_bcwv_successor_left_decoded_value. bcf_height_bcwv_successor_left_decoded_value + S (c) = S ((S (k)) * bcf_row_scale_bcwv_successor_left)) /\ exists bcf_quotient_bcwv_successor_left_decoded_value. bcf_row_code_bcwv_successor_left = bcf_quotient_bcwv_successor_left_decoded_value * S ((S (k)) * bcf_row_scale_bcwv_successor_left) + (c)))))))))
  186. 0186specialize choose_exists (S n)
  187. 0187specialize choose_exists k
  188. 0188exact choose_exists
  189. 0189cases hc_exists
  190. 0190rewrite zero_or_succ_right_witness at hsum
  191. 0191have hsecond_complement : S k + x1 = n
  192. 0192apply PA2
  193. 0193trans S k + S x1
  194. 0194symm
  195. 0195apply PA4
  196. 0196exact hsum
  197. 0197have hfirst_complement : k + S x1 = n
  198. 0198trans S (k + x1)
  199. 0199apply PA4
  200. 0200trans S k + x1
  201. 0201symm
  202. 0202apply add_succ_left
  203. 0203exact hsecond_complement
  204. 0204have hx_sum : x = x2 + x3
  205. 0205specialize choose_succ_succ n
  206. 0206specialize choose_succ_succ k
  207. 0207specialize choose_succ_succ x2
  208. 0208specialize choose_succ_succ x3
  209. 0209specialize choose_succ_succ x
  210. 0210apply choose_succ_succ
  211. 0211exact ha_exists_witness
  212. 0212exact hb_exists_witness
  213. 0213exact hlower
  214. 0214have hy_sum : y = x4 + x
  215. 0215specialize choose_succ_succ (S n)
  216. 0216specialize choose_succ_succ k
  217. 0217specialize choose_succ_succ x4
  218. 0218specialize choose_succ_succ x
  219. 0219specialize choose_succ_succ y
  220. 0220apply choose_succ_succ
  221. 0221exact hc_exists_witness
  222. 0222exact hlower
  223. 0223exact hupper
  224. 0224have hfirst_weight : S (S x1) * x4 = S n * x2
  225. 0225specialize IH k
  226. 0226specialize IH (S x1)
  227. 0227specialize IH x2
  228. 0228specialize IH x4
  229. 0229apply IH
  230. 0230exact hfirst_complement
  231. 0231exact ha_exists_witness
  232. 0232exact hc_exists_witness
  233. 0233have hsecond_weight : S x1 * x = S n * x3
  234. 0234specialize IH (S k)
  235. 0235specialize IH x1
  236. 0236specialize IH x3
  237. 0237specialize IH x
  238. 0238apply IH
  239. 0239exact hsecond_complement
  240. 0240exact hb_exists_witness
  241. 0241exact hlower
  242. 0242rewrite zero_or_succ_right_witness
  243. 0243trans S (S x1) * (x4 + x)
  244. 0244congr
  245. 0245refl
  246. 0246exact hy_sum
  247. 0247trans S (S x1) * x4 + S (S x1) * x
  248. 0248apply mul_add
  249. 0249trans S n * x2 + (S x1 * x + x)
  250. 0250congr
  251. 0251exact hfirst_weight
  252. 0252specialize mul_succ_left (S x1)
  253. 0253specialize mul_succ_left x
  254. 0254apply mul_succ_left
  255. 0255trans S n * x2 + (S n * x3 + x)
  256. 0256congr
  257. 0257refl
  258. 0258congr
  259. 0259exact hsecond_weight
  260. 0260refl
  261. 0261trans (S n * x2 + S n * x3) + x
  262. 0262specialize add_assoc (S n * x2)
  263. 0263specialize add_assoc (S n * x3)
  264. 0264specialize add_assoc x
  265. 0265symm
  266. 0266apply add_assoc
  267. 0267trans S n * (x2 + x3) + x
  268. 0268congr
  269. 0269specialize mul_add (S n)
  270. 0270specialize mul_add x2
  271. 0271specialize mul_add x3
  272. 0272symm
  273. 0273apply mul_add
  274. 0274refl
  275. 0275trans S n * x + x
  276. 0276congr
  277. 0277congr
  278. 0278refl
  279. 0279symm
  280. 0280exact hx_sum
  281. 0281refl
  282. 0282specialize mul_succ_left (S n)
  283. 0283specialize mul_succ_left x
  284. 0284symm
  285. 0285exact mul_succ_left