# DMSD Phase 3A — Prime Layer Baseline

**日期：** 2026-09-30  
**狀態：** COMPLETE  
**定位：** 第一個允許 `UNKNOWN` 成為正式數學狀態的 DMSD property layer

---

## 1. 為什麼 Prime Layer 和前面不同

前面三類 property：

### Parity

\[
S(B)
\]

可由區間端點直接精確計算。

### Residue

\[
V_m(B)
\]

可由 quotient/remainder 直接精確計算。

### Square

\[
C_\square(a,b)
=
\lfloor\sqrt{b-1}\rfloor-\lfloor\sqrt{a-1}\rfloor
\]

可由 integer-square-root boundary 精確計算。

Prime baseline 不預設存在同類型的 compact exact block operator。

因此，DMSD 必須第一次明確區分：

\[
\boxed{
\text{Represented Block}
\neq
\text{Known Exact Property Summary}
}
\]

---

## 2. PrimeSummary State

本輪定義：

```text
EXACT_COMPUTED
EXACT_MERGED
UNKNOWN
```

### EXACT_COMPUTED

完整 interval 已依登記方法精確計算。

### EXACT_MERGED

parent 的全部 children 都已 exact，因此 parent summary 可由 merge operator 精確重建。

### UNKNOWN

DMSD 知道這個 block 存在，但目前沒有 admitted exact prime summary。

這不是 false，也不是 zero。

它就是：

\[
\boxed{
\text{UNKNOWN}.
}
\]

---

## 3. 本輪 exact computation boundary

本地 reference sieve：

\[
0\le n\le10^7.
\]

因此完整計算：

\[
L_k=[10^k,10^{k+1})
\]

對：

\[
0\le k\le6
\]

得到 exact summaries。

| \(k\) | interval | prime count |
|---:|---|---:|
| 0 | \([1,10)\) | 4 |
| 1 | \([10,100)\) | 21 |
| 2 | \([100,1000)\) | 143 |
| 3 | \([10^3,10^4)\) | 1,061 |
| 4 | \([10^4,10^5)\) | 8,363 |
| 5 | \([10^5,10^6)\) | 68,906 |
| 6 | \([10^6,10^7)\) | 586,081 |

對：

\[
k\ge7
\]

本輪 baseline 不填 count：

```text
UNKNOWN
```

重要的是：這只是**目前 runtime / validation boundary**，不是任何「數學上無法計算」的宣稱。

---

## 4. 驗證結果

本輪完成：

```text
Exact scale layers:                    7
Hierarchy merge checks:                7
Nested exact refinement trials:      250
Independent trial-division oracles:  300
```

全部：

```text
PASS
```

獨立 oracle 在小區間逐一 trial division，
再與 sieve summary 比較。

---

## 5. PrimeSummary

本輪最小 summary：

\[
S_{\mathbb P}(B)
=
(
\sigma,
C,
p_{\min},
p_{\max},
M,
\Gamma
)
\]

其中：

- \(\sigma\)：knowledge state；
- \(C\)：prime count；
- \(p_{\min}\)：first prime；
- \(p_{\max}\)：last prime；
- \(M\)：method；
- \(\Gamma\)：coverage / provenance。

若：

\[
\sigma=\texttt{UNKNOWN},
\]

則 \(C,p_{\min},p_{\max}\) 必須保持未填值。

---

## 6. Prime Merge Algebra

若：

\[
B=\bigsqcup_iB_i
\]

且**所有** children 都 exact，則：

\[
C(B)=\sum_i C(B_i).
\]

first prime 為第一個 non-empty child 的 first prime；

last prime 為最後一個 non-empty child 的 last prime。

因此：

\[
\boxed{
S_{\mathbb P}(B)
=
\bigoplus_i S_{\mathbb P}(B_i)
}
\]

但只有：

\[
\forall i,\quad \sigma(B_i)\in
\{\texttt{EXACT\_COMPUTED},\texttt{EXACT\_MERGED}\}
\]

時才允許升格。

若有任一：

\[
\sigma(B_i)=\texttt{UNKNOWN},
\]

則不能由 children 證明 parent exact。

---

## 7. Knowledge-State Monotonicity

DMSD 現在可以區分數域 refinement 與知識 refinement。

空間上：

\[
B\rightarrow B_1,\ldots,B_m.
\]

知識上可能是：

```text
UNKNOWN parent
→ UNKNOWN children
→ compute selected children
→ EXACT_COMPUTED children
→ all children closed
→ EXACT_MERGED parent
```

因此 DMSD 不只具有 resolution tree，
也開始具有：

\[
\boxed{
\text{Knowledge-State Tree}.
}
\]

---

## 8. 這次最重要的改變

