-
Notifications
You must be signed in to change notification settings - Fork 336
Add Caccetta–Häggkvist conjecture (directed cycles vs minimum out-degree) #4231
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
henrykmichalewski
wants to merge
2
commits into
google-deepmind:main
Choose a base branch
from
henrykmichalewski:probabilistic-caccetta-haggkvist
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
132 changes: 132 additions & 0 deletions
132
FormalConjectures/Wikipedia/CaccettaHaggkvistConjecture.lean
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,132 @@ | ||
| /- | ||
| Copyright 2026 The Formal Conjectures Authors. | ||
|
|
||
| Licensed under the Apache License, Version 2.0 (the "License"); | ||
| you may not use this file except in compliance with the License. | ||
| You may obtain a copy of the License at | ||
|
|
||
| https://www.apache.org/licenses/LICENSE-2.0 | ||
|
|
||
| Unless required by applicable law or agreed to in writing, software | ||
| distributed under the License is distributed on an "AS IS" BASIS, | ||
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| See the License for the specific language governing permissions and | ||
| limitations under the License. | ||
| -/ | ||
|
|
||
| import FormalConjectures.Util.ProblemImports | ||
|
|
||
| /-! | ||
| # Caccetta–Häggkvist conjecture | ||
|
|
||
| The Caccetta–Häggkvist conjecture (1978) states that every simple digraph on $n$ vertices | ||
| in which every vertex has out-degree at least $n/r$ contains a directed cycle of length | ||
| at most $r$. | ||
|
|
||
| The most famous special case is $r = 3$: every simple digraph on $n$ vertices with minimum | ||
| out-degree at least $n/3$ should contain a directed cycle of length at most $3$. This case | ||
| is open; the best known partial results replace $n/3$ by $cn$ for constants $c > 1/3$, | ||
| e.g. $c = 3 - \sqrt{7} \approx 0.3542$ (Shen). | ||
|
|
||
| *References:* | ||
| * [Wikipedia](https://en.wikipedia.org/wiki/Caccetta%E2%80%93H%C3%A4ggkvist_conjecture) | ||
| * [CaHa78] Caccetta, L. and Häggkvist, R. (1978). "On minimal digraphs with given girth." | ||
| *Congressus Numerantium* XXI, pp. 181--187. | ||
| * [ChSz83] Chvátal, V. and Szemerédi, E. (1983). "Short cycles in directed graphs." | ||
| *J. Combin. Theory Ser. B* 35, pp. 323--327. | ||
| * [Sh98] Shen, J. (1998). "Directed triangles in digraphs." | ||
| *J. Combin. Theory Ser. B* 74, pp. 405--407. | ||
| * [Su06] Sullivan, B. D. (2006). "A summary of results and problems related to the | ||
| Caccetta-Häggkvist conjecture." [arXiv:math/0605646](https://arxiv.org/abs/math/0605646) | ||
| -/ | ||
|
|
||
| namespace CaccettaHaggkvist | ||
|
|
||
| variable {V : Type*} | ||
|
|
||
| /-- | ||
| The out-degree of a vertex `v` in a digraph `G` on a finite vertex type: the number of | ||
| vertices `w` with an arc `v → w`. | ||
| -/ | ||
| def outDegree [Fintype V] (G : Digraph V) [DecidableRel G.Adj] (v : V) : ℕ := | ||
| (Finset.univ.filter fun w => G.Adj v w).card | ||
|
Comment on lines
+47
to
+52
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This should be either inlined (my preference) or moved to |
||
|
|
||
| /-- | ||
| `HasDirectedCycleOfLength G k` says that the digraph `G` contains a directed cycle of | ||
| length `k`, encoded as an injective map $f : \mathbb{Z}/k\mathbb{Z} \to V$ such that | ||
| $f(i) \to f(i+1)$ is an arc of `G` for every $i$. The cyclic index type provides the | ||
| wraparound arc $f(k-1) \to f(0)$, and injectivity ensures the cycle visits `k` distinct | ||
| vertices. This is only meaningful for `k ≠ 0`. For `k = 1` it asks for a loop | ||
| $f(0) \to f(0)$, which is impossible in a loopless (irreflexive) digraph. | ||
| -/ | ||
| def HasDirectedCycleOfLength (G : Digraph V) (k : ℕ) : Prop := | ||
| ∃ f : ZMod k → V, Function.Injective f ∧ ∀ i, G.Adj (f i) (f (i + 1)) | ||
|
|
||
| /-- | ||
| **The Caccetta–Häggkvist conjecture** [CaHa78]. | ||
|
|
||
| Every simple digraph on $n \ge 1$ vertices in which every vertex has out-degree at least | ||
| $n/r$ contains a directed cycle of length at most $r$. | ||
|
|
||
| Conventions: | ||
| * The hypothesis `n ≤ r * outDegree G v` is the integer form of | ||
| $\operatorname{outdeg}(v) \ge n/r$, avoiding rational division. | ||
| * "Simple digraph" here means a digraph without loops (`Irreflexive G.Adj`); pairs of | ||
| opposite arcs (digons, i.e. $2$-cycles $u \to v \to u$) are allowed, as in the standard | ||
| statement of the conjecture. Since a digon is a directed cycle of length $2 \le r$, | ||
| the content of the conjecture lies in digon-free digraphs and $r \ge 3$. | ||
| * The hypothesis `1 ≤ n` excludes the empty digraph, for which the degree hypothesis is | ||
| vacuous but no directed cycle exists. | ||
| -/ | ||
| @[category research open, AMS 5] | ||
| theorem caccetta_haggkvist (n r : ℕ) (hn : 1 ≤ n) (hr : 1 ≤ r) (V : Type) [Fintype V] | ||
| (hV : Fintype.card V = n) (G : Digraph V) [DecidableRel G.Adj] | ||
| (hirr : Irreflexive G.Adj) | ||
| (hdeg : ∀ v, n ≤ r * outDegree G v) : | ||
| ∃ k : ℕ, 1 ≤ k ∧ k ≤ r ∧ HasDirectedCycleOfLength G k := by | ||
| sorry | ||
|
|
||
| namespace variants | ||
|
|
||
| /-- | ||
| **The triangle case ($r = 3$) of the Caccetta–Häggkvist conjecture.** | ||
|
|
||
| Every simple digraph on $n \ge 1$ vertices with minimum out-degree at least $n/3$ | ||
| contains a directed cycle of length at most $3$. This is the most studied special case of | ||
| the conjecture and is open; Chvátal and Szemerédi [ChSz83] proved the conclusion under the | ||
| stronger hypothesis $\operatorname{outdeg}(v) \ge (3 - \sqrt{5})n/2 \approx 0.382\, n$, | ||
| and Shen [Sh98] under $\operatorname{outdeg}(v) \ge (3 - \sqrt{7})\, n \approx 0.3542\, n$. | ||
| -/ | ||
| @[category research open, AMS 5] | ||
| theorem caccetta_haggkvist_triangle (n : ℕ) (hn : 1 ≤ n) (V : Type) [Fintype V] | ||
| (hV : Fintype.card V = n) (G : Digraph V) [DecidableRel G.Adj] | ||
| (hirr : Irreflexive G.Adj) | ||
| (hdeg : ∀ v, n ≤ 3 * outDegree G v) : | ||
| ∃ k : ℕ, 1 ≤ k ∧ k ≤ 3 ∧ HasDirectedCycleOfLength G k := by | ||
| sorry | ||
|
|
||
| end variants | ||
|
|
||
| /-- | ||
| Sanity check for the cycle encoding: the complete loopless digraph on three vertices | ||
| (arcs $x \to y$ for all $x \ne y$) contains a directed cycle of length $3$. | ||
| -/ | ||
| @[category test, AMS 5] | ||
| theorem complete_digraph_three_hasDirectedCycleOfLength_three : | ||
| HasDirectedCycleOfLength (Digraph.mk' fun x y : Fin 3 => x != y) 3 := by | ||
| unfold HasDirectedCycleOfLength | ||
| decide | ||
|
|
||
| /-- | ||
| Sanity check for the out-degree definition: in the complete loopless digraph on three | ||
| vertices, every vertex has out-degree $2$, so the degree hypothesis of the triangle case | ||
| ($n \le 3 \cdot \operatorname{outdeg}(v)$ with $n = 3$) is satisfied. | ||
| -/ | ||
| @[category test, AMS 5] | ||
| theorem complete_digraph_three_outDegree (v : Fin 3) : | ||
| outDegree (Digraph.mk' fun x y : Fin 3 => x != y) v = 2 := by | ||
| unfold outDegree | ||
| revert v | ||
| decide | ||
|
|
||
| end CaccettaHaggkvist | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this link is hallucinated. Let's instead use https://www.openproblemgarden.org/op/caccetta_haggkvist_conjecture and move this file to a new directory "OpenProblemGarden"!