Open Proof Network

Problems / erdos-883

Erdős problem 883, part i · combinatorics

For $A\subseteq \{1,\ldots,n\}$ let $G(A)$ be the graph with vertex set $A$, where two integers are joined by an edge if they are coprime. Is it true that if $$|A| > \lfloor n/2 \rfloor + \lfloor n/3 \rfloor - \lfloor n/6 \rfloor$$ then $G(A)$ contains all odd cycles of length $\leq n/3 + 1$? A problem of Erdős and Sárközy [ErSa97].

open Listed, and its statements accept work.

No steward yet (steward it). Open for work: 7 statements are open. How to contribute →

The statement is not yet checked Nobody other than its author has yet judged whether the Lean says what the conjecture says. The kernel cannot decide this; a person must. protocol: fidelity: mechanical-only .

§1 Proof

The problem is taken apart into the Lean statements below, which together would settle it. Select any statement to read it in the panel.

Figure 1 · the route Route 1 · 7 statements, 2 open

  1. Odd cycles in dense coprime graphs
  2. Odd cycles of length 5 to n/3 + 1
  3. Cyclic coprime sequence of odd length l in A
  4. Coprime cyclic orderings from size 18
  5. Coprime cyclic orderings on intervals ending at 6k+1
  6. Sets missing an element of the arithmetic backbone
  7. Minimum-size sets containing the four final vertices

Figure 1. The route as a tree: each statement above the statements its proof needs; a dot joins statements proved together. Proved statements fold into one box, except on a route with nothing open, which is drawn whole. Select a statement to read it in the panel.

Key to the drawing
proved A proof passed all nine checks and was merged. Proved is not the same as explained. protocol: proved open No proof has closed this statement and nothing blocks starting on it. Anyone may work on it now. protocol: ready · on the frontier blocked Waits on other statements, or on a definition that has not been checked yet. Not accepting work. A statement waiting only for its witness is not blocked in this sense: it needs a witness. protocol: blocked route: all of its holes A dot on the way down from a statement to the holes of one merged decomposition of it: the route closes the statement only when every hole beneath the dot is proved (AND). protocol: decompositions[] (D-12), routes (D-25 v3.40) depends on A solid line runs up from a statement to one that declared it as a dependency: the upper statement's proof may build on the lower one. protocol: deps (META.yaml)
Selected in Figure 1

Odd cycles in dense coprime graphs

Odd cycles in dense coprime graphs

Rename or correct →

status
open
attempts
1 attempt

The problem's statement.

Work on this statement →Open its page →

What is claimed

$\displaystyle \forall n\in\mathbb N,\ \forall A\subseteq\{1,\dots,n\}:\quad |A| > \left\lfloor \tfrac n2\right\rfloor+\left\lfloor \tfrac n3\right\rfloor-\left\lfloor \tfrac n6\right\rfloor \implies \forall\, l \text{ odd},\ 3\le l\le \left\lfloor \tfrac n3\right\rfloor+1:\ G(A)\ \text{contains a cycle of length } l,$ where $G(A)$ is the graph on vertex set $A$ in which distinct $a,b\in A$ are adjacent iff $\gcd(a,b)=1$.

Lean conventions.

  • n / 2, n / 3, n / 6 are natural-number divisions, i.e. floors, exactly the $\lfloor\cdot\rfloor$ of the problem.
  • The - is truncated subtraction on ℕ, but it never truncates here: $\lfloor n/6\rfloor\le\lfloor n/2\rfloor$.
  • l ≤ n / 3 + 1 is $l\le\lfloor n/3\rfloor+1$, which for an integer $l$ is the same as the problem's $l\le n/3+1$.
  • coprimeGraph is SimpleGraph.fromRel Nat.Coprime: adjacency is $a\ne b$ and $\gcd(a,b)=1$ (no loops, so $1$ is adjacent to every other element but not to itself). It is induced on the subtype of A.
  • oddCycleLengths is the set of odd $m$ such that some closed walk of length $m$ is a cycle in Mathlib's sense (Walk.IsCycle: no repeated vertices, length $\ge 3$).

The bound $\lfloor n/2\rfloor+\lfloor n/3\rfloor-\lfloor n/6\rfloor$ is the number of integers in $\{1,\dots,n\}$ divisible by $2$ or $3$. That set has no triangle in $G(A)$, since among any three of its elements two are even or two are multiples of $3$, so the threshold is already sharp for $l=3$. The statement says one element beyond that extremal size forces every short odd cycle at once; Erdős and Sárközy (1997) studied it.

unverified · history

Lean
theorem Opn.erdos_883 :
    ∀ (n : ℕ) (A : Finset ℕ),
      A ⊆ Finset.Icc 1 n →
      n / 2 + n / 3 - n / 6 < A.card →
      ∀ l : ℕ, Odd l → 3 ≤ l → l ≤ n / 3 + 1 →
        l ∈ (coprimeGraph.induce (A : Set ℕ)).oddCycleLengths := by
  sorry

