asi-polynomial-operads

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

ASI Polynomial Operads Skill

ASI多项式操作子技能

"Pattern runs on matter: The free monad monad as a module over the cofree comonad comonad" — Libkind & Spivak (ACT 2024)
"模式作用于物质:自由单子单子作为余自由余单子余单子上的模块" — Libkind & Spivak(ACT 2024)

1. Polynomial Functors (Spivak)

1. 多项式函子(Spivak)

Core Definition

核心定义

A polynomial functor $p: \text{Set} \to \text{Set}$ is a sum of representables:
$$p \cong \sum_{i \in p(1)} y^{p[i]}$$
Where:
  • $p(1)$ = set of positions (questions, observations)
  • $p[i]$ = set of directions at position $i$ (answers, actions)
多项式函子 $p: \text{Set} \to \text{Set}$ 是可表函子的和:
$$p \cong \sum_{i \in p(1)} y^{p[i]}$$
其中:
  • $p(1)$ = 位置集合(问题、观测)
  • $p[i]$ = 位置$i$处的方向集合(答案、动作)

Morphisms (Dependent Lenses)

态射(依赖透镜)

A lens $f: p \to q$ is a pair $(f_1, f^\sharp)$:
$$f_1: p(1) \to q(1) \quad \text{(on-positions)}$$ $$f^\sharp_i: q[f_1(i)] \to p[i] \quad \text{(on-directions, contravariant)}$$
透镜 $f: p \to q$ 是一对映射 $(f_1, f^\sharp)$:
$$f_1: p(1) \to q(1) \quad \text{(位置映射)}$$ $$f^\sharp_i: q[f_1(i)] \to p[i] \quad \text{(方向映射,反变)}$$

Hom-set Formula

同态集公式

$$\text{Poly}(p, q) \cong \prod_{i \in p(1)} \sum_{j \in q(1)} p[i]^{q[j]}$$
$$\text{Poly}(p, q) \cong \prod_{i \in p(1)} \sum_{j \in q(1)} p[i]^{q[j]}$$

2. Composition Products

2. 组合积

Substitution ($\triangleleft$) — The Module Action

替换($\triangleleft$)——模块作用

$$p \triangleleft q \cong \sum_{i \in p(1)} \sum_{\bar{j}: p[i] \to q(1)} y^{\sum_{a \in p[i]} q[\bar{j}(a)]}$$
Interpretation: Substitute $q$ into each "hole" of $p$.
$$p \triangleleft q \cong \sum_{i \in p(1)} \sum_{\bar{j}: p[i] \to q(1)} y^{\sum_{a \in p[i]} q[\bar{j}(a)]}$$
解释: 将$q$代入$p$的每个“空位”中。

Parallel/Dirichlet ($\otimes$)

并行/狄利克雷积($\otimes$)

$$p \otimes q \cong \sum_{i \in p(1)} \sum_{j \in q(1)} y^{p[i] \times q[j]}$$
Interpretation: Independent parallel execution.
$$p \otimes q \cong \sum_{i \in p(1)} \sum_{j \in q(1)} y^{p[i] \times q[j]}$$
解释: 独立并行执行。

Categorical Product ($\times$)

范畴积($\times$)

$$p \times q \cong \sum_{i \in p(1)} \sum_{j \in q(1)} y^{p[i] + q[j]}$$
$$p \times q \cong \sum_{i \in p(1)} \sum_{j \in q(1)} y^{p[i] + q[j]}$$

3. Free Monad & Cofree Comonad

3. 自由单子与余自由余单子

Cofree Comonad as Limit

余自由余单子作为极限

The carrier $t_p$ of the cofree comonoid on $p$:
$$t_p = \lim \left( 1 \xleftarrow{!} p \triangleleft 1 \xleftarrow{p \triangleleft !} p^{\triangleleft 2} \triangleleft 1 \leftarrow \cdots \right)$$
基于$p$的余自由余幺半群的载体$t_p$:
$$t_p = \lim \left( 1 \xleftarrow{!} p \triangleleft 1 \xleftarrow{p \triangleleft !} p^{\triangleleft 2} \triangleleft 1 \leftarrow \cdots \right)$$

Trees as Positions

树作为位置

$$t_p \cong \sum_{T \in \text{tree}_p} y^{\text{vtx}(T)}$$
  • $\text{tree}_p$ = set of $p$-trees (possibly infinite)
  • $\text{vtx}(T)$ = vertices (rooted paths) of tree $T$
