NS.09193 · Lemma chung_two_mul_radius_sub_one_le_largestInducedTreeSize · Written on the Wall II - Conjecture 84 > s-r2r4mp1yf5
s-r2r4mp1yf5 · proof · against statement v1
Proof for Lemma chung_two_mul_radius_sub_one_le_largestInducedTreeSize · Written on the Wall II - Conjecture 84
| Lean accepts it | yes | compiles under the pinned toolchain |
| Standard axioms | yes | propext, Classical.choice, Quot.sound only |
| Right theorem | yes | type identical to the reference, definitions unchanged |
| Faithful statement | yes | the reference statement has been reviewed |
Verification pipeline
Run #83 · verified · 24 Nov 2026, 10:16 UTC · Lean v4.33.1 · sandbox docker:nosorry-verifier:fc
- preflight — pass0.01 s
1 sorry found: only declarations the target does not depend on may keep sorry
- originality — pass0.01 s
no identical earlier submission
- compile reference statement — pass37.29 s
- compile submission — pass9.78 s
- statement & axioms — pass111.66 s
axioms: [propext, Quot.sound, Classical.choice]
- kernel replay — pass20.69 s
- comparator — skipped
not configured on this worker (COMPARATOR_BIN)
Points
| +1 | later verified proof of a lemma statement | 24 Nov 2026, 10:19 UTC |
Explanation
Proof of Chung's induced tree theorem ( for finite connected graphs), following Appendix A of Gebendorfer (Oct 2026) / Erdős–Saks–Sós (1986, Theorem 2.2):
- Strong induction on (
chung_aux). If , a single vertex already gives an induced tree of size . - For , choose maximizing from a fixed ; any shortest walk from to avoids , so is connected.
- If , apply the induction hypothesis to and lift an induced tree back into .
- Otherwise (Lemma 1). Choosing a centre of gives for all and .
- Along a geodesic from to , take and a vertex with (so ), plus a geodesic from to ().
- Triangle-inequality estimates from and show all () are disjoint from , and the only possible cross-edge between and is (which forces ).
- Iteratively attaching via
IsTree.induce_insert_of_unique_adj(insertChain_exists) either to (if , size ) or to (if , size ) yields an induced tree of size .
Declared prior work
F. Chung in Erdos-Saks-Sos (1986), Theorem 2.2; Jonas J. Gebendorfer (Oct 2026), Appendix A
Lean source
/-
Copyright 2025 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 FormalConjecturesUtil
/-!
# Written on the Wall II - Conjecture 84
**Verbatim statement (WOWII #84, status O):**
> If G is a simple connected graph, then tree(G) ≥ 2 rad(G) / δ(G)
**Source:** http://cms.uhd.edu/faculty/delavinae/research/wowII/all.html#conj84
Here `δ(G)` is the **minimum degree** of `G` (lowercase delta in the WOWII
HTML, rendered as `<font face="Symbol">d</font>`), not the average distance.
*Reference:*
[E. DeLaVina, Written on the Wall II, Conjectures of Graffiti.pc](http://cms.dt.uh.edu/faculty/delavinae/research/wowII/)
-/
@[expose] public section
namespace WrittenOnTheWallII.GraphConjecture84
open SimpleGraph
variable {α : Type*} [Fintype α] [DecidableEq α] [Nontrivial α]
/--
WOWII [Conjecture 84](http://cms.uhd.edu/faculty/delavinae/research/wowII/all.html#conj84)
(status O):
For a simple connected graph `G` with positive minimum degree,
`tree(G) ≥ 2 · rad(G) / δ(G)`,
where `tree(G)` is the number of vertices in a largest induced subtree,
`rad(G)` is the radius, and `δ(G) = G.minDegree` is the minimum degree.
The hypothesis `0 < G.minDegree` follows from connectedness on a nontrivial
vertex set, but is stated explicitly so the theorem reads as a real-valued
inequality without `x / 0` corner cases.
-/
@[category research open, AMS 5]
theorem conjecture84 (G : SimpleGraph α) [DecidableRel G.Adj]
(h : G.Connected) (hδ : 0 < G.minDegree) :
2 * (G.radius.toNat : ℝ) / (G.minDegree : ℝ) ≤ (largestInducedTreeSize G : ℝ) := by
sorry
-- Sanity checks
/-- The `largestInducedTreeSize` is nonneg. -/
@[category test, AMS 5]
example (G : SimpleGraph (Fin 3)) : 0 ≤ largestInducedTreeSize G := Nat.zero_le _
/-- The largest induced tree size is nonneg. -/
@[category test, AMS 5]
example (G : SimpleGraph (Fin 3)) : 0 ≤ (largestInducedTreeSize G : ℝ) :=
Nat.cast_nonneg _
section ChungHelpers
omit [Fintype α] [DecidableEq α] [Nontrivial α]
private lemma dist_getVert_le {β : Type*} {H : SimpleGraph β} (hH : H.Connected)
{a b : β} (q : H.Walk a b) :
∀ {i j : ℕ}, i ≤ j → j ≤ q.length → H.dist (q.getVert i) (q.getVert j) ≤ j - i := by
intro i j hij hj
obtain ⟨d, hd⟩ := Nat.exists_eq_add_of_le hij
subst hd
induction d with
| zero => simp
| succ d ih =>
have h1 : i + d < q.length := by omega
have ihd := ih (by omega) (by omega)
have hadj : H.Adj (q.getVert (i + d)) (q.getVert (i + d + 1)) :=
q.adj_getVert_succ h1
have htri : H.dist (q.getVert i) (q.getVert (i + d + 1)) ≤
H.dist (q.getVert i) (q.getVert (i + d)) +
H.dist (q.getVert (i + d)) (q.getVert (i + d + 1)) :=
hH.dist_triangle
have h1d : H.dist (q.getVert (i + d)) (q.getVert (i + d + 1)) = 1 :=
dist_eq_one_iff_adj.mpr hadj
rw [← Nat.add_assoc] at *
omega
private lemma geodesic_dist_getVert {β : Type*} {H : SimpleGraph β} (hH : H.Connected)
{a b : β} (q : H.Walk a b) (hq : q.length = H.dist a b) :
∀ {i j : ℕ}, i ≤ j → j ≤ q.length →
H.dist (q.getVert i) (q.getVert j) = j - i := by
intro i j hij hj
have h1 : H.dist a (q.getVert i) ≤ i := by
simpa [q.getVert_zero] using dist_getVert_le hH q (Nat.zero_le i) (hij.trans hj)
have h2 : H.dist (q.getVert i) (q.getVert j) ≤ j - i :=
dist_getVert_le hH q hij hj
have h3 : H.dist (q.getVert j) b ≤ q.length - j := by
simpa [q.getVert_length] using dist_getVert_le hH q hj (le_refl q.length)
have ht1 : H.dist a b ≤ H.dist a (q.getVert i) + H.dist (q.getVert i) b :=
hH.dist_triangle
have ht2 : H.dist (q.getVert i) b ≤ H.dist (q.getVert i) (q.getVert j) + H.dist (q.getVert j) b :=
hH.dist_triangle
omega
private lemma mem_support_iff_exists_getVert {β : Type*} {H : SimpleGraph β}
{a b z : β} (q : H.Walk a b) :
z ∈ q.support ↔ ∃ i ≤ q.length, q.getVert i = z := by
induction q with
| nil =>
simp only [Walk.support_nil, Walk.length_nil, List.mem_singleton, Nat.le_zero,
exists_eq_left, Walk.getVert_zero, eq_comm]
| @cons u v w huv q ih =>
simp only [Walk.support_cons, List.mem_cons, Walk.length_cons, ih]
constructor
· rintro (rfl | ⟨i, hi, rfl⟩)
· exact ⟨0, Nat.zero_le _, rfl⟩
· exact ⟨i + 1, Nat.succ_le_succ hi, by simp⟩
· rintro ⟨i, hi, rfl⟩
cases i with
| zero => exact Or.inl rfl
| succ i => exact Or.inr ⟨i, Nat.le_of_succ_le_succ hi, by simp⟩
private lemma walk_induce_tree_card_image {β : Type*} [Fintype β] [DecidableEq β]
{H : SimpleGraph β} {V' : Set β} (T' : Finset V')
(hT' : ((H.induce V').induce (T' : Set V')).IsTree) :
(H.induce ((T'.image Subtype.val : Finset β) : Set β)).IsTree := by
let S : Set β := (T'.image Subtype.val : Finset β)
have mem_iff (v : β) : v ∈ S ↔ ∃ u : V', u ∈ T' ∧ u.1 = v := by
simp [S]
let e : ((H.induce V').induce (T' : Set V')) ≃g H.induce S :=
{ toFun := fun x => ⟨x.1.1, (mem_iff x.1.1).mpr ⟨x.1, x.2, rfl⟩⟩
invFun := fun y =>
⟨((mem_iff y.1).mp y.2).choose, ((mem_iff y.1).mp y.2).choose_spec.1⟩
left_inv := fun x => by
apply Subtype.ext
apply Subtype.ext
exact ((mem_iff x.1.1).mp ((mem_iff x.1.1).mpr ⟨x.1, x.2, rfl⟩)).choose_spec.2
right_inv := fun y => by
apply Subtype.ext
exact ((mem_iff y.1).mp y.2).choose_spec.2
map_rel_iff' := fun {a b} => Iff.rfl }
exact (e.isTree_iff).mp hT'
private lemma card_largestInducedTreeSize_induce_le {β : Type*} [Fintype β] [DecidableEq β]
(H : SimpleGraph β) (V' : Set β) [Fintype V'] [DecidableEq V'] :
largestInducedTreeSize (H.induce V') ≤ largestInducedTreeSize H := by
classical
by_cases hne : ({n : ℕ | ∃ s : Finset V', s.card = n ∧
((H.induce V').induce (s : Set V')).IsTree}).Nonempty
· unfold largestInducedTreeSize
apply csSup_le hne
rintro n ⟨T', rfl, hT'⟩
have hT : (H.induce ((T'.image Subtype.val : Finset β) : Set β)).IsTree :=
walk_induce_tree_card_image T' hT'
have hcard : (T'.image Subtype.val).card = T'.card :=
Finset.card_image_of_injective T' Subtype.val_injective
rw [← hcard]
exact card_le_largestInducedTreeSize hT
· have h0 : largestInducedTreeSize (H.induce V') = 0 := by
unfold largestInducedTreeSize
rw [show {n : ℕ | ∃ s : Finset V', s.card = n ∧
((H.induce V').induce (s : Set V')).IsTree} = ∅ from
Set.not_nonempty_iff_eq_empty.mp hne]
simp
rw [h0]
exact Nat.zero_le _
private def walkInduce {β : Type*} {H : SimpleGraph β} {V' : Set β} :
∀ {a b : β} (q : H.Walk a b), (∀ z ∈ q.support, z ∈ V') →
(ha : a ∈ V') → (hb : b ∈ V') →
(H.induce V').Walk ⟨a, ha⟩ ⟨b, hb⟩
| _, _, .nil, _, ha, hb => .nil
| a, b, .cons (v := v1) hadj rest, hq, ha, hb =>
have hv1 : v1 ∈ V' := hq v1 (by simp [Walk.start_mem_support])
let u' : V' := ⟨a, ha⟩
let v' : V' := ⟨v1, hv1⟩
let w' : V' := ⟨b, hb⟩
Walk.cons (u := u') (v := v') (w := w') hadj
(walkInduce rest (fun z hz => hq z (List.mem_cons_of_mem _ hz)) hv1 hb)
private lemma walk_tail_exists {β : Type*} {H : SimpleGraph β}
{v x : β} (q : H.Walk v x) (hq : 1 ≤ q.length) :
∃ (v1 : β) (q' : H.Walk v1 x), v1 = q.getVert 1 ∧ q'.length = q.length - 1 ∧
∀ b ∈ q'.support, ∃ j, 1 ≤ j ∧ j ≤ q.length ∧ b = q.getVert j := by
cases q with
| nil => simp at hq
| @cons _ v1 _ hadj rest =>
refine ⟨v1, rest, by simp, by simp, fun b hb => ?_⟩
rw [mem_support_iff_exists_getVert] at hb
obtain ⟨j, hj, rfl⟩ := hb
exact ⟨j + 1, by omega, by simp only [Walk.length_cons]; omega, rfl⟩
private lemma insertChain_exists {β : Type*} [DecidableEq β] {H : SimpleGraph β}
(S₀ : Finset β) (hS₀ : (H.induce (S₀ : Set β)).IsTree)
{v w : β} (p : H.Walk v w) (hp : p.length = H.dist v w) (hH : H.Connected)
(a₀ : β) (ha₀_mem : a₀ ∈ S₀) (ha₀_adj : H.Adj (p.getVert 1) a₀)
(hdisj : ∀ i, 1 ≤ i → i ≤ p.length → p.getVert i ∉ S₀)
(huniq0 : ∀ i b, 1 ≤ i → i ≤ p.length → b ∈ S₀ → H.Adj (p.getVert i) b → i = 1 ∧ b = a₀) :
∀ k ≤ p.length, ∃ S : Finset β,
(H.induce (S : Set β)).IsTree ∧
S.card = S₀.card + k ∧
S = S₀ ∪ (Finset.Icc 1 k).image (fun i => p.getVert i) := by
intro k hk
induction k with
| zero =>
refine ⟨S₀, hS₀, by simp, by simp⟩
| succ k ih =>
obtain ⟨S, hSTree, hScard, rfl⟩ := ih (Nat.le_of_succ_le hk)
set z := p.getVert (k + 1)
have hz_notin : z ∉ S₀ ∪ (Finset.Icc 1 k).image (fun i => p.getVert i) := by
simp only [Finset.mem_union, Finset.mem_image, Finset.mem_Icc, not_or, not_exists, not_and]
refine ⟨hdisj (k + 1) (Nat.succ_pos k) hk, ?_⟩
rintro i ⟨hi1, hik⟩ heq
have hd1 : H.dist v (p.getVert i) = i := by
simpa [p.getVert_zero] using geodesic_dist_getVert hH p hp (Nat.zero_le i) (hik.trans (Nat.le_of_succ_le hk))
have hd2 : H.dist v z = k + 1 := by
simpa [p.getVert_zero] using geodesic_dist_getVert hH p hp (Nat.zero_le (k + 1)) hk
rw [heq, hd2] at hd1
omega
have hk_or : k = 0 ∨ 1 ≤ k := by omega
rcases hk_or with rfl | hk1
· have hz_tree : (H.induce ((insert z (S₀ ∪ (Finset.Icc 1 0).image (fun i => p.getVert i)) : Finset β) : Set β)).IsTree := by
apply IsTree.induce_insert_of_unique_adj hSTree hz_notin
(Finset.mem_union_left _ ha₀_mem) ha₀_adj
intro b hb hzb
simp only [Finset.Icc_eq_empty_of_lt (by omega : 1 > 0), Finset.image_empty,
Finset.union_empty] at hb
exact (huniq0 1 b (le_refl 1) hk hb hzb).2
refine ⟨insert z (S₀ ∪ (Finset.Icc 1 0).image (fun i => p.getVert i)), hz_tree, ?_, ?_⟩
· rw [Finset.card_insert_of_notMem hz_notin, hScard]
· ext u
simp only [Finset.mem_insert, Finset.mem_union, Finset.mem_image, Finset.mem_Icc,
Finset.Icc_eq_empty_of_lt (by omega : 1 > 0), Finset.image_empty, Finset.union_empty]
constructor
· rintro (rfl | hu)
· exact Or.inr ⟨1, ⟨le_refl 1, le_refl 1⟩, rfl⟩
· exact Or.inl hu
· rintro (hu | ⟨i, ⟨hi1, hik⟩, rfl⟩)
· exact Or.inr hu
· have : i = 1 := by omega
subst this
exact Or.inl rfl
· have hak_mem : p.getVert k ∈ S₀ ∪ (Finset.Icc 1 k).image (fun i => p.getVert i) :=
Finset.mem_union_right _ (Finset.mem_image_of_mem _ (Finset.mem_Icc.mpr ⟨hk1, le_refl k⟩))
have hak_adj : H.Adj z (p.getVert k) := (p.adj_getVert_succ hk).symm
have hz_tree : (H.induce ((insert z (S₀ ∪ (Finset.Icc 1 k).image (fun i => p.getVert i)) : Finset β) : Set β)).IsTree := by
apply IsTree.induce_insert_of_unique_adj hSTree hz_notin hak_mem hak_adj
intro b hb hzb
simp only [Finset.mem_union, Finset.mem_image, Finset.mem_Icc] at hb
rcases hb with hbS₀ | ⟨i, ⟨hi1, hik⟩, rfl⟩
· have h1 := (huniq0 (k + 1) b (by omega) hk hbS₀ hzb).1
omega
· have hd1 : H.dist v (p.getVert i) = i := by
simpa [p.getVert_zero] using geodesic_dist_getVert hH p hp (Nat.zero_le i) (hik.trans (Nat.le_of_succ_le hk))
have hd2 : H.dist v z = k + 1 := by
simpa [p.getVert_zero] using geodesic_dist_getVert hH p hp (Nat.zero_le (k + 1)) hk
have htri : H.dist v z ≤ H.dist v (p.getVert i) + H.dist (p.getVert i) z :=
hH.dist_triangle
have h1d : H.dist (p.getVert i) z = 1 := dist_eq_one_iff_adj.mpr hzb.symm
have hik_eq : i = k := by omega
subst hik_eq
rfl
refine ⟨insert z (S₀ ∪ (Finset.Icc 1 k).image (fun i => p.getVert i)), hz_tree, ?_, ?_⟩
· rw [Finset.card_insert_of_notMem hz_notin, hScard]; omega
· ext u
simp only [Finset.mem_insert, Finset.mem_union, Finset.mem_image, Finset.mem_Icc]
constructor
· rintro (rfl | hu | ⟨i, ⟨hi1, hik⟩, rfl⟩)
· exact Or.inr ⟨k + 1, ⟨by omega, le_refl _⟩, rfl⟩
· exact Or.inl hu
· exact Or.inr ⟨i, ⟨hi1, by omega⟩, rfl⟩
· rintro (hu | ⟨i, ⟨hi1, hik⟩, rfl⟩)
· exact Or.inr (Or.inl hu)
· by_cases hi_eq : i = k + 1
· subst hi_eq; exact Or.inl rfl
· exact Or.inr (Or.inr ⟨i, ⟨hi1, by omega⟩, rfl⟩)
private lemma chung_aux :
∀ (n : ℕ) {β : Type*} [Fintype β] [DecidableEq β] [Nonempty β]
(H : SimpleGraph β) [DecidableRel H.Adj],
Fintype.card β = n → H.Connected →
2 * H.radius.toNat - 1 ≤ largestInducedTreeSize H := by
intro n
induction n using Nat.strong_induction_on with
| h n ih =>
intro β _ _ _ H _ hcard hH
set r := H.radius.toNat
by_cases hr : r ≤ 1
· have h1 := one_le_largestInducedTreeSize H
omega
have hr2 : 2 ≤ r := by omega
have hrad_eq : r = computable_radius H := by
change H.radius.toNat = computable_radius H
rw [radius_eq_computable H hH]
rfl
have hecc_ge (u : β) : r ≤ computable_eccent H u := by
have hle := H.radius_le_eccent (u := u)
rw [radius_eq_computable H hH, eccent_eq_computable H hH u] at hle
have hle' : computable_radius H ≤ computable_eccent H u := by exact_mod_cast hle
omega
-- Step 1: pick u0 and x maximizing H.dist u0 x; prove x ≠ u0 and H - x is connected
let u0 : β := Classical.arbitrary β
obtain ⟨x, _, hx_max⟩ :=
Finset.exists_max_image (Finset.univ : Finset β) (fun z => H.dist u0 z) Finset.univ_nonempty
have hx_dist2 : 2 ≤ H.dist u0 x := by
have h_ecc : 2 ≤ computable_eccent H u0 := le_trans hr2 (hecc_ge u0)
have h_le : computable_eccent H u0 ≤ H.dist u0 x := by
unfold computable_eccent
apply Finset.sup_le
intro z _
rw [← dist_eq_computable]
exact hx_max z (Finset.mem_univ z)
omega
have h_u0_ne_x : u0 ≠ x := by
intro h_eq
subst h_eq
simp at hx_dist2
let V' : Set β := {x}ᶜ
let H' : SimpleGraph V' := H.induce V'
have hH'_nonempty : Nonempty V' := ⟨⟨u0, h_u0_ne_x⟩⟩
have hH'_reach (y : β) (hy : y ≠ x) :
H'.Reachable ⟨u0, h_u0_ne_x⟩ ⟨y, hy⟩ := by
obtain ⟨q0, hq0⟩ := hH.exists_walk_length_eq_dist u0 y
have hx_notin : x ∉ q0.support := by
intro hxmem
rw [mem_support_iff_exists_getVert] at hxmem
obtain ⟨i, hi, rfl⟩ := hxmem
have hi_lt : i < q0.length := by
rcases Nat.eq_or_lt_of_le hi with rfl | hi_lt
· rw [q0.getVert_length] at hy; exact absurd rfl hy
· exact hi_lt
have hdi : H.dist u0 (q0.getVert i) = i := by
simpa [q0.getVert_zero] using geodesic_dist_getVert hH q0 hq0 (Nat.zero_le i) hi
have hymax := hx_max y (Finset.mem_univ y)
omega
have hsupp : ∀ z ∈ q0.support, z ∈ V' := by
intro z hz heq
apply hx_notin
rwa [← heq]
exact ⟨walkInduce q0 hsupp h_u0_ne_x hy⟩
have hH' : H'.Connected := by
refine ⟨fun a b => ?_⟩
exact (hH'_reach a.1 a.2).symm.trans (hH'_reach b.1 b.2)
have hV'_card : Fintype.card V' < n := by
rw [← hcard]
have hcardV' : Fintype.card V' = (Finset.univ.erase x).card := by
rw [Fintype.card_subtype]
congr 1
ext z
simp [V', and_comm]
rw [hcardV', Finset.card_erase_of_mem (Finset.mem_univ x)]
exact Nat.sub_lt Fintype.card_pos Nat.zero_lt_one
-- Step 2: check if rad(H') >= r
by_cases hrad' : r ≤ H'.radius.toNat
· have ih' := ih (Fintype.card V') hV'_card H' rfl hH'
have hmono := card_largestInducedTreeSize_induce_le H V'
calc 2 * r - 1 ≤ 2 * H'.radius.toNat - 1 := by omega
_ ≤ largestInducedTreeSize H' := ih'
_ ≤ largestInducedTreeSize H := hmono
-- Step 3: Radius-drop case (H'.radius.toNat ≤ r - 1)
have hrad'_lt : H'.radius.toNat ≤ r - 1 := by omega
have hrad'_eq : H'.radius.toNat = computable_radius H' := by
rw [radius_eq_computable H' hH']
rfl
obtain ⟨c', _, hc'_min⟩ :=
Finset.exists_min_image (Finset.univ : Finset V') (fun u => computable_eccent H' u)
Finset.univ_nonempty
have hc'_ecc : computable_eccent H' c' ≤ r - 1 := by
have hcr : computable_radius H' = computable_eccent H' c' := by
apply le_antisymm
· exact Finset.inf'_le _ (Finset.mem_univ c')
· exact Finset.le_inf' _ _ fun u hu => hc'_min u hu
omega
let v : β := c'.1
have hv_ne_x : v ≠ x := c'.2
have hdist_v_ne : ∀ z : β, z ≠ x → H.dist v z ≤ r - 1 := by
intro z hz
have hH'_dist : H'.dist c' ⟨z, hz⟩ ≤ computable_eccent H' c' := by
rw [dist_eq_computable]
exact Finset.le_sup (f := fun u => computable_dist H' c' u) (Finset.mem_univ _)
obtain ⟨w', hw'⟩ := hH'.exists_walk_length_eq_dist c' ⟨z, hz⟩
have h_le : H.dist v z ≤ (w'.map (Embedding.induce V').toHom).length := dist_le _
rw [Walk.length_map, hw'] at h_le
omega
have hdist_vx_le : H.dist v x ≤ r := by
obtain ⟨qvx, hqvx⟩ := hH.exists_walk_length_eq_dist v x
have hlen_pos : 1 ≤ qvx.length := by
rw [hqvx]
exact Nat.pos_of_ne_zero fun h0 =>
hv_ne_x ((hH.dist_eq_zero_iff).mp h0)
let u := qvx.getVert (qvx.length - 1)
have hadj : H.Adj u x := by
simpa [u, Nat.sub_add_cancel hlen_pos, qvx.getVert_length] using
qvx.adj_getVert_succ (by omega : qvx.length - 1 < qvx.length)
have hu_ne : u ≠ x := hadj.ne
have hvu := hdist_v_ne u hu_ne
have hux : H.dist u x = 1 := dist_eq_one_iff_adj.mpr hadj
have htri : H.dist v x ≤ H.dist v u + H.dist u x := hH.dist_triangle
omega
have hdist_vx : H.dist v x = r := by
have hv_ecc : r ≤ computable_eccent H v := hecc_ge v
-- Since Finset.univ is nonempty, sup is attained at some zmax
obtain ⟨zmax, _, hzmax⟩ :=
Finset.exists_max_image (Finset.univ : Finset β) (fun z => computable_dist H v z)
Finset.univ_nonempty
have h_sup_le : computable_eccent H v ≤ computable_dist H v zmax := by
unfold computable_eccent
exact Finset.sup_le fun z _ => hzmax z (Finset.mem_univ z)
rw [← dist_eq_computable] at h_sup_le
by_cases hzx : zmax = x
· subst hzx; omega
· have := hdist_v_ne zmax hzx; omega
-- Step 4: geodesic q from v to x, point q2 = q.getVert 2, vertex w, geodesic p from v to w
obtain ⟨q, hq⟩ := hH.exists_walk_length_eq_dist v x
have hq_len : q.length = r := by omega
let q2 := q.getVert 2
have hq2_x : H.dist q2 x = r - 2 := by
simpa [q2, ← hq_len, q.getVert_length] using
geodesic_dist_getVert hH q hq (by omega : 2 ≤ r) (by omega : r ≤ q.length)
have hq2_v : H.dist v q2 = 2 := by
simpa [q2, q.getVert_zero] using
geodesic_dist_getVert hH q hq (Nat.zero_le 2) (by omega : 2 ≤ q.length)
-- Pick w maximizing computable_dist H q2 w so r ≤ H.dist q2 w
obtain ⟨w, _, hw_max⟩ :=
Finset.exists_max_image (Finset.univ : Finset β) (fun z => computable_dist H q2 z)
Finset.univ_nonempty
have hq2_w : r ≤ H.dist q2 w := by
have h_ecc := hecc_ge q2
have h_sup : computable_eccent H q2 ≤ computable_dist H q2 w := by
unfold computable_eccent
exact Finset.sup_le fun z _ => hw_max z (Finset.mem_univ z)
rw [← dist_eq_computable] at h_sup
omega
have hw_ne_x : w ≠ x := by
intro heq; subst heq; omega
set l := H.dist v w
have hl_le : l ≤ r - 1 := hdist_v_ne w hw_ne_x
have hl_ge : r - 2 ≤ l := by
have htri : H.dist q2 w ≤ H.dist q2 v + H.dist v w := hH.dist_triangle
rw [H.dist_comm (u := q2) (v := v)] at htri
have h2v : H.dist v q2 = 2 := hq2_v
omega
-- Subcase l = 0 => r = 2, q itself has r + 1 = 3 = 2*r - 1 vertices
by_cases hl0 : l = 0
· have hr_eq2 : r = 2 := by omega
have hqtree : (H.induce (q.support.toFinset : Set β)).IsTree :=
Walk.induce_support_isTree_of_length_eq_dist q hq
have hqnodup : q.support.Nodup := (q.isPath_of_length_eq_dist hq).support_nodup
have hqcard : q.support.toFinset.card = r + 1 := by
rw [List.toFinset_card_of_nodup hqnodup, Walk.length_support, hq_len]
have hbound := card_le_largestInducedTreeSize hqtree
omega
have hl1 : 1 ≤ l := by omega
obtain ⟨p, hp⟩ := hH.exists_walk_length_eq_dist v w
have hp_len : p.length = l := hp
-- Key distance lower bound: for 1 ≤ i ≤ l, i + 1 ≤ H.dist q2 (p.getVert i)
have hq2_p_ge : ∀ i, 1 ≤ i → i ≤ l → i + 1 ≤ H.dist q2 (p.getVert i) := by
intro i hi1 hil
have hpiw : H.dist (p.getVert i) w = l - i := by
simpa [← hp_len, p.getVert_length] using
geodesic_dist_getVert hH p hp hil (by omega : l ≤ p.length)
have htri : H.dist q2 w ≤ H.dist q2 (p.getVert i) + H.dist (p.getVert i) w :=
hH.dist_triangle
omega
-- Distance between q2 and q.getVert j for j ≤ r
have hq2_q : ∀ j ≤ r, H.dist q2 (q.getVert j) = if j ≤ 2 then 2 - j else j - 2 := by
intro j hj
split_ifs with hj2
· rw [H.dist_comm]
exact geodesic_dist_getVert hH q hq hj2 (by omega : 2 ≤ q.length)
· exact geodesic_dist_getVert hH q hq (by omega : 2 ≤ j) (by omega : j ≤ q.length)
-- Disjointness: p.getVert i ≠ q.getVert j for 1 ≤ i ≤ l, j ≤ r
have hp_ne_q : ∀ i, 1 ≤ i → i ≤ l → ∀ j ≤ r, p.getVert i ≠ q.getVert j := by
intro i hi1 hil j hj heq
have hdv_p : H.dist v (p.getVert i) = i := by
simpa [p.getVert_zero] using
geodesic_dist_getVert hH p hp (Nat.zero_le i) (by omega)
have hdv_q : H.dist v (q.getVert j) = j := by
simpa [q.getVert_zero] using
geodesic_dist_getVert hH q hq (Nat.zero_le j) (by omega)
rw [heq, hdv_q] at hdv_p
have h2p := hq2_p_ge i hi1 hil
rw [heq, hq2_q j hj] at h2p
split_ifs at h2p <;> omega
-- Cross-adjacencies between p.getVert i (1 ≤ i ≤ l) and q.getVert j (j ≤ r)
have hp_adj_q : ∀ i, 1 ≤ i → i ≤ l → ∀ j ≤ r,
H.Adj (p.getVert i) (q.getVert j) → i = 1 ∧ (j = 0 ∨ j = 1) := by
intro i hi1 hil j hj hadj
have hdv_p : H.dist v (p.getVert i) = i := by
simpa [p.getVert_zero] using
geodesic_dist_getVert hH p hp (Nat.zero_le i) (by omega)
have hdv_q : H.dist v (q.getVert j) = j := by
simpa [q.getVert_zero] using
geodesic_dist_getVert hH q hq (Nat.zero_le j) (by omega)
have hd1 : H.dist (p.getVert i) (q.getVert j) = 1 := dist_eq_one_iff_adj.mpr hadj
have htri1 : H.dist v (p.getVert i) ≤ H.dist v (q.getVert j) + H.dist (q.getVert j) (p.getVert i) :=
hH.dist_triangle
have htri2 : H.dist v (q.getVert j) ≤ H.dist v (p.getVert i) + H.dist (p.getVert i) (q.getVert j) :=
hH.dist_triangle
rw [H.dist_comm (u := q.getVert j) (v := p.getVert i), hd1, hdv_p, hdv_q] at htri1
rw [hd1, hdv_p, hdv_q] at htri2
have h2p := hq2_p_ge i hi1 hil
have htri3 : H.dist q2 (p.getVert i) ≤ H.dist q2 (q.getVert j) + H.dist (q.getVert j) (p.getVert i) :=
hH.dist_triangle
rw [H.dist_comm (u := q.getVert j) (v := p.getVert i), hd1, hq2_q j hj] at htri3
split_ifs at htri3 <;> omega
-- Split on whether H.Adj (p.getVert 1) (q.getVert 1)
by_cases hadj11 : H.Adj (p.getVert 1) (q.getVert 1)
· -- Subcase 2b: H.Adj (p.getVert 1) (q.getVert 1), hence l = r - 1
have hl_eq : l = r - 1 := by
have hpiw : H.dist (p.getVert 1) w = l - 1 := by
simpa [← hp_len, p.getVert_length] using
geodesic_dist_getVert hH p hp hl1 (by omega : l ≤ p.length)
have htri_w : H.dist q2 w ≤ H.dist q2 (p.getVert 1) + H.dist (p.getVert 1) w :=
hH.dist_triangle
have htri_q1 : H.dist q2 (p.getVert 1) ≤ H.dist q2 (q.getVert 1) + H.dist (q.getVert 1) (p.getVert 1) :=
hH.dist_triangle
have h1d : H.dist (q.getVert 1) (p.getVert 1) = 1 := dist_eq_one_iff_adj.mpr hadj11.symm
have h21 : H.dist q2 (q.getVert 1) = 1 := by
simpa using hq2_q 1 (by omega)
omega
obtain ⟨v1, q', hv1_eq, hq'_len, hq'_mem⟩ := walk_tail_exists q (by omega : 1 ≤ q.length)
have hq'_geod : q'.length = H.dist v1 x := by
have hd1x : H.dist (q.getVert 1) x = r - 1 := by
simpa [← hq_len, q.getVert_length] using
geodesic_dist_getVert hH q hq (by omega : 1 ≤ r) (by omega : r ≤ q.length)
rw [← hv1_eq] at hd1x
omega
let S₀ := q'.support.toFinset
have hS₀_tree : (H.induce (S₀ : Set β)).IsTree :=
Walk.induce_support_isTree_of_length_eq_dist q' hq'_geod
have hS₀_card : S₀.card = r := by
have hnodup := (q'.isPath_of_length_eq_dist hq'_geod).support_nodup
rw [List.toFinset_card_of_nodup hnodup, Walk.length_support, hq'_len, hq_len]
omega
have hv1_mem : v1 ∈ S₀ := by
simp [S₀, Walk.start_mem_support]
have hS₀_mem_iff (b : β) : b ∈ S₀ → ∃ j, 1 ≤ j ∧ j ≤ r ∧ b = q.getVert j := by
intro hb
simp only [S₀, List.mem_toFinset] at hb
obtain ⟨j, hj1, hjr, rfl⟩ := hq'_mem b hb
exact ⟨j, hj1, by omega, rfl⟩
have hdisj : ∀ i, 1 ≤ i → i ≤ p.length → p.getVert i ∉ S₀ := by
intro i hi1 hil hb
obtain ⟨j, _, hjr, heq⟩ := hS₀_mem_iff _ hb
exact hp_ne_q i hi1 (by omega) j hjr heq
have huniq0 : ∀ i b, 1 ≤ i → i ≤ p.length → b ∈ S₀ →
H.Adj (p.getVert i) b → i = 1 ∧ b = v1 := by
intro i b hi1 hil hb hadjb
obtain ⟨j, hj1, hjr, rfl⟩ := hS₀_mem_iff b hb
obtain ⟨hi_eq, hj_or⟩ := hp_adj_q i hi1 (by omega) j hjr hadjb
rcases hj_or with rfl | rfl
· omega
· exact ⟨hi_eq, hv1_eq.symm⟩
obtain ⟨S, hSTree, hScard, _⟩ := insertChain_exists S₀ hS₀_tree p hp hH v1
hv1_mem (by rw [hv1_eq]; exact hadj11) hdisj huniq0 l (by omega)
have hbound := card_le_largestInducedTreeSize hSTree
omega
· -- Subcase 2a: ¬ H.Adj (p.getVert 1) (q.getVert 1), start from S₀ = q.support.toFinset
let S₀ := q.support.toFinset
have hS₀_tree : (H.induce (S₀ : Set β)).IsTree :=
Walk.induce_support_isTree_of_length_eq_dist q hq
have hS₀_card : S₀.card = r + 1 := by
have hnodup := (q.isPath_of_length_eq_dist hq).support_nodup
rw [List.toFinset_card_of_nodup hnodup, Walk.length_support, hq_len]
have hv_mem : v ∈ S₀ := by
simp [S₀, Walk.start_mem_support]
have hv_adj : H.Adj (p.getVert 1) v := by
simpa [p.getVert_zero] using (p.adj_getVert_succ (by omega : 0 < p.length)).symm
have hS₀_mem_iff (b : β) : b ∈ S₀ → ∃ j ≤ r, b = q.getVert j := by
intro hb
simp only [S₀, List.mem_toFinset] at hb
rw [mem_support_iff_exists_getVert] at hb
obtain ⟨j, hj, rfl⟩ := hb
exact ⟨j, by omega, rfl⟩
have hdisj : ∀ i, 1 ≤ i → i ≤ p.length → p.getVert i ∉ S₀ := by
intro i hi1 hil hb
obtain ⟨j, hjr, heq⟩ := hS₀_mem_iff _ hb
exact hp_ne_q i hi1 (by omega) j hjr heq
have huniq0 : ∀ i b, 1 ≤ i → i ≤ p.length → b ∈ S₀ →
H.Adj (p.getVert i) b → i = 1 ∧ b = v := by
intro i b hi1 hil hb hadjb
obtain ⟨j, hjr, rfl⟩ := hS₀_mem_iff b hb
obtain ⟨hi_eq, hj_or⟩ := hp_adj_q i hi1 (by omega) j hjr hadjb
rcases hj_or with rfl | rfl
· exact ⟨hi_eq, q.getVert_zero⟩
· subst hi_eq
exact absurd hadjb hadj11
obtain ⟨S, hSTree, hScard, _⟩ := insertChain_exists S₀ hS₀_tree p hp hH v hv_mem
hv_adj hdisj huniq0 l (by omega)
have hbound := card_le_largestInducedTreeSize hSTree
omega
end ChungHelpers
/-- Intermediate lemma (nosorry): Chung's theorem (Erdos-Saks-Sos 1986, Theorem 2.2; Gebendorfer 2026, Theorem 2 / Appendix A): every connected finite graph satisfies tree(G) >= 2 rad(G) - 1. The sole external ingredient for Theorem 1 -/
theorem chung_two_mul_radius_sub_one_le_largestInducedTreeSize (G : SimpleGraph α) [DecidableRel G.Adj] (h : G.Connected) : 2 * G.radius.toNat - 1 ≤ largestInducedTreeSize G :=
chung_aux (Fintype.card α) G rfl h
end WrittenOnTheWallII.GraphConjecture84