KU000C · theorem body

kummer_binomial_carry_bit_count

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

Kummer's theorem: the valuation of C(a+b,a) is the number of base-p addition carries.

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

∀ p. ∀ a. ∀ b. ∀ C. ∀ v. Prime(p)Choose(a + b,a,C)PowerValuation(p,C,v) → ∃ x. ∃ y. ∃ z. ∃ n. ∃ m. ∃ k. ∃ i. ∃ j. PowerQuotPrefix(p,a,x,y,a + b) ∧ (PowerQuotPrefix(p,b,z,n,a + b) ∧ (PowerQuotPrefix(p,a + b,m,k,a + b) ∧ ((∀ u. Lt(u,a + b) → ∃ w. ∃ x0. ∃ x1. ∃ x2. BetaAt(x,y,u,w) ∧ (BetaAt(z,n,u,x0) ∧ (BetaAt(m,k,u,x1) ∧ (BetaAt(i,j,u,x2) ∧ (x2 = 0 ∧ x1 = w + x0 ∨ x2 = 1 ∧ x1 = S (w + x0)))))) ∧ BitCount(i,j,a + b,v))))

Every purple notation token opens its conservative definition. This reading surface never changes the unchanged intuitionistic kernel or confers checked-use authority.

Definitions used by this theorem

In the theorem statement

In local proof propositions

