/- 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 56

Reference: erdosproblems.com/56

open scoped Finsetnamespace Erdos56

Say a set of natural numbers is k-weakly divisible if any k+1 elements of A are not relatively prime.

def WeaklyDivisible (k : ) (A : Finset ) : Prop := s A.powersetCard (k + 1), ¬ Set.Pairwise s Nat.Coprime @[category API, AMS 11] lemma weaklyDivisible_empty (k : ): WeaklyDivisible k {} := k:WeaklyDivisible k All goals completed! 🐙

A singleton is k-weakly divisble if k ≠ 0.

@[category API, AMS 11] lemma weaklyDivisible_singleton {k : } (hk : k 0) (l : ) : WeaklyDivisible k {l} := k:hk:k 0l:WeaklyDivisible k {l} All goals completed! 🐙

No non-empty set is 1-weakly divisible.

@[category API, AMS 11] lemma not_weaklyDivisible_zero {A : _} (h : A.Nonempty) : ¬WeaklyDivisible 0 A := A:Finset h:A.Nonempty¬WeaklyDivisible 0 A simpa [WeaklyDivisible] using {_}, A:Finset h:A.Nonempty{?m.20} A #{?m.20} = 1 (↑{?m.20}).Pairwise Nat.Coprime All goals completed! 🐙 @[category API, AMS 11] lemma empty_iff_weaklyDivisible_zero {A : _} : WeaklyDivisible 0 A A = := fun h Finset.not_nonempty_iff_eq_empty.1 <| mt not_weaklyDivisible_zero (not_not.2 h), fun h h weaklyDivisible_empty _

MaxWeaklyDivisible N k is the size of the largest k-weakly divisible subset of {1,..., N}

