PP002A

prime_field_polynomial_horner_exists_unique

Constructive totality and uniqueness of genuine finite prime-field polynomial evaluation, including p=2 and length zero.

Alpha v34 checked-use · first admitted v31 · 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.

Length is representation length, not polynomial degree. Leading zeros and the empty zero polynomial are allowed; the canonical argument guard x<p also applies to the empty case. Evaluation is defined by actual field-operation steps, not an assumed residue invariant. Polynomial division, gcd, irreducibles and general prime-power extension fields remain open; this does not close G091.

Exact theorem in conservative defined notation

∀ p. ∀ b. ∀ c. ∀ t. ∀ l. Prime(p)BetaPrefixInto(b,c,l,p)Lt(t,p) → ∃ x. FpHorner(p,b,c,t,l,x) ∧ (∀ y. FpHorner(p,b,c,t,l,y) → y = x)

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

Definition DAG

Actual proof prerequisites

Original expanded first-order statement
forall p b c t l. (~((p) = 1) /\ forall pfa_factor_left_unique_prime pfa_factor_right_unique_prime. (p) = pfa_factor_left_unique_prime * pfa_factor_right_unique_prime -> pfa_factor_left_unique_prime = 1 \/ pfa_factor_right_unique_prime = 1) -> (forall fom_index_pfp_unique_coefficients. (exists fom_gap_pfp_unique_coefficients_index_bound. fom_gap_pfp_unique_coefficients_index_bound + S (fom_index_pfp_unique_coefficients) = l) -> exists fom_value_pfp_unique_coefficients. ((((exists fom_beta_height_pfp_unique_coefficients_entry. fom_beta_height_pfp_unique_coefficients_entry + S (fom_value_pfp_unique_coefficients) = S ((S (fom_index_pfp_unique_coefficients)) * c)) /\ exists fom_beta_quotient_pfp_unique_coefficients_entry. b = fom_beta_quotient_pfp_unique_coefficients_entry * S ((S (fom_index_pfp_unique_coefficients)) * c) + (fom_value_pfp_unique_coefficients))) /\ (exists fom_gap_pfp_unique_coefficients_value_bound. fom_gap_pfp_unique_coefficients_value_bound + S (fom_value_pfp_unique_coefficients) = p))) -> (exists pfa_gap_unique_base. pfa_gap_unique_base + S (t) = (p)) -> exists r. (exists pfh_trace_code_unique_chosen pfh_trace_scale_unique_chosen. (((exists pfa_gap_unique_chosentracebase. pfa_gap_unique_chosentracebase + S (t) = (p)) /\ (((((exists ff_h_pfp_unique_chosentraceinitial. ff_h_pfp_unique_chosentraceinitial + S (0) = S ((S (0)) * pfh_trace_scale_unique_chosen)) /\ exists ff_q_pfp_unique_chosentraceinitial. pfh_trace_code_unique_chosen = ff_q_pfp_unique_chosentraceinitial * S ((S (0)) * pfh_trace_scale_unique_chosen) + (0))) /\ (((((exists ff_h_pfp_unique_chosentraceterminal. ff_h_pfp_unique_chosentraceterminal + S (r) = S ((S (l)) * pfh_trace_scale_unique_chosen)) /\ exists ff_q_pfp_unique_chosentraceterminal. pfh_trace_code_unique_chosen = ff_q_pfp_unique_chosentraceterminal * S ((S (l)) * pfh_trace_scale_unique_chosen) + (r))) /\ ((forall pfh_index_unique_chosentracesteps. (exists pfa_gap_unique_chosentracestepsindex. pfa_gap_unique_chosentracestepsindex + S (pfh_index_unique_chosentracesteps) = (l)) -> (exists pfh_coefficient_unique_chosentracestepsstep pfh_before_unique_chosentracestepsstep pfh_after_unique_chosentracestepsstep pfh_product_unique_chosentracestepsstep. ((((exists ff_h_pfp_unique_chosentracestepsstepcoefficient. ff_h_pfp_unique_chosentracestepsstepcoefficient + S (pfh_coefficient_unique_chosentracestepsstep) = S ((S (pfh_index_unique_chosentracesteps)) * c)) /\ exists ff_q_pfp_unique_chosentracestepsstepcoefficient. b = ff_q_pfp_unique_chosentracestepsstepcoefficient * S ((S (pfh_index_unique_chosentracesteps)) * c) + (pfh_coefficient_unique_chosentracestepsstep))) /\ (((((exists ff_h_pfp_unique_chosentracestepsstepbefore. ff_h_pfp_unique_chosentracestepsstepbefore + S (pfh_before_unique_chosentracestepsstep) = S ((S (pfh_index_unique_chosentracesteps)) * pfh_trace_scale_unique_chosen)) /\ exists ff_q_pfp_unique_chosentracestepsstepbefore. pfh_trace_code_unique_chosen = ff_q_pfp_unique_chosentracestepsstepbefore * S ((S (pfh_index_unique_chosentracesteps)) * pfh_trace_scale_unique_chosen) + (pfh_before_unique_chosentracestepsstep))) /\ (((((exists ff_h_pfp_unique_chosentracestepsstepafter. ff_h_pfp_unique_chosentracestepsstepafter + S (pfh_after_unique_chosentracestepsstep) = S ((S (S (pfh_index_unique_chosentracesteps))) * pfh_trace_scale_unique_chosen)) /\ exists ff_q_pfp_unique_chosentracestepsstepafter. pfh_trace_code_unique_chosen = ff_q_pfp_unique_chosentracestepsstepafter * S ((S (S (pfh_index_unique_chosentracesteps))) * pfh_trace_scale_unique_chosen) + (pfh_after_unique_chosentracestepsstep))) /\ (((((exists pfa_gap_unique_chosentracestepsstepmultiplyleft. pfa_gap_unique_chosentracestepsstepmultiplyleft + S (pfh_before_unique_chosentracestepsstep) = (p)) /\ (((exists pfa_gap_unique_chosentracestepsstepmultiplyright. pfa_gap_unique_chosentracestepsstepmultiplyright + S (t) = (p)) /\ ((((exists pfa_gap_unique_chosentracestepsstepmultiplyresultbound. pfa_gap_unique_chosentracestepsstepmultiplyresultbound + S (pfh_product_unique_chosentracestepsstep) = (p)) /\ ((exists pfa_offset_left_unique_chosentracestepsstepmultiplyresultcongruence pfa_offset_right_unique_chosentracestepsstepmultiplyresultcongruence. ((pfh_before_unique_chosentracestepsstep) * (t)) + (p) * pfa_offset_left_unique_chosentracestepsstepmultiplyresultcongruence = (pfh_product_unique_chosentracestepsstep) + (p) * pfa_offset_right_unique_chosentracestepsstepmultiplyresultcongruence))))))))) /\ ((((exists pfa_gap_unique_chosentracestepsstepaddleft. pfa_gap_unique_chosentracestepsstepaddleft + S (pfh_product_unique_chosentracestepsstep) = (p)) /\ (((exists pfa_gap_unique_chosentracestepsstepaddright. pfa_gap_unique_chosentracestepsstepaddright + S (pfh_coefficient_unique_chosentracestepsstep) = (p)) /\ ((((exists pfa_gap_unique_chosentracestepsstepaddresultbound. pfa_gap_unique_chosentracestepsstepaddresultbound + S (pfh_after_unique_chosentracestepsstep) = (p)) /\ ((exists pfa_offset_left_unique_chosentracestepsstepaddresultcongruence pfa_offset_right_unique_chosentracestepsstepaddresultcongruence. ((pfh_product_unique_chosentracestepsstep) + (pfh_coefficient_unique_chosentracestepsstep)) + (p) * pfa_offset_left_unique_chosentracestepsstepaddresultcongruence = (pfh_after_unique_chosentracestepsstep) + (p) * pfa_offset_right_unique_chosentracestepsstepaddresultcongruence))))))))))))))))))))))))))) /\ forall s. (exists pfh_trace_code_unique_other pfh_trace_scale_unique_other. (((exists pfa_gap_unique_othertracebase. pfa_gap_unique_othertracebase + S (t) = (p)) /\ (((((exists ff_h_pfp_unique_othertraceinitial. ff_h_pfp_unique_othertraceinitial + S (0) = S ((S (0)) * pfh_trace_scale_unique_other)) /\ exists ff_q_pfp_unique_othertraceinitial. pfh_trace_code_unique_other = ff_q_pfp_unique_othertraceinitial * S ((S (0)) * pfh_trace_scale_unique_other) + (0))) /\ (((((exists ff_h_pfp_unique_othertraceterminal. ff_h_pfp_unique_othertraceterminal + S (s) = S ((S (l)) * pfh_trace_scale_unique_other)) /\ exists ff_q_pfp_unique_othertraceterminal. pfh_trace_code_unique_other = ff_q_pfp_unique_othertraceterminal * S ((S (l)) * pfh_trace_scale_unique_other) + (s))) /\ ((forall pfh_index_unique_othertracesteps. (exists pfa_gap_unique_othertracestepsindex. pfa_gap_unique_othertracestepsindex + S (pfh_index_unique_othertracesteps) = (l)) -> (exists pfh_coefficient_unique_othertracestepsstep pfh_before_unique_othertracestepsstep pfh_after_unique_othertracestepsstep pfh_product_unique_othertracestepsstep. ((((exists ff_h_pfp_unique_othertracestepsstepcoefficient. ff_h_pfp_unique_othertracestepsstepcoefficient + S (pfh_coefficient_unique_othertracestepsstep) = S ((S (pfh_index_unique_othertracesteps)) * c)) /\ exists ff_q_pfp_unique_othertracestepsstepcoefficient. b = ff_q_pfp_unique_othertracestepsstepcoefficient * S ((S (pfh_index_unique_othertracesteps)) * c) + (pfh_coefficient_unique_othertracestepsstep))) /\ (((((exists ff_h_pfp_unique_othertracestepsstepbefore. ff_h_pfp_unique_othertracestepsstepbefore + S (pfh_before_unique_othertracestepsstep) = S ((S (pfh_index_unique_othertracesteps)) * pfh_trace_scale_unique_other)) /\ exists ff_q_pfp_unique_othertracestepsstepbefore. pfh_trace_code_unique_other = ff_q_pfp_unique_othertracestepsstepbefore * S ((S (pfh_index_unique_othertracesteps)) * pfh_trace_scale_unique_other) + (pfh_before_unique_othertracestepsstep))) /\ (((((exists ff_h_pfp_unique_othertracestepsstepafter. ff_h_pfp_unique_othertracestepsstepafter + S (pfh_after_unique_othertracestepsstep) = S ((S (S (pfh_index_unique_othertracesteps))) * pfh_trace_scale_unique_other)) /\ exists ff_q_pfp_unique_othertracestepsstepafter. pfh_trace_code_unique_other = ff_q_pfp_unique_othertracestepsstepafter * S ((S (S (pfh_index_unique_othertracesteps))) * pfh_trace_scale_unique_other) + (pfh_after_unique_othertracestepsstep))) /\ (((((exists pfa_gap_unique_othertracestepsstepmultiplyleft. pfa_gap_unique_othertracestepsstepmultiplyleft + S (pfh_before_unique_othertracestepsstep) = (p)) /\ (((exists pfa_gap_unique_othertracestepsstepmultiplyright. pfa_gap_unique_othertracestepsstepmultiplyright + S (t) = (p)) /\ ((((exists pfa_gap_unique_othertracestepsstepmultiplyresultbound. pfa_gap_unique_othertracestepsstepmultiplyresultbound + S (pfh_product_unique_othertracestepsstep) = (p)) /\ ((exists pfa_offset_left_unique_othertracestepsstepmultiplyresultcongruence pfa_offset_right_unique_othertracestepsstepmultiplyresultcongruence. ((pfh_before_unique_othertracestepsstep) * (t)) + (p) * pfa_offset_left_unique_othertracestepsstepmultiplyresultcongruence = (pfh_product_unique_othertracestepsstep) + (p) * pfa_offset_right_unique_othertracestepsstepmultiplyresultcongruence))))))))) /\ ((((exists pfa_gap_unique_othertracestepsstepaddleft. pfa_gap_unique_othertracestepsstepaddleft + S (pfh_product_unique_othertracestepsstep) = (p)) /\ (((exists pfa_gap_unique_othertracestepsstepaddright. pfa_gap_unique_othertracestepsstepaddright + S (pfh_coefficient_unique_othertracestepsstep) = (p)) /\ ((((exists pfa_gap_unique_othertracestepsstepaddresultbound. pfa_gap_unique_othertracestepsstepaddresultbound + S (pfh_after_unique_othertracestepsstep) = (p)) /\ ((exists pfa_offset_left_unique_othertracestepsstepaddresultcongruence pfa_offset_right_unique_othertracestepsstepaddresultcongruence. ((pfh_product_unique_othertracestepsstep) + (pfh_coefficient_unique_othertracestepsstep)) + (p) * pfa_offset_left_unique_othertracestepsstepaddresultcongruence = (pfh_after_unique_othertracestepsstep) + (p) * pfa_offset_right_unique_othertracestepsstepaddresultcongruence))))))))))))))))))))))))))) -> s=r

