Open Proof Network

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)$

unverified · history

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
  sorry
Why 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.

Improve these words →

History: 1 version on record
  1. 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.

Split into

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⟩
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

Work on this statement →

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
  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 →

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.

Witness.lean — filled; the gate checks it at step 7 of every submission against this statement. Rendered from targets/erdos-883/nodes/erdos-883--h1/Witness.lean, sha256 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.

  1. h_seq hole ∀ (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) hole

    Leaves ∀ (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, with 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 : Fin l), f i ∈ A) ∧ ∀ (i j : Fin l), (SimpleGraph.cycleGraph l).Adj i j → (f i).Coprime (f j).

    Uses library Finset.Icc The finset $[a, b]$ of elements x such that a ≤ x and x ≤ b. , Finset.card s.card is the number of elements of s, aka its cardinality. , Odd An element a of a semiring is odd if there exists k such a = 2*k + 1. , Fin Natural numbers less than some upper bound. , Function.Injective A function f : α → β is called injective if f x = f y implies x = y. , SimpleGraph.cycleGraph Cycle graph over Fin n , SimpleGraph.Adj The adjacency relation of a simple graph. , Nat.Coprime m and n are coprime, or relatively prime, if their gcd is 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) := sorry

    targets/erdos-883/nodes/erdos-883--h1/attempts/20261125T154325Z-t1125-883-partial.lean, lines 31–35 at 95be5d21dd3d ↗

  2. bridge have ∀ (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

    Leaves ∀ (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, with bridge : ∀ (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; library Finset Finset α is the type of finite sets of elements of α. , Fin Natural numbers less than some upper bound. , Function.Injective A function f : α → β is called injective if f x = f y implies x = y. , SimpleGraph.cycleGraph Cycle graph over Fin n , SimpleGraph.Adj The adjacency relation of a simple graph. , Nat.Coprime m and n are coprime, or relatively prime, if their gcd is 1. , SimpleGraph.induce Restrict a graph to the vertices in the set s, deleting all edges incident to vertices outside the set. , Set A set is a collection of elements of some type α. , Subtype.mk, Finset.mem_coe, Iff.mpr Modus ponens for if and only if, reversed. , SimpleGraph.fromRel_adj, And.intro And.intro : a → b → a ∧ b is the constructor for the And operation. , SimpleGraph.Adj.ne, Or.inl Or.inl is "left injection" into an Or. , Exists.intro Existential 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⟩

    targets/erdos-883/nodes/erdos-883--h1/attempts/20261125T154325Z-t1125-883-partial.lean, lines 37–56 at 95be5d21dd3d ↗

    1. bridge.h_x3c6 (hφ) have Function.Injective (⇑φ : Fin l → (↑(↑A : Set ℕ) : Type))

      Leaves l ∈ (SimpleGraph.induce (↑A : Set ℕ) coprimeGraph).cycleLengths, with hφ : Function.Injective (⇑φ : Fin l → (↑(↑A : Set ℕ) : Type)).

      Uses library Function.Injective A function f : α → β is called injective if f x = f y implies x = y. , congrArg Congruence in the function argument: if a₁ = a₂ then f a₁ = f a₂ for any (nondependent) function f. , Subtype.val The 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)

      targets/erdos-883/nodes/erdos-883--h1/attempts/20261125T154325Z-t1125-883-partial.lean, lines 49–51 at 95be5d21dd3d ↗

    2. bridge.hcopy have (SimpleGraph.cycleGraph l).IsContained (SimpleGraph.induce (↑A : Set ℕ) coprimeGraph)

      Leaves l ∈ (SimpleGraph.induce (↑A : Set ℕ) coprimeGraph).cycleLengths, with hcopy : (SimpleGraph.cycleGraph l).IsContained (SimpleGraph.induce (↑A : Set ℕ) coprimeGraph).

      Uses definitions Erdos883.coprimeGraph; library SimpleGraph.IsContained The relation IsContained A B, A ⊑ B says that B contains a copy of A. , SimpleGraph.cycleGraph Cycle graph over Fin n , SimpleGraph.induce Restrict a graph to the vertices in the set s, deleting all edges incident to vertices outside the set. , Set A set is a collection of elements of some type α. , Nonempty.intro If val : α, then α is nonempty. , SimpleGraph.Copy.mk.

      Lean, lines 52–54
          have hcopy : SimpleGraph.IsContained (SimpleGraph.cycleGraph l)
              (SimpleGraph.induce (↑A : Set ℕ) Erdos883.coprimeGraph) :=
            ⟨⟨φ, hφ⟩⟩

      targets/erdos-883/nodes/erdos-883--h1/attempts/20261125T154325Z-t1125-883-partial.lean, lines 52–54 at 95be5d21dd3d ↗

    3. bridge.s3 obtain ∃ (v : (↑(↑A : Set ℕ) : Type)) (p : (SimpleGraph.induce (↑A : Set ℕ) coprimeGraph).Walk v v), p.IsCycle ∧ p.length = l

      Leaves l ∈ (SimpleGraph.induce (↑A : Set ℕ) coprimeGraph).cycleLengths, with v : (↑(↑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

      targets/erdos-883/nodes/erdos-883--h1/attempts/20261125T154325Z-t1125-883-partial.lean, line 55 at 95be5d21dd3d ↗

  3. s3 obtain ∃ (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, with f : 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

    targets/erdos-883/nodes/erdos-883--h1/attempts/20261125T154325Z-t1125-883-partial.lean, line 58 at 95be5d21dd3d ↗

  4. close term l ∈ (SimpleGraph.induce (↑A : Set ℕ) coprimeGraph).oddCycleLengths

    Closes the goal.

    Uses library And.intro And.intro : a → b → a ∧ b is the constructor for the And operation. .

    Lean, line 59
      exact ⟨bridge A l (by omega) f hinj hfA hc, hodd⟩

    targets/erdos-883/nodes/erdos-883--h1/attempts/20261125T154325Z-t1125-883-partial.lean, line 59 at 95be5d21dd3d ↗

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⟩
How to read this page