/- Copyright 2025 The Formal Conjectures Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at https://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ import FormalConjecturesUtil

Erdős Problem 304

Reference: erdosproblems.com/304

open Asymptotics Filternamespace Erdos304

The set of k for which a / b can be expressed as a sum of k distinct unit fractions.

def unitFractionExpressible (a b : ) : Set := {k | s : Finset , s.card = k ( n s, n > 1) (a / b : ) = n s, (n : )⁻¹}@[category API, simp, AMS 11] lemma zero_mem_unitFractionExpressible_iff {a b : } : 0 unitFractionExpressible a b a = 0 b = 0 := a:b:0 unitFractionExpressible a b a = 0 b = 0 All goals completed! 🐙a:b:h✝:a = 0 b = 0this:a / b = 0s:Finset hs: n s, 1 < nh: i s, i = 0 (x : ), x s a:b:h✝:a = 0 b = 0this:a / b = 0s:Finset hs: n s, 1 < nh: i s, i = 0i:hi:i sFalse All goals completed! 🐙@[category API, AMS 11] lemma unitFractionExpressible_zero_left {b : } : unitFractionExpressible 0 b = {0} := unitFractionExpressible_of_zero (b:0 = 0 b = 0 All goals completed! 🐙)@[category API, AMS 11] lemma unitFractionExpressible_zero_right {a : } : unitFractionExpressible a 0 = {0} := unitFractionExpressible_of_zero (a:a = 0 0 = 0 All goals completed! 🐙)@[category API, AMS 11] lemma zero_notMem_unitFractionExpressible {a b : } : 0 unitFractionExpressible a b a 0 b 0 := a:b:0 unitFractionExpressible a b a 0 b 0 All goals completed! 🐙@[category API, AMS 11] lemma eq_inv_of_one_mem_unitFractionExpressible {a b : } (h : 1 unitFractionExpressible a b) : m : , 1 < m (a / b : ) = (m : )⁻¹ := a:b:h:1 unitFractionExpressible a b m, 1 < m a / b = (↑m)⁻¹ a:b:h: s, (∃ a, s = {a}) (∀ n s, 1 < n) a / b = n s, (↑n)⁻¹ m, 1 < m a / b = (↑m)⁻¹ a:b:m:h₁: n {m}, 1 < nh₂:a / b = n {m}, (↑n)⁻¹ m, 1 < m a / b = (↑m)⁻¹ a:b:m:h₁:1 < mh₂:a / b = (↑m)⁻¹ m, 1 < m a / b = (↑m)⁻¹ All goals completed! 🐙a:b:h:1 unitFractionExpressible a bm:hm₁:1 < mhm:a / b = (↑m)⁻¹this:b 0a b a:b:h:1 unitFractionExpressible a bm:hm₁:1 < mhm:a / b = (↑m)⁻¹this:b 0b = a * m a:b:h:1 unitFractionExpressible a bm:hm₁:1 < mthis:b 0hm:a * m = bb = a * m All goals completed! 🐙

Let $$N(a, b)$$, denoted here by smallestCollection a b be the minimal k such that there exist integers $1 < n_1 < n_2 < \dots < n_k$ with $$\frac{a}{b} = \sum_{i=1}^k \frac{1}{n_i}$$

