Documentation

Mathlib.NumberTheory.AlmostPrime

Almost prime numbers #

This file defines Nat.IsAlmostPrime k n, the predicate that n has exactly k prime factors counted with multiplicity. We also define Nat.IsAtMostAlmostPrime, the corresponding predicate with at most k prime factors, and Nat.IsSemiprime, the special case of 2-almost-prime numbers.

Both definitions use the arithmetic function ArithmeticFunction.cardFactors, written Ω.

The terminology follows the standard definition of an almost prime.

Main statements #

IsAlmostPrime k n means that n is k-almost prime: it has exactly k prime factors, counted with multiplicity. The side condition excludes 0, so 1 is 0-almost prime.

Equations
Instances For

    IsAtMostAlmostPrime k n means that n has at most k prime factors, counted with multiplicity.

    Equations
    Instances For
      @[reducible, inline]
      abbrev Nat.IsSemiprime (n : ) :

      A semiprime is a 2-almost-prime number.

      Equations
      Instances For
        @[simp]
        theorem Nat.IsAlmostPrime.mul {k l m n : } (hm : k.IsAlmostPrime m) (hn : l.IsAlmostPrime n) :
        (k + l).IsAlmostPrime (m * n)
        theorem Nat.IsAlmostPrime.isAtMost {k l n : } (hn : k.IsAlmostPrime n) (hkl : k l) :
        theorem Nat.Prime.mul_isAlmostPrime_two {p q : } (hp : Prime p) (hq : Prime q) :