Documentation

LeanCert.Engine.Chebyshev.Psi

Certified Chebyshev psi(N) Upper Bounds #

This module provides computable upper bounds on the Chebyshev function psi(N) = sum_{n in Ioc 0 N} vonMangoldt(n).

The core checker is generalized by a rational slope slope:

The original 1.11-specific API is kept as thin wrappers:

Computable upper bound on vonMangoldt(n) #

Computable upper bound on the von Mangoldt function vonMangoldt(n). Returns (logPointComputable (minFac n) depth).hi when IsPrimePow n, and 0 otherwise.

Equations
Instances For
    def LeanCert.Engine.ChebyshevPsi.psiUB (N : ) (depth : := 20) :

    Computable upper bound on psi(N): psiUB N depth = sum n in Ioc 0 N, vonMangoldtUB n depth.

    Equations
    Instances For

      Correctness theorems #

      The von Mangoldt function is bounded above by our computable bound.

      The Chebyshev function psi(N) is bounded above by psiUB(N).

      Decidable comparison infrastructure #

      theorem LeanCert.Engine.ChebyshevPsi.psi_le_of_psiUB_le (N depth : ) (slope : ) (h : decide (psiUB N depth slope) = true) :
      Chebyshev.psi N slope

      Master theorem: if psiUB(N, depth) <= slope is verified computationally, then psi(N) <= slope.

      Generic slope checker: psi(N) <= slope * N #

      def LeanCert.Engine.ChebyshevPsi.checkPsiLeMulWith (N : ) (slope : ) (depth : := 20) :

      Computable check: does psiUB(N) <= slope * N hold?

      Equations
      Instances For
        theorem LeanCert.Engine.ChebyshevPsi.psi_le_of_checkPsiLeMulWith (N depth : ) (slope : ) (h : checkPsiLeMulWith N slope depth = true) :
        Chebyshev.psi N slope * N

        If checkPsiLeMulWith N slope depth holds, then psi(N) <= slope * N.

        theorem LeanCert.Engine.ChebyshevPsi.psi_le_mul_real_of_checkPsiLeMulWith (x : ) (slope : ) (depth : ) (hslope : 0 slope) (hx : 0 < x) (h : checkPsiLeMulWith x⌋₊ slope depth = true) :
        Chebyshev.psi x slope * x

        Real-variable form: if checkPsiLeMulWith floor(x) slope depth holds and slope >= 0, then psi(x) <= slope*x.

        Backwards-compatible wrappers for slope = 111/100 #

        Legacy check used by downstream code: psiUB(N) <= 1.11 * N.

        Equations
        Instances For
          theorem LeanCert.Engine.ChebyshevPsi.psi_le_of_checkPsiBound (N depth : ) (h : checkPsiBound N depth = true) :
          Chebyshev.psi N 111 / 100 * N

          Legacy theorem used by downstream code: psi(N) <= 1.11 * N.

          theorem LeanCert.Engine.ChebyshevPsi.psi_le_mul_real (x : ) (depth : ) (hx : 0 < x) (h : checkPsiBound x⌋₊ depth = true) :
          Chebyshev.psi x 111 / 100 * x

          Real-variable legacy theorem: psi(x) <= 1.11 * x, given checkPsiBound floor(x) depth.

          Efficient incremental checker (for #eval / native_decide testing) #

          Helper: accumulate vonMangoldtUB from 1 to n-1.

          Equations
          Instances For
            def LeanCert.Engine.ChebyshevPsi.checkAllPsiLeMulWith (bound : ) (slope : ) (depth : := 20) :

            Efficient O(N) check that psiUB(N) <= slope * N for all N = 1..bound. Uses incremental accumulation instead of recomputing psiUB from scratch.

            Equations
            Instances For
              @[irreducible]
              def LeanCert.Engine.ChebyshevPsi.checkAllPsiLeMulWith.go (bound : ) (slope : ) (depth n : ) (acc : ) :
              Equations
              • One or more equations did not get rendered due to their size.
              Instances For

                Legacy O(N) checker for slope = 111/100.

                Equations
                Instances For

                  Bridge: checkAllPsiLeMulWith.go -> checkPsiLeMulWith #

                  theorem LeanCert.Engine.ChebyshevPsi.checkAllPsiLeMulWith_implies_checkPsiLeMulWith (bound : ) (slope : ) (depth : ) (h : checkAllPsiLeMulWith bound slope depth = true) (N : ) (hN : 0 < N) (hNb : N bound) :
                  checkPsiLeMulWith N slope depth = true

                  If checkAllPsiLeMulWith bound slope depth returns true, then checkPsiLeMulWith N slope depth is true for all N in {1, ..., bound}.

                  theorem LeanCert.Engine.ChebyshevPsi.allPsiBoundsHold_implies_checkPsiBound (bound depth : ) (h : allPsiBoundsHold bound depth = true) (N : ) (hN : 0 < N) (hNb : N bound) :

                  Legacy bridge theorem for slope = 111/100.