Exact Lean source
Nonadditivity.HaarPathRecoloring
Download original .lean · View on GitHub · Jump to source
Direct imports
Imported by project modules
2 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.mk.congr_simpNonadditivity.HaarPathRecoloring.recolorPathNonadditivity.HaarPathRecoloring.recolorPath._proof_1internal/detail/privateNonadditivity.HaarPathRecoloring.recolorPath._proof_2internal/detail/privateNonadditivity.HaarPathRecoloring.recolorPath.congr_simpNonadditivity.HaarPathRecoloring.recolorPath.eq_1internal/detail/privateNonadditivity.HaarPathRecoloring.recolorPath_colorsNonadditivity.HaarPathRecoloring.recolorPath_dartPermNonadditivity.HaarPathRecoloring.recolorPath_incidenceColorNonadditivity.HaarPathRecoloring.recolorPath_incidenceVertexNonadditivity.HaarPathRecoloring.recolorPath_samePatternNonadditivity.HaarPathRecoloring.recolorPath_vertex
Full module
1/-2Copyright (c) 2026 the Nonadditivity project contributors.3All rights reserved. See COPYRIGHT.md for licensing and attribution.4-/56import Nonadditivity.HaarPathTransport78/-! # Reconstructing an actual path from compatible dart colors910The local signed-color equality pattern and reversal compatibility suffice to11recolor the literal path. Reducedness follows from the original reduced walk;12the result belongs to its actual coarse path class.13-/14noncomputable section15set_option backward.isDefEq.respectTransparency false16set_option maxHeartbeats 100000017set_option linter.unusedSectionVars false18namespace Nonadditivity.HaarPathRecoloring19open HaarPathGraph HaarPathProfiles HaarPathClasses20variable {V : Type*} [Fintype V] [DecidableEq V] {d m : ℕ}21variable (P : Path V d m) (κ : {q // q∈P.darts} → Color d)22variable (hrev : ∀ q : {q // q∈P.darts},23κ ⟨reverse q.val,P.reverse_mem q.property⟩=flipColor (κ q))24variable (hkernel : ∀ q r : {q // q∈P.darts}, source q.val=source r.val →25(κ q=κ r ↔ color q.val=color r.val))26include hrev hkernel2728def recolorPath : Path V d m where29vertex := P.vertex30colors i := κ ⟨P.traversal i,P.traversal_mem i⟩31closed := P.closed32reduced i j hij := by33intro he34have hs : source (P.traversal j)=source (reverse (P.traversal i)) := by35simp only [Path.traversal,source_dart,source_reverse_dart]36exact congrArg P.vertex (Fin.ext hij.symm)37have hk : κ ⟨P.traversal j,P.traversal_mem j⟩=38κ ⟨reverse (P.traversal i),P.reverse_mem (P.traversal_mem i)⟩ := by39rw [hrev ⟨P.traversal i,P.traversal_mem i⟩]40exact he41have hc := (hkernel ⟨P.traversal j,P.traversal_mem j⟩42⟨reverse (P.traversal i),P.reverse_mem (P.traversal_mem i)⟩ hs).mp hk43exact P.reduced i j hij (by simpa only [Path.traversal,color_dart,color_reverse_dart] using hc)4445@[simp] theorem recolorPath_vertex : (recolorPath P κ hrev hkernel).vertex=P.vertex := rfl4647@[simp] theorem recolorPath_colors (i : Fin m) :48(recolorPath P κ hrev hkernel).colors i=κ ⟨P.traversal i,P.traversal_mem i⟩ := rfl4950theorem recolorPath_incidenceVertex (a : Incidence m) :51incidenceVertex (recolorPath P κ hrev hkernel) a=incidenceVertex P a := rfl5253theorem recolorPath_incidenceColor (a : Incidence m) :54incidenceColor (recolorPath P κ hrev hkernel) a=55κ ⟨incidenceDart P a,incidenceDart_mem P a⟩ := by56obtain ⟨i,b⟩ := a57cases b58· simpa only [incidenceColor,incidenceDart,Bool.false_eq_true,ite_false,recolorPath]59using (hrev ⟨P.traversal i,P.traversal_mem i⟩).symm60· rfl6162/-- This is membership in the literal path equivalence relation, including63the local signed-color equality kernels at both ends of every traversal. -/64theorem recolorPath_samePattern : SamePattern P (recolorPath P κ hrev hkernel) := by65constructor66· intro i j67rfl68· intro a b hv69rw [recolorPath_incidenceColor,recolorPath_incidenceColor]70simpa only [color_incidenceDart] using (hkernel ⟨incidenceDart P a,incidenceDart_mem P a⟩71⟨incidenceDart P b,incidenceDart_mem P b⟩72(by simpa only [source_incidenceDart] using hv)).symm7374/-- The induced dart map changes the signed color and retains both literal75vertex endpoints. -/76theorem recolorPath_dartPerm (q : {q // q∈P.darts}) :77(recolorPath_samePattern P κ hrev hkernel).dartPerm q.val=78dart (source q.val) (κ q) (source (reverse q.val)) := by79let h := recolorPath_samePattern P κ hrev hkernel80obtain ⟨a,ha⟩ := exists_incidenceDart P q.property81have hq : (⟨incidenceDart P a,incidenceDart_mem P a⟩ : {q // q∈P.darts})=q :=82Subtype.ext ha83rw [←ha,h.dartPerm_apply]84apply (dart_eq_iff_source_color_target _ _).mpr85refine ⟨?_,?_,?_⟩86· simp only [source_incidenceDart,source_dart,recolorPath_incidenceVertex]87· simp only [color_incidenceDart,color_dart,recolorPath_incidenceColor,hq]88· rw [←incidenceDart_flip,source_incidenceDart,source_reverse_dart,89←incidenceDart_flip,source_incidenceDart,recolorPath_incidenceVertex]9091end Nonadditivity.HaarPathRecoloring