Complete tactic proof in conservative notation

All 35 original proof lines are preserved. Only local proposition formulas are abbreviated; every abbreviation has an exact binder-safe expansion check. The linked exact edition contains the unchanged replay script.

Read the argument

Proof checkpoints

35 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)
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 t
  5. L5
    intro l
  6. L6
    intro hp
  7. L7
    intro hc
  8. L8
    intro ht
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,t,l,r)Definitions: FpHorner(p,b,c,t,l,r)Original native command in the exact edition
  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 (t)
  6. L14
    specialize prime_field_polynomial_horner_exists (l)
  7. L15
    apply prime_field_polynomial_horner_exists
  8. L16
    exact hp
  9. L17
    exact hc
  10. L18
    exact ht
03Separate the logical casesL19–19

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

  1. L19
    cases he
04Construct an explicit witnessL20–20

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

  1. L20
    exists x
05Separate the logical casesL21–21

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

  1. L21
    split
06Use earlier factsL22–22

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

  1. L22
    exact he_witness
07Fix variables and assumptionsL23–24

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

  1. L23
    intro s
  2. L24
    intro hs
08Use earlier factsL25–34

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

  1. L25
    specialize prime_field_polynomial_horner_functional (p)
  2. L26
    specialize prime_field_polynomial_horner_functional (b)
  3. L27
    specialize prime_field_polynomial_horner_functional (c)
  4. L28
    specialize prime_field_polynomial_horner_functional (t)
  5. L29
    specialize prime_field_polynomial_horner_functional (l)
  6. L30
    specialize prime_field_polynomial_horner_functional (s)
  7. L31
    specialize prime_field_polynomial_horner_functional (x)
  8. L32
    apply prime_field_polynomial_horner_functional
  9. L33
    exact hp
  10. L34
    exact hs
