Exact Lean source
Nonadditivity.HaarPathMarks
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
35 project constants, including generated, internal and private declarations.
35 declarations
Nonadditivity.HaarPathClasses.DefectClassNonadditivity.HaarPathClasses.boundedExplorationCodeNonadditivity.HaarPathClasses.classExplorationCodeNonadditivity.HaarPathClasses.classExplorationCode._proof_1internal/detail/privateNonadditivity.HaarPathClasses.classExplorationCode._proof_2internal/detail/privateNonadditivity.HaarPathClasses.classRepresentativeNonadditivity.HaarPathClasses.classRepresentative_defectNonadditivity.HaarPathClasses.colorNormalizerNonadditivity.HaarPathClasses.colorNormalizer._proof_1internal/detail/privateNonadditivity.HaarPathClasses.colorNormalizer._proof_2internal/detail/privateNonadditivity.HaarPathClasses.explorationEventListNonadditivity.HaarPathClasses.explorationEventList._proof_1internal/detail/privateNonadditivity.HaarPathClasses.explorationEventList._proof_2internal/detail/privateNonadditivity.HaarPathClasses.explorationEventList._proof_3internal/detail/privateNonadditivity.HaarPathClasses.explorationEventList.congr_simpNonadditivity.HaarPathClasses.explorationEventList.eq_1internal/detail/privateNonadditivity.HaarPathClasses.explorationEventList_lengthNonadditivity.HaarPathClasses.explorationEventList_length_leNonadditivity.HaarPathClasses.explorationEventList_timesNonadditivity.HaarPathClasses.explorationMarkNonadditivity.HaarPathClasses.explorationMark.congr_simpNonadditivity.HaarPathClasses.explorationMark_eq_of_eventList_eqNonadditivity.HaarPathClasses.importantTimes_eq_of_eventList_eqNonadditivity.HaarPathClasses.initialColorNonadditivity.HaarPathClasses.initialColor._proof_1internal/detail/privateNonadditivity.HaarPathClasses.nextColorNonadditivity.HaarPathClasses.normalColorNonadditivity.HaarPathClasses.normalColor_after_firstVisitNonadditivity.HaarPathClasses.normalColor_incomingNonadditivity.HaarPathClasses.normalColor_rootNonadditivity.HaarPathClasses.treeStopNonadditivity.HaarPathClasses.treeStopIndexNonadditivity.HaarPathClasses.treeStopIndex._proof_1internal/detail/privateNonadditivity.HaarPathClasses.treeStop_boundsNonadditivity.HaarPathClasses.treeStop_bounds._proof_1_1internal/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.HaarPathVertexNames7import Nonadditivity.HaarPathExplorationBlocks8import Nonadditivity.HaarPathCodes910/-! # Actual sparse exploration marks1112The fixed-alphabet marks below are extracted from literal paths using their13first-occurrence vertex names and independent local color normalizers. No14edge of the unknown final graph is used as an encoding symbol.1516This file constructs the code and its size budget. Injectivity of the sparse17code is a separate reconstruction theorem, not assumed here.18-/19noncomputable section20namespace Nonadditivity.HaarPathClasses21open HaarPathGraph HaarPathProfiles22variable {V : Type*} [DecidableEq V] {m : ℕ}2324/-- Two fixed, distinct local incidence labels. -/25def initialColor : Color 2 := (0,false)26def nextColor : Color 2 := (0,true)2728def colorNormalizer (P : Path V 2 m) (hm : 0 < m) : V → Equiv.Perm (Color 2) :=29Classical.choose (exists_local_color_normalization P hm initialColor nextColor (by decide))3031def normalColor (P : Path V 2 m) (hm : 0 < m) (a : Incidence m) : Color 2 :=32normalizedIncidenceColor P (colorNormalizer P hm) a3334theorem normalColor_root (P : Path V 2 m) (hm : 0 < m) :35normalColor P hm (⟨0,hm⟩,true)=initialColor := by36exact (Classical.choose_spec37(exists_local_color_normalization P hm initialColor nextColor (by decide))).13839theorem normalColor_incoming (P : Path V 2 m) (hm : 0 < m)40(i : Fin m) (hi : P.FirstVisit i) : normalColor P hm (i,false)=initialColor := by41exact (Classical.choose_spec42(exists_local_color_normalization P hm initialColor nextColor (by decide))).2.1 i hi4344theorem normalColor_after_firstVisit (P : Path V 2 m) (hm : 0 < m)45(i j : Fin m) (hi : P.FirstVisit i) (hij : i.val+1=j.val) :46normalColor P hm (j,true)=nextColor := by47have hv : j.castSucc=i.succ := Fin.ext (by simpa using hij.symm)48change colorNormalizer P hm (P.vertex j.castSucc) (P.colors j)=nextColor49rw [hv]50exact (Classical.choose_spec51(exists_local_color_normalization P hm initialColor nextColor (by decide))).2.2 i j hi hij5253/-- End of the actual old-tree run following position i. -/54def treeStop (P : Path V 2 m) (i : Fin m) : ℕ :=55P.firstFresh (i.val+1) (P.nextImportant (i.val+1))5657theorem treeStop_bounds (P : Path V 2 m) (i : Fin m) :58i.val+1 ≤ treeStop P i ∧ treeStop P i ≤ m := by59have hb := P.nextImportant_bounds (i.val+1) (by omega)60have hs := P.firstFresh_bounds (i.val+1) (P.nextImportant (i.val+1)) hb.161exact ⟨hs.1,hs.2.trans hb.2⟩6263def treeStopIndex (P : Path V 2 m) (i : Fin m) : Fin (m+1) :=64⟨treeStop P i,Nat.lt_succ_of_le (treeStop_bounds P i).2⟩6566/-- Target, old-tree endpoint, and independent source/target/next colors. -/67def explorationMark (P : Path V 2 m) (hm : 0 < m) (i : Fin m) : ExplorationMark m :=68(P.vertexName hm i.succ,69P.vertexName hm (treeStopIndex P i),70normalColor P hm (i,true),71normalColor P hm (i,false),72if hs : treeStop P i < m then normalColor P hm (⟨treeStop P i,hs⟩,true)73else initialColor)7475/-- Sorted actual important times with the full fixed-alphabet marks. -/76def explorationEventList (P : Path V 2 m) (hm : 0 < m) : List (ExplorationEvent m) :=77(P.importantTimes.sort (· ≤ ·)).map fun i => (i,explorationMark P hm i)7879@[simp] theorem explorationEventList_length (P : Path V 2 m) (hm : 0 < m) :80(explorationEventList P hm).length=P.importantTimes.card := by81simp [explorationEventList]8283theorem explorationEventList_length_le (P : Path V 2 m) (hm : 0 < m) :84(explorationEventList P hm).length ≤ P.defectTwice+2 := by85rw [explorationEventList_length]86exact P.card_importantTimes_le hm8788def boundedExplorationCode (P : Path V 2 m) (hm : 0 < m) :89BoundedList (ExplorationEvent m) (P.defectTwice+2) :=90⟨explorationEventList P hm,explorationEventList_length_le P hm⟩9192@[simp] theorem explorationEventList_times (P : Path V 2 m) (hm : 0 < m) :93(explorationEventList P hm).map Prod.fst=P.importantTimes.sort (· ≤ ·) := by94simp [explorationEventList,List.map_map,Function.comp_def]9596theorem importantTimes_eq_of_eventList_eq {P Q : Path V 2 m} (hm : 0 < m)97(h : explorationEventList P hm=explorationEventList Q hm) :98P.importantTimes=Q.importantTimes := by99have he := congrArg (fun l : List (ExplorationEvent m) => (l.map Prod.fst).toFinset) h100simpa using he101102theorem explorationMark_eq_of_eventList_eq {P Q : Path V 2 m} (hm : 0 < m)103(h : explorationEventList P hm=explorationEventList Q hm)104(i : Fin m) (hi : i∈P.importantTimes) : explorationMark P hm i=explorationMark Q hm i := by105have hmem : (i,explorationMark P hm i)∈explorationEventList P hm := by106apply List.mem_map.mpr107exact ⟨i,by simpa using hi,rfl⟩108rw [h] at hmem109obtain ⟨j,hj,he⟩ := List.mem_map.mp hmem110have hji : j=i := congrArg Prod.fst he111subst j112exact (congrArg Prod.snd he).symm113114/-- The actual BC quotient restricted to a fixed integer defect. -/115abbrev DefectClass (V : Type*) [DecidableEq V] [Fintype V] (m δ : ℕ) (hm : 0 < m) :=116{C : PathClass V 2 m // classDefectTwice hm C=δ}117118def classRepresentative [Fintype V] {δ : ℕ} (hm : 0 < m)119(C : DefectClass V m δ hm) : Path V 2 m := Quotient.out C.val120121theorem classRepresentative_defect [Fintype V] {δ : ℕ} (hm : 0 < m)122(C : DefectClass V m δ hm) : (classRepresentative hm C).defectTwice=δ := by123have h := congrArg (classDefectTwice hm) (Quotient.out_eq C.val)124exact h.trans C.property125126/-- A concrete bounded sparse code for every actual defect class. Its127injectivity is established by the blockwise reconstruction in HaarPathCounting. -/128def classExplorationCode [Fintype V] {δ : ℕ} (hm : 0 < m)129(C : DefectClass V m δ hm) : BoundedList (ExplorationEvent m) (δ+2) :=130⟨explorationEventList (classRepresentative hm C) hm,by131have h := explorationEventList_length_le (classRepresentative hm C) hm132have hd := classRepresentative_defect hm C133omega⟩134135end Nonadditivity.HaarPathClasses