Exact Lean source
Nonadditivity.HaarRepresentativePositions
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
12 project constants, including generated, internal and private declarations.
12 declarations
Nonadditivity.HaarPathGraph.Path.RepresentativePositionNonadditivity.HaarPathGraph.Path.chainLabel_representativePositionNonadditivity.HaarPathGraph.Path.representativePositionNonadditivity.HaarPathGraph.Path.representativePosition.eq_1internal/detail/privateNonadditivity.HaarPathGraph.Path.representativePositionEquivNonadditivity.HaarPathGraph.Path.representativePositionEquiv._proof_1internal/detail/privateNonadditivity.HaarPathGraph.Path.representativePositionEquiv_applyNonadditivity.HaarPathGraph.Path.representativePositionEquiv_reverseNonadditivity.HaarPathGraph.Path.representativePositionEquiv_valNonadditivity.HaarPathGraph.Path.representativePosition_injectiveNonadditivity.HaarPathGraph.Path.representativePosition_surjectiveNonadditivity.HaarPathGraph.Path.representativePosition_surjective._proof_1_1internal/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.HaarCoreChainReverseAddress78/-! # Reversal-coherent coordinates on unoriented core edges -/9noncomputable section10set_option backward.isDefEq.respectTransparency false11set_option maxHeartbeats 120000012namespace Nonadditivity.HaarPathGraph.Path13variable {V : Type*} [DecidableEq V] {d m : ℕ} (P : Path V d m)1415abbrev RepresentativePosition := Σ e : P.unorientedChains, Fin (P.representative e).val.length × Bool1617def representativePosition (p : P.RepresentativePosition) : P.ChainPosition :=18if p.2.2 then ⟨P.representative p.1,p.2.1⟩ else19P.reversePosition ⟨P.representative p.1,p.2.1⟩2021lemma chainLabel_representativePosition (p : P.RepresentativePosition) :22P.chainLabel (P.representativePosition p).1=p.1 := by23obtain ⟨e,i,b⟩ := p24cases b <;> simp [representativePosition,reversePosition,P.label_representative]2526theorem representativePosition_injective : Function.Injective P.representativePosition := by27rintro ⟨e,i,b⟩ ⟨e',i',b'⟩ he28have hee : e=e' := by29simpa only [P.chainLabel_representativePosition] using congrArg (fun q => P.chainLabel q.1) he30subst e'31cases b <;> cases b'32· have hh := congrArg P.reversePosition he33simp only [representativePosition,Bool.false_eq_true,ite_false,P.reversePosition_involutive] at hh34have hi : i=i' := by cases hh; rfl35subst i'; rfl36· have hh := congrArg Sigma.fst he37change P.coreChainReverse (P.representative e)=P.representative e at hh38exact (P.coreChainReverse_ne_self _ hh).elim39· have hh := congrArg Sigma.fst he40change P.representative e=P.coreChainReverse (P.representative e) at hh41exact (P.coreChainReverse_ne_self _ hh.symm).elim42· have hi : i=i' := by cases he; rfl43subst i'; rfl4445theorem representativePosition_surjective : Function.Surjective P.representativePosition := by46rintro ⟨c,i⟩47have hex : ∃ e : P.unorientedChains,48c=P.representative e ∨ c=P.coreChainReverse (P.representative e) :=49⟨P.chainLabel c,P.eq_representative_or_reverse c⟩50obtain ⟨e,hc | hc⟩ := hex51· subst c52exact ⟨⟨e,i,true⟩,rfl⟩53· subst c54let j : Fin (P.representative e).val.length :=55(Fin.cast (P.coreChainReverse_length (P.representative e)) i).rev56refine ⟨⟨e,j,false⟩,?_⟩57change P.reversePosition ⟨P.representative e,j⟩=⟨P.coreChainReverse (P.representative e),i⟩58have hj : Fin.cast (P.coreChainReverse_length (P.representative e)).symm j.rev=i := by59apply Fin.ext60simp only [j,Fin.val_cast,Fin.val_rev]61have hi : i.val < (P.representative e).val.length :=62lt_of_lt_of_eq i.isLt (P.coreChainReverse_length _)63omega64exact congrArg (fun k => Sigma.mk (P.coreChainReverse (P.representative e)) k) hj6566/-- Each graph dart is exactly one representative position and one orientation. -/67def representativePositionEquiv : P.RepresentativePosition ≃ P.darts :=68(Equiv.ofBijective P.representativePosition69⟨P.representativePosition_injective,P.representativePosition_surjective⟩).trans P.positionEquiv7071@[simp] theorem representativePositionEquiv_apply (p : P.RepresentativePosition) :72P.representativePositionEquiv p=P.positionDart (P.representativePosition p) := rfl7374/-- Its value formula makes reversal independent of the chain-position index. -/75theorem representativePositionEquiv_val (e : P.unorientedChains)76(i : Fin (P.representative e).val.length) (b : Bool) :77(P.representativePositionEquiv ⟨e,i,b⟩).val =78if b then (P.representative e).val.get i else reverse ((P.representative e).val.get i) := by79cases b80· rw [representativePositionEquiv_apply]81change (P.positionDart (P.reversePosition ⟨P.representative e,i⟩)).val=_82rw [P.positionDart_reversePosition]83rfl84· rfl8586theorem representativePositionEquiv_reverse (e : P.unorientedChains)87(i : Fin (P.representative e).val.length) (b : Bool) :88P.representativePositionEquiv ⟨e,i,!b⟩=89⟨reverse (P.representativePositionEquiv ⟨e,i,b⟩).val,90P.reverse_mem (P.representativePositionEquiv ⟨e,i,b⟩).property⟩ := by91apply Subtype.ext92simp only [P.representativePositionEquiv_val]93cases b <;> simp9495end Nonadditivity.HaarPathGraph.Path