Equal-genus contractions of an arbitrary n-vertex, p-slot core #
Certificate/ContractionForestCensus.lean builds the union-find census
machinery (compFold, compFold_iff, IsForest, IsLoopy) for the one fixed
shape ExplicitPotential.Core 8 12, the shape of every genus-five AR row core.
This file lifts the same machinery, verbatim in argument, to an arbitrary
ExplicitPotential.Core n p, so that a row of any shape — not just the two
eight-vertex, twelve-slot rows 11/15 — can use the census, and so that
Certificate/DegenerateSpecCensus.lean can turn a forest into the DegSpec
face datum (rep, rep_idem, rep_zero, rep_loopless, forest) generically.
Nothing in ContractionForestCensus.lean is modified; that file, and
Generated/GenusFiveARRow1115ContractionCensus.lean, keep working untouched.
§4 below checks — cheaply, by rfl — that specializing this file's
definitions at n = 8, p = 12 recovers the fixed-shape file's definitions
exactly, so row 11/15's already-landed 2656/2686-target census is literally an
instance of this one, not a parallel development.
Two additions beyond a straight generalization #
The fixed-shape file stops at compFold/IsForest/IsLoopy: enough to
classify contraction targets, but not enough to emit a DegSpec face datum.
Two more facts are needed for that (DegenerateSpecCensus.lean consumes both):
compFoldis idempotent (compFold_idem): the union-find fold, folded again through itself, is a no-op. This is what makescompFold core Fusable asDegSpec.repdirectly —DegSpec.rep_idemis exactly this fact. Proved by induction on the edge list, carrying idempotence of the accumulator as the loop invariant (unionStep_idem); nodecide, no per-shape work.- A contracted edge really does identify its endpoints
(
compFold_tail_eq_head_of_mem) andcompFoldreaches every vertex from itself alongF(reachIn_self_compFold): together withcompFold_iff, the second is what letsDegenerateSpecCensus.leanproduce theZeroReachwitness the interpolated layer needs, straight from the spanning-forest structure that already definesrep— no separate search.
Direct adjacency along an explicit list of edge slots #
u and v are joined by one edge slot drawn from the list l (in
either reading direction).
Equations
Instances For
Equations
One new edge appended at the end joins the list's adjacency relation with one literal pair.
The reachability relation generated by a list of edge slots: the
reflexive-transitive closure of direct adjacency. Symmetric because
AdjInList already is.
Equations
Instances For
Merging one related pair into an equivalence relation #
Reflexive-transitive closure of a one-pair extension #
New. unionStep preserves idempotence of the accumulator: if rep is
already a retraction onto its own fixed points, so is unionStep rep u v.
This is the loop invariant foldRep_idem inducts on.
New. One unionStep merges at most two classes, so it destroys at
most one element of the image: image rep ⊆ insert (rep u) (image (unionStep …)),
because the only vertices whose value changes are those already sent to
rep u. This is the inductive heart of the graphic-matroid rank inequality
card_le_card_image_compFold_add_card.
Folding over a list of edges: union-find, and its correctness #
Union-find over a list of edge slots, applied in order.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Union-find correctness. foldRep-equality exactly characterizes
reachability via the processed edge list.
New. The union-find fold is idempotent: refolding through itself is a
no-op. Proved by induction on the edge list, carrying unionStep_idem as the
loop invariant — no decide, and independent of n/p. This is exactly
DegSpec.rep_idem once compFold is used as rep.
New. The graphic-matroid rank inequality, at list level: folding k
edges can cut the number of vertex classes by at most k. Induction on the
edge list, with card_image_le_card_image_unionStep_succ as the step.
The census-facing interface: a specific contracted edge set F #
The edge slots of the core belonging to a finite set F, listed in the
fixed canonical order 0, 1, …, p - 1.
Equations
- Utilities.Certificate.ContractionForestCensusGeneral.edgeList F = List.filter (fun (e : Fin p) => decide (e ∈ F)) (List.finRange p)
Instances For
The vertex partition induced by contracting the edge set F: each
vertex's canonical representative under the union-find fold.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The reachability relation actually induced by contracting F.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The main correctness theorem. compFold-equality exactly
characterizes vertex reachability through the contracted edge set F.
Equations
- One or more equations did not get rendered due to their size.
New. compFold is idempotent: refolding a class through compFold
again does nothing. This is exactly DegSpec.rep_idem.
New. A contracted edge's two endpoints land in the same class: this
is exactly DegSpec.rep_zero for e ∈ F.
New. Every vertex reaches its own compFold representative through
F — trivial from idempotence, but this is precisely the fact
DegenerateSpecCensus.lean transports into a ZeroReach witness.
Genus preservation: the graphic-matroid rank equation #
F is a forest of the core: contracting it is an equal-genus
topological contraction.
Equations
Instances For
The image of compFold core F has at most n elements — trivial, but
what forest_image_add_card_eq needs to turn the truncated-subtraction
IsForest equation into the additive DegSpec.forest equation.
New. The graphic-matroid rank inequality. Contracting F cuts the
number of vertex classes by at most F.card, for every slot set F — each
contracted slot merges at most two classes. IsForest core F is precisely the
equality case (see forest_image_add_card_eq), so this is the inequality whose
saturation "contracting F preserves the genus" means.
Consequence used by the split-loop analysis: a slot set carrying a cycle
cannot be a forest, because deleting a redundant slot from it leaves the
partition — hence the image cardinality — unchanged while dropping F.card
by one, which would violate this bound.
New. Two idempotent representative maps with the same fibres have
images of the same size; only the ≤ direction is stated, since the converse
is the same lemma with the arguments swapped. The injection is r₂ itself:
idempotence of r₁ makes r₂ (r₁ x) = r₂ x, so r₂ separates distinct
r₁-classes. Used to compare compFold core F with compFold core F' when
F and F' induce the same reachability relation.
New. IsForest, stated additively: exactly the DegSpec.forest
field, once rep := compFold core F and F is the zero-length slot set.
Every forest of an n-vertex graph has at most n - 1 edges: the
vertex-partition image is nonempty (given n > 0), so n - image.card ≤ n - 1.
F leaves a semantic loop: some uncontracted edge slot has both
endpoints identified by the contraction. Exactly the negation of
core_loopless/rep_loopless for the contraction target.
Equations
- One or more equations did not get rendered due to their size.
Instances For
New. The rep_loopless reading of ¬ IsLoopy, stated pointwise: a
surviving slot (e ∉ F) is not a loop after contracting F.