在前面的 property 中，全域 block 可以先有 exact summary。

Prime baseline 則允許：

\[
10^{100}
\]

級 represented scale 存在，同時：

```text
prime_count = UNKNOWN
```

這使 DMSD 第一次真正做到：

\[
\boxed{
\text{Representation Capacity}
\neq
\text{Knowledge Capacity}
\neq
\text{Current Compute Capacity}.
}
\]

三者分離。

---

## 9. 為什麼不能用估計值填進去

可以存在：

\[
\pi(x)\sim\frac{x}{\log x}
\]

等漸近資訊。

但本輪刻意不把 approximation 填入：

```text
EXACT prime count
```

欄位。

如果未來加入估計層，至少必須新增：

```text
ESTIMATED
interval / error model
method
scope
```

而不能把：

\[
\text{estimate}
\]

改名為：

\[
\text{exact}.
\]

---

## 10. 為什麼 probable prime 也沒有偷渡

同理，本輪不把對任意巨大整數的 probable-prime result 自動標成：

```text
EXACT CERTIFIED PRIME
```

若未來引入 probabilistic / probable-prime layer，必須明示：

```text
PROBABLE
algorithm
bases
error assumptions
scope
```

若要升格 exact certificate，則必須有相應 proof object / deterministic guarantee。

---

## 11. Lazy Computation MVP

`DMSD_Phase3A_PrimeBaseline_MVP.html` 支援：

- Kmax 到 100；
- Pyramid / Staircase；
- upward / downward traversal；
- scale-level known / unknown visual distinction；
- L0–L6 cached exact summaries；
- huge scales preserved as UNKNOWN；
- local lazy refinement；
- 小 interval on-demand segmented sieve；
- exact children → EXACT_MERGED parent；
- 任一 child UNKNOWN → parent merge remains UNKNOWN。

Browser MVP 的 local exact envelope 暫定：

```text
b ≤ 10^7
span ≤ 250,000
```

這是工程安全限制，不是數學邊界。

---

## 12. Prime Layer 的第一個 DMSD 原則

### No False Closure Principle

\[
\boxed{
\text{No certificate / no complete computation}
\Rightarrow
\text{do not mark exact}.
}
\]

這個原則對 prime 特別重要，但其實可以推廣到所有 future property layers。

---

## 13. 三種不同的 Closure

現在可以區分：

### Domain Closure

目前 runtime 表示到哪裡？

例如：

\[
K_{\max}=100.
\]

### Resolution Closure

哪些 block 已展開到多細？

### Knowledge Closure

哪些 block 已有足以標記 exact 的 property summary？

因此：

\[
\boxed{
\text{Domain Closure}
\neq
\text{Resolution Closure}
\neq
\text{Knowledge Closure}.
}
\]

這可能是 DMSD 到 Prime Layer 後最重要的結構性分化之一。

---

## 14. 與前一條質數研究線的關係

這裡暫時不使用先前 SDRPC 的 source-insufficiency conjecture 作為 Prime Layer 的前提。

DMSD 只做更保守的事情：

> 如果目前沒有 compact exact summary operator，就誠實保留 UNKNOWN，直到 computation、certificate 或新的 mathematical operator 提供 closure。

所以未來若真的找到新的質數 exact summary mechanism，DMSD 可以直接把它註冊成新的 property operator。

架構本身不預判它不存在。

---

## 15. 下一步

下一輪最值得做：

# DMSD Phase 3B — Prime Multiscale Local Structure

但仍應保持有限驗證：

- exact computed scales；
- normalized prime density；
- prime local-position histograms；
- center-relative distribution；
- staircase gap summaries；
- refinement convergence；
- representation artifact controls。

這一輪才開始「看」質數。

Phase 3A 的工作只是先確保：

\[
\boxed{
\text{我們不會把沒算過的東西假裝成已經知道。}
}
\]

---

## 16. 結論

Prime Layer Baseline 成立：

\[
\boxed{
\text{Huge represented domain}
+
\text{partial exact knowledge}
+
\text{explicit unknown regions}
+
\text{lazy local computation}
}
\]

可以同時存在。

前面 DMSD 的核心是：

\[
\text{Represented Range}
\neq
\text{Materialized Elements}.
\]

現在再增加：

\[
\boxed{
\text{Represented Range}
\neq
\text{Known Mathematical State}.
}
\]

這使 DMSD 從 multiscale visualization / summary runtime，
進一步變成：

\[
\boxed{
\text{Multiscale Epistemic Mathematical Runtime}.
}
\]

---

```text
DMSD Phase 3A: COMPLETE
Validation: PASS

Next:
DMSD Phase 3B — Prime Multiscale Local Structure
```
