AFTD Auto-Formalizing Theoretical Domains

even_linked_double_star_rooted_cycle_cover

theoremverified

Given a simple cycle and any vertex in its connected component, some simple path from that vertex contains every vertex of the cycle.

Statement

theorem even_linked_double_star_rooted_cycle_cover {V : Type*} {G : SimpleGraph V}
    {s v : V} (h : G.Reachable s v) (c : G.Walk v v) (hc : c.IsCycle) :
    ∃ y, ∃ P : G.Walk s y, P.IsPath ∧ c.support ⊆ P.support
Source
https://arxiv.org/abs/2611.19632; structural lemma for OP-1853.
Verified
29 Nov 2026
Axioms
Classical.choiceQuot.soundpropext
Built on 2
  • Arena.Reachable.transReachability is transitive.
  • supportThe support $\mathrm{supp}(p) \subseteq \mathrm{Fin}\,n$ consists of coordinates where $p(i) \neq I$; the weight is…
Used by 1

The proof, explained

The proof proceeds by reducing the problem to extending a simple path along a cycle. First, a helper lemma shows that any cycle can be converted into a simple path starting at any of its vertices by rotating the cycle to that vertex and dropping the last edge, preserving all vertices of the cycle. Next, given any simple path from s terminating at a vertex of the cycle, an induction on the path shows it can be extended to cover the entire cycle: if the path ever touches the cycle earlier, we immediately switch to the cycle; otherwise, prepending edges preserves simplicity since the path and cycle are initially disjoint. Finally, since s is in the connected component of the cycle, we take any simple path from s to the cycle's base vertex and apply this extension.

  1. Rotating the cycle c to start at x produces a cycle Q, and dropping its last edge gives a simple path starting at x.

    We rotate the cycle c to begin and end at the vertex x ∈ c, yielding another cycle Q. Removing the last edge of Q produces a simple path Q.dropLast starting at x (by `hq.isPath_dropLast`). We propose Q.dropLast as the witness path, leaving two obligations: its length plus 1 equals the cycle length, and its vertex set equals that of c.

    lines 7–10

      classical
      let Q := c.rotate x hx
      have hq : Q.IsCycle := hc.rotate hx
      refine ⟨_,Q.dropLast,hq.isPath_dropLast,?_,fun z => ?_⟩
  2. The length of Q.dropLast plus 1 equals the length of c. automation

    Since Q is a cycle, it is not nil. By `Walk.length_dropLast_add_one`, dropping the last edge decreases the length by 1. The tactic `simpa` combines this with the fact that rotation preserves length (Q.length = c.length) to close the equation.

    line 11

    uses Walk.length_dropLast_add_one

      · simpa [Q] using Walk.length_dropLast_add_one hq.not_nil
  3. The vertices of Q.dropLast are exactly the vertices of c.

    The vertices of Q consist of the vertices of Q.dropLast with the terminal vertex x appended. But x is the starting vertex of Q.dropLast, so x is already present in its vertex set, meaning that dropping the last edge loses no vertices. Since rotation preserves the set of vertices of a walk, a vertex belongs to Q.dropLast if and only if it belongs to c.

    lines 12–17

    uses List.mem_append, List.mem_singleton

      · have he := Q.support_dropLast_concat hq.not_nil
        have hxQ : x ∈ Q.dropLast.support := Q.dropLast.start_mem_support
        have hh : z ∈ Q.support ↔ z ∈ Q.dropLast.support := by
          rw [←he]; simp only [List.mem_append,List.mem_singleton]
          exact ⟨fun h => h.elim id (fun h => h ▸ hxQ),Or.inl⟩
        exact hh.symm.trans (c.mem_support_rotate_iff x hx)
  4. In the base case where P is a trivial path at z ∈ c.support, there is a path from z covering c using only vertices of c.

    We induct on the path P from s to z. When P is the empty walk at z, the start vertex s equals z, which lies on c. Applying `ds1310_rooted_cycle_cover_cyc_at` at z provides a simple path from z covering all vertices of c, with all of its vertices contained in c.

    lines 23–26

    uses ds1310_rooted_cycle_cover_cyc_at

      induction P with
      | nil =>
        obtain ⟨y,Q,hQ,_,hh⟩ := ds1310_rooted_cycle_cover_cyc_at c hc _ hz
        exact ⟨y,Q,hQ,fun _ h => (hh _).2 h,fun _ h => Or.inr ((hh _).1 h)⟩
  5. In the inductive step, if the initial vertex u of the path already belongs to c, the theorem holds directly.

    Consider the step where the path is formed by prepending an edge u ~ z to a path from z to the cycle. We case split on whether u ∈ c.support. If u is already on the cycle, we disregard the remainder of the path and apply `ds1310_rooted_cycle_cover_cyc_at` directly at u to obtain a cycle-covering path from u whose vertices all lie in c.

    lines 27–30

    uses ds1310_rooted_cycle_cover_cyc_at

      | @cons u z w h P ih =>
        by_cases hu : u ∈ c.support
        · obtain ⟨y,Q,hQ,_,hh⟩ := ds1310_rooted_cycle_cover_cyc_at c hc _ hu
          exact ⟨y,Q,hQ,fun _ h => (hh _).2 h,fun _ h => Or.inr ((hh _).1 h)⟩
  6. If u ∉ c.support, prepending u ~ z to the path given by the induction hypothesis yields a simple path covering c.

    Because u :: P' is a simple path, `Walk.cons_isPath_iff` implies that P' is a simple path and u does not appear in P'. By the induction hypothesis on P', there exists a simple path Q from z covering c with vertices in P' ∪ c. Since u ∉ P' and u ∉ c, u does not appear in Q. Hence prepending u ~ z to Q creates a simple path starting at u that still covers c by `List.mem_cons_of_mem`.

    lines 31–34

    uses Walk.cons_isPath_iff, List.mem_cons_of_mem

        · obtain ⟨ht,hn⟩ := (Walk.cons_isPath_iff _ _).mp hp
          obtain ⟨y,Q,hQ,hsub,hall⟩ := ih ht hz
          have hnot : u ∉ Q.support := fun h => (hall u h).elim hn hu
          refine ⟨y,Q.cons h,hQ.cons hnot,fun x hx => List.mem_cons_of_mem _ (hsub hx),?_⟩
  7. Every vertex of the prepended path u :: Q belongs to (u :: P') ∪ c.

    For any vertex b in u :: Q, by `List.mem_cons.mp`, either b = u, which belongs to u :: P' by `List.mem_cons_self`, or b belongs to Q. In the second case, the induction hypothesis ensures that b ∈ P' (which implies b ∈ u :: P' via `List.mem_cons_of_mem`) or b ∈ c.

    lines 35–38

    uses List.mem_cons.mp, List.mem_cons_self, List.mem_cons_of_mem

          intro b hb
          rcases List.mem_cons.mp hb with rfl|hb
          · exact Or.inl (List.mem_cons_self ..)
          · exact (hall b hb).imp (List.mem_cons_of_mem _) id
  8. There exists a simple path starting at s that contains every vertex of the cycle c.

    Since s is reachable from v, there exists a simple path P from s to v. Because v is the starting vertex of c, v ∈ c.support. Applying `ds1310_rooted_cycle_cover_to_cycle` to c and P yields a simple path Q starting at s containing every vertex of c.

    lines 43–45

    uses ds1310_rooted_cycle_cover_to_cycle

      obtain ⟨P,hP⟩ := h.exists_isPath
      obtain ⟨y,Q,hq,hh,_⟩ := ds1310_rooted_cycle_cover_to_cycle c hc P hP c.start_mem_support
      exact ⟨y,Q,hq,hh⟩
Walk.length_dropLast_add_one
For any walk p that is not nil, the length of p with its last edge removed, plus 1, equals the length of p.
List.mem_append
An element is in the concatenation s ++ t of two lists if and only if it is in s or in t.
List.mem_singleton
An element is in the singleton list [b] if and only if it is equal to b.
ds1310_rooted_cycle_cover_cyc_at
Given a cycle c and a vertex x on c, there exists a simple path starting at x whose vertices are precisely the vertices of c and whose length is the length of c minus 1.
Walk.cons_isPath_iff
A walk formed by prepending an edge u ~ v to a walk p is a simple path if and only if p is a simple path and u does not appear in the vertices of p.
List.mem_cons_of_mem
If an element belongs to a list l, then it belongs to y :: l for any element y.
List.mem_cons.mp
If an element belongs to y :: l, then it is either equal to y or belongs to l.
List.mem_cons_self
For any element a and list l, the element a belongs to a :: l.
ds1310_rooted_cycle_cover_to_cycle
Given a cycle c and a simple path P from s to a vertex on c, there exists a simple path starting at s covering all vertices of c, containing only vertices from P and c.

Written by a model (gemini-3.8-flash) from the Lean proof and the goal states Lean reported at each step. Lean verified the proof; this explanation is a reading aid and is not itself machine-checked.

Lean source view module on GitHub

open SimpleGraph Classicalopen scoped BigOperatorsprivate theorem ds1310_rooted_cycle_cover_cyc_at {V : Type*} {G : SimpleGraph V} {v : V} (c : G.Walk v v)    (hc : c.IsCycle) (x : V) (hx : x ∈ c.support) :    ∃ y, ∃ P : G.Walk x y, P.IsPath ∧ P.length+1=c.length ∧ ∀ z, z ∈ P.support ↔ z ∈ c.support := by  classical  let Q := c.rotate x hx  have hq : Q.IsCycle := hc.rotate hx  refine ⟨_,Q.dropLast,hq.isPath_dropLast,?_,fun z => ?_⟩  · simpa [Q] using Walk.length_dropLast_add_one hq.not_nil  · have he := Q.support_dropLast_concat hq.not_nil    have hxQ : x ∈ Q.dropLast.support := Q.dropLast.start_mem_support    have hh : z ∈ Q.support ↔ z ∈ Q.dropLast.support := by      rw [←he]; simp only [List.mem_append,List.mem_singleton]      exact ⟨fun h => h.elim id (fun h => h ▸ hxQ),Or.inl⟩    exact hh.symm.trans (c.mem_support_rotate_iff x hx)private theorem ds1310_rooted_cycle_cover_to_cycle {V : Type*} {G : SimpleGraph V} {v : V} (c : G.Walk v v)    (hc : c.IsCycle) {s z : V} (P : G.Walk s z) (hp : P.IsPath) (hz : z ∈ c.support) :    ∃ y, ∃ Q : G.Walk s y, Q.IsPath ∧ c.support ⊆ Q.support ∧      ∀ w ∈ Q.support, w ∈ P.support ∨ w ∈ c.support := by  induction P with  | nil =>    obtain ⟨y,Q,hQ,_,hh⟩ := ds1310_rooted_cycle_cover_cyc_at c hc _ hz    exact ⟨y,Q,hQ,fun _ h => (hh _).2 h,fun _ h => Or.inr ((hh _).1 h)⟩  | @cons u z w h P ih =>    by_cases hu : u ∈ c.support    · obtain ⟨y,Q,hQ,_,hh⟩ := ds1310_rooted_cycle_cover_cyc_at c hc _ hu      exact ⟨y,Q,hQ,fun _ h => (hh _).2 h,fun _ h => Or.inr ((hh _).1 h)⟩    · obtain ⟨ht,hn⟩ := (Walk.cons_isPath_iff _ _).mp hp      obtain ⟨y,Q,hQ,hsub,hall⟩ := ih ht hz      have hnot : u ∉ Q.support := fun h => (hall u h).elim hn hu      refine ⟨y,Q.cons h,hQ.cons hnot,fun x hx => List.mem_cons_of_mem _ (hsub hx),?_⟩      intro b hb      rcases List.mem_cons.mp hb with rfl|hb      · exact Or.inl (List.mem_cons_self ..)      · exact (hall b hb).imp (List.mem_cons_of_mem _) idtheorem even_linked_double_star_rooted_cycle_cover {V : Type*} {G : SimpleGraph V}    {s v : V} (h : G.Reachable s v) (c : G.Walk v v) (hc : c.IsCycle) :    ∃ y, ∃ P : G.Walk s y, P.IsPath ∧ c.support ⊆ P.support := by  obtain ⟨P,hP⟩ := h.exists_isPath  obtain ⟨y,Q,hq,hh,_⟩ := ds1310_rooted_cycle_cover_to_cycle c hc P hP c.start_mem_support  exact ⟨y,Q,hq,hh⟩
See it in the graphDiscuss this resultChallenge it