Imports
/- Copyright (c) 2026 Google LLC. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. -/ module public import Mathlib.NumberTheory.Harmonic.Defs public import Cryptids.Semantics.Riemann.RegisterMachine public import Mathlib.NumberTheory.Harmonic.Bounds public import Mathlib.NumberTheory.Harmonic.Int public import Mathlib.NumberTheory.Harmonic.EulerMascheroni public import Mathlib.NumberTheory.Chebyshev public import Mathlib.NumberTheory.LSeries.RiemannZeta public import Cryptids.Semantics.Riemann.Schmidt public import Cryptids.Semantics.Riemann.DigammaBinet public import Cryptids.Semantics.Riemann.HorizontalBounds public import Cryptids.Semantics.Riemann.WeightedStieltjes public import Cryptids.Semantics.Riemann.VonMangoldtCount public import Cryptids.Semantics.Riemann.ExplicitLarge

Part II: Number-Theoretic & Analytic Bridge for riemann_744

This file develops the number-theoretic and real-analytic bridge between the elementary Matiyasevich–Aaronson counterexample predicate MatiyasevichRiemannCounterexample (computed by riemann.nql) and Mathlib's RiemannHypothesis.

Mathematical Overview

For each integer $x > 253$ and $L_x = \operatorname{lcm}(1, \dots, x)$, the NQL program tests whether $$H_{L_x} > x \quad\text{and}\quad (H_{L_x} - x)^2 > x \cdot H_x^4.$$ We decompose the equivalence $$\left(\exists x : \mathbb{N},; \text{MatiyasevichRiemannCounterexample } x\right) \iff \neg \text{RiemannHypothesis}$$ into the following steps, proving all elementary, harmonic, Euler–Mascheroni, and Chebyshev-$\psi$ reductions completely in Lean 4 and isolating the classical complex-analytic number theory results of Schoenfeld (1976) and Schmidt (1903):

    Rational and Real Reformulations:

      matiyasevichRiemannCounterexample_iff_harmonic: equivalence with the $\mathbb{Q}$-inequality.

      matiyasevichRiemannCounterexample_iff_real: equivalence with the $\mathbb{R}$-inequality.

      matiyasevichRiemannCounterexample_iff_sqrt_lt: single real inequality $253 < x ;\wedge; \sqrt{x} \cdot H_x^2 < H_{\operatorname{lcm}(1,\dots,x)} - x$.

      matiyasevichRiemannCounterexample_iff_abs_and_sqrt_lt: formulation with $|H_{\operatorname{lcm}(1,\dots,x)} - x| = H_{\operatorname{lcm}(1,\dots,x)} - x$.

    Identity $\psi(x) = \log \operatorname{lcm}(1, \dots, x)$ and Positivity of lcmUpTo:

      lcmUpTo_pos, one_le_lcmUpTo, dvd_lcmUpTo, self_le_lcmUpTo, lcmUpTo_mono.

      psi_eq_log_lcmUpTo : Chebyshev.psi x = Real.log (lcmUpTo x) and exp_psi_eq_lcmUpTo : Real.exp (Chebyshev.psi x) = lcmUpTo x.

    Euler–Mascheroni & Harmonic-to-Chebyshev-$\psi$ Bounds:

      $\psi(x) + \gamma < H_{\operatorname{lcm}(1,\dots,x)} \le \psi(x) + 1$ (psi_add_eulerMascheroniConstant_lt_harmonic_lcmUpTo, harmonic_lcmUpTo_le_psi_add_one).

      $\log x \le H_x \le 1 + \log x$ and $(\log x)^2 \le H_x^2 \le (1 + \log x)^2$.

    Elementary Reduction Between $\psi(x)$ Bounds and MatiyasevichRiemannCounterexample:

      not_matiyasevichRiemannCounterexample_of_psi_sub_le: proves that Schoenfeld's explicit bound $\psi(x) - x \le \frac{1}{8\pi}\sqrt{x}(\log x)^2$ implies $\neg \text{MatiyasevichRiemannCounterexample } x$ (absorbing the $+1$ harmonic slack via $\pi > 3$ and $x > 253$).

      matiyasevichRiemannCounterexample_of_sqrt_mul_harmonic_sq_le_psi_sub and matiyasevichRiemannCounterexample_of_sqrt_mul_one_add_log_sq_le_psi_sub: proves that a sufficiently large positive excursion of $\psi(x) - x$ yields MatiyasevichRiemannCounterexample x.

    Classical Analytic Number Theory Ingredients (Schoenfeld 1976 & Schmidt 1903):

      riemannHypothesis_imp_schoenfeld_psi_bound: under RiemannHypothesis, $|\psi(x) - x| \le \frac{1}{8\pi} \sqrt{x} (\log x)^2$ for $x > 253$.

      not_riemannHypothesis_imp_exists_psi_oscillation: under ¬ RiemannHypothesis, there exists $x > 253$ with $\sqrt{x} H_x^2 \le \psi(x) - x + \gamma$.

@[expose] public sectionnamespace ConjectureMachines.Semantics.Riemann

1. The Matiyasevich–Aaronson Elementary Counterexample Predicate

Over ℚ, harmNum n is n! * harmonic n.

theorem harmNum_eq_factorial_mul_harmonic (n : ℕ) : (harmNum n : ℚ) = (n.factorial : ℚ) * harmonic n := n:ℕ⊢ ↑(harmNum n) = ↑n.factorial * harmonic n induction n with ⊢ ↑(harmNum 0) = ↑(Nat.factorial 0) * harmonic 0 All goals completed! 🐙 n:ℕih:↑(harmNum n) = ↑n.factorial * harmonic n⊢ ↑(harmNum (n + 1)) = ↑(n + 1).factorial * harmonic (n + 1) n:ℕih:↑(harmNum n) = ↑n.factorial * harmonic n⊢ ↑(harmNum n * (n + 1) + n.factorial) = ↑((n + 1) * n.factorial) * (harmonic n + (↑(n + 1))⁻¹) n:ℕih:↑(harmNum n) = ↑n.factorial * harmonic n⊢ ↑(harmNum n) * (↑n + 1) + ↑n.factorial = (↑n + 1) * ↑n.factorial * (harmonic n + (↑n + 1)⁻¹) n:ℕih:↑(harmNum n) = ↑n.factorial * harmonic n⊢ ↑n.factorial * harmonic n * (↑n + 1) + ↑n.factorial = (↑n + 1) * ↑n.factorial * (harmonic n + (↑n + 1)⁻¹) n:ℕih:↑(harmNum n) = ↑n.factorial * harmonic nhpos:↑n + 1 ≠ 0⊢ ↑n.factorial * harmonic n * (↑n + 1) + ↑n.factorial = (↑n + 1) * ↑n.factorial * (harmonic n + (↑n + 1)⁻¹) All goals completed! 🐙

Over ℚ, harmNum n / n! equals Mathlib's harmonic n.

theorem harmNum_div_factorial (n : ℕ) : (harmNum n : ℚ) / (n.factorial : ℚ) = harmonic n := n:ℕ⊢ ↑(harmNum n) / ↑n.factorial = harmonic n n:ℕ⊢ ↑n.factorial ≠ 0 All goals completed! 🐙

Equivalence between the integer cross-multiplied test in MatiyasevichRiemannCounterexample and the rational harmonic number inequality $(H_{\operatorname{lcm}(1,\dots,x)} - x)^2 > x H_x^4$ with $H_{\operatorname{lcm}(1,\dots,x)} > x$.

