PX0035

prime_field_polynomial_trim_zero_prefix_remainder_bound

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

The actual trimmed residual has at most d coefficients after a length-q zero prefix is proved; no degree is assigned to the empty case.

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 ub uc L t rb rc R q d. (exists pfc_gap_division_remainder_quotient_length. pfc_gap_division_remainder_quotient_length+(q)=(L)) -> (exists pfc_gap_division_remainder_cover_length. pfc_gap_division_remainder_cover_length+(L)=(q+d)) -> (forall pfp_repeat_index_division_remainder_zero. (exists pfa_gap_division_remainder_zeroindex. pfa_gap_division_remainder_zeroindex + S (pfp_repeat_index_division_remainder_zero) = (q)) -> (((exists ff_h_pfp_division_remainder_zeroentry. ff_h_pfp_division_remainder_zeroentry + S (0) = S ((S (pfp_repeat_index_division_remainder_zero)) * uc)) /\ exists ff_q_pfp_division_remainder_zeroentry. ub = ff_q_pfp_division_remainder_zeroentry * S ((S (pfp_repeat_index_division_remainder_zero)) * uc) + (0)))) -> ((((L)=(t)+(R)) /\ (((forall fom_index_pfp_division_remainder_triminput. (exists fom_gap_pfp_division_remainder_triminput_index_bound. fom_gap_pfp_division_remainder_triminput_index_bound + S (fom_index_pfp_division_remainder_triminput) = L) -> exists fom_value_pfp_division_remainder_triminput. ((((exists fom_beta_height_pfp_division_remainder_triminput_entry. fom_beta_height_pfp_division_remainder_triminput_entry + S (fom_value_pfp_division_remainder_triminput) = S ((S (fom_index_pfp_division_remainder_triminput)) * uc)) /\ exists fom_beta_quotient_pfp_division_remainder_triminput_entry. ub = fom_beta_quotient_pfp_division_remainder_triminput_entry * S ((S (fom_index_pfp_division_remainder_triminput)) * uc) + (fom_value_pfp_division_remainder_triminput))) /\ (exists fom_gap_pfp_division_remainder_triminput_value_bound. fom_gap_pfp_division_remainder_triminput_value_bound + S (fom_value_pfp_division_remainder_triminput) = p))) /\ (((forall pfp_repeat_index_division_remainder_trimremoved. (exists pfa_gap_division_remainder_trimremovedindex. pfa_gap_division_remainder_trimremovedindex + S (pfp_repeat_index_division_remainder_trimremoved) = (t)) -> (((exists ff_h_pfp_division_remainder_trimremovedentry. ff_h_pfp_division_remainder_trimremovedentry + S (0) = S ((S (pfp_repeat_index_division_remainder_trimremoved)) * uc)) /\ exists ff_q_pfp_division_remainder_trimremovedentry. ub = ff_q_pfp_division_remainder_trimremovedentry * S ((S (pfp_repeat_index_division_remainder_trimremoved)) * uc) + (0)))) /\ (((forall pftrim_index_division_remainder_trimsuffix pftrim_value_division_remainder_trimsuffix. (exists pfa_gap_division_remainder_trimsuffixbound. pfa_gap_division_remainder_trimsuffixbound + S (pftrim_index_division_remainder_trimsuffix) = (R)) -> (((exists ff_h_pfp_division_remainder_trimsuffixsource. ff_h_pfp_division_remainder_trimsuffixsource + S (pftrim_value_division_remainder_trimsuffix) = S ((S ((t)+pftrim_index_division_remainder_trimsuffix)) * uc)) /\ exists ff_q_pfp_division_remainder_trimsuffixsource. ub = ff_q_pfp_division_remainder_trimsuffixsource * S ((S ((t)+pftrim_index_division_remainder_trimsuffix)) * uc) + (pftrim_value_division_remainder_trimsuffix))) -> (((exists ff_h_pfp_division_remainder_trimsuffixoutput. ff_h_pfp_division_remainder_trimsuffixoutput + S (pftrim_value_division_remainder_trimsuffix) = S ((S (pftrim_index_division_remainder_trimsuffix)) * rc)) /\ exists ff_q_pfp_division_remainder_trimsuffixoutput. rb = ff_q_pfp_division_remainder_trimsuffixoutput * S ((S (pftrim_index_division_remainder_trimsuffix)) * rc) + (pftrim_value_division_remainder_trimsuffix)))) /\ (((R)=0 \/ (exists pftrim_leading_division_remainder_trimnormal. ((((exists ff_h_pfp_division_remainder_trimnormalentry. ff_h_pfp_division_remainder_trimnormalentry + S (pftrim_leading_division_remainder_trimnormal) = S ((S (0)) * rc)) /\ exists ff_q_pfp_division_remainder_trimnormalentry. rb = ff_q_pfp_division_remainder_trimnormalentry * S ((S (0)) * rc) + (pftrim_leading_division_remainder_trimnormal))) /\ ((~(pftrim_leading_division_remainder_trimnormal=0))))))))))))))) -> (exists pfc_gap_division_remainder_bound. pfc_gap_division_remainder_bound+(R)=(d))

