Documentation

Anderson4D.Combinatorics.Pairing

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 #

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.

structure Anderson4D.PartialPairing (ι : Type u_1) :
Type u_1

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.

Instances For
    @[implicit_reducible]
    Equations
    @[simp]
    theorem Anderson4D.PartialPairing.coe_mk {ι : Type u_1} (f : ι → ι) (hf : Function.Involutive f) :
    ⇑{ toFun := f, involutive := hf } = f
    theorem Anderson4D.PartialPairing.ext {ι : Type u_1} {κ₁ κ₂ : PartialPairing ι} (h : ∀ (i : ι), κ₁ i = κ₂ i) :
    κ₁ = κ₂
    theorem Anderson4D.PartialPairing.ext_iff {ι : Type u_1} {κ₁ κ₂ : PartialPairing ι} :
    κ₁ = κ₂ ↔ ∀ (i : ι), κ₁ i = κ₂ i
    @[simp]
    theorem Anderson4D.PartialPairing.apply_apply {ι : Type u_1} (κ : PartialPairing ι) (i : ι) :
    κ (κ i) = i
    theorem Anderson4D.PartialPairing.apply_eq_iff {ι : Type u_1} (κ : PartialPairing ι) {i j : ι} :
    κ i = j ↔ i = κ j

    An involution moves i to j iff it moves j to i.

    The permutation underlying a partial pairing.

    Equations
    Instances For
      @[simp]
      theorem Anderson4D.PartialPairing.coe_toPerm {ι : Type u_1} (κ : PartialPairing ι) :
      ⇑κ.toPerm = ⇑κ

      The identity involution: the empty pairing, in which every index is a single.

      Equations
      Instances For
        @[simp]
        theorem Anderson4D.PartialPairing.apply_notMem {ι : Type u_1} (κ : PartialPairing ι) {B : Finset ι} (hB : ∀ j ∈ B, κ j ∈ B) {i : ι} (hi : i ∉ B) :
        κ i ∉ B

        If κ maps B into B, then it maps the complement of B into the complement of B (using κ ∘ κ = id).

        def Anderson4D.PartialPairing.restrictCompl {ι : Type u_1} (κ : PartialPairing ι) {B : Finset ι} (hB : ∀ j ∈ B, κ j ∈ B) :
        PartialPairing { i : ι // i ∉ B }

        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
          @[simp]
          theorem Anderson4D.PartialPairing.restrictCompl_apply_coe {ι : Type u_1} (κ : PartialPairing ι) {B : Finset ι} (hB : ∀ j ∈ B, κ j ∈ B) (i : { i : ι // i ∉ B }) :
          ↑((κ.restrictCompl hB) i) = κ ↑i
          def Anderson4D.PartialPairing.congr {ι : Type u_1} {ι' : Type u_2} (e : ι ≃ ι') :

          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
            @[simp]
            theorem Anderson4D.PartialPairing.congr_apply_apply {ι : Type u_1} {ι' : Type u_2} (e : ι ≃ ι') (κ : PartialPairing ι) (j : ι') :
            ((congr e) κ) j = e (κ (e.symm j))

            The singles of a partial pairing: its fixed points (paper Def 2.2, the set S).

            Equations
            Instances For

              The indices moved by the pairing: the union of its pairs (complement of the singles).

              Equations
              Instances For
                @[simp]
                theorem Anderson4D.PartialPairing.mem_singles {ι : Type u_1} [Fintype ι] [DecidableEq ι] {κ : PartialPairing ι} {i : ι} :
                i ∈ κ.singles ↔ κ i = i
                @[simp]
                theorem Anderson4D.PartialPairing.mem_pairSupport {ι : Type u_1} [Fintype ι] [DecidableEq ι] {κ : PartialPairing ι} {i : ι} :
                i ∈ κ.pairSupport ↔ κ i ≠ i

                The pairs of a partial pairing, as unordered pairs (paper Def 2.2, the set P).

                Equations
                Instances For
                  theorem Anderson4D.PartialPairing.mem_pairs {ι : Type u_1} [Fintype ι] [DecidableEq ι] {κ : PartialPairing ι} {p : Sym2 ι} :
                  p ∈ κ.pairs ↔ ∃ (i : ι), κ i ≠ i ∧ s(i, κ i) = p
                  theorem Anderson4D.PartialPairing.pairSupport_filter_eq_pair {ι : Type u_1} [Fintype ι] [DecidableEq ι] {κ : PartialPairing ι} {a : ι} (ha : κ a ≠ a) :
                  {i ∈ κ.pairSupport | s(i, κ i) = s(a, κ a)} = {a, κ a}

                  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.

                  Equations
                  Instances For

                    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
                      @[implicit_reducible]
                      Equations

                      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
                      Instances For
                        @[implicit_reducible]
                        Equations
                        theorem Anderson4D.IsFullyPairedOn.ne_of_mem {m : ℕ} {κ : PartialPairing (Fin m)} {B : Finset (Fin m)} (h : IsFullyPairedOn κ B) {i : Fin m} (hi : i ∈ B) :
                        κ i ≠ i
                        theorem Anderson4D.IsFullyPairedOn.apply_mem {m : ℕ} {κ : PartialPairing (Fin m)} {B : Finset (Fin m)} (h : IsFullyPairedOn κ B) {i : Fin m} (hi : i ∈ B) :
                        κ i ∈ B
                        theorem Anderson4D.IsFullyPairedOn.apply_notMem {m : ℕ} {κ : PartialPairing (Fin m)} {B : Finset (Fin m)} (h : IsFullyPairedOn κ B) {i : Fin m} (hi : i ∉ B) :
                        κ i ∉ B
                        theorem Anderson4D.IsFullyPairedOn.inter {m : ℕ} {κ : PartialPairing (Fin m)} {B₁ B₂ : Finset (Fin m)} (h₁ : IsFullyPairedOn κ B₁) (h₂ : IsFullyPairedOn κ B₂) :
                        IsFullyPairedOn κ (B₁ ∩ B₂)

                        The intersection of two fully paired sets is fully paired.

                        theorem Anderson4D.IsFullyPairedOn.union {m : ℕ} {κ : PartialPairing (Fin m)} {B₁ B₂ : Finset (Fin m)} (h₁ : IsFullyPairedOn κ B₁) (h₂ : IsFullyPairedOn κ B₂) :
                        IsFullyPairedOn κ (B₁ ∪ B₂)

                        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
                        Instances For

                          κ admits a proper fully paired subinterval (one that is not the whole index interval). Its negation is primitivity, paper Def 2.3.

                          Equations
                          Instances For

                            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
                            Instances For

                              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
                              Instances For
                                theorem Anderson4D.mem_fpIntervals {m : ℕ} {κ : PartialPairing (Fin m)} {p : Fin m × Fin m} :
                                p ∈ fpIntervals κ ↔ p.1 ≤ p.2 ∧ IsFullyPairedOn κ (Finset.Icc p.1 p.2)

                                The minimal length b - a over all fully paired subintervals Finset.Icc a b of κ.

                                Equations
                                Instances For
                                  theorem Anderson4D.minPairedLength_le {m : ℕ} {κ : PartialPairing (Fin m)} (h : HasFullyPairedSubinterval κ) {a b : Fin m} (hab : a ≤ b) (hfp : IsFullyPairedOn κ (Finset.Icc a b)) :
                                  minPairedLength κ h ≤ ↑b - ↑a

                                  Minimality of minPairedLength.

                                  Fully paired subintervals achieving the minimal length.

                                  Equations
                                  Instances For
                                    theorem Anderson4D.mem_minCands {m : ℕ} {κ : PartialPairing (Fin m)} {h : HasFullyPairedSubinterval κ} {p : Fin m × Fin m} :
                                    p ∈ minCands κ h ↔ (p.1 ≤ p.2 ∧ IsFullyPairedOn κ (Finset.Icc p.1 p.2)) ∧ ↑p.2 - ↑p.1 = minPairedLength κ h

                                    The left endpoint selected by paper Def 3.1(2): leftmost among the minimal-length fully paired subintervals.

                                    Equations
                                    Instances For
                                      theorem Anderson4D.leastLeft_le {m : ℕ} {κ : PartialPairing (Fin m)} (h : HasFullyPairedSubinterval κ) {a b : Fin m} (hab : a ≤ b) (hfp : IsFullyPairedOn κ (Finset.Icc a b)) (hlen : ↑b - ↑a = minPairedLength κ h) :
                                      leastLeft κ h ≤ a

                                      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 has the minimal length.

                                        theorem Anderson4D.eq_leastFullyPairedSubinterval {m : ℕ} {κ : PartialPairing (Fin m)} (h : HasFullyPairedSubinterval κ) {a b : Fin m} (hab : a ≤ b) (_hfp : IsFullyPairedOn κ (Finset.Icc a b)) (hlen : ↑b - ↑a = minPairedLength κ h) (hfst : a = leastLeft κ h) :

                                        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
                                        Instances For
                                          @[simp]
                                          theorem Anderson4D.PartialPairing.removeInterval_apply_coe {m : ℕ} (κ : PartialPairing (Fin m)) {a b : Fin m} (h : IsFullyPairedOn κ (Finset.Icc a b)) (i : { i : Fin m // i ∉ Finset.Icc a b }) :
                                          ↑((κ.removeInterval h) i) = κ ↑i
                                          def Anderson4D.notMemOrderIso {m : ℕ} (B : Finset (Fin m)) :
                                          { i : Fin m // i ∉ B } ≃o ↥Bᶜ

                                          The complement subtype of B : Finset (Fin m), rephrased as the coercion of the finset Bᶜ.

                                          Equations
                                          Instances For
                                            def Anderson4D.complOrderIso {m : ℕ} (B : Finset (Fin m)) :
                                            { i : Fin m // i ∉ B } ≃o Fin (m - B.card)

                                            The order isomorphism between the complement of B : Finset (Fin m) and Fin (m - B.card), given by the unique monotone enumeration.

                                            Equations
                                            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
                                                theorem Anderson4D.removeIntervalFin_apply {m : ℕ} (κ : PartialPairing (Fin m)) {a b : Fin m} (h : IsFullyPairedOn κ (Finset.Icc a b)) (i : { i : Fin m // i ∉ Finset.Icc a b }) :

                                                Specification of removeIntervalFin: it is the conjugate of κ (restricted to the complement) under the monotone enumeration complOrderIso.