$$t_p \cong \sum_{T \in \text{tree}_p} y^{\text{vtx}(T)}$$
  • $\text{tree}_p$ = $p$-树集合(可能为无限树)
  • $\text{vtx}(T)$ = 树$T$的顶点(有根路径)

Comonoid Structure

余幺半群结构

  • Counit (Extract): $\epsilon_p: t_p \to y$ — picks the root
  • Comultiplication (Duplicate): $\delta_p: t_p \to t_p \triangleleft t_p$ — path concatenation
  • 余单位(提取): $\epsilon_p: t_p \to y$ —— 选取根节点
  • 余乘法(复制): $\delta_p: t_p \to t_p \triangleleft t_p$ —— 路径拼接

Module Action: Pattern Runs On Matter

模块作用:模式作用于物质

$$\Xi_{p,q} : \mathfrak{m}p \otimes \mathfrak{c}q \to \mathfrak{m}(p \otimes q)$$
Where:
  • $\mathfrak{m}p$ = free monad (Pattern, decision trees, wellfounded)
  • $\mathfrak{c}q$ = cofree comonad (Matter, behavior trees, non-wellfounded)
Examples:
PatternMatterRuns On
Interview scriptPersonInterview
ProgramOSExecution
Voting schemeVotersElection
Game rulesPlayersGame
Musical scorePerformerPerformance
$$\Xi_{p,q} : \mathfrak{m}p \otimes \mathfrak{c}q \to \mathfrak{m}(p \otimes q)$$
其中:
  • $\mathfrak{m}p$ = 自由单子(模式、决策树、良基)
  • $\mathfrak{c}q$ = 余自由余单子(物质、行为树、非良基)
示例:
模式物质作用场景
面试脚本面试者面试
程序操作系统执行
投票方案选民选举
游戏规则玩家游戏
乐谱演奏者演出

4. Dynamical Systems (Libkind-Spivak)

4. 动力系统(Libkind-Spivak)

Discrete Dynamical System

离散动力系统

$$f^{upd}: A \times S \to S \quad \text{(update)}$$ $$f^{rdt}: S \to B \quad \text{(readout)}$$
$$f^{upd}: A \times S \to S \quad \text{(更新)}$$ $$f^{rdt}: S \to B \quad \text{(读出)}$$

Continuous Dynamical System

连续动力系统

$$f^{dyn}: A \times S \to TS \quad \text{(dynamics: } \dot{s} = f^{dyn}(a, s) \text{)}$$ $$f^{rdt}: S \to B \quad \text{(readout)}$$
$$f^{dyn}: A \times S \to TS \quad \text{(动力学: } \dot{s} = f^{dyn}(a, s) \text{)}$$ $$f^{rdt}: S \to B \quad \text{(读出)}$$

Wiring Diagram Composition

连线图组合

For $\phi: X \to Y$: $$\phi^{in}: X^{in} \to X^{out} + Y^{in}$$ $$\phi^{out}: Y^{out} \to X^{out}$$
对于$\phi: X \to Y$: $$\phi^{in}: X^{in} \to X^{out} + Y^{in}$$ $$\phi^{out}: Y^{out} \to X^{out}$$

Composed Update

组合更新

$$\bar{f}^{upd}(y, s) := f^{upd}(\phi^{in}(y, f^{rdt}(s)), s)$$ $$\bar{f}^{rdt}(s) := \phi^{out}(f^{rdt}(s))$$
$$\bar{f}^{upd}(y, s) := f^{upd}(\phi^{in}(y, f^{rdt}(s)), s)$$ $$\bar{f}^{rdt}(s) := \phi^{out}(f^{rdt}(s))$$

5. Compositional Algorithms (Bumpus)

5. 组合式算法(Bumpus)

Structured Decomposition

结构化分解

$$d: \int G \to \mathbf{K}$$
Where $\int G$ is the Grothendieck construction.
$$d: \int G \to \mathbf{K}$$
其中$\int G$是Grothendieck构造。

Complexity Bound

复杂度边界

$$O\left(\max_{x \in VG} \alpha(dx) + \kappa^{|S|} \kappa^2\right) |EG|$$
Where:
  • $G$ = shape graph of decomposition
  • $S$ = feedback vertex set
  • $\kappa$ = max local solution space size
  • $\alpha(c)$ = time to compute sheaf on object $c$
$$O\left(\max_{x \in VG} \alpha(dx) + \kappa^{|S|} \kappa^2\right) |EG|$$
其中:
  • $G$ = 分解的形状图
  • $S$ = 反馈顶点集
  • $\kappa$ = 最大局部解空间大小
  • $\alpha(c)$ = 在对象$c$上计算层的时间