Constructive proof overview

Generated structural guide

The actual trimmed residual has at most d coefficients after a length-q zero prefix is proved; no degree is assigned to the empty case.

The unchanged tactic script uses 5 declared prerequisites and contains 65 exact native proof lines.

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

Proof neighborhood

Direct dependencies

PX0034 prime_field_polynomial_trim_zero_prefix_cut_bound add_comm Alpha theorem; checked-use authorized add_le_add_left Alpha theorem; checked-use authorized le_trans Alpha theorem; checked-use authorized add_le_cancel_right 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

65 script commands · 10 reading checkpoints · 6 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.

Named ingredients (1)

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

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

  1. L1
    intro p
  2. L2
    intro ub
  3. L3
    intro uc
  4. L4
    intro L
  5. L5
    intro t
  6. L6
    intro rb
  7. L7
    intro rc
  8. L8
    intro R
  9. L9
    intro q
  10. L10
    intro d
02Fix variables and assumptionsL11–14

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

  1. L11
    intro hqL
  2. L12
    intro hLd
  3. L13
    intro hz
  4. L14
    intro ht
03Establish hqtL15–24

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

  1. L15
    have hqt : exists pfc_gap_division_remainder_cut. pfc_gap_division_remainder_cut+(q)=(t)
  2. L16
    specialize prime_field_polynomial_trim_zero_prefix_cut_bound (p)
  3. L17
    specialize prime_field_polynomial_trim_zero_prefix_cut_bound (ub)
  4. L18
    specialize prime_field_polynomial_trim_zero_prefix_cut_bound (uc)
  5. L19
    specialize prime_field_polynomial_trim_zero_prefix_cut_bound (L)
  6. L20
    specialize prime_field_polynomial_trim_zero_prefix_cut_bound (t)
  7. L21
    specialize prime_field_polynomial_trim_zero_prefix_cut_bound (rb)
  8. L22
    specialize prime_field_polynomial_trim_zero_prefix_cut_bound (rc)
  9. L23
    specialize prime_field_polynomial_trim_zero_prefix_cut_bound (R)
  10. L24
    specialize prime_field_polynomial_trim_zero_prefix_cut_bound (q)
04Use earlier factsL25–28

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

  1. L25
    apply prime_field_polynomial_trim_zero_prefix_cut_bound
  2. L26
    exact hqL
  3. L27
    exact hz
  4. L28
    exact ht
05Establish hcopyL29–30

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

  1. L29
    have hcopy : FpPolynomialTrim(p,ub,uc,L,t,rb,rc,R)Definitions: FpPolynomialTrim
  2. L30
    exact ht
06Separate the logical casesL31–34

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

  1. L31
    cases hcopy
  2. L32
    cases hcopy_right
  3. L33
    cases hcopy_right_right
  4. L34
    cases hcopy_right_right_right
07Establish htotalL35–41

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

  1. L35
    have htotal : R+t=L
  2. L36
    trans t+R
  3. L37
    specialize add_comm (R)
  4. L38
    specialize add_comm (t)
  5. L39
    apply add_comm
  6. L40
    symm
  7. L41
    exact hcopy_left
