Exact Lean source
Nonadditivity.HaarChainReindex
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
10 project constants, including generated, internal and private declarations.
10 declarations
Nonadditivity.HaarPathGraph.Path.chainReindexNonadditivity.HaarPathGraph.Path.chainReindex.eq_1internal/detail/privateNonadditivity.HaarPathGraph.Path.chainReindex_apply_positionNonadditivity.HaarPathGraph.Path.chainReindex_countNonadditivity.HaarPathGraph.Path.chainReindex_fixed_coreNonadditivity.HaarPathGraph.Path.chainReindex_mem_core_iffNonadditivity.HaarPathGraph.Path.chainReindex_reverseNonadditivity.HaarPathGraph.Path.representativeReindexNonadditivity.HaarPathGraph.Path.representativeReindex._proof_1internal/detail/privateNonadditivity.HaarPathGraph.Path.representativeReindex._proof_2internal/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.HaarRepresentativePositions7import Nonadditivity.HaarCoreChainMultiplicity8import Nonadditivity.HaarCoreChainEndpoints910/-! # Reversal-coherent reindexing inside unoriented core edges -/11noncomputable section12attribute [local instance 2000] instBEqOfDecidableEq13set_option backward.isDefEq.respectTransparency false14set_option maxHeartbeats 120000015namespace Nonadditivity.HaarPathGraph.Path16variable {V : Type*} [DecidableEq V] {d m : ℕ} (P : Path V d m)1718def representativeReindex (σ : ∀ e : P.unorientedChains,19Equiv.Perm (Fin (P.representative e).val.length)) : Equiv.Perm P.RepresentativePosition where20toFun p := ⟨p.1,σ p.1 p.2.1,p.2.2⟩21invFun p := ⟨p.1,(σ p.1).symm p.2.1,p.2.2⟩22left_inv := by rintro ⟨e,i,b⟩; simp23right_inv := by rintro ⟨e,i,b⟩; simp2425/-- Reindex the positions of each unoriented edge, simultaneously and coherently26in its two orientations. -/27def chainReindex (σ : ∀ e : P.unorientedChains,28Equiv.Perm (Fin (P.representative e).val.length)) : Equiv.Perm P.darts :=29P.representativePositionEquiv.symm.trans30((P.representativeReindex σ).trans P.representativePositionEquiv)3132@[simp] theorem chainReindex_apply_position (σ : ∀ e : P.unorientedChains,33Equiv.Perm (Fin (P.representative e).val.length))34(e : P.unorientedChains) (i : Fin (P.representative e).val.length) (b : Bool) :35P.chainReindex σ (P.representativePositionEquiv ⟨e,i,b⟩)=36P.representativePositionEquiv ⟨e,σ e i,b⟩ := by37simp only [chainReindex,Equiv.trans_apply,Equiv.symm_apply_apply]38rfl3940theorem chainReindex_reverse (σ : ∀ e : P.unorientedChains,41Equiv.Perm (Fin (P.representative e).val.length)) (q : P.darts) :42P.chainReindex σ ⟨reverse q.val,P.reverse_mem q.property⟩ =43⟨reverse (P.chainReindex σ q).val,P.reverse_mem (P.chainReindex σ q).property⟩ := by44obtain ⟨⟨e,i,b⟩,rfl⟩ := P.representativePositionEquiv.surjective q45rw [←P.representativePositionEquiv_reverse,P.chainReindex_apply_position,46P.chainReindex_apply_position,P.representativePositionEquiv_reverse]4748/-- Directed traversal multiplicity is constant along a chain, so arbitrary49reindexing within that chain preserves the literal number of occurrences. -/50theorem chainReindex_count (σ : ∀ e : P.unorientedChains,51Equiv.Perm (Fin (P.representative e).val.length)) (q : P.darts) :52P.traversalList.count q.val=P.traversalList.count (P.chainReindex σ q).val := by53obtain ⟨j,hj⟩ := P.dart_eq_traversal_or_reverse q.val q.property54have hm : 0<m := Nat.zero_lt_of_lt j.isLt55obtain ⟨⟨e,i,b⟩,rfl⟩ := P.representativePositionEquiv.surjective q56rw [P.chainReindex_apply_position]57simp only [P.representativePositionEquiv_val]58cases b59· simp only [Bool.false_eq_true,ite_false]60apply P.traversal_count_constant_on_chain hm (P.coreChainReverse (P.representative e))61· exact List.mem_map.mpr ⟨_,List.mem_reverse.mpr (List.get_mem _ _),rfl⟩62· exact List.mem_map.mpr ⟨_,List.mem_reverse.mpr (List.get_mem _ _),rfl⟩63· simp only [ite_true]64exact P.traversal_count_constant_on_chain hm (P.representative e)65(List.get_mem _ _) (List.get_mem _ _)6667/-- Fixing the chain endpoints fixes every dart whose source is a core vertex. -/68theorem chainReindex_fixed_core (σ : ∀ e : P.unorientedChains,69Equiv.Perm (Fin (P.representative e).val.length))70(hfix : ∀ e i, (i.val=0 ∨ i.val+1=(P.representative e).val.length) → σ e i=i)71(q : P.darts) (hq : source q.val∈P.coreVertices) : P.chainReindex σ q=q := by72obtain ⟨⟨e,i,b⟩,rfl⟩ := P.representativePositionEquiv.surjective q73rw [P.chainReindex_apply_position]74have hi : i.val=0 ∨ i.val+1=(P.representative e).val.length := by75rw [P.representativePositionEquiv_val] at hq76cases b77· exact Or.inr ((P.coreChain_reverse_source_mem_core_iff _ _).mp hq)78· exact Or.inl ((P.coreChain_source_mem_core_iff _ _).mp hq)79rw [hfix e i hi]8081theorem chainReindex_mem_core_iff (σ : ∀ e : P.unorientedChains,82Equiv.Perm (Fin (P.representative e).val.length))83(hfix : ∀ e i, (i.val=0 ∨ i.val+1=(P.representative e).val.length) → σ e i=i)84(q : P.darts) : source (P.chainReindex σ q).val∈P.coreVertices ↔ source q.val∈P.coreVertices := by85constructor86· intro hc87have hfixed := P.chainReindex_fixed_core σ hfix (P.chainReindex σ q) hc88have he := (P.chainReindex σ).injective hfixed89simpa only [he] using hc90· intro hc91rw [P.chainReindex_fixed_core σ hfix q hc]92exact hc9394end Nonadditivity.HaarPathGraph.Path