MC000B

divisor_prime_toggle_bounded

Every actual prime-toggle image of the finite interval 0..n remains in that interval, not in an assumed larger universe.

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.

The input n is positive. Signed code 2 denotes +1, so the actual sum is +1 at n=1 and zero for n>1. The positive-values result permits arbitrary F(0), which the divisor mask excludes. Prime-square multiples contribute zero. Full G007 inversion is established in its separate family.

Exact theorem in conservative defined notation

∀ n. ∀ p. ∀ d. ∀ e. ¬n = 0 → Prime(p)Dvd(p,n)Le(d,n)DivisorPrimeToggle(n,p,d,e)Le(e,n)

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

Definition DAG

Actual proof prerequisites

Original expanded first-order statement
forall n p d e. ~(n=0) -> (~((p) = 1) /\ forall pvs_left_divisor_bounded_prime pvs_right_divisor_bounded_prime. (p) = pvs_left_divisor_bounded_prime * pvs_right_divisor_bounded_prime -> pvs_left_divisor_bounded_prime = 1 \/ pvs_right_divisor_bounded_prime = 1) -> (exists pvs_factor_divisor_bounded_prime_divisor. (n) = (p) * pvs_factor_divisor_bounded_prime_divisor) -> (exists pvs_le_gap_divisor_bounded_input. pvs_le_gap_divisor_bounded_input + (d) = (n)) -> ((((~((d)=0)) /\ (((exists pvs_factor_divisor_bounded_graphdivisor. (n) = (d) * pvs_factor_divisor_bounded_graphdivisor) /\ ((((~(exists pvs_factor_divisor_bounded_graphtogglefresh_input. (d) = (p) * pvs_factor_divisor_bounded_graphtogglefresh_input)) /\ ((e)=(p)*(d)))) \/ (((((d)=(p)*(e)) /\ (~(exists pvs_factor_divisor_bounded_graphtogglefresh_output. (e) = (p) * pvs_factor_divisor_bounded_graphtogglefresh_output)))) \/ (((exists pvs_factor_divisor_bounded_graphtogglesquare. (d) = ((p)*(p)) * pvs_factor_divisor_bounded_graphtogglesquare) /\ ((e)=(d)))))))))) \/ ((((d)=0 \/ ~(exists pvs_factor_divisor_bounded_graphnondivisor. (n) = (d) * pvs_factor_divisor_bounded_graphnondivisor)) /\ ((e)=(d))))) -> (exists pvs_le_gap_divisor_bounded_output. pvs_le_gap_divisor_bounded_output + (e) = (n))

Complete tactic proof in conservative notation

All 28 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

28 script commands · 7 reading checkpoints · 0 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 (1)
01Fix variables and assumptionsL1–9

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

  1. L1
    intro n
  2. L2
    intro p
  3. L3
    intro d
  4. L4
    intro e
  5. L5
    intro hn
  6. L6
    intro hp
  7. L7
    intro hpn
  8. L8
    intro hd
  9. L9
    intro he
02Separate the logical casesL10–12

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

  1. L10
    cases he
  2. L11
    cases he_left
  3. L12
    cases he_left_right
03Use earlier factsL13–22

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

  1. L13
    specialize divisor_le_nonzero (e)
  2. L14
    specialize divisor_le_nonzero (n)
  3. L15
    apply divisor_le_nonzero
  4. L16
    exact hn
  5. L17
    specialize prime_factor_toggle_preserves_divisor (p)
  6. L18
    specialize prime_factor_toggle_preserves_divisor (n)
  7. L19
    specialize prime_factor_toggle_preserves_divisor (d)
  8. L20
    specialize prime_factor_toggle_preserves_divisor (e)
  9. L21
    apply prime_factor_toggle_preserves_divisor
  10. L22
    exact hp
04Use earlier factsL23–25

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

  1. L23
    exact hpn
  2. L24
    exact he_left_right_left
  3. L25
    exact he_left_right_right
05Separate the logical casesL26–26

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

  1. L26
    cases he_right
06Calculate and transport equalitiesL27–27

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

  1. L27
    rewrite he_right_right
07Use earlier factsL28–28

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

  1. L28
    exact hd

Library-wide reading audit

Original defined command ledger · 28 lines
  1. 0001intro n
  2. 0002intro p
  3. 0003intro d
  4. 0004intro e
  5. 0005intro hn
  6. 0006intro hp
  7. 0007intro hpn
  8. 0008intro hd
  9. 0009intro he
  10. 0010cases he
  11. 0011cases he_left
  12. 0012cases he_left_right
  13. 0013specialize divisor_le_nonzero (e)
  14. 0014specialize divisor_le_nonzero (n)
  15. 0015apply divisor_le_nonzero
  16. 0016exact hn
  17. 0017specialize prime_factor_toggle_preserves_divisor (p)
  18. 0018specialize prime_factor_toggle_preserves_divisor (n)
  19. 0019specialize prime_factor_toggle_preserves_divisor (d)
  20. 0020specialize prime_factor_toggle_preserves_divisor (e)
  21. 0021apply prime_factor_toggle_preserves_divisor
  22. 0022exact hp
  23. 0023exact hpn
  24. 0024exact he_left_right_left
  25. 0025exact he_left_right_right
  26. 0026cases he_right
  27. 0027rewrite he_right_right
  28. 0028exact hd