# X4-DMSD P3：Ratio / Valuation / Modular Signature Engine

**Huge-Scale-Ready Exact Signatures for X4 Coupling Search**

版本：v0.1  
系列：X4-DMSD  
階段：P3  
性質：Exact ratio key／prime valuation signature／projective modular signature／DMSD handoff  
Canonical source：UTF-8 Markdown

---

## 摘要

X4-DMSD P2 已將三 face joint coupling：

$$
ACB'=BC'A'
$$

改寫成 exact equi-join：

$$
\frac{B'}{C'}=\frac{BA'}{AC}.
$$

P3 將 required ratio 拆成三層：

$$
\boxed{
\text{valuation signature}
\rightarrow
\text{projective modular signature}
\rightarrow
\text{exact reduced ratio}.
}
$$

前兩層只作 sound rejection，最後仍以 exact reduced integer pair 為 theorem gate。

prototype 使用：

$$
\mathcal P_V=\{2,3,5,7,11,13,17,19\},
$$

以及：

$$
\mathcal P_M=\{101,103,107,109\}.
$$

在同一個：

$$
m\le80
$$

corpus 中有：

$$
N=2628
$$

個 oriented joints與：

$$
6,906,384
$$

個 pair queries。

valuation gate 後剩：

$$
150,084
$$

個 pair。

valuation + projective-mod signature 後只剩：

$$
\boxed{
288
}
$$

個 pair需要建立 exact reduced-ratio key。

因此：

$$
\boxed{
99.995830\%
}
$$

的 pair queries 在 exact ratio construction 前已被 sound-reject。

最後 exact compatible oriented triples仍然是：

$$
\boxed{288}.
$$

在 $m\le15$ 與 $m\le30$ 的完整 exact Fraction cross-check 中，raw compatible count完全一致。

---

# 1. Exact Ratio Key

required ratio：

$$
R_{\mathrm{req}}=\frac{BA'}{AC}.
$$

P3 不把 runtime-specific `Fraction` 當 canonical theorem key，而定義：

$$
\boxed{
K_R=(n_R,d_R)
}
$$

其中：

$$
\gcd(n_R,d_R)=1,
\qquad
d_R>0.
$$

---

# 2. Cross-GCD Cancellation

先令 numerator factors：

$$
[B,A']
$$

與 denominator factors：

$$
[A,C].
$$

在乘法前反覆：

$$
g_{ij}=\gcd(n_i,d_j)
$$

並交叉除去。

最後才乘剩餘 factors。

核心原則：

$$
\boxed{
\text{cancel before multiply}.
}
$$

---

# 3. Prime-Valuation Signature

對：

$$
R=\frac nd
$$

定義：

$$
\nu_p(R)=v_p(n)-v_p(d).
$$

selected-prime signature：

$$
\boxed{
V(R)=(\nu_p(R))_{p\in\mathcal P_V}.
}
$$

---

# 4. Raw Factors 可直接算 Valuation

對 required ratio：

$$
\boxed{
\nu_p(R_{\mathrm{req}})
=
v_p(B)+v_p(A')-v_p(A)-v_p(C).
}
$$

完全不需要先建立：

$$
BA'
$$

或：

$$
AC.
$$

---

# 5. Valuation Mismatch Soundness

如果某 prime：

$$
p
$$

有：

$$
\nu_p(R_1)\neq\nu_p(R_2),
$$

則：

$$
R_1\neq R_2.
$$

所以 valuation mismatch 可以 exact reject。

但 valuation match只代表 `POSSIBLE`。

---

# 6. Projective Modular Signature

普通：

$$
nd^{-1}\pmod p
$$

遇到：

$$
p\mid d
$$

會失效。

因此使用：

$$
\boxed{
[n:d]\in\mathbb P^1(\mathbb F_p).
}
$$

三種 canonical state：

- finite；
- zero；
- infinity。

---

# 7. Required Projective State 也不需 Full Product

先計算：

$$
e_p
=
v_p(B)+v_p(A')-v_p(A)-v_p(C).
$$

若：

$$
e_p>0,
$$

projective state為 zero。

若：

$$
e_p<0,
$$

為 infinity。

若：

$$
e_p=0,
$$

只需各 factor 除去 $p$-power 後的 unit residue。

---

# 8. Modular Mismatch Soundness

如果兩 ratios在某：

$$
\mathbb P^1(\mathbb F_p)
$$

投影不同，

則原 rational ratios必不同。

所以：

$$
\boxed{
\text{projective-mod mismatch}
\Rightarrow
\text{exact inequality}.
}
$$

---

# 9. Combined Signature

定義：

$$
\boxed{
\Sigma_R=(V(R),M(R)).
}
$$

target joints預先建立：

$$
\Sigma_R
\mapsto
\text{support}.
$$

pair-required signature若不在 support中，直接 reject。

---

# 10. Three-Stage Join

### Gate 1

valuation support。

### Gate 2

projective modular support。

### Gate 3

exact reduced integer ratio。

只有 Gate 3能宣稱 exact match。

---

# 11. M80 Benchmark

pair count：

$$
6,906,384.
$$

valuation survivors：

$$
150,084.
$$

combined signature survivors：

$$
288.
$$

exact-key avoidance fraction：

$$
0.999958299452.
$$

即：

$$
\boxed{
99.995830\%
}
$$

的 pair不需要建立 exact ratio key。

---

# 12. Final Match Preservation

P3 最終仍輸出：

$$
288
$$

個 raw compatible triples，

與 P2完全相同。

因此 signature layer沒有改變 solution semantics。

---

# 13. Completeness Cross-Check

P3 對：

$$
M=15
$$

與：

$$
M=30
$$

使用 generic Fraction engine完整 cross-check。

結果 raw compatible triple counts全部一致。

---

# 14. DMSD Block Handoff

block summary可保存：

$$
\mathcal R(B)
$$

exact ratio support，

$$
\mathcal V(B)
$$

valuation support，

以及：

$$
\mathcal M(B)
$$

projective modular support。

---

# 15. Sound Hyperblock Pruning

若 pair blocks產生的 required signature support：

$$
\Sigma_{\mathrm{req}}
$$

與 target block support：

$$
\Sigma_{\mathrm{target}}
$$

滿足：

$$
\boxed{
\Sigma_{\mathrm{req}}
\cap
\Sigma_{\mathrm{target}}
=
\varnothing,
}
$$

則整個 hyperblock可 sound-prune。

---

# 16. Summary Hierarchy

理想 DMSD block summary：

$$
\boxed{
\text{valuation support}
\supseteq
\text{modular support}
\supseteq
\text{exact ratio support}.
}
$$

越前面的層越便宜但越粗。

---

# 17. Signature Collision

不同 exact ratios可能具有相同有限 signature。

這只會造成多做 exact gate，

不會造成 theorem false positive。

---

# 18. Signature False Negative

相等 rational ratios必具有相同：

- all prime valuations；
- all projective modular images。

所以如果 equal ratio被 signature mismatch reject，就是 implementation bug。

這可直接作 property-based invariant。

---

# 19. Cross-Language Serialization

valuation signature：

```text
[e_2,e_3,e_5,...]
```

projective residue：

```text
F(value)
Z
I
```

exact ratio：

```text
[num,den]
```

均可 deterministic serialize。

---

# 20. Rust-Friendly Model

```text
RatioKey {
    num: BigUint,
    den: BigUint
}
```

```text
ValuationSig {
    exponents: Vec<i32>
}
```

```text
P1Residue {
    Finite(u64),
    Zero,
    Infinity
}
```

---

# 21. Adaptive Prime Selection

P3 的 prime sets只是 prototype choice。

正式 DMSD可依 block distribution選擇 discriminative power較高的 primes。

但 prime selection只能影響效率，不能影響 exact completeness。

---

# 22. Monotone Refinement

如果 parent block：

$$
B
$$

refine成：

$$
B_1,\ldots,B_k,
$$

則 child support應：

$$
\mathcal S(B_i)\subseteq\mathcal S(B).
$$

若 summary宣稱 exact coverage：

$$
\mathcal S(B)
=
\bigcup_i\mathcal S(B_i).
$$

---

# 23. Huge-Scale 意義

P2 還是每一 pair都建立 exact rational query。

P3 第一次證明：

$$
\boxed{
\text{很多 pair 在 full exact ratio 生成前就可被 exact necessary signatures排除。}
}
$$

這是 DMSD block summary的直接前置條件。

---

# 24. P3 核心結果

### P3-R1

canonical exact ratio改用 reduced integer pair。

### P3-R2

cross-GCD cancellation限制 intermediate multiplication。

### P3-R3

valuation signature可由 raw factors直接計算。

### P3-R4

projective modular signature可 sound處理 denominator divisible primes。

### P3-R5

signature mismatch是 sound rejection。

### P3-R6

M80 exact-key avoidance：

$$
\boxed{
99.995830\%
}.
$$

### P3-R7

final exact matches仍為：

$$
288.
$$

---

# 25. Claim Boundary

P3 不宣稱：

- selected primes在所有 scale最優；
- exact-key avoidance比例會外推到巨大 scale；
- DMSD multiscale compression已完成；
- total runtime一定優於 P2；
- Perfect Cuboid已找到。

---

# 26. 下一階段

**X4-DMSD P4 — Multiscale Block Semantics and Sound Hyperblock Pruning**

下一步正式建立：

1. decimal seed-height blocks；
2. exact block coverage；
3. valuation support summary；
4. modular support summary；
5. pair-required block support；
6. hyperblock intersection；
7. `IMPOSSIBLE` certificate；
8. lazy refinement；
9. parent/child merge validation；
10. first real scale-jump experiment。

P4 才是 X4-DMSD 真正進入「不用展開整個巨大 domain」的階段。
