Exact Lean source
Nonadditivity.HaarPathInternalColors
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
12 project constants, including generated, internal and private declarations.
12 declarations
Nonadditivity.HaarPathGraph.Path.coreChain_internal_sources_nodupNonadditivity.HaarPathGraph.Path.coreChain_predecessorNonadditivity.HaarPathGraph.Path.coreChain_source_injectiveNonadditivity.HaarPathGraph.Path.internal_color_injectiveNonadditivity.HaarPathGraph.Path.internal_darts_color_separatedNonadditivity.HaarPathGraph.Path.internal_darts_color_separated._proof_1_1internal/detail/privateNonadditivity.HaarPathGraph.Path.internal_darts_color_separated._proof_1_2internal/detail/privateNonadditivity.HaarPathGraph.Path.internal_darts_color_separated._proof_1_3internal/detail/privateNonadditivity.HaarPathGraph.Path.toCore_predecessor_or_firstNonadditivity.HaarPathGraph.Path.toCore_stepNonadditivity.HaarPathGraph.Path.toCore_step._proof_1internal/detail/privateNonadditivity.HaarPathGraph.Path.toCore_tail_source_not_core
Full module
1/-2Copyright (c) 2026 the Nonadditivity project contributors.3All rights reserved. See COPYRIGHT.md for licensing and attribution.4-/56import Nonadditivity.HaarPathChainPartition78/-! # Internal vertices have unique outgoing signed colors910The degree-two hypothesis alone would not separate colors. Reducedness of the11original path supplies two distinct signed colors, exhausting its two darts.12Core-chain internal vertices also occur only once, by deterministic continuation13and the prohibition against traversing both orientations of one edge.14-/15noncomputable section16set_option maxHeartbeats 150000017set_option backward.isDefEq.respectTransparency false18set_option linter.unusedSectionVars false19namespace Nonadditivity.HaarPathGraph.Path20open HaarPathGraph HaarPathProfiles21variable {V : Type*} [DecidableEq V] {d m : ℕ} (P : Path V d m)2223theorem internal_darts_color_separated {v : V} (hv : v∈P.vertices)24(hcore : v∉P.coreVertices) :25∃ a b : Dart V d, a∈P.darts ∧ b∈P.darts ∧ source a=v ∧ source b=v ∧26color a≠color b ∧ ∀ q∈P.darts, source q=v → q=a ∨ q=b := by27have hroot : v≠P.vertex 0 := by28intro he29exact hcore (Finset.mem_filter.mpr ⟨hv,Or.inl he⟩)30obtain ⟨i,hi,hiv⟩ := Finset.mem_image.mp hv31have hi0 : 0 < (i : Fin m).val := by32by_contra h33have he : i.castSucc=0 := Fin.ext (by simp; omega)34exact hroot (by rw [←hiv,he])35let j : Fin m := ⟨i.val-1,by omega⟩36have hji : j.val+1=i.val := by dsimp [j]; omega37have hjs : j.succ=i.castSucc := Fin.ext hji38let a := P.traversal i39let b := reverse (P.traversal j)40have ha : a∈P.darts := P.traversal_mem i41have hb : b∈P.darts := P.reverse_traversal_mem j42have hav : source a=v := by simpa only [a,traversal,source_dart] using hiv43have hbv : source b=v := by simp only [b,traversal,source_reverse_dart,hjs,hiv]44have hc : color a≠color b := by45simpa only [a,b,traversal,color_dart,color_reverse_dart] using P.reduced j i hji46refine ⟨a,b,ha,hb,hav,hbv,hc,?_⟩47intro q hq hqv48by_cases hqa : q=a49· exact Or.inl hqa50· right51have hba : b≠a := fun he => hc (congrArg color he.symm)52exact (P.next_dart_unique ha hb hq (hav ▸ hcore)53(hav.trans hbv.symm) (hav.trans hqv.symm) hba hqa).symm5455/-- At a non-core vertex, its signed color determines its outgoing dart. -/56theorem internal_color_injective {q r : Dart V d} (hq : q∈P.darts) (hr : r∈P.darts)57(hcore : source q∉P.coreVertices) (hs : source q=source r) (hc : color q=color r) : q=r := by58obtain ⟨a,b,ha,hb,hav,hbv,hab,hex⟩ := P.internal_darts_color_separated (P.source_mem hq) hcore59rcases hex q hq rfl with hqa | hqb <;> rcases hex r hr hs.symm with hra | hrb60· exact hqa.trans hra.symm61· exact (hab (by simpa only [hqa,hrb] using hc)).elim62· exact (hab (by simpa only [hqb,hra] using hc.symm)).elim63· exact hqb.trans hrb.symm6465theorem toCore_predecessor_or_first {l : List (Dart V d)} (h : P.ToCore l)66{q : Dart V d} (hq : q∈l) :67l.head?=some q ∨ ∃ p∈l, source (reverse p)=source q ∧ q≠reverse p := by68induction h with69| last a ha hc => left; simpa using (List.mem_singleton.mp hq).symm70| cons a b l ha hc hj hr ht ih =>71rcases List.mem_cons.mp hq with hqa | hq72· left; simp [hqa]73· rcases ih hq with hhead | ⟨p,hp,hpq,hred⟩74· have he : b=q := by simpa using hhead75subst q76exact Or.inr ⟨a,by simp,hj,hr⟩77· exact Or.inr ⟨p,List.mem_cons_of_mem _ hp,hpq,hred⟩7879theorem coreChain_predecessor (c : P.CoreChain) {q : Dart V d}80(hq : q∈c.val) (hcore : source q∉P.coreVertices) :81∃ p∈c.val, source (reverse p)=source q ∧ q≠reverse p := by82rcases P.toCore_predecessor_or_first c.property.1 hq with hh | h83· obtain ⟨a,t,he,hac⟩ := c.property.284have haq : a=q := by simpa only [he,List.head?_cons,Option.some.injEq] using hh85exact (hcore (haq ▸ hac)).elim86· exact h8788/-- An internal vertex appears at most once in a maximal core chain. -/89theorem coreChain_source_injective (c : P.CoreChain) {q r : Dart V d}90(hq : q∈c.val) (hr : r∈c.val) (hcore : source q∉P.coreVertices)91(hs : source q=source r) : q=r := by92by_contra hne93obtain ⟨p,hp,hpq,hred⟩ := P.coreChain_predecessor c hq hcore94have he : reverse p=r := P.next_dart_unique (P.toCore_mem c.property.1 hq)95(P.reverse_mem (P.toCore_mem c.property.1 hp)) (P.toCore_mem c.property.1 hr)96hcore hpq.symm hs (Ne.symm hred) (Ne.symm hne)97exact P.coreChain_not_both_orientations c hp (he ▸ hr)9899theorem toCore_tail_source_not_core {l : List (Dart V d)} (h : P.ToCore l)100{q : Dart V d} (hq : q∈l.tail) : source q∉P.coreVertices := by101induction h with102| last a ha hc => simp at hq103| cons a b l ha hc hj hr ht ih =>104rcases List.mem_cons.mp hq with rfl | hq105· simpa only [hj] using hc106· exact ih hq107108theorem toCore_step {l : List (Dart V d)} (h : P.ToCore l)109(i : ℕ) (hi : i+1<l.length) :110source (reverse l[i])=source l[i+1] ∧ l[i+1]≠reverse l[i] := by111induction h generalizing i with112| last a ha hc => simp at hi113| cons a b l ha hc hj hr ht ih =>114cases i with115| zero => exact ⟨hj,hr⟩116| succ i => exact ih i (by simpa using hi)117118theorem coreChain_internal_sources_nodup (c : P.CoreChain) :119(c.val.tail.map source).Nodup := by120apply List.Nodup.map_on _ (P.toCore_nodup c.property.1).tail121intro q hq r hr hs122exact P.coreChain_source_injective c (List.mem_of_mem_tail hq) (List.mem_of_mem_tail hr)123(P.toCore_tail_source_not_core c.property.1 hq) hs124125end Nonadditivity.HaarPathGraph.Path