# RRLS v0.23 — Stretch → Fixate → Twist → Snap Back

## Status

**P = NP is not proved.**

v0.23 directly tests the proposed geometric pipeline:

    tangled relation
        ↓ stretch / cut loops
    tree-local system + closure-defect vector d
        ↓ choose anchor
    re-anchored defect coordinates
        ↓ reversible twist Φ
    localized defect language
        ↓ solve / test closure
    inverse twist + identify copies
        ↓
    snap back

Every transformation used in the experiments is exact and invertible.

---

## 1. Exact twisted closure condition

v0.22 defined the stretched defect language

    D_F = {d : the stretched tree has a satisfying assignment with defect d}.

Original satisfiability is

    0 ∈ D_F.

For an invertible twist z=Φ(d), define

    D'_F(z)=D_F(Φ^(-1)(z)).

Then the closure target becomes

    z_0 = Φ(0),

and exactly

    F SAT  iff  z_0 ∈ D'_F.

So twisting cannot create or destroy solutions. It can only redistribute the
description/interaction complexity of the retained loop-memory.

---

## 2. "Distance only" has an exact cardinality obstruction

If the twisted relation depended only on Hamming radius

    r(z)=|z|,

then every Hamming shell would be either entirely feasible or entirely infeasible.
Therefore

    |D_F| = Σ_(r∈R) C(k,r)

for some set of radii R.

This gives a coordinate-independent obstruction because every reversible twist preserves
|D_F|.

Measured:

| family   |   n |   factors |   defects |   feasible_states | perfect_radial_cardinality_possible   | radial_shell_set_if_possible   |
|:---------|----:|----------:|----------:|------------------:|:--------------------------------------|:-------------------------------|
| 1-in-3   |   8 |         8 |        10 |                86 | False                                 | nan                            |
| 1-in-3   |   8 |         9 |        11 |               168 | False                                 | nan                            |
| 1-in-3   |   8 |        10 |        13 |               272 | False                                 | nan                            |
| 1-in-3   |   8 |        11 |        15 |               336 | False                                 | nan                            |
| 1-in-3   |  10 |         9 |        10 |               174 | False                                 | nan                            |
| 1-in-3   |  10 |        10 |        11 |               283 | False                                 | nan                            |
| 1-in-3   |  10 |        11 |        13 |               396 | False                                 | nan                            |
| NAE-3    |   8 |         9 |        11 |              2036 | True                                  | (0, 1, 2, 3, 4, 5, 6, 7, 8, 9) |
| NAE-3    |   8 |        10 |        13 |              7988 | False                                 | nan                            |
| NAE-3    |   8 |        11 |        15 |             30437 | False                                 | nan                            |
| 3-XOR    |   8 |         9 |        11 |              1024 | True                                  | (0, 1, 2, 3, 4, 5)             |
| 3-XOR    |   8 |        10 |        13 |              2048 | False                                 | nan                            |

Every tested positive 1-in-3 defect language failed this necessary cardinality condition.

Therefore for those exact finite instances:

    no reversible twist whatsoever can make feasibility a function of distance alone.

The physical/computational model needs at least

    distance + phase/sector.

---

## 3. XOR: stretch then twist works exactly

The affine defect languages produced by XOR can be canonically twisted.

Given affine solution set

    D = a + span(b_1,...,b_r),

extend the span basis to a full GF(2) basis B and set

    z = B^(-1)(d XOR a).

Then exactly

    D' = {z : z_r=...=z_(k-1)=0}.

Measured:

| family   |   n |   factors |   defects |   feasible_states |   affine_dimension |   affine_codimension |   baseline_anf |   twisted_anf |   baseline_bdd |   twisted_bdd |   baseline_walsh |   twisted_walsh |   baseline_real_rank |   twisted_real_rank |   baseline_phase_bits |   twisted_phase_bits |   twisted_representation_cells | exact_coordinate_subcube   |
|:---------|----:|----------:|----------:|------------------:|-------------------:|---------------------:|---------------:|--------------:|---------------:|--------------:|-----------------:|----------------:|---------------------:|--------------------:|----------------------:|---------------------:|-------------------------------:|:---------------------------|
| 3-XOR    |   8 |         9 |        11 |              1024 |                 10 |                    1 |              8 |             2 |             13 |             1 |                1 |               1 |                    2 |                   1 |                     4 |                    1 |                             24 | True                       |
| 3-XOR    |   8 |        10 |        13 |              2048 |                 11 |                    2 |             68 |             4 |             39 |             2 |                4 |               4 |                    4 |                   1 |                   nan |                    2 |                             56 | True                       |
| 3-XOR    |  10 |        10 |        12 |              2048 |                 11 |                    1 |              4 |             2 |              5 |             1 |                1 |               1 |                    1 |                   1 |                     3 |                    1 |                             26 | True                       |

