/-
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.
-/importFormalConjecturesUtil
Estimate $n_k$ by finding a better upper bound than Cambie's
$n_k \leq k \cdot \operatorname{lcm}(1, \dotsc, k-1)$.
The comparator takes its least common multiple in ℕ and casts the result. Writing the
ascription as ((… ).lcm (fun n : ℕ => n) : ℝ) instead puts it on the Finset.lcm
application, so the coercion lands on n and the lcm is taken in ℝ, where lcm of
non-zero elements is 1 and the whole comparator collapses to k.
Erdős and Selfridge noted that, for $n \ge 2k$ with $k \ge 2$, at least one of the numbers
$n - i$ for $0 \le i < k$ fails to divide $\binom{n}{k}$ ([ErSe83]).
Cambie observed the improved bound
$n_k \le k \cdot \operatorname{lcm}(1, \dotsc, k - 1)$.
The hypothesis 3 ≤ k is necessary here too. At $k = 2$ the right hand side is
$2 \cdot \operatorname{lcm}(1) = 2$, while $n_2 = 4$.
The source writes the bound as $k[2, 3, \dotsc, k-1]$. That agrees with the range used here,
because including $1$ does not change a least common multiple.