PQ0047

prime_field_polynomial_synthetic_exists

Alpha v34 independently verified · alpha_closed; checked-use authorized; not Stable

Construct the actual quotient code and remainder from a real modular Horner history, for every nonempty canonical coefficient prefix.

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 expanded first-order arithmetic statement

forall p b c a n. (~((p) = 1) /\ forall pfa_factor_left_construct_prime pfa_factor_right_construct_prime. (p) = pfa_factor_left_construct_prime * pfa_factor_right_construct_prime -> pfa_factor_left_construct_prime = 1 \/ pfa_factor_right_construct_prime = 1) -> (forall fom_index_pfp_construct_coefficients. (exists fom_gap_pfp_construct_coefficients_index_bound. fom_gap_pfp_construct_coefficients_index_bound + S (fom_index_pfp_construct_coefficients) = S n) -> exists fom_value_pfp_construct_coefficients. ((((exists fom_beta_height_pfp_construct_coefficients_entry. fom_beta_height_pfp_construct_coefficients_entry + S (fom_value_pfp_construct_coefficients) = S ((S (fom_index_pfp_construct_coefficients)) * c)) /\ exists fom_beta_quotient_pfp_construct_coefficients_entry. b = fom_beta_quotient_pfp_construct_coefficients_entry * S ((S (fom_index_pfp_construct_coefficients)) * c) + (fom_value_pfp_construct_coefficients))) /\ (exists fom_gap_pfp_construct_coefficients_value_bound. fom_gap_pfp_construct_coefficients_value_bound + S (fom_value_pfp_construct_coefficients) = p))) -> (exists pfa_gap_construct_base. pfa_gap_construct_base + S (a) = (p)) -> exists qb qc r. (exists pfs_history_code_construct_result pfs_history_scale_construct_result. ((((exists pfa_gap_construct_resulttracebase. pfa_gap_construct_resulttracebase + S (a) = (p)) /\ (((((exists ff_h_pfp_construct_resulttraceinitial. ff_h_pfp_construct_resulttraceinitial + S (0) = S ((S (0)) * pfs_history_scale_construct_result)) /\ exists ff_q_pfp_construct_resulttraceinitial. pfs_history_code_construct_result = ff_q_pfp_construct_resulttraceinitial * S ((S (0)) * pfs_history_scale_construct_result) + (0))) /\ (((((exists ff_h_pfp_construct_resulttraceterminal. ff_h_pfp_construct_resulttraceterminal + S (r) = S ((S (S (n))) * pfs_history_scale_construct_result)) /\ exists ff_q_pfp_construct_resulttraceterminal. pfs_history_code_construct_result = ff_q_pfp_construct_resulttraceterminal * S ((S (S (n))) * pfs_history_scale_construct_result) + (r))) /\ ((forall pfh_index_construct_resulttracesteps. (exists pfa_gap_construct_resulttracestepsindex. pfa_gap_construct_resulttracestepsindex + S (pfh_index_construct_resulttracesteps) = (S (n))) -> (exists pfh_coefficient_construct_resulttracestepsstep pfh_before_construct_resulttracestepsstep pfh_after_construct_resulttracestepsstep pfh_product_construct_resulttracestepsstep. ((((exists ff_h_pfp_construct_resulttracestepsstepcoefficient. ff_h_pfp_construct_resulttracestepsstepcoefficient + S (pfh_coefficient_construct_resulttracestepsstep) = S ((S (pfh_index_construct_resulttracesteps)) * c)) /\ exists ff_q_pfp_construct_resulttracestepsstepcoefficient. b = ff_q_pfp_construct_resulttracestepsstepcoefficient * S ((S (pfh_index_construct_resulttracesteps)) * c) + (pfh_coefficient_construct_resulttracestepsstep))) /\ (((((exists ff_h_pfp_construct_resulttracestepsstepbefore. ff_h_pfp_construct_resulttracestepsstepbefore + S (pfh_before_construct_resulttracestepsstep) = S ((S (pfh_index_construct_resulttracesteps)) * pfs_history_scale_construct_result)) /\ exists ff_q_pfp_construct_resulttracestepsstepbefore. pfs_history_code_construct_result = ff_q_pfp_construct_resulttracestepsstepbefore * S ((S (pfh_index_construct_resulttracesteps)) * pfs_history_scale_construct_result) + (pfh_before_construct_resulttracestepsstep))) /\ (((((exists ff_h_pfp_construct_resulttracestepsstepafter. ff_h_pfp_construct_resulttracestepsstepafter + S (pfh_after_construct_resulttracestepsstep) = S ((S (S (pfh_index_construct_resulttracesteps))) * pfs_history_scale_construct_result)) /\ exists ff_q_pfp_construct_resulttracestepsstepafter. pfs_history_code_construct_result = ff_q_pfp_construct_resulttracestepsstepafter * S ((S (S (pfh_index_construct_resulttracesteps))) * pfs_history_scale_construct_result) + (pfh_after_construct_resulttracestepsstep))) /\ (((((exists pfa_gap_construct_resulttracestepsstepmultiplyleft. pfa_gap_construct_resulttracestepsstepmultiplyleft + S (pfh_before_construct_resulttracestepsstep) = (p)) /\ (((exists pfa_gap_construct_resulttracestepsstepmultiplyright. pfa_gap_construct_resulttracestepsstepmultiplyright + S (a) = (p)) /\ ((((exists pfa_gap_construct_resulttracestepsstepmultiplyresultbound. pfa_gap_construct_resulttracestepsstepmultiplyresultbound + S (pfh_product_construct_resulttracestepsstep) = (p)) /\ ((exists pfa_offset_left_construct_resulttracestepsstepmultiplyresultcongruence pfa_offset_right_construct_resulttracestepsstepmultiplyresultcongruence. ((pfh_before_construct_resulttracestepsstep) * (a)) + (p) * pfa_offset_left_construct_resulttracestepsstepmultiplyresultcongruence = (pfh_product_construct_resulttracestepsstep) + (p) * pfa_offset_right_construct_resulttracestepsstepmultiplyresultcongruence))))))))) /\ ((((exists pfa_gap_construct_resulttracestepsstepaddleft. pfa_gap_construct_resulttracestepsstepaddleft + S (pfh_product_construct_resulttracestepsstep) = (p)) /\ (((exists pfa_gap_construct_resulttracestepsstepaddright. pfa_gap_construct_resulttracestepsstepaddright + S (pfh_coefficient_construct_resulttracestepsstep) = (p)) /\ ((((exists pfa_gap_construct_resulttracestepsstepaddresultbound. pfa_gap_construct_resulttracestepsstepaddresultbound + S (pfh_after_construct_resulttracestepsstep) = (p)) /\ ((exists pfa_offset_left_construct_resulttracestepsstepaddresultcongruence pfa_offset_right_construct_resulttracestepsstepaddresultcongruence. ((pfh_product_construct_resulttracestepsstep) + (pfh_coefficient_construct_resulttracestepsstep)) + (p) * pfa_offset_left_construct_resulttracestepsstepaddresultcongruence = (pfh_after_construct_resulttracestepsstep) + (p) * pfa_offset_right_construct_resulttracestepsstepaddresultcongruence)))))))))))))))))))))))))) /\ ((forall ff_index_mcp_pfs_construct_resultquotient ff_source_mcp_pfs_construct_resultquotient ff_target_mcp_pfs_construct_resultquotient. (exists mcp_gap_pfs_construct_resultquotient_bound. mcp_gap_pfs_construct_resultquotient_bound + S (ff_index_mcp_pfs_construct_resultquotient) = (n)) -> (((exists fs_h_mcp_pfs_construct_resultquotient_source. fs_h_mcp_pfs_construct_resultquotient_source + S (ff_source_mcp_pfs_construct_resultquotient) = S ((S ((1) + (1) * ff_index_mcp_pfs_construct_resultquotient)) * pfs_history_scale_construct_result)) /\ exists fs_q_mcp_pfs_construct_resultquotient_source. pfs_history_code_construct_result = fs_q_mcp_pfs_construct_resultquotient_source * S ((S ((1) + (1) * ff_index_mcp_pfs_construct_resultquotient)) * pfs_history_scale_construct_result) + (ff_source_mcp_pfs_construct_resultquotient))) -> (((exists fs_h_mcp_pfs_construct_resultquotient_target. fs_h_mcp_pfs_construct_resultquotient_target + S (ff_target_mcp_pfs_construct_resultquotient) = S ((S (ff_index_mcp_pfs_construct_resultquotient)) * qc)) /\ exists fs_q_mcp_pfs_construct_resultquotient_target. qb = fs_q_mcp_pfs_construct_resultquotient_target * S ((S (ff_index_mcp_pfs_construct_resultquotient)) * qc) + (ff_target_mcp_pfs_construct_resultquotient))) -> ff_target_mcp_pfs_construct_resultquotient = ff_source_mcp_pfs_construct_resultquotient))))