Exact expanded first-order statement
forall p a b C v. ((~(p = 1) /\ forall frm_prime_left_kmckbc_prime frm_prime_right_kmckbc_prime. p = frm_prime_left_kmckbc_prime * frm_prime_right_kmckbc_prime -> frm_prime_left_kmckbc_prime = 1 \/ frm_prime_right_kmckbc_prime = 1)) -> (((exists bcf_lt_gap_kmckbc_choose_out_of_range. bcf_lt_gap_kmckbc_choose_out_of_range + S (a + b) = a) /\ C = 0) \/ ((exists bcf_le_gap_kmckbc_choose_in_range. bcf_le_gap_kmckbc_choose_in_range + (a) = a + b) /\ (exists bcf_row_code_code_kmckbc_choose bcf_row_code_scale_kmckbc_choose bcf_row_scale_code_kmckbc_choose bcf_row_scale_scale_kmckbc_choose bcf_row_code_kmckbc_choose bcf_row_scale_kmckbc_choose. ((forall bcf_row_index_kmckbc_choose_table. (exists bcf_lt_gap_kmckbc_choose_table_row_bound. bcf_lt_gap_kmckbc_choose_table_row_bound + S (bcf_row_index_kmckbc_choose_table) = S (a + b)) -> exists bcf_row_code_kmckbc_choose_table bcf_row_scale_kmckbc_choose_table. ((((exists bcf_height_kmckbc_choose_table_decoded_row_code. bcf_height_kmckbc_choose_table_decoded_row_code + S (bcf_row_code_kmckbc_choose_table) = S ((S (bcf_row_index_kmckbc_choose_table)) * bcf_row_code_scale_kmckbc_choose)) /\ exists bcf_quotient_kmckbc_choose_table_decoded_row_code. bcf_row_code_code_kmckbc_choose = bcf_quotient_kmckbc_choose_table_decoded_row_code * S ((S (bcf_row_index_kmckbc_choose_table)) * bcf_row_code_scale_kmckbc_choose) + (bcf_row_code_kmckbc_choose_table))) /\ ((((exists bcf_height_kmckbc_choose_table_decoded_row_scale. bcf_height_kmckbc_choose_table_decoded_row_scale + S (bcf_row_scale_kmckbc_choose_table) = S ((S (bcf_row_index_kmckbc_choose_table)) * bcf_row_scale_scale_kmckbc_choose)) /\ exists bcf_quotient_kmckbc_choose_table_decoded_row_scale. bcf_row_scale_code_kmckbc_choose = bcf_quotient_kmckbc_choose_table_decoded_row_scale * S ((S (bcf_row_index_kmckbc_choose_table)) * bcf_row_scale_scale_kmckbc_choose) + (bcf_row_scale_kmckbc_choose_table))) /\ ((bcf_row_index_kmckbc_choose_table = 0 /\ (forall bcf_index_kmckbc_choose_table_zero_row. (exists bcf_lt_gap_kmckbc_choose_table_zero_row_bound. bcf_lt_gap_kmckbc_choose_table_zero_row_bound + S (bcf_index_kmckbc_choose_table_zero_row) = S (a + b)) -> exists bcf_value_kmckbc_choose_table_zero_row. ((((exists bcf_height_kmckbc_choose_table_zero_row_entry. bcf_height_kmckbc_choose_table_zero_row_entry + S (bcf_value_kmckbc_choose_table_zero_row) = S ((S (bcf_index_kmckbc_choose_table_zero_row)) * bcf_row_scale_kmckbc_choose_table)) /\ exists bcf_quotient_kmckbc_choose_table_zero_row_entry. bcf_row_code_kmckbc_choose_table = bcf_quotient_kmckbc_choose_table_zero_row_entry * S ((S (bcf_index_kmckbc_choose_table_zero_row)) * bcf_row_scale_kmckbc_choose_table) + (bcf_value_kmckbc_choose_table_zero_row))) /\ ((bcf_index_kmckbc_choose_table_zero_row = 0 /\ bcf_value_kmckbc_choose_table_zero_row = 1) \/ exists bcf_predecessor_kmckbc_choose_table_zero_row. bcf_index_kmckbc_choose_table_zero_row = S bcf_predecessor_kmckbc_choose_table_zero_row /\ bcf_value_kmckbc_choose_table_zero_row = 0)))) \/ exists bcf_predecessor_kmckbc_choose_table bcf_previous_code_kmckbc_choose_table bcf_previous_scale_kmckbc_choose_table. bcf_row_index_kmckbc_choose_table = S bcf_predecessor_kmckbc_choose_table /\ ((((exists bcf_height_kmckbc_choose_table_decoded_previous_code. bcf_height_kmckbc_choose_table_decoded_previous_code + S (bcf_previous_code_kmckbc_choose_table) = S ((S (bcf_predecessor_kmckbc_choose_table)) * bcf_row_code_scale_kmckbc_choose)) /\ exists bcf_quotient_kmckbc_choose_table_decoded_previous_code. bcf_row_code_code_kmckbc_choose = bcf_quotient_kmckbc_choose_table_decoded_previous_code * S ((S (bcf_predecessor_kmckbc_choose_table)) * bcf_row_code_scale_kmckbc_choose) + (bcf_previous_code_kmckbc_choose_table))) /\ ((((exists bcf_height_kmckbc_choose_table_decoded_previous_scale. bcf_height_kmckbc_choose_table_decoded_previous_scale + S (bcf_previous_scale_kmckbc_choose_table) = S ((S (bcf_predecessor_kmckbc_choose_table)) * bcf_row_scale_scale_kmckbc_choose)) /\ exists bcf_quotient_kmckbc_choose_table_decoded_previous_scale. bcf_row_scale_code_kmckbc_choose = bcf_quotient_kmckbc_choose_table_decoded_previous_scale * S ((S (bcf_predecessor_kmckbc_choose_table)) * bcf_row_scale_scale_kmckbc_choose) + (bcf_previous_scale_kmckbc_choose_table))) /\ (forall bcf_index_kmckbc_choose_table_row_step. (exists bcf_lt_gap_kmckbc_choose_table_row_step_bound. bcf_lt_gap_kmckbc_choose_table_row_step_bound + S (bcf_index_kmckbc_choose_table_row_step) = S (a + b)) -> exists bcf_value_kmckbc_choose_table_row_step. ((((exists bcf_height_kmckbc_choose_table_row_step_entry. bcf_height_kmckbc_choose_table_row_step_entry + S (bcf_value_kmckbc_choose_table_row_step) = S ((S (bcf_index_kmckbc_choose_table_row_step)) * bcf_row_scale_kmckbc_choose_table)) /\ exists bcf_quotient_kmckbc_choose_table_row_step_entry. bcf_row_code_kmckbc_choose_table = bcf_quotient_kmckbc_choose_table_row_step_entry * S ((S (bcf_index_kmckbc_choose_table_row_step)) * bcf_row_scale_kmckbc_choose_table) + (bcf_value_kmckbc_choose_table_row_step))) /\ ((bcf_index_kmckbc_choose_table_row_step = 0 /\ bcf_value_kmckbc_choose_table_row_step = 1) \/ exists bcf_predecessor_kmckbc_choose_table_row_step bcf_left_kmckbc_choose_table_row_step bcf_right_kmckbc_choose_table_row_step. bcf_index_kmckbc_choose_table_row_step = S bcf_predecessor_kmckbc_choose_table_row_step /\ ((((exists bcf_height_kmckbc_choose_table_row_step_previous_left. bcf_height_kmckbc_choose_table_row_step_previous_left + S (bcf_left_kmckbc_choose_table_row_step) = S ((S (bcf_predecessor_kmckbc_choose_table_row_step)) * bcf_previous_scale_kmckbc_choose_table)) /\ exists bcf_quotient_kmckbc_choose_table_row_step_previous_left. bcf_previous_code_kmckbc_choose_table = bcf_quotient_kmckbc_choose_table_row_step_previous_left * S ((S (bcf_predecessor_kmckbc_choose_table_row_step)) * bcf_previous_scale_kmckbc_choose_table) + (bcf_left_kmckbc_choose_table_row_step))) /\ ((((exists bcf_height_kmckbc_choose_table_row_step_previous_right. bcf_height_kmckbc_choose_table_row_step_previous_right + S (bcf_right_kmckbc_choose_table_row_step) = S ((S (S (bcf_predecessor_kmckbc_choose_table_row_step))) * bcf_previous_scale_kmckbc_choose_table)) /\ exists bcf_quotient_kmckbc_choose_table_row_step_previous_right. bcf_previous_code_kmckbc_choose_table = bcf_quotient_kmckbc_choose_table_row_step_previous_right * S ((S (S (bcf_predecessor_kmckbc_choose_table_row_step))) * bcf_previous_scale_kmckbc_choose_table) + (bcf_right_kmckbc_choose_table_row_step))) /\ bcf_value_kmckbc_choose_table_row_step = bcf_left_kmckbc_choose_table_row_step + bcf_right_kmckbc_choose_table_row_step))))))))))) /\ ((((exists bcf_height_kmckbc_choose_decoded_row_code. bcf_height_kmckbc_choose_decoded_row_code + S (bcf_row_code_kmckbc_choose) = S ((S (a + b)) * bcf_row_code_scale_kmckbc_choose)) /\ exists bcf_quotient_kmckbc_choose_decoded_row_code. bcf_row_code_code_kmckbc_choose = bcf_quotient_kmckbc_choose_decoded_row_code * S ((S (a + b)) * bcf_row_code_scale_kmckbc_choose) + (bcf_row_code_kmckbc_choose))) /\ ((((exists bcf_height_kmckbc_choose_decoded_row_scale. bcf_height_kmckbc_choose_decoded_row_scale + S (bcf_row_scale_kmckbc_choose) = S ((S (a + b)) * bcf_row_scale_scale_kmckbc_choose)) /\ exists bcf_quotient_kmckbc_choose_decoded_row_scale. bcf_row_scale_code_kmckbc_choose = bcf_quotient_kmckbc_choose_decoded_row_scale * S ((S (a + b)) * bcf_row_scale_scale_kmckbc_choose) + (bcf_row_scale_kmckbc_choose))) /\ (((exists bcf_height_kmckbc_choose_decoded_value. bcf_height_kmckbc_choose_decoded_value + S (C) = S ((S (a)) * bcf_row_scale_kmckbc_choose)) /\ exists bcf_quotient_kmckbc_choose_decoded_value. bcf_row_code_kmckbc_choose = bcf_quotient_kmckbc_choose_decoded_value * S ((S (a)) * bcf_row_scale_kmckbc_choose) + (C))))))))) -> (((exists bpv_gap_kmckbc_valuation_exponent_bound. bpv_gap_kmckbc_valuation_exponent_bound + v = C) /\ (exists bpv_result_kmckbc_valuation_selected. ((exists ff_b_kmckbc_valuation_selected_power ff_c_kmckbc_valuation_selected_power. ((forall ff_i_kmckbc_valuation_selected_power_repeat. (exists ff_lt_kmckbc_valuation_selected_power_repeat_bound. ff_lt_kmckbc_valuation_selected_power_repeat_bound + S ff_i_kmckbc_valuation_selected_power_repeat = v) -> (((exists ff_h_kmckbc_valuation_selected_power_repeat_decoded. ff_h_kmckbc_valuation_selected_power_repeat_decoded + S (p) = S ((S (ff_i_kmckbc_valuation_selected_power_repeat)) * ff_c_kmckbc_valuation_selected_power)) /\ exists ff_q_kmckbc_valuation_selected_power_repeat_decoded. ff_b_kmckbc_valuation_selected_power = ff_q_kmckbc_valuation_selected_power_repeat_decoded * S ((S (ff_i_kmckbc_valuation_selected_power_repeat)) * ff_c_kmckbc_valuation_selected_power) + (p)))) /\ (exists ff_u_kmckbc_valuation_selected_power_product ff_v_kmckbc_valuation_selected_power_product. ((((exists ff_h_kmckbc_valuation_selected_power_product_start. ff_h_kmckbc_valuation_selected_power_product_start + S (1) = S ((S (0)) * ff_v_kmckbc_valuation_selected_power_product)) /\ exists ff_q_kmckbc_valuation_selected_power_product_start. ff_u_kmckbc_valuation_selected_power_product = ff_q_kmckbc_valuation_selected_power_product_start * S ((S (0)) * ff_v_kmckbc_valuation_selected_power_product) + (1))) /\ ((((exists ff_h_kmckbc_valuation_selected_power_product_terminal. ff_h_kmckbc_valuation_selected_power_product_terminal + S (bpv_result_kmckbc_valuation_selected) = S ((S (v)) * ff_v_kmckbc_valuation_selected_power_product)) /\ exists ff_q_kmckbc_valuation_selected_power_product_terminal. ff_u_kmckbc_valuation_selected_power_product = ff_q_kmckbc_valuation_selected_power_product_terminal * S ((S (v)) * ff_v_kmckbc_valuation_selected_power_product) + (bpv_result_kmckbc_valuation_selected))) /\ forall ff_i_kmckbc_valuation_selected_power_product. (exists ff_lt_kmckbc_valuation_selected_power_product_bound. ff_lt_kmckbc_valuation_selected_power_product_bound + S ff_i_kmckbc_valuation_selected_power_product = v) -> exists ff_p_kmckbc_valuation_selected_power_product ff_r_kmckbc_valuation_selected_power_product ff_s_kmckbc_valuation_selected_power_product. ((((exists ff_h_kmckbc_valuation_selected_power_product_factor. ff_h_kmckbc_valuation_selected_power_product_factor + S (ff_p_kmckbc_valuation_selected_power_product) = S ((S (ff_i_kmckbc_valuation_selected_power_product)) * ff_c_kmckbc_valuation_selected_power)) /\ exists ff_q_kmckbc_valuation_selected_power_product_factor. ff_b_kmckbc_valuation_selected_power = ff_q_kmckbc_valuation_selected_power_product_factor * S ((S (ff_i_kmckbc_valuation_selected_power_product)) * ff_c_kmckbc_valuation_selected_power) + (ff_p_kmckbc_valuation_selected_power_product))) /\ ((((exists ff_h_kmckbc_valuation_selected_power_product_partial. ff_h_kmckbc_valuation_selected_power_product_partial + S (ff_r_kmckbc_valuation_selected_power_product) = S ((S (ff_i_kmckbc_valuation_selected_power_product)) * ff_v_kmckbc_valuation_selected_power_product)) /\ exists ff_q_kmckbc_valuation_selected_power_product_partial. ff_u_kmckbc_valuation_selected_power_product = ff_q_kmckbc_valuation_selected_power_product_partial * S ((S (ff_i_kmckbc_valuation_selected_power_product)) * ff_v_kmckbc_valuation_selected_power_product) + (ff_r_kmckbc_valuation_selected_power_product))) /\ ((((exists ff_h_kmckbc_valuation_selected_power_product_successor. ff_h_kmckbc_valuation_selected_power_product_successor + S (ff_s_kmckbc_valuation_selected_power_product) = S ((S (S ff_i_kmckbc_valuation_selected_power_product)) * ff_v_kmckbc_valuation_selected_power_product)) /\ exists ff_q_kmckbc_valuation_selected_power_product_successor. ff_u_kmckbc_valuation_selected_power_product = ff_q_kmckbc_valuation_selected_power_product_successor * S ((S (S ff_i_kmckbc_valuation_selected_power_product)) * ff_v_kmckbc_valuation_selected_power_product) + (ff_s_kmckbc_valuation_selected_power_product))) /\ ff_s_kmckbc_valuation_selected_power_product = ff_r_kmckbc_valuation_selected_power_product * ff_p_kmckbc_valuation_selected_power_product)))))))) /\ (exists bpv_factor_kmckbc_valuation_selected_divides. C = bpv_result_kmckbc_valuation_selected * bpv_factor_kmckbc_valuation_selected_divides)))) /\ forall bpv_candidate_kmckbc_valuation. (exists bpv_gap_kmckbc_valuation_candidate_bound. bpv_gap_kmckbc_valuation_candidate_bound + bpv_candidate_kmckbc_valuation = C) -> (exists bpv_result_kmckbc_valuation_candidate. ((exists ff_b_kmckbc_valuation_candidate_power ff_c_kmckbc_valuation_candidate_power. ((forall ff_i_kmckbc_valuation_candidate_power_repeat. (exists ff_lt_kmckbc_valuation_candidate_power_repeat_bound. ff_lt_kmckbc_valuation_candidate_power_repeat_bound + S ff_i_kmckbc_valuation_candidate_power_repeat = bpv_candidate_kmckbc_valuation) -> (((exists ff_h_kmckbc_valuation_candidate_power_repeat_decoded. ff_h_kmckbc_valuation_candidate_power_repeat_decoded + S (p) = S ((S (ff_i_kmckbc_valuation_candidate_power_repeat)) * ff_c_kmckbc_valuation_candidate_power)) /\ exists ff_q_kmckbc_valuation_candidate_power_repeat_decoded. ff_b_kmckbc_valuation_candidate_power = ff_q_kmckbc_valuation_candidate_power_repeat_decoded * S ((S (ff_i_kmckbc_valuation_candidate_power_repeat)) * ff_c_kmckbc_valuation_candidate_power) + (p)))) /\ (exists ff_u_kmckbc_valuation_candidate_power_product ff_v_kmckbc_valuation_candidate_power_product. ((((exists ff_h_kmckbc_valuation_candidate_power_product_start. ff_h_kmckbc_valuation_candidate_power_product_start + S (1) = S ((S (0)) * ff_v_kmckbc_valuation_candidate_power_product)) /\ exists ff_q_kmckbc_valuation_candidate_power_product_start. ff_u_kmckbc_valuation_candidate_power_product = ff_q_kmckbc_valuation_candidate_power_product_start * S ((S (0)) * ff_v_kmckbc_valuation_candidate_power_product) + (1))) /\ ((((exists ff_h_kmckbc_valuation_candidate_power_product_terminal. ff_h_kmckbc_valuation_candidate_power_product_terminal + S (bpv_result_kmckbc_valuation_candidate) = S ((S (bpv_candidate_kmckbc_valuation)) * ff_v_kmckbc_valuation_candidate_power_product)) /\ exists ff_q_kmckbc_valuation_candidate_power_product_terminal. ff_u_kmckbc_valuation_candidate_power_product = ff_q_kmckbc_valuation_candidate_power_product_terminal * S ((S (bpv_candidate_kmckbc_valuation)) * ff_v_kmckbc_valuation_candidate_power_product) + (bpv_result_kmckbc_valuation_candidate))) /\ forall ff_i_kmckbc_valuation_candidate_power_product. (exists ff_lt_kmckbc_valuation_candidate_power_product_bound. ff_lt_kmckbc_valuation_candidate_power_product_bound + S ff_i_kmckbc_valuation_candidate_power_product = bpv_candidate_kmckbc_valuation) -> exists ff_p_kmckbc_valuation_candidate_power_product ff_r_kmckbc_valuation_candidate_power_product ff_s_kmckbc_valuation_candidate_power_product. ((((exists ff_h_kmckbc_valuation_candidate_power_product_factor. ff_h_kmckbc_valuation_candidate_power_product_factor + S (ff_p_kmckbc_valuation_candidate_power_product) = S ((S (ff_i_kmckbc_valuation_candidate_power_product)) * ff_c_kmckbc_valuation_candidate_power)) /\ exists ff_q_kmckbc_valuation_candidate_power_product_factor. ff_b_kmckbc_valuation_candidate_power = ff_q_kmckbc_valuation_candidate_power_product_factor * S ((S (ff_i_kmckbc_valuation_candidate_power_product)) * ff_c_kmckbc_valuation_candidate_power) + (ff_p_kmckbc_valuation_candidate_power_product))) /\ ((((exists ff_h_kmckbc_valuation_candidate_power_product_partial. ff_h_kmckbc_valuation_candidate_power_product_partial + S (ff_r_kmckbc_valuation_candidate_power_product) = S ((S (ff_i_kmckbc_valuation_candidate_power_product)) * ff_v_kmckbc_valuation_candidate_power_product)) /\ exists ff_q_kmckbc_valuation_candidate_power_product_partial. ff_u_kmckbc_valuation_candidate_power_product = ff_q_kmckbc_valuation_candidate_power_product_partial * S ((S (ff_i_kmckbc_valuation_candidate_power_product)) * ff_v_kmckbc_valuation_candidate_power_product) + (ff_r_kmckbc_valuation_candidate_power_product))) /\ ((((exists ff_h_kmckbc_valuation_candidate_power_product_successor. ff_h_kmckbc_valuation_candidate_power_product_successor + S (ff_s_kmckbc_valuation_candidate_power_product) = S ((S (S ff_i_kmckbc_valuation_candidate_power_product)) * ff_v_kmckbc_valuation_candidate_power_product)) /\ exists ff_q_kmckbc_valuation_candidate_power_product_successor. ff_u_kmckbc_valuation_candidate_power_product = ff_q_kmckbc_valuation_candidate_power_product_successor * S ((S (S ff_i_kmckbc_valuation_candidate_power_product)) * ff_v_kmckbc_valuation_candidate_power_product) + (ff_s_kmckbc_valuation_candidate_power_product))) /\ ff_s_kmckbc_valuation_candidate_power_product = ff_r_kmckbc_valuation_candidate_power_product * ff_p_kmckbc_valuation_candidate_power_product)))))))) /\ (exists bpv_factor_kmckbc_valuation_candidate_divides. C = bpv_result_kmckbc_valuation_candidate * bpv_factor_kmckbc_valuation_candidate_divides))) -> (exists bpv_gap_kmckbc_valuation_maximal. bpv_gap_kmckbc_valuation_maximal + bpv_candidate_kmckbc_valuation = v)) -> exists lb lc rb rc tb tc cb cc. (forall bls_index_kmckbc_left. (exists bls_gap_kmckbc_left_bound. bls_gap_kmckbc_left_bound + S (bls_index_kmckbc_left) = (a + b)) -> exists bls_power_kmckbc_left bls_quotient_kmckbc_left bls_remainder_kmckbc_left. ((exists bpvi_b_bls_kmckbc_left_power bpvi_c_bls_kmckbc_left_power. ((forall bpvi_i_bls_kmckbc_left_power. (exists bpvi_repeat_gap_bls_kmckbc_left_power. bpvi_repeat_gap_bls_kmckbc_left_power + S bpvi_i_bls_kmckbc_left_power = S bls_index_kmckbc_left) -> (((exists bpvi_h_bls_kmckbc_left_power_repeat. bpvi_h_bls_kmckbc_left_power_repeat + S (p) = S ((S (bpvi_i_bls_kmckbc_left_power)) * bpvi_c_bls_kmckbc_left_power)) /\ exists bpvi_q_bls_kmckbc_left_power_repeat. bpvi_b_bls_kmckbc_left_power = bpvi_q_bls_kmckbc_left_power_repeat * S ((S (bpvi_i_bls_kmckbc_left_power)) * bpvi_c_bls_kmckbc_left_power) + (p)))) /\ (exists bpvi_u_bls_kmckbc_left_power bpvi_v_bls_kmckbc_left_power. ((((exists bpvi_h_bls_kmckbc_left_power_start. bpvi_h_bls_kmckbc_left_power_start + S (1) = S ((S (0)) * bpvi_v_bls_kmckbc_left_power)) /\ exists bpvi_q_bls_kmckbc_left_power_start. bpvi_u_bls_kmckbc_left_power = bpvi_q_bls_kmckbc_left_power_start * S ((S (0)) * bpvi_v_bls_kmckbc_left_power) + (1))) /\ ((((exists bpvi_h_bls_kmckbc_left_power_terminal. bpvi_h_bls_kmckbc_left_power_terminal + S (bls_power_kmckbc_left) = S ((S (S bls_index_kmckbc_left)) * bpvi_v_bls_kmckbc_left_power)) /\ exists bpvi_q_bls_kmckbc_left_power_terminal. bpvi_u_bls_kmckbc_left_power = bpvi_q_bls_kmckbc_left_power_terminal * S ((S (S bls_index_kmckbc_left)) * bpvi_v_bls_kmckbc_left_power) + (bls_power_kmckbc_left))) /\ forall bpvi_j_bls_kmckbc_left_power. (exists bpvi_product_gap_bls_kmckbc_left_power. bpvi_product_gap_bls_kmckbc_left_power + S bpvi_j_bls_kmckbc_left_power = S bls_index_kmckbc_left) -> exists bpvi_factor_bls_kmckbc_left_power bpvi_partial_bls_kmckbc_left_power bpvi_successor_bls_kmckbc_left_power. ((((exists bpvi_h_bls_kmckbc_left_power_factor. bpvi_h_bls_kmckbc_left_power_factor + S (bpvi_factor_bls_kmckbc_left_power) = S ((S (bpvi_j_bls_kmckbc_left_power)) * bpvi_c_bls_kmckbc_left_power)) /\ exists bpvi_q_bls_kmckbc_left_power_factor. bpvi_b_bls_kmckbc_left_power = bpvi_q_bls_kmckbc_left_power_factor * S ((S (bpvi_j_bls_kmckbc_left_power)) * bpvi_c_bls_kmckbc_left_power) + (bpvi_factor_bls_kmckbc_left_power))) /\ ((((exists bpvi_h_bls_kmckbc_left_power_partial. bpvi_h_bls_kmckbc_left_power_partial + S (bpvi_partial_bls_kmckbc_left_power) = S ((S (bpvi_j_bls_kmckbc_left_power)) * bpvi_v_bls_kmckbc_left_power)) /\ exists bpvi_q_bls_kmckbc_left_power_partial. bpvi_u_bls_kmckbc_left_power = bpvi_q_bls_kmckbc_left_power_partial * S ((S (bpvi_j_bls_kmckbc_left_power)) * bpvi_v_bls_kmckbc_left_power) + (bpvi_partial_bls_kmckbc_left_power))) /\ ((((exists bpvi_h_bls_kmckbc_left_power_successor. bpvi_h_bls_kmckbc_left_power_successor + S (bpvi_successor_bls_kmckbc_left_power) = S ((S (S bpvi_j_bls_kmckbc_left_power)) * bpvi_v_bls_kmckbc_left_power)) /\ exists bpvi_q_bls_kmckbc_left_power_successor. bpvi_u_bls_kmckbc_left_power = bpvi_q_bls_kmckbc_left_power_successor * S ((S (S bpvi_j_bls_kmckbc_left_power)) * bpvi_v_bls_kmckbc_left_power) + (bpvi_successor_bls_kmckbc_left_power))) /\ bpvi_successor_bls_kmckbc_left_power = bpvi_partial_bls_kmckbc_left_power * bpvi_factor_bls_kmckbc_left_power)))))))) /\ ((((exists ff_h_bls_kmckbc_left_quotient_entry. ff_h_bls_kmckbc_left_quotient_entry + S (bls_quotient_kmckbc_left) = S ((S (bls_index_kmckbc_left)) * lc)) /\ exists ff_q_bls_kmckbc_left_quotient_entry. lb = ff_q_bls_kmckbc_left_quotient_entry * S ((S (bls_index_kmckbc_left)) * lc) + (bls_quotient_kmckbc_left))) /\ ((a = bls_power_kmckbc_left * bls_quotient_kmckbc_left + bls_remainder_kmckbc_left /\ exists bls_remainder_gap_kmckbc_left_division. bls_remainder_gap_kmckbc_left_division + S (bls_remainder_kmckbc_left) = bls_power_kmckbc_left))))) /\ ((forall bls_index_kmckbc_right. (exists bls_gap_kmckbc_right_bound. bls_gap_kmckbc_right_bound + S (bls_index_kmckbc_right) = (a + b)) -> exists bls_power_kmckbc_right bls_quotient_kmckbc_right bls_remainder_kmckbc_right. ((exists bpvi_b_bls_kmckbc_right_power bpvi_c_bls_kmckbc_right_power. ((forall bpvi_i_bls_kmckbc_right_power. (exists bpvi_repeat_gap_bls_kmckbc_right_power. bpvi_repeat_gap_bls_kmckbc_right_power + S bpvi_i_bls_kmckbc_right_power = S bls_index_kmckbc_right) -> (((exists bpvi_h_bls_kmckbc_right_power_repeat. bpvi_h_bls_kmckbc_right_power_repeat + S (p) = S ((S (bpvi_i_bls_kmckbc_right_power)) * bpvi_c_bls_kmckbc_right_power)) /\ exists bpvi_q_bls_kmckbc_right_power_repeat. bpvi_b_bls_kmckbc_right_power = bpvi_q_bls_kmckbc_right_power_repeat * S ((S (bpvi_i_bls_kmckbc_right_power)) * bpvi_c_bls_kmckbc_right_power) + (p)))) /\ (exists bpvi_u_bls_kmckbc_right_power bpvi_v_bls_kmckbc_right_power. ((((exists bpvi_h_bls_kmckbc_right_power_start. bpvi_h_bls_kmckbc_right_power_start + S (1) = S ((S (0)) * bpvi_v_bls_kmckbc_right_power)) /\ exists bpvi_q_bls_kmckbc_right_power_start. bpvi_u_bls_kmckbc_right_power = bpvi_q_bls_kmckbc_right_power_start * S ((S (0)) * bpvi_v_bls_kmckbc_right_power) + (1))) /\ ((((exists bpvi_h_bls_kmckbc_right_power_terminal. bpvi_h_bls_kmckbc_right_power_terminal + S (bls_power_kmckbc_right) = S ((S (S bls_index_kmckbc_right)) * bpvi_v_bls_kmckbc_right_power)) /\ exists bpvi_q_bls_kmckbc_right_power_terminal. bpvi_u_bls_kmckbc_right_power = bpvi_q_bls_kmckbc_right_power_terminal * S ((S (S bls_index_kmckbc_right)) * bpvi_v_bls_kmckbc_right_power) + (bls_power_kmckbc_right))) /\ forall bpvi_j_bls_kmckbc_right_power. (exists bpvi_product_gap_bls_kmckbc_right_power. bpvi_product_gap_bls_kmckbc_right_power + S bpvi_j_bls_kmckbc_right_power = S bls_index_kmckbc_right) -> exists bpvi_factor_bls_kmckbc_right_power bpvi_partial_bls_kmckbc_right_power bpvi_successor_bls_kmckbc_right_power. ((((exists bpvi_h_bls_kmckbc_right_power_factor. bpvi_h_bls_kmckbc_right_power_factor + S (bpvi_factor_bls_kmckbc_right_power) = S ((S (bpvi_j_bls_kmckbc_right_power)) * bpvi_c_bls_kmckbc_right_power)) /\ exists bpvi_q_bls_kmckbc_right_power_factor. bpvi_b_bls_kmckbc_right_power = bpvi_q_bls_kmckbc_right_power_factor * S ((S (bpvi_j_bls_kmckbc_right_power)) * bpvi_c_bls_kmckbc_right_power) + (bpvi_factor_bls_kmckbc_right_power))) /\ ((((exists bpvi_h_bls_kmckbc_right_power_partial. bpvi_h_bls_kmckbc_right_power_partial + S (bpvi_partial_bls_kmckbc_right_power) = S ((S (bpvi_j_bls_kmckbc_right_power)) * bpvi_v_bls_kmckbc_right_power)) /\ exists bpvi_q_bls_kmckbc_right_power_partial. bpvi_u_bls_kmckbc_right_power = bpvi_q_bls_kmckbc_right_power_partial * S ((S (bpvi_j_bls_kmckbc_right_power)) * bpvi_v_bls_kmckbc_right_power) + (bpvi_partial_bls_kmckbc_right_power))) /\ ((((exists bpvi_h_bls_kmckbc_right_power_successor. bpvi_h_bls_kmckbc_right_power_successor + S (bpvi_successor_bls_kmckbc_right_power) = S ((S (S bpvi_j_bls_kmckbc_right_power)) * bpvi_v_bls_kmckbc_right_power)) /\ exists bpvi_q_bls_kmckbc_right_power_successor. bpvi_u_bls_kmckbc_right_power = bpvi_q_bls_kmckbc_right_power_successor * S ((S (S bpvi_j_bls_kmckbc_right_power)) * bpvi_v_bls_kmckbc_right_power) + (bpvi_successor_bls_kmckbc_right_power))) /\ bpvi_successor_bls_kmckbc_right_power = bpvi_partial_bls_kmckbc_right_power * bpvi_factor_bls_kmckbc_right_power)))))))) /\ ((((exists ff_h_bls_kmckbc_right_quotient_entry. ff_h_bls_kmckbc_right_quotient_entry + S (bls_quotient_kmckbc_right) = S ((S (bls_index_kmckbc_right)) * rc)) /\ exists ff_q_bls_kmckbc_right_quotient_entry. rb = ff_q_bls_kmckbc_right_quotient_entry * S ((S (bls_index_kmckbc_right)) * rc) + (bls_quotient_kmckbc_right))) /\ ((b = bls_power_kmckbc_right * bls_quotient_kmckbc_right + bls_remainder_kmckbc_right /\ exists bls_remainder_gap_kmckbc_right_division. bls_remainder_gap_kmckbc_right_division + S (bls_remainder_kmckbc_right) = bls_power_kmckbc_right))))) /\ ((forall bls_index_kmckbc_total. (exists bls_gap_kmckbc_total_bound. bls_gap_kmckbc_total_bound + S (bls_index_kmckbc_total) = (a + b)) -> exists bls_power_kmckbc_total bls_quotient_kmckbc_total bls_remainder_kmckbc_total. ((exists bpvi_b_bls_kmckbc_total_power bpvi_c_bls_kmckbc_total_power. ((forall bpvi_i_bls_kmckbc_total_power. (exists bpvi_repeat_gap_bls_kmckbc_total_power. bpvi_repeat_gap_bls_kmckbc_total_power + S bpvi_i_bls_kmckbc_total_power = S bls_index_kmckbc_total) -> (((exists bpvi_h_bls_kmckbc_total_power_repeat. bpvi_h_bls_kmckbc_total_power_repeat + S (p) = S ((S (bpvi_i_bls_kmckbc_total_power)) * bpvi_c_bls_kmckbc_total_power)) /\ exists bpvi_q_bls_kmckbc_total_power_repeat. bpvi_b_bls_kmckbc_total_power = bpvi_q_bls_kmckbc_total_power_repeat * S ((S (bpvi_i_bls_kmckbc_total_power)) * bpvi_c_bls_kmckbc_total_power) + (p)))) /\ (exists bpvi_u_bls_kmckbc_total_power bpvi_v_bls_kmckbc_total_power. ((((exists bpvi_h_bls_kmckbc_total_power_start. bpvi_h_bls_kmckbc_total_power_start + S (1) = S ((S (0)) * bpvi_v_bls_kmckbc_total_power)) /\ exists bpvi_q_bls_kmckbc_total_power_start. bpvi_u_bls_kmckbc_total_power = bpvi_q_bls_kmckbc_total_power_start * S ((S (0)) * bpvi_v_bls_kmckbc_total_power) + (1))) /\ ((((exists bpvi_h_bls_kmckbc_total_power_terminal. bpvi_h_bls_kmckbc_total_power_terminal + S (bls_power_kmckbc_total) = S ((S (S bls_index_kmckbc_total)) * bpvi_v_bls_kmckbc_total_power)) /\ exists bpvi_q_bls_kmckbc_total_power_terminal. bpvi_u_bls_kmckbc_total_power = bpvi_q_bls_kmckbc_total_power_terminal * S ((S (S bls_index_kmckbc_total)) * bpvi_v_bls_kmckbc_total_power) + (bls_power_kmckbc_total))) /\ forall bpvi_j_bls_kmckbc_total_power. (exists bpvi_product_gap_bls_kmckbc_total_power. bpvi_product_gap_bls_kmckbc_total_power + S bpvi_j_bls_kmckbc_total_power = S bls_index_kmckbc_total) -> exists bpvi_factor_bls_kmckbc_total_power bpvi_partial_bls_kmckbc_total_power bpvi_successor_bls_kmckbc_total_power. ((((exists bpvi_h_bls_kmckbc_total_power_factor. bpvi_h_bls_kmckbc_total_power_factor + S (bpvi_factor_bls_kmckbc_total_power) = S ((S (bpvi_j_bls_kmckbc_total_power)) * bpvi_c_bls_kmckbc_total_power)) /\ exists bpvi_q_bls_kmckbc_total_power_factor. bpvi_b_bls_kmckbc_total_power = bpvi_q_bls_kmckbc_total_power_factor * S ((S (bpvi_j_bls_kmckbc_total_power)) * bpvi_c_bls_kmckbc_total_power) + (bpvi_factor_bls_kmckbc_total_power))) /\ ((((exists bpvi_h_bls_kmckbc_total_power_partial. bpvi_h_bls_kmckbc_total_power_partial + S (bpvi_partial_bls_kmckbc_total_power) = S ((S (bpvi_j_bls_kmckbc_total_power)) * bpvi_v_bls_kmckbc_total_power)) /\ exists bpvi_q_bls_kmckbc_total_power_partial. bpvi_u_bls_kmckbc_total_power = bpvi_q_bls_kmckbc_total_power_partial * S ((S (bpvi_j_bls_kmckbc_total_power)) * bpvi_v_bls_kmckbc_total_power) + (bpvi_partial_bls_kmckbc_total_power))) /\ ((((exists bpvi_h_bls_kmckbc_total_power_successor. bpvi_h_bls_kmckbc_total_power_successor + S (bpvi_successor_bls_kmckbc_total_power) = S ((S (S bpvi_j_bls_kmckbc_total_power)) * bpvi_v_bls_kmckbc_total_power)) /\ exists bpvi_q_bls_kmckbc_total_power_successor. bpvi_u_bls_kmckbc_total_power = bpvi_q_bls_kmckbc_total_power_successor * S ((S (S bpvi_j_bls_kmckbc_total_power)) * bpvi_v_bls_kmckbc_total_power) + (bpvi_successor_bls_kmckbc_total_power))) /\ bpvi_successor_bls_kmckbc_total_power = bpvi_partial_bls_kmckbc_total_power * bpvi_factor_bls_kmckbc_total_power)))))))) /\ ((((exists ff_h_bls_kmckbc_total_quotient_entry. ff_h_bls_kmckbc_total_quotient_entry + S (bls_quotient_kmckbc_total) = S ((S (bls_index_kmckbc_total)) * tc)) /\ exists ff_q_bls_kmckbc_total_quotient_entry. tb = ff_q_bls_kmckbc_total_quotient_entry * S ((S (bls_index_kmckbc_total)) * tc) + (bls_quotient_kmckbc_total))) /\ ((a + b = bls_power_kmckbc_total * bls_quotient_kmckbc_total + bls_remainder_kmckbc_total /\ exists bls_remainder_gap_kmckbc_total_division. bls_remainder_gap_kmckbc_total_division + S (bls_remainder_kmckbc_total) = bls_power_kmckbc_total))))) /\ ((forall kmc_index_kmckbc_carries. (exists bcf_lt_gap_kmckbc_carries_bound. bcf_lt_gap_kmckbc_carries_bound + S (kmc_index_kmckbc_carries) = a + b) -> exists kmc_left_kmckbc_carries kmc_right_kmckbc_carries kmc_total_kmckbc_carries kmc_bit_kmckbc_carries. (((exists fs_h_kmckbc_carries_left. fs_h_kmckbc_carries_left + S (kmc_left_kmckbc_carries) = S ((S (kmc_index_kmckbc_carries)) * lc)) /\ exists fs_q_kmckbc_carries_left. lb = fs_q_kmckbc_carries_left * S ((S (kmc_index_kmckbc_carries)) * lc) + (kmc_left_kmckbc_carries))) /\ ((((exists fs_h_kmckbc_carries_right. fs_h_kmckbc_carries_right + S (kmc_right_kmckbc_carries) = S ((S (kmc_index_kmckbc_carries)) * rc)) /\ exists fs_q_kmckbc_carries_right. rb = fs_q_kmckbc_carries_right * S ((S (kmc_index_kmckbc_carries)) * rc) + (kmc_right_kmckbc_carries))) /\ ((((exists fs_h_kmckbc_carries_total. fs_h_kmckbc_carries_total + S (kmc_total_kmckbc_carries) = S ((S (kmc_index_kmckbc_carries)) * tc)) /\ exists fs_q_kmckbc_carries_total. tb = fs_q_kmckbc_carries_total * S ((S (kmc_index_kmckbc_carries)) * tc) + (kmc_total_kmckbc_carries))) /\ ((((exists fs_h_kmckbc_carries_bit. fs_h_kmckbc_carries_bit + S (kmc_bit_kmckbc_carries) = S ((S (kmc_index_kmckbc_carries)) * cc)) /\ exists fs_q_kmckbc_carries_bit. cb = fs_q_kmckbc_carries_bit * S ((S (kmc_index_kmckbc_carries)) * cc) + (kmc_bit_kmckbc_carries))) /\ (((kmc_bit_kmckbc_carries = 0 /\ kmc_total_kmckbc_carries = kmc_left_kmckbc_carries + kmc_right_kmckbc_carries) \/ (kmc_bit_kmckbc_carries = 1 /\ kmc_total_kmckbc_carries = S (kmc_left_kmckbc_carries + kmc_right_kmckbc_carries)))))))) /\ (((exists ff_u_kmckbc_count_sum ff_v_kmckbc_count_sum. ((((exists ff_h_kmckbc_count_sum_start. ff_h_kmckbc_count_sum_start + S (0) = S ((S (0)) * ff_v_kmckbc_count_sum)) /\ exists ff_q_kmckbc_count_sum_start. ff_u_kmckbc_count_sum = ff_q_kmckbc_count_sum_start * S ((S (0)) * ff_v_kmckbc_count_sum) + (0))) /\ ((((exists ff_h_kmckbc_count_sum_terminal. ff_h_kmckbc_count_sum_terminal + S ((v)) = S ((S ((a + b))) * ff_v_kmckbc_count_sum)) /\ exists ff_q_kmckbc_count_sum_terminal. ff_u_kmckbc_count_sum = ff_q_kmckbc_count_sum_terminal * S ((S ((a + b))) * ff_v_kmckbc_count_sum) + ((v)))) /\ forall ff_i_kmckbc_count_sum. (exists ff_lt_kmckbc_count_sum_bound. ff_lt_kmckbc_count_sum_bound + S ff_i_kmckbc_count_sum = (a + b)) -> exists ff_a_kmckbc_count_sum ff_r_kmckbc_count_sum ff_s_kmckbc_count_sum. ((((exists ff_h_kmckbc_count_sum_summand. ff_h_kmckbc_count_sum_summand + S (ff_a_kmckbc_count_sum) = S ((S (ff_i_kmckbc_count_sum)) * cc)) /\ exists ff_q_kmckbc_count_sum_summand. cb = ff_q_kmckbc_count_sum_summand * S ((S (ff_i_kmckbc_count_sum)) * cc) + (ff_a_kmckbc_count_sum))) /\ ((((exists ff_h_kmckbc_count_sum_partial. ff_h_kmckbc_count_sum_partial + S (ff_r_kmckbc_count_sum) = S ((S (ff_i_kmckbc_count_sum)) * ff_v_kmckbc_count_sum)) /\ exists ff_q_kmckbc_count_sum_partial. ff_u_kmckbc_count_sum = ff_q_kmckbc_count_sum_partial * S ((S (ff_i_kmckbc_count_sum)) * ff_v_kmckbc_count_sum) + (ff_r_kmckbc_count_sum))) /\ ((((exists ff_h_kmckbc_count_sum_successor. ff_h_kmckbc_count_sum_successor + S (ff_s_kmckbc_count_sum) = S ((S (S ff_i_kmckbc_count_sum)) * ff_v_kmckbc_count_sum)) /\ exists ff_q_kmckbc_count_sum_successor. ff_u_kmckbc_count_sum = ff_q_kmckbc_count_sum_successor * S ((S (S ff_i_kmckbc_count_sum)) * ff_v_kmckbc_count_sum) + (ff_s_kmckbc_count_sum))) /\ ff_s_kmckbc_count_sum = ff_r_kmckbc_count_sum + ff_a_kmckbc_count_sum)))))) /\ (forall ff_i_kmckbc_count_bits. (exists ff_lt_kmckbc_count_bits_bound. ff_lt_kmckbc_count_bits_bound + S ff_i_kmckbc_count_bits = (a + b)) -> exists ff_bit_kmckbc_count_bits. ((((exists ff_h_kmckbc_count_bits_decoded. ff_h_kmckbc_count_bits_decoded + S (ff_bit_kmckbc_count_bits) = S ((S (ff_i_kmckbc_count_bits)) * cc)) /\ exists ff_q_kmckbc_count_bits_decoded. cb = ff_q_kmckbc_count_bits_decoded * S ((S (ff_i_kmckbc_count_bits)) * cc) + (ff_bit_kmckbc_count_bits))) /\ (ff_bit_kmckbc_count_bits = 0 \/ ff_bit_kmckbc_count_bits = 1))))))))

