STEP 1905 · 2026-09-08 · rei-aios-ab
Unit dispatch decoder (UnaryUnit ↔ LogScaleUnit の 2-way) + SELF⟲ recursive decoder — 両 file sorry 0、 axiom profile [propext] only 中心 + funext 由来 4 件 [propext, Quot.sound] は 命題 が stream 等号 を 要求 する ため の 代価 (機械的除去可能 だが 意図的保持、 下記 由来分類 参照)。 STEP 1904 の Level 1-5a stack に Level 4b + 5b を 追加、 累積 9 files / 100+ declarations。
UnaryUnit + LogScaleUnit の 2-way disambiguation via 2 cross-encoding lemmas
Level 4 (STEP 1901) の encodeUnit に 対する decoder。 「try unary → fall back to log」 の 直列 dispatch:
def decodeUnit (tokens : List Token) : Option Unit :=
match decodeUnary tokens with
| some u => some (Unit.unary u)
| none =>
match decodeLogScale tokens with
| some u => some (Unit.log u)
| none => none
Cross-encoding lemma 核心 (紙上の 決定的 相違 tokens):
decodeLogScale_encodeUnary : ∀ u, decodeLogScale (encodeUnary u) = none — encodeUnary tokens ⊂ {Token.neg, Token.o, Token.zero, Token.pct} = Token.dot 無し、 decodeLogScale が 要求する readDigitsUntilDot rest3 = (_, Token.dot :: _) は 必ず faildecodeUnary_encodeLogScale : ∀ u, decodeUnary (encodeLogScale u) = none — encodeLogScale の rest3 位置 は digit^b_digits ++ [Token.dot] ++ ... = Token.digit or Token.dot 有り、 decodeUnary の countLeadingO rest3 = (_, []) or (_, Token.pct :: _) は 必ず failProof strategy: 2 helper lemma で decodeXxxAfterNeg の 具体形 に 対する none 主張 を 一括証明 (countLeadingO_replicate_then_zero 適用 + cases b + List.replicate_succ + rfl)、 main lemma は 4 case × cases a (0/succ) で show 経由 helper に 還元。
Roundtrip: decodeUnit_encodeUnit は cross-encoding lemma を rw で 適用 + rw [decodeLogScale_encodeLogScale] で 1 pass 完成。
ClsSelf 構造再帰 decoder + 二重帰納 roundtrip
Level 5a (STEP 1902) の ClsSelf inductive + encodeClsSelf に 対する 構造再帰 decoder:
def decodeClsSelf : List Token → Option ClsSelf
| [] => some (ClsSelf.leaf [])
| Token.digit d :: rest =>
match decodeClsSelf rest with
| some (ClsSelf.leaf ds) => some (ClsSelf.leaf (d :: ds))
| some (ClsSelf.recur ds inner) => some (ClsSelf.recur (d :: ds) inner)
| none => none
| Token.dot :: rest =>
match decodeClsSelf rest with
| some inner => some (ClsSelf.recur [] inner)
| none => none
| _ => none
構造再帰 (Token.digit / Token.dot prefix で rest に 再帰、 rest.length は 決定的に減少)。 spec §1.1 「.n 内部に .m = SELF⟲ 埋め込み」 の 再帰的 parsing。
Roundtrip: 二重帰納
ClsSelf induction (leaf / recur)unfold decodeClsSelf + rw [ih] の 二回転で完成SelfLog decoder = Level 3b pattern + decodeClsSelf 統合、 rest6 の cls parsing だけ decodeClsSelf 差し替え。 Roundtrip は Level 3b の 4 case pattern + 最後 decodeClsSelf_encodeClsSelf の 一発適用。
全 19 declarations = 15 [propext] + 4 [propext, Quot.sound]。分類は 数 でなく 由来 (下記 由来分類 参照)
propext = Prop への simp/rw から 遍在、 個別 の 意味 なし。Quot.sound = 関数・ストリーム等号 を 述べる 命題 に 固有、 funext 由来、 その 命題 を 保つ 限り 除去不可。[propext, Quot.sound] は 機械的 に は 除去可能 だが 意図的 に 保持:_roundtrip_eq × 2: 主張 が (fun n => ...) = s (stream 等号 = 関数等号)、 funext は 命題 の 代価。 削除 すれば axiom ではなく 命題 の 方 が 消える (「測定対象 を 削って 計器 を 緑 に する」 pattern、 STEP 1608 候補 F 撤回 と 同型)。 pointwise 版 (_roundtrip_pointwise) は 別命題 (∀ n, ...) で 独立 に [propext] only 保持。A2_holds_full + A2_holds_self: A2_deterministic_* predicate が stream 等号 で 決定性 を 述べる 自然な 定式化。 pointwise predicate に spec 変更する 独立 の 理由 (「A2 の 意味 が そもそも pointwise だった」 等) が 存在しない → 変更動機 は axiom 数 のみ = 計器合わせ、 保持。| File | declaration | Axioms |
|---|---|---|
| Level 4b | decodeLogScale_encodeUnary | [propext] |
decodeUnary_encodeLogScale | [propext] | |
decodeUnit | [propext] | |
zceDecodeFull | [propext] | |
decodeUnit_encodeUnit | [propext] | |
zceEncodeFull_zceDecodeFull_roundtrip_pointwise | [propext] | |
encodeUnit_injective | [propext] | |
zceEncodeFull_zceDecodeFull_roundtrip_eq | [propext, Quot.sound] | |
A2_holds_full | [propext, Quot.sound] | |
| Level 5b | decodeClsSelf | [propext] |
decodeClsSelf_encodeClsSelf | [propext] | |
decodeSelfLogAfterNeg | [propext] | |
decodeSelfLog | [propext] | |
zceDecodeSelfLog | [propext] | |
decodeSelfLog_encodeSelfLog | [propext] | |
zceEncodeSelfLog_zceDecodeSelfLog_roundtrip_pointwise | [propext] | |
encodeSelfLog_injective | [propext] | |
zceEncodeSelfLog_zceDecodeSelfLog_roundtrip_eq | [propext, Quot.sound] | |
A2_holds_self | [propext, Quot.sound] |
| Level | Content | STEP | sorry | Axiom footprint |
|---|---|---|---|---|
| 1 | Unary structural + witnesses | 1893, 1897 | 0 | [propext] |
| 2 | Unary decoder + roundtrip + A2 | 1896, 1897 | 0 | [propext] + Quot.sound (eq) |
| 3 | LogScale structural + witnesses | 1898 | 0 | [propext] + Quot.sound (eq) |
| 3b | LogScale decoder + roundtrip + A2 | 1899 | 0 | [propext] + Quot.sound (eq) |
| 4 | Full Unit inductive structural | 1901 | 0 | [propext] + Quot.sound (eq) |
| 4b | Unit dispatch decoder + cross-encoding | 1905 | 0 | [propext] + Quot.sound (eq) |
| 5a | ClassSuffix inductive + non-trivial B3 | 1902 | 0 | [propext] + Quot.sound (eq) |
| 5b | SELF⟲ recursive decoder + roundtrip | 1905 | 0 | [propext] + Quot.sound (eq) |
Level 1-5b 各 Level 自身の scope で 完成。 完全 stack: 9 files + 100+ declarations / sorry 0 / [propext] 中心。 藤本さん directive chain 14 段実行完了 (1883/84 → ... → 1904 → 1905)。
「Level 4b 完成」 の scope 明示 (藤本さん 2026-09-09 指摘 対応): Level 4b の 定理 の scope は UnaryUnit ↔ LogScaleUnit の 2-way dispatch であり、 この scope で 完全に 完成。 SELF⟲ 有り LogScaleSelfUnit を含む 3-way dispatch (UnaryUnit + LogScaleUnit + LogScaleSelfUnit) は Level 6 別 arc、 これは Level 4b の 未完成 では なく scope 外。
ZCE の 内部で 版番号 axis が 2 系統 に 割れている ため、 記述時 は 常に axis prefix を 明示:
v0.4 phase 2b / v0.4 phase 2c — ZceLedgerPartition / ZceShannon / ZceGibbs 系Level 1 ~ Level 5b — ZceLevel* 系 (本 STEP 対象)「ZCE の 2b」 と 単独記述 すると phase 2b / Level 3b / Level 4b の どれ か 曖昧化。 常に phase v0.4.2b or Level 3b の 形 で prefix 明示 (藤本さん 2026-09-09 指摘)。