Constructive proof overview

Generated structural guide

Construct the actual quotient code and remainder from a real modular Horner history, for every nonempty canonical coefficient prefix.

The unchanged tactic script uses 2 declared prerequisites and contains 38 exact native proof lines.

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

Proof neighborhood

Direct dependencies

prime_field_polynomial_horner_exists Alpha theorem; checked-use authorized beta_affine_matrix_slice_exists Alpha theorem; checked-use authorized

Direct dependents

Formal native tactic body

Dependencies are introduced as named hypotheses before line 1. Local theorem links identify exact declared prerequisites. This exact body belongs to a complete independently kernel-checked constructive proof bundle and has Alpha checked-use authority; it does not imply Stable membership.

Read the argument

Proof checkpoints

38 script commands · 8 reading checkpoints · 2 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.

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–8

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

  1. L1
    intro p
  2. L2
    intro b
  3. L3
    intro c
  4. L4
    intro a
  5. L5
    intro n
  6. L6
    intro hp
  7. L7
    intro hc
  8. L8
    intro ha
02Establish heL9–18

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

  1. L9
    have he : ∃ r. FpHorner(p,b,c,a,S n,r)Definitions: FpHorner
  2. L10
    specialize prime_field_polynomial_horner_exists (p)
  3. L11
    specialize prime_field_polynomial_horner_exists (b)
  4. L12
    specialize prime_field_polynomial_horner_exists (c)
  5. L13
    specialize prime_field_polynomial_horner_exists (a)
  6. L14
    specialize prime_field_polynomial_horner_exists (S n)
  7. L15
    apply prime_field_polynomial_horner_exists
  8. L16
    exact hp
  9. L17
    exact hc
  10. L18
    exact ha
