-
Notifications
You must be signed in to change notification settings - Fork 227
feat(ErdosProblems): 43 #307
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 5 commits
4c87eae
42ef9ec
fdd33e8
8c0e1a5
2d87566
4ed0afb
35b40cf
747be5f
c6e7ecc
815e023
751efab
ed2cf46
a6e0082
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,62 @@ | ||||||||||||||
| /- | ||||||||||||||
| Copyright 2025 The Formal Conjectures Authors. | ||||||||||||||
|
|
||||||||||||||
| Licensed under the Apache License, Version 2.0 (the "License"); | ||||||||||||||
| you may not use this file except in compliance with the License. | ||||||||||||||
| You may obtain a copy of the License at | ||||||||||||||
|
|
||||||||||||||
| https://www.apache.org/licenses/LICENSE-2.0 | ||||||||||||||
|
|
||||||||||||||
| Unless required by applicable law or agreed to in writing, software | ||||||||||||||
| distributed under the License is distributed on an "AS IS" BASIS, | ||||||||||||||
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||||||||||||||
| See the License for the specific language governing permissions and | ||||||||||||||
| limitations under the License. | ||||||||||||||
| -/ | ||||||||||||||
|
|
||||||||||||||
| import FormalConjectures.Util.ProblemImports | ||||||||||||||
| import FormalConjectures.ForMathlib.Combinatorics.Basic | ||||||||||||||
|
|
||||||||||||||
| /-! | ||||||||||||||
| # Erdős Problem 43 | ||||||||||||||
| *Reference:* [erdosproblems.com/43](https://www.erdosproblems.com/43) | ||||||||||||||
|
|
||||||||||||||
| -/ | ||||||||||||||
callesonne marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||||
|
|
||||||||||||||
| open scoped Pointwise | ||||||||||||||
|
|
||||||||||||||
| /-- The maximum size of a Sidon set in `{1, ..., N}`. This version is computable. -/ | ||||||||||||||
| def maxSidonSetSize := maxSidonSetSize' | ||||||||||||||
|
|
||||||||||||||
mo271 marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||||
| /-- | ||||||||||||||
| If `A` and `B` are Sidon sets in `{1, ..., N}` with disjoint difference sets, | ||||||||||||||
| is the sum of unordered pair counts bounded by that of an optimal Sidon set up to `O(1)`? | ||||||||||||||
|
Comment on lines
+29
to
+30
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Better to stick to the original formulation. |
||||||||||||||
| -/ | ||||||||||||||
| @[category research open, AMS 11 05] | ||||||||||||||
| theorem erdos_43 : | ||||||||||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. since this is phrased as a questions, we should wrap the entire statement in parenthesis and write |
||||||||||||||
| ∃ C : ℝ, ∀ (N : ℕ) (A B : Finset ℕ), | ||||||||||||||
| A ⊆ Finset.Icc 1 N → | ||||||||||||||
| B ⊆ Finset.Icc 1 N → | ||||||||||||||
| IsSidon A.toSet → | ||||||||||||||
| IsSidon B.toSet → | ||||||||||||||
| (A - A) ∩ (B - B) = ∅ → | ||||||||||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
In both |
||||||||||||||
| ((A.card * (A.card - 1) + B.card * (B.card - 1)) / 2 : ℝ) ≤ | ||||||||||||||
| (maxSidonSetSize N * (maxSidonSetSize N - 1) / 2 : ℝ) + C := by | ||||||||||||||
mo271 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||||||||||||
| sorry | ||||||||||||||
|
|
||||||||||||||
| /-- | ||||||||||||||
| If `A` and `B` are equal-sized Sidon sets with disjoint difference sets, | ||||||||||||||
| can the sum of pair counts be bounded by a strict fraction of the optimum? | ||||||||||||||
| -/ | ||||||||||||||
| @[category research open, AMS 11 05] | ||||||||||||||
| theorem erdos_43_equal_size : | ||||||||||||||
| ∃ c : ℝ, 0 < c ∧ ∀ (N : ℕ) (A B : Finset ℕ), | ||||||||||||||
mo271 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||||||||||||
| A ⊆ Finset.Icc 1 N → | ||||||||||||||
| B ⊆ Finset.Icc 1 N → | ||||||||||||||
| IsSidon A.toSet → | ||||||||||||||
| IsSidon B.toSet → | ||||||||||||||
| A.card = B.card → | ||||||||||||||
| (A - A) ∩ (B - B) = ∅ → | ||||||||||||||
| ((A.card * (A.card - 1) + B.card * (B.card - 1)) / 2 : ℝ) ≤ | ||||||||||||||
| (1 - c) * (maxSidonSetSize N * (maxSidonSetSize N - 1) / 2 : ℝ) := by | ||||||||||||||
mo271 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||||||||||||
| sorry | ||||||||||||||
|
Comment on lines
+44
to
+57
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same comments as to the first theorem apply here. |
||||||||||||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -17,6 +17,9 @@ limitations under the License. | |||||
| import Mathlib.Algebra.Group.Defs | ||||||
| import Mathlib.Data.Set.Card | ||||||
| import Mathlib.Order.Defs.PartialOrder | ||||||
| import Mathlib.Data.Finset.Basic | ||||||
| import Mathlib.Data.Finset.Powerset | ||||||
| import Mathlib.Data.Nat.Enat | ||||||
|
|
||||||
| open Function Set | ||||||
|
|
||||||
|
|
@@ -38,3 +41,23 @@ lemma Set.IsAPOfLength.card (s : Set α) (l : ℕ∞) (hs : s.IsAPOfLength l) : | |||||
| lemma IsSidon.avoids_isAPOfLength_three {α : Type*} [AddCommMonoid α] (A : Set ℕ) (hA : IsSidon A) : | ||||||
mo271 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||||
| (∀ Y, IsAPOfLength Y 3 → (A ∩ Y).ncard ≤ 2) := by | ||||||
| sorry | ||||||
|
|
||||||
| -- Decidability instance for computable versions | ||||||
| instance decidableIsSidon (A : Finset ℕ) : Decidable (IsSidon A.toSet) := by | ||||||
| unfold IsSidon | ||||||
| classical | ||||||
| simp only [Set.mem_toSet, emforall, emimp] | ||||||
| apply decidable_of_iff _ (by simp) | ||||||
| exact decidable_of_iff (∀ i₁ j₁ i₂ j₂ ∈ A, i₁ + i₂ = j₁ + j₂ → (i₁ = j₁ ∧ i₂ = j₂) ∨ (i₁ = j₂ ∧ i₂ = j₁)) (by simp) | ||||||
|
|
||||||
|
|
||||||
| /-- All subset sizes of Sidon sets in `{1, ..., n}`. -/ | ||||||
| def SidonSubsetsSizes (n : ℕ) : Finset ℕ := | ||||||
| Finset.image Finset.card <| (Finset.Icc 1 n).powerset.filter (λ A => IsSidon A.toSet) | ||||||
|
|
||||||
| lemma SidonSubsetsSizesNonempty (n : ℕ) : (SidonSubsetsSizes n).Nonempty := by | ||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
I think since this is a lemma we would use small caps here? |
||||||
| use 0 | ||||||
| simp [SidonSubsetsSizes] | ||||||
|
|
||||||
| def maxSidonSetSize' (n : ℕ) : ℕ := | ||||||
| (SidonSubsetsSizes n).max' (SidonSubsetsSizesNonempty n) | ||||||
mo271 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||||
Uh oh!
There was an error while loading. Please reload this page.