Exact Lean source
Nonadditivity.HaarPathDecomposition
Download original .lean · View on GitHub · Jump to source
Direct imports
Imported by project modules
3 direct reverse imports
Relationships above come from literal import commands. The declarations below link to types and references extracted from Lean’s environment. Source text is complete and unchanged.
Declarations in this module
12 project constants, including generated, internal and private declarations.
12 declarations
Nonadditivity.HaarPathGraph.Path.StepNonadditivity.HaarPathGraph.Path.exists_chain_decompositionNonadditivity.HaarPathGraph.Path.exists_chain_decomposition._proof_1_1internal/detail/privateNonadditivity.HaarPathGraph.Path.exists_initial_chainNonadditivity.HaarPathGraph.Path.exists_traversal_chain_decompositionNonadditivity.HaarPathGraph.Path.exists_traversal_chain_decomposition._proof_1_1internal/detail/privateNonadditivity.HaarPathGraph.Path.exists_traversal_chain_decomposition._proof_1_3internal/detail/privateNonadditivity.HaarPathGraph.Path.exists_traversal_chain_decomposition._proof_1_4internal/detail/privateNonadditivity.HaarPathGraph.Path.traversalListNonadditivity.HaarPathGraph.Path.traversalList.eq_1internal/detail/privateNonadditivity.HaarPathGraph.Path.traversalList_lengthNonadditivity.HaarPathGraph.Path.traversalList_step
Full module
1/-2Copyright (c) 2026 the Nonadditivity project contributors.3All rights reserved. See COPYRIGHT.md for licensing and attribution.4-/56import Nonadditivity.HaarPathChains78/-! # Actual decomposition into degree-two core chains -/9noncomputable section10namespace Nonadditivity.HaarPathGraph.Path11variable {V : Type*} [DecidableEq V] {d m : ℕ} (P : Path V d m)1213def Step (a b : Dart V d) : Prop := source (reverse a)=source b ∧ b ≠ reverse a1415/-- Stop at the first core vertex. The returned suffix begins at a core16vertex whenever it is nonempty. -/17theorem exists_initial_chain (a : Dart V d) (l : List (Dart V d))18(hmem : ∀ q ∈ a::l, q ∈ P.darts) (hstep : (a::l).IsChain Step)19(hend : source (reverse ((a::l).getLast (by simp))) ∈ P.coreVertices) :20∃ t s, l=t++s ∧ P.ToCore (a::t) ∧21∀ b r, s=b::r → source b ∈ P.coreVertices := by22induction l generalizing a with23| nil =>24refine ⟨[],[],rfl,ToCore.last a (hmem a (by simp)) (by simpa using hend),?_⟩25intro b r he26cases he27| cons b l ih =>28have hpair := (List.isChain_cons_cons.mp hstep).129have htail := (List.isChain_cons_cons.mp hstep).230by_cases hc : source (reverse a) ∈ P.coreVertices31· refine ⟨[],b::l,rfl,ToCore.last a (hmem a (by simp)) hc,?_⟩32intro c r he33have hbc : b=c := (List.cons.inj he).134rw [←hbc,←hpair.1]35exact hc36· obtain ⟨t,s,he,ht,hs⟩ := ih b37(fun q hq => hmem q (List.mem_cons_of_mem a hq))38htail (by simpa using hend)39refine ⟨b::t,s,?_,ToCore.cons a b t (hmem a (by simp)) hc hpair.1 hpair.2 ht,hs⟩40simp [he]4142/-- Any reduced graph walk with endpoints at core vertices is a concatenation43of the actual first-hit chains. No decomposition hypothesis is supplied. -/44theorem exists_chain_decomposition (l : List (Dart V d)) (hne : l ≠ [])45(hmem : ∀ q ∈ l, q ∈ P.darts) (hstep : l.IsChain Step)46(hstart : source (l.head hne) ∈ P.coreVertices)47(hend : source (reverse (l.getLast hne)) ∈ P.coreVertices) :48∃ cs : List P.CoreChain, (cs.map Subtype.val).flatten = l := by49induction hn : l.length using Nat.strong_induction_on generalizing l with50| h n ih =>51cases l with52| nil => exact (hne rfl).elim53| cons a l =>54obtain ⟨t,s,he,ht,hs⟩ := P.exists_initial_chain a l hmem hstep hend55let c : P.CoreChain := ⟨a::t,ht,⟨a,t,rfl,by simpa using hstart⟩⟩56have hefull : a::l=(a::t)++s := by simp [he]57by_cases hsn : s=[]58· refine ⟨[c],?_⟩59change (a::t)++[]=a::l60rw [List.append_nil]61simpa only [hsn,List.append_nil] using hefull.symm62· have hslen : s.length < n := by63rw [←hn,hefull,List.length_append,List.length_cons]64omega65have hsmem : ∀ q ∈ s, q ∈ P.darts := by66intro q hq67apply hmem q68rw [hefull]69exact List.mem_append_right _ hq70have hsstep : s.IsChain Step := by71rw [hefull] at hstep72exact hstep.right_of_append73have hsstart : source (s.head hsn) ∈ P.coreVertices :=74hs _ _ (List.cons_head_tail hsn).symm75have hsend : source (reverse (s.getLast hsn)) ∈ P.coreVertices := by76simpa only [hefull,List.getLast_append_of_ne_nil _ hsn] using hend77obtain ⟨cs,hcs⟩ := ih s.length hslen s hsn hsmem hsstep hsstart hsend rfl78refine ⟨c::cs,?_⟩79change (a::t)++(cs.map Subtype.val).flatten=a::l80rw [hcs]81exact hefull.symm8283/-- The literal oriented dart sequence of the original path. -/84def traversalList : List (Dart V d) := List.ofFn P.traversal8586omit [DecidableEq V] in87@[simp] theorem traversalList_length : P.traversalList.length=m := by simp [traversalList]8889omit [DecidableEq V] in90theorem traversalList_step : P.traversalList.IsChain Step := by91apply List.isChain_iff_getElem.mpr92intro i hi93have hi' : i+1<m := by simpa [traversalList] using hi94simp only [traversalList,List.getElem_ofFn]95constructor96· simp only [traversal,source_reverse_dart,source_dart]97rfl98· intro h99have hc := congrArg color h100simp only [traversal,color_dart,color_reverse_dart] at hc101exact P.reduced _ _ rfl hc102103/-- The original nonempty reduced path, with no extra graph hypotheses,104admits a successive core-chain occurrence list. -/105theorem exists_traversal_chain_decomposition (hm : 0 < m) :106∃ cs : List P.CoreChain, (cs.map Subtype.val).flatten=P.traversalList := by107have hne : P.traversalList ≠ [] := by108intro he109have h := congrArg List.length he110simp only [traversalList_length,List.length_nil] at h111omega112have hroot : P.vertex 0 ∈ P.coreVertices :=113Finset.mem_filter.mpr ⟨P.start_mem ⟨0,hm⟩,Or.inl rfl⟩114apply P.exists_chain_decomposition P.traversalList hne115· intro q hq116obtain ⟨i,rfl⟩ := List.mem_ofFn.mp hq117exact P.traversal_mem i118· exact P.traversalList_step119· simpa [traversalList,List.head_ofFn,traversal] using hroot120· have hlast : (⟨m-1,Nat.sub_one_lt (by omega)⟩ : Fin m).succ=Fin.last m := by121apply Fin.ext122simp only [Fin.val_succ,Fin.val_last]123omega124simpa [traversalList,List.getLast_ofFn,traversal,hlast,P.closed] using hroot125126end Nonadditivity.HaarPathGraph.Path