Exact Lean source
Nonadditivity.HaarPathChainPartition
Download original .lean · View on GitHub · Jump to source
Direct imports
Imported by project modules
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
14 project constants, including generated, internal and private declarations.
14 declarations
Nonadditivity.HaarPathGraph.Path.InternalChain.congr_simpNonadditivity.HaarPathGraph.Path.ToCore.congr_simpNonadditivity.HaarPathGraph.Path.coreChain_eq_of_common_dartNonadditivity.HaarPathGraph.Path.coreChain_not_both_orientationsNonadditivity.HaarPathGraph.Path.internalChain_takeNonadditivity.HaarPathGraph.Path.internalChain_take._proof_1_1internal/detail/privateNonadditivity.HaarPathGraph.Path.internalChain_take._proof_1_3internal/detail/privateNonadditivity.HaarPathGraph.Path.reversed_prefix_toCoreNonadditivity.HaarPathGraph.Path.reversed_prefix_toCore._proof_1_1internal/detail/privateNonadditivity.HaarPathGraph.Path.suffix_toCoreNonadditivity.HaarPathGraph.Path.toCore_dropNonadditivity.HaarPathGraph.Path.toCore_memNonadditivity.HaarPathGraph.Path.toCore_nodupNonadditivity.HaarPathGraph.Path.toCore_nodup._proof_1_2internal/detail/private
Full module
1/-2Copyright (c) 2026 the Nonadditivity project contributors.3All rights reserved. See COPYRIGHT.md for licensing and attribution.4-/56import Nonadditivity.HaarPathChainCount78/-! # Core chains partition the oriented incidences they visit -/9noncomputable section10namespace Nonadditivity.HaarPathGraph.Path11variable {V : Type*} [DecidableEq V] {d m : ℕ} (P : Path V d m)1213lemma toCore_drop {l : List (Dart V d)} (h : P.ToCore l) (n : ℕ) (hn : n<l.length) :14P.ToCore (l.drop n) := by15induction h generalizing n with16| last a ha hc =>17have hn0 : n=0 := by simpa using hn18subst n19exact ToCore.last a ha hc20| cons a b l ha hc hj hr ht ih =>21cases n with22| zero => exact ToCore.cons a b l ha hc hj hr ht23| succ n => simpa using ih n (by simpa using hn)2425lemma internalChain_take {l : List (Dart V d)} (h : P.InternalChain l)26(n : ℕ) (hn : 0<n) : P.InternalChain (l.take n) := by27induction h generalizing n with28| single a ha =>29cases n with30| zero => omega31| succ n => simpa using InternalChain.single a ha32| cons a b l ha hc hj hr ht ih =>33cases n with34| zero => omega35| succ n =>36cases n with37| zero => exact InternalChain.single a ha38| succ n =>39simpa using InternalChain.cons a b (l.take n) ha hc hj hr (ih (n+1) (by omega))4041lemma toCore_mem {l : List (Dart V d)} (h : P.ToCore l) {q : Dart V d} (hq : q ∈ l) :42q ∈ P.darts := by43induction h with44| last a ha hc => simpa using (List.mem_singleton.mp hq) ▸ ha45| cons a b l ha hc hj hr ht ih =>46rcases List.mem_cons.mp hq with rfl | hq47· exact ha48· exact ih hq4950/-- A terminated deterministic chain never revisits the same oriented dart. -/51theorem toCore_nodup {l : List (Dart V d)} (h : P.ToCore l) : l.Nodup := by52induction h with53| last a ha hc => simp54| cons a b l ha hc hj hr ht ih =>55apply List.nodup_cons.mpr56refine ⟨?_,ih⟩57intro hmem58obtain ⟨p,s,he⟩ := List.mem_iff_append.mp hmem59have hs : P.ToCore (a::s) := by60have hd := P.toCore_drop ht p.length (by rw [he]; simp)61simpa [he] using hd62have heq := P.toCore_unique (ToCore.cons a b l ha hc hj hr ht) hs rfl63have hlen := congrArg List.length heq64rw [he] at hlen65simp only [List.length_cons,List.length_append] at hlen66omega6768/-- The suffix beginning at any occurrence of a dart is its unique route to69the next core vertex. -/70lemma suffix_toCore (c : P.CoreChain) (p : List (Dart V d)) (q : Dart V d)71(s : List (Dart V d)) (he : c.val=p++q::s) : P.ToCore (q::s) := by72have hd := P.toCore_drop c.property.1 p.length (by rw [he]; simp)73simpa [he] using hd7475/-- Reversing the prefix through a dart reaches the preceding core vertex. -/76lemma reversed_prefix_toCore (c : P.CoreChain) (p : List (Dart V d)) (q : Dart V d)77(s : List (Dart V d)) (he : c.val=p++q::s) :78P.ToCore ((p++[q]).reverse.map reverse) := by79have hi : P.InternalChain (p++[q]) := by80have ht := P.internalChain_take c.property.1.internalChain (p.length+1) (by omega)81simpa [he,List.take_add] using ht82have hr := P.internalChain_reverse hi83apply P.internalChain_toCore hr84have hc : source (c.val.head (P.toCore_nonempty c.property.1)) ∈ P.coreVertices := by85obtain ⟨a,t,hat,hc⟩ := c.property.286simpa [hat] using hc87cases p with88| nil => simpa [he] using hc89| cons a p => simpa [he,List.getLast_map,List.getLast_reverse] using hc9091/-- Sharing an oriented incidence identifies the entire maximal core chain.92The forward and backward continuations are both forced. -/93theorem coreChain_eq_of_common_dart (c c' : P.CoreChain) {q : Dart V d}94(hq : q ∈ c.val) (hq' : q ∈ c'.val) : c=c' := by95obtain ⟨p,s,he⟩ := List.mem_iff_append.mp hq96obtain ⟨p',s',he'⟩ := List.mem_iff_append.mp hq'97have hs : s=s' := (List.cons.inj98(P.toCore_unique (P.suffix_toCore c p q s he) (P.suffix_toCore c' p' q s' he') rfl)).299have hb := P.toCore_unique (P.reversed_prefix_toCore c p q s he)100(P.reversed_prefix_toCore c' p' q s' he') (by simp)101have hp : p=p' := by102have hh := congrArg (fun l : List (Dart V d) => l.reverse.map reverse) hb103simp only [List.map_reverse,List.reverse_reverse,List.map_map,Function.comp_def,104reverse_reverse,List.map_id_fun'] at hh105exact List.append_cancel_right hh106apply Subtype.ext107simp [he,he',hp,hs]108109/-- A chain cannot traverse an edge in both orientations. -/110theorem coreChain_not_both_orientations (c : P.CoreChain) {q : Dart V d} (hq : q ∈ c.val) :111reverse q ∉ c.val := by112intro hrev113have hmem : q ∈ (P.coreChainReverse c).val := by114change q ∈ c.val.reverse.map reverse115exact List.mem_map.mpr ⟨reverse q,List.mem_reverse.mpr hrev,reverse_reverse q⟩116exact P.coreChainReverse_ne_self c (P.coreChain_eq_of_common_dart c (P.coreChainReverse c) hq hmem).symm117118end Nonadditivity.HaarPathGraph.Path