Exact Lean source
Nonadditivity.HaarProfileWordReverse
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
9 project constants, including generated, internal and private declarations.
9 declarations
Nonadditivity.HaarPathGraph.Path.ofFn_flip_revNonadditivity.HaarPathGraph.Path.ofFn_flip_rev._proof_1_1internal/detail/privateNonadditivity.HaarPathGraph.Path.reverseProfileWordNonadditivity.HaarPathGraph.Path.reverseProfileWord._proof_1internal/detail/privateNonadditivity.HaarPathGraph.Path.reverseProfileWord_involutiveNonadditivity.HaarPathGraph.Path.reverseProfileWord_ofFnNonadditivity.HaarPathGraph.Path.reverseProfileWord_twice_ofFnNonadditivity.HaarPathGraph.Path.reverseProfileWord_valNonadditivity.HaarPathGraph.Path.reverseProfileWord_word
Full module
1/-2Copyright (c) 2026 the Nonadditivity project contributors.3All rights reserved. See COPYRIGHT.md for licensing and attribution.4-/56import Nonadditivity.HaarCoreChainWords7import Nonadditivity.HaarCoreChainReverseAddress8import Nonadditivity.HaarPathProfileReverse910/-! # Reversing an arbitrary word in an actual core-chain profile1112The chosen reduced word on one orientation determines a word in the actual13opposite profile. This is a map of literal finite profile families, with the14precise reversed index formula and inverse free-group evaluation.15-/16noncomputable section17set_option backward.isDefEq.respectTransparency false18set_option maxHeartbeats 100000019namespace Nonadditivity.HaarPathGraph.Path20open HaarPathProfiles HaarProfileCoefficient2122theorem ofFn_flip_rev {d j k : ℕ} (hj : j=k) (w : Fin k → Color d) :23List.ofFn (fun i : Fin j => flipColor (w (Fin.cast hj i.rev))) =24FreeGroup.invRev (List.ofFn w) := by25subst j26apply List.ext_getElem27· simp [FreeGroup.invRev]28· intro i hi hj29simp only [List.getElem_ofFn,FreeGroup.invRev,List.getElem_map,30List.getElem_reverse,List.length_map,List.length_ofFn,Fin.cast_refl]31apply congrArg flipColor32apply congrArg w33apply Fin.ext34simp only [id_eq,Fin.val_rev]35omega3637variable {V : Type*} [DecidableEq V] {d m : ℕ} (P : Path V d m)3839def reverseProfileWord (c : P.CoreChain)40(w : Words d c.val.length (P.coreChainProfile c).val) :41Words d (P.coreChainReverse c).val.length42(P.coreChainProfile (P.coreChainReverse c)).val := by43refine ⟨fun i => flipColor (w.val (Fin.cast (P.coreChainReverse_length c) i.rev)),?_⟩44rw [ofFn_flip_rev]45refine ⟨reduced_invRev w.property.1,?_,?_,?_⟩46· rw [P.coreChainProfile_reverse_first]47simp only [FreeGroup.invRev,List.head?_reverse,List.getLast?_map,48w.property.2.2.1,Option.map_some]49rfl50· rw [P.coreChainProfile_reverse_last]51simp only [FreeGroup.invRev,List.getLast?_reverse,List.head?_map,52w.property.2.1,Option.map_some]53rfl54· intro a55rw [P.coreChainProfile_reverse_count]56change ((List.ofFn w.val).map flipColor).reverse.count a = _57rw [List.count_reverse]58rw [←flipColor_involutive a,59List.count_map_of_injective _ flipColor flipColor_involutive.injective,60flipColor_involutive]61exact w.property.2.2.2 _6263@[simp] theorem reverseProfileWord_val (c : P.CoreChain)64(w : Words d c.val.length (P.coreChainProfile c).val)65(i : Fin (P.coreChainReverse c).val.length) :66(P.reverseProfileWord c w).val i =67flipColor (w.val (Fin.cast (P.coreChainReverse_length c) i.rev)) := rfl6869theorem reverseProfileWord_ofFn (c : P.CoreChain)70(w : Words d c.val.length (P.coreChainProfile c).val) :71List.ofFn (P.reverseProfileWord c w).val = FreeGroup.invRev (List.ofFn w.val) :=72ofFn_flip_rev _ _7374@[simp] theorem reverseProfileWord_word (c : P.CoreChain)75(w : Words d c.val.length (P.coreChainProfile c).val) :76word (P.reverseProfileWord c w)=(word w)⁻¹ := by77unfold word78rw [P.reverseProfileWord_ofFn,FreeGroup.inv_mk]7980/-- Reversing the chosen signed word twice restores its literal letter list. -/81theorem reverseProfileWord_twice_ofFn (c : P.CoreChain)82(w : Words d c.val.length (P.coreChainProfile c).val) :83List.ofFn (P.reverseProfileWord (P.coreChainReverse c) (P.reverseProfileWord c w)).val =84List.ofFn w.val := by85rw [P.reverseProfileWord_ofFn,P.reverseProfileWord_ofFn,FreeGroup.invRev_invRev]8687/-- The actual profile-family elements are involutive, allowing for the88dependent equality between the twice-reversed chain and the original chain. -/89theorem reverseProfileWord_involutive (c : P.CoreChain)90(w : Words d c.val.length (P.coreChainProfile c).val) :91HEq (P.reverseProfileWord (P.coreChainReverse c) (P.reverseProfileWord c w)) w := by92have hh (c' : P.CoreChain) (he : c'=c)93(w' : Words d c'.val.length (P.coreChainProfile c').val)94(hw : List.ofFn w'.val=List.ofFn w.val) : HEq w' w := by95subst c'96exact heq_of_eq (Subtype.ext (List.ofFn_injective hw))97exact hh _ (P.coreChainReverse_involutive c) _ (P.reverseProfileWord_twice_ofFn c w)9899end Nonadditivity.HaarPathGraph.Path