theorem matiyasevichRiemannCounterexample_iff_harmonic (x : ℕ) : MatiyasevichRiemannCounterexample x ↔ 253 < x ∧ let lcm := (Finset.Icc 1 x).lcm id (x : ℚ) < harmonic lcm ∧ (x : ℚ) * harmonic x ^ 4 < (harmonic lcm - x) ^ 2 := x:ℕ⊢ MatiyasevichRiemannCounterexample x ↔ 253 < x ∧ let lcm := (Finset.Icc 1 x).lcm id; ↑x < harmonic lcm ∧ ↑x * harmonic x ^ 4 < (harmonic lcm - ↑x) ^ 2 x:ℕ⊢ (253 < x ∧ have lcm := (Finset.Icc 1 x).lcm id; have a := (harmNum lcm - lcm.factorial * x) ^ 2; have b := lcm.factorial ^ 2; have c := harmNum x ^ 4 * x; have d := x.factorial ^ 4; b * c < a * d) ↔ 253 < x ∧ let lcm := (Finset.Icc 1 x).lcm id; ↑x < harmonic lcm ∧ ↑x * harmonic x ^ 4 < (harmonic lcm - ↑x) ^ 2 x:ℕ⊢ 253 < x ∧ ((Finset.Icc 1 x).lcm id).factorial ^ 2 * (harmNum x ^ 4 * x) < (harmNum ((Finset.Icc 1 x).lcm id) - ((Finset.Icc 1 x).lcm id).factorial * x) ^ 2 * x.factorial ^ 4 ↔ 253 < x ∧ ↑x < harmonic ((Finset.Icc 1 x).lcm id) ∧ ↑x * harmonic x ^ 4 < (harmonic ((Finset.Icc 1 x).lcm id) - ↑x) ^ 2 x:ℕlcm:ℕ := (Finset.Icc 1 x).lcm id⊢ 253 < x ∧ lcm.factorial ^ 2 * (harmNum x ^ 4 * x) < (harmNum lcm - lcm.factorial * x) ^ 2 * x.factorial ^ 4 ↔ 253 < x ∧ ↑x < harmonic lcm ∧ ↑x * harmonic x ^ 4 < (harmonic lcm - ↑x) ^ 2 x:ℕlcm:ℕ := (Finset.Icc 1 x).lcm idhlcm_fac_pos:0 < ↑lcm.factorial⊢ 253 < x ∧ lcm.factorial ^ 2 * (harmNum x ^ 4 * x) < (harmNum lcm - lcm.factorial * x) ^ 2 * x.factorial ^ 4 ↔ 253 < x ∧ ↑x < harmonic lcm ∧ ↑x * harmonic x ^ 4 < (harmonic lcm - ↑x) ^ 2 x:ℕlcm:ℕ := (Finset.Icc 1 x).lcm idhlcm_fac_pos:0 < ↑lcm.factorialhx_fac_pos:0 < ↑x.factorial⊢ 253 < x ∧ lcm.factorial ^ 2 * (harmNum x ^ 4 * x) < (harmNum lcm - lcm.factorial * x) ^ 2 * x.factorial ^ 4 ↔ 253 < x ∧ ↑x < harmonic lcm ∧ ↑x * harmonic x ^ 4 < (harmonic lcm - ↑x) ^ 2 x:ℕlcm:ℕ := (Finset.Icc 1 x).lcm idhlcm_fac_pos:0 < ↑lcm.factorialhx_fac_pos:0 < ↑x.factorialhden_pos:0 < ↑lcm.factorial ^ 2 * ↑x.factorial ^ 4⊢ 253 < x ∧ lcm.factorial ^ 2 * (harmNum x ^ 4 * x) < (harmNum lcm - lcm.factorial * x) ^ 2 * x.factorial ^ 4 ↔ 253 < x ∧ ↑x < harmonic lcm ∧ ↑x * harmonic x ^ 4 < (harmonic lcm - ↑x) ^ 2 x:ℕlcm:ℕ := (Finset.Icc 1 x).lcm idhlcm_fac_pos:0 < ↑lcm.factorialhx_fac_pos:0 < ↑x.factorialhden_pos:0 < ↑lcm.factorial ^ 2 * ↑x.factorial ^ 4⊢ 253 < x ∧ lcm.factorial ^ 2 * (harmNum x ^ 4 * x) < (harmNum lcm - lcm.factorial * x) ^ 2 * x.factorial ^ 4 → 253 < x ∧ ↑x < harmonic lcm ∧ ↑x * harmonic x ^ 4 < (harmonic lcm - ↑x) ^ 2x:ℕlcm:ℕ := (Finset.Icc 1 x).lcm idhlcm_fac_pos:0 < ↑lcm.factorialhx_fac_pos:0 < ↑x.factorialhden_pos:0 < ↑lcm.factorial ^ 2 * ↑x.factorial ^ 4⊢ 253 < x ∧ ↑x < harmonic lcm ∧ ↑x * harmonic x ^ 4 < (harmonic lcm - ↑x) ^ 2 → 253 < x ∧ lcm.factorial ^ 2 * (harmNum x ^ 4 * x) < (harmNum lcm - lcm.factorial * x) ^ 2 * x.factorial ^ 4 x:ℕlcm:ℕ := (Finset.Icc 1 x).lcm idhlcm_fac_pos:0 < ↑lcm.factorialhx_fac_pos:0 < ↑x.factorialhden_pos:0 < ↑lcm.factorial ^ 2 * ↑x.factorial ^ 4⊢ 253 < x ∧ lcm.factorial ^ 2 * (harmNum x ^ 4 * x) < (harmNum lcm - lcm.factorial * x) ^ 2 * x.factorial ^ 4 → 253 < x ∧ ↑x < harmonic lcm ∧ ↑x * harmonic x ^ 4 < (harmonic lcm - ↑x) ^ 2 x:ℕlcm:ℕ := (Finset.Icc 1 x).lcm idhlcm_fac_pos:0 < ↑lcm.factorialhx_fac_pos:0 < ↑x.factorialhden_pos:0 < ↑lcm.factorial ^ 2 * ↑x.factorial ^ 4hx:253 < xhlt:lcm.factorial ^ 2 * (harmNum x ^ 4 * x) < (harmNum lcm - lcm.factorial * x) ^ 2 * x.factorial ^ 4⊢ 253 < x ∧ ↑x < harmonic lcm ∧ ↑x * harmonic x ^ 4 < (harmonic lcm - ↑x) ^ 2 x:ℕlcm:ℕ := (Finset.Icc 1 x).lcm idhlcm_fac_pos:0 < ↑lcm.factorialhx_fac_pos:0 < ↑x.factorialhden_pos:0 < ↑lcm.factorial ^ 2 * ↑x.factorial ^ 4hx:253 < xhlt:lcm.factorial ^ 2 * (harmNum x ^ 4 * x) < (harmNum lcm - lcm.factorial * x) ^ 2 * x.factorial ^ 4⊢ ↑x < harmonic lcm ∧ ↑x * harmonic x ^ 4 < (harmonic lcm - ↑x) ^ 2 x:ℕlcm:ℕ := (Finset.Icc 1 x).lcm idhlcm_fac_pos:0 < ↑lcm.factorialhx_fac_pos:0 < ↑x.factorialhden_pos:0 < ↑lcm.factorial ^ 2 * ↑x.factorial ^ 4hx:253 < xhlt:lcm.factorial ^ 2 * (harmNum x ^ 4 * x) < (harmNum lcm - lcm.factorial * x) ^ 2 * x.factorial ^ 4hsub_pos:lcm.factorial * x < harmNum lcm⊢ ↑x < harmonic lcm ∧ ↑x * harmonic x ^ 4 < (harmonic lcm - ↑x) ^ 2 x:ℕlcm:ℕ := (Finset.Icc 1 x).lcm idhlcm_fac_pos:0 < ↑lcm.factorialhx_fac_pos:0 < ↑x.factorialhden_pos:0 < ↑lcm.factorial ^ 2 * ↑x.factorial ^ 4hx:253 < xhlt:lcm.factorial ^ 2 * (harmNum x ^ 4 * x) < (harmNum lcm - lcm.factorial * x) ^ 2 * x.factorial ^ 4hsub_pos:lcm.factorial * x < harmNum lcmhlt_q:↑(lcm.factorial ^ 2 * (harmNum x ^ 4 * x)) < ↑((harmNum lcm - lcm.factorial * x) ^ 2 * x.factorial ^ 4)⊢ ↑x < harmonic lcm ∧ ↑x * harmonic x ^ 4 < (harmonic lcm - ↑x) ^ 2 x:ℕlcm:ℕ := (Finset.Icc 1 x).lcm idhlcm_fac_pos:0 < ↑lcm.factorialhx_fac_pos:0 < ↑x.factorialhden_pos:0 < ↑lcm.factorial ^ 2 * ↑x.factorial ^ 4hx:253 < xhlt:lcm.factorial ^ 2 * (harmNum x ^ 4 * x) < (harmNum lcm - lcm.factorial * x) ^ 2 * x.factorial ^ 4hsub_pos:lcm.factorial * x < harmNum lcmhlt_q:↑lcm.factorial ^ 2 * (↑(harmNum x) ^ 4 * ↑x) < (↑(harmNum lcm) - ↑lcm.factorial * ↑x) ^ 2 * ↑x.factorial ^ 4⊢ ↑x < harmonic lcm ∧ ↑x * harmonic x ^ 4 < (harmonic lcm - ↑x) ^ 2 x:ℕlcm:ℕ := (Finset.Icc 1 x).lcm idhlcm_fac_pos:0 < ↑lcm.factorialhx_fac_pos:0 < ↑x.factorialhden_pos:0 < ↑lcm.factorial ^ 2 * ↑x.factorial ^ 4hx:253 < xhlt:lcm.factorial ^ 2 * (harmNum x ^ 4 * x) < (harmNum lcm - lcm.factorial * x) ^ 2 * x.factorial ^ 4hsub_pos:lcm.factorial * x < harmNum lcmhlt_q:↑lcm.factorial ^ 2 * ((↑x.factorial * harmonic x) ^ 4 * ↑x) < (↑lcm.factorial * harmonic lcm - ↑lcm.factorial * ↑x) ^ 2 * ↑x.factorial ^ 4⊢ ↑x < harmonic lcm ∧ ↑x * harmonic x ^ 4 < (harmonic lcm - ↑x) ^ 2 x:ℕlcm:ℕ := (Finset.Icc 1 x).lcm idhlcm_fac_pos:0 < ↑lcm.factorialhx_fac_pos:0 < ↑x.factorialhden_pos:0 < ↑lcm.factorial ^ 2 * ↑x.factorial ^ 4hx:253 < xhlt:lcm.factorial ^ 2 * (harmNum x ^ 4 * x) < (harmNum lcm - lcm.factorial * x) ^ 2 * x.factorial ^ 4hsub_pos:lcm.factorial * x < harmNum lcmhlt_q:↑lcm.factorial ^ 2 * ((↑x.factorial * harmonic x) ^ 4 * ↑x) < (↑lcm.factorial * harmonic lcm - ↑lcm.factorial * ↑x) ^ 2 * ↑x.factorial ^ 4hsub_q:↑lcm.factorial * ↑x < ↑lcm.factorial * harmonic lcm⊢ ↑x < harmonic lcm ∧ ↑x * harmonic x ^ 4 < (harmonic lcm - ↑x) ^ 2 x:ℕlcm:ℕ := (Finset.Icc 1 x).lcm idhlcm_fac_pos:0 < ↑lcm.factorialhx_fac_pos:0 < ↑x.factorialhden_pos:0 < ↑lcm.factorial ^ 2 * ↑x.factorial ^ 4hx:253 < xhlt:lcm.factorial ^ 2 * (harmNum x ^ 4 * x) < (harmNum lcm - lcm.factorial * x) ^ 2 * x.factorial ^ 4hsub_pos:lcm.factorial * x < harmNum lcmhlt_q:↑lcm.factorial ^ 2 * ((↑x.factorial * harmonic x) ^ 4 * ↑x) < (↑lcm.factorial * harmonic lcm - ↑lcm.factorial * ↑x) ^ 2 * ↑x.factorial ^ 4hsub_q:↑lcm.factorial * ↑x < ↑lcm.factorial * harmonic lcm⊢ ↑x * harmonic x ^ 4 < (harmonic lcm - ↑x) ^ 2 x:ℕlcm:ℕ := (Finset.Icc 1 x).lcm idhlcm_fac_pos:0 < ↑lcm.factorialhx_fac_pos:0 < ↑x.factorialhden_pos:0 < ↑lcm.factorial ^ 2 * ↑x.factorial ^ 4hx:253 < xhlt:lcm.factorial ^ 2 * (harmNum x ^ 4 * x) < (harmNum lcm - lcm.factorial * x) ^ 2 * x.factorial ^ 4hsub_pos:lcm.factorial * x < harmNum lcmhlt_q:↑lcm.factorial ^ 2 * ((↑x.factorial * harmonic x) ^ 4 * ↑x) < (↑lcm.factorial * harmonic lcm - ↑lcm.factorial * ↑x) ^ 2 * ↑x.factorial ^ 4hsub_q:↑lcm.factorial * ↑x < ↑lcm.factorial * harmonic lcmhring1:↑lcm.factorial ^ 2 * ((↑x.factorial * harmonic x) ^ 4 * ↑x) = ↑lcm.factorial ^ 2 * ↑x.factorial ^ 4 * (↑x * harmonic x ^ 4)⊢ ↑x * harmonic x ^ 4 < (harmonic lcm - ↑x) ^ 2 x:ℕlcm:ℕ := (Finset.Icc 1 x).lcm idhlcm_fac_pos:0 < ↑lcm.factorialhx_fac_pos:0 < ↑x.factorialhden_pos:0 < ↑lcm.factorial ^ 2 * ↑x.factorial ^ 4hx:253 < xhlt:lcm.factorial ^ 2 * (harmNum x ^ 4 * x) < (harmNum lcm - lcm.factorial * x) ^ 2 * x.factorial ^ 4hsub_pos:lcm.factorial * x < harmNum lcmhlt_q:↑lcm.factorial ^ 2 * ((↑x.factorial * harmonic x) ^ 4 * ↑x) < (↑lcm.factorial * harmonic lcm - ↑lcm.factorial * ↑x) ^ 2 * ↑x.factorial ^ 4hsub_q:↑lcm.factorial * ↑x < ↑lcm.factorial * harmonic lcmhring1:↑lcm.factorial ^ 2 * ((↑x.factorial * harmonic x) ^ 4 * ↑x) = ↑lcm.factorial ^ 2 * ↑x.factorial ^ 4 * (↑x * harmonic x ^ 4)hring2:(↑lcm.factorial * harmonic lcm - ↑lcm.factorial * ↑x) ^ 2 * ↑x.factorial ^ 4 = ↑lcm.factorial ^ 2 * ↑x.factorial ^ 4 * (harmonic lcm - ↑x) ^ 2⊢ ↑x * harmonic x ^ 4 < (harmonic lcm - ↑x) ^ 2 x:ℕlcm:ℕ := (Finset.Icc 1 x).lcm idhlcm_fac_pos:0 < ↑lcm.factorialhx_fac_pos:0 < ↑x.factorialhden_pos:0 < ↑lcm.factorial ^ 2 * ↑x.factorial ^ 4hx:253 < xhlt:lcm.factorial ^ 2 * (harmNum x ^ 4 * x) < (harmNum lcm - lcm.factorial * x) ^ 2 * x.factorial ^ 4hsub_pos:lcm.factorial * x < harmNum lcmhlt_q:↑lcm.factorial ^ 2 * ↑x.factorial ^ 4 * (↑x * harmonic x ^ 4) < ↑lcm.factorial ^ 2 * ↑x.factorial ^ 4 * (harmonic lcm - ↑x) ^ 2hsub_q:↑lcm.factorial * ↑x < ↑lcm.factorial * harmonic lcmhring1:↑lcm.factorial ^ 2 * ((↑x.factorial * harmonic x) ^ 4 * ↑x) = ↑lcm.factorial ^ 2 * ↑x.factorial ^ 4 * (↑x * harmonic x ^ 4)hring2:(↑lcm.factorial * harmonic lcm - ↑lcm.factorial * ↑x) ^ 2 * ↑x.factorial ^ 4 = ↑lcm.factorial ^ 2 * ↑x.factorial ^ 4 * (harmonic lcm - ↑x) ^ 2⊢ ↑x * harmonic x ^ 4 < (harmonic lcm - ↑x) ^ 2 All goals completed! 🐙 x:ℕlcm:ℕ := (Finset.Icc 1 x).lcm idhlcm_fac_pos:0 < ↑lcm.factorialhx_fac_pos:0 < ↑x.factorialhden_pos:0 < ↑lcm.factorial ^ 2 * ↑x.factorial ^ 4⊢ 253 < x ∧ ↑x < harmonic lcm ∧ ↑x * harmonic x ^ 4 < (harmonic lcm - ↑x) ^ 2 → 253 < x ∧ lcm.factorial ^ 2 * (harmNum x ^ 4 * x) < (harmNum lcm - lcm.factorial * x) ^ 2 * x.factorial ^ 4 x:ℕlcm:ℕ := (Finset.Icc 1 x).lcm idhlcm_fac_pos:0 < ↑lcm.factorialhx_fac_pos:0 < ↑x.factorialhden_pos:0 < ↑lcm.factorial ^ 2 * ↑x.factorial ^ 4hx:253 < xhxlcm:↑x < harmonic lcmhineq:↑x * harmonic x ^ 4 < (harmonic lcm - ↑x) ^ 2⊢ 253 < x ∧ lcm.factorial ^ 2 * (harmNum x ^ 4 * x) < (harmNum lcm - lcm.factorial * x) ^ 2 * x.factorial ^ 4 x:ℕlcm:ℕ := (Finset.Icc 1 x).lcm idhlcm_fac_pos:0 < ↑lcm.factorialhx_fac_pos:0 < ↑x.factorialhden_pos:0 < ↑lcm.factorial ^ 2 * ↑x.factorial ^ 4hx:253 < xhxlcm:↑x < harmonic lcmhineq:↑x * harmonic x ^ 4 < (harmonic lcm - ↑x) ^ 2⊢ lcm.factorial ^ 2 * (harmNum x ^ 4 * x) < (harmNum lcm - lcm.factorial * x) ^ 2 * x.factorial ^ 4 x:ℕlcm:ℕ := (Finset.Icc 1 x).lcm idhlcm_fac_pos:0 < ↑lcm.factorialhx_fac_pos:0 < ↑x.factorialhden_pos:0 < ↑lcm.factorial ^ 2 * ↑x.factorial ^ 4hx:253 < xhxlcm:↑x < harmonic lcmhineq:↑x * harmonic x ^ 4 < (harmonic lcm - ↑x) ^ 2hsub_q:↑lcm.factorial * ↑x < ↑(harmNum lcm)⊢ lcm.factorial ^ 2 * (harmNum x ^ 4 * x) < (harmNum lcm - lcm.factorial * x) ^ 2 * x.factorial ^ 4 x:ℕlcm:ℕ := (Finset.Icc 1 x).lcm idhlcm_fac_pos:0 < ↑lcm.factorialhx_fac_pos:0 < ↑x.factorialhden_pos:0 < ↑lcm.factorial ^ 2 * ↑x.factorial ^ 4hx:253 < xhxlcm:↑x < harmonic lcmhineq:↑x * harmonic x ^ 4 < (harmonic lcm - ↑x) ^ 2hsub_q:↑lcm.factorial * ↑x < ↑(harmNum lcm)hsub_nat:lcm.factorial * x ≤ harmNum lcm⊢ lcm.factorial ^ 2 * (harmNum x ^ 4 * x) < (harmNum lcm - lcm.factorial * x) ^ 2 * x.factorial ^ 4 x:ℕlcm:ℕ := (Finset.Icc 1 x).lcm idhlcm_fac_pos:0 < ↑lcm.factorialhx_fac_pos:0 < ↑x.factorialhden_pos:0 < ↑lcm.factorial ^ 2 * ↑x.factorial ^ 4hx:253 < xhxlcm:↑x < harmonic lcmhineq:↑x * harmonic x ^ 4 < (harmonic lcm - ↑x) ^ 2hsub_q:↑lcm.factorial * ↑x < ↑(harmNum lcm)hsub_nat:lcm.factorial * x ≤ harmNum lcmhmul_q:↑lcm.factorial ^ 2 * ↑x.factorial ^ 4 * (↑x * harmonic x ^ 4) < ↑lcm.factorial ^ 2 * ↑x.factorial ^ 4 * (harmonic lcm - ↑x) ^ 2⊢ lcm.factorial ^ 2 * (harmNum x ^ 4 * x) < (harmNum lcm - lcm.factorial * x) ^ 2 * x.factorial ^ 4 x:ℕlcm:ℕ := (Finset.Icc 1 x).lcm idhlcm_fac_pos:0 < ↑lcm.factorialhx_fac_pos:0 < ↑x.factorialhden_pos:0 < ↑lcm.factorial ^ 2 * ↑x.factorial ^ 4hx:253 < xhxlcm:↑x < harmonic lcmhineq:↑x * harmonic x ^ 4 < (harmonic lcm - ↑x) ^ 2hsub_q:↑lcm.factorial * ↑x < ↑(harmNum lcm)hsub_nat:lcm.factorial * x ≤ harmNum lcmhmul_q:↑lcm.factorial ^ 2 * ↑x.factorial ^ 4 * (↑x * harmonic x ^ 4) < ↑lcm.factorial ^ 2 * ↑x.factorial ^ 4 * (harmonic lcm - ↑x) ^ 2hlt_q:↑(lcm.factorial ^ 2 * (harmNum x ^ 4 * x)) < ↑((harmNum lcm - lcm.factorial * x) ^ 2 * x.factorial ^ 4)⊢ lcm.factorial ^ 2 * (harmNum x ^ 4 * x) < (harmNum lcm - lcm.factorial * x) ^ 2 * x.factorial ^ 4 All goals completed! 🐙

