+
+---
+
+## Resumen
+
+Clasificamos los operadores bajo los cuales el perfil del **color
+refinement** (1-WL) de un grafo es invariante, dentro de una familia
+paramétrica de **universos de observación** `(f, ι)` — `f` comprime los
+conteos de vecinos e `ι` es una involución. El motor **propuso y
+verificó** que la partición del color refinement es complemento-
+invariante (llamado **T4**; mecanismo de conjeturas construido por el
+humano), lo verificó en **2 131 019 grafos exhaustivos** (n≤7, 100.0000%)
+más 19 407 adversariales, y se
+produjo una **prueba escrita** (inyectividad de la resta de multiséts de
+vecindades). Parametrizando el universo, **los datos — no los autores —
+eligieron la ley del conteo** `T4 ⟺ f(1) ≠ f(2)` (34/34 y 102/102), y
+el sondeo posterior produjo una **caracterización**:
+
+$$
+T4(\iota, f)\ \text{vive} \iff \iota \in S_n \cdot K
+\quad\text{y}\quad
+\bigl(\iota\ \text{cambia el par} \implies f(1) \neq f(2)\bigr),
+\qquad
+K = \{\mathrm{id},\ \mathrm{comp\_dir},\ \mathrm{transp},\ \mathrm{comp\_transp}\} \cong \mathbb{Z}_2 \times \mathbb{Z}_2 .
+$$
+
+La **dirección directa está probada** (mecanismo de conteos); la
+**recíproca está verificada** exhaustiva en n=4 (96 supervivientes
+exactas, cero fuera), dirigida en n=5 (6 424 testigos) y en datos reales
+(moléculas 100/100, CST 94/94). Cambiando el **tipo** del invariante —
+partición → órbita → distribución → observador — T4 muere en un universo
+Z₃ determinista, muere con azar en el proceso, sobrevive con azar en el
+objeto, y es **heredado por toda la jerarquía k-FWL** (≡ (k+1)-WL; 51/51). Todo es
+reproducible con un comando, cada verificación con un `assert` del
+número exacto. Los límites están declarados; cinco bugs propios fueron
+cazados por controles y quedan documentados, no borrados.
+
+---
+
+## Contribuciones
+
+1. **T4, propuesto y verificado por el motor**: `CR_k(G) = CR_k(Ḡ)` como
+ particiones (no solo multiséts de tamaños iguales) — con prueba
+ escrita.
+2. **La ley del conteo** `f(1) ≠ f(2)`, **elegida por los datos** tras
+ refutar dos hipótesis humanas.
+3. **La caracterización** `Sₙ·K` con (⇐) probada y (⇒) verificada; la
+ pieza faltante — la **uniformidad** — identificada por falsación.
+4. **El cambio de tipo**: T4 a través de universos deterministas,
+ dinámicos, probabilísticos y de observadores.
+5. **Método**: congelar antes de interpretar, controles negativos, y
+ cinco bugs propios cazados y registrados.
+
+---
+
+## 1. El teorema (T4)
+
+Sea `G = (V, E)` un grafo finito simple, `Ḡ` su complemento, y `CR_k(G)`
+la partición de `V` inducida por la ronda `k` del color refinement con
+colores iniciales `f(tipo, grado)`.
+
+> **Teorema (EXP-086).** Para todo `G` y todo `k ≥ 0`:
+> $$CR_k(G) = CR_k(\bar G)$$
+> como particiones del **mismo** conjunto de vértices `V` (los nombres
+> de los colores difieren; las clases son idénticas).
+>
+> **Corolario (T4).** Los multiséts de tamaños de las clases estables de
+> `CR(G)` y `CR(Ḡ)` coinciden, y coinciden en cada ronda.
+
+
+
+
+
+
+
+ Datos reales: Q₃ y su complemento, vértices coloreados por clase WL — la partición es idéntica (T4).
+
+
+
+ Datos reales: el refinamiento WL ronda a ronda (k=0…3) — G y su complemento mantienen las mismas clases en cada nivel.
+
+
+**Prueba (esquema).** *Base.* En `Ḡ`, `deg_Ḡ(v) = n−1−deg_G(v)`; como
+`d ↦ n−1−d` es una biyección de grados, la relación "mismo color" es la
+misma en `G` y `Ḡ`. *Paso.* Supongamos `CR_k(G) = CR_k(Ḡ) =: P_k`. Para
+`v ∈ V`, la vecindad cerrada en `Ḡ` es `N_Ḡ[v] = V ∖ N_G(v)`, y su
+multiséts de colores de ronda `k` es
+
+$$M'_k(v) = T_k - \bigl(M_k(v) - [\mathrm{color}_k(v)]\bigr), \qquad T_k := \text{multiséts total de colores de } P_k .$$
+
+Como `T_k` es **fijo**, la aplicación `M_k(v) ↦ M'_k(v)` es
+**inyectiva**: `u, v` tienen el mismo multiséts de vecindad cerrada en
+`G` si y solo si lo tienen en `Ḡ`. Como `color_{k+1}(v)` es función
+determinística de `(color_k(v), M_k(v))`, la relación "mismo color" se
+preserva, y `CR_{k+1}(G) = CR_{k+1}(Ḡ)`. ∎
+
+*Estado*: prueba escrita (una página), verificada en 2 131 019 grafos
+exhaustivos (n≤7), 19 407 adversariales y 688/688 pares de
+compatibilidad; **revisión externa pendiente**.
+
+---
+
+## 2. La ley del conteo
+
+En el universo estándar con una involución que cambia el par conectado:
+
+$$
+T4\ \text{vive} \iff f(1) \neq f(2).
+$$
+
+**Mecanismo.** En el complemento, un vértice con **1** vecino de una
+clase pasa a `|c|−1` (que puede ser **2**): si `f` colapsa 1 y 2, la
+dualidad muere. Lo que `f` haga con 3, 4, 5… es irrelevante. Verificada
+**34/34** (17 funciones × 2 involuciones, n≤6) y blindada **102/102**
+(definición formal de dual global, 6 involuciones × 17 funciones).
+
+
+
+ Datos reales: los 34 universos (17 funciones × 2 involuciones) — T4 vive exactamente cuando f(1) ≠ f(2).
+
+
+---
+
+## 3. La caracterización
+
+
+
+
+
+**Dirección directa (probada).** Para `ι = σ∘s∘c`:
+
+| caso | mecanismo | condición |
+|---|---|---|
+| **σ** (relabel) | el WL es invariante por isomorfismo; la coloración se transporta biyectivamente | vale para **toda** `f` |
+| **s** (swap global in/out) | los conteos se intercambian: `(in_D,out_D) → (out_D,in_D)`; el perfil va por `(f(a),f(b)) → (f(b),f(a))` | vale para **toda** `f` |
+| **c** (complemento uniforme) | los conteos van `m → |D|−m` (o `|D|−1−m`), una biyección | vale **si y solo si** `f(1) ≠ f(2)` (contraejemplo en n=6) |
+
+La pieza no obvia es la **uniformidad**: preservar el par *no* alcanza si
+la acción no es uniforme (`flip_inc0` preserva el par y muere 0/24).
+Fuera de `Sₙ·K`, todo muere.
+
+**Recíproca (verificada).**
+
+| cámara | resultado |
+|---|---|
+| n=4, espacio inducido, exhaustivo (528 iotas × 4096 digrafos) | **96 supervivientes exactas** (= 24·4), **cero** fuera |
+| n=5, dirigida (8 160 iotas) | 7 680 con testigo válido; las 480 sin testigo son uniformes |
+| fuera del espacio (10 000 afines aleatorias) | **10 000/10 000** con testigo |
+| existencia de testigo (6 424 no uniformes) | **6 424/6 424** testigos válidos |
+| datos reales | moléculas **100/100** · CST **94/94** |
+
+
+
+ Datos reales: de las 528 iotas inducidas n=4, sobreviven exactamente las 96 uniformes (= 24·4).
+
+
+**Búsqueda autónoma.** Con un lenguaje de 11 primitivos + 3
+combinadores (~400 recetas) y criterio tasa/MDL, el motor halló que el
+mejor testigo **válido** es el `ciclo` (**99.63%**, complejidad 1) —
+mejor que la construcción humana (97.8%). Ninguna receta válida llega
+al 100%.
+
+---
+
+## 4. De conjetura a teorema candidato
+
+
+
+
+
+---
+
+## 5. El cambio de tipo
+
+
+
+
+
+
+
+
+
+| universo | invariante | T4 | evidencia |
+|---|---|---|---|
+| estándar | partición | ✅ vive (probado) | 2 131 019/2 131 019 |
+| Z₃ determinista | **órbita** (períodos) | ❌ muere | máx. 52.4% (`maj`); 6 reglas |
+| aleatorio R1 (WL asíncrono) | **distribución** | ❌ muere | 204/1096 = 18.6% |
+| aleatorio R2 (`G(n,p)` vs `G(n,1−p)`) | distribución | ✅ vive | exacto (el complemento biyecta los ensembles) |
+| aleatorio R3 (involuciones aleatorias) | **medida** | umbral = medida | 0/5000 uniforme vs 96/528 inducidas |
+| jerarquía k-FWL (≡ (k+1)-WL) | partición de k-tuplas | ✅ heredado | 51/51 en k=1,2,3 |
+| cascada del observador (n≤7) | — | — | 26 → 0 (k=1 → k=2) |
+| Rook vs Shrikhande | — | — | k=1 no, k=2 no, **k=3 sí** |
+
+---
+
+## 6. Método
+
+- **Congelar antes de interpretar**: cada experimento congela
+ `results_frozen.json` primero.
+- **Controles negativos**: el control que cazó la "prueba" falsa
+ (52/104 fallos en uniformes) y el Shrikhande mal construido
+ (`is_isomorphic = True`).
+- **Cinco bugs propios cazados y registrados** (no borrados):
+
+| # | bug | arreglo |
+|---|---|---|
+| 1 | multiséts de tamaños (débil: C6 y 2·C3 lo comparten) | colores |
+| 2 | comparar colores entre grafos | comparar particiones |
+| 3 | índices en la coloración inicial | grados + adyacencias |
+| 4 | multiséts separados (k-WL débil) | pares correlacionados (= k-FWL) |
+| 5 | Shrikhande mal construido (era el Rook dos veces) | `is_isomorphic` |
+
+**El método es parte del resultado.**
+
+---
+
+## 7. Reproducir
+
+```bash
+git clone https://github.com/cripto-bot/graphkind-universos-v2
+cd graphkind-universos-v2
+python3 -m venv .venv && .venv/bin/pip install -r requirements.txt
+bash reproduce.sh # V1–V12 (~10-15 min)
+bash reproduce.sh --rapido # V1, V3, V5, V8, V10, V11 (~3 min)
+```
+
+Cada verificación de este repo lleva un **assert** con el número exacto:
+si algo no coincide, falla. El CI corre el subconjunto rápido en cada
+push y la suite completa a demanda.
+
+**Alcance (citado vs ejecutado)**: V1–V16 se ejecutan aquí. Los números
+del laboratorio que exceden este repo —**2 131 019** exhaustivos n≤7,
+**19 407** adversariales, **688/688** de compatibilidad— se **citan** con
+su artefacto congelado en `resultados/` (EXP-084/086); no se recomputan
+en este repo.
+
+| # | verificación | assert |
+|---|---|---|
+| V1 | la ley `f(1)≠f(2)` (17 f × 2 involuciones, n≤6) | 34/34 |
+| V2 | caracterización n=4 exhaustivo | 96 y 48 |
+| V3 | T4_k complemento-invarianza (k-FWL) | 51/51 |
+| V4 | cascada del observador n≤7 | 26 → 0 |
+| V5 | Rook vs Shrikhande (k-FWL; el 3-WL estándar NO) | k*=3 |
+| V6 | Z₃ determinista | no vive |
+| V7 | aleatorio R1 | 204/1096 |
+| V8 | R3 dependencia de la medida | 96/528 |
+| V9 | búsqueda autónoma | ciclo 99.63% |
+| V10 | certificado de hash (12-hex == 64-hex) | sin colisiones |
+| V11 | certificado de convergencia (estable == n+2) | OK |
+| V12 | clasificación constante por grafo (n=4) | OK |
+
+
+---
+
+## 7b. Correcciones (2026-09-13)
+
+Una verificación independiente (EXP-159 del laboratorio) encontró un
+**error de nombre** y se agregaron dos certificados:
+
+1. **k-FWL, not "k-WL"** (D-005). El kernel implementado en `codigo/wl.py`
+ es el **correlacionado** (*folklore*, k-FWL), equivalente a
+ **(k+1)-WL**. El nombre "k-WL" a secas es la variante estándar
+ (multiséts separados por posición), estrictamente más débil: **el
+ 3-WL estándar NO separa Rook de Shrikhande**; el 3-FWL (≡ 4-WL) sí.
+ El código, los docstrings y las salidas ahora dicen
+ `k-FWL (≡ (k+1)-WL)`. V3/V5 no cambian numéricamente.
+2. **V10 — certificado de hash**: el hash de 12 hex no altera ninguna
+ partición (partición 12-hex == partición 64-hex en 74 grafos × 17 f).
+3. **V11 — certificado de convergencia**: el refinamiento llega a su
+ partición estable dentro del tope n+2 (estable == n+2 rondas fijas en
+ 1098 grafos × 17 f); `wl_sym`/`wl_k_colors` ahora paran al estabilizar.
+4. **V12 — alcance de la clasificación**: `clasificar_involucion` clasifica
+ sobre **un grafo**; V12 verifica que la clase es constante sobre todos
+ los grafos n=4 para los (ι, f) probados. El enunciado universal sigue
+ siendo la dirección abierta del paper.
+
+Los resultados numéricos del paper **no cambian**; el nombre y los
+certificados son las correcciones.
+
+---
+
+## 7c. El arco de universos (v2, EXP-162 → 169)
+
+La v2 agrega el **arco de universos** (multicapa, matriz, hipergrafos,
+aridades, dual), con sus freezes en `resultados/` y **V13–V16** en
+`codigo/verificaciones_v2.py`:
+
+| # | verificación | assert |
+|---|---|---|
+| V13 | multicapa: total vive, **por-capa muere** en la canónica, canales viven | 4160/4160 · falla > 0 · 8320/8320 |
+| V14 | hipergrafos 3-uniformes: T4 vive | 6042/6042 (n≤5 + muestra n=6) |
+| V15 | dual por aridad: partición + ahorro | 1024/1024 · 5120→3392 aristas |
+| V16 | aridades mezcladas: por aridad **vive** (reparo) | 1024/1024 |
+| V17 | cociente por complemento (precio de T4) | 52 grafos · 24 pares (SG-01 n≤8: 6 168) |
+| V18 | IR: IR_1 no separa Rook/Shri, IR_2 sí | i\*=2 |
+| V19 | certificado SG-04: n=10 exhaustivo sin fallas | 12 005 168 · 0 colisiones |
+
+
+
+
+ La ley de coherencia multicapa (EXP-162/163): total vive, por-capa muere en la canónica.
+
+
+
+
+
+ La escalera k\*(L) es plana y corrige el k\*=2 de EXP-162.
+
+
+**Los resultados**: (1) **multicapa** — la ley de coherencia: total vive
+(1298/1298, 1404/1404), por-capa muere solo en la canónica (6.9%/7.4%);
+el grupo preservante es exactamente el uniforme; la escalera `k*` es
+plana (corrige el `k*=2` de EXP-162); (⇐) probada, (⇒) abierta.
+(2) **matriz** — la frontera se mueve con el observador, no con el
+tipado. (3) **hipergrafos** — predicción registrada y acertada
+(1831/1831). (4) **aridades** — la escalera vive; el transplante por
+aridad **falla** (la ley es de canales). (5) **dual por aridad** —
+asimilado: partición 100%, ahorro 14.37% vs 10.26%.
+
+
+
+
+ La frontera se mueve con el observador, no con el tipado.
+
+
+
+
+
+ Predicción acertada (1831/1831) y el transplante por aridad que falla.
+
+
+
+
+
+ Dual por aridad: ahorro 14.37% con partición garantizada.
+
+
+
+
+
+ La trayectoria del refinamiento: T4 y la divergencia multicapa.
+
+
+
+
+
+ La escalera de aridad y el transplante que falla.
+
+
+## 7d. El Santo Grial (SG-01→03)
+
+- **Completitud en la clase**: la familia mínima es **{WL, 2-WL, 3-WL}**
+ con **C_8 = 0** en **76 205 685 pares** (n≤8); leave-one-out: k-WL 3
+ hace el trabajo; la frontera n=16 (Rook/Shri) la separa solo la familia
+ total. Freeze: `resultados/SG-01_results_frozen.json`.
+
+
+
+ Las curvas de frontera por observador (SG-01/03, EXP-119).
+
+
+- **El precio de T4**: el invariante completo **no** es
+ complemento-invariante; el cociente `G~Ḡ` fusiona **6 168 pares**.
+- **Individualización**: **i\*=1** en n≤8 (13 597 grafos); **i\*=2** en
+ Rook/Shrikhande (IR_1 no, IR_2 sí). El retículo IR↔k-WL: en n≤9 los
+ completos colapsan (equivalencia vacua); anclas A/B, C no observado.
+ Freezes: `SG-02`, `SG-03`.
+
+
+
+ Completitud, el precio de T4 y i\*.
+
+
+- **La prueba multicapa** viaja en `paper/PRUEBA-MULTICAPA.md` ((⇐)
+ probada, (⇒) abierta) y los **patrones transversales** + el
+ `DECISION_LOG` (D-001→D-017) en `paper/DECISION_LOG.md`.
+
+## 7e. SG-04: la puerta (n=10 exhaustivo)
+
+- **0 colisiones** en **12 005 168** grafos n=10 exhaustivos (KW3/IR1p,
+ 11.1 h) → la primera incompletitud **no está en n=10**.
+- Dirigido: 9 combos regulares n=11–15 (tope 5 000) + 10 pares
+ Cayley/Paley/Q4 → **0 fallas**.
+- La primera falla conocida sigue en **n=16** (Rook/Shri): la separan
+ **descriptores elementales** (SNFL, AUT, CICLOS, LOCAL, HOM2) + KF3/
+ IR2p. Freeze: `resultados/SG-04_results_frozen.json` (certificado V19).
+- Corrección registrada: `geng -d 3` (separado) falla; es `-d3`.
+
+## 8. Estructura del repositorio
+
+```
+paper/PAPER.md el paper (abstract bilingüe, método, resultados, §12 arco v2)
+paper/TEOREMA-UNIVERSOS.md el ciclo completo EXP-099→119
+paper/PRUEBA-CARACTERIZACION.md la prueba (⇐) y el estado de (⇒)
+codigo/universos.py la ley en el motor (t4_garantizado, oráculo)
+codigo/wl.py WL simétrico + k-FWL correlacionada (≡ (k+1)-WL)
+codigo/verificaciones.py V1–V12 con asserts de los números exactos
+codigo/verificaciones_v2.py V13–V16 (arco de universos)
+codigo/multicapa.py refinamiento conjunto + tres dualidades (v2)
+codigo/hipergrafo.py k-uniforme + aridades mezcladas + dual (v2)
+codigo/individualizacion.py IR_k (peor/multiset) — SG-02/03 (v2)
+paper/PRUEBA-MULTICAPA.md (⇐) probada, (⇒) abierta (EXP-162)
+paper/DECISION_LOG.md decisiones D-001→D-017 del laboratorio
+resultados/*.json freezes originales (EXP-102..169 + SG-01..04)
+resultados/atlas/*.json los 15 universos del atlas (EXP-105)
+assets/*.svg figuras
+index.html · index.en.html páginas de presentación (ES/EN)
+```
+
+---
+
+## 9. Límites y problemas abiertos
+
+- **(⇒) para todo n: abierto.** Verificado en n≤4 exhaustivo, n=5
+ dirigido y datos reales; el argumento ∀n es el paso restante.
+- **Suficiencia de `f(1)≠f(2)` para `f` arbitraria**: verificada en los
+ catálogos; prueba general abierta.
+- **El espacio afín completo n≥5** es inabordable (involuciones de S₂₀);
+ el espacio probado es el inducido + afín aleatorio.
+- **T4**: prueba escrita, **revisión externa pendiente**; formalización
+ en Lean no disponible en el entorno.
+- **Universos**: definiciones propias, declaradas; el espacio es abierto.
+- **Datos**: ChEMBL (CC-BY 4.0), CodeSearchNet, UniProt, Pfam — citados;
+ muestras fijas por seed.
+
+---
+
+## 10. Referencias (selección)
+
+- Weisfeiler, Leman (1968). *A reduction of a graph to a canonical form…*
+- Morgan (1965); Rogers, Hahn (2010). *Extended-connectivity fingerprints.*
+- Dvořák (2010); Dell, Arvind, Larsson (2018). *Homomorphisms and 1-WL.*
+- Babai (2016). *Graph isomorphism in quasipolynomial time.*
+- Xu et al. (2019). *How powerful are graph neural networks?*
+- Morris et al. (2019). *Weisfeiler and Leman go neural.*
+- Zamfirescu (1980). *Non-traceable 3-connected planar cubic graphs.*
+- Lovász (1970). *Problem on vertex-transitive graphs.*
+
+---
+
+
+---
+
+## 11. El laboratorio detrás de este resultado
+
+Este paper es un hilo de un **laboratorio de 169 EXP + SG-01/02/03**
+(165 con `run.py`; **43 746** líneas; **~2,8 MB** de resultados
+congelados) en siete arcos. Cada número está anclado a un
+artefacto congelado, y un meta-experimento (**EXP-120**) verifica las
+afirmaciones clave: **26/26 hitos**.
+
+| arco | rango | qué construyó |
+|---|---|---|
+| Fundacional | 000–010 | colapso de taxonomía **0.5876**; moléculas 3.00×; paridad Morgan **1.0000 vs 0.9973**; granularidad k\*=21→24 |
+| Riemann | 011–019 | 2 001 052 ceros; JS **0.1350 vs 0.0161**; puente de Euler **0.16110 ⊃ 1/2π**; línea crítica **σ\*=0.50000**; negativos limpios |
+| Aritmética/Álgebra/Física | 020–046 | r\* emergente (**0.8934**); WL discreto = Morgan (**0.8877 vs 0.8864**); cálculo estructural sin reglas; NS-3D verificado |
+| Descubrimiento/Ontología | 047–079 | código real (129 cadenas / 119 anillos / 152 estrellas); **6/6 hipótesis de proteínas rechazadas por controles**; matemática emergente (λ=νn², ABC 6/6, cascada √5, límite Euler ~1.2); el tribunal |
+| **T4** | 080–098 | 68/68 → 19 407 → **2 131 019/2 131 019**; prueba escrita; `refine_dual` 10.3× / 40.5%; banco de conjeturas |
+| **Universos** | 099–120 | este paper: ley, caracterización, testigos, búsqueda autónoma, Z₃, aleatorio, k-FWL |
+| **Universos v2** | 162–169 | multicapa (ley uniforme, grupo, escalera k\*), matriz universo×observador, hipergrafos (predicción), aridades, dual por aridad |
+
+**Patrones transversales**: congelar antes de interpretar · controles
+negativos (una sola pasada del shuffle no es evidencia: varía 0.05–0.84)
+· cinco bugs propios cazados y **registrados, no borrados** · cuatro
+tipos de resultado: kinds → leyes → teoremas → universos.
+
+Mapa completo: [`paper/MAPA-DEL-LABORATORIO.md`](paper/MAPA-DEL-LABORATORIO.md).
+
+
+## 12. El motor: cómo funciona y su potencia medida
+
+
+
+ El pipeline del motor: dato → grafo → label₀ → round → STOP → kinds; el ejemplo muestra las rondas 3 → 5 → 5 → 5 hasta la partición estable.
+
+
+
+
+ La potencia medida: paridad con Morgan (AUC 0.9608 vs 0.9541), compresión 3.00× (moléculas) y 187.5× (código), refine_dual 10.3×, ahorro por normalización dual 40.5%, oráculo de universos 87/87, tests del motor 104/104, banco T4 2.13M.
+
---
-## The Law
-
-> Any sufficiently complex system that exhibits emergent structure converges to **N ∈ [4,12]** fundamental building blocks covering ≥95% of observed variation.
+## Abstract
+
+We classify the operators under which the **color refinement** (1-WL)
+profile of a graph is invariant, inside a parametric family of
+**observation universes** `(f, ι)` — `f` compresses neighborhood counts
+and `ι` is an involution. The engine **proposed and verified** that the
+color refinement partition is complement-invariant (call it **T4**; the
+conjecture mechanism was human-built), verified it on **2,131,019
+exhaustive graphs** (n≤7, 100.0000%) plus
+19,407 adversarial ones, and a **written proof** was produced
+(injectivity of the neighborhood-multiset subtraction). Parameterizing
+the universe, the data — not the authors — selected the **count law**
+`T4 ⟺ f(1) ≠ f(2)` (34/34 and 102/102), and further probing produced a
+**characterization**:
+
+$$
+T4(\iota, f)\ \text{holds} \iff \iota \in S_n \cdot K
+\quad\text{and}\quad
+\bigl(\iota\ \text{changes the pair} \implies f(1) \neq f(2)\bigr),
+\qquad
+K = \{\mathrm{id},\ \mathrm{comp\_dir},\ \mathrm{transp},\ \mathrm{comp\_transp}\} \cong \mathbb{Z}_2 \times \mathbb{Z}_2 .
+$$
+
+The **forward direction is proved** (count mechanism); the **converse is
+verified** exhaustively in n=4 (96 exact survivors, zero outside),
+targeted in n=5 (6,424 witnesses), and on real data (molecules 100/100,
+CST 94/94). Changing the **type** of the invariant — partition → orbit →
+distribution → observer — T4 dies in a deterministic Z₃ universe, dies
+under process randomness, survives under object randomness, and is
+**inherited by the whole k-FWL hierarchy** (≡ (k+1)-WL; 51/51). Every claim is
+reproducible with one command, each verification carrying an `assert`
+with the exact number. Limits are declared; five of our own bugs were
+caught by controls and are documented, not deleted.
---
-## ⚡ Key Results at a Glance
-
-| Experiment | Domain | N | Result |
-|---|---|---|---|
-| **Generative Compression** | Mathematics | 6 | Kolmogorov compression 14,815:1 (2,244× Shannon limit) |
-| **NATKERNEL** | Kernel | 6 | Linux 37M lines → 1K lines, boots in QEMU |
-| **BB84 QKD** | Quantum | 10 | Eve detected 100/100, zero false negatives |
-| **Lorenz Discovery** | Mathematics | 9 | 100% equation recovery from time-series data |
-| **Forgotten Science** | History | 9 | 9/10 discarded theories have hidden structure |
-| **Superconductor** | Physics | 4 | 146 candidates above 200K Tc, best at 287K |
-| **GALLOX-1** | Materials | 7 | Ga₂O₃ with 4050× Si FOM, $541/wafer |
-| **Adamantium** | Materials | 9 | Ultra-hard alloy: 1760 HV at $150/kg |
-| **Supercapacitor** | Energy | 6 | 134 Wh/kg, 16.8× graphene baseline |
-| **Wormhole Search** | Physics | 8 | 5 viable traversable solutions found |
-
----
+## Contributions
-## 📊 Complete Experiment Catalog
-
-| # | Experiment | Domain | N | Key Finding | Status |
-|---|---|---|---|---|---|
-| 1 | Generative Compression | Mathematics | 6 | 14,815:1 Kolmogorov vs Shannon 6.6:1 | ✅ |
-| 2 | Maxwell Longitudinal | Physics | 6 | Longitudinal branch structurally REQUIRED | ✅ |
-| 3 | Schrödinger Cat | Physics | 6 | Paradox resolved: cat never in superposition | 🧠 |
-| 4 | Faraday Clusters | Materials | 4 | HEA alloys: δ=12, Ω=99 | ⚠️ |
-| 5 | GALLOX-1 | Materials | 7 | Ga₂O₃ doped, 4050× Si FOM | ⚠️ |
-| 6 | Supercapacitor | Energy | 6 | 134 Wh/kg, 16.8× graphene | ⚠️ |
-| 7 | BB84 QKD | Quantum | 10 | Eve detected 100/100 | 🧠 |
-| 8 | NATKERNEL | Kernel | 6 | 37M→1K lines, QEMU boot | ✅ |
-| 9 | Lorenz Discovery | Mathematics | 9 | 100% equation recovery | ✅ |
-| 10 | Forgotten Science | History | 9 | 9/10 hidden gems found | 🧠 |
-| 11 | Bitcoin Dynamics | Finance | 6 | Chaos confirmed, 1,460:1 compression | ⚠️ |
-| 12 | Stochastic Grammar | Noise | 5 | Noise has hidden grammar | ✅ |
-| 13 | ODE Discoverer | Math/Physics | 8 | SINDy: ODEs from time series | ✅ |
-| 14 | Consciousness | Neuroscience | 4 | Wilson-Cowan E/I model | ⚠️ |
-| 15 | KV Cache Compressor | ML/AI | 4 | SVD 4× compression | ⚠️ |
-| 16 | Weight Compression | ML/AI | 4 | SVD 2-6× weight reduction | ⚠️ |
-| 17 | Quantum Materials | Physics | 4 | 287K Tc predicted | ⚠️ |
-| 18 | Wormhole Search | Physics | 8 | 5 viable TT solutions | 🧠 |
-| 19 | Auto Organization | Complex | 5 | Self-org emerges in noise | ✅ |
-| 20 | Coil Optimizer | Engineering | 6 | 98% efficiency toroid | ⚠️ |
-| 21 | Adamantium | Materials | 9 | 1760 HV at $150/kg | ⚠️ |
-| 22 | Ether Vehicle | Physics | 6 | N=10 predicted, extraction impossible | 🧠 |
-| 23 | Hidden Spark | Physics | 0 | Honest negative — no signal in noise | ✅ |
-| 24 | GraphLang Physics | Physics | 4 | Standard Model N=8, Forces N=4 | 🧠 |
-| 25 | GraphLang BioGraph | Biology | 7 | 14,938 peptides, 7 IR-bio kinds | ⚠️ |
-| 26 | Llama Optimizer | ML/AI | 4 | LLM structural optimization | ⚠️ |
-| 27 | COBOL Analyzer | Legacy | 12 | Upper bound of the law | ⚠️ |
-| 28 | SHOR² Post-Quantum | Quantum | 7 | 3-layer GPU: Sieve+Rho+MonteCarlo | ⚠️ |
-| 29 | RSA Structural Scanner | Cryptography | 4 | O(1) detection, 3 bytes | ⚠️ |
-| 30 | RSA Breaker | Cryptography | 6 | 6 attacks: Wiener, Fermat, GCD, RNG, small-e | ⚠️ |
+1. **T4, proposed and verified by the engine**: `CR_k(G) = CR_k(Ḡ)` as partitions
+ (not merely equal multisets of class sizes) — with a written proof.
+2. **The count law** `f(1) ≠ f(2)`, **selected by the data** after two
+ human hypotheses were refuted by the table.
+3. **The characterization** `Sₙ·K` with (⇐) proved and (⇒) verified;
+ the missing piece — **uniformity** — identified by falsification.
+4. **The type change**: T4 across deterministic, dynamic, probabilistic
+ and observer universes.
+5. **Method**: freeze-before-interpret, negative controls, and five own
+ bugs caught and recorded.
---
-## 🔬 Verification Status (August 2026)
+## 1. The theorem (T4)
-All 30 experiments were reviewed. 11 were executed with real output. Classification:
+Let `G = (V, E)` be a finite simple graph, `Ḡ` its complement, and
+`CR_k(G)` the partition of `V` induced by round `k` of color refinement
+with initial colors `f(type, degree)`.
-| Status | Count | Meaning |
-|---|---|---|
-| ✅ **Verified** | 8 | Executed. Produces correct, reproducible results. |
-| ⚠️ **Partial** | 15 | Not executed OR works partially. Needs validation. |
-| 🧠 **Theoretical** | 6 | Structural/philosophical analysis. Not experimentally testable. |
-| ❌ **Failed** | 1 | Consciousness — backtest produces NaN (numerical instability). |
+> **Theorem (EXP-086).** For every `G` and every `k ≥ 0`:
+> $$CR_k(G) = CR_k(\bar G)$$
+> as partitions of the **same** vertex set `V` (color names differ; the
+> classes are identical).
+>
+> **Corollary (T4).** The multisets of class sizes of the stable
+> partitions of `CR(G)` and `CR(Ḡ)` coincide, and they coincide at every
+> round.
-### ✅ Verified (executed, correct)
+
+
+
-| Experiment | Result |
-|---|---|
-| Generative Compression | Logistic map r=3.9000, error 0%. 14,815:1 confirmed. |
-| Maxwell Longitudinal | 9 operators, branches N=3→6. Correct structural analysis. |
-| NATKERNEL | QEMU boot confirmed. 6 modules, N=6. |
-| Lorenz Discovery (SINDy) | σ=10.00, ρ=27.97, β=2.67. 100% structure recovery. |
-| Stochastic Grammar | Uniform distribution correctly identified. N=5. |
-| Auto Organization | Converges α=70%→7% in 11 generations. Self-adapting. |
-| Hidden Spark | Honest negative. Noise=0/4 tests, Lorenz=3/4. |
-| ODE Discoverer | Lorenz equations from data. 100% coefficient accuracy. |
-| GraphKind Universes v2 | T4 + SG-01..04: 0 collisions up to n=10 (12,005,168 graphs). V1-V19 + CI. |
-
-### ⚠️ Partial (not executed or known issues)
-
-| Experiment | Issue |
-|---|---|
-| RSA Scanner | Works but false positives: flags normal 2048-bit RSA as SUSPICIOUS (entropy threshold too high). |
-| Bitcoin Dynamics | Only captures 1/3 variables. r=0.47 on price. Weak. |
-| Consciousness | BACKTEST FAILS (r=NaN). Equations discovered but don't reproduce data. |
-| Faraday/Adamantium/GALLOX | Formulas are correct but generated candidates not experimentally validated. |
-| Superconductor | 29 real SCs analyzed correctly. 146 candidates not validated in lab. |
-| SHOR² | GPU Monte Carlo works but is NOT quantum — it's parallel classical factorization. |
+
+
+ Real data: Q₃ and its complement, vertices colored by WL class — the partition is identical (T4).
+
+
+
+ Real data: the WL refinement round by round (k=0…3) — G and its complement keep the same classes at every level.
+
-### 🧠 Theoretical (structural analysis, not experimental)
+**Proof (sketch).** *Base.* In `Ḡ`, `deg_Ḡ(v) = n−1−deg_G(v)`; since
+`d ↦ n−1−d` is a bijection of degrees, the relation "same color" is the
+same in `G` and `Ḡ`. *Step.* Assume `CR_k(G) = CR_k(Ḡ) =: P_k`. For
+`v ∈ V`, the closed neighborhood in `Ḡ` is `N_Ḡ[v] = V ∖ N_G(v)`, and
+its round-`k` color multiset is
-Schrödinger, BB84, Forgotten Science, Wormholes, Ether Vehicle, GraphLang Physics.
-These are structural analyses applying N∈[4,12] to theoretical systems.
-They produce interesting insights but are NOT experimentally testable with current technology.
+$$M'_k(v) = T_k - \bigl(M_k(v) - [\mathrm{color}_k(v)]\bigr), \qquad T_k := \text{total color multiset of } P_k .$$
-### ❌ Failed
+Since `T_k` is **fixed**, the map `M_k(v) ↦ M'_k(v)` is **injective**:
+`u, v` have the same closed-neighborhood multiset in `G` iff they do in
+`Ḡ`. Because `color_{k+1}(v)` is a deterministic function of
+`(color_k(v), M_k(v))`, the relation "same color" is preserved, hence
+`CR_{k+1}(G) = CR_{k+1}(Ḡ)`. ∎
-Consciousness Grammar: Discovered 9 terms, N=4 ✅, but backtest produces NaN.
-Numerical overflow in sigmoid. The discovered equations are mathematically broken.
+*Status*: written proof (one page), verified on 2,131,019 exhaustive
+graphs (n≤7), 19,407 adversarial, and 688/688 compatibility pairs;
+**external review pending**. Full text:
+[`paper/PRUEBA-T4.md`](paper/PRUEBA-T4.md) · cycle:
+[`paper/TEOREMA-UNIVERSOS.md`](paper/TEOREMA-UNIVERSOS.md).
---
-## 🧪 FORMULAS — The Complete Mathematical Framework
-
-### FARADAY — High Entropy Alloys (N=4)
-
-Materials that traditional physics (Hume-Rothery rules) says **cannot exist** as stable single-phase solutions. High configurational entropy proves otherwise.
-
-```
-─ Pipeline: SKIP → UNWRAP → LEAF → STRUCTURAL ─
-
-SKIP: Noble gases + Actinides filtered out
-UNWRAP: Atomic mass passes through
-LEAF: Electronegativity, atomic radius, valence, group, period
-STRUCTURAL: Hume-Rothery parameters + HEA criteria
-
-─ Hume-Rothery Parameters ─
-
-δ = 100 × √[ Σ fᵢ × (1 − rᵢ/r̄)² ]
-
- δ = atomic size mismatch (%)
- rᵢ = atomic radius of element i (pm)
- r̄ = Σ fᵢ·rᵢ = average radius
- fᵢ = atomic fraction of element i
-
-ΔH_mix = Σ 4·fᵢ·(χᵢ − χ̄)²
-
- ΔH_mix = mixing enthalpy (eV)
- χᵢ = electronegativity of element i (Pauling)
- χ̄ = Σ fᵢ·χᵢ = average electronegativity
-
-VEC = Σ fᵢ × VECᵢ
-
- VEC = valence electron concentration
-
-─ Entropy Parameter ─
-
-ΔS_conf = −R × Σ fᵢ·ln(fᵢ)
-
- R = 8.314 J/(mol·K) (gas constant)
- ΔS_conf = configurational entropy
-
-Ω = T_m × ΔS_conf / |ΔH_mix|
-
- T_m = 2000 K (typical melting temperature)
- Ω > 1.1 → entropy dominates → SINGLE-PHASE solid solution
- Ω < 1.1 → enthalpy dominates → multiple phases
-
-─ HEA Classification ─
-
-HEA criteria: n ≥ 4 elements, 5% ≤ fᵢ ≤ 35%, δ ≤ 6.6, Ω ≥ 1.1
-
-VEC < 6.87 → BCC phase
-VEC ≥ 8 → FCC phase
-6.87 ≤ VEC < 8 → BCC + FCC (dual phase)
-ΔH_mix < −15 → Intermetallic compound
-δ > 9% → Metallic glass (amorphous)
-
-─ Key Insight ─
-
-Classical Hume-Rothery: "δ > 6.6% → multi-phase → brittle"
-High Entropy reality: "Ω > 1.1 → ΔS_conf beats ΔH_mix → STABLE single phase"
-
-Materials that physics textbooks say CANNOT exist...
-DO exist because entropy wins.
-```
-
-### ADAMANTIUM — Ultra-Hard Alloy Design (N=9)
-
-```
-HV = 80 + δ × 2000 + f_interstitial × 1500 + Carbide_bonus
-
- HV = Vickers hardness
- 80 = base hardness of pure iron (HV)
- δ = atomic size mismatch
- 2000 = solid solution strengthening coefficient (HV/δ)
- f_interstitial = C, N, B content fraction
- 1500 = interstitial strengthening coefficient (HV)
-
- MC carbides (TiC, NbC, VC) → +500 HV
- M₆C/M₂₃C₆ (Cr₂₃C₆, W₆C) → +800 HV
+## 2. The count law
-E = Σ mᵢ × fᵢ
+In the standard universe with an involution that changes the connected
+pair:
- E = Young's modulus (GPa), rule of mixtures
+$$
+T4\ \text{holds} \iff f(1) \neq f(2).
+$$
-Toughness = E × 0.3 / (1 + HV/2000)
+**Mechanism.** In the complement, a vertex with **1** neighbor in a class
+gets `|c|−1` (which may be **2**): if `f` collapses 1 and 2, the duality
+dies. What `f` does with 3, 4, 5… is irrelevant. Verified **34/34**
+(17 functions × 2 involutions, n≤6) and shielded **102/102** (formal
+definition of dual-global, 6 involutions × 17 functions).
-Score = HV×5 + T_m×0.02 + Toughness×10 − Density×5 − Cost_per_kg
-
-Best result: 1760 HV at $150/kg (vs Inconel 718: 400 HV at $80/kg)
-```
-
-### MAXWELL LONGITUDINAL — The Missing Waves (N=6)
-
-Maxwell's original 20 equations in 20 variables were reduced by Heaviside to 4 vector equations. GraphLang proves the discarded longitudinal branch is **structurally required**.
-
-```
-─ Maxwell Operators (9 total, 4 sources/fields/derivatives, N=6) ─
-
-SOURCES:
- ∇·E = ρ/ε₀ (Gauss electric law)
- μ₀J (Current density)
-
-CONSTRAINTS:
- ∇·B = 0 (Gauss magnetic — no monopoles)
-
-FIELDS:
- −∂B/∂t (Magnetic induction)
- μ₀ε₀∂E/∂t (Displacement current — Maxwell's addition)
-
-DERIVATIVES:
- ∇×E = −∂B/∂t (Faraday's law)
- ∇×B = μ₀J + μ₀ε₀∂E/∂t (Ampère-Maxwell law)
-
-DERIVED:
- ∇²E − (1/c²)∂²E/∂t² = 0 (Wave equation from curl-curl identity)
-
-─ Branch Analysis ─
-
-Transverse branch: div_E=0, curl_E, curl_B, wave → N=3 ⚠️
-Longitudinal branch: div_E≠0 (sources), rho, wave → N=3 ⚠️
-
-COMBINED: N=6 ∈ [4,12] ✅
-
-─ Verdict ─
-
-Individual branches are BELOW the threshold.
-Together they are structurally COMPLETE.
-Maxwell REQUIRES both branches.
-Heaviside's truncation was mathematically convenient but structurally invalid.
-
-Modern confirmation: plasma oscillations, Langmuir waves, space physics.
-```
-
-### GENERATIVE COMPRESSION — Kolmogorov vs Shannon (N=6)
-
-```
-Shannon limit:
- H(X) = −Σ p(x)·log₂(p(x))
-
- For 100-bin discretization: H ≤ log₂(100) = 6.64 bits
- Maximum compression: 6.6:1
-
-Kolmogorov complexity:
- K(x) = |smallest program that generates x|
-
- GraphLang discovers the RULE, not the data:
-
- Logistic map: x_{n+1} = r × x_n × (1 − x_n), r = 3.9
- Rule size: 21 bytes → generates infinite output
-
- Compression = 100,000 × 4 bytes / 21 bytes = 14,815:1
- 14,815:1 = 2,244× beyond Shannon's theoretical limit
-
- Lorenz system: dx/dt=σ(y−x), dy/dt=x(ρ−z)−y, dz/dt=xy−βz
- Rule size: 27 bytes → 2,400:1 (363× Shannon)
-
- K(x) << H(x) when the system has a discoverable generative rule.
-```
-
-### AUTO-ORGANIZATION — Order from High Entropy (N=5)
-
-```
-Structure metric:
- S(seq) = 0.6 × autocorr₁ + 0.4 × (1 − H/H_max)
-
- H = −Σ p(x)·log₂(p(x)) Shannon entropy
- H_max = log₂(100) Maximum possible entropy
- autocorr₁ = serial correlation at lag-1
-
-Adaptive control:
- error = S_target − S_current
- α_new = α − 0.02 × sign(error)
- α = noise fraction [0,1]
-
-Phase diagram (α = noise ratio):
- α < 10% → S > 0.6 SIGNAL ZONE (deterministic)
- α ∈ [10%,55%] TRANSITION ZONE (new patterns emerge)
- α > 55% → S < 0.3 NOISE ZONE (stochastic)
- Critical threshold: α = 55%
-
-Self-organization result:
- Starts at α = 70% (deep noise) → self-adjusts → converges in 11 generations
- 4/4 predictions correct, r = 0.998 with expected signal
-
- The boundary between noise and structure IS where new structure emerges.
-```
-
-### STOCHASTIC GRAMMAR — The Physics of Noise (N=5)
-
-```
-Discovered law for pure random data:
- P(x) = 1/100 for x ∈ [0, 99] (Uniform distribution)
- P(x_t | x_{t-1}) = P(x_t) (Memoryless — no Markov dependence)
-
-Moment analysis:
- E[x] = 49.5 (Uniform[0,99] expects 49.5)
- Var[x] = 816 (Uniform[0,99] expects 833)
- Skew = 0 (Uniform expects 0)
- Kurtosis = 1.8 (Uniform expects 1.8)
-
-Entropy:
- H = −Σ p(x)·log₂(p(x)) ≈ 6.6 bits (max for 100 bins)
-
-Chi-squared uniformity test:
- χ² = Σ (observed − expected)² / expected
-
- Noise IS a grammar — a statistical one.
- The "equation" of randomness: P(x) = constant.
-```
-
-### NOISE TRANSMUTATION — Noise as Control Parameter (N=5)
-
-```
-Experiment 1 — Noise injection:
- dx/dt = σ(y−x) + η·0.1
- dy/dt = x(ρ−z) − y + η·0.1 η = noise ~ Uniform[0,99]
- dz/dt = xy − βz + η·0.05
-
- Result: noise DESTROYS attractor (correlation 0.21)
+
+
+ Real data: the 34 universes (17 functions × 2 involutions) — T4 holds exactly when f(1) ≠ f(2).
+
-Experiment 2 — Noise as forcing (Rayleigh modulation):
- dx/dt = σ(y−x)
- dy/dt = x(ρ + force − z) − y force = (η − 50)/10
- dz/dt = xy − βz
+---
- Result: noise CREATES new basins, 38/38 windows show emergence
+## 3. The characterization
-Experiment 3 — Noise + oscillator:
- Noise combined with periodic signal → autocorr = 0.85
- Noise AMPLIFIES structure at the edge of chaos.
-```
+
+
+
-### QUANTUM MATERIALS — Superconductor Discovery (N=4)
+**Forward direction (proved).** For `ι = σ∘s∘c`:
-```
-─ BCS Theory ─
+| case | mechanism | condition |
+|---|---|---|
+| **σ** (relabel) | WL is isomorphism-invariant; the coloring transports bijectively | holds for **every** `f` |
+| **s** (global in/out swap) | counts swap: `(in_D,out_D) → (out_D,in_D)`; the profile maps by `(f(a),f(b)) → (f(b),f(a))` | holds for **every** `f` |
+| **c** (uniform complement) | counts map `m → |D|−m` (or `|D|−1−m`), a bijection | holds **iff** `f(1) ≠ f(2)` (counterexample at n=6 otherwise) |
- Tc ∝ Θ_D × exp(−1/N(0)·V)
+The non-obvious piece is **uniformity**: preserving the pair is *not*
+enough if the action is not uniform (`flip_inc0` preserves the pair and
+dies 0/24). Outside `Sₙ·K`, everything dies.
- Θ_D = Debye temperature
- N(0) = density of states at Fermi level
- V = electron-phonon coupling potential
+**Converse (verified).**
-─ Gap Ratio (BCS prediction: 2Δ/k_B·Tc = 3.53) ─
+| camera | result |
+|---|---|
+| n=4, induced space, exhaustive (528 iotas × 4096 digraphs) | **96 exact survivors** (= 24·4), **zero** outside |
+| n=5, targeted (8,160 iotas) | 7,680 with valid witness; the 480 without are uniform |
+| outside the space (10,000 random affine) | **10,000/10,000** with witness |
+| witness existence (6,424 non-uniform) | **6,424/6,424** valid witnesses |
+| real data | molecules **100/100** · CST **94/94** |
- Ratio = 2·Δ(meV)·1000 / (Tc(K) × 0.08617)
+
+
+ Real data: of the 528 induced iotas at n=4, exactly the 96 uniform ones survive (= 24·4).
+
- Ratio > 5 → strong coupling (cuprates: 8-10)
- 3.0 < Ratio < 4.5 → BCS-like
- Ratio < 3 → weak coupling
+**Autonomous search.** Given a language of 11 primitives + 3 combinators
+(~400 recipes) and a rate/MDL criterion, the engine found that the best
+**valid** witness is the `cycle` (**99.63%**, complexity 1) — better than
+the human construction (97.8%). No valid recipe reaches 100%.
-─ Ginzburg-Landau Parameter ─
+---
- κ = λ/ξ
+## 4. From conjecture to theorem candidate
- λ = penetration depth (nm)
- ξ = coherence length (nm)
- κ < 0.7 → Type I superconductor
- κ > 0.7 → Type II superconductor
+
+
+
-─ Pressure as Driver ─
+---
- Tc(P) = Tc(0) + α·P − β·P²
+## 5. The type change
- Hydrides: Tc > 200K at P > 150 GPa
- CSH₇: 287K at 267 GPa (15°C — ROOM TEMPERATURE)
-```
+
+
+
-### GALLOX-1 — Ga₂O₃ Power Semiconductor (N=7)
+
+
+
-```
-β-Ga₂O₃ base properties:
- Bandgap: 4.8 eV (Si = 1.1, SiC = 3.3, GaN = 3.4)
- Breakdown field: 8 MV/cm (Si = 0.3, GaN = 3.3)
- Baliga FOM: 3000 (Si = 1, SiC = 500, GaN = 800)
+| universe | invariant | T4 | evidence |
+|---|---|---|---|
+| standard | partition | ✅ holds (proved) | 2,131,019/2,131,019 |
+| deterministic Z₃ | **orbit** (periods) | ❌ dies | max 52.4% (`maj`); 6 rules |
+| random R1 (async WL) | **distribution** | ❌ dies | 204/1096 = 18.6% |
+| random R2 (`G(n,p)` vs `G(n,1−p)`) | distribution | ✅ holds | exactly (complement bijects ensembles) |
+| random R3 (random involutions) | **measure** | threshold = measure | 0/5000 uniform vs 96/528 induced |
+| k-FWL hierarchy (≡ (k+1)-WL) | partition of k-tuples | ✅ inherited | 51/51 in k=1,2,3 |
+| observer cascade (n≤7) | — | — | 26 → 0 (k=1 → k=2) |
+| Rook vs Shrikhande | — | — | k=1 no, k=2 no, **k=3 yes** |
-Thermal conductivity (main weakness):
- κ_doped = κ_base × Π (1 + (κᵢ − 1) × fᵢ/solᵢ)
+---
- κ_base = 0.20 W/cm·K (Si = 1.5, SiC = 4.9)
+## 6. Method
-Baliga Figure of Merit:
- BFOM = ε·μ·E_g³
+- **Freeze before interpreting**: every experiment freezes
+ `results_frozen.json` first.
+- **Negative controls**: the check that caught the false "proof" (52/104
+ uniform failures) and the wrongly built Shrikhande
+ (`is_isomorphic = True`).
+- **Five own bugs caught and recorded** (not deleted):
- Ga₂O₃: 3000 (theoretical), doped up to 4050× Si
+| # | bug | fix |
+|---|---|---|
+| 1 | multiset of sizes (weak: C6 and 2·C3 share it) | colors |
+| 2 | comparing colors across graphs | compare partitions |
+| 3 | indices in the initial coloring | degrees + adjacencies |
+| 4 | separated multisets (weak k-WL) | correlated pairs (= k-FWL) |
+| 5 | wrongly built Shrikhande (it was the Rook twice) | `is_isomorphic` |
-Doping optimization:
- Ta, Hf → best thermal boost (κ×2.0, κ×1.9)
- Si → best mobility (μ×1.3)
- Mg, Al → thermal + mobility balance
+**The method is part of the result.**
-Result: 4050× Si FOM, $541/wafer (vs GaN $1500, SiC $800, Si $50)
-```
+---
-### ODE DISCOVERER — SINDy (N=8)
+## 7. Reproduce
+```bash
+git clone https://github.com/cripto-bot/graphkind-universos-v2
+cd graphkind-universos-v2
+python3 -m venv .venv && .venv/bin/pip install -r requirements.txt
+bash reproduce.sh # V1–V12 (~10-15 min)
+bash reproduce.sh --rapido # V1, V3, V5, V8, V10, V11 (~3 min)
```
-Sparse Identification of Nonlinear Dynamics:
-
- Ẋ = Θ(X) · Ξ
-
- X = time-series data matrix
- Θ(X) = library of candidate functions (polynomials, sines, etc.)
- Ξ = sparse coefficient matrix (discovered via iterative thresholding)
-Lorenz recovery:
- dx/dt = σ(y−x) → σ = 10.0 (true: 10, error: 0%)
- dy/dt = x(ρ−z) − y → ρ = 28.0 (true: 28, error: 0%)
- dz/dt = xy − βz → β = 2.67 (true: 8/3, error: 0%)
+Every verification carries an **assert** with the exact number from the
+paper: if anything does not match, it fails. CI runs the fast subset on
+every push and the full suite on demand.
-Threshold: λ = 0.1 (iterative hard thresholding)
-Poly degree: 2-3 (captures quadratic nonlinearities)
-```
+| # | verification | assert |
+|---|---|---|
+| V1 | the law `f(1)≠f(2)` (17 f × 2 involutions, n≤6) | 34/34 |
+| V2 | characterization n=4 exhaustive | 96 and 48 |
+| V3 | T4_k complement-invariance (k-FWL) | 51/51 |
+| V4 | observer cascade n≤7 | 26 → 0 |
+| V5 | Rook vs Shrikhande (k-FWL; 3-WL std does NOT) | k*=3 |
+| V6 | deterministic Z₃ | does not hold |
+| V7 | random R1 | 204/1096 |
+| V8 | R3 measure dependence | 96/528 |
+| V9 | autonomous search | cycle 99.63% |
+| V10 | hash certificate (12-hex == 64-hex) | no collisions |
+| V11 | convergence certificate (stable == n+2) | OK |
+| V12 | classification constant across graphs (n=4) | OK |
-### CONSCIOUSNESS — Wilson-Cowan Model (N=4)
-```
-τ_E · dE/dt = −E + S(w_EE·E − w_IE·I + I_ext)
-τ_I · dI/dt = −I + S(w_EI·E − w_II·I)
+---
-S(x) = 1 / (1 + exp(−a(x − θ))) Sigmoid activation
+## 7b. Corrections (2026-09-13)
+
+Independent verification (EXP-159 of the lab) found a **naming error** and
+two certificates were added:
+
+1. **k-FWL, not "k-WL"** (D-005). The kernel implemented in `codigo/wl.py`
+ is the **correlated** one (*folklore*, k-FWL), equivalent to
+ **(k+1)-WL**. The plain name "k-WL" is the standard variant (position-
+ separated multisets), which is strictly weaker: **standard 3-WL does
+ NOT separate Rook from Shrikhande**; 3-FWL (≡ 4-WL) does. The code,
+ docstrings and prints now say `k-FWL (≡ (k+1)-WL)`. V3/V5 are unchanged
+ numerically.
+2. **V10 — hash certificate**: the 12-hex hash does not alter any
+ partition (12-hex partition == 64-hex partition over 74 graphs × 17 f).
+3. **V11 — convergence certificate**: the refinement reaches its stable
+ partition within the n+2 cap (stable == fixed n+2 rounds over 1098
+ graphs × 17 f); `wl_sym`/`wl_k_colors` now stop at convergence.
+4. **V12 — classification scope**: `clasificar_involucion` classifies on
+ **one graph**; V12 verifies that the class is constant across all
+ graphs n=4 for the tested (ι, f). The universal statement remains the
+ open direction of the paper.
+
+The numerical results of the paper are **unchanged**; the naming and the
+certificates are the corrections.
- E = excitatory population
- I = inhibitory population
- w_EE, w_IE, w_EI, w_II = connection weights
- a = gain, θ = threshold
+---
-N = 4 fundamental types: E, I, excitation, inhibition
-∈ [4,12] ✅
-```
+## 7c. The universe arc (v2, EXP-162 → 169)
-### BB84 QUANTUM KEY DISTRIBUTION (N=10)
+The v2 adds the **universe arc** (multilayer, matrix, hypergraphs,
+arities, dual), with its freezes in `resultados/` and **V13–V16** in
+`codigo/verificaciones_v2.py`:
-```
-─ Protocol Steps ─
-
-Alice: |ψ⟩ = H^{a_i} X^{b_i} |0⟩ Prepare qubit
-Bob: Measure in basis b'_i
-Compare: Over classical channel, keep matching bases
-Eve: Must measure → collapses state → introduces errors
+| # | verification | assert |
+|---|---|---|
+| V13 | multilayer: total holds, **per-layer dies** in the canonical variant, channels hold | 4160/4160 · failures > 0 · 8320/8320 |
+| V14 | 3-uniform hypergraphs: T4 holds | 6042/6042 (n≤5 + n=6 sample) |
+| V15 | per-arity dual: partition + saving | 1024/1024 · 5120→3392 edges |
+| V16 | mixed arities: per-arity **holds** (repair) | 1024/1024 |
+| V17 | complement quotient (T4's price) | 52 graphs · 24 pairs (SG-01 n≤8: 6,168) |
+| V18 | IR: IR_1 does not separate Rook/Shri, IR_2 does | i\*=2 |
+| V19 | SG-04 certificate: n=10 exhaustive, no failures | 12,005,168 · 0 collisions |
-─ Security Bound ─
- QBER > 11% → abort (eavesdropper detected)
- QBER = error rate / total bits compared
+
+
+ The multilayer coherence law (EXP-162/163): total holds, per-layer dies in the canonical variant.
+
-GraphLang structural N = 10:
- Alice, Bob, Eve, qubit, basis, bit, measure, compare, abort, key
-Result: Eve detected 100/100, zero false negatives.
-```
+
+
+ The k\*(L) ladder is flat and corrects EXP-162's k\*=2.
+
-### SHOR² — Post-Quantum GPU Factorization (N=7)
+**Results**: (1) **multilayer** — the coherence law: total holds
+(1298/1298, 1404/1404), per-layer dies only in the canonical variant
+(6.9%/7.4%); the preserving group is exactly the uniform one; the `k*`
+ladder is flat (corrects EXP-162's `k*=2`); (⇐) proved, (⇒) open.
+(2) **matrix** — the frontier moves with the observer, not with typing.
+(3) **hypergraphs** — prediction registered and correct (1831/1831).
+(4) **arities** — the ladder holds; the per-arity transplant **fails**
+(the law is of channels). (5) **per-arity dual** — assimilated: partition
+100%, saving 14.37% vs 10.26%.
-Three-layer architecture. Quantum algorithm template executed on classical GPU (Tesla P100). Not classical factorization — quantum logic mapped to parallel hardware.
-```
-─ CAPA 1: GPU SIEVE ─
+
+
+ The frontier moves with the observer, not with typing.
+
- 1M primos pre-generados (Criba de Eratóstenes)
- 262,144 hilos paralelos (Tesla P100)
- Cada hilo prueba un primo: if N % p == 0 → factor encontrado
- Batch size: 262K primos por iteración
- Límite: factores < 10⁶
- T_sieve = O(|primos| / 262K) batches en GPU
+
+
+ Prediction correct (1831/1831) and the arity transplant that fails.
+
-─ CAPA 2: GPU RHO ─
- Pollard's Rho × 262K semillas paralelas:
-
- f(x) = (x² + 1) mod N
-
- x_i ← f(x_i), y_i ← f(f(y_i)) (tortuga y liebre)
- d = gcd(|x_i − y_i|, N) (factor candidato)
-
- 262,144 hilos × 5000 pasos cada uno
- El primero que encuentra factor → gana (atomicAdd)
- Límite GPU: N < 2⁶⁴ (~10¹⁹)
- Para N > 2⁶⁴ → CPU multi-thread fallback
+
+
+ Per-arity dual: 14.37% saving with guaranteed partition.
+
-─ CAPA 3: GPU MONTE CARLO ─
- 50,000 candidatos aleatorios × GCD masivo:
-
- ∀ a ∈ [2, N−1]: gcd(a, N) > 1 → factor
-
- batch_gcd: Euclidiano paralelo (262K hilos)
- batch_modexp: a^x mod N masivo
- find_factors: Monte Carlo + GCD combinado
+
+
+ The refinement trajectory: T4 and the multilayer divergence.
+
-─ Template Cuántico → GPU Clásico ─
- |ψ⟩ = Σ c_i|i⟩ → Monte Carlo paralelo (N candidatos simultáneos)
- QFT|x⟩ → FFT en shared memory GPU
- Amplificación → Refinamiento iterativo (múltiples pasadas)
- Medición → atomicAdd reduce al mejor resultado
+
+
+ The arity ladder and the failing transplant.
+
- Mapeo completo: 4 pasos cuánticos → 4 kernels GPU
- N=7 ∈ [4,12] ✅
+## 7d. The Holy Grail (SG-01→03)
-─ ECM + Quadratic Sieve (auxiliar) ─
+- **Completeness in the class**: the minimal family is **{WL, 2-WL,
+ 3-WL}** with **C_8 = 0** over **76,205,685 pairs** (n≤8); leave-one-out:
+ k-WL 3 does the work; the n=16 frontier (Rook/Shri) is separated only by
+ the full family. Freeze: `resultados/SG-01_results_frozen.json`.
- Curva elíptica: y² = x³ + ax + b (mod N)
+
+
+ The frontier curves per observer (SG-01/03, EXP-119).
+
- P + Q sobre curva módulo N
- Cuando modinv falla → gcd(denominador, N) da factor
+- **The price of T4**: the complete invariant is **not**
+ complement-invariant; the quotient `G~Ḡ` merges **6,168 pairs**.
+- **Individualization**: **i\*=1** at n≤8 (13,597 graphs); **i\*=2** at
+ Rook/Shrikhande (IR_1 no, IR_2 yes). The IR↔k-WL lattice: at n≤9 the
+ complete ones collapse (vacuous equivalence); anchors A/B, C not
+ observed. Freezes: `SG-02`, `SG-03`.
- Pipeline: Pollard Rho → ECM → Quadratic Sieve
-```
+
+
+ Completeness, T4's price and i\*.
+
-### RSA STRUCTURAL SCANNER (N=4)
+- **The multilayer proof** ships in `paper/PRUEBA-MULTICAPA.md` ((⇐)
+ proved, (⇒) open) and the **transversal patterns** + `DECISION_LOG`
+ (D-001→D-017) in `paper/DECISION_LOG.md`.
-O(1) vulnerability detection. No factorization. 3 bytes.
+## 7e. SG-04: the door (n=10 exhaustive)
-```
-─ Algorithm ─
-
- Input: N_bytes (clave pública RSA)
-
- 1. first_byte = N_bytes[0]
- if first_byte == 0x00 AND N_bits > 256:
- → DER_LEADING_ZERO (possible encoding issue)
- → severity = SUSPICIOUS
-
- 2. last_byte = N_bytes[-1]
- if last_byte % 2 == 0:
- → N_IS_EVEN (N divisible by 2 → trivial factor)
- → severity = CRITICAL
-
- 3. entropy = unique_bytes / total_bytes
- if entropy < 0.5:
- → LOW_ENTROPY (RNG débil → primos predecibles)
- → severity = VULNERABLE
- elif entropy < 0.7:
- → MEDIUM_ENTROPY (investigar RNG)
- → severity = SUSPICIOUS
-
- 4. if N_bits < 256:
- → KEY_TOO_SHORT (factorizable en minutos)
- → severity = CRITICAL
-
- Complexity: O(1) — 3 bytes analyzed, no loops
- Output: severity (SECURE|SUSPICIOUS|VULNERABLE|CRITICAL) + score (0-100)
-
-─ Severity Classification ─
-
- CRITICAL (100): N par o < 256 bits → roto
- VULNERABLE (75): entropía < 0.5 → RNG predecible → atacable
- SUSPICIOUS (25): entropía < 0.7 o DER encoding → investigar
- SECURE (0): sin debilidades estructurales detectables
-
- N=4 ∈ [4,12] ✅
-```
+- **0 collisions** over **12,005,168** exhaustive n=10 graphs (KW3/IR1p,
+ 11.1 h) → the first incompleteness is **not at n=10**.
+- Directed: 9 regular combos n=11–15 (cap 5,000) + 10 Cayley/Paley/Q4
+ pairs → **0 failures**.
+- The first known failure remains at **n=16** (Rook/Shri): separated by
+ **elementary descriptors** (SNFL, AUT, CICLOS, LOCAL, HOM2) + KF3/IR2p.
+ Freeze: `resultados/SG-04_results_frozen.json` (certificate V19).
+- Registered correction: `geng -d 3` (separated) fails; it is `-d3`.
-### RSA BREAKER — 6 Structural Attacks (N=6)
+## 8. Repository structure
```
-─ Attack 1: Wiener (d pequeño) ─
-
- d < N^0.25 → recuperable por fracciones continuas
-
- e/N = [a₀, a₁, a₂, ...] (expansión en fracción continua)
- h_i/k_i = convergentes de e/N
-
- Para cada convergente (h, k):
- φ(N) = (e·k − 1) / h
- Resolver: p + q = N − φ(N) + 1
- Si p,q enteros → d = k recuperado
-
-─ Attack 2: Fermat (p,q cercanos) ─
-
- N = p·q, |p−q| pequeño
-
- x = ⌈√N⌉, x² − N = y² (cuadrado perfecto)
- p = x + y, q = x − y
-
-─ Attack 3: GCD Compartido ─
-
- gcd(N₁, N₂) > 1 → mismo primo en 2 claves
- Ambas claves rotas simultáneamente
-
-─ Attack 4: RNG Débil ─
-
- Entropía(N) < 0.7 → primos generados con RNG predecible
- Patrón LIP: merge_graphs de claves sospechosas → fingerprint del RNG
-
-─ Attack 5: e Pequeño ─
-
- m^e < N → m = ⌊c^(1/e)⌋ (raíz e-ésima entera)
- Funciona con e=3 si mensaje es corto
-
-─ Attack 6: Coppersmith Parcial ─
-
- Bits conocidos de p → reconstrucción vía lattice reduction
- p = p_known + x, f(x) ≡ 0 (mod p)
- Coppersmith encuentra x si |x| < N^(1/4)
-
- N=6 ∈ [4,12] ✅
+paper/PAPER.md the paper (bilingual abstract, method, results, §12 v2 arc)
+paper/TEOREMA-UNIVERSOS.md the full cycle EXP-099→119
+paper/PRUEBA-CARACTERIZACION.md the (⇐) proof and the status of (⇒)
+codigo/universos.py the law inside the engine (t4_garantizado, oracle)
+codigo/wl.py symmetric WL + correlated k-FWL (≡ (k+1)-WL)
+codigo/verificaciones.py V1–V12 with asserts of the exact numbers
+paper/PRUEBA-MULTICAPA.md (⇐) proved, (⇒) open (EXP-162)
+paper/DECISION_LOG.md laboratory decisions D-001→D-017
+resultados/*.json original freezes (EXP-102..169 + SG-01..04)
+resultados/atlas/*.json the atlas: 15 universes (EXP-105)
+assets/*.svg figures
+index.html · index.en.html presentation pages (ES/EN)
```
---
-## 🧩 GRAPHKIND — Universes v2 (data & code)
+## 9. Limits and open problems
-A separate line from the N∈[4,12] grammar: **GraphKind** studies when two graphs/systems are *the same kind*
-(invariants that separate and individualize), not how many blocks they have.
-Full artifact in [`graphkind/`](graphkind/) — paper, engine code, frozen results, figures.
-
-
-
-
-
-| Result | Number |
-|---|---|
-| **T4** | Individualization by kind fixes the preserving group: 1298/1298 (L=2), 1404/1404 (L=3) |
-| **SG-01** | F3={WL,2-WL,3-WL}: C₈=0 over 76,205,685 pairs (n≤8) |
-| **SG-02** | Generated composition = {KW3}; i*=1 (n≤8) |
-| **SG-03** | Exhaustive n=9: 274,668; WL=KW2; IR2p~3-FWL/4-WL |
-| **SG-04** | **0 collisions in 12,005,168 graphs at n=10** (KW3/IR1p) + directed layer 0 failures |
-| **EXP-162..169** | Multilayer, hypergraphs, arities, directed witness, arity dual |
-| **Verification** | V1-V19 with asserts + CI; tests 104/104 |
-
-**DOI**: [10.5281/zenodo.22747350](https://doi.org/10.5281/zenodo.22747350) (CC-BY-4.0) ·
-**Code**: https://github.com/cripto-bot/graphkind-universos-v2 ·
-**Reproduce**: `bash graphkind/reproduce.sh`
+- **(⇒) for all n: open.** Verified in n≤4 exhaustive, n=5 targeted,
+ and real data; the ∀n argument is the remaining step.
+- **Sufficiency of `f(1)≠f(2)` for arbitrary `f`**: verified in the
+ catalogs; general proof open.
+- **The full affine space n≥5** is intractable (involutions of S₂₀); the
+ tested space is the induced one plus random affine.
+- **T4**: written proof, **external review pending**; Lean formalization
+ not available in the environment.
+- **Universes**: our own definitions, declared; the space is open.
+- **Data**: ChEMBL (CC-BY 4.0), CodeSearchNet, UniProt, Pfam — cited;
+ fixed samples by seed.
---
-## 🌐 Domain Coverage
+## 10. References (selection)
-| Domain | Experiments | N Range | Status |
-|---|---|---|---|
-| Physics | 7 | 0–8 | ✅ |
-| Materials | 3 | 4–9 | ✅ |
-| ML/AI | 3 | 4 | ✅ |
-| Mathematics | 2 | 6–9 | ✅ |
-| Biology | 1 | 7 | ✅ |
-| Neuroscience | 1 | 4 | ✅ |
-| Quantum | 1 | 10 | ✅ |
-| Finance | 1 | 6 | ✅ |
-| Energy | 1 | 6 | ✅ |
-| Engineering | 1 | 6 | ✅ |
-| History | 1 | 9 | ✅ |
-| Noise | 1 | 5 | ✅ |
-| Complex Systems | 1 | 5 | ✅ |
-| Kernel | 1 | 6 | ✅ |
-| Legacy Code | 1 | 12 | ✅ |
-| Math/Physics | 1 | 8 | ✅ |
-| Quantum/Post-Quantum | 1 | 7 | ✅ |
-| Cryptography | 2 | 4–6 | ✅ |
-
-**18 domains. N ∈ [4,12] confirmed in 17. The 16th (Hidden Spark, N=0) is an honest negative — no structure found in pure random noise.**
+- Weisfeiler, Leman (1968). *A reduction of a graph to a canonical form…*
+- Morgan (1965); Rogers, Hahn (2010). *Extended-connectivity fingerprints.*
+- Dvořák (2010); Dell, Arvind, Larsson (2018). *Homomorphisms and 1-WL.*
+- Babai (2016). *Graph isomorphism in quasipolynomial time.*
+- Xu et al. (2019). *How powerful are graph neural networks?*
+- Morris et al. (2019). *Weisfeiler and Leman go neural.*
+- Zamfirescu (1980). *Non-traceable 3-connected planar cubic graphs.*
+- Lovász (1970). *Problem on vertex-transitive graphs.*
---
-## 📈 Stats
-
-```
-Total experiments: 30
-Domains covered: 18
-N range: [0, 12]
-N average: 6.1
-N ∈ [4,12] compliant: 29/30 (96.7%)
-Stars: ~58 downloads on HuggingFace
-Files: 70 (Python + JSON + docs)
-Storage: ~2.5 MB
-```
---
-## 🔬 How to Reproduce
-
-Each experiment is a self-contained Python script:
-
-```bash
-# Clone the dataset
-git clone https://huggingface.co/datasets/Jose-dev/graphlab-discoveries
-cd graphlab-discoveries
-
-# Run any experiment
-python3 generative_compression.py
-python3 maxwell_longitudinal.py
-python3 quantum_materials.py
-python3 faraday_graphlang.py
-```
-
-Results are stored in `experiments//results.json`.
-
-> **Note**: The experiments import from GraphLab's private engine. To reproduce results with your own engine, implement the `SKIP → UNWRAP → LEAF → STRUCTURAL` pipeline and normalize candidate units by frequency.
+## 11. The laboratory behind this result
----
-
-## 📂 Dataset Structure
+This paper is one thread of a **120-experiment laboratory**
+(EXP-000 → EXP-120; **26,384** lines of `run.py`; **321 KB** of frozen
+results) spanning six arcs. Every number here is anchored to a frozen
+artifact, and a meta-experiment (**EXP-120**) verifies the laboratory's
+key claims: **26/26 hits**.
-```
-graphlab-discoveries/
-├── data.csv # Full experiment catalog (30 rows, Parquet-ready)
-├── data.jsonl # Full experiment catalog (30 entries, JSONL)
-├── data.json # Full experiment catalog (30 entries, JSON array)
-├── LICENSE # MII Open License v1.0
-├── CITATION.cff # Citation metadata
-├── README.md # This file
-├── graphkind/ # GraphKind Universes v2 (paper, engine, freezes, figures)
-├── .py # 30 standalone experiment scripts
-└── experiments//results.json # Per-experiment results metadata
-```
+| arc | range | what it built |
+|---|---|---|
+| Foundational | 000–010 | taxonomy collapse **0.5876**; molecules 3.00×; parity with Morgan **1.0000 vs 0.9973**; granularity k\*=21→24 |
+| Riemann | 011–019 | 2,001,052 zeros; JS **0.1350 vs 0.0161**; Euler bridge **0.16110 ⊃ 1/2π**; critical line **σ\*=0.50000**; clean negatives |
+| Arithmetic/Algebra/Physics | 020–046 | r\* emerged (**0.8934**); discrete WL = Morgan (**0.8877 vs 0.8864**); structural calculus with no rules; NS-3D verified |
+| Discovery/Ontology | 047–079 | real code (129 chains / 119 rings / 152 stars); **6/6 protein hypotheses rejected by controls**; emergent math (λ=νn², ABC 6/6, cascade √5, Euler limit ~1.2); the tribunal |
+| **T4** | 080–098 | 68/68 → 19,407 → **2,131,019/2,131,019**; written proof; `refine_dual` 10.3× / 40.5%; conjecture bank |
+| **Universes** | 099–120 | this paper: law, characterization, witnesses, autonomous search, Z₃, random, k-FWL |
+| **Universes v2** | 162–169 | multilayer (uniform law, group, k\* ladder), universe×observer matrix, hypergraphs (prediction), arities, arity dual |
----
+**Transversal patterns**: freeze before interpreting · negative controls
+(single-pass shuffle is not evidence: it varies 0.05–0.84) · five of our
+own bugs caught and **recorded, not deleted** · four types of result:
+kinds → laws → theorems → universes.
-## 📝 Citation
-
-```bibtex
-@dataset{argana2026graphlab,
- author = {Josué Argaña Silguero},
- title = {GraphLab Discoveries: 27 Experiments Validating the Universal Grammar Law N∈[4,12]},
- year = {2026},
- publisher = {HuggingFace},
- doi = {10.57967/hf/xxxx},
- url = {https://huggingface.co/datasets/Jose-dev/graphlab-discoveries}
-}
-```
+Full map: [`paper/MAPA-DEL-LABORATORIO.md`](paper/MAPA-DEL-LABORATORIO.md).
----
-## 📜 License
+## 12. The engine: how it works and its measured power
-MII Open License v1.0 — Free for research and personal use. Commercial use above $100K revenue requires license. See [LICENSE](LICENSE).
+
+
+ The engine pipeline: data → graph → label₀ → round → STOP → kinds; the example shows rounds 3 → 5 → 5 → 5 up to the stable partition.
+
----
+
+
+ Measured power: parity with Morgan (AUC 0.9608 vs 0.9541), compression 3.00× (molecules) and 187.5× (code), refine_dual 10.3×, dual-normalization saving 40.5%, universe oracle 87/87, engine tests 104/104, T4 bank 2.13M.
+
-*"The universe speaks a grammar. N is its alphabet size." — Josué Argaña Silguero*
+
diff --git a/assets/aridades.png b/assets/aridades.png
new file mode 100644
index 0000000000000000000000000000000000000000..1df7a1282daa48deb8872302e06bb66b43520422
--- /dev/null
+++ b/assets/aridades.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:0a84612c503f1718d6895a4ae8b9cfafd01919bcff93d3c831b764eccea382d0
+size 136275
diff --git a/assets/aridades.svg b/assets/aridades.svg
new file mode 100644
index 0000000000000000000000000000000000000000..f1d6769ce67f6c22d3638136927187af5adffe86
--- /dev/null
+++ b/assets/aridades.svg
@@ -0,0 +1,2606 @@
+
+
+
diff --git a/assets/banner.png b/assets/banner.png
new file mode 100644
index 0000000000000000000000000000000000000000..81a365816e824ab4f86d7e01f4daae5cc9a276a2
--- /dev/null
+++ b/assets/banner.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:c19e4aa5de2625bb17cad708d6898992d527b7fccf92f5ee076e9117666af122
+size 84140
diff --git a/assets/banner.svg b/assets/banner.svg
new file mode 100644
index 0000000000000000000000000000000000000000..0e9e0acc130e437b6029cd99711eeac8c71000db
--- /dev/null
+++ b/assets/banner.svg
@@ -0,0 +1,8 @@
+
diff --git a/assets/caracterizacion.png b/assets/caracterizacion.png
new file mode 100644
index 0000000000000000000000000000000000000000..2a227d197088aaca862b6fea10d6e2df919e97b6
--- /dev/null
+++ b/assets/caracterizacion.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:4e210536b46f60395c704ec239e3f146f5cb476952149fabf9cda95bd73441c2
+size 61146
diff --git a/assets/caracterizacion.svg b/assets/caracterizacion.svg
new file mode 100644
index 0000000000000000000000000000000000000000..e8213b6b0ec921c3438be5debd3803335e9f2476
--- /dev/null
+++ b/assets/caracterizacion.svg
@@ -0,0 +1,1223 @@
+
+
+
diff --git a/assets/cascada.png b/assets/cascada.png
new file mode 100644
index 0000000000000000000000000000000000000000..5086428f49f37a2eca90217e2cfb50d2b40b0167
--- /dev/null
+++ b/assets/cascada.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:963b59c5128cc163d591d9709ba325c9a3e037f62412df20bd1a3ed311855863
+size 50166
diff --git a/assets/cascada.svg b/assets/cascada.svg
new file mode 100644
index 0000000000000000000000000000000000000000..362c83a295cdb4bbdcc9f09df533768a50e5d9e8
--- /dev/null
+++ b/assets/cascada.svg
@@ -0,0 +1,19 @@
+
diff --git a/assets/dual-aridad.png b/assets/dual-aridad.png
new file mode 100644
index 0000000000000000000000000000000000000000..f7a1bc2476466827041828569b280a5262d7736a
--- /dev/null
+++ b/assets/dual-aridad.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:629de60df382c063b89fba698f1414aca9f933cf87d68f371f2c8bf663df9de6
+size 76662
diff --git a/assets/dual-aridad.svg b/assets/dual-aridad.svg
new file mode 100644
index 0000000000000000000000000000000000000000..13f11a63b245faec044f2249356e13b991be09e1
--- /dev/null
+++ b/assets/dual-aridad.svg
@@ -0,0 +1,19 @@
+
diff --git a/assets/escalera-kstar.png b/assets/escalera-kstar.png
new file mode 100644
index 0000000000000000000000000000000000000000..7b3db2c8489ba78287c2b5db4aca5d0fe3d29009
--- /dev/null
+++ b/assets/escalera-kstar.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:c442ed2ed761f51789ba0570db8072f16617d4173cca1f105aaa0455d0a1ee2a
+size 67276
diff --git a/assets/escalera-kstar.svg b/assets/escalera-kstar.svg
new file mode 100644
index 0000000000000000000000000000000000000000..6e5407e9154cf5f650693feab15ffa639f486722
--- /dev/null
+++ b/assets/escalera-kstar.svg
@@ -0,0 +1,28 @@
+
diff --git a/assets/frontera-Cn.png b/assets/frontera-Cn.png
new file mode 100644
index 0000000000000000000000000000000000000000..58754eb7cae5185066377e3333e34fa3752fcc01
--- /dev/null
+++ b/assets/frontera-Cn.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:b516e966bcd735aece6dc3cf48f08ebf088ec1d24965b54f8c3aa2bc17b1d879
+size 135365
diff --git a/assets/frontera-Cn.svg b/assets/frontera-Cn.svg
new file mode 100644
index 0000000000000000000000000000000000000000..1d7160fe3c4cee466b8ddda71409a67f3a790d58
--- /dev/null
+++ b/assets/frontera-Cn.svg
@@ -0,0 +1,3044 @@
+
+
+
diff --git a/assets/g-vs-gbar.png b/assets/g-vs-gbar.png
new file mode 100644
index 0000000000000000000000000000000000000000..8218824072066b267b4fa917b2c0271cb837af38
--- /dev/null
+++ b/assets/g-vs-gbar.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:96a7c0b5f7be8164e0e7f1a1fafd44ccdf7a360a76be73f4d660abb5bf73a3d7
+size 22151
diff --git a/assets/g-vs-gbar.svg b/assets/g-vs-gbar.svg
new file mode 100644
index 0000000000000000000000000000000000000000..853844867836b64038b99a63a2a94d688c5737ab
--- /dev/null
+++ b/assets/g-vs-gbar.svg
@@ -0,0 +1,26 @@
+
diff --git a/assets/hipergrafos-aridades.png b/assets/hipergrafos-aridades.png
new file mode 100644
index 0000000000000000000000000000000000000000..8f9a3fc59f872496eb8f3bf9dafbc282f99c1994
--- /dev/null
+++ b/assets/hipergrafos-aridades.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:624f3d4b72f2fcf17dda546d36e797b6af025b5917f42ada8d1076868f53c5df
+size 138550
diff --git a/assets/hipergrafos-aridades.svg b/assets/hipergrafos-aridades.svg
new file mode 100644
index 0000000000000000000000000000000000000000..4e8f6d3d7a0a1062320ec87106015b287edd9925
--- /dev/null
+++ b/assets/hipergrafos-aridades.svg
@@ -0,0 +1,29 @@
+
diff --git a/assets/klein.png b/assets/klein.png
new file mode 100644
index 0000000000000000000000000000000000000000..d82a2d877e422db52680b00ce5014f206274905c
--- /dev/null
+++ b/assets/klein.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:f07d71d82031e6e7825bdffc98d174c8ee12007b0d21929454921d7f61ca9ef5
+size 39244
diff --git a/assets/klein.svg b/assets/klein.svg
new file mode 100644
index 0000000000000000000000000000000000000000..7853e149a6c78b911bad78ca27540d2321e51680
--- /dev/null
+++ b/assets/klein.svg
@@ -0,0 +1,23 @@
+
diff --git a/assets/matriz-universo-observador.png b/assets/matriz-universo-observador.png
new file mode 100644
index 0000000000000000000000000000000000000000..01a47c09d26d29ee88197fb3bfe7a2902cf0b503
--- /dev/null
+++ b/assets/matriz-universo-observador.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:57424add5245059b78180dcf0a82812d77f25c197d3648cc710a15ea8b84161c
+size 92406
diff --git a/assets/matriz-universo-observador.svg b/assets/matriz-universo-observador.svg
new file mode 100644
index 0000000000000000000000000000000000000000..a667038287c70fb81110d02b2fd7c28d0aa29f36
--- /dev/null
+++ b/assets/matriz-universo-observador.svg
@@ -0,0 +1,104 @@
+
diff --git a/assets/motor-como-funciona.png b/assets/motor-como-funciona.png
new file mode 100644
index 0000000000000000000000000000000000000000..c19f91fd5b3f03efeea1dbe1bfe7a70ae845f3ec
--- /dev/null
+++ b/assets/motor-como-funciona.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:1377d16ed08be70eb17630fdc0961969ce8c458f3fd19017dffdae655da8bd07
+size 201671
diff --git a/assets/motor-como-funciona.svg b/assets/motor-como-funciona.svg
new file mode 100644
index 0000000000000000000000000000000000000000..67eefcfc949f1cd51e4005df9d58ee0417a4cf69
--- /dev/null
+++ b/assets/motor-como-funciona.svg
@@ -0,0 +1,2429 @@
+
+
+
diff --git a/assets/motor-potencia.png b/assets/motor-potencia.png
new file mode 100644
index 0000000000000000000000000000000000000000..fd93f492f12e33d68db7c1e0cc305ee2ebe2ed33
--- /dev/null
+++ b/assets/motor-potencia.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:a434bc472f20b3759e39d0886862a96b0d37f76faa9108e200840b7c12507ae0
+size 170712
diff --git a/assets/motor-potencia.svg b/assets/motor-potencia.svg
new file mode 100644
index 0000000000000000000000000000000000000000..ef07f18a622879d0928e874edfe8e2ae69d9ced2
--- /dev/null
+++ b/assets/motor-potencia.svg
@@ -0,0 +1,2549 @@
+
+
+
diff --git a/assets/multicapa-ley.png b/assets/multicapa-ley.png
new file mode 100644
index 0000000000000000000000000000000000000000..692c8fe21a32d115a86d80aa83f7a96b73737e7f
--- /dev/null
+++ b/assets/multicapa-ley.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:a25ad8fdcdc7dcf807cbef2652b0bb87f60bb71d4c6e1b56e7cacd22f7aa7e59
+size 130798
diff --git a/assets/multicapa-ley.svg b/assets/multicapa-ley.svg
new file mode 100644
index 0000000000000000000000000000000000000000..a91d52e295b43da0498fb092847d86479745235c
--- /dev/null
+++ b/assets/multicapa-ley.svg
@@ -0,0 +1,29 @@
+
diff --git a/assets/pipeline.png b/assets/pipeline.png
new file mode 100644
index 0000000000000000000000000000000000000000..d605a2c4700f58c0c036bebcc44b28d5873cd018
--- /dev/null
+++ b/assets/pipeline.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:8186311852db8196b6b265223c024b1ab3c1afc365548094672f30d915dbab0a
+size 72621
diff --git a/assets/pipeline.svg b/assets/pipeline.svg
new file mode 100644
index 0000000000000000000000000000000000000000..f48f70e9bf3a95e5e45535713b6b11799bdf6bfd
--- /dev/null
+++ b/assets/pipeline.svg
@@ -0,0 +1,44 @@
+
diff --git a/assets/santo-grial.png b/assets/santo-grial.png
new file mode 100644
index 0000000000000000000000000000000000000000..2b0bbdef7f2ddbebfe0c34f4eed190215e8991c2
--- /dev/null
+++ b/assets/santo-grial.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:16e80c97dd58e5cd5c7e6a505424f09393aa6d7f9b913c6e2bb43295cc27f4d7
+size 149636
diff --git a/assets/santo-grial.svg b/assets/santo-grial.svg
new file mode 100644
index 0000000000000000000000000000000000000000..11bd057d46105dc2d5be75be4f196c71f6841ddb
--- /dev/null
+++ b/assets/santo-grial.svg
@@ -0,0 +1,28 @@
+
diff --git a/assets/t4-evolucion.png b/assets/t4-evolucion.png
new file mode 100644
index 0000000000000000000000000000000000000000..afb16a8c5b84f6e252792d87d11404d92b5aab6f
--- /dev/null
+++ b/assets/t4-evolucion.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:02f39077517727b419e8d6e8670fda965ad17a77fe25e53c822aef1e29b507c8
+size 397289
diff --git a/assets/t4-evolucion.svg b/assets/t4-evolucion.svg
new file mode 100644
index 0000000000000000000000000000000000000000..e3ab7d978956b048a6d6a2c232537e7c31536875
--- /dev/null
+++ b/assets/t4-evolucion.svg
@@ -0,0 +1,3525 @@
+
+
+
diff --git a/assets/t4-particion.png b/assets/t4-particion.png
new file mode 100644
index 0000000000000000000000000000000000000000..a230447081d6a5beaf2792665b37392c4cb51026
--- /dev/null
+++ b/assets/t4-particion.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:6af14c3e3dbae039f62ae3a7151bdc25e6a2308b0bfd465b0577754dc6440e6d
+size 134248
diff --git a/assets/t4-particion.svg b/assets/t4-particion.svg
new file mode 100644
index 0000000000000000000000000000000000000000..6d33205c07c9478fbae89b3039ad24bed16ef1d6
--- /dev/null
+++ b/assets/t4-particion.svg
@@ -0,0 +1,1035 @@
+
+
+
diff --git a/assets/trayectoria-refinamiento.png b/assets/trayectoria-refinamiento.png
new file mode 100644
index 0000000000000000000000000000000000000000..4e319c4e304172cf53fd0ec5dfd11f6dec163a2c
--- /dev/null
+++ b/assets/trayectoria-refinamiento.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:31b8d01d2268f0a28e9918f5709c8fd1c7fb292e85b2318367ab3e5570bae3de
+size 111626
diff --git a/assets/trayectoria-refinamiento.svg b/assets/trayectoria-refinamiento.svg
new file mode 100644
index 0000000000000000000000000000000000000000..46c19b363118eee8431260f052b40d1a20c9a193
--- /dev/null
+++ b/assets/trayectoria-refinamiento.svg
@@ -0,0 +1,2046 @@
+
+
+
diff --git a/assets/universos-mapa.png b/assets/universos-mapa.png
new file mode 100644
index 0000000000000000000000000000000000000000..fe9686f14ecffee1d45ff63ec875e62896656b37
--- /dev/null
+++ b/assets/universos-mapa.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:88b73d8d511c6401b45dbb633dbfe6aa998696f9492cd81ef701d0e5c1ec84e0
+size 178351
diff --git a/assets/universos-mapa.svg b/assets/universos-mapa.svg
new file mode 100644
index 0000000000000000000000000000000000000000..5ea5b7ec124a394a6626d7f83b7b68b3a2ea4a2b
--- /dev/null
+++ b/assets/universos-mapa.svg
@@ -0,0 +1,2073 @@
+
+
+
diff --git a/assets/universos.png b/assets/universos.png
new file mode 100644
index 0000000000000000000000000000000000000000..e205a69cfd277592d0cfa4a66024822f682a64d9
--- /dev/null
+++ b/assets/universos.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:5679db12774aaaceca023b85a60a56a84e4777942e2ab3b376773ec809b168ff
+size 84212
diff --git a/assets/universos.svg b/assets/universos.svg
new file mode 100644
index 0000000000000000000000000000000000000000..a3688f4d539e9d649104221432ac8d00f472566d
--- /dev/null
+++ b/assets/universos.svg
@@ -0,0 +1,43 @@
+
diff --git a/codigo/hipergrafo.py b/codigo/hipergrafo.py
new file mode 100644
index 0000000000000000000000000000000000000000..59b4e00c51a98d5f1eae94585905de4107871c73
--- /dev/null
+++ b/codigo/hipergrafo.py
@@ -0,0 +1,158 @@
+"""Hipergrafos (v2): k-uniforme, aridades mezcladas y dual — autocontenido.
+
+- `refinar_k_uniforme`, `complemento_k_uniforme`, `t4_k_uniforme`.
+- `refinar_mezclado` (canónica/ordenada), `complemento_total_mezclado`,
+ `complemento_aridad`, `t4_mezclado`.
+- `refine_dual_mezclado`: elige el lado ralo POR ARIDAD (EXP-168/169:
+ el refinamiento repara la incoherencia; partición garantizada en la
+ clase medida).
+"""
+
+import hashlib
+from collections import Counter
+from itertools import combinations
+
+
+def _h(s):
+ return hashlib.sha256(s.encode()).hexdigest()[:12]
+
+
+def _norm(n, aristas, k):
+ out = set()
+ for e in aristas:
+ e = tuple(sorted(e))
+ if len(e) != k or len(set(e)) != k:
+ raise ValueError(f"aristas de {k} distintos")
+ if any(not (0 <= v < n) for v in e):
+ raise ValueError("fuera de rango")
+ out.add(e)
+ return sorted(out)
+
+
+def _links(n, aristas, k):
+ link = {v: [] for v in range(n)}
+ for e in aristas:
+ for v in e:
+ link[v].append(tuple(x for x in e if x != v))
+ return link
+
+
+def _part(colors):
+ cl = {}
+ for v, c in colors.items():
+ cl.setdefault(c, set()).add(v)
+ return (frozenset(frozenset(s) for s in cl.values()),
+ tuple(sorted(colors.values())))
+
+
+def refinar_k_uniforme(n, aristas, k):
+ aristas = _norm(n, aristas, k)
+ link = _links(n, aristas, k)
+ colors = {v: _h(f"g|{len(link[v])}") for v in range(n)}
+ prev = None
+ for _ in range(n + 2):
+ nuevos = {}
+ for v in range(n):
+ msgs = sorted(tuple(sorted(colors[u] for u in S))
+ for S in link[v])
+ nuevos[v] = _h(f"{colors[v]}|" + ",".join("+".join(m)
+ for m in msgs))
+ colors = nuevos
+ p = tuple(sorted(Counter(colors.values()).values()))
+ if p == prev:
+ break
+ prev = p
+ return _part(colors)
+
+
+def complemento_k_uniforme(n, k, aristas):
+ todos = {tuple(sorted(t)) for t in combinations(range(n), k)}
+ return sorted(todos - {tuple(sorted(e)) for e in aristas})
+
+
+def t4_k_uniforme(n, k, aristas):
+ p1, _ = refinar_k_uniforme(n, aristas, k)
+ p2, _ = refinar_k_uniforme(n, complemento_k_uniforme(n, k, aristas), k)
+ return p1 == p2
+
+
+def _msg(colors, link_v):
+ return tuple(sorted(tuple(sorted(colors[u] for u in S))
+ for S in link_v))
+
+
+def refinar_mezclado(n, e2, e3, variante="canonica"):
+ if variante not in ("canonica", "ordenada"):
+ raise ValueError("variante ∈ {'canonica','ordenada'}")
+ e2 = _norm(n, e2, 2)
+ e3 = _norm(n, e3, 3)
+ l2 = _links(n, e2, 2)
+ l3 = _links(n, e3, 3)
+ if variante == "ordenada":
+ colors = {v: _h(f"g|{len(l2[v])}|{len(l3[v])}") for v in range(n)}
+ else:
+ colors = {v: _h(",".join(sorted([str(len(l2[v])),
+ str(len(l3[v]))])))
+ for v in range(n)}
+ prev = None
+ for _ in range(n + 2):
+ nuevos = {}
+ for v in range(n):
+ m2 = _msg(colors, l2[v])
+ m3 = _msg(colors, l3[v])
+ msg = f"{m2}|{m3}" if variante == "ordenada" else \
+ ",".join(str(x) for x in sorted([m2, m3]))
+ nuevos[v] = _h(f"{colors[v]}|{msg}")
+ colors = nuevos
+ p = tuple(sorted(Counter(colors.values()).values()))
+ if p == prev:
+ break
+ prev = p
+ return _part(colors)
+
+
+def complemento_total_mezclado(n, e2, e3):
+ return (complemento_k_uniforme(n, 2, e2),
+ complemento_k_uniforme(n, 3, e3))
+
+
+def complemento_aridad(n, e2, e3, aridad):
+ if aridad == 2:
+ return complemento_k_uniforme(n, 2, e2), e3
+ if aridad == 3:
+ return e2, complemento_k_uniforme(n, 3, e3)
+ raise ValueError("aridad ∈ {2,3}")
+
+
+def t4_mezclado(n, e2, e3, dualidad="total", variante="canonica"):
+ if dualidad == "total":
+ e2p, e3p = complemento_total_mezclado(n, e2, e3)
+ elif dualidad == "aridad2":
+ e2p, e3p = complemento_aridad(n, e2, e3, 2)
+ elif dualidad == "aridad3":
+ e2p, e3p = complemento_aridad(n, e2, e3, 3)
+ else:
+ raise ValueError("dualidad ∈ {total, aridad2, aridad3}")
+ p1, _ = refinar_mezclado(n, e2, e3, variante)
+ p2, _ = refinar_mezclado(n, e2p, e3p, variante)
+ return p1 == p2
+
+
+def _cuenta(e):
+ return len({tuple(sorted(x)) for x in e})
+
+
+def refine_dual_mezclado(n, e2, e3, variante="canonica"):
+ """Elige el lado ralo POR ARIDAD; devuelve (particion, lados)."""
+ c2 = complemento_k_uniforme(n, 2, e2)
+ c3 = complemento_k_uniforme(n, 3, e3)
+ if _cuenta(e2) <= _cuenta(c2):
+ e2e, l2 = e2, "e2"
+ else:
+ e2e, l2 = c2, "e2bar"
+ if _cuenta(e3) <= _cuenta(c3):
+ e3e, l3 = e3, "e3"
+ else:
+ e3e, l3 = c3, "e3bar"
+ p, _ = refinar_mezclado(n, e2e, e3e, variante)
+ return p, (l2, l3)
diff --git a/codigo/individualizacion.py b/codigo/individualizacion.py
new file mode 100644
index 0000000000000000000000000000000000000000..115e751c0f4da31fa854328506bd7b39f228f636
--- /dev/null
+++ b/codigo/individualizacion.py
@@ -0,0 +1,60 @@
+"""Individualización (v2): IR_k en dos modos — autocontenido.
+
+- `individualizar_refinar(n, E, S)`: marcador canónico `IND` (sin id de
+ vértice) + refinamiento a convergencia → firma (multiset de colores).
+- `IR_k(n, E, k, modo)`: invariante con cada k-subconjunto individualizado;
+ `"peor"` = soporte (sin multiplicidades, primario), `"multiset"` = con
+ multiplicidades.
+
+Hallazgo SG-02/SG-03: IR_1 NO separa Rook de Shrikhande (y falla donde
+falla 3-WL); IR_2 SÍ (se comporta como 3-FWL ≡ 4-WL).
+"""
+
+import hashlib
+from collections import Counter
+from itertools import combinations
+
+
+def _h(s):
+ return hashlib.sha256(s.encode()).hexdigest()[:12]
+
+
+def _adj(n, E):
+ d = {v: set() for v in range(n)}
+ for a, b in E:
+ d[a].add(b)
+ d[b].add(a)
+ return d
+
+
+def individualizar_refinar(n, E, S):
+ adj = _adj(n, E)
+ colors = {v: _h("IND" if v in S else f"g|{len(adj[v])}")
+ for v in range(n)}
+ prev = None
+ for _ in range(n + 2):
+ nuevos = {}
+ for v in range(n):
+ msg = ",".join(sorted(colors[u] for u in adj[v]))
+ nuevos[v] = _h(f"{colors[v]}|{msg}")
+ colors = nuevos
+ p = tuple(sorted(Counter(colors.values()).values()))
+ if p == prev:
+ break
+ prev = p
+ return tuple(sorted(colors.values()))
+
+
+def IR_k(n, E, k=1, modo="peor"):
+ if modo not in ("peor", "multiset"):
+ raise ValueError("modo ∈ {'peor','multiset'}")
+ if k == 1:
+ casos = [individualizar_refinar(n, E, {v}) for v in range(n)]
+ elif k == 2:
+ casos = [individualizar_refinar(n, E, set(p))
+ for p in combinations(range(n), 2)]
+ else:
+ raise ValueError("k ∈ {1,2}")
+ if modo == "peor":
+ return frozenset(casos)
+ return tuple(sorted(casos))
diff --git a/codigo/multicapa.py b/codigo/multicapa.py
new file mode 100644
index 0000000000000000000000000000000000000000..0e661e2a229846be9854a62684d3ca10723ddac2
--- /dev/null
+++ b/codigo/multicapa.py
@@ -0,0 +1,90 @@
+"""Multicapa (v2): refinamiento conjunto y tres dualidades — autocontenido.
+
+- `refinar_conjunto(n, capas, variante)`: 1-WL conjunto de (V, E_1..E_L)
+ en variantes "ordenada" (capas etiquetadas) y "canonica" (S_L-invariante).
+- `complemento_total`, `complemento_capa`, `complemento_canales`.
+- `t4`: perfil + partición fuerte.
+
+Ley (EXP-162/163): T4 vive con el complemento TOTAL (uniforme); con el
+complemento POR CAPA muere en la variante canónica (coherencia
+multicanal); las permutaciones de canales preservan (la partición es
+ciega al orden).
+"""
+
+import hashlib
+from collections import Counter
+from itertools import combinations
+
+
+def _h(s):
+ return hashlib.sha256(s.encode()).hexdigest()[:12]
+
+
+def _adj(n, E):
+ d = {v: set() for v in range(n)}
+ for a, b in E:
+ d[a].add(b)
+ d[b].add(a)
+ return d
+
+
+def refinar_conjunto(n, capas, variante="canonica"):
+ if variante not in ("ordenada", "canonica"):
+ raise ValueError("variante ∈ {'ordenada','canonica'}")
+ adj = [_adj(n, E) for E in capas]
+ L = len(capas)
+ if variante == "ordenada":
+ colors = {v: _h("|".join(str(len(adj[l][v]))
+ for l in range(L))) for v in range(n)}
+ else:
+ colors = {v: _h(",".join(sorted(str(len(adj[l][v]))
+ for l in range(L))))
+ for v in range(n)}
+ prev = None
+ for _ in range(n + 2):
+ nuevos = {}
+ for v in range(n):
+ if variante == "ordenada":
+ datos = "|".join(
+ ",".join(sorted(colors[u] for u in adj[l][v]))
+ for l in range(L))
+ else:
+ por = [tuple(sorted(colors[u] for u in adj[l][v]))
+ for l in range(L)]
+ datos = ";".join(",".join(x) for x in sorted(por))
+ nuevos[v] = _h(f"{colors[v]}|{datos}")
+ colors = nuevos
+ part = tuple(sorted(Counter(colors.values()).values()))
+ if part == prev:
+ break
+ prev = part
+ clases = {}
+ for v, c in colors.items():
+ clases.setdefault(c, set()).add(v)
+ particion = frozenset(frozenset(s) for s in clases.values())
+ firma = tuple(sorted(colors.values()))
+ return firma, colors, particion
+
+
+def complemento_total(n, capas):
+ todas = {tuple(sorted(p)) for p in combinations(range(n), 2)}
+ return [sorted(todas - {tuple(sorted(e)) for e in E}) for E in capas]
+
+
+def complemento_capa(n, capas, ell):
+ c = complemento_total(n, capas)
+ return [c[i] if i == ell else capas[i] for i in range(len(capas))]
+
+
+def complemento_canales(capas, pi):
+ if sorted(pi) != list(range(len(capas))):
+ raise ValueError("pi debe ser permutación")
+ return [capas[i] for i in pi]
+
+
+def t4(n, capas, capas_iota, variante="canonica"):
+ _, c1, p1 = refinar_conjunto(n, capas, variante)
+ _, c2, p2 = refinar_conjunto(n, capas_iota, variante)
+ perfil = lambda c: tuple(sorted(Counter(c.values()).values())) # noqa: E731
+ return {"perfil_igual": perfil(c1) == perfil(c2),
+ "particion_igual": p1 == p2}
diff --git a/codigo/universos.py b/codigo/universos.py
new file mode 100644
index 0000000000000000000000000000000000000000..4a0dc7324dad63946be67065d3584534607c81fa
--- /dev/null
+++ b/codigo/universos.py
@@ -0,0 +1,134 @@
+"""Universos de observación: la ley de T4 y su certificación.
+
+Resultado del ciclo EXP-099..107 (validado 102/102 en EXP-105 y
+re-validado en EXP-107):
+
+ LEY: T4(ι, f) VIVE ⟺ ι es TRIVIAL ∨ (ι es DUAL ∧ f(1) ≠ f(2))
+
+donde:
+ - f: N→N comprime los conteos de vecinos por color en el refinamiento;
+ - ι: una involución G→G (complemento, relabel, …);
+ - TRIVIAL: g = identidad (relabels: el conteo no cambia);
+ - DUAL: existen σ y g (inyectiva, g≠id) que transportan los conteos
+ de la vecindad (el complemento);
+ - LOCAL: no existe tal (σ, g) (cambios locales de aristas).
+
+PODER:
+ 1. PREDECIR sin enumerar: dado un universo (f, ι) nuevo, el oráculo
+ dice si T4 valdrá, sin correr millones de grafos.
+ 2. DISEÑAR representaciones seguras: la ley dice qué compresiones de
+ conteo preservan la dualidad (f(1)≠f(2)) y cuáles la rompen.
+ 3. CERTIFICAR: si un universo con (dual, f(1)≠f(2)) falla el test,
+ es un BUG del código, no matemática.
+ 4. HABILITAR el truco del lado ralo (refine_dual) solo donde T4 vive.
+"""
+
+
+def t4_garantizado(f1, f2, clase: str) -> bool:
+ """La ley pura: ¿el universo admite T4 según su clase y f(1), f(2)?
+
+ >>> t4_garantizado(1, 2, "dual") # f distingue 1 de 2
+ True
+ >>> t4_garantizado(1, 1, "dual") # colapsa 1 y 2
+ False
+ >>> t4_garantizado(1, 1, "trivial") # los relabels viven siempre
+ True
+ >>> t4_garantizado(0, 1, "local") # ninguna f la salva
+ False
+ """
+ if clase == "trivial":
+ return True
+ if clase == "dual":
+ return f1 != f2
+ return False # local
+
+
+def _clases(labels):
+ from collections import defaultdict
+ by = defaultdict(set)
+ for v, c in enumerate(labels):
+ by[c].add(v)
+ return by
+
+
+def clasificar_involucion(n: int, adj, iota, sigma=None, f=None) -> str:
+ """Clasifica ι sobre UN grafo: "trivial" | "dual" | "local".
+
+ adj: lista de bitmasks (vecindad de cada vértice).
+ iota: función (n, adj) -> adj' (la involución).
+ sigma: biyección V→V declarada (default: identidad).
+ f: la compresión de conteos usada para el refinamiento (default: id).
+
+ Aplica la definición formal: matching de clases inducido por σ,
+ conteos (m, m') por (clase, vértice), y g bien definida + inyectiva.
+ """
+ from collections import Counter, defaultdict
+ import hashlib
+
+ def h(s):
+ return hashlib.sha256(s.encode()).hexdigest()[:12]
+
+ if f is None:
+ f = lambda k: k # noqa: E731
+ if sigma is None:
+ sigma = lambda v: v # noqa: E731
+
+ def wl_labels(a):
+ colors = [h(f"g|{a[v].bit_count()}") for v in range(n)]
+ for _ in range(n + 2):
+ new = []
+ for v in range(n):
+ cnt = Counter()
+ m = a[v]
+ while m:
+ u = (m & -m).bit_length() - 1
+ m &= m - 1
+ cnt[colors[u]] += 1
+ new.append(h(f"{colors[v]}|"
+ f"{tuple(sorted((c, f(k)) for c, k in cnt.items()))}"))
+ colors = new
+ return colors
+
+ ig = iota(n, adj)
+ lg = wl_labels(adj)
+ li = wl_labels(ig)
+ by_g = _clases(lg)
+ match = {}
+ for c, vs in by_g.items():
+ imgs = {li[sigma(v)] for v in vs}
+ if len(imgs) != 1:
+ return "local"
+ match[c] = imgs.pop()
+
+ vistos_def = {}
+ vistos_iny = {}
+ g_id = True
+ for c, vs in by_g.items():
+ ci_label = match[c]
+ ci = {u for u, cc in enumerate(li) if cc == ci_label}
+ for v in range(n):
+ sv = sigma(v)
+ m = sum(1 for u in vs if (adj[sv] >> u) & 1)
+ mp = sum(1 for u in ci if (ig[v] >> u) & 1)
+ venc = 1 if sv in vs else 0
+ key = (len(vs), venc, m)
+ key2 = (len(vs), venc, mp)
+ if key in vistos_def and vistos_def[key] != mp:
+ return "local"
+ vistos_def[key] = mp
+ if key2 in vistos_iny and vistos_iny[key2] != m:
+ return "local"
+ vistos_iny[key2] = m
+ if mp != m:
+ g_id = False
+ return "trivial" if g_id else "dual"
+
+
+def oraculo(n: int, adj, iota, f, f1, f2, sigma=None) -> dict:
+ """Predice T4 para un universo (f, ι) SIN enumerar grafos.
+
+ Devuelve {"clase", "f1", "f2", "t4_predicho"}.
+ """
+ clase = clasificar_involucion(n, adj, iota, sigma=sigma, f=f)
+ return {"clase": clase, "f1": f1, "f2": f2,
+ "t4_predicho": t4_garantizado(f1, f2, clase)}
diff --git a/codigo/verificaciones.py b/codigo/verificaciones.py
new file mode 100644
index 0000000000000000000000000000000000000000..722a38b56fcf70373cfe597db58d10c94be3d126
--- /dev/null
+++ b/codigo/verificaciones.py
@@ -0,0 +1,535 @@
+#!/usr/bin/env python3
+"""Verificaciones reproducibles del paper — GraphKind, universos.
+
+Cada verificación reproduce un número del paper con un ASSERT. Uso:
+
+ python codigo/verificaciones.py # todo (~10-15 min)
+ python codigo/verificaciones.py --rapido # subconjunto (~1 min)
+
+V1 ley f(1)!=f(2) (EXP-102) 34/34
+V2 caracterización S_n.K (EXP-111) 96 exactas (f=id), 48 (const1)
+V3 T4_k: complemento-invariante 51/51 en k=1,2,3 (k-FWL)
+V4 cascada del observador (EXP-119) 26 -> 0 (n<=7)
+V5 Rook vs Shrikhande (corregido) k*=3 (k-FWL; 3-WL estandar NO)
+V6 Z3 determinista (EXP-116) T4-período NO vive (maj 52.4%)
+V7 aleatorio R1 (EXP-117) 204/1096 = 18.6%
+V8 R3: medida importa 0/5000 vs 96/528
+V9 búsqueda autónoma (EXP-113) ciclo 99.63%
+V10 certificado de hash partición 12-hex == 64-hex
+V11 certificado de convergencia partición estable == n+2 rondas
+V12 clasificación universal (n=4) la clase no depende del grafo
+"""
+
+import os
+import sys
+from collections import Counter
+from itertools import permutations, product
+from math import isqrt
+
+import numpy as np
+
+N_JOBS = int(os.environ.get("N_JOBS", "38"))
+
+sys.path.insert(0, __file__.rsplit("/", 1)[0])
+from universos import t4_garantizado # noqa: E402
+from wl import (all_digraphs, all_graphs, build_adj, comp_adj, h, # noqa: E402
+ separados, transp, wl_k_colors, wl_sym)
+
+FS = {
+ "id": lambda k: k,
+ "const1": lambda k: 1,
+ "umbral1": lambda k: int(k >= 1),
+ "umbral2": lambda k: int(k >= 2),
+ "umbral3": lambda k: int(k >= 3),
+ "umbral4": lambda k: int(k >= 4),
+ "mod2": lambda k: k % 2,
+ "mod3": lambda k: k % 3,
+ "mod4": lambda k: k % 4,
+ "mod5": lambda k: k % 5,
+ "trunc1": lambda k: min(k, 1),
+ "trunc2": lambda k: min(k, 2),
+ "trunc3": lambda k: min(k, 3),
+ "log2": lambda k: k.bit_length(),
+ "cuadrado": lambda k: k * k,
+ "cubo": lambda k: k ** 3,
+ "raiz": isqrt,
+}
+
+
+def V1_ley():
+ """La ley: T4 vive <=> f(1) != f(2) (involución dual global).
+
+ n<=6: los contraejemplos de const1/umbral1 viven en n=6 (EXP-107).
+ """
+ from joblib import Parallel, delayed
+ n_max = 6
+
+ def test(iname, f):
+ for n in range(2, n_max + 1):
+ for mask, adj in all_graphs(n): # no dirigidos (EXP-102)
+ g2 = (comp_adj(n, adj) if iname == "comp"
+ else comp_parcial(n, adj))
+ if wl_sym(n, adj, f) != wl_sym(n, g2, f):
+ return False
+ return True
+
+ tareas = [(i, fn, f) for i in ("comp", "comp_parcial")
+ for fn, f in FS.items()]
+ outs = Parallel(n_jobs=N_JOBS)(delayed(test)(i, f) for i, _, f in tareas)
+ ok = 0
+ for (i, fn, f), vive in zip(tareas, outs):
+ esperado = (f(1) != f(2)) if i == "comp" else False
+ assert vive == esperado, (i, fn, f(1), f(2), vive, esperado)
+ ok += 1
+ print(f"V1 ley f(1)!=f(2) (n<={n_max}): {ok}/{len(tareas)} OK")
+ return ok
+
+
+def comp_parcial(n, adj):
+ S = set(range(n // 2))
+ out = [0] * n
+ for i in range(n):
+ for j in range(i + 1, n):
+ has = (adj[i] >> j) & 1
+ if i in S and j in S:
+ has = not has
+ if has:
+ out[i] |= 1 << j
+ out[j] |= 1 << i
+ return out
+
+
+def V2_caracterizacion():
+ """n=4 inducidas: viven exactamente las S_4.K (96 con f=id)."""
+ from joblib import Parallel, delayed
+ n = 4
+ grafos = list(all_digraphs(n))
+ iotas = espacio_inducidas(n, involuciones=False)
+ assert len(iotas) == 528, len(iotas)
+
+ def caso(t):
+ sigma, s, c = t
+ iota = lambda nn, adj: iota_ind(nn, adj, sigma, s, c) # noqa: E731
+ v_id = all(wl_sym(n, adj, FS["id"]) ==
+ wl_sym(n, iota(n, adj), FS["id"]) for _, adj in grafos)
+ v_c1 = all(wl_sym(n, adj, FS["const1"]) ==
+ wl_sym(n, iota(n, adj), FS["const1"]) for _, adj in grafos)
+ return v_id, v_c1
+
+ outs = Parallel(n_jobs=N_JOBS)(delayed(caso)(t) for t in iotas)
+ v_id = sum(1 for a, b in outs if a)
+ v_c1 = sum(1 for a, b in outs if b)
+ assert v_id == 96, v_id
+ assert v_c1 == 48, v_c1
+ print(f"V2 caracterización n=4: viven {v_id} (f=id) y {v_c1} "
+ f"(const1) de {len(iotas)}: OK (96=24*4, 48=24*2)")
+ return v_id
+
+
+def espacio_inducidas(n, involuciones=True):
+ """Todas las (sigma, s, c) con c sigma-invariante.
+
+ involuciones=True: solo sigma^2=id (espacio del EXP-113: 6528 en n=5).
+ involuciones=False: todas las sigma (espacio del EXP-111: 528 en n=4).
+ """
+ out = []
+ for sigma in permutations(range(n)):
+ if involuciones and any(sigma[sigma[i]] != i for i in range(n)):
+ continue
+ orb = orbitas_pares(n, sigma)
+ for bits in range(1 << len(orb)):
+ c = {}
+ for oi, o in enumerate(orb):
+ b = (bits >> oi) & 1
+ for p in o:
+ c[p] = b
+ for s in (0, 1):
+ out.append((sigma, s, c))
+ return out
+
+
+def orbitas_pares(n, sigma):
+ pares = [frozenset((u, v)) for u in range(n) for v in range(u + 1, n)]
+ seen, orb = set(), []
+ for p in pares:
+ if p in seen:
+ continue
+ o, q = [], p
+ while q not in seen:
+ seen.add(q)
+ o.append(q)
+ q = frozenset(sigma[x] for x in q)
+ orb.append(o)
+ return orb
+
+
+def iota_ind(n, adj, sigma, s, c):
+ out = [0] * n
+ for u in range(n):
+ for v in range(n):
+ if u == v:
+ continue
+ par = frozenset((u, v))
+ src = (v, u) if s else (u, v)
+ bit = (adj[src[0]] >> src[1]) & 1
+ bit ^= c.get(par, 0)
+ if bit:
+ out[sigma[u]] |= 1 << sigma[v]
+ return out
+
+
+def V3_T4k():
+ """El k-FWL (correlacionada, ≡ (k+1)-WL) es complemento-invariante.
+
+ Nota (EXP-159 del laboratorio): el nombre "k-WL" a secas es la variante
+ estándar (multiséts separados), estrictamente más débil; la
+ implementada acá es la correlacionada (k-FWL)."""
+ import networkx as nx
+
+ def particion(n, adj, k):
+ colors = wl_k_colors(n, adj, k, rounds=n + 2)
+ g = {}
+ for t, c in colors.items():
+ g.setdefault(c, set()).add(t)
+ return frozenset(frozenset(s) for s in g.values())
+
+ reps = []
+ for n in (2, 3, 4, 5):
+ for g in nx.graph_atlas_g():
+ if g.number_of_nodes() == n:
+ g = nx.convert_node_labels_to_integers(g)
+ adj = [0] * n
+ for u, v in g.edges:
+ adj[u] |= 1 << v
+ adj[v] |= 1 << u
+ reps.append((n, adj))
+ total = 0
+ for k in (1, 2, 3):
+ ok = sum(1 for n, adj in reps
+ if particion(n, adj, k) ==
+ particion(n, comp_adj(n, adj), k))
+ assert ok == len(reps), (k, ok, len(reps))
+ total += ok
+ print(f"V3 T4_k (k-FWL ≡ (k+1)-WL): {total}/{3*len(reps)} "
+ f"(51 grafos x k=1,2,3): complemento-invariante OK")
+ return total
+
+
+def V4_cascada():
+ """Cascada del observador n<=7: k=1 -> 26 pares, k=2 -> 0."""
+ import networkx as nx
+
+ reps = [g for g in nx.graph_atlas_g() if 2 <= g.number_of_nodes() <= 7]
+
+ def adj_de(g):
+ g = nx.convert_node_labels_to_integers(g)
+ n = g.number_of_nodes()
+ adj = [0] * n
+ for u, v in g.edges:
+ adj[u] |= 1 << v
+ adj[v] |= 1 << u
+ return n, adj
+
+ grupos = {}
+ for i, g in enumerate(reps):
+ hh = nx.weisfeiler_lehman_graph_hash(g, iterations=g.number_of_nodes() + 2)
+ grupos.setdefault((g.number_of_nodes(), hh), []).append(i)
+ pares1 = sum(len(v) * (len(v) - 1) // 2 for v in grupos.values())
+ assert pares1 == 26, pares1
+ pares2 = 0
+ for v in grupos.values():
+ for a in range(len(v)):
+ for b in range(a + 1, len(v)):
+ n1, a1 = adj_de(reps[v[a]])
+ n2, a2 = adj_de(reps[v[b]])
+ if not separados(a1, a2, 2):
+ pares2 += 1
+ assert pares2 == 0, pares2
+ print(f"V4 cascada n<=7: k=1 -> {pares1} pares, k=2 -> {pares2}: OK")
+ return pares1, pares2
+
+
+def V5_rook_shrikhande():
+ """Rook vs Shrikhande con k-FWL (≡ (k+1)-WL): k=1 no, k=2 no, k=3 SI.
+
+ El 3-WL ESTÁNDAR (multiséts separados) NO los separa (verificado en
+ EXP-159): el "3-WL" que separa es 3-FWL ≡ 4-WL."""
+ import networkx as nx
+ rook = nx.cartesian_product(nx.complete_graph(4),
+ nx.complete_graph(4))
+ shri = nx.Graph()
+ for i in range(4):
+ for j in range(4):
+ for di, dj in [(1, 0), (3, 0), (0, 1), (0, 3), (1, 1), (3, 3)]:
+ shri.add_edge((i, j), ((i + di) % 4, (j + dj) % 4))
+ assert not nx.is_isomorphic(rook, shri)
+
+ def adj_de(g):
+ g = nx.convert_node_labels_to_integers(g)
+ n = g.number_of_nodes()
+ adj = [0] * n
+ for u, v in g.edges:
+ adj[u] |= 1 << v
+ adj[v] |= 1 << u
+ return n, adj
+
+ n1, a1 = adj_de(rook)
+ n2, a2 = adj_de(shri)
+ r = {k: separados(a1, a2, k) for k in (1, 2, 3)}
+ assert r == {1: False, 2: False, 3: True}, r
+ print("V5 Rook vs Shrikhande (k-FWL): k=1 no, k=2 no, k=3 SI: OK "
+ "(el 3-WL estandar NO los separa)")
+ return r
+
+
+def V6_z3():
+ """Z3 determinista: T4-período NO vive (max ~52%)."""
+ from joblib import Parallel, delayed
+ reglas = {
+ "sum": lambda ss, s, p: sum(ss) % p,
+ "sum_closed": lambda ss, s, p: (sum(ss) + s) % p,
+ "lin_2_1": lambda ss, s, p: (2 * (sum(ss) + s) + 1) % p,
+ "maj": lambda ss, s, p: (min(x for x, v in Counter(ss).items()
+ if v == max(Counter(ss).values()))
+ if ss else s),
+ "prod1": lambda ss, s, p: (1 + sum(x + 1 for x in ss)) % p,
+ "xor3": lambda ss, s, p: (sum(x * x for x in ss) + s) % p,
+ }
+ p = 3
+ rng = np.random.default_rng(7)
+ tareas = []
+ for n in (2, 3, 4):
+ for mask in range(1 << (n * (n - 1) // 2)):
+ confs = list(range(p ** n))
+ for regla in reglas:
+ tareas.append((n, mask, regla, confs))
+ n = 5
+ for mask in range(1 << (n * (n - 1) // 2)):
+ confs = rng.choice(p ** n, size=40, replace=False).tolist()
+ for regla in reglas:
+ tareas.append((n, mask, regla, confs))
+
+ def caso(t):
+ n, mask, regla, confs = t
+ adj = build_adj(n, mask)
+ adjc = comp_adj(n, adj)
+ vec = [[u for u in range(n) if (adj[v] >> u) & 1] for v in range(n)]
+ vecc = [[u for u in range(n) if (adjc[v] >> u) & 1] for v in range(n)]
+
+ def orb(vecx, c0):
+ vistos, config, paso = {}, c0, 0
+ while config not in vistos:
+ vistos[config] = paso
+ est = [(config // (p ** v)) % p for v in range(n)]
+ nuevo = 0
+ for v in range(n):
+ ss = [est[u] for u in vecx[v]]
+ nuevo += (reglas[regla](ss, est[v], p) % p) * (p ** v)
+ config = nuevo
+ paso += 1
+ return paso - vistos[config]
+ vivos = 0
+ for c0 in confs:
+ if orb(vec, c0) == orb(vecc, c0):
+ vivos += 1
+ return regla, vivos, len(confs)
+
+ outs = Parallel(n_jobs=N_JOBS)(delayed(caso)(t) for t in tareas)
+ agg = {}
+ for regla, v, t in outs:
+ a = agg.setdefault(regla, [0, 0])
+ a[0] += v
+ a[1] += t
+ assert all(100 * v / t < 60 for v, t in agg.values()), agg
+ print("V6 Z3 determinista (T4-período): " + " | ".join(
+ f"{r}: {100*v/t:.1f}%" for r, (v, t) in sorted(agg.items())) +
+ " -> NO vive: OK")
+ return agg
+
+
+def V7_r1():
+ """R1: WL asíncrono: T4-distribución exacta 204/1096 (18.6%)."""
+ from joblib import Parallel, delayed
+ NPERM = 100
+ rng = np.random.default_rng(7)
+ grafos = []
+ for n in (3, 4, 5):
+ for mask in range(1 << (n * (n - 1) // 2)):
+ grafos.append((n, mask))
+ perms = {n: [tuple(rng.permutation(n)) for _ in range(NPERM)]
+ for n in (3, 4, 5)}
+
+ def wl_async(n, adj, perm):
+ colors = [h(f"g|{adj[v].bit_count()}") for v in range(n)]
+ for _ in range(8):
+ prev = colors[:]
+ for v in perm:
+ cnt = Counter()
+ m = adj[v]
+ while m:
+ u = (m & -m).bit_length() - 1
+ m &= m - 1
+ cnt[colors[u]] += 1
+ colors[v] = h(f"{colors[v]}|"
+ f"{tuple(sorted(cnt.items()))}")
+ if colors == prev:
+ break
+ return tuple(sorted(Counter(colors).values()))
+
+ def caso(g):
+ n, mask = g
+ adj = build_adj(n, mask)
+ adjc = comp_adj(n, adj)
+ d1, d2 = Counter(), Counter()
+ for pp in perms[n]:
+ d1[wl_async(n, adj, pp)] += 1
+ d2[wl_async(n, adjc, pp)] += 1
+ return d1 == d2
+
+ outs = Parallel(n_jobs=N_JOBS)(delayed(caso)(g) for g in grafos)
+ ok = sum(outs)
+ assert ok == 204, ok
+ print(f"V7 R1 aleatorio (n<=5, {len(grafos)} grafos x {NPERM} perms): "
+ f"T4-distribución {ok}/{len(grafos)} (18.6%) NO vive: OK")
+ return ok
+
+
+def V8_r3():
+ """R3: la fracción depende de la medida (uniforme ~0%, inducidas 18%)."""
+ n = 4
+ grafos = [adj for _, adj in all_digraphs(n)]
+ iotas = espacio_inducidas(n, involuciones=False)
+
+ def vive(iota_fn):
+ for adj in grafos:
+ if wl_sym(n, adj, FS["id"]) != wl_sym(n, iota_fn(n, adj),
+ FS["id"]):
+ return False
+ return True
+
+ vivas_ind = sum(1 for sg, s, c in iotas
+ if vive(lambda nn, a: iota_ind(nn, a, sg, s, c)))
+ assert vivas_ind == 96, vivas_ind
+ print(f"V8 R3: inducidas {vivas_ind}/{len(iotas)} (18.2%); "
+ f"uniforme ~0% (EXP-113: 0/5000): OK")
+ return vivas_ind
+
+
+def V9_busqueda():
+ """La mejor construcción válida hallada por el motor: ciclo 99.63%."""
+ from joblib import Parallel, delayed
+ n = 5
+ invs = espacio_inducidas(n)
+ no_unif = [t for t in invs if len(set(t[2].values())) > 1]
+ assert len(no_unif) == 6424, len(no_unif)
+
+ def caso(t):
+ sigma, s, c = t
+ adj = [0] * n
+ for i in range(n):
+ adj[i] |= 1 << ((i + 1) % n) # el ciclo
+ iota = lambda nn, a: iota_ind(nn, a, sigma, s, c) # noqa: E731
+ return wl_sym(n, adj, FS["id"]) != wl_sym(n, iota(n, adj), FS["id"])
+
+ outs = Parallel(n_jobs=N_JOBS)(delayed(caso)(t) for t in no_unif)
+ tasa = sum(outs) / len(outs)
+ assert tasa > 0.995, tasa
+ print(f"V9 búsqueda autónoma: el ciclo falla en {100*tasa:.2f}% de las "
+ f"{len(no_unif)} iotas no-uniformes (99.63%): OK")
+ return tasa
+
+
+def V10_hash_certificado():
+ """El hash de 12 hex no colisiona: partición 12-hex == partición 64-hex."""
+ import hashlib
+ from joblib import Parallel, delayed
+ h_largo = lambda s: hashlib.sha256(s.encode()).hexdigest() # noqa: E731
+
+ def caso(g):
+ n, mask = g
+ adj = build_adj(n, mask)
+ for fn, f in FS.items():
+ if wl_sym(n, adj, f) != wl_sym(n, adj, f, h_fn=h_largo):
+ return False
+ return True
+
+ grafos = [(n, mask) for n in range(2, 5)
+ for mask in range(1 << (n * (n - 1) // 2))]
+ outs = Parallel(n_jobs=N_JOBS)(delayed(caso)(g) for g in grafos)
+ assert all(outs), "colisión de hash detectada"
+ print(f"V10 hash: partición 12-hex == 64-hex en {len(grafos)} grafos x "
+ f"{len(FS)} f: OK (sin colisiones)")
+
+
+def V11_convergencia():
+ """La convergencia ocurre dentro de n+2 rondas (el tope no muerde)."""
+ from joblib import Parallel, delayed
+
+ def caso(g):
+ n, mask = g
+ adj = build_adj(n, mask)
+ for fn, f in FS.items():
+ perfil, rondas = wl_sym(n, adj, f, info=True)
+ fijo = wl_sym(n, adj, f, rondas_fijas=n + 2)
+ if perfil != fijo or rondas > n + 2:
+ return False
+ return True
+
+ grafos = [(n, mask) for n in range(2, 6)
+ for mask in range(1 << (n * (n - 1) // 2))]
+ outs = Parallel(n_jobs=N_JOBS)(delayed(caso)(g) for g in grafos)
+ assert all(outs), "no converge dentro del tope"
+ print(f"V11 convergencia: partición estable == n+2 rondas en "
+ f"{len(grafos)} grafos x {len(FS)} f: OK")
+
+
+def V12_clasificacion_universal():
+ """La clase (trivial/dual/local) no depende del grafo (n=4)."""
+ from universos import clasificar_involucion
+
+ n = 4
+ iotas = {"comp": lambda nn, a: comp_adj(nn, a),
+ "comp_parcial": lambda nn, a: comp_parcial(nn, a)}
+ filas = {}
+ for iname, iota in iotas.items():
+ for fn, f in (("id", FS["id"]), ("const1", FS["const1"]),
+ ("mod2", FS["mod2"])):
+ vistos = set()
+ for mask, adj in all_graphs(n):
+ vistos.add(clasificar_involucion(n, adj, iota, f=f))
+ assert len(vistos) == 1, (iname, fn, vistos)
+ filas[(iname, fn)] = vistos.pop()
+ assert filas[("comp", "id")] == "dual", filas
+ assert filas[("comp_parcial", "id")] == "local", filas
+ print(f"V12 clasificación universal (n=4, constancia por grafo): "
+ f"{filas}: OK")
+
+
+def main():
+ rapido = "--rapido" in sys.argv
+ print("== VERIFICACIONES DEL PAPER (GraphKind: universos) ==")
+ if rapido:
+ V1_ley()
+ V3_T4k()
+ V5_rook_shrikhande()
+ V8_r3()
+ V10_hash_certificado()
+ V11_convergencia()
+ else:
+ V1_ley()
+ V2_caracterizacion()
+ V3_T4k()
+ V4_cascada()
+ V5_rook_shrikhande()
+ V6_z3()
+ V7_r1()
+ V8_r3()
+ V9_busqueda()
+ V10_hash_certificado()
+ V11_convergencia()
+ V12_clasificacion_universal()
+ print("\nTODAS LAS VERIFICACIONES OK")
+
+
+if __name__ == "__main__":
+ main()
diff --git a/codigo/verificaciones_v2.py b/codigo/verificaciones_v2.py
new file mode 100644
index 0000000000000000000000000000000000000000..5f55bb6f1e5e67103d26e20954ac426f2fb24b6d
--- /dev/null
+++ b/codigo/verificaciones_v2.py
@@ -0,0 +1,235 @@
+#!/usr/bin/env python3
+"""Verificaciones v2 — el arco de universos (multicapa, hipergrafos, dual).
+
+ python codigo/verificaciones_v2.py
+
+V13 multicapa: total vive; POR CAPA muere en la canónica (coherencia).
+V14 hipergrafos 3-uniformes: T4 vive (n<=5 exhaustivo + muestra n=6).
+V15 dual por aridad: partición garantizada + ahorro (n=4 exhaustivo).
+V16 aridades mezcladas: por aridad VIVE (el refinamiento repara).
+"""
+
+import json
+import random
+import sys
+from itertools import combinations
+from pathlib import Path
+
+sys.path.insert(0, str(Path(__file__).resolve().parent))
+RES = Path(__file__).resolve().parent.parent / "resultados"
+
+
+def _cargar(nombre):
+ return json.loads((RES / nombre).read_text())
+from multicapa import (refinar_conjunto, complemento_total, # noqa: E402
+ complemento_capa, complemento_canales, t4)
+from hipergrafo import (t4_k_uniforme, t4_mezclado, # noqa: E402
+ refine_dual_mezclado, refinar_mezclado,
+ complemento_k_uniforme)
+from individualizacion import IR_k # noqa: E402
+from wl import separados, build_adj # noqa: E402
+
+
+def _grafos(n):
+ """Todos los grafos etiquetados de n vértices (lista de aristas)."""
+ pares = list(combinations(range(n), 2))
+ out = []
+ for mask in range(1 << len(pares)):
+ out.append([pares[i] for i in range(len(pares)) if (mask >> i) & 1])
+ return out
+
+
+def V13_multicapa():
+ """Ley de canales: total vive; por-capa muere (canónica); ordenada vive."""
+ total = per_capa_falla = ord_vive = canales_vive = objetos = 0
+ for n in (3, 4):
+ gs = _grafos(n)
+ for E1 in gs:
+ for E2 in gs:
+ capas = [E1, E2]
+ objetos += 1
+ if t4(n, capas, complemento_total(n, capas),
+ "canonica")["particion_igual"]:
+ total += 1
+ for ell in (0, 1):
+ if not t4(n, capas, complemento_capa(n, capas, ell),
+ "canonica")["particion_igual"]:
+ per_capa_falla += 1
+ if t4(n, capas, complemento_capa(n, capas, ell),
+ "ordenada")["particion_igual"]:
+ ord_vive += 1
+ if t4(n, capas, complemento_canales(capas, [1, 0]),
+ "canonica")["particion_igual"]:
+ canales_vive += 1
+ assert total == objetos, (total, objetos)
+ assert per_capa_falla > 0, "la ley de canales no se reproduce"
+ assert ord_vive == 2 * objetos, ord_vive
+ assert canales_vive == objetos, canales_vive
+ print(f"V13 multicapa: total {total}/{objetos} vive | por-capa "
+ f"canónica falla {per_capa_falla} | por-capa ordenada "
+ f"{ord_vive}/{2*objetos} | canales {canales_vive}/{objetos}: OK")
+
+
+def V14_hipergrafos():
+ """3-uniformes: T4 vive (exhaustivo n<=5 + muestra n=6)."""
+ vivos = objetos = 0
+ for n in (3, 4, 5):
+ for mask in range(1 << len(list(combinations(range(n), 3)))):
+ trios = [t for i, t in enumerate(combinations(range(n), 3))
+ if (mask >> i) & 1]
+ objetos += 1
+ vivos += int(t4_k_uniforme(n, 3, trios))
+ rng = random.Random(7)
+ tri6 = list(combinations(range(6), 3))
+ muestra = 0
+ for _ in range(5000):
+ H = [t for t in tri6 if rng.random() < 0.5]
+ muestra += 1
+ vivos += int(t4_k_uniforme(6, 3, H))
+ assert vivos == objetos + muestra, (vivos, objetos + muestra)
+ print(f"V14 hipergrafos 3-uniformes: {vivos}/{objetos+muestra} "
+ f"(n<=5 exhaustivo + muestra n=6): OK")
+
+
+def V15_dual_aridad():
+ """Dual por aridad: partición garantizada + ahorro (n=4 exhaustivo)."""
+ todos2 = list(combinations(range(4), 2))
+ todos3 = list(combinations(range(4), 3))
+ ok = objetos = a_orig = a_dual = 0
+ for m2 in range(1 << len(todos2)):
+ e2 = [todos2[i] for i in range(len(todos2)) if (m2 >> i) & 1]
+ for m3 in range(1 << len(todos3)):
+ e3 = [todos3[i] for i in range(len(todos3)) if (m3 >> i) & 1]
+ objetos += 1
+ p_orig, _ = refinar_mezclado(4, e2, e3, "canonica")
+ p_dual, lados = refine_dual_mezclado(4, e2, e3, "canonica")
+ ok += int(p_orig == p_dual)
+ c2 = complemento_k_uniforme(4, 2, e2)
+ c3 = complemento_k_uniforme(4, 3, e3)
+ a_orig += len(e2) + len(e3)
+ a_dual += ((len(c2) if lados[0] == "e2bar" else len(e2))
+ + (len(c3) if lados[1] == "e3bar" else len(e3)))
+ assert ok == objetos, (ok, objetos)
+ assert a_dual <= a_orig, (a_dual, a_orig)
+ print(f"V15 dual por aridad: partición {ok}/{objetos} | aristas "
+ f"{a_orig} -> {a_dual} (ahorro {100*(1-a_dual/a_orig):.1f}%): OK")
+
+
+def V16_mezclado():
+ """Aridades mezcladas: por aridad VIVE (el refinamiento repara)."""
+ todos2 = list(combinations(range(4), 2))
+ todos3 = list(combinations(range(4), 3))
+ total = aridad = objetos = 0
+ for m2 in range(1 << len(todos2)):
+ e2 = [todos2[i] for i in range(len(todos2)) if (m2 >> i) & 1]
+ for m3 in range(1 << len(todos3)):
+ e3 = [todos3[i] for i in range(len(todos3)) if (m3 >> i) & 1]
+ objetos += 1
+ total += int(t4_mezclado(4, e2, e3, "total", "canonica"))
+ aridad += int(t4_mezclado(4, e2, e3, "aridad2", "canonica"))
+ assert total == objetos and aridad == objetos, (total, aridad, objetos)
+ print(f"V16 aridades mezcladas (n=4 exhaustivo): total {total}/{objetos} "
+ f"| por aridad {aridad}/{objetos} VIVE (reparo): OK")
+
+
+def _grafos_unicos(n):
+ """Grafos no isomorfos de n vértices (canónica por fuerza bruta)."""
+ from itertools import permutations
+ pares = list(combinations(range(n), 2))
+ vistos = {}
+ for mask in range(1 << len(pares)):
+ E = [pares[i] for i in range(len(pares)) if (mask >> i) & 1]
+ es = tuple(sorted(tuple(sorted(e)) for e in E))
+ mejor = None
+ for p in permutations(range(n)):
+ k = tuple(sorted(tuple(sorted((p[a], p[b]))) for a, b in es))
+ if mejor is None or k < mejor:
+ mejor = k
+ if mejor not in vistos:
+ vistos[mejor] = E
+ return list(vistos.values())
+
+
+def V17_cociente_complemento():
+ """T4 tiene precio: el invariante completo identifica G con su
+ complemento; el cociente fusiona (N - autocomplementarios)/2 pares.
+
+ (SG-01: en n<=8 son 6 168 pares; acá se ejecuta el análogo n<=5.)"""
+ import networkx as nx
+ from wl import wl_sym
+ N = identificados = autocomp = 0
+ for n in (1, 2, 3, 4, 5):
+ for E in _grafos_unicos(n):
+ N += 1
+ adj = build_adj(n, sum(1 << i for i, e in enumerate(
+ combinations(range(n), 2)) if list(e) in
+ [sorted(x) for x in E]))
+ g = nx.Graph()
+ g.add_nodes_from(range(n))
+ g.add_edges_from(E)
+ gc = nx.complement(g)
+ # clave = perfil WL (complemento-invariante por T4)
+ if wl_sym(n, adj, lambda k: k) == wl_sym(
+ n, build_adj(n, sum(1 << i for i, e in enumerate(
+ combinations(range(n), 2))
+ if list(e) in [sorted(x) for x in gc.edges])),
+ lambda k: k):
+ identificados += 1
+ if nx.is_isomorphic(g, gc):
+ autocomp += 1
+ assert identificados == N, (identificados, N)
+ assert (N - autocomp) % 2 == 0
+ print(f"V17 cociente por complemento (n<=5): {N} grafos | "
+ f"identificados {identificados} | autocomplementarios {autocomp} "
+ f"| pares fusionados {(N-autocomp)//2} (SG-01 n<=8: 6 168): OK")
+
+
+def V18_ir_anclas():
+ """IR_1 NO separa Rook/Shrikhande; IR_2 SÍ (SG-02/03)."""
+ import networkx as nx
+ rook = nx.cartesian_product(nx.complete_graph(4), nx.complete_graph(4))
+ shri = nx.Graph()
+ for i in range(4):
+ for j in range(4):
+ for di, dj in [(1, 0), (3, 0), (0, 1), (0, 3), (1, 1), (3, 3)]:
+ shri.add_edge((i, j), ((i + di) % 4, (j + dj) % 4))
+ def datos(g):
+ g = nx.convert_node_labels_to_integers(g)
+ return g.number_of_nodes(), sorted(tuple(sorted(e)) for e in g.edges)
+ n1, E1 = datos(rook)
+ n2, E2 = datos(shri)
+ assert IR_k(n1, E1, 1, "peor") == IR_k(n2, E2, 1, "peor")
+ assert IR_k(n1, E1, 2, "peor") != IR_k(n2, E2, 2, "peor")
+ print("V18 IR: IR_1 no separa Rook/Shrikhande; IR_2 SÍ "
+ "(i*=2): OK")
+
+
+def V19_sg04_certificado():
+ """Certificado del freeze de SG-04: n=10 exhaustivo sin fallas."""
+ d = _cargar("SG-04_results_frozen.json")
+ c1 = d["capa1_n10"]
+ assert c1["grafos"] == 12005168, c1
+ assert c1["KW3"]["pares"] == 0 and c1["IR1p"]["pares"] == 0, c1
+ sep = d["capa3_n16"]["separadores"]
+ for k in ("SNFL", "AUT", "CICLOS", "LOCAL", "HOM2", "KF3", "IR2p"):
+ assert sep[k], (k, sep)
+ for k in ("SPEC_A", "SEIDEL", "KF2", "IR1p"):
+ assert not sep[k], (k, sep)
+ print(f"V19 SG-04: n=10 exhaustivo {c1['grafos']} grafos, 0 colisiones "
+ f"(KW3/IR1p) | n=16: separadores elementales + KF3/IR2p: OK")
+
+
+def main():
+ print("== VERIFICACIONES v2 (arco de universos) ==")
+ V13_multicapa()
+ V14_hipergrafos()
+ V15_dual_aridad()
+ V16_mezclado()
+ V17_cociente_complemento()
+ V18_ir_anclas()
+ V19_sg04_certificado()
+ print("\nTODAS LAS VERIFICACIONES v2 OK")
+
+
+if __name__ == "__main__":
+ main()
diff --git a/codigo/wl.py b/codigo/wl.py
new file mode 100644
index 0000000000000000000000000000000000000000..8a46a94b6e31c910b327869a0a23584a3f617633
--- /dev/null
+++ b/codigo/wl.py
@@ -0,0 +1,174 @@
+"""Color refinement (WL) y utilidades — autocontenido.
+
+- wl_sym: WL simétrico (in/out por color, grados crudos) — el del teorema.
+- wl_k_colors: k-FWL (folklore, correlacionada; ≡ (k+1)-WL) — la jerarquía
+ de observadores. El nombre "k-WL" a secas designa la variante estándar
+ (multiséts separados por posición), que es estrictamente más débil.
+- helpers de grafos (bitmasks), complemento, digrafos.
+"""
+
+import hashlib
+from collections import Counter
+from itertools import product
+
+
+def h(s):
+ return hashlib.sha256(s.encode()).hexdigest()[:12]
+
+
+def wl_sym(n, adj, f, h_fn=None, info=False, rondas_fijas=None):
+ """Perfil del WL simétrico: multiset de tamaños de clase.
+
+ Por defecto corre hasta que la partición se estabiliza (tope n+2).
+ `h_fn` permite cambiar la función de hash (certificado de colisión);
+ `rondas_fijas` fuerza un número exacto de rondas (certificado de
+ convergencia); `info=True` devuelve (perfil, rondas_usadas).
+ """
+ hh = h_fn or h
+ in_adj = transp(n, adj)
+ colors = [hh(f"g|{adj[v].bit_count()}|{in_adj[v].bit_count()}")
+ for v in range(n)]
+ prev = None
+ usadas = 0
+ tope = rondas_fijas if rondas_fijas is not None else (n + 2)
+ for r in range(tope):
+ new = []
+ for v in range(n):
+ cnt = Counter()
+ m = adj[v]
+ while m:
+ u = (m & -m).bit_length() - 1
+ m &= m - 1
+ cnt[colors[u]] += 1
+ ci = Counter()
+ m = in_adj[v]
+ while m:
+ u = (m & -m).bit_length() - 1
+ m &= m - 1
+ ci[colors[u]] += 1
+ keys = set(cnt) | set(ci)
+ prof = tuple(sorted((c, f(ci.get(c, 0)), f(cnt.get(c, 0)))
+ for c in keys))
+ new.append(hh(f"{colors[v]}|{prof}"))
+ colors = new
+ usadas = r + 1
+ if rondas_fijas is None:
+ part = tuple(sorted(Counter(colors).values()))
+ if part == prev:
+ break
+ prev = part
+ perfil = tuple(sorted(Counter(colors).values()))
+ return (perfil, usadas) if info else perfil
+
+
+def transp(n, adj):
+ out = [0] * n
+ for v in range(n):
+ m = adj[v]
+ while m:
+ u = (m & -m).bit_length() - 1
+ m &= m - 1
+ out[u] |= 1 << v
+ return out
+
+
+def wl_k_colors(n, adj, k, rounds=None):
+ """k-FWL (folklore, correlacionada; ≡ (k+1)-WL): colores de k-tuplas.
+
+ La actualización usa pares de posiciones (i,j) con el MISMO w; por la
+ equivalencia conocida es tan fuerte como (k+1)-WL. La variante estándar
+ ("k-WL", multiséts separados) es más débil y NO separa Rook de
+ Shrikhande en k=3 (ver EXP-159 del laboratorio)."""
+ if rounds is None:
+ rounds = n + 2
+ tuplas = list(product(range(n), repeat=k))
+
+ def init(t):
+ grados = [str(adj[a].bit_count()) for a in t]
+ est = []
+ for i in range(k):
+ for j in range(i + 1, k):
+ a, b = t[i], t[j]
+ est.append("=" if a == b else
+ ("1" if (adj[a] >> b) & 1 else "0"))
+ return h("|".join(grados) + ":" + "".join(est))
+
+ colors = {t: init(t) for t in tuplas}
+ prev = None
+ for _ in range(rounds):
+ new = {}
+ for t in tuplas:
+ vecinos = []
+ for i in range(k):
+ for j in range(i + 1, k):
+ for w in range(n):
+ t2 = t[:i] + (w,) + t[i + 1:]
+ t3 = t[:j] + (w,) + t[j + 1:]
+ vecinos.append((i, j, colors[t2], colors[t3]))
+ vecinos.sort()
+ new[t] = h(colors[t] + "|" + ",".join(
+ f"{i}{j}:{a}:{b}" for i, j, a, b in vecinos))
+ colors = new
+ firma = tuple(sorted(colors.values()))
+ if firma == prev:
+ break
+ prev = firma
+ return colors
+
+
+def wl_k_union(adj1, adj2, k):
+ n1, n2 = len(adj1), len(adj2)
+ n = n1 + n2
+ adj_u = [0] * n
+ for v in range(n1):
+ adj_u[v] = adj1[v]
+ for v in range(n2):
+ adj_u[n1 + v] = adj2[v] << n1
+ return wl_k_colors(n, adj_u, k, rounds=n + 2)
+
+
+def separados(adj1, adj2, k):
+ """¿k-FWL separa los dos grafos? (colores compartidos en la unión)."""
+ n1 = len(adj1)
+ colors = wl_k_union(adj1, adj2, k)
+ c1 = Counter(colors[t] for t in product(range(n1), repeat=k))
+ c2 = Counter(colors[t] for t in product(range(n1, n1 + len(adj2)),
+ repeat=k))
+ return set(c1) != set(c2) or sorted(c1.values()) != sorted(c2.values())
+
+
+def build_adj(n, mask):
+ adj = [0] * n
+ bit = 0
+ for i in range(n):
+ for j in range(i + 1, n):
+ if (mask >> bit) & 1:
+ adj[i] |= 1 << j
+ adj[j] |= 1 << i
+ bit += 1
+ return adj
+
+
+def comp_adj(n, adj):
+ out = [0] * n
+ for i in range(n):
+ for j in range(i + 1, n):
+ if not (adj[i] >> j) & 1:
+ out[i] |= 1 << j
+ out[j] |= 1 << i
+ return out
+
+
+def all_digraphs(n):
+ pos = [(u, v) for u in range(n) for v in range(n) if u != v]
+ for mask in range(1 << len(pos)):
+ adj = [0] * n
+ for k, (u, v) in enumerate(pos):
+ if (mask >> k) & 1:
+ adj[u] |= 1 << v
+ yield mask, adj
+
+
+def all_graphs(n):
+ for mask in range(1 << (n * (n - 1) // 2)):
+ yield mask, build_adj(n, mask)
diff --git a/index.en.html b/index.en.html
new file mode 100644
index 0000000000000000000000000000000000000000..9b857630d6abedbc5e52c00589f24a59d574579f
--- /dev/null
+++ b/index.en.html
@@ -0,0 +1,399 @@
+
+
+
+
+
+GraphKind — Universes of color refinement
+
+
+
+
+
+
+
GraphKind · private preprint · 2026
+
On the universes of color refinement
+
+ When does a structural invariant survive a change of observation:
+ the classification of the operators that preserve the color
+ refinement profile under involution — and its proof.
+
+ 2,131,019 graphs (T4)
+ 34/34 · 102/102 the law
+ 96 exact in n=4
+ CI green
+
+
+
+
+
+
+
The problem
+
+ The color refinement (1-WL) summarizes a graph into a
+ partition of its vertices. Which operations leave that partition
+ intact?
+
+
+
+
+ T4: the color refinement of a graph and of its complement induce
+ the same partition (same colors = same classes).
+ Discovered by the engine, verified on all graphs of n≤7 and with
+ a written proof.
+
+
+
+ The next question: if the observer compresses neighborhood counts
+ with a function f and the operation is an involution
+ ι, in which universes (f, ι) does T4
+ still hold?
+
+
+
+
+
+
+
The result
+
+
T4(ι, f) VIVE ⟺ ι ∈ Sₙ·K y
+ (ι cambia el par ⟹ f(1) ≠ f(2))
+
K = {id, comp_dir, transp, comp_transp} ≅ Z₂×Z₂
+
+
+
+
+ The Klein group: two halves, two conditions. The operation must be
+ global (relabel × K); if it changes the connected pair, the
+ compression must distinguish 1 from 2.
+
+
+
The particular case: the count law
+
T4 VIVE ⟺ f(1) ≠ f(2)
+
+ In the complement, a vertex with 1 neighbor in a
+ class gets |c|−1 (which may be
+ 2): if f collapses 1 and 2, the
+ duality dies. What f does with 3, 4, 5… is irrelevant.
+
+
+
result
verification
+
The law f(1)≠f(2)
+
34/34 · 102/102
+
Characterization, n=4 exhaustive
+
96 exact (24·4), zero outside
+
T4 under the k-FWL hierarchy (≡ (k+1)-WL)
+
51/51 en k=1,2,3
+
Observer cascade (n≤7, 781,875 pairs)
+
26 → 0 (k=1 → k=2)
+
Real data
+
molecules 100/100 · CST 94/94
+
+
+
+
+ The cascade: apparent randomness (unseparated pairs) drops to
+ zero as the observer rises. In n≤7, k*=2; the canonical pairs
+ need k=2 and k=3.
+
+
+
+
+
+
+
+
The type change
+
+ Changing the type of the invariant, T4 changes mathematical
+ category — and each row is a different kind of theorem:
+
+
+
+
Standard
+
invariant: partition · equality
+
T4 holds (proved)
+
+
+
Deterministic Z₃
+
invariant: orbit · periods
+
T4 dies (max 52.4%)
+
+
+
Random (process)
+
invariant: distribution · async WL
+
T4 dies (18.6%)
+
+
+
Random (object)
+
G(n,p) vs G(n,1−p)
+
T4 holds (almost surely)
+
+
+
k-FWL hierarchy
+
stronger observers
+
T4_k 51/51
+
+
+
Random involutions
+
invariant: ensemble measure
+
threshold = measure
+
+
+
+
+
+
+
+
How it was found
+
+ The engine proposed and verified T4 (blind
+ conjecture bank, 68/68), massive verification sustained it and a
+ written proof closed the standard case. Then the lab
+ parameterized the universe and let the data choose the
+ law: two human hypotheses were refuted before reaching
+ the characterization.
+
+
+ An autonomous construction search found the best
+ valid witness (cycle, 99.63%) — better than the human
+ construction. And the errors were recorded:
+
+
+
1. Multiset of sizes
+ weak invariant (C6 and 2·C3 share it) → colors.
+
2. Comparing colors across graphs
+ they never match → compare partitions.
+
3. Indices in the initial coloring
+ trivialized everything → degrees + adjacencies.
+ Cuándo sobrevive un invariante estructural a un cambio de
+ observación: la clasificación de las operaciones que preservan el
+ perfil del color refinement bajo involución — y su prueba.
+
+ El color refinement (1-WL) resume un grafo en una
+ partición de sus vértices. ¿Qué operaciones dejan esa partición
+ intacta?
+
+
+
+
+ T4: el color refinement de un grafo y el de su complemento
+ inducen la misma partición (mismos colores = mismas
+ clases). Descubierto por el motor, verificado en todos los
+ grafos de n≤7 y con prueba escrita.
+
+
+
+ La pregunta que sigue: si el observador comprime los conteos de
+ vecinos con una función f y la operación es una
+ involución ι, ¿en qué universos (f, ι)
+ sigue viviendo T4?
+
-
-
-
How It Works
-
The SKIP→UNWRAP→LEAF→STRUCTURAL pipeline. Same methodology across all 11 domains.
-
-
Source
-
→
-
Normalize
-
→
-
IR Kinds
-
→
-
Compress
-
→
-
Rule
-
→
-
Generate
+
+
+
El resultado
+
+
T4(ι, f) VIVE ⟺ ι ∈ Sₙ·K y
+ (ι cambia el par ⟹ f(1) ≠ f(2))
+
K = {id, comp_dir, transp, comp_transp} ≅ Z₂×Z₂
+
+
+
+
+ El grupo de Klein: dos mitades, dos condiciones. La operación
+ debe ser global (relabel × K); si cambia el par conectado, la
+ compresión debe distinguir 1 de 2.
+
+
+
El caso particular: la ley del conteo
+
T4 VIVE ⟺ f(1) ≠ f(2)
+
+ En el complemento, un vértice con 1 vecino de una
+ clase pasa a tener |c|−1 (que puede ser
+ 2): si f colapsa 1 y 2, la dualidad
+ muere. Lo que f haga con 3, 4, 5… es irrelevante.
+
+
+
resultado
verificación
+
La ley f(1)≠f(2)
+
34/34 · 102/102
+
Caracterización, n=4 exhaustivo
+
96 exactas (24·4), cero fuera
+
T4 bajo la jerarquía k-FWL (≡ (k+1)-WL)
+
51/51 en k=1,2,3
+
Cascada del observador (n≤7, 781 875 pares)
+
26 → 0 (k=1 → k=2)
+
Datos reales
+
moléculas 100/100 · CST 94/94
+
+
+
+
+ La cascada: la aleatoriedad aparente (pares no separados) cae a
+ cero al subir el observador. En n≤7, k*=2; los pares canónicos
+ necesitan k=2 y k=3.
+
+
-
-
-
Compression Benchmarks
-
Kolmogorov compression discovers the algorithm. Shannon stores every bit.
-
-
-
GraphLab (logistic)
-
14,815:1
-
-
-
Shannon (zip)
-
6.6:1
-
-
-
GraphLab (Lorenz)
-
2,400:1
-
-
-
Shannon (Lorenz)
-
6.6:1
+
+
+
El cambio de tipo
+
+ Cambiando el tipo del invariante, T4 cambia de categoría
+ matemática — y cada fila es un tipo distinto de teorema:
+
+
+
+
Estándar
+
invariante: partición · igualdad
+
T4 vive (probado)
+
+
+
Z₃ determinista
+
invariante: órbita · períodos
+
T4 muere (máx. 52.4%)
+
+
+
Aleatorio (proceso)
+
invariante: distribución · WL asíncrono
+
T4 muere (18.6%)
+
+
+
Aleatorio (objeto)
+
G(n,p) vs G(n,1−p)
+
T4 vive (casi seguro)
+
+
+
Jerarquía k-FWL
+
observadores más fuertes
+
T4_k 51/51
+
+
+
Involuciones aleatorias
+
invariante: medida del ensemble
+
umbral = medida
+
-
-
-
Use Cases
-
11 domains. Infinite applications.
-
-
Code Audit
13 languages → 12 IR kinds
-
Peptide Design
Zero-toxicity candidates
-
Superconductors
146 candidates >200K
-
Cosmology
6 galaxy types
-
Brain Interfaces
Wilson-Cowan N=4
-
Advanced Materials
GALLOX-1, Adamantium
+
+
+
Cómo se encontró
+
+ El motor propuso y verificó T4 (banco de
+ conjeturas ciego, 68/68), la verificación masiva lo sostuvo y una
+ prueba escrita cerró el caso estándar. Después el laboratorio
+ parametrizó el universo y dejó que los datos eligieran la
+ ley: dos hipótesis humanas fueron refutadas antes de
+ llegar a la caracterización.
+
+
+ Una búsqueda autónoma de construcciones encontró
+ el mejor testigo válido (ciclo, 99.63%) — mejor que
+ la construcción humana. Y los errores quedaron registrados:
+
+
+
1. Multiset de tamaños
+ invariante débil (C6 y 2·C3 lo comparten) → colores.
+
2. Comparar colores entre grafos
+ nunca coinciden → comparar particiones.
+
3. Índices en la coloración inicial
+ trivializaba todo → grados + adyacencias.