Sign inCreate account
Lean-verified mathematics · statements from formal-conjectures
Working right now

Loading…

s-q8d7j94zkp · disproof · against statement v1

Disproof for Written on the Wall II - Conjecture 72

verifiedby testunknownsubmitted 24 Nov 2026, 12:05 UTCchecked 24 Nov 2026, 12:06 UTC
Lean accepts ityescompiles under the pinned toolchain
Standard axiomsyespropext, Classical.choice, Quot.sound only
Right theoremyesproves exactly the negation of the reference
Faithful statementyesthe reference statement has been reviewed

Verification pipeline

Run #89 · verified · 24 Nov 2026, 12:05 UTC · Lean v4.33.1 · sandbox docker:nosorry-verifier:fc
  1. preflight — pass0.03 s
    1 sorry found: only declarations the target does not depend on may keep sorry
  2. originality — pass0.00 s
    no identical earlier submission
  3. compile reference statement — pass0.00 s
    from cache
  4. compile submission — pass26.06 s
  5. statement & axioms — pass52.40 s
    axioms: [propext, Quot.sound, Classical.choice]
  6. kernel replay — pass10.74 s
  7. comparator — skipped
    not applicable to disproofs

Points

+100first verified proof of an open problem24 Nov 2026, 12:06 UTC

Explanation

Complete sorry-free disproof (--kind disproof, WrittenOnTheWallII.GraphConjecture72.not_conjecture72) of Written on the Wall II — Conjecture 72 (wotw-graphconjecture72), showing a connected 19-vertex counterexample G19:

Counterexample G19 (19 vertices in 5 layers L0..L4 of sizes 7, 2, 1, 2, 7):

  • L0 (indices 0..6): clique of size 7, completely adjacent to L1.
  • L1 (indices 7, 8): independent set of size 2, completely adjacent to L0 and L2.
  • L2 (index 9): single vertex, completely adjacent to L1 and L3.
  • L3 (indices 10, 11): independent set of size 2, completely adjacent to L2 and L4.
  • L4 (indices 12..18): clique of size 7, completely adjacent to L3.

Invariant values on G19:

  1. averageEccentricity G19 ≥ 70 / 19: Layer distances give eccentricities ≥ 4, 3, 2, 3, 4 on L0..L4, summing to 7·4 + 2·3 + 1·2 + 2·3 + 7·4 = 70.
  2. max_v λ(v) ≥ 4: The neighborhood of vertex 9 contains the 4-element independent set {7, 8, 10, 11}.
  3. Lower bound on conjecture RHS: 70 / 19 + 4 / 3 = 286 / 57 > 5, so ⌈averageEccentricity G19 + maxL / 3⌉ ≥ 6.
  4. largestInducedTreeSize G19 ≤ 5: Any induced subtree T on vertex set S has at most 2 vertices in each clique L0, L4 (triangle-free); if vertex 9 ∈ S, avoiding triangles and 4-cycles forces |S ∩ (L0 ∪ L1)| ≤ 2 and |S ∩ (L3 ∪ L4)| ≤ 2 (total |S| ≤ 5); if 9 ∉ S, connectedness of T keeps S entirely on one side (|S| ≤ 4 ≤ 5).

Thus ⌈averageEccentricity G19 + maxL / 3⌉ ≥ 6 > 5 ≥ largestInducedTreeSize G19, refuting conjecture72. Verified locally with lake env lean W72.lean (0 errors, 0 warnings, standard axioms [propext, Classical.choice, Quot.sound]).

Declared prior work

Jonas J. Gebendorfer (Oct 2026), An unbounded deficit in Written on the Wall II Conjecture 72 (19-vertex counterexample)

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 72