03Separate the logical casesL19–21

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

  1. L19
    cases he
  2. L20
    cases he_witness
  3. L21
    cases he_witness_witness
04Establish hqL22–28

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

  1. L22
    have hq : ∃ qb. ∃ qc. MatrixAffineSlice(x1,x2,1,1,qb,qc,n)Definitions: MatrixAffineSlice
  2. L23
    specialize beta_affine_matrix_slice_exists (x1)
  3. L24
    specialize beta_affine_matrix_slice_exists (x2)
  4. L25
    specialize beta_affine_matrix_slice_exists (1)
  5. L26
    specialize beta_affine_matrix_slice_exists (1)
  6. L27
    specialize beta_affine_matrix_slice_exists (n)
  7. L28
    apply beta_affine_matrix_slice_exists
05Separate the logical casesL29–30

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

  1. L29
    cases hq
  2. L30
    cases hq_witness
06Construct an explicit witnessL31–35

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

  1. L31
    exists x3
  2. L32
    exists x4
  3. L33
    exists x
  4. L34
    exists x1
  5. L35
    exists x2
07Separate the logical casesL36–36

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

  1. L36
    split
08Use earlier factsL37–38

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

  1. L37
    exact he_witness_witness_witness
  2. L38
    exact hq_witness_witness

Library-wide reading audit

