Forests and minors over \(\mathbb F_2\)
Over \(\mathbb F_2\) a determinant is a permanent, and the minors of the Laplacian of a family of bits count forests. This section proves the counting statements that the identity \(T_{5b}(n)=\det M_{5b}\) of row 5b rests on. No arithmetic enters: \(V\) is any finite set (for an odd number \(n\), the set of its primes), the bits \(a_{ij}\in\mathbb F_2\) are arbitrary, and the Laplacian \(L_U\) of the bits on \(U\subseteq V\) is defined here; for the bits of \(n\), \(L_V\) is Smith's matrix \(L\).
There are three main results. The forest lemma, the case over \(\mathbb F_2\) of the all-minors matrix-tree theorem, writes a minor of \(L_U\) as a sum over forests. The second expands the determinant of the symmetric block matrix \(P(c,d)=\begin{pmatrix}D_d&L^{\mathsf T}\\L&D_c\end{pmatrix}\) as a forest sum. The third relates the forests on \(V\) to the set partitions of \(V\) whose blocks are unions of trees.
Minors over \(\mathbb F_2\)
A minor with rows \(R\) and columns \(C\) is a sum over the bijections \(R\to C\), with no signs; for \(R=C\) it is the principal minor. Two identities, for a rank-one change of a matrix and for a bordered matrix, serve for the determinants of Smith's matrices.
TheoremMinors over \(\mathbb F_2\) as permanents#✓
Let \(V\) be a finite set and \(M\) a \(V\times V\) matrix over \(\mathbb F_2\). For \(R,C\subseteq V\) put $\(\operatorname{per}M[R,C]=\sum_{\sigma}\prod_{i\in R}M_{i\sigma(i)},\)$ the sum over the bijections \(\sigma:R\to C\). This is the minor of \(M\) with rows \(R\) and columns \(C\) used below; it needs no signs and no ordering of \(R\) and \(C\). Then:
- (principal minors) for \(S\subseteq V\), \(\det M[S,S]=\operatorname{per}M[S,S]\); in particular \(\det M=\operatorname{per}M[V,V]\);
- if \(|R|\ne|C|\), then \(\operatorname{per}M[R,C]=0\);
- \(\operatorname{per}M[R,C]\) depends only on the rows of \(M\) indexed by \(R\);
- (transpose) \(\operatorname{per}M^{\mathsf T}[A,C]=\operatorname{per}M[C,A]\) for \(A,C\subseteq V\).
Proof sketch. (1) In the Leibniz expansion of \(\det M[S,S]\) every sign \(\pm1\) is \(1\) in \(\mathbb F_2\), and the permutations of \(S\) are exactly the bijections \(S\to S\); the case \(S=V\) is \(\det M\). (2) There are no bijections. (3) The products only involve rows in \(R\). (4) Inverting a bijection \(A\to C\) gives a bijection \(C\to A\), and this matches the two sums term by term: with \(c=\sigma(a)\), \(\prod_{a\in A}M^{\mathsf T}_{a\sigma(a)}=\prod_{c\in C}M_{c\sigma^{-1}(c)}\).
theorem det_submatrix_eq_pmin (M : Matrix ι ι (ZMod 2)) (S : Finset ι) :
(M.submatrix (fun x : ↥S => (x : ι)) (fun x : ↥S => (x : ι))).det = pmin M S S
def pmin (M : Matrix ι ι (ZMod 2)) (R C : Finset ι) : ZMod 2 :=
∑ σ ∈ bijFun R C, ∏ i ∈ R, M i (σ i)
def bijFun (R C : Finset ι) : Finset (ι → ι) :=
univ.filter fun σ => (∀ i, i ∉ R → σ i = i) ∧ (∀ i ∈ R, σ i ∈ C) ∧
(∀ i ∈ R, ∀ j ∈ R, σ i = σ j → i = j) ∧ R.card = C.card
def pmin (M : Matrix ι ι (ZMod 2)) (R C : Finset ι) : ZMod 2 :=
∑ σ ∈ bijFun R C, ∏ i ∈ R, M i (σ i)
ZInQKernel/RouteK/Rank5b/Sec3/Perm.lean:28
def bijFun (R C : Finset ι) : Finset (ι → ι) :=
univ.filter fun σ => (∀ i, i ∉ R → σ i = i) ∧ (∀ i ∈ R, σ i ∈ C) ∧
(∀ i ∈ R, ∀ j ∈ R, σ i = σ j → i = j) ∧ R.card = C.card
ZInQKernel/RouteK/Rank5b/Sec3/Perm.lean:23
Used by 9
TheoremRow operations on minors over \(\mathbb F_2\)#✓
Let \(V\) be a finite set, \(M\) a \(V\times V\) matrix over \(\mathbb F_2\), \(R,C\subseteq V\), and let \(\operatorname{per}M[R,C]\) be the minor of \(M\) with rows \(R\) and columns \(C\), the sum over the bijections \(R\to C\). Then:
- (row expansion) for \(i\in R\), \(\operatorname{per}M[R,C]=\sum_{v\in C}M_{iv}\operatorname{per}M[R\setminus\{i\},C\setminus\{v\}]\);
- (linearity in a row) for \(i\in R\) and finitely many row vectors \(r_u\), the minor of the matrix \(M\) with row \(i\) replaced by \(\sum_u r_u\) is the sum over \(u\) of the minors of \(M\) with row \(i\) replaced by \(r_u\); in particular this holds for a sum \(r+s\) of two rows;
- (equal rows) if \(i\ne k\) lie in \(R\) and rows \(i\) and \(k\) of \(M\) are equal, then \(\operatorname{per}M[R,C]=0\).
Proof sketch. (1) Group the bijections by \(v=\sigma(i)\): removing \(i\) leaves a bijection \(R\setminus\{i\}\to C\setminus\{v\}\), and each such bijection extends uniquely by \(i\mapsto v\); a bijection is onto \(C\), so every \(v\in C\) occurs. (2) By (1), whose terms are linear in row \(i\), while the smaller minors in (1) do not involve row \(i\), since a minor depends only on the rows it uses. (3) Composing with the transposition of \(i\) and \(k\) is an involution of the bijections \(R\to C\); it has no fixed point, since \(\sigma(i)\ne\sigma(k)\), and it keeps each product, since rows \(i\) and \(k\) agree. So the terms cancel in pairs.
theorem pmin_expand_row (M : Matrix ι ι (ZMod 2)) {R C : Finset ι} {i : ι} (hi : i ∈ R) :
pmin M R C = ∑ v ∈ C, M i v * pmin M (R.erase i) (C.erase v)
theorem pmin_updateRow_sum (M : Matrix ι ι (ZMod 2)) {R C : Finset ι} {i : ι} (hi : i ∈ R)
{κ : Type*} (T : Finset κ) (r : κ → ι → ZMod 2) :
pmin (M.updateRow i (∑ u ∈ T, r u)) R C = ∑ u ∈ T, pmin (M.updateRow i (r u)) R C
theorem pmin_updateRow_add (M : Matrix ι ι (ZMod 2)) {R C : Finset ι} {i : ι} (hi : i ∈ R)
(r s : ι → ZMod 2) :
pmin (M.updateRow i (r + s)) R C = pmin (M.updateRow i r) R C + pmin (M.updateRow i s) R C
def pmin (M : Matrix ι ι (ZMod 2)) (R C : Finset ι) : ZMod 2 :=
∑ σ ∈ bijFun R C, ∏ i ∈ R, M i (σ i)
ZInQKernel/RouteK/Rank5b/Sec3/Perm.lean:28
Uses 1 · Used by 2
TheoremRank-one updates and bordered determinants#✓
Let \(K\) be a field, \(I\) a finite index set, \(A\) an \(I\times I\) matrix over \(K\) and \(u,w\in K^I\). Write \(A^{(j\leftarrow u)}\) for \(A\) with column \(j\) replaced by \(u\). Then $\(\det(A+uw^{\mathsf T})=\det A+\sum_{j\in I}w_j\det A^{(j\leftarrow u)}.\)$ If moreover \(Ax=u\) for some \(x\in K^I\), then $\(\det(A+uw^{\mathsf T})=\det A\,(1+w\cdot x).\)$ No invertibility is assumed. The determinant is additive in a column over finite sums: if column \(j\) of \(A\) is replaced by \(\sum_{u\in T}f_u\), the determinant is \(\sum_{u\in T}\det A^{(j\leftarrow f_u)}\).
Over \(\mathbb F_2\), where \(-t=t\), \(s-t=s+t\) and \(t^2=t\):
- for an \(I\times I\) matrix \(A\) and \(v\in\mathbb F_2^I\), the bordered matrix \(\begin{pmatrix}A&v\\v^{\mathsf T}&0\end{pmatrix}\), indexed by \(I\) and one more index, has determinant \(\det(A+vv^{\mathsf T})+\det A\);
- for a symmetric \(I\times I\) matrix \(B\) and \(v\in\mathbb F_2^I\), \(\sum_{i,j}v_iv_jB_{ij}=\sum_iv_iB_{ii}\).
Proof sketch. Transpose: row \(i\) of \(A^{\mathsf T}+wu^{\mathsf T}\) is row \(i\) of \(A^{\mathsf T}\) plus \(w_iu^{\mathsf T}\). By multilinearity in the rows, the determinant is the sum, over the sets \(s\) of rows, of the determinant of the matrix whose rows in \(s\) are those of \(A^{\mathsf T}\) and whose other rows are \(w_iu^{\mathsf T}\). If two rows lie outside \(s\) the term vanishes: the two rows are multiples of \(u^{\mathsf T}\), so one of them is zero or a multiple of the other. What remains is \(s=I\), giving \(\det A\), and \(s=I\setminus\{j\}\), giving \(w_j\det A^{(j\leftarrow u)}\). If \(Ax=u\), then \(u=\sum_kx_k(\text{column }k)\); by linearity in column \(j\), and since the terms with \(k\ne j\) have two equal columns, \(\det A^{(j\leftarrow u)}=x_j\det A\), which gives the second formula. For the bordered matrix, the matrix with corner \(1\) in place of \(0\) has determinant \(\det(A-vv^{\mathsf T})= \det(A+vv^{\mathsf T})\), by the Schur complement of the corner. Its last row is the last row of the bordered matrix plus \((0,\dots,0,1)\), so by linearity in the last row it is also the bordered determinant plus the determinant of a block triangular matrix with diagonal blocks \(A\) and \(1\), that is, plus \(\det A\). For the quadratic form, the terms \((i,j)\) and \((j,i)\) with \(i\ne j\) are equal by symmetry and cancel, and \(v_i^2=v_i\).
theorem det_add_col_mul_row_of_mulVec (A : Matrix n n K) {u x : n → K} (hx : A *ᵥ x = u)
(w : n → K) :
(A + replicateCol Unit u * replicateRow Unit w).det = A.det * (1 + w ⬝ᵥ x)
theorem det_add_col_mul_row (A : Matrix n n K) (u w : n → K) :
(A + replicateCol Unit u * replicateRow Unit w).det =
A.det + ∑ j, w j * (A.updateCol j u).det
theorem det_updateCol_finset_sum (A : Matrix n n K) (j : n) {κ : Type*} (s : Finset κ)
(f : κ → n → K) : (A.updateCol j (∑ i ∈ s, f i)).det = ∑ i ∈ s, (A.updateCol j (f i)).det
Forests and the forest lemma
Expanding the diagonal entries of the Laplacian turns a minor into a sum over maps. A map with a cycle has an even number of compatible bijections and drops out, and each forest contributes once exactly when the deleted columns meet every tree once.
DefinitionThe Laplacian of a family of bits#✓
Let \(V\) be a finite set and \(a=(a_{ij})_{i,j\in V}\) a family of bits \(a_{ij}\in\mathbb F_2\). For \(U\subseteq V\) the Laplacian of \(a\) on \(U\) is the \(V\times V\) matrix \(L_U\) over \(\mathbb F_2\) with $\((L_U)_{ij}=a_{ij}\quad(i\ne j),\qquad (L_U)_{ii}=\sum_{k\in U,\,k\ne i}a_{ik}.\)$ Only the diagonal depends on \(U\): the diagonal entry in row \(i\) is the sum of the bits of that row over the columns in \(U\) other than \(i\), also when \(i\notin U\). The bits \(a_{ii}\) are never used. We write \(L=L_V\).
For the bits \(a_{pq}\) of an odd squarefree number, \(L_V\) is Smith's matrix \(L\): the two definitions agree entry by entry.
def lapl (a : ι → ι → ZMod 2) (U : Finset ι) : Matrix ι ι (ZMod 2) := fun i j =>
if i = j then ∑ k ∈ U.erase i, a i k else a i j
Used by 7
DefinitionForests on a finite set#✓
Let \(V\) be a finite set with \(N\) elements and \(f:V\to V\) a map.
- The root of \(i\in V\) is \(r_f(i)=f^N(i)\), and \(f\) is acyclic if every root is a fixed point of \(f\).
- For \(U,R\subseteq V\), \(f\) moves \(R\) in \(U\) if it is the identity outside \(R\) and, for \(i\in R\), \(f(i)\in U\) and \(f(i)\ne i\).
- For \(U,F\subseteq V\), a forest on \(U\) rooted at \(F\) is an acyclic map that moves \(U\setminus F\) in \(U\). Its tree at \(\rho\in F\) is \(T_\rho=\{v\in U:r_f(v)=\rho\}\), and a set \(W\) is a transversal of it if, for every \(\rho\in F\), exactly one element of \(W\) has root \(\rho\).
- Given bits \(a_{ij}\in\mathbb F_2\) (\(i,j\in V\)), the weight of \(f\) on \(R\subseteq V\) is \(\mathrm{wt}_R(f)=\prod_{i\in R}a_{if(i)}\); for a forest on \(U\) rooted at \(F\) we write \(\mathrm{wt}(f)=\mathrm{wt}_{U\setminus F}(f)\).
- The roots of \(g\) in \(U\) are its fixed points in \(U\), and a forest on \(U\) is a forest on \(U\) rooted at some \(F\subseteq U\).
These notions satisfy the following.
- In an acyclic map every periodic point is fixed, and a map that is not acyclic has a periodic point that is not fixed. So \(f\) is acyclic exactly when it has no cycle of length at least \(2\).
- A fixed point is its own root. If \(f\) is acyclic, \(f(x)\) and every \(f^k(x)\) have the same root as \(x\).
- Let \(f\) move \(U\setminus F\) in \(U\). Then a point \(x\) with \(f(x)\ne x\) lies in \(U\setminus F\), a point outside \(U\setminus F\) is its own root, and the iterates and the root of a point of \(U\) stay in \(U\). If moreover \(f\) is acyclic, the root of every point of \(U\) lies in \(F\).
- A map is a forest on \(U\) if and only if it is the identity outside \(U\), maps \(U\) into \(U\) and is acyclic. A forest on \(U\) rooted at \(F\subseteq U\) has exactly \(F\) as its roots in \(U\); so every forest on \(U\) is rooted at exactly one \(F\subseteq U\), namely its set of roots in \(U\).
- Hence, for every \(\mathbb F_2\)-valued function \(H\) of a set and a map, $\(\sum_{F\subseteq U}\ \sum_{f}H(F,f)=\sum_{g}H\bigl(R_U(g),g\bigr),\)$ where \(f\) runs over the forests on \(U\) rooted at \(F\), \(g\) over the forests on \(U\), and \(R_U(g)\) is the set of roots of \(g\) in \(U\).
def forests (U F : Finset ι) : Finset (ι → ι) := (mapsOn U (U \ F)).filter IsAcyc
def mapsOn (U R : Finset ι) : Finset (ι → ι) :=
univ.filter fun f => (∀ i, i ∉ R → f i = i) ∧ ∀ i ∈ R, f i ∈ U ∧ f i ≠ i
def wt (a : ι → ι → ZMod 2) (R : Finset ι) (f : ι → ι) : ZMod 2 := ∏ i ∈ R, a i (f i)
def mapsOn (U R : Finset ι) : Finset (ι → ι) :=
univ.filter fun f => (∀ i, i ∉ R → f i = i) ∧ ∀ i ∈ R, f i ∈ U ∧ f i ≠ i
ZInQKernel/RouteK/Rank5b/Sec3/Forest.lean:30
def IsAcyc (f : ι → ι) : Prop := ∀ i, f (root f i) = root f i
ZInQKernel/RouteK/Rank5b/Sec3/Forest.lean:44
Used by 18
TheoremExpanding the diagonal of a Laplacian#✓
Let \(a\) be bits on a finite set \(V\), let \(U\subseteq V\) with Laplacian \(L_U\), and let \(R,C\subseteq V\) with \(C\subseteq U\). For a map \(f:V\to V\) let \(\mathrm{compat}_{R,C}(f)\) be the set of bijections \(\sigma:R\to C\) with \(\sigma(i)\in\{i,f(i)\}\) for every \(i\in R\). Then $\(\operatorname{per}L_U[R,C]=\sum_f\mathrm{wt}_R(f)\cdot\#\mathrm{compat}_{R,C}(f),\)$ the sum over the maps \(f\) that move \(R\) in \(U\), with the counts read in \(\mathbb F_2\).
Proof sketch. Fix a bijection \(\sigma:R\to C\) and expand \(\prod_{i\in R}(L_U)_{i\sigma(i)}\). If \(\sigma(i)\ne i\), the factor is the single bit \(a_{i\sigma(i)}\), and \(\sigma(i)\in C\subseteq U\); it is the choice \(f(i)=\sigma(i)\). If \(\sigma(i)=i\), the factor is \(\sum_{j\in U,\,j\ne i}a_{ij}\), and each term is a choice \(f(i)=j\). Extending by the identity outside \(R\), the product becomes \(\sum\mathrm{wt}_R(f)\) over the maps \(f\) that move \(R\) in \(U\) and satisfy \(\sigma(i)\in\{i,f(i)\}\) for all \(i\in R\). Summing over \(\sigma\) and exchanging the two sums gives the claim.
theorem pmin_lapl_eq_sum_maps (a : ι → ι → ZMod 2) {U R C : Finset ι} (hCU : C ⊆ U) :
pmin (lapl a U) R C = ∑ f ∈ mapsOn U R, wt a R f * ((compat R C f).card : ZMod 2)
def compat (R C : Finset ι) (f : ι → ι) : Finset (ι → ι) :=
(bijFun R C).filter fun σ => ∀ i ∈ R, σ i = i ∨ σ i = f i
theorem mem_compat {R C : Finset ι} {f σ : ι → ι} :
σ ∈ compat R C f ↔ σ ∈ bijFun R C ∧ ∀ i ∈ R, σ i = i ∨ σ i = f i
def pmin (M : Matrix ι ι (ZMod 2)) (R C : Finset ι) : ZMod 2 :=
∑ σ ∈ bijFun R C, ∏ i ∈ R, M i (σ i)
ZInQKernel/RouteK/Rank5b/Sec3/Perm.lean:28
def lapl (a : ι → ι → ZMod 2) (U : Finset ι) : Matrix ι ι (ZMod 2) := fun i j =>
if i = j then ∑ k ∈ U.erase i, a i k else a i j
ZInQKernel/RouteK/Rank5b/Sec3/Defs.lean:38
def mapsOn (U R : Finset ι) : Finset (ι → ι) :=
univ.filter fun f => (∀ i, i ∉ R → f i = i) ∧ ∀ i ∈ R, f i ∈ U ∧ f i ≠ i
ZInQKernel/RouteK/Rank5b/Sec3/Forest.lean:30
def wt (a : ι → ι → ZMod 2) (R : Finset ι) (f : ι → ι) : ZMod 2 := ∏ i ∈ R, a i (f i)
ZInQKernel/RouteK/Rank5b/Sec3/Forest.lean:34
def compat (R C : Finset ι) (f : ι → ι) : Finset (ι → ι) :=
(bijFun R C).filter fun σ => ∀ i ∈ R, σ i = i ∨ σ i = f i
ZInQKernel/RouteK/Rank5b/Sec3/Forest.lean:37
def bijFun (R C : Finset ι) : Finset (ι → ι) :=
univ.filter fun σ => (∀ i, i ∉ R → σ i = i) ∧ (∀ i ∈ R, σ i ∈ C) ∧
(∀ i ∈ R, ∀ j ∈ R, σ i = σ j → i = j) ∧ R.card = C.card
ZInQKernel/RouteK/Rank5b/Sec3/Perm.lean:23
Uses 3 · Used by 1
TheoremMaps with a cycle contribute an even number#✓
Let \(U,F\) be subsets of a finite set \(V\), and let \(f\) be a map that moves \(U\setminus F\) in \(U\) and is not acyclic. Then for every \(C\subseteq V\) the number of bijections \(\sigma:U\setminus F\to C\) with \(\sigma(i)\in\{i,f(i)\}\) for all \(i\in U\setminus F\) is even.
Proof sketch. Since \(f\) is not acyclic, some point \(x\) is periodic and not fixed; let \(Z\) be its forward orbit. No point of \(Z\) is fixed, so \(Z\subseteq U\setminus F\); \(f\) maps \(Z\) onto itself and is injective on \(Z\). Let \(\sigma\) be compatible. If \(\sigma(j)=f(j)\) for some \(j\in Z\), then \(\sigma(f(j))\ne f(j)\) by injectivity of \(\sigma\), since \(f(j)\ne j\); so \(\sigma(f(j))=f(f(j))\), and going around the orbit, \(\sigma=f\) on all of \(Z\). Hence either \(\sigma(x)=x\) and \(\sigma\) is the identity on \(Z\), or \(\sigma(x)=f(x)\) and \(\sigma=f\) on \(Z\). Switching \(\sigma\) on \(Z\) between the identity and \(f\), and keeping it elsewhere, gives again a compatible bijection onto \(C\), because both maps send \(Z\) onto \(Z\). This switch is an involution of the compatible bijections without fixed points, since it changes \(\sigma(x)\). So their number is even.
theorem card_compat_even (hf : f ∈ mapsOn U (U \ F)) (hac : ¬IsAcyc f) :
((compat (U \ F) C f).card : ZMod 2) = 0
def mapsOn (U R : Finset ι) : Finset (ι → ι) :=
univ.filter fun f => (∀ i, i ∉ R → f i = i) ∧ ∀ i ∈ R, f i ∈ U ∧ f i ≠ i
ZInQKernel/RouteK/Rank5b/Sec3/Forest.lean:30
def IsAcyc (f : ι → ι) : Prop := ∀ i, f (root f i) = root f i
ZInQKernel/RouteK/Rank5b/Sec3/Forest.lean:44
def compat (R C : Finset ι) (f : ι → ι) : Finset (ι → ι) :=
(bijFun R C).filter fun σ => ∀ i ∈ R, σ i = i ∨ σ i = f i
ZInQKernel/RouteK/Rank5b/Sec3/Forest.lean:37
Uses 1 · Used by 1
TheoremThe map \(\sigma_W\) and the transversal criterion#✓
Let \(U,F,W\) be subsets of a finite set \(V\) and let \(f\) be a forest on \(U\) rooted at \(F\). Call a point reached from \(W\) if it is \(f^k(w)\) for some \(w\in W\) and \(k\ge0\), and let \(\sigma_W\) be the map equal to \(f\) at the points of \(U\setminus F\) reached from \(W\) and equal to the identity elsewhere. Call a bijection \(\sigma:U\setminus F\to U\setminus W\) compatible with \(f\) if \(\sigma(i)\in\{i,f(i)\}\) for all \(i\in U\setminus F\).
If \(F,W\subseteq U\) and \(|F|=|W|\), then \(\sigma_W\) is a compatible bijection if and only if \(W\) is a transversal of \(f\).
Along the way: consider the conditions (A) no point of \(U\setminus F\) reached from \(W\) is sent by \(f\) into \(W\), and (B) two points of \(U\setminus F\) reached from \(W\) with the same image under \(f\) are equal. If (A) and (B) hold, then no two different points of \(W\) have the same root.
Proof sketch. Since \(|U\setminus F|=|U\setminus W|\), \(\sigma_W\) is a compatible bijection if and only if (A) and (B) hold. Suppose (A) and (B), and let \(w\ne w'\) in \(W\) have the same root. Take \(f^a(w)=f^b(w')\) with \(a+b\) minimal and look at the points just before the meeting point: either one of them violates (A) or (B), or one of them lies outside \(U\setminus F\), is fixed by \(f\), and contradicts the minimality. So the root map is injective on \(W\). It sends \(W\) into \(F\), and \(|W|=|F|\), so every tree contains exactly one point of \(W\). Conversely, let \(W\) be a transversal. If \(f^k(w)\in U\setminus F\) and \(f^{k+1}(w)\in W\), then \(f^{k+1}(w)\) and \(w\) have the same root, so \(f^{k+1}(w)=w\); then \(w\) is periodic, hence fixed, and so is \(f^k(w)\), a contradiction; this gives (A). If \(f^a(w)\) and \(f^b(w')\) in \(U\setminus F\) have the same image, then \(w\) and \(w'\) have the same root, so \(w=w'\); if \(a<b\), then \(f^{a+1}(w)\) is periodic, hence fixed, and so is \(f^b(w)\), a contradiction; so \(a=b\), which gives (B).
theorem sigmaW_mem_iff (hFU : F ⊆ U) (hWU : W ⊆ U) (hcard : F.card = W.card)
(hf : f ∈ mapsOn U (U \ F)) (hac : IsAcyc f) :
sigmaW U F W f ∈ compat (U \ F) (U \ W) f ↔ IsTransv f F W
noncomputable def sigmaW (U F W : Finset ι) (f : ι → ι) : ι → ι := fun i =>
if i ∈ U \ F ∧ ∃ w ∈ W, ∃ k, f^[k] w = i then f i else i
theorem merge (hf : f ∈ mapsOn U (U \ F)) {w w' : ι} (hww : w ≠ w')
(hroot : root f w = root f w')
(hA : ∀ i ∈ U \ F, (∃ v ∈ W, ∃ k, f^[k] v = i) → f i ∉ W)
(hB : ∀ i ∈ U \ F, ∀ j ∈ U \ F, (∃ v ∈ W, ∃ k, f^[k] v = i) → (∃ v ∈ W, ∃ k, f^[k] v = j) →
f i = f j → i = j) (hw : w ∈ W) (hw' : w' ∈ W) : False
def mapsOn (U R : Finset ι) : Finset (ι → ι) :=
univ.filter fun f => (∀ i, i ∉ R → f i = i) ∧ ∀ i ∈ R, f i ∈ U ∧ f i ≠ i
ZInQKernel/RouteK/Rank5b/Sec3/Forest.lean:30
def IsAcyc (f : ι → ι) : Prop := ∀ i, f (root f i) = root f i
ZInQKernel/RouteK/Rank5b/Sec3/Forest.lean:44
noncomputable def sigmaW (U F W : Finset ι) (f : ι → ι) : ι → ι := fun i =>
if i ∈ U \ F ∧ ∃ w ∈ W, ∃ k, f^[k] w = i then f i else i
ZInQKernel/RouteK/Rank5b/Sec3/Forest.lean:372
def compat (R C : Finset ι) (f : ι → ι) : Finset (ι → ι) :=
(bijFun R C).filter fun σ => ∀ i ∈ R, σ i = i ∨ σ i = f i
ZInQKernel/RouteK/Rank5b/Sec3/Forest.lean:37
def IsTransv (f : ι → ι) (F W : Finset ι) : Prop :=
∀ ρ ∈ F, (W.filter fun w => root f w = ρ).card = 1
ZInQKernel/RouteK/Rank5b/Sec3/Forest.lean:52
def root (f : ι → ι) (i : ι) : ι := f^[Fintype.card ι] i
ZInQKernel/RouteK/Rank5b/Sec3/Forest.lean:41
Uses 2 · Used by 1
TheoremA forest has at most one compatible bijection#✓
Let \(U,F,W\) be subsets of a finite set \(V\), let \(f\) be a forest on \(U\) rooted at \(F\), and let \(\sigma_W\) and the bijections compatible with \(f\) be as in the transversal criterion.
- Every compatible bijection equals \(\sigma_W\).
- If \(F,W\subseteq U\) and \(|F|=|W|\), the number of compatible bijections is \(1\) if \(W\) is a transversal of \(f\) and \(0\) otherwise.
Proof sketch. (1) Let \(\sigma\) be compatible. By induction on \(k\), if \(f^k(w)\in U\setminus F\) with \(w\in W\), then \(\sigma(f^k(w))=f(f^k(w))\). For \(k=0\), \(\sigma(w)\) lies in \(U\setminus W\), so \(\sigma(w)\ne w\). For the step, \(f^k(w)\) is in \(U\setminus F\) too (otherwise \(f\) fixes it), and \(f^{k+1}(w)=\sigma(f^k(w))\) is already the image of another point, so \(\sigma\) cannot fix it. In the other direction, let \(i\in U\setminus F\) have \(\sigma(i)=f(i)\) without being reached from \(W\). Then \(i\notin W\), so \(i=\sigma(j)\) for some \(j\); \(\sigma(j)=j\) is impossible, since then \(j=i\) and \(\sigma(i)=i\), so \(\sigma(j)=f(j)=i\), and \(j\) is not reached from \(W\) either. Repeating this \(N=|V|\) times gives a point whose \(N\)-th iterate is \(i\); then \(i\) is a root, hence fixed by \(f\), which contradicts \(i\in U\setminus F\). So \(\sigma=f\) exactly at the points of \(U\setminus F\) reached from \(W\), that is, \(\sigma=\sigma_W\).
(2) By (1) there is at most one compatible bijection, \(\sigma_W\), and by the transversal criterion \(\sigma_W\) is one exactly when \(W\) is a transversal.
theorem card_compat_acyc (hFU : F ⊆ U) (hWU : W ⊆ U) (hcard : F.card = W.card)
(hf : f ∈ mapsOn U (U \ F)) (hac : IsAcyc f) :
(compat (U \ F) (U \ W) f).card = if IsTransv f F W then 1 else 0
theorem eq_sigmaW (hf : f ∈ mapsOn U (U \ F)) (hac : IsAcyc f) {σ : ι → ι}
(hσ : σ ∈ compat (U \ F) (U \ W) f) : σ = sigmaW U F W f
def mapsOn (U R : Finset ι) : Finset (ι → ι) :=
univ.filter fun f => (∀ i, i ∉ R → f i = i) ∧ ∀ i ∈ R, f i ∈ U ∧ f i ≠ i
ZInQKernel/RouteK/Rank5b/Sec3/Forest.lean:30
def IsAcyc (f : ι → ι) : Prop := ∀ i, f (root f i) = root f i
ZInQKernel/RouteK/Rank5b/Sec3/Forest.lean:44
def compat (R C : Finset ι) (f : ι → ι) : Finset (ι → ι) :=
(bijFun R C).filter fun σ => ∀ i ∈ R, σ i = i ∨ σ i = f i
ZInQKernel/RouteK/Rank5b/Sec3/Forest.lean:37
def IsTransv (f : ι → ι) (F W : Finset ι) : Prop :=
∀ ρ ∈ F, (W.filter fun w => root f w = ρ).card = 1
ZInQKernel/RouteK/Rank5b/Sec3/Forest.lean:52
noncomputable def sigmaW (U F W : Finset ι) (f : ι → ι) : ι → ι := fun i =>
if i ∈ U \ F ∧ ∃ w ∈ W, ∃ k, f^[k] w = i then f i else i
ZInQKernel/RouteK/Rank5b/Sec3/Forest.lean:372
Uses 3 · Used by 1
TheoremThe forest lemma (Lemma 2.1)#✓
Let \(a\) be bits on a finite set \(V\), let \(U\subseteq V\) with Laplacian \(L_U\), and let \(F,W\subseteq U\) with \(|F|=|W|\). Then $\(\operatorname{per}L_U[U\setminus F,\,U\setminus W]=\sum_f\mathrm{wt}(f),\)$ the sum over the forests \(f\) on \(U\) rooted at \(F\) of which \(W\) is a transversal, that is, in which every tree contains exactly one element of \(W\). This is the case over \(\mathbb F_2\) of the all-minors matrix-tree theorem.
Proof sketch. Since \(U\setminus W\subseteq U\), the diagonal expansion writes the minor as \(\sum_f\mathrm{wt}(f)\cdot\#\mathrm{compat}(f)\) over the maps \(f\) that move \(U\setminus F\) in \(U\), where \(\mathrm{compat}(f)\) is the set of bijections \(\sigma:U\setminus F\to U\setminus W\) with \(\sigma(i)\in\{i,f(i)\}\). The maps that are not acyclic have an even number of compatible bijections and drop out. The acyclic ones are the forests on \(U\) rooted at \(F\), and for a forest the number of compatible bijections is \(1\) if \(W\) is a transversal and \(0\) otherwise.
theorem pmin_lapl_eq_forests (a : ι → ι → ZMod 2) {U F W : Finset ι} (hFU : F ⊆ U) (hWU : W ⊆ U)
(hcard : F.card = W.card) :
pmin (lapl a U) (U \ F) (U \ W) =
∑ f ∈ forests U F, if IsTransv f F W then wt a (U \ F) f else 0
def pmin (M : Matrix ι ι (ZMod 2)) (R C : Finset ι) : ZMod 2 :=
∑ σ ∈ bijFun R C, ∏ i ∈ R, M i (σ i)
ZInQKernel/RouteK/Rank5b/Sec3/Perm.lean:28
def lapl (a : ι → ι → ZMod 2) (U : Finset ι) : Matrix ι ι (ZMod 2) := fun i j =>
if i = j then ∑ k ∈ U.erase i, a i k else a i j
ZInQKernel/RouteK/Rank5b/Sec3/Defs.lean:38
def forests (U F : Finset ι) : Finset (ι → ι) := (mapsOn U (U \ F)).filter IsAcyc
ZInQKernel/RouteK/Rank5b/Sec3/Forest.lean:49
def IsTransv (f : ι → ι) (F W : Finset ι) : Prop :=
∀ ρ ∈ F, (W.filter fun w => root f w = ρ).card = 1
ZInQKernel/RouteK/Rank5b/Sec3/Forest.lean:52
def wt (a : ι → ι → ZMod 2) (R : Finset ι) (f : ι → ι) : ZMod 2 := ∏ i ∈ R, a i (f i)
ZInQKernel/RouteK/Rank5b/Sec3/Forest.lean:34
Uses 6 · Used by 2
A determinant as a forest sum
Expanding the two diagonal blocks of \(P(c,d)\) leaves, for each choice of deleted rows and columns, the product of a minor of \(L\) with its transpose, which over \(\mathbb F_2\) is the minor itself; the forest lemma turns it into forests weighted by their roots and trees.
TheoremMinors of anti-diagonal block matrices and of diagonal shifts#✓
Minors over \(\mathbb F_2\) are the permanent minors \(\operatorname{per}M[R,C]\), sums over the bijections \(R\to C\).
- (Anti-diagonal blocks.) Let \(M,N\) be \(V\times V\) matrices over \(\mathbb F_2\) and \(A,C\subseteq V\). On the rows and columns \(A\sqcup C\) of \(V\sqcup V\), $\(\operatorname{per}\begin{pmatrix}0&M\\N&0\end{pmatrix}[A\sqcup C,A\sqcup C] =\operatorname{per}M[A,C]\cdot\operatorname{per}N[C,A].\)$
- (Diagonal shift.) Let \(Q\) be a square matrix over \(\mathbb F_2\) indexed by a finite set \(X\), and \(e\in\mathbb F_2^X\) with diagonal matrix \(D_e\). Then $\(\operatorname{per}(Q+D_e)[X,X]=\sum_{S\subseteq X}e^S\operatorname{per}Q[X\setminus S,X\setminus S], \qquad e^S=\prod_{x\in S}e_x.\)$
Proof sketch. (1) A pair of bijections \(\nu:A\to C\) and \(\tau:C\to A\) glues to the bijection of \(A\sqcup C\) that sends \(a\) in the first copy to \(\nu(a)\) in the second and \(c\) in the second copy to \(\tau(c)\) in the first, and its product is the product of the two. Every bijection of \(A\sqcup C\) with a nonzero product sends each copy into the other, since the diagonal blocks vanish, and so arises from exactly one such pair. (2) Write each entry as \((D_e)_{x\sigma(x)}+Q_{x\sigma(x)}\) and expand \(\prod_x(Q+D_e)_{x\sigma(x)}\) over the sets \(S\) of points where the diagonal term is taken. The term vanishes unless \(\sigma\) fixes \(S\) pointwise, and then it is \(e^S\prod_{x\notin S}Q_{x\sigma(x)}\). Exchange the sums: the bijections of \(X\) that fix \(S\) pointwise are the bijections of \(X\setminus S\).
theorem pmin_fromBlocks_anti (M N : Matrix ι ι (ZMod 2)) (A C : Finset ι) :
pmin (fromBlocks 0 M N 0 : Matrix (ι ⊕ ι) (ι ⊕ ι) (ZMod 2)) (A.disjSum C) (A.disjSum C) =
pmin M A C * pmin N C A
def glue (A C : Finset ι) (ν τ : ι → ι) : ι ⊕ ι → ι ⊕ ι :=
Sum.elim (fun a => if a ∈ A then Sum.inr (ν a) else Sum.inl a)
(fun c => if c ∈ C then Sum.inl (τ c) else Sum.inr c)
theorem pmin_add_diagonal (Q : Matrix n n (ZMod 2)) (e : n → ZMod 2) :
pmin (Q + diagonal e) univ univ =
∑ S ∈ (univ : Finset n).powerset, (∏ x ∈ S, e x) * pmin Q (univ \ S) (univ \ S)
def pmin (M : Matrix ι ι (ZMod 2)) (R C : Finset ι) : ZMod 2 :=
∑ σ ∈ bijFun R C, ∏ i ∈ R, M i (σ i)
ZInQKernel/RouteK/Rank5b/Sec3/Perm.lean:28
Uses 1 · Used by 1
TheoremThe determinant of \(P(c,d)\) as a forest sum#✓
Let \(a\) be bits on a finite set \(V\), \(L=L_V\) their Laplacian, and \(c,d\in\mathbb F_2^V\), with diagonal matrices \(D_c\), \(D_d\). Let \(P(c,d)\) be the symmetric \((V\sqcup V)\)-square matrix $\(P(c,d)=\begin{pmatrix}D_d&L^{\mathsf T}\\L&D_c\end{pmatrix}.\)$ Then $\(\det P(c,d)=\sum_{F\subseteq V}c^F\sum_f\mathrm{wt}(f)\prod_{\rho\in F}d(T_\rho),\)$ the inner sum over the forests \(f\) on \(V\) rooted at \(F\), where \(c^F=\prod_{\rho\in F}c_\rho\), \(T_\rho\) is the tree of \(f\) at \(\rho\), and \(d(T)=\sum_{v\in T}d_v\).
Proof sketch. By the permanent form of principal minors, \(\det P(c,d)\) is the permanent of \(P(c,d)\) on all of \(V\sqcup V\). Write \(P(c,d)=Q+D\) with \(Q=\begin{pmatrix}0&L^{\mathsf T}\\L&0\end{pmatrix}\) and \(D\) diagonal with diagonal \(e=(d,c)\). The expansion of a diagonal shift gives \(\operatorname{per}(Q+D)=\sum_Se^S\operatorname{per}Q[S^c,S^c]\), over the subsets \(S\) of \(V\sqcup V\). Write \(S=W\sqcup F\), so that \(e^S=d^Wc^F\) and \(S^c=(V\setminus W)\sqcup(V\setminus F)\). By the anti-diagonal block rule, $\(\operatorname{per}Q[S^c,S^c]=\operatorname{per}L^{\mathsf T}[V\setminus W,V\setminus F]\cdot \operatorname{per}L[V\setminus F,V\setminus W]=\operatorname{per}L[V\setminus F,V\setminus W]^2 =\operatorname{per}L[V\setminus F,V\setminus W],\)$ using the transpose rule and \(t^2=t\) in \(\mathbb F_2\). If \(|F|\ne|W|\), this minor is \(0\), and \(W\) is a transversal of no forest rooted at \(F\), since a transversal has one point in each of the \(|F|\) trees. If \(|F|=|W|\), the forest lemma for \(U=V\) makes it the sum of \(\mathrm{wt}(f)\) over the forests \(f\) rooted at \(F\) of which \(W\) is a transversal. Exchanging the sums, a forest rooted at \(F\) carries \(c^F\mathrm{wt}(f)\sum_Wd^W\) over its transversals \(W\). A transversal is a choice of one point in each tree, so \(\sum_Wd^W=\prod_{\rho\in F}d(T_\rho)\).
theorem det_Pmat (a : ι → ι → ZMod 2) (c d : ι → ZMod 2) :
(Pmat a c d).det = ∑ F ∈ (univ : Finset ι).powerset, (∏ ρ ∈ F, c ρ) *
∑ f ∈ forests univ F, wt a (univ \ F) f *
∏ ρ ∈ F, ∑ v ∈ univ.filter (fun v => root f v = ρ), d v
def Pmat (a : ι → ι → ZMod 2) (c d : ι → ZMod 2) : Matrix (ι ⊕ ι) (ι ⊕ ι) (ZMod 2) :=
fromBlocks (diagonal d) (lapl a univ)ᵀ (lapl a univ) (diagonal c)
theorem card_eq_of_isTransv {U F W : Finset ι} {f : ι → ι} (hf : f ∈ forests U F) (hWU : W ⊆ U)
(htr : IsTransv f F W) : F.card = W.card
def Pmat (a : ι → ι → ZMod 2) (c d : ι → ZMod 2) : Matrix (ι ⊕ ι) (ι ⊕ ι) (ZMod 2) :=
fromBlocks (diagonal d) (lapl a univ)ᵀ (lapl a univ) (diagonal c)
ZInQKernel/RouteK/Rank5b/Sec3/DetForest.lean:348
def forests (U F : Finset ι) : Finset (ι → ι) := (mapsOn U (U \ F)).filter IsAcyc
ZInQKernel/RouteK/Rank5b/Sec3/Forest.lean:49
def wt (a : ι → ι → ZMod 2) (R : Finset ι) (f : ι → ι) : ZMod 2 := ∏ i ∈ R, a i (f i)
ZInQKernel/RouteK/Rank5b/Sec3/Forest.lean:34
def root (f : ι → ι) (i : ι) : ι := f^[Fintype.card ι] i
ZInQKernel/RouteK/Rank5b/Sec3/Forest.lean:41
def lapl (a : ι → ι → ZMod 2) (U : Finset ι) : Matrix ι ι (ZMod 2) := fun i j =>
if i = j then ∑ k ∈ U.erase i, a i k else a i j
ZInQKernel/RouteK/Rank5b/Sec3/Defs.lean:38
def IsTransv (f : ι → ι) (F W : Finset ι) : Prop :=
∀ ρ ∈ F, (W.filter fun w => root f w = ρ).card = 1
ZInQKernel/RouteK/Rank5b/Sec3/Forest.lean:52
Forests and set partitions
A family of forests on the blocks of a set partition is a forest on the whole set that preserves the blocks. The compatible partitions with prescribed numbers of roots per block are counted by pairings of the roots.
TheoremGluing forests along a set partition#✓
Let \(\pi\) be a set partition of a finite set \(V\), and write \(\pi(i)\) for the block containing \(i\). For a map \(f:V\to V\) and \(B\subseteq V\) let \(f|_B\) be the map equal to \(f\) on \(B\) and to the identity off \(B\). For each block \(B\) and each map \(g\) let \(h_B(g)\in\mathbb F_2\). Then $\(\prod_{B\in\pi}\ \sum_{g}h_B(g)=\sum_f\ \prod_{B\in\pi}h_B(f|_B),\)$ where in the factor of \(B\), \(g\) runs over the forests on \(B\), and \(f\) runs over the forests on \(V\) with \(f(i)\in\pi(i)\) for every \(i\), that is, those that map every block into itself.
Along the way:
- if a map \(g\) sends \(B\) into \(B\) and \(f\) agrees with \(g\) on \(B\), then on \(B\) the iterates of \(f\) agree with those of \(g\) and stay in \(B\); in particular \(f\) and \(g\) have the same roots at the points of \(B\), and these roots lie in \(B\);
- if \(f\) is a forest on \(V\) that maps \(B\) into itself, then \(f|_B\) is a forest on \(B\);
- every point lies in its block, every \(\pi(i)\) is a block, the blocks are exactly the sets \(\pi(i)\), and \(j\in\pi(i)\) implies \(\pi(j)=\pi(i)\); a set partition is determined by its blocks \(\pi(i)\), \(i\in V\);
- a function \(b\) from \(V\) to the subsets of \(V\) with \(i\in b(i)\) for all \(i\), and \(b(j)=b(i)\) whenever \(j\in b(i)\), is the block function of a set partition, the one whose blocks are the sets \(b(i)\).
Proof sketch. Expanding the product of sums gives a sum over the families \((g_B)_{B\in\pi}\) of forests on the blocks. Glue such a family into the map \(f\) with \(f(j)=g_{\pi(j)}(j)\). It maps each block into itself, and it is acyclic: on a block \(B\) it agrees with \(g_B\), which maps \(B\) into itself, so by (1) the root of a point of \(B\) is its root under \(g_B\), a point of \(B\) fixed by \(g_B\) and hence by \(f\). Conversely, a forest \(f\) on \(V\) that maps each block into itself has the restrictions \(f|_B\), which are forests on the blocks by (2). Gluing the restrictions returns \(f\), and restricting a glued family returns the family, since each \(g_B\) is the identity off \(B\). This bijection matches the terms.
theorem prod_sum_allF (P : Finpartition (univ : Finset ι)) (h : Finset ι → (ι → ι) → ZMod 2) :
∏ B ∈ P.parts, ∑ g ∈ allF B, h B g =
∑ f ∈ (allF univ).filter (fun f => ∀ i, f i ∈ P.part i),
∏ B ∈ P.parts, h B (restrict B f)
def restrict (B : Finset ι) (f : ι → ι) : ι → ι := fun i => if i ∈ B then f i else i
theorem iterate_agree {B : Finset ι} {f g : ι → ι} (hg : ∀ i ∈ B, g i ∈ B)
(hfg : ∀ i ∈ B, f i = g i) (k : ℕ) : ∀ i ∈ B, f^[k] i = g^[k] i ∧ g^[k] i ∈ B
def allF (U : Finset ι) : Finset (ι → ι) := U.powerset.biUnion fun F => forests U F
ZInQKernel/RouteK/Rank5b/Sec3/Glue.lean:28
def restrict (B : Finset ι) (f : ι → ι) : ι → ι := fun i => if i ∈ B then f i else i
ZInQKernel/RouteK/Rank5b/Sec3/Glue.lean:132
Uses 1 · Used by 5
TheoremPairings are odd in number exactly on sets of even size#✓
A pairing of a finite set \(X\) is a fixed-point-free involution of \(X\): a map \(s:X\to X\) with \(s(x)\ne x\) and \(s(s(x))=x\) for all \(x\in X\), that is, a partition of \(X\) into pairs. The number of pairings of \(X\) is odd if \(|X|\) is even and even if \(|X|\) is odd. For distinct \(x,y\in X\), the pairings \(s\) of \(X\) with \(s(x)=y\) correspond bijectively to the pairings of \(X\setminus\{x,y\}\).
Proof sketch. The bijection removes the pair \(\{x,y\}\) from a pairing with \(s(x)=y\), and puts it back in a pairing of \(X\setminus\{x,y\}\). The parity statement is by strong induction on \(|X|\). The empty set has one pairing and a point has none. For \(|X|\ge2\) choose distinct \(x,y\in X\) and conjugate pairings by the transposition \(\tau\) of \(x\) and \(y\), \(s\mapsto\tau s\tau\). This is an involution of the pairings of \(X\), and its fixed points are exactly the pairings with \(s(x)=y\). The other pairings cancel in pairs, so the number of pairings of \(X\) has the parity of the number of pairings of \(X\setminus\{x,y\}\), a set of size \(|X|-2\), and induction applies.
theorem card_fpfi (X : Finset ι) :
((fpfi X).card : ZMod 2) = if Even X.card then 1 else 0
def fpfi (X : Finset ι) : Finset (ι → ι) :=
univ.filter fun s => (∀ i, i ∉ X → s i = i) ∧ ∀ i ∈ X, s i ∈ X ∧ s i ≠ i ∧ s (s i) = i
theorem mem_fpfi {X : Finset ι} {s : ι → ι} :
s ∈ fpfi X ↔ (∀ i, i ∉ X → s i = i) ∧ ∀ i ∈ X, s i ∈ X ∧ s i ≠ i ∧ s (s i) = i
def fpfi (X : Finset ι) : Finset (ι → ι) :=
univ.filter fun s => (∀ i, i ∉ X → s i = i) ∧ ∀ i ∈ X, s i ∈ X ∧ s i ≠ i ∧ s (s i) = i
ZInQKernel/RouteK/Rank5b/Sec3/Count.lean:22
TheoremSet partitions compatible with a forest#✓
Let \(f\) be a forest on a finite set \(V\), with root map \(r\) and set of roots \(R\) (its fixed points); every root \(r(i)\) lies in \(R\), and each element of \(R\) is its own root. A set partition \(\pi\) of \(V\) is compatible with \(f\) if \(f(i)\) lies in the block \(\pi(i)\) of \(i\) for every \(i\). In a compatible partition, \(\pi(f^k(i))=\pi(i)\) for all \(k\), so \(\pi(r(i))=\pi(i)\): a point lies in a block if and only if its root does.
Let \(\rho_7\ne\rho_3\) be roots of \(f\). Then the set partitions \(\pi\) compatible with \(f\) such that \(\rho_7\) is the only root in its block, \(\rho_3\) is the only root in its block, and the block of every other root contains exactly two roots, are as many as the pairings of \(R\setminus\{\rho_7,\rho_3\}\).
Proof sketch. Extend a pairing \(s\) of \(R\setminus\{\rho_7,\rho_3\}\) by the identity and put \(b_s(i)=\{j\in V:r(j)=r(i)\text{ or }r(j)=s(r(i))\}\). Then \(i\in b_s(i)\), and \(j\in b_s(i)\) implies \(b_s(j)=b_s(i)\) because \(s\) is an involution, so \(b_s\) is the block function of a set partition \(\pi_s\). It is compatible with \(f\), since \(r(f(i))=r(i)\). The roots in the block of \(\rho_7\) are just \(\rho_7\), since \(s\) fixes \(\rho_7\), and likewise for \(\rho_3\); the roots in the block of any other root \(\rho\) are \(\rho\) and \(s(\rho)\ne\rho\). The map \(s\mapsto\pi_s\) is injective, since \(s(\rho)\) is the root other than \(\rho\) in the block of \(\rho\). It is onto: given such a partition \(\pi\), let \(s(\rho)\) be the other root in the block of \(\rho\), for \(\rho\in R\setminus\{\rho_7, \rho_3\}\). Then \(s(\rho)\notin\{\rho_7,\rho_3\}\), as otherwise \(\rho\) would be a second root in their block, and \(s(s(\rho))=\rho\), so \(s\) is a pairing. Finally \(\pi=\pi_s\), because the block of \(i\) in either partition consists of the points whose root lies in the block of \(r(i)\), and the roots in that block are \(r(i)\) and \(s(r(i))\); a set partition is determined by its blocks.
theorem card_setA (hf : f ∈ allF (univ : Finset ι)) {ρ7 ρ3 : ι} (h7 : ρ7 ∈ rootsOf univ f)
(h3 : ρ3 ∈ rootsOf univ f) (h73 : ρ7 ≠ ρ3) :
(setA f ρ7 ρ3).card = (fpfi (((rootsOf univ f).erase ρ7).erase ρ3)).card
def Resp (f : ι → ι) (P : Finpartition (univ : Finset ι)) : Prop := ∀ i, f i ∈ P.part i
theorem part_iterate {P : Finpartition (univ : Finset ι)} (hP : Resp f P) (i : ι) (k : ℕ) :
P.part (f^[k] i) = P.part i
def allF (U : Finset ι) : Finset (ι → ι) := U.powerset.biUnion fun F => forests U F
ZInQKernel/RouteK/Rank5b/Sec3/Glue.lean:28
def rootsOf (U : Finset ι) (g : ι → ι) : Finset ι := U.filter fun i => g i = i
ZInQKernel/RouteK/Rank5b/Sec3/Glue.lean:25
def setA (f : ι → ι) (ρ7 ρ3 : ι) : Finset (Finpartition (univ : Finset ι)) :=
univ.filter fun P => Resp f P ∧ P.part ρ7 ∩ rootsOf univ f = {ρ7} ∧
P.part ρ3 ∩ rootsOf univ f = {ρ3} ∧
∀ ρ ∈ rootsOf univ f, ρ ≠ ρ7 → ρ ≠ ρ3 → (P.part ρ ∩ rootsOf univ f).card = 2
ZInQKernel/RouteK/Rank5b/Sec3/Count.lean:245
def fpfi (X : Finset ι) : Finset (ι → ι) :=
univ.filter fun s => (∀ i, i ∉ X → s i = i) ∧ ∀ i ∈ X, s i ∈ X ∧ s i ≠ i ∧ s (s i) = i
ZInQKernel/RouteK/Rank5b/Sec3/Count.lean:22
def Resp (f : ι → ι) (P : Finpartition (univ : Finset ι)) : Prop := ∀ i, f i ∈ P.part i
ZInQKernel/RouteK/Rank5b/Sec3/Count.lean:217
Uses 3 · Used by 5
Loading dependency explorer…
The dependency explorer needs JavaScript and its graph data.