Exact Lean source
Nonadditivity.HaarChainColoringPalettes
Download original .lean · View on GitHub · Jump to source
Direct imports
Imported by project modules
3 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
22 project constants, including generated, internal and private declarations.
22 declarations
Nonadditivity.HaarPathGraph.Path.ChainColoring.extNonadditivity.HaarPathGraph.Path.ChainColoring.ext_iffNonadditivity.HaarPathGraph.Path.ChainColoring.paletteNonadditivity.HaarPathGraph.Path.ChainColoring.value_reverseNonadditivity.HaarPathGraph.Path.ChainColoring.value_reverse._proof_1_1internal/detail/privateNonadditivity.HaarPathGraph.Path.ChainColoring.value_reverse._proof_1_2internal/detail/privateNonadditivity.HaarPathGraph.Path.ChainPaletteNonadditivity.HaarPathGraph.Path.chainPaletteEquivNonadditivity.HaarPathGraph.Path.paletteColoringNonadditivity.HaarPathGraph.Path.paletteColoring_of_paletteNonadditivity.HaarPathGraph.Path.paletteColoring_paletteNonadditivity.HaarPathGraph.Path.paletteWordNonadditivity.HaarPathGraph.Path.paletteWord._proof_1internal/detail/privateNonadditivity.HaarPathGraph.Path.paletteWord._proof_2internal/detail/privateNonadditivity.HaarPathGraph.Path.paletteWord._proof_3internal/detail/privateNonadditivity.HaarPathGraph.Path.paletteWord.eq_1internal/detail/privateNonadditivity.HaarPathGraph.Path.paletteWord_representativeNonadditivity.HaarPathGraph.Path.paletteWord_reversalNonadditivity.HaarPathGraph.Path.paletteWord_reversal._proof_1_1internal/detail/privateNonadditivity.HaarPathGraph.Path.paletteWord_reverse_representativeNonadditivity.HaarPathGraph.Path.paletteWord_wordNonadditivity.HaarPathGraph.Path.word_cast_chain
Full module
1/-2Copyright (c) 2026 the Nonadditivity project contributors.3All rights reserved. See COPYRIGHT.md for licensing and attribution.4-/56import Nonadditivity.HaarChainColoring7import Nonadditivity.HaarProfileWordReverse8import Nonadditivity.HaarRepresentativePositions910/-! # Independent unoriented profile palettes1112A choice of one reduced profile word for every unoriented core edge is exactly13a reversal-compatible assignment on all oriented chains. The equivalence has14no compatibility restrictions between distinct unoriented labels.15-/16noncomputable section17set_option backward.isDefEq.respectTransparency false18set_option maxHeartbeats 120000019namespace Nonadditivity.HaarPathGraph.Path20open HaarPathProfiles HaarProfileCoefficient21variable {V : Type*} [DecidableEq V] {d m : ℕ} (P : Path V d m)2223abbrev ChainPalette := ∀ e : P.unorientedChains,24Words d (P.representative e).val.length (P.coreChainProfile (P.representative e)).val2526def paletteWord (σ : P.ChainPalette) (c : P.CoreChain) :27Words d c.val.length (P.coreChainProfile c).val := by28classical29by_cases h : c=P.representative (P.chainLabel c)30· exact h.symm ▸ σ (P.chainLabel c)31· have hr : c=P.coreChainReverse (P.representative (P.chainLabel c)) :=32(P.eq_representative_or_reverse c).resolve_left h33exact hr.symm ▸ P.reverseProfileWord _ (σ (P.chainLabel c))3435@[simp] theorem paletteWord_representative (σ : P.ChainPalette) (e : P.unorientedChains) :36P.paletteWord σ (P.representative e)=σ e := by37simp [paletteWord,P.label_representative]38apply eq_of_heq39exact (eqRec_heq (φ := fun c : P.CoreChain =>40Words d c.val.length (P.coreChainProfile c).val) _ _).trans41(congr_arg_heq σ (P.label_representative e))4243@[simp] theorem paletteWord_reverse_representative (σ : P.ChainPalette) (e : P.unorientedChains) :44P.paletteWord σ (P.coreChainReverse (P.representative e))=45P.reverseProfileWord (P.representative e) (σ e) := by46simp [paletteWord,P.label_representative,P.coreChainReverse_ne_self]47apply eq_of_heq48exact (eqRec_heq (φ := fun c : P.CoreChain =>49Words d c.val.length (P.coreChainProfile c).val) _ _).trans (congr_arg_heq50(fun e => P.reverseProfileWord (P.representative e) (σ e))51((P.chainLabel_reverse _).trans (P.label_representative e)))5253theorem word_cast_chain {c c' : P.CoreChain} (h : c=c')54(w : Words d c.val.length (P.coreChainProfile c).val) :55word (h ▸ w)=word w := by56cases h57rfl5859/-- The coefficient uses the chosen representative word or its group inverse,60according to the literal orientation of the occurrence. -/61theorem paletteWord_word (σ : P.ChainPalette) (c : P.CoreChain) :62word (P.paletteWord σ c) =63if c=P.representative (P.chainLabel c) then word (σ (P.chainLabel c))64else (word (σ (P.chainLabel c)))⁻¹ := by65classical66unfold paletteWord67split_ifs68· exact P.word_cast_chain _ _69· rw [P.word_cast_chain,P.reverseProfileWord_word]7071theorem paletteWord_reversal (σ : P.ChainPalette) (p : P.ChainPosition) :72(P.paletteWord σ (P.reversePosition p).1).val (P.reversePosition p).2=73flipColor ((P.paletteWord σ p.1).val p.2) := by74have hpos (e : P.unorientedChains) (i : Fin (P.representative e).val.length) :75(P.paletteWord σ (P.reversePosition ⟨P.representative e,i⟩).1).val76(P.reversePosition ⟨P.representative e,i⟩).2 =77flipColor ((P.paletteWord σ (P.representative e)).val i) := by78change (P.paletteWord σ (P.coreChainReverse (P.representative e))).val79(Fin.cast (P.coreChainReverse_length _).symm i.rev) = _80rw [P.paletteWord_reverse_representative,P.paletteWord_representative,P.reverseProfileWord_val]81apply congrArg flipColor82apply congrArg (σ e).val83apply Fin.ext84simp only [Fin.val_cast,Fin.val_rev]85rw [P.coreChainReverse_length]86have hi := i.isLt87omega88obtain ⟨⟨e,i,b⟩,rfl⟩ := P.representativePosition_surjective p89cases b90· change (P.paletteWord σ (P.reversePosition (P.reversePosition ⟨P.representative e,i⟩)).1).val91(P.reversePosition (P.reversePosition ⟨P.representative e,i⟩)).2 = _92rw [P.reversePosition_involutive]93have hh := congrArg flipColor (hpos e i)94rw [flipColor_involutive] at hh95exact hh.symm96· exact hpos e i9798def paletteColoring (σ : P.ChainPalette) : P.ChainColoring where99value := P.paletteWord σ100reversal := P.paletteWord_reversal σ101102namespace ChainColoring103variable {P} (F : P.ChainColoring)104105def palette : P.ChainPalette := fun e => F.value (P.representative e)106107theorem value_reverse (c : P.CoreChain) :108F.value (P.coreChainReverse c)=P.reverseProfileWord c (F.value c) := by109apply Subtype.ext110funext i111let j : Fin c.val.length := (Fin.cast (P.coreChainReverse_length c) i).rev112have hj : Fin.cast (P.coreChainReverse_length c).symm j.rev=i := by113apply Fin.ext114simp only [j,Fin.val_cast,Fin.val_rev]115have hi : i.val<c.val.length := lt_of_lt_of_eq i.isLt (P.coreChainReverse_length c)116omega117have h := F.reversal ⟨c,j⟩118change (F.value (P.coreChainReverse c)).val119(Fin.cast (P.coreChainReverse_length c).symm j.rev)=flipColor ((F.value c).val j) at h120rw [hj] at h121rw [P.reverseProfileWord_val,h]122apply congrArg flipColor123apply congrArg (F.value c).val124apply Fin.ext125simp only [j,Fin.val_rev,Fin.val_cast]126have hl := P.coreChainReverse_length c127omega128129@[ext] theorem ext {F G : P.ChainColoring} (h : ∀ c, F.value c=G.value c) : F=G := by130cases F with131| mk f hf =>132cases G with133| mk g hg =>134have he : f=g := funext h135cases he136rfl137138end ChainColoring139140@[simp] theorem paletteColoring_palette (σ : P.ChainPalette) :141(P.paletteColoring σ).palette=σ := by142funext e143exact P.paletteWord_representative σ e144145@[simp] theorem paletteColoring_of_palette (F : P.ChainColoring) :146P.paletteColoring F.palette=F := by147apply ChainColoring.ext148intro c149change P.paletteWord F.palette c=F.value c150obtain ⟨e,hc | hc⟩ : ∃ e : P.unorientedChains,151c=P.representative e ∨ c=P.coreChainReverse (P.representative e) :=152⟨P.chainLabel c,P.eq_representative_or_reverse c⟩153· subst c154exact P.paletteWord_representative F.palette e155· subst c156rw [P.paletteWord_reverse_representative,F.value_reverse]157rfl158159/-- Exact factorization into independent actual reduced profile families. -/160def chainPaletteEquiv : P.ChainPalette ≃ P.ChainColoring where161toFun := P.paletteColoring162invFun := ChainColoring.palette163left_inv := P.paletteColoring_palette164right_inv := P.paletteColoring_of_palette165166end Nonadditivity.HaarPathGraph.Path