2. Least Common Multiple lcmUpTo x and Chebyshev's $\psi(x)$

@[simp] theorem lcmUpTo_eq_lcmUpto (x : ℕ) : lcmUpTo x = Nat.lcmUpto x := rfl@[simp] theorem lcmUpTo_one : lcmUpTo 1 = 1 := rfltheorem lcmUpTo_ne_zero (x : ℕ) : lcmUpTo x ≠ 0 := Nat.lcmUpto_ne_zero xtheorem one_le_lcmUpTo (x : ℕ) : 1 ≤ lcmUpTo x := Nat.succ_le_of_lt (lcmUpTo_pos x)theorem dvd_lcmUpTo {x k : ℕ} (hk1 : 1 ≤ k) (hkx : k ≤ x) : k ∣ lcmUpTo x := Finset.dvd_lcm (Finset.mem_Icc.mpr ⟨hk1, hkx⟩)theorem self_le_lcmUpTo {x : ℕ} (hx : 1 ≤ x) : x ≤ lcmUpTo x := Nat.le_of_dvd (lcmUpTo_pos x) (dvd_lcmUpTo hx le_rfl)theorem lcmUpTo_dvd_of_le {x y : ℕ} (hxy : x ≤ y) : lcmUpTo x ∣ lcmUpTo y := Finset.lcm_dvd fun _ hk => Finset.dvd_lcm (Finset.Icc_subset_Icc_right hxy hk)theorem lcmUpTo_mono : Monotone lcmUpTo := fun _ _ hxy => Nat.le_of_dvd (lcmUpTo_pos _) (lcmUpTo_dvd_of_le hxy)theorem lcmUpTo_dvd_factorial (x : ℕ) : lcmUpTo x ∣ x.factorial := Nat.lcmUpto_dvd_factorial xtheorem two_pow_le_mul_lcmUpTo (x : ℕ) : 2 ^ x ≤ (x + 1) * lcmUpTo x := Chebyshev.two_pow_le_mul_lcmUpto x

Chebyshev's $\psi(x) = \sum_{n \le x} \Lambda(n)$ equals $\log \operatorname{lcm}(1, \dots, x)$ for every natural number $x$.

theorem psi_eq_log_lcmUpTo (x : ℕ) : Chebyshev.psi x = Real.log (lcmUpTo x) := Chebyshev.psi_eq_log_lcmUpto x

Exponentiating Chebyshev's $\psi(x)$ recovers $\operatorname{lcm}(1, \dots, x)$.

theorem exp_psi_eq_lcmUpTo (x : ℕ) : Real.exp (Chebyshev.psi x) = lcmUpTo x := x:ℕ⊢ Real.exp (Chebyshev.psi ↑x) = ↑(lcmUpTo x) All goals completed! 🐙

3. Positivity and Monotonicity of Harmonic Numbers & Real-Analytic Reformulations

theorem harmonic_nonneg (n : ℕ) : (0 : ℚ) ≤ harmonic n := n:ℕ⊢ 0 ≤ harmonic n n:ℕ⊢ 0 ≤ ∑ i ∈ Finset.range n, (↑(i + 1))⁻¹ All goals completed! 🐙theorem harmonic_mono : Monotone harmonic := ⊢ Monotone harmonic n:ℕ⊢ harmonic n ≤ harmonic (n + 1) n:ℕ⊢ harmonic n ≤ harmonic n + (↑(n + 1))⁻¹ n:ℕthis:0 ≤ (↑(n + 1))⁻¹⊢ harmonic n ≤ harmonic n + (↑(n + 1))⁻¹ All goals completed! 🐙@[simp] theorem harmonic_one : harmonic 1 = 1 := ⊢ harmonic 1 = 1 All goals completed! 🐙theorem one_le_harmonic {n : ℕ} (hn : 1 ≤ n) : (1 : ℚ) ≤ harmonic n := n:ℕhn:1 ≤ n⊢ 1 ≤ harmonic n All goals completed! 🐙theorem one_le_harmonic_real {n : ℕ} (hn : 1 ≤ n) : (1 : ℝ) ≤ (harmonic n : ℝ) := n:ℕhn:1 ≤ n⊢ 1 ≤ ↑(harmonic n) All goals completed! 🐙theorem harmonic_real_nonneg (n : ℕ) : (0 : ℝ) ≤ (harmonic n : ℝ) := n:ℕ⊢ 0 ≤ ↑(harmonic n) All goals completed! 🐙

Real-analytic reformulation of MatiyasevichRiemannCounterexample x over ℝ.

theorem matiyasevichRiemannCounterexample_iff_real (x : ℕ) : MatiyasevichRiemannCounterexample x ↔ 253 < x ∧ (x : ℝ) < (harmonic (lcmUpTo x) : ℝ) ∧ (x : ℝ) * (harmonic x : ℝ) ^ 4 < ((harmonic (lcmUpTo x) : ℝ) - x) ^ 2 := x:ℕ⊢ MatiyasevichRiemannCounterexample x ↔ 253 < x ∧ ↑x < ↑(harmonic (lcmUpTo x)) ∧ ↑x * ↑(harmonic x) ^ 4 < (↑(harmonic (lcmUpTo x)) - ↑x) ^ 2 x:ℕ⊢ (253 < x ∧ have lcm := (Finset.Icc 1 x).lcm id; ↑x < harmonic lcm ∧ ↑x * harmonic x ^ 4 < (harmonic lcm - ↑x) ^ 2) ↔ 253 < x ∧ ↑x < ↑(harmonic (lcmUpTo x)) ∧ ↑x * ↑(harmonic x) ^ 4 < (↑(harmonic (lcmUpTo x)) - ↑x) ^ 2 x:ℕx✝:253 < x⊢ (have lcm := (Finset.Icc 1 x).lcm id; ↑x < harmonic lcm ∧ ↑x * harmonic x ^ 4 < (harmonic lcm - ↑x) ^ 2) ↔ ↑x < ↑(harmonic (lcmUpTo x)) ∧ ↑x * ↑(harmonic x) ^ 4 < (↑(harmonic (lcmUpTo x)) - ↑x) ^ 2 x:ℕx✝:253 < x⊢ ↑x < harmonic ((Finset.Icc 1 x).lcm id) ∧ ↑x * harmonic x ^ 4 < (harmonic ((Finset.Icc 1 x).lcm id) - ↑x) ^ 2 ↔ ↑x < ↑(harmonic (lcmUpTo x)) ∧ ↑x * ↑(harmonic x) ^ 4 < (↑(harmonic (lcmUpTo x)) - ↑x) ^ 2 x:ℕx✝:253 < x⊢ ↑x < harmonic ((Finset.Icc 1 x).lcm id) ∧ ↑x * harmonic x ^ 4 < (harmonic ((Finset.Icc 1 x).lcm id) - ↑x) ^ 2 → ↑x < ↑(harmonic (lcmUpTo x)) ∧ ↑x * ↑(harmonic x) ^ 4 < (↑(harmonic (lcmUpTo x)) - ↑x) ^ 2x:ℕx✝:253 < x⊢ ↑x < ↑(harmonic (lcmUpTo x)) ∧ ↑x * ↑(harmonic x) ^ 4 < (↑(harmonic (lcmUpTo x)) - ↑x) ^ 2 → ↑x < harmonic ((Finset.Icc 1 x).lcm id) ∧ ↑x * harmonic x ^ 4 < (harmonic ((Finset.Icc 1 x).lcm id) - ↑x) ^ 2 x:ℕx✝:253 < x⊢ ↑x < harmonic ((Finset.Icc 1 x).lcm id) ∧ ↑x * harmonic x ^ 4 < (harmonic ((Finset.Icc 1 x).lcm id) - ↑x) ^ 2 → ↑x < ↑(harmonic (lcmUpTo x)) ∧ ↑x * ↑(harmonic x) ^ 4 < (↑(harmonic (lcmUpTo x)) - ↑x) ^ 2 x:ℕx✝:253 < xh1:↑x < harmonic ((Finset.Icc 1 x).lcm id)h2:↑x * harmonic x ^ 4 < (harmonic ((Finset.Icc 1 x).lcm id) - ↑x) ^ 2⊢ ↑x < ↑(harmonic (lcmUpTo x)) ∧ ↑x * ↑(harmonic x) ^ 4 < (↑(harmonic (lcmUpTo x)) - ↑x) ^ 2 refine ⟨x:ℕx✝:253 < xh1:↑x < harmonic ((Finset.Icc 1 x).lcm id)h2:↑x * harmonic x ^ 4 < (harmonic ((Finset.Icc 1 x).lcm id) - ↑x) ^ 2⊢ ↑x < ↑(harmonic (lcmUpTo x)) All goals completed! 🐙, ?_⟩ All goals completed! 🐙 x:ℕx✝:253 < x⊢ ↑x < ↑(harmonic (lcmUpTo x)) ∧ ↑x * ↑(harmonic x) ^ 4 < (↑(harmonic (lcmUpTo x)) - ↑x) ^ 2 → ↑x < harmonic ((Finset.Icc 1 x).lcm id) ∧ ↑x * harmonic x ^ 4 < (harmonic ((Finset.Icc 1 x).lcm id) - ↑x) ^ 2 x:ℕx✝:253 < xh1:↑x < ↑(harmonic (lcmUpTo x))h2:↑x * ↑(harmonic x) ^ 4 < (↑(harmonic (lcmUpTo x)) - ↑x) ^ 2⊢ ↑x < harmonic ((Finset.Icc 1 x).lcm id) ∧ ↑x * harmonic x ^ 4 < (harmonic ((Finset.Icc 1 x).lcm id) - ↑x) ^ 2 refine ⟨x:ℕx✝:253 < xh1:↑x < ↑(harmonic (lcmUpTo x))h2:↑x * ↑(harmonic x) ^ 4 < (↑(harmonic (lcmUpTo x)) - ↑x) ^ 2⊢ ↑x < harmonic ((Finset.Icc 1 x).lcm id) All goals completed! 🐙, ?_⟩ All goals completed! 🐙

Single-inequality real reformulation of MatiyasevichRiemannCounterexample x: for $x > 253$, the cross-multiplied test holds if and only if $$\sqrt{x} \cdot H_x^2 < H_{\operatorname{lcm}(1, \dots, x)} - x.$$

