Switch embeddings to index-offset.

This is a special case of an embedding, but it has the nice
property for checking inclusion.
This commit is contained in:
2026-08-09 17:23:46 -05:00
parent 904f6375be
commit 827d55c6b6
2 changed files with 102 additions and 36 deletions

View File

@@ -41,8 +41,9 @@ noncomputable def Trace.embed {g h : Graph} (e : GGraph.Embed g h)
a corresponding trace exists in the combined graph. -/
noncomputable def Trace.overlay_left {idx₁ idx₂ : g₁.Index}
(tr : Trace g₁ idx₁ idx₂ ρ₁ ρ₂) :
Trace (g₁ g₂) (idx₁.castAdd g₂.size) (idx₂.castAdd g₂.size) ρ₁ ρ₂ :=
tr.embed (GGraph.Embed.overlayLeft g₁ g₂)
Trace (g₁ g₂) (idx₁.castAdd g₂.size) (idx₂.castAdd g₂.size) ρ₁ ρ₂ := by
have h := tr.embed (GGraph.Embed.overlayLeft g₁ g₂)
rwa [GGraph.Embed.overlayLeft_f, GGraph.Embed.overlayLeft_f] at h
/-- When two graphs are overlaid, for each trace in the right graph,
a corresponding trace exists in the combined graph. -/
@@ -55,8 +56,9 @@ noncomputable def Trace.overlay_right {idx₁ idx₂ : g₂.Index}
a corresponding trace exists in the combined graph. -/
noncomputable def Trace.sequence_left {idx₁ idx₂ : g₁.Index}
(tr : Trace g₁ idx₁ idx₂ ρ₁ ρ₂) :
Trace (g₁ g₂) (idx₁.castAdd g₂.size) (idx₂.castAdd g₂.size) ρ₁ ρ₂ :=
tr.embed (GGraph.Embed.sequenceLeft g₁ g₂)
Trace (g₁ g₂) (idx₁.castAdd g₂.size) (idx₂.castAdd g₂.size) ρ₁ ρ₂ := by
have h := tr.embed (GGraph.Embed.sequenceLeft g₁ g₂)
rwa [GGraph.Embed.sequenceLeft_f, GGraph.Embed.sequenceLeft_f] at h
/-- When two graphs are sequenced, for each trace in the second graph,
a corresponding trace exists in the combined graph. -/