Lean / Reader
Lean readerFullCutTest.lean
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.
import StrippedPathsopen SimpleGraph SimpleGraph.Walknamespace TerminalCycles.RootedBlockuniverse uvariable {V W : Type u}/-- The two-copy sum test and an individual dyadic path in every cut side,with exactly the degree and order data supplied by the published structural theorem. -/theorem full_cut_test [Finite V] [Finite W] (H : SimpleGraph V) (G : SimpleGraph W)(f : H ↪g G) {s t : V} {c : W} (ne : s ≠ t)(outside : ∀ v, f v ≠ c) (cs : G.Adj c (f s)) (ct : G.Adj c (f t))(ds : 2 ≤ valence H s) (dt : 2 ≤ valence H t)(ordinary : ∀ v, v ≠ s → v ≠ t → 3 ≤ valence H v) (balanced : Nat.card W=2*Nat.card V+1)(absent : ¬ hasPowerCycle G) (minimal : smaller_graphs_have_cycle G) :sumTests (lengths H s t) ∧ (∃ i ≥ 2, ∃ p : H.Walk s t, p.IsPath ∧ p.length=2^i) ∧(∀ n ∈ lengths H s t, ∀ k ≥ 2, n+2 ≠ 2^k) ∧(∃ (v : V) (w : H.Walk v v), w.IsCycle ∧ w.length % 2=1) := byhave no : ¬ hasPowerCycle H := byrintro ⟨k,v,p,hk,hp,len⟩exact absent ⟨k,_,p.map f.toHom,hk,hp.map (f:=f.toHom) f.injective,by simpa using len⟩have avoid : ∀ n ∈ lengths H s t, ∀ k ≥ 2, n+2 ≠ 2^k := byrintro n ⟨p,hp,rfl⟩exact forbidden_plus_two f ne outside cs ct absent p hphave disj : ∀ v, H.Adj v s → H.Adj v t → False := byintro v vs vtlet p : H.Walk s t := cons vs.symm (cons vt nil)have hp : p.IsPath := by simp [p,cons_isPath_iff,vs.ne.symm,ne,vt.ne]exact avoid _ ⟨p,hp,rfl⟩ 2 (by decide) rflhave tests := cut_sum_tests H G ne ds dt disj ordinary (by omega) no minimalrefine ⟨tests,?_,avoid,odd_cycle_of_sum_tests tests⟩by_cases e : H.Adj s t· exact adjacent_dyadic H G e ds dt disj ordinary (by omega) no minimal· exact (two_terminal_lengths H G ne e ds dt ordinary (by omega) (by omega) no minimal).1#print axioms full_cut_testend TerminalCycles.RootedBlock