BX0010

binary_modular_exponentiation_result_exists_unique

Every guarded modular exponentiation has exactly one actual canonical natural result.

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

Current library: Alpha v34, 4,223 checked-use theorems; Stable remains 432. Historical first admissions, original proof editions, and non-admitted aliases are preserved. Exact original first-admission records.

G102 was OPEN when this family was first admitted in Alpha v21. It is now CLOSED in Alpha v23: every arbitrary exponent has actual canonical beta-coded digits, a complete modular execution, and exact counted bound operations≤3*BitLen(e)+2.

Exact theorem in conservative defined notation

∀ a. ∀ e. ∀ m. BinaryModulus(m) → ∃ x. BinaryModularPower(a,e,m,x) ∧ (∀ y. BinaryModularPower(a,e,m,y) → x = y)

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

Definition DAG

Actual proof prerequisites

Original expanded first-order statement
forall a e m. (exists ff_modulus_gap_binary_guard. ff_modulus_gap_binary_guard + S 1 = m) -> exists r. ((exists ff_power_binary_result. ((exists ff_b_binary_result_value ff_c_binary_result_value. ((forall ff_i_binary_result_value_repeat. (exists ff_lt_binary_result_value_repeat_bound. ff_lt_binary_result_value_repeat_bound + S ff_i_binary_result_value_repeat = e) -> (((exists ff_h_binary_result_value_repeat_decoded. ff_h_binary_result_value_repeat_decoded + S (a) = S ((S (ff_i_binary_result_value_repeat)) * ff_c_binary_result_value)) /\ exists ff_q_binary_result_value_repeat_decoded. ff_b_binary_result_value = ff_q_binary_result_value_repeat_decoded * S ((S (ff_i_binary_result_value_repeat)) * ff_c_binary_result_value) + (a)))) /\ (exists ff_u_binary_result_value_product ff_v_binary_result_value_product. ((((exists ff_h_binary_result_value_product_start. ff_h_binary_result_value_product_start + S (1) = S ((S (0)) * ff_v_binary_result_value_product)) /\ exists ff_q_binary_result_value_product_start. ff_u_binary_result_value_product = ff_q_binary_result_value_product_start * S ((S (0)) * ff_v_binary_result_value_product) + (1))) /\ ((((exists ff_h_binary_result_value_product_terminal. ff_h_binary_result_value_product_terminal + S (ff_power_binary_result) = S ((S (e)) * ff_v_binary_result_value_product)) /\ exists ff_q_binary_result_value_product_terminal. ff_u_binary_result_value_product = ff_q_binary_result_value_product_terminal * S ((S (e)) * ff_v_binary_result_value_product) + (ff_power_binary_result))) /\ forall ff_i_binary_result_value_product. (exists ff_lt_binary_result_value_product_bound. ff_lt_binary_result_value_product_bound + S ff_i_binary_result_value_product = e) -> exists ff_p_binary_result_value_product ff_r_binary_result_value_product ff_s_binary_result_value_product. ((((exists ff_h_binary_result_value_product_factor. ff_h_binary_result_value_product_factor + S (ff_p_binary_result_value_product) = S ((S (ff_i_binary_result_value_product)) * ff_c_binary_result_value)) /\ exists ff_q_binary_result_value_product_factor. ff_b_binary_result_value = ff_q_binary_result_value_product_factor * S ((S (ff_i_binary_result_value_product)) * ff_c_binary_result_value) + (ff_p_binary_result_value_product))) /\ ((((exists ff_h_binary_result_value_product_partial. ff_h_binary_result_value_product_partial + S (ff_r_binary_result_value_product) = S ((S (ff_i_binary_result_value_product)) * ff_v_binary_result_value_product)) /\ exists ff_q_binary_result_value_product_partial. ff_u_binary_result_value_product = ff_q_binary_result_value_product_partial * S ((S (ff_i_binary_result_value_product)) * ff_v_binary_result_value_product) + (ff_r_binary_result_value_product))) /\ ((((exists ff_h_binary_result_value_product_successor. ff_h_binary_result_value_product_successor + S (ff_s_binary_result_value_product) = S ((S (S ff_i_binary_result_value_product)) * ff_v_binary_result_value_product)) /\ exists ff_q_binary_result_value_product_successor. ff_u_binary_result_value_product = ff_q_binary_result_value_product_successor * S ((S (S ff_i_binary_result_value_product)) * ff_v_binary_result_value_product) + (ff_s_binary_result_value_product))) /\ ff_s_binary_result_value_product = ff_r_binary_result_value_product * ff_p_binary_result_value_product)))))))) /\ (((exists ff_gap_binary_result_residue. ff_gap_binary_result_residue + S (r) = m) /\ (exists ff_left_binary_result_residue_congruence ff_right_binary_result_residue_congruence. (ff_power_binary_result) + m * ff_left_binary_result_residue_congruence = (r) + m * ff_right_binary_result_residue_congruence))))) /\ forall s. (exists ff_power_binary_other. ((exists ff_b_binary_other_value ff_c_binary_other_value. ((forall ff_i_binary_other_value_repeat. (exists ff_lt_binary_other_value_repeat_bound. ff_lt_binary_other_value_repeat_bound + S ff_i_binary_other_value_repeat = e) -> (((exists ff_h_binary_other_value_repeat_decoded. ff_h_binary_other_value_repeat_decoded + S (a) = S ((S (ff_i_binary_other_value_repeat)) * ff_c_binary_other_value)) /\ exists ff_q_binary_other_value_repeat_decoded. ff_b_binary_other_value = ff_q_binary_other_value_repeat_decoded * S ((S (ff_i_binary_other_value_repeat)) * ff_c_binary_other_value) + (a)))) /\ (exists ff_u_binary_other_value_product ff_v_binary_other_value_product. ((((exists ff_h_binary_other_value_product_start. ff_h_binary_other_value_product_start + S (1) = S ((S (0)) * ff_v_binary_other_value_product)) /\ exists ff_q_binary_other_value_product_start. ff_u_binary_other_value_product = ff_q_binary_other_value_product_start * S ((S (0)) * ff_v_binary_other_value_product) + (1))) /\ ((((exists ff_h_binary_other_value_product_terminal. ff_h_binary_other_value_product_terminal + S (ff_power_binary_other) = S ((S (e)) * ff_v_binary_other_value_product)) /\ exists ff_q_binary_other_value_product_terminal. ff_u_binary_other_value_product = ff_q_binary_other_value_product_terminal * S ((S (e)) * ff_v_binary_other_value_product) + (ff_power_binary_other))) /\ forall ff_i_binary_other_value_product. (exists ff_lt_binary_other_value_product_bound. ff_lt_binary_other_value_product_bound + S ff_i_binary_other_value_product = e) -> exists ff_p_binary_other_value_product ff_r_binary_other_value_product ff_s_binary_other_value_product. ((((exists ff_h_binary_other_value_product_factor. ff_h_binary_other_value_product_factor + S (ff_p_binary_other_value_product) = S ((S (ff_i_binary_other_value_product)) * ff_c_binary_other_value)) /\ exists ff_q_binary_other_value_product_factor. ff_b_binary_other_value = ff_q_binary_other_value_product_factor * S ((S (ff_i_binary_other_value_product)) * ff_c_binary_other_value) + (ff_p_binary_other_value_product))) /\ ((((exists ff_h_binary_other_value_product_partial. ff_h_binary_other_value_product_partial + S (ff_r_binary_other_value_product) = S ((S (ff_i_binary_other_value_product)) * ff_v_binary_other_value_product)) /\ exists ff_q_binary_other_value_product_partial. ff_u_binary_other_value_product = ff_q_binary_other_value_product_partial * S ((S (ff_i_binary_other_value_product)) * ff_v_binary_other_value_product) + (ff_r_binary_other_value_product))) /\ ((((exists ff_h_binary_other_value_product_successor. ff_h_binary_other_value_product_successor + S (ff_s_binary_other_value_product) = S ((S (S ff_i_binary_other_value_product)) * ff_v_binary_other_value_product)) /\ exists ff_q_binary_other_value_product_successor. ff_u_binary_other_value_product = ff_q_binary_other_value_product_successor * S ((S (S ff_i_binary_other_value_product)) * ff_v_binary_other_value_product) + (ff_s_binary_other_value_product))) /\ ff_s_binary_other_value_product = ff_r_binary_other_value_product * ff_p_binary_other_value_product)))))))) /\ (((exists ff_gap_binary_other_residue. ff_gap_binary_other_residue + S (s) = m) /\ (exists ff_left_binary_other_residue_congruence ff_right_binary_other_residue_congruence. (ff_power_binary_other) + m * ff_left_binary_other_residue_congruence = (s) + m * ff_right_binary_other_residue_congruence))))) -> r = s)