Tree-Shaped Bound

树形边界

For tree-shaped decompositions ($|S| = 0$): $$O(\kappa^2) |EG|$$
对于树形分解($|S| = 0$): $$O(\kappa^2) |EG|$$

6. Cohomological Obstructions (Bumpus)

6. 上同调障碍(Bumpus)

Čech Cohomology

切赫上同调

$$H^n(X, \mathcal{U}, F) := \ker(\delta^n) / \text{im}(\delta^{n-1})$$
$$H^n(X, \mathcal{U}, F) := \ker(\delta^n) / \text{im}(\delta^{n-1})$$

Global Existence Constraint

全局存在性约束

$$FX \neq \emptyset \iff H^0(X, \mathfrak{M}F) = 0$$
Interpretation: A problem has a solution iff the zeroth cohomology of its model-collecting presheaf is trivial.
$$FX \neq \emptyset \iff H^0(X, \mathfrak{M}F) = 0$$
解释: 问题有解当且仅当其模型收集预层的0阶上同调是平凡的。

GF(3) Connection

GF(3)关联

While Bumpus uses $\mathbb{Z}[S]$ (free Abelianization), the methods generalize to:
  • $\text{Vect}(\mathbb{F}_3)$ — vector spaces over GF(3)
  • Balanced ternary conservation = cohomological constraint
尽管Bumpus使用$\mathbb{Z}[S]$(自由阿贝尔化),该方法可推广至:
  • $\text{Vect}(\mathbb{F}_3)$ —— GF(3)上的向量空间
  • 平衡三进制守恒 = 上同调约束

7. Spined Categories (Bumpus)

7. 带刺范畴(Bumpus)

Definition

定义

A spined category $(\mathcal{C}, \Omega, \mathfrak{P})$:
  • $\Omega: \mathbb{N}_{=} \to \mathcal{C}$ — the spine functor
  • $\mathfrak{P}$ — proxy pushout operation
带刺范畴$(\mathcal{C}, \Omega, \mathfrak{P})$:
  • $\Omega: \mathbb{N}_{=} \to \mathcal{C}$ —— 刺函子
  • $\mathfrak{P}$ —— 代理推出操作

Proxy Pushout

代理推出

For span $G \xleftarrow{g} \Omega_n \xrightarrow{h} H$: $$G \xrightarrow{\mathfrak{P}(g,h)_g} \mathfrak{P}(g,h) \xleftarrow{\mathfrak{P}(g,h)_h} H$$
对于跨度$G \xleftarrow{g} \Omega_n \xrightarrow{h} H$: $$G \xrightarrow{\mathfrak{P}(g,h)_g} \mathfrak{P}(g,h) \xleftarrow{\mathfrak{P}(g,h)_h} H$$

Chordal Objects (Recursive)

弦对象(递归定义)

Smallest set $S$ where:
  1. $\Omega_n \in S$ for all $n$
  2. $\mathfrak{P}(a,b) \in S$ for $A, B \in S$ and arrows to $\Omega_n$
最小集合$S$满足:
  1. 对所有$n$,$\Omega_n \in S$
  2. 若$A, B \in S$且存在指向$\Omega_n$的态射,则$\mathfrak{P}(a,b) \in S$

Width/Triangulation

宽度/三角化

$$\Delta[X] = \min { \text{width}(\delta) \mid \delta: X \hookrightarrow H \text{ pseudo-chordal}}$$
$$\Delta[X] = \min { \text{width}(\delta) \mid \delta: X \hookrightarrow H \text{ 伪弦} }$$

8. Open Games (Hedges)

8. 开放博弈(Hedges)

Parametrised Lens (Arena)

参数化透镜(竞技场)

ParaLens p q x s y r = (get, put)
  get : p → x → y        -- forward
  put : p → x → r → (s, q)  -- backward
The 6 wires:
  • x
    = observed states (from past)
  • y
    = output states (to future)
  • r
    = utilities received (from future)
  • s
    = back-propagated utilities (to past)
  • p
    = strategies (parameters)
  • q
    = rewards (co-parameters)
ParaLens p q x s y r = (get, put)
  get : p → x → y        -- forward
  put : p → x → r → (s, q)  -- backward
6条连线:
  • x
    = 观测状态(来自过去)
  • y
    = 输出状态(去往未来)
  • r
    = 接收的效用(来自未来)
  • s
    = 反向传播的效用(去往过去)
  • p
    = 策略(参数)
  • q
    = 奖励(余参数)

