Exact Lean source
Nonadditivity.HaarPathWeightTransport
Download original .lean · View on GitHub · Jump to source
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
15 project constants, including generated, internal and private declarations.
15 declarations
Nonadditivity.HaarPathWeightTransport.dartEntryNonadditivity.HaarPathWeightTransport.dartEntry.eq_1internal/detail/privateNonadditivity.HaarPathWeightTransport.dartRelabelNonadditivity.HaarPathWeightTransport.dartRelabel._proof_1internal/detail/privateNonadditivity.HaarPathWeightTransport.dartRelabel._proof_2internal/detail/privateNonadditivity.HaarPathWeightTransport.dartRelabel.eq_1internal/detail/privateNonadditivity.HaarPathWeightTransport.dartRelabel_colorNonadditivity.HaarPathWeightTransport.dartRelabel_eq_of_entry_permsNonadditivity.HaarPathWeightTransport.dartRelabel_reverseNonadditivity.HaarPathWeightTransport.integral_pathProduct_eq_of_dart_transportNonadditivity.HaarPathWeightTransport.pathEntries_eq_map_traversalNonadditivity.HaarPathWeightTransport.selected_map_signedRelabelNonadditivity.HaarPathWeightTransport.signedRelabelNonadditivity.HaarPathWeightTransport.signedRelabel.eq_1internal/detail/privateNonadditivity.HaarPathWeightTransport.traversalList_perm_of_dart_counts
Full module
1/-2Copyright (c) 2026 the Nonadditivity project contributors.3All rights reserved. See COPYRIGHT.md for licensing and attribution.4-/56import Nonadditivity.HaarPathColorRelabel7import Nonadditivity.HaarPathRelabel89/-! # Exact transport of Haar path weights1011Color-preserving dart matching, including literal traversal multiplicities,12gives equality of actual Haar integrals. The intermediate permutations act13independently on the row and column labels of each matrix family.14-/15noncomputable section16set_option backward.isDefEq.respectTransparency false17set_option maxHeartbeats 120000018set_option linter.unusedSectionVars false19namespace Nonadditivity.HaarPathWeightTransport20open HaarPathGraph HaarPathProfiles HaarPathClasses HaarPathWeights21open HaarPathColorRelabel MeasureTheory HaarModel22variable {V : Type*} [Fintype V] [DecidableEq V] {d m : ℕ}2324def dartRelabel (σ τ : Fin d → Equiv.Perm V) : Equiv.Perm (Dart V d) where25toFun q := ((σ q.1.2.1 q.1.1,q.1.2.1,τ q.1.2.1 q.1.2.2),q.2)26invFun q := (((σ q.1.2.1).symm q.1.1,q.1.2.1,(τ q.1.2.1).symm q.1.2.2),q.2)27left_inv q := by simp28right_inv q := by simp2930@[simp] theorem dartRelabel_color (σ τ : Fin d → Equiv.Perm V) (q : Dart V d) :31color (dartRelabel σ τ q)=color q := rfl3233@[simp] theorem dartRelabel_reverse (σ τ : Fin d → Equiv.Perm V) (q : Dart V d) :34dartRelabel σ τ (reverse q)=reverse (dartRelabel σ τ q) := rfl3536theorem dartRelabel_eq_of_entry_perms {P Q : Path V d m}37(F : {q // q∈P.darts} ≃ {q // q∈Q.darts})38(hcolor : ∀ q, color (F q).val=color q.val)39(hrev : ∀ q : {q // q∈P.darts},40F ⟨reverse q.val,P.reverse_mem q.property⟩ =41⟨reverse (F q).val,Q.reverse_mem (F q).property⟩)42(σ τ : Fin d → Equiv.Perm V)43(hp : ∀ q : {q // q∈P.darts}, ∀ a : Fin d,44color q.val=(a,true) →45σ a (source q.val)=source (F q).val ∧46τ a (source (reverse q.val))=source (reverse (F q).val))47(q : {q // q∈P.darts}) : dartRelabel σ τ q.val=(F q).val := by48have hpos (r : {q // q∈P.darts}) (hb : r.val.2=true) :49dartRelabel σ τ r.val=(F r).val := by50have hr : color r.val=(r.val.1.2.1,true) := by simp only [color,hb]51obtain ⟨hrow,hcol⟩ := hp r r.val.1.2.1 hr52have hc := hcolor r53have hb' : (F r).val.2=true := (congrArg Prod.snd hc).trans hb54apply (dart_eq_iff_source_color_target _ _).mpr55refine ⟨?_,hc.symm,?_⟩56· simpa only [dartRelabel,Equiv.coe_fn_mk,source,hb,ite_true,hb'] using hrow57· simpa only [dartRelabel,Equiv.coe_fn_mk,source,reverse,hb,hb',58Bool.not_true,Bool.false_eq_true,ite_false] using hcol59cases hb : q.val.260· let r : {q // q∈P.darts} := ⟨reverse q.val,P.reverse_mem q.property⟩61have hr : r.val.2=true := by simp only [r,reverse,hb,Bool.not_false]62have he := hpos r hr63have he' := congrArg reverse he64simpa only [r,dartRelabel_reverse,hrev,reverse_reverse] using he'65· exact hpos q hb6667theorem traversalList_perm_of_dart_counts {P Q : Path V d m}68(F : {q // q∈P.darts} ≃ {q // q∈Q.darts})69(E : Equiv.Perm (Dart V d)) (hE : ∀ q, E q.val=(F q).val)70(hcount : ∀ q : {q // q∈P.darts},71P.traversalList.count q.val=Q.traversalList.count (F q).val) :72Q.traversalList.Perm (P.traversalList.map E) := by73classical74apply List.perm_iff_count.mpr75intro r76obtain ⟨q,rfl⟩ := E.surjective r77rw [List.count_map_of_injective _ _ E.injective]78by_cases hq : q∈P.darts79· rw [hE ⟨q,hq⟩]80exact (hcount ⟨q,hq⟩).symm81· have hn : E q∉Q.darts := by82intro he83obtain ⟨r,hr⟩ := F.surjective ⟨E q,he⟩84have hEq : E r.val=E q := (hE r).trans (congrArg Subtype.val hr)85exact hq (E.injective hEq ▸ r.property)86have hP : q∉P.traversalList := by87intro h88obtain ⟨i,hi⟩ := List.mem_ofFn.mp h89exact hq (hi ▸ P.traversal_mem i)90have hQ : E q∉Q.traversalList := by91intro h92obtain ⟨i,hi⟩ := List.mem_ofFn.mp h93exact hn (hi ▸ Q.traversal_mem i)94rw [List.count_eq_zero.mpr hP,List.count_eq_zero.mpr hQ]9596def dartEntry {N : ℕ} (q : Dart (Fin (N+1)) 2) : SignedEntry N :=97(color q,(q.1.1,q.1.2.2))9899theorem pathEntries_eq_map_traversal {N m : ℕ} (P : Path (Fin (N+1)) 2 m) :100pathEntries P=P.traversalList.map dartEntry := by101simp only [pathEntries,Path.traversalList,List.map_ofFn]102congr 1103funext i104cases hb : (P.colors i).2 <;>105simp [dartEntry,Path.traversal,dart,edge,color,hb]106all_goals exact Prod.ext rfl hb107108def signedRelabel {N : ℕ} (σ τ : Fin 2 → Equiv.Perm (Fin (N+1)))109(e : SignedEntry N) : SignedEntry N := (e.1,(σ e.1.1 e.2.1,τ e.1.1 e.2.2))110111theorem selected_map_signedRelabel {N : ℕ}112(σ τ : Fin 2 → Equiv.Perm (Fin (N+1))) (c : Color 2) (L : List (SignedEntry N)) :113selected c (L.map (signedRelabel σ τ))=114relabelEntries (σ c.1) (τ c.1) (selected c L) := by115induction L with116| nil => rfl117| cons e L ih =>118by_cases he : e.1=c119· simp [selected,signedRelabel,relabelEntries,he] at ih ⊢120exact ih121· simp [selected,signedRelabel,relabelEntries,he] at ih ⊢122exact ih123124/-- Literal multiplicity-preserving colored dart matching preserves the exact125path expectation, with no restrictions on the degree or matrix dimension. -/126theorem integral_pathProduct_eq_of_dart_transport {N m : ℕ}127{P Q : Path (Fin (N+1)) 2 m} (h : SamePattern P Q)128(F : {q // q∈P.darts} ≃ {q // q∈Q.darts})129(hcolor : ∀ q, color (F q).val=color q.val)130(hcore : ∀ q, source q.val∈P.coreVertices →131source (F q).val=h.vertexPerm (source q.val))132(hcoreiff : ∀ q, source (F q).val∈Q.coreVertices ↔ source q.val∈P.coreVertices)133(hrev : ∀ q : {q // q∈P.darts},134F ⟨reverse q.val,P.reverse_mem q.property⟩ =135⟨reverse (F q).val,Q.reverse_mem (F q).property⟩)136(hcount : ∀ q : {q // q∈P.darts},137P.traversalList.count q.val=Q.traversalList.count (F q).val) :138(∫ U : LocalUnitary N × LocalUnitary N, pathProduct P U ∂(haar N).prod (haar N)) =139∫ U : LocalUnitary N × LocalUnitary N, pathProduct Q U ∂(haar N).prod (haar N) := by140obtain ⟨σ,τ,hp⟩ := exists_family_entry_perms h F hcolor hcore hcoreiff hrev141have hE := dartRelabel_eq_of_entry_perms F hcolor hrev σ τ hp142have ht := traversalList_perm_of_dart_counts F (dartRelabel σ τ) hE hcount143have he : (pathEntries Q).Perm ((pathEntries P).map (signedRelabel σ τ)) := by144rw [pathEntries_eq_map_traversal,pathEntries_eq_map_traversal]145convert ht.map dartEntry using 1 <;> simp only [List.map_map] <;> rfl146have hs (a : Fin 2) (b : Bool) :147(selected (a,b) (pathEntries Q)).Perm148(relabelEntries (σ a) (τ a) (selected (a,b) (pathEntries P))) := by149rw [←selected_map_signedRelabel σ τ (a,b) (pathEntries P)]150exact (he.filter _).map Prod.snd151simp_rw [pathProduct_eq]152exact (integral_signedProduct_eq_of_family_relabel (pathEntries P) (pathEntries Q) σ τ hs).symm153154end Nonadditivity.HaarPathWeightTransport