PC0009

prime_count_bounded

The exact prime count is at most the ambient finite interval length.

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

These are the exact finite integer inequalities with constant 8, for every N≥2. The proof uses constructive binomial and primorial infrastructure; it does not assume logarithms, asymptotic estimates, the prime number theorem, or a factorization oracle.

Exact theorem in conservative defined notation

∀ n. ∀ k. PrimeCount(n,k)Le(k,n)

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

Definition DAG

Actual proof prerequisites

bit_count_bounded · checked external prerequisiteprime_bit_prefix_all_bits
Original expanded first-order statement
forall n k. (exists pc_code_count_bound_source pc_scale_count_bound_source. (forall pc_index_count_bound_source_mask. (exists pc_lt_count_bound_source_mask_bound. pc_lt_count_bound_source_mask_bound + S (pc_index_count_bound_source_mask) = (n)) -> exists pc_bit_count_bound_source_mask. (((exists fs_h_pc_count_bound_source_mask_entry. fs_h_pc_count_bound_source_mask_entry + S (pc_bit_count_bound_source_mask) = S ((S (pc_index_count_bound_source_mask)) * pc_scale_count_bound_source)) /\ exists fs_q_pc_count_bound_source_mask_entry. pc_code_count_bound_source = fs_q_pc_count_bound_source_mask_entry * S ((S (pc_index_count_bound_source_mask)) * pc_scale_count_bound_source) + (pc_bit_count_bound_source_mask))) /\ (((((~(S (pc_index_count_bound_source_mask) = 1) /\ forall bpr_left_pc_count_bound_source_mask_choice_prime bpr_right_pc_count_bound_source_mask_choice_prime. S (pc_index_count_bound_source_mask) = bpr_left_pc_count_bound_source_mask_choice_prime * bpr_right_pc_count_bound_source_mask_choice_prime -> bpr_left_pc_count_bound_source_mask_choice_prime = 1 \/ bpr_right_pc_count_bound_source_mask_choice_prime = 1)) /\ pc_bit_count_bound_source_mask = 1) \/ (~((~(S (pc_index_count_bound_source_mask) = 1) /\ forall bpr_left_pc_count_bound_source_mask_choice_prime bpr_right_pc_count_bound_source_mask_choice_prime. S (pc_index_count_bound_source_mask) = bpr_left_pc_count_bound_source_mask_choice_prime * bpr_right_pc_count_bound_source_mask_choice_prime -> bpr_left_pc_count_bound_source_mask_choice_prime = 1 \/ bpr_right_pc_count_bound_source_mask_choice_prime = 1)) /\ pc_bit_count_bound_source_mask = 0)))) /\ (exists fs_u_pc_count_bound_source_sum fs_v_pc_count_bound_source_sum. ((((exists fs_h_pc_count_bound_source_sum_body_start. fs_h_pc_count_bound_source_sum_body_start + S (0) = S ((S (0)) * fs_v_pc_count_bound_source_sum)) /\ exists fs_q_pc_count_bound_source_sum_body_start. fs_u_pc_count_bound_source_sum = fs_q_pc_count_bound_source_sum_body_start * S ((S (0)) * fs_v_pc_count_bound_source_sum) + (0))) /\ ((((exists fs_h_pc_count_bound_source_sum_body_terminal. fs_h_pc_count_bound_source_sum_body_terminal + S (k) = S ((S (n)) * fs_v_pc_count_bound_source_sum)) /\ exists fs_q_pc_count_bound_source_sum_body_terminal. fs_u_pc_count_bound_source_sum = fs_q_pc_count_bound_source_sum_body_terminal * S ((S (n)) * fs_v_pc_count_bound_source_sum) + (k))) /\ forall fs_i_pc_count_bound_source_sum_body_steps. (exists fs_lt_pc_count_bound_source_sum_body_steps_bound. fs_lt_pc_count_bound_source_sum_body_steps_bound + S fs_i_pc_count_bound_source_sum_body_steps = n) -> exists fs_a_pc_count_bound_source_sum_body_steps fs_r_pc_count_bound_source_sum_body_steps fs_s_pc_count_bound_source_sum_body_steps. ((((exists fs_h_pc_count_bound_source_sum_body_steps_summand. fs_h_pc_count_bound_source_sum_body_steps_summand + S (fs_a_pc_count_bound_source_sum_body_steps) = S ((S (fs_i_pc_count_bound_source_sum_body_steps)) * pc_scale_count_bound_source)) /\ exists fs_q_pc_count_bound_source_sum_body_steps_summand. pc_code_count_bound_source = fs_q_pc_count_bound_source_sum_body_steps_summand * S ((S (fs_i_pc_count_bound_source_sum_body_steps)) * pc_scale_count_bound_source) + (fs_a_pc_count_bound_source_sum_body_steps))) /\ ((((exists fs_h_pc_count_bound_source_sum_body_steps_partial. fs_h_pc_count_bound_source_sum_body_steps_partial + S (fs_r_pc_count_bound_source_sum_body_steps) = S ((S (fs_i_pc_count_bound_source_sum_body_steps)) * fs_v_pc_count_bound_source_sum)) /\ exists fs_q_pc_count_bound_source_sum_body_steps_partial. fs_u_pc_count_bound_source_sum = fs_q_pc_count_bound_source_sum_body_steps_partial * S ((S (fs_i_pc_count_bound_source_sum_body_steps)) * fs_v_pc_count_bound_source_sum) + (fs_r_pc_count_bound_source_sum_body_steps))) /\ ((((exists fs_h_pc_count_bound_source_sum_body_steps_successor. fs_h_pc_count_bound_source_sum_body_steps_successor + S (fs_s_pc_count_bound_source_sum_body_steps) = S ((S (S fs_i_pc_count_bound_source_sum_body_steps)) * fs_v_pc_count_bound_source_sum)) /\ exists fs_q_pc_count_bound_source_sum_body_steps_successor. fs_u_pc_count_bound_source_sum = fs_q_pc_count_bound_source_sum_body_steps_successor * S ((S (S fs_i_pc_count_bound_source_sum_body_steps)) * fs_v_pc_count_bound_source_sum) + (fs_s_pc_count_bound_source_sum_body_steps))) /\ fs_s_pc_count_bound_source_sum_body_steps = fs_r_pc_count_bound_source_sum_body_steps + fs_a_pc_count_bound_source_sum_body_steps))))))) -> (exists pc_le_count_bound_result. pc_le_count_bound_result + (k) = (n))

