# Registered protocol 4: compact proof steps, a CDCL baseline, and the pigeonhole theorem at new sizes

Frozen on 29 November 2026, after protocols 1–3 were scored and published (pull requests #28 and #29), and before
any run under this protocol beyond the ones named below. Corrections are dated addenda at the end.

## What it tests

1. **Compact proof steps** (`prover.py`, `--compact`). Each AND and implication step of the prover used to write three
   clauses: one per case of the split variable, and the step itself. Bryant and Heule's solver writes at most two: one
   case as a clause, and the step with that clause and the other case's chain as hints, or a single clause when one
   case is already settled by an existing clause. The BDDs, the orders and the schedule are unchanged (with
   `--compact` off, the proofs of protocols 1–3 are reproduced byte for byte; checked on three formulas).
2. **A CDCL baseline** (`cdcl.py`): Kissat 4.0.4 (github.com/arminbiere/kissat, commit `8af8e56`, built from source
   with the owner's approval on 29 November 2026) on exactly the shuffled formulas the sweep is given, with the same
   limit of 1,800 seconds. Its DRAT proof is streamed and counted (text format), not stored or checked.
3. **The theorem of `THEORY.md`** at sizes it was not derived from: on direct-encoded pigeonhole the largest state of
   every run must equal max_i (n − i)(i + 1)(n + 1 − i).

The schedule is protocol 2's ordered sweep (`sweep2`) and the orders protocol 3's (`auto3`). Every formula uses
shuffle 10, which no earlier protocol used.

## What was seen before this freeze

- With `--compact`, on other shuffles: `chess` 24 (444,825 proof clauses, against 585,090 without), `php-direct` 24
  (945,429 against 1,192,892) and 36 (4,297,704), `tseitin-grid` 24 (221,926 against 261,933); all verified.
- Kissat on four of this protocol's own formulas (shuffle 10), as smoke tests: `php-direct` 8 (0.5 s) and 10 (56 s),
  `chess` 8 and 12 (under 1 s), `tseitin-grid` 8 and 10 (2.8 s at 10).
- Schedule variants that were tried and are not part of this protocol: early quantification, folding a slice's
  clauses, and grouping a clause with the larger clause containing its variables. On the chessboard the hand-designed
  orders with grouping came within 1.3 times of Bryant and Heule's published proof sizes, but the variants helped
  some families and hurt others (`php-onto` grew by 19% with grouping), so none is tested here.
- The theorem was checked by `theory.py` for n = 6, 10, 16 and 24 and against the largest states of protocol 3
  (n = 8 to 56).

## Frozen files (SHA-256)

```
1dbffcaa7d53a0332a712937bf421e24976ccde6868da1a48415f322764f026a  prover.py
ecbc6620b97c0d434236f7aa5fec1b7ab21fa9751cbc5a0d8dfe292253b75404  schedule.py
c8b6ed1b4c139b14e77954e2207e5f782890ae56c4a0800cbb3e8b20a49f53c9  spectral.py
a2f83777ec091346b2861b995585c560a138e3a462c047a2d0b59721b030cb3f  orders.py
21509b0ef4e947653200ef1d39c1e01db01b2a2720ac1cdd1bc961e4593b333a  families.py
e533623d40388c8c0754fd67f4f09bc82806c8376627dba6406ecb85fb9d9ea9  run.py
0780a0bd196d6bcd918534989a988f72e2a30c2b3cb57367adccae5fc042ea6d  cdcl.py
652dcf06d2403c508b372f38cf645b93be85268a596d83afc349cef4a7968801  experiment.py
01085292945d492b1f02456782f28a91f7782fa57f1667563a4943d11e8f6c2f  analyze.py
157765bce470ea0b53995b0dbd0a30ba64b5c47a78d890d7bfed4f745d1ab9c5  theory.py
```

## Runs

`python3 experiment.py --protocol 4` runs the 12 series listed by `--protocol 4 --list`: the sweep on six families
(group T2) and Kissat on the same six (group T3). Limits as in protocols 1–3: 50 million proof clauses, 1,800 seconds
and 7 GiB per run; a series stops at its first run over a limit.

## Hypotheses and how they are scored (`analyze.py --protocol 4`)

- **T0 (soundness).** Every "unsat" run of the sweep has a proof that `lrat-check` verifies.
- **T1 (compact steps make the proofs smaller).** At every size measured both here and in the protocol that last ran
  the same family with the same orders (protocol 3 for the pigeonhole families, protocol 2 for `chess`, `chess-four`
  and `tseitin-grid`; protocols 2 and 3 showed that shuffling does not change these proof sizes), the compact proof is
  at most 0.9 times the earlier one.
- **T2 (scaling).** For each of the six families, verified proofs up to n ≥ 32, the power fit beats the exponential fit
  over n ≥ 16, and the exponent is at most 5.
- **T3 (CDCL).** For `php-direct`, `php-sinz`, `php-onto` and `chess`: the largest n that Kissat solves within 1,800
  seconds is smaller than the largest n at which the sweep writes a verified proof; and at the smallest size the sweep
  ran that is at least Kissat's largest solved n, the sweep's total time (orders, proof and check) is less than
  Kissat's time. Reported, not scored, for `chess-four` and `tseitin-grid`.
- **T4 (the theorem).** For every verified `php-direct` run, the largest state equals max_i (n − i)(i + 1)(n + 1 − i).

Reported, not scored: the size at n = 36 of the direct-encoded pigeonhole proof with its input clauses, against
Bryant's 95,494,509.

## Addenda

### Addendum 1 (29 November 2026, after the sweep runs and before the last Kissat run finished)

1. **Memory.** In compact mode the prover kept the literals of each step's case clause after the step that used them,
   which the three-clause mode does not (`Prover.forget` was not called on it). The case clause is now forgotten
   when it was written for that step alone; proofs are byte-identical (checked on four shuffle-10 formulas), and peak
   memory at `php-direct` 32 fell from 758 to 675 MB. The registered runs were made before the fix: `php-direct` and
   `php-onto` stopped at the 7 GiB limit at n = 56, where protocol 3 had reached n = 56 on `php-direct` without
   compact steps.
2. **T1, explained after scoring (not registered).** T1 compares compact proofs on shuffle 10 with the earlier
   protocols' proofs on other shuffles, on the premise that shuffling does not change proof sizes. That premise was
   shown in protocols 2 and 3 only for `php-direct` and `chess`; protocol 1 (H5) had already seen ratios up to 1.40
   between shuffles of `tseitin-grid`. Run on the very same shuffle-10 formulas with and without `--compact`, the
   compact proofs are 0.835 times the others on `tseitin-grid` at n = 32 (486,877 against 582,803 clauses) and 0.834
   at n = 48, and 0.69 on `php-sinz` at n = 20 and 24, with identical BDD node counts. T1's failure therefore comes
   from the orders differing between shuffles of the same Tseitin grid, not from the compact steps; it stands as
   registered.
