# Rank-five matroid certificate

Run `python3 verify.py certificate.json` with Python 3.9 or newer. The verifier uses the standard library and integer arithmetic. Polynomial coefficients in its output are ordered from constant term to leading term.

## Data format

`certificate.json` is one JSON object. Its fields specify the ground set and the complete family of bases by coordinate rules.

| Field | Meaning |
| --- | --- |
| `prime` | The prime `q` defining the coordinate field `F_q`. |
| `field_modulus` | The five coefficients of a monic irreducible quartic, from constant term to leading term. |
| `frobenius_indices` | The list `[0, 1, 2, 3]`. Entry `i` gives the exponent `q**i` in the graph rule. |
| `auxiliary_index` | The zero-based position of the graph coefficient used as the auxiliary point label. This format uses position `3`. |
| `rank` | The size of each basis. This format uses rank `5`. |

Set `K = F_q[z]/(field_modulus)`. Encode an element of `K` by its four coefficients in the basis `1, z, z², z³`, using residues from `0` through `q-1`. The following disjoint families are the ground set.

- A geometric point is a nonzero eight-tuple over `F_q` whose first nonzero entry is `1`. It represents the one-dimensional space spanned by that vector in `K × K`. The first four coordinates encode the first component and the last four encode the second.
- An auxiliary point is a four-tuple over `F_q`. Write it as `p_a` for the corresponding element `a` of `K`.

For every four-tuple `(c_0, c_1, c_2, c_3)` of elements of `K`, form the graph of the map

```text
f(t) = c_0 t + c_1 t^q + c_2 t^(q^2) + c_3 t^(q^3).
```

A block consists of every geometric point in that graph and the auxiliary point `p_(c_3)`. A five-element subset is a basis exactly when its geometric vectors are linearly independent over `F_q` and the subset is contained in no block. This rule specifies every basis, including those containing auxiliary points. With exactly one auxiliary point, block containment amounts to solving a linear system over `F_q` for `c_0, c_1, c_2` with `c_3` fixed. The verifier's `Matroid` class provides a ground-set iterator and a basis membership test.

## Matroid and flats

The verifier tests that `q` is prime and that the modulus has no monic factor of degree one or two. These checks give a field of size `q^4`. Each graph map is linear over `F_q`. Two coefficient tuples giving the same map would have a difference polynomial vanishing at all `q^4` elements despite having degree at most `q^3`. Thus all graphs are distinct. Two distinct graphs with the same auxiliary label have intersection dimension at most two, since their difference has degree at most `q^2`. Graphs with different labels intersect in dimension at most three and share no auxiliary point.

The starting matroid is the direct sum of the geometric point matroid and the free matroid on the auxiliary points. Its flats have the form `(U, A)`, with `U` a vector subspace of `K × K` and `A` a set of auxiliary labels. The rank is `dim(U) + |A|`. Every block is a rank-five flat of this starting matroid, and the intersection bounds give each independent four-set at most one containing block.

Keep the independent sets of the starting matroid through size four and use the encoded bases for size five. Five coordinate axes give a basis, which the verifier checks. The family is hereditary. For augmentation, the only new case has an independent four-set `I` and a basis `J`. At least one element of `J` lies outside the starting closure of `I`. If every such element failed to extend `I` to a basis, every one would lie in the unique block containing `I`. That block is a starting flat, so it also contains the starting closure of `I` and hence all of `J`. This contradicts the basis rule.

Testing closure of a set of rank at most three only requires independence through size four, so its flat stays unchanged. A rank-four flat is the closure of an independent four-set. Its closure is the containing block if one exists and its starting closure otherwise. The full ground set is the sole rank-five flat. This gives the whole lattice with order given by inclusion.

## Exact chain counts

Let the vertical subspace be `0 × K`. A geometric four-space with zero intersection with the vertical space is the graph of a linear map on all of `K`. The graph rule gives every such map because it gives `q^16` distinct maps and a linear map on a four-dimensional space has `q^16` possibilities.

A geometric three-space with zero vertical intersection is a graph on a three-dimensional subspace of the first copy of `K`. For a fixed label, distinct choices of the other three coefficients restrict to distinct maps on that subspace by the degree bound `q^2 < q^3`. There are `q^12` choices, equal to the number of linear maps from that subspace to `K`. Thus each such rank-four flat with one auxiliary point is absorbed by exactly one block.

The verifier counts surviving old hyperplanes with zero or one auxiliary point by counting geometric spaces with positive vertical intersection dimension. For a geometric `k`-space with vertical intersection dimension `j`, choose a `j`-space `B` in the vertical copy and a `(k-j)`-space in the first copy. The remaining choice is a linear map from that image into `K/B`, giving `q^((k-j)(4-j))` possibilities. All old rank-four flats with two or more auxiliary points survive. New hyperplanes are the blocks, one per graph. Their proper lower flats are indexed by the subspaces of the graph and the subsets of its singleton label, restricted to ranks at most three.

For each requested set of internal ranks, count chains from the top down. Choosing a subspace of dimension `i` in an `n`-space uses the ratio of the numbers of ordered independent `i`-tuples in dimensions `n` and `i`. Choosing `j` auxiliary labels from `t` uses the binomial coefficient. After choosing the largest flat of a chain, apply the same count inside it to the remaining ranks. If rank four occurs, sum over the hyperplane families above. The exact enumeration uses the coordinate families without materializing the ground set or all its flats in memory.

## Polynomial and root checks

The verifier uses Propositions 4.6 and 4.7 of Caiolo, Ferroni and Hoster. In the chain expansion of the right augmented polynomial, a strict step of rank gap `d` contributes `(-1)^(d+1) (1+x+...+x^d)`. This follows by expanding the inverse-kernel recursion in Proposition 4.6. For the dual Chow polynomial, Proposition 4.7 composes that inverse with the kernel `(-x)^d`. The verifier therefore adds the terms with the last factor replaced by `(-x)^d` and the entire right augmented polynomial for the case where this kernel is taken on the diagonal. Each weight depends only on the ranks in the chain and is multiplied by the independently counted number of chains of those ranks. [CFH, Sections 4.2, 4.4 and 7.2](https://arxiv.org/html/2605.28474v1#S4.SS2)

For the resulting degree-four and degree-five polynomials, the verifier recovers the coefficients `g_i` by successive subtraction of `g_i x^i(1+x)^(degree-2i)` and checks that the remainder is zero. In both cases it tests `g_0 > 0`, `g_2 > 0`, and `g_1^2 - 4 g_0 g_2 < 0`. The quadratic `g_0 + g_1 y + g_2 y^2` is then strictly positive for every real `y`. For real `x != -1`, use `y = x/(1+x)^2` and multiply by `(1+x)^degree`. At `x = -1`, the degree-four polynomial has value `g_2`, and the degree-five polynomial has a simple root because its quotient by `1+x` has value `g_2`. Both polynomials consequently have nonreal zeros.

The graph construction is the instance specified in the public claim. The certificate contains the field and graph parameters only. [Public construction](https://github.com/1337isnot1337/solved-conjectures/blob/main/results/caiolo-ferroni-hoster/PROOF.md)
