| | @@ -4,7 +4,7 @@ import FormalConjectures.ErdosProblems.«329» |
| 4 | 4 | # Erdős Problem 329: a Sidon set with positive `√N`-density |
| 5 | 5 | |
| 6 | 6 | Blocks of the Erdős–Turán Sidon set `{2pk + (k² mod p) : k < p}` (for an odd prime `p`), shifted far |
| 7 | | −apart, give an infinite Sidon set `A` with `|A ∩ [1, N]| ≥ √N / 3` for infinitely many `N`. |
| 7 | +apart, give an infinite Sidon set `A` with `|A ∩ [1, N]| ≥ √N / 2` for infinitely many `N`. |
| 8 | 8 | A Sidon set also has `|A ∩ [1, N]|² ≤ 4N`, so the `limsup` is of a bounded sequence. |
| 9 | 9 | -/ |
| 10 | 10 | |
| | @@ -279,19 +279,21 @@ theorem sidon_density_le {B : Set ℕ} (hB : IsSidon B) (N : ℕ) : |
| 279 | 279 | Real.mul_self_sqrt (by positivity)] |
| 280 | 280 | nlinarith [Nat.cast_nonneg (α := ℝ) F.card] |
| 281 | 281 | |
| 282 | +private theorem block_subset_A_inter_Icc (n : ℕ) : |
| 283 | + (block (T n) : Set ℕ) ⊆ A ∩ Set.Icc 1 (T (n + 1)) := by |
| 284 | + intro x hx |
| 285 | + obtain ⟨hlo, hhi⟩ := block_bounds hx |
| 286 | + have hp := (P_prime (T n)).pos |
| 287 | + have hshift : 0 < shift (T n) := by unfold shift; positivity |
| 288 | + exact ⟨⟨n, hx⟩, hshift.trans_le hlo, (T_succ n).symm ▸ hhi.le⟩ |
| 289 | + |
| 282 | 290 | theorem A_density_ge (n : ℕ) : 1 / 3 ≤ _root_.Erdos329.sqrtPartialDensity A (T (n + 1)) := by |
| 283 | 291 | unfold _root_.Erdos329.sqrtPartialDensity |
| 284 | 292 | set p := P (T n) |
| 285 | 293 | have hp := P_ge (T n) |
| 286 | | − have hsub : (block (T n) : Set ℕ) ⊆ A ∩ Set.Icc 1 (T (n + 1)) := by |
| 287 | | − intro x hx |
| 288 | | − have := block_bounds hx |
| 289 | | − refine ⟨⟨n, hx⟩, ?_, ?_⟩ |
| 290 | | − · have : 1 ≤ shift (T n) := by unfold shift; nlinarith |
| 291 | | − omega |
| 292 | | − · rw [T_succ]; omega |
| 293 | 294 | have hc : (p : ℝ) ≤ (A ∩ Set.Icc 1 (T (n + 1))).ncard := by |
| 294 | | − have := Set.ncard_le_ncard hsub ((Set.finite_Icc _ _).subset Set.inter_subset_right) |
| 295 | + have := Set.ncard_le_ncard (block_subset_A_inter_Icc n) |
| 296 | + ((Set.finite_Icc _ _).subset Set.inter_subset_right) |
| 295 | 297 | rw [Set.ncard_coe_finset, card_block] at this |
| 296 | 298 | exact_mod_cast this |
| 297 | 299 | have hN : (T (n + 1) : ℝ) ≤ (3 * p) * (3 * p) := by |
| | @@ -307,17 +309,50 @@ theorem A_density_ge (n : ℕ) : 1 / 3 ≤ _root_.Erdos329.sqrtPartialDensity A |
| 307 | 309 | rw [le_div_iff₀ hs0] |
| 308 | 310 | nlinarith |
| 309 | 311 | |
| 310 | | −theorem exists_sidon_pos_density : |
| 311 | | − ∃ (A : Set ℕ), IsSidon A ∧ 0 < _root_.Erdos329.sidonUpperDensity A := by |
| 312 | | − refine ⟨A, A_sidon, ?_⟩ |
| 313 | | − have hb : IsBoundedUnder (· ≤ ·) atTop (fun N => _root_.Erdos329.sqrtPartialDensity A N) := |
| 314 | | − isBoundedUnder_of_eventually_le (a := 2) (Eventually.of_forall (sidon_density_le A_sidon)) |
| 315 | | − have hf : ∃ᶠ N in atTop, (1 / 3 : ℝ) ≤ _root_.Erdos329.sqrtPartialDensity A N := by |
| 316 | | − rw [frequently_atTop] |
| 317 | | − intro m |
| 318 | | − exact ⟨T (m + 1), (le_T _).trans' (by omega), A_density_ge m⟩ |
| 319 | | − have := le_limsup_of_frequently_le hf hb |
| 320 | | − unfold _root_.Erdos329.sidonUpperDensity |
| 312 | +/-- At each block endpoint after the first, one earlier point and the entire |
| 313 | +new block give Erdős' one-half lower bound for the square-root density. -/ |
| 314 | +theorem half_le_A_density (n : ℕ) (hn : 1 ≤ n) : |
| 315 | + 1 / 2 ≤ _root_.Erdos329.sqrtPartialDensity A (T (n + 1)) := by |
| 316 | + obtain ⟨x, hx⟩ : (block (T 0)).Nonempty := by |
| 317 | + rw [← Finset.card_pos, card_block] |
| 318 | + exact (P_prime _).pos |
| 319 | + have hxold := stage_lt n x (block_subset_stage hn hx) |
| 320 | + have hxout : x ∉ block (T n) := by |
| 321 | + intro h |
| 322 | + have hlo := (block_bounds h).1 |
| 323 | + unfold shift at hlo |
| 324 | + omega |
| 325 | + have hsub : (↑(insert x (block (T n))) : Set ℕ) ⊆ A ∩ Set.Icc 1 (T (n + 1)) := by |
| 326 | + intro y hy |
| 327 | + rcases Finset.mem_insert.mp hy with rfl | hy |
| 328 | + · have hxfirst := block_subset_A_inter_Icc 0 hx |
| 329 | + exact ⟨hxfirst.1, hxfirst.2.1, hxold.le.trans (by have := T_le_succ n; omega)⟩ |
| 330 | + · exact block_subset_A_inter_Icc n hy |
| 331 | + have hcard := Set.ncard_le_ncard hsub ((Set.finite_Icc _ _).subset Set.inter_subset_right) |
| 332 | + rw [Set.ncard_coe_finset, Finset.card_insert_of_notMem hxout, card_block] at hcard |
| 333 | + have hc : (P (T n) : ℝ) + 1 ≤ (A ∩ Set.Icc 1 (T (n + 1))).ncard := by |
| 334 | + exact_mod_cast hcard |
| 335 | + have hsqrt : Real.sqrt (T (n + 1)) ≤ 2 * ((P (T n) : ℝ) + 1) := by |
| 336 | + apply (Real.sqrt_le_left (by positivity)).2 |
| 337 | + rw [T_succ] |
| 338 | + push_cast |
| 339 | + have hp : (T n : ℝ) + 3 ≤ P (T n) := by exact_mod_cast P_ge (T n) |
| 340 | + nlinarith |
| 341 | + have hpos : (0 : ℝ) < T (n + 1) := by |
| 342 | + exact_mod_cast (Nat.zero_lt_of_lt (T_le_succ n)) |
| 343 | + rw [_root_.Erdos329.sqrtPartialDensity, le_div_iff₀ (Real.sqrt_pos.mpr hpos)] |
| 321 | 344 | linarith |
| 322 | 345 | |
| 346 | +/-- The Erdős–Turán block construction attains upper square-root density at least one half. -/ |
| 347 | +theorem half_le_A_sidonUpperDensity : 1 / 2 ≤ _root_.Erdos329.sidonUpperDensity A := by |
| 348 | + apply le_limsup_of_frequently_le _ (isBoundedUnder_of_eventually_le (a := 2) |
| 349 | + (Eventually.of_forall (sidon_density_le A_sidon))) |
| 350 | + rw [frequently_atTop] |
| 351 | + intro m |
| 352 | + exact ⟨T (m + 1 + 1), (le_T _).trans' (by omega), half_le_A_density (m + 1) (by omega)⟩ |
| 353 | + |
| 354 | +theorem exists_sidon_pos_density : |
| 355 | + ∃ (A : Set ℕ), IsSidon A ∧ 0 < _root_.Erdos329.sidonUpperDensity A := |
| 356 | + ⟨A, A_sidon, lt_of_lt_of_le (by norm_num) half_le_A_sidonUpperDensity⟩ |
| 357 | + |
| 323 | 358 | end ErdosSwarm.Erdos329 |