Headline examples:

- 11-defect XOR:
  ANF 8 -> 2,
  sampled BDD 13 -> 1,
  distance+phase bits 4 -> 1.

- 13-defect XOR:
  ANF 68 -> 4,
  sampled BDD 39 -> 2,
  baseline not representable with <=6 phase bits,
  after canonical twist exactly 2 phase bits.

This is a complete finite realization of:

    stretch -> twist -> localize tension.

---

## 4. Non-affine languages: tension moves but does not disappear

Exact reversible short-gate searches were run on positive 1-in-3 and NAE defect
languages.

| family   |   n |   factors |   defects |   feasible_states |   gates_found | gate_sequence                                                                                                                                                                                                                                          |   search_seconds |   baseline_anf |   twisted_anf |   anf_reduction_pct |   baseline_walsh |   twisted_walsh |   baseline_bdd |   twisted_bdd |   baseline_real_rank |   twisted_real_rank |   baseline_mixed_shells |   twisted_mixed_shells |   baseline_radial_error |   twisted_radial_error |   phase_bits_after_search_le4 |
|:---------|----:|----------:|----------:|------------------:|--------------:|:-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------:|---------------:|--------------:|--------------------:|-----------------:|----------------:|---------------:|--------------:|---------------------:|--------------------:|------------------------:|-----------------------:|------------------------:|-----------------------:|------------------------------:|
| 1-in-3   |   8 |         8 |        10 |                86 |             3 | (Gate(kind='CNOT', target=5, controls=(4,)), Gate(kind='TOFFOLI', target=2, controls=(4, 9)), Gate(kind='CNOT', target=9, controls=(8,)))                                                                                                              |         0.804906 |            414 |           230 |             44.4444 |              544 |             552 |             53 |            51 |                   11 |                   9 |                       8 |                      9 |              0.0830078  |             0.0830078  |                           nan |
| 1-in-3   |   8 |         9 |        11 |               168 |             4 | (Gate(kind='TOFFOLI', target=10, controls=(0, 4)), Gate(kind='NOT', target=2, controls=()), Gate(kind='CNOT', target=2, controls=(8,)), Gate(kind='CNOT', target=6, controls=(9,)))                                                                    |         1.07815  |            896 |           516 |             42.4107 |              312 |             312 |             44 |            41 |                    8 |                   8 |                       8 |                      8 |              0.081543   |             0.0820312  |                           nan |
| 1-in-3   |   8 |        10 |        13 |               272 |             2 | (Gate(kind='NOT', target=10, controls=()), Gate(kind='NOT', target=4, controls=()))                                                                                                                                                                    |         1.62259  |           3296 |          1540 |             53.2767 |             1168 |            1168 |            114 |           114 |                   30 |                  30 |                      12 |                     11 |              0.0330811  |             0.0332031  |                           nan |
| 1-in-3   |  10 |         9 |        10 |               174 |             5 | (Gate(kind='TOFFOLI', target=7, controls=(0, 1)), Gate(kind='TOFFOLI', target=4, controls=(0, 1)), Gate(kind='CNOT', target=1, controls=(0,)), Gate(kind='CNOT', target=6, controls=(5,)), Gate(kind='TOFFOLI', target=2, controls=(0, 4)))            |         0.821112 |            218 |           118 |             45.8716 |              544 |             552 |             49 |            60 |                   10 |                   9 |                       9 |                      8 |              0.168945   |             0.166992   |                           nan |
| 1-in-3   |  10 |        10 |        11 |               283 |             3 | (Gate(kind='TOFFOLI', target=2, controls=(5, 6)), Gate(kind='CNOT', target=2, controls=(1,)), Gate(kind='NOT', target=5, controls=()))                                                                                                                 |         1.05549  |            876 |           570 |             34.9315 |             2048 |            2048 |            106 |            96 |                   19 |                  19 |                       8 |                      9 |              0.137695   |             0.138184   |                           nan |
| NAE-3    |   8 |         9 |        11 |              2036 |             5 | (Gate(kind='TOFFOLI', target=10, controls=(3, 5)), Gate(kind='TOFFOLI', target=0, controls=(1, 9)), Gate(kind='TOFFOLI', target=1, controls=(2, 7)), Gate(kind='TOFFOLI', target=5, controls=(7, 9)), Gate(kind='TOFFOLI', target=8, controls=(1, 9))) |         1.04733  |             41 |             9 |             78.0488 |              512 |             512 |             22 |            16 |                    3 |                   2 |                       6 |                      4 |              0.00585938 |             0.00585938 |                           nan |
| NAE-3    |   8 |        10 |        13 |              7988 |             3 | (Gate(kind='CNOT', target=0, controls=(7,)), Gate(kind='CNOT', target=6, controls=(5,)), Gate(kind='TOFFOLI', target=10, controls=(4, 9)))                                                                                                             |         1.42248  |           1005 |           675 |             32.8358 |             3552 |            3558 |            153 |           174 |                   31 |                  27 |                       6 |                      7 |              0.0249023  |             0.0249023  |                           nan |

