flow_state_verdict tool v0.1

STEP: 1541 / Test: 43/43 PASS / Lean 4: 10 theorem zero sorry / Type: 状態遷移 arc 第 1 号、 FLOWING primary tool (47 defer 22 番目、 姉妹 tool 25)

★★★ FLOWING primary tool — D-FUMT₈ 24 tool 中で FLOWING (~→) を first-class に emit する 初 tool。 D-FUMT₈ 8 値 primitive 全て が 少なくとも 1 tool で operational 実現される マイルストーン。

目的地への距離時系列 (distances[]) → 到達 / 遷移中 / 発散 / 停滞 verdict。 FLOWING (~→) = 「まだ 遷移中、 destination に 向かっているが 未到達」。

8 case 決定表: invalid → NEITHER / all zero → ZERO already_at_destination / last ≤ tol → TRUE arrived / decreasing → FLOWING ★ in_transition / increasing → FALSE diverging / constant → NEITHER stuck / oscillating net~0 → BOTH / erratic → NEITHER。

❸ 「arrived」 は 「最新観測 (last) が tolerance 以内」 semantic 採用 (control system 直観)。 過去の 大きな距離は 遷移 process の 一部で 「現状」 判定に 影響しない。

決定表

ConditionVerdictReason物理解釈
invalid / n<2 / NaN / negativeNEITHERinvalid_inputデータ不足 / 距離は非負
all distances ≈ 0ZEROalready_at_destinationtrivially 起点 = 終点
last ≤ toleranceTRUEarrived現時点で 到達
strictly decreasing + last > tolFLOWING ★in_transition接近中、 未到達
strictly increasingFALSEdiverging離れている (発散)
constant nonzeroNEITHERstuck停滞 (motion なし)
oscillating (non-mono, net ≈ 0)BOTHoscillatingbounded 振動
erratic (non-mono, drift)NEITHERerratic予測不能

使用例

// 温度制御 (settling 中): FLOWING
flowStateVerdict({ distances: [5.0, 3.0, 1.5, 0.8, 0.4], tolerance: 0.1 });
// { verdict: 'FLOWING', reason: 'in_transition' }

// 学習曲線 (loss 減少 中、 未収束): FLOWING
flowStateVerdict({ distances: [2.5, 1.8, 1.2, 0.9, 0.7, 0.5], tolerance: 0.01 });
// { verdict: 'FLOWING', reason: 'in_transition' }

// PID 到達 (last ≤ tolerance): TRUE
flowStateVerdict({ distances: [10, 5, 2, 0.5, 0.1, 0.05], tolerance: 0.1 });
// { verdict: 'TRUE', reason: 'arrived' }

// Runaway trajectory: FALSE
flowStateVerdict({ distances: [1, 2, 4, 8], tolerance: 0.1 });
// { verdict: 'FALSE', reason: 'diverging' }

// 停滞: NEITHER
flowStateVerdict({ distances: [5, 5, 5, 5], tolerance: 0.01 });
// { verdict: 'NEITHER', reason: 'stuck' }

// Bounded 振動: BOTH
flowStateVerdict({ distances: [5, 3, 6, 4, 5], tolerance: 0.5 });
// { verdict: 'BOTH', reason: 'oscillating' }

Lean 4 (10 theorem zero sorry)

flow_no_data_gives_neither                    : no data → NEITHER
flow_all_zero_gives_zero                      : all zero → ZERO
flow_arrived_gives_true                       : last ≤ tol → TRUE
flow_decreasing_gives_flowing                 : ★ decreasing → FLOWING
flow_increasing_gives_false                   : increasing → FALSE
flow_constant_gives_neither                   : constant → NEITHER
flow_oscillating_gives_both                   : non-mono net~0 → BOTH
flow_erratic_gives_neither                    : non-mono drift → NEITHER
flow_verdict_deterministic                    : idempotent
flow_flowing_requires_decreasing_not_arrived  : ★ FLOWING 排他性 formal 保証

D-FUMT₈ 8 primitive operational 実現 map (2026-08-29 完成)

PrimitiveFirst toolSTEP
TRUEsyntax_verdict 等 (well_formed)1532
FALSEsyntax_verdict 等 (mismatched)1532
NEITHERd8_verdict_from_measurement 等1350
BOTHconservation quasi / oscillating 系1535
ZEROconservation vacuum 系1535
INFINITYconservation unbounded / shannon uniform1535 / 1499
FLOWINGflow_state_verdict (本)1541
SELFhalting / liar / conservation / nash 等 8 tool1524-1535

Non-goal (honest scope)

❶ 完全 dynamical systems formalization 未 embed — 距離時系列 判定 のみ。

❂ Lyapunov exponent 計算 未 (別 STEP 1509 lyapunov_verdict tool の 領域)。

❸ 具体的 physical unit (m / s / K) verification 未 — numerical value のみ (単位一致は caller 責任)。

❹ adaptive tolerance / trajectory prediction 未。

❺ 「arrived」 semantic は control system 直観 (last ≤ tol)、 steady-state observation (max ≤ tol) 別 semantic は 未対応 (別 tool candidate)。

❻ 累計 defer 27 → 26。