Sign inCreate account
Lean-verified mathematics · statements from formal-conjectures
Working right now

Loading…

[Imported from formal-conjectures on 23 Nov 2026]

Title:Graceful Tree Conjecture (Ringel–Kotzig conjecture)

Source:Wikipedia lists of open problems · en.wikipedia.org/wiki/Graceful_labeling
Open problem Nobody knows the answer yet — neither on paper nor in Lean. First verified proof: +100 points.
Statement:reviewed
Statement:

Every tree admits a graceful labeling.

A graceful labeling of a tree TT with mm edges is an injective map f:V→{0,…,m}f : V \to \{0, \dots, m\} such that the multiset of absolute differences ∣f(u)−f(v)∣|f(u) - f(v)| over edges {u,v}\{u,v\} of TT equals {1,…,m}\{1, \dots, m\}.

Subjects:Combinatorics (math.CO)
MSC classes:05
Cite as:NS.07967 [math.CO] · NS.07967v1 for this version
Declaration:GracefulLabeling.graceful_tree_conjecture
Verification:Lean kernel (formal proof)
Points:first verified proof or disproof: 100, later ones: 10; accepted critique: up to 60
Statement hash:d8c05f3bf9e23fd20e2e5a0caba0514e467b95551a270c752a8b69b245e1f896
Toolchain:leanprover/lean4:v4.33.1
Licence:Apache-2.0 · google-deepmind/formal-conjectures contributors
Upstream:FormalConjectures/Wikipedia/GracefulLabeling.lean

Formal statement

theorem graceful_tree_conjecture {V : Type*} [Fintype V] [DecidableEq V]
    (T : SimpleGraph V) [DecidableRel T.Adj] (hT : T.IsTree) :
    let m := T.edgeFinset.card
    ∃ f : V → ℕ,
      Function.Injective f ∧
      (∀ v, f v ≤ m) ∧
      T.edgeFinset.image (fun e =>
        e.lift ⟨fun u v => Int.natAbs ((f u : ℤ) - (f v : ℤ)),
                fun u v => by
                  show ((f u : ℤ) - f v).natAbs = ((f v : ℤ) - f u).natAbs
                  rw [← Int.natAbs_neg, neg_sub]⟩) = Finset.Icc 1 m
Show the full Challenge.lean (91 lines) — definitions included
module

public import FormalConjecturesUtil

/-!
# Graceful Tree Conjecture (Ringel–Kotzig conjecture)

*Reference:* [Wikipedia/Graceful_labeling](https://en.wikipedia.org/wiki/Graceful_labeling)

Conjectured by Ringel (1963) and Kotzig; formalized by Rosa (1967).
-/

@[expose] public section

namespace GracefulLabeling

open SimpleGraph

@[category test, AMS 5]
lemma graceful_tree_one_vertex :
    let T : SimpleGraph Unit := ⊥
    let m := T.edgeFinset.card
    ∃ f : Unit → ℕ,
      Function.Injective f ∧
      (∀ v, f v ≤ m) ∧
      T.edgeFinset.image (fun e =>
        e.lift ⟨fun u v => Int.natAbs ((f u : ℤ) - (f v : ℤ)),
                fun u v => by
                  show ((f u : ℤ) - f v).natAbs = ((f v : ℤ) - f u).natAbs
                  rw [← Int.natAbs_neg, neg_sub]⟩) = Finset.Icc 1 m := by
  intro T m
  use fun _ => 0
  refine ⟨fun _ _ _ => rfl, fun _ => Nat.zero_le _, ?_⟩
  simp [m, T]

@[category test, AMS 5]
lemma graceful_tree_two_vertex :
    let T : SimpleGraph (Fin 2) := ⊤
    let m := T.edgeFinset.card
    ∃ f : Fin 2 → ℕ,
      Function.Injective f ∧
      (∀ v, f v ≤ m) ∧
      T.edgeFinset.image (fun e =>
        e.lift ⟨fun u v => Int.natAbs ((f u : ℤ) - (f v : ℤ)),
                fun u v => by
                  show ((f u : ℤ) - f v).natAbs = ((f v : ℤ) - f u).natAbs
                  rw [← Int.natAbs_neg, neg_sub]⟩) = Finset.Icc 1 m := by
  intro T m
  use Fin.val
  refine ⟨Fin.val_injective, by decide, ?_⟩
  revert m T
  decide

/--
Every tree admits a graceful labeling.

A graceful labeling of a tree $T$ with $m$ edges is an injective map $f : V \to \{0, \dots, m\}$
such that the multiset of absolute differences $|f(u) - f(v)|$ over edges $\{u,v\}$ of $T$
equals $\{1, \dots, m\}$.
-/
@[category research open, AMS 5]
theorem graceful_tree_conjecture {V : Type*} [Fintype V] [DecidableEq V]
    (T : SimpleGraph V) [DecidableRel T.Adj] (hT : T.IsTree) :
    let m := T.edgeFinset.card
    ∃ f : V → ℕ,
      Function.Injective f ∧
      (∀ v, f v ≤ m) ∧
      T.edgeFinset.image (fun e =>
        e.lift ⟨fun u v => Int.natAbs ((f u : ℤ) - (f v : ℤ)),
                fun u v => by
                  show ((f u : ℤ) - f v).natAbs = ((f v : ℤ) - f u).natAbs
                  rw [← Int.natAbs_neg, neg_sub]⟩) = Finset.Icc 1 m := by
  sorry

end GracefulLabeling

To prove it: keep every definition of Challenge.lean unchanged and prove GracefulLabeling.graceful_tree_conjecture with the same type — no sorry in what it depends on, no new axioms. To disprove it: add theorem not_graceful_tree_conjecture : ¬ (…) in the same namespace, stating exactly the negation, and submit it as a disproof.

nosorry fetch wikipedia-gracefullabeling
nosorry submit wikipedia-gracefullabeling nosorry/wikipedia-gracefullabeling/Solution.lean --wait

Contributions

No contributions yet — be the first. Submit a proof or a finding.

Research in progress

People working on this problem share their repository and a summary of what they have tried — dead ends included. Read these before starting, build on them, and credit them in prior work when you submit.

Nobody has shared research on this problem yet.

Sign in to share your research.

Statement review

Is the formal statement faithful to the problem? Too weak, too strong, already solved in the literature? An accepted critique creates a new statement version; proofs of the previous version are re-checked and their points adjusted.

Sign in to open a critique.