09Use earlier factsL35–35

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

  1. L35
    exact he_witness

Library-wide reading audit

Original defined command ledger · 35 lines
  1. 0001intro p
  2. 0002intro b
  3. 0003intro c
  4. 0004intro t
  5. 0005intro l
  6. 0006intro hp
  7. 0007intro hc
  8. 0008intro ht
  9. 0009have he : ∃ r. FpHorner(p,b,c,t,l,r)
  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 (t)
  14. 0014specialize prime_field_polynomial_horner_exists (l)
  15. 0015apply prime_field_polynomial_horner_exists
  16. 0016exact hp
  17. 0017exact hc
  18. 0018exact ht
  19. 0019cases he
  20. 0020exists x
  21. 0021split
  22. 0022exact he_witness
  23. 0023intro s
  24. 0024intro hs
  25. 0025specialize prime_field_polynomial_horner_functional (p)
  26. 0026specialize prime_field_polynomial_horner_functional (b)
  27. 0027specialize prime_field_polynomial_horner_functional (c)
  28. 0028specialize prime_field_polynomial_horner_functional (t)
  29. 0029specialize prime_field_polynomial_horner_functional (l)
  30. 0030specialize prime_field_polynomial_horner_functional (s)
  31. 0031specialize prime_field_polynomial_horner_functional (x)
  32. 0032apply prime_field_polynomial_horner_functional
  33. 0033exact hp
  34. 0034exact hs
  35. 0035exact he_witness