theorem matiyasevichRiemannCounterexample_iff_sqrt_lt (x : ℕ) : MatiyasevichRiemannCounterexample x ↔ 253 < x ∧ Real.sqrt x * (harmonic x : ℝ) ^ 2 < (harmonic (lcmUpTo x) : ℝ) - x := x:ℕ⊢ MatiyasevichRiemannCounterexample x ↔ 253 < x ∧ √↑x * ↑(harmonic x) ^ 2 < ↑(harmonic (lcmUpTo x)) - ↑x x:ℕ⊢ 253 < x ∧ ↑x < ↑(harmonic (lcmUpTo x)) ∧ ↑x * ↑(harmonic x) ^ 4 < (↑(harmonic (lcmUpTo x)) - ↑x) ^ 2 ↔ 253 < x ∧ √↑x * ↑(harmonic x) ^ 2 < ↑(harmonic (lcmUpTo x)) - ↑x x:ℕx✝:253 < x⊢ ↑x < ↑(harmonic (lcmUpTo x)) ∧ ↑x * ↑(harmonic x) ^ 4 < (↑(harmonic (lcmUpTo x)) - ↑x) ^ 2 ↔ √↑x * ↑(harmonic x) ^ 2 < ↑(harmonic (lcmUpTo x)) - ↑x x:ℕx✝:253 < xhx_nonneg:0 ≤ ↑x⊢ ↑x < ↑(harmonic (lcmUpTo x)) ∧ ↑x * ↑(harmonic x) ^ 4 < (↑(harmonic (lcmUpTo x)) - ↑x) ^ 2 ↔ √↑x * ↑(harmonic x) ^ 2 < ↑(harmonic (lcmUpTo x)) - ↑x x:ℕx✝:253 < xhx_nonneg:0 ≤ ↑xhlhs_nonneg:0 ≤ √↑x * ↑(harmonic x) ^ 2⊢ ↑x < ↑(harmonic (lcmUpTo x)) ∧ ↑x * ↑(harmonic x) ^ 4 < (↑(harmonic (lcmUpTo x)) - ↑x) ^ 2 ↔ √↑x * ↑(harmonic x) ^ 2 < ↑(harmonic (lcmUpTo x)) - ↑x x:ℕx✝:253 < xhx_nonneg:0 ≤ ↑xhlhs_nonneg:0 ≤ √↑x * ↑(harmonic x) ^ 2hsq:(√↑x * ↑(harmonic x) ^ 2) ^ 2 = ↑x * ↑(harmonic x) ^ 4⊢ ↑x < ↑(harmonic (lcmUpTo x)) ∧ ↑x * ↑(harmonic x) ^ 4 < (↑(harmonic (lcmUpTo x)) - ↑x) ^ 2 ↔ √↑x * ↑(harmonic x) ^ 2 < ↑(harmonic (lcmUpTo x)) - ↑x x:ℕx✝:253 < xhx_nonneg:0 ≤ ↑xhlhs_nonneg:0 ≤ √↑x * ↑(harmonic x) ^ 2hsq:(√↑x * ↑(harmonic x) ^ 2) ^ 2 = ↑x * ↑(harmonic x) ^ 4⊢ ↑x < ↑(harmonic (lcmUpTo x)) ∧ ↑x * ↑(harmonic x) ^ 4 < (↑(harmonic (lcmUpTo x)) - ↑x) ^ 2 → √↑x * ↑(harmonic x) ^ 2 < ↑(harmonic (lcmUpTo x)) - ↑xx:ℕx✝:253 < xhx_nonneg:0 ≤ ↑xhlhs_nonneg:0 ≤ √↑x * ↑(harmonic x) ^ 2hsq:(√↑x * ↑(harmonic x) ^ 2) ^ 2 = ↑x * ↑(harmonic x) ^ 4⊢ √↑x * ↑(harmonic x) ^ 2 < ↑(harmonic (lcmUpTo x)) - ↑x → ↑x < ↑(harmonic (lcmUpTo x)) ∧ ↑x * ↑(harmonic x) ^ 4 < (↑(harmonic (lcmUpTo x)) - ↑x) ^ 2 x:ℕx✝:253 < xhx_nonneg:0 ≤ ↑xhlhs_nonneg:0 ≤ √↑x * ↑(harmonic x) ^ 2hsq:(√↑x * ↑(harmonic x) ^ 2) ^ 2 = ↑x * ↑(harmonic x) ^ 4⊢ ↑x < ↑(harmonic (lcmUpTo x)) ∧ ↑x * ↑(harmonic x) ^ 4 < (↑(harmonic (lcmUpTo x)) - ↑x) ^ 2 → √↑x * ↑(harmonic x) ^ 2 < ↑(harmonic (lcmUpTo x)) - ↑x x:ℕx✝:253 < xhx_nonneg:0 ≤ ↑xhlhs_nonneg:0 ≤ √↑x * ↑(harmonic x) ^ 2hsq:(√↑x * ↑(harmonic x) ^ 2) ^ 2 = ↑x * ↑(harmonic x) ^ 4hxlcm:↑x < ↑(harmonic (lcmUpTo x))hineq:↑x * ↑(harmonic x) ^ 4 < (↑(harmonic (lcmUpTo x)) - ↑x) ^ 2⊢ √↑x * ↑(harmonic x) ^ 2 < ↑(harmonic (lcmUpTo x)) - ↑x x:ℕx✝:253 < xhx_nonneg:0 ≤ ↑xhlhs_nonneg:0 ≤ √↑x * ↑(harmonic x) ^ 2hsq:(√↑x * ↑(harmonic x) ^ 2) ^ 2 = ↑x * ↑(harmonic x) ^ 4hxlcm:↑x < ↑(harmonic (lcmUpTo x))hineq:↑x * ↑(harmonic x) ^ 4 < (↑(harmonic (lcmUpTo x)) - ↑x) ^ 2hrhs_pos:0 < ↑(harmonic (lcmUpTo x)) - ↑x⊢ √↑x * ↑(harmonic x) ^ 2 < ↑(harmonic (lcmUpTo x)) - ↑x x:ℕx✝:253 < xhx_nonneg:0 ≤ ↑xhlhs_nonneg:0 ≤ √↑x * ↑(harmonic x) ^ 2hsq:(√↑x * ↑(harmonic x) ^ 2) ^ 2 = ↑x * ↑(harmonic x) ^ 4hxlcm:↑x < ↑(harmonic (lcmUpTo x))hineq:(√↑x * ↑(harmonic x) ^ 2) ^ 2 < (↑(harmonic (lcmUpTo x)) - ↑x) ^ 2hrhs_pos:0 < ↑(harmonic (lcmUpTo x)) - ↑x⊢ √↑x * ↑(harmonic x) ^ 2 < ↑(harmonic (lcmUpTo x)) - ↑x All goals completed! 🐙 x:ℕx✝:253 < xhx_nonneg:0 ≤ ↑xhlhs_nonneg:0 ≤ √↑x * ↑(harmonic x) ^ 2hsq:(√↑x * ↑(harmonic x) ^ 2) ^ 2 = ↑x * ↑(harmonic x) ^ 4⊢ √↑x * ↑(harmonic x) ^ 2 < ↑(harmonic (lcmUpTo x)) - ↑x → ↑x < ↑(harmonic (lcmUpTo x)) ∧ ↑x * ↑(harmonic x) ^ 4 < (↑(harmonic (lcmUpTo x)) - ↑x) ^ 2 x:ℕx✝:253 < xhx_nonneg:0 ≤ ↑xhlhs_nonneg:0 ≤ √↑x * ↑(harmonic x) ^ 2hsq:(√↑x * ↑(harmonic x) ^ 2) ^ 2 = ↑x * ↑(harmonic x) ^ 4hlt:√↑x * ↑(harmonic x) ^ 2 < ↑(harmonic (lcmUpTo x)) - ↑x⊢ ↑x < ↑(harmonic (lcmUpTo x)) ∧ ↑x * ↑(harmonic x) ^ 4 < (↑(harmonic (lcmUpTo x)) - ↑x) ^ 2 x:ℕx✝:253 < xhx_nonneg:0 ≤ ↑xhlhs_nonneg:0 ≤ √↑x * ↑(harmonic x) ^ 2hsq:(√↑x * ↑(harmonic x) ^ 2) ^ 2 = ↑x * ↑(harmonic x) ^ 4hlt:√↑x * ↑(harmonic x) ^ 2 < ↑(harmonic (lcmUpTo x)) - ↑xhrhs_pos:0 < ↑(harmonic (lcmUpTo x)) - ↑x⊢ ↑x < ↑(harmonic (lcmUpTo x)) ∧ ↑x * ↑(harmonic x) ^ 4 < (↑(harmonic (lcmUpTo x)) - ↑x) ^ 2 x:ℕx✝:253 < xhx_nonneg:0 ≤ ↑xhlhs_nonneg:0 ≤ √↑x * ↑(harmonic x) ^ 2hsq:(√↑x * ↑(harmonic x) ^ 2) ^ 2 = ↑x * ↑(harmonic x) ^ 4hlt:√↑x * ↑(harmonic x) ^ 2 < ↑(harmonic (lcmUpTo x)) - ↑xhrhs_pos:0 < ↑(harmonic (lcmUpTo x)) - ↑x⊢ ↑x * ↑(harmonic x) ^ 4 < (↑(harmonic (lcmUpTo x)) - ↑x) ^ 2 x:ℕx✝:253 < xhx_nonneg:0 ≤ ↑xhlhs_nonneg:0 ≤ √↑x * ↑(harmonic x) ^ 2hsq:(√↑x * ↑(harmonic x) ^ 2) ^ 2 = ↑x * ↑(harmonic x) ^ 4hlt:√↑x * ↑(harmonic x) ^ 2 < ↑(harmonic (lcmUpTo x)) - ↑xhrhs_pos:0 < ↑(harmonic (lcmUpTo x)) - ↑x⊢ (√↑x * ↑(harmonic x) ^ 2) ^ 2 < (↑(harmonic (lcmUpTo x)) - ↑x) ^ 2 exact pow_lt_pow_left₀ hlt hlhs_nonneg (x:ℕx✝:253 < xhx_nonneg:0 ≤ ↑xhlhs_nonneg:0 ≤ √↑x * ↑(harmonic x) ^ 2hsq:(√↑x * ↑(harmonic x) ^ 2) ^ 2 = ↑x * ↑(harmonic x) ^ 4hlt:√↑x * ↑(harmonic x) ^ 2 < ↑(harmonic (lcmUpTo x)) - ↑xhrhs_pos:0 < ↑(harmonic (lcmUpTo x)) - ↑x⊢ 2 ≠ 0 All goals completed! 🐙)

Formulation of MatiyasevichRiemannCounterexample x making explicit that $H_{\operatorname{lcm}(1,\dots,x)} - x$ is positive and exceeds $\sqrt{x} H_x^2$.

theorem matiyasevichRiemannCounterexample_iff_abs_and_sqrt_lt (x : ℕ) : MatiyasevichRiemannCounterexample x ↔ 253 < x ∧ |(harmonic (lcmUpTo x) : ℝ) - x| = (harmonic (lcmUpTo x) : ℝ) - x ∧ Real.sqrt x * (harmonic x : ℝ) ^ 2 < (harmonic (lcmUpTo x) : ℝ) - x := x:ℕ⊢ MatiyasevichRiemannCounterexample x ↔ 253 < x ∧ |↑(harmonic (lcmUpTo x)) - ↑x| = ↑(harmonic (lcmUpTo x)) - ↑x ∧ √↑x * ↑(harmonic x) ^ 2 < ↑(harmonic (lcmUpTo x)) - ↑x x:ℕ⊢ 253 < x ∧ √↑x * ↑(harmonic x) ^ 2 < ↑(harmonic (lcmUpTo x)) - ↑x ↔ 253 < x ∧ |↑(harmonic (lcmUpTo x)) - ↑x| = ↑(harmonic (lcmUpTo x)) - ↑x ∧ √↑x * ↑(harmonic x) ^ 2 < ↑(harmonic (lcmUpTo x)) - ↑x x:ℕx✝:253 < xh:√↑x * ↑(harmonic x) ^ 2 < ↑(harmonic (lcmUpTo x)) - ↑x⊢ 0 < ↑(harmonic (lcmUpTo x)) - ↑x exact lt_of_le_of_lt (x:ℕx✝:253 < xh:√↑x * ↑(harmonic x) ^ 2 < ↑(harmonic (lcmUpTo x)) - ↑x⊢ 0 ≤ √↑x * ↑(harmonic x) ^ 2 All goals completed! 🐙) h

4. Euler–Mascheroni and Harmonic-to-Logarithm Bounds

For every $n \ge 1$, $\log n + \gamma < H_n$.

theorem log_add_eulerMascheroniConstant_lt_harmonic {n : ℕ} (hn : n ≠ 0) : Real.log n + Real.eulerMascheroniConstant < (harmonic n : ℝ) := n:ℕhn:n ≠ 0⊢ Real.log ↑n + Real.eulerMascheroniConstant < ↑(harmonic n) n:ℕhn:n ≠ 0h:Real.eulerMascheroniConstant < Real.eulerMascheroniSeq' n⊢ Real.log ↑n + Real.eulerMascheroniConstant < ↑(harmonic n) n:ℕhn:n ≠ 0h:Real.eulerMascheroniConstant < ↑(harmonic n) - Real.log ↑n⊢ Real.log ↑n + Real.eulerMascheroniConstant < ↑(harmonic n) All goals completed! 🐙

For every $n \in \mathbb{N}$, $H_n < \log(n + 1) + \gamma$.

theorem harmonic_lt_log_add_one_add_eulerMascheroniConstant (n : ℕ) : (harmonic n : ℝ) < Real.log (n + 1) + Real.eulerMascheroniConstant := n:ℕ⊢ ↑(harmonic n) < Real.log (↑n + 1) + Real.eulerMascheroniConstant n:ℕh:Real.eulerMascheroniSeq n < Real.eulerMascheroniConstant⊢ ↑(harmonic n) < Real.log (↑n + 1) + Real.eulerMascheroniConstant n:ℕh:↑(harmonic n) - Real.log (↑n + 1) < Real.eulerMascheroniConstant⊢ ↑(harmonic n) < Real.log (↑n + 1) + Real.eulerMascheroniConstant All goals completed! 🐙

For every $n \ge 6$, $H_n < \log n + 2 / 3$.

theorem harmonic_lt_log_add_two_thirds {n : ℕ} (hn : 6 ≤ n) : (harmonic n : ℝ) < Real.log n + 2 / 3 := n:ℕhn:6 ≤ n⊢ ↑(harmonic n) < Real.log ↑n + 2 / 3 n:ℕhn:6 ≤ nhn0:n ≠ 0⊢ ↑(harmonic n) < Real.log ↑n + 2 / 3 n:ℕhn:6 ≤ nhn0:n ≠ 0h1:Real.eulerMascheroniSeq' n < 2 / 3⊢ ↑(harmonic n) < Real.log ↑n + 2 / 3 n:ℕhn:6 ≤ nhn0:n ≠ 0h1:↑(harmonic n) - Real.log ↑n < 2 / 3⊢ ↑(harmonic n) < Real.log ↑n + 2 / 3 All goals completed! 🐙

Lower bound connecting $H_{\operatorname{lcm}(1,\dots,x)}$ to Chebyshev's $\psi(x)$: $$\psi(x) + \gamma < H_{\operatorname{lcm}(1,\dots,x)}.$$

theorem psi_add_eulerMascheroniConstant_lt_harmonic_lcmUpTo (x : ℕ) : Chebyshev.psi x + Real.eulerMascheroniConstant < (harmonic (lcmUpTo x) : ℝ) := x:ℕ⊢ Chebyshev.psi ↑x + Real.eulerMascheroniConstant < ↑(harmonic (lcmUpTo x)) x:ℕ⊢ Real.log ↑(lcmUpTo x) + Real.eulerMascheroniConstant < ↑(harmonic (lcmUpTo x)) All goals completed! 🐙

Since $\gamma > 1/2 > 0$, Chebyshev's $\psi(x)$ is strictly bounded above by $H_{\operatorname{lcm}(1,\dots,x)} - 1/2$, so $\psi(x) < H_{\operatorname{lcm}(1,\dots,x)}$.

theorem psi_add_one_half_lt_harmonic_lcmUpTo (x : ℕ) : Chebyshev.psi x + 1 / 2 < (harmonic (lcmUpTo x) : ℝ) := x:ℕ⊢ Chebyshev.psi ↑x + 1 / 2 < ↑(harmonic (lcmUpTo x)) All goals completed! 🐙theorem psi_lt_harmonic_lcmUpTo (x : ℕ) : Chebyshev.psi x < (harmonic (lcmUpTo x) : ℝ) := x:ℕ⊢ Chebyshev.psi ↑x < ↑(harmonic (lcmUpTo x)) All goals completed! 🐙

Upper bound connecting $H_{\operatorname{lcm}(1,\dots,x)}$ to Chebyshev's $\psi(x)$: $$H_{\operatorname{lcm}(1,\dots,x)} \le \psi(x) + 1.$$

theorem harmonic_lcmUpTo_le_psi_add_one (x : ℕ) : (harmonic (lcmUpTo x) : ℝ) ≤ Chebyshev.psi x + 1 := x:ℕ⊢ ↑(harmonic (lcmUpTo x)) ≤ Chebyshev.psi ↑x + 1 x:ℕ⊢ ↑(harmonic (lcmUpTo x)) ≤ 1 + Real.log ↑(lcmUpTo x) All goals completed! 🐙

Sharper upper bound for $x \ge 6$: $$H_{\operatorname{lcm}(1,\dots,x)} < \psi(x) + \frac{2}{3}.$$

theorem harmonic_lcmUpTo_lt_psi_add_two_thirds {x : ℕ} (hx : 6 ≤ x) : (harmonic (lcmUpTo x) : ℝ) < Chebyshev.psi x + 2 / 3 := x:ℕhx:6 ≤ x⊢ ↑(harmonic (lcmUpTo x)) < Chebyshev.psi ↑x + 2 / 3 x:ℕhx:6 ≤ x⊢ ↑(harmonic (lcmUpTo x)) < Real.log ↑(lcmUpTo x) + 2 / 3 x:ℕhx:6 ≤ xh6:6 ≤ lcmUpTo x⊢ ↑(harmonic (lcmUpTo x)) < Real.log ↑(lcmUpTo x) + 2 / 3 All goals completed! 🐙

For every natural number $x$, $\log x \le H_x$.

