The /d denominator: #level-canonical = C(N, d-1)/d (all d), Mathlib, sorry-free. #
PRIMARY (multiplicative form):
d * #{S // S.card = d-1 ∧ LevelCanonical d m S} = (d*m).choose (d-1)
COROLLARY (division form), one-liner from the above.
Route: rotation rhoPow t (translate by +(t*m)), the per-level count vector cnt,
the cycle-lemma bridge (∃! canonical rotation index per (d-1)-subset), assembled into a
bijection {(d-1)-subsets} ≃ {canonical} × Fin d (uniqueness of the canonical index supplies
freeness for free), giving card = #canonical * d.
Part 0: a Fintype instance for the target subtype (all d, m). #
The TARGET statement uses Fintype.card {S : Finset (ZMod (d*m)) // …} with no [NeZero (d*m)]
binder, so we must provide the Fintype instance unconditionally. When d*m ≠ 0 it comes from
NeZero; in the degenerate case d*m = 0 the predicate forces every S = ∅ (a singleton),
so the subtype is still finite.
Equations
- CriticalPortraits.instFintypeCanonical d m = Fintype.ofFinite { S : Finset (ZMod (d * m)) // S.card = d - 1 ∧ CriticalPortraits.LevelCanonical d m S }
Part 1: level arithmetic. #
Part 2: counts and prefix sums. #
t-fold rotation: translate every element by +(t*m).
Equations
- CriticalPortraits.rhoPow t S = Finset.map (Equiv.toEmbedding (Equiv.addRight ↑(t * m))) S
Instances For
The count-shift: rotating by t shifts the level-count vector cyclically.
For j < d, the elements of rhoPow t S at level j biject (via +t'*m) with the
elements of S at level (j + (d - t%d)) % d.
The integer complement sequence whose partial sums drive the cycle lemma:
bSeq S l = 1 - (aP S l : ℤ).
Equations
- CriticalPortraits.bSeq S l = 1 - ↑(CriticalPortraits.aP S l)
Instances For
Part 5: the core equivalence LevelCanonical ↔ Good. #
The prefix sum of the rotated count is a shifted window of aP.
For t < d and j < d, with e = d - t.
Reindex: ∑_{l<j+1} f (l + e) = (∑_{l<e+j+1} f) - (∑_{l<e} f).
The LC prefix inequality (index j) for rhoPow t S, recast via partial sums of bSeq.
For t < d, j < d, with e = d - t:
(#{i ∈ rhoPow t S : level i ≤ j} ≤ j) ↔ Q b e < Q b (e + (j+1)).
Part 7: the unique canonical rotation index. #
The canonical rotation index of a (d-1)-subset (junk 0 for non-(d-1)-subsets).
Equations
- CriticalPortraits.canIdx hd hm S = if h : S.card = d - 1 then Exists.choose ⋯ else 0