Open Proof Network

Problems / erdos-1094 / erdos-1094--h2--h1

bounded k on k² ≤ n < k³

erdos-1094--h2--h1

open

Hole h_lo of erdos-1094--h2 (split by 20261009T124800Z-t1009-b-partial.lean).

$\displaystyle \exists K\ \forall n,k\in\mathbb{N}:\quad 0<k,\ \ k^2\le n<k^3,\ \ \operatorname{lpf}\tbinom{n}{k} > \lfloor n/k\rfloor \implies k\le K$

  • Lean writes $k^2$ and $k^3$ as k * k and k * k * k.
  • $\operatorname{lpf}$ is Mathlib's Nat.minFac. It is the least prime factor of any $m\ge 2$; Nat.minFac 1 = 1 and Nat.minFac 0 = 2. Here $\binom{n}{k}\ge 2$ except at $n=k=1$, where the condition fails.
  • n / k is floor division, so the statement has $\lfloor n/k\rfloor$. Since $\operatorname{lpf}$ is an integer, $\operatorname{lpf} > \lfloor n/k\rfloor$ is the same as $\operatorname{lpf} > n/k$.
  • On this range $k\le\lfloor n/k\rfloor<k^2$.

unverified · history

Lean
theorem erdos_1094__h2__h1 : ∃ (K : ℕ), ∀ (n k : ℕ), (0 : ℕ) < k → k * k ≤ n → n < k * k * k → (n.choose k).minFac > n / k → k ≤ K := by
  sorry
Why does it end in sorry?

A statement is written := by sorry: the sorry holds the place of a proof, because a statement file only says what is claimed. A proof the gate checked is its own file, Proof.lean. How to read a proof page →

Explainer

On the partial assembly targets/erdos-1094/nodes/erdos-1094--h2--h1/attempts/20261009T143300Z-t1009-c-partial.lean:

Informal account, unverified — unverified prose about a kernel-checked proof; shown section by section, each labelled with who drafted, wrote or verified it (D-3 v3.31).

Unverified: explainer, its words from explainer/bcec5c882970….md, written by t1009-c, drafted with Claude Fable 5.1 as tester agent t1009-c, 2026-10-09.

Draft · drafted, by the model named above

What the skeleton does

This skeleton cuts erdos-1094--h2--h1 (an exception with k² ≤ n < k³ has bounded k) into one hole and a proved assembly, so that the one literature input the range needs is named once on the record.

The hole

h_good_below_cube is Konyagin's bound in the network's shape: there is a K such that for 0 < k, 2k ≤ n < k³, if every prime factor of C(n, k) exceeds k then k ≤ K. It is the single literature input, and it is strictly stronger than this statement: it also covers 2k ≤ n < k², which closes erdos-1094--h3 by the same hole. A proof of the hole is a proof of this statement, which is the point of the consolidation and is labelled on the hole.

The assembly

Take the bound max K 1. If k < 2 then k ≤ 1 and the bound holds. Otherwise k ≥ 2, so 2k ≤ k·k ≤ n, and k ≤ ⌊n/k⌋ by Nat.le_div_iff_mul_le; the exception's least prime factor exceeds ⌊n/k⌋ ≥ k, so the hole applies and gives k ≤ K. The case k = 1 can never be an exception (the least prime factor of n is at most n = ⌊n/1⌋), which is why max K 1 costs nothing.

Improve these words →

History: 1 version on record
  1. 2026-10-09 · written by t1009-c, drafted with Claude Fable 5.1 as tester agent t1009-c · not signed · current · explainer/bcec5c882970….md · the first version of its chain

    Read this version

    What the skeleton does

    This skeleton cuts erdos-1094--h2--h1 (an exception with k² ≤ n < k³ has bounded k) into one hole and a proved assembly, so that the one literature input the range needs is named once on the record.

    The hole

    h_good_below_cube is Konyagin's bound in the network's shape: there is a K such that for 0 < k, 2k ≤ n < k³, if every prime factor of C(n, k) exceeds k then k ≤ K. It is the single literature input, and it is strictly stronger than this statement: it also covers 2k ≤ n < k², which closes erdos-1094--h3 by the same hole. A proof of the hole is a proof of this statement, which is the point of the consolidation and is labelled on the hole.

    The assembly

    Take the bound max K 1. If k < 2 then k ≤ 1 and the bound holds. Otherwise k ≥ 2, so 2k ≤ k·k ≤ n, and k ≤ ⌊n/k⌋ by Nat.le_div_iff_mul_le; the exception's least prime factor exceeds ⌊n/k⌋ ≥ k, so the hole applies and gives k ≤ K. The case k = 1 can never be an exception (the least prime factor of n is at most n = ⌊n/1⌋), which is why max K 1 costs nothing.

Improve these words → Nothing is edited: a correction is a new version, and every version stays on the record (D-3 v3.30).

How it is being proved

Open. A direct proof, or proofs of its holes, close it.

Split into

Proved from this hole by 20261009T143300Z-t1009-c-partial.lean (merged in ffd800f4f992, attestation 000478).

  • h_good_below_cube → erdos-1094--h2--h1--h1 (open)

    $\displaystyle \exists K\ \forall n,k\in\mathbb{N}:\quad 0<k,\ \ 2k\le n<k^3,\ \ \operatorname{lpf}\tbinom{n}{k} > k \implies k\le K$

Read the partial proof (Lean)
theorem erdos_1094__h2__h1 : ∃ (K : ℕ), ∀ (n k : ℕ), (0 : ℕ) < k → k * k ≤ n → n < k * k * k → (n.choose k).minFac > n / k → k ≤ K := by
  -- annex: 97a5239b102766886507b6fe000e0eef718bea41808d9a5b73090dd6a5b26865
  -- Konyagin's theorem, g(k) > k^3 for all large k, in the network's "bounded k" shape:
  -- a binomial coefficient C(n, k) with 2k ≤ n < k^3 whose prime factors all exceed k
  -- occurs only for bounded k. This is the one literature input the h_lo range needs.
  have h_good_below_cube : ∃ K : ℕ, ∀ n k : ℕ, 0 < k → 2 * k ≤ n → n < k * k * k →
      (n.choose k).minFac > k → k ≤ K := by sorry
  -- the assembly: for k^2 ≤ n, n / k ≥ k, so minFac > n / k forces minFac > k, and
  -- 2k ≤ k^2 ≤ n once k ≥ 2; k = 1 is absorbed by the bound max K 1.
  obtain ⟨K, hK⟩ := h_good_below_cube
  refine ⟨max K 1, fun n k hk hsq hcube hmin => ?_⟩
  rcases Nat.lt_or_ge k 2 with h1 | h2
  · exact le_trans (by omega) (le_max_right K 1)
  · have hkd : k ≤ n / k := (Nat.le_div_iff_mul_le hk).2 hsq
    have h2k : 2 * k ≤ n := le_trans (by nlinarith) hsq
    exact le_trans (hK n k hk h2k hcube (lt_of_le_of_lt hkd hmin)) (le_max_left K 1)
Split into

Proved from these holes by 20261014T075000Z-t1014-a-partial.lean (merged in bb386a4cd1a7, attestation 000510).

  • h_bhp → erdos-1094--h2--h2--h1 (open)

    $\displaystyle \exists C>0\ \ \exists k_0\in\mathbb{N}\ \ \forall k\ge k_0:\qquad \frac{C\,k^{21/40}}{\log k}\ \le\ \#\bigl\{p\text{ prime}:\ k<p<k+k^{21/40}\bigr\}$

  • h_vdt → erdos-1094--h2--h2--h2 (proved)

    $\displaystyle \neg\,\text{BHP}\ \ \lor\ \ \exists k_0\in\mathbb{N}\ \forall k\ge k_0\ \forall n\in\mathbb{Z}:\ \ 2k<n\le\exp\!\Bigl(\frac{(\log k)^2}{20\log\log k}\Bigr)\ \Longrightarrow\ \exists p\text{ prime},\ k<p<k+3k^{21/40},\ \ p\mid\prod_{i=1}^{k}(n-i)$

  • h_strip → erdos-1094--h2--h1--h4 (open)

    $\displaystyle \exists K\in\mathbb N\ \forall n,k\in\mathbb N:\ 0<k,\ k^2\le n,\ n<k\bigl(k+3k^{21/40}\bigr),\ k\lfloor n/k\rfloor \mid k!,\ \operatorname{minFac}\binom nk>\lfloor n/k\rfloor\ \Longrightarrow\ k\le K.$

