def
definition
primeCounting
show as:
view math explainer →
open explainer
Generate a durable explainer page for this declaration.
open lean source
IndisputableMonolith.NumberTheory.Primes.ArithmeticFunctions on GitHub at line 349.
browse module
All declarations in this module, on Recognition.
explainer page
used by
-
prime_counting_asymptotic -
prime_counting_asymptotic_pnt -
coprime_prime_pow -
isPerfect_fourhundredninetysix -
primeCounting_def -
primeCounting_eighthundred -
primeCounting_eleven -
primeCounting_fifty -
primeCounting_five -
primeCounting_fivehundred -
primeCounting_fourhundred -
primeCounting_hundred -
primeCounting_mono -
primeCounting_ninehundred -
primeCounting_one -
primeCounting_onehundredfifty -
primeCounting_seven -
primeCounting_sevenhundredfifty -
primeCounting_seventeen -
primeCounting_sixhundred -
primeCounting_ten -
primeCounting_thirteen -
primeCounting_thirty -
primeCounting_thousand -
primeCounting_three -
primeCounting_twenty -
primeCounting_two -
primeCounting_twohundred -
primeCounting_twohundredfifty -
primeCounting_zero -
prime_threethousandfiveeleven -
sigma_two_thirty
formal source
346/-! ### Prime counting function π -/
347
348/-- The prime counting function π(n) = #{p ≤ n : p prime}. -/
349def primeCounting (n : ℕ) : ℕ := Nat.primeCounting n
350
351@[simp] theorem primeCounting_def {n : ℕ} : primeCounting n = Nat.primeCounting n := rfl
352
353/-- π(0) = 0. -/
354theorem primeCounting_zero : primeCounting 0 = 0 := by
355 simp [primeCounting]
356
357/-- π(1) = 0. -/
358theorem primeCounting_one : primeCounting 1 = 0 := by
359 simp [primeCounting, Nat.primeCounting]
360
361/-- π(2) = 1. -/
362theorem primeCounting_two : primeCounting 2 = 1 := by
363 native_decide
364
365/-- π(3) = 2. -/
366theorem primeCounting_three : primeCounting 3 = 2 := by
367 native_decide
368
369/-- π(5) = 3. -/
370theorem primeCounting_five : primeCounting 5 = 3 := by
371 native_decide
372
373/-- π(10) = 4. -/
374theorem primeCounting_ten : primeCounting 10 = 4 := by
375 native_decide
376
377/-- π(7) = 4. -/
378theorem primeCounting_seven : primeCounting 7 = 4 := by
379 native_decide