Exact Lean source
Nonadditivity.HaarCoreChainAddress
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
11 project constants, including generated, internal and private declarations.
11 declarations
Nonadditivity.HaarPathGraph.Path.ChainPositionNonadditivity.HaarPathGraph.Path.positionDartNonadditivity.HaarPathGraph.Path.positionDart._proof_1internal/detail/privateNonadditivity.HaarPathGraph.Path.positionDart_injectiveNonadditivity.HaarPathGraph.Path.positionDart_surjectiveNonadditivity.HaarPathGraph.Path.positionEquivNonadditivity.HaarPathGraph.Path.positionEquiv._proof_1internal/detail/privateNonadditivity.HaarPathGraph.Path.positionEquiv_applyNonadditivity.HaarPathGraph.Path.recolorNonadditivity.HaarPathGraph.Path.recolor_chainNonadditivity.HaarPathGraph.Path.recolor_position
Full module
1/-2Copyright (c) 2026 the Nonadditivity project contributors.3All rights reserved. See COPYRIGHT.md for licensing and attribution.4-/56import Nonadditivity.HaarCoreChainLabels78/-! # Exact coordinates of graph darts on suppressed chains910The positions of all oriented core chains partition the literal graph darts.11The address map and its inverse are actual bijections, not chosen encodings12with a coverage or reconstruction premise.13-/1415noncomputable section16set_option backward.isDefEq.respectTransparency false1718namespace Nonadditivity.HaarPathGraph.Path1920variable {V : Type*} [DecidableEq V] {d m : ℕ} (P : Path V d m)2122abbrev ChainPosition := Σ c : P.CoreChain, Fin c.val.length2324def positionDart (p : P.ChainPosition) : P.darts :=25⟨p.1.val.get p.2, P.toCore_mem p.1.property.1 (List.get_mem _ _)⟩2627/-- A literal oriented dart determines both its chain and its position. -/28theorem positionDart_injective : Function.Injective P.positionDart := by29rintro ⟨c,i⟩ ⟨c',i'⟩ he30have heq : c.val.get i = c'.val.get i' := congrArg Subtype.val he31have hc : c = c' := P.coreChain_eq_of_common_dart c c'32(List.get_mem _ _) (heq.symm ▸ List.get_mem _ _)33subst c'34have hi : i = i' := (P.toCore_nodup c.property.1).injective_get heq35subst i'36rfl3738/-- Every actual graph dart lies on one of the complete oriented core chains. -/39theorem positionDart_surjective : Function.Surjective P.positionDart := by40intro q41obtain ⟨i,hi | hi⟩ := P.dart_eq_traversal_or_reverse q.val q.property42all_goals43have hm : 0 < m := Nat.zero_lt_of_lt i.isLt44obtain ⟨cs,hcs⟩ := P.exists_traversal_chain_decomposition hm45have hmem : P.traversal i ∈ (cs.map Subtype.val).flatten := by46rw [hcs]47exact List.mem_ofFn.mpr ⟨i,rfl⟩48obtain ⟨l,hl,hil⟩ := List.mem_flatten.mp hmem49obtain ⟨c,hc,rfl⟩ := List.mem_map.mp hl50· have hqc : q.val ∈ c.val := hi.symm ▸ hil51obtain ⟨j,hj⟩ := List.mem_iff_get.mp hqc52exact ⟨⟨c,j⟩,Subtype.ext hj⟩53· have hqc : q.val ∈ (P.coreChainReverse c).val := by54rw [hi]55exact List.mem_map.mpr ⟨P.traversal i,List.mem_reverse.mpr hil,rfl⟩56obtain ⟨j,hj⟩ := List.mem_iff_get.mp hqc57exact ⟨⟨P.coreChainReverse c,j⟩,Subtype.ext hj⟩5859/-- The canonical finite position address of each oriented dart. -/60def positionEquiv : P.ChainPosition ≃ P.darts :=61Equiv.ofBijective P.positionDart ⟨P.positionDart_injective,P.positionDart_surjective⟩6263@[simp] theorem positionEquiv_apply (p : P.ChainPosition) : P.positionEquiv p = P.positionDart p := rfl6465/-- Recolor every graph dart using arbitrary prescribed lists on the chains. -/66def recolor (F : ∀ c : P.CoreChain, Fin c.val.length → HaarPathProfiles.Color d)67(q : P.darts) : HaarPathProfiles.Color d :=68F (P.positionEquiv.symm q).1 (P.positionEquiv.symm q).26970@[simp] theorem recolor_position (F : ∀ c : P.CoreChain, Fin c.val.length → HaarPathProfiles.Color d)71(c : P.CoreChain) (i : Fin c.val.length) :72P.recolor F (P.positionDart ⟨c,i⟩) = F c i := by73change F (P.positionEquiv.symm (P.positionEquiv ⟨c,i⟩)).174(P.positionEquiv.symm (P.positionEquiv ⟨c,i⟩)).2 = _75rw [Equiv.symm_apply_apply]7677/-- Reading back a recolored chain returns exactly its assigned finite word. -/78theorem recolor_chain (F : ∀ c : P.CoreChain, Fin c.val.length → HaarPathProfiles.Color d)79(c : P.CoreChain) :80List.ofFn (fun i : Fin c.val.length => P.recolor F (P.positionDart ⟨c,i⟩)) =81List.ofFn (F c) := by82simp only [P.recolor_position]8384end Nonadditivity.HaarPathGraph.Path