Typical ANF reductions were 35–78%.

However none of the tested positive 1-in-3 cases became exactly representable as

    g(distance, <=4 phase bits).

So the twist is genuinely simplifying the closure language, but the remaining phase is
still too rich.

---

## 5. Literal metric-preserving moves versus shears

The search was split into:

- Hamming-isometric re-anchoring (bit flips; coordinate permutations do not change ANF
  term count);
- affine shears (CNOT + flips);
- nonlinear reversible shears (Toffoli included).

Measured:

| family   |   defects |   baseline_anf |   isometric_flip_anf |   affine_shear_anf |   nonlinear_shear_anf |   isometric_reduction_pct |   affine_reduction_pct |   nonlinear_reduction_pct |   isometric_gates |   affine_gates |   nonlinear_gates |
|:---------|----------:|---------------:|---------------------:|-------------------:|----------------------:|--------------------------:|-----------------------:|--------------------------:|------------------:|---------------:|------------------:|
| 1-in-3   |        10 |            414 |                  312 |                160 |                   238 |                   24.6377 |                61.3527 |                   42.5121 |                 5 |              3 |                 2 |
| 1-in-3   |        11 |            896 |                  144 |                228 |                   440 |                   83.9286 |                74.5536 |                   50.8929 |                 5 |              4 |                 2 |
| 1-in-3   |        13 |           3296 |                  792 |               1016 |                  1688 |                   75.9709 |                69.1748 |                   48.7864 |                 5 |              5 |                 4 |
| 1-in-3   |        11 |            876 |                  374 |                352 |                   572 |                   57.3059 |                59.8174 |                   34.7032 |                 4 |              4 |                 4 |
| NAE-3    |        11 |             41 |                   25 |                  9 |                    15 |                   39.0244 |                78.0488 |                   63.4146 |                 2 |              4 |                 3 |
| NAE-3    |        13 |           1005 |                  861 |                633 |                   685 |                   14.3284 |                37.0149 |                   31.8408 |                 5 |              2 |                 1 |

Important result:

Metric-preserving re-anchoring alone can be dramatic.

For one 11-defect 1-in-3 relation:

    896 -> 144 ANF terms

under the sampled isometric search.

Affine CNOT shears often improve further on other cases.

Under the tested search budget, nonlinear Toffoli twisting did not beat the best affine
or isometric result on these selected instances.

So the first useful operation after stretch appears to be **choose the right anchor /
linear alignment**, not necessarily add nonlinear torsion immediately.

---

## 6. Exhaustive fixation-point search

For k<=11 defect spaces, every possible Hamming-isometric translation

    d -> d XOR a

was evaluated exactly.

| family   |   defects |   feasible_states |   anchors_tested |   baseline_anf |   best_anchor_anf |   exact_anchor_reduction_pct |   best_anchor_mask |   best_anchor_hamming_weight |   median_anchor_anf |   worst_anchor_anf |   phase_bits_after_best_anchor_le6 |   seconds |
|:---------|----------:|------------------:|-----------------:|---------------:|------------------:|-----------------------------:|-------------------:|-----------------------------:|--------------------:|-------------------:|-----------------------------------:|----------:|
| 1-in-3   |        10 |                86 |             1024 |            414 |               277 |                      33.0918 |                339 |                            5 |                 370 |                583 |                                nan |  0.068338 |
| 1-in-3   |        11 |               168 |             2048 |            896 |               105 |                      88.2812 |               1951 |                            9 |                 224 |                920 |                                nan |  0.194604 |
| 1-in-3   |        10 |               174 |             1024 |            218 |               134 |                      38.5321 |                925 |                            7 |                 202 |                392 |                                nan |  0.068614 |
| 1-in-3   |        11 |               283 |             2048 |            876 |               342 |                      60.9589 |               1714 |                            6 |                 620 |               1338 |                                nan |  0.193651 |
| NAE-3    |        11 |              2036 |             2048 |             41 |                25 |                      39.0244 |                  9 |                            2 |                  97 |                719 |                                nan |  0.203338 |

