# RRLS v0.22 — Elastic Unfolding / Holonomy

## Status

**P = NP is not proved.**

This release formalizes the "fix one end of a messy loop, stretch it straight, track
where every coordinate moved, solve the straightened object, then snap it back" idea.

The mathematically safe version is not to keep only a scalar distance.  It is to keep
the full **closure defect / holonomy coordinate** created when loops are unwrapped.

---

## 1. Elastic Unfolding Lemma

Let the factor graph of a Boolean constraint instance have variable nodes V, factor
nodes C, and incidence edges E. Choose any spanning forest T.

For every non-tree incidence edge e=(v,c), cut that occurrence and replace it by an
independent copy v_e. The stretched factor graph is now a forest.

Define one Boolean closure defect per cut:

    d_e = x(v_e) XOR x(v).

Let F_tilde be the stretched constraint system and define the exact defect language

    D_F = { d :
              exists assignment y satisfying F_tilde
              whose closure-defect vector is d }.

Then

    F is satisfiable  iff  0 is in D_F.

Proof:
- every original satisfying assignment extends to the stretched system by assigning
  each copy the value of its original variable, producing d=0;
- every stretched satisfying assignment with d=0 identifies every copy with its
  original variable and therefore induces an original satisfying assignment.

The implementation was differentially checked on clause, XOR, exact-1, and NAE factors:

    128/128 exact agreement.

---

## 2. This is the rigorous version of "stretch and remember distance"

A loop cannot be turned into a globally open line by a reversible deformation without
remembering the closure information somewhere.

Cutting/unwrapping removes the topological loop from the visible graph, but each cut
creates a defect coordinate.  The number of independent cuts is the cycle rank of the
factor graph:

    beta_1 = |E| - |V| - |C| + components.

So the stretched object becomes structurally easy, while the missing global consistency
moves into D_F.

This is exactly the computational analogue of storing winding/holonomy while unwrapping
a cyclic coordinate.

---

## 3. Important correction: scalar distance is not enough

Suppose two cut coordinates move in different directions but travel the same absolute
distance. A scalar distance would identify them even though they can impose different
snap-back constraints.

The exact retained object must therefore be one of:

- a signed/vector displacement;
- a defect bit/vector;
- a winding number;
- a holonomy/transport operator;
- or, for a smooth nonlinear deformation, enough information to evaluate the inverse map.

If y=T(x), solving in stretched coordinates means solving

    G(y) = F(T^(-1)(y)).

The snap-back step is

    x* = T^(-1)(y*).

Only when T is linear does this reduce to matrix multiplication by T^(-1).
For a general deformation, "multiply retained distance by the found function" is not
mathematically sufficient.

---

## 4. Exact defect-language experiment

Small factor systems were stretched to trees and their entire defect languages were
enumerated exactly.

| family   |   defects |   cases |   median_states |   median_density |   affine_rate |   median_anf |   median_walsh |   median_bdd |   median_real_rank |   median_gf2_rank |   anf_fraction |   walsh_fraction |
|:---------|----------:|--------:|----------------:|-----------------:|--------------:|-------------:|---------------:|-------------:|-------------------:|------------------:|---------------:|-----------------:|
| 1-in-3   |         9 |       1 |              90 |       0.175781   |           0   |        177   |          288   |         44   |                9   |               9   |    0.345703    |      0.5625      |
| 1-in-3   |        11 |       2 |             163 |       0.0795898  |           0   |        664.5 |          768   |         62   |               14   |              14   |    0.324463    |      0.375       |
| 1-in-3   |        12 |       1 |             306 |       0.074707   |           0   |        960   |         2176   |         89   |               14   |              14   |    0.234375    |      0.53125     |
| 1-in-3   |        13 |       1 |             528 |       0.0644531  |           0   |       1256   |          680   |         60   |               11   |              11   |    0.15332     |      0.0830078   |
| 1-in-3   |        14 |       1 |             559 |       0.0341187  |           0   |       3376   |        16384   |        116   |               17   |              17   |    0.206055    |      1           |
| 1-in-3   |        15 |       1 |             304 |       0.00927734 |           0   |      12052   |         5344   |        225   |               37   |              37   |    0.367798    |      0.163086    |
| 3-SAT    |         9 |       2 |             512 |       1          |           1   |          1   |            1   |          0   |                1   |               1   |    0.00195312  |      0.00195312  |
| 3-SAT    |        11 |       2 |            2048 |       1          |           1   |          1   |            1   |          0   |                1   |               1   |    0.000488281 |      0.000488281 |
| 3-SAT    |        13 |       2 |            8192 |       1          |           1   |          1   |            1   |          0   |                1   |               1   |    0.00012207  |      0.00012207  |
| 3-SAT    |        15 |       1 |           32768 |       1          |           1   |          1   |            1   |          0   |                1   |               1   |    3.05176e-05 |      3.05176e-05 |
| 3-XOR    |         9 |       2 |             256 |       0.5        |           1   |          5   |            1   |          7   |                1   |               1   |    0.00976562  |      0.00195312  |
| 3-XOR    |        11 |       2 |             768 |       0.375      |           1   |         19   |            2.5 |         14   |                1.5 |               1.5 |    0.00927734  |      0.0012207   |
| 3-XOR    |        13 |       2 |            2560 |       0.3125     |           1   |        120.5 |            4.5 |         30   |                5   |               5   |    0.0147095   |      0.000549316 |
| 3-XOR    |        15 |       1 |            2048 |       0.0625     |           1   |        916   |           16   |        111   |               16   |              16   |    0.0279541   |      0.000488281 |
| NAE-3    |         9 |       1 |             512 |       1          |           1   |          1   |            1   |          0   |                1   |               1   |    0.00195312  |      0.00195312  |
| NAE-3    |        10 |       1 |            1020 |       0.996094   |           0   |         17   |          256   |          8   |                2   |               2   |    0.0166016   |      0.25        |
| NAE-3    |        11 |       2 |            2034 |       0.993164   |           0.5 |         29   |          256.5 |          7   |                2   |               2   |    0.0141602   |      0.125244    |
| NAE-3    |        13 |       2 |            8027 |       0.979858   |           0   |        364.5 |         4608   |         45.5 |                7.5 |               7.5 |    0.0444946   |      0.5625      |
| NAE-3    |        15 |       1 |           31378 |       0.957581   |           0   |       4071   |        16384   |        360   |               50   |              50   |    0.124237    |      0.5         |

