Lean / Reader
Lean reader

FullCutTest.lean

37 lines1 declarationsno sorryimports StrippedPaths

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

  1. import StrippedPaths
  2. open SimpleGraph SimpleGraph.Walk
  3. namespace TerminalCycles.RootedBlock
  4. universe u
  5. variable {V W : Type u}
  6. /-- The two-copy sum test and an individual dyadic path in every cut side,
  7. with exactly the degree and order data supplied by the published structural theorem. -/
  8. theorem full_cut_test [Finite V] [Finite W] (H : SimpleGraph V) (G : SimpleGraph W)
  9. (f : H ↪g G) {s t : V} {c : W} (ne : s ≠ t)
  10. (outside : ∀ v, f v ≠ c) (cs : G.Adj c (f s)) (ct : G.Adj c (f t))
  11. (ds : 2 ≤ valence H s) (dt : 2 ≤ valence H t)
  12. (ordinary : ∀ v, v ≠ s → v ≠ t → 3 ≤ valence H v) (balanced : Nat.card W=2*Nat.card V+1)
  13. (absent : ¬ hasPowerCycle G) (minimal : smaller_graphs_have_cycle G) :
  14. sumTests (lengths H s t) ∧ (∃ i ≥ 2, ∃ p : H.Walk s t, p.IsPath ∧ p.length=2^i) ∧
  15. (∀ n ∈ lengths H s t, ∀ k ≥ 2, n+2 ≠ 2^k) ∧
  16. (∃ (v : V) (w : H.Walk v v), w.IsCycle ∧ w.length % 2=1) := by
  17. have no : ¬ hasPowerCycle H := by
  18. rintro ⟨k,v,p,hk,hp,len⟩
  19. exact absent ⟨k,_,p.map f.toHom,hk,hp.map (f:=f.toHom) f.injective,by simpa using len⟩
  20. have avoid : ∀ n ∈ lengths H s t, ∀ k ≥ 2, n+2 ≠ 2^k := by
  21. rintro n ⟨p,hp,rfl⟩
  22. exact forbidden_plus_two f ne outside cs ct absent p hp
  23. have disj : ∀ v, H.Adj v s → H.Adj v t → False := by
  24. intro v vs vt
  25. let p : H.Walk s t := cons vs.symm (cons vt nil)
  26. have hp : p.IsPath := by simp [p,cons_isPath_iff,vs.ne.symm,ne,vt.ne]
  27. exact avoid _ ⟨p,hp,rfl⟩ 2 (by decide) rfl
  28. have tests := cut_sum_tests H G ne ds dt disj ordinary (by omega) no minimal
  29. refine ⟨tests,?_,avoid,odd_cycle_of_sum_tests tests⟩
  30. by_cases e : H.Adj s t
  31. · exact adjacent_dyadic H G e ds dt disj ordinary (by omega) no minimal
  32. · exact (two_terminal_lengths H G ne e ds dt ordinary (by omega) (by omega) no minimal).1
  33. #print axioms full_cut_test
  34. end TerminalCycles.RootedBlock