Complete unchanged native tactic proof

All 24 lines are the exact independently kernel-checked original script.

Read the argument

Proof checkpoints

24 script commands · 9 reading checkpoints · 1 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 (2)

Long local formulas use this family’s existing definitions. Each new abbreviation was expanded back to the identical native formula, including its free-variable context. The original edition is preserved below.

01Fix variables and assumptionsL1–4

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

  1. L1
    intro a
  2. L2
    intro e
  3. L3
    intro m
  4. L4
    intro hmodulus
02Use earlier factsL5–7

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

  1. L5
    specialize binary_modular_exponentiation_result_exists a
  2. L6
    specialize binary_modular_exponentiation_result_exists e
  3. L7
    specialize binary_modular_exponentiation_result_exists m
03Establish hresultL8–10

Establish this local claim before using it. It is not an additional assumption. The following proof commands apply binary modular exponentiation result exists.

  1. L8
    have hresult : ∃ r. BinaryModularPower(a,e,m,r)Definitions: BinaryModularPowerOriginal native command in the exact edition
  2. L9
    apply binary_modular_exponentiation_result_exists
  3. L10
    exact hmodulus
04Separate the logical casesL11–11

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

  1. L11
    cases hresult
05Construct an explicit witnessL12–12

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

  1. L12
    exists x
