/-
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.
-/
module
public import FormalConjecturesForMathlib.Combinatorics.SimpleGraph.VertexDistance@[expose] public sectionnamespace SimpleGraphvariable {α : Type*} [Fintype α] [DecidableEq α]
The Wiener index of G, which is the sum of distances between all
pairs of vertices.
noncomputable def wienerIndex (G : SimpleGraph α) : ℕ :=
∑ uv : Sym2 α, uv.lift ⟨fun u v ↦ G.dist u v, α:Type u_1inst✝¹:Fintype αinst✝:DecidableEq αG:SimpleGraph αuv:Sym2 α⊢ ∀ (a₁ a₂ : α), (fun u v ↦ G.dist u v) a₁ a₂ = (fun u v ↦ G.dist u v) a₂ a₁ All goals completed! 🐙⟩Computable Wiener index: half the sum of all ordered pairwise distances.
def computable_wiener (G : SimpleGraph α) [DecidableRel G.Adj] : ℕ :=
(∑ u ∈ Finset.univ, ∑ v ∈ Finset.univ, computable_dist G u v) / 2neg α:Type u_1inst✝¹:Fintype αinst✝:DecidableEq αf:α → α → ℕhf:∀ (a b : α), f a b = f b ahd:∀ (a : α), f a a = 0h_fiber:∑ j, ∑ i, f (↑i).1 (↑i).2 = ∑ i, f i.1 i.2q:Sym2 αa✝:q ∈ Finset.univa:αb:αh_filter:{p | s(p.1, p.2) = s(a, b)} = {(a, b), (b, a)}hab:¬a = b⊢ f (a, b).1 (a, b).2 + f a b = 2 * f a b; ring All goals completed! 🐙
theorem wiener_eq_computable (G : SimpleGraph α) [DecidableRel G.Adj] :
wienerIndex G = computable_wiener G := by α:Type u_1inst✝²:Fintype αinst✝¹:DecidableEq αG:SimpleGraph αinst✝:DecidableRel G.Adj⊢ G.wienerIndex = G.computable_wiener
unfold wienerIndex computable_wiener α:Type u_1inst✝²:Fintype αinst✝¹:DecidableEq αG:SimpleGraph αinst✝:DecidableRel G.Adj⊢ ∑ uv, Sym2.lift ⟨fun u v ↦ G.dist u v, ⋯⟩ uv = (∑ u, ∑ v, G.computable_dist u v) / 2
-- Goal: ∑ uv, Sym2.lift ⟨dist, _⟩ uv = (∑ u, ∑ v, computable_dist u v) / 2
have hcomm : ∀ a b, computable_dist G a b = computable_dist G b a := by α:Type u_1inst✝²:Fintype αinst✝¹:DecidableEq αG:SimpleGraph αinst✝:DecidableRel G.Adj⊢ G.wienerIndex = G.computable_wiener α:Type u_1inst✝²:Fintype αinst✝¹:DecidableEq αG:SimpleGraph αinst✝:DecidableRel G.Adjhcomm:∀ (a b : α), G.computable_dist a b = G.computable_dist b a⊢ ∑ uv, Sym2.lift ⟨fun u v ↦ G.dist u v, ⋯⟩ uv = (∑ u, ∑ v, G.computable_dist u v) / 2
intro a b α:Type u_1inst✝²:Fintype αinst✝¹:DecidableEq αG:SimpleGraph αinst✝:DecidableRel G.Adja:αb:α⊢ G.computable_dist a b = G.computable_dist b a α:Type u_1inst✝²:Fintype αinst✝¹:DecidableEq αG:SimpleGraph αinst✝:DecidableRel G.Adjhcomm:∀ (a b : α), G.computable_dist a b = G.computable_dist b a⊢ ∑ uv, Sym2.lift ⟨fun u v ↦ G.dist u v, ⋯⟩ uv = (∑ u, ∑ v, G.computable_dist u v) / 2; rw [← dist_eq_computable, α:Type u_1inst✝²:Fintype αinst✝¹:DecidableEq αG:SimpleGraph αinst✝:DecidableRel G.Adja:αb:α⊢ G.dist a b = G.computable_dist b a α:Type u_1inst✝²:Fintype αinst✝¹:DecidableEq αG:SimpleGraph αinst✝:DecidableRel G.Adjhcomm:∀ (a b : α), G.computable_dist a b = G.computable_dist b a⊢ ∑ uv, Sym2.lift ⟨fun u v ↦ G.dist u v, ⋯⟩ uv = (∑ u, ∑ v, G.computable_dist u v) / 2 ← dist_eq_computable, α:Type u_1inst✝²:Fintype αinst✝¹:DecidableEq αG:SimpleGraph αinst✝:DecidableRel G.Adja:αb:α⊢ G.dist a b = G.dist b a α:Type u_1inst✝²:Fintype αinst✝¹:DecidableEq αG:SimpleGraph αinst✝:DecidableRel G.Adjhcomm:∀ (a b : α), G.computable_dist a b = G.computable_dist b a⊢ ∑ uv, Sym2.lift ⟨fun u v ↦ G.dist u v, ⋯⟩ uv = (∑ u, ∑ v, G.computable_dist u v) / 2 dist_comm α:Type u_1inst✝²:Fintype αinst✝¹:DecidableEq αG:SimpleGraph αinst✝:DecidableRel G.Adja:αb:α⊢ G.dist b a = G.dist b a α:Type u_1inst✝²:Fintype αinst✝¹:DecidableEq αG:SimpleGraph αinst✝:DecidableRel G.Adjhcomm:∀ (a b : α), G.computable_dist a b = G.computable_dist b a⊢ ∑ uv, Sym2.lift ⟨fun u v ↦ G.dist u v, ⋯⟩ uv = (∑ u, ∑ v, G.computable_dist u v) / 2] α:Type u_1inst✝²:Fintype αinst✝¹:DecidableEq αG:SimpleGraph αinst✝:DecidableRel G.Adjhcomm:∀ (a b : α), G.computable_dist a b = G.computable_dist b a⊢ ∑ uv, Sym2.lift ⟨fun u v ↦ G.dist u v, ⋯⟩ uv = (∑ u, ∑ v, G.computable_dist u v) / 2 α:Type u_1inst✝²:Fintype αinst✝¹:DecidableEq αG:SimpleGraph αinst✝:DecidableRel G.Adjhcomm:∀ (a b : α), G.computable_dist a b = G.computable_dist b a⊢ ∑ uv, Sym2.lift ⟨fun u v ↦ G.dist u v, ⋯⟩ uv = (∑ u, ∑ v, G.computable_dist u v) / 2
have hdiag : ∀ a, computable_dist G a a = 0 := by α:Type u_1inst✝²:Fintype αinst✝¹:DecidableEq αG:SimpleGraph αinst✝:DecidableRel G.Adj⊢ G.wienerIndex = G.computable_wiener α:Type u_1inst✝²:Fintype αinst✝¹:DecidableEq αG:SimpleGraph αinst✝:DecidableRel G.Adjhcomm:∀ (a b : α), G.computable_dist a b = G.computable_dist b ahdiag:∀ (a : α), G.computable_dist a a = 0⊢ ∑ uv, Sym2.lift ⟨fun u v ↦ G.dist u v, ⋯⟩ uv = (∑ u, ∑ v, G.computable_dist u v) / 2
intro a α:Type u_1inst✝²:Fintype αinst✝¹:DecidableEq αG:SimpleGraph αinst✝:DecidableRel G.Adjhcomm:∀ (a b : α), G.computable_dist a b = G.computable_dist b aa:α⊢ G.computable_dist a a = 0 α:Type u_1inst✝²:Fintype αinst✝¹:DecidableEq αG:SimpleGraph αinst✝:DecidableRel G.Adjhcomm:∀ (a b : α), G.computable_dist a b = G.computable_dist b ahdiag:∀ (a : α), G.computable_dist a a = 0⊢ ∑ uv, Sym2.lift ⟨fun u v ↦ G.dist u v, ⋯⟩ uv = (∑ u, ∑ v, G.computable_dist u v) / 2; rw [← dist_eq_computable α:Type u_1inst✝²:Fintype αinst✝¹:DecidableEq αG:SimpleGraph αinst✝:DecidableRel G.Adjhcomm:∀ (a b : α), G.computable_dist a b = G.computable_dist b aa:α⊢ G.dist a a = 0 α:Type u_1inst✝²:Fintype αinst✝¹:DecidableEq αG:SimpleGraph αinst✝:DecidableRel G.Adjhcomm:∀ (a b : α), G.computable_dist a b = G.computable_dist b aa:α⊢ G.dist a a = 0 α:Type u_1inst✝²:Fintype αinst✝¹:DecidableEq αG:SimpleGraph αinst✝:DecidableRel G.Adjhcomm:∀ (a b : α), G.computable_dist a b = G.computable_dist b ahdiag:∀ (a : α), G.computable_dist a a = 0⊢ ∑ uv, Sym2.lift ⟨fun u v ↦ G.dist u v, ⋯⟩ uv = (∑ u, ∑ v, G.computable_dist u v) / 2] α:Type u_1inst✝²:Fintype αinst✝¹:DecidableEq αG:SimpleGraph αinst✝:DecidableRel G.Adjhcomm:∀ (a b : α), G.computable_dist a b = G.computable_dist b aa:α⊢ G.dist a a = 0 α:Type u_1inst✝²:Fintype αinst✝¹:DecidableEq αG:SimpleGraph αinst✝:DecidableRel G.Adjhcomm:∀ (a b : α), G.computable_dist a b = G.computable_dist b ahdiag:∀ (a : α), G.computable_dist a a = 0⊢ ∑ uv, Sym2.lift ⟨fun u v ↦ G.dist u v, ⋯⟩ uv = (∑ u, ∑ v, G.computable_dist u v) / 2; simp α:Type u_1inst✝²:Fintype αinst✝¹:DecidableEq αG:SimpleGraph αinst✝:DecidableRel G.Adjhcomm:∀ (a b : α), G.computable_dist a b = G.computable_dist b ahdiag:∀ (a : α), G.computable_dist a a = 0⊢ ∑ uv, Sym2.lift ⟨fun u v ↦ G.dist u v, ⋯⟩ uv = (∑ u, ∑ v, G.computable_dist u v) / 2 α:Type u_1inst✝²:Fintype αinst✝¹:DecidableEq αG:SimpleGraph αinst✝:DecidableRel G.Adjhcomm:∀ (a b : α), G.computable_dist a b = G.computable_dist b ahdiag:∀ (a : α), G.computable_dist a a = 0⊢ ∑ uv, Sym2.lift ⟨fun u v ↦ G.dist u v, ⋯⟩ uv = (∑ u, ∑ v, G.computable_dist u v) / 2
-- Sum over Sym2 using dist = sum over Sym2 using computable_dist
have h_sum : (∑ uv : Sym2 α, Sym2.lift ⟨fun u v ↦ G.dist u v,
by α:Type u_1inst✝²:Fintype αinst✝¹:DecidableEq αG:SimpleGraph αinst✝:DecidableRel G.Adjhcomm:∀ (a b : α), G.computable_dist a b = G.computable_dist b ahdiag:∀ (a : α), G.computable_dist a a = 0uv:Sym2 α⊢ ∀ (a₁ a₂ : α), (fun u v ↦ G.dist u v) a₁ a₂ = (fun u v ↦ G.dist u v) a₂ a₁ α:Type u_1inst✝²:Fintype αinst✝¹:DecidableEq αG:SimpleGraph αinst✝:DecidableRel G.Adjhcomm:∀ (a b : α), G.computable_dist a b = G.computable_dist b ahdiag:∀ (a : α), G.computable_dist a a = 0h_sum:∑ uv, Sym2.lift ⟨fun u v ↦ G.dist u v, ⋯⟩ uv = ∑ uv, Sym2.lift ⟨fun u v ↦ G.computable_dist u v, ⋯⟩ uv⊢ ∑ uv, Sym2.lift ⟨fun u v ↦ G.dist u v, ⋯⟩ uv = (∑ u, ∑ v, G.computable_dist u v) / 2 intro a b α:Type u_1inst✝²:Fintype αinst✝¹:DecidableEq αG:SimpleGraph αinst✝:DecidableRel G.Adjhcomm:∀ (a b : α), G.computable_dist a b = G.computable_dist b ahdiag:∀ (a : α), G.computable_dist a a = 0uv:Sym2 αa:αb:α⊢ (fun u v ↦ G.dist u v) a b = (fun u v ↦ G.dist u v) b a α:Type u_1inst✝²:Fintype αinst✝¹:DecidableEq αG:SimpleGraph αinst✝:DecidableRel G.Adjhcomm:∀ (a b : α), G.computable_dist a b = G.computable_dist b ahdiag:∀ (a : α), G.computable_dist a a = 0h_sum:∑ uv, Sym2.lift ⟨fun u v ↦ G.dist u v, ⋯⟩ uv = ∑ uv, Sym2.lift ⟨fun u v ↦ G.computable_dist u v, ⋯⟩ uv⊢ ∑ uv, Sym2.lift ⟨fun u v ↦ G.dist u v, ⋯⟩ uv = (∑ u, ∑ v, G.computable_dist u v) / 2; simp [dist_comm] All goals completed! 🐙 α:Type u_1inst✝²:Fintype αinst✝¹:DecidableEq αG:SimpleGraph αinst✝:DecidableRel G.Adjhcomm:∀ (a b : α), G.computable_dist a b = G.computable_dist b ahdiag:∀ (a : α), G.computable_dist a a = 0h_sum:∑ uv, Sym2.lift ⟨fun u v ↦ G.dist u v, ⋯⟩ uv = ∑ uv, Sym2.lift ⟨fun u v ↦ G.computable_dist u v, ⋯⟩ uv⊢ ∑ uv, Sym2.lift ⟨fun u v ↦ G.dist u v, ⋯⟩ uv = (∑ u, ∑ v, G.computable_dist u v) / 2⟩ uv) =
∑ uv : Sym2 α, Sym2.lift ⟨fun u v ↦ computable_dist G u v,
fun a b => hcomm a b⟩ uv := by α:Type u_1inst✝²:Fintype αinst✝¹:DecidableEq αG:SimpleGraph αinst✝:DecidableRel G.Adj⊢ G.wienerIndex = G.computable_wiener α:Type u_1inst✝²:Fintype αinst✝¹:DecidableEq αG:SimpleGraph αinst✝:DecidableRel G.Adjhcomm:∀ (a b : α), G.computable_dist a b = G.computable_dist b ahdiag:∀ (a : α), G.computable_dist a a = 0h_sum:∑ uv, Sym2.lift ⟨fun u v ↦ G.dist u v, ⋯⟩ uv = ∑ uv, Sym2.lift ⟨fun u v ↦ G.computable_dist u v, ⋯⟩ uv⊢ ∑ uv, Sym2.lift ⟨fun u v ↦ G.dist u v, ⋯⟩ uv = (∑ u, ∑ v, G.computable_dist u v) / 2
apply Finset.sum_congr rfl α:Type u_1inst✝²:Fintype αinst✝¹:DecidableEq αG:SimpleGraph αinst✝:DecidableRel G.Adjhcomm:∀ (a b : α), G.computable_dist a b = G.computable_dist b ahdiag:∀ (a : α), G.computable_dist a a = 0⊢ ∀ x ∈ Finset.univ, Sym2.lift ⟨fun u v ↦ G.dist u v, ⋯⟩ x = Sym2.lift ⟨fun u v ↦ G.computable_dist u v, ⋯⟩ x α:Type u_1inst✝²:Fintype αinst✝¹:DecidableEq αG:SimpleGraph αinst✝:DecidableRel G.Adjhcomm:∀ (a b : α), G.computable_dist a b = G.computable_dist b ahdiag:∀ (a : α), G.computable_dist a a = 0h_sum:∑ uv, Sym2.lift ⟨fun u v ↦ G.dist u v, ⋯⟩ uv = ∑ uv, Sym2.lift ⟨fun u v ↦ G.computable_dist u v, ⋯⟩ uv⊢ ∑ uv, Sym2.lift ⟨fun u v ↦ G.dist u v, ⋯⟩ uv = (∑ u, ∑ v, G.computable_dist u v) / 2; intro x _ α:Type u_1inst✝²:Fintype αinst✝¹:DecidableEq αG:SimpleGraph αinst✝:DecidableRel G.Adjhcomm:∀ (a b : α), G.computable_dist a b = G.computable_dist b ahdiag:∀ (a : α), G.computable_dist a a = 0x:Sym2 αa✝:x ∈ Finset.univ⊢ Sym2.lift ⟨fun u v ↦ G.dist u v, ⋯⟩ x = Sym2.lift ⟨fun u v ↦ G.computable_dist u v, ⋯⟩ x α:Type u_1inst✝²:Fintype αinst✝¹:DecidableEq αG:SimpleGraph αinst✝:DecidableRel G.Adjhcomm:∀ (a b : α), G.computable_dist a b = G.computable_dist b ahdiag:∀ (a : α), G.computable_dist a a = 0h_sum:∑ uv, Sym2.lift ⟨fun u v ↦ G.dist u v, ⋯⟩ uv = ∑ uv, Sym2.lift ⟨fun u v ↦ G.computable_dist u v, ⋯⟩ uv⊢ ∑ uv, Sym2.lift ⟨fun u v ↦ G.dist u v, ⋯⟩ uv = (∑ u, ∑ v, G.computable_dist u v) / 2
refine Sym2.ind (fun a b => ?_) x α:Type u_1inst✝²:Fintype αinst✝¹:DecidableEq αG:SimpleGraph αinst✝:DecidableRel G.Adjhcomm:∀ (a b : α), G.computable_dist a b = G.computable_dist b ahdiag:∀ (a : α), G.computable_dist a a = 0x:Sym2 αa✝:x ∈ Finset.univa:αb:α⊢ Sym2.lift ⟨fun u v ↦ G.dist u v, ⋯⟩ s(a, b) = Sym2.lift ⟨fun u v ↦ G.computable_dist u v, ⋯⟩ s(a, b) α:Type u_1inst✝²:Fintype αinst✝¹:DecidableEq αG:SimpleGraph αinst✝:DecidableRel G.Adjhcomm:∀ (a b : α), G.computable_dist a b = G.computable_dist b ahdiag:∀ (a : α), G.computable_dist a a = 0h_sum:∑ uv, Sym2.lift ⟨fun u v ↦ G.dist u v, ⋯⟩ uv = ∑ uv, Sym2.lift ⟨fun u v ↦ G.computable_dist u v, ⋯⟩ uv⊢ ∑ uv, Sym2.lift ⟨fun u v ↦ G.dist u v, ⋯⟩ uv = (∑ u, ∑ v, G.computable_dist u v) / 2
simp only [Sym2.lift_mk, dist_eq_computable] α:Type u_1inst✝²:Fintype αinst✝¹:DecidableEq αG:SimpleGraph αinst✝:DecidableRel G.Adjhcomm:∀ (a b : α), G.computable_dist a b = G.computable_dist b ahdiag:∀ (a : α), G.computable_dist a a = 0h_sum:∑ uv, Sym2.lift ⟨fun u v ↦ G.dist u v, ⋯⟩ uv = ∑ uv, Sym2.lift ⟨fun u v ↦ G.computable_dist u v, ⋯⟩ uv⊢ ∑ uv, Sym2.lift ⟨fun u v ↦ G.dist u v, ⋯⟩ uv = (∑ u, ∑ v, G.computable_dist u v) / 2 α:Type u_1inst✝²:Fintype αinst✝¹:DecidableEq αG:SimpleGraph αinst✝:DecidableRel G.Adjhcomm:∀ (a b : α), G.computable_dist a b = G.computable_dist b ahdiag:∀ (a : α), G.computable_dist a a = 0h_sum:∑ uv, Sym2.lift ⟨fun u v ↦ G.dist u v, ⋯⟩ uv = ∑ uv, Sym2.lift ⟨fun u v ↦ G.computable_dist u v, ⋯⟩ uv⊢ ∑ uv, Sym2.lift ⟨fun u v ↦ G.dist u v, ⋯⟩ uv = (∑ u, ∑ v, G.computable_dist u v) / 2
rw [h_sum α:Type u_1inst✝²:Fintype αinst✝¹:DecidableEq αG:SimpleGraph αinst✝:DecidableRel G.Adjhcomm:∀ (a b : α), G.computable_dist a b = G.computable_dist b ahdiag:∀ (a : α), G.computable_dist a a = 0h_sum:∑ uv, Sym2.lift ⟨fun u v ↦ G.dist u v, ⋯⟩ uv = ∑ uv, Sym2.lift ⟨fun u v ↦ G.computable_dist u v, ⋯⟩ uv⊢ ∑ uv, Sym2.lift ⟨fun u v ↦ G.computable_dist u v, ⋯⟩ uv = (∑ u, ∑ v, G.computable_dist u v) / 2 α:Type u_1inst✝²:Fintype αinst✝¹:DecidableEq αG:SimpleGraph αinst✝:DecidableRel G.Adjhcomm:∀ (a b : α), G.computable_dist a b = G.computable_dist b ahdiag:∀ (a : α), G.computable_dist a a = 0h_sum:∑ uv, Sym2.lift ⟨fun u v ↦ G.dist u v, ⋯⟩ uv = ∑ uv, Sym2.lift ⟨fun u v ↦ G.computable_dist u v, ⋯⟩ uv⊢ ∑ uv, Sym2.lift ⟨fun u v ↦ G.computable_dist u v, ⋯⟩ uv = (∑ u, ∑ v, G.computable_dist u v) / 2] α:Type u_1inst✝²:Fintype αinst✝¹:DecidableEq αG:SimpleGraph αinst✝:DecidableRel G.Adjhcomm:∀ (a b : α), G.computable_dist a b = G.computable_dist b ahdiag:∀ (a : α), G.computable_dist a a = 0h_sum:∑ uv, Sym2.lift ⟨fun u v ↦ G.dist u v, ⋯⟩ uv = ∑ uv, Sym2.lift ⟨fun u v ↦ G.computable_dist u v, ⋯⟩ uv⊢ ∑ uv, Sym2.lift ⟨fun u v ↦ G.computable_dist u v, ⋯⟩ uv = (∑ u, ∑ v, G.computable_dist u v) / 2
have h2 := double_sum_eq_two_mul_sym2_sum hcomm hdiag α:Type u_1inst✝²:Fintype αinst✝¹:DecidableEq αG:SimpleGraph αinst✝:DecidableRel G.Adjhcomm:∀ (a b : α), G.computable_dist a b = G.computable_dist b ahdiag:∀ (a : α), G.computable_dist a a = 0h_sum:∑ uv, Sym2.lift ⟨fun u v ↦ G.dist u v, ⋯⟩ uv = ∑ uv, Sym2.lift ⟨fun u v ↦ G.computable_dist u v, ⋯⟩ uvh2:∑ u, ∑ v, G.computable_dist u v = 2 * ∑ x, Sym2.lift ⟨G.computable_dist, ⋯⟩ x⊢ ∑ uv, Sym2.lift ⟨fun u v ↦ G.computable_dist u v, ⋯⟩ uv = (∑ u, ∑ v, G.computable_dist u v) / 2
-- h2 : ∑∑ f = 2 * ∑ Sym2 lift f
-- goal: ∑ Sym2 lift f = ∑∑ f / 2
rw [h2, α:Type u_1inst✝²:Fintype αinst✝¹:DecidableEq αG:SimpleGraph αinst✝:DecidableRel G.Adjhcomm:∀ (a b : α), G.computable_dist a b = G.computable_dist b ahdiag:∀ (a : α), G.computable_dist a a = 0h_sum:∑ uv, Sym2.lift ⟨fun u v ↦ G.dist u v, ⋯⟩ uv = ∑ uv, Sym2.lift ⟨fun u v ↦ G.computable_dist u v, ⋯⟩ uvh2:∑ u, ∑ v, G.computable_dist u v = 2 * ∑ x, Sym2.lift ⟨G.computable_dist, ⋯⟩ x⊢ ∑ uv, Sym2.lift ⟨fun u v ↦ G.computable_dist u v, ⋯⟩ uv = (2 * ∑ x, Sym2.lift ⟨G.computable_dist, ⋯⟩ x) / 2 All goals completed! 🐙 Nat.mul_div_cancel_left _ (by α:Type u_1inst✝²:Fintype αinst✝¹:DecidableEq αG:SimpleGraph αinst✝:DecidableRel G.Adjhcomm:∀ (a b : α), G.computable_dist a b = G.computable_dist b ahdiag:∀ (a : α), G.computable_dist a a = 0h_sum:∑ uv, Sym2.lift ⟨fun u v ↦ G.dist u v, ⋯⟩ uv = ∑ uv, Sym2.lift ⟨fun u v ↦ G.computable_dist u v, ⋯⟩ uvh2:∑ u, ∑ v, G.computable_dist u v = 2 * ∑ x, Sym2.lift ⟨G.computable_dist, ⋯⟩ x⊢ 0 < 2 All goals completed! 🐙 omega All goals completed! 🐙 All goals completed! 🐙 : 0 < 2)] All goals completed! 🐙end SimpleGraph