**Verbatim statement (WOWII #72, status O):**
> If G is a simple connected graph, then tree(G) ≥ CEIL[average of ecc(v) + maximum of λ(v) /3]

**Source:** http://cms.uhd.edu/faculty/delavinae/research/wowII/all.html#conj72


*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.GraphConjecture72

open SimpleGraph

section

variable {α : Type*} [Fintype α] [DecidableEq α] [Nontrivial α]

/--
WOWII [Conjecture 72](http://cms.dt.uh.edu/faculty/delavinae/research/wowII/)

For a simple connected graph `G`,
$\operatorname{tree}(G) ≥ ⌈\operatorname{ecc}_{\mathrm{avg}}(G) + \max_v \lambda(v)/3⌉$
where `tree(G)` is the number of vertices in a largest induced tree,
`ecc_avg(G)` is the average eccentricity of `G`, and
`max_v l(v) = max_v indepNeighborsCard G v` is the maximum over all vertices of
the independence number of the neighbourhood.
-/
@[category research open, AMS 5]
theorem conjecture72 (G : SimpleGraph α) (h : G.Connected) :
    let maxL := (Finset.univ.image (fun v => indepNeighborsCard G v)).max' (by simp)
    ⌈averageEccentricity G + (maxL : ℝ) / 3⌉ ≤ (largestInducedTreeSize G : ℝ) := by
  sorry

end

universe u_1

private def layer19 (i : Fin 19) : ℤ :=
  if i.val < 7 then 0
  else if i.val < 9 then 1
  else if i.val = 9 then 2
  else if i.val < 12 then 3
  else 4

private def g19Adj (i j : Fin 19) : Prop :=
  i ≠ j ∧
    ((layer19 i = 0 ∧ layer19 j = 0) ∨
     (layer19 i = 4 ∧ layer19 j = 4) ∨
     Int.natAbs (layer19 i - layer19 j) = 1)

private def G19 : SimpleGraph (ULift.{u_1} (Fin 19)) where
  Adj x y := g19Adj x.down y.down
  symm := ⟨fun _ _ h => by
    rcases h with ⟨hne, ⟨h0, h0'⟩ | ⟨h4, h4'⟩ | h1⟩
    · exact ⟨hne.symm, Or.inl ⟨h0', h0⟩⟩
    · exact ⟨hne.symm, Or.inr (Or.inl ⟨h4', h4⟩)⟩
    · refine ⟨hne.symm, Or.inr (Or.inr ?_)⟩
      rw [← Int.natAbs_neg, neg_sub]
      exact h1⟩
  loopless := ⟨fun _ h => h.1 rfl⟩

private abbrev v19 (i : Fin 19) : ULift.{u_1} (Fin 19) := ULift.up i

private lemma G19_conn : (G19.{u_1}).Connected := by
  have hreach : ∀ x : ULift.{u_1} (Fin 19), (G19.{u_1}).Reachable x (v19.{u_1} 9) := by
    intro ⟨i⟩
    have h7 : (G19.{u_1}).Adj (v19.{u_1} 7) (v19.{u_1} 9) := ⟨by decide, Or.inr (Or.inr (by decide))⟩
    have h10 : (G19.{u_1}).Adj (v19.{u_1} 10) (v19.{u_1} 9) := ⟨by decide, Or.inr (Or.inr (by decide))⟩
    by_cases hL0 : i.val < 7
    · have hadj : (G19.{u_1}).Adj (ULift.up i) (v19.{u_1} 7) := by
        refine ⟨by intro h; have hv := congrArg Fin.val h; exact absurd hv (by simp; omega),
          Or.inr (Or.inr ?_)⟩
        simp [layer19, hL0]
      exact (Walk.cons hadj (Walk.cons h7 Walk.nil)).reachable
    · by_cases hL1 : i.val < 9
      · have hadj : (G19.{u_1}).Adj (ULift.up i) (v19.{u_1} 9) := by
          refine ⟨by intro h; have hv := congrArg Fin.val h; exact absurd hv (by simp; omega),
            Or.inr (Or.inr ?_)⟩
          simp [layer19, hL0, hL1]
        exact hadj.reachable
      · by_cases hL2 : i.val = 9
        · have heq : ULift.up i = v19.{u_1} 9 := congrArg ULift.up (Fin.ext hL2)
          rw [heq]
        · by_cases hL3 : i.val < 12
          · have hadj : (G19.{u_1}).Adj (ULift.up i) (v19.{u_1} 9) := by
              refine ⟨by intro h; have hv := congrArg Fin.val h; exact absurd hv (by simp; omega),
                Or.inr (Or.inr ?_)⟩
              simp [layer19, hL0, hL1, hL2, hL3]
            exact hadj.reachable
          · have hadj : (G19.{u_1}).Adj (ULift.up i) (v19.{u_1} 10) := by
              refine ⟨by intro h; have hv := congrArg Fin.val h; exact absurd hv (by simp; omega),
                Or.inr (Or.inr ?_)⟩
              simp [layer19, hL0, hL1, hL2, hL3]
            exact (Walk.cons hadj (Walk.cons h10 Walk.nil)).reachable
  exact ⟨fun x y => (hreach x).trans (hreach y).symm⟩

private lemma g19Adj_diff_le {i j : Fin 19} (h : g19Adj i j) :
    Int.natAbs (layer19 i - layer19 j) ≤ 1 := by
  rcases h with ⟨_, ⟨h0, _⟩ | ⟨h4, _⟩ | h1⟩ <;> omega

private lemma g19_walk_layer_diff {x y : ULift.{u_1} (Fin 19)}
    (w : (G19.{u_1}).Walk x y) :
    Int.natAbs (layer19 x.down - layer19 y.down) ≤ (w.length : ℕ) := by
  induction w with
  | nil => simp
  | cons hadj _ ih =>
    have h1 : Int.natAbs (layer19 _ - layer19 _) ≤ 1 := g19Adj_diff_le hadj
    simp only [Walk.length_cons]
    omega

private lemma g19_dist_lower (x y : ULift.{u_1} (Fin 19)) :
    Int.natAbs (layer19 x.down - layer19 y.down) ≤ (G19.{u_1}).dist x y := by
  obtain ⟨w, hw⟩ := G19_conn.exists_walk_length_eq_dist x y
  rw [← hw]
  exact g19_walk_layer_diff w

private lemma g19_dist_le_eccent (x y : ULift.{u_1} (Fin 19)) :
    (G19.{u_1}).dist x y ≤ ((G19.{u_1}).eccent x).toNat := by
  classical
  have h1 : (((G19.{u_1}).dist x y : ℕ) : ℕ∞) ≤ (computable_eccent (G19.{u_1}) x : ℕ∞) := by
    rw [(G19_conn.preconnected x y).coe_dist_eq_edist, ← eccent_eq_computable (G19.{u_1}) G19_conn x]
    exact edist_le_eccent
  rw [eccent_eq_computable (G19.{u_1}) G19_conn x, ENat.toNat_natCast]
  exact_mod_cast h1

private lemma g19_eccent_lower (x : ULift.{u_1} (Fin 19)) :
    Int.natAbs (layer19 x.down - 2) + 2 ≤ ((G19.{u_1}).eccent x).toNat := by
  by_cases hle : layer19 x.down ≤ 2
  · have hd := g19_dist_lower x (v19.{u_1} 12)
    have he := g19_dist_le_eccent x (v19.{u_1} 12)
    have hl : layer19 (12 : Fin 19) = 4 := by decide
    dsimp only [v19] at hd he
    rw [hl] at hd
    omega
  · have hd := g19_dist_lower x (v19.{u_1} 0)
    have he := g19_dist_le_eccent x (v19.{u_1} 0)
    have hl : layer19 (0 : Fin 19) = 0 := by decide
    dsimp only [v19] at hd he
    rw [hl] at hd
    omega

private lemma g19_avg_ecc_lower :
    (70 : ℝ) / 19 ≤ averageEccentricity (G19.{u_1}) := by
  have hsum_layer :
      (∑ i : Fin 19, (Int.natAbs (layer19 i - 2) + 2)) = 70 := by
    decide
  have hsum : 70 ≤ ∑ x : ULift.{u_1} (Fin 19), ((G19.{u_1}).eccent x).toNat := by
    have heq : (∑ x : ULift.{u_1} (Fin 19), (Int.natAbs (layer19 x.down - 2) + 2)) = 70 := by
      rw [Fintype.sum_equiv (Equiv.ulift : ULift.{u_1} (Fin 19) ≃ Fin 19)
        (fun x => Int.natAbs (layer19 x.down - 2) + 2)
        (fun i => Int.natAbs (layer19 i - 2) + 2) (fun _ => rfl)]
      exact hsum_layer
    rw [← heq]
    exact Finset.sum_le_sum fun x _ => g19_eccent_lower x
  unfold averageEccentricity
  have hcard : (Fintype.card (ULift.{u_1} (Fin 19)) : ℝ) = 19 := by
    simp
  rw [hcard]
  have hsumR : (70 : ℝ) ≤ ((∑ x : ULift.{u_1} (Fin 19), ((G19.{u_1}).eccent x).toNat : ℕ) : ℝ) := by
    exact_mod_cast hsum
  exact div_le_div_of_nonneg_right hsumR (by norm_num : (0 : ℝ) ≤ 19)

private lemma g19_maxL_lower :
    4 ≤ (Finset.univ.image (fun v => indepNeighborsCard (G19.{u_1}) v)).max' (by simp) := by
  classical
  let A : Finset (ULift.{u_1} (Fin 19)) := {v19.{u_1} 7, v19.{u_1} 8, v19.{u_1} 10, v19.{u_1} 11}
  have hN : ∀ w ∈ A, (G19.{u_1}).Adj (v19.{u_1} 9) w := by
    intro w hw
    simp only [A, Finset.mem_insert, Finset.mem_singleton] at hw
    rcases hw with rfl | rfl | rfl | rfl <;>
      exact ⟨by decide, Or.inr (Or.inr (by decide))⟩
  have hInd : (G19.{u_1}).IsIndepSet (A : Set (ULift.{u_1} (Fin 19))) := by
    intro a ha b hb hab hadj
    simp only [Finset.mem_coe, A, Finset.mem_insert, Finset.mem_singleton] at ha hb
    rcases ha with rfl | rfl | rfl | rfl <;> rcases hb with rfl | rfl | rfl | rfl
    all_goals first
      | exact hab rfl
      | (rcases (hadj : g19Adj _ _) with ⟨_, ⟨h0, _⟩ | ⟨h4, _⟩ | h1⟩
         · revert h0; decide
         · revert h4; decide
         · revert h1; decide)
  let A' : Finset ((G19.{u_1}).neighborSet (v19.{u_1} 9)) :=
    A.attach.map ⟨fun x => ⟨x.1, hN x.1 x.2⟩, fun a b hab =>
      Subtype.ext (by simpa using congrArg Subtype.val hab)⟩
  have hInd' : ((G19.{u_1}).induce ((G19.{u_1}).neighborSet (v19.{u_1} 9))).IsIndepSet
      (A' : Set ((G19.{u_1}).neighborSet (v19.{u_1} 9))) := by
    intro x hx y hy hxy hadj
    simp only [Finset.mem_coe, A', Finset.mem_map, Finset.mem_attach, true_and,
      Subtype.exists] at hx hy
    rcases hx with ⟨x0, hx0, rfl⟩
    rcases hy with ⟨y0, hy0, rfl⟩
    exact hInd hx0 hy0 (fun h => hxy (Subtype.ext h)) hadj
  have hcardA : A.card = 4 := by
    have h7 : v19.{u_1} 7 ∉ ({v19.{u_1} 8, v19.{u_1} 10, v19.{u_1} 11} : Finset (ULift.{u_1} (Fin 19))) := by
      simp [v19]
    have h8 : v19.{u_1} 8 ∉ ({v19.{u_1} 10, v19.{u_1} 11} : Finset (ULift.{u_1} (Fin 19))) := by
      simp [v19]
    have h10 : v19.{u_1} 10 ∉ ({v19.{u_1} 11} : Finset (ULift.{u_1} (Fin 19))) := by
      simp [v19]
    simp only [A]
    rw [Finset.card_insert_of_notMem h7, Finset.card_insert_of_notMem h8,
      Finset.card_insert_of_notMem h10, Finset.card_singleton]
  have hcard_le : 4 ≤ indepNeighborsCard (G19.{u_1}) (v19.{u_1} 9) := by
    have hc := hInd'.card_le_indepNum
    simpa [A', hcardA, indepNeighborsCard] using hc
  exact le_trans hcard_le (Finset.le_max' _ _ (Finset.mem_image_of_mem _ (Finset.mem_univ _)))

private lemma isTree_no_triangle {β : Type*} {G : SimpleGraph β} {S : Set β}
    (hT : (G.induce S).IsTree) {a b c : β} (ha : a ∈ S) (hb : b ∈ S) (hc : c ∈ S)
    (hab : G.Adj a b) (hbc : G.Adj b c) (hca : G.Adj c a) : False := by
  let a' : S := ⟨a, ha⟩
  let b' : S := ⟨b, hb⟩
  let c' : S := ⟨c, hc⟩
  let w : (G.induce S).Walk a' a' :=
    Walk.cons (show (G.induce S).Adj a' b' from hab)
      (Walk.cons (show (G.induce S).Adj b' c' from hbc)
        (Walk.cons (show (G.induce S).Adj c' a' from hca) Walk.nil))
  have hcyc : w.IsCycle := by
    have hab_ne : a' ≠ b' := fun h => hab.ne (congrArg Subtype.val h)
    have hbc_ne : b' ≠ c' := fun h => hbc.ne (congrArg Subtype.val h)
    have hca_ne : c' ≠ a' := fun h => hca.ne (congrArg Subtype.val h)
    simp only [w, Walk.isCycle_def, Walk.isTrail_def, Walk.edges_cons, Walk.edges_nil,
      List.nodup_cons, List.mem_cons, List.mem_nil_iff, or_false, not_or, ne_eq,
      Sym2.eq_iff, reduceCtorEq, not_false_eq_true, Walk.support_cons, Walk.support_nil,
      List.tail_cons, List.nodup_nil, and_true, true_and]
    simp_all
    exact ⟨fun h => hca_ne h.symm, fun h => hab_ne h.symm⟩
  exact hT.isAcyclic w hcyc

private lemma isTree_no_4cycle {β : Type*} {G : SimpleGraph β} {S : Set β}
    (hT : (G.induce S).IsTree) {a b c d : β}
    (ha : a ∈ S) (hb : b ∈ S) (hc : c ∈ S) (hd : d ∈ S)
    (hac : a ≠ c) (hbd : b ≠ d)
    (hab : G.Adj a b) (hbc : G.Adj b c) (hcd : G.Adj c d) (hda : G.Adj d a) : False := by
  let a' : S := ⟨a, ha⟩
  let b' : S := ⟨b, hb⟩
  let c' : S := ⟨c, hc⟩
  let d' : S := ⟨d, hd⟩
  let w : (G.induce S).Walk a' a' :=
    Walk.cons (show (G.induce S).Adj a' b' from hab)
      (Walk.cons (show (G.induce S).Adj b' c' from hbc)
        (Walk.cons (show (G.induce S).Adj c' d' from hcd)
          (Walk.cons (show (G.induce S).Adj d' a' from hda) Walk.nil)))
  have hcyc : w.IsCycle := by
    have hab_ne : a' ≠ b' := fun h => hab.ne (congrArg Subtype.val h)
    have hbc_ne : b' ≠ c' := fun h => hbc.ne (congrArg Subtype.val h)
    have hcd_ne : c' ≠ d' := fun h => hcd.ne (congrArg Subtype.val h)
    have hda_ne : d' ≠ a' := fun h => hda.ne (congrArg Subtype.val h)
    have hac_ne : a' ≠ c' := fun h => hac (congrArg Subtype.val h)
    have hbd_ne : b' ≠ d' := fun h => hbd (congrArg Subtype.val h)
    simp only [w, Walk.isCycle_def, Walk.isTrail_def, Walk.edges_cons, Walk.edges_nil,
      List.nodup_cons, List.mem_cons, List.mem_nil_iff, or_false, not_or, ne_eq,
      Sym2.eq_iff, reduceCtorEq, not_false_eq_true, Walk.support_cons, Walk.support_nil,
      List.tail_cons, List.nodup_nil, and_true, true_and]
    simp_all
    exact ⟨fun h => hac_ne h.symm, fun h => hab_ne h.symm, fun h => hac_ne h.symm⟩
  exact hT.isAcyclic w hcyc

private lemma three_distinct_of_two_lt_card {β : Type*} [DecidableEq β] {S : Finset β}
    (h : 2 < S.card) : ∃ a ∈ S, ∃ b ∈ S, ∃ c ∈ S, a ≠ b ∧ a ≠ c ∧ b ≠ c := by
  have h0 : 0 < S.card := by omega
  obtain ⟨a, ha⟩ := Finset.card_pos.mp h0
  have h1 : 1 < (S.erase a).card := by rw [Finset.card_erase_of_mem ha]; omega
  have h1pos : 0 < (S.erase a).card := by omega
  obtain ⟨b, hb⟩ := Finset.card_pos.mp h1pos
  have h2 : 0 < ((S.erase a).erase b).card := by rw [Finset.card_erase_of_mem hb]; omega
  obtain ⟨c, hc⟩ := Finset.card_pos.mp h2
  refine ⟨a, ha, b, (Finset.mem_erase.mp hb).2, c, (Finset.mem_erase.mp (Finset.mem_erase.mp hc).2).2,
    (Finset.mem_erase.mp hb).1.symm, (Finset.mem_erase.mp (Finset.mem_erase.mp hc).2).1.symm,
    (Finset.mem_erase.mp hc).1.symm⟩

private lemma two_distinct_of_one_lt_card {β : Type*} [DecidableEq β] {S : Finset β}
    (h : 1 < S.card) : ∃ a ∈ S, ∃ b ∈ S, a ≠ b := by
  have h0 : 0 < S.card := by omega
  obtain ⟨a, ha⟩ := Finset.card_pos.mp h0
  have h1 : 0 < (S.erase a).card := by rw [Finset.card_erase_of_mem ha]; omega
  obtain ⟨b, hb⟩ := Finset.card_pos.mp h1
  exact ⟨a, ha, b, (Finset.mem_erase.mp hb).2, (Finset.mem_erase.mp hb).1.symm⟩

private lemma g19_tree_card_le (S : Finset (ULift.{u_1} (Fin 19)))
    (hT : ((G19.{u_1}).induce (S : Set (ULift.{u_1} (Fin 19)))).IsTree) :
    S.card ≤ 5 := by
  classical
  let S0 := S.filter fun x => layer19 x.down = 0
  let S1 := S.filter fun x => layer19 x.down = 1
  let S2 := S.filter fun x => layer19 x.down = 2
  let S3 := S.filter fun x => layer19 x.down = 3
  let S4 := S.filter fun x => layer19 x.down = 4
  have hS_split : S.card = S0.card + S1.card + S2.card + S3.card + S4.card := by
    have hlayer : ∀ x : ULift.{u_1} (Fin 19),
        layer19 x.down = 0 ∨ layer19 x.down = 1 ∨ layer19 x.down = 2 ∨
        layer19 x.down = 3 ∨ layer19 x.down = 4 := by
      intro ⟨i⟩
      simp only [layer19]
      split_ifs <;> omega
    have hpart : S = S0 ∪ S1 ∪ S2 ∪ S3 ∪ S4 := by
      ext x
      simp only [Finset.mem_union, Finset.mem_filter, S0, S1, S2, S3, S4]
      constructor
      · intro hx
        rcases hlayer x with h | h | h | h | h
        · exact Or.inl (Or.inl (Or.inl (Or.inl ⟨hx, h⟩)))
        · exact Or.inl (Or.inl (Or.inl (Or.inr ⟨hx, h⟩)))
        · exact Or.inl (Or.inl (Or.inr ⟨hx, h⟩))
        · exact Or.inl (Or.inr ⟨hx, h⟩)
        · exact Or.inr ⟨hx, h⟩
      · intro hx
        rcases hx with (((⟨hx, _⟩ | ⟨hx, _⟩) | ⟨hx, _⟩) | ⟨hx, _⟩) | ⟨hx, _⟩ <;> exact hx
    have hd01 : Disjoint S0 S1 := Finset.disjoint_filter.mpr fun _ _ h0 h1 => by omega
    have hd012 : Disjoint (S0 ∪ S1) S2 := Finset.disjoint_union_left.mpr
      ⟨Finset.disjoint_filter.mpr fun _ _ h0 h2 => by omega,
       Finset.disjoint_filter.mpr fun _ _ h1 h2 => by omega⟩
    have hd0123 : Disjoint (S0 ∪ S1 ∪ S2) S3 := Finset.disjoint_union_left.mpr
      ⟨Finset.disjoint_union_left.mpr
        ⟨Finset.disjoint_filter.mpr fun _ _ h0 h3 => by omega,
         Finset.disjoint_filter.mpr fun _ _ h1 h3 => by omega⟩,
       Finset.disjoint_filter.mpr fun _ _ h2 h3 => by omega⟩
    have hd01234 : Disjoint (S0 ∪ S1 ∪ S2 ∪ S3) S4 := Finset.disjoint_union_left.mpr
      ⟨Finset.disjoint_union_left.mpr
        ⟨Finset.disjoint_union_left.mpr
          ⟨Finset.disjoint_filter.mpr fun _ _ h0 h4 => by omega,
           Finset.disjoint_filter.mpr fun _ _ h1 h4 => by omega⟩,
         Finset.disjoint_filter.mpr fun _ _ h2 h4 => by omega⟩,
       Finset.disjoint_filter.mpr fun _ _ h3 h4 => by omega⟩
    rw [hpart, Finset.card_union_of_disjoint hd01234, Finset.card_union_of_disjoint hd0123,
      Finset.card_union_of_disjoint hd012, Finset.card_union_of_disjoint hd01]
  have hS0_le : S0.card ≤ 2 := by
    by_contra hgt
    obtain ⟨a, ha, b, hb, c, hc, hab, hac, hbc⟩ := three_distinct_of_two_lt_card (S := S0) (by omega)
    obtain ⟨haS, ha0⟩ := Finset.mem_filter.mp ha
    obtain ⟨hbS, hb0⟩ := Finset.mem_filter.mp hb
    obtain ⟨hcS, hc0⟩ := Finset.mem_filter.mp hc
    exact isTree_no_triangle hT haS hbS hcS
      ⟨fun h => hab (congrArg ULift.up h), Or.inl ⟨ha0, hb0⟩⟩
      ⟨fun h => hbc (congrArg ULift.up h), Or.inl ⟨hb0, hc0⟩⟩
      ⟨fun h => hac.symm (congrArg ULift.up h), Or.inl ⟨hc0, ha0⟩⟩
  have hS4_le : S4.card ≤ 2 := by
    by_contra hgt
    obtain ⟨a, ha, b, hb, c, hc, hab, hac, hbc⟩ := three_distinct_of_two_lt_card (S := S4) (by omega)
    obtain ⟨haS, ha4⟩ := Finset.mem_filter.mp ha
    obtain ⟨hbS, hb4⟩ := Finset.mem_filter.mp hb
    obtain ⟨hcS, hc4⟩ := Finset.mem_filter.mp hc
    exact isTree_no_triangle hT haS hbS hcS
      ⟨fun h => hab (congrArg ULift.up h), Or.inr (Or.inl ⟨ha4, hb4⟩)⟩
      ⟨fun h => hbc (congrArg ULift.up h), Or.inr (Or.inl ⟨hb4, hc4⟩)⟩
      ⟨fun h => hac.symm (congrArg ULift.up h), Or.inr (Or.inl ⟨hc4, ha4⟩)⟩
  have hS1_sub : S1 ⊆ ({v19.{u_1} 7, v19.{u_1} 8} : Finset (ULift.{u_1} (Fin 19))) := by
    intro ⟨i⟩ hx
    have h1 := (Finset.mem_filter.mp hx).2
    have hi : i.val = 7 ∨ i.val = 8 := by
      dsimp only [layer19] at h1
      split_ifs at h1 <;> omega
    rcases hi with h7 | h8
    · exact Finset.mem_insert.mpr (Or.inl (congrArg ULift.up (Fin.ext h7)))
    · exact Finset.mem_insert_of_mem (Finset.mem_singleton.mpr (congrArg ULift.up (Fin.ext h8)))
  have hS2_sub : S2 ⊆ ({v19.{u_1} 9} : Finset (ULift.{u_1} (Fin 19))) := by
    intro ⟨i⟩ hx
    have h2 := (Finset.mem_filter.mp hx).2
    have hi : i.val = 9 := by
      dsimp only [layer19] at h2
      split_ifs at h2 <;> omega
    exact Finset.mem_singleton.mpr (congrArg ULift.up (Fin.ext hi))
  have hS3_sub : S3 ⊆ ({v19.{u_1} 10, v19.{u_1} 11} : Finset (ULift.{u_1} (Fin 19))) := by
    intro ⟨i⟩ hx
    have h3 := (Finset.mem_filter.mp hx).2
    have hi : i.val = 10 ∨ i.val = 11 := by
      dsimp only [layer19] at h3
      split_ifs at h3 <;> omega
    rcases hi with h10 | h11
    · exact Finset.mem_insert.mpr (Or.inl (congrArg ULift.up (Fin.ext h10)))
    · exact Finset.mem_insert_of_mem (Finset.mem_singleton.mpr (congrArg ULift.up (Fin.ext h11)))
  have hS1_le : S1.card ≤ 2 := le_trans (Finset.card_le_card hS1_sub) Finset.card_le_two
  have hS2_le : S2.card ≤ 1 := by simpa using Finset.card_le_card hS2_sub
  have hS3_le : S3.card ≤ 2 := le_trans (Finset.card_le_card hS3_sub) Finset.card_le_two
  by_cases h9 : v19.{u_1} 9 ∈ S
  · have h01 : S0.card + S1.card ≤ 2 := by
      by_contra hgt
      rcases Nat.lt_or_ge 1 S0.card with h0_gt | h0_le1
      · obtain ⟨a, ha, b, hb, hab⟩ := two_distinct_of_one_lt_card (S := S0) h0_gt
        have hS1_pos : 0 < S1.card := by omega
        obtain ⟨c, hc⟩ := Finset.card_pos.mp hS1_pos
        obtain ⟨haS, ha0⟩ := Finset.mem_filter.mp ha
        obtain ⟨hbS, hb0⟩ := Finset.mem_filter.mp hb
        obtain ⟨hcS, hc1⟩ := Finset.mem_filter.mp hc
        have hac : a.down ≠ c.down := fun h => by
          have := congrArg layer19 h; omega
        have hbc : b.down ≠ c.down := fun h => by
          have := congrArg layer19 h; omega
        exact isTree_no_triangle hT haS hbS hcS
          ⟨fun h => hab (congrArg ULift.up h), Or.inl ⟨ha0, hb0⟩⟩
          ⟨hbc, Or.inr (Or.inr (by omega))⟩
          ⟨hac.symm, Or.inr (Or.inr (by omega))⟩
      · have hS0_eq : S0.card = 1 := by omega
        have hS1_eq : S1.card = 2 := by omega
        have h1eq : S1 = {v19.{u_1} 7, v19.{u_1} 8} := by
          refine Finset.eq_of_subset_of_card_le hS1_sub ?_
          have hpair : ({v19.{u_1} 7, v19.{u_1} 8} : Finset (ULift.{u_1} (Fin 19))).card = 2 :=
            Finset.card_pair (by simp [v19])
          omega
        have hS0_pos : 0 < S0.card := by omega
        obtain ⟨a, ha⟩ := Finset.card_pos.mp hS0_pos
        obtain ⟨haS, ha0⟩ := Finset.mem_filter.mp ha
        have h7S : v19.{u_1} 7 ∈ S :=
          (Finset.mem_filter.mp (h1eq ▸ Finset.mem_insert_self (v19.{u_1} 7) {v19.{u_1} 8})).1
        have h8S : v19.{u_1} 8 ∈ S :=
          (Finset.mem_filter.mp (h1eq ▸ Finset.mem_insert_of_mem (Finset.mem_singleton_self (v19.{u_1} 8)))).1
        have hl7 : layer19 (7 : Fin 19) = 1 := by decide
        have hl8 : layer19 (8 : Fin 19) = 1 := by decide
        have hl9 : layer19 (9 : Fin 19) = 2 := by decide
        have ha9 : a ≠ v19.{u_1} 9 := fun h => by
          have hl := congrArg (fun z : ULift.{u_1} (Fin 19) => layer19 z.down) h
          dsimp only [v19] at hl
          rw [ha0, hl9] at hl
          omega
        have h78 : (v19.{u_1} 7) ≠ v19.{u_1} 8 := by simp [v19]
        have ha7 : a.down ≠ (7 : Fin 19) := fun h => by
          have hl := congrArg layer19 h
          rw [ha0, hl7] at hl
          omega
        have ha8 : a.down ≠ (8 : Fin 19) := fun h => by
          have hl := congrArg layer19 h
          rw [ha0, hl8] at hl
          omega
        exact isTree_no_4cycle hT haS h7S h9 h8S ha9 h78
          ⟨ha7, Or.inr (Or.inr (by dsimp only [v19]; rw [ha0, hl7]; rfl))⟩
          ⟨by decide, Or.inr (Or.inr (by dsimp only [v19]; rw [hl7, hl9]; rfl))⟩
          ⟨by decide, Or.inr (Or.inr (by dsimp only [v19]; rw [hl9, hl8]; rfl))⟩
          ⟨ha8.symm, Or.inr (Or.inr (by dsimp only [v19]; rw [hl8, ha0]; rfl))⟩
    have h34 : S3.card + S4.card ≤ 2 := by
      by_contra hgt
      rcases Nat.lt_or_ge 1 S4.card with h4_gt | h4_le1
      · obtain ⟨a, ha, b, hb, hab⟩ := two_distinct_of_one_lt_card (S := S4) h4_gt
        have hS3_pos : 0 < S3.card := by omega
        obtain ⟨c, hc⟩ := Finset.card_pos.mp hS3_pos
        obtain ⟨haS, ha4⟩ := Finset.mem_filter.mp ha
        obtain ⟨hbS, hb4⟩ := Finset.mem_filter.mp hb
        obtain ⟨hcS, hc3⟩ := Finset.mem_filter.mp hc
        have hac : a.down ≠ c.down := fun h => by
          have := congrArg layer19 h; omega
        have hbc : b.down ≠ c.down := fun h => by
          have := congrArg layer19 h; omega
        exact isTree_no_triangle hT haS hbS hcS
          ⟨fun h => hab (congrArg ULift.up h), Or.inr (Or.inl ⟨ha4, hb4⟩)⟩
          ⟨hbc, Or.inr (Or.inr (by omega))⟩
          ⟨hac.symm, Or.inr (Or.inr (by omega))⟩
      · have hS4_eq : S4.card = 1 := by omega
        have hS3_eq : S3.card = 2 := by omega
        have h3eq : S3 = {v19.{u_1} 10, v19.{u_1} 11} := by
          refine Finset.eq_of_subset_of_card_le hS3_sub ?_
          have hpair : ({v19.{u_1} 10, v19.{u_1} 11} : Finset (ULift.{u_1} (Fin 19))).card = 2 :=
            Finset.card_pair (by simp [v19])
          omega
        have hS4_pos : 0 < S4.card := by omega
        obtain ⟨a, ha⟩ := Finset.card_pos.mp hS4_pos
        obtain ⟨haS, ha4⟩ := Finset.mem_filter.mp ha
        have h10S : v19.{u_1} 10 ∈ S :=
          (Finset.mem_filter.mp (h3eq ▸ Finset.mem_insert_self (v19.{u_1} 10) {v19.{u_1} 11})).1
        have h11S : v19.{u_1} 11 ∈ S :=
          (Finset.mem_filter.mp (h3eq ▸ Finset.mem_insert_of_mem (Finset.mem_singleton_self (v19.{u_1} 11)))).1
        have hl10 : layer19 (10 : Fin 19) = 3 := by decide
        have hl11 : layer19 (11 : Fin 19) = 3 := by decide
        have hl9 : layer19 (9 : Fin 19) = 2 := by decide
        have ha9 : a ≠ v19.{u_1} 9 := fun h => by
          have hl := congrArg (fun z : ULift.{u_1} (Fin 19) => layer19 z.down) h
          dsimp only [v19] at hl
          rw [ha4, hl9] at hl
          omega
        have h1011 : (v19.{u_1} 10) ≠ v19.{u_1} 11 := by simp [v19]
        have ha10 : a.down ≠ (10 : Fin 19) := fun h => by
          have hl := congrArg layer19 h
          rw [ha4, hl10] at hl
          omega
        have ha11 : a.down ≠ (11 : Fin 19) := fun h => by
          have hl := congrArg layer19 h
          rw [ha4, hl11] at hl
          omega
        exact isTree_no_4cycle hT haS h10S h9 h11S ha9 h1011
          ⟨ha10, Or.inr (Or.inr (by dsimp only [v19]; rw [ha4, hl10]; rfl))⟩
          ⟨by decide, Or.inr (Or.inr (by dsimp only [v19]; rw [hl10, hl9]; rfl))⟩
          ⟨by decide, Or.inr (Or.inr (by dsimp only [v19]; rw [hl9, hl11]; rfl))⟩
          ⟨ha11.symm, Or.inr (Or.inr (by dsimp only [v19]; rw [hl11, ha4]; rfl))⟩
    omega
  · have hS2_zero : S2.card = 0 := by
      rw [Finset.card_eq_zero, Finset.eq_empty_iff_forall_notMem]
      intro x hx
      have hmem := hS2_sub hx
      rw [Finset.mem_singleton] at hmem
      exact h9 (hmem ▸ (Finset.mem_filter.mp hx).1)
    have hno_cross : (S0.card + S1.card = 0) ∨ (S3.card + S4.card = 0) := by
      by_contra hboth
      push Not at hboth
      have hleft_pos : 0 < S0.card + S1.card := Nat.pos_of_ne_zero hboth.1
      have hright_pos : 0 < S3.card + S4.card := Nat.pos_of_ne_zero hboth.2
      obtain ⟨x, hxS, hx_lt⟩ : ∃ x ∈ S, layer19 x.down < 2 := by
        rcases Nat.lt_or_ge 0 S0.card with h0 | _
        · obtain ⟨x, hx⟩ := Finset.card_pos.mp h0
          obtain ⟨hxS, hx0⟩ := Finset.mem_filter.mp hx
          exact ⟨x, hxS, by omega⟩
        · have hS1_pos : 0 < S1.card := by omega
          obtain ⟨x, hx⟩ := Finset.card_pos.mp hS1_pos
          obtain ⟨hxS, hx1⟩ := Finset.mem_filter.mp hx
          exact ⟨x, hxS, by omega⟩
      obtain ⟨y, hyS, hy_gt⟩ : ∃ y ∈ S, 2 < layer19 y.down := by
        rcases Nat.lt_or_ge 0 S3.card with h3 | _
        · obtain ⟨y, hy⟩ := Finset.card_pos.mp h3
          obtain ⟨hyS, hy3⟩ := Finset.mem_filter.mp hy
          exact ⟨y, hyS, by omega⟩
        · have hS4_pos : 0 < S4.card := by omega
          obtain ⟨y, hy⟩ := Finset.card_pos.mp hS4_pos
          obtain ⟨hyS, hy4⟩ := Finset.mem_filter.mp hy
          exact ⟨y, hyS, by omega⟩
      obtain ⟨w⟩ := hT.connected ⟨x, hxS⟩ ⟨y, hyS⟩
      have hstep : ∀ {a b : (S : Set (ULift.{u_1} (Fin 19)))}
          (q : ((G19.{u_1}).induce (S : Set _)).Walk a b),
          layer19 a.1.down < 2 → 2 < layer19 b.1.down → False := by
        intro a b q ha hb
        induction q with
        | nil => omega
        | @cons u1 u2 u3 hadj _ ih =>
          have hu2 : layer19 u2.1.down ≠ 2 := by
            intro hl2
            have hi : u2.1.down = (9 : Fin 19) := by
              dsimp only [layer19] at hl2
              apply Fin.ext
              split_ifs at hl2 <;> omega
            have hu2_eq : u2.1 = v19.{u_1} 9 := ULift.down_injective hi
            exact h9 (hu2_eq ▸ u2.2)
          have hdiff : Int.natAbs (layer19 u1.1.down - layer19 u2.1.down) ≤ 1 := g19Adj_diff_le hadj
          by_cases hu2_lt : layer19 u2.1.down < 2
          · exact ih hu2_lt hb
          · omega
      exact hstep w hx_lt hy_gt
    rcases hno_cross with h01 | h34
    · omega
    · omega

private lemma g19_largestInducedTreeSize_le :
    largestInducedTreeSize (G19.{u_1}) ≤ 5 := by
  unfold largestInducedTreeSize
  have hnil_eq : (Walk.nil : (G19.{u_1}).Walk (v19.{u_1} 9) (v19.{u_1} 9)).support.toFinset =
      ({v19.{u_1} 9} : Finset (ULift.{u_1} (Fin 19))) := by simp
  have hnil_tree : ((G19.{u_1}).induce (({v19.{u_1} 9} : Finset (ULift.{u_1} (Fin 19))) : Set _)).IsTree := by
    rw [← hnil_eq]
    exact Walk.induce_support_isTree_of_length_eq_dist Walk.nil (by simp)
  have hne : ({n : ℕ | ∃ s : Finset (ULift.{u_1} (Fin 19)),
      s.card = n ∧ ((G19.{u_1}).induce (s : Set _)).IsTree}).Nonempty :=
    ⟨1, {v19.{u_1} 9}, rfl, hnil_tree⟩
  apply csSup_le hne
  rintro m ⟨S, rfl, hT⟩
  exact g19_tree_card_le S hT

/--
Disproof of WOWII Conjecture 72 via a 19-vertex layer-clique counterexample `G19`:
- Layers `L0` (size 7, clique), `L1` (size 2), `L2` (size 1), `L3` (size 2), `L4` (size 7, clique),
  with complete bipartite edges between adjacent layers.
- `averageEccentricity G19 ≥ 70 / 19`, `max_v λ(v) ≥ 4` (at `L2`), so
  `⌈averageEccentricity G19 + maxL / 3⌉ ≥ ⌈70 / 19 + 4 / 3⌉ = 6`,
- whereas every induced subtree of `G19` has at most `5` vertices.
-/
theorem not_conjecture72 :
    ¬ (∀ {α : Type u_1} [Fintype α] [DecidableEq α] [Nontrivial α]
      (G : SimpleGraph α) (_h : G.Connected),
      let maxL := (Finset.univ.image (fun v => indepNeighborsCard G v)).max' (by simp)
      ⌈averageEccentricity G + (maxL : ℝ) / 3⌉ ≤ (largestInducedTreeSize G : ℝ)) := by
  intro hconj
  have hIneq := hconj (G19.{u_1}) G19_conn
  dsimp only at hIneq
  have hecc : (70 : ℝ) / 19 ≤ averageEccentricity (G19.{u_1}) := g19_avg_ecc_lower
  have hmaxL : (4 : ℝ) ≤ ((Finset.univ.image (fun v => indepNeighborsCard (G19.{u_1}) v)).max' (by simp) : ℝ) := by
    exact_mod_cast g19_maxL_lower
  have htree : (largestInducedTreeSize (G19.{u_1}) : ℝ) ≤ 5 := by
    exact_mod_cast g19_largestInducedTreeSize_le
  have hsum : (5 : ℝ) < averageEccentricity (G19.{u_1}) +
      ((Finset.univ.image (fun v => indepNeighborsCard (G19.{u_1}) v)).max' (by simp) : ℝ) / 3 := by
    linarith
  have hceil : (6 : ℝ) ≤
      (⌈averageEccentricity (G19.{u_1}) +
        ((Finset.univ.image (fun v => indepNeighborsCard (G19.{u_1}) v)).max' (by simp) : ℝ) / 3⌉ : ℝ) := by
    have hlt : (5 : ℤ) <
        ⌈averageEccentricity (G19.{u_1}) +
          ((Finset.univ.image (fun v => indepNeighborsCard (G19.{u_1}) v)).max' (by simp) : ℝ) / 3⌉ :=
      Int.lt_ceil.mpr (by exact_mod_cast hsum)
    have hge : (6 : ℤ) ≤
        ⌈averageEccentricity (G19.{u_1}) +
          ((Finset.univ.image (fun v => indepNeighborsCard (G19.{u_1}) v)).max' (by simp) : ℝ) / 3⌉ := by
      omega
    exact_mod_cast hge
  linarith

-- Sanity checks

/-- The `largestInducedTreeSize` is nonneg. -/
@[category test, AMS 5]
example (G : SimpleGraph (Fin 3)) : 0 ≤ largestInducedTreeSize G := Nat.zero_le _

/-- The average eccentricity is nonneg. -/
@[category test, AMS 5]
example (G : SimpleGraph (Fin 3)) : 0 ≤ averageEccentricity G := by
  unfold averageEccentricity
  positivity

end WrittenOnTheWallII.GraphConjecture72