The tensor intersection of subspaces: the dimension of {X : columns ⊆ U ∧ rows ⊆ W} #
The whole difficulty of the dimension tensor formula $k = k_1k_2 + k_1^\top k_2^\top$ is concentrated in one fact: the space of matrices whose columns lie in $U$ and whose rows lie in $W$ has dimension exactly $\dim U\cdot\dim W$ (the dimension count of a subspace tensor intersection, that is, the dimension of $U\otimes W$).
This module proves it in one go (finrank_colsRows), by an explicit equivalence
rather than a dimension argument:
- take a basis $u$ of $U$ together with the coordinate read-back linear map $L$ on
Fin a → Vec p(a left inverse of an independent family,exists_leftInverse_of_linearIndependent) - the coefficient expansion
vee($a\times s$ coefficients ↦ $p\times s$ matrices) and the coordinate extractionwedge($p\times s$ matrices ↦ $a\times s$ coefficients) are mutually inverse - the key step: the row condition is unaffected by
wedge, which translates "the rows all lie in $W$" into "the rows all lie in $W$", so $\{columns\subseteq U,\ rows\subseteq W\}\cong \{\text{rows}\subseteq W\}$, and the latter is isomorphic toFin a → W, of dimension $a\cdot\dim W$.
The first two auxiliary facts (the dimensions of the column- and row-constrained spaces)
are finrank_colsSub / finrank_rowsSub.
Index conventions #
Matrices are always written with product indexing,
VMat p s = Fin p × Fin s → ZMod 2 (the same row type as hgpHX), and are never
flattened into Fin; the structural theorem therefore needs no relabelling.
1. Product-indexed matrices and the two constrained subspaces #
The column-constrained subspace: the matrices all of whose columns lie in U.
Equations
- QECCertificates.colsSub U = { carrier := {X : QECCertificates.VMat p s | ∀ (j : Fin s), QECCertificates.colOf X j ∈ U}, add_mem' := ⋯, zero_mem' := ⋯, smul_mem' := ⋯ }
Instances For
The row-constrained subspace: the matrices all of whose rows lie in W.
Equations
- QECCertificates.rowsSub W = { carrier := {X : QECCertificates.VMat p s | ∀ (i : Fin p), QECCertificates.rowOf X i ∈ W}, add_mem' := ⋯, zero_mem' := ⋯, smul_mem' := ⋯ }
Instances For
2. The dimensions of the column- and row-constrained spaces #
The dimension of the column-constrained space: $\dim\{X : \mathrm{col}\,X\subseteq U\} = s\cdot\dim U$.
The dimension of the row-constrained space: $\dim\{X : \mathrm{row}\,X\subseteq W\} = p\cdot\dim W$.
3. Coordinate read-back of an independent family (left inverse) #
Left inverse of an independent family: when u : Fin a → Vec p is linearly
independent, there is a linear map L that reads the coefficients $c$ back from any
combination $\sum_k c_k u_k$.
The construction: the combination map $\varphi(c)=\sum_k c_k u_k$ is injective by
independence, and one takes a left inverse of it on the whole space
(LinearMap.exists_leftInverse_of_injective: over a vector space every injective linear
map has a left inverse).
Coefficient expansion: expands an a×s coefficient matrix along the basis vectors
of U into a p×s matrix (column j is $\sum_k C_{kj}u_k$).
Equations
Instances For
Coordinate extraction: reads each column of a p×s matrix as coefficients, through
the left inverse L.
Equations
- QECCertificates.wedge L = { toFun := fun (X : QECCertificates.VMat p s) (kj : Fin a × Fin s) => L (QECCertificates.colOf X kj.2) kj.1, map_add' := ⋯, map_smul' := ⋯ }
Instances For
vee after wedge is the identity (on the column-constrained space): vee is a left
inverse of wedge.
The row condition pushes forward: if the rows of X all lie in W, then so do the
rows of wedge L X (substituting the matrix representation L x = Σ_i x_i · L(e_i) into
the row sums of wedge).
The row condition pulls back: if the rows of wedge L X all lie in W and the
columns of X all lie in U, then the rows of X all lie in W (using
vee_wedge_of_coords to write the rows of X as combinations of the rows of
wedge L X).
6. Main theorem: the dimension of the tensor intersection #
The dimension of the tensor intersection: the space of matrices with columns in
U and rows in W has dimension exactly $\dim U\cdot\dim W$.
This is the only nontrivial dimension input to the tensor formula $k=k_1k_2+k_1^\top k_2^\top$ (the dimension of $U\otimes W$ in the language of matrices). The proof goes through an explicit equivalence:
$$\{X:\mathrm{col}\,X\subseteq U,\ \mathrm{row}\,X\subseteq W\}\;\cong\;\mathrm{Fin}\,a\to W, \qquad a=\dim U,$$
the forward map extracting coordinates with wedge and then taking rows, the backward map
forming vee from the W-combinations of the coefficient rows.