The important contrast:

### XOR

Every tested XOR defect language was affine.

So after stretching the graph, the loop-memory itself collapses into a GF(2) linear
system.  This is exactly why global parity can remain easy even when the visible graph
contains many loops.

### Positive 1-in-3

The tested defect languages were non-affine and quickly became much richer.

One k=15 case had:

- 32,768 possible defect vectors;
- only 304 feasible defect states;
- 12,052 nonzero ANF terms;
- sampled OBDD size 225;
- sampled flattening rank 37.

The stretched tree is easy.  The difficulty has moved into the snap-back compatibility
language.

### NAE-3

The defect relation also becomes non-affine on denser tested cases, despite often being
close to full as a set.

### Sparse planted 3-SAT

The tested small sparse clause systems often allowed every defect vector.  That means
the stretched local clauses were too weak to constrain the cut-memory in those samples;
it is not evidence that hard random 3-SAT is solved by the lift.

---

## 5. Domain lifting has a conservation law unless semantics collapse

Bundling b Boolean variables into one super-coordinate reduces the visible coordinate
count, but that super-coordinate has 2^b raw states.

For a graph partition into blocks P, assign block B weight

    w(B)=|B|=log2(2^|B|).

Any tree decomposition of the quotient graph can be expanded by replacing every block
with its constituent Boolean variables. Therefore the weighted bag size of pure
bundling cannot be smaller than the original treewidth+1.

So:

    coordinate count down

does not imply

    information-width down.

A useful lift must reduce the **semantic domain**, not just the number of coordinate
labels.

Pigeonhole is the positive example: a block of b slot bits has 2^b raw Boolean states,
but exact-one structure reduces its legitimate semantic domain to only b states.

That is a true entropy collapse.

---

## 6. New target: Holonomy Algebra

The stretched representation converts arbitrary loop structure into:

    tree-local constraints
    +
    global defect language D_F.

Tree-local reasoning is polynomial.

Therefore the entire wall becomes:

> Can D_F be canonically compiled into a polynomial-size tractable algebra for every F?

For XOR:
    yes -> affine rank.

For the tested 1-in-3 / NAE cases:
    not by the current affine / ANF / sampled-BDD languages.

A universal polynomial canonicalizer for D_F would provide exactly the kind of
"retained-distance function" needed to snap every stretched solution back into a
globally consistent solution.

That is the next RRLS search target.

---

## 7. Strongest candidate algorithm suggested by the stretch idea

    1. choose a canonical anchor / spanning forest;
    2. cut non-tree incidences;
    3. solve or simplify the resulting tree factors;
    4. compile the exact defect language D_F;
    5. discover a canonical algebra for D_F;
    6. test whether 0 belongs to D_F;
    7. reconstruct the tree assignment and identify copies;
    8. snap back through the inverse transport map.

The proof gate remains closed until steps 4-5 are proved polynomial for every CNF.

But this framing is stronger than merely "rotate coordinates": it explicitly tracks
the exact information that a reversible stretch must preserve.