Sequential Composition

顺序组合

haskell
(MkLens get put) >>>> (MkLens get' put') =
  MkLens
    (\(p, p') x -> get' p' (get p x))           -- compose forward
    (\(p, p') x t ->
      let (r, q') = put' p' (get p x) t         -- future first
          (s, q) = put p x r                     -- then past
      in (s, (q, q')))
Key insight: Backward pass = constraint propagation / abduction.
haskell
(MkLens get put) >>>> (MkLens get' put') =
  MkLens
    (\(p, p') x -> get' p' (get p x))           -- compose forward
    (\(p, p') x t ->
      let (r, q') = put' p' (get p x) t         -- future first
          (s, q) = put p x r                     -- then past
      in (s, (q, q')))
核心洞见: 反向传播 = 约束传播 / 溯因推理。

Equilibrium

均衡

$$E_G(x, k) := \varepsilon_G(x; A_G; k)$$
Where $\varepsilon = \bigotimes_{p \in P} \varepsilon_p$ is the joint selection function.
$$E_G(x, k) := \varepsilon_G(x; A_G; k)$$
其中$\varepsilon = \bigotimes_{p \in P} \varepsilon_p$是联合选择函数。

9. Integration: DiscoHy Operads

9. 整合:DiscoHy操作子

The 7 Operad Network

7操作子网络

OperadTritDescription
Little Disks (E₂)+1Non-overlapping disk configurations
Cubes (E_∞)-1Infinite-dimensional parallelism
Cactus-1Trees with cycles (self-modification)
Thread0Linear continuations + DuckDB
Gravity-1Moduli M_{0,n} with involutions
Modular+1All genera, runtime polymorphism
Swiss-Cheese+1Open/closed for forward-only learning
GF(3) Total: $(+1) + (-1) + (-1) + (0) + (-1) + (+1) + (+1) = 0$ ✓
操作子三元值描述
Little Disks (E₂)+1不重叠圆盘配置
Cubes (E_∞)-1无限维并行性
Cactus-1带环的树(自修改)
Thread0线性延续 + DuckDB
Gravity-1带对合的模空间M_{0,n}
Modular+1所有亏格,运行时多态
Swiss-Cheese+1面向前向学习的开放/封闭结构
GF(3)总和: $(+1) + (-1) + (-1) + (0) + (-1) + (+1) + (+1) = 0$ ✓

Libkind-Spivak Dynamical Operads

Libkind-Spivak动力操作子

OperadTritType
Directed (⊳)+1Output → Input wiring
Undirected (○)-1Interface matching via pullback
Machines0State machines with dynamics
Dynamical+1Open ODEs
操作子三元值类型
Directed (⊳)+1输出→输入连线
Undirected (○)-1通过拉回实现接口匹配
Machines0带动力学的状态机
Dynamical+1开放常微分方程

10. General Intelligence Requirements (Swan/Hedges)

10. 通用智能需求(Swan/Hedges)

From "Road to General Intelligence":
来自《通用智能之路》:

Value Proposition

价值主张

General intelligence must:
  1. Perform work on command — respond to dynamic goal changes
  2. Scale to real-world concerns
  3. Respect safety constraints
  4. Be explainable and auditable
通用智能必须:
  1. 按需执行任务 —— 响应动态目标变化
  2. 扩展至现实场景
  3. 遵守安全约束
  4. 可解释、可审计

Structural Causal Model

结构因果模型

$$X_i = f_i(\text{PA}_i, U_i), \quad i = 1, \ldots, n$$
Where:
  • $\text{PA}_i$ = parent nodes
  • $U_i$ = exogenous noise (jointly independent)
$$X_i = f_i(\text{PA}_i, U_i), \quad i = 1, \ldots, n$$
其中:
  • $\text{PA}_i$ = 父节点
  • $U_i$ = 外生噪声(联合独立)

Ladder of Causality

因果阶梯

  1. Observational — statistical learning
  2. Interventional — setting variables despite natural processes
  3. Counterfactual — inferences from alternate histories
  1. 观测层 —— 统计学习
  2. 干预层 —— 突破自然过程设置变量
  3. 反事实层 —— 基于替代历史的推理

Lens-Based Abduction

透镜式溯因

ComponentRole
get (forward)Induction / forward inference
put (backward)Abduction / constraint propagation
Selection functionAttention mechanism
Equilibrium checkingReflective reasoning
组件作用
get(正向)归纳 / 正向推理
put(反向)溯因 / 约束传播
选择函数注意力机制
均衡检查反思性推理

11. Commands

11. 命令

bash
undefined
bash
undefined

Run polynomial functor demo

Run polynomial functor demo

just poly-functor-demo
just poly-functor-demo

Test free monad / cofree comonad pairing

Test free monad / cofree comonad pairing

just monad-test
just monad-test

Run DiscoHy operads

Run DiscoHy operads

python3 src/operads/relational_operad_interleave.py
python3 src/operads/relational_operad_interleave.py

Run Libkind-Spivak dynamical systems

Run Libkind-Spivak dynamical systems

python3 src/operads/libkind_spivak_dynamics.py
python3 src/operads/libkind_spivak_dynamics.py

Check GF(3) conservation

Check GF(3) conservation

just gf3-verify
undefined
just gf3-verify
undefined

12. File Locations

12. 文件位置

lib/
├── free_monad.rb              # Pattern (decision trees)
├── cofree_comonad.rb          # Matter (behavior trees)
├── runs_on.rb                 # Module action implementation
└── discohy.hy                 # Hy operad implementations

src/music_topos/
├── free_monad.clj             # Clojure Pattern
├── cofree_comonad.clj         # Clojure Matter
├── runs_on.clj                # Module action
└── operads/
    ├── relational_operad_interleave.py
    ├── libkind_spivak_dynamics.py
    └── infinity_operads.py

scripts/
├── discohy_operad_1_little_disks.py
├── discohy_operad_2_cubes.py
├── discohy_operad_3_cactus.py
├── discohy_operad_4_thread.py
├── discohy_operad_5_gravity.lisp
├── discohy_operad_6_modular.bb
└── discohy_operad_7_swiss_cheese.py
lib/
├── free_monad.rb              # Pattern (decision trees)
├── cofree_comonad.rb          # Matter (behavior trees)
├── runs_on.rb                 # Module action implementation
└── discohy.hy                 # Hy operad implementations

src/music_topos/
├── free_monad.clj             # Clojure Pattern
├── cofree_comonad.clj         # Clojure Matter
├── runs_on.clj                # Module action
└── operads/
    ├── relational_operad_interleave.py
    ├── libkind_spivak_dynamics.py
    └── infinity_operads.py

scripts/
├── discohy_operad_1_little_disks.py
├── discohy_operad_2_cubes.py
├── discohy_operad_3_cactus.py
├── discohy_operad_4_thread.py
├── discohy_operad_5_gravity.lisp
├── discohy_operad_6_modular.bb
└── discohy_operad_7_swiss_cheese.py

13. References

13. 参考文献

  1. Spivak, D.I.Polynomial Functors: A General Theory of Interaction (2022)
  2. Libkind, S. & Spivak, D.I.Pattern Runs on Matter (ACT 2024)
  3. Spivak, D.I.Dynamical Systems and Sheaves (2019)
  4. Bumpus, B.M.Compositional Algorithms on Compositional Data (2024)
  5. Bumpus, B.M.Spined Categories (2023)
  6. Bumpus, B.M.Cohomology Obstructions (2024)
  7. Swan, J. & Hedges, J. et al.The Road to General Intelligence (Springer 2022)
  8. Hedges, J.Open Games with Agency (2023)
  1. Spivak, D.I.Polynomial Functors: A General Theory of Interaction (2022)
  2. Libkind, S. & Spivak, D.I.Pattern Runs on Matter (ACT 2024)
  3. Spivak, D.I.Dynamical Systems and Sheaves (2019)
  4. Bumpus, B.M.Compositional Algorithms on Compositional Data (2024)
  5. Bumpus, B.M.Spined Categories (2023)
  6. Bumpus, B.M.Cohomology Obstructions (2024)
  7. Swan, J. & Hedges, J. et al.The Road to General Intelligence (Springer 2022)
  8. Hedges, J.Open Games with Agency (2023)

14. See Also

14. 相关链接

  • acsets
    — Algebraic databases (schema category)
  • discohy-streams
    — 7 operad variants with GF(3) balance
  • triad-interleave
    — Balanced ternary scheduling
  • world-hopping
    — Badiou triangle navigation
  • open-games
    — Bidirectional transformations
  • acsets
    — 代数数据库(模式范畴)
  • discohy-streams
    — 符合GF(3)平衡的7种操作子变体
  • triad-interleave
    — 平衡三进制调度
  • world-hopping
    — Badiou三角导航
  • open-games
    — 双向变换