/-
Copyright 2026 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 FormalConjecturesUtilSize of smallest subset of ${1, 2, \dots, n}$ with distinct subset sums
Size of the smallest subset $S$ of $T = {1,2,3,\dots,n}$ such that $S \cdot S$ contains $T$, where $S \cdot S$ is the set of all products of elements of $S$.
References:
arxiv/2605.22763 Advancing Mathematics Research with AI-Driven Formal Proof Search by George Tsoukalas et al.
namespace OeisA194806open Finset NatThe set of all products of elements from a Finset S.
def setProd (S : Finset ℕ) : Finset ℕ :=
(S.product S).image fun p : ℕ × ℕ => p.fst * p.sndSize of the smallest subset $S$ of $T = {1,2,3,\dots,n}$ such that $S \cdot S$ contains $T$, where $S \cdot S$ is the set of all products of elements of $S$.
def a (n : ℕ) : ℕ :=
if h : n = 0 then 0
else
let T_n := Icc 1 n
-- The set of subsets $S \subseteq T_n$ such that $T_n \subseteq S \cdot S$.
let valid_subsets : Finset (Finset ℕ) :=
T_n.powerset.filter (fun S : Finset ℕ => T_n ⊆ setProd S)
-- Proof that $T_n$ is guaranteed to be a valid subset, ensuring `valid_subsets` is non-empty.
have T_n_is_valid : T_n ∈ valid_subsets := n:ℕh:¬n = 0T_n:Finset ℕ := Icc 1 nvalid_subsets:Finset (Finset ℕ) := {S ∈ T_n.powerset | T_n ⊆ setProd S}⊢ T_n ∈ valid_subsets
n:ℕh:¬n = 0T_n:Finset ℕ := Icc 1 nvalid_subsets:Finset (Finset ℕ) := {S ∈ T_n.powerset | T_n ⊆ setProd S}⊢ T_n ∈ T_n.powerset ∧ T_n ⊆ setProd T_n
n:ℕh:¬n = 0T_n:Finset ℕ := Icc 1 nvalid_subsets:Finset (Finset ℕ) := {S ∈ T_n.powerset | T_n ⊆ setProd S}⊢ T_n ∈ T_n.powersetn:ℕh:¬n = 0T_n:Finset ℕ := Icc 1 nvalid_subsets:Finset (Finset ℕ) := {S ∈ T_n.powerset | T_n ⊆ setProd S}⊢ T_n ⊆ setProd T_n
-- 1. T_n ∈ T_n.powerset (i.e., T_n ⊆ T_n)
n:ℕh:¬n = 0T_n:Finset ℕ := Icc 1 nvalid_subsets:Finset (Finset ℕ) := {S ∈ T_n.powerset | T_n ⊆ setProd S}⊢ T_n ⊆ T_nn:ℕh:¬n = 0T_n:Finset ℕ := Icc 1 nvalid_subsets:Finset (Finset ℕ) := {S ∈ T_n.powerset | T_n ⊆ setProd S}⊢ T_n ⊆ setProd T_n; n:ℕh:¬n = 0T_n:Finset ℕ := Icc 1 nvalid_subsets:Finset (Finset ℕ) := {S ∈ T_n.powerset | T_n ⊆ setProd S}⊢ T_n ⊆ setProd T_n
-- 2. T_n ⊆ setProd T_n
n:ℕh:¬n = 0T_n:Finset ℕ := Icc 1 nvalid_subsets:Finset (Finset ℕ) := {S ∈ T_n.powerset | T_n ⊆ setProd S}k:ℕhk:k ∈ T_n⊢ k ∈ setProd T_n
n:ℕh:¬n = 0T_n:Finset ℕ := Icc 1 nvalid_subsets:Finset (Finset ℕ) := {S ∈ T_n.powerset | T_n ⊆ setProd S}k:ℕhk:k ∈ T_none_le_n:1 ≤ n⊢ k ∈ setProd T_n
n:ℕh:¬n = 0T_n:Finset ℕ := Icc 1 nvalid_subsets:Finset (Finset ℕ) := {S ∈ T_n.powerset | T_n ⊆ setProd S}k:ℕhk:k ∈ T_none_le_n:1 ≤ nh1:1 ∈ T_n⊢ k ∈ setProd T_n
-- We show k = k * 1 is in setProd T_n
-- setProd T_n is the image of T_n × T_n under multiplication.
n:ℕh:¬n = 0T_n:Finset ℕ := Icc 1 nvalid_subsets:Finset (Finset ℕ) := {S ∈ T_n.powerset | T_n ⊆ setProd S}k:ℕhk:k ∈ T_none_le_n:1 ≤ nh1:1 ∈ T_n⊢ ∃ a b, (a, b) ∈ T_n.product T_n ∧ a * b = k
n:ℕh:¬n = 0T_n:Finset ℕ := Icc 1 nvalid_subsets:Finset (Finset ℕ) := {S ∈ T_n.powerset | T_n ⊆ setProd S}k:ℕhk:k ∈ T_none_le_n:1 ≤ nh1:1 ∈ T_n⊢ (k, 1) ∈ T_n.product T_n ∧ k * 1 = k
n:ℕh:¬n = 0T_n:Finset ℕ := Icc 1 nvalid_subsets:Finset (Finset ℕ) := {S ∈ T_n.powerset | T_n ⊆ setProd S}k:ℕhk:k ∈ T_none_le_n:1 ≤ nh1:1 ∈ T_n⊢ (k, 1) ∈ T_n.product T_nn:ℕh:¬n = 0T_n:Finset ℕ := Icc 1 nvalid_subsets:Finset (Finset ℕ) := {S ∈ T_n.powerset | T_n ⊆ setProd S}k:ℕhk:k ∈ T_none_le_n:1 ≤ nh1:1 ∈ T_n⊢ k * 1 = k
-- Show that (k, 1) ∈ T_n × T_n
n:ℕh:¬n = 0T_n:Finset ℕ := Icc 1 nvalid_subsets:Finset (Finset ℕ) := {S ∈ T_n.powerset | T_n ⊆ setProd S}k:ℕhk:k ∈ T_none_le_n:1 ≤ nh1:1 ∈ T_n⊢ (k, 1) ∈ T_n.product T_n All goals completed! 🐙
-- Show that k * 1 = k
n:ℕh:¬n = 0T_n:Finset ℕ := Icc 1 nvalid_subsets:Finset (Finset ℕ) := {S ∈ T_n.powerset | T_n ⊆ setProd S}k:ℕhk:k ∈ T_none_le_n:1 ≤ nh1:1 ∈ T_n⊢ k * 1 = k All goals completed! 🐙
have h_nonempty : valid_subsets.Nonempty := ⟨T_n, T_n_is_valid⟩
let sizes := valid_subsets.image Finset.card
-- The min' function requires proof that the finset is non-empty.
have h_sizes_nonempty : sizes.Nonempty := h_nonempty.image Finset.card
-- We return the minimum card of all valid subsets.
sizes.min' h_sizes_nonempty@[category test, AMS 11]
lemma a_1 : a 1 = 1 := ⊢ a 1 = 1 All goals completed! 🐙@[category test, AMS 11]
lemma a_2 : a 2 = 2 := ⊢ a 2 = 2 All goals completed! 🐙@[category test, AMS 11]
lemma a_3 : a 3 = 3 := ⊢ a 3 = 3 All goals completed! 🐙@[category test, AMS 11]
lemma a_4 : a 4 = 3 := ⊢ a 4 = 3 All goals completed! 🐙@[category test, AMS 11]
lemma a_5 : a 5 = 4 := ⊢ a 5 = 4 All goals completed! 🐙Is $a(n) / \pi(n)$ bounded as $n \to \infty$? - Robert Israel, Jan 09 2017
A formal proof has been found with the methods described in arxiv/2605.22763.
@[category research solved, AMS 11, formal_proof using formal_conjectures at
"https://github.com/mo271/formal-conjectures/blob/a32396489dcb8f86c3549b93aa358ac6a10a3a1f/FormalConjectures/OEIS/194806.wip.lean#L472"]
theorem a_div_prime_counting_bounded : ∃ C : ℝ,
∀ n : ℕ, 2 ≤ n → (a n : ℝ) / (Nat.primeCounting n : ℝ) ≤ C := ⊢ ∃ C, ∀ (n : ℕ), 2 ≤ n → ↑(OeisA194806.a n) / ↑n.primeCounting ≤ C
All goals completed! 🐙end OeisA194806