noncomputable def smallestCollection (a b : ) : := sInf (unitFractionExpressible a b)a:b:ha:a 0hb:b 0h:(unitFractionExpressible a b).NonemptysmallestCollection a b 0 a:b:ha:a 0hb:b 0h:(unitFractionExpressible a b).Nonemptyh':smallestCollection a b = 0False a:b:ha:a 0hb:b 0h:(unitFractionExpressible a b).Nonemptyh':smallestCollection a b = 0this:0 unitFractionExpressible a bFalse All goals completed! 🐙b:hb:1 < bthis✝¹:1 unitFractionExpressible 1 bthis✝:smallestCollection 1 b 1this:0 unitFractionExpressible 1 bsmallestCollection 1 b = 1 b:hb:1 < bthis✝²:1 unitFractionExpressible 1 bthis✝¹:smallestCollection 1 b 1this✝:0 unitFractionExpressible 1 bthis:smallestCollection 1 b 0smallestCollection 1 b = 1 All goals completed! 🐙@[category API, AMS 11] lemma eq_one_of_smallestCollection_eq_one {a b : } (h : smallestCollection a b = 1) : m : , 1 < m (a / b : ) = (m : )⁻¹ := a:b:h:smallestCollection a b = 1 m, 1 < m a / b = (↑m)⁻¹ a:b:h:smallestCollection a b = 1this:1 unitFractionExpressible a b m, 1 < m a / b = (↑m)⁻¹ All goals completed! 🐙@[category API, AMS 11] lemma dvd_of_smallestCollection_eq_one {a b : } (h : smallestCollection a b = 1) : a b := a:b:h:smallestCollection a b = 1a b a:b:h:smallestCollection a b = 1this:1 unitFractionExpressible a ba b All goals completed! 🐙h:2 unitFractionExpressible 2 15this✝¹:smallestCollection 2 15 2this✝:0 < smallestCollection 2 15this:smallestCollection 2 15 1smallestCollection 2 15 = 2 All goals completed! 🐙

Write $$N(b) = max_{1 \leq a < b} N(a, b)$$.

noncomputable def smallestCollectionTo (b : ) : := sSup {smallestCollection a b | a Finset.Ico 1 b}

In 1950, Erdős [Er50c] proved the upper bound $$N(b) \ll \log b / \log \log b$$. [Er50c] Erdős, P., Az ${1}/{x_1} + {1}/{x_2} + \ldots + {1}/{x_n} =A/B$ egyenlet eg'{E}sz sz'{A}m'{u} megold'{A}sairól. Mat. Lapok (1950), 192-210.

@[category research solved, AMS 11] theorem erdos_304.variants.upper_1950 : (fun b => (smallestCollectionTo b : )) =O[atTop] (fun b => Real.log b / Real.log (Real.log b)) := (fun b (smallestCollectionTo b)) =O[atTop] fun b Real.log b / Real.log (Real.log b) All goals completed! 🐙

In 1950, Erdős [Er50c] proved the lower bound $$\log \log b \ll N(b)$$. [Er50c] Erdős, P., Az ${1}/{x_1} + {1}/{x_2} + \ldots + {1}/{x_n} =A/B$ egyenlet eg'{E}sz sz'{A}m'{u} megold'{A}sairól. Mat. Lapok (1950), 192-210.

@[category research solved, AMS 11] theorem erdos_304.variants.lower_1950 : (fun b : => Real.log (Real.log b)) =O[atTop] (fun b => (smallestCollectionTo b : )) := (fun b Real.log (Real.log b)) =O[atTop] fun b (smallestCollectionTo b) All goals completed! 🐙

In 1985 Vose [Vo85] proved the upper bound $$N(b) \ll \sqrt{\log b}$$. [Vo85] Vose, Michael D., Egyptian fractions. Bull. London Math. Soc. (1985), 21-24.

@[category research solved, AMS 11] theorem erdos_304.variants.upper_1985 : (fun b => (smallestCollectionTo b : )) =O[atTop] (fun b => Real.sqrt (Real.log b)) := (fun b (smallestCollectionTo b)) =O[atTop] fun b (Real.log b) All goals completed! 🐙

Is it true that $$N(b) \ll \log \log b$$?

@[category research open, AMS 11] theorem upper_bound : answer(sorry) (fun b : => (smallestCollectionTo b : )) =O[atTop] (fun b : => Real.log (Real.log b)) := True (fun b (smallestCollectionTo b)) =O[atTop] fun b Real.log (Real.log b) All goals completed! 🐙end Erdos304