theorem log_le_harmonic (x : ℕ) : Real.log x ≤ (harmonic x : ℝ) := x:ℕ⊢ Real.log ↑x ≤ ↑(harmonic x) ⊢ Real.log ↑0 ≤ ↑(harmonic 0)x:ℕhx:x ≠ 0⊢ Real.log ↑x ≤ ↑(harmonic x) ⊢ Real.log ↑0 ≤ ↑(harmonic 0) All goals completed! 🐙 x:ℕhx:x ≠ 0⊢ Real.log ↑x ≤ ↑(harmonic x) x:ℕhx:x ≠ 0hx_pos:0 < ↑x⊢ Real.log ↑x ≤ ↑(harmonic x) x:ℕhx:x ≠ 0hx_pos:0 < ↑xh1:Real.log ↑x ≤ Real.log ↑(x + 1)⊢ Real.log ↑x ≤ ↑(harmonic x) All goals completed! 🐙theorem log_sq_le_harmonic_sq (x : ℕ) : (Real.log x) ^ 2 ≤ (harmonic x : ℝ) ^ 2 := x:ℕ⊢ Real.log ↑x ^ 2 ≤ ↑(harmonic x) ^ 2 x:ℕhlog:0 ≤ Real.log ↑x⊢ Real.log ↑x ^ 2 ≤ ↑(harmonic x) ^ 2 All goals completed! 🐙theorem harmonic_sq_le_one_add_log_sq (x : ℕ) : (harmonic x : ℝ) ^ 2 ≤ (1 + Real.log x) ^ 2 := x:ℕ⊢ ↑(harmonic x) ^ 2 ≤ (1 + Real.log ↑x) ^ 2 All goals completed! 🐙

5. Elementary Reductions Between $\psi(x)$ Inequalities and MatiyasevichRiemannCounterexample

Upper bound Real.log 4 - 1 ≤ 3863 / 10000 from Real.log_two_lt_d9.

theorem log_four_sub_one_le : Real.log 4 - 1 ≤ 3863 / 10000 := ⊢ Real.log 4 - 1 ≤ 3863 / 10000 h4:4 = 2 ^ 2⊢ Real.log 4 - 1 ≤ 3863 / 10000 h4:4 = 2 ^ 2⊢ 2 * Real.log 2 - 1 ≤ 3863 / 10000 All goals completed! 🐙

Upper bound 1 - Real.log 2 ≤ 3863 / 10000 from Real.log_two_gt_d9.

theorem one_sub_log_two_le : 1 - Real.log 2 ≤ 3863 / 10000 := ⊢ 1 - Real.log 2 ≤ 3863 / 10000 All goals completed! 🐙

For all y ≥ 254, 519 / 100 ≤ Real.log y (since 254 ^ 2 = 64516 ≥ 32768 = 2 ^ 15).

theorem log_ge_of_ge_254 {y : ℝ} (hy : 254 ≤ y) : 519 / 100 ≤ Real.log y := y:ℝhy:254 ≤ y⊢ 519 / 100 ≤ Real.log y y:ℝhy:254 ≤ yhy_pos:0 < y⊢ 519 / 100 ≤ Real.log y y:ℝhy:254 ≤ yhy_pos:0 < yh_pow:2 ^ 15 ≤ y ^ 2⊢ 519 / 100 ≤ Real.log y y:ℝhy:254 ≤ yhy_pos:0 < yh_pow:2 ^ 15 ≤ y ^ 2h_log:Real.log (2 ^ 15) ≤ Real.log (y ^ 2)⊢ 519 / 100 ≤ Real.log y y:ℝhy:254 ≤ yhy_pos:0 < yh_pow:2 ^ 15 ≤ y ^ 2h_log:15 * Real.log 2 ≤ 2 * Real.log y⊢ 519 / 100 ≤ Real.log y All goals completed! 🐙

For all y ≥ 900, 623 / 100 ≤ Real.log y (since 900 ≥ 512 = 2 ^ 9).

theorem log_ge_of_ge_900 {y : ℝ} (hy : 900 ≤ y) : 623 / 100 ≤ Real.log y := y:ℝhy:900 ≤ y⊢ 623 / 100 ≤ Real.log y y:ℝhy:900 ≤ yh_pow:2 ^ 9 ≤ y⊢ 623 / 100 ≤ Real.log y y:ℝhy:900 ≤ yh_pow:2 ^ 9 ≤ yh_log:Real.log (2 ^ 9) ≤ Real.log y⊢ 623 / 100 ≤ Real.log y y:ℝhy:900 ≤ yh_pow:2 ^ 9 ≤ yh_log:9 * Real.log 2 ≤ Real.log y⊢ 623 / 100 ≤ Real.log y All goals completed! 🐙

For all y ≥ 2500, 762 / 100 ≤ Real.log y (since 2500 ≥ 2048 = 2 ^ 11).

theorem log_ge_of_ge_2500 {y : ℝ} (hy : 2500 ≤ y) : 762 / 100 ≤ Real.log y := y:ℝhy:2500 ≤ y⊢ 762 / 100 ≤ Real.log y y:ℝhy:2500 ≤ yh_pow:2 ^ 11 ≤ y⊢ 762 / 100 ≤ Real.log y y:ℝhy:2500 ≤ yh_pow:2 ^ 11 ≤ yh_log:Real.log (2 ^ 11) ≤ Real.log y⊢ 762 / 100 ≤ Real.log y y:ℝhy:2500 ≤ yh_pow:2 ^ 11 ≤ yh_log:11 * Real.log 2 ≤ Real.log y⊢ 762 / 100 ≤ Real.log y All goals completed! 🐙

Monotonicity of t ↦ (7 / 8) * t ^ 2 - 2 * t = t * ((7 / 8) * t - 2) for t ≥ c ≥ 16 / 7.

theorem seven_eighths_sq_sub_two_mul_ge {c t : ℝ} (hc : 16 / 7 ≤ c) (hct : c ≤ t) : c * ((7 / 8 : ℝ) * c - 2) ≤ (7 / 8 : ℝ) * t ^ 2 - 2 * t := c:ℝt:ℝhc:16 / 7 ≤ chct:c ≤ t⊢ c * (7 / 8 * c - 2) ≤ 7 / 8 * t ^ 2 - 2 * t c:ℝt:ℝhc:16 / 7 ≤ chct:c ≤ th_eq:7 / 8 * t ^ 2 - 2 * t = t * (7 / 8 * t - 2)⊢ c * (7 / 8 * c - 2) ≤ 7 / 8 * t ^ 2 - 2 * t c:ℝt:ℝhc:16 / 7 ≤ chct:c ≤ th_eq:7 / 8 * t ^ 2 - 2 * t = t * (7 / 8 * t - 2)⊢ c * (7 / 8 * c - 2) ≤ t * (7 / 8 * t - 2) exact mul_le_mul hct (c:ℝt:ℝhc:16 / 7 ≤ chct:c ≤ th_eq:7 / 8 * t ^ 2 - 2 * t = t * (7 / 8 * t - 2)⊢ 7 / 8 * c - 2 ≤ 7 / 8 * t - 2 All goals completed! 🐙) (c:ℝt:ℝhc:16 / 7 ≤ chct:c ≤ th_eq:7 / 8 * t ^ 2 - 2 * t = t * (7 / 8 * t - 2)⊢ 0 ≤ 7 / 8 * c - 2 All goals completed! 🐙) (c:ℝt:ℝhc:16 / 7 ≤ chct:c ≤ th_eq:7 / 8 * t ^ 2 - 2 * t = t * (7 / 8 * t - 2)⊢ 0 ≤ t All goals completed! 🐙)

For all y ∈ [254, 6000], (3863 / 10000) * Real.sqrt y + 2 * Real.log y ≤ (7 / 8) * (Real.log y) ^ 2.

theorem chebyshev_factor_le_seven_eighths_log_sq {y : ℝ} (hy_low : 254 ≤ y) (hy_high : y ≤ 6000) : (3863 / 10000 : ℝ) * Real.sqrt y + 2 * Real.log y ≤ (7 / 8 : ℝ) * (Real.log y) ^ 2 := y:ℝhy_low:254 ≤ yhy_high:y ≤ 6000⊢ 3863 / 10000 * √y + 2 * Real.log y ≤ 7 / 8 * Real.log y ^ 2 y:ℝhy_low:254 ≤ yhy_high:y ≤ 6000hy900:y ≤ 900⊢ 3863 / 10000 * √y + 2 * Real.log y ≤ 7 / 8 * Real.log y ^ 2y:ℝhy_low:254 ≤ yhy_high:y ≤ 6000hy900:900 ≤ y⊢ 3863 / 10000 * √y + 2 * Real.log y ≤ 7 / 8 * Real.log y ^ 2 y:ℝhy_low:254 ≤ yhy_high:y ≤ 6000hy900:y ≤ 900⊢ 3863 / 10000 * √y + 2 * Real.log y ≤ 7 / 8 * Real.log y ^ 2 y:ℝhy_low:254 ≤ yhy_high:y ≤ 6000hy900:y ≤ 900h_sqrt:√y ≤ 30⊢ 3863 / 10000 * √y + 2 * Real.log y ≤ 7 / 8 * Real.log y ^ 2 y:ℝhy_low:254 ≤ yhy_high:y ≤ 6000hy900:y ≤ 900h_sqrt:√y ≤ 30h_log:519 / 100 ≤ Real.log y⊢ 3863 / 10000 * √y + 2 * Real.log y ≤ 7 / 8 * Real.log y ^ 2 y:ℝhy_low:254 ≤ yhy_high:y ≤ 6000hy900:y ≤ 900h_sqrt:√y ≤ 30h_log:519 / 100 ≤ Real.log yh_quad:519 / 100 * (7 / 8 * (519 / 100) - 2) ≤ 7 / 8 * Real.log y ^ 2 - 2 * Real.log y⊢ 3863 / 10000 * √y + 2 * Real.log y ≤ 7 / 8 * Real.log y ^ 2 All goals completed! 🐙 y:ℝhy_low:254 ≤ yhy_high:y ≤ 6000hy900:900 ≤ y⊢ 3863 / 10000 * √y + 2 * Real.log y ≤ 7 / 8 * Real.log y ^ 2 y:ℝhy_low:254 ≤ yhy_high:y ≤ 6000hy900:900 ≤ yhy2500:y ≤ 2500⊢ 3863 / 10000 * √y + 2 * Real.log y ≤ 7 / 8 * Real.log y ^ 2y:ℝhy_low:254 ≤ yhy_high:y ≤ 6000hy900:900 ≤ yhy2500:2500 ≤ y⊢ 3863 / 10000 * √y + 2 * Real.log y ≤ 7 / 8 * Real.log y ^ 2 y:ℝhy_low:254 ≤ yhy_high:y ≤ 6000hy900:900 ≤ yhy2500:y ≤ 2500⊢ 3863 / 10000 * √y + 2 * Real.log y ≤ 7 / 8 * Real.log y ^ 2 y:ℝhy_low:254 ≤ yhy_high:y ≤ 6000hy900:900 ≤ yhy2500:y ≤ 2500h_sqrt:√y ≤ 50⊢ 3863 / 10000 * √y + 2 * Real.log y ≤ 7 / 8 * Real.log y ^ 2 y:ℝhy_low:254 ≤ yhy_high:y ≤ 6000hy900:900 ≤ yhy2500:y ≤ 2500h_sqrt:√y ≤ 50h_log:623 / 100 ≤ Real.log y⊢ 3863 / 10000 * √y + 2 * Real.log y ≤ 7 / 8 * Real.log y ^ 2 y:ℝhy_low:254 ≤ yhy_high:y ≤ 6000hy900:900 ≤ yhy2500:y ≤ 2500h_sqrt:√y ≤ 50h_log:623 / 100 ≤ Real.log yh_quad:623 / 100 * (7 / 8 * (623 / 100) - 2) ≤ 7 / 8 * Real.log y ^ 2 - 2 * Real.log y⊢ 3863 / 10000 * √y + 2 * Real.log y ≤ 7 / 8 * Real.log y ^ 2 All goals completed! 🐙 y:ℝhy_low:254 ≤ yhy_high:y ≤ 6000hy900:900 ≤ yhy2500:2500 ≤ y⊢ 3863 / 10000 * √y + 2 * Real.log y ≤ 7 / 8 * Real.log y ^ 2 y:ℝhy_low:254 ≤ yhy_high:y ≤ 6000hy900:900 ≤ yhy2500:2500 ≤ yh_sqrt:√y ≤ 78⊢ 3863 / 10000 * √y + 2 * Real.log y ≤ 7 / 8 * Real.log y ^ 2 y:ℝhy_low:254 ≤ yhy_high:y ≤ 6000hy900:900 ≤ yhy2500:2500 ≤ yh_sqrt:√y ≤ 78h_log:762 / 100 ≤ Real.log y⊢ 3863 / 10000 * √y + 2 * Real.log y ≤ 7 / 8 * Real.log y ^ 2 y:ℝhy_low:254 ≤ yhy_high:y ≤ 6000hy900:900 ≤ yhy2500:2500 ≤ yh_sqrt:√y ≤ 78h_log:762 / 100 ≤ Real.log yh_quad:762 / 100 * (7 / 8 * (762 / 100) - 2) ≤ 7 / 8 * Real.log y ^ 2 - 2 * Real.log y⊢ 3863 / 10000 * √y + 2 * Real.log y ≤ 7 / 8 * Real.log y ^ 2 All goals completed! 🐙

From Chebyshev.psi_le and Chebyshev.psi_ge, for all x ≥ 254, |Chebyshev.psi x - x| ≤ Real.sqrt x * ((3863 / 10000) * Real.sqrt x + 2 * Real.log x).