08Establish hpartialL42–48

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

  1. L42
    have hpartial : exists pfc_gap_division_remainder_partial. pfc_gap_division_remainder_partial+(R+q)=(R+t)
  2. L43
    specialize add_le_add_left (q)
  3. L44
    specialize add_le_add_left (t)
  4. L45
    specialize add_le_add_left (R)
  5. L46
    apply add_le_add_left
  6. L47
    exact hqt
  7. L48
    rewrite htotal at hpartial
09Establish hfullL49–55

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

  1. L49
    have hfull : exists pfc_gap_division_remainder_full. pfc_gap_division_remainder_full+(R+q)=(q+d)
  2. L50
    specialize le_trans (R+q)
  3. L51
    specialize le_trans (L)
  4. L52
    specialize le_trans (q+d)
  5. L53
    apply le_trans
  6. L54
    exact hpartial
  7. L55
    exact hLd
10Establish hcommL56–65

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

  1. L56
    have hcomm : q+d=d+q
  2. L57
    specialize add_comm (q)
  3. L58
    specialize add_comm (d)
  4. L59
    apply add_comm
  5. L60
    rewrite hcomm at hfull
  6. L61
    specialize add_le_cancel_right (R)
  7. L62
    specialize add_le_cancel_right (d)
  8. L63
    specialize add_le_cancel_right (q)
  9. L64
    apply add_le_cancel_right
  10. L65
    exact hfull

Library-wide reading audit

