Exact Lean source
Nonadditivity.HaarPathNormalizedTree
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
23 project constants, including generated, internal and private declarations.
23 declarations
Nonadditivity.HaarPathGraph.Path.discoveryGraph_eq_of_vertex_prefixNonadditivity.HaarPathGraph.Path.discoveryGraph_eq_of_vertex_prefix._proof_1_1internal/detail/privateNonadditivity.HaarPathGraph.Path.discoveryGraph_eq_of_vertex_prefix._proof_1_2internal/detail/privateNonadditivity.HaarPathGraph.Path.namedPath_tree_edge_mem_iffNonadditivity.HaarPathGraph.Path.namedPath_tree_edge_mem_iff._simp_1_1internal/detail/privateNonadditivity.HaarPathGraph.Path.named_old_tree_reconstructionNonadditivity.HaarPathGraph.Path.named_old_tree_reconstruction._proof_1internal/detail/privateNonadditivity.HaarPathGraph.Path.named_old_tree_reconstruction._proof_1_1internal/detail/privateNonadditivity.HaarPathGraph.Path.named_old_tree_reconstruction._proof_1_2internal/detail/privateNonadditivity.HaarPathGraph.Path.named_old_tree_reconstruction._proof_1_3internal/detail/privateNonadditivity.HaarPathGraph.Path.named_old_tree_reconstruction._proof_1_4internal/detail/privateNonadditivity.HaarPathGraph.Path.named_old_tree_reconstruction._proof_1_5internal/detail/privateNonadditivity.HaarPathGraph.Path.named_old_tree_reconstruction._proof_1_6internal/detail/privateNonadditivity.HaarPathGraph.Path.named_old_tree_reconstruction._proof_1_7internal/detail/privateNonadditivity.HaarPathGraph.Path.named_old_tree_reconstruction._proof_1_8internal/detail/privateNonadditivity.HaarPathGraph.Path.named_old_tree_reconstruction._proof_1_9internal/detail/privateNonadditivity.HaarPathGraph.Path.named_old_tree_reconstruction._proof_2internal/detail/privateNonadditivity.HaarPathGraph.Path.oldTreeSegment.congr_simpNonadditivity.HaarPathGraph.Path.old_tree_segment_reconstructionNonadditivity.HaarPathGraph.Path.old_tree_segment_reconstruction._proof_1_1internal/detail/privateNonadditivity.HaarPathGraph.Path.old_tree_segment_reconstruction._proof_1_2internal/detail/privateNonadditivity.HaarPathGraph.Path.old_tree_segment_reconstruction._proof_1_4internal/detail/privateNonadditivity.HaarPathGraph.Path.old_tree_segment_reconstruction._proof_1_5internal/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.HaarPathTreeSegment7import Nonadditivity.HaarPathVertexNames89/-! # Endpoint reconstruction of actual old-tree intervals -/10noncomputable section11set_option maxHeartbeats 150000012set_option linter.unusedSectionVars false13namespace Nonadditivity.HaarPathGraph.Path14open HaarPathGraph HaarPathProfiles HaarPathClasses15variable {V : Type*} [DecidableEq V] {d m : ℕ}1617theorem discoveryGraph_eq_of_vertex_prefix (P Q : Path V d m) (a : ℕ)18(hv : ∀ j : Fin (m+1), j.val ≤ a → P.vertex j=Q.vertex j) :19P.discoveryGraph a=Q.discoveryGraph a := by20have hf (i : Fin m) (hi : i.val<a) : P.FirstVisit i ↔ Q.FirstVisit i := by21constructor22· intro hp j hj23rw [← hv j (by omega), ← hv i.succ (by simp; omega)]24exact hp j hj25· intro hq j hj26rw [hv j (by omega), hv i.succ (by simp; omega)]27exact hq j hj28ext x y29constructor30· rintro ⟨i,hi,hia,hxy⟩31refine ⟨i,(hf i hia).mp hi,hia,?_⟩32simpa only [hv i.castSucc (by simp; omega),hv i.succ (by simp; omega)] using hxy33· rintro ⟨i,hi,hia,hxy⟩34refine ⟨i,(hf i hia).mpr hi,hia,?_⟩35simpa only [hv i.castSucc (by simp; omega),hv i.succ (by simp; omega)] using hxy3637/-- An old-tree interval is determined by the decoded tree and its endpoint,38including the interval length. -/39theorem old_tree_segment_reconstruction (P Q : Path V d m) (a lP lQ : ℕ)40(hP : a+lP ≤ m) (hQ : a+lQ ≤ m)41(htP : ∀ i : Fin m, a ≤ i.val → i.val<a+lP → P.edgeAt i∈P.treeEdges)42(hoP : ∀ i : Fin m, a ≤ i.val → i.val<a+lP → ¬P.FirstVisit i)43(htQ : ∀ i : Fin m, a ≤ i.val → i.val<a+lQ → Q.edgeAt i∈Q.treeEdges)44(hoQ : ∀ i : Fin m, a ≤ i.val → i.val<a+lQ → ¬Q.FirstVisit i)45(hv : ∀ j : Fin (m+1), j.val ≤ a → P.vertex j=Q.vertex j)46(he : P.vertexAt (a+lP)=Q.vertexAt (a+lQ)) :47lP=lQ ∧ ∀ t, t ≤ lP → P.vertexAt (a+t)=Q.vertexAt (a+t) := by48have hg := discoveryGraph_eq_of_vertex_prefix P Q a hv49have hs : P.vertexAt a=Q.vertexAt a := by50rw [P.vertexAt_eq a (by omega),Q.vertexAt_eq a (by omega)]51exact hv ⟨a,by omega⟩ le_rfl52let wP := P.oldTreeSegment a lP hP htP hoP53let wQ := Q.oldTreeSegment a lQ hQ htQ hoQ54let w := (wP.mapLe hg.le).copy hs he55have hr : w.edges.IsChain (· ≠ ·) := by56simpa only [w,SimpleGraph.Walk.edges_copy,SimpleGraph.Walk.edges_mapLe_eq_edges] using57P.oldTreeSegment_reduced a lP hP htP hoP58have hw : w=wQ := Q.discovery_tree_route_unique a w wQ hr59(Q.oldTreeSegment_reduced a lQ hQ htQ hoQ)60have hlist : List.ofFn (fun t : Fin (lP+1) => P.vertexAt (a+t.val)) =61List.ofFn (fun t : Fin (lQ+1) => Q.vertexAt (a+t.val)) := by62have hh := congrArg SimpleGraph.Walk.support hw63simpa only [w,wP,wQ,SimpleGraph.Walk.support_copy,SimpleGraph.Walk.support_mapLe_eq_support,64oldTreeSegment_support] using hh65have hlen : lP=lQ := by66have hh := congrArg List.length hlist67simp only [List.length_ofFn] at hh68omega69refine ⟨hlen,?_⟩70subst lQ71intro t ht72exact congrFun (List.ofFn_inj.mp hlist) ⟨t,by omega⟩7374theorem namedPath_tree_edge_mem_iff (P : Path V d m) (hm : 0<m) (i : Fin m) :75(P.namedPath hm).edgeAt i ∈ (P.namedPath hm).treeEdges ↔ P.edgeAt i ∈ P.treeEdges := by76simp only [treeEdges,Finset.mem_image,P.namedPath_firstTimes hm,P.namedPath_edgeAt_eq_iff hm]7778/-- Matching names at the old endpoint identify the whole old-tree route. -/79theorem named_old_tree_reconstruction (P Q : Path V d m) (hm : 0<m)80(a bP bQ : ℕ) (haP : a ≤ bP) (haQ : a ≤ bQ) (hPm : bP ≤ m) (hQm : bQ ≤ m)81(htP : ∀ i : Fin m, a ≤ i.val → i.val<bP → P.edgeAt i∈P.treeEdges)82(hoP : ∀ i : Fin m, a ≤ i.val → i.val<bP → ¬P.FirstVisit i)83(htQ : ∀ i : Fin m, a ≤ i.val → i.val<bQ → Q.edgeAt i∈Q.treeEdges)84(hoQ : ∀ i : Fin m, a ≤ i.val → i.val<bQ → ¬Q.FirstVisit i)85(hv : ∀ j : Fin (m+1), j.val ≤ a → P.vertexName hm j=Q.vertexName hm j)86(he : P.vertexName hm ⟨bP,by omega⟩=Q.vertexName hm ⟨bQ,by omega⟩) :87bP=bQ ∧ ∀ j : Fin (m+1), a ≤ j.val → j.val ≤ bP →88P.vertexName hm j=Q.vertexName hm j := by89have hbP : a+(bP-a)=bP := by omega90have hbQ : a+(bQ-a)=bQ := by omega91obtain ⟨hl,hv'⟩ := old_tree_segment_reconstruction (P.namedPath hm) (Q.namedPath hm)92a (bP-a) (bQ-a) (by omega) (by omega)93(fun i hi hj => (P.namedPath_tree_edge_mem_iff hm i).mpr (htP i hi (by omega)))94(fun i hi hj h => hoP i hi (by omega) ((P.namedPath_firstVisit_iff hm i).mp h))95(fun i hi hj => (Q.namedPath_tree_edge_mem_iff hm i).mpr (htQ i hi (by omega)))96(fun i hi hj h => hoQ i hi (by omega) ((Q.namedPath_firstVisit_iff hm i).mp h))97hv (by rw [hbP,hbQ,(P.namedPath hm).vertexAt_eq bP hPm,98(Q.namedPath hm).vertexAt_eq bQ hQm]; exact he)99refine ⟨by omega,?_⟩100intro j haj hjP101have h := hv' (j.val-a) (by omega)102have hj : a+(j.val-a)=j.val := by omega103rw [hj,vertexAt_fin,vertexAt_fin] at h104exact h105106end Nonadditivity.HaarPathGraph.Path