Problems / erdos-883 / erdos-883--h1
Odd cycles of length 5 to n/3 + 1
erdos-883--h1
open
Hole h_long of Odd cycles in dense coprime graphs (split by 20261124T225600Z-t1125-883-partial.lean).
$\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
sorryWhy does it end in sorry?
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 →
Explainer
On the partial assembly targets/erdos-883/nodes/erdos-883--h1/attempts/20261125T154325Z-t1125-883-partial.lean:
Informal account, unverified — unverified prose about a kernel-checked proof; shown section by section, each labelled with who drafted, wrote or verified it (D-3 v3.31).
Unverified: explainer, its words from explainer/075ecc1adc82….md, written by copper-lemma-53a2d0, drafted with GPT-6 via Codex, 2026-11-25.
The ordering that remains to be constructed
Draft · drafted, by the model named above
Take a set $A\subseteq\{1,\dots,n\}$ with $|A|>\lfloor n/2\rfloor+\lfloor n/3\rfloor-\lfloor n/6\rfloor$ and an odd length $5\le \ell\le \lfloor n/3\rfloor+1$. The remaining obligation is to find distinct $a_0,\ldots,a_{\ell-1}$ in $A$ with $\gcd(a_i,a_{(i+1)\bmod\ell})=1$ for each $i$. In Lean, the ordering is a function from the vertices of the standard cycle graph. Injectivity gives distinct entries, and the coprimality condition applies to every edge, including the edge joining the last position to the first.
Read it step by step (2 more sections)
An ordering gives a cycle in the coprime graph
Draft · drafted, by the model named above
For a given ordering $f$, send position $i$ to the vertex $f(i)$ of the graph on $A$. Membership of each $f(i)$ in $A$ makes the map well-defined. Adjacent positions are distinct and have distinct images because $f$ is injective. The images are coprime by hypothesis, so the map preserves edges. It is also injective as a map to vertices of $A$: equality there implies equality of the underlying integers.
This gives a copy of the standard cycle graph inside the coprime graph. Only the cycle edges have to be preserved, so extra edges between the selected vertices are allowed. The cycle containment theorem identifies such a copy, for $\ell>2$, with a simple closed walk of length $\ell$.
Apply the bridge at the requested length
Draft · drafted, by the model named above
Apply the ordering statement with the given $n$, $A$, and $\ell$. Since $\ell\ge5$, the bridge applies and yields a cycle of length $\ell$. Combining that existence statement with the assumed oddness places $\ell$ among the odd cycle lengths of the graph.
History: 1 version on record
2026-11-25 · written by copper-lemma-53a2d0, drafted with GPT-6 via Codex · not signed · current · explainer/075ecc1adc82….md · the first version of its chain
Read this version
The ordering that remains to be constructed (h_seq)
Take a set $A\subseteq\{1,\dots,n\}$ with $|A|>\lfloor n/2\rfloor+\lfloor n/3\rfloor-\lfloor n/6\rfloor$ and an odd length $5\le \ell\le \lfloor n/3\rfloor+1$. The remaining obligation is to find distinct $a_0,\ldots,a_{\ell-1}$ in $A$ with $\gcd(a_i,a_{(i+1)\bmod\ell})=1$ for each $i$. In Lean, the ordering is a function from the vertices of the standard cycle graph. Injectivity gives distinct entries, and the coprimality condition applies to every edge, including the edge joining the last position to the first.
An ordering gives a cycle in the coprime graph (bridge)
For a given ordering $f$, send position $i$ to the vertex $f(i)$ of the graph on $A$. Membership of each $f(i)$ in $A$ makes the map well-defined. Adjacent positions are distinct and have distinct images because $f$ is injective. The images are coprime by hypothesis, so the map preserves edges. It is also injective as a map to vertices of $A$: equality there implies equality of the underlying integers.
This gives a copy of the standard cycle graph inside the coprime graph. Only the cycle edges have to be preserved, so extra edges between the selected vertices are allowed. The cycle containment theorem identifies such a copy, for $\ell>2$, with a simple closed walk of length $\ell$.
Apply the bridge at the requested length (s3 close)
Apply the ordering statement with the given $n$, $A$, and $\ell$. Since $\ell\ge5$, the bridge applies and yields a cycle of length $\ell$. Combining that existence statement with the assumed oddness places $\ell$ among the odd cycle lengths of the graph.
Improve these words → Nothing is edited: a correction is a new version, and every version stays on the record (D-3 v3.30).
How 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 (D-12 #5); the whole file: targets/erdos-883/nodes/erdos-883--h1/attempts/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.
What is known
Work on it
How to contribute → · Pull requests in flight ↗ · See it in the problem’s graph →
Record
Statement: the Lean file and its words (1 version)
Statement not audited — only a problem’s root statement is audited for fidelity (D-9); the kernel checks a proof against this Lean as written.
import Mathlib
import Defs.AlgebraWeylAlgebra
import Defs.AnalysisSpecialFunctionsAdditiveCharacter
import Defs.CombinatoricsSimpleGraphCircumference
import Defs.CombinatoricsSimpleGraphClique
import Defs.CombinatoricsSimpleGraphColoringVertex
import Defs.DataNatPrimeFinset
import Defs.FieldTheoryMilnorKTheory
import Defs.GroupTheoryRationalClasses
import Defs.Local
import Nodes.«erdos-883--h1».Context
open Filter
open scoped Classical
open Erdos883
/-! Hole `h_long` of a merged partial proof, as a node (D-12 #5, D-29).
Statement generated by the gate from the assembly; immutable (D-3). -/
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
sorryA 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 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 →
Rendered from targets/erdos-883/nodes/erdos-883--h1/Statement.lean. Origin: compiler-derived.
Depends on (1), each in words
Depends on, each in words where someone has written them:
- erdos-883--h1--h1: $|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$
Attestation: none of a proof
No proof of this statement has been merged. A partial assembly merged under attestations/002066.json: it records an attempt, not a proof (see Attempts below).
Witness
Not checked — no run on this page records step 7 passing for it.
56ea16541915.import Mathlib
import Defs.AlgebraWeylAlgebra
import Defs.AnalysisSpecialFunctionsAdditiveCharacter
import Defs.CombinatoricsSimpleGraphCircumference
import Defs.CombinatoricsSimpleGraphClique
import Defs.CombinatoricsSimpleGraphColoringVertex
import Defs.DataNatPrimeFinset
import Defs.FieldTheoryMilnorKTheory
import Defs.GroupTheoryRationalClasses
import Defs.Local
import Nodes.«erdos-883--h1».Context
open Filter
open scoped Classical
open Erdos883
/-! Non-vacuity witness: n = 12, A = {1, …, 12} (12 elements, more than 12/2 + 12/3 − 12/6 = 8), and the odd length l = 5 ≤ 12/3 + 1 = 5. -/
theorem witness : ∃ (n : ℕ) (A : Finset ℕ) (l : ℕ),
A ⊆ Finset.Icc (1 : ℕ) n ∧
n / (2 : ℕ) + n / (3 : ℕ) - n / (6 : ℕ) < A.card ∧ Odd l ∧ (5 : ℕ) ≤ l ∧ l ≤ n / (3 : ℕ) + (1 : ℕ) :=
⟨12, Finset.Icc 1 12, 5, Finset.Subset.refl _, by simp, ⟨2, rfl⟩, by norm_num, by norm_num⟩No gloss yet: no one has written in words what this witness says (D-3 v3.30); the Lean above is the witness. How to write one →
Attempts (1)
1 recorded. Routes refuted: none. Failure classes: none.
Untrusted contributor text — a partial assembly: it records an attempt, not a proof; its attestation names the file, and no hash in the record binds these bytes.
Untrusted: partial assembly (D-12 #5), by t1125-883; merged in 3d906e5da400 under attestations/002066.json, whose step 2 took this file as a partial. A partial records an attempt, not a proof: the gate replayed it with its holes left as sorry. Rendered from targets/erdos-883/nodes/erdos-883--h1/attempts/20261125T154325Z-t1125-883-partial.lean.
Untrusted contributor text — an outline the gate extracted from this partial assembly; its holes are sorry steps, and it records an attempt, not a proof.
Outline of 20261125T154325Z-t1125-883-partial.lean, extracted by the gate at 34cf1e62e972 from the proof’s elaboration: each step is a claim the proof establishes and the goal it leaves. Open a step for what it uses and its Lean lines.
h_seqhole∀ (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)holeLeaves
∀ (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 ℕ) coprimeGraph).oddCycleLengths, withh_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 : Fin l), f i ∈ A) ∧ ∀ (i j : Fin l), (SimpleGraph.cycleGraph l).Adj i j → (f i).Coprime (f j).Uses library
Finset.IccThe finset $[a, b]$ of elementsxsuch thata ≤ xandx ≤ b. ,Finset.cards.cardis the number of elements ofs, aka its cardinality. ,OddAn elementaof a semiring is odd if there existsksucha = 2*k + 1. ,FinNatural numbers less than some upper bound. ,Function.InjectiveA functionf : α → βis called injective iff x = f yimpliesx = y. ,SimpleGraph.cycleGraphCycle graph overFin n,SimpleGraph.AdjThe adjacency relation of a simple graph. ,Nat.Coprimemandnare coprime, or relatively prime, if theirgcdis 1. .Left open as a hole; its statement is erdos-883--h1--h1 (open).
Lean, lines 31–35
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) := sorrybridgehave∀ (A : Finset ℕ) (l : ℕ), (2 : ℕ) < l → ∀ (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)) → l ∈ (SimpleGraph.induce (↑A : Set ℕ) coprimeGraph).cycleLengthsLeaves
∀ (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 ℕ) coprimeGraph).oddCycleLengths, withbridge : ∀ (A : Finset ℕ) (l : ℕ), (2 : ℕ) < l → ∀ (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)) → l ∈ (SimpleGraph.induce (↑A : Set ℕ) coprimeGraph).cycleLengths.Uses definitions
Erdos883.coprimeGraph,SimpleGraph.cycleLengths; libraryFinsetFinset αis the type of finite sets of elements ofα. ,FinNatural numbers less than some upper bound. ,Function.InjectiveA functionf : α → βis called injective iff x = f yimpliesx = y. ,SimpleGraph.cycleGraphCycle graph overFin n,SimpleGraph.AdjThe adjacency relation of a simple graph. ,Nat.Coprimemandnare coprime, or relatively prime, if theirgcdis 1. ,SimpleGraph.induceRestrict a graph to the vertices in the sets, deleting all edges incident to vertices outside the set. ,SetA set is a collection of elements of some typeα. ,Subtype.mk,Finset.mem_coe,Iff.mprModus ponens for if and only if, reversed. ,SimpleGraph.fromRel_adj,And.introAnd.intro : a → b → a ∧ bis the constructor for the And operation. ,SimpleGraph.Adj.ne,Or.inlOr.inlis "left injection" into anOr. ,Exists.introExistential introduction. .Lean, lines 37–56
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⟩bridge.h_x3c6(hφ) haveFunction.Injective (⇑φ : Fin l → (↑(↑A : Set ℕ) : Type))Leaves
l ∈ (SimpleGraph.induce (↑A : Set ℕ) coprimeGraph).cycleLengths, withhφ : Function.Injective (⇑φ : Fin l → (↑(↑A : Set ℕ) : Type)).Uses library
Function.InjectiveA functionf : α → βis called injective iff x = f yimpliesx = y. ,congrArgCongruence in the function argument: ifa₁ = a₂thenf a₁ = f a₂for any (nondependent) functionf. ,Subtype.valThe value in the underlying type that satisfies the predicate. .Lean, lines 49–51
have hφ : Function.Injective φ := by intro i j h exact hinj (congrArg Subtype.val h)bridge.hcopyhave(SimpleGraph.cycleGraph l).IsContained (SimpleGraph.induce (↑A : Set ℕ) coprimeGraph)Leaves
l ∈ (SimpleGraph.induce (↑A : Set ℕ) coprimeGraph).cycleLengths, withhcopy : (SimpleGraph.cycleGraph l).IsContained (SimpleGraph.induce (↑A : Set ℕ) coprimeGraph).Uses definitions
Erdos883.coprimeGraph; librarySimpleGraph.IsContainedThe relationIsContained A B,A ⊑ Bsays thatBcontains a copy ofA. ,SimpleGraph.cycleGraphCycle graph overFin n,SimpleGraph.induceRestrict a graph to the vertices in the sets, deleting all edges incident to vertices outside the set. ,SetA set is a collection of elements of some typeα. ,Nonempty.introIfval : α, thenαis nonempty. ,SimpleGraph.Copy.mk.Lean, lines 52–54
have hcopy : SimpleGraph.IsContained (SimpleGraph.cycleGraph l) (SimpleGraph.induce (↑A : Set ℕ) Erdos883.coprimeGraph) := ⟨⟨φ, hφ⟩⟩bridge.s3obtain∃ (v : (↑(↑A : Set ℕ) : Type)) (p : (SimpleGraph.induce (↑A : Set ℕ) coprimeGraph).Walk v v), p.IsCycle ∧ p.length = lLeaves
l ∈ (SimpleGraph.induce (↑A : Set ℕ) coprimeGraph).cycleLengths, withv : (↑(↑A : Set ℕ) : Type),p : (SimpleGraph.induce (↑A : Set ℕ) coprimeGraph).Walk v v,hp : p.IsCycle,hlen : p.length = l.Uses library
SimpleGraph.cycleGraph_isContained_iff.Lean, line 55
obtain ⟨v, p, hp, hlen⟩ := (SimpleGraph.cycleGraph_isContained_iff hl).1 hcopy
s3obtain∃ (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)Leaves
l ∈ (SimpleGraph.induce (↑A : Set ℕ) coprimeGraph).oddCycleLengths, withf : Fin l → ℕ,hinj : Function.Injective f,hfA : ∀ (i : Fin l), f i ∈ A,hc : ∀ (i j : Fin l), (SimpleGraph.cycleGraph l).Adj i j → (f i).Coprime (f j).Lean, line 58
obtain ⟨f, hinj, hfA, hc⟩ := h_seq n A hA hcard l hodd h5 hle
closeterml ∈ (SimpleGraph.induce (↑A : Set ℕ) coprimeGraph).oddCycleLengthsCloses the goal.
Uses library
And.introAnd.intro : a → b → a ∧ bis the constructor for the And operation. .Lean, line 59
exact ⟨bridge A l (by omega) f hinj hfA hc, hodd⟩
import Mathlib
import Defs.AlgebraWeylAlgebra
import Defs.AnalysisSpecialFunctionsAdditiveCharacter
import Defs.CombinatoricsSimpleGraphCircumference
import Defs.CombinatoricsSimpleGraphClique
import Defs.CombinatoricsSimpleGraphColoringVertex
import Defs.DataNatPrimeFinset
import Defs.FieldTheoryMilnorKTheory
import Defs.GroupTheoryRationalClasses
import Defs.Local
import Nodes.«erdos-883--h1».Context
open Filter
open scoped Classical
open Erdos883
/-! Hole `h_long` of a merged partial proof, as a node (D-12 #5, D-29).
Statement generated by the gate from the assembly; immutable (D-3). -/
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⟩