L0 combinatorics: partial pairings and fully paired subintervals #
Paper: D-pair — Def 2.2 / Def 2.3 — pairings, intervals, primitivity
Formalization of Definitions 2.2–2.3 of Deng–Shen (arXiv:2607.10105), PAPER_MAP nodes D-pair and D-int, together with the operations on pairings that the proof of Prop 3.4 and the Dyck-word bookkeeping of §4.1 require (node D-RI's interval-removal step, Def 3.1(2)).
Design #
- A partial pairing of a finite index type
ιis represented as an involutionκ : ι → ι(PartialPairing): the singles of the paper are its fixed points (PartialPairing.singles), the pairs are its 2-cycles, recorded as unordered pairs (PartialPairing.pairs : Finset (Sym2 ι)). - The ordered layer (subintervals of the paper's
[1, m]) is developed onι := Fin mwith intervalsFinset.Icc a b.IsFullyPairedOn κ Bsays thatBcontains no single and is closed underκ;IsPrimitivesays that no proper fully paired subinterval exists (paper Def 2.3; for a primitive full pairing the whole of[1, m]is still fully paired). The selector of paper Def 3.1(2) — the smallest-length, leftmost fully paired subinterval, the whole interval being allowed — isleastFullyPairedSubinterval, with hypothesisHasFullyPairedSubinterval(no properness requirement); the properness-aware variant used to characterize primitivity isHasProperFullyPairedSubinterval. - Interval removal (Def 3.1(2a)) is implemented on the complement subtype:
PartialPairing.removeIntervalproduces a pairing of{i : Fin m // i ∉ Finset.Icc a b}, avoidingFinre-indexing arithmetic in the primary API. The transported version onFin (m - (Icc a b).card)is provided asremoveIntervalFinvia the order isomorphismcomplOrderIso.
Everything in this file is fully proved; the enumeration instances are computable
and the expected small cardinalities are checked both by #guard and by
kernel-reduced decide examples.
Paper Def 2.2 (node D-pair). A partial pairing of the index type ι
is an involution κ : ι → ι. Indices with κ i = i are the singles; the
2-cycles {i, κ i} (for κ i ≠ i) are the pairs.
- toFun : ι → ι
The underlying involutive map.
- involutive : Function.Involutive self.toFun
The map is an involution.
Instances For
Equations
- Anderson4D.PartialPairing.instFunLike = { coe := Anderson4D.PartialPairing.toFun, coe_injective := ⋯ }
An involution moves i to j iff it moves j to i.
The permutation underlying a partial pairing.
Equations
Instances For
The identity involution: the empty pairing, in which every index is a single.
Equations
- Anderson4D.PartialPairing.id = { toFun := fun (i : ι) => i, involutive := ⋯ }
Instances For
Equations
If κ maps B into B, then it maps the complement of B into the
complement of B (using κ ∘ κ = id).
Restrict a partial pairing to the complement of a κ-closed finset,
as a pairing of the complement subtype. This is the engine behind interval
removal (paper Def 3.1(2a)).
Equations
Instances For
Transport of partial pairings along an equivalence of index types
(conjugation), as an equivalence. Used to move the induced pairing of
removeInterval to a Fin index set, and later for the pairing
manipulations in the proof of Prop 3.4.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The singles of a partial pairing: its fixed points (paper Def 2.2, the
set S).
Instances For
The indices moved by the pairing: the union of its pairs (complement of the singles).
Equations
- κ.pairSupport = {i : ι | κ i ≠ i}
Instances For
The pairs of a partial pairing, as unordered pairs (paper Def 2.2, the
set P).
Equations
- κ.pairs = Finset.image (fun (i : ι) => s(i, κ i)) κ.pairSupport
Instances For
The fiber of the pair {a, κ a} inside the pair support is exactly
{a, κ a}.
The pairs partition the pair support into 2-cycles: counting version.
Counting form of Def 2.2: #S + 2 #P = m.
Paper Def 2.2 (node D-pair). A partial pairing is full if it has no singles: every index belongs to a pair.
Instances For
Equations
- κ.instDecidablePredIsFullOfFintypeOfDecidableEq = decidable_of_iff (∀ (i : ι), κ i ≠ i) ⋯
A full pairing forces an even number of indices.
A partial pairing is the same data as an involutive self-map.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- x✝¹.instDecidableEqOfFintype x✝ = decidable_of_iff (∀ (x : ι), x✝¹ x = x✝ x) ⋯
Equations
- Anderson4D.PartialPairing.instDecidablePredForallInvolutiveOfFintypeOfDecidableEq f = decidable_of_iff (∀ (x : α), f (f x) = x) ⋯
The ordered layer: fully paired subintervals of Fin m #
Paper Def 2.3 (node D-int). Subintervals of [1, m] are Finset.Icc a b
with a b : Fin m, a ≤ b.
Paper Def 2.3 (node D-int). B is fully paired under κ if it
contains no single of κ and is closed under κ (so the pairs meeting B
lie entirely inside B). Stated for an arbitrary finset B; the paper's
notion is the special case B = Finset.Icc a b.
Equations
- Anderson4D.IsFullyPairedOn κ B = ((∀ i ∈ B, κ i ≠ i) ∧ ∀ i ∈ B, κ i ∈ B)
Instances For
Equations
- Anderson4D.instDecidableIsFullyPairedOn κ B = decidable_of_iff ((∀ i ∈ B, κ i ≠ i) ∧ ∀ i ∈ B, κ i ∈ B) ⋯
The intersection of two fully paired sets is fully paired.
The union of two fully paired sets is fully paired.
Structural lemma for the §4.1 Dyck-word bookkeeping: two fully paired
subintervals always have fully paired intersection and union (this
strengthens the paper's silent "disjoint or nested or overlapping" case
analysis: in the overlapping case both ∩ and ∪ are again fully
paired).
κ admits a fully paired subinterval, the whole index interval being
allowed. This is the hypothesis of the Def 3.1(2) selector
leastFullyPairedSubinterval.
Equations
- Anderson4D.HasFullyPairedSubinterval κ = ∃ (a : Fin m) (b : Fin m), a ≤ b ∧ Anderson4D.IsFullyPairedOn κ (Finset.Icc a b)
Instances For
Equations
- Anderson4D.instDecidableHasFullyPairedSubinterval κ = decidable_of_iff (∃ (a : Fin m) (b : Fin m), a ≤ b ∧ Anderson4D.IsFullyPairedOn κ (Finset.Icc a b)) ⋯
κ admits a proper fully paired subinterval (one that is not the whole
index interval). Its negation is primitivity, paper Def 2.3.
Equations
- Anderson4D.HasProperFullyPairedSubinterval κ = ∃ (a : Fin m) (b : Fin m), a ≤ b ∧ Finset.Icc a b ≠ Finset.univ ∧ Anderson4D.IsFullyPairedOn κ (Finset.Icc a b)
Instances For
Equations
- Anderson4D.instDecidableHasProperFullyPairedSubinterval κ = decidable_of_iff (∃ (a : Fin m) (b : Fin m), a ≤ b ∧ Finset.Icc a b ≠ Finset.univ ∧ Anderson4D.IsFullyPairedOn κ (Finset.Icc a b)) ⋯
Paper Def 2.3 (node D-int). A partial pairing of Fin m is
primitive if it has no proper fully paired subinterval: every fully paired
subinterval is the whole of Fin m. (For a primitive full pairing the
whole interval is itself fully paired, so primitivity does not exclude it.)
Equations
- Anderson4D.IsPrimitive κ = ∀ (a b : Fin m), a ≤ b → Anderson4D.IsFullyPairedOn κ (Finset.Icc a b) → Finset.Icc a b = Finset.univ
Instances For
Equations
- Anderson4D.instDecidableIsPrimitive κ = decidable_of_iff (∀ (a b : Fin m), a ≤ b → Anderson4D.IsFullyPairedOn κ (Finset.Icc a b) → Finset.Icc a b = Finset.univ) ⋯
A full pairing of a nonempty index interval always has a fully paired subinterval, namely the whole interval — the situation in which the Def 3.1 induction keeps running until the interval itself is removed.
The Def 3.1(2) selector: smallest, leftmost fully paired subinterval #
Endpoint pairs (a, b), a ≤ b, of fully paired subintervals of κ.
Equations
- Anderson4D.fpIntervals κ = {p : Fin m × Fin m | p.1 ≤ p.2 ∧ Anderson4D.IsFullyPairedOn κ (Finset.Icc p.1 p.2)}
Instances For
The minimal length b - a over all fully paired subintervals
Finset.Icc a b of κ.
Equations
- Anderson4D.minPairedLength κ h = (Finset.image (fun (p : Fin m × Fin m) => ↑p.2 - ↑p.1) (Anderson4D.fpIntervals κ)).min' ⋯
Instances For
Minimality of minPairedLength.
Fully paired subintervals achieving the minimal length.
Equations
- Anderson4D.minCands κ h = {p ∈ Anderson4D.fpIntervals κ | ↑p.2 - ↑p.1 = Anderson4D.minPairedLength κ h}
Instances For
The left endpoint selected by paper Def 3.1(2): leftmost among the minimal-length fully paired subintervals.
Equations
- Anderson4D.leastLeft κ h = (Finset.image Prod.fst (Anderson4D.minCands κ h)).min' ⋯
Instances For
Leftmost-ness of leastLeft among minimal-length fully paired
subintervals.
Paper Def 3.1(2) selector. Among all fully paired subintervals of κ
(the whole interval allowed), the one of smallest length and, among those, the
leftmost; returned as its pair of endpoints (a, b).
Equations
Instances For
The selected subinterval is a genuine interval: a ≤ b.
The selected subinterval is fully paired.
The selected subinterval has the minimal length.
Uniqueness: a fully paired subinterval of minimal length whose left endpoint is the selected one is the selected subinterval.
The selected subinterval is also smallest with respect to inclusion: a fully paired subinterval contained in it coincides with it.
Interval removal (paper Def 3.1(2a)) #
Primary version: the induced pairing on the complement subtype
{i : Fin m // i ∉ Finset.Icc a b} — no Fin re-indexing arithmetic. The
re-indexed version on Fin (m - (Finset.Icc a b).card) is obtained by
transporting along the order isomorphism complOrderIso.
Remove a fully paired subinterval from a pairing: the induced pairing on
the complement subtype. Well-defined because a fully paired set is
κ-closed, hence so is its complement.
Equations
- κ.removeInterval h = κ.restrictCompl ⋯
Instances For
Interval removal, re-indexed over Fin (m - (Finset.Icc a b).card) by the
monotone enumeration of the complement. removeInterval (the subtype
version) is the primary API; this is the transported form.
Equations
Instances For
Specification of removeIntervalFin: it is the conjugate of κ (restricted
to the complement) under the monotone enumeration complOrderIso.