Kruskal.totalWeight_nil
theoremverifiedimported Lean
Total weight of the empty edge list. Over any number of vertices $n$, the total weight of the empty list of weighted edges is $0$; that is, the sum of the weights of no edges is $\sum_{e \in [\,]} e.\mathit{weight} = 0$.
Statement
set_option relaxedAutoImplicit false in set_option autoImplicit false in @[simp] lemma Kruskal.totalWeight_nil {n : ℕ} : totalWeight ([] : List (WEdge n)) = 0
- Source
- TCSlib, `Kruskal.totalWeight_nil`
- Lean proof
- By [Your Name], [Partner's Name (if applicable)], from github.com/Shilun-Allan-Li/tcslib at
c8a02591b1e5(Copyright (c) 2026 [Your Name] and [Partner's Name (if applicable)]. All rights reserved, Apache-2.0). Compiled here against leanprover/lean4:v4.33.1, Mathlib v4.33.1; written for leanprover/lean4:v4.25.0.Kruskal.totalWeight_nil← Kruskal.totalWeight_nil (TCSlib/GraphTheory/Kruskal/Reach.lean:122): verbatim
- Verified
- 07 Oct 2026
- Axioms
propext- Built on 2
- Kruskal.WEdgeA weighted edge over $n$ vertices is a structure with two endpoints $u, v : \mathrm{Fin}\,n$ and a natural-number weight…
- Kruskal.totalWeightThe total weight of an edge list is the sum of the weights of all its edges:…
- Used by 5
- Kruskal.totalWeight_eraseTotal weight after removing an edge. Let $\mathit{edges}$ be a list of weighted edges over $n$ vertices, and let $e$ be a weighted edge…
- Kruskal.kruskal_optimalOptimality of Kruskal's algorithm. Let $E$ be a list of weighted edges on $n$ vertices, and let $S$ be another such list in which every…
- Kruskal.processEdges_optimalOptimality of the greedy edge-selection sweep. Let $\mathit{edges}$ be a list of weighted edges on $n$ vertices, sorted in nondecreasing…
- Kruskal.reduce_to_restDropping a redundant edge from a candidate set. Let $\mathit{uf}$ be a union-find state on $n$ nodes, let $e$ be a weighted edge with…
- Kruskal.processEdges_take_weightWeight contributed by an accepted edge. Fix a natural number $n$ and a union-find state $\mathit{uf}$ over $n$ nodes, and let $e$ be a…
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.
set_option relaxedAutoImplicit false inset_option autoImplicit false in@[simp] lemma Kruskal.totalWeight_nil {n : ℕ} : totalWeight ([] : List (WEdge n)) = 0 := by simp [totalWeight]