One positive 1-in-3 instance had:

    baseline ANF = 896
    best anchored ANF = 105

an exact 88.3% reduction.

The best anchor is not always a feasible state.

---

## 7. Replication of low-tension anchor geometry

Fresh positive 1-in-3 instances:

|   seed |   factors |   defects |   feasible_states |   baseline_anf |   best_anchor_anf |   reduction_pct | anchor_is_feasible   |   distance_to_nearest_feasible |   best_anchor_weight |
|-------:|----------:|----------:|------------------:|---------------:|------------------:|----------------:|:---------------------|-------------------------------:|---------------------:|
|      0 |         8 |         9 |                98 |            192 |               103 |         46.3542 | False                |                              2 |                    5 |
|      1 |         9 |        11 |               172 |            536 |               374 |         30.2239 | False                |                              2 |                    7 |
|      2 |         8 |        11 |               132 |           1494 |               184 |         87.6841 | False                |                              2 |                    7 |
|      3 |         9 |        11 |               291 |            868 |               128 |         85.2535 | False                |                              2 |                    8 |
|      4 |         8 |         9 |                80 |            162 |               101 |         37.6543 | False                |                              2 |                    5 |
|      6 |         8 |         9 |               112 |            214 |                50 |         76.6355 | False                |                              1 |                    6 |
|      7 |         9 |        11 |               247 |            640 |               208 |         67.5    | False                |                              1 |                    8 |
|      8 |         8 |        10 |                88 |            364 |               196 |         46.1538 | False                |                              2 |                    5 |
|      9 |         9 |        11 |               228 |           1050 |               140 |         86.6667 | False                |                              2 |                   10 |
|     10 |         8 |        10 |               102 |            284 |                98 |         65.493  | False                |                              3 |                    7 |
|     11 |         9 |        11 |               198 |            626 |               289 |         53.8339 | False                |                              2 |                    8 |
|     12 |         8 |         9 |                88 |            146 |                28 |         80.8219 | False                |                              2 |                    7 |
|     14 |         8 |         9 |                88 |            204 |                92 |         54.902  | False                |                              2 |                    5 |
|     15 |         9 |        11 |               220 |            896 |               164 |         81.6964 | False                |                              2 |                    6 |

Among the 14 nontrivial replicated cases:

- nearest-feasible distance 1: 2 cases
- nearest-feasible distance 2: 11 cases
- nearest-feasible distance 3: 1 case

Therefore "distance exactly 2" is not a law.

But the data suggests a useful research hypothesis:

> low-ANF anchors may lie close to the feasible defect fiber.

This must be tested on larger and independent families before assigning significance.

---

## 8. Boolean-Taylor interpretation of the fixation point

For a Boolean function f, re-anchor at a:

    f_a(x)=f(x XOR a).

The ANF coefficients of f_a are the Boolean finite-derivative/Taylor coefficients seen
from anchor a.

Thus a low-tension anchor is literally a point from which the tower of active Boolean
derivatives is sparse.

This gives a mathematical form to the proposed visual intuition:

    fixate somewhere
    -> stretch
    -> observe how coordinates align relative to that anchor.

The unresolved algorithmic question is how to find a good anchor without checking 2^k
possible anchors.

---

## 9. Why "multiply retained distance by the found function" needs refinement

For a general exact reversible map

    z = Φ(d),

snap-back is

    d = Φ^(-1)(z),

followed by identification of the stretched copies.

A scalar distance is sufficient only when D'_F is radial.

For the tested 1-in-3 cores this is mathematically impossible from cardinality alone.

The general retained state must therefore include:

    radius + phase

or, equivalently, enough coordinates to evaluate the exact inverse transport.

---

## 10. New target: Canonical Anchor + Holonomy Twist

The strongest next algorithm suggested by v0.23 is:

1. stretch the factor graph to a tree;
2. construct closure-defect coordinates;
3. compute a polynomial-time canonical anchor a(F);
4. re-anchor d -> d XOR a(F);
5. compute a polynomial-time canonical twist Φ_F;
6. compile D'_F into a tractable distance/phase algebra;
7. test Φ_F(0) for membership;
8. invert Φ_F and snap back.

For XOR, steps 3–6 are solved by affine linear algebra.

For the tested 1-in-3 defect languages, no such complete compact phase algebra is known.

A universal polynomial implementation of these steps for every CNF would place SAT in P
and hence prove P=NP.

v0.23 does not provide that universal canonicalizer.
