asi-polynomial-operads
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseASI 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:
| Pattern | Matter | Runs On |
|---|---|---|
| Interview script | Person | Interview |
| Program | OS | Execution |
| Voting scheme | Voters | Election |
| Game rules | Players | Game |
| Musical score | Performer | Performance |
$$\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:
- $\Omega_n \in S$ for all $n$
- $\mathfrak{P}(a,b) \in S$ for $A, B \in S$ and arrows to $\Omega_n$
最小集合$S$满足:
- 对所有$n$,$\Omega_n \in S$
- 若$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) -- backwardThe 6 wires:
- = observed states (from past)
x - = output states (to future)
y - = utilities received (from future)
r - = back-propagated utilities (to past)
s - = strategies (parameters)
p - = rewards (co-parameters)
q
ParaLens p q x s y r = (get, put)
get : p → x → y -- forward
put : p → x → r → (s, q) -- backward6条连线:
- = 观测状态(来自过去)
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操作子网络
| Operad | Trit | Description |
|---|---|---|
| Little Disks (E₂) | +1 | Non-overlapping disk configurations |
| Cubes (E_∞) | -1 | Infinite-dimensional parallelism |
| Cactus | -1 | Trees with cycles (self-modification) |
| Thread | 0 | Linear continuations + DuckDB |
| Gravity | -1 | Moduli M_{0,n} with involutions |
| Modular | +1 | All genera, runtime polymorphism |
| Swiss-Cheese | +1 | Open/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 | 带环的树(自修改) |
| Thread | 0 | 线性延续 + 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动力操作子
| Operad | Trit | Type |
|---|---|---|
| Directed (⊳) | +1 | Output → Input wiring |
| Undirected (○) | -1 | Interface matching via pullback |
| Machines | 0 | State machines with dynamics |
| Dynamical | +1 | Open ODEs |
| 操作子 | 三元值 | 类型 |
|---|---|---|
| Directed (⊳) | +1 | 输出→输入连线 |
| Undirected (○) | -1 | 通过拉回实现接口匹配 |
| Machines | 0 | 带动力学的状态机 |
| Dynamical | +1 | 开放常微分方程 |
10. General Intelligence Requirements (Swan/Hedges)
10. 通用智能需求(Swan/Hedges)
From "Road to General Intelligence":
来自《通用智能之路》:
Value Proposition
价值主张
General intelligence must:
- Perform work on command — respond to dynamic goal changes
- Scale to real-world concerns
- Respect safety constraints
- Be explainable and auditable
通用智能必须:
- 按需执行任务 —— 响应动态目标变化
- 扩展至现实场景
- 遵守安全约束
- 可解释、可审计
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
因果阶梯
- Observational — statistical learning
- Interventional — setting variables despite natural processes
- Counterfactual — inferences from alternate histories
- 观测层 —— 统计学习
- 干预层 —— 突破自然过程设置变量
- 反事实层 —— 基于替代历史的推理
Lens-Based Abduction
透镜式溯因
| Component | Role |
|---|---|
| get (forward) | Induction / forward inference |
| put (backward) | Abduction / constraint propagation |
| Selection function | Attention mechanism |
| Equilibrium checking | Reflective reasoning |
| 组件 | 作用 |
|---|---|
| get(正向) | 归纳 / 正向推理 |
| put(反向) | 溯因 / 约束传播 |
| 选择函数 | 注意力机制 |
| 均衡检查 | 反思性推理 |
11. Commands
11. 命令
bash
undefinedbash
undefinedRun 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
undefinedjust gf3-verify
undefined12. 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.pylib/
├── 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.py13. References
13. 参考文献
- Spivak, D.I. — Polynomial Functors: A General Theory of Interaction (2022)
- Libkind, S. & Spivak, D.I. — Pattern Runs on Matter (ACT 2024)
- Spivak, D.I. — Dynamical Systems and Sheaves (2019)
- Bumpus, B.M. — Compositional Algorithms on Compositional Data (2024)
- Bumpus, B.M. — Spined Categories (2023)
- Bumpus, B.M. — Cohomology Obstructions (2024)
- Swan, J. & Hedges, J. et al. — The Road to General Intelligence (Springer 2022)
- Hedges, J. — Open Games with Agency (2023)
- Spivak, D.I. — Polynomial Functors: A General Theory of Interaction (2022)
- Libkind, S. & Spivak, D.I. — Pattern Runs on Matter (ACT 2024)
- Spivak, D.I. — Dynamical Systems and Sheaves (2019)
- Bumpus, B.M. — Compositional Algorithms on Compositional Data (2024)
- Bumpus, B.M. — Spined Categories (2023)
- Bumpus, B.M. — Cohomology Obstructions (2024)
- Swan, J. & Hedges, J. et al. — The Road to General Intelligence (Springer 2022)
- Hedges, J. — Open Games with Agency (2023)
14. See Also
14. 相关链接
- — Algebraic databases (schema category)
acsets - — 7 operad variants with GF(3) balance
discohy-streams - — Balanced ternary scheduling
triad-interleave - — Badiou triangle navigation
world-hopping - — Bidirectional transformations
open-games
- — 代数数据库(模式范畴)
acsets - — 符合GF(3)平衡的7种操作子变体
discohy-streams - — 平衡三进制调度
triad-interleave - — Badiou三角导航
world-hopping - — 双向变换
open-games