# DMSD Phase 2A — Parity Property Layer

**日期：** 2026-09-30  
**狀態：** COMPLETE  
**目的：** 驗證 DMSD Core 能否疊加第一個 exact property layer，而不破壞 multiscale / lazy-expansion 架構。

---

## 1. 本輪不是研究奇偶數

Parity 只作為最乾淨的 property-layer control。

要驗證的是：

\[
oxed{	ext{DMSD Core}+	ext{Property Layer}}
\]

是否可以在極大 represented range 下仍維持：

- 不逐元素實體化；
- exact summary；
- lazy local refinement；
- parent / children property conservation；
- Pyramid / Staircase state sharing。

## 2. Exact interval summary

對半開區間 \([a,b)\)，令 \(N=b-a\)。偶數個數直接由端點得到：

\[
E(a,b)=\left\lfloorrac{b-1}{2}ightfloor-\left\lfloorrac{a-1}{2}ightfloor.
\]

奇數個數：

\[
O(a,b)=N-E(a,b).
\]

因此 property summary 的成本與區間實際元素數無關。DMSD 可以表示 \([10^{100},10^{101})\)，而不需要列舉其中任何一個整數。

## 3. 驗證結果

- Scale checks：**101 / 101 PASS**，覆蓋 \(0\le k\le100\)。
- Hierarchy checks：**7 / 7 PASS**，包含 \(k=100\)。
- Deterministic random nested refinement：**200 / 200 PASS**，深度 1–5。

每次 refinement 均檢查：

\[
O(B)=\sum_iO(B_i),\qquad E(B)=\sum_iE(B_i).
\]

## 4. 第一個 DMSD refinement invariant

若區塊被不相交分割：

\[
B=igsqcup_iB_i,
\]

對可加總的 property summary \(S\)：

\[
oxed{S(B)=\sum_iS(B_i)}.
\]

Parity 中：

\[
S(B)=(O(B),E(B)).
\]

這可作為 lazy refinement 的 correctness certificate。

## 5. MVP 功能

`DMSD_Phase2A_Parity_MVP.html` 提供：

- Kmax 最高 100；
- Pyramid / Staircase；
- 小→大 / 大→小 traversal；
- Property Layer On / Off；
- exact odd/even block summary；
- Lazy local refinement；
- parent / children conservation certificate；
- BigInt 大整數區間；
- 不預先 materialize 全域數列。

## 6. 本輪真正得到的結果

\[
oxed{	ext{Property computation}
eq	ext{element materialization}}
\]

至少對 parity 這類具有解析區間摘要的 property，DMSD 可以在 block level 直接保持精確資訊。

因此 DMSD 開始從單純 Visual LOD 變成：

\[
oxed{	ext{Mathematical Level of Detail}}
\]

不同解析度可以攜帶不同層級、但仍精確的數學摘要。

## 7. Property summary 類型草案

後續可區分：

1. **Type A — Exact analytic summary**：不用枚舉即可精確計算，例如 parity、固定 residue counts。
2. **Type B — Recursive/composable summary**：parent 與 children 可透過摘要合成。
3. **Type C — Computed local summary**：必須展開指定區域計算。
4. **Type D — Approximate summary**：粗尺度只能估計，必須附 error / certificate。

因此未來 DMSD block state 可以同時記錄：

\[
oxed{	ext{Resolution}+	ext{Exactness Class}+	ext{Certificate}}.
\]

## 8. 下一輪

下一輪最自然的是：

**DMSD Phase 2B — Residue Layers**

先加入：

\[
nmod3,\quad nmod5,\quad nmod10.
\]

用來測試多分類 property vector、refinement conservation，以及十進制 representation artifact 是否開始顯現。

---

```text
DMSD Phase 2A: COMPLETE
Validation: PASS
Next: Phase 2B — Residue Layers
```