Complete tactic proof in conservative notation

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

18 script commands · 5 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–3

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

  1. L1
    intro n
  2. L2
    intro k
  3. L3
    intro h
02Separate the logical casesL4–6

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

  1. L4
    cases h
  2. L5
    cases h_witness
  3. L6
    cases h_witness_witness
03Use earlier factsL7–11

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

  1. L7
    specialize bit_count_bounded x
  2. L8
    specialize bit_count_bounded x1
  3. L9
    specialize bit_count_bounded n
  4. L10
    specialize bit_count_bounded k
  5. L11
    apply bit_count_bounded
04Separate the logical casesL12–12

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

  1. L12
    split
05Use earlier factsL13–18

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

  1. L13
    exact h_witness_witness_right
  2. L14
    specialize prime_bit_prefix_all_bits x
  3. L15
    specialize prime_bit_prefix_all_bits x1
  4. L16
    specialize prime_bit_prefix_all_bits n
  5. L17
    apply prime_bit_prefix_all_bits
  6. L18
    exact h_witness_witness_left

Library-wide reading audit

Original defined command ledger · 18 lines
  1. 0001intro n
  2. 0002intro k
  3. 0003intro h
  4. 0004cases h
  5. 0005cases h_witness
  6. 0006cases h_witness_witness
  7. 0007specialize bit_count_bounded x
  8. 0008specialize bit_count_bounded x1
  9. 0009specialize bit_count_bounded n
  10. 0010specialize bit_count_bounded k
  11. 0011apply bit_count_bounded
  12. 0012split
  13. 0013exact h_witness_witness_right
  14. 0014specialize prime_bit_prefix_all_bits x
  15. 0015specialize prime_bit_prefix_all_bits x1
  16. 0016specialize prime_bit_prefix_all_bits n
  17. 0017apply prime_bit_prefix_all_bits
  18. 0018exact h_witness_witness_left