{
  "id": "7621",
  "ident": "NS.07621",
  "slug": "wikipedia-alspachconjecture",
  "title": "Alspach's conjecture on cycle decompositions of complete graphs (1981; proved 2014)",
  "status": "solved",
  "statement_status": "reviewed",
  "statement_md": "**Alspach's conjecture (1981), proved by Bryant, Horsley and Pettersson (2014).**\n\nLet $n$ be odd and let $m_1, \\dots, m_t$ be integers with $3 \\le m_i \\le n$ and\n$m_1 + \\dots + m_t = \\binom{n}{2}$. Then the complete graph $K_n$ decomposes into cycles of\nlengths $m_1, \\dots, m_t$. (These conditions are clearly necessary: $K_n$ has all degrees even\nonly for odd $n$, and its edges must be split exactly among the cycles.)",
  "subjects": [
    "math.CO",
    "msc:05"
  ],
  "tags": [],
  "collection": "wikipedia",
  "source_url": null,
  "solved_on_platform": false,
  "needs_answer": false,
  "version": 1,
  "decl_name": "AlspachConjecture.alspach_conjecture",
  "statement_lean": "theorem alspach_conjecture :\n    ∀ (n : ℕ), Odd n → ∀ m : Multiset ℕ, (∀ x ∈ m, 3 ≤ x ∧ x ≤ n) → m.sum = n.choose 2 →\n      ∃ C : Multiset (Cycle (completeGraph (Fin n))),\n        IsCycleDecomposition (completeGraph (Fin n)) C ∧ lengths C = m",
  "challenge_source": "/-\nCopyright 2026 The Formal Conjectures Authors.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n    https://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n-/\n\nmodule\n\npublic import FormalConjecturesUtil\n\n/-!\n# Alspach's conjecture on cycle decompositions of complete graphs (1981; proved 2014)\n\n*References:*\n* [Wikipedia](https://en.wikipedia.org/wiki/Alspach%27s_conjecture)\n* [Al81] Alspach, B. (1981). \"Research problems, Problem 3.\" *Discrete Math.* 36, p. 333.\n* [BHP14] Bryant, D., Horsley, D. and Pettersson, W. (2014). \"Cycle decompositions V:\n  Complete graphs into cycles of arbitrary lengths.\" *Proc. London Math. Soc.* 108,\n  pp. 1153--1192. [arXiv:1204.3709](https://arxiv.org/abs/1204.3709)\n* [GJKKO21] Glock, S., Joos, F., Kim, J., Kühn, D. and Osthus, D. (2021). \"Resolution of the\n  Oberwolfach problem.\" *J. Eur. Math. Soc.* 23, pp. 2511--2547.\n  [arXiv:1806.04644](https://arxiv.org/abs/1806.04644)\n-/\n\n@[expose] public section\n\nopen SimpleGraph Finset\n\nnamespace AlspachConjecture\n\nvariable {V : Type*} [Fintype V] [DecidableEq V]\n\nopen Classical in\n/-- A multiset of cycles `C` is a **cycle decomposition** of `G` if every edge of `G` lies on\nexactly one of the cycles. -/\ndef IsCycleDecomposition (G : SimpleGraph V) [DecidableRel G.Adj] (C : Multiset (Cycle G)) :\n    Prop :=\n  ∀ e ∈ G.edgeFinset, (C.filter fun c => e ∈ c.edges).card = 1\n\n/-- The multiset of cycle lengths of a family of cycles. -/\ndef lengths {G : SimpleGraph V} (C : Multiset (Cycle G)) : Multiset ℕ :=\n  C.map SimpleGraph.Cycle.length\n\n/--\n**Alspach's conjecture (1981), proved by Bryant, Horsley and Pettersson (2014).**\n\nLet $n$ be odd and let $m_1, \\dots, m_t$ be integers with $3 \\le m_i \\le n$ and\n$m_1 + \\dots + m_t = \\binom{n}{2}$. Then the complete graph $K_n$ decomposes into cycles of\nlengths $m_1, \\dots, m_t$. (These conditions are clearly necessary: $K_n$ has all degrees even\nonly for odd $n$, and its edges must be split exactly among the cycles.)\n-/\n@[category research solved, AMS 5]\ntheorem alspach_conjecture :\n    ∀ (n : ℕ), Odd n → ∀ m : Multiset ℕ, (∀ x ∈ m, 3 ≤ x ∧ x ≤ n) → m.sum = n.choose 2 →\n      ∃ C : Multiset (Cycle (completeGraph (Fin n))),\n        IsCycleDecomposition (completeGraph (Fin n)) C ∧ lengths C = m := by\n  sorry\n\nopen Classical in\n/--\n**The even case (Bryant–Horsley–Pettersson 2014).**\n\nFor even $n$, the complete graph minus a perfect matching, $K_n - I$, decomposes into cycles of\nlengths $m_1, \\dots, m_t$ whenever $3 \\le m_i \\le n$ and $\\sum m_i = \\binom{n}{2} - n/2$.\nSince Mathlib has no canonical perfect matching of $K_n$, we state this for any perfect\nmatching `I`.\n\n*Reference:* [BHP14].\n-/\n@[category research solved, AMS 5]\ntheorem alspach_conjecture.variants.even (n : ℕ) (hn : Even n)\n    (I : (completeGraph (Fin n)).Subgraph) (hI : I.IsPerfectMatching)\n    (m : Multiset ℕ) (hm : ∀ x ∈ m, 3 ≤ x ∧ x ≤ n) (hsum : m.sum = n.choose 2 - n / 2) :\n    ∃ C : Multiset (Cycle (completeGraph (Fin n) \\ I.spanningCoe)),\n      IsCycleDecomposition (completeGraph (Fin n) \\ I.spanningCoe) C ∧ lengths C = m := by\n  sorry\n\n/--\nA long-cycle corollary of the Alspach theorem (Bryant–Horsley–Pettersson 2014).\n\nFor odd $n$, the conjecture holds whenever all the prescribed lengths $m_i$ are at least\n$\\lceil(n+4)/2\\rceil$. This follows from [BHP14, Theorem 1].\n-/\n@[category research solved, AMS 5]\ntheorem alspach_conjecture.variants.long_cycles (n : ℕ) (hn : Odd n) (m : Multiset ℕ)\n    (hm : ∀ x ∈ m, (n + 5) / 2 ≤ x ∧ x ≤ n) (hsum : m.sum = n.choose 2) :\n    ∃ C : Multiset (Cycle (completeGraph (Fin n))),\n      IsCycleDecomposition (completeGraph (Fin n)) C ∧ lengths C = m := by\n  sorry\n\n/-- The empty family decomposes an edgeless graph. -/\n@[category API, AMS 5]\nlemma isCycleDecomposition_zero {G : SimpleGraph V} [DecidableRel G.Adj]\n    (h : G.edgeFinset = ∅) : IsCycleDecomposition G 0 :=\n  fun e he => by simp [h] at he\n\n/--\n**The case $n = 1$.**\n\n$K_1$ has no edges, so the only admissible multiset of lengths is empty and the empty\ndecomposition works.\n-/\n@[category test, AMS 5]\ntheorem alspach_conjecture.variants.one (m : Multiset ℕ) (hm : ∀ x ∈ m, 3 ≤ x ∧ x ≤ 1)\n    (hsum : m.sum = Nat.choose 1 2) :\n    ∃ C : Multiset (Cycle (completeGraph (Fin 1))),\n      IsCycleDecomposition (completeGraph (Fin 1)) C ∧ lengths C = m := by\n  have hm0 : m = 0 := by\n    rw [Multiset.eq_zero_iff_forall_notMem]\n    intro x hx\n    have := hm x hx\n    omega\n  subst hm0\n  refine ⟨0, isCycleDecomposition_zero ?_, Multiset.map_zero _⟩\n  decide\n\n/-- The triangle `0 → 1 → 2 → 0` as a cycle of `K₃`. -/\ndef triangle : Cycle (completeGraph (Fin 3)) where\n  base := 0\n  walk := Walk.cons (by decide : (completeGraph (Fin 3)).Adj 0 1)\n    (Walk.cons (by decide : (completeGraph (Fin 3)).Adj 1 2)\n      (Walk.cons (by decide : (completeGraph (Fin 3)).Adj 2 0) Walk.nil))\n  isCycle := by\n    rw [Walk.isCycle_def, Walk.isTrail_def]\n    exact ⟨by decide, by simp, by decide⟩\n\n/--\n**The case $n = 3$.**\n\n$K_3$ has three edges, so the only admissible multiset of lengths is $\\{3\\}$, realised by the\ntriangle itself.\n-/\n@[category test, AMS 5]\ntheorem alspach_conjecture.variants.three (m : Multiset ℕ) (hm : ∀ x ∈ m, 3 ≤ x ∧ x ≤ 3)\n    (hsum : m.sum = Nat.choose 3 2) :\n    ∃ C : Multiset (Cycle (completeGraph (Fin 3))),\n      IsCycleDecomposition (completeGraph (Fin 3)) C ∧ lengths C = m := by\n  -- Every element of `m` is `3`, and the sum is `3`, so `m = {3}`.\n  have hm3 : m = Multiset.replicate m.card 3 := by\n    rw [Multiset.eq_replicate]; exact ⟨rfl, fun x hx => le_antisymm (hm x hx).2 (hm x hx).1⟩\n  have hcard : m.card = 1 := by\n    have := hsum; rw [hm3, Multiset.sum_replicate, smul_eq_mul] at this; simp at this; omega\n  rw [hm3, hcard, Multiset.replicate_one]\n  refine ⟨{triangle}, fun e he => ?_, by simp [lengths, triangle]; decide⟩\n  rw [Multiset.filter_singleton]\n  split_ifs with h\n  · rfl\n  · exfalso\n    apply h\n    have he' : e ∈ (completeGraph (Fin 3)).edgeSet := mem_edgeFinset.mp he\n    induction e using Sym2.ind with\n    | h a b =>\n      rw [mem_edgeSet, completeGraph_eq_top, top_adj] at he'\n      fin_cases a <;> fin_cases b <;> first | exact absurd rfl he' | decide\n\n/-- The exceptional Oberwolfach $2$-factor `C₄ + C₅` on nine vertices. -/\ndef oberwolfachException9 : SimpleGraph (Fin 4 ⊕ Fin 5) :=\n  cycleGraph 4 ⊕g cycleGraph 5\n\n/-- The exceptional Oberwolfach $2$-factor `C₃ + C₃ + C₅` on eleven vertices. -/\ndef oberwolfachException11 : SimpleGraph ((Fin 3 ⊕ Fin 3) ⊕ Fin 5) :=\n  (cycleGraph 3 ⊕g cycleGraph 3) ⊕g cycleGraph 5\n\n/--\n**The Oberwolfach problem (Ringel 1967).**\n\nFor odd $n$ and a $2$-regular graph $F$ on $n$ vertices, can $K_n$ be decomposed into\n$(n-1)/2$ spanning subgraphs isomorphic to $F$? The decomposition is known to be impossible for\nexactly two pairs with odd $n$ — $(9, C_4 + C_5)$ and $(11, C_3 + C_3 + C_5)$ — and is\nconjectured to exist in every other case. Known for all sufficiently large $n$ [GJKKO21].\n-/\n@[category research open, AMS 5]\ntheorem alspach_conjecture.variants.oberwolfach :\n    ∀ (n : ℕ), Odd n → 3 ≤ n →\n      ∀ (F : SimpleGraph (Fin n)) [DecidableRel F.Adj], (∀ v, F.degree v = 2) →\n      IsEmpty (F ≃g oberwolfachException9) → IsEmpty (F ≃g oberwolfachException11) →\n      ∃ D : Fin ((n - 1) / 2) → SimpleGraph (Fin n),\n        (∀ i, Nonempty (D i ≃g F)) ∧\n        ∀ u v, (completeGraph (Fin n)).Adj u v ↔ ∃! i, (D i).Adj u v := by\n  sorry\n\nend AlspachConjecture\n",
  "statement_hash": "65b00c2b67319542c7ad0271978b6ab577d23b8efac76f3c451421596fee498d",
  "toolchain": "leanprover/lean4:v4.33.1",
  "upstream_commit": "f9b3868d5ca994a7bf95039bcec05338c0c21e2f",
  "workspace": "formal-conjectures",
  "field": "math",
  "formalization": "formal",
  "verification": "lean-kernel",
  "license": "Apache-2.0",
  "attribution": "google-deepmind/formal-conjectures contributors",
  "metric_name": null,
  "metric_direction": null,
  "critiques": [],
  "public_partial_proofs": [],
  "research_threads": [],
  "instructions": "Read research_threads first: other people's public repositories and what they already tried. Write Solution.lean starting from challenge_source. Keep every definition identical, prove decl_name with exactly the same type, no sorry in its dependency closure, no new axioms, no native_decide, no metaprogramming. Submit with POST /api/v1/submissions."
}