Proof neighborhood

Direct theorem prerequisites

prime_legendre_sum_exists · Alpha closed KU0005 binomial_legendre_valuation_balance legendre_sum_extended_prefix_exists · Alpha closed add_comm · Stable closed KU0008 add_quotient_carry_prefix_exists KU0009 add_quotient_carry_prefix_all_bits bit_count_exists · Stable closed KU000B beta_sum_add_carry_exact add_left_cancel · Stable closed

Direct theorem dependents

Definition-aware tactic body

Only propositions whose conservative expansion has been checked for exact first-order equivalence are compacted. Every changed line retains its immutable exact replay command.

Read the argument

Proof checkpoints

157 script commands · 35 reading checkpoints · 12 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 (4)
01Fix variables and assumptionsL1–8

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

  1. L1
    intro p
  2. L2
    intro a
  3. L3
    intro b
  4. L4
    intro C
  5. L5
    intro v
  6. L6
    intro hp
  7. L7
    intro hchoose
  8. L8
    intro hvaluation
02Establish hleft_legendreL9–13

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

  1. L9
    have hleft_legendre : ∃ L. LegendreSum(p,a,L)Definitions: LegendreSum(p,a,L)Original native command in the exact edition
  2. L10
    specialize prime_legendre_sum_exists p
  3. L11
    specialize prime_legendre_sum_exists a
  4. L12
    apply prime_legendre_sum_exists
  5. L13
    exact hp
03Separate the logical casesL14–14

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

  1. L14
    cases hleft_legendre
04Establish hright_legendreL15–19

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

  1. L15
    have hright_legendre : ∃ M. LegendreSum(p,b,M)Definitions: LegendreSum(p,b,M)Original native command in the exact edition
  2. L16
    specialize prime_legendre_sum_exists p
  3. L17
    specialize prime_legendre_sum_exists b
  4. L18
    apply prime_legendre_sum_exists
  5. L19
    exact hp
05Separate the logical casesL20–20

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

  1. L20
    cases hright_legendre
06Establish htotal_legendreL21–25

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

  1. L21
    have htotal_legendre : ∃ T. LegendreSum(p,a + b,T)Definitions: LegendreSum(p,a + b,T)Original native command in the exact edition
  2. L22
    specialize prime_legendre_sum_exists p
  3. L23
    specialize prime_legendre_sum_exists (a + b)
  4. L24
    apply prime_legendre_sum_exists
  5. L25
    exact hp
07Separate the logical casesL26–26

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

  1. L26
    cases htotal_legendre
08Establish hvaluation_balanceL27–36

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

  1. L27
    have hvaluation_balance : x2 = (x + x1) + v
  2. L28
    specialize binomial_legendre_valuation_balance p
  3. L29
    specialize binomial_legendre_valuation_balance a
  4. L30
    specialize binomial_legendre_valuation_balance b
  5. L31
    specialize binomial_legendre_valuation_balance C
  6. L32
    specialize binomial_legendre_valuation_balance v
  7. L33
    specialize binomial_legendre_valuation_balance x2
  8. L34
    specialize binomial_legendre_valuation_balance x
  9. L35
    specialize binomial_legendre_valuation_balance x1
  10. L36
    apply binomial_legendre_valuation_balance
09Use earlier factsL37–42

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

  1. L37
    exact hp
  2. L38
    exact hchoose
  3. L39
    exact hvaluation
  4. L40
    exact htotal_legendre_witness
  5. L41
    exact hleft_legendre_witness
  6. L42
    exact hright_legendre_witness
10Establish hleft_extendedL43–50

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

  1. L43
    have hleft_extended : ∃ lb. ∃ lc. PowerQuotPrefix(p,a,lb,lc,a + b) ∧ Sum(lb,lc,a + b,x)Definitions: PowerQuotPrefix(p,a,lb,lc,a + b)Sum(lb,lc,a + b,x)Original native command in the exact edition
  2. L44
    specialize legendre_sum_extended_prefix_exists p
  3. L45
    specialize legendre_sum_extended_prefix_exists a
  4. L46
    specialize legendre_sum_extended_prefix_exists x
  5. L47
    specialize legendre_sum_extended_prefix_exists b
  6. L48
    apply legendre_sum_extended_prefix_exists
  7. L49
    exact hp
  8. L50
    exact hleft_legendre_witness
