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].
No steward yet (steward it). Open for work: 7 statements are open. How to contribute →
§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.
Routes
Tap a numbered end to draw that route below.
Each numbered end is a route; click one to draw it below.
- Route 1proves the problem · 7 statements · 0 proved · 5 split further · 2 openthrough
erdos-883, split byt1125-883DrawStatements
Open
- Sets missing an element of the arithmetic backbone
- Minimum-size sets containing the four final vertices
Split further
Retire…
Split of Odd cycles in dense coprime graphs: l = 3 is proved (blocks of six consecutive integers bound t…Removes this route.Split of Odd cycles of length 5 to n/3 + 1: reduce to arithmetic: l distinct elements of A in cyclic or…Does not remove this route: it would then end at “Odd cycles of length 5 to n/3 + 1”, left as one open statement. Only what is beneath that statement goes.Split of Cyclic coprime sequence of odd length l in A: Check the five-cycle range through 17 by finite certificate…Does not remove this route: it would then end at “Cyclic coprime sequence of odd length l in A”, left as one open statement. Only what is beneath that statement goes.Split of Coprime cyclic orderings from size 18: Cut each interval at 6k+1 and compare its loss in vertices…Does not remove this route: it would then end at “Coprime cyclic orderings from size 18”, left as one open statement. Only what is beneath that statement goes.Split of Coprime cyclic orderings on intervals ending at 6k+1: Construct the odd cycle on the multiples of two and three,…Does not remove this route: it would then end at “Coprime cyclic orderings on intervals ending at 6k+1”, left as one open statement. Only what is beneath that statement goes.
Drawn below ↓ Route 1 · 7 statements, 2 open
Figure 1 · the route Route 1 · 7 statements, 2 open
Proved statements folded ·
Retire this route…
A route goes through one split or more, and retiring a split takes away what is beneath it. Each choice below says what it does to this route.
Split of Odd cycles in dense coprime graphs: l = 3 is proved (blocks of six consecutive integers bound t…Removes this route.Split of Odd cycles of length 5 to n/3 + 1: reduce to arithmetic: l distinct elements of A in cyclic or…Does not remove this route: it would then end at “Odd cycles of length 5 to n/3 + 1”, left as one open statement. Only what is beneath that statement goes.Split of Cyclic coprime sequence of odd length l in A: Check the five-cycle range through 17 by finite certificate…Does not remove this route: it would then end at “Cyclic coprime sequence of odd length l in A”, left as one open statement. Only what is beneath that statement goes.Split of Coprime cyclic orderings from size 18: Cut each interval at 6k+1 and compare its loss in vertices…Does not remove this route: it would then end at “Coprime cyclic orderings from size 18”, left as one open statement. Only what is beneath that statement goes.Split of Coprime cyclic orderings on intervals ending at 6k+1: Construct the odd cycle on the multiples of two and three,…Does not remove this route: it would then end at “Coprime cyclic orderings on intervals ending at 6k+1”, left as one open statement. Only what is beneath that statement goes.- Odd cycles in dense coprime graphs
- Odd cycles of length 5 to n/3 + 1
- Cyclic coprime sequence of odd length l in A
- Coprime cyclic orderings from size 18
- Coprime cyclic orderings on intervals ending at 6k+1
- Sets missing an element of the arithmetic backbone
- 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
Odd cycles in dense coprime graphs
- 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 / 6are 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 + 1is $l\le\lfloor n/3\rfloor+1$, which for an integer $l$ is the same as the problem's $l\le n/3+1$.coprimeGraphisSimpleGraph.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 ofA.oddCycleLengthsis 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.
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
sorryHow it is being proved
Open. A direct proof, or proofs of its holes, close it.
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 hlnThe gate replayed this file at its merge, each hole a sorry; the whole file: 20261124T225600Z-t1125-883-partial.lean
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 / 6is $\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 / 6are 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 + 1is $l\le\lfloor n/3\rfloor+1$, which for an integer $l$ is the same as the problem's $l\le n/3+1$.coprimeGraphisSimpleGraph.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 ofA.oddCycleLengthsis 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 →
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.
Odd cycles in dense coprime graphs › Odd cycles of length 5 to n/3 + 1
- status
- open
- attempts
- 1 attempt
Hole h_long of Odd cycles in dense coprime graphs (split by 20261124T225600Z-t1125-883-partial.lean).
Work on this statement →Open its page →
What is claimed
$\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)$
Lean
theorem erdos_883__h1 : ∀ (n : ℕ),
∀ A ⊆ Finset.Icc (1 : ℕ) n,
n / (2 : ℕ) + n / (3 : ℕ) - n / (6 : ℕ) < A.card →
∀ (l : ℕ),
Odd l →
(5 : ℕ) ≤ l →
l ≤ n / (3 : ℕ) + (1 : ℕ) → l ∈ (SimpleGraph.induce (↑A : Set ℕ) Erdos883.coprimeGraph).oddCycleLengths := by
sorryHow it is being proved
Open. A direct proof, or proofs of its holes, close it.
Reduced to this hole by 20261125T154325Z-t1125-883-partial.lean (merged in 3d906e5da400, attestation 002066).
h_seq→ Cyclic coprime sequence of odd length l in A (open)$\displaystyle |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\exists\text{ distinct }a_0,\dots,a_{l-1}\in A\text{ with }\gcd(a_i,a_{(i+1)\bmod l})=1$
Read the partial proof (Lean)
theorem erdos_883__h1 : ∀ (n : ℕ),
∀ A ⊆ Finset.Icc (1 : ℕ) n,
n / (2 : ℕ) + n / (3 : ℕ) - n / (6 : ℕ) < A.card →
∀ (l : ℕ),
Odd l →
(5 : ℕ) ≤ l →
l ≤ n / (3 : ℕ) + (1 : ℕ) → l ∈ (SimpleGraph.induce (↑A : Set ℕ) Erdos883.coprimeGraph).oddCycleLengths := by
-- approach: reduce to arithmetic: l distinct elements of A in cyclic order, consecutive ones coprime, form a copy of cycleGraph l in G(A)
-- licence: CC-BY-4.0
-- label: Cyclic coprime sequence of odd length l in A
-- claim: $|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\exists\text{ distinct }a_0,\dots,a_{l-1}\in A\text{ with }\gcd(a_i,a_{(i+1)\bmod l})=1$
have h_seq : ∀ (n : ℕ), ∀ A ⊆ Finset.Icc (1 : ℕ) n,
n / (2 : ℕ) + n / (3 : ℕ) - n / (6 : ℕ) < A.card →
∀ (l : ℕ), Odd l → (5 : ℕ) ≤ l → l ≤ n / (3 : ℕ) + (1 : ℕ) →
∃ f : Fin l → ℕ, Function.Injective f ∧ (∀ i, f i ∈ A) ∧
∀ i j : Fin l, (SimpleGraph.cycleGraph l).Adj i j → Nat.Coprime (f i) (f j) := sorry
-- A cyclic coprime sequence is a copy of `cycleGraph l` in `G(A)`, hence a cycle of length `l`.
have bridge : ∀ (A : Finset ℕ) (l : ℕ), 2 < l → ∀ f : Fin l → ℕ, Function.Injective f →
(∀ i, f i ∈ A) →
(∀ i j : Fin l, (SimpleGraph.cycleGraph l).Adj i j → Nat.Coprime (f i) (f j)) →
l ∈ (SimpleGraph.induce (↑A : Set ℕ) Erdos883.coprimeGraph).cycleLengths := by
intro A l hl f hinj hA hc
let φ : SimpleGraph.cycleGraph l →g SimpleGraph.induce (↑A : Set ℕ) Erdos883.coprimeGraph :=
{ toFun := fun i => ⟨f i, Finset.mem_coe.mpr (hA i)⟩
map_rel' := by
intro i j hij
show Erdos883.coprimeGraph.Adj (f i) (f j)
rw [Erdos883.coprimeGraph, SimpleGraph.fromRel_adj]
exact ⟨fun h => hij.ne (hinj h), Or.inl (hc i j hij)⟩ }
have hφ : Function.Injective φ := by
intro i j h
exact hinj (congrArg Subtype.val h)
have hcopy : SimpleGraph.IsContained (SimpleGraph.cycleGraph l)
(SimpleGraph.induce (↑A : Set ℕ) Erdos883.coprimeGraph) :=
⟨⟨φ, hφ⟩⟩
obtain ⟨v, p, hp, hlen⟩ := (SimpleGraph.cycleGraph_isContained_iff hl).1 hcopy
exact ⟨v, p, hp, hlen⟩
intro n A hA hcard l hodd h5 hle
obtain ⟨f, hinj, hfA, hc⟩ := h_seq n A hA hcard l hodd h5 hle
exact ⟨bridge A l (by omega) f hinj hfA hc, hodd⟩The gate replayed this file at its merge, each hole a sorry; the whole file: 20261125T154325Z-t1125-883-partial.lean
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.
Record details (words, files)
- id
- erdos-883--h1
- hash
- 3054dcd8d3b7
- origin
- compiler-derived
- mathlib
- 0df444a360ea
- files
- Statement.lean ↗
In words, unverified — what this statement says; written by t1125-883, drafted with claude-opus-5-5, 2026-11-24; no one has read it against the Lean and signed it.
Draft · drafted, by the model named above
$\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)$
Rendered from gloss/020a0ffdd8d9….md · Improve these words →
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.
Odd cycles in dense coprime graphs › Odd cycles of length 5 to n/3 + 1 › Cyclic coprime sequence of odd length l in A
- status
- open
- attempts
- 1 attempt
Hole h_seq of Odd cycles of length 5 to n/3 + 1 (split by 20261125T154325Z-t1125-883-partial.lean).
Work on this statement →Open its page →
What is claimed
$\displaystyle |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\exists\text{ distinct }a_0,\dots,a_{l-1}\in A\text{ with }\gcd(a_i,a_{(i+1)\bmod l})=1$
Lean
theorem erdos_883__h1__h1 : ∀ (n : ℕ),
∀ A ⊆ Finset.Icc (1 : ℕ) n,
n / (2 : ℕ) + n / (3 : ℕ) - n / (6 : ℕ) < A.card →
∀ (l : ℕ),
Odd l →
(5 : ℕ) ≤ l →
l ≤ n / (3 : ℕ) + (1 : ℕ) →
∃ (f : Fin l → ℕ),
Function.Injective f ∧
(∀ (i : Fin l), f i ∈ A) ∧ ∀ (i j : Fin l), (SimpleGraph.cycleGraph l).Adj i j → (f i).Coprime (f j) := by
sorryHow it is being proved
Open. A direct proof, or proofs of its holes, close it.
Reduced to this hole by 20261125T180934Z-copper-lemma-53a2d0-partial.lean (merged in 13aff85240fc, attestation 002070).
h_large→ Coprime cyclic orderings from size 18 (open)$\displaystyle \forall n\ge18,\ \forall A\subseteq[1,n],\ |A|>\lfloor n/2\rfloor+\lfloor n/3\rfloor-\lfloor n/6\rfloor\ \Rightarrow\ \forall\text{ odd }l\in[5,\lfloor n/3\rfloor+1],\ \exists\text{ an injective coprime cyclic ordering of length }l\text{ in }A$
Read the partial proof (Lean)
private def cycles12 : List (Fin 5 → ℕ) := [
![1, 2, 3, 4, 5], ![6, 7, 8, 9, 11], ![1, 3, 10, 7, 12],
![2, 5, 9, 10, 11], ![1, 4, 9, 11, 12], ![1, 5, 6, 7, 8],
![3, 4, 7, 9, 10], ![3, 5, 12, 11, 8], ![2, 3, 5, 6, 7],
![1, 3, 8, 11, 6], ![1, 10, 9, 5, 12], ![1, 2, 5, 4, 11],
![1, 2, 3, 4, 9], ![1, 2, 7, 4, 9], ![1, 2, 7, 4, 11],
![2, 3, 4, 5, 9], ![2, 3, 4, 7, 11], ![2, 3, 4, 9, 11],
![2, 5, 4, 7, 9], ![2, 5, 4, 7, 11]
]
private def cycles13 : List (Fin 5 → ℕ) := [
![1, 2, 3, 4, 5], ![6, 7, 8, 9, 11], ![1, 7, 10, 13, 12],
![2, 3, 11, 6, 13], ![3, 5, 8, 9, 10], ![4, 5, 11, 12, 13],
![1, 2, 9, 8, 13], ![1, 4, 7, 10, 11], ![2, 5, 12, 7, 9],
![1, 3, 8, 11, 12], ![3, 4, 7, 6, 13], ![1, 6, 5, 9, 10],
![2, 3, 7, 10, 11], ![1, 5, 6, 13, 8], ![2, 9, 4, 11, 13],
![1, 3, 4, 9, 8], ![5, 6, 7, 11, 12], ![1, 4, 9, 11, 12],
![2, 3, 5, 12, 13], ![7, 8, 9, 10, 13], ![1, 3, 10, 7, 6],
![2, 5, 6, 11, 9], ![2, 7, 4, 11, 13], ![3, 4, 9, 10, 13],
![1, 2, 3, 4, 13], ![1, 2, 5, 4, 7], ![1, 2, 5, 4, 11],
![1, 2, 7, 4, 9], ![1, 2, 11, 4, 13], ![2, 3, 4, 5, 7],
![2, 3, 4, 5, 11], ![2, 3, 4, 7, 9], ![2, 3, 4, 9, 11],
![2, 5, 4, 7, 13], ![2, 5, 4, 9, 13]
]
private def cycles17 : List (Fin 5 → ℕ) := [
![1, 2, 3, 4, 5], ![6, 7, 8, 9, 11], ![10, 13, 14, 15, 17],
![1, 7, 12, 13, 16], ![3, 11, 12, 17, 16], ![2, 5, 9, 16, 15],
![1, 3, 10, 9, 14], ![4, 5, 6, 7, 17], ![4, 11, 8, 13, 15],
![2, 3, 7, 6, 13], ![1, 8, 9, 17, 12], ![5, 7, 10, 11, 14],
![1, 2, 15, 11, 6], ![4, 5, 9, 10, 13], ![3, 7, 8, 15, 16],
![4, 9, 11, 14, 17], ![3, 5, 12, 13, 8], ![1, 6, 13, 16, 17],
![2, 7, 12, 17, 15], ![1, 6, 5, 14, 15], ![2, 3, 13, 16, 9],
![1, 4, 11, 10, 17], ![3, 5, 8, 9, 10], ![4, 9, 10, 7, 15],
![2, 5, 11, 14, 13], ![2, 3, 4, 15, 17], ![3, 7, 6, 17, 10],
![2, 7, 6, 13, 17], ![3, 4, 11, 15, 14], ![1, 2, 3, 4, 11],
![1, 2, 5, 4, 9], ![1, 2, 9, 4, 13], ![1, 2, 3, 4, 13],
![2, 5, 4, 7, 13], ![2, 5, 4, 11, 15]
]
private def avoidsVertex (v : ℕ) (c : Fin 5 → ℕ) : Bool :=
!(List.ofFn c).contains v
/-- Every set of at most `k` deleted vertices leaves a cycle from the list.
If a deleted vertex hits the first cycle, branch on which vertex it is. -/
private def covers (k : ℕ) (cs : List (Fin 5 → ℕ)) : Bool :=
match k, cs with
| _, [] => false
| 0, _ :: _ => true
| k + 1, c :: rest =>
(List.ofFn c).all fun v => covers k (rest.filter (avoidsVertex v))
private theorem covers_sound (k : ℕ) (cs : List (Fin 5 → ℕ)) (D : Finset ℕ)
(hD : D.card ≤ k) (h : covers k cs = true) :
∃ f ∈ cs, ∀ i, f i ∉ D := by
induction k generalizing cs D with
| zero =>
cases cs with
| nil => simp [covers] at h
| cons c cs =>
obtain rfl := Finset.card_eq_zero.mp (Nat.le_zero.mp hD)
exact ⟨c, List.mem_cons_self, by simp⟩
| succ k ih =>
cases cs with
| nil => simp [covers] at h
| cons c cs =>
by_cases hit : ∃ i, c i ∈ D
· obtain ⟨i, hi⟩ := hit
have hcover : covers k (cs.filter (avoidsVertex (c i))) = true :=
List.all_eq_true.mp h (c i) (List.mem_ofFn.mpr ⟨i, rfl⟩)
have hcard : (D.erase (c i)).card ≤ k := by
rw [Finset.card_erase_of_mem hi]
omega
obtain ⟨f, hf, hav⟩ := ih _ _ hcard hcover
obtain ⟨hf, hfne⟩ := List.mem_filter.mp hf
refine ⟨f, List.mem_cons_of_mem _ hf, fun j hj => ?_⟩
apply hav j
refine Finset.mem_erase.mpr ⟨?_, hj⟩
intro heq
have hmem : c i ∈ List.ofFn f := List.mem_ofFn.mpr ⟨j, heq⟩
have hcontains : (List.ofFn f).contains (c i) = true := List.contains_iff_mem.mpr hmem
simp only [avoidsVertex, hcontains, Bool.not_true, Bool.false_eq_true] at hfne
· exact ⟨c, List.mem_cons_self, fun i hi => hit ⟨i, hi⟩⟩
private def validCycle (n : ℕ) (f : Fin 5 → ℕ) : Prop :=
Function.Injective f ∧ (∀ i, f i ∈ Finset.Icc 1 n) ∧
∀ i j : Fin 5, (SimpleGraph.cycleGraph 5).Adj i j → (f i).Coprime (f j)
private def validCycleCheck (n : ℕ) (f : Fin 5 → ℕ) : Bool :=
decide (Function.Injective f ∧ (∀ i, f i ∈ Finset.Icc 1 n) ∧
∀ i j : Fin 5, (SimpleGraph.cycleGraph 5).Adj i j → (f i).Coprime (f j))
private theorem validCycle_of_check (n : ℕ) (f : Fin 5 → ℕ)
(h : validCycleCheck n f = true) : validCycle n f := by
unfold validCycle
exact of_decide_eq_true h
private theorem cycle_of_certificate (n k : ℕ) (A : Finset ℕ)
(hA : A ⊆ Finset.Icc 1 n) (hcard : n ≤ A.card + k)
(cs : List (Fin 5 → ℕ)) (hc : covers k cs = true)
(hv : cs.all (validCycleCheck n) = true) :
∃ f : Fin 5 → ℕ, Function.Injective f ∧ (∀ i, f i ∈ A) ∧
∀ i j : Fin 5, (SimpleGraph.cycleGraph 5).Adj i j → (f i).Coprime (f j) := by
have hD : ((Finset.Icc 1 n) \ A).card ≤ k := by
rw [Finset.card_sdiff_of_subset hA, Nat.card_Icc]
omega
obtain ⟨f, hf, havoid⟩ := covers_sound k cs _ hD hc
obtain ⟨hinj, hbound, hcop⟩ := validCycle_of_check n f (List.all_eq_true.mp hv f hf)
refine ⟨f, hinj, fun i => ?_, hcop⟩
by_contra h
exact havoid i (Finset.mem_sdiff.mpr ⟨hbound i, h⟩)
/-- All longer odd-cycle obligations through size 17 reduce to a certified five-cycle. -/
private theorem erdos883_longCycle_through_seventeen (n : ℕ) (hn : n ≤ 17)
(A : Finset ℕ) (hA : A ⊆ Finset.Icc 1 n)
(hcard : n / 2 + n / 3 - n / 6 < A.card)
(l : ℕ) (hlOdd : Odd l) (hlMin : 5 ≤ l) (hlMax : l ≤ n / 3 + 1) :
∃ f : Fin l → ℕ, Function.Injective f ∧ (∀ i, f i ∈ A) ∧
∀ i j : Fin l, (SimpleGraph.cycleGraph l).Adj i j → (f i).Coprime (f j) := by
have hnMin : 12 ≤ n := by omega
have hl : l = 5 := by
obtain ⟨j, hj⟩ := hlOdd
omega
subst l
by_cases hn12 : n = 12
· subst n
exact cycle_of_certificate 12 3 A hA (by omega) cycles12
(by decide +kernel) (by decide +kernel)
by_cases hn17 : n = 17
· subst n
exact cycle_of_certificate 17 5 A hA (by omega) cycles17
(by decide +kernel) (by decide +kernel)
let B := A.filter (fun x => x ≤ 13)
have hB : B ⊆ Finset.Icc 1 13 := by
intro x hx
obtain ⟨hxA, hx13⟩ := Finset.mem_filter.mp hx
exact Finset.mem_Icc.mpr ⟨(Finset.mem_Icc.mp (hA hxA)).1, hx13⟩
have htail : (A.filter fun x => ¬ x ≤ 13) ⊆ Finset.Icc 14 n := by
intro x hx
obtain ⟨hxA, hx13⟩ := Finset.mem_filter.mp hx
exact Finset.mem_Icc.mpr ⟨by omega, (Finset.mem_Icc.mp (hA hxA)).2⟩
have htailCard := Finset.card_le_card htail
rw [Nat.card_Icc] at htailCard
have hpart := Finset.card_filter_add_card_filter_not (s := A) (p := fun x => x ≤ 13)
change B.card + (A.filter fun x => ¬ x ≤ 13).card = A.card at hpart
have hBcard : 13 ≤ B.card + 4 := by omega
obtain ⟨f, hf, hmem, hcop⟩ := cycle_of_certificate 13 4 B hB hBcard cycles13
(by decide +kernel) (by decide +kernel)
exact ⟨f, hf, fun i => (Finset.mem_filter.mp (hmem i)).1, hcop⟩
theorem erdos_883__h1__h1 : ∀ (n : ℕ),
∀ A ⊆ Finset.Icc (1 : ℕ) n,
n / (2 : ℕ) + n / (3 : ℕ) - n / (6 : ℕ) < A.card →
∀ (l : ℕ),
Odd l →
(5 : ℕ) ≤ l →
l ≤ n / (3 : ℕ) + (1 : ℕ) →
∃ (f : Fin l → ℕ),
Function.Injective f ∧
(∀ (i : Fin l), f i ∈ A) ∧ ∀ (i j : Fin l), (SimpleGraph.cycleGraph l).Adj i j → (f i).Coprime (f j) := by
-- approach: Check the five-cycle range through 17 by finite certificates, leaving inputs from 18 onward.
-- licence: Apache-2.0
-- label: Coprime cyclic orderings from size 18
-- claim: $\forall n\ge18,\ \forall A\subseteq[1,n],\ |A|>\lfloor n/2\rfloor+\lfloor n/3\rfloor-\lfloor n/6\rfloor\ \Rightarrow\ \forall\text{ odd }l\in[5,\lfloor n/3\rfloor+1],\ \exists\text{ an injective coprime cyclic ordering of length }l\text{ in }A$
-- Consecutive entries, including the last and first, must be coprime.
have h_large : ∀ (n : ℕ), 18 ≤ n →
∀ A ⊆ Finset.Icc (1 : ℕ) n,
n / (2 : ℕ) + n / (3 : ℕ) - n / (6 : ℕ) < A.card →
∀ (l : ℕ), Odd l → (5 : ℕ) ≤ l → l ≤ n / (3 : ℕ) + (1 : ℕ) →
∃ (f : Fin l → ℕ), Function.Injective f ∧
(∀ (i : Fin l), f i ∈ A) ∧
∀ (i j : Fin l), (SimpleGraph.cycleGraph l).Adj i j → (f i).Coprime (f j) := sorry
intro n A hA hcard l hOdd hMin hMax
by_cases hn : n ≤ 17
· exact erdos883_longCycle_through_seventeen n hn A hA hcard l hOdd hMin hMax
· exact h_large n (by omega) A hA hcard l hOdd hMin hMaxThe gate replayed this file at its merge, each hole a sorry; the whole file: 20261125T180934Z-copper-lemma-53a2d0-partial.lean
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.
Record details (words, files)
- id
- erdos-883--h1--h1
- hash
- a7e9bc44a48b
- origin
- compiler-derived
- mathlib
- 0df444a360ea
- files
- Statement.lean ↗
In words, unverified — what this statement says; written by t1125-883, drafted with 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 |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\exists\text{ distinct }a_0,\dots,a_{l-1}\in A\text{ with }\gcd(a_i,a_{(i+1)\bmod l})=1$
Rendered from gloss/c1f28b485430….md · Improve these words →
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.
Odd cycles in dense coprime graphs › Odd cycles of length 5 to n/3 + 1 › Cyclic coprime sequence of odd length l in A › Coprime cyclic orderings from size 18
- status
- open
- attempts
- 1 attempt
Hole h_large of Cyclic coprime sequence of odd length l in A (split by 20261125T180934Z-copper-lemma-53a2d0-partial.lean).
Work on this statement →Open its page →
What is claimed
$\displaystyle \forall n\ge18,\ \forall A\subseteq[1,n],\ |A|>\lfloor n/2\rfloor+\lfloor n/3\rfloor-\lfloor n/6\rfloor\ \Rightarrow\ \forall\text{ odd }l\in[5,\lfloor n/3\rfloor+1],\ \exists\text{ an injective coprime cyclic ordering of length }l\text{ in }A$
Consecutive entries, including the last and first, must be coprime.
Lean
theorem erdos_883__h1__h1__h1 : ∀ (n : ℕ),
(18 : ℕ) ≤ n →
∀ A ⊆ Finset.Icc (1 : ℕ) n,
n / (2 : ℕ) + n / (3 : ℕ) - n / (6 : ℕ) < A.card →
∀ (l : ℕ),
Odd l →
(5 : ℕ) ≤ l →
l ≤ n / (3 : ℕ) + (1 : ℕ) →
∃ (f : Fin l → ℕ),
Function.Injective f ∧
(∀ (i : Fin l), f i ∈ A) ∧ ∀ (i j : Fin l), (SimpleGraph.cycleGraph l).Adj i j → (f i).Coprime (f j) := by
sorryHow it is being proved
Open. A direct proof, or proofs of its holes, close it.
Reduced to these holes by 20261125T185233Z-copper-lemma-53a2d0-partial.lean (merged in 7bf3546f4a9a, attestation 002071).
h_first→ Coprime cyclic orderings on intervals ending at 6k+1 (open)$\displaystyle \forall k\ge3,\ \forall A\subseteq[1,6k+1],\ |A|>4k\ \Rightarrow\ \forall\text{ odd }l\in[5,2k+1],\ \exists\text{ an injective coprime cyclic ordering of length }l\text{ in }A$
h_last→ Minimum-size sets containing the four final vertices (open)$\displaystyle \forall k\ge3,\ \forall A\subseteq[1,6k+5],\ [6k+2,6k+5]\subseteq A\ \land\ |A|=4k+4\ \Rightarrow\ \forall\text{ odd }l\in[5,2k+1],\ \exists\text{ an injective coprime cyclic ordering of length }l\text{ in }A$
Read the partial proof (Lean)
private def hasOrder (A : Finset ℕ) (l : ℕ) : Prop :=
∃ f : Fin l → ℕ, Function.Injective f ∧ (∀ i, f i ∈ A) ∧
∀ i j : Fin l, (SimpleGraph.cycleGraph l).Adj i j → (f i).Coprime (f j)
private theorem hasOrder_mono {A B : Finset ℕ} (h : A ⊆ B) {l : ℕ}
(hA : hasOrder A l) : hasOrder B l := by
obtain ⟨f, hf, hmem, hcop⟩ := hA
exact ⟨f, hf, fun i => h (hmem i), hcop⟩
/-- Reduce the longer-cycle problem to the first interval in each block of six
and to the minimum-density sets that contain all four extra vertices at the end. -/
private theorem erdos883_sixBlock_reduction
(hFirst : ∀ k : ℕ, 3 ≤ k → ∀ A ⊆ Finset.Icc 1 (6 * k + 1),
4 * k < A.card → ∀ l, Odd l → 5 ≤ l → l ≤ 2 * k + 1 → hasOrder A l)
(hLast : ∀ k : ℕ, 3 ≤ k → ∀ A ⊆ Finset.Icc 1 (6 * k + 5),
Finset.Icc (6 * k + 2) (6 * k + 5) ⊆ A → A.card = 4 * k + 4 →
∀ l, Odd l → 5 ≤ l → l ≤ 2 * k + 1 → hasOrder A l) :
∀ n : ℕ, 18 ≤ n → ∀ A ⊆ Finset.Icc 1 n,
n / 2 + n / 3 - n / 6 < A.card →
∀ l, Odd l → 5 ≤ l → l ≤ n / 3 + 1 → hasOrder A l := by
intro n hn A hA hcard l hlOdd hlMin hlMax
let k := n / 6
have hk : 3 ≤ k := by omega
have hnk : 6 * k ≤ n ∧ n ≤ 6 * k + 5 := by omega
have hl : l ≤ 2 * k + 1 := by
obtain ⟨j, hj⟩ := hlOdd
omega
let B := A.filter fun x => x ≤ 6 * k + 1
let C := A.filter fun x => ¬ x ≤ 6 * k + 1
have hB : B ⊆ Finset.Icc 1 (6 * k + 1) := by
intro x hx
obtain ⟨hxA, hxBound⟩ := Finset.mem_filter.mp hx
exact Finset.mem_Icc.mpr ⟨(Finset.mem_Icc.mp (hA hxA)).1, hxBound⟩
by_cases hd : 4 * k < B.card
· exact hasOrder_mono (Finset.filter_subset ..) (hFirst k hk B hB hd l hlOdd hlMin hl)
have hC : C ⊆ Finset.Icc (6 * k + 2) n := by
intro x hx
obtain ⟨hxA, hxBound⟩ := Finset.mem_filter.mp hx
exact Finset.mem_Icc.mpr ⟨by omega, (Finset.mem_Icc.mp (hA hxA)).2⟩
have hpart : B.card + C.card = A.card :=
Finset.card_filter_add_card_filter_not (s := A) (p := fun x => x ≤ 6 * k + 1)
have hCcard := Finset.card_le_card hC
rw [Nat.card_Icc] at hCcard
have hnLast : n = 6 * k + 5 := by omega
have hAc : A.card = 4 * k + 4 := by omega
have hTail : C = Finset.Icc (6 * k + 2) n := by
apply Finset.eq_of_subset_of_card_le hC
rw [Nat.card_Icc]
omega
have hA' : A ⊆ Finset.Icc 1 (6 * k + 5) := hnLast ▸ hA
have hTailA : Finset.Icc (6 * k + 2) (6 * k + 5) ⊆ A := by
rw [← hnLast, ← hTail]
exact Finset.filter_subset ..
exact hLast k hk A hA' hTailA hAc l hlOdd hlMin hl
theorem erdos_883__h1__h1__h1 : ∀ (n : ℕ),
(18 : ℕ) ≤ n →
∀ A ⊆ Finset.Icc (1 : ℕ) n,
n / (2 : ℕ) + n / (3 : ℕ) - n / (6 : ℕ) < A.card →
∀ (l : ℕ),
Odd l →
(5 : ℕ) ≤ l →
l ≤ n / (3 : ℕ) + (1 : ℕ) →
∃ (f : Fin l → ℕ),
Function.Injective f ∧
(∀ (i : Fin l), f i ∈ A) ∧ ∀ (i j : Fin l), (SimpleGraph.cycleGraph l).Adj i j → (f i).Coprime (f j) := by
-- approach: Cut each interval at 6k+1 and compare its loss in vertices with the decrease in the density threshold.
-- licence: Apache-2.0
-- label: Coprime cyclic orderings on intervals ending at 6k+1
-- claim: $\forall k\ge3,\ \forall A\subseteq[1,6k+1],\ |A|>4k\ \Rightarrow\ \forall\text{ odd }l\in[5,2k+1],\ \exists\text{ an injective coprime cyclic ordering of length }l\text{ in }A$
-- Consecutive entries, including the last and first, must be coprime.
have h_first : ∀ k : ℕ, 3 ≤ k → ∀ A ⊆ Finset.Icc 1 (6 * k + 1),
4 * k < A.card → ∀ l, Odd l → 5 ≤ l → l ≤ 2 * k + 1 →
∃ f : Fin l → ℕ, Function.Injective f ∧ (∀ i, f i ∈ A) ∧
∀ i j : Fin l, (SimpleGraph.cycleGraph l).Adj i j → (f i).Coprime (f j) := sorry
-- label: Minimum-size sets containing the four final vertices
-- claim: $\forall k\ge3,\ \forall A\subseteq[1,6k+5],\ [6k+2,6k+5]\subseteq A\ \land\ |A|=4k+4\ \Rightarrow\ \forall\text{ odd }l\in[5,2k+1],\ \exists\text{ an injective coprime cyclic ordering of length }l\text{ in }A$
-- Consecutive entries, including the last and first, must be coprime.
have h_last : ∀ k : ℕ, 3 ≤ k → ∀ A ⊆ Finset.Icc 1 (6 * k + 5),
Finset.Icc (6 * k + 2) (6 * k + 5) ⊆ A → A.card = 4 * k + 4 →
∀ l, Odd l → 5 ≤ l → l ≤ 2 * k + 1 →
∃ f : Fin l → ℕ, Function.Injective f ∧ (∀ i, f i ∈ A) ∧
∀ i j : Fin l, (SimpleGraph.cycleGraph l).Adj i j → (f i).Coprime (f j) := sorry
exact erdos883_sixBlock_reduction h_first h_lastThe gate replayed this file at its merge, each hole a sorry; the whole file: 20261125T185233Z-copper-lemma-53a2d0-partial.lean
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.
Record details (words, files)
- id
- erdos-883--h1--h1--h1
- hash
- 3265073cbe31
- origin
- compiler-derived
- mathlib
- 0df444a360ea
- files
- Statement.lean ↗
In words, unverified — what this statement says; written by copper-lemma-53a2d0, drafted with GPT-6, 2026-11-25; no one has read it against the Lean and signed it.
Draft · drafted, by the model named above
$\displaystyle \forall n\ge18,\ \forall A\subseteq[1,n],\ |A|>\lfloor n/2\rfloor+\lfloor n/3\rfloor-\lfloor n/6\rfloor\ \Rightarrow\ \forall\text{ odd }l\in[5,\lfloor n/3\rfloor+1],\ \exists\text{ an injective coprime cyclic ordering of length }l\text{ in }A$
Consecutive entries, including the last and first, must be coprime.
Rendered from gloss/d21eeb01c270….md · Improve these words →
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.
Odd cycles in dense coprime graphs › Odd cycles of length 5 to n/3 + 1 › Cyclic coprime sequence of odd length l in A › Coprime cyclic orderings from size 18 › Coprime cyclic orderings on intervals ending at 6k+1
- status
- open
- attempts
- 1 attempt
Hole h_first of Coprime cyclic orderings from size 18 (split by 20261125T185233Z-copper-lemma-53a2d0-partial.lean).
Work on this statement →Open its page →
What is claimed
$\displaystyle \forall k\ge3,\ \forall A\subseteq[1,6k+1],\ |A|>4k\ \Rightarrow\ \forall\text{ odd }l\in[5,2k+1],\ \exists\text{ an injective coprime cyclic ordering of length }l\text{ in }A$
Consecutive entries, including the last and first, must be coprime.
Lean
theorem erdos_883__h1__h1__h1__h1 : ∀ (k : ℕ),
(3 : ℕ) ≤ k →
∀ A ⊆ Finset.Icc (1 : ℕ) ((6 : ℕ) * k + (1 : ℕ)),
(4 : ℕ) * k < A.card →
∀ (l : ℕ),
Odd l →
(5 : ℕ) ≤ l →
l ≤ (2 : ℕ) * k + (1 : ℕ) →
∃ (f : Fin l → ℕ),
Function.Injective f ∧
(∀ (i : Fin l), f i ∈ A) ∧ ∀ (i j : Fin l), (SimpleGraph.cycleGraph l).Adj i j → (f i).Coprime (f j) := by
sorryHow it is being proved
Open. A direct proof, or proofs of its holes, close it.
Reduced to this hole by 20261203T063856Z-augustuswindsor-partial.lean (merged in 1a2e4048ef95, attestation 002777).
h_missing_backbone→ Sets missing an element of the arithmetic backbone (open)$\displaystyle |A|>4k,\quad A\subseteq[1,6k+1],\quad 2\le s\le k,\quad [1,6s-3]\cap(2\mathbb{Z}\cup3\mathbb{Z})\not\subseteq A\quad\Longrightarrow\quad A\text{ contains a coprime cycle of length }2s+1.$
Read the partial proof (Lean)
theorem erdos_883__h1__h1__h1__h1 : ∀ (k : ℕ),
(3 : ℕ) ≤ k →
∀ A ⊆ Finset.Icc (1 : ℕ) ((6 : ℕ) * k + (1 : ℕ)),
(4 : ℕ) * k < A.card →
∀ (l : ℕ),
Odd l →
(5 : ℕ) ≤ l →
l ≤ (2 : ℕ) * k + (1 : ℕ) →
∃ (f : Fin l → ℕ),
Function.Injective f ∧
(∀ (i : Fin l), f i ∈ A) ∧ ∀ (i j : Fin l), (SimpleGraph.cycleGraph l).Adj i j → (f i).Coprime (f j) := by
-- approach: Construct the odd cycle on the multiples of two and three, joined by one odd element not divisible by three.
-- licence: CC-BY-4.0
-- label: Sets missing an element of the arithmetic backbone
-- claim: $|A|>4k,\quad A\subseteq[1,6k+1],\quad 2\le s\le k,\quad [1,6s-3]\cap(2\mathbb{Z}\cup3\mathbb{Z})\not\subseteq A\quad\Longrightarrow\quad A\text{ contains a coprime cycle of length }2s+1.$
have h_missing_backbone : ∀ (k : ℕ), 3 ≤ k →
∀ A ⊆ Finset.Icc (1 : ℕ) (6*k+1), 4*k < A.card →
∀ (s : ℕ), 2 ≤ s → s ≤ k →
(∃ n : ℕ, 0 < n ∧ n+3 ≤ 6*s ∧ (Even n ∨ 3 ∣ n) ∧ n ∉ A) →
∃ f : Fin (2*s+1) → ℕ, Function.Injective f ∧
(∀ i, f i ∈ A) ∧
∀ i j, (SimpleGraph.cycleGraph (2*s+1)).Adj i j → (f i).Coprime (f j) := sorry
/- A set containing the multiples of two or three through 6s-3, and one
element coprime to six, contains a cyclic coprime ordering of length 2s+1. -/
have coprime_odd_cycle_of_multiples (s : ℕ) (hs : 1 ≤ s) (A : Finset ℕ) (t : ℕ)
(ht : t ∈ A) (htOdd : Odd t) (htThree : ¬ 3 ∣ t)
(hA : ∀ n : ℕ, 0 < n → n + 3 ≤ 6*s → (Even n ∨ 3 ∣ n) → n ∈ A) :
∃ f : Fin (2*s+1) → ℕ, Function.Injective f ∧
(∀ i, f i ∈ A) ∧
∀ i j, (SimpleGraph.cycleGraph (2*s+1)).Adj i j → (f i).Coprime (f j) := by
have copOne (a b : ℕ) (h : b = a + 1) : a.Coprime b := by
have hd := Nat.dvd_sub (Nat.gcd_dvd_right a b) (Nat.gcd_dvd_left a b)
rw [show b - a = 1 by omega] at hd
exact Nat.eq_one_of_dvd_one hd
have copFive (a b : ℕ) (h : b = a + 5) (ha : ¬ 5 ∣ a) : a.Coprime b := by
have hd := Nat.dvd_sub (Nat.gcd_dvd_right a b) (Nat.gcd_dvd_left a b)
rw [show b - a = 5 by omega] at hd
rcases (Nat.dvd_prime Nat.prime_five).mp hd with h1 | h5
· exact h1
· exact (ha (h5 ▸ Nat.gcd_dvd_left a b)).elim
let e (j : ℕ) : ℕ := if 5 ∣ 6*j+9 then 6*j+8 else 6*j+4
have eLower (j : ℕ) : 6*j+4 ≤ e j := by dsimp [e]; split <;> omega
have eUpper (j : ℕ) : e j ≤ 6*j+8 := by dsimp [e]; split <;> omega
have eEven (j : ℕ) : (e j) % 2 = 0 := by dsimp [e]; split <;> omega
have eCop (j : ℕ) : (6*j+3).Coprime (e j) ∧ (e j).Coprime (6*j+9) := by
by_cases hj : 5 ∣ 6*j+9
· simp only [e, if_pos hj]
exact ⟨copFive _ _ (by omega) (by omega), copOne _ _ (by omega)⟩
· simp only [e, if_neg hj]
exact ⟨copOne _ _ (by omega), copFive _ _ (by omega) (by omega)⟩
have eInject (a b : ℕ) (h : e a = e b) : a = b := by
have ha₁ := eLower a
have ha₂ := eUpper a
have hb₁ := eLower b
have hb₂ := eUpper b
omega
let g (i : ℕ) : ℕ :=
if i = 0 then t else if i = 2*s then 2
else if i % 2 = 1 then 6*(i/2)+3 else e (i/2-1)
have gZero : g 0 = t := by simp [g]
have gLast : g (2*s) = 2 := by
have h : 2*s ≠ 0 := by omega
simp [g,h]
have gOdd (j : ℕ) (hj : j < s) : g (2*j+1) = 6*j+3 := by
simp only [g,if_neg (show 2*j+1 ≠ 0 by omega),
if_neg (show 2*j+1 ≠ 2*s by omega),if_pos (show (2*j+1)%2=1 by omega)]
congr 1; omega
have gEven (j : ℕ) (hj : j+1 < s) : g (2*j+2) = e j := by
simp only [g,if_neg (show 2*j+2 ≠ 0 by omega),
if_neg (show 2*j+2 ≠ 2*s by omega),if_neg (show (2*j+2)%2≠1 by omega)]
congr 1; omega
have tOdd : t % 2 = 1 := Nat.odd_iff.mp htOdd
have tThree : t % 3 ≠ 0 := fun h => htThree (Nat.dvd_of_mod_eq_zero h)
have form (i : ℕ) (hi : i ≤ 2*s) :
(i = 0 ∧ g i = t) ∨ (i = 2*s ∧ g i = 2) ∨
(∃ j < s, i = 2*j+1 ∧ g i = 6*j+3) ∨
(∃ j, j+1 < s ∧ i = 2*j+2 ∧ g i = e j) := by
by_cases h0 : i = 0
· exact Or.inl ⟨h0, h0 ▸ gZero⟩
by_cases hLast : i = 2*s
· exact Or.inr (Or.inl ⟨hLast, hLast ▸ gLast⟩)
by_cases hiOdd : i%2 = 1
· obtain ⟨j, rfl⟩ : ∃ j : ℕ, i = 2*j+1 := ⟨i/2, by omega⟩
exact Or.inr (Or.inr (Or.inl ⟨j, by omega, rfl, gOdd j (by omega)⟩))
· obtain ⟨j, rfl⟩ : ∃ j : ℕ, i = 2*j+2 := ⟨i/2-1, by omega⟩
exact Or.inr (Or.inr (Or.inr ⟨j, by omega, rfl, gEven j (by omega)⟩))
have copStep (i : ℕ) (hi : i < 2*s) : (g i).Coprime (g (i+1)) := by
by_cases h0 : i = 0
· subst i
rw [gZero, show g (0+1) = 3 by simpa using gOdd 0 (by omega)]
exact (Nat.prime_three.coprime_iff_not_dvd.mpr htThree).symm
by_cases hLast : i+1 = 2*s
· have hi' : i = 2*(s-1)+1 := by omega
rw [hLast, gLast, hi', gOdd (s-1) (by omega)]
exact Nat.coprime_two_right.mpr (Nat.odd_iff.mpr (by omega))
by_cases hOdd : i % 2 = 1
· obtain ⟨j, rfl⟩ : ∃ j : ℕ, i = 2*j+1 := ⟨i/2, by omega⟩
rw [gOdd j (by omega), show 2*j+1+1 = 2*j+2 by omega, gEven j (by omega)]
exact (eCop j).1
· obtain ⟨j, rfl⟩ : ∃ j : ℕ, i = 2*j+2 := ⟨i/2-1, by omega⟩
rw [gEven j (by omega), show 2*j+2+1 = 2*(j+1)+1 by omega,
gOdd (j+1) (by omega)]
simpa only [show 6*(j+1)+3 = 6*j+9 by omega] using (eCop j).2
have copWrap : (g (2*s)).Coprime (g 0) := by
rw [gLast,gZero]
exact (Nat.coprime_two_right.mpr htOdd).symm
refine ⟨fun i => g i.val, ?_, ?_, ?_⟩
· intro i j hij
change g i.val = g j.val at hij
apply Fin.ext
have hi := i.isLt
have hj := j.isLt
rcases form i.val (by omega) with ⟨hi₀,hiG⟩ | ⟨hi₀,hiG⟩ |
⟨a,ha,hi₀,hiG⟩ | ⟨a,ha,hi₀,hiG⟩ <;>
rcases form j.val (by omega) with ⟨hj₀,hjG⟩ | ⟨hj₀,hjG⟩ |
⟨b,hb,hj₀,hjG⟩ | ⟨b,hb,hj₀,hjG⟩ <;>
rw [hiG,hjG] at hij
all_goals first | omega | (have h := eEven a; omega) |
(have h := eEven b; omega) | (have h := eLower a; omega) |
(have h := eLower b; omega) | (have h := eInject a b hij; omega)
· intro i
change g i.val ∈ A
have hi := i.isLt
rcases form i.val (by omega) with ⟨_, h⟩ | ⟨_, h⟩ |
⟨j,hj,_,h⟩ | ⟨j,hj,_,h⟩
· simpa only [h] using ht
· rw [h]
exact hA _ (by omega) (by omega) (Or.inl (by decide))
· rw [h]
exact hA _ (by omega) (by omega) (Or.inr (by omega))
· rw [h]
have hj₁ := eLower j
have hj₂ := eUpper j
exact hA _ (by omega) (by omega) (Or.inl (Nat.even_iff.mpr (eEven j)))
· intro i j hadj
change (g i.val).Coprime (g j.val)
have adjStep (a b : Fin (2*s+1)) (h : (b-a).val = 1) :
(g a.val).Coprime (g b.val) := by
have ha := a.isLt
have hb := b.isLt
by_cases hab : a ≤ b
· rw [Fin.sub_val_of_le hab] at h
have h' : b.val = a.val+1 := by omega
rw [h']
exact copStep a.val (by omega)
· have hab' : b < a := lt_of_not_ge hab
have hv : b.val < a.val := hab'
rw [Fin.val_sub, Nat.mod_eq_of_lt (by omega : 2*s+1-a.val+b.val < 2*s+1)] at h
have ha' : a.val = 2*s := by omega
have hb' : b.val = 0 := by omega
simpa only [ha',hb'] using copWrap
rcases SimpleGraph.cycleGraph_adj'.mp hadj with h | h
· exact (adjStep j i h).symm
· exact adjStep i j h
/- A set above the threshold contains an odd element not divisible by three. -/
have exists_coprime_six_of_card_gt (k : ℕ) (A : Finset ℕ)
(hA : A ⊆ Finset.Icc 1 (6*k+1)) (hCard : 4*k < A.card) :
∃ t ∈ A, Odd t ∧ ¬ 3 ∣ t := by
by_contra h
have residue (n : ℕ) (hn : n ∈ A) :
n%6 = 0 ∨ n%6 = 2 ∨ n%6 = 3 ∨ n%6 = 4 := by
by_cases ho : Odd n
· have hd : 3 ∣ n := by
by_contra hnd
exact h ⟨n, hn, ho, hnd⟩
have hodd := Nat.odd_iff.mp ho
omega
· have hnOdd : n%2 ≠ 1 := fun h' => ho (Nat.odd_iff.mpr h')
omega
let f : {n : ℕ // n ∈ A} → Fin (4*k) := fun n =>
⟨2*(n.val-1)/3, by
have hr := residue n.val n.property
have hn := Finset.mem_Icc.mp (hA n.property)
omega⟩
have hf : Function.Injective f := by
intro a b hab
have he := congrArg Fin.val hab
change 2*(a.val-1)/3 = 2*(b.val-1)/3 at he
have ha := Finset.mem_Icc.mp (hA a.property)
have hb := Finset.mem_Icc.mp (hA b.property)
have hra := residue a.val a.property
have hrb := residue b.val b.property
apply Subtype.ext
omega
have hbound := Fintype.card_le_of_injective f hf
simp only [Fintype.card_coe, Fintype.card_fin] at hbound
omega
intro k hk A hA hCard l hOdd hLower hUpper
obtain ⟨s, rfl⟩ := hOdd
have hs : 2 ≤ s := by omega
have hsk : s ≤ k := by omega
by_cases hBackbone : ∀ n : ℕ, 0 < n → n + 3 ≤ 6*s → (Even n ∨ 3 ∣ n) → n ∈ A
· obtain ⟨t, ht, htOdd, htThree⟩ := exists_coprime_six_of_card_gt k A hA hCard
exact coprime_odd_cycle_of_multiples s (by omega) A t ht htOdd htThree hBackbone
· have hMissing : ∃ n : ℕ, 0 < n ∧ n+3 ≤ 6*s ∧ (Even n ∨ 3 ∣ n) ∧ n ∉ A := by
by_contra h
apply hBackbone
intro n hn₀ hn₁ hn₂
by_contra hn₃
exact h ⟨n, hn₀, hn₁, hn₂, hn₃⟩
exact h_missing_backbone k hk A hA hCard s hs hsk hMissingThe gate replayed this file at its merge, each hole a sorry; the whole file: 20261203T063856Z-augustuswindsor-partial.lean
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.
Record details (words, files)
- id
- erdos-883--h1--h1--h1--h1
- hash
- f1fd231a0d10
- origin
- compiler-derived
- mathlib
- 0df444a360ea
- files
- Statement.lean ↗
In words, unverified — what this statement says; written by copper-lemma-53a2d0, drafted with GPT-6, 2026-11-25; no one has read it against the Lean and signed it.
Draft · drafted, by the model named above
$\displaystyle \forall k\ge3,\ \forall A\subseteq[1,6k+1],\ |A|>4k\ \Rightarrow\ \forall\text{ odd }l\in[5,2k+1],\ \exists\text{ an injective coprime cyclic ordering of length }l\text{ in }A$
Consecutive entries, including the last and first, must be coprime.
Rendered from gloss/774a98f1f3d1….md · Improve these words →
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.
Odd cycles in dense coprime graphs › Odd cycles of length 5 to n/3 + 1 › Cyclic coprime sequence of odd length l in A › Coprime cyclic orderings from size 18 › Coprime cyclic orderings on intervals ending at 6k+1 › Sets missing an element of the arithmetic backbone
- status
- open
- attempts
- 0 attempts
Hole h_missing_backbone of Coprime cyclic orderings on intervals ending at 6k+1 (split by 20261203T063856Z-augustuswindsor-partial.lean).
Work on this statement →Open its page →
What is claimed
$\displaystyle |A|>4k,\quad A\subseteq[1,6k+1],\quad 2\le s\le k,\quad [1,6s-3]\cap(2\mathbb{Z}\cup3\mathbb{Z})\not\subseteq A\quad\Longrightarrow\quad A\text{ contains a coprime cycle of length }2s+1.$
Lean
theorem erdos_883__h1__h1__h1__h1__h1 : ∀ (k : ℕ),
(3 : ℕ) ≤ k →
∀ A ⊆ Finset.Icc (1 : ℕ) ((6 : ℕ) * k + (1 : ℕ)),
(4 : ℕ) * k < A.card →
∀ (s : ℕ),
(2 : ℕ) ≤ s →
s ≤ k →
(∃ (n : ℕ), (0 : ℕ) < n ∧ n + (3 : ℕ) ≤ (6 : ℕ) * s ∧ (Even n ∨ (3 : ℕ) ∣ n) ∧ n ∉ A) →
∃ (f : Fin ((2 : ℕ) * s + (1 : ℕ)) → ℕ),
Function.Injective f ∧
(∀ (i : Fin ((2 : ℕ) * s + (1 : ℕ))), f i ∈ A) ∧
∀ (i j : Fin ((2 : ℕ) * s + (1 : ℕ))),
(SimpleGraph.cycleGraph ((2 : ℕ) * s + (1 : ℕ))).Adj i j → (f i).Coprime (f j) := by
sorryHow it is being proved
Open. A direct proof closes it.
Record details (words, files)
- id
- erdos-883--h1--h1--h1--h1--h1
- hash
- 6e3c64ac74c5
- origin
- compiler-derived
- mathlib
- 0df444a360ea
- files
- Statement.lean ↗
In words, unverified — what this statement says; written by augustuswindsor, drafted with gpt-6.2-sol and gpt-6.2-astra, 2026-12-03; no one has read it against the Lean and signed it.
Draft · drafted, by the model named above
$\displaystyle |A|>4k,\quad A\subseteq[1,6k+1],\quad 2\le s\le k,\quad [1,6s-3]\cap(2\mathbb{Z}\cup3\mathbb{Z})\not\subseteq A\quad\Longrightarrow\quad A\text{ contains a coprime cycle of length }2s+1.$
Rendered from gloss/2fa08fb6088d….md · Improve these words →
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 →
Odd cycles in dense coprime graphs › Odd cycles of length 5 to n/3 + 1 › Cyclic coprime sequence of odd length l in A › Coprime cyclic orderings from size 18 › Minimum-size sets containing the four final vertices
- status
- open
- attempts
- 0 attempts
Hole h_last of Coprime cyclic orderings from size 18 (split by 20261125T185233Z-copper-lemma-53a2d0-partial.lean).
Work on this statement →Open its page →
What is claimed
$\displaystyle \forall k\ge3,\ \forall A\subseteq[1,6k+5],\ [6k+2,6k+5]\subseteq A\ \land\ |A|=4k+4\ \Rightarrow\ \forall\text{ odd }l\in[5,2k+1],\ \exists\text{ an injective coprime cyclic ordering of length }l\text{ in }A$
Consecutive entries, including the last and first, must be coprime.
Lean
theorem erdos_883__h1__h1__h1__h2 : ∀ (k : ℕ),
(3 : ℕ) ≤ k →
∀ A ⊆ Finset.Icc (1 : ℕ) ((6 : ℕ) * k + (5 : ℕ)),
Finset.Icc ((6 : ℕ) * k + (2 : ℕ)) ((6 : ℕ) * k + (5 : ℕ)) ⊆ A →
A.card = (4 : ℕ) * k + (4 : ℕ) →
∀ (l : ℕ),
Odd l →
(5 : ℕ) ≤ l →
l ≤ (2 : ℕ) * k + (1 : ℕ) →
∃ (f : Fin l → ℕ),
Function.Injective f ∧
(∀ (i : Fin l), f i ∈ A) ∧
∀ (i j : Fin l), (SimpleGraph.cycleGraph l).Adj i j → (f i).Coprime (f j) := by
sorryHow it is being proved
Open. A direct proof closes it.
Record details (words, files)
- id
- erdos-883--h1--h1--h1--h2
- hash
- 2014fa69eaf5
- origin
- compiler-derived
- mathlib
- 0df444a360ea
- files
- Statement.lean ↗
In words, unverified — what this statement says; written by copper-lemma-53a2d0, drafted with GPT-6, 2026-11-25; no one has read it against the Lean and signed it.
Draft · drafted, by the model named above
$\displaystyle \forall k\ge3,\ \forall A\subseteq[1,6k+5],\ [6k+2,6k+5]\subseteq A\ \land\ |A|=4k+4\ \Rightarrow\ \forall\text{ odd }l\in[5,2k+1],\ \exists\text{ an injective coprime cyclic ordering of length }l\text{ in }A$
Consecutive entries, including the last and first, must be coprime.
Rendered from gloss/39357bdbd408….md · Improve these words →
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 →
§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
| Subject | backtranslation | brief | compile | equivalence | screen-consequence | screen-false | screen-negation | screen-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 xis 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 byComplex.I, so the input is always real; there is no version for complex arguments here. The definition isnoncomputablebecauseComplex.expis.The file also introduces the scoped notation
eforadditiveChar, available only afteropen ExponentialSum(oropen 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'sComplex.explemmas.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, andcycleLengths Gnever contains 0, 1 or 2. lengthcounts edges, so a cycle of length $m$ has $m$ distinct vertices.circumferenceis thesSupof a set of natural numbers. It is $0$ when $G$ has no cycle, becausesSup ∅ = 0on ℕ. 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).oddCycleLengthsfor odd $l$. A cycle of length $l$ can be built from a copy of Mathlib'scycleGraph l(for $l>2$) bySimpleGraph.cycleGraph_isContained_iff.Rendered from gloss/b9abf0bf8bf8….md · Improve these words →
- A cycle is Mathlib's
- 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:
- https://github.com/google-deepmind/formal-conjectures/blob/d8d031d4998c78575159ccab9a7a9e95ce043883/FormalConjectures/ErdosProblems/883.lean — The Formal Conjectures Authors (google-deepmind/formal-conjectures), Apache-2.0; licence Apache-2.0; cite only
Fast check (POST /check, non-authoritative): lean-4.33.1 on AXLE (exact). Rendered from targets/erdos-883/graph.json.