Original exact command ledger · 38 lines
  1. 0001intro p
  2. 0002intro b
  3. 0003intro c
  4. 0004intro a
  5. 0005intro n
  6. 0006intro hp
  7. 0007intro hc
  8. 0008intro ha
  9. 0009have he : exists r. (exists pfh_trace_code_construct_eval pfh_trace_scale_construct_eval. (((exists pfa_gap_construct_evaltracebase. pfa_gap_construct_evaltracebase + S (a) = (p)) /\ (((((exists ff_h_pfp_construct_evaltraceinitial. ff_h_pfp_construct_evaltraceinitial + S (0) = S ((S (0)) * pfh_trace_scale_construct_eval)) /\ exists ff_q_pfp_construct_evaltraceinitial. pfh_trace_code_construct_eval = ff_q_pfp_construct_evaltraceinitial * S ((S (0)) * pfh_trace_scale_construct_eval) + (0))) /\ (((((exists ff_h_pfp_construct_evaltraceterminal. ff_h_pfp_construct_evaltraceterminal + S (r) = S ((S (S n)) * pfh_trace_scale_construct_eval)) /\ exists ff_q_pfp_construct_evaltraceterminal. pfh_trace_code_construct_eval = ff_q_pfp_construct_evaltraceterminal * S ((S (S n)) * pfh_trace_scale_construct_eval) + (r))) /\ ((forall pfh_index_construct_evaltracesteps. (exists pfa_gap_construct_evaltracestepsindex. pfa_gap_construct_evaltracestepsindex + S (pfh_index_construct_evaltracesteps) = (S n)) -> (exists pfh_coefficient_construct_evaltracestepsstep pfh_before_construct_evaltracestepsstep pfh_after_construct_evaltracestepsstep pfh_product_construct_evaltracestepsstep. ((((exists ff_h_pfp_construct_evaltracestepsstepcoefficient. ff_h_pfp_construct_evaltracestepsstepcoefficient + S (pfh_coefficient_construct_evaltracestepsstep) = S ((S (pfh_index_construct_evaltracesteps)) * c)) /\ exists ff_q_pfp_construct_evaltracestepsstepcoefficient. b = ff_q_pfp_construct_evaltracestepsstepcoefficient * S ((S (pfh_index_construct_evaltracesteps)) * c) + (pfh_coefficient_construct_evaltracestepsstep))) /\ (((((exists ff_h_pfp_construct_evaltracestepsstepbefore. ff_h_pfp_construct_evaltracestepsstepbefore + S (pfh_before_construct_evaltracestepsstep) = S ((S (pfh_index_construct_evaltracesteps)) * pfh_trace_scale_construct_eval)) /\ exists ff_q_pfp_construct_evaltracestepsstepbefore. pfh_trace_code_construct_eval = ff_q_pfp_construct_evaltracestepsstepbefore * S ((S (pfh_index_construct_evaltracesteps)) * pfh_trace_scale_construct_eval) + (pfh_before_construct_evaltracestepsstep))) /\ (((((exists ff_h_pfp_construct_evaltracestepsstepafter. ff_h_pfp_construct_evaltracestepsstepafter + S (pfh_after_construct_evaltracestepsstep) = S ((S (S (pfh_index_construct_evaltracesteps))) * pfh_trace_scale_construct_eval)) /\ exists ff_q_pfp_construct_evaltracestepsstepafter. pfh_trace_code_construct_eval = ff_q_pfp_construct_evaltracestepsstepafter * S ((S (S (pfh_index_construct_evaltracesteps))) * pfh_trace_scale_construct_eval) + (pfh_after_construct_evaltracestepsstep))) /\ (((((exists pfa_gap_construct_evaltracestepsstepmultiplyleft. pfa_gap_construct_evaltracestepsstepmultiplyleft + S (pfh_before_construct_evaltracestepsstep) = (p)) /\ (((exists pfa_gap_construct_evaltracestepsstepmultiplyright. pfa_gap_construct_evaltracestepsstepmultiplyright + S (a) = (p)) /\ ((((exists pfa_gap_construct_evaltracestepsstepmultiplyresultbound. pfa_gap_construct_evaltracestepsstepmultiplyresultbound + S (pfh_product_construct_evaltracestepsstep) = (p)) /\ ((exists pfa_offset_left_construct_evaltracestepsstepmultiplyresultcongruence pfa_offset_right_construct_evaltracestepsstepmultiplyresultcongruence. ((pfh_before_construct_evaltracestepsstep) * (a)) + (p) * pfa_offset_left_construct_evaltracestepsstepmultiplyresultcongruence = (pfh_product_construct_evaltracestepsstep) + (p) * pfa_offset_right_construct_evaltracestepsstepmultiplyresultcongruence))))))))) /\ ((((exists pfa_gap_construct_evaltracestepsstepaddleft. pfa_gap_construct_evaltracestepsstepaddleft + S (pfh_product_construct_evaltracestepsstep) = (p)) /\ (((exists pfa_gap_construct_evaltracestepsstepaddright. pfa_gap_construct_evaltracestepsstepaddright + S (pfh_coefficient_construct_evaltracestepsstep) = (p)) /\ ((((exists pfa_gap_construct_evaltracestepsstepaddresultbound. pfa_gap_construct_evaltracestepsstepaddresultbound + S (pfh_after_construct_evaltracestepsstep) = (p)) /\ ((exists pfa_offset_left_construct_evaltracestepsstepaddresultcongruence pfa_offset_right_construct_evaltracestepsstepaddresultcongruence. ((pfh_product_construct_evaltracestepsstep) + (pfh_coefficient_construct_evaltracestepsstep)) + (p) * pfa_offset_left_construct_evaltracestepsstepaddresultcongruence = (pfh_after_construct_evaltracestepsstep) + (p) * pfa_offset_right_construct_evaltracestepsstepaddresultcongruence)))))))))))))))))))))))))))
  10. 0010specialize prime_field_polynomial_horner_exists (p)
  11. 0011specialize prime_field_polynomial_horner_exists (b)
  12. 0012specialize prime_field_polynomial_horner_exists (c)
  13. 0013specialize prime_field_polynomial_horner_exists (a)
  14. 0014specialize prime_field_polynomial_horner_exists (S n)
  15. 0015apply prime_field_polynomial_horner_exists
  16. 0016exact hp
  17. 0017exact hc
  18. 0018exact ha
  19. 0019cases he
  20. 0020cases he_witness
  21. 0021cases he_witness_witness
  22. 0022have hq : exists qb qc. (forall ff_index_mcp_pfs_construct_slice ff_source_mcp_pfs_construct_slice ff_target_mcp_pfs_construct_slice. (exists mcp_gap_pfs_construct_slice_bound. mcp_gap_pfs_construct_slice_bound + S (ff_index_mcp_pfs_construct_slice) = (n)) -> (((exists fs_h_mcp_pfs_construct_slice_source. fs_h_mcp_pfs_construct_slice_source + S (ff_source_mcp_pfs_construct_slice) = S ((S ((1) + (1) * ff_index_mcp_pfs_construct_slice)) * x2)) /\ exists fs_q_mcp_pfs_construct_slice_source. x1 = fs_q_mcp_pfs_construct_slice_source * S ((S ((1) + (1) * ff_index_mcp_pfs_construct_slice)) * x2) + (ff_source_mcp_pfs_construct_slice))) -> (((exists fs_h_mcp_pfs_construct_slice_target. fs_h_mcp_pfs_construct_slice_target + S (ff_target_mcp_pfs_construct_slice) = S ((S (ff_index_mcp_pfs_construct_slice)) * qc)) /\ exists fs_q_mcp_pfs_construct_slice_target. qb = fs_q_mcp_pfs_construct_slice_target * S ((S (ff_index_mcp_pfs_construct_slice)) * qc) + (ff_target_mcp_pfs_construct_slice))) -> ff_target_mcp_pfs_construct_slice = ff_source_mcp_pfs_construct_slice)
  23. 0023specialize beta_affine_matrix_slice_exists (x1)
  24. 0024specialize beta_affine_matrix_slice_exists (x2)
  25. 0025specialize beta_affine_matrix_slice_exists (1)
  26. 0026specialize beta_affine_matrix_slice_exists (1)
  27. 0027specialize beta_affine_matrix_slice_exists (n)
  28. 0028apply beta_affine_matrix_slice_exists
  29. 0029cases hq
  30. 0030cases hq_witness
  31. 0031exists x3
  32. 0032exists x4
  33. 0033exists x
  34. 0034exists x1
  35. 0035exists x2
  36. 0036split
  37. 0037exact he_witness_witness_witness
  38. 0038exact hq_witness_witness