retained_line_msf_weight_empty
The minimum spanning forest of the empty graph on n line vertices has total weight zero.
Statement
theorem retained_line_msf_weight_empty (n : ℕ) : retained_line_msf_weight (⊥ : SimpleGraph (Fin n)) = 0- Source
- Sanity check for retained_line_msf_weight for OP-815.
- Verified
- 19 Nov 2026
- Axioms
Classical.choiceQuot.soundpropext- Built on 2
- retained_line_msf_weightFor a graph on the first n nonnegative integers, the minimum total edge length among its spanning forests, one tree in each connected…
- graph_costFor a finite vertex type V with [Fintype V], a pairwise distance function d : V → V → ℝ, and a simple graph T on V, graph_cost d T is…
- Used by 1
- retained_line_expected_msf_twoFor two vertices, the expected retained minimum spanning forest weight is q.
The proof, explained
By definition, the retained line minimum spanning forest weight of the empty graph ⊥ is the infimum of the costs of all maximal acyclic subgraphs of ⊥. Because any subgraph of ⊥ must be ⊥ itself, and ⊥ is acyclic with no edges, ⊥ is the unique maximal acyclic subgraph and has cost zero. Consequently, the set of candidate forest costs is the singleton {0}, whose infimum is 0.
The definition of the retained line minimum spanning forest weight on the empty graph is unfolded into the infimum of candidate subgraph costs.
We enable classical reasoning and unfold the definition of retained_line_msf_weight for the empty graph ⊥. By definition, this weight is the infimum (sInf) of the set of costs of all subgraphs F ≤ ⊥ that are maximal among the acyclic subgraphs of ⊥.
classical simp only [retained_line_msf_weight]Determining that the set of candidate forest costs is {0} reduces to showing that a real number x is a candidate cost if and only if x = 0.
We set up an intermediate claim h asserting that the set of costs of maximal acyclic subgraphs of ⊥ is the singleton {0}. By set extensionality (ext x) and simplifying set membership using Set.mem_setOf_eq and Set.mem_singleton_iff, this equality reduces to the equivalence: x is the cost of some maximal acyclic subgraph F ≤ ⊥ if and only if x = 0. We then split the equivalence into two implications.
uses
Set.mem_setOf_eq,Set.mem_singleton_iffhave h : {x : ℝ | ∃ F : SimpleGraph (Fin n), Maximal (fun H : SimpleGraph (Fin n) => H ≤ (⊥ : SimpleGraph (Fin n)) ∧ H.IsAcyclic) F ∧ x = graph_cost (fun i j => |(i.val : ℝ) - (j.val : ℝ)|) F} = {0} := by ext x simp only [Set.mem_setOf_eq, Set.mem_singleton_iff] constructor
Every maximal acyclic subgraph of the empty graph has cost 0.
For the forward implication, suppose x is the cost of a maximal acyclic subgraph F ≤ ⊥. Since F ≤ ⊥, le_bot_iff.mp implies F = ⊥. Substituting F = ⊥, the empty graph has no edges, so every term in the double sum defining graph_cost vanishes, showing x = 0.
uses
le_bot_iff.mp· rintro ⟨F, hF, rfl⟩ have hf : F = ⊥ := le_bot_iff.mp hF.1.1 subst F simp [graph_cost]
0 is the cost of a maximal acyclic subgraph of the empty graph.
For the reverse implication, given x = 0, we exhibit ⊥ as the witness. First, ⊥ ≤ ⊥ holds by le_refl, and ⊥ is acyclic by SimpleGraph.isAcyclic_bot. Second, ⊥ is maximal because any acyclic subgraph b ≤ ⊥ already satisfies b ≤ ⊥. Finally, the graph cost of ⊥ is 0 because it has no edges.
uses
le_refl,SimpleGraph.isAcyclic_bot· intro hx subst x refine ⟨⊥, ?_, ?_⟩ · refine ⟨⟨le_refl _, SimpleGraph.isAcyclic_bot⟩, ?_⟩ intro b hb _ exact hb.1 · simp [graph_cost]
The infimum of {0} is 0, completing the proof.
Rewriting the set of candidate costs using the equality h leaves the infimum sInf {0}. Applying csInf_singleton evaluates the infimum of the singleton set {0} to 0.
uses
csInf_singletonrw [h, csInf_singleton]
Set.mem_setOf_eq- An element belongs to a set comprehension {y | p y} if and only if the predicate p holds for that element.
Set.mem_singleton_iff- An element a belongs to the singleton {b} if and only if a = b.
le_bot_iff.mp- If an element is less than or equal to the bottom element ⊥ in a bounded order, then it equals ⊥.
le_refl- The order relation ≤ is reflexive: a ≤ a for every element a.
SimpleGraph.isAcyclic_bot- The empty graph ⊥ on any vertex type contains no edges and is therefore acyclic.
csInf_singleton- The infimum of a singleton set {a} in a conditionally complete lattice is a.
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
Choose a tactic — a marked line — to see the goals Lean had before and after it, as in Lean’s infoview. Step with ← → or j k.
theorem retained_line_msf_weight_empty (n : ℕ) : retained_line_msf_weight (⊥ : SimpleGraph (Fin n)) = 0 := by classical simp only [retained_line_msf_weight] have h : {x : ℝ | ∃ F : SimpleGraph (Fin n), Maximal (fun H : SimpleGraph (Fin n) => H ≤ (⊥ : SimpleGraph (Fin n)) ∧ H.IsAcyclic) F ∧ x = graph_cost (fun i j => |(i.val : ℝ) - (j.val : ℝ)|) F} = {0} := by ext x simp only [Set.mem_setOf_eq, Set.mem_singleton_iff] constructor · rintro ⟨F, hF, rfl⟩ have hf : F = ⊥ := le_bot_iff.mp hF.1.1 subst F simp [graph_cost] · intro hx subst x refine ⟨⊥, ?_, ?_⟩ · refine ⟨⟨le_refl _, SimpleGraph.isAcyclic_bot⟩, ?_⟩ intro b hb _ exact hb.1 · simp [graph_cost] rw [h, csInf_singleton]