06Separate the logical casesL13–13

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

  1. L13
    split
07Use earlier factsL14–14

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

  1. L14
    exact hresult_witness
08Fix variables and assumptionsL15–16

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

  1. L15
    intro s
  2. L16
    intro hs
09Use earlier factsL17–24

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

  1. L17
    specialize binary_modular_exponentiation_result_functional a
  2. L18
    specialize binary_modular_exponentiation_result_functional e
  3. L19
    specialize binary_modular_exponentiation_result_functional m
  4. L20
    specialize binary_modular_exponentiation_result_functional x
  5. L21
    specialize binary_modular_exponentiation_result_functional s
  6. L22
    apply binary_modular_exponentiation_result_functional
  7. L23
    exact hresult_witness
  8. L24
    exact hs

Library-wide reading audit

Original defined command ledger · 24 lines
  1. 0001intro a
  2. 0002intro e
  3. 0003intro m
  4. 0004intro hmodulus
  5. 0005specialize binary_modular_exponentiation_result_exists a
  6. 0006specialize binary_modular_exponentiation_result_exists e
  7. 0007specialize binary_modular_exponentiation_result_exists m
  8. 0008have hresult : exists r. (exists ff_power_binary_result. ((exists ff_b_binary_result_value ff_c_binary_result_value. ((forall ff_i_binary_result_value_repeat. (exists ff_lt_binary_result_value_repeat_bound. ff_lt_binary_result_value_repeat_bound + S ff_i_binary_result_value_repeat = e) -> (((exists ff_h_binary_result_value_repeat_decoded. ff_h_binary_result_value_repeat_decoded + S (a) = S ((S (ff_i_binary_result_value_repeat)) * ff_c_binary_result_value)) /\ exists ff_q_binary_result_value_repeat_decoded. ff_b_binary_result_value = ff_q_binary_result_value_repeat_decoded * S ((S (ff_i_binary_result_value_repeat)) * ff_c_binary_result_value) + (a)))) /\ (exists ff_u_binary_result_value_product ff_v_binary_result_value_product. ((((exists ff_h_binary_result_value_product_start. ff_h_binary_result_value_product_start + S (1) = S ((S (0)) * ff_v_binary_result_value_product)) /\ exists ff_q_binary_result_value_product_start. ff_u_binary_result_value_product = ff_q_binary_result_value_product_start * S ((S (0)) * ff_v_binary_result_value_product) + (1))) /\ ((((exists ff_h_binary_result_value_product_terminal. ff_h_binary_result_value_product_terminal + S (ff_power_binary_result) = S ((S (e)) * ff_v_binary_result_value_product)) /\ exists ff_q_binary_result_value_product_terminal. ff_u_binary_result_value_product = ff_q_binary_result_value_product_terminal * S ((S (e)) * ff_v_binary_result_value_product) + (ff_power_binary_result))) /\ forall ff_i_binary_result_value_product. (exists ff_lt_binary_result_value_product_bound. ff_lt_binary_result_value_product_bound + S ff_i_binary_result_value_product = e) -> exists ff_p_binary_result_value_product ff_r_binary_result_value_product ff_s_binary_result_value_product. ((((exists ff_h_binary_result_value_product_factor. ff_h_binary_result_value_product_factor + S (ff_p_binary_result_value_product) = S ((S (ff_i_binary_result_value_product)) * ff_c_binary_result_value)) /\ exists ff_q_binary_result_value_product_factor. ff_b_binary_result_value = ff_q_binary_result_value_product_factor * S ((S (ff_i_binary_result_value_product)) * ff_c_binary_result_value) + (ff_p_binary_result_value_product))) /\ ((((exists ff_h_binary_result_value_product_partial. ff_h_binary_result_value_product_partial + S (ff_r_binary_result_value_product) = S ((S (ff_i_binary_result_value_product)) * ff_v_binary_result_value_product)) /\ exists ff_q_binary_result_value_product_partial. ff_u_binary_result_value_product = ff_q_binary_result_value_product_partial * S ((S (ff_i_binary_result_value_product)) * ff_v_binary_result_value_product) + (ff_r_binary_result_value_product))) /\ ((((exists ff_h_binary_result_value_product_successor. ff_h_binary_result_value_product_successor + S (ff_s_binary_result_value_product) = S ((S (S ff_i_binary_result_value_product)) * ff_v_binary_result_value_product)) /\ exists ff_q_binary_result_value_product_successor. ff_u_binary_result_value_product = ff_q_binary_result_value_product_successor * S ((S (S ff_i_binary_result_value_product)) * ff_v_binary_result_value_product) + (ff_s_binary_result_value_product))) /\ ff_s_binary_result_value_product = ff_r_binary_result_value_product * ff_p_binary_result_value_product)))))))) /\ (((exists ff_gap_binary_result_residue. ff_gap_binary_result_residue + S (r) = m) /\ (exists ff_left_binary_result_residue_congruence ff_right_binary_result_residue_congruence. (ff_power_binary_result) + m * ff_left_binary_result_residue_congruence = (r) + m * ff_right_binary_result_residue_congruence)))))
  9. 0009apply binary_modular_exponentiation_result_exists
  10. 0010exact hmodulus
  11. 0011cases hresult
  12. 0012exists x
  13. 0013split
  14. 0014exact hresult_witness
  15. 0015intro s
  16. 0016intro hs
  17. 0017specialize binary_modular_exponentiation_result_functional a
  18. 0018specialize binary_modular_exponentiation_result_functional e
  19. 0019specialize binary_modular_exponentiation_result_functional m
  20. 0020specialize binary_modular_exponentiation_result_functional x
  21. 0021specialize binary_modular_exponentiation_result_functional s
  22. 0022apply binary_modular_exponentiation_result_functional
  23. 0023exact hresult_witness
  24. 0024exact hs