11Separate the logical casesL51–53

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

  1. L51
    cases hleft_extended
  2. L52
    cases hleft_extended_witness
  3. L53
    cases hleft_extended_witness_witness
12Establish hright_extendedL54–61

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

  1. L54
    have hright_extended : ∃ rb. ∃ rc. PowerQuotPrefix(p,b,rb,rc,b + a) ∧ Sum(rb,rc,b + a,x1)Definitions: PowerQuotPrefix(p,b,rb,rc,b + a)Sum(rb,rc,b + a,x1)Original native command in the exact edition
  2. L55
    specialize legendre_sum_extended_prefix_exists p
  3. L56
    specialize legendre_sum_extended_prefix_exists b
  4. L57
    specialize legendre_sum_extended_prefix_exists x1
  5. L58
    specialize legendre_sum_extended_prefix_exists a
  6. L59
    apply legendre_sum_extended_prefix_exists
  7. L60
    exact hp
  8. L61
    exact hright_legendre_witness
13Separate the logical casesL62–64

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

  1. L62
    cases hright_extended
  2. L63
    cases hright_extended_witness
  3. L64
    cases hright_extended_witness_witness
14Establish hlengthL65–70

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

  1. L65
    have hlength : b + a = a + b
  2. L66
    apply add_comm
  3. L67
    rewrite hlength at hright_extended_witness_witness_left
  4. L68
    rewrite hlength at hright_extended_witness_witness_right
  5. L69
    rewrite hlength at hright_extended_witness_witness_right
  6. L70
    rewrite hlength at hright_extended_witness_witness_right
15Separate the logical casesL71–73

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

  1. L71
    cases htotal_legendre_witness
  2. L72
    cases htotal_legendre_witness_witness
  3. L73
    cases htotal_legendre_witness_witness_witness
16Establish hcarry_codesL74–83

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

  1. L74
    have hcarry_codes : ∃ cb. ∃ cc. ∀ kmc_index_kmckbc_carry_codes. Lt(kmc_index_kmckbc_carry_codes,a + b) → ∃ x. ∃ y. ∃ z. ∃ n. BetaAt(x3,x4,kmc_index_kmckbc_carry_codes,x) ∧ (BetaAt(x5,x6,kmc_index_kmckbc_carry_codes,y) ∧ (BetaAt(x7,x8,kmc_index_kmckbc_carry_codes,z) ∧ (BetaAt(cb,cc,kmc_index_kmckbc_carry_codes,n) ∧ (n = 0 ∧ z = x + y ∨ n = 1 ∧ z = S (x + y)))))Definitions: Lt(kmc_index_kmckbc_carry_codes,a + b)BetaAt(x3,x4,kmc_index_kmckbc_carry_codes,x)BetaAt(x5,x6,kmc_index_kmckbc_carry_codes,y)BetaAt(x7,x8,kmc_index_kmckbc_carry_codes,z)BetaAt(cb,cc,kmc_index_kmckbc_carry_codes,n)Original native command in the exact edition
  2. L75
    specialize add_quotient_carry_prefix_exists p
  3. L76
    specialize add_quotient_carry_prefix_exists a
  4. L77
    specialize add_quotient_carry_prefix_exists b
  5. L78
    specialize add_quotient_carry_prefix_exists x3
  6. L79
    specialize add_quotient_carry_prefix_exists x4
  7. L80
    specialize add_quotient_carry_prefix_exists x5
  8. L81
    specialize add_quotient_carry_prefix_exists x6
  9. L82
    specialize add_quotient_carry_prefix_exists x7
  10. L83
    specialize add_quotient_carry_prefix_exists x8
17Use earlier factsL84–88

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

  1. L84
    specialize add_quotient_carry_prefix_exists (a + b)
  2. L85
    apply add_quotient_carry_prefix_exists
  3. L86
    exact hleft_extended_witness_witness_left
  4. L87
    exact hright_extended_witness_witness_left
  5. L88
    exact htotal_legendre_witness_witness_witness_left
18Separate the logical casesL89–90

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

  1. L89
    cases hcarry_codes
  2. L90
    cases hcarry_codes_witness
19Establish hall_bitsL91–100

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

  1. L91
    have hall_bits : AllBits(x9,x10,a + b)Definitions: AllBits(x9,x10,a + b)Original native command in the exact edition
  2. L92
    specialize add_quotient_carry_prefix_all_bits x3
  3. L93
    specialize add_quotient_carry_prefix_all_bits x4
  4. L94
    specialize add_quotient_carry_prefix_all_bits x5
  5. L95
    specialize add_quotient_carry_prefix_all_bits x6
  6. L96
    specialize add_quotient_carry_prefix_all_bits x7
  7. L97
    specialize add_quotient_carry_prefix_all_bits x8
  8. L98
    specialize add_quotient_carry_prefix_all_bits x9
  9. L99
    specialize add_quotient_carry_prefix_all_bits x10
  10. L100
    specialize add_quotient_carry_prefix_all_bits (a + b)
20Use earlier factsL101–102

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

  1. L101
    apply add_quotient_carry_prefix_all_bits
  2. L102
    exact hcarry_codes_witness_witness
21Establish hcountL103–108

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

  1. L103
    have hcount : ∃ E. BitCount(x9,x10,a + b,E)Definitions: BitCount(x9,x10,a + b,E)Original native command in the exact edition
  2. L104
    specialize bit_count_exists x9
  3. L105
    specialize bit_count_exists x10
  4. L106
    specialize bit_count_exists (a + b)
  5. L107
    apply bit_count_exists
  6. L108
    exact hall_bits
22Separate the logical casesL109–109

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

  1. L109
    cases hcount
23Establish hcarry_balanceL110–119

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

  1. L110
    have hcarry_balance : x2 = (x + x1) + x11
  2. L111
    specialize beta_sum_add_carry_exact x3
  3. L112
    specialize beta_sum_add_carry_exact x4
  4. L113
    specialize beta_sum_add_carry_exact x5
  5. L114
    specialize beta_sum_add_carry_exact x6
  6. L115
    specialize beta_sum_add_carry_exact x7
  7. L116
    specialize beta_sum_add_carry_exact x8
  8. L117
    specialize beta_sum_add_carry_exact x9
  9. L118
    specialize beta_sum_add_carry_exact x10
  10. L119
    specialize beta_sum_add_carry_exact (a + b)
24Use earlier factsL120–129

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

  1. L120
    specialize beta_sum_add_carry_exact x
  2. L121
    specialize beta_sum_add_carry_exact x1
  3. L122
    specialize beta_sum_add_carry_exact x2
  4. L123
    specialize beta_sum_add_carry_exact x11
  5. L124
    apply beta_sum_add_carry_exact
  6. L125
    exact hleft_extended_witness_witness_right
  7. L126
    exact hright_extended_witness_witness_right
  8. L127
    exact htotal_legendre_witness_witness_witness_right
  9. L128
    exact hcarry_codes_witness_witness
  10. L129
    exact hcount_witness
25Establish hcount_eqL130–139

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

  1. L130
    have hcount_eq : x11 = v
  2. L131
    specialize add_left_cancel (x + x1)
  3. L132
    specialize add_left_cancel x11
  4. L133
    specialize add_left_cancel v
  5. L134
    apply add_left_cancel
  6. L135
    trans x2
  7. L136
    symm
  8. L137
    exact hcarry_balance
  9. L138
    exact hvaluation_balance
  10. L139
    rewrite hcount_eq at hcount_witness
26Calculate and transport equalitiesL140–140

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

  1. L140
    rewrite hcount_eq at hcount_witness
27Construct an explicit witnessL141–148

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

  1. L141
    exists x3
  2. L142
    exists x4
  3. L143
    exists x5
  4. L144
    exists x6
  5. L145
    exists x7
  6. L146
    exists x8
  7. L147
    exists x9
  8. L148
    exists x10
28Separate the logical casesL149–149

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

  1. L149
    split
29Use earlier factsL150–150

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

  1. L150
    exact hleft_extended_witness_witness_left
30Separate the logical casesL151–151

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

  1. L151
    split
31Use earlier factsL152–152

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

  1. L152
    exact hright_extended_witness_witness_left
32Separate the logical casesL153–153

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

  1. L153
    split
33Use earlier factsL154–154

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

  1. L154
    exact htotal_legendre_witness_witness_witness_left
34Separate the logical casesL155–155

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

  1. L155
    split
35Use earlier factsL156–157

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

  1. L156
    exact hcarry_codes_witness_witness
  2. L157
    exact hcount_witness

Library-wide reading audit