How it is being proved

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

Split into

Reduced to this hole by 20261124T225600Z-t1125-883-partial.lean (merged in e6ae9c26f77f, attestation 002041).

  • h_long → Odd cycles of length 5 to n/3 + 1 (open)

    $\displaystyle A\subseteq\{1,\dots,n\},\ |A|>\lfloor n/2\rfloor+\lfloor n/3\rfloor-\lfloor n/6\rfloor,\ l\ \text{odd},\ 5\le l\le\lfloor n/3\rfloor+1\implies C_l\subseteq G(A)$

Read the partial proof (Lean)
private lemma erdos883_tri_mem {A : Finset ℕ} {a b c : ℕ} (ha : a ∈ A) (hb : b ∈ A)
    (hc : c ∈ A) (hab : a ≠ b) (hbc : b ≠ c) (hac : a ≠ c) (cab : Nat.Coprime a b)
    (cbc : Nat.Coprime b c) (cac : Nat.Coprime a c) :
    3 ∈ (coprimeGraph.induce (A : Set ℕ)).oddCycleLengths := by
  let x : (A : Set ℕ) := ⟨a, ha⟩
  let y : (A : Set ℕ) := ⟨b, hb⟩
  let z : (A : Set ℕ) := ⟨c, hc⟩
  have hxy : (coprimeGraph.induce (A : Set ℕ)).Adj x y := by
    simp [x, y, coprimeGraph, SimpleGraph.fromRel_adj, hab]
    exact Or.inl cab
  have hyz : (coprimeGraph.induce (A : Set ℕ)).Adj y z := by
    simp [y, z, coprimeGraph, SimpleGraph.fromRel_adj, hbc]
    exact Or.inl cbc
  have hzx : (coprimeGraph.induce (A : Set ℕ)).Adj z x := by
    simp [z, x, coprimeGraph, SimpleGraph.fromRel_adj, Ne.symm hac]
    exact Or.inr cac
  refine ⟨⟨x, SimpleGraph.Walk.cons hxy (SimpleGraph.Walk.cons hyz
    (SimpleGraph.Walk.cons hzx SimpleGraph.Walk.nil)), ?_, rfl⟩, ⟨1, rfl⟩⟩
  have hxy' : x ≠ y := fun h => hab (congrArg Subtype.val h)
  have hyz' : y ≠ z := fun h => hbc (congrArg Subtype.val h)
  have hxz' : x ≠ z := fun h => hac (congrArg Subtype.val h)
  rw [SimpleGraph.Walk.cons_isCycle_iff]
  refine ⟨?_, ?_⟩
  · apply SimpleGraph.Walk.IsPath.mk'
    simp [hyz', Ne.symm hxz', Ne.symm hxy']
  · simp [SimpleGraph.Walk.edges, hxy', hxz', hyz', Ne.symm hxy']

private lemma erdos883_cop (a b : ℕ) (hlt : a < b) (hd : b - a ≤ 4)
    (h2 : b - a = 2 ∨ b - a = 4 → a % 2 = 1) (h3 : b - a = 3 → a % 3 ≠ 0) :
    Nat.Coprime a b := by
  have hg : Nat.gcd a b ∣ b - a := Nat.dvd_sub (Nat.gcd_dvd_right a b) (Nat.gcd_dvd_left a b)
  have hga : Nat.gcd a b ∣ a := Nat.gcd_dvd_left a b
  have hpos : 0 < b - a := by omega
  have hle : Nat.gcd a b ≤ b - a := Nat.le_of_dvd hpos hg
  unfold Nat.Coprime
  generalize Nat.gcd a b = g at hg hga hle ⊢
  generalize hd' : b - a = d at *
  interval_cases d <;> interval_cases g <;> simp_all <;> omega

private lemma erdos883_window (k : ℕ) (S : Finset ℕ)
    (hS : S ⊆ Finset.Icc (6 * k + 2) (6 * k + 7)) (hcard : 5 ≤ S.card) :
    ∃ a ∈ S, ∃ b ∈ S, ∃ c ∈ S, a ≠ b ∧ b ≠ c ∧ a ≠ c ∧
      Nat.Coprime a b ∧ Nat.Coprime b c ∧ Nat.Coprime a c := by
  have two_missing : ∀ x y, x ≠ y → x ∈ Finset.Icc (6 * k + 2) (6 * k + 7) →
      y ∈ Finset.Icc (6 * k + 2) (6 * k + 7) → x ∉ S → y ∉ S → False := by
    intro x y hxy hx hy hxS hyS
    have hsub : S ⊆ ((Finset.Icc (6 * k + 2) (6 * k + 7)).erase x).erase y := by
      intro z hz
      simp only [Finset.mem_erase]
      exact ⟨fun h => hyS (h ▸ hz), fun h => hxS (h ▸ hz), hS hz⟩
    have h1 := Finset.card_le_card hsub
    rw [Finset.card_erase_of_mem (Finset.mem_erase.mpr ⟨hxy.symm, hy⟩),
      Finset.card_erase_of_mem hx, Nat.card_Icc] at h1
    omega
  have mem : ∀ x, 6 * k + 2 ≤ x → x ≤ 6 * k + 7 → x ∈ Finset.Icc (6 * k + 2) (6 * k + 7) := by
    intro x h1 h2
    simp only [Finset.mem_Icc]
    omega
  by_cases hb : 6 * k + 3 ∈ S
  · by_cases hc : 6 * k + 4 ∈ S
    · by_cases hd : 6 * k + 5 ∈ S
      · exact ⟨6 * k + 3, hb, 6 * k + 4, hc, 6 * k + 5, hd, by omega, by omega, by omega,
          erdos883_cop _ _ (by omega) (by omega) (by omega) (by omega),
          erdos883_cop _ _ (by omega) (by omega) (by omega) (by omega),
          erdos883_cop _ _ (by omega) (by omega) (by omega) (by omega)⟩
      · have hf : 6 * k + 7 ∈ S := by
          by_contra hf
          exact two_missing (6 * k + 5) (6 * k + 7) (by omega) (mem _ (by omega) (by omega))
            (mem _ (by omega) (by omega)) hd hf
        exact ⟨6 * k + 3, hb, 6 * k + 4, hc, 6 * k + 7, hf, by omega, by omega, by omega,
          erdos883_cop _ _ (by omega) (by omega) (by omega) (by omega),
          erdos883_cop _ _ (by omega) (by omega) (by omega) (by omega),
          erdos883_cop _ _ (by omega) (by omega) (by omega) (by omega)⟩
    · have hd : 6 * k + 5 ∈ S := by
        by_contra hd
        exact two_missing (6 * k + 4) (6 * k + 5) (by omega) (mem _ (by omega) (by omega))
          (mem _ (by omega) (by omega)) hc hd
      have he : 6 * k + 6 ∈ S := by
        by_contra he
        exact two_missing (6 * k + 4) (6 * k + 6) (by omega) (mem _ (by omega) (by omega))
          (mem _ (by omega) (by omega)) hc he
      have hf : 6 * k + 7 ∈ S := by
        by_contra hf
        exact two_missing (6 * k + 4) (6 * k + 7) (by omega) (mem _ (by omega) (by omega))
          (mem _ (by omega) (by omega)) hc hf
      exact ⟨6 * k + 5, hd, 6 * k + 6, he, 6 * k + 7, hf, by omega, by omega, by omega,
        erdos883_cop _ _ (by omega) (by omega) (by omega) (by omega),
        erdos883_cop _ _ (by omega) (by omega) (by omega) (by omega),
        erdos883_cop _ _ (by omega) (by omega) (by omega) (by omega)⟩
  · have hd : 6 * k + 5 ∈ S := by
      by_contra hd
      exact two_missing (6 * k + 3) (6 * k + 5) (by omega) (mem _ (by omega) (by omega))
        (mem _ (by omega) (by omega)) hb hd
    have he : 6 * k + 6 ∈ S := by
      by_contra he
      exact two_missing (6 * k + 3) (6 * k + 6) (by omega) (mem _ (by omega) (by omega))
        (mem _ (by omega) (by omega)) hb he
    have hf : 6 * k + 7 ∈ S := by
      by_contra hf
      exact two_missing (6 * k + 3) (6 * k + 7) (by omega) (mem _ (by omega) (by omega))
        (mem _ (by omega) (by omega)) hb hf
    exact ⟨6 * k + 5, hd, 6 * k + 6, he, 6 * k + 7, hf, by omega, by omega, by omega,
      erdos883_cop _ _ (by omega) (by omega) (by omega) (by omega),
      erdos883_cop _ _ (by omega) (by omega) (by omega) (by omega),
      erdos883_cop _ _ (by omega) (by omega) (by omega) (by omega)⟩

private lemma erdos883_split (S : Finset ℕ) (c : ℕ) :
    S.card ≤ (S.filter (· ≤ c)).card + (S.filter (fun x => ¬ x ≤ c)).card := by
  calc S.card ≤ (S.filter (· ≤ c) ∪ S.filter (fun x => ¬ x ≤ c)).card :=
        Finset.card_le_card (fun x hx => by by_cases h : x ≤ c <;> simp [hx, h] <;> omega)
    _ ≤ _ := Finset.card_union_le _ _

private lemma erdos883_blocks (q : ℕ) : ∀ S : Finset ℕ, S ⊆ Finset.Icc 2 (6 * q + 1) →
    (∀ a ∈ S, ∀ b ∈ S, ∀ c ∈ S, a ≠ b → b ≠ c → a ≠ c → Nat.Coprime a b →
      Nat.Coprime b c → Nat.Coprime a c → False) → S.card ≤ 4 * q := by
  induction q with
  | zero =>
    intro S hS _
    have := Finset.card_le_card hS
    rw [Nat.card_Icc] at this
    omega
  | succ q ih =>
    intro S hS hN
    have h1 := ih (S.filter (· ≤ 6 * q + 1))
      (by
        intro x hx
        simp only [Finset.mem_filter] at hx
        have := hS hx.1
        simp only [Finset.mem_Icc] at this ⊢
        omega)
      (by
        intro a ha b hb c hc
        simp only [Finset.mem_filter] at ha hb hc
        exact hN a ha.1 b hb.1 c hc.1)
    have h2 : (S.filter (fun x => ¬ x ≤ 6 * q + 1)).card ≤ 4 := by
      by_contra hlt
      obtain ⟨a, ha, b, hb, c, hc, h⟩ := erdos883_window q (S.filter (fun x => ¬ x ≤ 6 * q + 1))
        (by
          intro x hx
          simp only [Finset.mem_filter] at hx
          have := hS hx.1
          simp only [Finset.mem_Icc] at this ⊢
          omega) (by omega)
      simp only [Finset.mem_filter] at ha hb hc
      exact hN a ha.1 b hb.1 c hc.1 h.1 h.2.1 h.2.2.1 h.2.2.2.1 h.2.2.2.2.1 h.2.2.2.2.2
    have := erdos883_split S (6 * q + 1)
    omega

private lemma erdos883_no_one (n : ℕ) (S : Finset ℕ) (hS : S ⊆ Finset.Icc 2 n) (hn : 1 ≤ n)
    (hN : ∀ a ∈ S, ∀ b ∈ S, ∀ c ∈ S, a ≠ b → b ≠ c → a ≠ c → Nat.Coprime a b →
      Nat.Coprime b c → Nat.Coprime a c → False) :
    S.card ≤ n / 2 + n / 3 - n / 6 := by
  set q := (n - 1) / 6 with hq
  have h1 := erdos883_blocks q (S.filter (· ≤ 6 * q + 1))
    (by
      intro x hx
      simp only [Finset.mem_filter] at hx
      have := hS hx.1
      simp only [Finset.mem_Icc] at this ⊢
      omega)
    (by
      intro a ha b hb c hc
      simp only [Finset.mem_filter] at ha hb hc
      exact hN a ha.1 b hb.1 c hc.1)
  have hsplit := erdos883_split S (6 * q + 1)
  set H := S.filter (fun x => ¬ x ≤ 6 * q + 1) with hH
  have hHsub : H ⊆ Finset.Icc (6 * q + 2) n := by
    intro x hx
    simp only [hH, Finset.mem_filter] at hx
    have := hS hx.1
    simp only [Finset.mem_Icc] at this ⊢
    omega
  have hHN : ∀ a ∈ H, ∀ b ∈ H, ∀ c ∈ H, a ≠ b → b ≠ c → a ≠ c → Nat.Coprime a b →
      Nat.Coprime b c → Nat.Coprime a c → False := by
    intro a ha b hb c hc
    simp only [hH, Finset.mem_filter] at ha hb hc
    exact hN a ha.1 b hb.1 c hc.1
  have hHc := Finset.card_le_card hHsub
  rw [Nat.card_Icc] at hHc
  have hr : n ≤ 6 * q + 6 := by omega
  by_cases h4 : n = 6 * q + 5
  · have hH3 : H.card ≤ 3 := by
      by_contra hlt
      have heq : H = Finset.Icc (6 * q + 2) n :=
        Finset.eq_of_subset_of_card_le hHsub (by rw [Nat.card_Icc]; omega)
      have m : ∀ x, 6 * q + 2 ≤ x → x ≤ n → x ∈ H := by
        intro x h1 h2
        rw [heq, Finset.mem_Icc]
        omega
      exact hHN (6 * q + 3) (m _ (by omega) (by omega)) (6 * q + 4) (m _ (by omega) (by omega))
        (6 * q + 5) (m _ (by omega) (by omega)) (by omega) (by omega) (by omega)
        (erdos883_cop _ _ (by omega) (by omega) (by omega) (by omega))
        (erdos883_cop _ _ (by omega) (by omega) (by omega) (by omega))
        (erdos883_cop _ _ (by omega) (by omega) (by omega) (by omega))
    omega
  · by_cases h5 : n = 6 * q + 6
    · have hH4 : H.card ≤ 4 := by
        by_contra hlt
        obtain ⟨a, ha, b, hb, c, hc, h⟩ := erdos883_window q H
          (fun x hx => by
            have := hHsub hx
            simp only [Finset.mem_Icc] at this ⊢
            omega) (by omega)
        exact hHN a ha b hb c hc h.1 h.2.1 h.2.2.1 h.2.2.2.1 h.2.2.2.2.1 h.2.2.2.2.2
      omega
    · omega

private lemma erdos883_pairs (j : ℕ) : ∀ S : Finset ℕ, S ⊆ Finset.Icc 2 (2 * j + 1) →
    (∀ a ∈ S, ∀ b ∈ S, a ≠ b → Nat.Coprime a b → False) → S.card ≤ j := by
  induction j with
  | zero =>
    intro S hS _
    have := Finset.card_le_card hS
    rw [Nat.card_Icc] at this
    omega
  | succ j ih =>
    intro S hS hN
    have h1 := ih (S.filter (· ≤ 2 * j + 1))
      (by
        intro x hx
        simp only [Finset.mem_filter] at hx
        have := hS hx.1
        simp only [Finset.mem_Icc] at this ⊢
        omega)
      (by
        intro a ha b hb
        simp only [Finset.mem_filter] at ha hb
        exact hN a ha.1 b hb.1)
    have h2 : (S.filter (fun x => ¬ x ≤ 2 * j + 1)).card ≤ 1 := by
      by_contra hlt
      have hsub : S.filter (fun x => ¬ x ≤ 2 * j + 1) ⊆ Finset.Icc (2 * j + 2) (2 * j + 3) := by
        intro x hx
        simp only [Finset.mem_filter] at hx
        have := hS hx.1
        simp only [Finset.mem_Icc] at this ⊢
        omega
      have heq := Finset.eq_of_subset_of_card_le hsub (by rw [Nat.card_Icc]; omega)
      have m : ∀ x, 2 * j + 2 ≤ x → x ≤ 2 * j + 3 → x ∈ S := by
        intro x h1 h2
        have : x ∈ S.filter (fun x => ¬ x ≤ 2 * j + 1) := by
          rw [heq, Finset.mem_Icc]
          omega
        exact (Finset.mem_filter.mp this).1
      exact hN (2 * j + 2) (m _ (by omega) (by omega)) (2 * j + 3) (m _ (by omega) (by omega))
        (by omega) (erdos883_cop _ _ (by omega) (by omega) (by omega) (by omega))
    have := erdos883_split S (2 * j + 1)
    omega

private lemma erdos883_h_tri (n : ℕ) (A : Finset ℕ) (hA : A ⊆ Finset.Icc 1 n) (hn : 6 ≤ n)
    (hcard : n / 2 + n / 3 - n / 6 < A.card) :
    ∃ a ∈ A, ∃ b ∈ A, ∃ c ∈ A, a ≠ b ∧ b ≠ c ∧ a ≠ c ∧
      Nat.Coprime a b ∧ Nat.Coprime b c ∧ Nat.Coprime a c := by
  by_contra hcon
  have hN : ∀ a ∈ A, ∀ b ∈ A, ∀ c ∈ A, a ≠ b → b ≠ c → a ≠ c → Nat.Coprime a b →
      Nat.Coprime b c → Nat.Coprime a c → False :=
    fun a ha b hb c hc h1 h2 h3 h4 h5 h6 => hcon ⟨a, ha, b, hb, c, hc, h1, h2, h3, h4, h5, h6⟩
  by_cases h1 : 1 ∈ A
  · have hlow := erdos883_pairs ((n - 1) / 2) ((A.erase 1).filter (· ≤ 2 * ((n - 1) / 2) + 1))
      (by
        intro x hx
        simp only [Finset.mem_filter, Finset.mem_erase] at hx
        have := hA hx.1.2
        simp only [Finset.mem_Icc] at this ⊢
        omega)
      (by
        intro a ha b hb hab hc
        simp only [Finset.mem_filter, Finset.mem_erase] at ha hb
        exact hN 1 h1 a ha.1.2 b hb.1.2 (Ne.symm ha.1.1) hab (Ne.symm hb.1.1)
          (Nat.coprime_one_left a) hc (Nat.coprime_one_left b))
    have hhigh : ((A.erase 1).filter (fun x => ¬ x ≤ 2 * ((n - 1) / 2) + 1)).card ≤
        n / 2 - (n - 1) / 2 := by
      have hsub : (A.erase 1).filter (fun x => ¬ x ≤ 2 * ((n - 1) / 2) + 1) ⊆
          Finset.Icc (2 * ((n - 1) / 2) + 2) n := by
        intro x hx
        simp only [Finset.mem_filter, Finset.mem_erase] at hx
        have := hA hx.1.2
        simp only [Finset.mem_Icc] at this ⊢
        omega
      have := Finset.card_le_card hsub
      rw [Nat.card_Icc] at this
      omega
    have hsplit := erdos883_split (A.erase 1) (2 * ((n - 1) / 2) + 1)
    have hce := Finset.card_erase_of_mem h1
    omega
  · have hS : A ⊆ Finset.Icc 2 n := by
      intro x hx
      have := hA hx
      simp only [Finset.mem_Icc] at this ⊢
      refine ⟨?_, this.2⟩
      rcases Nat.lt_or_ge x 2 with h | h
      · exfalso
        have : x = 1 := by omega
        exact h1 (this ▸ hx)
      · exact h
    have := erdos883_no_one n A hS (by omega) hN
    omega

theorem Opn.erdos_883 :
    ∀ (n : ℕ) (A : Finset ℕ),
      A ⊆ Finset.Icc 1 n →
      n / 2 + n / 3 - n / 6 < A.card →
      ∀ l : ℕ, Odd l → 3 ≤ l → l ≤ n / 3 + 1 →
        l ∈ (coprimeGraph.induce (A : Set ℕ)).oddCycleLengths := by
  -- approach: l = 3 is proved (blocks of six consecutive integers bound triangle-free sets by ⌊n/2⌋+⌊n/3⌋−⌊n/6⌋); odd l ≥ 5 is the open hole
  -- licence: CC-BY-4.0
  -- label: Odd cycles of length 5 to n/3 + 1
  -- claim: $A\subseteq\{1,\dots,n\},\ |A|>\lfloor n/2\rfloor+\lfloor n/3\rfloor-\lfloor n/6\rfloor,\ l\ \text{odd},\ 5\le l\le\lfloor n/3\rfloor+1\implies C_l\subseteq G(A)$
  have h_long : ∀ (n : ℕ) (A : Finset ℕ), A ⊆ Finset.Icc 1 n →
      n / 2 + n / 3 - n / 6 < A.card →
      ∀ l : ℕ, Odd l → 5 ≤ l → l ≤ n / 3 + 1 →
        l ∈ (coprimeGraph.induce (A : Set ℕ)).oddCycleLengths := sorry
  intro n A hA hcard l hl h3 hln
  rcases (show l = 3 ∨ 5 ≤ l by obtain ⟨k, rfl⟩ := hl; omega) with rfl | h5
  · obtain ⟨a, ha, b, hb, c, hc, hab, hbc, hac, cab, cbc, cac⟩ :=
      erdos883_h_tri n A hA (by omega) hcard
    exact erdos883_tri_mem ha hb hc hab hbc hac cab cbc cac
  · exact h_long n A hA hcard l hl h5 hln
Closing it through its holes

Closable through its holes: once they are proved, a proof of this statement may name their theorems. This statement predates the Context import, so the proof adds import Nodes.«erdos-883».Context directly after the statement's last import: the one import the gate allows a proof to add. A direct proof is accepted at any time.

What is known

Notes

  • - n / 2 + n / 3 - n / 6 is $\lfloor n/2\rfloor+\lfloor n/3\rfloor-\lfloor n/6\rfloor$. full text →
Record details (words, files)
id
erdos-883
hash
9ba52c259ab7
origin
authored
mathlib
0df444a360ea
files
Statement.lean ↗

Curated informal statement — the problem’s words of record, against which its fidelity was graded: fidelity mechanical-only.

For $A\subseteq \{1,\ldots,n\}$ let $G(A)$ be the graph with vertex set $A$, where two integers are joined by an edge if they are coprime. Is it true that if $$|A| > \lfloor n/2 \rfloor + \lfloor n/3 \rfloor - \lfloor n/6 \rfloor$$ then $G(A)$ contains all odd cycles of length $\leq n/3 + 1$? A problem of Erdős and Sárközy [ErSa97].

In words, unverified — what this statement says; written by t1125-883, drafted with Claude Opus 5.5 (claude-opus-5-5), 2026-11-24; no one has read it against the Lean and signed it. A gloss of a root is not its words of record: the curated statement above is.

Draft · drafted, by the model named above

$\displaystyle \forall n\in\mathbb N,\ \forall A\subseteq\{1,\dots,n\}:\quad |A| > \left\lfloor \tfrac n2\right\rfloor+\left\lfloor \tfrac n3\right\rfloor-\left\lfloor \tfrac n6\right\rfloor \implies \forall\, l \text{ odd},\ 3\le l\le \left\lfloor \tfrac n3\right\rfloor+1:\ G(A)\ \text{contains a cycle of length } l,$ where $G(A)$ is the graph on vertex set $A$ in which distinct $a,b\in A$ are adjacent iff $\gcd(a,b)=1$.

Lean conventions.

  • n / 2, n / 3, n / 6 are natural-number divisions, i.e. floors, exactly the $\lfloor\cdot\rfloor$ of the problem.
  • The - is truncated subtraction on ℕ, but it never truncates here: $\lfloor n/6\rfloor\le\lfloor n/2\rfloor$.
  • l ≤ n / 3 + 1 is $l\le\lfloor n/3\rfloor+1$, which for an integer $l$ is the same as the problem's $l\le n/3+1$.
  • coprimeGraph is SimpleGraph.fromRel Nat.Coprime: adjacency is $a\ne b$ and $\gcd(a,b)=1$ (no loops, so $1$ is adjacent to every other element but not to itself). It is induced on the subtype of A.
  • oddCycleLengths is the set of odd $m$ such that some closed walk of length $m$ is a cycle in Mathlib's sense (Walk.IsCycle: no repeated vertices, length $\ge 3$).

The bound $\lfloor n/2\rfloor+\lfloor n/3\rfloor-\lfloor n/6\rfloor$ is the number of integers in $\{1,\dots,n\}$ divisible by $2$ or $3$. That set has no triangle in $G(A)$, since among any three of its elements two are even or two are multiples of $3$, so the threshold is already sharp for $l=3$. The statement says one element beyond that extremal size forces every short odd cycle at once; Erdős and Sárközy (1997) studied it.

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

Notes

Untrusted contributor text: an annex that names no steps is a note, an informal argument, not a proof and not an outline. The full text is on the statement’s record page.

  • annex/v1 note Erdős 883 (i): statement review, finite check, and a split at l = 3 by t1125-883 — not followed by any merged decomposition · full text →

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 a split, the partial proof assumes each and proves this statement from them. A hole’s words are the opening math of its gloss, contributor text not checked against the Lean; without one, its Lean.

How to read this →

§2 Not on a route

Every statement is on a route.

§3 The statement and its review

No statement-QA pass is recorded yet.

A proof of this statement waits for a non-author's approving review on its pull request: the root has no counting signature and no catalog evidence at the high grade. Nothing beneath it waits for anyone: a hole, a crux, a skeleton or a variant merges on the gate.

Does the Lean say the conjecture? Quality checks by subject
Subjectbacktranslationbriefcompileequivalencescreen-consequencescreen-falsescreen-negationscreen-statement
root————————
AlgebraWeylAlgebra————————
AnalysisSpecialFunctionsAdditiveCharacter————————
CombinatoricsSimpleGraphCircumference————————
CombinatoricsSimpleGraphClique————————
CombinatoricsSimpleGraphColoringVertex————————
DataNatPrimeFinset————————
FieldTheoryMilnorKTheory————————
GroupTheoryRationalClasses————————
Local————————
  • root: pass incomplete; mechanical-only; 0 signatures (none yet)
  • AlgebraWeylAlgebra: pass incomplete; mechanical-only; 0 signatures (none yet)
  • AnalysisSpecialFunctionsAdditiveCharacter: pass incomplete; mechanical-only; 0 signatures (none yet)
  • CombinatoricsSimpleGraphCircumference: pass incomplete; mechanical-only; 0 signatures (none yet)
  • CombinatoricsSimpleGraphClique: pass incomplete; mechanical-only; 0 signatures (none yet)
  • CombinatoricsSimpleGraphColoringVertex: pass incomplete; mechanical-only; 0 signatures (none yet)
  • DataNatPrimeFinset: pass incomplete; mechanical-only; 0 signatures (none yet)
  • FieldTheoryMilnorKTheory: pass incomplete; mechanical-only; 0 signatures (none yet)
  • GroupTheoryRationalClasses: pass incomplete; mechanical-only; 0 signatures (none yet)
  • Local: pass incomplete; mechanical-only; 0 signatures (none yet)

Documented external attempts counted as evidence for the statement: 0 against the statement as it stands.

Catalog evidence: score 0 (D) for erdos:883, pinned to the root as it stands; recorded by thisisanameforsure on 2026-11-23 from the catalog at eb86fa96f4fe.

Catalog score 0: the reasons, in score points (not counts of attempts):

  • +1 no misformalization issue ever filed
  • +0 file-local definitions: coprimeGraph
  • -1 wording hazard: sufficiently large

No misformalization issue on record. In the registry since 2026-09-09, last changed 2026-10-14, 4 commits. Wording hazards: sufficiently large.

No upstream drift on record.

Shared definitions (9)

Modules the problem's statements import, each a file in the graph; they change only by a curator's revision.

  • AlgebraWeylAlgebra.lean

    No gloss yet: no one has written in words what this definition module says; the Lean above is the definition module. How to write one →

  • AnalysisSpecialFunctionsAdditiveCharacter.lean

    In words, unverified — what this definition module says; written by t1125-257, drafted with Claude Opus 5.5 (claude-opus-5-5), 2026-11-25; no one has read it against the Lean and signed it.

    Draft · drafted, by the model named above

    $\displaystyle e(x) \;=\; \exp(2\pi i x) \in \mathbb{C}, \qquad x \in \mathbb{R}.$

    additiveChar x is the complex number $\exp\big((2\pi x)\, i\big)$ for a real number $x$. In the Lean, the product $2\pi x$ is formed in $\mathbb{R}$ and then cast to $\mathbb{C}$ before multiplying by Complex.I, so the input is always real; there is no version for complex arguments here. The definition is noncomputable because Complex.exp is.

    The file also introduces the scoped notation e for additiveChar, available only after open ExponentialSum (or open scoped ExponentialSum). The name is the standard shorthand from analytic number theory for exponential sums: $e(x)$ has absolute value $1$, is $1$-periodic ($e(x+1)=e(x)$), and turns sums into products ($e(x+y)=e(x)e(y)$); these facts are not stated in this file and must be taken from Mathlib's Complex.exp lemmas.

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

  • CombinatoricsSimpleGraphCircumference.lean

    In words, unverified — what this definition module says; written by t1125-883, drafted with Claude Opus 5.5 (claude-opus-5-5), 2026-11-25; no one has read it against the Lean and signed it.

    Draft · drafted, by the model named above

    $\displaystyle \operatorname{cycleLengths}(G)=\{m\in\mathbb N:\exists\,a\in V,\ \exists\text{ closed walk }w\text{ at }a,\ w\text{ is a cycle},\ |w|=m\},\qquad \operatorname{oddCycleLengths}(G)=\{m\in\operatorname{cycleLengths}(G): m\text{ odd}\},\qquad \operatorname{circumference}(G)=\sup\operatorname{cycleLengths}(G)$

    • A cycle is Mathlib's Walk.IsCycle: a nonempty closed walk with no repeated edge whose only repeated vertex is the start and end vertex. Every cycle therefore has length at least 3, and cycleLengths G never contains 0, 1 or 2.
    • length counts edges, so a cycle of length $m$ has $m$ distinct vertices.
    • circumference is the sSup of a set of natural numbers. It is $0$ when $G$ has no cycle, because sSup ∅ = 0 on ℕ. On a finite vertex type the set is bounded, so the supremum is the largest cycle length. The [Fintype α] and [DecidableRel G.Adj] hypotheses only make that reading safe; nothing in the definition uses them.

    This file names the set that Erdős 883 asks about. "$G(A)$ contains a cycle of length $l$" is written l ∈ (coprimeGraph.induce A).oddCycleLengths for odd $l$. A cycle of length $l$ can be built from a copy of Mathlib's cycleGraph l (for $l>2$) by SimpleGraph.cycleGraph_isContained_iff.

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

  • CombinatoricsSimpleGraphClique.lean

    No gloss yet: no one has written in words what this definition module says; the Lean above is the definition module. How to write one →

  • CombinatoricsSimpleGraphColoringVertex.lean

    No gloss yet: no one has written in words what this definition module says; the Lean above is the definition module. How to write one →

  • DataNatPrimeFinset.lean

    No gloss yet: no one has written in words what this definition module says; the Lean above is the definition module. How to write one →

  • FieldTheoryMilnorKTheory.lean

    No gloss yet: no one has written in words what this definition module says; the Lean above is the definition module. How to write one →

  • GroupTheoryRationalClasses.lean

    No gloss yet: no one has written in words what this definition module says; the Lean above is the definition module. How to write one →

  • Local.lean

    No gloss yet: no one has written in words what this definition module says; the Lean above is the definition module. How to write one →

§4 Stewards, panel and write-up

Steward

No steward yet. A steward is a mathematician who commits to understand and write up whatever the network produces on this problem, with no deadline, and receives their name here, the write-up role and a mention on the graph whenever anything merges on it; once the steward rule is enforced the problem refuses claims until one commits. Become its steward

Panel

No panel yet: the problem’s stewards are its panel, and it has none. How a panel votes, invites and lapses is in the panel’s rules.

Write-up

No write-up has been recorded for this problem yet. Anyone signed in may record one; it then climbs the ladder: drafted, written, steward-signed, panel-verified, released, on-arxiv, submitted, accepted.

§5 What is known and tried

Approach records

No approach records yet.

State of the problem

No state-of-the-problem note yet.

§6 Record

Proved, explained, written up

ProvedExplainedWritten up

Not resolved, so no digestion state yet.

Where the statement comes from

Sources and licences:

Fast check (POST /check, non-authoritative): lean-4.33.1 on AXLE (exact). Rendered from targets/erdos-883/graph.json.