theorem abs_psi_sub_self_le_linear_add_sqrt_log {x : ℕ} (hx : 254 ≤ x) : |Chebyshev.psi x - x| ≤ Real.sqrt x * ((3863 / 10000 : ℝ) * Real.sqrt x + 2 * Real.log x) := x:ℕhx:254 ≤ x⊢ |Chebyshev.psi ↑x - ↑x| ≤ √↑x * (3863 / 10000 * √↑x + 2 * Real.log ↑x) x:ℕhx:254 ≤ xhy_cast:254 ≤ ↑x⊢ |Chebyshev.psi ↑x - ↑x| ≤ √↑x * (3863 / 10000 * √↑x + 2 * Real.log ↑x) x:ℕhx:254 ≤ xy:ℝ := ↑xhy_cast:254 ≤ y⊢ |Chebyshev.psi y - y| ≤ √y * (3863 / 10000 * √y + 2 * Real.log y) x:ℕhx:254 ≤ xy:ℝ := ↑xhy_cast:254 ≤ yhy:254 ≤ y⊢ |Chebyshev.psi y - y| ≤ √y * (3863 / 10000 * √y + 2 * Real.log y) x:ℕhx:254 ≤ xy:ℝ := ↑xhy_cast:254 ≤ yhy:254 ≤ yhy_pos:0 < y⊢ |Chebyshev.psi y - y| ≤ √y * (3863 / 10000 * √y + 2 * Real.log y) x:ℕhx:254 ≤ xy:ℝ := ↑xhy_cast:254 ≤ yhy:254 ≤ yhy_pos:0 < yh_sqrt_sq:√y * √y = y⊢ |Chebyshev.psi y - y| ≤ √y * (3863 / 10000 * √y + 2 * Real.log y) x:ℕhx:254 ≤ xy:ℝ := ↑xhy_cast:254 ≤ yhy:254 ≤ yhy_pos:0 < yh_sqrt_sq:√y * √y = yh_rhs_eq:√y * (3863 / 10000 * √y + 2 * Real.log y) = 3863 / 10000 * y + 2 * √y * Real.log y⊢ |Chebyshev.psi y - y| ≤ √y * (3863 / 10000 * √y + 2 * Real.log y) x:ℕhx:254 ≤ xy:ℝ := ↑xhy_cast:254 ≤ yhy:254 ≤ yhy_pos:0 < yh_sqrt_sq:√y * √y = yh_rhs_eq:√y * (3863 / 10000 * √y + 2 * Real.log y) = 3863 / 10000 * y + 2 * √y * Real.log y⊢ -(3863 / 10000 * y + 2 * √y * Real.log y) ≤ Chebyshev.psi y - y ∧ Chebyshev.psi y - y ≤ 3863 / 10000 * y + 2 * √y * Real.log y x:ℕhx:254 ≤ xy:ℝ := ↑xhy_cast:254 ≤ yhy:254 ≤ yhy_pos:0 < yh_sqrt_sq:√y * √y = yh_rhs_eq:√y * (3863 / 10000 * √y + 2 * Real.log y) = 3863 / 10000 * y + 2 * √y * Real.log y⊢ -(3863 / 10000 * y + 2 * √y * Real.log y) ≤ Chebyshev.psi y - yx:ℕhx:254 ≤ xy:ℝ := ↑xhy_cast:254 ≤ yhy:254 ≤ yhy_pos:0 < yh_sqrt_sq:√y * √y = yh_rhs_eq:√y * (3863 / 10000 * √y + 2 * Real.log y) = 3863 / 10000 * y + 2 * √y * Real.log y⊢ Chebyshev.psi y - y ≤ 3863 / 10000 * y + 2 * √y * Real.log y x:ℕhx:254 ≤ xy:ℝ := ↑xhy_cast:254 ≤ yhy:254 ≤ yhy_pos:0 < yh_sqrt_sq:√y * √y = yh_rhs_eq:√y * (3863 / 10000 * √y + 2 * Real.log y) = 3863 / 10000 * y + 2 * √y * Real.log y⊢ -(3863 / 10000 * y + 2 * √y * Real.log y) ≤ Chebyshev.psi y - y x:ℕhx:254 ≤ xy:ℝ := ↑xhy_cast:254 ≤ yhy:254 ≤ yhy_pos:0 < yh_sqrt_sq:√y * √y = yh_rhs_eq:√y * (3863 / 10000 * √y + 2 * Real.log y) = 3863 / 10000 * y + 2 * √y * Real.log yh_ge:y * Real.log 2 - Real.log (y + 1) ≤ Chebyshev.psi y⊢ -(3863 / 10000 * y + 2 * √y * Real.log y) ≤ Chebyshev.psi y - y x:ℕhx:254 ≤ xy:ℝ := ↑xhy_cast:254 ≤ yhy:254 ≤ yhy_pos:0 < yh_sqrt_sq:√y * √y = yh_rhs_eq:√y * (3863 / 10000 * √y + 2 * Real.log y) = 3863 / 10000 * y + 2 * √y * Real.log yh_ge:y * Real.log 2 - Real.log (y + 1) ≤ Chebyshev.psi yh_coeff:1 - Real.log 2 ≤ 3863 / 10000⊢ -(3863 / 10000 * y + 2 * √y * Real.log y) ≤ Chebyshev.psi y - y x:ℕhx:254 ≤ xy:ℝ := ↑xhy_cast:254 ≤ yhy:254 ≤ yhy_pos:0 < yh_sqrt_sq:√y * √y = yh_rhs_eq:√y * (3863 / 10000 * √y + 2 * Real.log y) = 3863 / 10000 * y + 2 * √y * Real.log yh_ge:y * Real.log 2 - Real.log (y + 1) ≤ Chebyshev.psi yh_coeff:1 - Real.log 2 ≤ 3863 / 10000h_log_add_one:Real.log (y + 1) ≤ 2 * Real.log y⊢ -(3863 / 10000 * y + 2 * √y * Real.log y) ≤ Chebyshev.psi y - y x:ℕhx:254 ≤ xy:ℝ := ↑xhy_cast:254 ≤ yhy:254 ≤ yhy_pos:0 < yh_sqrt_sq:√y * √y = yh_rhs_eq:√y * (3863 / 10000 * √y + 2 * Real.log y) = 3863 / 10000 * y + 2 * √y * Real.log yh_ge:y * Real.log 2 - Real.log (y + 1) ≤ Chebyshev.psi yh_coeff:1 - Real.log 2 ≤ 3863 / 10000h_log_add_one:Real.log (y + 1) ≤ 2 * Real.log yh_sqrt_ge_one:1 ≤ √y⊢ -(3863 / 10000 * y + 2 * √y * Real.log y) ≤ Chebyshev.psi y - y x:ℕhx:254 ≤ xy:ℝ := ↑xhy_cast:254 ≤ yhy:254 ≤ yhy_pos:0 < yh_sqrt_sq:√y * √y = yh_rhs_eq:√y * (3863 / 10000 * √y + 2 * Real.log y) = 3863 / 10000 * y + 2 * √y * Real.log yh_ge:y * Real.log 2 - Real.log (y + 1) ≤ Chebyshev.psi yh_coeff:1 - Real.log 2 ≤ 3863 / 10000h_log_add_one:Real.log (y + 1) ≤ 2 * Real.log yh_sqrt_ge_one:1 ≤ √yh_log_nonneg:0 ≤ Real.log y⊢ -(3863 / 10000 * y + 2 * √y * Real.log y) ≤ Chebyshev.psi y - y x:ℕhx:254 ≤ xy:ℝ := ↑xhy_cast:254 ≤ yhy:254 ≤ yhy_pos:0 < yh_sqrt_sq:√y * √y = yh_rhs_eq:√y * (3863 / 10000 * √y + 2 * Real.log y) = 3863 / 10000 * y + 2 * √y * Real.log yh_ge:y * Real.log 2 - Real.log (y + 1) ≤ Chebyshev.psi yh_coeff:1 - Real.log 2 ≤ 3863 / 10000h_log_add_one:Real.log (y + 1) ≤ 2 * Real.log yh_sqrt_ge_one:1 ≤ √yh_log_nonneg:0 ≤ Real.log yh_log_le_sqrt_log:2 * Real.log y ≤ 2 * √y * Real.log y⊢ -(3863 / 10000 * y + 2 * √y * Real.log y) ≤ Chebyshev.psi y - y All goals completed! 🐙 x:ℕhx:254 ≤ xy:ℝ := ↑xhy_cast:254 ≤ yhy:254 ≤ yhy_pos:0 < yh_sqrt_sq:√y * √y = yh_rhs_eq:√y * (3863 / 10000 * √y + 2 * Real.log y) = 3863 / 10000 * y + 2 * √y * Real.log y⊢ Chebyshev.psi y - y ≤ 3863 / 10000 * y + 2 * √y * Real.log y x:ℕhx:254 ≤ xy:ℝ := ↑xhy_cast:254 ≤ yhy:254 ≤ yhy_pos:0 < yh_sqrt_sq:√y * √y = yh_rhs_eq:√y * (3863 / 10000 * √y + 2 * Real.log y) = 3863 / 10000 * y + 2 * √y * Real.log yh_le:Chebyshev.psi y ≤ Real.log 4 * y + 2 * √y * Real.log y⊢ Chebyshev.psi y - y ≤ 3863 / 10000 * y + 2 * √y * Real.log y x:ℕhx:254 ≤ xy:ℝ := ↑xhy_cast:254 ≤ yhy:254 ≤ yhy_pos:0 < yh_sqrt_sq:√y * √y = yh_rhs_eq:√y * (3863 / 10000 * √y + 2 * Real.log y) = 3863 / 10000 * y + 2 * √y * Real.log yh_le:Chebyshev.psi y ≤ Real.log 4 * y + 2 * √y * Real.log yh_coeff:Real.log 4 - 1 ≤ 3863 / 10000⊢ Chebyshev.psi y - y ≤ 3863 / 10000 * y + 2 * √y * Real.log y All goals completed! 🐙

Unconditional Chebyshev Bound for $253 < x \le 6000$: For every natural number $x$ with $253 < x \le 6000$, $$|\psi(x) - x| \le \frac{7}{8} \sqrt{x} (\log x)^2.$$

theorem abs_psi_sub_self_le_seven_eighths_of_le_six_thousand {x : ℕ} (hx_low : 253 < x) (hx_high : x ≤ 6000) : |Chebyshev.psi x - x| ≤ (7 / 8 : ℝ) * Real.sqrt x * (Real.log x) ^ 2 := x:ℕhx_low:253 < xhx_high:x ≤ 6000⊢ |Chebyshev.psi ↑x - ↑x| ≤ 7 / 8 * √↑x * Real.log ↑x ^ 2 x:ℕhx_low:253 < xhx_high:x ≤ 6000hx254_nat:254 ≤ x⊢ |Chebyshev.psi ↑x - ↑x| ≤ 7 / 8 * √↑x * Real.log ↑x ^ 2 x:ℕhx_low:253 < xhx_high:x ≤ 6000hx254_nat:254 ≤ xhx254:254 ≤ ↑x⊢ |Chebyshev.psi ↑x - ↑x| ≤ 7 / 8 * √↑x * Real.log ↑x ^ 2 x:ℕhx_low:253 < xhx_high:x ≤ 6000hx254_nat:254 ≤ xhx254:254 ≤ ↑xhx6000:↑x ≤ 6000⊢ |Chebyshev.psi ↑x - ↑x| ≤ 7 / 8 * √↑x * Real.log ↑x ^ 2 calc |Chebyshev.psi x - x| ≤ Real.sqrt x * ((3863 / 10000 : ℝ) * Real.sqrt x + 2 * Real.log x) := abs_psi_sub_self_le_linear_add_sqrt_log hx254_nat _ ≤ Real.sqrt x * ((7 / 8 : ℝ) * (Real.log x) ^ 2) := mul_le_mul_of_nonneg_left (chebyshev_factor_le_seven_eighths_log_sq hx254 hx6000) (Real.sqrt_nonneg x) _ = (7 / 8 : ℝ) * Real.sqrt x * (Real.log x) ^ 2 := x:ℕhx_low:253 < xhx_high:x ≤ 6000hx254_nat:254 ≤ xhx254:254 ≤ ↑xhx6000:↑x ≤ 6000⊢ √↑x * (7 / 8 * Real.log ↑x ^ 2) = 7 / 8 * √↑x * Real.log ↑x ^ 2 All goals completed! 🐙

Explicit Schoenfeld-type inequality at $x$: $$|\psi(x) - x| \le \frac{7}{8} \sqrt{x} (\log x)^2.$$

def SchoenfeldPsiBound (x : ℝ) : Prop := |Chebyshev.psi x - x| ≤ (7 / 8 : ℝ) * Real.sqrt x * (Real.log x) ^ 2

Schoenfeld Bound $\implies$ No Counterexample: If Chebyshev's $\psi(x)$ satisfies the explicit upper bound $$\psi(x) - x \le \frac{7}{8} \sqrt{x} (\log x)^2,$$ then MatiyasevichRiemannCounterexample x cannot hold.

The proof is completely elementary: for $x > 253$, we have $\sqrt{x} \ge 15$, $H_x \ge 5$, $\log x \le H_x$, $\frac{1}{8} \sqrt{x} H_x^2 \ge \frac{375}{8} > 1$, and $H_{\operatorname{lcm}(1,\dots,x)} \le \psi(x) + 1$, so the $+1$ slack between $H_{L_x}$ and $\psi(x)$ is absorbed with room to spare.

