Exact Lean source
Nonadditivity.HaarActualScanWords
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
2 project constants, including generated, internal and private declarations.
2 declarations
Nonadditivity.HaarActualScanWords.actualScanWords_specNonadditivity.HaarActualScanWords.scanWords_eq_actual_chunks
Full module
1/-2Copyright (c) 2026 the Nonadditivity project contributors.3All rights reserved. See COPYRIGHT.md for licensing and attribution.4-/56import Nonadditivity.HaarSkeletonSegmentation7import Nonadditivity.HaarPaletteDecoder8import Nonadditivity.HaarRefinedPaletteFibre9import Nonadditivity.HaarReducedChunks1011/-! # Actual decoded chunks of the reconstructed refined path1213The decoder's reversed scan is exactly the consecutive occurrence partition14of the original path. Its chunks are reduced and nontrivial, and their product15is the literal recolored word, for every independent profile assignment.16-/17noncomputable section18set_option backward.isDefEq.respectTransparency false19set_option maxHeartbeats 100000020namespace Nonadditivity.HaarActualScanWords21open HaarPathGraph HaarProfileCoefficient HaarSkeletonSegmentation HaarPaletteDecoder22NoncommutativeCS HaarNonbacktracking2324variable {V : Type*} [Fintype V] [DecidableEq V] {d m : ℕ}25(P : Path V d m) (cs : List P.CoreChain)26(R : EndpointSkeleton P.unorientedChains27(Fin.elim0 : Fin 0 → P.unorientedChains) (Fin.elim0 : Fin 0 → P.unorientedChains))2829theorem scanWords_eq_actual_chunks30(hw : R.word=(cs.map P.chainLabel).reverse) (σ : P.ChainPalette) :31scanWords R (decode (blockDirections P (R.occurrenceBlocks cs.reverse))) (chainEmbed P σ) =32(R.occurrenceBlocks cs.reverse).map33(fun block => (block.reverse.map (fun c => word (P.paletteWord σ c))).prod) := by34have hmap := R.map_occurrenceBlocks P.chainLabel cs.reverse35(by simpa only [List.map_reverse] using hw.symm)36apply List.ext_getElem37· simp [scanWords]38· intro k hk hk'39have hkB : k<(R.occurrenceBlocks cs.reverse).length := by simpa using hk'40have hkR : k<R.blocks.length := by simpa [scanWords] using hk41have hget : R.blocks[k]=(R.occurrenceBlocks cs.reverse)[k].map P.chainLabel := by42have he := congrArg (fun ls : List (List P.unorientedChains) => ls.getD k []) hmap43dsimp only at he44rw [List.getD_eq_getElem _ _ (by simpa using hkB),45List.getD_eq_getElem _ _ hkR,List.getElem_map] at he46exact he.symm47simp only [scanWords,List.getElem_mapIdx,List.getElem_map]48rw [hget]49simp only [List.map_map,Function.comp_def]50exact decode_actual_block P σ (R.occurrenceBlocks cs.reverse) k hkB5152/-- Every remaining reduced-word hypothesis of the analytic segmented53coefficient theorem holds for the actual independent profile palettes. -/54theorem actualScanWords_spec55(hcs : (cs.map Subtype.val).flatten=P.traversalList)56(hR : R.Compressed) (hw : R.word=(cs.map P.chainLabel).reverse)57(σ : P.ChainPalette) :58let gs := (scanWords R59(decode (blockDirections P (R.occurrenceBlocks cs.reverse))) (chainEmbed P σ)).reverse60gs.prod=FreeGroup.mk (List.ofFn (P.paletteColoring σ).path.colors) ∧61(∀ g∈gs, g≠1) ∧ FreeGroup.IsReduced (gs.flatMap FreeGroup.toWord) := by62let φ : P.CoreChain → FreeGroup (Fin d) := fun c => word (P.paletteWord σ c)63let chunks := ((R.occurrenceBlocks cs.reverse).map List.reverse).reverse64have hw' : cs.reverse.map P.chainLabel=R.word := by65simpa only [List.map_reverse] using hw.symm66have hflat : chunks.flatten=cs := R.flatten_map_reversed_occurrenceBlocks P.chainLabel cs hw'67have hchunks : ∀ c∈chunks, c≠[] := by68intro c hc69obtain ⟨b,hb,rfl⟩ := List.mem_map.mp (List.mem_reverse.mp hc)70exact fun he => R.occurrenceBlocks_nonempty hR P.chainLabel cs.reverse hw' b hb71(List.reverse_eq_nil_iff.mp he)72have hred : FreeGroup.IsReduced ((cs.map φ).flatMap FreeGroup.toWord) :=73(P.paletteColoring σ).assignedWords_reduced cs hcs74have hne : ∀ c∈cs, φ c≠1 := fun c _ => word_ne_one (P.paletteWord σ c)75have hs := occurrence_chunk_spec cs chunks φ hflat hred hne hchunks76dsimp only at hs77have hg : (scanWords R78(decode (blockDirections P (R.occurrenceBlocks cs.reverse))) (chainEmbed P σ)).reverse =79chunks.map (fun c => (c.map φ).prod) := by80rw [scanWords_eq_actual_chunks P cs R hw σ]81simp only [chunks,List.map_reverse,List.map_map,Function.comp_def,φ]82dsimp only83rw [hg]84refine ⟨?_,hs.2.2.1,hs.2.1⟩85exact hs.2.2.2.trans ((P.paletteColoring σ).assignedWords_prod cs hcs)8687end Nonadditivity.HaarActualScanWords