Exact Lean source
Nonadditivity.HaarCoreChainLabels
Download original .lean · View on GitHub · Jump to source
Imported by project modules
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
12 project constants, including generated, internal and private declarations.
12 declarations
Nonadditivity.HaarPathGraph.Path.card_chainLabelsNonadditivity.HaarPathGraph.Path.chainLabelNonadditivity.HaarPathGraph.Path.chainLabel._proof_1internal/detail/privateNonadditivity.HaarPathGraph.Path.chainLabel_reverseNonadditivity.HaarPathGraph.Path.chainLabels_coverNonadditivity.HaarPathGraph.Path.chain_or_reverse_mem_decompositionNonadditivity.HaarPathGraph.Path.dart_eq_traversal_or_reverseNonadditivity.HaarPathGraph.Path.eq_representative_or_reverseNonadditivity.HaarPathGraph.Path.label_representativeNonadditivity.HaarPathGraph.Path.representativeNonadditivity.HaarPathGraph.Path.representative._proof_1internal/detail/privateNonadditivity.HaarPathGraph.Path.representative_mem
Full module
1/-2Copyright (c) 2026 the Nonadditivity project contributors.3All rights reserved. See COPYRIGHT.md for licensing and attribution.4-/56import Nonadditivity.HaarPathChainPartition7import Nonadditivity.HaarPathCoefficientWords89/-! # Literal unoriented labels of the actual core-chain occurrence sequence1011Every compressed edge occurs in the path, and the two orientations have the12same label. Thus the number of variables in the endpoint sum is exactly the13number of unoriented core edges, rather than the number of traversals.14-/1516noncomputable section17set_option backward.isDefEq.respectTransparency false1819namespace Nonadditivity.HaarPathGraph.Path2021variable {V : Type*} [DecidableEq V] {d m : ℕ} (P : Path V d m)2223/-- The literal orientation-free label of a core-chain occurrence. -/24def chainLabel (c : P.CoreChain) : P.unorientedChains :=25⟨{c, P.coreChainReverse c}, Finset.mem_image.mpr ⟨c, Finset.mem_univ _, rfl⟩⟩2627@[simp] theorem chainLabel_reverse (c : P.CoreChain) :28P.chainLabel (P.coreChainReverse c) = P.chainLabel c := by29apply Subtype.ext30change {P.coreChainReverse c, P.coreChainReverse (P.coreChainReverse c)} =31{c, P.coreChainReverse c}32rw [P.coreChainReverse_involutive]33exact Finset.pair_comm _ _3435/-- Every orientation of every graph edge is either an original traversal36or the reverse of an original traversal. -/37theorem dart_eq_traversal_or_reverse (q : Dart V d) (hq : q ∈ P.darts) :38∃ i : Fin m, q = P.traversal i ∨ q = reverse (P.traversal i) := by39have he : q.1 ∈ P.edges := (Finset.mem_product.mp hq).140obtain ⟨i, hi⟩ := List.mem_ofFn.mp (List.mem_toFinset.mp he)41have hedge : (P.traversal i).1 = q.1 := hi42refine ⟨i, ?_⟩43by_cases hb : q.2 = (P.traversal i).244· exact Or.inl (Prod.ext hedge.symm hb)45· right46refine Prod.ext (show q.1 = (reverse (P.traversal i)).1 from hedge.symm) ?_47change q.2 = !(P.traversal i).248cases hq2 : q.2 <;> cases ht2 : (P.traversal i).2 <;> simp_all4950/-- Every core chain occurs in one of its two orientations in the actual51maximal-chain decomposition. -/52theorem chain_or_reverse_mem_decomposition (cs : List P.CoreChain)53(hcs : (cs.map Subtype.val).flatten = P.traversalList) (c : P.CoreChain) :54c ∈ cs ∨ P.coreChainReverse c ∈ cs := by55let q := c.val.head (P.toCore_nonempty c.property.1)56have hqc : q ∈ c.val := List.head_mem _57have hq : q ∈ P.darts := P.toCore_mem c.property.1 hqc58obtain ⟨i,hi | hi⟩ := P.dart_eq_traversal_or_reverse q hq59· have hmem : q ∈ (cs.map Subtype.val).flatten := by60rw [hcs, hi]61exact List.mem_ofFn.mpr ⟨i,rfl⟩62obtain ⟨l,hl,hql⟩ := List.mem_flatten.mp hmem63obtain ⟨c',hc',rfl⟩ := List.mem_map.mp hl64have he := P.coreChain_eq_of_common_dart c c' hqc hql65exact Or.inl (he.symm ▸ hc')66· have hmem : reverse q ∈ (cs.map Subtype.val).flatten := by67rw [hcs, hi, reverse_reverse]68exact List.mem_ofFn.mpr ⟨i,rfl⟩69obtain ⟨l,hl,hql⟩ := List.mem_flatten.mp hmem70obtain ⟨c',hc',rfl⟩ := List.mem_map.mp hl71have hrev : reverse q ∈ (P.coreChainReverse c).val := by72exact List.mem_map.mpr ⟨q,List.mem_reverse.mpr hqc,rfl⟩73have he := P.coreChain_eq_of_common_dart (P.coreChainReverse c) c' hrev hql74exact Or.inr (he.symm ▸ hc')7576/-- The occurrence sequence covers every actual orientation-free core label. -/77theorem chainLabels_cover (cs : List P.CoreChain)78(hcs : (cs.map Subtype.val).flatten = P.traversalList) :79∀ e : P.unorientedChains, ∃ c ∈ cs, P.chainLabel c = e := by80intro e81obtain ⟨c,hc,he⟩ := Finset.mem_image.mp e.property82have hel : P.chainLabel c = e := Subtype.ext he83rcases P.chain_or_reverse_mem_decomposition cs hcs c with hc | hc84· exact ⟨c,hc,hel⟩85· exact ⟨P.coreChainReverse c,hc,(P.chainLabel_reverse c).trans hel⟩8687/-- There are exactly as many distinct occurrence labels as actual core edges. -/88theorem card_chainLabels (cs : List P.CoreChain)89(hcs : (cs.map Subtype.val).flatten = P.traversalList) :90(cs.map P.chainLabel).toFinset.card = P.unorientedChains.card := by91have he : (cs.map P.chainLabel).toFinset = Finset.univ := by92apply Finset.eq_univ_of_forall93intro e94obtain ⟨c,hc,rfl⟩ := P.chainLabels_cover cs hcs e95exact List.mem_toFinset.mpr (List.mem_map_of_mem hc)96rw [he, Finset.card_univ, Fintype.card_coe]9798/-- Pick one of the two literal orientations of each compressed edge. -/99def representative (e : P.unorientedChains) : P.CoreChain :=100(show e.val.Nonempty from by101obtain ⟨c,hc,he⟩ := Finset.mem_image.mp e.property102rw [←he]103exact ⟨c,by simp⟩).choose104105theorem representative_mem (e : P.unorientedChains) : P.representative e ∈ e.val :=106by107unfold representative108exact Classical.choose_spec _109110theorem label_representative (e : P.unorientedChains) : P.chainLabel (P.representative e) = e := by111obtain ⟨c,hc,he⟩ := Finset.mem_image.mp e.property112apply Subtype.ext113exact (HaarPathInvolution.pair_eq_of_mem P.coreChainReverse_involutive114(he ▸ P.representative_mem e)).trans he115116/-- Each actual oriented occurrence is its representative or its reverse. -/117theorem eq_representative_or_reverse (c : P.CoreChain) :118c = P.representative (P.chainLabel c) ∨119c = P.coreChainReverse (P.representative (P.chainLabel c)) := by120have h := P.representative_mem (P.chainLabel c)121change P.representative (P.chainLabel c) ∈ {c,P.coreChainReverse c} at h122rcases Finset.mem_insert.mp h with h | h123· exact Or.inl h.symm124· have he := Finset.mem_singleton.mp h125exact Or.inr (by rw [he,P.coreChainReverse_involutive])126127end Nonadditivity.HaarPathGraph.Path