Skip to content

Commit 66510d0

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 7f0d95f commit 66510d0

1 file changed

Lines changed: 65 additions & 0 deletions

File tree

Mathlib/Combinatorics/SimpleGraph/InducedCopy.lean

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,71 @@ abbrev toSubgraph (f : Embedding G H) : H.Subgraph := f.toCopy.toSubgraph
8989

9090
end Embedding
9191

92+
/-!
93+
### Induced shape of a copy
94+
95+
For a copy `f : Copy G H`, the *induced shape* of `f` is the pullback `H.comap f.toEmbedding`:
96+
a graph on `V` whose adjacency records the induced adjacency of `H` restricted to the image
97+
of `f`. It is always a supergraph of `G` (`Copy.le_inducedShape`), and a copy whose induced
98+
shape equals a prescribed supergraph `G' ≥ G` upgrades to a graph embedding `G' ↪g H`. The
99+
fibers of `Copy.inducedShape` over supergraphs `G' ≥ G` are canonically embeddings
100+
`G' ↪g H` (`Copy.fiberInducedShapeEquiv`).
101+
-/
102+
103+
namespace Copy
104+
105+
variable {G G' : SimpleGraph V} {H : SimpleGraph W}
106+
107+
/-- The *induced shape* of a copy `f : Copy G H` is the pullback of the host graph along
108+
the underlying injection `f.toEmbedding`. This is always a supergraph of `G`
109+
(`Copy.le_inducedShape`); it records the induced subgraph of `H` on the image of `f`,
110+
transported back to the vertex type `V`. -/
111+
def inducedShape (f : Copy G H) : SimpleGraph V :=
112+
H.comap f.toEmbedding
113+
114+
/-- Adjacency in the induced shape unfolds to adjacency in `H` at the image vertices. -/
115+
@[simp] lemma inducedShape_adj (f : Copy G H) {a b : V} :
116+
f.inducedShape.Adj a b ↔ H.Adj (f a) (f b) := Iff.rfl
117+
118+
/-- A copy is dominated by its induced shape: every edge of `G` is mapped to an edge of
119+
`H`, hence appears as an edge of the pullback. -/
120+
lemma le_inducedShape (f : Copy G H) : G ≤ f.inducedShape :=
121+
fun _ _ => f.toHom.map_adj
122+
123+
/-- Promote a copy whose induced shape equals a specified supergraph `G'` to a graph
124+
embedding `G' ↪g H`. The underlying function is `f` itself; the adjacency-iff direction
125+
that is missing in `Copy` is recovered from `h : f.inducedShape = G'`. -/
126+
@[expose] def toEmbeddingOfInducedShapeEq (f : Copy G H) (h : f.inducedShape = G') : G' ↪g H where
127+
toFun := f
128+
inj' := f.injective
129+
map_rel_iff' {a b} := by
130+
change H.Adj (f a) (f b) ↔ G'.Adj a b
131+
rw [← h, inducedShape_adj]
132+
133+
@[simp] lemma toEmbeddingOfInducedShapeEq_apply (f : Copy G H) (h : f.inducedShape = G')
134+
(v : V) : f.toEmbeddingOfInducedShapeEq h v = f v := rfl
135+
136+
/-- The fiber of `Copy.inducedShape` over a fixed supergraph `G'` of `G` is canonically
137+
equivalent to the type of graph embeddings `G' ↪g H`. The underlying function of the copy
138+
matches the underlying function of the embedding; the only added datum is the
139+
adjacency-iff direction recovered from the inducedShape equation. -/
140+
def fiberInducedShapeEquiv (hGG' : G ≤ G') :
141+
{f : Copy G H // f.inducedShape = G'} ≃ Embedding G' H where
142+
toFun f := f.val.toEmbeddingOfInducedShapeEq f.prop
143+
invFun e := ⟨e.toCopy.comp (Copy.ofLE G G' hGG'), by
144+
ext a b
145+
simp [inducedShape]⟩
146+
left_inv f := by
147+
apply Subtype.ext
148+
ext v
149+
simp
150+
right_inv e := by
151+
apply DFunLike.ext
152+
intro v
153+
simp
154+
155+
end Copy
156+
92157
/-!
93158
### Induced containment
94159

0 commit comments

Comments
 (0)