Erdős Problem 390 — exact finite model and asymptotic target
Definitionerdos390_problemFor natural numbers and , let
Call an admissible endpoint for if there is a finite set whose product is . Because is a set, its factors are automatically distinct. For , define to be the least admissible endpoint; set for only to make a total function.
Define
The main asymptotic proposition is along the natural numbers tending to infinity. For the complementary formulation, also define
as a rational number, and say that has a complement product if some finite subset of has product .
These definitions provide the exact finite model and asymptotic target used by the mission.
Formalization Note Real logarithm and division are total operations. Thus the displayed functions also have formal values at small , but every asymptotic assertion is taken at . The quotient is rational rather than truncated natural-number division.
import Mathlib.Analysis.Asymptotics.Defs
import Mathlib.Analysis.SpecialFunctions.Log.Basic
import Mathlib.Data.Finset.Interval
import Mathlib.Data.Nat.Factorial.Basic
open Filter
open scoped BigOperators
namespace Erdos390
noncomputable section
/-- The integer interval `(n, M]`. -/
def factorInterval (n M : ℕ) : Finset ℕ :=
Finset.Ioc n M
/-- There is a factorization of `n!` into distinct integers in `(n, M]`. -/
def IsAdmissibleEndpoint (n M : ℕ) : Prop :=
∃ factors : Finset ℕ,
factors ⊆ factorInterval n M ∧ factors.prod id = n.factorial
/-- For `n ≥ 3`, the singleton factorization `{n!}` supplies an endpoint. -/
theorem exists_admissibleEndpoint {n : ℕ} (hn : 3 ≤ n) :
∃ M, IsAdmissibleEndpoint n M := by
refine ⟨n.factorial, {n.factorial}, ?_, by simp⟩
intro a ha
have ha' : a = n.factorial := by simpa using ha
subst a
simp [factorInterval, Nat.lt_factorial_self hn]
/-- The least possible largest factor. Outside the paper's domain `n ≥ 3`,
the value is set to zero solely to make the function total. -/
def f (n : ℕ) : ℕ :=
by
classical
exact if hn : 3 ≤ n then Nat.find (exists_admissibleEndpoint hn) else 0
/-- The exact second-order constant in the proposed solution. -/
def C0 : ℝ :=
(4029639598 : ℝ) / 25970038185
/-- The second-order scale `n / log n`. -/
def secondOrderScale (n : ℕ) : ℝ :=
(n : ℝ) / Real.log (n : ℝ)
/-- The error after subtracting the asserted two leading terms. -/
def mainError (n : ℕ) : ℝ :=
(f n : ℝ) -
(2 * (n : ℝ) + C0 * secondOrderScale n)
/-- The literal small-`o` formulation of the paper's main asymptotic. -/
def MainAsymptotic : Prop :=
mainError =o[atTop] secondOrderScale
/-- The exact rational complement quotient `M! / (n!)²`. -/
def complementQuotient (n M : ℕ) : ℚ :=
(M.factorial : ℚ) / (n.factorial : ℚ) ^ 2
/-- A subset of `(n,M]` whose product is the complement quotient. -/
def HasComplementProduct (n M : ℕ) : Prop :=
∃ selected : Finset ℕ,
selected ⊆ factorInterval n M ∧
((selected.prod id : ℕ) : ℚ) = complementQuotient n M
end
end Erdos390