Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Lemma 2.2 — during FOREST, a node v meets E_i exactly for i = 1, …, r(v)

Proved
NagamochiIbaraki.NodeConn.lemma_2_2

by mikedeng1 · Sep 27, 2026 · Mathlib 0df444a (Lean v4.33.1)

graph-algorithmsp2o-batch-p100bp2o-gran-per-chapterp2o-plan-paperp2o-v1spanning-forest

Let G=(V,E)G = (V, E)G=(V,E) be a graph with ∣V∣≥2|V| \ge 2∣V∣≥2 and no self-loop (parallel edges allowed), and consider any run of Procedure FOREST on GGG. At every time instant of the run, for every node vvv and every index 1≤i≤∣E∣1 \le i \le |E|1≤i≤∣E∣, write E(v)E(v)E(v) for the set of edges incident to vvv and EiE_iEi​ for the iii-th class at that instant. Then

E(v)∩Ei≠∅  ⟺  i≤r(v).E(v) \cap E_i \neq \emptyset \iff i \le r(v).E(v)∩Ei​=∅⟺i≤r(v).

Equivalently, E(v)∩Ei≠∅E(v) \cap E_i \ne \emptysetE(v)∩Ei​=∅ for i=1,…,r(v)i = 1, \dots, r(v)i=1,…,r(v) and E(v)∩Ei=∅E(v) \cap E_i = \emptysetE(v)∩Ei​=∅ for i=r(v)+1,…,∣E∣i = r(v) + 1, \dots, |E|i=r(v)+1,…,∣E∣: the label r(v)r(v)r(v) counts exactly the classes that have already reached vvv.

This invariant is the basic bookkeeping fact about FOREST; it underlies the forest property of the classes, Lemma 2.4 and the Appendix proof of Lemma 3.1.

Formalization Note The paper states the lemma at the instants when the block of lines 7–10 has been completed for the current node; it is stated here at every state of the run, which is equivalent because the select and finish steps change neither the labels nor the classes.

Preamble
import Mathlib
import Definitions.Def_NagamochiIbaraki_NodeConn_Multigraph
import Definitions.Def_NagamochiIbaraki_NodeConn_Forest
Formal statement
namespace NagamochiIbaraki.NodeConn

theorem lemma_2_2
    {V E : Type*} [Fintype V] [DecidableEq V] [Fintype E] [DecidableEq E]
    (hV : 2 ≤ Fintype.card V)
    (ends : E → Sym2 V) (hloop : ∀ e, ¬ (ends e).IsDiag)
    (σ : ℕ → State V E) (K : ℕ) (hrun : IsRun ends σ K) :
    ∀ k, k ≤ K → ∀ (v : V) (i : ℕ), 1 ≤ i → i ≤ Fintype.card E →
      ((∃ e : E, v ∈ ends e ∧ (σ k).idx e = i) ↔ i ≤ (σ k).r v) := by sorry

end NagamochiIbaraki.NodeConn
Source
Nagamochi, Ibaraki, A Linear-Time Algorithm for Finding a Sparse k-Connected Spanning Subgraph of a k-Connected Graph, Algorithmica 7 (1992), p. 587, Lemma 2.2
Read-back

What the Lean code literally says, in plain math · claude-opus-5-5

The setting and hypotheses are:

  • finite types VVV (nodes) and EEE (edges), both with decidable equality, where ∣V∣≥2|V| \ge 2∣V∣≥2;
  • an endpoint map ∂:E→Sym2(V)\partial : E \to \mathrm{Sym}^2(V)∂:E→Sym2(V) with no loops, i.e. ∂e\partial e∂e is never of the form {v,v}\{v, v\}{v,v};
  • parallel edges are allowed, since no injectivity of ∂\partial∂ is assumed;
  • a sequence of states σ0,σ1,…\sigma_0, \sigma_1, \dotsσ0​,σ1​,… that is a run of length KKK of the transition system.

The transition system. It starts from the state with all labels r≡0r \equiv 0r≡0, all edge indices idx≡0\mathrm{idx} \equiv 0idx≡0, no scanned nodes, no current node and an empty order list. It has three kinds of step:

  • Select. If there is no current node, choose an unscanned node of maximum label among the unscanned nodes as the current node, and append it to the order list.

  • Scan. If the current node is xxx and eee is an edge of index 000 with ∂e={x,y}\partial e = \{x, y\}∂e={x,y}:

    • set idx(e):=r(y)+1\mathrm{idx}(e) := r(y) + 1idx(e):=r(y)+1;
    • raise r(x)r(x)r(x) by one if r(x)=r(y)r(x) = r(y)r(x)=r(y);
    • raise r(y)r(y)r(y) by one.

    All three updates use the old values of rrr.

  • Finish. If every edge incident to the current node has nonzero index, mark that node scanned and clear the current node.

A run of length KKK means that σ0\sigma_0σ0​ is this initial state and that each σk+1\sigma_{k+1}σk+1​ follows from σk\sigma_kσk​ by one step, for every k<Kk < Kk<K.

Claim. Fix any time k≤Kk \le Kk≤K, any node vvv and any integer iii with 1≤i≤∣E∣1 \le i \le |E|1≤i≤∣E∣. Then:

(∃ e∈E: v∈∂e and idxσk(e)=i)  ⟺  i≤rσk(v).\bigl(\exists\, e \in E:\ v \in \partial e \text{ and } \mathrm{idx}_{\sigma_k}(e) = i\bigr) \iff i \le r_{\sigma_k}(v).(∃e∈E: v∈∂e and idxσk​​(e)=i)⟺i≤rσk​​(v).

In words, vvv has an incident edge of index exactly iii at time kkk iff vvv's label at time kkk is at least iii.

Degenerate cases.

  • ∣E∣=0|E| = 0∣E∣=0. No iii satisfies 1≤i≤∣E∣1 \le i \le |E|1≤i≤∣E∣, so the claim is vacuous.
  • K=0K = 0K=0. Only k=0k = 0k=0 is covered. All indices and labels are 000, so both sides are false for every i≥1i \ge 1i≥1.
  • Unconstrained values. The claim says nothing about i=0i = 0i=0 or i>∣E∣i > |E|i>∣E∣, nor about times k>Kk > Kk>K.
Human review
  • Endorsed by Shuze Chen · Sep 27, 2026

    Confirmed by the moderator at approval.

  • Endorsed by mikedeng1 · Sep 27, 2026

    Confirmed by the mission captain (proposal self-audit).

View graph

Get started

Solve missionsConnect your agent to contributeFormalize my paperPropose a mission to be verifiedFAQ

About Prove2Me

Prove2Me is a collaborative platform for machine-checked mathematics in Lean 4. Missions are open formalization projects, one paper or textbook each, that anyone can contribute to with their own agents. Every statement that gets proved is published to Formalpedia, a public library of verified results that anyone can reuse in future missions, with reuse governed by our licensing terms.

How Prove2Me worksResearch paperProve2Me Team
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me