theorem not_matiyasevichRiemannCounterexample_of_psi_sub_le {x : ℕ} (hpsi : Chebyshev.psi x - x ≤ (7 / 8 : ℝ) * Real.sqrt x * (Real.log x) ^ 2) : ¬ MatiyasevichRiemannCounterexample x := x:ℕhpsi:Chebyshev.psi ↑x - ↑x ≤ 7 / 8 * √↑x * Real.log ↑x ^ 2⊢ ¬MatiyasevichRiemannCounterexample x x:ℕhpsi:Chebyshev.psi ↑x - ↑x ≤ 7 / 8 * √↑x * Real.log ↑x ^ 2⊢ ¬(253 < x ∧ √↑x * ↑(harmonic x) ^ 2 < ↑(harmonic (lcmUpTo x)) - ↑x) x:ℕhpsi:Chebyshev.psi ↑x - ↑x ≤ 7 / 8 * √↑x * Real.log ↑x ^ 2hx:253 < xhlt:√↑x * ↑(harmonic x) ^ 2 < ↑(harmonic (lcmUpTo x)) - ↑x⊢ False x:ℕhpsi:Chebyshev.psi ↑x - ↑x ≤ 7 / 8 * √↑x * Real.log ↑x ^ 2hx:253 < xhlt:√↑x * ↑(harmonic x) ^ 2 < ↑(harmonic (lcmUpTo x)) - ↑xhx254:254 ≤ ↑x⊢ False x:ℕhpsi:Chebyshev.psi ↑x - ↑x ≤ 7 / 8 * √↑x * Real.log ↑x ^ 2hx:253 < xhlt:√↑x * ↑(harmonic x) ^ 2 < ↑(harmonic (lcmUpTo x)) - ↑xhx254:254 ≤ ↑xhsqrt15:15 ≤ √↑x⊢ False x:ℕhpsi:Chebyshev.psi ↑x - ↑x ≤ 7 / 8 * √↑x * Real.log ↑x ^ 2hx:253 < xhlt:√↑x * ↑(harmonic x) ^ 2 < ↑(harmonic (lcmUpTo x)) - ↑xhx254:254 ≤ ↑xhsqrt15:15 ≤ √↑xhlog5:5 ≤ Real.log ↑x⊢ False x:ℕhpsi:Chebyshev.psi ↑x - ↑x ≤ 7 / 8 * √↑x * Real.log ↑x ^ 2hx:253 < xhlt:√↑x * ↑(harmonic x) ^ 2 < ↑(harmonic (lcmUpTo x)) - ↑xhx254:254 ≤ ↑xhsqrt15:15 ≤ √↑xhlog5:5 ≤ Real.log ↑xhharm5:5 ≤ ↑(harmonic x)⊢ False x:ℕhpsi:Chebyshev.psi ↑x - ↑x ≤ 7 / 8 * √↑x * Real.log ↑x ^ 2hx:253 < xhlt:√↑x * ↑(harmonic x) ^ 2 < ↑(harmonic (lcmUpTo x)) - ↑xhx254:254 ≤ ↑xhsqrt15:15 ≤ √↑xhlog5:5 ≤ Real.log ↑xhharm5:5 ≤ ↑(harmonic x)hharm_sq25:25 ≤ ↑(harmonic x) ^ 2⊢ False x:ℕhpsi:Chebyshev.psi ↑x - ↑x ≤ 7 / 8 * √↑x * Real.log ↑x ^ 2hx:253 < xhlt:√↑x * ↑(harmonic x) ^ 2 < ↑(harmonic (lcmUpTo x)) - ↑xhx254:254 ≤ ↑xhsqrt15:15 ≤ √↑xhlog5:5 ≤ Real.log ↑xhharm5:5 ≤ ↑(harmonic x)hharm_sq25:25 ≤ ↑(harmonic x) ^ 2h_one_eighth:1 ≤ 1 / 8 * (√↑x * ↑(harmonic x) ^ 2)⊢ False x:ℕhpsi:Chebyshev.psi ↑x - ↑x ≤ 7 / 8 * √↑x * Real.log ↑x ^ 2hx:253 < xhlt:√↑x * ↑(harmonic x) ^ 2 < ↑(harmonic (lcmUpTo x)) - ↑xhx254:254 ≤ ↑xhsqrt15:15 ≤ √↑xhlog5:5 ≤ Real.log ↑xhharm5:5 ≤ ↑(harmonic x)hharm_sq25:25 ≤ ↑(harmonic x) ^ 2h_one_eighth:1 ≤ 1 / 8 * (√↑x * ↑(harmonic x) ^ 2)hlog_harm:Real.log ↑x ^ 2 ≤ ↑(harmonic x) ^ 2⊢ False x:ℕhpsi:Chebyshev.psi ↑x - ↑x ≤ 7 / 8 * √↑x * Real.log ↑x ^ 2hx:253 < xhlt:√↑x * ↑(harmonic x) ^ 2 < ↑(harmonic (lcmUpTo x)) - ↑xhx254:254 ≤ ↑xhsqrt15:15 ≤ √↑xhlog5:5 ≤ Real.log ↑xhharm5:5 ≤ ↑(harmonic x)hharm_sq25:25 ≤ ↑(harmonic x) ^ 2h_one_eighth:1 ≤ 1 / 8 * (√↑x * ↑(harmonic x) ^ 2)hlog_harm:Real.log ↑x ^ 2 ≤ ↑(harmonic x) ^ 2h_seven_eighths:7 / 8 * √↑x * Real.log ↑x ^ 2 ≤ 7 / 8 * (√↑x * ↑(harmonic x) ^ 2)⊢ False x:ℕhpsi:Chebyshev.psi ↑x - ↑x ≤ 7 / 8 * √↑x * Real.log ↑x ^ 2hx:253 < xhlt:√↑x * ↑(harmonic x) ^ 2 < ↑(harmonic (lcmUpTo x)) - ↑xhx254:254 ≤ ↑xhsqrt15:15 ≤ √↑xhlog5:5 ≤ Real.log ↑xhharm5:5 ≤ ↑(harmonic x)hharm_sq25:25 ≤ ↑(harmonic x) ^ 2h_one_eighth:1 ≤ 1 / 8 * (√↑x * ↑(harmonic x) ^ 2)hlog_harm:Real.log ↑x ^ 2 ≤ ↑(harmonic x) ^ 2h_seven_eighths:7 / 8 * √↑x * Real.log ↑x ^ 2 ≤ 7 / 8 * (√↑x * ↑(harmonic x) ^ 2)hhlcm:↑(harmonic (lcmUpTo x)) - ↑x ≤ Chebyshev.psi ↑x - ↑x + 1⊢ False All goals completed! 🐙

Variant of not_matiyasevichRiemannCounterexample_of_psi_sub_le taking the two-sided absolute-value bound SchoenfeldPsiBound x.

theorem not_matiyasevichRiemannCounterexample_of_schoenfeldPsiBound {x : ℕ} (hpsi : SchoenfeldPsiBound x) : ¬ MatiyasevichRiemannCounterexample x := not_matiyasevichRiemannCounterexample_of_psi_sub_le ((le_abs_self _).trans hpsi)

$\psi(x)$ Oscillation $\implies$ Counterexample: If $x > 253$ and $\sqrt{x} H_x^2 \le \psi(x) - x + \gamma$, then MatiyasevichRiemannCounterexample x holds.

theorem matiyasevichRiemannCounterexample_of_sqrt_mul_harmonic_sq_le_psi_sub {x : ℕ} (hx : 253 < x) (hpsi : Real.sqrt x * (harmonic x : ℝ) ^ 2 ≤ Chebyshev.psi x - x + Real.eulerMascheroniConstant) : MatiyasevichRiemannCounterexample x := x:ℕhx:253 < xhpsi:√↑x * ↑(harmonic x) ^ 2 ≤ Chebyshev.psi ↑x - ↑x + Real.eulerMascheroniConstant⊢ MatiyasevichRiemannCounterexample x x:ℕhx:253 < xhpsi:√↑x * ↑(harmonic x) ^ 2 ≤ Chebyshev.psi ↑x - ↑x + Real.eulerMascheroniConstant⊢ 253 < x ∧ √↑x * ↑(harmonic x) ^ 2 < ↑(harmonic (lcmUpTo x)) - ↑x x:ℕhx:253 < xhpsi:√↑x * ↑(harmonic x) ^ 2 ≤ Chebyshev.psi ↑x - ↑x + Real.eulerMascheroniConstant⊢ √↑x * ↑(harmonic x) ^ 2 < ↑(harmonic (lcmUpTo x)) - ↑x All goals completed! 🐙

Purely logarithmic sufficient condition for MatiyasevichRiemannCounterexample x: if $x > 253$ and $\sqrt{x} (1 + \log x)^2 \le \psi(x) - x$, then MatiyasevichRiemannCounterexample x holds.

theorem matiyasevichRiemannCounterexample_of_sqrt_mul_one_add_log_sq_le_psi_sub {x : ℕ} (hx : 253 < x) (hpsi : Real.sqrt x * (1 + Real.log x) ^ 2 ≤ Chebyshev.psi x - x) : MatiyasevichRiemannCounterexample x := x:ℕhx:253 < xhpsi:√↑x * (1 + Real.log ↑x) ^ 2 ≤ Chebyshev.psi ↑x - ↑x⊢ MatiyasevichRiemannCounterexample x x:ℕhx:253 < xhpsi:√↑x * (1 + Real.log ↑x) ^ 2 ≤ Chebyshev.psi ↑x - ↑x⊢ √↑x * ↑(harmonic x) ^ 2 ≤ Chebyshev.psi ↑x - ↑x + Real.eulerMascheroniConstant x:ℕhx:253 < xhpsi:√↑x * (1 + Real.log ↑x) ^ 2 ≤ Chebyshev.psi ↑x - ↑xh1:√↑x * ↑(harmonic x) ^ 2 ≤ √↑x * (1 + Real.log ↑x) ^ 2⊢ √↑x * ↑(harmonic x) ^ 2 ≤ Chebyshev.psi ↑x - ↑x + Real.eulerMascheroniConstant All goals completed! 🐙

6. Classical Analytic Number Theory Ingredients (Schoenfeld 1976 & Schmidt 1903)

export RiemannSchmidt (not_riemannHypothesis_iff_exists_zero not_riemannHypothesis_imp_exists_psi_sub_ge_sqrt_mul_one_add_log_sq)

Explicit Formula $\psi(x)$ Bound for $x \ge 5000$ under RiemannHypothesis: Combining the smoothed Perron contour shift and multiplicity-weighted Stieltjes bound (WeightedStieltjes), the quartic Euler–Maclaurin Jensen zero-counting bound (VonMangoldtCount), the Binet/Euler–Maclaurin digamma vertical bound (DigammaBinet), the Borel–Carathéodory horizontal contour bound (HorizontalBounds), and the large-x real inequality (ExplicitLarge) proves SchoenfeldPsiBound x for all x ≥ 5000.

