Skip to content

Commit 67bb8d3

Browse files
committed
feat(Combinatorics/SimpleGraph/InducedCopy): Copy.inducedShape
For a copy `f : Copy G H`, the *induced shape* of `f` is the pullback `H.comap f.toEmbedding`: a graph on `V` whose adjacency records the induced adjacency of `H` restricted to the image of `f`. Adds: * `Copy.inducedShape`, `Copy.inducedShape_adj`, `Copy.le_inducedShape`. * `Copy.toEmbeddingOfInducedShapeEq`: promotes a copy whose induced shape equals a prescribed supergraph `G' ≥ G` to an embedding `G' ↪g H`. * `Copy.fiberInducedShapeEquiv`: the per-supergraph bijection `{f : Copy G H // f.inducedShape = G'} ≃ Embedding G' H`. This material is the load-bearing fiber decomposition consumed by the Möbius inversion `copyCount_eq_sum_embeddingCount` / `embeddingCount_eq_sum_signed_copyCount` (downstream PR). `Copy.toEmbeddingOfInducedShapeEq` is `@[expose]` for the same reason as `Copy.toEmbeddingOfIsInduced`: its `_apply` simp lemma needs the body to unfold across modules.
1 parent de72aec commit 67bb8d3

1 file changed

Lines changed: 45 additions & 0 deletions

File tree

Mathlib/Combinatorics/SimpleGraph/InducedCopy.lean

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,51 @@ providing the converse direction to `Embedding.toSubgraph` / `Embedding.toSubgra
139139
@[simp] lemma Copy.toEmbeddingOfIsInduced_apply (f : Copy G H) (hInd : f.toSubgraph.IsInduced)
140140
(v : V) : f.toEmbeddingOfIsInduced hInd v = f v := rfl
141141

142+
/-! ### Induced shape of a copy
143+
144+
The pullback `H.comap f.toEmbedding` records the induced adjacency on the image of a copy
145+
`f : Copy G H`, transported back to `V`. It is always a supergraph of `G`, and pinning it
146+
down to a specific supergraph `G'` promotes the copy to an embedding `G' ↪g H`. -/
147+
148+
namespace Copy
149+
150+
variable {G G' : SimpleGraph V} {H : SimpleGraph W}
151+
152+
/-- The pullback of the host graph along the underlying injection of a copy. -/
153+
def inducedShape (f : Copy G H) : SimpleGraph V :=
154+
H.comap f.toEmbedding
155+
156+
@[simp] lemma inducedShape_adj (f : Copy G H) {a b : V} :
157+
f.inducedShape.Adj a b ↔ H.Adj (f a) (f b) := Iff.rfl
158+
159+
lemma le_inducedShape (f : Copy G H) : G ≤ f.inducedShape :=
160+
fun _ _ => f.toHom.map_adj
161+
162+
/-- A copy with induced shape `G'` promotes to a graph embedding `G' ↪g H`. -/
163+
@[expose] def toEmbeddingOfInducedShapeEq (f : Copy G H) (h : f.inducedShape = G') :
164+
G' ↪g H where
165+
toFun := f
166+
inj' := f.injective
167+
map_rel_iff' {a b} := by
168+
change H.Adj (f a) (f b) ↔ G'.Adj a b
169+
rw [← h, inducedShape_adj]
170+
171+
@[simp] lemma toEmbeddingOfInducedShapeEq_apply (f : Copy G H) (h : f.inducedShape = G')
172+
(v : V) : f.toEmbeddingOfInducedShapeEq h v = f v := rfl
173+
174+
/-- The fiber of `inducedShape` over a supergraph `G' ≥ G` is canonically `Embedding G' H`. -/
175+
def fiberInducedShapeEquiv (hGG' : G ≤ G') :
176+
{f : Copy G H // f.inducedShape = G'} ≃ Embedding G' H where
177+
toFun f := f.val.toEmbeddingOfInducedShapeEq f.prop
178+
invFun e := ⟨e.toCopy.comp (Copy.ofLE G G' hGG'), by ext a b; simp [inducedShape]⟩
179+
left_inv f := by apply Subtype.ext; ext v; simp
180+
right_inv e := by apply DFunLike.ext; intro v; simp
181+
182+
end Copy
183+
184+
@[simp] lemma Embedding.inducedShape_toCopy (e : Embedding G H) : e.toCopy.inducedShape = G := by
185+
ext a b; rw [Copy.inducedShape_adj]; exact e.map_rel_iff
186+
142187
/-!
143188
### Induced containment
144189

0 commit comments

Comments
 (0)