结论
Erdos Problem 261 asks whether, for every positive integer n (and, in a weaker form, for infinitely many n), the number n/2^n can be written as _i=1^t a_i/2^a_i with t 2 distinct positive integers a_i. Borwein and Loring settled the ``infinitely many'' part with a block of consecutive indices for n=2^u-u-1. We study second representations on this family. For every u 8 and n=2^u-u-1, we prove that every representation other than the Borwein--Loring block +1,,n+u-1 has largest index greater than n+4u-2-_2(3u(u-1)). The bound is
Lean 证明
主定理已在 Lean 4(Mathlib 0df444a360ea)里编译通过,只用 propext、Classical.choice、Quot.sound 三个公理;陈述是否忠实由 gpt-6.2-sol 核对。
完整 Lean 文件
import Mathlib
open Finset
/-- `f j = j / 2^j`. -/
noncomputable def erdos261f (j : ℕ) : ℝ := (j : ℝ) / (2 : ℝ) ^ j
/-- A representation of `f n`: a finite set of at least two distinct positive integers
whose `f`-values sum to `f n`. -/
def IsErdos261Rep (n : ℕ) (A : Finset ℕ) : Prop :=
2 ≤ A.card ∧ (∀ a ∈ A, 0 < a) ∧ ∑ a ∈ A, erdos261f a = erdos261f n
/-- Main theorem: for `u ≥ 8` and `n = 2^u - u - 1`, every representation of `n / 2^n`
other than the Borwein–Loring block `{n+1, …, n+u-1}` has
`max A > n + 4u - 2 - log₂(3u(u-1))`. -/
theorem erdos261_borwein_loring_second_rep_span
(u : ℕ) (hu : 8 ≤ u) (A : Finset ℕ)
(hA : IsErdos261Rep (2 ^ u - u - 1) A)
(hne : A ≠ Finset.Icc (2 ^ u - u - 1 + 1) (2 ^ u - u - 1 + u - 1)) :
∃ hAne : A.Nonempty,
((A.max' hAne : ℕ) : ℝ) >
((2 ^ u - u - 1 : ℕ) : ℝ) + 4 * (u : ℝ) - 2
- Real.logb 2 (3 * (u : ℝ) * ((u : ℝ) - 1)) := by
set_option maxHeartbeats 0 in
set_option maxRecDepth 4096 in
classical
let T (j : ℕ) : ℝ := ((j : ℝ) + 2) / (2 : ℝ) ^ j
have fpos (j : ℕ) (hj : 0 < j) : 0 < erdos261f j := by
unfold erdos261f
exact div_pos (by exact_mod_cast hj) (by positivity)
have sum_le {S U : Finset ℕ} (h : S ⊆ U) :
∑ j ∈ S, erdos261f j ≤ ∑ j ∈ U, erdos261f j := by
apply Finset.sum_le_sum_of_subset_of_nonneg h
intro j _ _
unfold erdos261f
positivity
have split_sum {β : Type} [AddCommMonoid β]
(f : ℕ → β) {S U : Finset ℕ} (h : S ⊆ U) :
(∑ j ∈ U \ S, f j) + (∑ j ∈ S, f j) = ∑ j ∈ U, f j := by
have hd : Disjoint (U \ S) S := Finset.disjoint_left.mpr (by
intro j hj hjS
exact (Finset.mem_sdiff.mp hj).2 hjS)
have he : (U \ S) ∪ S = U := by
ext j
simp only [Finset.mem_union, Finset.mem_sdiff]
constructor
· rintro (hj | hj)
· exact hj.1
· exact h hj
· intro hj
by_cases hjS : j ∈ S
· exact Or.inr hjS
· exact Or.inl ⟨hj, hjS⟩
rw [← Finset.sum_union hd, he]
have step (j : ℕ) : T j - T (j + 1) = erdos261f (j + 1) := by
simp only [T, erdos261f, Nat.cast_add, Nat.cast_one, pow_succ]
field_simp [show (2 : ℝ) ^ j ≠ 0 by positivity] <;> ring
have interval (a b : ℕ) (hab : a ≤ b) :
∑ j ∈ Icc (a + 1) b, erdos261f j = T a - T b := by
induction b with
| zero =>
have ha : a = 0 := by omega
have he : Icc (a + 1) 0 = ∅ := by
ext j
constructor
· intro hj
obtain ⟨hl, hr⟩ := Finset.mem_Icc.mp hj
omega
· simp
rw [he, Finset.sum_empty, ha, sub_self]
| succ b ih =>
change ∑ j ∈ Icc (a + 1) (b + 1), erdos261f j = T a - T (b + 1)
by_cases h : a ≤ b
· have he : Icc (a + 1) (b + 1) = insert (b + 1) (Icc (a + 1) b) := by
ext j
simp only [Finset.mem_Icc, Finset.mem_insert]
omega
have hn : b + 1 ∉ Icc (a + 1) b := by
intro hj
have hh := (Finset.mem_Icc.mp hj).2
omega
rw [he, Finset.sum_insert hn, ih h]
linarith only [step b]
· have ha : a = b + 1 := by omega
have he : Icc (a + 1) (b + 1) = ∅ := by
ext j
constructor
· intro hj
obtain ⟨hl, hr⟩ := Finset.mem_Icc.mp hj
omega
· simp
rw [he, Finset.sum_empty, ha, sub_self]
have fmono (a b : ℕ) (ha : 0 < a) (hab : a ≤ b) :
erdos261f b ≤ erdos261f a := by
have hstep (j : ℕ) (hj : 0 < j) : erdos261f (j + 1) ≤ erdos261f j := by
have hj' : (1 : ℝ) ≤ (j : ℝ) := by
exact_mod_cast (show 1 ≤ j by omega)
have hp : 0 < (2 : ℝ) ^ j := by positivity
have hq : 0 < (2 : ℝ) ^ j * 2 := by positivity
unfold erdos261f
simp only [Nat.cast_add, Nat.cast_one, pow_succ]
apply (div_le_div_iff₀ hq hp).2
calc
((j : ℝ) + 1) * (2 : ℝ) ^ j ≤ (2 * (j : ℝ)) * (2 : ℝ) ^ j :=
mul_le_mul_of_nonneg_right (by linarith only [hj']) hp.le
_ = _ := by ring
induction b with
| zero => omega
| succ b ih =>
change erdos261f (b + 1) ≤ erdos261f a
by_cases h : a ≤ b
· exact (hstep b (by omega)).trans (ih h)
· have he : b + 1 = a := by omega
rw [he]
have growth (v : ℕ) (hv : 8 ≤ v) : 3 * v * (v - 1) < 2 ^ v := by
induction v with
| zero => omega
| succ v ih =>
change 3 * (v + 1) * (v + 1 - 1) < 2 ^ (v + 1)
by_cases h : 8 ≤ v
· rw [show v + 1 - 1 = v by omega, pow_succ]
calc
3 * (v + 1) * v = (v + 1) * (3 * v) := by ring
_ ≤ (2 * (v - 1)) * (3 * v) := Nat.mul_le_mul_right _ (by omega)
_ = (3 * v * (v - 1)) * 2 := by ring
_ < 2 ^ v * 2 := mul_lt_mul_of_pos_right (ih h) (by decide)
· have he : v = 7 := by omega
subst v
decide
have binary_gap (s K : ℕ) (hs : 0 < s)
(hK : K + 2 = 2 ^ u + s) (R : Finset ℕ) (hzero : 0 ∉ R)
(hrange : ∀ r ∈ R, r < s)
(hmass : 2 ^ (s + 1) = K + 2 + ∑ r ∈ R, (K - r) * 2 ^ r) :
3 * (u : ℝ) - 1 - Real.logb 2 (3 * (u : ℝ) * ((u : ℝ) - 1)) <
(s : ℝ) := by
have pow_mono {a b : ℕ} (h : a ≤ b) : (2 : ℕ) ^ a ≤ 2 ^ b := by
have hp : 0 < (2 : ℕ) ^ (b - a) := by positivity
calc
2 ^ a = 2 ^ a * 1 := by rw [mul_one]
_ ≤ 2 ^ a * 2 ^ (b - a) := Nat.mul_le_mul_left _ (by omega)
_ = 2 ^ b := by rw [← pow_add, show a + (b - a) = b by omega]
have pow_dvd (k a t : ℕ) (h : k ≤ a) : 2 ^ k ∣ 2 ^ a * t := by
refine ⟨2 ^ (a - k) * t, ?_⟩
rw [← mul_assoc, ← pow_add, show k + (a - k) = a by omega]
let W (Q : Finset ℕ) : ℕ := ∑ r ∈ Q, (r + 2) * 2 ^ r
have weight_le (Q : Finset ℕ) (b : ℕ) (h : ∀ r ∈ Q, r + 2 ≤ b) :
W Q ≤ b * ∑ r ∈ Q, 2 ^ r := by
dsimp only [W]
rw [Finset.mul_sum]
exact Finset.sum_le_sum (fun r hr => Nat.mul_le_mul_right _ (h r hr))
have full_bits (m : ℕ) :
(∑ r ∈ range m, (2 : ℕ) ^ r) + 1 = 2 ^ m ∧ W (range m) = m * 2 ^ m := by
induction m with
| zero => simp [W]
| succ m ih =>
obtain ⟨hD, hW⟩ := ih
constructor
· change (∑ r ∈ range (m + 1), (2 : ℕ) ^ r) + 1 = 2 ^ (m + 1)
rw [Finset.sum_range_succ, pow_succ]
omega
· change W (range (m + 1)) = (m + 1) * 2 ^ (m + 1)
dsimp only [W] at hW ⊢
rw [Finset.sum_range_succ, hW, pow_succ] <;> ring
let c : ℝ := 3 * (u : ℝ) * ((u : ℝ) - 1)
change 3 * (u : ℝ) - 1 - Real.logb 2 c < (s : ℝ)
have hur : (8 : ℝ) ≤ (u : ℝ) := by exact_mod_cast hu
have hc : 0 < c := by
change 0 < 3 * (u : ℝ) * ((u : ℝ) - 1)
exact mul_pos (mul_pos (by norm_num) (by linarith only [hur])) (by linarith only [hur])
by_cases hlarge : 3 * u ≤ s
· have hl : 3 * (u : ℝ) ≤ (s : ℝ) := by exact_mod_cast hlarge
have hc1 : 1 ≤ c := by
change 1 ≤ 3 * (u : ℝ) * ((u : ℝ) - 1)
nlinarith only [hur, sq_nonneg ((u : ℝ) - 8)]
have hlog : 0 ≤ Real.logb 2 c := by
unfold Real.logb
exact div_nonneg (Real.log_nonneg hc1) (Real.log_nonneg (by norm_num))
linarith only [hl, hlog]
have hsmall : s < 3 * u := by omega
have hgrowth := growth u hu
have hus : u ≤ s := by
by_contra hn
have hh := pow_mono (show s + 1 ≤ u by omega)
omega
let Q := insert 0 R
let D : ℕ := ∑ r ∈ Q, 2 ^ r
have hD : D = 1 + ∑ r ∈ R, 2 ^ r := by
change (∑ r ∈ insert 0 R, (2 : ℕ) ^ r) = 1 + ∑ r ∈ R, 2 ^ r
rw [Finset.sum_insert hzero, pow_zero]
have hW : W Q = 2 + W R := by
change (∑ r ∈ insert 0 R, (r + 2) * 2 ^ r) = 2 + W R
rw [Finset.sum_insert hzero]
simp [W]
have hR : (∑ r ∈ R, (K - r) * 2 ^ r) + W R =
(2 ^ u + s) * ∑ r ∈ R, 2 ^ r := by
dsimp only [W]
rw [← Finset.sum_add_distrib, Finset.mul_sum]
apply Finset.sum_congr rfl
intro r hr
rw [← add_mul]
have hh : K - r + (r + 2) = 2 ^ u + s := by
have hlt := hrange r hr
have hpow : 2 ≤ (2 : ℕ) ^ u := by
simpa using (pow_mono (show 1 ≤ u by omega))
omega
rw [hh]
have hbin : 2 ^ (s + 1) + W Q = (2 ^ u + s) * D + 2 := by
rw [hD, hW, mul_add, mul_one]
omega
have hlower : (2 ^ u - 1) * D ≤ 2 ^ (s + 1) := by
rw [hD, mul_add, mul_one, Finset.mul_sum, hmass]
refine Nat.add_le_add (show 2 ^ u - 1 ≤ K + 2 by omega) ?_
apply Finset.sum_le_sum
intro r hr
apply Nat.mul_le_mul_right
have hlt := hrange r hr
omega
let m := s + 1 - u
have hmu_sum : u + m = s + 1 := by dsimp [m]; omega
have hsm : m + (u - 1) = s := by omega
have hp : (2 : ℕ) ^ (s + 1) = 2 ^ u * 2 ^ m := by
rw [← pow_add, hmu_sum]
rw [hp] at hbin hlower
have hp4 : 4 ≤ (2 : ℕ) ^ u := by
simpa using (pow_mono (show 2 ≤ u by omega))
have hDt : D < 2 ^ (m + 1) := by
by_contra! hh
have hle := (Nat.mul_le_mul_left (2 ^ u - 1) hh).trans hlower
have hlt : (2 : ℕ) ^ u * 2 ^ m < (2 ^ u - 1) * 2 ^ (m + 1) := calc
_ < ((2 ^ u - 1) * 2) * 2 ^ m :=
mul_lt_mul_of_pos_right (by omega) (by positivity)
_ = _ := by rw [pow_succ] <;> ring
exact (not_lt_of_ge hle) hlt
have hbit (r : ℕ) (hr : r ∈ Q) : 2 ^ r ≤ D := by
change 2 ^ r ≤ ∑ i ∈ Q, (2 : ℕ) ^ i
exact Finset.single_le_sum (fun _ _ => Nat.zero_le _) hr
have hWle : W Q ≤ (m + 2) * D := by
apply weight_le
intro r hr
by_contra hh
have hle := (pow_mono (show m + 1 ≤ r by omega)).trans (hbit r hr)
omega
have hDsmall : D < 2 ^ m := by
by_contra! hh
have hh' := Nat.mul_le_mul_left (2 ^ u) hh
have hcoef := Nat.mul_le_mul_right D (show 2 ^ u + (m + 2) ≤ 2 ^ u + s by omega)
rw [add_mul (2 ^ u) (m + 2) D] at hcoef
omega
have hQ : Q ⊆ range m := by
intro r hr
apply Finset.mem_range.mpr
by_contra! hh
have hle := (pow_mono hh).trans (hbit r hr)
omega
let E := range m \ Q
let e : ℕ := 1 + ∑ r ∈ E, 2 ^ r
have hfull := full_bits m
have hde : D + e = 2 ^ m := by
have hh := split_sum (fun r : ℕ => (2 : ℕ) ^ r) hQ
change (∑ r ∈ E, (2 : ℕ) ^ r) + D = ∑ r ∈ range m, (2 : ℕ) ^ r at hh
change D + (1 + ∑ r ∈ E, 2 ^ r) = 2 ^ m
have hsum := hfull.1
omega
have hWE : W E + W Q = m * 2 ^ m := by
have hh : W E + W Q = W (range m) :=
split_sum (fun r : ℕ => (r + 2) * 2 ^ r) hQ
exact hh.trans hfull.2
have hEbound : W E ≤ (m + 1) * ∑ r ∈ E, 2 ^ r := by
apply weight_le
intro r hr
have hlt := Finset.mem_range.mp (Finset.mem_sdiff.mp hr).1
omega
have hBpos' : W E + 2 < s * e := by
have hcoef := Nat.mul_le_mul_right e (show m + 2 ≤ s by omega)
have hepos : 1 ≤ e := by dsimp [e]; omega
have hmul : (m + 2) * e =
(m + 1) * (∑ r ∈ E, 2 ^ r) + (m + 1) + e := by
dsimp only [e]
ring
have hmpos : 1 ≤ m := by omega
omega
let B := s * e - (W E + 2)
have hBadd : B + (W E + 2) = s * e := Nat.sub_add_cancel hBpos'.le
have hBpos : 0 < B := by omega
have hBlt : B < s * e := by omega
have hkey : (u - 1) * 2 ^ m = 2 ^ u * e + B := by
have hh := congrArg (fun x : ℕ => (2 ^ u + s) * x) hde
change (2 ^ u + s) * (D + e) = (2 ^ u + s) * 2 ^ m at hh
rw [mul_add, add_mul (2 ^ u) s e, add_mul (2 ^ u) s (2 ^ m)] at hh
have hsp : s * 2 ^ m = m * 2 ^ m + (u - 1) * 2 ^ m := by
rw [← add_mul, hsm]
omega
have hBdvd (k : ℕ) (hkm : k ≤ m) (hku : k ≤ u) : 2 ^ k ∣ B := by
have h1 : 2 ^ k ∣ (u - 1) * 2 ^ m := by
rw [mul_comm (u - 1) (2 ^ m)]
exact pow_dvd k m (u - 1) hkm
have h2 := pow_dvd k u e hku
have heq : B = (u - 1) * 2 ^ m - 2 ^ u * e := by omega
rw [heq]
exact Nat.dvd_sub h1 h2
have hbound : 2 ^ u * B < (3 * u * (u - 1)) * 2 ^ m := by
calc
2 ^ u * B < 2 ^ u * (s * e) := mul_lt_mul_of_pos_left hBlt (by positivity)
_ = s * (2 ^ u * e) := by ring
_ < s * ((u - 1) * 2 ^ m) := mul_lt_mul_of_pos_left (by omega) hs
_ = (s * (u - 1)) * 2 ^ m := by ring
_ ≤ (3 * u * (u - 1)) * 2 ^ m :=
Nat.mul_le_mul_right _ (Nat.mul_le_mul_right _ hsmall.le)
have hmu : u < m := by
by_contra! hh
have hle : 2 ^ m ≤ B := Nat.le_of_dvd hBpos (hBdvd m le_rfl hh)
have hlt := (Nat.mul_le_mul_left (2 ^ u) hle).trans_lt hbound
exact (not_lt_of_ge (Nat.mul_le_mul_right (2 ^ m) hgrowth.le)) hlt
have hlt : 2 ^ u * 2 ^ u < (3 * u * (u - 1)) * 2 ^ m :=
(Nat.mul_le_mul_left (2 ^ u)
(Nat.le_of_dvd hBpos (hBdvd u hmu.le le_rfl))).trans_lt hbound
have hcr : ((3 * u * (u - 1) : ℕ) : ℝ) = c := by
simp only [c, Nat.cast_mul, Nat.cast_ofNat,
Nat.cast_sub (show 1 ≤ u by omega), Nat.cast_one]
have hltr : (2 : ℝ) ^ u * (2 : ℝ) ^ u < c * (2 : ℝ) ^ m := by
rw [← hcr]
have hcast : ((2 ^ u * 2 ^ u : ℕ) : ℝ) <
(((3 * u * (u - 1)) * 2 ^ m : ℕ) : ℝ) := by exact_mod_cast hlt
simpa only [Nat.cast_mul, Nat.cast_pow, Nat.cast_ofNat] using hcast
have hlog : 2 * (u : ℝ) - (m : ℝ) < Real.logb 2 c := by
have hl := Real.log_lt_log (by positivity : 0 < (2 : ℝ) ^ u * (2 : ℝ) ^ u) hltr
have hpu : (2 : ℝ) ^ u ≠ 0 := by positivity
have hpm : (2 : ℝ) ^ m ≠ 0 := by positivity
rw [Real.log_mul hpu hpu, Real.log_mul (ne_of_gt hc) hpm] at hl
simp only [Real.log_pow] at hl
unfold Real.logb
apply (lt_div_iff₀ (Real.log_pos (by norm_num : (1 : ℝ) < 2))).2
nlinarith only [hl]
have hsr : (m : ℝ) + (u : ℝ) = (s : ℝ) + 1 := by
have h : m + u = s + 1 := by omega
simpa only [Nat.cast_add, Nat.cast_one] using congrArg (fun x : ℕ => (x : ℝ)) h
linarith only [hlog, hsr]
let n := 2 ^ u - u - 1
let M := n + u - 1
let C := Icc (n + 1) M
let P := Icc (n + 1) (M - 1)
change A ≠ C at hne
change IsErdos261Rep n A at hA
obtain ⟨hcard, hpos, hAsum⟩ := hA
have hcard_pos : 0 < A.card := by omega
have hAne : A.Nonempty := Finset.card_pos.mp hcard_pos
let K := A.max' hAne
have hKA : K ∈ A := Finset.max'_mem A hAne
have hmax (j : ℕ) (hj : j ∈ A) : j ≤ K := Finset.le_max' A j hj
have hu2 : u < 2 ^ u := by
have h3 : u ≤ 3 * u := by omega
have hl : u ≤ 3 * u * (u - 1) := calc
u = u * 1 := by rw [mul_one]
_ ≤ 3 * u * (u - 1) := Nat.mul_le_mul h3 (by omega)
exact hl.trans_lt (growth u hu)
have hM2 : M + 2 = 2 ^ u := by dsimp [M, n]; omega
have hMn : M = n + (u - 1) := by dsimp [M]; omega
have hM4 : 4 < M := by omega
have hnM : n ≤ M := by omega
have hn1M : n + 1 ≤ M := by omega
have hTM : T M = 2 / (2 : ℝ) ^ n := by
have hnum : (M : ℝ) + 2 = (2 : ℝ) ^ u := by
simpa only [Nat.cast_add, Nat.cast_pow, Nat.cast_ofNat] using
congrArg (fun x : ℕ => (x : ℝ)) hM2
have ha : u - 1 + 1 = u := by omega
have hp : (2 : ℝ) ^ (u - 1) * 2 = (2 : ℝ) ^ u := by rw [← pow_succ, ha]
have hpM : (2 : ℝ) ^ M = (2 : ℝ) ^ n * (2 : ℝ) ^ (u - 1) := by
rw [← pow_add, ← hMn]
dsimp only [T]
rw [hnum, hpM, ← hp]
field_simp [show (2 : ℝ) ^ n ≠ 0 by positivity,
show (2 : ℝ) ^ (u - 1) ≠ 0 by positivity] <;> ring
have hblockT : ∑ j ∈ C, erdos261f j = T n - T M := interval n M hnM
have hblock : ∑ j ∈ C, erdos261f j = erdos261f n := by
rw [hblockT, hTM]
simp only [T, erdos261f]
rw [← sub_div] <;> ring
have hTn : T n = erdos261f n + T M := by linarith only [hblockT, hblock]
have hAbove (j : ℕ) (hj : j ∈ A) : n < j := by
by_contra! hjn
have hex : ∃ b ∈ A, b ≠ j := by
by_contra hh
have hsub : A ⊆ {j} := by
intro b hb
apply Finset.mem_singleton.mpr
by_cases hbj : b = j
· exact hbj
· exact (hh ⟨b, hb, hbj⟩).elim
have hc : A.card ≤ ({j} : Finset ℕ).card := Finset.card_le_card hsub
rw [Finset.card_singleton] at hc
omega
obtain ⟨b, hb, hbj⟩ := hex
have hbnot : b ∉ ({j} : Finset ℕ) := by simpa only [Finset.mem_singleton] using hbj
have hsub : insert b {j} ⊆ A := by
intro x hx
rcases Finset.mem_insert.mp hx with he | he
· simpa only [he] using hb
· have hxj := Finset.mem_singleton.mp he
simpa only [hxj] using hj
have hle := sum_le hsub
rw [Finset.sum_insert hbnot, Finset.sum_singleton, hAsum] at hle
have hm := fmono j n (hpos j hj) hjn
have hbpos := fpos b (hpos b hb)
linarith only [hle, hm, hbpos]
have hlast : T M < erdos261f (M - 1) := by
have hmp : M - 1 + 1 = M := by omega
have hmcast : ((M - 1 : ℕ) : ℝ) + 1 = (M : ℝ) := by
simpa only [Nat.cast_add, Nat.cast_one] using
congrArg (fun x : ℕ => (x : ℝ)) hmp
have hM4r : (4 : ℝ) < (M : ℝ) := by exact_mod_cast hM4
have hpM : (2 : ℝ) ^ M = (2 : ℝ) ^ (M - 1) * 2 := by
rw [← pow_succ, hmp]
calc
T M = (((M : ℝ) + 2) / 2) / (2 : ℝ) ^ (M - 1) := by
dsimp only [T]
rw [hpM]
field_simp [show (2 : ℝ) ^ (M - 1) ≠ 0 by positivity] <;> ring
_ < erdos261f (M - 1) := by
unfold erdos261f
exact div_lt_div_of_pos_right (by linarith only [hmcast, hM4r]) (by positivity)
have hPA : P ⊆ A := by
intro j hj
have hjP : n + 1 ≤ j ∧ j ≤ M - 1 := Finset.mem_Icc.mp hj
by_contra hjA
let L := max K M
have hKL : K ≤ L := le_max_left _ _
have hML : M ≤ L := le_max_right _ _
have hsub : insert j A ⊆ Icc (n + 1) L := by
intro x hx
apply Finset.mem_Icc.mpr
rcases Finset.mem_insert.mp hx with he | he
· subst x
exact ⟨hjP.1, le_trans (show j ≤ M by omega) hML⟩
· refine ⟨?_, (hmax x he).trans hKL⟩
have hh := hAbove x he
omega
have hle := sum_le hsub
have hnL : n ≤ L := hnM.trans hML
rw [Finset.sum_insert hjA, hAsum, interval n L hnL] at hle
have hTL : 0 ≤ T L := by dsimp only [T]; positivity
have hf := fmono j (M - 1) (by omega) hjP.2
linarith only [hle, hTL, hf, hlast, hTn]
have hCP : insert M P = C := by
ext j
change (j ∈ insert M (Icc (n + 1) (M - 1))) ↔ j ∈ Icc (n + 1) M
simp only [Finset.mem_insert, Finset.mem_Icc]
omega
have hMP : M ∉ P := by
intro h
have hh : M ≤ M - 1 := (Finset.mem_Icc.mp h).2
omega
have hMnot : M ∉ A := by
intro hMA
have hCA : C ⊆ A := by
rw [← hCP]
intro j hj
rcases Finset.mem_insert.mp hj with he | he
· simpa only [he] using hMA
· exact hPA he
have hAC : A ⊆ C := by
intro j hj
by_contra hjC
have hsub : insert j C ⊆ A := by
intro x hx
rcases Finset.mem_insert.mp hx with he | he
· simpa only [he] using hj
· exact hCA he
have hle := sum_le hsub
rw [Finset.sum_insert hjC, hblock, hAsum] at hle
have hfj := fpos j (hpos j hj)
linarith only [hle, hfj]
apply hne
ext j
exact ⟨fun hj => hAC hj, fun hj => hCA hj⟩
let S := A \ P
have hSsum : ∑ j ∈ S, erdos261f j = erdos261f M := by
have hh : (∑ j ∈ S, erdos261f j) + (∑ j ∈ P, erdos261f j) =
∑ j ∈ A, erdos261f j := split_sum erdos261f hPA
have hh' := hblock
rw [← hCP, Finset.sum_insert hMP] at hh'
linarith only [hh, hh', hAsum]
have hSgt (j : ℕ) (hj : j ∈ S) : M < j := by
have hjA : j ∈ A := (Finset.mem_sdiff.mp hj).1
have hjP : j ∉ P := (Finset.mem_sdiff.mp hj).2
have hnj := hAbove j hjA
by_contra! h
by_cases he : j = M
· subst j
exact hMnot hjA
· exact hjP (Finset.mem_Icc.mpr ⟨by omega, by omega⟩)
have hSne : S.Nonempty := by
by_contra hn
have he : S = ∅ := by
ext j
constructor
· intro hj
exact (hn ⟨j, hj⟩).elim
· simp
rw [he, Finset.sum_empty] at hSsum
have hposM := fpos M (by omega)
linarith only [hSsum, hposM]
have hMK : M < K := by
obtain ⟨j, hj⟩ := hSne
exact (hSgt j hj).trans_le (hmax j (Finset.mem_sdiff.mp hj).1)
have hKS : K ∈ S := by
refine Finset.mem_sdiff.mpr ⟨hKA, ?_⟩
intro h
have hh : K ≤ M - 1 := (Finset.mem_Icc.mp h).2
omega
let s := K - M
have hs : 0 < s := by dsimp [s]; omega
have hKs : K = M + s := by dsimp [s]; omega
let J := Icc (M + 1) K
let O := J \ S
have hSJ : S ⊆ J := by
intro j hj
have hlt := hSgt j hj
exact Finset.mem_Icc.mpr ⟨by omega, hmax j (Finset.mem_sdiff.mp hj).1⟩
have hmass : (∑ j ∈ O, erdos261f j) + T K = 2 / (2 : ℝ) ^ M := by
have hh : (∑ j ∈ O, erdos261f j) + (∑ j ∈ S, erdos261f j) =
∑ j ∈ J, erdos261f j := split_sum erdos261f hSJ
have ht : ∑ j ∈ J, erdos261f j = T M - T K := interval M K hMK.le
have he : T M - erdos261f M = 2 / (2 : ℝ) ^ M := by
simp only [T, erdos261f]
rw [← sub_div] <;> ring
linarith only [hh, ht, hSsum, he]
let R := (range s).filter (fun r => K - r ∈ O)
have hz : 0 ∉ R := by
intro h
have hh : K - 0 ∈ O := (Finset.mem_filter.mp h).2
rw [Nat.sub_zero] at hh
exact (Finset.mem_sdiff.mp hh).2 hKS
have hr (r : ℕ) (h : r ∈ R) : r < s :=
Finset.mem_range.mp (Finset.mem_filter.mp h).1
have hImg : R.image (fun r => K - r) = O := by
ext j
constructor
· intro hj
obtain ⟨r, hr', he⟩ := Finset.mem_image.mp hj
change K - r = j at he
have hh : K - r ∈ O := (Finset.mem_filter.mp hr').2
simpa only [he] using hh
· intro hj
have hjJ : M + 1 ≤ j ∧ j ≤ K := Finset.mem_Icc.mp (Finset.mem_sdiff.mp hj).1
have he : K - (K - j) = j := by omega
refine Finset.mem_image.mpr ⟨K - j, ?_, he⟩
refine Finset.mem_filter.mpr ⟨Finset.mem_range.mpr (by omega), ?_⟩
change K - (K - j) ∈ O
simpa only [he] using hj
have hO : ∑ j ∈ O, erdos261f j = ∑ r ∈ R, erdos261f (K - r) := by
rw [← hImg]
apply Finset.sum_image
intro a ha b hb hab
have h1 := hr a ha
have h2 := hr b hb
change K - a = K - b at hab
omega
have hscaled : (∑ j ∈ O, erdos261f j) * (2 : ℝ) ^ K =
∑ r ∈ R, ((K - r : ℕ) : ℝ) * (2 : ℝ) ^ r := by
rw [hO, Finset.sum_mul]
apply Finset.sum_congr rfl
intro r hr'
have hrK : r ≤ K := by
have hlt := hr r hr'
omega
have hp : (2 : ℝ) ^ K = (2 : ℝ) ^ (K - r) * (2 : ℝ) ^ r := by
rw [← pow_add, Nat.sub_add_cancel hrK]
unfold erdos261f
rw [hp]
field_simp [show (2 : ℝ) ^ (K - r) ≠ 0 by positivity] <;> ring
have htail : T K * (2 : ℝ) ^ K = (K : ℝ) + 2 := by
dsimp only [T]
exact div_mul_cancel₀ _ (by positivity)
have hright : (2 / (2 : ℝ) ^ M) * (2 : ℝ) ^ K = (2 : ℝ) ^ (s + 1) := by
rw [hKs, pow_add (2 : ℝ) M s, pow_succ (2 : ℝ) s]
field_simp [show (2 : ℝ) ^ M ≠ 0 by positivity] <;> ring
have hnat : 2 ^ (s + 1) = K + 2 + ∑ r ∈ R, (K - r) * 2 ^ r := by
have hh : (2 : ℝ) ^ (s + 1) =
(K : ℝ) + 2 + ∑ r ∈ R, ((K - r : ℕ) : ℝ) * (2 : ℝ) ^ r := calc
_ = (2 / (2 : ℝ) ^ M) * (2 : ℝ) ^ K := hright.symm
_ = ((∑ j ∈ O, erdos261f j) + T K) * (2 : ℝ) ^ K := by rw [hmass]
_ = _ := by
rw [add_mul, hscaled, htail]
exact add_comm _ _
have hc : ((2 ^ (s + 1) : ℕ) : ℝ) =
((K + 2 + ∑ r ∈ R, (K - r) * 2 ^ r : ℕ) : ℝ) := by
simpa only [Nat.cast_pow, Nat.cast_add, Nat.cast_ofNat, Nat.cast_sum,
Nat.cast_mul] using hh
exact_mod_cast hc
have hK2 : K + 2 = 2 ^ u + s := by rw [hKs, add_right_comm M s 2, hM2]
have hgap := binary_gap s K hs hK2 R hz hr hnat
have hKr : (K : ℝ) + 1 = (n : ℝ) + (u : ℝ) + (s : ℝ) := by
have h : K + 1 = n + u + s := by omega
simpa only [Nat.cast_add, Nat.cast_one] using congrArg (fun x : ℕ => (x : ℝ)) h
refine ⟨hAne, ?_⟩
change (K : ℝ) > (n : ℝ) + 4 * (u : ℝ) - 2 -
Real.logb 2 (3 * (u : ℝ) * ((u : ℝ) - 1))
linarith only [hgap, hKr]
#print axioms erdos261_borwein_loring_second_rep_spanAI 和人各做了什么
AI:Claude Opus 5.5 / gpt-6.2-sol / gpt-6.2-astra 在自动流程里提出结论和证明;Claude Sonnet 自查,gpt-6.2-sol 两轮严审(high、xhigh),Claude Opus 独立复审并联网查新。人:项目负责人设定目标、搭建流程,对内容负责;没有人工审稿。
发布日期:2026-11-30