Original defined command ledger · 157 lines
  1. 0001intro p
  2. 0002intro a
  3. 0003intro b
  4. 0004intro C
  5. 0005intro v
  6. 0006intro hp
  7. 0007intro hchoose
  8. 0008intro hvaluation
  9. 0009have hleft_legendre : ∃ L. LegendreSum(p,a,L)
    Exact native replay linehave hleft_legendre : exists L. exists bls_code_kmckbc_left_legendre bls_scale_kmckbc_left_legendre. ((forall bls_index_kmckbc_left_legendre_prefix. (exists bls_gap_kmckbc_left_legendre_prefix_bound. bls_gap_kmckbc_left_legendre_prefix_bound + S (bls_index_kmckbc_left_legendre_prefix) = (a)) -> exists bls_power_kmckbc_left_legendre_prefix bls_quotient_kmckbc_left_legendre_prefix bls_remainder_kmckbc_left_legendre_prefix. ((exists bpvi_b_bls_kmckbc_left_legendre_prefix_power bpvi_c_bls_kmckbc_left_legendre_prefix_power. ((forall bpvi_i_bls_kmckbc_left_legendre_prefix_power. (exists bpvi_repeat_gap_bls_kmckbc_left_legendre_prefix_power. bpvi_repeat_gap_bls_kmckbc_left_legendre_prefix_power + S bpvi_i_bls_kmckbc_left_legendre_prefix_power = S bls_index_kmckbc_left_legendre_prefix) -> (((exists bpvi_h_bls_kmckbc_left_legendre_prefix_power_repeat. bpvi_h_bls_kmckbc_left_legendre_prefix_power_repeat + S (p) = S ((S (bpvi_i_bls_kmckbc_left_legendre_prefix_power)) * bpvi_c_bls_kmckbc_left_legendre_prefix_power)) /\ exists bpvi_q_bls_kmckbc_left_legendre_prefix_power_repeat. bpvi_b_bls_kmckbc_left_legendre_prefix_power = bpvi_q_bls_kmckbc_left_legendre_prefix_power_repeat * S ((S (bpvi_i_bls_kmckbc_left_legendre_prefix_power)) * bpvi_c_bls_kmckbc_left_legendre_prefix_power) + (p)))) /\ (exists bpvi_u_bls_kmckbc_left_legendre_prefix_power bpvi_v_bls_kmckbc_left_legendre_prefix_power. ((((exists bpvi_h_bls_kmckbc_left_legendre_prefix_power_start. bpvi_h_bls_kmckbc_left_legendre_prefix_power_start + S (1) = S ((S (0)) * bpvi_v_bls_kmckbc_left_legendre_prefix_power)) /\ exists bpvi_q_bls_kmckbc_left_legendre_prefix_power_start. bpvi_u_bls_kmckbc_left_legendre_prefix_power = bpvi_q_bls_kmckbc_left_legendre_prefix_power_start * S ((S (0)) * bpvi_v_bls_kmckbc_left_legendre_prefix_power) + (1))) /\ ((((exists bpvi_h_bls_kmckbc_left_legendre_prefix_power_terminal. bpvi_h_bls_kmckbc_left_legendre_prefix_power_terminal + S (bls_power_kmckbc_left_legendre_prefix) = S ((S (S bls_index_kmckbc_left_legendre_prefix)) * bpvi_v_bls_kmckbc_left_legendre_prefix_power)) /\ exists bpvi_q_bls_kmckbc_left_legendre_prefix_power_terminal. bpvi_u_bls_kmckbc_left_legendre_prefix_power = bpvi_q_bls_kmckbc_left_legendre_prefix_power_terminal * S ((S (S bls_index_kmckbc_left_legendre_prefix)) * bpvi_v_bls_kmckbc_left_legendre_prefix_power) + (bls_power_kmckbc_left_legendre_prefix))) /\ forall bpvi_j_bls_kmckbc_left_legendre_prefix_power. (exists bpvi_product_gap_bls_kmckbc_left_legendre_prefix_power. bpvi_product_gap_bls_kmckbc_left_legendre_prefix_power + S bpvi_j_bls_kmckbc_left_legendre_prefix_power = S bls_index_kmckbc_left_legendre_prefix) -> exists bpvi_factor_bls_kmckbc_left_legendre_prefix_power bpvi_partial_bls_kmckbc_left_legendre_prefix_power bpvi_successor_bls_kmckbc_left_legendre_prefix_power. ((((exists bpvi_h_bls_kmckbc_left_legendre_prefix_power_factor. bpvi_h_bls_kmckbc_left_legendre_prefix_power_factor + S (bpvi_factor_bls_kmckbc_left_legendre_prefix_power) = S ((S (bpvi_j_bls_kmckbc_left_legendre_prefix_power)) * bpvi_c_bls_kmckbc_left_legendre_prefix_power)) /\ exists bpvi_q_bls_kmckbc_left_legendre_prefix_power_factor. bpvi_b_bls_kmckbc_left_legendre_prefix_power = bpvi_q_bls_kmckbc_left_legendre_prefix_power_factor * S ((S (bpvi_j_bls_kmckbc_left_legendre_prefix_power)) * bpvi_c_bls_kmckbc_left_legendre_prefix_power) + (bpvi_factor_bls_kmckbc_left_legendre_prefix_power))) /\ ((((exists bpvi_h_bls_kmckbc_left_legendre_prefix_power_partial. bpvi_h_bls_kmckbc_left_legendre_prefix_power_partial + S (bpvi_partial_bls_kmckbc_left_legendre_prefix_power) = S ((S (bpvi_j_bls_kmckbc_left_legendre_prefix_power)) * bpvi_v_bls_kmckbc_left_legendre_prefix_power)) /\ exists bpvi_q_bls_kmckbc_left_legendre_prefix_power_partial. bpvi_u_bls_kmckbc_left_legendre_prefix_power = bpvi_q_bls_kmckbc_left_legendre_prefix_power_partial * S ((S (bpvi_j_bls_kmckbc_left_legendre_prefix_power)) * bpvi_v_bls_kmckbc_left_legendre_prefix_power) + (bpvi_partial_bls_kmckbc_left_legendre_prefix_power))) /\ ((((exists bpvi_h_bls_kmckbc_left_legendre_prefix_power_successor. bpvi_h_bls_kmckbc_left_legendre_prefix_power_successor + S (bpvi_successor_bls_kmckbc_left_legendre_prefix_power) = S ((S (S bpvi_j_bls_kmckbc_left_legendre_prefix_power)) * bpvi_v_bls_kmckbc_left_legendre_prefix_power)) /\ exists bpvi_q_bls_kmckbc_left_legendre_prefix_power_successor. bpvi_u_bls_kmckbc_left_legendre_prefix_power = bpvi_q_bls_kmckbc_left_legendre_prefix_power_successor * S ((S (S bpvi_j_bls_kmckbc_left_legendre_prefix_power)) * bpvi_v_bls_kmckbc_left_legendre_prefix_power) + (bpvi_successor_bls_kmckbc_left_legendre_prefix_power))) /\ bpvi_successor_bls_kmckbc_left_legendre_prefix_power = bpvi_partial_bls_kmckbc_left_legendre_prefix_power * bpvi_factor_bls_kmckbc_left_legendre_prefix_power)))))))) /\ ((((exists ff_h_bls_kmckbc_left_legendre_prefix_quotient_entry. ff_h_bls_kmckbc_left_legendre_prefix_quotient_entry + S (bls_quotient_kmckbc_left_legendre_prefix) = S ((S (bls_index_kmckbc_left_legendre_prefix)) * bls_scale_kmckbc_left_legendre)) /\ exists ff_q_bls_kmckbc_left_legendre_prefix_quotient_entry. bls_code_kmckbc_left_legendre = ff_q_bls_kmckbc_left_legendre_prefix_quotient_entry * S ((S (bls_index_kmckbc_left_legendre_prefix)) * bls_scale_kmckbc_left_legendre) + (bls_quotient_kmckbc_left_legendre_prefix))) /\ ((a = bls_power_kmckbc_left_legendre_prefix * bls_quotient_kmckbc_left_legendre_prefix + bls_remainder_kmckbc_left_legendre_prefix /\ exists bls_remainder_gap_kmckbc_left_legendre_prefix_division. bls_remainder_gap_kmckbc_left_legendre_prefix_division + S (bls_remainder_kmckbc_left_legendre_prefix) = bls_power_kmckbc_left_legendre_prefix))))) /\ (exists ff_u_bls_kmckbc_left_legendre_sum ff_v_bls_kmckbc_left_legendre_sum. ((((exists ff_h_bls_kmckbc_left_legendre_sum_start. ff_h_bls_kmckbc_left_legendre_sum_start + S (0) = S ((S (0)) * ff_v_bls_kmckbc_left_legendre_sum)) /\ exists ff_q_bls_kmckbc_left_legendre_sum_start. ff_u_bls_kmckbc_left_legendre_sum = ff_q_bls_kmckbc_left_legendre_sum_start * S ((S (0)) * ff_v_bls_kmckbc_left_legendre_sum) + (0))) /\ ((((exists ff_h_bls_kmckbc_left_legendre_sum_terminal. ff_h_bls_kmckbc_left_legendre_sum_terminal + S (L) = S ((S (a)) * ff_v_bls_kmckbc_left_legendre_sum)) /\ exists ff_q_bls_kmckbc_left_legendre_sum_terminal. ff_u_bls_kmckbc_left_legendre_sum = ff_q_bls_kmckbc_left_legendre_sum_terminal * S ((S (a)) * ff_v_bls_kmckbc_left_legendre_sum) + (L))) /\ forall ff_i_bls_kmckbc_left_legendre_sum. (exists ff_lt_bls_kmckbc_left_legendre_sum_bound. ff_lt_bls_kmckbc_left_legendre_sum_bound + S ff_i_bls_kmckbc_left_legendre_sum = a) -> exists ff_a_bls_kmckbc_left_legendre_sum ff_r_bls_kmckbc_left_legendre_sum ff_s_bls_kmckbc_left_legendre_sum. ((((exists ff_h_bls_kmckbc_left_legendre_sum_summand. ff_h_bls_kmckbc_left_legendre_sum_summand + S (ff_a_bls_kmckbc_left_legendre_sum) = S ((S (ff_i_bls_kmckbc_left_legendre_sum)) * bls_scale_kmckbc_left_legendre)) /\ exists ff_q_bls_kmckbc_left_legendre_sum_summand. bls_code_kmckbc_left_legendre = ff_q_bls_kmckbc_left_legendre_sum_summand * S ((S (ff_i_bls_kmckbc_left_legendre_sum)) * bls_scale_kmckbc_left_legendre) + (ff_a_bls_kmckbc_left_legendre_sum))) /\ ((((exists ff_h_bls_kmckbc_left_legendre_sum_partial. ff_h_bls_kmckbc_left_legendre_sum_partial + S (ff_r_bls_kmckbc_left_legendre_sum) = S ((S (ff_i_bls_kmckbc_left_legendre_sum)) * ff_v_bls_kmckbc_left_legendre_sum)) /\ exists ff_q_bls_kmckbc_left_legendre_sum_partial. ff_u_bls_kmckbc_left_legendre_sum = ff_q_bls_kmckbc_left_legendre_sum_partial * S ((S (ff_i_bls_kmckbc_left_legendre_sum)) * ff_v_bls_kmckbc_left_legendre_sum) + (ff_r_bls_kmckbc_left_legendre_sum))) /\ ((((exists ff_h_bls_kmckbc_left_legendre_sum_successor. ff_h_bls_kmckbc_left_legendre_sum_successor + S (ff_s_bls_kmckbc_left_legendre_sum) = S ((S (S ff_i_bls_kmckbc_left_legendre_sum)) * ff_v_bls_kmckbc_left_legendre_sum)) /\ exists ff_q_bls_kmckbc_left_legendre_sum_successor. ff_u_bls_kmckbc_left_legendre_sum = ff_q_bls_kmckbc_left_legendre_sum_successor * S ((S (S ff_i_bls_kmckbc_left_legendre_sum)) * ff_v_bls_kmckbc_left_legendre_sum) + (ff_s_bls_kmckbc_left_legendre_sum))) /\ ff_s_bls_kmckbc_left_legendre_sum = ff_r_bls_kmckbc_left_legendre_sum + ff_a_bls_kmckbc_left_legendre_sum)))))))
  10. 0010specialize prime_legendre_sum_exists p
  11. 0011specialize prime_legendre_sum_exists a
  12. 0012apply prime_legendre_sum_exists
  13. 0013exact hp
  14. 0014cases hleft_legendre
  15. 0015have hright_legendre : ∃ M. LegendreSum(p,b,M)
    Exact native replay linehave hright_legendre : exists M. exists bls_code_kmckbc_right_legendre bls_scale_kmckbc_right_legendre. ((forall bls_index_kmckbc_right_legendre_prefix. (exists bls_gap_kmckbc_right_legendre_prefix_bound. bls_gap_kmckbc_right_legendre_prefix_bound + S (bls_index_kmckbc_right_legendre_prefix) = (b)) -> exists bls_power_kmckbc_right_legendre_prefix bls_quotient_kmckbc_right_legendre_prefix bls_remainder_kmckbc_right_legendre_prefix. ((exists bpvi_b_bls_kmckbc_right_legendre_prefix_power bpvi_c_bls_kmckbc_right_legendre_prefix_power. ((forall bpvi_i_bls_kmckbc_right_legendre_prefix_power. (exists bpvi_repeat_gap_bls_kmckbc_right_legendre_prefix_power. bpvi_repeat_gap_bls_kmckbc_right_legendre_prefix_power + S bpvi_i_bls_kmckbc_right_legendre_prefix_power = S bls_index_kmckbc_right_legendre_prefix) -> (((exists bpvi_h_bls_kmckbc_right_legendre_prefix_power_repeat. bpvi_h_bls_kmckbc_right_legendre_prefix_power_repeat + S (p) = S ((S (bpvi_i_bls_kmckbc_right_legendre_prefix_power)) * bpvi_c_bls_kmckbc_right_legendre_prefix_power)) /\ exists bpvi_q_bls_kmckbc_right_legendre_prefix_power_repeat. bpvi_b_bls_kmckbc_right_legendre_prefix_power = bpvi_q_bls_kmckbc_right_legendre_prefix_power_repeat * S ((S (bpvi_i_bls_kmckbc_right_legendre_prefix_power)) * bpvi_c_bls_kmckbc_right_legendre_prefix_power) + (p)))) /\ (exists bpvi_u_bls_kmckbc_right_legendre_prefix_power bpvi_v_bls_kmckbc_right_legendre_prefix_power. ((((exists bpvi_h_bls_kmckbc_right_legendre_prefix_power_start. bpvi_h_bls_kmckbc_right_legendre_prefix_power_start + S (1) = S ((S (0)) * bpvi_v_bls_kmckbc_right_legendre_prefix_power)) /\ exists bpvi_q_bls_kmckbc_right_legendre_prefix_power_start. bpvi_u_bls_kmckbc_right_legendre_prefix_power = bpvi_q_bls_kmckbc_right_legendre_prefix_power_start * S ((S (0)) * bpvi_v_bls_kmckbc_right_legendre_prefix_power) + (1))) /\ ((((exists bpvi_h_bls_kmckbc_right_legendre_prefix_power_terminal. bpvi_h_bls_kmckbc_right_legendre_prefix_power_terminal + S (bls_power_kmckbc_right_legendre_prefix) = S ((S (S bls_index_kmckbc_right_legendre_prefix)) * bpvi_v_bls_kmckbc_right_legendre_prefix_power)) /\ exists bpvi_q_bls_kmckbc_right_legendre_prefix_power_terminal. bpvi_u_bls_kmckbc_right_legendre_prefix_power = bpvi_q_bls_kmckbc_right_legendre_prefix_power_terminal * S ((S (S bls_index_kmckbc_right_legendre_prefix)) * bpvi_v_bls_kmckbc_right_legendre_prefix_power) + (bls_power_kmckbc_right_legendre_prefix))) /\ forall bpvi_j_bls_kmckbc_right_legendre_prefix_power. (exists bpvi_product_gap_bls_kmckbc_right_legendre_prefix_power. bpvi_product_gap_bls_kmckbc_right_legendre_prefix_power + S bpvi_j_bls_kmckbc_right_legendre_prefix_power = S bls_index_kmckbc_right_legendre_prefix) -> exists bpvi_factor_bls_kmckbc_right_legendre_prefix_power bpvi_partial_bls_kmckbc_right_legendre_prefix_power bpvi_successor_bls_kmckbc_right_legendre_prefix_power. ((((exists bpvi_h_bls_kmckbc_right_legendre_prefix_power_factor. bpvi_h_bls_kmckbc_right_legendre_prefix_power_factor + S (bpvi_factor_bls_kmckbc_right_legendre_prefix_power) = S ((S (bpvi_j_bls_kmckbc_right_legendre_prefix_power)) * bpvi_c_bls_kmckbc_right_legendre_prefix_power)) /\ exists bpvi_q_bls_kmckbc_right_legendre_prefix_power_factor. bpvi_b_bls_kmckbc_right_legendre_prefix_power = bpvi_q_bls_kmckbc_right_legendre_prefix_power_factor * S ((S (bpvi_j_bls_kmckbc_right_legendre_prefix_power)) * bpvi_c_bls_kmckbc_right_legendre_prefix_power) + (bpvi_factor_bls_kmckbc_right_legendre_prefix_power))) /\ ((((exists bpvi_h_bls_kmckbc_right_legendre_prefix_power_partial. bpvi_h_bls_kmckbc_right_legendre_prefix_power_partial + S (bpvi_partial_bls_kmckbc_right_legendre_prefix_power) = S ((S (bpvi_j_bls_kmckbc_right_legendre_prefix_power)) * bpvi_v_bls_kmckbc_right_legendre_prefix_power)) /\ exists bpvi_q_bls_kmckbc_right_legendre_prefix_power_partial. bpvi_u_bls_kmckbc_right_legendre_prefix_power = bpvi_q_bls_kmckbc_right_legendre_prefix_power_partial * S ((S (bpvi_j_bls_kmckbc_right_legendre_prefix_power)) * bpvi_v_bls_kmckbc_right_legendre_prefix_power) + (bpvi_partial_bls_kmckbc_right_legendre_prefix_power))) /\ ((((exists bpvi_h_bls_kmckbc_right_legendre_prefix_power_successor. bpvi_h_bls_kmckbc_right_legendre_prefix_power_successor + S (bpvi_successor_bls_kmckbc_right_legendre_prefix_power) = S ((S (S bpvi_j_bls_kmckbc_right_legendre_prefix_power)) * bpvi_v_bls_kmckbc_right_legendre_prefix_power)) /\ exists bpvi_q_bls_kmckbc_right_legendre_prefix_power_successor. bpvi_u_bls_kmckbc_right_legendre_prefix_power = bpvi_q_bls_kmckbc_right_legendre_prefix_power_successor * S ((S (S bpvi_j_bls_kmckbc_right_legendre_prefix_power)) * bpvi_v_bls_kmckbc_right_legendre_prefix_power) + (bpvi_successor_bls_kmckbc_right_legendre_prefix_power))) /\ bpvi_successor_bls_kmckbc_right_legendre_prefix_power = bpvi_partial_bls_kmckbc_right_legendre_prefix_power * bpvi_factor_bls_kmckbc_right_legendre_prefix_power)))))))) /\ ((((exists ff_h_bls_kmckbc_right_legendre_prefix_quotient_entry. ff_h_bls_kmckbc_right_legendre_prefix_quotient_entry + S (bls_quotient_kmckbc_right_legendre_prefix) = S ((S (bls_index_kmckbc_right_legendre_prefix)) * bls_scale_kmckbc_right_legendre)) /\ exists ff_q_bls_kmckbc_right_legendre_prefix_quotient_entry. bls_code_kmckbc_right_legendre = ff_q_bls_kmckbc_right_legendre_prefix_quotient_entry * S ((S (bls_index_kmckbc_right_legendre_prefix)) * bls_scale_kmckbc_right_legendre) + (bls_quotient_kmckbc_right_legendre_prefix))) /\ ((b = bls_power_kmckbc_right_legendre_prefix * bls_quotient_kmckbc_right_legendre_prefix + bls_remainder_kmckbc_right_legendre_prefix /\ exists bls_remainder_gap_kmckbc_right_legendre_prefix_division. bls_remainder_gap_kmckbc_right_legendre_prefix_division + S (bls_remainder_kmckbc_right_legendre_prefix) = bls_power_kmckbc_right_legendre_prefix))))) /\ (exists ff_u_bls_kmckbc_right_legendre_sum ff_v_bls_kmckbc_right_legendre_sum. ((((exists ff_h_bls_kmckbc_right_legendre_sum_start. ff_h_bls_kmckbc_right_legendre_sum_start + S (0) = S ((S (0)) * ff_v_bls_kmckbc_right_legendre_sum)) /\ exists ff_q_bls_kmckbc_right_legendre_sum_start. ff_u_bls_kmckbc_right_legendre_sum = ff_q_bls_kmckbc_right_legendre_sum_start * S ((S (0)) * ff_v_bls_kmckbc_right_legendre_sum) + (0))) /\ ((((exists ff_h_bls_kmckbc_right_legendre_sum_terminal. ff_h_bls_kmckbc_right_legendre_sum_terminal + S (M) = S ((S (b)) * ff_v_bls_kmckbc_right_legendre_sum)) /\ exists ff_q_bls_kmckbc_right_legendre_sum_terminal. ff_u_bls_kmckbc_right_legendre_sum = ff_q_bls_kmckbc_right_legendre_sum_terminal * S ((S (b)) * ff_v_bls_kmckbc_right_legendre_sum) + (M))) /\ forall ff_i_bls_kmckbc_right_legendre_sum. (exists ff_lt_bls_kmckbc_right_legendre_sum_bound. ff_lt_bls_kmckbc_right_legendre_sum_bound + S ff_i_bls_kmckbc_right_legendre_sum = b) -> exists ff_a_bls_kmckbc_right_legendre_sum ff_r_bls_kmckbc_right_legendre_sum ff_s_bls_kmckbc_right_legendre_sum. ((((exists ff_h_bls_kmckbc_right_legendre_sum_summand. ff_h_bls_kmckbc_right_legendre_sum_summand + S (ff_a_bls_kmckbc_right_legendre_sum) = S ((S (ff_i_bls_kmckbc_right_legendre_sum)) * bls_scale_kmckbc_right_legendre)) /\ exists ff_q_bls_kmckbc_right_legendre_sum_summand. bls_code_kmckbc_right_legendre = ff_q_bls_kmckbc_right_legendre_sum_summand * S ((S (ff_i_bls_kmckbc_right_legendre_sum)) * bls_scale_kmckbc_right_legendre) + (ff_a_bls_kmckbc_right_legendre_sum))) /\ ((((exists ff_h_bls_kmckbc_right_legendre_sum_partial. ff_h_bls_kmckbc_right_legendre_sum_partial + S (ff_r_bls_kmckbc_right_legendre_sum) = S ((S (ff_i_bls_kmckbc_right_legendre_sum)) * ff_v_bls_kmckbc_right_legendre_sum)) /\ exists ff_q_bls_kmckbc_right_legendre_sum_partial. ff_u_bls_kmckbc_right_legendre_sum = ff_q_bls_kmckbc_right_legendre_sum_partial * S ((S (ff_i_bls_kmckbc_right_legendre_sum)) * ff_v_bls_kmckbc_right_legendre_sum) + (ff_r_bls_kmckbc_right_legendre_sum))) /\ ((((exists ff_h_bls_kmckbc_right_legendre_sum_successor. ff_h_bls_kmckbc_right_legendre_sum_successor + S (ff_s_bls_kmckbc_right_legendre_sum) = S ((S (S ff_i_bls_kmckbc_right_legendre_sum)) * ff_v_bls_kmckbc_right_legendre_sum)) /\ exists ff_q_bls_kmckbc_right_legendre_sum_successor. ff_u_bls_kmckbc_right_legendre_sum = ff_q_bls_kmckbc_right_legendre_sum_successor * S ((S (S ff_i_bls_kmckbc_right_legendre_sum)) * ff_v_bls_kmckbc_right_legendre_sum) + (ff_s_bls_kmckbc_right_legendre_sum))) /\ ff_s_bls_kmckbc_right_legendre_sum = ff_r_bls_kmckbc_right_legendre_sum + ff_a_bls_kmckbc_right_legendre_sum)))))))
  16. 0016specialize prime_legendre_sum_exists p
  17. 0017specialize prime_legendre_sum_exists b
  18. 0018apply prime_legendre_sum_exists
  19. 0019exact hp
  20. 0020cases hright_legendre
  21. 0021have htotal_legendre : ∃ T. LegendreSum(p,a + b,T)
    Exact native replay linehave htotal_legendre : exists T. exists bls_code_kmckbc_total_legendre bls_scale_kmckbc_total_legendre. ((forall bls_index_kmckbc_total_legendre_prefix. (exists bls_gap_kmckbc_total_legendre_prefix_bound. bls_gap_kmckbc_total_legendre_prefix_bound + S (bls_index_kmckbc_total_legendre_prefix) = ((a + b))) -> exists bls_power_kmckbc_total_legendre_prefix bls_quotient_kmckbc_total_legendre_prefix bls_remainder_kmckbc_total_legendre_prefix. ((exists bpvi_b_bls_kmckbc_total_legendre_prefix_power bpvi_c_bls_kmckbc_total_legendre_prefix_power. ((forall bpvi_i_bls_kmckbc_total_legendre_prefix_power. (exists bpvi_repeat_gap_bls_kmckbc_total_legendre_prefix_power. bpvi_repeat_gap_bls_kmckbc_total_legendre_prefix_power + S bpvi_i_bls_kmckbc_total_legendre_prefix_power = S bls_index_kmckbc_total_legendre_prefix) -> (((exists bpvi_h_bls_kmckbc_total_legendre_prefix_power_repeat. bpvi_h_bls_kmckbc_total_legendre_prefix_power_repeat + S (p) = S ((S (bpvi_i_bls_kmckbc_total_legendre_prefix_power)) * bpvi_c_bls_kmckbc_total_legendre_prefix_power)) /\ exists bpvi_q_bls_kmckbc_total_legendre_prefix_power_repeat. bpvi_b_bls_kmckbc_total_legendre_prefix_power = bpvi_q_bls_kmckbc_total_legendre_prefix_power_repeat * S ((S (bpvi_i_bls_kmckbc_total_legendre_prefix_power)) * bpvi_c_bls_kmckbc_total_legendre_prefix_power) + (p)))) /\ (exists bpvi_u_bls_kmckbc_total_legendre_prefix_power bpvi_v_bls_kmckbc_total_legendre_prefix_power. ((((exists bpvi_h_bls_kmckbc_total_legendre_prefix_power_start. bpvi_h_bls_kmckbc_total_legendre_prefix_power_start + S (1) = S ((S (0)) * bpvi_v_bls_kmckbc_total_legendre_prefix_power)) /\ exists bpvi_q_bls_kmckbc_total_legendre_prefix_power_start. bpvi_u_bls_kmckbc_total_legendre_prefix_power = bpvi_q_bls_kmckbc_total_legendre_prefix_power_start * S ((S (0)) * bpvi_v_bls_kmckbc_total_legendre_prefix_power) + (1))) /\ ((((exists bpvi_h_bls_kmckbc_total_legendre_prefix_power_terminal. bpvi_h_bls_kmckbc_total_legendre_prefix_power_terminal + S (bls_power_kmckbc_total_legendre_prefix) = S ((S (S bls_index_kmckbc_total_legendre_prefix)) * bpvi_v_bls_kmckbc_total_legendre_prefix_power)) /\ exists bpvi_q_bls_kmckbc_total_legendre_prefix_power_terminal. bpvi_u_bls_kmckbc_total_legendre_prefix_power = bpvi_q_bls_kmckbc_total_legendre_prefix_power_terminal * S ((S (S bls_index_kmckbc_total_legendre_prefix)) * bpvi_v_bls_kmckbc_total_legendre_prefix_power) + (bls_power_kmckbc_total_legendre_prefix))) /\ forall bpvi_j_bls_kmckbc_total_legendre_prefix_power. (exists bpvi_product_gap_bls_kmckbc_total_legendre_prefix_power. bpvi_product_gap_bls_kmckbc_total_legendre_prefix_power + S bpvi_j_bls_kmckbc_total_legendre_prefix_power = S bls_index_kmckbc_total_legendre_prefix) -> exists bpvi_factor_bls_kmckbc_total_legendre_prefix_power bpvi_partial_bls_kmckbc_total_legendre_prefix_power bpvi_successor_bls_kmckbc_total_legendre_prefix_power. ((((exists bpvi_h_bls_kmckbc_total_legendre_prefix_power_factor. bpvi_h_bls_kmckbc_total_legendre_prefix_power_factor + S (bpvi_factor_bls_kmckbc_total_legendre_prefix_power) = S ((S (bpvi_j_bls_kmckbc_total_legendre_prefix_power)) * bpvi_c_bls_kmckbc_total_legendre_prefix_power)) /\ exists bpvi_q_bls_kmckbc_total_legendre_prefix_power_factor. bpvi_b_bls_kmckbc_total_legendre_prefix_power = bpvi_q_bls_kmckbc_total_legendre_prefix_power_factor * S ((S (bpvi_j_bls_kmckbc_total_legendre_prefix_power)) * bpvi_c_bls_kmckbc_total_legendre_prefix_power) + (bpvi_factor_bls_kmckbc_total_legendre_prefix_power))) /\ ((((exists bpvi_h_bls_kmckbc_total_legendre_prefix_power_partial. bpvi_h_bls_kmckbc_total_legendre_prefix_power_partial + S (bpvi_partial_bls_kmckbc_total_legendre_prefix_power) = S ((S (bpvi_j_bls_kmckbc_total_legendre_prefix_power)) * bpvi_v_bls_kmckbc_total_legendre_prefix_power)) /\ exists bpvi_q_bls_kmckbc_total_legendre_prefix_power_partial. bpvi_u_bls_kmckbc_total_legendre_prefix_power = bpvi_q_bls_kmckbc_total_legendre_prefix_power_partial * S ((S (bpvi_j_bls_kmckbc_total_legendre_prefix_power)) * bpvi_v_bls_kmckbc_total_legendre_prefix_power) + (bpvi_partial_bls_kmckbc_total_legendre_prefix_power))) /\ ((((exists bpvi_h_bls_kmckbc_total_legendre_prefix_power_successor. bpvi_h_bls_kmckbc_total_legendre_prefix_power_successor + S (bpvi_successor_bls_kmckbc_total_legendre_prefix_power) = S ((S (S bpvi_j_bls_kmckbc_total_legendre_prefix_power)) * bpvi_v_bls_kmckbc_total_legendre_prefix_power)) /\ exists bpvi_q_bls_kmckbc_total_legendre_prefix_power_successor. bpvi_u_bls_kmckbc_total_legendre_prefix_power = bpvi_q_bls_kmckbc_total_legendre_prefix_power_successor * S ((S (S bpvi_j_bls_kmckbc_total_legendre_prefix_power)) * bpvi_v_bls_kmckbc_total_legendre_prefix_power) + (bpvi_successor_bls_kmckbc_total_legendre_prefix_power))) /\ bpvi_successor_bls_kmckbc_total_legendre_prefix_power = bpvi_partial_bls_kmckbc_total_legendre_prefix_power * bpvi_factor_bls_kmckbc_total_legendre_prefix_power)))))))) /\ ((((exists ff_h_bls_kmckbc_total_legendre_prefix_quotient_entry. ff_h_bls_kmckbc_total_legendre_prefix_quotient_entry + S (bls_quotient_kmckbc_total_legendre_prefix) = S ((S (bls_index_kmckbc_total_legendre_prefix)) * bls_scale_kmckbc_total_legendre)) /\ exists ff_q_bls_kmckbc_total_legendre_prefix_quotient_entry. bls_code_kmckbc_total_legendre = ff_q_bls_kmckbc_total_legendre_prefix_quotient_entry * S ((S (bls_index_kmckbc_total_legendre_prefix)) * bls_scale_kmckbc_total_legendre) + (bls_quotient_kmckbc_total_legendre_prefix))) /\ (((a + b) = bls_power_kmckbc_total_legendre_prefix * bls_quotient_kmckbc_total_legendre_prefix + bls_remainder_kmckbc_total_legendre_prefix /\ exists bls_remainder_gap_kmckbc_total_legendre_prefix_division. bls_remainder_gap_kmckbc_total_legendre_prefix_division + S (bls_remainder_kmckbc_total_legendre_prefix) = bls_power_kmckbc_total_legendre_prefix))))) /\ (exists ff_u_bls_kmckbc_total_legendre_sum ff_v_bls_kmckbc_total_legendre_sum. ((((exists ff_h_bls_kmckbc_total_legendre_sum_start. ff_h_bls_kmckbc_total_legendre_sum_start + S (0) = S ((S (0)) * ff_v_bls_kmckbc_total_legendre_sum)) /\ exists ff_q_bls_kmckbc_total_legendre_sum_start. ff_u_bls_kmckbc_total_legendre_sum = ff_q_bls_kmckbc_total_legendre_sum_start * S ((S (0)) * ff_v_bls_kmckbc_total_legendre_sum) + (0))) /\ ((((exists ff_h_bls_kmckbc_total_legendre_sum_terminal. ff_h_bls_kmckbc_total_legendre_sum_terminal + S (T) = S ((S ((a + b))) * ff_v_bls_kmckbc_total_legendre_sum)) /\ exists ff_q_bls_kmckbc_total_legendre_sum_terminal. ff_u_bls_kmckbc_total_legendre_sum = ff_q_bls_kmckbc_total_legendre_sum_terminal * S ((S ((a + b))) * ff_v_bls_kmckbc_total_legendre_sum) + (T))) /\ forall ff_i_bls_kmckbc_total_legendre_sum. (exists ff_lt_bls_kmckbc_total_legendre_sum_bound. ff_lt_bls_kmckbc_total_legendre_sum_bound + S ff_i_bls_kmckbc_total_legendre_sum = (a + b)) -> exists ff_a_bls_kmckbc_total_legendre_sum ff_r_bls_kmckbc_total_legendre_sum ff_s_bls_kmckbc_total_legendre_sum. ((((exists ff_h_bls_kmckbc_total_legendre_sum_summand. ff_h_bls_kmckbc_total_legendre_sum_summand + S (ff_a_bls_kmckbc_total_legendre_sum) = S ((S (ff_i_bls_kmckbc_total_legendre_sum)) * bls_scale_kmckbc_total_legendre)) /\ exists ff_q_bls_kmckbc_total_legendre_sum_summand. bls_code_kmckbc_total_legendre = ff_q_bls_kmckbc_total_legendre_sum_summand * S ((S (ff_i_bls_kmckbc_total_legendre_sum)) * bls_scale_kmckbc_total_legendre) + (ff_a_bls_kmckbc_total_legendre_sum))) /\ ((((exists ff_h_bls_kmckbc_total_legendre_sum_partial. ff_h_bls_kmckbc_total_legendre_sum_partial + S (ff_r_bls_kmckbc_total_legendre_sum) = S ((S (ff_i_bls_kmckbc_total_legendre_sum)) * ff_v_bls_kmckbc_total_legendre_sum)) /\ exists ff_q_bls_kmckbc_total_legendre_sum_partial. ff_u_bls_kmckbc_total_legendre_sum = ff_q_bls_kmckbc_total_legendre_sum_partial * S ((S (ff_i_bls_kmckbc_total_legendre_sum)) * ff_v_bls_kmckbc_total_legendre_sum) + (ff_r_bls_kmckbc_total_legendre_sum))) /\ ((((exists ff_h_bls_kmckbc_total_legendre_sum_successor. ff_h_bls_kmckbc_total_legendre_sum_successor + S (ff_s_bls_kmckbc_total_legendre_sum) = S ((S (S ff_i_bls_kmckbc_total_legendre_sum)) * ff_v_bls_kmckbc_total_legendre_sum)) /\ exists ff_q_bls_kmckbc_total_legendre_sum_successor. ff_u_bls_kmckbc_total_legendre_sum = ff_q_bls_kmckbc_total_legendre_sum_successor * S ((S (S ff_i_bls_kmckbc_total_legendre_sum)) * ff_v_bls_kmckbc_total_legendre_sum) + (ff_s_bls_kmckbc_total_legendre_sum))) /\ ff_s_bls_kmckbc_total_legendre_sum = ff_r_bls_kmckbc_total_legendre_sum + ff_a_bls_kmckbc_total_legendre_sum)))))))
  22. 0022specialize prime_legendre_sum_exists p
  23. 0023specialize prime_legendre_sum_exists (a + b)
  24. 0024apply prime_legendre_sum_exists
  25. 0025exact hp
  26. 0026cases htotal_legendre
  27. 0027have hvaluation_balance : x2 = (x + x1) + v
  28. 0028specialize binomial_legendre_valuation_balance p
  29. 0029specialize binomial_legendre_valuation_balance a
  30. 0030specialize binomial_legendre_valuation_balance b
  31. 0031specialize binomial_legendre_valuation_balance C
  32. 0032specialize binomial_legendre_valuation_balance v
  33. 0033specialize binomial_legendre_valuation_balance x2
  34. 0034specialize binomial_legendre_valuation_balance x
  35. 0035specialize binomial_legendre_valuation_balance x1
  36. 0036apply binomial_legendre_valuation_balance
  37. 0037exact hp
  38. 0038exact hchoose
  39. 0039exact hvaluation
  40. 0040exact htotal_legendre_witness
  41. 0041exact hleft_legendre_witness
  42. 0042exact hright_legendre_witness
  43. 0043have hleft_extended : ∃ lb. ∃ lc. PowerQuotPrefix(p,a,lb,lc,a + b)Sum(lb,lc,a + b,x)
    Exact native replay linehave hleft_extended : exists lb lc. (forall bls_index_kmckbc_left_extended_prefix. (exists bls_gap_kmckbc_left_extended_prefix_bound. bls_gap_kmckbc_left_extended_prefix_bound + S (bls_index_kmckbc_left_extended_prefix) = (a + b)) -> exists bls_power_kmckbc_left_extended_prefix bls_quotient_kmckbc_left_extended_prefix bls_remainder_kmckbc_left_extended_prefix. ((exists bpvi_b_bls_kmckbc_left_extended_prefix_power bpvi_c_bls_kmckbc_left_extended_prefix_power. ((forall bpvi_i_bls_kmckbc_left_extended_prefix_power. (exists bpvi_repeat_gap_bls_kmckbc_left_extended_prefix_power. bpvi_repeat_gap_bls_kmckbc_left_extended_prefix_power + S bpvi_i_bls_kmckbc_left_extended_prefix_power = S bls_index_kmckbc_left_extended_prefix) -> (((exists bpvi_h_bls_kmckbc_left_extended_prefix_power_repeat. bpvi_h_bls_kmckbc_left_extended_prefix_power_repeat + S (p) = S ((S (bpvi_i_bls_kmckbc_left_extended_prefix_power)) * bpvi_c_bls_kmckbc_left_extended_prefix_power)) /\ exists bpvi_q_bls_kmckbc_left_extended_prefix_power_repeat. bpvi_b_bls_kmckbc_left_extended_prefix_power = bpvi_q_bls_kmckbc_left_extended_prefix_power_repeat * S ((S (bpvi_i_bls_kmckbc_left_extended_prefix_power)) * bpvi_c_bls_kmckbc_left_extended_prefix_power) + (p)))) /\ (exists bpvi_u_bls_kmckbc_left_extended_prefix_power bpvi_v_bls_kmckbc_left_extended_prefix_power. ((((exists bpvi_h_bls_kmckbc_left_extended_prefix_power_start. bpvi_h_bls_kmckbc_left_extended_prefix_power_start + S (1) = S ((S (0)) * bpvi_v_bls_kmckbc_left_extended_prefix_power)) /\ exists bpvi_q_bls_kmckbc_left_extended_prefix_power_start. bpvi_u_bls_kmckbc_left_extended_prefix_power = bpvi_q_bls_kmckbc_left_extended_prefix_power_start * S ((S (0)) * bpvi_v_bls_kmckbc_left_extended_prefix_power) + (1))) /\ ((((exists bpvi_h_bls_kmckbc_left_extended_prefix_power_terminal. bpvi_h_bls_kmckbc_left_extended_prefix_power_terminal + S (bls_power_kmckbc_left_extended_prefix) = S ((S (S bls_index_kmckbc_left_extended_prefix)) * bpvi_v_bls_kmckbc_left_extended_prefix_power)) /\ exists bpvi_q_bls_kmckbc_left_extended_prefix_power_terminal. bpvi_u_bls_kmckbc_left_extended_prefix_power = bpvi_q_bls_kmckbc_left_extended_prefix_power_terminal * S ((S (S bls_index_kmckbc_left_extended_prefix)) * bpvi_v_bls_kmckbc_left_extended_prefix_power) + (bls_power_kmckbc_left_extended_prefix))) /\ forall bpvi_j_bls_kmckbc_left_extended_prefix_power. (exists bpvi_product_gap_bls_kmckbc_left_extended_prefix_power. bpvi_product_gap_bls_kmckbc_left_extended_prefix_power + S bpvi_j_bls_kmckbc_left_extended_prefix_power = S bls_index_kmckbc_left_extended_prefix) -> exists bpvi_factor_bls_kmckbc_left_extended_prefix_power bpvi_partial_bls_kmckbc_left_extended_prefix_power bpvi_successor_bls_kmckbc_left_extended_prefix_power. ((((exists bpvi_h_bls_kmckbc_left_extended_prefix_power_factor. bpvi_h_bls_kmckbc_left_extended_prefix_power_factor + S (bpvi_factor_bls_kmckbc_left_extended_prefix_power) = S ((S (bpvi_j_bls_kmckbc_left_extended_prefix_power)) * bpvi_c_bls_kmckbc_left_extended_prefix_power)) /\ exists bpvi_q_bls_kmckbc_left_extended_prefix_power_factor. bpvi_b_bls_kmckbc_left_extended_prefix_power = bpvi_q_bls_kmckbc_left_extended_prefix_power_factor * S ((S (bpvi_j_bls_kmckbc_left_extended_prefix_power)) * bpvi_c_bls_kmckbc_left_extended_prefix_power) + (bpvi_factor_bls_kmckbc_left_extended_prefix_power))) /\ ((((exists bpvi_h_bls_kmckbc_left_extended_prefix_power_partial. bpvi_h_bls_kmckbc_left_extended_prefix_power_partial + S (bpvi_partial_bls_kmckbc_left_extended_prefix_power) = S ((S (bpvi_j_bls_kmckbc_left_extended_prefix_power)) * bpvi_v_bls_kmckbc_left_extended_prefix_power)) /\ exists bpvi_q_bls_kmckbc_left_extended_prefix_power_partial. bpvi_u_bls_kmckbc_left_extended_prefix_power = bpvi_q_bls_kmckbc_left_extended_prefix_power_partial * S ((S (bpvi_j_bls_kmckbc_left_extended_prefix_power)) * bpvi_v_bls_kmckbc_left_extended_prefix_power) + (bpvi_partial_bls_kmckbc_left_extended_prefix_power))) /\ ((((exists bpvi_h_bls_kmckbc_left_extended_prefix_power_successor. bpvi_h_bls_kmckbc_left_extended_prefix_power_successor + S (bpvi_successor_bls_kmckbc_left_extended_prefix_power) = S ((S (S bpvi_j_bls_kmckbc_left_extended_prefix_power)) * bpvi_v_bls_kmckbc_left_extended_prefix_power)) /\ exists bpvi_q_bls_kmckbc_left_extended_prefix_power_successor. bpvi_u_bls_kmckbc_left_extended_prefix_power = bpvi_q_bls_kmckbc_left_extended_prefix_power_successor * S ((S (S bpvi_j_bls_kmckbc_left_extended_prefix_power)) * bpvi_v_bls_kmckbc_left_extended_prefix_power) + (bpvi_successor_bls_kmckbc_left_extended_prefix_power))) /\ bpvi_successor_bls_kmckbc_left_extended_prefix_power = bpvi_partial_bls_kmckbc_left_extended_prefix_power * bpvi_factor_bls_kmckbc_left_extended_prefix_power)))))))) /\ ((((exists ff_h_bls_kmckbc_left_extended_prefix_quotient_entry. ff_h_bls_kmckbc_left_extended_prefix_quotient_entry + S (bls_quotient_kmckbc_left_extended_prefix) = S ((S (bls_index_kmckbc_left_extended_prefix)) * lc)) /\ exists ff_q_bls_kmckbc_left_extended_prefix_quotient_entry. lb = ff_q_bls_kmckbc_left_extended_prefix_quotient_entry * S ((S (bls_index_kmckbc_left_extended_prefix)) * lc) + (bls_quotient_kmckbc_left_extended_prefix))) /\ ((a = bls_power_kmckbc_left_extended_prefix * bls_quotient_kmckbc_left_extended_prefix + bls_remainder_kmckbc_left_extended_prefix /\ exists bls_remainder_gap_kmckbc_left_extended_prefix_division. bls_remainder_gap_kmckbc_left_extended_prefix_division + S (bls_remainder_kmckbc_left_extended_prefix) = bls_power_kmckbc_left_extended_prefix))))) /\ (exists fs_u_kmckbc_left_extended_sum fs_v_kmckbc_left_extended_sum. ((((exists fs_h_kmckbc_left_extended_sum_body_start. fs_h_kmckbc_left_extended_sum_body_start + S (0) = S ((S (0)) * fs_v_kmckbc_left_extended_sum)) /\ exists fs_q_kmckbc_left_extended_sum_body_start. fs_u_kmckbc_left_extended_sum = fs_q_kmckbc_left_extended_sum_body_start * S ((S (0)) * fs_v_kmckbc_left_extended_sum) + (0))) /\ ((((exists fs_h_kmckbc_left_extended_sum_body_terminal. fs_h_kmckbc_left_extended_sum_body_terminal + S (x) = S ((S (a + b)) * fs_v_kmckbc_left_extended_sum)) /\ exists fs_q_kmckbc_left_extended_sum_body_terminal. fs_u_kmckbc_left_extended_sum = fs_q_kmckbc_left_extended_sum_body_terminal * S ((S (a + b)) * fs_v_kmckbc_left_extended_sum) + (x))) /\ forall fs_i_kmckbc_left_extended_sum_body_steps. (exists fs_lt_kmckbc_left_extended_sum_body_steps_bound. fs_lt_kmckbc_left_extended_sum_body_steps_bound + S fs_i_kmckbc_left_extended_sum_body_steps = a + b) -> exists fs_a_kmckbc_left_extended_sum_body_steps fs_r_kmckbc_left_extended_sum_body_steps fs_s_kmckbc_left_extended_sum_body_steps. ((((exists fs_h_kmckbc_left_extended_sum_body_steps_summand. fs_h_kmckbc_left_extended_sum_body_steps_summand + S (fs_a_kmckbc_left_extended_sum_body_steps) = S ((S (fs_i_kmckbc_left_extended_sum_body_steps)) * lc)) /\ exists fs_q_kmckbc_left_extended_sum_body_steps_summand. lb = fs_q_kmckbc_left_extended_sum_body_steps_summand * S ((S (fs_i_kmckbc_left_extended_sum_body_steps)) * lc) + (fs_a_kmckbc_left_extended_sum_body_steps))) /\ ((((exists fs_h_kmckbc_left_extended_sum_body_steps_partial. fs_h_kmckbc_left_extended_sum_body_steps_partial + S (fs_r_kmckbc_left_extended_sum_body_steps) = S ((S (fs_i_kmckbc_left_extended_sum_body_steps)) * fs_v_kmckbc_left_extended_sum)) /\ exists fs_q_kmckbc_left_extended_sum_body_steps_partial. fs_u_kmckbc_left_extended_sum = fs_q_kmckbc_left_extended_sum_body_steps_partial * S ((S (fs_i_kmckbc_left_extended_sum_body_steps)) * fs_v_kmckbc_left_extended_sum) + (fs_r_kmckbc_left_extended_sum_body_steps))) /\ ((((exists fs_h_kmckbc_left_extended_sum_body_steps_successor. fs_h_kmckbc_left_extended_sum_body_steps_successor + S (fs_s_kmckbc_left_extended_sum_body_steps) = S ((S (S fs_i_kmckbc_left_extended_sum_body_steps)) * fs_v_kmckbc_left_extended_sum)) /\ exists fs_q_kmckbc_left_extended_sum_body_steps_successor. fs_u_kmckbc_left_extended_sum = fs_q_kmckbc_left_extended_sum_body_steps_successor * S ((S (S fs_i_kmckbc_left_extended_sum_body_steps)) * fs_v_kmckbc_left_extended_sum) + (fs_s_kmckbc_left_extended_sum_body_steps))) /\ fs_s_kmckbc_left_extended_sum_body_steps = fs_r_kmckbc_left_extended_sum_body_steps + fs_a_kmckbc_left_extended_sum_body_steps))))))
  44. 0044specialize legendre_sum_extended_prefix_exists p
  45. 0045specialize legendre_sum_extended_prefix_exists a
  46. 0046specialize legendre_sum_extended_prefix_exists x
  47. 0047specialize legendre_sum_extended_prefix_exists b
  48. 0048apply legendre_sum_extended_prefix_exists
  49. 0049exact hp
  50. 0050exact hleft_legendre_witness
  51. 0051cases hleft_extended
  52. 0052cases hleft_extended_witness
  53. 0053cases hleft_extended_witness_witness
  54. 0054have hright_extended : ∃ rb. ∃ rc. PowerQuotPrefix(p,b,rb,rc,b + a)Sum(rb,rc,b + a,x1)
    Exact native replay linehave hright_extended : exists rb rc. (forall bls_index_kmckbc_right_extended_prefix. (exists bls_gap_kmckbc_right_extended_prefix_bound. bls_gap_kmckbc_right_extended_prefix_bound + S (bls_index_kmckbc_right_extended_prefix) = (b + a)) -> exists bls_power_kmckbc_right_extended_prefix bls_quotient_kmckbc_right_extended_prefix bls_remainder_kmckbc_right_extended_prefix. ((exists bpvi_b_bls_kmckbc_right_extended_prefix_power bpvi_c_bls_kmckbc_right_extended_prefix_power. ((forall bpvi_i_bls_kmckbc_right_extended_prefix_power. (exists bpvi_repeat_gap_bls_kmckbc_right_extended_prefix_power. bpvi_repeat_gap_bls_kmckbc_right_extended_prefix_power + S bpvi_i_bls_kmckbc_right_extended_prefix_power = S bls_index_kmckbc_right_extended_prefix) -> (((exists bpvi_h_bls_kmckbc_right_extended_prefix_power_repeat. bpvi_h_bls_kmckbc_right_extended_prefix_power_repeat + S (p) = S ((S (bpvi_i_bls_kmckbc_right_extended_prefix_power)) * bpvi_c_bls_kmckbc_right_extended_prefix_power)) /\ exists bpvi_q_bls_kmckbc_right_extended_prefix_power_repeat. bpvi_b_bls_kmckbc_right_extended_prefix_power = bpvi_q_bls_kmckbc_right_extended_prefix_power_repeat * S ((S (bpvi_i_bls_kmckbc_right_extended_prefix_power)) * bpvi_c_bls_kmckbc_right_extended_prefix_power) + (p)))) /\ (exists bpvi_u_bls_kmckbc_right_extended_prefix_power bpvi_v_bls_kmckbc_right_extended_prefix_power. ((((exists bpvi_h_bls_kmckbc_right_extended_prefix_power_start. bpvi_h_bls_kmckbc_right_extended_prefix_power_start + S (1) = S ((S (0)) * bpvi_v_bls_kmckbc_right_extended_prefix_power)) /\ exists bpvi_q_bls_kmckbc_right_extended_prefix_power_start. bpvi_u_bls_kmckbc_right_extended_prefix_power = bpvi_q_bls_kmckbc_right_extended_prefix_power_start * S ((S (0)) * bpvi_v_bls_kmckbc_right_extended_prefix_power) + (1))) /\ ((((exists bpvi_h_bls_kmckbc_right_extended_prefix_power_terminal. bpvi_h_bls_kmckbc_right_extended_prefix_power_terminal + S (bls_power_kmckbc_right_extended_prefix) = S ((S (S bls_index_kmckbc_right_extended_prefix)) * bpvi_v_bls_kmckbc_right_extended_prefix_power)) /\ exists bpvi_q_bls_kmckbc_right_extended_prefix_power_terminal. bpvi_u_bls_kmckbc_right_extended_prefix_power = bpvi_q_bls_kmckbc_right_extended_prefix_power_terminal * S ((S (S bls_index_kmckbc_right_extended_prefix)) * bpvi_v_bls_kmckbc_right_extended_prefix_power) + (bls_power_kmckbc_right_extended_prefix))) /\ forall bpvi_j_bls_kmckbc_right_extended_prefix_power. (exists bpvi_product_gap_bls_kmckbc_right_extended_prefix_power. bpvi_product_gap_bls_kmckbc_right_extended_prefix_power + S bpvi_j_bls_kmckbc_right_extended_prefix_power = S bls_index_kmckbc_right_extended_prefix) -> exists bpvi_factor_bls_kmckbc_right_extended_prefix_power bpvi_partial_bls_kmckbc_right_extended_prefix_power bpvi_successor_bls_kmckbc_right_extended_prefix_power. ((((exists bpvi_h_bls_kmckbc_right_extended_prefix_power_factor. bpvi_h_bls_kmckbc_right_extended_prefix_power_factor + S (bpvi_factor_bls_kmckbc_right_extended_prefix_power) = S ((S (bpvi_j_bls_kmckbc_right_extended_prefix_power)) * bpvi_c_bls_kmckbc_right_extended_prefix_power)) /\ exists bpvi_q_bls_kmckbc_right_extended_prefix_power_factor. bpvi_b_bls_kmckbc_right_extended_prefix_power = bpvi_q_bls_kmckbc_right_extended_prefix_power_factor * S ((S (bpvi_j_bls_kmckbc_right_extended_prefix_power)) * bpvi_c_bls_kmckbc_right_extended_prefix_power) + (bpvi_factor_bls_kmckbc_right_extended_prefix_power))) /\ ((((exists bpvi_h_bls_kmckbc_right_extended_prefix_power_partial. bpvi_h_bls_kmckbc_right_extended_prefix_power_partial + S (bpvi_partial_bls_kmckbc_right_extended_prefix_power) = S ((S (bpvi_j_bls_kmckbc_right_extended_prefix_power)) * bpvi_v_bls_kmckbc_right_extended_prefix_power)) /\ exists bpvi_q_bls_kmckbc_right_extended_prefix_power_partial. bpvi_u_bls_kmckbc_right_extended_prefix_power = bpvi_q_bls_kmckbc_right_extended_prefix_power_partial * S ((S (bpvi_j_bls_kmckbc_right_extended_prefix_power)) * bpvi_v_bls_kmckbc_right_extended_prefix_power) + (bpvi_partial_bls_kmckbc_right_extended_prefix_power))) /\ ((((exists bpvi_h_bls_kmckbc_right_extended_prefix_power_successor. bpvi_h_bls_kmckbc_right_extended_prefix_power_successor + S (bpvi_successor_bls_kmckbc_right_extended_prefix_power) = S ((S (S bpvi_j_bls_kmckbc_right_extended_prefix_power)) * bpvi_v_bls_kmckbc_right_extended_prefix_power)) /\ exists bpvi_q_bls_kmckbc_right_extended_prefix_power_successor. bpvi_u_bls_kmckbc_right_extended_prefix_power = bpvi_q_bls_kmckbc_right_extended_prefix_power_successor * S ((S (S bpvi_j_bls_kmckbc_right_extended_prefix_power)) * bpvi_v_bls_kmckbc_right_extended_prefix_power) + (bpvi_successor_bls_kmckbc_right_extended_prefix_power))) /\ bpvi_successor_bls_kmckbc_right_extended_prefix_power = bpvi_partial_bls_kmckbc_right_extended_prefix_power * bpvi_factor_bls_kmckbc_right_extended_prefix_power)))))))) /\ ((((exists ff_h_bls_kmckbc_right_extended_prefix_quotient_entry. ff_h_bls_kmckbc_right_extended_prefix_quotient_entry + S (bls_quotient_kmckbc_right_extended_prefix) = S ((S (bls_index_kmckbc_right_extended_prefix)) * rc)) /\ exists ff_q_bls_kmckbc_right_extended_prefix_quotient_entry. rb = ff_q_bls_kmckbc_right_extended_prefix_quotient_entry * S ((S (bls_index_kmckbc_right_extended_prefix)) * rc) + (bls_quotient_kmckbc_right_extended_prefix))) /\ ((b = bls_power_kmckbc_right_extended_prefix * bls_quotient_kmckbc_right_extended_prefix + bls_remainder_kmckbc_right_extended_prefix /\ exists bls_remainder_gap_kmckbc_right_extended_prefix_division. bls_remainder_gap_kmckbc_right_extended_prefix_division + S (bls_remainder_kmckbc_right_extended_prefix) = bls_power_kmckbc_right_extended_prefix))))) /\ (exists fs_u_kmckbc_right_extended_sum fs_v_kmckbc_right_extended_sum. ((((exists fs_h_kmckbc_right_extended_sum_body_start. fs_h_kmckbc_right_extended_sum_body_start + S (0) = S ((S (0)) * fs_v_kmckbc_right_extended_sum)) /\ exists fs_q_kmckbc_right_extended_sum_body_start. fs_u_kmckbc_right_extended_sum = fs_q_kmckbc_right_extended_sum_body_start * S ((S (0)) * fs_v_kmckbc_right_extended_sum) + (0))) /\ ((((exists fs_h_kmckbc_right_extended_sum_body_terminal. fs_h_kmckbc_right_extended_sum_body_terminal + S (x1) = S ((S (b + a)) * fs_v_kmckbc_right_extended_sum)) /\ exists fs_q_kmckbc_right_extended_sum_body_terminal. fs_u_kmckbc_right_extended_sum = fs_q_kmckbc_right_extended_sum_body_terminal * S ((S (b + a)) * fs_v_kmckbc_right_extended_sum) + (x1))) /\ forall fs_i_kmckbc_right_extended_sum_body_steps. (exists fs_lt_kmckbc_right_extended_sum_body_steps_bound. fs_lt_kmckbc_right_extended_sum_body_steps_bound + S fs_i_kmckbc_right_extended_sum_body_steps = b + a) -> exists fs_a_kmckbc_right_extended_sum_body_steps fs_r_kmckbc_right_extended_sum_body_steps fs_s_kmckbc_right_extended_sum_body_steps. ((((exists fs_h_kmckbc_right_extended_sum_body_steps_summand. fs_h_kmckbc_right_extended_sum_body_steps_summand + S (fs_a_kmckbc_right_extended_sum_body_steps) = S ((S (fs_i_kmckbc_right_extended_sum_body_steps)) * rc)) /\ exists fs_q_kmckbc_right_extended_sum_body_steps_summand. rb = fs_q_kmckbc_right_extended_sum_body_steps_summand * S ((S (fs_i_kmckbc_right_extended_sum_body_steps)) * rc) + (fs_a_kmckbc_right_extended_sum_body_steps))) /\ ((((exists fs_h_kmckbc_right_extended_sum_body_steps_partial. fs_h_kmckbc_right_extended_sum_body_steps_partial + S (fs_r_kmckbc_right_extended_sum_body_steps) = S ((S (fs_i_kmckbc_right_extended_sum_body_steps)) * fs_v_kmckbc_right_extended_sum)) /\ exists fs_q_kmckbc_right_extended_sum_body_steps_partial. fs_u_kmckbc_right_extended_sum = fs_q_kmckbc_right_extended_sum_body_steps_partial * S ((S (fs_i_kmckbc_right_extended_sum_body_steps)) * fs_v_kmckbc_right_extended_sum) + (fs_r_kmckbc_right_extended_sum_body_steps))) /\ ((((exists fs_h_kmckbc_right_extended_sum_body_steps_successor. fs_h_kmckbc_right_extended_sum_body_steps_successor + S (fs_s_kmckbc_right_extended_sum_body_steps) = S ((S (S fs_i_kmckbc_right_extended_sum_body_steps)) * fs_v_kmckbc_right_extended_sum)) /\ exists fs_q_kmckbc_right_extended_sum_body_steps_successor. fs_u_kmckbc_right_extended_sum = fs_q_kmckbc_right_extended_sum_body_steps_successor * S ((S (S fs_i_kmckbc_right_extended_sum_body_steps)) * fs_v_kmckbc_right_extended_sum) + (fs_s_kmckbc_right_extended_sum_body_steps))) /\ fs_s_kmckbc_right_extended_sum_body_steps = fs_r_kmckbc_right_extended_sum_body_steps + fs_a_kmckbc_right_extended_sum_body_steps))))))
  55. 0055specialize legendre_sum_extended_prefix_exists p
  56. 0056specialize legendre_sum_extended_prefix_exists b
  57. 0057specialize legendre_sum_extended_prefix_exists x1
  58. 0058specialize legendre_sum_extended_prefix_exists a
  59. 0059apply legendre_sum_extended_prefix_exists
  60. 0060exact hp
  61. 0061exact hright_legendre_witness
  62. 0062cases hright_extended
  63. 0063cases hright_extended_witness
  64. 0064cases hright_extended_witness_witness
  65. 0065have hlength : b + a = a + b
  66. 0066apply add_comm
  67. 0067rewrite hlength at hright_extended_witness_witness_left
  68. 0068rewrite hlength at hright_extended_witness_witness_right
  69. 0069rewrite hlength at hright_extended_witness_witness_right
  70. 0070rewrite hlength at hright_extended_witness_witness_right
  71. 0071cases htotal_legendre_witness
  72. 0072cases htotal_legendre_witness_witness
  73. 0073cases htotal_legendre_witness_witness_witness
  74. 0074have hcarry_codes : ∃ cb. ∃ cc. ∀ kmc_index_kmckbc_carry_codes. Lt(kmc_index_kmckbc_carry_codes,a + b) → ∃ x. ∃ y. ∃ z. ∃ n. BetaAt(x3,x4,kmc_index_kmckbc_carry_codes,x) ∧ (BetaAt(x5,x6,kmc_index_kmckbc_carry_codes,y) ∧ (BetaAt(x7,x8,kmc_index_kmckbc_carry_codes,z) ∧ (BetaAt(cb,cc,kmc_index_kmckbc_carry_codes,n) ∧ (n = 0 ∧ z = x + y ∨ n = 1 ∧ z = S (x + y)))))
    Exact native replay linehave hcarry_codes : exists cb cc. forall kmc_index_kmckbc_carry_codes. (exists bcf_lt_gap_kmckbc_carry_codes_bound. bcf_lt_gap_kmckbc_carry_codes_bound + S (kmc_index_kmckbc_carry_codes) = a + b) -> exists kmc_left_kmckbc_carry_codes kmc_right_kmckbc_carry_codes kmc_total_kmckbc_carry_codes kmc_bit_kmckbc_carry_codes. (((exists fs_h_kmckbc_carry_codes_left. fs_h_kmckbc_carry_codes_left + S (kmc_left_kmckbc_carry_codes) = S ((S (kmc_index_kmckbc_carry_codes)) * x4)) /\ exists fs_q_kmckbc_carry_codes_left. x3 = fs_q_kmckbc_carry_codes_left * S ((S (kmc_index_kmckbc_carry_codes)) * x4) + (kmc_left_kmckbc_carry_codes))) /\ ((((exists fs_h_kmckbc_carry_codes_right. fs_h_kmckbc_carry_codes_right + S (kmc_right_kmckbc_carry_codes) = S ((S (kmc_index_kmckbc_carry_codes)) * x6)) /\ exists fs_q_kmckbc_carry_codes_right. x5 = fs_q_kmckbc_carry_codes_right * S ((S (kmc_index_kmckbc_carry_codes)) * x6) + (kmc_right_kmckbc_carry_codes))) /\ ((((exists fs_h_kmckbc_carry_codes_total. fs_h_kmckbc_carry_codes_total + S (kmc_total_kmckbc_carry_codes) = S ((S (kmc_index_kmckbc_carry_codes)) * x8)) /\ exists fs_q_kmckbc_carry_codes_total. x7 = fs_q_kmckbc_carry_codes_total * S ((S (kmc_index_kmckbc_carry_codes)) * x8) + (kmc_total_kmckbc_carry_codes))) /\ ((((exists fs_h_kmckbc_carry_codes_bit. fs_h_kmckbc_carry_codes_bit + S (kmc_bit_kmckbc_carry_codes) = S ((S (kmc_index_kmckbc_carry_codes)) * cc)) /\ exists fs_q_kmckbc_carry_codes_bit. cb = fs_q_kmckbc_carry_codes_bit * S ((S (kmc_index_kmckbc_carry_codes)) * cc) + (kmc_bit_kmckbc_carry_codes))) /\ (((kmc_bit_kmckbc_carry_codes = 0 /\ kmc_total_kmckbc_carry_codes = kmc_left_kmckbc_carry_codes + kmc_right_kmckbc_carry_codes) \/ (kmc_bit_kmckbc_carry_codes = 1 /\ kmc_total_kmckbc_carry_codes = S (kmc_left_kmckbc_carry_codes + kmc_right_kmckbc_carry_codes)))))))
  75. 0075specialize add_quotient_carry_prefix_exists p
  76. 0076specialize add_quotient_carry_prefix_exists a
  77. 0077specialize add_quotient_carry_prefix_exists b
  78. 0078specialize add_quotient_carry_prefix_exists x3
  79. 0079specialize add_quotient_carry_prefix_exists x4
  80. 0080specialize add_quotient_carry_prefix_exists x5
  81. 0081specialize add_quotient_carry_prefix_exists x6
  82. 0082specialize add_quotient_carry_prefix_exists x7
  83. 0083specialize add_quotient_carry_prefix_exists x8
  84. 0084specialize add_quotient_carry_prefix_exists (a + b)
  85. 0085apply add_quotient_carry_prefix_exists
  86. 0086exact hleft_extended_witness_witness_left
  87. 0087exact hright_extended_witness_witness_left
  88. 0088exact htotal_legendre_witness_witness_witness_left
  89. 0089cases hcarry_codes
  90. 0090cases hcarry_codes_witness
  91. 0091have hall_bits : AllBits(x9,x10,a + b)
    Exact native replay linehave hall_bits : forall ff_i_kmckbc_all_bits. (exists ff_lt_kmckbc_all_bits_bound. ff_lt_kmckbc_all_bits_bound + S ff_i_kmckbc_all_bits = (a + b)) -> exists ff_bit_kmckbc_all_bits. ((((exists ff_h_kmckbc_all_bits_decoded. ff_h_kmckbc_all_bits_decoded + S (ff_bit_kmckbc_all_bits) = S ((S (ff_i_kmckbc_all_bits)) * x10)) /\ exists ff_q_kmckbc_all_bits_decoded. x9 = ff_q_kmckbc_all_bits_decoded * S ((S (ff_i_kmckbc_all_bits)) * x10) + (ff_bit_kmckbc_all_bits))) /\ (ff_bit_kmckbc_all_bits = 0 \/ ff_bit_kmckbc_all_bits = 1))
  92. 0092specialize add_quotient_carry_prefix_all_bits x3
  93. 0093specialize add_quotient_carry_prefix_all_bits x4
  94. 0094specialize add_quotient_carry_prefix_all_bits x5
  95. 0095specialize add_quotient_carry_prefix_all_bits x6
  96. 0096specialize add_quotient_carry_prefix_all_bits x7
  97. 0097specialize add_quotient_carry_prefix_all_bits x8
  98. 0098specialize add_quotient_carry_prefix_all_bits x9
  99. 0099specialize add_quotient_carry_prefix_all_bits x10
  100. 0100specialize add_quotient_carry_prefix_all_bits (a + b)
  101. 0101apply add_quotient_carry_prefix_all_bits
  102. 0102exact hcarry_codes_witness_witness
  103. 0103have hcount : ∃ E. BitCount(x9,x10,a + b,E)
    Exact native replay linehave hcount : exists E. ((exists ff_u_kmckbc_count_exists_sum ff_v_kmckbc_count_exists_sum. ((((exists ff_h_kmckbc_count_exists_sum_start. ff_h_kmckbc_count_exists_sum_start + S (0) = S ((S (0)) * ff_v_kmckbc_count_exists_sum)) /\ exists ff_q_kmckbc_count_exists_sum_start. ff_u_kmckbc_count_exists_sum = ff_q_kmckbc_count_exists_sum_start * S ((S (0)) * ff_v_kmckbc_count_exists_sum) + (0))) /\ ((((exists ff_h_kmckbc_count_exists_sum_terminal. ff_h_kmckbc_count_exists_sum_terminal + S ((E)) = S ((S ((a + b))) * ff_v_kmckbc_count_exists_sum)) /\ exists ff_q_kmckbc_count_exists_sum_terminal. ff_u_kmckbc_count_exists_sum = ff_q_kmckbc_count_exists_sum_terminal * S ((S ((a + b))) * ff_v_kmckbc_count_exists_sum) + ((E)))) /\ forall ff_i_kmckbc_count_exists_sum. (exists ff_lt_kmckbc_count_exists_sum_bound. ff_lt_kmckbc_count_exists_sum_bound + S ff_i_kmckbc_count_exists_sum = (a + b)) -> exists ff_a_kmckbc_count_exists_sum ff_r_kmckbc_count_exists_sum ff_s_kmckbc_count_exists_sum. ((((exists ff_h_kmckbc_count_exists_sum_summand. ff_h_kmckbc_count_exists_sum_summand + S (ff_a_kmckbc_count_exists_sum) = S ((S (ff_i_kmckbc_count_exists_sum)) * x10)) /\ exists ff_q_kmckbc_count_exists_sum_summand. x9 = ff_q_kmckbc_count_exists_sum_summand * S ((S (ff_i_kmckbc_count_exists_sum)) * x10) + (ff_a_kmckbc_count_exists_sum))) /\ ((((exists ff_h_kmckbc_count_exists_sum_partial. ff_h_kmckbc_count_exists_sum_partial + S (ff_r_kmckbc_count_exists_sum) = S ((S (ff_i_kmckbc_count_exists_sum)) * ff_v_kmckbc_count_exists_sum)) /\ exists ff_q_kmckbc_count_exists_sum_partial. ff_u_kmckbc_count_exists_sum = ff_q_kmckbc_count_exists_sum_partial * S ((S (ff_i_kmckbc_count_exists_sum)) * ff_v_kmckbc_count_exists_sum) + (ff_r_kmckbc_count_exists_sum))) /\ ((((exists ff_h_kmckbc_count_exists_sum_successor. ff_h_kmckbc_count_exists_sum_successor + S (ff_s_kmckbc_count_exists_sum) = S ((S (S ff_i_kmckbc_count_exists_sum)) * ff_v_kmckbc_count_exists_sum)) /\ exists ff_q_kmckbc_count_exists_sum_successor. ff_u_kmckbc_count_exists_sum = ff_q_kmckbc_count_exists_sum_successor * S ((S (S ff_i_kmckbc_count_exists_sum)) * ff_v_kmckbc_count_exists_sum) + (ff_s_kmckbc_count_exists_sum))) /\ ff_s_kmckbc_count_exists_sum = ff_r_kmckbc_count_exists_sum + ff_a_kmckbc_count_exists_sum)))))) /\ (forall ff_i_kmckbc_count_exists_bits. (exists ff_lt_kmckbc_count_exists_bits_bound. ff_lt_kmckbc_count_exists_bits_bound + S ff_i_kmckbc_count_exists_bits = (a + b)) -> exists ff_bit_kmckbc_count_exists_bits. ((((exists ff_h_kmckbc_count_exists_bits_decoded. ff_h_kmckbc_count_exists_bits_decoded + S (ff_bit_kmckbc_count_exists_bits) = S ((S (ff_i_kmckbc_count_exists_bits)) * x10)) /\ exists ff_q_kmckbc_count_exists_bits_decoded. x9 = ff_q_kmckbc_count_exists_bits_decoded * S ((S (ff_i_kmckbc_count_exists_bits)) * x10) + (ff_bit_kmckbc_count_exists_bits))) /\ (ff_bit_kmckbc_count_exists_bits = 0 \/ ff_bit_kmckbc_count_exists_bits = 1))))
  104. 0104specialize bit_count_exists x9
  105. 0105specialize bit_count_exists x10
  106. 0106specialize bit_count_exists (a + b)
  107. 0107apply bit_count_exists
  108. 0108exact hall_bits
  109. 0109cases hcount
  110. 0110have hcarry_balance : x2 = (x + x1) + x11
  111. 0111specialize beta_sum_add_carry_exact x3
  112. 0112specialize beta_sum_add_carry_exact x4
  113. 0113specialize beta_sum_add_carry_exact x5
  114. 0114specialize beta_sum_add_carry_exact x6
  115. 0115specialize beta_sum_add_carry_exact x7
  116. 0116specialize beta_sum_add_carry_exact x8
  117. 0117specialize beta_sum_add_carry_exact x9
  118. 0118specialize beta_sum_add_carry_exact x10
  119. 0119specialize beta_sum_add_carry_exact (a + b)
  120. 0120specialize beta_sum_add_carry_exact x
  121. 0121specialize beta_sum_add_carry_exact x1
  122. 0122specialize beta_sum_add_carry_exact x2
  123. 0123specialize beta_sum_add_carry_exact x11
  124. 0124apply beta_sum_add_carry_exact
  125. 0125exact hleft_extended_witness_witness_right
  126. 0126exact hright_extended_witness_witness_right
  127. 0127exact htotal_legendre_witness_witness_witness_right
  128. 0128exact hcarry_codes_witness_witness
  129. 0129exact hcount_witness
  130. 0130have hcount_eq : x11 = v
  131. 0131specialize add_left_cancel (x + x1)
  132. 0132specialize add_left_cancel x11
  133. 0133specialize add_left_cancel v
  134. 0134apply add_left_cancel
  135. 0135trans x2
  136. 0136symm
  137. 0137exact hcarry_balance
  138. 0138exact hvaluation_balance
  139. 0139rewrite hcount_eq at hcount_witness
  140. 0140rewrite hcount_eq at hcount_witness
  141. 0141exists x3
  142. 0142exists x4
  143. 0143exists x5
  144. 0144exists x6
  145. 0145exists x7
  146. 0146exists x8
  147. 0147exists x9
  148. 0148exists x10
  149. 0149split
  150. 0150exact hleft_extended_witness_witness_left
  151. 0151split
  152. 0152exact hright_extended_witness_witness_left
  153. 0153split
  154. 0154exact htotal_legendre_witness_witness_witness_left
  155. 0155split
  156. 0156exact hcarry_codes_witness_witness
  157. 0157exact hcount_witness