noncomputable def MaxWeaklyDivisible (N : ) (k : ) : := sSup {#A | (A : Finset ) (_ : A Finset.Icc 1 N) (_ : WeaklyDivisible k A)} @[category test, AMS 11] theorem maxWeaklyDivisible_zero : k : , MaxWeaklyDivisible 0 k = 0 := (k : ), MaxWeaklyDivisible 0 k = 0 k:MaxWeaklyDivisible 0 k = 0 All goals completed! 🐙 @[category test, AMS 11] theorem maxWeaklyDivisible_one {k : } (hk : k 0) : MaxWeaklyDivisible 1 k = 1 := k:hk:k 0MaxWeaklyDivisible 1 k = 1 have : {x | A, WeaklyDivisible k A (A = A = {1}) #A = x} = {0, 1} := k:hk:k 0MaxWeaklyDivisible 1 k = 1 refine Set.ext fun _ => fun _ => k:hk:k 0x✝¹:x✝:x✝¹ {x | A, WeaklyDivisible k A (A = A = {1}) #A = x}x✝¹ {0, 1} All goals completed! 🐙, ?_ k:hk:k 00 {x | A, WeaklyDivisible k A (A = A = {1}) #A = x}k:hk:k 0x✝:h✝:x✝ {1}x✝¹ {x | A, WeaklyDivisible k A (A = A = {1}) #A = x} k:hk:k 00 {x | A, WeaklyDivisible k A (A = A = {1}) #A = x} All goals completed! 🐙 k:hk:k 0x✝:h✝:x✝ {1}x✝¹ {x | A, WeaklyDivisible k A (A = A = {1}) #A = x} exact {1}, k:hk:k 0x✝:h✝:x✝ {1}WeaklyDivisible k {1} ({1} = {1} = {1}) #{1} = x✝ All goals completed! 🐙 All goals completed! 🐙 @[category test, AMS 11] theorem maxWeaklyDivisible_zero_k (N : ) : MaxWeaklyDivisible N 0 = 0 := N:MaxWeaklyDivisible N 0 = 0 All goals completed! 🐙

FirstPrimesMultiples N k is the set of numbers in {1,..., N} that are a multiple of one of the first k primes.

noncomputable def FirstPrimesMultiples (N k : ) : Finset := (Finset.Icc 1 N).filter fun i => j < k, (j.nth Nat.Prime i) @[category test, AMS 11] theorem firstPrimesMultiples_one_card_zero (k : ) : (FirstPrimesMultiples 1 k).card = 0 := k:#(FirstPrimesMultiples 1 k) = 0 k: x < k, ¬Nat.nth Nat.Prime x = 1 intro n k:n:h:n < k¬Nat.nth Nat.Prime n = 1 k:n:h:n < khprime:Nat.nth Nat.Prime n = 1False have : Nat.Prime 1 := k:#(FirstPrimesMultiples 1 k) = 0 k:n:h:n < khprime:Nat.nth Nat.Prime n = 11 = Nat.nth Nat.Prime n All goals completed! 🐙 All goals completed! 🐙 @[category test, AMS 11] theorem firstPrimesMultiples_zero_k_card_zero (N : ) : (FirstPrimesMultiples N 0).card = 0 := N:#(FirstPrimesMultiples N 0) = 0 All goals completed! 🐙

An example of a k-weakly divisible set is the subset of {1, ..., N} containing the multiples of the first k primes.

@[category API, AMS 11] lemma weaklyDivisible_firstPrimesMultiples (N k : ) : WeaklyDivisible k (FirstPrimesMultiples N k) := N:k:WeaklyDivisible k (FirstPrimesMultiples N k) N:k: s Finset.powersetCard (k + 1) (FirstPrimesMultiples N k), ¬(↑s).Pairwise Nat.Coprime intro s N:k:s:Finset hs:s Finset.powersetCard (k + 1) (FirstPrimesMultiples N k)¬(↑s).Pairwise Nat.Coprime N:k:s:Finset hs:s FirstPrimesMultiples N k #s = k + 1¬(↑s).Pairwise Nat.Coprime -- Define the map from s to Fin k N:k:s:Finset hs:s FirstPrimesMultiples N k #s = k + 1f:s Fin k := fun x => match x with | x, hx => have h_exists := ; Classical.choose h_exists, ¬(↑s).Pairwise Nat.Coprime have hcard_s : Fintype.card s = k + 1 := N:k:WeaklyDivisible k (FirstPrimesMultiples N k) All goals completed! 🐙 N:k:s:Finset hs:s FirstPrimesMultiples N k #s = k + 1f:s Fin k := fun x => match x with | x, hx => have h_exists := ; Classical.choose h_exists, hcard_s:Fintype.card s = k + 1 := of_eq_true (Eq.trans (Eq.trans (congrArg (fun x => x = k + 1) (Eq.trans (Fintype.card_coe s) hs.right)) Nat.add_left_cancel_iff._simp_1) (eq_self 1))hcard_fink:Fintype.card (Fin k) = k := Fintype.card_fin k¬(↑s).Pairwise Nat.Coprime obtain x, y, hne, heq := Fintype.exists_ne_map_eq_of_card_lt f (N:k:s:Finset hs:s FirstPrimesMultiples N k #s = k + 1f:s Fin k := fun x => match x with | x, hx => have h_exists := ; Classical.choose h_exists, hcard_s:Fintype.card s = k + 1 := of_eq_true (Eq.trans (Eq.trans (congrArg (fun x => x = k + 1) (Eq.trans (Fintype.card_coe s) hs.right)) Nat.add_left_cancel_iff._simp_1) (eq_self 1))hcard_fink:Fintype.card (Fin k) = k := Fintype.card_fin kFintype.card (Fin k) < Fintype.card s All goals completed! 🐙) N:k:s:Finset hs:s FirstPrimesMultiples N k #s = k + 1f:s Fin k := fun x => match x with | x, hx => have h_exists := ; Classical.choose h_exists, hcard_s:Fintype.card s = k + 1 := of_eq_true (Eq.trans (Eq.trans (congrArg (fun x => x = k + 1) (Eq.trans (Fintype.card_coe s) hs.right)) Nat.add_left_cancel_iff._simp_1) (eq_self 1))hcard_fink:Fintype.card (Fin k) = k := Fintype.card_fin kx:sy:shne:x yheq:f x = f yh_pair:(↑s).Pairwise Nat.CoprimeFalse have hne_val : x.1 y.1 := N:k:WeaklyDivisible k (FirstPrimesMultiples N k) N:k:s:Finset hs:s FirstPrimesMultiples N k #s = k + 1f:s Fin k := fun x => match x with | x, hx => have h_exists := ; Classical.choose h_exists, hcard_s:Fintype.card s = k + 1 := of_eq_true (Eq.trans (Eq.trans (congrArg (fun x => x = k + 1) (Eq.trans (Fintype.card_coe s) hs.right)) Nat.add_left_cancel_iff._simp_1) (eq_self 1))hcard_fink:Fintype.card (Fin k) = k := Fintype.card_fin kx:sy:shne:x yheq:f x = f yh_pair:(↑s).Pairwise Nat.Coprimeh_eq:x = yFalse All goals completed! 🐙 N:k:s:Finset hs:s FirstPrimesMultiples N k #s = k + 1f:s Fin k := fun x => match x with | x, hx => have h_exists := ; Classical.choose h_exists, hcard_s:Fintype.card s = k + 1 := of_eq_true (Eq.trans (Eq.trans (congrArg (fun x => x = k + 1) (Eq.trans (Fintype.card_coe s) hs.right)) Nat.add_left_cancel_iff._simp_1) (eq_self 1))hcard_fink:Fintype.card (Fin k) = k := Fintype.card_fin kx:sy:shne:x yheq:f x = f yh_pair:(↑s).Pairwise Nat.Coprimehne_val:x y := fun h_eq => hne (Subtype.ext h_eq)h_coprime:(↑x).Coprime y := h_pair x.property y.property hne_valFalse N:k:s:Finset hs:s FirstPrimesMultiples N k #s = k + 1f:s Fin k := fun x => match x with | x, hx => have h_exists := ; Classical.choose h_exists, hcard_s:Fintype.card s = k + 1 := of_eq_true (Eq.trans (Eq.trans (congrArg (fun x => x = k + 1) (Eq.trans (Fintype.card_coe s) hs.right)) Nat.add_left_cancel_iff._simp_1) (eq_self 1))hcard_fink:Fintype.card (Fin k) = k := Fintype.card_fin kx:sy:shne:x yheq:f x = f yh_pair:(↑s).Pairwise Nat.Coprimehne_val:x y := fun h_eq => hne (Subtype.ext h_eq)h_coprime:(↑x).Coprime y := h_pair x.property y.property hne_valp: := Nat.nth Nat.Prime (f x)False N:k:s:Finset hs:s FirstPrimesMultiples N k #s = k + 1f:s Fin k := fun x => match x with | x, hx => have h_exists := ; Classical.choose h_exists, hcard_s:Fintype.card s = k + 1 := of_eq_true (Eq.trans (Eq.trans (congrArg (fun x => x = k + 1) (Eq.trans (Fintype.card_coe s) hs.right)) Nat.add_left_cancel_iff._simp_1) (eq_self 1))hcard_fink:Fintype.card (Fin k) = k := Fintype.card_fin kx:sy:shne:x yheq:f x = f yh_pair:(↑s).Pairwise Nat.Coprimehne_val:x y := fun h_eq => hne (Subtype.ext h_eq)h_coprime:(↑x).Coprime y := h_pair x.property y.property hne_valp: := Nat.nth Nat.Prime (f x)hp_prime:Nat.Prime p := Nat.prime_nth_prime (f x)False have hp_div_x : p x.1 := N:k:WeaklyDivisible k (FirstPrimesMultiples N k) N:k:s:Finset hs:s FirstPrimesMultiples N k #s = k + 1f:s Fin k := fun x => match x with | x, hx => have h_exists := ; Classical.choose h_exists, hcard_s:Fintype.card s = k + 1 := of_eq_true (Eq.trans (Eq.trans (congrArg (fun x => x = k + 1) (Eq.trans (Fintype.card_coe s) hs.right)) Nat.add_left_cancel_iff._simp_1) (eq_self 1))hcard_fink:Fintype.card (Fin k) = k := Fintype.card_fin kx:sy:shne:x yheq:f x = f yh_pair:(↑s).Pairwise Nat.Coprimehne_val:x y := fun h_eq => hne (Subtype.ext h_eq)h_coprime:(↑x).Coprime y := h_pair x.property y.property hne_valp: := Nat.nth Nat.Prime (f x)hp_prime:Nat.Prime p := Nat.prime_nth_prime (f x)h_exists: j < k, Nat.nth Nat.Prime j x := (Finset.mem_filter.mp (hs.left x.property)).rightp x All goals completed! 🐙 have hp_div_y : p y.1 := N:k:WeaklyDivisible k (FirstPrimesMultiples N k) N:k:s:Finset hs:s FirstPrimesMultiples N k #s = k + 1f:s Fin k := fun x => match x with | x, hx => have h_exists := ; Classical.choose h_exists, hcard_s:Fintype.card s = k + 1 := of_eq_true (Eq.trans (Eq.trans (congrArg (fun x => x = k + 1) (Eq.trans (Fintype.card_coe s) hs.right)) Nat.add_left_cancel_iff._simp_1) (eq_self 1))hcard_fink:Fintype.card (Fin k) = k := Fintype.card_fin kx:sy:shne:x yheq:f x = f yh_pair:(↑s).Pairwise Nat.Coprimehne_val:x y := fun h_eq => hne (Subtype.ext h_eq)h_coprime:(↑x).Coprime y := h_pair x.property y.property hne_valp: := Nat.nth Nat.Prime (f x)hp_prime:Nat.Prime p := Nat.prime_nth_prime (f x)hp_div_x:p x := have h_exists := (Finset.mem_filter.mp (hs.left x.property)).right; (Classical.choose_spec h_exists).righth_exists: j < k, Nat.nth Nat.Prime j y := (Finset.mem_filter.mp (hs.left y.property)).rightp y have h_eq_f : (f x).val = (f y).val := N:k:WeaklyDivisible k (FirstPrimesMultiples N k) All goals completed! 🐙 -- (f y).val is Classical.choose h_exists by definition have : p = (Classical.choose h_exists).nth Nat.Prime := N:k:WeaklyDivisible k (FirstPrimesMultiples N k) N:k:s:Finset hs:s FirstPrimesMultiples N k #s = k + 1f:s Fin k := fun x => match x with | x, hx => have h_exists := ; Classical.choose h_exists, hcard_s:Fintype.card s = k + 1 := of_eq_true (Eq.trans (Eq.trans (congrArg (fun x => x = k + 1) (Eq.trans (Fintype.card_coe s) hs.right)) Nat.add_left_cancel_iff._simp_1) (eq_self 1))hcard_fink:Fintype.card (Fin k) = k := Fintype.card_fin kx:sy:shne:x yheq:f x = f yh_pair:(↑s).Pairwise Nat.Coprimehne_val:x y := fun h_eq => hne (Subtype.ext h_eq)h_coprime:(↑x).Coprime y := h_pair x.property y.property hne_valp: := Nat.nth Nat.Prime (f x)hp_prime:Nat.Prime p := Nat.prime_nth_prime (f x)hp_div_x:p x := have h_exists := (Finset.mem_filter.mp (hs.left x.property)).right; (Classical.choose_spec h_exists).righth_exists: j < k, Nat.nth Nat.Prime j y := (Finset.mem_filter.mp (hs.left y.property)).righth_eq_f:(f x) = (f y) := Eq.mpr (id (congrArg (fun _a => _a = (f y)) heq)) (Eq.refl (f y))Nat.nth Nat.Prime (f x) = Nat.nth Nat.Prime (Classical.choose h_exists) All goals completed! 🐙 N:k:s:Finset hs:s FirstPrimesMultiples N k #s = k + 1f:s Fin k := fun x => match x with | x, hx => have h_exists := ; Classical.choose h_exists, hcard_s:Fintype.card s = k + 1 := of_eq_true (Eq.trans (Eq.trans (congrArg (fun x => x = k + 1) (Eq.trans (Fintype.card_coe s) hs.right)) Nat.add_left_cancel_iff._simp_1) (eq_self 1))hcard_fink:Fintype.card (Fin k) = k := Fintype.card_fin kx:sy:shne:x yheq:f x = f yh_pair:(↑s).Pairwise Nat.Coprimehne_val:x y := fun h_eq => hne (Subtype.ext h_eq)h_coprime:(↑x).Coprime y := h_pair x.property y.property hne_valp: := Nat.nth Nat.Prime (f x)hp_prime:Nat.Prime p := Nat.prime_nth_prime (f x)hp_div_x:p x := have h_exists := (Finset.mem_filter.mp (hs.left x.property)).right; (Classical.choose_spec h_exists).righth_exists: j < k, Nat.nth Nat.Prime j y := (Finset.mem_filter.mp (hs.left y.property)).righth_eq_f:(f x) = (f y) := Eq.mpr (id (congrArg (fun _a => _a = (f y)) heq)) (Eq.refl (f y))this:p = Nat.nth Nat.Prime (Classical.choose h_exists) := id (Eq.mpr (id (congrArg (fun _a => Nat.nth Nat.Prime _a = Nat.nth Nat.Prime (Classical.choose h_exists)) h_eq_f)) (Eq.refl (Nat.nth Nat.Prime (f y))))Nat.nth Nat.Prime (Classical.choose h_exists) y All goals completed! 🐙 N:k:s:Finset hs:s FirstPrimesMultiples N k #s = k + 1f:s Fin k := fun x => match x with | x, hx => have h_exists := ; Classical.choose h_exists, hcard_s:Fintype.card s = k + 1 := of_eq_true (Eq.trans (Eq.trans (congrArg (fun x => x = k + 1) (Eq.trans (Fintype.card_coe s) hs.right)) Nat.add_left_cancel_iff._simp_1) (eq_self 1))hcard_fink:Fintype.card (Fin k) = k := Fintype.card_fin kx:sy:shne:x yheq:f x = f yh_pair:(↑s).Pairwise Nat.Coprimehne_val:x y := fun h_eq => hne (Subtype.ext h_eq)h_coprime:(↑x).Coprime y := h_pair x.property y.property hne_valp: := Nat.nth Nat.Prime (f x)hp_prime:Nat.Prime p := Nat.prime_nth_prime (f x)hp_div_x:p x := have h_exists := (Finset.mem_filter.mp (hs.left x.property)).right; (Classical.choose_spec h_exists).righthp_div_y:p y := have h_exists := (Finset.mem_filter.mp (hs.left y.property)).right; have h_eq_f := Eq.mpr (id (congrArg (fun _a => _a = (f y)) heq)) (Eq.refl (f y)); have this := id (Eq.mpr (id (congrArg (fun _a => Nat.nth Nat.Prime _a = Nat.nth Nat.Prime (Classical.choose h_exists)) h_eq_f)) (Eq.refl (Nat.nth Nat.Prime (f y)))); Eq.mpr (id (congrArg (fun _a => _a y) this)) (Classical.choose_spec h_exists).righthp_div_gcd:p (↑x).gcd y := Nat.dvd_gcd hp_div_x hp_div_yFalse N:k:s:Finset hs:s FirstPrimesMultiples N k #s = k + 1f:s Fin k := fun x => match x with | x, hx => have h_exists := ; Classical.choose h_exists, hcard_s:Fintype.card s = k + 1 := of_eq_true (Eq.trans (Eq.trans (congrArg (fun x => x = k + 1) (Eq.trans (Fintype.card_coe s) hs.right)) Nat.add_left_cancel_iff._simp_1) (eq_self 1))hcard_fink:Fintype.card (Fin k) = k := Fintype.card_fin kx:sy:shne:x yheq:f x = f yh_pair:(↑s).Pairwise Nat.Coprimehne_val:x y := fun h_eq => hne (Subtype.ext h_eq)h_coprime:(↑x).Coprime y := h_pair x.property y.property hne_valp: := Nat.nth Nat.Prime (f x)hp_prime:Nat.Prime p := Nat.prime_nth_prime (f x)hp_div_x:p x := have h_exists := (Finset.mem_filter.mp (hs.left x.property)).right; (Classical.choose_spec h_exists).righthp_div_y:p y := have h_exists := (Finset.mem_filter.mp (hs.left y.property)).right; have h_eq_f := Eq.mpr (id (congrArg (fun _a => _a = (f y)) heq)) (Eq.refl (f y)); have this := id (Eq.mpr (id (congrArg (fun _a => Nat.nth Nat.Prime _a = Nat.nth Nat.Prime (Classical.choose h_exists)) h_eq_f)) (Eq.refl (Nat.nth Nat.Prime (f y)))); Eq.mpr (id (congrArg (fun _a => _a y) this)) (Classical.choose_spec h_exists).righthp_div_gcd:p (↑x).gcd y := Nat.dvd_gcd hp_div_x hp_div_yh_gcd_eq_one:(↑x).gcd y = 1 := h_coprimeFalse N:k:s:Finset hs:s FirstPrimesMultiples N k #s = k + 1f:s Fin k := fun x => match x with | x, hx => have h_exists := ; Classical.choose h_exists, hcard_s:Fintype.card s = k + 1 := of_eq_true (Eq.trans (Eq.trans (congrArg (fun x => x = k + 1) (Eq.trans (Fintype.card_coe s) hs.right)) Nat.add_left_cancel_iff._simp_1) (eq_self 1))hcard_fink:Fintype.card (Fin k) = k := Fintype.card_fin kx:sy:shne:x yheq:f x = f yh_pair:(↑s).Pairwise Nat.Coprimehne_val:x y := fun h_eq => hne (Subtype.ext h_eq)h_coprime:(↑x).Coprime y := h_pair x.property y.property hne_valp: := Nat.nth Nat.Prime (f x)hp_prime:Nat.Prime p := Nat.prime_nth_prime (f x)hp_div_x:p x := have h_exists := (Finset.mem_filter.mp (hs.left x.property)).right; (Classical.choose_spec h_exists).righthp_div_y:p y := have h_exists := (Finset.mem_filter.mp (hs.left y.property)).right; have h_eq_f := Eq.mpr (id (congrArg (fun _a => _a = (f y)) heq)) (Eq.refl (f y)); have this := id (Eq.mpr (id (congrArg (fun _a => Nat.nth Nat.Prime _a = Nat.nth Nat.Prime (Classical.choose h_exists)) h_eq_f)) (Eq.refl (Nat.nth Nat.Prime (f y)))); Eq.mpr (id (congrArg (fun _a => _a y) this)) (Classical.choose_spec h_exists).righthp_div_gcd:p 1h_gcd_eq_one:(↑x).gcd y = 1False have hp_le_one : p 1 := Nat.le_of_dvd (N:k:s:Finset hs:s FirstPrimesMultiples N k #s = k + 1f:s Fin k := fun x => match x with | x, hx => have h_exists := ; Classical.choose h_exists, hcard_s:Fintype.card s = k + 1 := of_eq_true (Eq.trans (Eq.trans (congrArg (fun x => x = k + 1) (Eq.trans (Fintype.card_coe s) hs.right)) Nat.add_left_cancel_iff._simp_1) (eq_self 1))hcard_fink:Fintype.card (Fin k) = k := Fintype.card_fin kx:sy:shne:x yheq:f x = f yh_pair:(↑s).Pairwise Nat.Coprimehne_val:x y := fun h_eq => hne (Subtype.ext h_eq)h_coprime:(↑x).Coprime y := h_pair x.property y.property hne_valp: := Nat.nth Nat.Prime (f x)hp_prime:Nat.Prime p := Nat.prime_nth_prime (f x)hp_div_x:p x := have h_exists := (Finset.mem_filter.mp (hs.left x.property)).right; (Classical.choose_spec h_exists).righthp_div_y:p y := have h_exists := (Finset.mem_filter.mp (hs.left y.property)).right; have h_eq_f := Eq.mpr (id (congrArg (fun _a => _a = (f y)) heq)) (Eq.refl (f y)); have this := id (Eq.mpr (id (congrArg (fun _a => Nat.nth Nat.Prime _a = Nat.nth Nat.Prime (Classical.choose h_exists)) h_eq_f)) (Eq.refl (Nat.nth Nat.Prime (f y)))); Eq.mpr (id (congrArg (fun _a => _a y) this)) (Classical.choose_spec h_exists).righthp_div_gcd:p 1h_gcd_eq_one:(↑x).gcd y = 10 < 1 All goals completed! 🐙) hp_div_gcd N:k:s:Finset hs:s FirstPrimesMultiples N k #s = k + 1f:s Fin k := fun x => match x with | x, hx => have h_exists := ; Classical.choose h_exists, hcard_s:Fintype.card s = k + 1 := of_eq_true (Eq.trans (Eq.trans (congrArg (fun x => x = k + 1) (Eq.trans (Fintype.card_coe s) hs.right)) Nat.add_left_cancel_iff._simp_1) (eq_self 1))hcard_fink:Fintype.card (Fin k) = k := Fintype.card_fin kx:sy:shne:x yheq:f x = f yh_pair:(↑s).Pairwise Nat.Coprimehne_val:x y := fun h_eq => hne (Subtype.ext h_eq)h_coprime:(↑x).Coprime y := h_pair x.property y.property hne_valp: := Nat.nth Nat.Prime (f x)hp_prime:Nat.Prime p := Nat.prime_nth_prime (f x)hp_div_x:p x := have h_exists := (Finset.mem_filter.mp (hs.left x.property)).right; (Classical.choose_spec h_exists).righthp_div_y:p y := have h_exists := (Finset.mem_filter.mp (hs.left y.property)).right; have h_eq_f := Eq.mpr (id (congrArg (fun _a => _a = (f y)) heq)) (Eq.refl (f y)); have this := id (Eq.mpr (id (congrArg (fun _a => Nat.nth Nat.Prime _a = Nat.nth Nat.Prime (Classical.choose h_exists)) h_eq_f)) (Eq.refl (Nat.nth Nat.Prime (f y)))); Eq.mpr (id (congrArg (fun _a => _a y) this)) (Classical.choose_spec h_exists).righthp_div_gcd:p 1h_gcd_eq_one:(↑x).gcd y = 1hp_le_one:p 1 := Nat.le_of_dvd (Mathlib.Meta.NormNum.isNat_lt_true (Mathlib.Meta.NormNum.isNat_ofNat (Eq.refl 0)) (Mathlib.Meta.NormNum.isNat_ofNat (Eq.refl 1)) (Eq.refl false)) hp_div_gcdthis:p > 1 := Nat.Prime.one_lt hp_primeFalse All goals completed! 🐙

Suppose $A \subseteq {1,\dots,N}$ is such that there are no $k+1$ elements of $A$ which are relatively prime. An example is the set of all multiples of the first $k$ primes. Is this the largest such set? To avoid trivial counterexamples, we must insist that $N$ be at least the $k$th prime.

@[category research solved, AMS 11, formal_proof using lean4 at "https://github.com/plby/lean-proofs/blob/main/src/v4.24.0/ErdosProblems/Erdos56.lean"] theorem declaration uses 'sorry'erdos_56 : answer(False) ∀ᵉ (k > 0) (N (k-1).nth Nat.Prime), (MaxWeaklyDivisible N k = (FirstPrimesMultiples N k).card) := False k > 0, N Nat.nth Nat.Prime (k - 1), MaxWeaklyDivisible N k = #(FirstPrimesMultiples N k) All goals completed! 🐙 end Erdos56