Normalize kernel expressions when comparing two automata port by port

オープン
#395 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
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時間
マージ済み PR(30日)
123

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

trailofbits/constructive-cryptography のほかの issue

trailofbits/constructive-cryptography の issue をすべて見る

似ている issue

Backend & API Design の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。