Original exact command ledger · 65 lines
  1. 0001intro p
  2. 0002intro ub
  3. 0003intro uc
  4. 0004intro L
  5. 0005intro t
  6. 0006intro rb
  7. 0007intro rc
  8. 0008intro R
  9. 0009intro q
  10. 0010intro d
  11. 0011intro hqL
  12. 0012intro hLd
  13. 0013intro hz
  14. 0014intro ht
  15. 0015have hqt : exists pfc_gap_division_remainder_cut. pfc_gap_division_remainder_cut+(q)=(t)
  16. 0016specialize prime_field_polynomial_trim_zero_prefix_cut_bound (p)
  17. 0017specialize prime_field_polynomial_trim_zero_prefix_cut_bound (ub)
  18. 0018specialize prime_field_polynomial_trim_zero_prefix_cut_bound (uc)
  19. 0019specialize prime_field_polynomial_trim_zero_prefix_cut_bound (L)
  20. 0020specialize prime_field_polynomial_trim_zero_prefix_cut_bound (t)
  21. 0021specialize prime_field_polynomial_trim_zero_prefix_cut_bound (rb)
  22. 0022specialize prime_field_polynomial_trim_zero_prefix_cut_bound (rc)
  23. 0023specialize prime_field_polynomial_trim_zero_prefix_cut_bound (R)
  24. 0024specialize prime_field_polynomial_trim_zero_prefix_cut_bound (q)
  25. 0025apply prime_field_polynomial_trim_zero_prefix_cut_bound
  26. 0026exact hqL
  27. 0027exact hz
  28. 0028exact ht
  29. 0029have hcopy : (((L)=(t)+(R)) /\ (((forall fom_index_pfp_division_remainder_copyinput. (exists fom_gap_pfp_division_remainder_copyinput_index_bound. fom_gap_pfp_division_remainder_copyinput_index_bound + S (fom_index_pfp_division_remainder_copyinput) = L) -> exists fom_value_pfp_division_remainder_copyinput. ((((exists fom_beta_height_pfp_division_remainder_copyinput_entry. fom_beta_height_pfp_division_remainder_copyinput_entry + S (fom_value_pfp_division_remainder_copyinput) = S ((S (fom_index_pfp_division_remainder_copyinput)) * uc)) /\ exists fom_beta_quotient_pfp_division_remainder_copyinput_entry. ub = fom_beta_quotient_pfp_division_remainder_copyinput_entry * S ((S (fom_index_pfp_division_remainder_copyinput)) * uc) + (fom_value_pfp_division_remainder_copyinput))) /\ (exists fom_gap_pfp_division_remainder_copyinput_value_bound. fom_gap_pfp_division_remainder_copyinput_value_bound + S (fom_value_pfp_division_remainder_copyinput) = p))) /\ (((forall pfp_repeat_index_division_remainder_copyremoved. (exists pfa_gap_division_remainder_copyremovedindex. pfa_gap_division_remainder_copyremovedindex + S (pfp_repeat_index_division_remainder_copyremoved) = (t)) -> (((exists ff_h_pfp_division_remainder_copyremovedentry. ff_h_pfp_division_remainder_copyremovedentry + S (0) = S ((S (pfp_repeat_index_division_remainder_copyremoved)) * uc)) /\ exists ff_q_pfp_division_remainder_copyremovedentry. ub = ff_q_pfp_division_remainder_copyremovedentry * S ((S (pfp_repeat_index_division_remainder_copyremoved)) * uc) + (0)))) /\ (((forall pftrim_index_division_remainder_copysuffix pftrim_value_division_remainder_copysuffix. (exists pfa_gap_division_remainder_copysuffixbound. pfa_gap_division_remainder_copysuffixbound + S (pftrim_index_division_remainder_copysuffix) = (R)) -> (((exists ff_h_pfp_division_remainder_copysuffixsource. ff_h_pfp_division_remainder_copysuffixsource + S (pftrim_value_division_remainder_copysuffix) = S ((S ((t)+pftrim_index_division_remainder_copysuffix)) * uc)) /\ exists ff_q_pfp_division_remainder_copysuffixsource. ub = ff_q_pfp_division_remainder_copysuffixsource * S ((S ((t)+pftrim_index_division_remainder_copysuffix)) * uc) + (pftrim_value_division_remainder_copysuffix))) -> (((exists ff_h_pfp_division_remainder_copysuffixoutput. ff_h_pfp_division_remainder_copysuffixoutput + S (pftrim_value_division_remainder_copysuffix) = S ((S (pftrim_index_division_remainder_copysuffix)) * rc)) /\ exists ff_q_pfp_division_remainder_copysuffixoutput. rb = ff_q_pfp_division_remainder_copysuffixoutput * S ((S (pftrim_index_division_remainder_copysuffix)) * rc) + (pftrim_value_division_remainder_copysuffix)))) /\ (((R)=0 \/ (exists pftrim_leading_division_remainder_copynormal. ((((exists ff_h_pfp_division_remainder_copynormalentry. ff_h_pfp_division_remainder_copynormalentry + S (pftrim_leading_division_remainder_copynormal) = S ((S (0)) * rc)) /\ exists ff_q_pfp_division_remainder_copynormalentry. rb = ff_q_pfp_division_remainder_copynormalentry * S ((S (0)) * rc) + (pftrim_leading_division_remainder_copynormal))) /\ ((~(pftrim_leading_division_remainder_copynormal=0))))))))))))))
  30. 0030exact ht
  31. 0031cases hcopy
  32. 0032cases hcopy_right
  33. 0033cases hcopy_right_right
  34. 0034cases hcopy_right_right_right
  35. 0035have htotal : R+t=L
  36. 0036trans t+R
  37. 0037specialize add_comm (R)
  38. 0038specialize add_comm (t)
  39. 0039apply add_comm
  40. 0040symm
  41. 0041exact hcopy_left
  42. 0042have hpartial : exists pfc_gap_division_remainder_partial. pfc_gap_division_remainder_partial+(R+q)=(R+t)
  43. 0043specialize add_le_add_left (q)
  44. 0044specialize add_le_add_left (t)
  45. 0045specialize add_le_add_left (R)
  46. 0046apply add_le_add_left
  47. 0047exact hqt
  48. 0048rewrite htotal at hpartial
  49. 0049have hfull : exists pfc_gap_division_remainder_full. pfc_gap_division_remainder_full+(R+q)=(q+d)
  50. 0050specialize le_trans (R+q)
  51. 0051specialize le_trans (L)
  52. 0052specialize le_trans (q+d)
  53. 0053apply le_trans
  54. 0054exact hpartial
  55. 0055exact hLd
  56. 0056have hcomm : q+d=d+q
  57. 0057specialize add_comm (q)
  58. 0058specialize add_comm (d)
  59. 0059apply add_comm
  60. 0060rewrite hcomm at hfull
  61. 0061specialize add_le_cancel_right (R)
  62. 0062specialize add_le_cancel_right (d)
  63. 0063specialize add_le_cancel_right (q)
  64. 0064apply add_le_cancel_right
  65. 0065exact hfull