Lean / Reader
Lean reader

CutVertex.lean

96 lines6 declarationsno sorryimports CompetitorDegrees

Lean 4 Web has Mathlib, so it can check files that import only Mathlib. This one also imports CompetitorDegrees, which it does not have: you can read it there, but it will not check. Build the project itself to check it.

  1. import CompetitorDegrees
  2. open SimpleGraph SimpleGraph.Walk
  3. open scoped Sym2
  4. namespace TerminalCycles
  5. universe u
  6. variable {V W : Type u}
  7. /-- The full open problem, with the finiteness, adjacency-decision and minimum
  8. degree conventions in FormalConjectures/ErdosProblems/64.lean. -/
  9. def erdos64Statement : Prop :=
  10. ∀ (T : Type u) (K : SimpleGraph T) [Fintype T] [DecidableRel K.Adj],
  11. K.minDegree ≥ 3 → hasPowerCycle K
  12. /-- Order minimality among nonempty finite graphs, all of whose degrees
  13. are at least three. Lexicographic minimality by order and size implies this. -/
  14. def smaller_graphs_have_cycle (_G : SimpleGraph W) : Prop :=
  15. ∀ (T : Type u) [Finite T] [Nonempty T] (K : SimpleGraph T),
  16. Nat.card T < Nat.card W → (∀ v, 3 ≤ valence K v) → hasPowerCycle K
  17. private theorem absent_below {H : SimpleGraph V} {G : SimpleGraph W} (f : H ↪g G)
  18. (absent : ¬ hasPowerCycle G) : ¬ hasPowerCycle H := by
  19. rintro ⟨k,v,p,hk,c,sz⟩
  20. apply absent
  21. exact ⟨k,f v,p.map f.toHom,hk,c.map f.injective,(length_map _ _).trans sz⟩
  22. /-- Appending the two incidences of c closes every simple terminal path. -/
  23. theorem forbidden_plus_two {H : SimpleGraph V} {G : SimpleGraph W}
  24. (f : H ↪g G) {c : W} {s t : V} (different : s ≠ t)
  25. (outside : ∀ v, f v ≠ c) (cs : G.Adj c (f s)) (ct : G.Adj c (f t))
  26. (absent : ¬ hasPowerCycle G) (p : H.Walk s t) (simple : p.IsPath) :
  27. ∀ k ≥ 2, p.length+2 ≠ 2^k := by
  28. intro k hk he
  29. let q := p.map f.toHom
  30. have fresh : c ∉ q.support := by
  31. intro in_q
  32. change c ∈ (p.map f.toHom).support at in_q
  33. rw [Walk.support_map, List.mem_map] at in_q
  34. obtain ⟨v,_,eq⟩ := in_q
  35. exact outside v eq
  36. have good := map_isPath_of_injective (f:=f.toHom) f.injective simple
  37. have cycle := close_internal q good (fun e => different (f.injective e)) fresh cs ct.symm
  38. apply absent
  39. exact ⟨k,c,_,hk,cycle,by simpa [q,Nat.add_assoc] using he⟩
  40. /-- The nonadjacent-terminal conclusion under the single-side conditions
  41. provided by Ducoffe and Dumitru's Theorem 2.3. -/
  42. theorem cut_side_paths [Finite V] [Finite W] (H : SimpleGraph V) (G : SimpleGraph W)
  43. (f : H ↪g G) (s t : V) (c : W)
  44. (different : s ≠ t) (missing : ¬ H.Adj s t)
  45. (outside : ∀ v, f v ≠ c) (cs : G.Adj c (f s)) (ct : G.Adj c (f t))
  46. (smaller : Nat.card V < Nat.card W)
  47. (ds : 2 ≤ valence H s) (dt : 2 ≤ valence H t)
  48. (rest : ∀ v, v ≠ s → v ≠ t → 3 ≤ valence H v)
  49. (absent : ¬ hasPowerCycle G) (minimal : smaller_graphs_have_cycle G) :
  50. (∃ i ≥ 2, ∃ p : H.Walk s t, p.IsPath ∧ p.length = 2^i) ∧
  51. (∃ j ≥ 2, ∃ p : H.Walk s t, p.IsPath ∧ p.length+1 = 2^j) ∧
  52. (∀ p : H.Walk s t, p.IsPath → ∀ k ≥ 2, p.length+2 ≠ 2^k) := by
  53. classical
  54. letI : Nonempty V := ⟨s⟩
  55. have forbidden := forbidden_plus_two f different outside cs ct absent
  56. have disj : ∀ v, H.Adj v s → H.Adj v t → False := by
  57. intro v vs vt
  58. let p : H.Walk s t := cons vs.symm (cons vt nil)
  59. have simple : p.IsPath := by
  60. simp [p,cons_isPath_iff,vs.ne.symm,different,vt.ne]
  61. exact forbidden p simple 2 (by decide) (by rfl)
  62. have no_old := absent_below f absent
  63. have yes_merged := minimal _ (identify H s t)
  64. (lt_of_le_of_lt (identified_size s t) smaller) (identified_minimum H s t missing disj ds dt rest)
  65. have yes_added := minimal _ (completeEdge H s t) smaller
  66. (completed_minimum H s t different missing ds dt rest)
  67. have no_deleted : ¬ hasPowerCycle ((completeEdge H s t).deleteEdges {s(s,t)}) := by
  68. rwa [delete_completed H s t missing]
  69. obtain ⟨j,hj,proof⟩ := critical_edge_forces_path (completeEdge H s t) s t yes_added no_deleted
  70. rw [delete_completed H s t missing] at proof
  71. exact ⟨identification_forces_dyadic_path H s t different no_old yes_merged, ⟨j,hj,proof⟩, forbidden⟩
  72. /-- Applying the balanced-cut order identity from Theorem 2.3 gives an
  73. ambient bound from the one-less-than-a-power path in `cut_side_paths`. -/
  74. theorem balanced_order_of_dyadic_distance [Finite V] [Finite W]
  75. (H : SimpleGraph V) (s t : V) {i : ℕ} (dyadic : H.dist s t = 2^i)
  76. (balanced : Nat.card W = 2 * Nat.card V + 1)
  77. (path : ∃ j ≥ 2, ∃ p : H.Walk s t, p.IsPath ∧ p.length+1 = 2^j) :
  78. 2 * H.dist s t ≤ Nat.card V ∧ 4 * H.dist s t + 1 ≤ Nat.card W := by
  79. classical
  80. letI := Fintype.ofFinite V
  81. obtain ⟨j,_,p,hp,len⟩ := path
  82. have side := order_of_dyadic_distance dyadic p hp len
  83. rw [← Nat.card_eq_fintype_card] at side
  84. exact ⟨side, by omega⟩
  85. end TerminalCycles