1 Genes and Chromosomes
1.1 Gene types and genes
A gene type is one of three polarization types: \(\mathtt{NonPolarized}\), \(\mathtt{Positive}\), or \(\mathtt{Negative}\). There is a natural involution \(\varepsilon \mapsto -\varepsilon \) that swaps \(\mathtt{Positive}\) and \(\mathtt{Negative}\) and fixes \(\mathtt{NonPolarized}\).
A gene \(g = (n, \varepsilon )\) consists of a rank \(n \in \mathbb {N}\) and a type \(\varepsilon \in \mathtt{GeneType}\).
For \(n \ge 1\) and a type \(\varepsilon \), \(\mathtt{Gene.ofRank}\, n\, \varepsilon \) is the one-gene chromosome consisting of the gene \((n,\varepsilon )\) with multiplicity one; for \(n=0\) it is the zero chromosome. The variant \(\mathtt{Gene.ofRankAlt}\) uses the alternating type \((-1)^{n-1}\varepsilon \).
The signature of a gene \(g = (n, \varepsilon )\) is a pair \((a, b) \in \mathbb {Q} \times \mathbb {Q}\) defined by:
If \(\varepsilon = \mathtt{NonPolarized}\): \((a,b) = (n/2,\, n/2)\).
If \(\varepsilon = \mathtt{Positive}\): \((a,b) = (\lceil n/2 \rceil ,\, \lfloor n/2 \rfloor )\).
If \(\varepsilon = \mathtt{Negative}\): \((a,b) = (\lfloor n/2 \rfloor ,\, \lceil n/2 \rceil )\).
For any gene \(g\), we have \(a(g) + b(g) = \mathrm{rank}(g)\).
1.2 Chromosomes
A chromosome is a finitely supported function \(X \colon \mathtt{Gene} \to \mathbb {N}\), i.e. a formal sum of genes with non-negative integer multiplicities. We write \(\mathtt{Chromosome} = \mathtt{Gene} \to _0 \mathbb {N}\).
The signature of a chromosome \(X\) is the additive extension: \(\mathrm{sig}(X) = \sum _{g} X(g) \cdot \mathrm{sig}(g) \in \mathbb {Q} \times \mathbb {Q}\).
The signature of \(\mathtt{Gene.ofRank}\, n\, \varepsilon \) is the signature of the corresponding gene when \(n\ne 0\), and zero when \(n=0\). For polarized types the file also records the one-step recurrence obtained by lowering the rank and changing, or preserving, the sign according to the parity.
The rank of a chromosome \(X\) is \(\mathrm{rank}(X) = \sum _g X(g) \cdot \mathrm{rank}(g)\).
For any chromosome \(X\), the sum of the two signature components equals the rank: \(\mathrm{sig}(X).1 + \mathrm{sig}(X).2 = \mathrm{rank}(X)\).
If \(\mathrm{sig}(X)=0\), then \(X=0\).
For chromosomes \(X\) and \(Y\), we say \(X\) dominates \(Y\) (written \(Y \le X\)) if \(\mathrm{sig}(Y^{(k)}) \le \mathrm{sig}(X^{(k)})\) componentwise for all \(k \ge 0\), where \(X^{(k)}\) denotes the \(k\)-th derivative.
The dominance preorder is an ordered cancel additive monoid structure on chromosomes. In particular, subtracting the same present gene from two strictly ordered chromosomes preserves strict order.
1.3 Prime and lift operations
The prime (derivative) operation \(X \mapsto X'\) is the additive homomorphism that maps a gene \((n, \varepsilon )\) to the gene \((n-1,\varepsilon )\) when \(n{\gt}1\), and sends rank-one genes to \(0\).
Prime lowers the rank of an \(\mathtt{ofRank}\) generator by one, iterated prime lowers it by the number of iterations, and the coefficient of a gene \(g\) in \(X'\) is the coefficient of the rank-shifted gene \((g.rank+1,g.type)\) in \(X\).
The lift operation is an additive homomorphism mapping a gene \((n,\varepsilon )\) to \((n+1,\varepsilon )\).
The prime operation is a left inverse to lift: \((\mathrm{lift}\, X)' = X\) for all \(X\).
If \(X \ne 0\), then \(\mathrm{maxRank}(X') {\lt} \mathrm{maxRank}(X)\).
1.4 Decompositions
For \(k \in \mathbb {N}\), \(X_{\le k}\) (below) filters genes with rank \(\le k\), and \(X_{{\gt} k}\) (above) filters genes with rank \({\gt} k\). We have \(X = X_{\le k} + X_{{\gt} k}\).
The below/above filters decompose a chromosome. The below part of rank at most \(k\) is killed by \(k\) primes, so \(X\) can be reconstructed from \(X^{(k)}\) by lifting, together with its below-\(k\) part.
Every chromosome decomposes as \(X = X_{\mathrm{odd}} + X_{\mathrm{even}}\) where \(X_{\mathrm{odd}}\) (resp. \(X_{\mathrm{even}}\)) collects genes of odd (resp. even) rank.
\((X')_{\mathrm{even}} = (X_{\mathrm{odd}})'\) and \((X')_{\mathrm{odd}} = (X_{\mathrm{even}})'\).
The Lean development now follows the mathematical blocks Basic, Signature, Prime, Rank, Order, Lift, and Parity under the Chromosome directory. The module YoungDiagram.Chromosome re-exports them as the stable public entry point.