Normalize kernel expressions when comparing two automata port by port

未关闭
#395 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
54/100
Issue 类型
功能
描述清晰度
描述清楚
活跃度
活跃

调研方向

Start in src/Probability/ and read the existing ProbDist rewrite lemmas named in the issue, then inspect the automaton and product step definitions referenced by #221 and #223. Implement kernel_nf with the specified fixed rewrite list and add the cited state-map and product-step lemmas. Done means the side-by-side automata equality closes port by port and the tactic handles both pushforward examples.

由索引模型根据 Issue 内容生成。

描述

Background

By #221, two automata on one interface are one system when a state map $f$ carries each step of the first to the step of the second:

\big(\mathrm{step}_1(s,i,x)\big).\mathrm{map}\,(f\times\mathrm{id})=\mathrm{step}_2(f\,s,i,x)\qquad\text{for every port } i .

The hypothesis is one identity of kernels per port. After the two steps are unfolded, both sides are built from ProbDist.map, ProbDist.bind and ProbDist.single, and differ only in how the pushforwards are nested. A fixed rewriting brings both to one form:

(P.map g).map f   = P.map (f ∘ g)                   ProbDist.map_map
(P.bind k).map f  = P.bind fun a => (k a).map f     ProbDist.map_bind
(P.map g).bind k  = P.bind fun a => k (g a)         ProbDist.bind_map
(δ_a).bind k      = k a                             ProbDist.single_bind
(δ_a).map f       = δ_(f a)                         ProbDist.map_single

Today each such identity is closed by a hand-picked sequence of these rewrites.

Proposed change

Add the tactic kernel_nf in src/Probability/: a simp only with the fixed list above, Function.comp_def, Prod.map_apply and id_eq. It unfolds no definition.

Add what a proof of this shape cites before the tactic:

  • TypedSystem.ofProbAutomaton_eq_of_stateMap_of_map_eq: the law of #221 with the image of the initial law as a hypothesis, μ.map f = ν. Applied to a goal ofProbAutomaton A step₁ μ = ofProbAutomaton A step₂ ν, both automata are read off the goal, and what is left is the state map and one identity per port.
  • ProbStep.parallel_inl and ProbStep.parallel_inr: the two rows of the product step of #223, by rfl.
Acceptance criteria

Take two automata side by side and the same pair with the two states exchanged. Prove them equal: each port closes by its row and kernel_nf. Check the tactic on a pushforward of a draw from a pushforward, and on a draw from a point law.

主要语言
Lean
星标
3
派生
0
平均合并
1 天 7 小时
30 天内合并 PR
123

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

trailofbits/constructive-cryptography 的其他 Issue

查看 trailofbits/constructive-cryptography 的全部 Issue

相似的 Issue

更多 Backend & API Design Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。