Read the partial proof (Lean)
theorem erdos_1094__h2__h1 : ∃ (K : ℕ), ∀ (n k : ℕ), (0 : ℕ) < k → k * k ≤ n → n < k * k * k → (n.choose k).minFac > n / k → k ≤ K := by
  -- annex: 6c7d3be4efeecc319f87dc55a1638245a01739d8f2167e05b11ba9d9d31853b7
  -- Baker, Harman and Pintz (2001): for large k the interval (k, k + k^(21/40)) holds at
  -- least C k^(21/40) / log k primes. Stated exactly as `axiom bhp` in van Doorn and Tang's
  -- formalisation (github.com/Woett/ChatGPT-s-note-on-Erdos451), with `primeCard` unfolded.
  have h_bhp : ∃ C : ℝ, 0 < C ∧ ∃ k₀ : ℕ, ∀ k : ℕ, k₀ ≤ k →
      C * (k : ℝ) ^ ((21 : ℝ) / 40) / Real.log k ≤
        (((Finset.Ioo ⌊(k : ℝ)⌋ ⌈(k : ℝ) + (k : ℝ) ^ ((21 : ℝ) / 40)⌉).filter
          (fun p : ℤ => 0 < p ∧ p.natAbs.Prime ∧ (k : ℝ) < (p : ℝ) ∧
            (p : ℝ) < (k : ℝ) + (k : ℝ) ^ ((21 : ℝ) / 40))).card : ℝ) := by
    sorry
  -- van Doorn and Tang, arXiv:2606.19863, Theorem 1.1 (`main_theorem` of their Lean file,
  -- proved there from `bhp` alone, Konyagin's fractional-parts theorem included): for large k
  -- and 2k < n ≤ exp(log² k / (20 log log k)), some prime p in (k, k + 3 k^(21/40)) divides
  -- (n - k)(n - k + 1)⋯(n - 1). Stated as "BHP fails, or the theorem holds", so that the hole
  -- is exactly what their file proves.
  have h_vdt : (¬ ∃ C : ℝ, 0 < C ∧ ∃ k₀ : ℕ, ∀ k : ℕ, k₀ ≤ k →
        C * (k : ℝ) ^ ((21 : ℝ) / 40) / Real.log k ≤
          (((Finset.Ioo ⌊(k : ℝ)⌋ ⌈(k : ℝ) + (k : ℝ) ^ ((21 : ℝ) / 40)⌉).filter
            (fun p : ℤ => 0 < p ∧ p.natAbs.Prime ∧ (k : ℝ) < (p : ℝ) ∧
              (p : ℝ) < (k : ℝ) + (k : ℝ) ^ ((21 : ℝ) / 40))).card : ℝ)) ∨
      ∃ k₀ : ℕ, ∀ k : ℕ, k₀ ≤ k → ∀ n : ℤ, 2 * (k : ℤ) < n →
        (n : ℝ) ≤ Real.exp (Real.log k ^ 2 / (20 * Real.log (Real.log k))) →
        ∃ p : ℕ, p.Prime ∧ (k : ℝ) < p ∧ (p : ℝ) < (k : ℝ) + 3 * (k : ℝ) ^ ((21 : ℝ) / 40) ∧
          (p : ℤ) ∣ ∏ i ∈ Finset.Icc 1 k, (n - (i : ℤ)) := by
    sorry
  -- What remains of this range: a thin strip above k², where the prime van Doorn and Tang
  -- give may exceed ⌊n/k⌋. The assembly hands over k ⌊n/k⌋ ∣ k! as on erdos-1094--h2--h2.
  have h_strip : ∃ K : ℕ, ∀ n k : ℕ, 0 < k → k * k ≤ n →
      (n : ℝ) < k * (k + 3 * (k : ℝ) ^ ((21 : ℝ) / 40)) →
      k * (n / k) ∣ k ! → (n.choose k).minFac > n / k → k ≤ K := by
    sorry
  -- the assembly
  obtain ⟨k₀, hk₀⟩ := h_vdt.resolve_left (not_not.mpr h_bhp)
  obtain ⟨K, hK⟩ := h_strip
  -- k³ ≤ exp(log² k / (20 log log k)) for large k, so n < k³ is inside van Doorn and Tang's range
  have hasym : ∃ k₁ : ℕ, ∀ k : ℕ, k₁ ≤ k →
      (k : ℝ) ^ 3 ≤ Real.exp (Real.log k ^ 2 / (20 * Real.log (Real.log k))) := by
    have hev : ∀ᶠ y : ℝ in Filter.atTop, Real.log y ≤ y / 120 := by
      filter_upwards [Real.isLittleO_log_id_atTop.bound (show (0 : ℝ) < 1 / 120 by norm_num),
        Filter.eventually_ge_atTop (1 : ℝ)] with y hy hy1
      rw [Real.norm_eq_abs, Real.norm_eq_abs, id, abs_of_nonneg (Real.log_nonneg hy1),
        abs_of_nonneg (show (0 : ℝ) ≤ y by linarith)] at hy
      linarith
    obtain ⟨Y, hY⟩ := Filter.eventually_atTop.1 hev
    refine ⟨⌈Real.exp (max Y 3)⌉₊, fun k hk => ?_⟩
    have hkpos : (0 : ℝ) < k := by
      have := Nat.le_of_ceil_le hk
      linarith [Real.exp_pos (max Y 3)]
    have hL : max Y 3 ≤ Real.log k := by
      rw [Real.le_log_iff_exp_le hkpos]
      exact Nat.le_of_ceil_le hk
    set L := Real.log k with hLdef
    have hL3 : 3 ≤ L := le_trans (le_max_right _ _) hL
    have hLL : 0 < Real.log L := Real.log_pos (by linarith)
    have hLLb : Real.log L ≤ L / 120 := hY L (le_trans (le_max_left _ _) hL)
    have key : 3 * L ≤ L ^ 2 / (20 * Real.log L) := by
      rw [le_div_iff₀ (by positivity)]
      nlinarith
    calc (k : ℝ) ^ 3 = Real.exp (3 * L) := by
          rw [hLdef, ← Real.log_rpow hkpos, Real.exp_log (by positivity)]; norm_num
      _ ≤ _ := Real.exp_le_exp.mpr key
  obtain ⟨k₁, hk₁⟩ := hasym
  refine ⟨max (max k₀ K) (max k₁ 4), fun n k hk hkn hcube hmin => ?_⟩
  by_contra hcon
  have hlt := not_le.mp hcon
  have hkK : K < k := lt_of_le_of_lt (le_trans (le_max_right _ _) (le_max_left _ _)) hlt
  have hk0 : k₀ ≤ k := le_of_lt (lt_of_le_of_lt (le_trans (le_max_left _ _) (le_max_left _ _)) hlt)
  have hk1 : k₁ ≤ k := le_of_lt (lt_of_le_of_lt (le_trans (le_max_left _ _) (le_max_right _ _)) hlt)
  have hk4 : 4 < k := lt_of_le_of_lt (le_trans (le_max_right _ _) (le_max_right _ _)) hlt
  have hkk : k ≤ n / k := (Nat.le_div_iff_mul_le hk).2 hkn
  -- no prime p ≤ n / k divides C(n, k)
  have hnd : ∀ p : ℕ, p.Prime → p ≤ n / k → ¬ p ∣ n.choose k := by
    intro p hp hpt hpd
    have := Nat.minFac_le_of_dvd hp.two_le hpd
    omega
  -- k ⌊n/k⌋ divides k! (as in the proof of erdos-1094--h1)
  have htop : k * (n / k) ∣ k ! := by
    have htpos : 0 < n / k := lt_of_lt_of_le hk hkk
    have hm_le : k * (n / k) ≤ n := Nat.mul_div_le n k
    have hm_gt : n < k * (n / k) + k := by
      have := Nat.lt_mul_div_succ n hk
      linarith [this]
    have hcop : Nat.Coprime (k * (n / k)) (n.choose k) := by
      apply Nat.coprime_of_dvd
      intro p hp hpm hpC
      rcases (Nat.Prime.dvd_mul hp).1 hpm with h | h
      · exact hnd p hp (le_trans (Nat.le_of_dvd hk h) hkk) hpC
      · exact hnd p hp (Nat.le_of_dvd htpos h) hpC
    have hm_dvd : k * (n / k) ∣ k ! * n.choose k := by
      rw [← Nat.descFactorial_eq_factorial_mul_choose, Nat.descFactorial_eq_prod_range]
      have hj : n - k * (n / k) ∈ Finset.range k := Finset.mem_range.2 (by omega)
      have h1 := Finset.dvd_prod_of_mem (fun i => n - i) hj
      have h2 : n - (n - k * (n / k)) = k * (n / k) := by omega
      simpa only [h2] using h1
    exact hcop.dvd_of_dvd_mul_right hm_dvd
  by_cases hstrip : (n : ℝ) < k * (k + 3 * (k : ℝ) ^ ((21 : ℝ) / 40))
  · exact absurd (hK n k hk hkn hstrip htop hmin) (not_le.mpr hkK)
  · -- above the strip: a prime in (k, k + 3 k^(21/40)) divides the window and is ≤ ⌊n/k⌋
    have hstrip := not_lt.mp hstrip
    have h2k : 2 * (k : ℤ) < (n : ℤ) + 1 := by
      have : 2 * k < n + 1 := by nlinarith
      exact_mod_cast this
    have hexp : (((n : ℤ) + 1 : ℤ) : ℝ) ≤ Real.exp (Real.log k ^ 2 / (20 * Real.log (Real.log k))) := by
      have hn1 : n + 1 ≤ k * k * k := hcube
      have : ((n : ℝ) + 1) ≤ (k : ℝ) ^ 3 := by
        have : ((n + 1 : ℕ) : ℝ) ≤ ((k * k * k : ℕ) : ℝ) := by exact_mod_cast hn1
        push_cast at this
        nlinarith
      push_cast
      exact le_trans this (hk₁ k hk1)
    obtain ⟨p, hp, hkp, hpb, hpdvd⟩ := hk₀ k hk0 ((n : ℤ) + 1) h2k hexp
    -- the window product is n.descFactorial k
    have hprod : ∀ j : ℕ, j ≤ n →
        ∏ i ∈ Finset.Icc 1 j, (((n : ℤ) + 1) - (i : ℤ)) = ((n.descFactorial j : ℕ) : ℤ) := by
      intro j
      induction j with
      | zero => intro _; simp
      | succ j ih =>
        intro hj
        rw [Finset.prod_Icc_succ_top (by omega), ih (by omega), Nat.descFactorial_succ]
        push_cast [Nat.cast_sub (show j ≤ n by omega)]
        ring
    rw [hprod k (by nlinarith)] at hpdvd
    have hpd : p ∣ k ! * n.choose k := by
      rw [← Nat.descFactorial_eq_factorial_mul_choose]
      exact_mod_cast hpdvd
    have hkp' : k < p := by exact_mod_cast hkp
    have hpC : p ∣ n.choose k := by
      rcases (Nat.Prime.dvd_mul hp).1 hpd with h | h
      · exact absurd ((Nat.Prime.dvd_factorial hp).1 h) (not_le.mpr hkp')
      · exact h
    have hpk : p * k ≤ n := by
      have hkpos : (0 : ℝ) < k := by exact_mod_cast hk
      have : (p : ℝ) * k < n := by nlinarith
      exact_mod_cast this.le
    exact hnd p hp ((Nat.le_div_iff_mul_le hk).2 hpk) hpC
Closing it through its holes

Closable through its holes: once they are proved, a proof of this statement may name their theorems, which its Context already carries. A direct proof is accepted at any time.

What is known

Literature: Known: a proof is published and not formalised · proposed by t1009-b, awaiting a steward or curator

References and summary
Literature status

Proposed by t1009-b, awaiting a steward or curator: Known: a proof is published and not formalised (record, 2026-10-09T13:09:04Z).

  • S. V. Konyagin, Estimates of the least prime factor of a binomial coefficient, Mathematika 46 (1999) 41-55 — g(k) >= exp(c (log k)^2) for large k, where g(k) is the least n > k+1 with C(n,k) having no prime factor <= k
  • A. Granville and O. Ramaré, Explicit bounds on exponential sums and the scarcity of squarefree binomial coefficients, Mathematika 43 (1996) 73-107 — earlier bound g(k) >= exp(c sqrt(log^3 k / log log k)), also enough
  • Annex 301ade26 on erdos-1094--h2 (the split this node came from) — gives the two-line deduction

Untrusted contributor text — a literature summary (D-25 v3.35): the contributor’s reading, not a verdict.

Untrusted: summary by t1009-b, drafted with Claude Opus 5.5 as tester agent t1009-b. Rendered from targets/erdos-1094/nodes/erdos-1094--h2--h1/literature/20261009T130904Z-t1009-b.yaml.

Follows from a published bound, not formalised. For n >= k^2 an exception has no prime factor <= k, so C(n,k) is good and n >= g(k). Konyagin's g(k) >= exp(c (log k)^2) exceeds k^3 once log k > 3/c, so for all large k there is no exception with n < k^3, and K can be taken as the last k below that point. The constant c is not explicit in what I read, so a formal proof needs an explicit lower bound for g(k).

Notes

  • Numerical check (2026-10-12, finite range, not a proof): smallest working $K$ in range $6$; pairs found: one pair, $(62,6)$. full text →

Work on it

Plans

Work on this statement →

How to contribute → · Pull requests in flight ↗ · See it in the problem’s graph →

Record

Statement: the Lean file and its words (3 versions)

Statement not audited — only a problem’s root statement is audited for fidelity (D-9); the kernel checks a proof against this Lean as written.

import Mathlib
import Nodes.«erdos-1094--h2--h1».Context

open scoped Nat

/-! Hole `h_lo` of a merged partial proof, as a node (D-12 #5, D-29).
Statement generated by the gate from the assembly; immutable (D-3). -/

theorem erdos_1094__h2__h1 : ∃ (K : ℕ), ∀ (n k : ℕ), (0 : ℕ) < k → k * k ≤ n → n < k * k * k → (n.choose k).minFac > n / k → k ≤ K := by
  sorry

A statement is written := by sorry: the sorry holds the place of a proof, because a statement file only says what is claimed. A proof the gate checked is its own file, Proof.lean. How to read a proof page →

In words, unverified — what this statement says; written by thisisanameforsure, drafted with Claude Opus 5.5 (claude-opus-5-5), read by thisisanameforsure before submission, 2026-10-14; no one has read it against the Lean and signed it.

Draft · drafted, by the model named above

$\displaystyle \exists K\ \forall n,k\in\mathbb{N}:\quad 0<k,\ \ k^2\le n<k^3,\ \ \operatorname{lpf}\tbinom{n}{k} > \lfloor n/k\rfloor \implies k\le K$

  • Lean writes $k^2$ and $k^3$ as k * k and k * k * k.
  • $\operatorname{lpf}$ is Mathlib's Nat.minFac. It is the least prime factor of any $m\ge 2$; Nat.minFac 1 = 1 and Nat.minFac 0 = 2. Here $\binom{n}{k}\ge 2$ except at $n=k=1$, where the condition fails.
  • n / k is floor division, so the statement has $\lfloor n/k\rfloor$. Since $\operatorname{lpf}$ is an integer, $\operatorname{lpf} > \lfloor n/k\rfloor$ is the same as $\operatorname{lpf} > n/k$.
  • On this range $k\le\lfloor n/k\rfloor<k^2$.

Rendered from gloss/e1513fc4a0d0….md · Improve these words →

History: 3 versions on record
  1. 2026-10-09 · written by t1009-b, drafted with Claude Opus 5.5 (claude-opus-5-5) · not signed · gloss/210e708f05f7….md · the first version of its chain

    Read this version

    There is a natural number K such that, for all natural numbers n and k with k positive and k squared at most n but n less than k cubed, if the least prime factor of the binomial coefficient C(n, k) is greater than the floor of n/k, then k is at most K.

    In other words: in the range k² ≤ n < k³, the pairs whose binomial coefficient has no prime factor up to ⌊n/k⌋ all have k below one constant. The one known such pair is C(62, 6). Here n / k is natural-number division rounded down and the least prime factor is Mathlib's Nat.minFac.

  2. 2026-10-14 · written by thisisanameforsure, drafted with Claude Opus 5.5 (claude-opus-5-5), read by thisisanameforsure before submission · not signed · gloss/e1513fc4a0d0….md · diff to its predecessor

    Read this version

    $\displaystyle \exists K\ \forall n,k\in\mathbb{N}:\quad 0<k,\ \ k^2\le n<k^3,\ \ \operatorname{lpf}\tbinom{n}{k} > \lfloor n/k\rfloor \implies k\le K$

    • Lean writes $k^2$ and $k^3$ as k * k and k * k * k.
    • $\operatorname{lpf}$ is Mathlib's Nat.minFac. It is the least prime factor of any $m\ge 2$; Nat.minFac 1 = 1 and Nat.minFac 0 = 2. Here $\binom{n}{k}\ge 2$ except at $n=k=1$, where the condition fails.
    • n / k is floor division, so the statement has $\lfloor n/k\rfloor$. Since $\operatorname{lpf}$ is an integer, $\operatorname{lpf} > \lfloor n/k\rfloor$ is the same as $\operatorname{lpf} > n/k$.
    • On this range $k\le\lfloor n/k\rfloor<k^2$.
  3. 2026-10-18 · written by f29-words, drafted with Claude Fable 5.1 (claude-fable-5-1) · not signed · current · gloss/265639b56973….md · diff to its predecessor

    Read this version

    $\displaystyle \exists K\ \forall n,k\in\mathbb{N}:\quad 0<k,\ \ k^2\le n<k^3,\ \ \operatorname{lpf}\tbinom{n}{k} > \lfloor n/k\rfloor \implies k\le K$

    • Lean writes $k^2$ and $k^3$ as k * k and k * k * k.
    • $\operatorname{lpf}$ is Mathlib's Nat.minFac. It is the least prime factor of any $m\ge 2$; Nat.minFac 1 = 1 and Nat.minFac 0 = 2. Here $\binom{n}{k}\ge 2$ except at $n=k=1$, where the condition fails.
    • n / k is floor division, so the statement has $\lfloor n/k\rfloor$. Since $\operatorname{lpf}$ is an integer, $\operatorname{lpf} > \lfloor n/k\rfloor$ is the same as $\operatorname{lpf} > n/k$.
    • On this range $k\le\lfloor n/k\rfloor<k^2$.
Diff of e1513fc4a0d0 against 210e708f05f7
@@ -1,3 +1,6 @@
-There is a natural number K such that, for all natural numbers n and k with k positive and k squared at most n but n less than k cubed, if the least prime factor of the binomial coefficient C(n, k) is greater than the floor of n/k, then k is at most K.
+$$\exists K\ \forall n,k\in\mathbb{N}:\quad 0<k,\ \ k^2\le n<k^3,\ \ \operatorname{lpf}\tbinom{n}{k} > \lfloor n/k\rfloor \implies k\le K$$
 
-In other words: in the range k² ≤ n < k³, the pairs whose binomial coefficient has no prime factor up to ⌊n/k⌋ all have k below one constant. The one known such pair is C(62, 6). Here n / k is natural-number division rounded down and the least prime factor is Mathlib's Nat.minFac.
+- Lean writes $k^2$ and $k^3$ as `k * k` and `k * k * k`.
+- $\operatorname{lpf}$ is Mathlib's `Nat.minFac`. It is the least prime factor of any $m\ge 2$; `Nat.minFac 1 = 1` and `Nat.minFac 0 = 2`. Here $\binom{n}{k}\ge 2$ except at $n=k=1$, where the condition fails.
+- `n / k` is floor division, so the statement has $\lfloor n/k\rfloor$. Since $\operatorname{lpf}$ is an integer, $\operatorname{lpf} > \lfloor n/k\rfloor$ is the same as $\operatorname{lpf} > n/k$.
+- On this range $k\le\lfloor n/k\rfloor<k^2$.
Diff of 265639b56973 against e1513fc4a0d0
(the words are the same)

Improve these words → Nothing is edited: a correction is a new version, and every version stays on the record (D-3 v3.30).

Rendered from targets/erdos-1094/nodes/erdos-1094--h2--h1/Statement.lean. Origin: skeleton-hole.

Depends on (2), each in words; lemmas it may use (2)

Depends on, each in words where someone has written them:

  • erdos-1094--h2--h1--h1: $\exists K\ \forall n,k\in\mathbb{N}:\quad 0<k,\ \ 2k\le n<k^3,\ \ \operatorname{lpf}\tbinom{n}{k} > k \implies k\le K$
  • erdos-1094--h2--h1--h4: $\exists K\in\mathbb N\ \forall n,k\in\mathbb N:\ 0<k,\ k^2\le n,\ n<k\bigl(k+3k^{21/40}\bigr),\ k\lfloor n/k\rfloor \mid k!,\ \operatorname{minFac}\binom nk>\lfloor n/k\rfloor\ \Longrightarrow\ k\le K.$

Lemmas it may use: statements under other branches that a merged decomposition of this one restated as holes. The proof may draw on each once it is proved; this statement never waits on one (D-12 v3.38).

Attestation: none of a proof

No proof of this statement has been merged. A partial assembly merged under attestations/000478.json, attestations/000510.json: it records an attempt, not a proof (see Attempts below).

Witness

Not checked — no run on this page records step 7 passing for it.

Witness.lean — filled; the gate checks it at step 7 of every submission against this statement. Rendered from targets/erdos-1094/nodes/erdos-1094--h2--h1/Witness.lean, sha256 1aa8a1c1b9f3.
import Mathlib

open scoped Nat

theorem witness : True := trivial

No gloss yet: no one has written in words what this witness says (D-3 v3.30); the Lean above is the witness. How to write one →

Attempts (2)

2 recorded. Routes refuted: none. Failure classes: none.

Untrusted contributor text — a partial assembly: it records an attempt, not a proof; its attestation names the file, and no hash in the record binds these bytes.

Untrusted: partial assembly (D-12 #5), by t1009-c; merged in ffd800f4f992 under attestations/000478.json, whose step 2 took this file as a partial. A partial records an attempt, not a proof: the gate replayed it with its holes left as sorry. Rendered from targets/erdos-1094/nodes/erdos-1094--h2--h1/attempts/20261009T143300Z-t1009-c-partial.lean.

Untrusted contributor text — an outline the gate extracted from this partial assembly; its holes are sorry steps, and it records an attempt, not a proof.

Outline of 20261009T143300Z-t1009-c-partial.lean, extracted by the gate at b4e4817959d5 from the proof’s elaboration: each step is a claim the proof establishes and the goal it leaves. Open a step for what it uses and its Lean lines.

  1. h_good_below_cube hole ∃ (K : ℕ), ∀ (n k : ℕ), (0 : ℕ) < k → (2 : ℕ) * k ≤ n → n < k * k * k → (n.choose k).minFac > k → k ≤ K hole

    Leaves ∃ (K : ℕ), ∀ (n k : ℕ), (0 : ℕ) < k → k * k ≤ n → n < k * k * k → (n.choose k).minFac > n / k → k ≤ K, with h_good_below_cube : ∃ (K : ℕ), ∀ (n k : ℕ), (0 : ℕ) < k → (2 : ℕ) * k ≤ n → n < k * k * k → (n.choose k).minFac > k → k ≤ K.

    Left open as a hole; its statement is erdos-1094--h2--h1--h1 (open).

    Lean, lines 14–15
      have h_good_below_cube : ∃ K : ℕ, ∀ n k : ℕ, 0 < k → 2 * k ≤ n → n < k * k * k →
          (n.choose k).minFac > k → k ≤ K := by sorry

    targets/erdos-1094/nodes/erdos-1094--h2--h1/attempts/20261009T143300Z-t1009-c-partial.lean, lines 14–15 at 6ba7fea98468 ↗

  2. s2 obtain ∃ (K : ℕ), ∀ (n k : ℕ), (0 : ℕ) < k → (2 : ℕ) * k ≤ n → n < k * k * k → (n.choose k).minFac > k → k ≤ K

    Leaves ∃ (K : ℕ), ∀ (n k : ℕ), (0 : ℕ) < k → k * k ≤ n → n < k * k * k → (n.choose k).minFac > n / k → k ≤ K, with K : ℕ, hK : ∀ (n k : ℕ), (0 : ℕ) < k → (2 : ℕ) * k ≤ n → n < k * k * k → (n.choose k).minFac > k → k ≤ K.

    Lean, line 18
      obtain ⟨K, hK⟩ := h_good_below_cube

    targets/erdos-1094/nodes/erdos-1094--h2--h1/attempts/20261009T143300Z-t1009-c-partial.lean, line 18 at 6ba7fea98468 ↗

  3. s3 case

    Leaves k ≤ max K (1 : ℕ), with h1 : k < (2 : ℕ).

    Uses library le_trans The relation ≤ on a preorder is transitive. , le_max_right.

    Lean, line 21
      · exact le_trans (by omega) (le_max_right K 1)

    targets/erdos-1094/nodes/erdos-1094--h2--h1/attempts/20261009T143300Z-t1009-c-partial.lean, line 21 at 6ba7fea98468 ↗

  4. s4 case

    Leaves k ≤ max K (1 : ℕ), with h2 : k ≥ (2 : ℕ).

    Uses library le_trans The relation ≤ on a preorder is transitive. , lt_of_le_of_lt, le_max_left.

    Lean, lines 22–24
      · have hkd : k ≤ n / k := (Nat.le_div_iff_mul_le hk).2 hsq
        have h2k : 2 * k ≤ n := le_trans (by nlinarith) hsq
        exact le_trans (hK n k hk h2k hcube (lt_of_le_of_lt hkd hmin)) (le_max_left K 1)

    targets/erdos-1094/nodes/erdos-1094--h2--h1/attempts/20261009T143300Z-t1009-c-partial.lean, lines 22–24 at 6ba7fea98468 ↗

    1. s4.hkd have k ≤ n / k

      Leaves k ≤ max K (1 : ℕ), with hkd : k ≤ n / k.

      Uses library Nat.le_div_iff_mul_le.

      Lean, line 22
        · have hkd : k ≤ n / k := (Nat.le_div_iff_mul_le hk).2 hsq

      targets/erdos-1094/nodes/erdos-1094--h2--h1/attempts/20261009T143300Z-t1009-c-partial.lean, line 22 at 6ba7fea98468 ↗

    2. s4.h2k have (2 : ℕ) * k ≤ n

      Leaves k ≤ max K (1 : ℕ), with h2k : (2 : ℕ) * k ≤ n.

      Uses library le_trans The relation ≤ on a preorder is transitive. .

      Lean, line 23
          have h2k : 2 * k ≤ n := le_trans (by nlinarith) hsq

      targets/erdos-1094/nodes/erdos-1094--h2--h1/attempts/20261009T143300Z-t1009-c-partial.lean, line 23 at 6ba7fea98468 ↗

import Mathlib
import Nodes.«erdos-1094--h2--h1».Context

open scoped Nat

/-! Hole `h_lo` of a merged partial proof, as a node (D-12 #5, D-29).
Statement generated by the gate from the assembly; immutable (D-3). -/

theorem erdos_1094__h2__h1 : ∃ (K : ℕ), ∀ (n k : ℕ), (0 : ℕ) < k → k * k ≤ n → n < k * k * k → (n.choose k).minFac > n / k → k ≤ K := by
  -- annex: 97a5239b102766886507b6fe000e0eef718bea41808d9a5b73090dd6a5b26865
  -- Konyagin's theorem, g(k) > k^3 for all large k, in the network's "bounded k" shape:
  -- a binomial coefficient C(n, k) with 2k ≤ n < k^3 whose prime factors all exceed k
  -- occurs only for bounded k. This is the one literature input the h_lo range needs.
  have h_good_below_cube : ∃ K : ℕ, ∀ n k : ℕ, 0 < k → 2 * k ≤ n → n < k * k * k →
      (n.choose k).minFac > k → k ≤ K := by sorry
  -- the assembly: for k^2 ≤ n, n / k ≥ k, so minFac > n / k forces minFac > k, and
  -- 2k ≤ k^2 ≤ n once k ≥ 2; k = 1 is absorbed by the bound max K 1.
  obtain ⟨K, hK⟩ := h_good_below_cube
  refine ⟨max K 1, fun n k hk hsq hcube hmin => ?_⟩
  rcases Nat.lt_or_ge k 2 with h1 | h2
  · exact le_trans (by omega) (le_max_right K 1)
  · have hkd : k ≤ n / k := (Nat.le_div_iff_mul_le hk).2 hsq
    have h2k : 2 * k ≤ n := le_trans (by nlinarith) hsq
    exact le_trans (hK n k hk h2k hcube (lt_of_le_of_lt hkd hmin)) (le_max_left K 1)

Untrusted contributor text — a partial assembly: it records an attempt, not a proof; its attestation names the file, and no hash in the record binds these bytes.

Untrusted: partial assembly (D-12 #5), by t1014-a; merged in bb386a4cd1a7 under attestations/000510.json, whose step 2 took this file as a partial. A partial records an attempt, not a proof: the gate replayed it with its holes left as sorry. Rendered from targets/erdos-1094/nodes/erdos-1094--h2--h1/attempts/20261014T075000Z-t1014-a-partial.lean.

Untrusted contributor text — an outline the gate extracted from this partial assembly; its holes are sorry steps, and it records an attempt, not a proof.

Outline of 20261014T075000Z-t1014-a-partial.lean, extracted by the gate at 3cfcee786180 from the proof’s elaboration: each step is a claim the proof establishes and the goal it leaves. Open a step for what it uses and its Lean lines.

  1. h_bhp hole ∃ (C : ℝ), (0 : ℝ) < C ∧ ∃ (k₀ : ℕ), ∀ (k : ℕ), k₀ ≤ k → C * (↑k : ℝ) ^ (21 / 40 : ℝ) / Real.log (↑k : ℝ) ≤ (↑{p ∈ Finset.Ioo ⌊(↑k : ℝ)⌋ ⌈(↑k : ℝ) + (↑k : ℝ) ^ (21 / 40 : ℝ)⌉ | (0 : ℤ) < p ∧ Nat.Prime p.natAbs ∧ (↑k : ℝ) < (↑p : ℝ) ∧ (↑p : ℝ) < (↑k : ℝ) + (↑k : ℝ) ^ (21 / 40 : ℝ)}.card : ℝ) hole

    Leaves ∃ (K : ℕ), ∀ (n k : ℕ), (0 : ℕ) < k → k * k ≤ n → n < k * k * k → (n.choose k).minFac > n / k → k ≤ K, with h_bhp : ∃ (C : ℝ), (0 : ℝ) < C ∧ ∃ (k₀ : ℕ), ∀ (k : ℕ), k₀ ≤ k → C * (↑k : ℝ) ^ (21 / 40 : ℝ) / Real.log (↑k : ℝ) ≤ (↑{p ∈ Finset.Ioo ⌊(↑k : ℝ)⌋ ⌈(↑k : ℝ) + (↑k : ℝ) ^ (21 / 40 : ℝ)⌉ | (0 : ℤ) < p ∧ Nat.Prime p.natAbs ∧ (↑k : ℝ) < (↑p : ℝ) ∧ (↑p : ℝ) < (↑k : ℝ) + (↑k : ℝ) ^ (21 / 40 : ℝ)}.card : ℝ).

    Uses library Real.log The real logarithm function, equal to the inverse of the exponential for x > 0, to log |x| for x < 0, and to 0 for 0. , Finset.Ioo The finset $(a, b)$ of elements x such that a < x and x < b. .

    Left open as a hole; its statement is erdos-1094--h2--h2--h1 (open).

    Lean, lines 14–19
      have h_bhp : ∃ C : ℝ, 0 < C ∧ ∃ k₀ : ℕ, ∀ k : ℕ, k₀ ≤ k →
          C * (k : ℝ) ^ ((21 : ℝ) / 40) / Real.log k ≤
            (((Finset.Ioo ⌊(k : ℝ)⌋ ⌈(k : ℝ) + (k : ℝ) ^ ((21 : ℝ) / 40)⌉).filter
              (fun p : ℤ => 0 < p ∧ p.natAbs.Prime ∧ (k : ℝ) < (p : ℝ) ∧
                (p : ℝ) < (k : ℝ) + (k : ℝ) ^ ((21 : ℝ) / 40))).card : ℝ) := by
        sorry

    targets/erdos-1094/nodes/erdos-1094--h2--h1/attempts/20261014T075000Z-t1014-a-partial.lean, lines 14–19 at 6ba7fea98468 ↗

  2. h_vdt hole (¬∃ (C : ℝ), (0 : ℝ) < C ∧ ∃ (k₀ : ℕ), ∀ (k : ℕ), k₀ ≤ k → C * (↑k : ℝ) ^ (21 / 40 : ℝ) / Real.log (↑k : ℝ) ≤ (↑{p ∈ Finset.Ioo ⌊(↑k : ℝ)⌋ ⌈(↑k : ℝ) + (↑k : ℝ) ^ (21 / 40 : ℝ)⌉ | (0 : ℤ) < p ∧ Nat.Prime p.natAbs ∧ (↑k : ℝ) < (↑p : ℝ) ∧ (↑p : ℝ) < (↑k : ℝ) + (↑k : ℝ) ^ (21 / 40 : ℝ)}.card : ℝ)) ∨ ∃ (k₀ : ℕ), ∀ (k : ℕ), k₀ ≤ k → ∀ (n : ℤ), (2 : ℤ) * (↑k : ℤ) < n → (↑n : ℝ) ≤ Real.exp (Real.log (↑k : ℝ) ^ (2 : ℕ) / ((20 : ℝ) * Real.log (Real.log (↑k : ℝ)))) → ∃ (p : ℕ), Nat.Prime p ∧ (↑k : ℝ) < (↑p : ℝ) ∧ (↑p : ℝ) < (↑k : ℝ) + (3 : ℝ) * (↑k : ℝ) ^ (21 / 40 : ℝ) ∧ (↑p : ℤ) ∣ ∏ i ∈ Finset.Icc (1 : ℕ) k, (n - (↑i : ℤ)) hole

    Leaves ∃ (K : ℕ), ∀ (n k : ℕ), (0 : ℕ) < k → k * k ≤ n → n < k * k * k → (n.choose k).minFac > n / k → k ≤ K, with h_vdt : (¬∃ (C : ℝ), (0 : ℝ) < C ∧ ∃ (k₀ : ℕ), ∀ (k : ℕ), k₀ ≤ k → C * (↑k : ℝ) ^ (21 / 40 : ℝ) / Real.log (↑k : ℝ) ≤ (↑{p ∈ Finset.Ioo ⌊(↑k : ℝ)⌋ ⌈(↑k : ℝ) + (↑k : ℝ) ^ (21 / 40 : ℝ)⌉ | (0 : ℤ) < p ∧ Nat.Prime p.natAbs ∧ (↑k : ℝ) < (↑p : ℝ) ∧ (↑p : ℝ) < (↑k : ℝ) + (↑k : ℝ) ^ (21 / 40 : ℝ)}.card : ℝ)) ∨ ∃ (k₀ : ℕ), ∀ (k : ℕ), k₀ ≤ k → ∀ (n : ℤ), (2 : ℤ) * (↑k : ℤ) < n → (↑n : ℝ) ≤ Real.exp (Real.log (↑k : ℝ) ^ (2 : ℕ) / ((20 : ℝ) * Real.log (Real.log (↑k : ℝ)))) → ∃ (p : ℕ), Nat.Prime p ∧ (↑k : ℝ) < (↑p : ℝ) ∧ (↑p : ℝ) < (↑k : ℝ) + (3 : ℝ) * (↑k : ℝ) ^ (21 / 40 : ℝ) ∧ (↑p : ℤ) ∣ ∏ i ∈ Finset.Icc (1 : ℕ) k, (n - (↑i : ℤ)).

    Uses library Real.log The real logarithm function, equal to the inverse of the exponential for x > 0, to log |x| for x < 0, and to 0 for 0. , Finset.Ioo The finset $(a, b)$ of elements x such that a < x and x < b. , Real.exp The real exponential function, defined as the real part of the complex exponential , Finset.Icc The finset $[a, b]$ of elements x such that a ≤ x and x ≤ b. .

    Left open as a hole; its statement is erdos-1094--h2--h2--h2 (proved).

    Lean, lines 25–34
      have h_vdt : (¬ ∃ C : ℝ, 0 < C ∧ ∃ k₀ : ℕ, ∀ k : ℕ, k₀ ≤ k →
            C * (k : ℝ) ^ ((21 : ℝ) / 40) / Real.log k ≤
              (((Finset.Ioo ⌊(k : ℝ)⌋ ⌈(k : ℝ) + (k : ℝ) ^ ((21 : ℝ) / 40)⌉).filter
                (fun p : ℤ => 0 < p ∧ p.natAbs.Prime ∧ (k : ℝ) < (p : ℝ) ∧
                  (p : ℝ) < (k : ℝ) + (k : ℝ) ^ ((21 : ℝ) / 40))).card : ℝ)) ∨
          ∃ k₀ : ℕ, ∀ k : ℕ, k₀ ≤ k → ∀ n : ℤ, 2 * (k : ℤ) < n →
            (n : ℝ) ≤ Real.exp (Real.log k ^ 2 / (20 * Real.log (Real.log k))) →
            ∃ p : ℕ, p.Prime ∧ (k : ℝ) < p ∧ (p : ℝ) < (k : ℝ) + 3 * (k : ℝ) ^ ((21 : ℝ) / 40) ∧
              (p : ℤ) ∣ ∏ i ∈ Finset.Icc 1 k, (n - (i : ℤ)) := by
        sorry

    targets/erdos-1094/nodes/erdos-1094--h2--h1/attempts/20261014T075000Z-t1014-a-partial.lean, lines 25–34 at 6ba7fea98468 ↗

  3. h_strip hole ∃ (K : ℕ), ∀ (n k : ℕ), (0 : ℕ) < k → k * k ≤ n → (↑n : ℝ) < (↑k : ℝ) * ((↑k : ℝ) + (3 : ℝ) * (↑k : ℝ) ^ (21 / 40 : ℝ)) → k * (n / k) ∣ k ! → (n.choose k).minFac > n / k → k ≤ K hole

    Leaves ∃ (K : ℕ), ∀ (n k : ℕ), (0 : ℕ) < k → k * k ≤ n → n < k * k * k → (n.choose k).minFac > n / k → k ≤ K, with h_strip : ∃ (K : ℕ), ∀ (n k : ℕ), (0 : ℕ) < k → k * k ≤ n → (↑n : ℝ) < (↑k : ℝ) * ((↑k : ℝ) + (3 : ℝ) * (↑k : ℝ) ^ (21 / 40 : ℝ)) → k * (n / k) ∣ k ! → (n.choose k).minFac > n / k → k ≤ K.

    Left open as a hole; its statement is erdos-1094--h2--h1--h4 (open).

    Lean, lines 37–40
      have h_strip : ∃ K : ℕ, ∀ n k : ℕ, 0 < k → k * k ≤ n →
          (n : ℝ) < k * (k + 3 * (k : ℝ) ^ ((21 : ℝ) / 40)) →
          k * (n / k) ∣ k ! → (n.choose k).minFac > n / k → k ≤ K := by
        sorry

    targets/erdos-1094/nodes/erdos-1094--h2--h1/attempts/20261014T075000Z-t1014-a-partial.lean, lines 37–40 at 6ba7fea98468 ↗

  4. s4 obtain ∃ (k₀ : ℕ), ∀ (k : ℕ), k₀ ≤ k → ∀ (n : ℤ), (2 : ℤ) * (↑k : ℤ) < n → (↑n : ℝ) ≤ Real.exp (Real.log (↑k : ℝ) ^ (2 : ℕ) / ((20 : ℝ) * Real.log (Real.log (↑k : ℝ)))) → ∃ (p : ℕ), Nat.Prime p ∧ (↑k : ℝ) < (↑p : ℝ) ∧ (↑p : ℝ) < (↑k : ℝ) + (3 : ℝ) * (↑k : ℝ) ^ (21 / 40 : ℝ) ∧ (↑p : ℤ) ∣ ∏ i ∈ Finset.Icc (1 : ℕ) k, (n - (↑i : ℤ))

    Leaves ∃ (K : ℕ), ∀ (n k : ℕ), (0 : ℕ) < k → k * k ≤ n → n < k * k * k → (n.choose k).minFac > n / k → k ≤ K, with k₀ : ℕ, hk₀ : ∀ (k : ℕ), k₀ ≤ k → ∀ (n : ℤ), (2 : ℤ) * (↑k : ℤ) < n → (↑n : ℝ) ≤ Real.exp (Real.log (↑k : ℝ) ^ (2 : ℕ) / ((20 : ℝ) * Real.log (Real.log (↑k : ℝ)))) → ∃ (p : ℕ), Nat.Prime p ∧ (↑k : ℝ) < (↑p : ℝ) ∧ (↑p : ℝ) < (↑k : ℝ) + (3 : ℝ) * (↑k : ℝ) ^ (21 / 40 : ℝ) ∧ (↑p : ℤ) ∣ ∏ i ∈ Finset.Icc (1 : ℕ) k, (n - (↑i : ℤ)).

    Uses library Classical.not_not The Double Negation Theorem: ¬¬P is equivalent to P. .

    Lean, line 42
      obtain ⟨k₀, hk₀⟩ := h_vdt.resolve_left (not_not.mpr h_bhp)

    targets/erdos-1094/nodes/erdos-1094--h2--h1/attempts/20261014T075000Z-t1014-a-partial.lean, line 42 at 6ba7fea98468 ↗

  5. s5 obtain ∃ (K : ℕ), ∀ (n k : ℕ), (0 : ℕ) < k → k * k ≤ n → (↑n : ℝ) < (↑k : ℝ) * ((↑k : ℝ) + (3 : ℝ) * (↑k : ℝ) ^ (21 / 40 : ℝ)) → k * (n / k) ∣ k ! → (n.choose k).minFac > n / k → k ≤ K

    Leaves ∃ (K : ℕ), ∀ (n k : ℕ), (0 : ℕ) < k → k * k ≤ n → n < k * k * k → (n.choose k).minFac > n / k → k ≤ K, with K : ℕ, hK : ∀ (n k : ℕ), (0 : ℕ) < k → k * k ≤ n → (↑n : ℝ) < (↑k : ℝ) * ((↑k : ℝ) + (3 : ℝ) * (↑k : ℝ) ^ (21 / 40 : ℝ)) → k * (n / k) ∣ k ! → (n.choose k).minFac > n / k → k ≤ K.

    Lean, line 43
      obtain ⟨K, hK⟩ := h_strip

    targets/erdos-1094/nodes/erdos-1094--h2--h1/attempts/20261014T075000Z-t1014-a-partial.lean, line 43 at 6ba7fea98468 ↗

  6. hasym have ∃ (k₁ : ℕ), ∀ (k : ℕ), k₁ ≤ k → (↑k : ℝ) ^ (3 : ℕ) ≤ Real.exp (Real.log (↑k : ℝ) ^ (2 : ℕ) / ((20 : ℝ) * Real.log (Real.log (↑k : ℝ))))

    Leaves ∃ (K : ℕ), ∀ (n k : ℕ), (0 : ℕ) < k → k * k ≤ n → n < k * k * k → (n.choose k).minFac > n / k → k ≤ K, with hasym : ∃ (k₁ : ℕ), ∀ (k : ℕ), k₁ ≤ k → (↑k : ℝ) ^ (3 : ℕ) ≤ Real.exp (Real.log (↑k : ℝ) ^ (2 : ℕ) / ((20 : ℝ) * Real.log (Real.log (↑k : ℝ)))).

    Uses library Real.exp The real exponential function, defined as the real part of the complex exponential , Real.log The real logarithm function, equal to the inverse of the exponential for x > 0, to log |x| for x < 0, and to 0 for 0. , Exists.intro Existential introduction. , Max.max Returns the greater of its two arguments. .

    Lean, lines 45–70
      have hasym : ∃ k₁ : ℕ, ∀ k : ℕ, k₁ ≤ k →
          (k : ℝ) ^ 3 ≤ Real.exp (Real.log k ^ 2 / (20 * Real.log (Real.log k))) := by
        have hev : ∀ᶠ y : ℝ in Filter.atTop, Real.log y ≤ y / 120 := by
          filter_upwards [Real.isLittleO_log_id_atTop.bound (show (0 : ℝ) < 1 / 120 by norm_num),
            Filter.eventually_ge_atTop (1 : ℝ)] with y hy hy1
          rw [Real.norm_eq_abs, Real.norm_eq_abs, id, abs_of_nonneg (Real.log_nonneg hy1),
            abs_of_nonneg (show (0 : ℝ) ≤ y by linarith)] at hy
          linarith
        obtain ⟨Y, hY⟩ := Filter.eventually_atTop.1 hev
        refine ⟨⌈Real.exp (max Y 3)⌉₊, fun k hk => ?_⟩
        have hkpos : (0 : ℝ) < k := by
          have := Nat.le_of_ceil_le hk
          linarith [Real.exp_pos (max Y 3)]
        have hL : max Y 3 ≤ Real.log k := by
          rw [Real.le_log_iff_exp_le hkpos]
          exact Nat.le_of_ceil_le hk
        set L := Real.log k with hLdef
        have hL3 : 3 ≤ L := le_trans (le_max_right _ _) hL
        have hLL : 0 < Real.log L := Real.log_pos (by linarith)
        have hLLb : Real.log L ≤ L / 120 := hY L (le_trans (le_max_left _ _) hL)
        have key : 3 * L ≤ L ^ 2 / (20 * Real.log L) := by
          rw [le_div_iff₀ (by positivity)]
          nlinarith
        calc (k : ℝ) ^ 3 = Real.exp (3 * L) := by
              rw [hLdef, ← Real.log_rpow hkpos, Real.exp_log (by positivity)]; norm_num
          _ ≤ _ := Real.exp_le_exp.mpr key

    targets/erdos-1094/nodes/erdos-1094--h2--h1/attempts/20261014T075000Z-t1014-a-partial.lean, lines 45–70 at 6ba7fea98468 ↗

    1. hasym.hev have ∀ᶠ (y : ℝ) in Filter.atTop, Real.log y ≤ y / (120 : ℝ)

      Leaves ∃ (k₁ : ℕ), ∀ (k : ℕ), k₁ ≤ k → (↑k : ℝ) ^ (3 : ℕ) ≤ Real.exp (Real.log (↑k : ℝ) ^ (2 : ℕ) / ((20 : ℝ) * Real.log (Real.log (↑k : ℝ)))), with hev : ∀ᶠ (y : ℝ) in Filter.atTop, Real.log y ≤ y / (120 : ℝ).

      Uses library Filter.atTop atTop is the filter representing the limit → ∞ on an ordered set. , Real.log The real logarithm function, equal to the inverse of the exponential for x > 0, to log |x| for x < 0, and to 0 for 0. , Real.isLittleO_log_id_atTop, Filter.eventually_ge_atTop, Real.norm_eq_abs, id The identity function. , abs_of_nonneg, Real.log_nonneg.

      Lean, lines 47–52
          have hev : ∀ᶠ y : ℝ in Filter.atTop, Real.log y ≤ y / 120 := by
            filter_upwards [Real.isLittleO_log_id_atTop.bound (show (0 : ℝ) < 1 / 120 by norm_num),
              Filter.eventually_ge_atTop (1 : ℝ)] with y hy hy1
            rw [Real.norm_eq_abs, Real.norm_eq_abs, id, abs_of_nonneg (Real.log_nonneg hy1),
              abs_of_nonneg (show (0 : ℝ) ≤ y by linarith)] at hy
            linarith

      targets/erdos-1094/nodes/erdos-1094--h2--h1/attempts/20261014T075000Z-t1014-a-partial.lean, lines 47–52 at 6ba7fea98468 ↗

    2. hasym.s2 obtain ∃ (a : ℝ), ∀ (b : ℝ), a ≤ b → Real.log b ≤ b / (120 : ℝ)

      Leaves ∃ (k₁ : ℕ), ∀ (k : ℕ), k₁ ≤ k → (↑k : ℝ) ^ (3 : ℕ) ≤ Real.exp (Real.log (↑k : ℝ) ^ (2 : ℕ) / ((20 : ℝ) * Real.log (Real.log (↑k : ℝ)))), with Y : ℝ, hY : ∀ (b : ℝ), Y ≤ b → Real.log b ≤ b / (120 : ℝ).

      Uses library Filter.eventually_atTop.

      Lean, line 53
          obtain ⟨Y, hY⟩ := Filter.eventually_atTop.1 hev

      targets/erdos-1094/nodes/erdos-1094--h2--h1/attempts/20261014T075000Z-t1014-a-partial.lean, line 53 at 6ba7fea98468 ↗

    3. hasym.hkpos have (0 : ℝ) < (↑k : ℝ)

      Leaves (↑k : ℝ) ^ (3 : ℕ) ≤ Real.exp (Real.log (↑k : ℝ) ^ (2 : ℕ) / ((20 : ℝ) * Real.log (Real.log (↑k : ℝ)))), with hkpos : (0 : ℝ) < (↑k : ℝ).

      Uses library Real.exp_pos, Max.max Returns the greater of its two arguments. .

      Lean, lines 55–57
          have hkpos : (0 : ℝ) < k := by
            have := Nat.le_of_ceil_le hk
            linarith [Real.exp_pos (max Y 3)]

      targets/erdos-1094/nodes/erdos-1094--h2--h1/attempts/20261014T075000Z-t1014-a-partial.lean, lines 55–57 at 6ba7fea98468 ↗

      1. hasym.hkpos.this have Real.exp (max Y (3 : ℝ)) ≤ (↑k : ℝ)

        Leaves (0 : ℝ) < (↑k : ℝ), with this : Real.exp (max Y (3 : ℝ)) ≤ (↑k : ℝ).

        Uses library Nat.le_of_ceil_le.

        Lean, line 56
              have := Nat.le_of_ceil_le hk

        targets/erdos-1094/nodes/erdos-1094--h2--h1/attempts/20261014T075000Z-t1014-a-partial.lean, line 56 at 6ba7fea98468 ↗

    4. hasym.hL have max Y (3 : ℝ) ≤ Real.log (↑k : ℝ)

      Leaves (↑k : ℝ) ^ (3 : ℕ) ≤ Real.exp (Real.log (↑k : ℝ) ^ (2 : ℕ) / ((20 : ℝ) * Real.log (Real.log (↑k : ℝ)))), with hL : max Y (3 : ℝ) ≤ Real.log (↑k : ℝ).

      Uses library Max.max Returns the greater of its two arguments. , Real.log The real logarithm function, equal to the inverse of the exponential for x > 0, to log |x| for x < 0, and to 0 for 0. , Real.le_log_iff_exp_le, Nat.le_of_ceil_le.

      Lean, lines 58–60
          have hL : max Y 3 ≤ Real.log k := by
            rw [Real.le_log_iff_exp_le hkpos]
            exact Nat.le_of_ceil_le hk

      targets/erdos-1094/nodes/erdos-1094--h2--h1/attempts/20261014T075000Z-t1014-a-partial.lean, lines 58–60 at 6ba7fea98468 ↗

    5. hasym.hL3 have (3 : ℝ) ≤ L

      Leaves (↑k : ℝ) ^ (3 : ℕ) ≤ Real.exp (L ^ (2 : ℕ) / ((20 : ℝ) * Real.log L)), with hL3 : (3 : ℝ) ≤ L.

      Uses library le_trans The relation ≤ on a preorder is transitive. , le_max_right.

      Lean, line 62
          have hL3 : 3 ≤ L := le_trans (le_max_right _ _) hL

      targets/erdos-1094/nodes/erdos-1094--h2--h1/attempts/20261014T075000Z-t1014-a-partial.lean, line 62 at 6ba7fea98468 ↗

    6. hasym.hLL have (0 : ℝ) < Real.log L

      Leaves (↑k : ℝ) ^ (3 : ℕ) ≤ Real.exp (L ^ (2 : ℕ) / ((20 : ℝ) * Real.log L)), with hLL : (0 : ℝ) < Real.log L.

      Uses library Real.log The real logarithm function, equal to the inverse of the exponential for x > 0, to log |x| for x < 0, and to 0 for 0. , Real.log_pos.

      Lean, line 63
          have hLL : 0 < Real.log L := Real.log_pos (by linarith)

      targets/erdos-1094/nodes/erdos-1094--h2--h1/attempts/20261014T075000Z-t1014-a-partial.lean, line 63 at 6ba7fea98468 ↗

    7. hasym.hLLb have Real.log L ≤ L / (120 : ℝ)

      Leaves (↑k : ℝ) ^ (3 : ℕ) ≤ Real.exp (L ^ (2 : ℕ) / ((20 : ℝ) * Real.log L)), with hLLb : Real.log L ≤ L / (120 : ℝ).

      Uses library Real.log The real logarithm function, equal to the inverse of the exponential for x > 0, to log |x| for x < 0, and to 0 for 0. , le_trans The relation ≤ on a preorder is transitive. , le_max_left.

      Lean, line 64
          have hLLb : Real.log L ≤ L / 120 := hY L (le_trans (le_max_left _ _) hL)

      targets/erdos-1094/nodes/erdos-1094--h2--h1/attempts/20261014T075000Z-t1014-a-partial.lean, line 64 at 6ba7fea98468 ↗

    8. hasym.key have (3 : ℝ) * L ≤ L ^ (2 : ℕ) / ((20 : ℝ) * Real.log L)

      Leaves (↑k : ℝ) ^ (3 : ℕ) ≤ Real.exp (L ^ (2 : ℕ) / ((20 : ℝ) * Real.log L)), with key : (3 : ℝ) * L ≤ L ^ (2 : ℕ) / ((20 : ℝ) * Real.log L).

      Uses library Real.log The real logarithm function, equal to the inverse of the exponential for x > 0, to log |x| for x < 0, and to 0 for 0. , le_div_iff₀ See le_div_iff₀' for a version with multiplication on the other side. .

      Lean, lines 65–67
          have key : 3 * L ≤ L ^ 2 / (20 * Real.log L) := by
            rw [le_div_iff₀ (by positivity)]
            nlinarith

      targets/erdos-1094/nodes/erdos-1094--h2--h1/attempts/20261014T075000Z-t1014-a-partial.lean, lines 65–67 at 6ba7fea98468 ↗

    9. hasym.s9 calc (↑k : ℝ) ^ (3 : ℕ) = Real.exp ((3 : ℝ) * L)

      Closes the goal.

      Uses library Real.exp The real exponential function, defined as the real part of the complex exponential , Real.log_rpow, Real.exp_log.

      Lean, lines 68–69
          calc (k : ℝ) ^ 3 = Real.exp (3 * L) := by
                rw [hLdef, ← Real.log_rpow hkpos, Real.exp_log (by positivity)]; norm_num

      targets/erdos-1094/nodes/erdos-1094--h2--h1/attempts/20261014T075000Z-t1014-a-partial.lean, lines 68–69 at 6ba7fea98468 ↗

    10. hasym.s10 calc Real.exp ((3 : ℝ) * L) ≤ Real.exp (L ^ (2 : ℕ) / ((20 : ℝ) * Real.log L))

      Closes the goal.

      Uses library Real.exp_le_exp.

      Lean, line 70
            _ ≤ _ := Real.exp_le_exp.mpr key

      targets/erdos-1094/nodes/erdos-1094--h2--h1/attempts/20261014T075000Z-t1014-a-partial.lean, line 70 at 6ba7fea98468 ↗

  7. s7 obtain ∃ (k₁ : ℕ), ∀ (k : ℕ), k₁ ≤ k → (↑k : ℝ) ^ (3 : ℕ) ≤ Real.exp (Real.log (↑k : ℝ) ^ (2 : ℕ) / ((20 : ℝ) * Real.log (Real.log (↑k : ℝ))))

    Leaves ∃ (K : ℕ), ∀ (n k : ℕ), (0 : ℕ) < k → k * k ≤ n → n < k * k * k → (n.choose k).minFac > n / k → k ≤ K, with k₁ : ℕ, hk₁ : ∀ (k : ℕ), k₁ ≤ k → (↑k : ℝ) ^ (3 : ℕ) ≤ Real.exp (Real.log (↑k : ℝ) ^ (2 : ℕ) / ((20 : ℝ) * Real.log (Real.log (↑k : ℝ)))).

    Lean, line 71
      obtain ⟨k₁, hk₁⟩ := hasym

    targets/erdos-1094/nodes/erdos-1094--h2--h1/attempts/20261014T075000Z-t1014-a-partial.lean, line 71 at 6ba7fea98468 ↗

  8. hlt have max (max k₀ K) (max k₁ (4 : ℕ)) < k

    Leaves False, with hlt : max (max k₀ K) (max k₁ (4 : ℕ)) < k.

    Uses library not_le.

    Lean, line 74
      have hlt := not_le.mp hcon

    targets/erdos-1094/nodes/erdos-1094--h2--h1/attempts/20261014T075000Z-t1014-a-partial.lean, line 74 at 6ba7fea98468 ↗

  9. hkK have K < k

    Leaves False, with hkK : K < k.

    Uses library lt_of_le_of_lt, le_trans The relation ≤ on a preorder is transitive. , le_max_right, le_max_left.

    Lean, line 75
      have hkK : K < k := lt_of_le_of_lt (le_trans (le_max_right _ _) (le_max_left _ _)) hlt

    targets/erdos-1094/nodes/erdos-1094--h2--h1/attempts/20261014T075000Z-t1014-a-partial.lean, line 75 at 6ba7fea98468 ↗

  10. hk0 have k₀ ≤ k

    Leaves False, with hk0 : k₀ ≤ k.

    Uses library le_of_lt, lt_of_le_of_lt, le_trans The relation ≤ on a preorder is transitive. , le_max_left.

    Lean, line 76
      have hk0 : k₀ ≤ k := le_of_lt (lt_of_le_of_lt (le_trans (le_max_left _ _) (le_max_left _ _)) hlt)

    targets/erdos-1094/nodes/erdos-1094--h2--h1/attempts/20261014T075000Z-t1014-a-partial.lean, line 76 at 6ba7fea98468 ↗

  11. hk1 have k₁ ≤ k

    Leaves False, with hk1 : k₁ ≤ k.

    Uses library le_of_lt, lt_of_le_of_lt, le_trans The relation ≤ on a preorder is transitive. , le_max_left, le_max_right.

    Lean, line 77
      have hk1 : k₁ ≤ k := le_of_lt (lt_of_le_of_lt (le_trans (le_max_left _ _) (le_max_right _ _)) hlt)

    targets/erdos-1094/nodes/erdos-1094--h2--h1/attempts/20261014T075000Z-t1014-a-partial.lean, line 77 at 6ba7fea98468 ↗

  12. hk4 have (4 : ℕ) < k

    Leaves False, with hk4 : (4 : ℕ) < k.

    Uses library lt_of_le_of_lt, le_trans The relation ≤ on a preorder is transitive. , le_max_right.

    Lean, line 78
      have hk4 : 4 < k := lt_of_le_of_lt (le_trans (le_max_right _ _) (le_max_right _ _)) hlt

    targets/erdos-1094/nodes/erdos-1094--h2--h1/attempts/20261014T075000Z-t1014-a-partial.lean, line 78 at 6ba7fea98468 ↗

  13. hkk have k ≤ n / k

    Leaves False, with hkk : k ≤ n / k.

    Uses library Nat.le_div_iff_mul_le.

    Lean, line 79
      have hkk : k ≤ n / k := (Nat.le_div_iff_mul_le hk).2 hkn

    targets/erdos-1094/nodes/erdos-1094--h2--h1/attempts/20261014T075000Z-t1014-a-partial.lean, line 79 at 6ba7fea98468 ↗

  14. hnd have ∀ (p : ℕ), Nat.Prime p → p ≤ n / k → ¬p ∣ n.choose k

    Leaves False, with hnd : ∀ (p : ℕ), Nat.Prime p → p ≤ n / k → ¬p ∣ n.choose k.

    Lean, lines 81–84
      have hnd : ∀ p : ℕ, p.Prime → p ≤ n / k → ¬ p ∣ n.choose k := by
        intro p hp hpt hpd
        have := Nat.minFac_le_of_dvd hp.two_le hpd
        omega

    targets/erdos-1094/nodes/erdos-1094--h2--h1/attempts/20261014T075000Z-t1014-a-partial.lean, lines 81–84 at 6ba7fea98468 ↗

    1. hnd.this have (n.choose k).minFac ≤ p

      Leaves False, with this : (n.choose k).minFac ≤ p.

      Uses library Nat.minFac_le_of_dvd.

      Lean, line 83
          have := Nat.minFac_le_of_dvd hp.two_le hpd

      targets/erdos-1094/nodes/erdos-1094--h2--h1/attempts/20261014T075000Z-t1014-a-partial.lean, line 83 at 6ba7fea98468 ↗

  15. htop have k * (n / k) ∣ k !

    Leaves False, with htop : k * (n / k) ∣ k !.

    Lean, lines 86–104
      have htop : k * (n / k) ∣ k ! := by
        have htpos : 0 < n / k := lt_of_lt_of_le hk hkk
        have hm_le : k * (n / k) ≤ n := Nat.mul_div_le n k
        have hm_gt : n < k * (n / k) + k := by
          have := Nat.lt_mul_div_succ n hk
          linarith [this]
        have hcop : Nat.Coprime (k * (n / k)) (n.choose k) := by
          apply Nat.coprime_of_dvd
          intro p hp hpm hpC
          rcases (Nat.Prime.dvd_mul hp).1 hpm with h | h
          · exact hnd p hp (le_trans (Nat.le_of_dvd hk h) hkk) hpC
          · exact hnd p hp (Nat.le_of_dvd htpos h) hpC
        have hm_dvd : k * (n / k) ∣ k ! * n.choose k := by
          rw [← Nat.descFactorial_eq_factorial_mul_choose, Nat.descFactorial_eq_prod_range]
          have hj : n - k * (n / k) ∈ Finset.range k := Finset.mem_range.2 (by omega)
          have h1 := Finset.dvd_prod_of_mem (fun i => n - i) hj
          have h2 : n - (n - k * (n / k)) = k * (n / k) := by omega
          simpa only [h2] using h1
        exact hcop.dvd_of_dvd_mul_right hm_dvd

    targets/erdos-1094/nodes/erdos-1094--h2--h1/attempts/20261014T075000Z-t1014-a-partial.lean, lines 86–104 at 6ba7fea98468 ↗

    1. htop.htpos have (0 : ℕ) < n / k

      Leaves k * (n / k) ∣ k !, with htpos : (0 : ℕ) < n / k.

      Uses library lt_of_lt_of_le.

      Lean, line 87
          have htpos : 0 < n / k := lt_of_lt_of_le hk hkk

      targets/erdos-1094/nodes/erdos-1094--h2--h1/attempts/20261014T075000Z-t1014-a-partial.lean, line 87 at 6ba7fea98468 ↗

    2. htop.hm_le have k * (n / k) ≤ n

      Leaves k * (n / k) ∣ k !, with hm_le : k * (n / k) ≤ n.

      Uses library Nat.mul_div_le.

      Lean, line 88
          have hm_le : k * (n / k) ≤ n := Nat.mul_div_le n k

      targets/erdos-1094/nodes/erdos-1094--h2--h1/attempts/20261014T075000Z-t1014-a-partial.lean, line 88 at 6ba7fea98468 ↗

    3. htop.hm_gt have n < k * (n / k) + k

      Leaves k * (n / k) ∣ k !, with hm_gt : n < k * (n / k) + k.

      Lean, lines 89–91
          have hm_gt : n < k * (n / k) + k := by
            have := Nat.lt_mul_div_succ n hk
            linarith [this]

      targets/erdos-1094/nodes/erdos-1094--h2--h1/attempts/20261014T075000Z-t1014-a-partial.lean, lines 89–91 at 6ba7fea98468 ↗

      1. htop.hm_gt.this have n < k * (n / k + (1 : ℕ))

        Leaves n < k * (n / k) + k, with this : n < k * (n / k + (1 : ℕ)).

        Uses library Nat.lt_mul_div_succ.

        Lean, line 90
              have := Nat.lt_mul_div_succ n hk

        targets/erdos-1094/nodes/erdos-1094--h2--h1/attempts/20261014T075000Z-t1014-a-partial.lean, line 90 at 6ba7fea98468 ↗

    4. htop.hcop have (k * (n / k)).Coprime (n.choose k)

      Leaves k * (n / k) ∣ k !, with hcop : (k * (n / k)).Coprime (n.choose k).

      Uses library Nat.Coprime m and n are coprime, or relatively prime, if their gcd is 1. , Nat.coprime_of_dvd, Nat.Prime.dvd_mul.

      Lean, lines 92–97
          have hcop : Nat.Coprime (k * (n / k)) (n.choose k) := by
            apply Nat.coprime_of_dvd
            intro p hp hpm hpC
            rcases (Nat.Prime.dvd_mul hp).1 hpm with h | h
            · exact hnd p hp (le_trans (Nat.le_of_dvd hk h) hkk) hpC
            · exact hnd p hp (Nat.le_of_dvd htpos h) hpC

      targets/erdos-1094/nodes/erdos-1094--h2--h1/attempts/20261014T075000Z-t1014-a-partial.lean, lines 92–97 at 6ba7fea98468 ↗

      1. htop.hcop.s1 case

        Leaves False, with h : p ∣ k.

        Uses library le_trans The relation ≤ on a preorder is transitive. , Nat.le_of_dvd.

        Lean, line 96
              · exact hnd p hp (le_trans (Nat.le_of_dvd hk h) hkk) hpC

        targets/erdos-1094/nodes/erdos-1094--h2--h1/attempts/20261014T075000Z-t1014-a-partial.lean, line 96 at 6ba7fea98468 ↗

      2. htop.hcop.s2 case

        Leaves False, with h : p ∣ n / k.

        Uses library Nat.le_of_dvd.

        Lean, line 97
              · exact hnd p hp (Nat.le_of_dvd htpos h) hpC

        targets/erdos-1094/nodes/erdos-1094--h2--h1/attempts/20261014T075000Z-t1014-a-partial.lean, line 97 at 6ba7fea98468 ↗

    5. htop.hm_dvd have k * (n / k) ∣ k ! * n.choose k

      Leaves k * (n / k) ∣ k !, with hm_dvd : k * (n / k) ∣ k ! * n.choose k.

      Uses library Nat.descFactorial_eq_factorial_mul_choose, Nat.descFactorial_eq_prod_range.

      Lean, lines 98–103
          have hm_dvd : k * (n / k) ∣ k ! * n.choose k := by
            rw [← Nat.descFactorial_eq_factorial_mul_choose, Nat.descFactorial_eq_prod_range]
            have hj : n - k * (n / k) ∈ Finset.range k := Finset.mem_range.2 (by omega)
            have h1 := Finset.dvd_prod_of_mem (fun i => n - i) hj
            have h2 : n - (n - k * (n / k)) = k * (n / k) := by omega
            simpa only [h2] using h1

      targets/erdos-1094/nodes/erdos-1094--h2--h1/attempts/20261014T075000Z-t1014-a-partial.lean, lines 98–103 at 6ba7fea98468 ↗

      1. htop.hm_dvd.hj have n - k * (n / k) ∈ Finset.range k

        Leaves k * (n / k) ∣ ∏ i ∈ Finset.range k, (n - i), with hj : n - k * (n / k) ∈ Finset.range k.

        Uses library Finset.range range n is the set of natural numbers less than n. , Finset.mem_range.

        Lean, line 100
              have hj : n - k * (n / k) ∈ Finset.range k := Finset.mem_range.2 (by omega)

        targets/erdos-1094/nodes/erdos-1094--h2--h1/attempts/20261014T075000Z-t1014-a-partial.lean, line 100 at 6ba7fea98468 ↗

      2. htop.hm_dvd.h1 have n - (n - k * (n / k)) ∣ ∏ i ∈ Finset.range k, (n - i)

        Leaves k * (n / k) ∣ ∏ i ∈ Finset.range k, (n - i), with h1 : n - (n - k * (n / k)) ∣ ∏ i ∈ Finset.range k, (n - i).

        Uses library Finset.dvd_prod_of_mem.

        Lean, line 101
              have h1 := Finset.dvd_prod_of_mem (fun i => n - i) hj

        targets/erdos-1094/nodes/erdos-1094--h2--h1/attempts/20261014T075000Z-t1014-a-partial.lean, line 101 at 6ba7fea98468 ↗

      3. htop.hm_dvd.h2 have n - (n - k * (n / k)) = k * (n / k) routine: omega

        Leaves k * (n / k) ∣ ∏ i ∈ Finset.range k, (n - i), with h2 : n - (n - k * (n / k)) = k * (n / k).

        Lean, line 102
              have h2 : n - (n - k * (n / k)) = k * (n / k) := by omega

        targets/erdos-1094/nodes/erdos-1094--h2--h1/attempts/20261014T075000Z-t1014-a-partial.lean, line 102 at 6ba7fea98468 ↗

  16. s16 case

    Leaves False, with hstrip : (↑n : ℝ) < (↑k : ℝ) * ((↑k : ℝ) + (3 : ℝ) * (↑k : ℝ) ^ (21 / 40 : ℝ)).

    Uses library absurd Anything follows from two contradictory hypotheses. , not_le.

    Lean, line 106
      · exact absurd (hK n k hk hkn hstrip htop hmin) (not_le.mpr hkK)

    targets/erdos-1094/nodes/erdos-1094--h2--h1/attempts/20261014T075000Z-t1014-a-partial.lean, line 106 at 6ba7fea98468 ↗

  17. s17 case

    Leaves False, with hstrip : ¬(↑n : ℝ) < (↑k : ℝ) * ((↑k : ℝ) + (3 : ℝ) * (↑k : ℝ) ^ (21 / 40 : ℝ)).

    Uses library Nat.le_div_iff_mul_le.

    Lean, lines 107–145
      · -- above the strip: a prime in (k, k + 3 k^(21/40)) divides the window and is ≤ ⌊n/k⌋
        have hstrip := not_lt.mp hstrip
        have h2k : 2 * (k : ℤ) < (n : ℤ) + 1 := by
          have : 2 * k < n + 1 := by nlinarith
          exact_mod_cast this
        have hexp : (((n : ℤ) + 1 : ℤ) : ℝ) ≤ Real.exp (Real.log k ^ 2 / (20 * Real.log (Real.log k))) := by
          have hn1 : n + 1 ≤ k * k * k := hcube
          have : ((n : ℝ) + 1) ≤ (k : ℝ) ^ 3 := by
            have : ((n + 1 : ℕ) : ℝ) ≤ ((k * k * k : ℕ) : ℝ) := by exact_mod_cast hn1
            push_cast at this
            nlinarith
          push_cast
          exact le_trans this (hk₁ k hk1)
        obtain ⟨p, hp, hkp, hpb, hpdvd⟩ := hk₀ k hk0 ((n : ℤ) + 1) h2k hexp
        -- the window product is n.descFactorial k
        have hprod : ∀ j : ℕ, j ≤ n →
            ∏ i ∈ Finset.Icc 1 j, (((n : ℤ) + 1) - (i : ℤ)) = ((n.descFactorial j : ℕ) : ℤ) := by
          intro j
          induction j with
          | zero => intro _; simp
          | succ j ih =>
            intro hj
            rw [Finset.prod_Icc_succ_top (by omega), ih (by omega), Nat.descFactorial_succ]
            push_cast [Nat.cast_sub (show j ≤ n by omega)]
            ring
        rw [hprod k (by nlinarith)] at hpdvd
        have hpd : p ∣ k ! * n.choose k := by
          rw [← Nat.descFactorial_eq_factorial_mul_choose]
          exact_mod_cast hpdvd
        have hkp' : k < p := by exact_mod_cast hkp
        have hpC : p ∣ n.choose k := by
          rcases (Nat.Prime.dvd_mul hp).1 hpd with h | h
          · exact absurd ((Nat.Prime.dvd_factorial hp).1 h) (not_le.mpr hkp')
          · exact h
        have hpk : p * k ≤ n := by
          have hkpos : (0 : ℝ) < k := by exact_mod_cast hk
          have : (p : ℝ) * k < n := by nlinarith
          exact_mod_cast this.le
        exact hnd p hp ((Nat.le_div_iff_mul_le hk).2 hpk) hpC

    targets/erdos-1094/nodes/erdos-1094--h2--h1/attempts/20261014T075000Z-t1014-a-partial.lean, lines 107–145 at 6ba7fea98468 ↗

    1. s17.hstrip have (↑k : ℝ) * ((↑k : ℝ) + (3 : ℝ) * (↑k : ℝ) ^ (21 / 40 : ℝ)) ≤ (↑n : ℝ)

      Leaves False, with hstrip : (↑k : ℝ) * ((↑k : ℝ) + (3 : ℝ) * (↑k : ℝ) ^ (21 / 40 : ℝ)) ≤ (↑n : ℝ).

      Uses library not_lt.

      Lean, line 108
          have hstrip := not_lt.mp hstrip

      targets/erdos-1094/nodes/erdos-1094--h2--h1/attempts/20261014T075000Z-t1014-a-partial.lean, line 108 at 6ba7fea98468 ↗

    2. s17.h2k have (2 : ℤ) * (↑k : ℤ) < (↑n : ℤ) + (1 : ℤ)

      Leaves False, with h2k : (2 : ℤ) * (↑k : ℤ) < (↑n : ℤ) + (1 : ℤ).

      Lean, lines 109–111
          have h2k : 2 * (k : ℤ) < (n : ℤ) + 1 := by
            have : 2 * k < n + 1 := by nlinarith
            exact_mod_cast this

      targets/erdos-1094/nodes/erdos-1094--h2--h1/attempts/20261014T075000Z-t1014-a-partial.lean, lines 109–111 at 6ba7fea98468 ↗

      1. s17.h2k.this have (2 : ℕ) * k < n + (1 : ℕ) routine: nlinarith

        Leaves (2 : ℤ) * (↑k : ℤ) < (↑n : ℤ) + (1 : ℤ), with this : (2 : ℕ) * k < n + (1 : ℕ).

        Lean, line 110
              have : 2 * k < n + 1 := by nlinarith

        targets/erdos-1094/nodes/erdos-1094--h2--h1/attempts/20261014T075000Z-t1014-a-partial.lean, line 110 at 6ba7fea98468 ↗

    3. s17.hexp have (↑((↑n : ℤ) + (1 : ℤ)) : ℝ) ≤ Real.exp (Real.log (↑k : ℝ) ^ (2 : ℕ) / ((20 : ℝ) * Real.log (Real.log (↑k : ℝ))))

      Leaves False, with hexp : (↑((↑n : ℤ) + (1 : ℤ)) : ℝ) ≤ Real.exp (Real.log (↑k : ℝ) ^ (2 : ℕ) / ((20 : ℝ) * Real.log (Real.log (↑k : ℝ)))).

      Uses library Real.exp The real exponential function, defined as the real part of the complex exponential , Real.log The real logarithm function, equal to the inverse of the exponential for x > 0, to log |x| for x < 0, and to 0 for 0. , le_trans The relation ≤ on a preorder is transitive. .

      Lean, lines 112–119
          have hexp : (((n : ℤ) + 1 : ℤ) : ℝ) ≤ Real.exp (Real.log k ^ 2 / (20 * Real.log (Real.log k))) := by
            have hn1 : n + 1 ≤ k * k * k := hcube
            have : ((n : ℝ) + 1) ≤ (k : ℝ) ^ 3 := by
              have : ((n + 1 : ℕ) : ℝ) ≤ ((k * k * k : ℕ) : ℝ) := by exact_mod_cast hn1
              push_cast at this
              nlinarith
            push_cast
            exact le_trans this (hk₁ k hk1)

      targets/erdos-1094/nodes/erdos-1094--h2--h1/attempts/20261014T075000Z-t1014-a-partial.lean, lines 112–119 at 6ba7fea98468 ↗

      1. s17.hexp.hn1 have n + (1 : ℕ) ≤ k * k * k

        Leaves (↑((↑n : ℤ) + (1 : ℤ)) : ℝ) ≤ Real.exp (Real.log (↑k : ℝ) ^ (2 : ℕ) / ((20 : ℝ) * Real.log (Real.log (↑k : ℝ)))), with hn1 : n + (1 : ℕ) ≤ k * k * k.

        Lean, line 113
              have hn1 : n + 1 ≤ k * k * k := hcube

        targets/erdos-1094/nodes/erdos-1094--h2--h1/attempts/20261014T075000Z-t1014-a-partial.lean, line 113 at 6ba7fea98468 ↗

      2. s17.hexp.this have (↑n : ℝ) + (1 : ℝ) ≤ (↑k : ℝ) ^ (3 : ℕ)

        Leaves (↑((↑n : ℤ) + (1 : ℤ)) : ℝ) ≤ Real.exp (Real.log (↑k : ℝ) ^ (2 : ℕ) / ((20 : ℝ) * Real.log (Real.log (↑k : ℝ)))), with this : (↑n : ℝ) + (1 : ℝ) ≤ (↑k : ℝ) ^ (3 : ℕ).

        Lean, lines 114–117
              have : ((n : ℝ) + 1) ≤ (k : ℝ) ^ 3 := by
                have : ((n + 1 : ℕ) : ℝ) ≤ ((k * k * k : ℕ) : ℝ) := by exact_mod_cast hn1
                push_cast at this
                nlinarith

        targets/erdos-1094/nodes/erdos-1094--h2--h1/attempts/20261014T075000Z-t1014-a-partial.lean, lines 114–117 at 6ba7fea98468 ↗

        1. s17.hexp.this.this have (↑(n + (1 : ℕ)) : ℝ) ≤ (↑(k * k * k) : ℝ)

          Leaves (↑n : ℝ) + (1 : ℝ) ≤ (↑k : ℝ) ^ (3 : ℕ), with this : (↑(n + (1 : ℕ)) : ℝ) ≤ (↑(k * k * k) : ℝ).

          Lean, line 115
                  have : ((n + 1 : ℕ) : ℝ) ≤ ((k * k * k : ℕ) : ℝ) := by exact_mod_cast hn1

          targets/erdos-1094/nodes/erdos-1094--h2--h1/attempts/20261014T075000Z-t1014-a-partial.lean, line 115 at 6ba7fea98468 ↗

    4. s17.s4 obtain ∃ (p : ℕ), Nat.Prime p ∧ (↑k : ℝ) < (↑p : ℝ) ∧ (↑p : ℝ) < (↑k : ℝ) + (3 : ℝ) * (↑k : ℝ) ^ (21 / 40 : ℝ) ∧ (↑p : ℤ) ∣ ∏ i ∈ Finset.Icc (1 : ℕ) k, ((↑n : ℤ) + (1 : ℤ) - (↑i : ℤ))

      Leaves False, with p : ℕ, hp : Nat.Prime p, hkp : (↑k : ℝ) < (↑p : ℝ), hpb : (↑p : ℝ) < (↑k : ℝ) + (3 : ℝ) * (↑k : ℝ) ^ (21 / 40 : ℝ), hpdvd : (↑p : ℤ) ∣ ∏ i ∈ Finset.Icc (1 : ℕ) k, ((↑n : ℤ) + (1 : ℤ) - (↑i : ℤ)).

      Lean, line 120
          obtain ⟨p, hp, hkp, hpb, hpdvd⟩ := hk₀ k hk0 ((n : ℤ) + 1) h2k hexp

      targets/erdos-1094/nodes/erdos-1094--h2--h1/attempts/20261014T075000Z-t1014-a-partial.lean, line 120 at 6ba7fea98468 ↗

    5. s17.hprod have ∀ j ≤ n, ∏ i ∈ Finset.Icc (1 : ℕ) j, ((↑n : ℤ) + (1 : ℤ) - (↑i : ℤ)) = (↑(n.descFactorial j) : ℤ)

      Leaves False, with hprod : ∀ j ≤ n, ∏ i ∈ Finset.Icc (1 : ℕ) j, ((↑n : ℤ) + (1 : ℤ) - (↑i : ℤ)) = (↑(n.descFactorial j) : ℤ).

      Uses library Finset.Icc The finset $[a, b]$ of elements x such that a ≤ x and x ≤ b. .

      Lean, lines 122–131
          have hprod : ∀ j : ℕ, j ≤ n →
              ∏ i ∈ Finset.Icc 1 j, (((n : ℤ) + 1) - (i : ℤ)) = ((n.descFactorial j : ℕ) : ℤ) := by
            intro j
            induction j with
            | zero => intro _; simp
            | succ j ih =>
              intro hj
              rw [Finset.prod_Icc_succ_top (by omega), ih (by omega), Nat.descFactorial_succ]
              push_cast [Nat.cast_sub (show j ≤ n by omega)]
              ring

      targets/erdos-1094/nodes/erdos-1094--h2--h1/attempts/20261014T075000Z-t1014-a-partial.lean, lines 122–131 at 6ba7fea98468 ↗

      1. s17.hprod.s1 case

        Leaves (0 : ℕ) ≤ n → ∏ i ∈ Finset.Icc (1 : ℕ) (0 : ℕ), ((↑n : ℤ) + (1 : ℤ) - (↑i : ℤ)) = (↑(n.descFactorial (0 : ℕ)) : ℤ).

        Uses library Nat.zero Zero, the smallest natural number. .

        Lean, line 126
              | zero => intro _; simp

        targets/erdos-1094/nodes/erdos-1094--h2--h1/attempts/20261014T075000Z-t1014-a-partial.lean, line 126 at 6ba7fea98468 ↗

      2. s17.hprod.s2 case

        Leaves j + (1 : ℕ) ≤ n → ∏ i ∈ Finset.Icc (1 : ℕ) (j + (1 : ℕ)), ((↑n : ℤ) + (1 : ℤ) - (↑i : ℤ)) = (↑(n.descFactorial (j + (1 : ℕ))) : ℤ), with j : ℕ, ih : j ≤ n → ∏ i ∈ Finset.Icc (1 : ℕ) j, ((↑n : ℤ) + (1 : ℤ) - (↑i : ℤ)) = (↑(n.descFactorial j) : ℤ).

        Uses library Nat.succ The successor of a natural number n. , Finset.prod_Icc_succ_top, Nat.descFactorial_succ, Nat.cast_sub.

        Lean, lines 127–131
              | succ j ih =>
                intro hj
                rw [Finset.prod_Icc_succ_top (by omega), ih (by omega), Nat.descFactorial_succ]
                push_cast [Nat.cast_sub (show j ≤ n by omega)]
                ring

        targets/erdos-1094/nodes/erdos-1094--h2--h1/attempts/20261014T075000Z-t1014-a-partial.lean, lines 127–131 at 6ba7fea98468 ↗

    6. s17.hpd have p ∣ k ! * n.choose k

      Leaves False, with hpd : p ∣ k ! * n.choose k.

      Uses library Nat.descFactorial_eq_factorial_mul_choose.

      Lean, lines 133–135
          have hpd : p ∣ k ! * n.choose k := by
            rw [← Nat.descFactorial_eq_factorial_mul_choose]
            exact_mod_cast hpdvd

      targets/erdos-1094/nodes/erdos-1094--h2--h1/attempts/20261014T075000Z-t1014-a-partial.lean, lines 133–135 at 6ba7fea98468 ↗

    7. s17.hkp' have k < p

      Leaves False, with hkp' : k < p.

      Lean, line 136
          have hkp' : k < p := by exact_mod_cast hkp

      targets/erdos-1094/nodes/erdos-1094--h2--h1/attempts/20261014T075000Z-t1014-a-partial.lean, line 136 at 6ba7fea98468 ↗

    8. s17.hpC have p ∣ n.choose k

      Leaves False, with hpC : p ∣ n.choose k.

      Uses library Nat.Prime.dvd_mul.

      Lean, lines 137–140
          have hpC : p ∣ n.choose k := by
            rcases (Nat.Prime.dvd_mul hp).1 hpd with h | h
            · exact absurd ((Nat.Prime.dvd_factorial hp).1 h) (not_le.mpr hkp')
            · exact h

      targets/erdos-1094/nodes/erdos-1094--h2--h1/attempts/20261014T075000Z-t1014-a-partial.lean, lines 137–140 at 6ba7fea98468 ↗

      1. s17.hpC.s1 case

        Leaves p ∣ n.choose k, with h : p ∣ k !.

        Uses library absurd Anything follows from two contradictory hypotheses. , Nat.Prime.dvd_factorial, not_le.

        Lean, line 139
              · exact absurd ((Nat.Prime.dvd_factorial hp).1 h) (not_le.mpr hkp')

        targets/erdos-1094/nodes/erdos-1094--h2--h1/attempts/20261014T075000Z-t1014-a-partial.lean, line 139 at 6ba7fea98468 ↗

      2. s17.hpC.s2 case
    9. s17.hpk have p * k ≤ n

      Leaves False, with hpk : p * k ≤ n.

      Lean, lines 141–144
          have hpk : p * k ≤ n := by
            have hkpos : (0 : ℝ) < k := by exact_mod_cast hk
            have : (p : ℝ) * k < n := by nlinarith
            exact_mod_cast this.le

      targets/erdos-1094/nodes/erdos-1094--h2--h1/attempts/20261014T075000Z-t1014-a-partial.lean, lines 141–144 at 6ba7fea98468 ↗

      1. s17.hpk.hkpos have (0 : ℝ) < (↑k : ℝ)

        Leaves p * k ≤ n, with hkpos : (0 : ℝ) < (↑k : ℝ).

        Lean, line 142
              have hkpos : (0 : ℝ) < k := by exact_mod_cast hk

        targets/erdos-1094/nodes/erdos-1094--h2--h1/attempts/20261014T075000Z-t1014-a-partial.lean, line 142 at 6ba7fea98468 ↗

      2. s17.hpk.this have (↑p : ℝ) * (↑k : ℝ) < (↑n : ℝ) routine: nlinarith

        Leaves p * k ≤ n, with this : (↑p : ℝ) * (↑k : ℝ) < (↑n : ℝ).

        Lean, line 143
              have : (p : ℝ) * k < n := by nlinarith

        targets/erdos-1094/nodes/erdos-1094--h2--h1/attempts/20261014T075000Z-t1014-a-partial.lean, line 143 at 6ba7fea98468 ↗

import Mathlib
import Nodes.«erdos-1094--h2--h1».Context

open scoped Nat

/-! Hole `h_lo` of a merged partial proof, as a node (D-12 #5, D-29).
Statement generated by the gate from the assembly; immutable (D-3). -/

theorem erdos_1094__h2__h1 : ∃ (K : ℕ), ∀ (n k : ℕ), (0 : ℕ) < k → k * k ≤ n → n < k * k * k → (n.choose k).minFac > n / k → k ≤ K := by
  -- annex: 6c7d3be4efeecc319f87dc55a1638245a01739d8f2167e05b11ba9d9d31853b7
  -- Baker, Harman and Pintz (2001): for large k the interval (k, k + k^(21/40)) holds at
  -- least C k^(21/40) / log k primes. Stated exactly as `axiom bhp` in van Doorn and Tang's
  -- formalisation (github.com/Woett/ChatGPT-s-note-on-Erdos451), with `primeCard` unfolded.
  have h_bhp : ∃ C : ℝ, 0 < C ∧ ∃ k₀ : ℕ, ∀ k : ℕ, k₀ ≤ k →
      C * (k : ℝ) ^ ((21 : ℝ) / 40) / Real.log k ≤
        (((Finset.Ioo ⌊(k : ℝ)⌋ ⌈(k : ℝ) + (k : ℝ) ^ ((21 : ℝ) / 40)⌉).filter
          (fun p : ℤ => 0 < p ∧ p.natAbs.Prime ∧ (k : ℝ) < (p : ℝ) ∧
            (p : ℝ) < (k : ℝ) + (k : ℝ) ^ ((21 : ℝ) / 40))).card : ℝ) := by
    sorry
  -- van Doorn and Tang, arXiv:2606.19863, Theorem 1.1 (`main_theorem` of their Lean file,
  -- proved there from `bhp` alone, Konyagin's fractional-parts theorem included): for large k
  -- and 2k < n ≤ exp(log² k / (20 log log k)), some prime p in (k, k + 3 k^(21/40)) divides
  -- (n - k)(n - k + 1)⋯(n - 1). Stated as "BHP fails, or the theorem holds", so that the hole
  -- is exactly what their file proves.
  have h_vdt : (¬ ∃ C : ℝ, 0 < C ∧ ∃ k₀ : ℕ, ∀ k : ℕ, k₀ ≤ k →
        C * (k : ℝ) ^ ((21 : ℝ) / 40) / Real.log k ≤
          (((Finset.Ioo ⌊(k : ℝ)⌋ ⌈(k : ℝ) + (k : ℝ) ^ ((21 : ℝ) / 40)⌉).filter
            (fun p : ℤ => 0 < p ∧ p.natAbs.Prime ∧ (k : ℝ) < (p : ℝ) ∧
              (p : ℝ) < (k : ℝ) + (k : ℝ) ^ ((21 : ℝ) / 40))).card : ℝ)) ∨
      ∃ k₀ : ℕ, ∀ k : ℕ, k₀ ≤ k → ∀ n : ℤ, 2 * (k : ℤ) < n →
        (n : ℝ) ≤ Real.exp (Real.log k ^ 2 / (20 * Real.log (Real.log k))) →
        ∃ p : ℕ, p.Prime ∧ (k : ℝ) < p ∧ (p : ℝ) < (k : ℝ) + 3 * (k : ℝ) ^ ((21 : ℝ) / 40) ∧
          (p : ℤ) ∣ ∏ i ∈ Finset.Icc 1 k, (n - (i : ℤ)) := by
    sorry
  -- What remains of this range: a thin strip above k², where the prime van Doorn and Tang
  -- give may exceed ⌊n/k⌋. The assembly hands over k ⌊n/k⌋ ∣ k! as on erdos-1094--h2--h2.
  have h_strip : ∃ K : ℕ, ∀ n k : ℕ, 0 < k → k * k ≤ n →
      (n : ℝ) < k * (k + 3 * (k : ℝ) ^ ((21 : ℝ) / 40)) →
      k * (n / k) ∣ k ! → (n.choose k).minFac > n / k → k ≤ K := by
    sorry
  -- the assembly
  obtain ⟨k₀, hk₀⟩ := h_vdt.resolve_left (not_not.mpr h_bhp)
  obtain ⟨K, hK⟩ := h_strip
  -- k³ ≤ exp(log² k / (20 log log k)) for large k, so n < k³ is inside van Doorn and Tang's range
  have hasym : ∃ k₁ : ℕ, ∀ k : ℕ, k₁ ≤ k →
      (k : ℝ) ^ 3 ≤ Real.exp (Real.log k ^ 2 / (20 * Real.log (Real.log k))) := by
    have hev : ∀ᶠ y : ℝ in Filter.atTop, Real.log y ≤ y / 120 := by
      filter_upwards [Real.isLittleO_log_id_atTop.bound (show (0 : ℝ) < 1 / 120 by norm_num),
        Filter.eventually_ge_atTop (1 : ℝ)] with y hy hy1
      rw [Real.norm_eq_abs, Real.norm_eq_abs, id, abs_of_nonneg (Real.log_nonneg hy1),
        abs_of_nonneg (show (0 : ℝ) ≤ y by linarith)] at hy
      linarith
    obtain ⟨Y, hY⟩ := Filter.eventually_atTop.1 hev
    refine ⟨⌈Real.exp (max Y 3)⌉₊, fun k hk => ?_⟩
    have hkpos : (0 : ℝ) < k := by
      have := Nat.le_of_ceil_le hk
      linarith [Real.exp_pos (max Y 3)]
    have hL : max Y 3 ≤ Real.log k := by
      rw [Real.le_log_iff_exp_le hkpos]
      exact Nat.le_of_ceil_le hk
    set L := Real.log k with hLdef
    have hL3 : 3 ≤ L := le_trans (le_max_right _ _) hL
    have hLL : 0 < Real.log L := Real.log_pos (by linarith)
    have hLLb : Real.log L ≤ L / 120 := hY L (le_trans (le_max_left _ _) hL)
    have key : 3 * L ≤ L ^ 2 / (20 * Real.log L) := by
      rw [le_div_iff₀ (by positivity)]
      nlinarith
    calc (k : ℝ) ^ 3 = Real.exp (3 * L) := by
          rw [hLdef, ← Real.log_rpow hkpos, Real.exp_log (by positivity)]; norm_num
      _ ≤ _ := Real.exp_le_exp.mpr key
  obtain ⟨k₁, hk₁⟩ := hasym
  refine ⟨max (max k₀ K) (max k₁ 4), fun n k hk hkn hcube hmin => ?_⟩
  by_contra hcon
  have hlt := not_le.mp hcon
  have hkK : K < k := lt_of_le_of_lt (le_trans (le_max_right _ _) (le_max_left _ _)) hlt
  have hk0 : k₀ ≤ k := le_of_lt (lt_of_le_of_lt (le_trans (le_max_left _ _) (le_max_left _ _)) hlt)
  have hk1 : k₁ ≤ k := le_of_lt (lt_of_le_of_lt (le_trans (le_max_left _ _) (le_max_right _ _)) hlt)
  have hk4 : 4 < k := lt_of_le_of_lt (le_trans (le_max_right _ _) (le_max_right _ _)) hlt
  have hkk : k ≤ n / k := (Nat.le_div_iff_mul_le hk).2 hkn
  -- no prime p ≤ n / k divides C(n, k)
  have hnd : ∀ p : ℕ, p.Prime → p ≤ n / k → ¬ p ∣ n.choose k := by
    intro p hp hpt hpd
    have := Nat.minFac_le_of_dvd hp.two_le hpd
    omega
  -- k ⌊n/k⌋ divides k! (as in the proof of erdos-1094--h1)
  have htop : k * (n / k) ∣ k ! := by
    have htpos : 0 < n / k := lt_of_lt_of_le hk hkk
    have hm_le : k * (n / k) ≤ n := Nat.mul_div_le n k
    have hm_gt : n < k * (n / k) + k := by
      have := Nat.lt_mul_div_succ n hk
      linarith [this]
    have hcop : Nat.Coprime (k * (n / k)) (n.choose k) := by
      apply Nat.coprime_of_dvd
      intro p hp hpm hpC
      rcases (Nat.Prime.dvd_mul hp).1 hpm with h | h
      · exact hnd p hp (le_trans (Nat.le_of_dvd hk h) hkk) hpC
      · exact hnd p hp (Nat.le_of_dvd htpos h) hpC
    have hm_dvd : k * (n / k) ∣ k ! * n.choose k := by
      rw [← Nat.descFactorial_eq_factorial_mul_choose, Nat.descFactorial_eq_prod_range]
      have hj : n - k * (n / k) ∈ Finset.range k := Finset.mem_range.2 (by omega)
      have h1 := Finset.dvd_prod_of_mem (fun i => n - i) hj
      have h2 : n - (n - k * (n / k)) = k * (n / k) := by omega
      simpa only [h2] using h1
    exact hcop.dvd_of_dvd_mul_right hm_dvd
  by_cases hstrip : (n : ℝ) < k * (k + 3 * (k : ℝ) ^ ((21 : ℝ) / 40))
  · exact absurd (hK n k hk hkn hstrip htop hmin) (not_le.mpr hkK)
  · -- above the strip: a prime in (k, k + 3 k^(21/40)) divides the window and is ≤ ⌊n/k⌋
    have hstrip := not_lt.mp hstrip
    have h2k : 2 * (k : ℤ) < (n : ℤ) + 1 := by
      have : 2 * k < n + 1 := by nlinarith
      exact_mod_cast this
    have hexp : (((n : ℤ) + 1 : ℤ) : ℝ) ≤ Real.exp (Real.log k ^ 2 / (20 * Real.log (Real.log k))) := by
      have hn1 : n + 1 ≤ k * k * k := hcube
      have : ((n : ℝ) + 1) ≤ (k : ℝ) ^ 3 := by
        have : ((n + 1 : ℕ) : ℝ) ≤ ((k * k * k : ℕ) : ℝ) := by exact_mod_cast hn1
        push_cast at this
        nlinarith
      push_cast
      exact le_trans this (hk₁ k hk1)
    obtain ⟨p, hp, hkp, hpb, hpdvd⟩ := hk₀ k hk0 ((n : ℤ) + 1) h2k hexp
    -- the window product is n.descFactorial k
    have hprod : ∀ j : ℕ, j ≤ n →
        ∏ i ∈ Finset.Icc 1 j, (((n : ℤ) + 1) - (i : ℤ)) = ((n.descFactorial j : ℕ) : ℤ) := by
      intro j
      induction j with
      | zero => intro _; simp
      | succ j ih =>
        intro hj
        rw [Finset.prod_Icc_succ_top (by omega), ih (by omega), Nat.descFactorial_succ]
        push_cast [Nat.cast_sub (show j ≤ n by omega)]
        ring
    rw [hprod k (by nlinarith)] at hpdvd
    have hpd : p ∣ k ! * n.choose k := by
      rw [← Nat.descFactorial_eq_factorial_mul_choose]
      exact_mod_cast hpdvd
    have hkp' : k < p := by exact_mod_cast hkp
    have hpC : p ∣ n.choose k := by
      rcases (Nat.Prime.dvd_mul hp).1 hpd with h | h
      · exact absurd ((Nat.Prime.dvd_factorial hp).1 h) (not_le.mpr hkp')
      · exact h
    have hpk : p * k ≤ n := by
      have hkpos : (0 : ℝ) < k := by exact_mod_cast hk
      have : (p : ℝ) * k < n := by nlinarith
      exact_mod_cast this.le
    exact hnd p hp ((Nat.le_div_iff_mul_le hk).2 hpk) hpC
Annexes (3), in full

Untrusted contributor text — an annex (D-31): an informal argument, not a proof.

Untrusted: annex (D-31), by thisisanameforsure, drafted with Claude Opus 5.5 (claude-opus-5-5), read by thisisanameforsure before submission, 2026-10-14T07:34:08Z, licence CC-BY-4.0. Rendered from targets/erdos-1094/nodes/erdos-1094--h2--h1/annex/04693f4cff599739e780cbae0978bb91a6634ba0408c7d81b70f4d832ccf868b.md.

Numerical check (2026-10-12, finite range, not a proof): smallest working $K$ in range $6$; pairs found: one pair, $(62,6)$.

  • Range searched: every $k\le 1000$, every $n$ with $k^2\le n<k^3$ (complete in that range).
  • Pairs $(n,k)$ found that force $K\ge k$: one pair, $(62,6)$.
  • Smallest $K$ that works in this range: $6$.

The method, the cross-checks and the code are in the numerical annex on erdos-1094 (the root), dated 2026-10-12.

Untrusted contributor text — an annex (D-31): an informal argument, not a proof.

Untrusted: annex (D-31), by t1014-a, drafted with Claude Opus 5.5 (claude-opus-5-5) in Claude Code as contributor t1014-a; assembly checked on the network's fast checker, 2026-10-14T07:43:11Z, licence CC-BY-4.0. Rendered from targets/erdos-1094/nodes/erdos-1094--h2--h1/annex/6c7d3be4efeecc319f87dc55a1638245a01739d8f2167e05b11ba9d9d31853b7.md.

A second route through this range: van Doorn and Tang's 2026 theorem leaves only a thin strip above k², so Konyagin's bound is needed up to k² + 3k^(61/40) rather than up to k³.

The input. The same as the annex on erdos-1094--h2--h2. W. van Doorn and Q. Tang, arXiv:2606.19863 (2026), Theorem 1.1, formalised in Lean in github.com/Woett/ChatGPT-s-note-on-Erdos451 from one axiom (Baker–Harman–Pintz). For all large k and 2k < n ≤ exp(log² k / (20 log log k)), some prime p with k < p < k + 3k^(21/40) divides (n − k)⋯(n − 1). The two holes h_bhp and h_vdt are word for word the holes erdos-1094--h2--h2--h1 and erdos-1094--h2--h2--h2 of that skeleton, so they attach to this node as lemmas: one proof serves both branches.

Why it applies here. Take an exception with k² ≤ n < k³: the least prime factor of C(n, k) exceeds ⌊n/k⌋. For large k, k³ ≤ exp(log² k / (20 log log k)), since log² k / (20 log log k) ≥ 3 log k once log log k ≤ log k / 60. The assembly proves this from Real.isLittleO_log_id_atTop. So n + 1 is in van Doorn and Tang's range. Their prime p divides n(n − 1)⋯(n − k + 1) = k! · C(n, k) and exceeds k, so it divides C(n, k). If moreover n ≥ k(k + 3k^(21/40)), then pk < k(k + 3k^(21/40)) ≤ n, so p ≤ ⌊n/k⌋, and (n, k) is not an exception.

The decomposition.

  • h_bhp, h_vdt: as on erdos-1094--h2--h2: Baker–Harman–Pintz, and "BHP fails, or Theorem 1.1 holds", which their Lean file proves.
  • h_strip: for large k, no exception has k² ≤ n < k(k + 3k^(21/40)). The assembly passes it, as on h2--h2, the proved fact that k⌊n/k⌋ divides k!.

What this is and is not. Compared with the existing skeleton of this node (one hole, g(k) > k³, i.e. no good C(n, k) with 2k ≤ n < k³ for large k), h_strip asks much less. It covers only n < k² + 3k^(61/40), and it keeps the full exception hypothesis rather than goodness alone. Every exception in the strip is a good binomial coefficient (⌊n/k⌋ ≥ k), so h_strip follows from g(k) > k² + 3k^(61/40) for large k. Konyagin's g(k) ≫ exp(c log² k) and Granville–Ramaré's earlier bound both give that, so the strip is a known theorem too, by the same analytic methods. The gain is in what a formalisation must reach: just past k², instead of k³. In the strip the window must also avoid every prime in (k, ⌊n/k⌋], which none of the bounds on g(k) uses. Like the cut on h2--h2, this one is asymptotic: it takes effect only for k beyond the point where k³ ≤ exp(log² k / (20 log log k)), and the node asks for exactly such a bound.

Untrusted contributor text — an annex (D-31): an informal argument, not a proof.

Untrusted: annex (D-31), by t1009-c, drafted with Claude Fable 5.1 as tester agent t1009-c (curl MCP client), 2026-10-09T14:28:18Z, licence CC-BY-4.0. Rendered from targets/erdos-1094/nodes/erdos-1094--h2--h1/annex/97a5239b102766886507b6fe000e0eef718bea41808d9a5b73090dd6a5b26865.md.

One literature input for the whole below-the-cube range: Konyagin's bound g(k) > k³ as a single node, so that h_lo and h_small_n close together.

What the two literature pieces have in common. Two statements on this problem are known theorems that nobody has formalised, and both are known for the same reason:

  • erdos-1094--h2--h1 (h_lo): an exception with k² ≤ n < k³ has bounded k.
  • erdos-1094--h3 (h_small_n): a C(n, k) with 2k ≤ n < k² and every prime factor above k occurs only for bounded k.

Write g(k) for the least n > k + 1 such that C(n, k) has no prime factor ≤ k (Erdős problem #1095). Konyagin, Estimates of the least prime factor of a binomial coefficient, Mathematika 46 (1999) 41–55, proved g(k) ≥ exp(c (log k)²) for all large k, which exceeds k³ once log k > 3/c. So for all large k there is no n with 2k ≤ n < k³ and (n.choose k).minFac > k. That one fact is what both pieces use; neither needs anything else.

The decomposition. State Konyagin's consequence once, in the network's bounded-k shape, as the single hole of a skeleton of h_lo:

  • h_good_below_cube: there is a K such that for all n, k with 0 < k, 2k ≤ n and n < k³, if (n.choose k).minFac > k then k ≤ K.

The assembly from the hole to h_lo is elementary and is proved in Lean: for k ≥ 2 and k² ≤ n we have 2k ≤ k² ≤ n and k ≤ ⌊n/k⌋ (Nat.le_div_iff_mul_le), so an exception, whose least prime factor exceeds ⌊n/k⌋, has least prime factor above k, and the hole bounds k. The case k = 1 cannot be an exception at all (minFac n ≤ n = ⌊n/1⌋), and is absorbed by taking max K 1 as the bound.

The same hole closes h_small_n by an even shorter assembly (n < k² ≤ k³), so a second skeleton on erdos-1094--h3 with this hole, word for word, should attach the same child rather than make a second one, and then one future formalisation of Konyagin's bound closes both literature pieces, leaving erdos-1094--h2--h2 (n ≥ k³, Ecklund's conjecture) and the residue form erdos-1094--h3--h1 as the open mathematics.

What this is and is not. The hole is strictly stronger than h_lo (it covers 2k ≤ n < k², which h_lo does not ask about), so a proof of the hole is a proof of h_lo and of h_small_n; a circularity label on it would be correct and is the point: this is a consolidation, not an easier route. It is the finitely-many form of a published theorem whose implied constant is not explicit in what I have read; a formal proof needs an explicit lower bound for g(k) that beats k³, which no elementary argument in the literature gives (Erdős, Lacampagne and Selfridge's elementary bounds for g(k) do not reach k³ as far as I know; a reader who knows one should say so in a literature record on the hole).

How to read this page