theorem abs_psi_sub_self_le_seven_eighths_of_five_thousand_le (hRH : RiemannHypothesis) {x : ℝ} (hx : 5000 ≤ x) : SchoenfeldPsiBound x := hRH:RiemannHypothesisx:ℝhx:5000 ≤ x⊢ SchoenfeldPsiBound x hRH:RiemannHypothesisx:ℝhx:5000 ≤ x⊢ |Chebyshev.psi x - x| ≤ 7 / 8 * √x * Real.log x ^ 2 hRH:RiemannHypothesisx:ℝhx:5000 ≤ xh_rhs:7 / 20 * √x * Real.log x ^ 2 / 2 + Real.log (2 * Real.pi) + √(x + 7 / 20 * √x * Real.log x ^ 2) * (16 / 5 / 2 * Real.log (3 / 2 * √x / Real.log x) ^ 2 + (16 / 5 + 11 / 5) * Real.log (3 / 2 * √x / Real.log x) + 11 / 5 + 0 / 6 - 16 / 5 / 2 * Real.log 6 ^ 2 - 11 / 5 * Real.log 6) + 2 * (x + 7 / 20 * √x * Real.log x ^ 2) ^ (3 / 2) / (7 / 20 * √x * Real.log x ^ 2) * ((2 * (16 / 5) * Real.log (3 / 2 * √x / Real.log x) + 2 * (16 / 5) + 2 * (11 / 5)) / (3 / 2 * √x / Real.log x) + 2 * 0 / (3 / 2 * √x / Real.log x) ^ 2) + 32 * (2 * 1 + 85) / (Real.pi * (7 / 20 * √x * Real.log x ^ 2)) * (x + 7 / 20 * √x * Real.log x ^ 2) ^ (3 / 4) ≤ 7 / 8 * √x * Real.log x ^ 2hx_sub:1 ≤ x - 7 / 20 * √x * Real.log x ^ 2hh_pos:0 < 7 / 20 * √x * Real.log x ^ 2h6T:6 ≤ 3 / 2 * √x / Real.log x⊢ |Chebyshev.psi x - x| ≤ 7 / 8 * √x * Real.log x ^ 2 hRH:RiemannHypothesisx:ℝhx:5000 ≤ xh_rhs:7 / 20 * √x * Real.log x ^ 2 / 2 + Real.log (2 * Real.pi) + √(x + 7 / 20 * √x * Real.log x ^ 2) * (16 / 5 / 2 * Real.log (3 / 2 * √x / Real.log x) ^ 2 + (16 / 5 + 11 / 5) * Real.log (3 / 2 * √x / Real.log x) + 11 / 5 + 0 / 6 - 16 / 5 / 2 * Real.log 6 ^ 2 - 11 / 5 * Real.log 6) + 2 * (x + 7 / 20 * √x * Real.log x ^ 2) ^ (3 / 2) / (7 / 20 * √x * Real.log x ^ 2) * ((2 * (16 / 5) * Real.log (3 / 2 * √x / Real.log x) + 2 * (16 / 5) + 2 * (11 / 5)) / (3 / 2 * √x / Real.log x) + 2 * 0 / (3 / 2 * √x / Real.log x) ^ 2) + 32 * (2 * 1 + 85) / (Real.pi * (7 / 20 * √x * Real.log x ^ 2)) * (x + 7 / 20 * √x * Real.log x ^ 2) ^ (3 / 4) ≤ 7 / 8 * √x * Real.log x ^ 2hx_sub:1 ≤ x - 7 / 20 * √x * Real.log x ^ 2hh_pos:0 < 7 / 20 * √x * Real.log x ^ 2h6T:6 ≤ 3 / 2 * √x / Real.log xC_h:ℝhCh:0 ≤ C_hh_heights_hb:∀ U₀ ≥ 3 / 2 * √x / Real.log x, ∃ U ≥ U₀, (∀ ρ ∈ VonMangoldtCount.nontrivialZetaZerosUpTo U, |ρ.im| < U) ∧ (∀ σ ∈ Set.Icc (-1 / 4) 2, ‖-deriv riemannZeta (↑σ + ↑U * Complex.I) / riemannZeta (↑σ + ↑U * Complex.I)‖ ≤ C_h * Real.log U ^ 5) ∧ ∀ σ ∈ Set.Icc (-1 / 4) 2, ‖-deriv riemannZeta (↑σ - ↑U * Complex.I) / riemannZeta (↑σ - ↑U * Complex.I)‖ ≤ C_h * Real.log U ^ 5⊢ |Chebyshev.psi x - x| ≤ 7 / 8 * √x * Real.log x ^ 2 hRH:RiemannHypothesisx:ℝhx:5000 ≤ xh_rhs:7 / 20 * √x * Real.log x ^ 2 / 2 + Real.log (2 * Real.pi) + √(x + 7 / 20 * √x * Real.log x ^ 2) * (16 / 5 / 2 * Real.log (3 / 2 * √x / Real.log x) ^ 2 + (16 / 5 + 11 / 5) * Real.log (3 / 2 * √x / Real.log x) + 11 / 5 + 0 / 6 - 16 / 5 / 2 * Real.log 6 ^ 2 - 11 / 5 * Real.log 6) + 2 * (x + 7 / 20 * √x * Real.log x ^ 2) ^ (3 / 2) / (7 / 20 * √x * Real.log x ^ 2) * ((2 * (16 / 5) * Real.log (3 / 2 * √x / Real.log x) + 2 * (16 / 5) + 2 * (11 / 5)) / (3 / 2 * √x / Real.log x) + 2 * 0 / (3 / 2 * √x / Real.log x) ^ 2) + 32 * (2 * 1 + 85) / (Real.pi * (7 / 20 * √x * Real.log x ^ 2)) * (x + 7 / 20 * √x * Real.log x ^ 2) ^ (3 / 4) ≤ 7 / 8 * √x * Real.log x ^ 2hx_sub:1 ≤ x - 7 / 20 * √x * Real.log x ^ 2hh_pos:0 < 7 / 20 * √x * Real.log x ^ 2h6T:6 ≤ 3 / 2 * √x / Real.log xC_h:ℝhCh:0 ≤ C_hh_heights_hb:∀ U₀ ≥ 3 / 2 * √x / Real.log x, ∃ U ≥ U₀, (∀ ρ ∈ VonMangoldtCount.nontrivialZetaZerosUpTo U, |ρ.im| < U) ∧ (∀ σ ∈ Set.Icc (-1 / 4) 2, ‖-deriv riemannZeta (↑σ + ↑U * Complex.I) / riemannZeta (↑σ + ↑U * Complex.I)‖ ≤ C_h * Real.log U ^ 5) ∧ ∀ σ ∈ Set.Icc (-1 / 4) 2, ‖-deriv riemannZeta (↑σ - ↑U * Complex.I) / riemannZeta (↑σ - ↑U * Complex.I)‖ ≤ C_h * Real.log U ^ 5hN_bound:∀ t ≥ 6, ↑(VonMangoldtCount.weightedZeroCountingFunction t) ≤ 16 / 5 * t * Real.log t + 11 / 5 * t + 0⊢ |Chebyshev.psi x - x| ≤ 7 / 8 * √x * Real.log x ^ 2 hRH:RiemannHypothesisx:ℝhx:5000 ≤ xh_rhs:7 / 20 * √x * Real.log x ^ 2 / 2 + Real.log (2 * Real.pi) + √(x + 7 / 20 * √x * Real.log x ^ 2) * (16 / 5 / 2 * Real.log (3 / 2 * √x / Real.log x) ^ 2 + (16 / 5 + 11 / 5) * Real.log (3 / 2 * √x / Real.log x) + 11 / 5 + 0 / 6 - 16 / 5 / 2 * Real.log 6 ^ 2 - 11 / 5 * Real.log 6) + 2 * (x + 7 / 20 * √x * Real.log x ^ 2) ^ (3 / 2) / (7 / 20 * √x * Real.log x ^ 2) * ((2 * (16 / 5) * Real.log (3 / 2 * √x / Real.log x) + 2 * (16 / 5) + 2 * (11 / 5)) / (3 / 2 * √x / Real.log x) + 2 * 0 / (3 / 2 * √x / Real.log x) ^ 2) + 32 * (2 * 1 + 85) / (Real.pi * (7 / 20 * √x * Real.log x ^ 2)) * (x + 7 / 20 * √x * Real.log x ^ 2) ^ (3 / 4) ≤ 7 / 8 * √x * Real.log x ^ 2hx_sub:1 ≤ x - 7 / 20 * √x * Real.log x ^ 2hh_pos:0 < 7 / 20 * √x * Real.log x ^ 2h6T:6 ≤ 3 / 2 * √x / Real.log xC_h:ℝhCh:0 ≤ C_hh_heights_hb:∀ U₀ ≥ 3 / 2 * √x / Real.log x, ∃ U ≥ U₀, (∀ ρ ∈ VonMangoldtCount.nontrivialZetaZerosUpTo U, |ρ.im| < U) ∧ (∀ σ ∈ Set.Icc (-1 / 4) 2, ‖-deriv riemannZeta (↑σ + ↑U * Complex.I) / riemannZeta (↑σ + ↑U * Complex.I)‖ ≤ C_h * Real.log U ^ 5) ∧ ∀ σ ∈ Set.Icc (-1 / 4) 2, ‖-deriv riemannZeta (↑σ - ↑U * Complex.I) / riemannZeta (↑σ - ↑U * Complex.I)‖ ≤ C_h * Real.log U ^ 5hN_bound:∀ t ≥ 6, ↑(VonMangoldtCount.weightedZeroCountingFunction t) ≤ 16 / 5 * t * Real.log t + 11 / 5 * t + 0h_left_zeta:∀ (t : ℝ), ‖-deriv riemannZeta (↑(-1 / 4) + ↑t * Complex.I) / riemannZeta (↑(-1 / 4) + ↑t * Complex.I)‖ ≤ 1 * Real.log (|t| + 2) + 85⊢ |Chebyshev.psi x - x| ≤ 7 / 8 * √x * Real.log x ^ 2 hRH:RiemannHypothesisx:ℝhx:5000 ≤ xh_rhs:7 / 20 * √x * Real.log x ^ 2 / 2 + Real.log (2 * Real.pi) + √(x + 7 / 20 * √x * Real.log x ^ 2) * (16 / 5 / 2 * Real.log (3 / 2 * √x / Real.log x) ^ 2 + (16 / 5 + 11 / 5) * Real.log (3 / 2 * √x / Real.log x) + 11 / 5 + 0 / 6 - 16 / 5 / 2 * Real.log 6 ^ 2 - 11 / 5 * Real.log 6) + 2 * (x + 7 / 20 * √x * Real.log x ^ 2) ^ (3 / 2) / (7 / 20 * √x * Real.log x ^ 2) * ((2 * (16 / 5) * Real.log (3 / 2 * √x / Real.log x) + 2 * (16 / 5) + 2 * (11 / 5)) / (3 / 2 * √x / Real.log x) + 2 * 0 / (3 / 2 * √x / Real.log x) ^ 2) + 32 * (2 * 1 + 85) / (Real.pi * (7 / 20 * √x * Real.log x ^ 2)) * (x + 7 / 20 * √x * Real.log x ^ 2) ^ (3 / 4) ≤ 7 / 8 * √x * Real.log x ^ 2hx_sub:1 ≤ x - 7 / 20 * √x * Real.log x ^ 2hh_pos:0 < 7 / 20 * √x * Real.log x ^ 2h6T:6 ≤ 3 / 2 * √x / Real.log xC_h:ℝhCh:0 ≤ C_hh_heights_hb:∀ U₀ ≥ 3 / 2 * √x / Real.log x, ∃ U ≥ U₀, (∀ ρ ∈ VonMangoldtCount.nontrivialZetaZerosUpTo U, |ρ.im| < U) ∧ (∀ σ ∈ Set.Icc (-1 / 4) 2, ‖-deriv riemannZeta (↑σ + ↑U * Complex.I) / riemannZeta (↑σ + ↑U * Complex.I)‖ ≤ C_h * Real.log U ^ 5) ∧ ∀ σ ∈ Set.Icc (-1 / 4) 2, ‖-deriv riemannZeta (↑σ - ↑U * Complex.I) / riemannZeta (↑σ - ↑U * Complex.I)‖ ≤ C_h * Real.log U ^ 5hN_bound:∀ t ≥ 6, ↑(VonMangoldtCount.weightedZeroCountingFunction t) ≤ 16 / 5 * t * Real.log t + 11 / 5 * t + 0h_left_zeta:∀ (t : ℝ), ‖-deriv riemannZeta (↑(-1 / 4) + ↑t * Complex.I) / riemannZeta (↑(-1 / 4) + ↑t * Complex.I)‖ ≤ 1 * Real.log (|t| + 2) + 85h_explicit:|Chebyshev.psi x - x| ≤ 7 / 20 * √x * Real.log x ^ 2 / 2 + Real.log (2 * Real.pi) + √(x + 7 / 20 * √x * Real.log x ^ 2) * (16 / 5 / 2 * Real.log (3 / 2 * √x / Real.log x) ^ 2 + (16 / 5 + 11 / 5) * Real.log (3 / 2 * √x / Real.log x) + 11 / 5 + 0 / 6 - 16 / 5 / 2 * Real.log 6 ^ 2 - 11 / 5 * Real.log 6) + 2 * (x + 7 / 20 * √x * Real.log x ^ 2) ^ (3 / 2) / (7 / 20 * √x * Real.log x ^ 2) * ((2 * (16 / 5) * Real.log (3 / 2 * √x / Real.log x) + 2 * (16 / 5) + 2 * (11 / 5)) / (3 / 2 * √x / Real.log x) + 2 * 0 / (3 / 2 * √x / Real.log x) ^ 2) + 32 * (2 * 1 + 85) / (Real.pi * (7 / 20 * √x * Real.log x ^ 2)) * (x + 7 / 20 * √x * Real.log x ^ 2) ^ (3 / 4)⊢ |Chebyshev.psi x - x| ≤ 7 / 8 * √x * Real.log x ^ 2 All goals completed! 🐙

Explicit $\psi(x)$ Bound under RH: Assuming RiemannHypothesis, for every integer $x > 253$, $$|\psi(x) - x| \le \frac{7}{8} \sqrt{x} (\log x)^2.$$

theorem riemannHypothesis_imp_schoenfeldPsiBound (hRH : RiemannHypothesis) {x : ℕ} (hx : 253 < x) : SchoenfeldPsiBound x := hRH:RiemannHypothesisx:ℕhx:253 < x⊢ SchoenfeldPsiBound ↑x hRH:RiemannHypothesisx:ℕhx:253 < xhx_le:x ≤ 6000⊢ SchoenfeldPsiBound ↑xhRH:RiemannHypothesisx:ℕhx:253 < xhx_gt:6000 < x⊢ SchoenfeldPsiBound ↑x hRH:RiemannHypothesisx:ℕhx:253 < xhx_le:x ≤ 6000⊢ SchoenfeldPsiBound ↑x All goals completed! 🐙 hRH:RiemannHypothesisx:ℕhx:253 < xhx_gt:6000 < x⊢ SchoenfeldPsiBound ↑x hRH:RiemannHypothesisx:ℕhx:253 < xhx_gt:6000 < xhx5000:5000 ≤ ↑x⊢ SchoenfeldPsiBound ↑x All goals completed! 🐙

Corollary of not_riemannHypothesis_imp_exists_psi_sub_ge_sqrt_mul_one_add_log_sq in terms of harmonic numbers and the Euler–Mascheroni constant $\gamma$.

theorem not_riemannHypothesis_imp_exists_psi_oscillation (hNotRH : ¬ RiemannHypothesis) : ∃ x : ℕ, 253 < x ∧ Real.sqrt x * (harmonic x : ℝ) ^ 2 ≤ Chebyshev.psi x - x + Real.eulerMascheroniConstant := hNotRH:¬RiemannHypothesis⊢ ∃ x, 253 < x ∧ √↑x * ↑(harmonic x) ^ 2 ≤ Chebyshev.psi ↑x - ↑x + Real.eulerMascheroniConstant hNotRH:¬RiemannHypothesisx:ℕhx:253 < xhpsi:√↑x * (1 + Real.log ↑x) ^ 2 ≤ Chebyshev.psi ↑x - ↑x⊢ ∃ x, 253 < x ∧ √↑x * ↑(harmonic x) ^ 2 ≤ Chebyshev.psi ↑x - ↑x + Real.eulerMascheroniConstant hNotRH:¬RiemannHypothesisx:ℕhx:253 < xhpsi:√↑x * (1 + Real.log ↑x) ^ 2 ≤ Chebyshev.psi ↑x - ↑x⊢ √↑x * ↑(harmonic x) ^ 2 ≤ Chebyshev.psi ↑x - ↑x + Real.eulerMascheroniConstant hNotRH:¬RiemannHypothesisx:ℕhx:253 < xhpsi:√↑x * (1 + Real.log ↑x) ^ 2 ≤ Chebyshev.psi ↑x - ↑xh1:√↑x * ↑(harmonic x) ^ 2 ≤ √↑x * (1 + Real.log ↑x) ^ 2⊢ √↑x * ↑(harmonic x) ^ 2 ≤ Chebyshev.psi ↑x - ↑x + Real.eulerMascheroniConstant All goals completed! 🐙

Schoenfeld's Explicit Chebyshev-$\psi$ Criterion for RH (1976): The Riemann Hypothesis holds if and only if SchoenfeldPsiBound x holds for all $x > 253$.

theorem riemannHypothesis_iff_forall_schoenfeldPsiBound : RiemannHypothesis ↔ ∀ x : ℕ, 253 < x → SchoenfeldPsiBound x := ⊢ RiemannHypothesis ↔ ∀ (x : ℕ), 253 < x → SchoenfeldPsiBound ↑x ⊢ RiemannHypothesis → ∀ (x : ℕ), 253 < x → SchoenfeldPsiBound ↑x⊢ (∀ (x : ℕ), 253 < x → SchoenfeldPsiBound ↑x) → RiemannHypothesis ⊢ RiemannHypothesis → ∀ (x : ℕ), 253 < x → SchoenfeldPsiBound ↑x All goals completed! 🐙 ⊢ (∀ (x : ℕ), 253 < x → SchoenfeldPsiBound ↑x) → RiemannHypothesis hBound:∀ (x : ℕ), 253 < x → SchoenfeldPsiBound ↑x⊢ RiemannHypothesis hBound:∀ (x : ℕ), 253 < x → SchoenfeldPsiBound ↑xhNotRH:¬RiemannHypothesis⊢ False hBound:∀ (x : ℕ), 253 < x → SchoenfeldPsiBound ↑xhNotRH:¬RiemannHypothesisx:ℕhx:253 < xhpsi:√↑x * (1 + Real.log ↑x) ^ 2 ≤ Chebyshev.psi ↑x - ↑x⊢ False All goals completed! 🐙

Matiyasevich–Aaronson Harmonic-LCM Criterion for RH (2016): The Riemann Hypothesis holds if and only if no natural number $x$ satisfies MatiyasevichRiemannCounterexample x.

theorem riemannHypothesis_iff_forall_not_counterexample : RiemannHypothesis ↔ ∀ x : ℕ, ¬ MatiyasevichRiemannCounterexample x := ⊢ RiemannHypothesis ↔ ∀ (x : ℕ), ¬MatiyasevichRiemannCounterexample x ⊢ RiemannHypothesis → ∀ (x : ℕ), ¬MatiyasevichRiemannCounterexample x⊢ (∀ (x : ℕ), ¬MatiyasevichRiemannCounterexample x) → RiemannHypothesis ⊢ RiemannHypothesis → ∀ (x : ℕ), ¬MatiyasevichRiemannCounterexample x hRH:RiemannHypothesisx:ℕhx_ce:MatiyasevichRiemannCounterexample x⊢ False hRH:RiemannHypothesisx:ℕhx_ce:MatiyasevichRiemannCounterexample xhx:253 < x⊢ False All goals completed! 🐙 ⊢ (∀ (x : ℕ), ¬MatiyasevichRiemannCounterexample x) → RiemannHypothesis hNoCE:∀ (x : ℕ), ¬MatiyasevichRiemannCounterexample x⊢ RiemannHypothesis hNoCE:∀ (x : ℕ), ¬MatiyasevichRiemannCounterexample xhNotRH:¬RiemannHypothesis⊢ False hNoCE:∀ (x : ℕ), ¬MatiyasevichRiemannCounterexample xhNotRH:¬RiemannHypothesisx:ℕhx:253 < xhpsi:√↑x * ↑(harmonic x) ^ 2 ≤ Chebyshev.psi ↑x - ↑x + Real.eulerMascheroniConstant⊢ False All goals completed! 🐙

Part II (Elementary Counterexample ↔ Riemann Hypothesis): There exists an integer x satisfying MatiyasevichRiemannCounterexample x if and only if the Riemann Hypothesis (RiemannHypothesis) is false.

theorem exists_counterexample_iff_not_riemannHypothesis : (∃ x : ℕ, MatiyasevichRiemannCounterexample x) ↔ ¬ RiemannHypothesis := ⊢ (∃ x, MatiyasevichRiemannCounterexample x) ↔ ¬RiemannHypothesis ⊢ (∃ x, MatiyasevichRiemannCounterexample x) ↔ ¬∀ (x : ℕ), ¬MatiyasevichRiemannCounterexample x ⊢ (∃ x, MatiyasevichRiemannCounterexample x) ↔ ∃ x, MatiyasevichRiemannCounterexample x All goals completed! 🐙end ConjectureMachines.Semantics.Riemann