SlideShare a Scribd company logo
1 of 31
Download to read offline
Coq 関係計算ライブラリの開発と写像の性質の証明
溝口佳寛 1 松嶋 聡昭 2 田中久治 3 井口修一 4
1 九州大学マス・フォア・インダストリ研究所
2 九州大学大学院数理学府
3 佐賀大学大学院工学系研究科
4 福岡工業大学情報工学部
日本数式処理学会@筑波大学
2015 年 6 月 6 日 (土)
本スライド : http://www.slideshare.net/yoshihiromizoguchi/coq-49044889
溝口佳寛 (九大 IMI) Coq 関係計算ライブラリ 数式処理学会 2015/6/6 1 / 31
目次
1 はじめに
2 代数から圏 (カテゴリー) へ
ブール代数
関係代数
Dedekind 圏 (関係計算の圏)
3 Coq 関係計算ライブラリ
Dedekind 圏の実装
写像の性質の関係式による定義
関数計算による証明の効用
自動証明の可能性 (Tactic)
4 おわりに
結論と今後の課題
参考文献
溝口佳寛 (九大 IMI) Coq 関係計算ライブラリ 数式処理学会 2015/6/6 2 / 31
はじめに
対象の間のネットワーク構造 (=関係) は, 最も基本的な数学概念です.
数の計算や数の方程式は日常的に利用されています.
では, 構造の式, その計算, 構造の方程式, それらの数学的解析という
のは, あるのでしょうか?
実は, 関係の理論というのは随分昔から数学者により考えられて来て
います.
関係の間の演算で定式化されたネットワーク構造は, 関係計算とい
う記号処理により方程式を解くことが可能です.
「数の方程式」ではなく「構造の方程式」の数式処理 (Symbolic
Computation) による数学解析・応用が私たちの興味の対象です.
また, 計算のみでなく, 数学定理の証明やプログラム実装の正当性
の証明検証への応用も視野に入れています.
溝口佳寛 (九大 IMI) Coq 関係計算ライブラリ 数式処理学会 2015/6/6 3 / 31
関係計算と関係代数の歴史
論理の代数的定式化は G. Boole に始まる (1847).
集合演算の代数式としての De-Morgan の公式 (1864) .
述語論理に代わる代数の定式化の試み, Peirce 1870.
関係代数の公理化と表現可能性の考察
Tarski 1941, Lyndon 1950, McKenzie 1966.
関係の圏論的考察
MacLane 1961, Puppe 1962, Kawahara 1973.
代数から圏へ (Homogeneous to heterogeneous)
Allegories(寓圏)(Freyd 1990), Dedekind 圏 (Oliver 1980).
点公理と Dedekind 圏の公理化
Furusawa 2015.
† R. D. Maddux, The origin of relation algebras in the development and
axiomaization of the calculus of relations, 1991.
† R. Hirsh, I. Hodkinson, Relation algebras by games, 2002.
† G. Schmidt, Relational Mathematics, 2010.
溝口佳寛 (九大 IMI) Coq 関係計算ライブラリ 数式処理学会 2015/6/6 4 / 31
関係計算の計算機科学への応用
プログラム理論 (プログラム検証)
The weakest prespecifiacion (Hoare 1987),
Categorical assertion semantics in toposes (Kawahara 1992),
Automated verification of relational while-programs (Berghammer 2014),
Semigroup with if–then–else and halting programs (Jackson 2009).
オートマトン理論, グラフ変換系 (計算モデル)
Applications of relational calculus to computer mathematics (Kawahara
1988),
Relational graph rewritings, (Mizoguchi 1995).
関係データベース, 形式概念解析 (データモデル)
Relational aspects of relational database dependencies, (Okuma 2000),
Formal concepts in Dedekind categories, (Ishida 2008).
† 14th International Conference on Relational and Algebraic Methods in
Computer Science (RAMiCS),
http://mathcs.chapman.edu/ramics2014/
溝口佳寛 (九大 IMI) Coq 関係計算ライブラリ 数式処理学会 2015/6/6 5 / 31
ブール代数 (1)
B を集合とし, ϕ ∈ B, ∇ ∈ B, ⊔ : B × B → B, − : B → B に対して,
B = (B, ϕ, ∇, ⊔, −) を考えとき, 任意の元 a, b, c ∈ B に対して, 以下の公理
を満たすときに, B をブール代数という.
(a ⊔ b) ⊔ c = a ⊔ (b ⊔ c)
a ⊔ b = b ⊔ a
a ⊔ a = a
−(−b) = b
b ⊔ (−b) = ∇
−∇ = ϕ
a ⊓ (b ⊔ c) = (a ⊓ b) ⊔ (a ⊓ c)
where x ⊓ y = −((−x) ⊔ (−y)).
ϕ ⊔ a = a
※ a ⊑ b を a ⊔ b = b で定め, a − b を a ⊔ (−b) で定める.
溝口佳寛 (九大 IMI) Coq 関係計算ライブラリ 数式処理学会 2015/6/6 6 / 31
ブール代数 (2)
集合 X の部分集合全体を 2X とし, 集合 X の部分集合 A,B に対して,
A ⊔ B を和集合, −A を補集合 (−A = X − A) とするとき,
F(X) = (2X, ϕ, X, ⊔, −) はブール代数になる.
定理 (ストーンの表現定理 (1936))
Boole 代数の公理系を満たす代数系 B はある集合 X の部分集合によって
作られる Boole 代数 F(X) と同型である.
命題
有限個の元を持つ Boole 代数は, ある有限集合の部分集合全体からなる
Boole 代数と同型である. 従って, 有限の Boole 代数はある自然数 n と 1
対 1 対応し, ブール代数の元の数は 2n である.
溝口佳寛 (九大 IMI) Coq 関係計算ライブラリ 数式処理学会 2015/6/6 7 / 31
関係代数 (1)
R を集合とし, ϕ, ∇, id ∈ R, ⊔ : R × R → R, · : R × R → R, − : R → R,
( )♯ : R → R に対して, R = (R, ⊔, −, ϕ, ∇, id,♯ , ·) を考える. 任意の元
a, b, c ∈ B に対して, 以下の公理を満たすときに, R を関係代数という.
(R, ⊔, −, ϕ, ∇) はブール代数である.
(R, ·, id) は id を単位元とする半群で
ある.
(a · b) · c = a · (b · c)
a · id = id · a = a
以下の 3 つの条件は同値である.
(a · b) ⊓ c = ϕ
(a♯
· c) ⊓ b = ϕ
a ⊓ (c · b♯
) = ϕ
溝口佳寛 (九大 IMI) Coq 関係計算ライブラリ 数式処理学会 2015/6/6 8 / 31
関係代数 (2)
集合 X に対して, X × X の部分集合全体を 2X×X とし, 集合 X × X の部分
集合 A,B に対して,
A · B = {(x, y) | ∃u, (x, u) ∈ A ∧ (u, y) ∈ B}
idX = {(x, x) | x ∈ X}
A♯
= {(y, x) | (x, y) ∈ A}
とするとき, F(X × X) = (2X×X, ⊔, −, ϕ, X × X, idX, ( )♯, ·) は関係代数に
なる.
例
関係 A ∈ 2X×X に対して, 式 A · A ⊆ A が, 推移律
(a, b) ∈ A ∧ (b, c) ∈ A ⇒ (a, c) ∈ A
を表す. 集合論の論理式で表現される性質を関係演算の計算式で表現し,
数式処理で証明することが出来る.
溝口佳寛 (九大 IMI) Coq 関係計算ライブラリ 数式処理学会 2015/6/6 9 / 31
Lyndon の条件式
X を集合とし, F(X × X) を直積集合の部分集合によって作られる関係代
数とする. このとき, 2X×X の任意の元に対して, 以下の条件式が成立する.
(D1)
(a·b)⊓(c·d)⊓(e· f) ⊏ a·[(a♯
·c)⊓(b·d♯
)⊓{((a♯
·e)⊓(b· f♯
))·((e♯
·c)⊓(f ·d♯
))}]·d
(D2)
a⊓((b⊓(c·d))·(e⊓(f·g))) ⊏ c·[(((c♯
·a)⊓(d·e))·g♯
)⊓(d·f)⊓(c♯
·((a·g♯
)⊓(b·f)))]·g
(D3) a ⊏ (b · c) ⊓ (d · e) と (b♯
· d) ⊓ (c · e♯
) ⊏ f · g が成立するとき,
a ⊏ ((b · f) ⊓ (d · g♯
)) · (( f♯
· b♯
) ⊓ (g · e))
溝口佳寛 (九大 IMI) Coq 関係計算ライブラリ 数式処理学会 2015/6/6 10 / 31
McKenzie 代数
A = {id, x, y, y♯} として, A ∪ {ϕ, ∇} で生成される (すなわち, 任意の元は
A ∪ {ϕ, ∇} の元の有限個の和 (⊔) である) 関係代数で, 最小元を ϕ, 最大元
を ∇ とする.
x = x♯, id♯
= id
For any α ∈ A, ϕ ⊏ α ⊏ ∇ and α ⊓ α = α.
For any α, β ∈ A, if α β then α ⊓ β = ϕ.
連接 (·) 演算表を以下で定義する.
· id x y y♯
id id x y y♯
x x id ⊔ y ⊔ y♯ x ⊔ y x ⊔ y♯
y y x ⊔ y y ∇
y♯ y♯ x ⊔ y♯ ∇ y♯
このとき, A で生成される関係代数が唯一定まる. この関係代数を
McKenzie 代数と呼ぶ.
溝口佳寛 (九大 IMI) Coq 関係計算ライブラリ 数式処理学会 2015/6/6 11 / 31
関係代数の表現不可能性
予想
関係代数はある集合 X の直積集合の部分集合によって作られる関係代数
F(X × X) と同型である.
定理 (McKenzie 1970)
McKenzie 代数は (D2) を満たさない. 実際, a = c = d = f = g = x,
b = y, e = y♯ とすると, (D2) が成立しない. すなわち, 予想は成立しない.
上記の定理の証明は代入して規則に従い (D2) を計算することにより示さ
れる.
※関係代数の表現不可能性を最初に示したのは Lyndon 1950 である.
溝口佳寛 (九大 IMI) Coq 関係計算ライブラリ 数式処理学会 2015/6/6 12 / 31
Dedekind 圏 (関係計算の圏)(1)
D を圏とし, D の対象 X と Y に対して, D(X, Y) を X と Y の間の射全体
のクラスとする. 任意の対象 X, Y, Z に対して, 射の結合 ·, 逆射 ( )♯, 剰余
結合 ▷ は以下の関数群である.
· = D(X, Y) × D(Y, Z) → D(X, Z)
( )♯
= D(X, Y) → D(Y, X)
▷ = D(X, Y) × D(Y, Z) → D(X, Z)
このとき, 次の公理を満たすときに, D を Dedekind 圏という.
1 (D, ⊑, ⊓, ⊔, ⇒, ϕXY, ∇XY) は ϕXY を最小元, ∇XY を最大限とする完備
Heyting 代数である.
2 任意の α, α′ ∈ D(X, Y) に対して,
(α · β)♯
= β♯
· α♯
(α♯
)♯
= α
α ⊑ α′
ならば, α♯
⊑ α′♯
.
3 任意の α ∈ D(X, Y), β ∈ D(Y, Z), γ ∈ D(X, Z) に対して,
(α · β) ⊓ γ ⊑ α · (β ⊓ (α♯
· γ))
4 任意の α ∈ D(X, Y), β ∈ D(Y, Z), δ ∈ D(X, Z) に対して,
δ ⊑ α ▷ β ↔ α♯
· δ ⊑ β
溝口佳寛 (九大 IMI) Coq 関係計算ライブラリ 数式処理学会 2015/6/6 13 / 31
Dedekind 圏 (関係計算の圏)(2)
※ 記号の定義を以下に整理しておく.
(1) A relation α of a set A into another set B is a subset of the Cartesian
product A × B and denoted by α : A ⇁ B.
(2) The inverse relation α♯ : B ⇁ A of α is a relation such that
(b, a) ∈ α♯ if and only if (a, b) ∈ α.
(3) The composite αβ : A ⇁ C of α : A ⇁ B followed by β : B ⇁ C is
a relation such that (a, c) ∈ αβ if and only if there exists b ∈ B with
(a, b) ∈ α and (b, c) ∈ β.
(4) As a relation of a set A into a set B is a subset of A × B, the inclusion
relation, union, intersection and difference of them are available as
usual and denoted by ⊑, ⊔, ⊓ and −, respectively.
(5) The identity relation idA : A ⇁ A is a relation with
idA = {(a, a) ∈ A × A|a ∈ A}.
(6) The empty relation ϕ ⊆ A × B is denoted by 0AB. The entire set
A × B is called the universal relation and denoted by ∇AB.
(7) The one point set {∗} is denoted by I. We note that ∇II = idI.
溝口佳寛 (九大 IMI) Coq 関係計算ライブラリ 数式処理学会 2015/6/6 14 / 31
Dedekind 圏の公理と補題の Coq による実装 (1)
ライブラリ Basic_Notations
基本演算の定義の記法について, 集合圏での公理の証明.
ライブラリ Distributive_Laws
分配法則, De-Morgan の法則など
ライブラリ Empty_Universal_Inverse
空関係, 全関係, 逆関係に関する補題
ライブラリ Basic_Lemmas
包含関係, 和関係, 共通関係に関する補題
ライブラリ Functions_Mappings
関係の性質, 関数定義, 関数の性質など 1
ライブラリ Dedekind
Dedekint 圏の公理に関する補題と集合圏での公理の証明.
1
※本日の講演内容の Tactic を含む.
溝口佳寛 (九大 IMI) Coq 関係計算ライブラリ 数式処理学会 2015/6/6 15 / 31
Dedekind 圏の公理と補題の Coq による実装 (2)
A, B を eqType として, A から B への関係の型を (Rel A B) と書き,
A → B → Prop として定義する. 以下に関係の表記についてまとめる.
数式 Coq Notation
逆関係 α♯ (inverse_relation α) (α #)
合成関係 αβ (composite α β) (α・β)
恒等関係 idA (identity_relation A) (Id A)
空関係 ϕAB (empty_relation A B) (φ A B)
全関係 ∇AB (universal_relation A B) (∇ A B)
溝口佳寛 (九大 IMI) Coq 関係計算ライブラリ 数式処理学会 2015/6/6 16 / 31
写像の性質の関係式による定義 (1)
関係が関数 (total function) であること, 単射 (injection) であること, 全射
(surjection) であることなどは論理式ではなく, 全て関係式で定式化され
ます.
定義
Let α : A ⇁ B be a relation.
(1) α is total, if idA ⊑ αα♯.
(2) α is univalent, if α♯α ⊑ idB.
(3) A univalent relation is also called as a partial function.
(4) α is (total) function, if α is total and univalent.
(3) A (total) function α : A ⇁ B is surjection, if α♯α = idB.
(4) A (total) function α : A ⇁ B is injection, if αα♯ = idA.
(5) A (total) function is bijection, if it is surjection and injection.
Note. We use letters f, g, h, · · · for (total) functions. For a function,
surjection and injection, we use an arrow symbol →, ↠ and ↣.
溝口佳寛 (九大 IMI) Coq 関係計算ライブラリ 数式処理学会 2015/6/6 17 / 31
写像の性質の関係式による定義 (2)
 
Definition total_id {A B : eqType} (alpha : Rel A B) :=
(Id A) ≡ (alpha ・ (alpha #)).
Definition univalent_id {A B : eqType} (alpha : Rel A B) :=
((alpha #) ・ alpha) ≡ (Id B).
Definition total_r {A B : eqType} (alpha : Rel A B) :=
(Id A) ⊆ (alpha ・ (alpha #)).
Definition univalent_r {A B : eqType} (alpha : Rel A B) :=
((alpha #) ・ alpha) ⊆ (Id B).
Definition function_r {A B : eqType} (alpha : Rel A B) :=
(total_r alpha) / (univalent_r alpha).
Definition surjection_r {A B : eqType} (alpha : Rel A B) :=
(function_r alpha) / (total_r (alpha #)).
Definition injection_r {A B : eqType} (alpha : Rel A B) :=
(function_r alpha) / (univalent_r (alpha #)).
Definition bijection_r {A B : eqType} (alpha : Rel A B) :=
(surjection_r alpha) / (injection_r alpha).
 
溝口佳寛 (九大 IMI) Coq 関係計算ライブラリ 数式処理学会 2015/6/6 18 / 31
単射の合成は単射である (論理式で定式化)
命題
f : X → Y, g : Y → Z が単射のとき, f · g : X → Z は単射である.
(∀x, x′ ∈ X, ∀y ∈ Y, (x, y) ∈ f ∧ (x′, y) ∈ f ⇒ x = x′)
∧ (∀y, y′ ∈ Y, ∀z ∈ Z, (y, z) ∈ g ∧ (y′, z) ∈ g ⇒ y = y′)
⇒ (∀x, x′ ∈ X, ∀z ∈ Z, ((x, z) ∈ f · g) ∧ ((x′, z) ∈ f · g))
⇒ x = x′
ここで,
(x, z) ∈ f · g ⇔ ∃y ∈ Y, (x, y) ∈ f ∧ (y, z) ∈ g
(x′
, z) ∈ f · g ⇔ ∃y′
∈ Y, (x′
, y′
) ∈ f ∧ (y′
, z) ∈ g
※ 補題を準備しておけば良いかもしれないが, 自動証明への道筋が明ら
かでない.
溝口佳寛 (九大 IMI) Coq 関係計算ライブラリ 数式処理学会 2015/6/6 19 / 31
単射の合成は単射である (論理式で定式化)(2)
 
Theorem injection_composite_set
{X Y Z : eqType} {f : Rel X Y} {g : Rel Y Z}:
(forall (x x’ : X)(y : Y), f x y / f x’ y - x = x’) /
(forall (y y’ : Y)(z : Z), g y z / g y’ z - y = y’) -
(forall (x x’ : X)(z : Z),
(exists y : Y, f x y / g y z) / (exists y’ : Y, f x’ y’ / g y’ z) - x = x’).
Proof.
intuition.
move:H2.
elim = y H4.
apply (H0 x x’ y).
split.
apply (proj1 H4).
move:H3.
elim =y’ H5.
have: y=y’.
apply (H1 y y’ z).
apply (conj (proj2 H4) (proj2 H5)).
move = H6.
rewrite -H6 in H5.
apply (proj1 H5).
Qed.
 
※ 少し面倒だが, 手動で証明を与えることは出来る.
溝口佳寛 (九大 IMI) Coq 関係計算ライブラリ 数式処理学会 2015/6/6 20 / 31
単射の合成は単射である (関係式で定式化)
命題
f : X → Y, g : Y → Z が単射のとき, f · g : X → Z は単射である.
( f · f♯
⊑ idX) ∧ (g · g♯
⊑ idY) ⇒ ((f · g) · ( f · g)♯
⊑ idX)
( f · g) · ( f · g)♯
= ( f · g) · (g♯ · f♯) (∵ (α · β)♯ = β♯ · α♯)
= f · (g · g♯) · f♯ (∵ 結合法則)
⊑ f · idY · f♯ (∵ 仮定 g · g♯ ⊑ idY)
= f · f♯ (∵ idYは単位元)
⊑ idX (∵ 仮定 f · f♯ ⊑ idX)
全ての性質が関係式で定式化されており, 証明は式変形のみで行える.
溝口佳寛 (九大 IMI) Coq 関係計算ライブラリ 数式処理学会 2015/6/6 21 / 31
単射の合成は単射である (関係式で定式化)(2)
 
Theorem injection_composite_rel_tactic
{X Y Z : eqType} {f : Rel X Y} {g : Rel Y Z}:
(f ・ (f #)) ⊆ Id X / (g ・ (g #)) ⊆ Id Y -
((f ・ g) ・ ((f ・ g) #)) ⊆ Id X.
Proof.
Rel_simpl2.
Qed.
 
※ この例の場合は, 式変形は全て自動 (Tactic) で証明出来た.
溝口佳寛 (九大 IMI) Coq 関係計算ライブラリ 数式処理学会 2015/6/6 22 / 31
基本的な補題たち
 
Lemma composite_include_left
{A B C : eqType} {b : Rel B C} {a a’ : Rel A B}: (a ⊆ a’) - ((a ・ b) ⊆ (a’ ・ b)).
Lemma composite_include_left_a_id
{A B : eqType} {b : Rel A B} {a : Rel A A}: (a ⊆ Id A) - ((a ・ b) ⊆ b).
Lemma composite_include_left_id_a
{A B : eqType} {b : Rel A B} {a : Rel A A}: (Id A ⊆ a) - (b ⊆ (a ・ b)).
Lemma composite_include_right
{A B C : eqType} {b b’ : Rel B C} {a : Rel A B}: (b ⊆ b’) - ((a ・ b) ⊆ (a ・ b’)).
Lemma composite_include_right_b_id
{A B : eqType} {b : Rel B B} {a : Rel A B}: (b ⊆ Id B) - ((a ・ b) ⊆ a).
Lemma composite_include_right_id_b
{A B : eqType} {b : Rel B B} {a : Rel A B}: (Id B ⊆ b) - (a ⊆ (a ・ b)).
Lemma composite_include_left_right
{A B C D : eqType} {b b’ : Rel B C} {a : Rel A B} {c : Rel C D}:
(b ⊆ b’) - ((a ・ (b ・ c)) ⊆ (a ・ (b’ ・ c))).
Lemma composite_include_left_right_b_id
{A B C : eqType} {b : Rel B B} {a : Rel A B} {c : Rel B C}:
(b ⊆ Id B) - ((a ・ (b ・ c)) ⊆ (a ・ c)).
Lemma composite_include_left_right_id_b
{A B C : eqType} {b : Rel B B} {a : Rel A B} {c : Rel B C}:
(Id B ⊆ b) - ((a ・ c) ⊆ (a ・ (b ・ c))).
 
溝口佳寛 (九大 IMI) Coq 関係計算ライブラリ 数式処理学会 2015/6/6 23 / 31
自動証明の可能性 (Tactic)
※ 必ずしも式が短くなるような簡約を行えば良い訳ではない.
 
Ltac Rel_simpl1 :=
Rel_simpl_intro;
repeat match goal with
| [_ : _ |- _ ⊆ _ ] = apply f_include
| [ H : _ |- _ ⊆ _ ] = apply H
| [_ : _ |- (_ ・ _) ⊆ (_ ・ _) ] = apply composite_include
| [_ : _ |- (_ ・ _) ⊆ _ ] = apply composite_include_left_a_id
| [_ : _ |- _ ⊆ (_ ・ _) ] = apply composite_include_left_id_a
| [_ : _ |- (_ ・ _) ⊆ _ ] = apply composite_include_right_b_id
| [_ : _ |- _ ⊆ (_ ・ _) ] = apply composite_include_right_id_b
| [ H : _ ⊆ _ , H0 : _ ⊆ _ |- _ ⊆ _ ] = apply (include_include H H0)
| [ H : (Id _) ⊆ _ ,H0 : _ ⊆ (Id _) |- _ ] = rewrite (include_equal H H0)
| [_ : _ |- (_ #) ⊆ (_ #) ] = apply include_inverse
| [_ : _ |- _ ] = rewrite composite_inverse
| [_ : _ |- _ ] = rewrite composite_composite4
end.
Ltac Rel_simpl2 :=
Rel_simpl_intro;
repeat match goal with
| [ H : (Id _) ⊆ _ |- (Id _) ⊆ _ ] = apply (include_include H)
| [ H : _ ⊆ (Id _) |- _ ⊆ (Id _) ] = apply (fun (H0 : _ ⊆ _) = (include_include H0 H))
end;Rel_simpl1.
 
※ 例えば, 式の途中に恒等写像を追加して式を冗長にする必要が生じる
(Rel_simpl2).
溝口佳寛 (九大 IMI) Coq 関係計算ライブラリ 数式処理学会 2015/6/6 24 / 31
全射の合成は全射である (関係式で定式化)
命題
f : X → Y, g : Y → Z が全射のとき, f · g : X → Z は全射である.
(idX ⊑ f · f♯
) ∧ (idY ⊑ g · g♯
) ⇒ (idX ⊑ ( f · g) · (f · g)♯
)
idX
⊑ f · f♯ (∵ 仮定 idX ⊑ f · f♯)
= f · (idY · f♯) (∵ idY は単位元)
⊑ f · ((g · g♯) · f♯) (∵ 仮定 idY ⊑ g · g♯)
= ( f · g) · (g♯ · g♯) (∵ 結合法則)
= ( f · g) · ( f · g)♯ (∵ 合成の逆関係)
全ての性質が関係式で定式化されており, 証明は式変形のみで行える.
溝口佳寛 (九大 IMI) Coq 関係計算ライブラリ 数式処理学会 2015/6/6 25 / 31
全射の合成は全射である (関係式で定式化)(2)
 
Lemma total_composite2
{A B C : eqType} {f : Rel A B} {g : Rel B C}:
((Id A) ⊆ (f ・ (f #))) - (Id B) ⊆ (g ・ (g #)) -
(Id A) ⊆ ((f ・ g) ・ ((f ・ g) #)).
Proof.
Rel_simpl2.
Qed.
 
※ この例の場合は, 式変形は全て自動 (Tactic) で証明出来た.
溝口佳寛 (九大 IMI) Coq 関係計算ライブラリ 数式処理学会 2015/6/6 26 / 31
まとめと今後の課題
関係計算の Coq ライブラリの実装
型と演算の定義, 記法の整理.
Tarski の公理の集合論での証明.
関係代数の性質の証明.
関係計算のための Tactic の実装.
今後の課題
公理や命題の階層の整理.
関係計算のための Tactic の改良.
関係計算により定式化された実問題の性質の形式証明.
関係計算式による数学の再構成とその形式証明.
謝辞. 本 Coq ライブラリの実装にあたり,
Reynald Affeldt 氏 (産業技術総合研究所), 平井洋一氏 (FireEye) には,
初期のころから多くの助言を頂きました. ここに感謝の意を表します.
溝口佳寛 (九大 IMI) Coq 関係計算ライブラリ 数式処理学会 2015/6/6 27 / 31
参考文献 I
R. Berghammer, P. H¨ofner, and I. Stucke.
Automated verification of relational while-programs.
In P. H¨ofner, P. Jipsen, W. Kahl, and M. E. M¨uller, editors, Relational and Algebraic Methods in
Computer Science (RAMiCS’14), volume 8428 of Lecture Notes in Computer Sciences, pages
173–190, 2014.
Peter J. Freyd and Andre Scedrov.
Categories, allegories, volume 39 of North-Holland mathematical library.
North-Holland, Amsterdam, 1990.
Hitoshi Furusawa and Yasuo Kawahara.
Point axioms and related conditions in dedekind categories.
Journal of Logical and Algebraic Methods in Programming, 84:359–376, 2015.
Robin Hirsh and Ian Hodkinson.
Relation algebras by games, volume 147 of Studies in Logic and Foundations.
North-Holland, Amsterdam, 2002.
C. A. R. Hoare and HE Jifeng.
The weakest prespecification.
Information processing letter, 24:127–132., 1987.
溝口佳寛 (九大 IMI) Coq 関係計算ライブラリ 数式処理学会 2015/6/6 28 / 31
参考文献 II
T. Ishida, K. Honda, and Y. Kawahara.
Formal concepts in Dedekind categories.
In R. Berghammer, B. M¨oller, and G. Struth, editors, Relations and Kleene Algebras in Computer
Science, volume 4988 of Lecture Notes in Computer Science, pages 221–233, 2008.
Marcel Jackson and Tim Stokes.
Semigroup with if–then–else and halting programs.
International Journal of Algebra and Computation, 19(7):937–961, 2009.
Y. Kawahara.
Applications of relational calculus to computer mathematics.
Bull. Inform. Cybernet., 23:67–78, 1988.
Y. Kawahara and Y. Mizoguchi.
Categorical assertion semantics in toposes.
Advances in Software Science and Technology, 4:137–150, 1992.
Saunder Mac Lane.
Categories for the working mathematicians.
Springer-Verlag, 1971.
R. C. Lyndon.
The representation of relational algebras.
Annuals of Mathematics, 51:707–729, 1950.
溝口佳寛 (九大 IMI) Coq 関係計算ライブラリ 数式処理学会 2015/6/6 29 / 31
参考文献 III
Roger D. Maddux.
The origin of relation algebras in the development and axiomatization of the calculus of relations.
Studia Logica: An International Journal for Symbolic Logic, 50:421–455, 1991.
Ralph N. McKenzie, George F. McNulty, and Walter F. Tylor.
Algebras, lattices, varieties.
The Wadsworth  Books/Cole mathematics series. Wadsworth  Books, 1987.
Y. Mizoguchi and Y. Kawahara.
Relational graph rewritings.
Theoret. Comput. Sci., 141:311–328, 1995.
A. De Morgan.
On the syllogism: IV, and on the logic of relations.
Transactions of the Cambridge Philosophcal Society, pages 331–358, 1966.
H. Okuma and Y. Kawahara.
Relational aspects of relational database dependencies.
Bull. Inform. Cybernet., pages 91–104, 2000.
J. P. Oliver and D. Serrato.
Cat´egories de dedekind morphismes dans les cat´egories de Shr¨oder.
C. R. Acad. Sci. Paris, 290:939–941, 1980.
溝口佳寛 (九大 IMI) Coq 関係計算ライブラリ 数式処理学会 2015/6/6 30 / 31
参考文献 IV
C. S. Peirce.
Note B: the logic of relatives, volume iviii+vi+203, pages 187–203.
John Benjamins Publishing Co., Amsterdam and Philadelphia., 1983.
G. Schmidt.
Relational Mathematics.
Cambridge University Press, 2010.
Marshall H. Stone.
The theory of representations of Boolean algebras.
Transactions of American Mathematical Society, 40, 1936.
A. Tarski.
On the calculus of relations.
Journal of Symbolic Logic, 6:73–89, 1941.
溝口佳寛 (九大 IMI) Coq 関係計算ライブラリ 数式処理学会 2015/6/6 31 / 31

More Related Content

What's hot

公開鍵暗号7: 楕円曲線の数理
公開鍵暗号7: 楕円曲線の数理公開鍵暗号7: 楕円曲線の数理
公開鍵暗号7: 楕円曲線の数理
Joe Suzuki
 
オンライン凸最適化と線形識別モデル学習の最前線_IBIS2011
オンライン凸最適化と線形識別モデル学習の最前線_IBIS2011オンライン凸最適化と線形識別モデル学習の最前線_IBIS2011
オンライン凸最適化と線形識別モデル学習の最前線_IBIS2011
Preferred Networks
 

What's hot (20)

複素数・四元数と図形の回転
複素数・四元数と図形の回転複素数・四元数と図形の回転
複素数・四元数と図形の回転
 
2018年度秋学期 応用数学(解析) 第2部・基本的な微分方程式 第8回 2階線形微分方程式(2) (2018. 11. 13)
2018年度秋学期 応用数学(解析) 第2部・基本的な微分方程式 第8回 2階線形微分方程式(2) (2018. 11. 13)2018年度秋学期 応用数学(解析) 第2部・基本的な微分方程式 第8回 2階線形微分方程式(2) (2018. 11. 13)
2018年度秋学期 応用数学(解析) 第2部・基本的な微分方程式 第8回 2階線形微分方程式(2) (2018. 11. 13)
 
相互情報量を用いた独立性の検定
相互情報量を用いた独立性の検定相互情報量を用いた独立性の検定
相互情報量を用いた独立性の検定
 
2016年度秋学期 応用数学(解析) 第8回 2階線形微分方程式(2) (2016. 11. 24)
2016年度秋学期 応用数学(解析) 第8回 2階線形微分方程式(2) (2016. 11. 24)2016年度秋学期 応用数学(解析) 第8回 2階線形微分方程式(2) (2016. 11. 24)
2016年度秋学期 応用数学(解析) 第8回 2階線形微分方程式(2) (2016. 11. 24)
 
Bayes Independence Test - HSIC と性能を比較する-
Bayes Independence Test - HSIC と性能を比較する-Bayes Independence Test - HSIC と性能を比較する-
Bayes Independence Test - HSIC と性能を比較する-
 
2014年度秋学期 応用数学(解析) 第4部・複素関数論ダイジェスト / 第12回 複素関数・正則関数 (2014. 12. 18)
2014年度秋学期 応用数学(解析) 第4部・複素関数論ダイジェスト / 第12回 複素関数・正則関数 (2014. 12. 18)2014年度秋学期 応用数学(解析) 第4部・複素関数論ダイジェスト / 第12回 複素関数・正則関数 (2014. 12. 18)
2014年度秋学期 応用数学(解析) 第4部・複素関数論ダイジェスト / 第12回 複素関数・正則関数 (2014. 12. 18)
 
Grcosmo 44 slide
Grcosmo 44 slideGrcosmo 44 slide
Grcosmo 44 slide
 
公開鍵暗号7: 楕円曲線の数理
公開鍵暗号7: 楕円曲線の数理公開鍵暗号7: 楕円曲線の数理
公開鍵暗号7: 楕円曲線の数理
 
PRML 1.6 情報理論
PRML 1.6 情報理論PRML 1.6 情報理論
PRML 1.6 情報理論
 
2016年度秋学期 応用数学(解析) 第7回 2階線形微分方程式(1) (2016. 11. 17)
2016年度秋学期 応用数学(解析) 第7回 2階線形微分方程式(1) (2016. 11. 17)2016年度秋学期 応用数学(解析) 第7回 2階線形微分方程式(1) (2016. 11. 17)
2016年度秋学期 応用数学(解析) 第7回 2階線形微分方程式(1) (2016. 11. 17)
 
情報幾何学の基礎 第2章 4.5
情報幾何学の基礎 第2章 4.5情報幾何学の基礎 第2章 4.5
情報幾何学の基礎 第2章 4.5
 
2016年度秋学期 応用数学(解析) 第10回 生存時間分布と半減期 (2016. 12. 1)
2016年度秋学期 応用数学(解析) 第10回 生存時間分布と半減期 (2016. 12. 1)2016年度秋学期 応用数学(解析) 第10回 生存時間分布と半減期 (2016. 12. 1)
2016年度秋学期 応用数学(解析) 第10回 生存時間分布と半減期 (2016. 12. 1)
 
Sinsa1234
Sinsa1234Sinsa1234
Sinsa1234
 
20140512_水曜セミナードラフトv1
20140512_水曜セミナードラフトv120140512_水曜セミナードラフトv1
20140512_水曜セミナードラフトv1
 
PRML 2.3.9-2.4.1
PRML 2.3.9-2.4.1PRML 2.3.9-2.4.1
PRML 2.3.9-2.4.1
 
情報幾何の基礎輪読会 #1
情報幾何の基礎輪読会 #1情報幾何の基礎輪読会 #1
情報幾何の基礎輪読会 #1
 
オンライン凸最適化と線形識別モデル学習の最前線_IBIS2011
オンライン凸最適化と線形識別モデル学習の最前線_IBIS2011オンライン凸最適化と線形識別モデル学習の最前線_IBIS2011
オンライン凸最適化と線形識別モデル学習の最前線_IBIS2011
 
2021年度秋学期 画像情報処理 第11回 逆投影法による再構成 (2021. 12. 3)
2021年度秋学期 画像情報処理 第11回 逆投影法による再構成 (2021. 12. 3)2021年度秋学期 画像情報処理 第11回 逆投影法による再構成 (2021. 12. 3)
2021年度秋学期 画像情報処理 第11回 逆投影法による再構成 (2021. 12. 3)
 
Deep learning _linear_algebra___probablity___information
Deep learning _linear_algebra___probablity___informationDeep learning _linear_algebra___probablity___information
Deep learning _linear_algebra___probablity___information
 
Introduction of introduction_to_group_theory
Introduction of introduction_to_group_theoryIntroduction of introduction_to_group_theory
Introduction of introduction_to_group_theory
 

Viewers also liked

「型の理論」と証明支援システム -- COQの世界
「型の理論」と証明支援システム -- COQの世界「型の理論」と証明支援システム -- COQの世界
「型の理論」と証明支援システム -- COQの世界
maruyama097
 
証明駆動開発のたのしみ@名古屋reject会議
証明駆動開発のたのしみ@名古屋reject会議証明駆動開発のたのしみ@名古屋reject会議
証明駆動開発のたのしみ@名古屋reject会議
Hiroki Mizuno
 
Gallinaによる証明駆動開発の魅力
Gallinaによる証明駆動開発の魅力Gallinaによる証明駆動開発の魅力
Gallinaによる証明駆動開発の魅力
Hiroki Mizuno
 

Viewers also liked (10)

Coqによる証明駆動開発
Coqによる証明駆動開発Coqによる証明駆動開発
Coqによる証明駆動開発
 
証明プログラミング超入門
証明プログラミング超入門証明プログラミング超入門
証明プログラミング超入門
 
「型の理論」と証明支援システム -- COQの世界
「型の理論」と証明支援システム -- COQの世界「型の理論」と証明支援システム -- COQの世界
「型の理論」と証明支援システム -- COQの世界
 
証明駆動開発のたのしみ@名古屋reject会議
証明駆動開発のたのしみ@名古屋reject会議証明駆動開発のたのしみ@名古屋reject会議
証明駆動開発のたのしみ@名古屋reject会議
 
Haskellでプレゼン
HaskellでプレゼンHaskellでプレゼン
Haskellでプレゼン
 
Gallinaによる証明駆動開発の魅力
Gallinaによる証明駆動開発の魅力Gallinaによる証明駆動開発の魅力
Gallinaによる証明駆動開発の魅力
 
定理証明支援系Coqについて
定理証明支援系Coqについて定理証明支援系Coqについて
定理証明支援系Coqについて
 
数式処理ソフトMathematicaで数学の問題を解く
数式処理ソフトMathematicaで数学の問題を解く数式処理ソフトMathematicaで数学の問題を解く
数式処理ソフトMathematicaで数学の問題を解く
 
書くネタがCoqしかない
書くネタがCoqしかない書くネタがCoqしかない
書くネタがCoqしかない
 
よくわかるCoqプログラミング
よくわかるCoqプログラミングよくわかるCoqプログラミング
よくわかるCoqプログラミング
 

Similar to Coq関係計算ライブラリの開発と写像の性質の証明

生物統計特論6資料 2006 abc法(bootstrap) isseing333
生物統計特論6資料 2006 abc法(bootstrap) isseing333生物統計特論6資料 2006 abc法(bootstrap) isseing333
生物統計特論6資料 2006 abc法(bootstrap) isseing333
Issei Kurahashi
 
introductino to persistent homology and topological data analysis
introductino to persistent homology and topological data analysisintroductino to persistent homology and topological data analysis
introductino to persistent homology and topological data analysis
Tatsuki SHIMIZU
 
統計的因果推論 勉強用 isseing333
統計的因果推論 勉強用 isseing333統計的因果推論 勉強用 isseing333
統計的因果推論 勉強用 isseing333
Issei Kurahashi
 
ガンマ分布族のなす空間の曲率
ガンマ分布族のなす空間の曲率ガンマ分布族のなす空間の曲率
ガンマ分布族のなす空間の曲率
Masaki Asano
 
mathemaical_notation
mathemaical_notationmathemaical_notation
mathemaical_notation
Kenta Oono
 

Similar to Coq関係計算ライブラリの開発と写像の性質の証明 (20)

生物統計特論6資料 2006 abc法(bootstrap) isseing333
生物統計特論6資料 2006 abc法(bootstrap) isseing333生物統計特論6資料 2006 abc法(bootstrap) isseing333
生物統計特論6資料 2006 abc法(bootstrap) isseing333
 
Estimating Mutual Information for Discrete‐Continuous Mixtures 離散・連続混合の相互情報量の推定
Estimating Mutual Information for Discrete‐Continuous Mixtures 離散・連続混合の相互情報量の推定Estimating Mutual Information for Discrete‐Continuous Mixtures 離散・連続混合の相互情報量の推定
Estimating Mutual Information for Discrete‐Continuous Mixtures 離散・連続混合の相互情報量の推定
 
Introduction to Categorical Programming
Introduction to Categorical ProgrammingIntroduction to Categorical Programming
Introduction to Categorical Programming
 
Introduction to Categorical Programming (Revised)
Introduction to Categorical Programming (Revised)Introduction to Categorical Programming (Revised)
Introduction to Categorical Programming (Revised)
 
2022年度秋学期 画像情報処理 第4回 フーリエ変換とサンプリング定理 (2022. 10. 14)
2022年度秋学期 画像情報処理 第4回 フーリエ変換とサンプリング定理 (2022. 10. 14) 2022年度秋学期 画像情報処理 第4回 フーリエ変換とサンプリング定理 (2022. 10. 14)
2022年度秋学期 画像情報処理 第4回 フーリエ変換とサンプリング定理 (2022. 10. 14)
 
introductino to persistent homology and topological data analysis
introductino to persistent homology and topological data analysisintroductino to persistent homology and topological data analysis
introductino to persistent homology and topological data analysis
 
統計的因果推論 勉強用 isseing333
統計的因果推論 勉強用 isseing333統計的因果推論 勉強用 isseing333
統計的因果推論 勉強用 isseing333
 
[DL輪読会]Convolutional Conditional Neural Processesと Neural Processes Familyの紹介
[DL輪読会]Convolutional Conditional Neural Processesと Neural Processes Familyの紹介[DL輪読会]Convolutional Conditional Neural Processesと Neural Processes Familyの紹介
[DL輪読会]Convolutional Conditional Neural Processesと Neural Processes Familyの紹介
 
Casual learning machine learning with_excel_no4
Casual learning machine learning with_excel_no4Casual learning machine learning with_excel_no4
Casual learning machine learning with_excel_no4
 
ガンマ分布族のなす空間の曲率
ガンマ分布族のなす空間の曲率ガンマ分布族のなす空間の曲率
ガンマ分布族のなす空間の曲率
 
A summary on “On choosing and bounding probability metrics”
A summary on “On choosing and bounding probability metrics”A summary on “On choosing and bounding probability metrics”
A summary on “On choosing and bounding probability metrics”
 
圏論のモナドとHaskellのモナド
圏論のモナドとHaskellのモナド圏論のモナドとHaskellのモナド
圏論のモナドとHaskellのモナド
 
2013 03 25
2013 03 252013 03 25
2013 03 25
 
分布 isseing333
分布 isseing333分布 isseing333
分布 isseing333
 
距離空間とconcaveな写像
距離空間とconcaveな写像距離空間とconcaveな写像
距離空間とconcaveな写像
 
第4回MachineLearningのための数学塾資料(浅川)
第4回MachineLearningのための数学塾資料(浅川)第4回MachineLearningのための数学塾資料(浅川)
第4回MachineLearningのための数学塾資料(浅川)
 
mathemaical_notation
mathemaical_notationmathemaical_notation
mathemaical_notation
 
Learning Latent Space Energy Based Prior Modelの解説
Learning Latent Space Energy Based Prior Modelの解説Learning Latent Space Energy Based Prior Modelの解説
Learning Latent Space Energy Based Prior Modelの解説
 
凸角形全体の位相の性質
凸角形全体の位相の性質凸角形全体の位相の性質
凸角形全体の位相の性質
 
凸角形全体の位相の性質
凸角形全体の位相の性質 凸角形全体の位相の性質
凸角形全体の位相の性質
 

More from Yoshihiro Mizoguchi

More from Yoshihiro Mizoguchi (20)

DockerでAlmaLinux(web, php, pukiwiki)環境構築
DockerでAlmaLinux(web, php, pukiwiki)環境構築DockerでAlmaLinux(web, php, pukiwiki)環境構築
DockerでAlmaLinux(web, php, pukiwiki)環境構築
 
DockerでCoq インストール
DockerでCoq インストールDockerでCoq インストール
DockerでCoq インストール
 
Homebrewによるソフトウェアの実装 (3)
Homebrewによるソフトウェアの実装 (3)Homebrewによるソフトウェアの実装 (3)
Homebrewによるソフトウェアの実装 (3)
 
Homebrewによるソフトウェアの実装 (2)
Homebrewによるソフトウェアの実装 (2)Homebrewによるソフトウェアの実装 (2)
Homebrewによるソフトウェアの実装 (2)
 
Homebrewによるソフトウェアの実装(1)
Homebrewによるソフトウェアの実装(1)Homebrewによるソフトウェアの実装(1)
Homebrewによるソフトウェアの実装(1)
 
Overleafを使った文書作成
Overleafを使った文書作成Overleafを使った文書作成
Overleafを使った文書作成
 
Amazon AWSの使い方
Amazon AWSの使い方Amazon AWSの使い方
Amazon AWSの使い方
 
ShareLaTeXの使い方
ShareLaTeXの使い方ShareLaTeXの使い方
ShareLaTeXの使い方
 
Symbolic Computations in Conformal Geometric Algebra for Three Dimensional O...
Symbolic Computations in Conformal Geometric Algebra for Three Dimensional  O...Symbolic Computations in Conformal Geometric Algebra for Three Dimensional  O...
Symbolic Computations in Conformal Geometric Algebra for Three Dimensional O...
 
Theory of Relational Calculus and its Formalization
Theory of Relational Calculus and its FormalizationTheory of Relational Calculus and its Formalization
Theory of Relational Calculus and its Formalization
 
Verification of a brick wang tiling algorithm
Verification of a brick wang tiling algorithmVerification of a brick wang tiling algorithm
Verification of a brick wang tiling algorithm
 
計算機を用いて数学の問題を解くということ
計算機を用いて数学の問題を解くということ計算機を用いて数学の問題を解くということ
計算機を用いて数学の問題を解くということ
 
A Coq Library for the Theory of Relational Calculus
A Coq Library for the Theory of Relational CalculusA Coq Library for the Theory of Relational Calculus
A Coq Library for the Theory of Relational Calculus
 
Algebras for programming languages
Algebras for programming languagesAlgebras for programming languages
Algebras for programming languages
 
Coqチュートリアル
CoqチュートリアルCoqチュートリアル
Coqチュートリアル
 
Mac bookでwebサーバーを起動する方法
Mac bookでwebサーバーを起動する方法Mac bookでwebサーバーを起動する方法
Mac bookでwebサーバーを起動する方法
 
有限オートマトンとスティッカー系に関するCoqによる形式証明について
有限オートマトンとスティッカー系に関するCoqによる形式証明について有限オートマトンとスティッカー系に関するCoqによる形式証明について
有限オートマトンとスティッカー系に関するCoqによる形式証明について
 
計算可能実数とは
計算可能実数とは計算可能実数とは
計算可能実数とは
 
グラフデータ構造と5色定理
グラフデータ構造と5色定理グラフデータ構造と5色定理
グラフデータ構造と5色定理
 
Graph partitioning and characteristic polynomials of Laplacian matrics of Roa...
Graph partitioning and characteristic polynomials of Laplacian matrics of Roa...Graph partitioning and characteristic polynomials of Laplacian matrics of Roa...
Graph partitioning and characteristic polynomials of Laplacian matrics of Roa...
 

Recently uploaded

The_Five_Books_Overview_Presentation_2024
The_Five_Books_Overview_Presentation_2024The_Five_Books_Overview_Presentation_2024
The_Five_Books_Overview_Presentation_2024
koheioishi1
 
TokyoTechGraduateExaminationPresentation
TokyoTechGraduateExaminationPresentationTokyoTechGraduateExaminationPresentation
TokyoTechGraduateExaminationPresentation
YukiTerazawa
 

Recently uploaded (8)

東京工業大学 環境・社会理工学院 建築学系 大学院入学入試・進学説明会2024_v2
東京工業大学 環境・社会理工学院 建築学系 大学院入学入試・進学説明会2024_v2東京工業大学 環境・社会理工学院 建築学系 大学院入学入試・進学説明会2024_v2
東京工業大学 環境・社会理工学院 建築学系 大学院入学入試・進学説明会2024_v2
 
ゲーム理論 BASIC 演習106 -価格の交渉ゲーム-#ゲーム理論 #gametheory #数学
ゲーム理論 BASIC 演習106 -価格の交渉ゲーム-#ゲーム理論 #gametheory #数学ゲーム理論 BASIC 演習106 -価格の交渉ゲーム-#ゲーム理論 #gametheory #数学
ゲーム理論 BASIC 演習106 -価格の交渉ゲーム-#ゲーム理論 #gametheory #数学
 
The_Five_Books_Overview_Presentation_2024
The_Five_Books_Overview_Presentation_2024The_Five_Books_Overview_Presentation_2024
The_Five_Books_Overview_Presentation_2024
 
TokyoTechGraduateExaminationPresentation
TokyoTechGraduateExaminationPresentationTokyoTechGraduateExaminationPresentation
TokyoTechGraduateExaminationPresentation
 
生成AIの回答内容の修正を課題としたレポートについて:お茶の水女子大学「授業・研究における生成系AIの活用事例」での講演資料
生成AIの回答内容の修正を課題としたレポートについて:お茶の水女子大学「授業・研究における生成系AIの活用事例」での講演資料生成AIの回答内容の修正を課題としたレポートについて:お茶の水女子大学「授業・研究における生成系AIの活用事例」での講演資料
生成AIの回答内容の修正を課題としたレポートについて:お茶の水女子大学「授業・研究における生成系AIの活用事例」での講演資料
 
世界を変えるクレーンを生み出そう! 高知エンジニアリングキャンプ2024プログラム
世界を変えるクレーンを生み出そう! 高知エンジニアリングキャンプ2024プログラム世界を変えるクレーンを生み出そう! 高知エンジニアリングキャンプ2024プログラム
世界を変えるクレーンを生み出そう! 高知エンジニアリングキャンプ2024プログラム
 
2024年度 東京工業大学 工学院 機械系 大学院 修士課程 入試 説明会 資料
2024年度 東京工業大学 工学院 機械系 大学院 修士課程 入試 説明会 資料2024年度 東京工業大学 工学院 機械系 大学院 修士課程 入試 説明会 資料
2024年度 東京工業大学 工学院 機械系 大学院 修士課程 入試 説明会 資料
 
次世代機の製品コンセプトを描く ~未来の機械を創造してみよう~
次世代機の製品コンセプトを描く ~未来の機械を創造してみよう~次世代機の製品コンセプトを描く ~未来の機械を創造してみよう~
次世代機の製品コンセプトを描く ~未来の機械を創造してみよう~
 

Coq関係計算ライブラリの開発と写像の性質の証明

  • 1. Coq 関係計算ライブラリの開発と写像の性質の証明 溝口佳寛 1 松嶋 聡昭 2 田中久治 3 井口修一 4 1 九州大学マス・フォア・インダストリ研究所 2 九州大学大学院数理学府 3 佐賀大学大学院工学系研究科 4 福岡工業大学情報工学部 日本数式処理学会@筑波大学 2015 年 6 月 6 日 (土) 本スライド : http://www.slideshare.net/yoshihiromizoguchi/coq-49044889 溝口佳寛 (九大 IMI) Coq 関係計算ライブラリ 数式処理学会 2015/6/6 1 / 31
  • 2. 目次 1 はじめに 2 代数から圏 (カテゴリー) へ ブール代数 関係代数 Dedekind 圏 (関係計算の圏) 3 Coq 関係計算ライブラリ Dedekind 圏の実装 写像の性質の関係式による定義 関数計算による証明の効用 自動証明の可能性 (Tactic) 4 おわりに 結論と今後の課題 参考文献 溝口佳寛 (九大 IMI) Coq 関係計算ライブラリ 数式処理学会 2015/6/6 2 / 31
  • 3. はじめに 対象の間のネットワーク構造 (=関係) は, 最も基本的な数学概念です. 数の計算や数の方程式は日常的に利用されています. では, 構造の式, その計算, 構造の方程式, それらの数学的解析という のは, あるのでしょうか? 実は, 関係の理論というのは随分昔から数学者により考えられて来て います. 関係の間の演算で定式化されたネットワーク構造は, 関係計算とい う記号処理により方程式を解くことが可能です. 「数の方程式」ではなく「構造の方程式」の数式処理 (Symbolic Computation) による数学解析・応用が私たちの興味の対象です. また, 計算のみでなく, 数学定理の証明やプログラム実装の正当性 の証明検証への応用も視野に入れています. 溝口佳寛 (九大 IMI) Coq 関係計算ライブラリ 数式処理学会 2015/6/6 3 / 31
  • 4. 関係計算と関係代数の歴史 論理の代数的定式化は G. Boole に始まる (1847). 集合演算の代数式としての De-Morgan の公式 (1864) . 述語論理に代わる代数の定式化の試み, Peirce 1870. 関係代数の公理化と表現可能性の考察 Tarski 1941, Lyndon 1950, McKenzie 1966. 関係の圏論的考察 MacLane 1961, Puppe 1962, Kawahara 1973. 代数から圏へ (Homogeneous to heterogeneous) Allegories(寓圏)(Freyd 1990), Dedekind 圏 (Oliver 1980). 点公理と Dedekind 圏の公理化 Furusawa 2015. † R. D. Maddux, The origin of relation algebras in the development and axiomaization of the calculus of relations, 1991. † R. Hirsh, I. Hodkinson, Relation algebras by games, 2002. † G. Schmidt, Relational Mathematics, 2010. 溝口佳寛 (九大 IMI) Coq 関係計算ライブラリ 数式処理学会 2015/6/6 4 / 31
  • 5. 関係計算の計算機科学への応用 プログラム理論 (プログラム検証) The weakest prespecifiacion (Hoare 1987), Categorical assertion semantics in toposes (Kawahara 1992), Automated verification of relational while-programs (Berghammer 2014), Semigroup with if–then–else and halting programs (Jackson 2009). オートマトン理論, グラフ変換系 (計算モデル) Applications of relational calculus to computer mathematics (Kawahara 1988), Relational graph rewritings, (Mizoguchi 1995). 関係データベース, 形式概念解析 (データモデル) Relational aspects of relational database dependencies, (Okuma 2000), Formal concepts in Dedekind categories, (Ishida 2008). † 14th International Conference on Relational and Algebraic Methods in Computer Science (RAMiCS), http://mathcs.chapman.edu/ramics2014/ 溝口佳寛 (九大 IMI) Coq 関係計算ライブラリ 数式処理学会 2015/6/6 5 / 31
  • 6. ブール代数 (1) B を集合とし, ϕ ∈ B, ∇ ∈ B, ⊔ : B × B → B, − : B → B に対して, B = (B, ϕ, ∇, ⊔, −) を考えとき, 任意の元 a, b, c ∈ B に対して, 以下の公理 を満たすときに, B をブール代数という. (a ⊔ b) ⊔ c = a ⊔ (b ⊔ c) a ⊔ b = b ⊔ a a ⊔ a = a −(−b) = b b ⊔ (−b) = ∇ −∇ = ϕ a ⊓ (b ⊔ c) = (a ⊓ b) ⊔ (a ⊓ c) where x ⊓ y = −((−x) ⊔ (−y)). ϕ ⊔ a = a ※ a ⊑ b を a ⊔ b = b で定め, a − b を a ⊔ (−b) で定める. 溝口佳寛 (九大 IMI) Coq 関係計算ライブラリ 数式処理学会 2015/6/6 6 / 31
  • 7. ブール代数 (2) 集合 X の部分集合全体を 2X とし, 集合 X の部分集合 A,B に対して, A ⊔ B を和集合, −A を補集合 (−A = X − A) とするとき, F(X) = (2X, ϕ, X, ⊔, −) はブール代数になる. 定理 (ストーンの表現定理 (1936)) Boole 代数の公理系を満たす代数系 B はある集合 X の部分集合によって 作られる Boole 代数 F(X) と同型である. 命題 有限個の元を持つ Boole 代数は, ある有限集合の部分集合全体からなる Boole 代数と同型である. 従って, 有限の Boole 代数はある自然数 n と 1 対 1 対応し, ブール代数の元の数は 2n である. 溝口佳寛 (九大 IMI) Coq 関係計算ライブラリ 数式処理学会 2015/6/6 7 / 31
  • 8. 関係代数 (1) R を集合とし, ϕ, ∇, id ∈ R, ⊔ : R × R → R, · : R × R → R, − : R → R, ( )♯ : R → R に対して, R = (R, ⊔, −, ϕ, ∇, id,♯ , ·) を考える. 任意の元 a, b, c ∈ B に対して, 以下の公理を満たすときに, R を関係代数という. (R, ⊔, −, ϕ, ∇) はブール代数である. (R, ·, id) は id を単位元とする半群で ある. (a · b) · c = a · (b · c) a · id = id · a = a 以下の 3 つの条件は同値である. (a · b) ⊓ c = ϕ (a♯ · c) ⊓ b = ϕ a ⊓ (c · b♯ ) = ϕ 溝口佳寛 (九大 IMI) Coq 関係計算ライブラリ 数式処理学会 2015/6/6 8 / 31
  • 9. 関係代数 (2) 集合 X に対して, X × X の部分集合全体を 2X×X とし, 集合 X × X の部分 集合 A,B に対して, A · B = {(x, y) | ∃u, (x, u) ∈ A ∧ (u, y) ∈ B} idX = {(x, x) | x ∈ X} A♯ = {(y, x) | (x, y) ∈ A} とするとき, F(X × X) = (2X×X, ⊔, −, ϕ, X × X, idX, ( )♯, ·) は関係代数に なる. 例 関係 A ∈ 2X×X に対して, 式 A · A ⊆ A が, 推移律 (a, b) ∈ A ∧ (b, c) ∈ A ⇒ (a, c) ∈ A を表す. 集合論の論理式で表現される性質を関係演算の計算式で表現し, 数式処理で証明することが出来る. 溝口佳寛 (九大 IMI) Coq 関係計算ライブラリ 数式処理学会 2015/6/6 9 / 31
  • 10. Lyndon の条件式 X を集合とし, F(X × X) を直積集合の部分集合によって作られる関係代 数とする. このとき, 2X×X の任意の元に対して, 以下の条件式が成立する. (D1) (a·b)⊓(c·d)⊓(e· f) ⊏ a·[(a♯ ·c)⊓(b·d♯ )⊓{((a♯ ·e)⊓(b· f♯ ))·((e♯ ·c)⊓(f ·d♯ ))}]·d (D2) a⊓((b⊓(c·d))·(e⊓(f·g))) ⊏ c·[(((c♯ ·a)⊓(d·e))·g♯ )⊓(d·f)⊓(c♯ ·((a·g♯ )⊓(b·f)))]·g (D3) a ⊏ (b · c) ⊓ (d · e) と (b♯ · d) ⊓ (c · e♯ ) ⊏ f · g が成立するとき, a ⊏ ((b · f) ⊓ (d · g♯ )) · (( f♯ · b♯ ) ⊓ (g · e)) 溝口佳寛 (九大 IMI) Coq 関係計算ライブラリ 数式処理学会 2015/6/6 10 / 31
  • 11. McKenzie 代数 A = {id, x, y, y♯} として, A ∪ {ϕ, ∇} で生成される (すなわち, 任意の元は A ∪ {ϕ, ∇} の元の有限個の和 (⊔) である) 関係代数で, 最小元を ϕ, 最大元 を ∇ とする. x = x♯, id♯ = id For any α ∈ A, ϕ ⊏ α ⊏ ∇ and α ⊓ α = α. For any α, β ∈ A, if α β then α ⊓ β = ϕ. 連接 (·) 演算表を以下で定義する. · id x y y♯ id id x y y♯ x x id ⊔ y ⊔ y♯ x ⊔ y x ⊔ y♯ y y x ⊔ y y ∇ y♯ y♯ x ⊔ y♯ ∇ y♯ このとき, A で生成される関係代数が唯一定まる. この関係代数を McKenzie 代数と呼ぶ. 溝口佳寛 (九大 IMI) Coq 関係計算ライブラリ 数式処理学会 2015/6/6 11 / 31
  • 12. 関係代数の表現不可能性 予想 関係代数はある集合 X の直積集合の部分集合によって作られる関係代数 F(X × X) と同型である. 定理 (McKenzie 1970) McKenzie 代数は (D2) を満たさない. 実際, a = c = d = f = g = x, b = y, e = y♯ とすると, (D2) が成立しない. すなわち, 予想は成立しない. 上記の定理の証明は代入して規則に従い (D2) を計算することにより示さ れる. ※関係代数の表現不可能性を最初に示したのは Lyndon 1950 である. 溝口佳寛 (九大 IMI) Coq 関係計算ライブラリ 数式処理学会 2015/6/6 12 / 31
  • 13. Dedekind 圏 (関係計算の圏)(1) D を圏とし, D の対象 X と Y に対して, D(X, Y) を X と Y の間の射全体 のクラスとする. 任意の対象 X, Y, Z に対して, 射の結合 ·, 逆射 ( )♯, 剰余 結合 ▷ は以下の関数群である. · = D(X, Y) × D(Y, Z) → D(X, Z) ( )♯ = D(X, Y) → D(Y, X) ▷ = D(X, Y) × D(Y, Z) → D(X, Z) このとき, 次の公理を満たすときに, D を Dedekind 圏という. 1 (D, ⊑, ⊓, ⊔, ⇒, ϕXY, ∇XY) は ϕXY を最小元, ∇XY を最大限とする完備 Heyting 代数である. 2 任意の α, α′ ∈ D(X, Y) に対して, (α · β)♯ = β♯ · α♯ (α♯ )♯ = α α ⊑ α′ ならば, α♯ ⊑ α′♯ . 3 任意の α ∈ D(X, Y), β ∈ D(Y, Z), γ ∈ D(X, Z) に対して, (α · β) ⊓ γ ⊑ α · (β ⊓ (α♯ · γ)) 4 任意の α ∈ D(X, Y), β ∈ D(Y, Z), δ ∈ D(X, Z) に対して, δ ⊑ α ▷ β ↔ α♯ · δ ⊑ β 溝口佳寛 (九大 IMI) Coq 関係計算ライブラリ 数式処理学会 2015/6/6 13 / 31
  • 14. Dedekind 圏 (関係計算の圏)(2) ※ 記号の定義を以下に整理しておく. (1) A relation α of a set A into another set B is a subset of the Cartesian product A × B and denoted by α : A ⇁ B. (2) The inverse relation α♯ : B ⇁ A of α is a relation such that (b, a) ∈ α♯ if and only if (a, b) ∈ α. (3) The composite αβ : A ⇁ C of α : A ⇁ B followed by β : B ⇁ C is a relation such that (a, c) ∈ αβ if and only if there exists b ∈ B with (a, b) ∈ α and (b, c) ∈ β. (4) As a relation of a set A into a set B is a subset of A × B, the inclusion relation, union, intersection and difference of them are available as usual and denoted by ⊑, ⊔, ⊓ and −, respectively. (5) The identity relation idA : A ⇁ A is a relation with idA = {(a, a) ∈ A × A|a ∈ A}. (6) The empty relation ϕ ⊆ A × B is denoted by 0AB. The entire set A × B is called the universal relation and denoted by ∇AB. (7) The one point set {∗} is denoted by I. We note that ∇II = idI. 溝口佳寛 (九大 IMI) Coq 関係計算ライブラリ 数式処理学会 2015/6/6 14 / 31
  • 15. Dedekind 圏の公理と補題の Coq による実装 (1) ライブラリ Basic_Notations 基本演算の定義の記法について, 集合圏での公理の証明. ライブラリ Distributive_Laws 分配法則, De-Morgan の法則など ライブラリ Empty_Universal_Inverse 空関係, 全関係, 逆関係に関する補題 ライブラリ Basic_Lemmas 包含関係, 和関係, 共通関係に関する補題 ライブラリ Functions_Mappings 関係の性質, 関数定義, 関数の性質など 1 ライブラリ Dedekind Dedekint 圏の公理に関する補題と集合圏での公理の証明. 1 ※本日の講演内容の Tactic を含む. 溝口佳寛 (九大 IMI) Coq 関係計算ライブラリ 数式処理学会 2015/6/6 15 / 31
  • 16. Dedekind 圏の公理と補題の Coq による実装 (2) A, B を eqType として, A から B への関係の型を (Rel A B) と書き, A → B → Prop として定義する. 以下に関係の表記についてまとめる. 数式 Coq Notation 逆関係 α♯ (inverse_relation α) (α #) 合成関係 αβ (composite α β) (α・β) 恒等関係 idA (identity_relation A) (Id A) 空関係 ϕAB (empty_relation A B) (φ A B) 全関係 ∇AB (universal_relation A B) (∇ A B) 溝口佳寛 (九大 IMI) Coq 関係計算ライブラリ 数式処理学会 2015/6/6 16 / 31
  • 17. 写像の性質の関係式による定義 (1) 関係が関数 (total function) であること, 単射 (injection) であること, 全射 (surjection) であることなどは論理式ではなく, 全て関係式で定式化され ます. 定義 Let α : A ⇁ B be a relation. (1) α is total, if idA ⊑ αα♯. (2) α is univalent, if α♯α ⊑ idB. (3) A univalent relation is also called as a partial function. (4) α is (total) function, if α is total and univalent. (3) A (total) function α : A ⇁ B is surjection, if α♯α = idB. (4) A (total) function α : A ⇁ B is injection, if αα♯ = idA. (5) A (total) function is bijection, if it is surjection and injection. Note. We use letters f, g, h, · · · for (total) functions. For a function, surjection and injection, we use an arrow symbol →, ↠ and ↣. 溝口佳寛 (九大 IMI) Coq 関係計算ライブラリ 数式処理学会 2015/6/6 17 / 31
  • 18. 写像の性質の関係式による定義 (2) Definition total_id {A B : eqType} (alpha : Rel A B) := (Id A) ≡ (alpha ・ (alpha #)). Definition univalent_id {A B : eqType} (alpha : Rel A B) := ((alpha #) ・ alpha) ≡ (Id B). Definition total_r {A B : eqType} (alpha : Rel A B) := (Id A) ⊆ (alpha ・ (alpha #)). Definition univalent_r {A B : eqType} (alpha : Rel A B) := ((alpha #) ・ alpha) ⊆ (Id B). Definition function_r {A B : eqType} (alpha : Rel A B) := (total_r alpha) / (univalent_r alpha). Definition surjection_r {A B : eqType} (alpha : Rel A B) := (function_r alpha) / (total_r (alpha #)). Definition injection_r {A B : eqType} (alpha : Rel A B) := (function_r alpha) / (univalent_r (alpha #)). Definition bijection_r {A B : eqType} (alpha : Rel A B) := (surjection_r alpha) / (injection_r alpha). 溝口佳寛 (九大 IMI) Coq 関係計算ライブラリ 数式処理学会 2015/6/6 18 / 31
  • 19. 単射の合成は単射である (論理式で定式化) 命題 f : X → Y, g : Y → Z が単射のとき, f · g : X → Z は単射である. (∀x, x′ ∈ X, ∀y ∈ Y, (x, y) ∈ f ∧ (x′, y) ∈ f ⇒ x = x′) ∧ (∀y, y′ ∈ Y, ∀z ∈ Z, (y, z) ∈ g ∧ (y′, z) ∈ g ⇒ y = y′) ⇒ (∀x, x′ ∈ X, ∀z ∈ Z, ((x, z) ∈ f · g) ∧ ((x′, z) ∈ f · g)) ⇒ x = x′ ここで, (x, z) ∈ f · g ⇔ ∃y ∈ Y, (x, y) ∈ f ∧ (y, z) ∈ g (x′ , z) ∈ f · g ⇔ ∃y′ ∈ Y, (x′ , y′ ) ∈ f ∧ (y′ , z) ∈ g ※ 補題を準備しておけば良いかもしれないが, 自動証明への道筋が明ら かでない. 溝口佳寛 (九大 IMI) Coq 関係計算ライブラリ 数式処理学会 2015/6/6 19 / 31
  • 20. 単射の合成は単射である (論理式で定式化)(2) Theorem injection_composite_set {X Y Z : eqType} {f : Rel X Y} {g : Rel Y Z}: (forall (x x’ : X)(y : Y), f x y / f x’ y - x = x’) / (forall (y y’ : Y)(z : Z), g y z / g y’ z - y = y’) - (forall (x x’ : X)(z : Z), (exists y : Y, f x y / g y z) / (exists y’ : Y, f x’ y’ / g y’ z) - x = x’). Proof. intuition. move:H2. elim = y H4. apply (H0 x x’ y). split. apply (proj1 H4). move:H3. elim =y’ H5. have: y=y’. apply (H1 y y’ z). apply (conj (proj2 H4) (proj2 H5)). move = H6. rewrite -H6 in H5. apply (proj1 H5). Qed. ※ 少し面倒だが, 手動で証明を与えることは出来る. 溝口佳寛 (九大 IMI) Coq 関係計算ライブラリ 数式処理学会 2015/6/6 20 / 31
  • 21. 単射の合成は単射である (関係式で定式化) 命題 f : X → Y, g : Y → Z が単射のとき, f · g : X → Z は単射である. ( f · f♯ ⊑ idX) ∧ (g · g♯ ⊑ idY) ⇒ ((f · g) · ( f · g)♯ ⊑ idX) ( f · g) · ( f · g)♯ = ( f · g) · (g♯ · f♯) (∵ (α · β)♯ = β♯ · α♯) = f · (g · g♯) · f♯ (∵ 結合法則) ⊑ f · idY · f♯ (∵ 仮定 g · g♯ ⊑ idY) = f · f♯ (∵ idYは単位元) ⊑ idX (∵ 仮定 f · f♯ ⊑ idX) 全ての性質が関係式で定式化されており, 証明は式変形のみで行える. 溝口佳寛 (九大 IMI) Coq 関係計算ライブラリ 数式処理学会 2015/6/6 21 / 31
  • 22. 単射の合成は単射である (関係式で定式化)(2) Theorem injection_composite_rel_tactic {X Y Z : eqType} {f : Rel X Y} {g : Rel Y Z}: (f ・ (f #)) ⊆ Id X / (g ・ (g #)) ⊆ Id Y - ((f ・ g) ・ ((f ・ g) #)) ⊆ Id X. Proof. Rel_simpl2. Qed. ※ この例の場合は, 式変形は全て自動 (Tactic) で証明出来た. 溝口佳寛 (九大 IMI) Coq 関係計算ライブラリ 数式処理学会 2015/6/6 22 / 31
  • 23. 基本的な補題たち Lemma composite_include_left {A B C : eqType} {b : Rel B C} {a a’ : Rel A B}: (a ⊆ a’) - ((a ・ b) ⊆ (a’ ・ b)). Lemma composite_include_left_a_id {A B : eqType} {b : Rel A B} {a : Rel A A}: (a ⊆ Id A) - ((a ・ b) ⊆ b). Lemma composite_include_left_id_a {A B : eqType} {b : Rel A B} {a : Rel A A}: (Id A ⊆ a) - (b ⊆ (a ・ b)). Lemma composite_include_right {A B C : eqType} {b b’ : Rel B C} {a : Rel A B}: (b ⊆ b’) - ((a ・ b) ⊆ (a ・ b’)). Lemma composite_include_right_b_id {A B : eqType} {b : Rel B B} {a : Rel A B}: (b ⊆ Id B) - ((a ・ b) ⊆ a). Lemma composite_include_right_id_b {A B : eqType} {b : Rel B B} {a : Rel A B}: (Id B ⊆ b) - (a ⊆ (a ・ b)). Lemma composite_include_left_right {A B C D : eqType} {b b’ : Rel B C} {a : Rel A B} {c : Rel C D}: (b ⊆ b’) - ((a ・ (b ・ c)) ⊆ (a ・ (b’ ・ c))). Lemma composite_include_left_right_b_id {A B C : eqType} {b : Rel B B} {a : Rel A B} {c : Rel B C}: (b ⊆ Id B) - ((a ・ (b ・ c)) ⊆ (a ・ c)). Lemma composite_include_left_right_id_b {A B C : eqType} {b : Rel B B} {a : Rel A B} {c : Rel B C}: (Id B ⊆ b) - ((a ・ c) ⊆ (a ・ (b ・ c))). 溝口佳寛 (九大 IMI) Coq 関係計算ライブラリ 数式処理学会 2015/6/6 23 / 31
  • 24. 自動証明の可能性 (Tactic) ※ 必ずしも式が短くなるような簡約を行えば良い訳ではない. Ltac Rel_simpl1 := Rel_simpl_intro; repeat match goal with | [_ : _ |- _ ⊆ _ ] = apply f_include | [ H : _ |- _ ⊆ _ ] = apply H | [_ : _ |- (_ ・ _) ⊆ (_ ・ _) ] = apply composite_include | [_ : _ |- (_ ・ _) ⊆ _ ] = apply composite_include_left_a_id | [_ : _ |- _ ⊆ (_ ・ _) ] = apply composite_include_left_id_a | [_ : _ |- (_ ・ _) ⊆ _ ] = apply composite_include_right_b_id | [_ : _ |- _ ⊆ (_ ・ _) ] = apply composite_include_right_id_b | [ H : _ ⊆ _ , H0 : _ ⊆ _ |- _ ⊆ _ ] = apply (include_include H H0) | [ H : (Id _) ⊆ _ ,H0 : _ ⊆ (Id _) |- _ ] = rewrite (include_equal H H0) | [_ : _ |- (_ #) ⊆ (_ #) ] = apply include_inverse | [_ : _ |- _ ] = rewrite composite_inverse | [_ : _ |- _ ] = rewrite composite_composite4 end. Ltac Rel_simpl2 := Rel_simpl_intro; repeat match goal with | [ H : (Id _) ⊆ _ |- (Id _) ⊆ _ ] = apply (include_include H) | [ H : _ ⊆ (Id _) |- _ ⊆ (Id _) ] = apply (fun (H0 : _ ⊆ _) = (include_include H0 H)) end;Rel_simpl1. ※ 例えば, 式の途中に恒等写像を追加して式を冗長にする必要が生じる (Rel_simpl2). 溝口佳寛 (九大 IMI) Coq 関係計算ライブラリ 数式処理学会 2015/6/6 24 / 31
  • 25. 全射の合成は全射である (関係式で定式化) 命題 f : X → Y, g : Y → Z が全射のとき, f · g : X → Z は全射である. (idX ⊑ f · f♯ ) ∧ (idY ⊑ g · g♯ ) ⇒ (idX ⊑ ( f · g) · (f · g)♯ ) idX ⊑ f · f♯ (∵ 仮定 idX ⊑ f · f♯) = f · (idY · f♯) (∵ idY は単位元) ⊑ f · ((g · g♯) · f♯) (∵ 仮定 idY ⊑ g · g♯) = ( f · g) · (g♯ · g♯) (∵ 結合法則) = ( f · g) · ( f · g)♯ (∵ 合成の逆関係) 全ての性質が関係式で定式化されており, 証明は式変形のみで行える. 溝口佳寛 (九大 IMI) Coq 関係計算ライブラリ 数式処理学会 2015/6/6 25 / 31
  • 26. 全射の合成は全射である (関係式で定式化)(2) Lemma total_composite2 {A B C : eqType} {f : Rel A B} {g : Rel B C}: ((Id A) ⊆ (f ・ (f #))) - (Id B) ⊆ (g ・ (g #)) - (Id A) ⊆ ((f ・ g) ・ ((f ・ g) #)). Proof. Rel_simpl2. Qed. ※ この例の場合は, 式変形は全て自動 (Tactic) で証明出来た. 溝口佳寛 (九大 IMI) Coq 関係計算ライブラリ 数式処理学会 2015/6/6 26 / 31
  • 27. まとめと今後の課題 関係計算の Coq ライブラリの実装 型と演算の定義, 記法の整理. Tarski の公理の集合論での証明. 関係代数の性質の証明. 関係計算のための Tactic の実装. 今後の課題 公理や命題の階層の整理. 関係計算のための Tactic の改良. 関係計算により定式化された実問題の性質の形式証明. 関係計算式による数学の再構成とその形式証明. 謝辞. 本 Coq ライブラリの実装にあたり, Reynald Affeldt 氏 (産業技術総合研究所), 平井洋一氏 (FireEye) には, 初期のころから多くの助言を頂きました. ここに感謝の意を表します. 溝口佳寛 (九大 IMI) Coq 関係計算ライブラリ 数式処理学会 2015/6/6 27 / 31
  • 28. 参考文献 I R. Berghammer, P. H¨ofner, and I. Stucke. Automated verification of relational while-programs. In P. H¨ofner, P. Jipsen, W. Kahl, and M. E. M¨uller, editors, Relational and Algebraic Methods in Computer Science (RAMiCS’14), volume 8428 of Lecture Notes in Computer Sciences, pages 173–190, 2014. Peter J. Freyd and Andre Scedrov. Categories, allegories, volume 39 of North-Holland mathematical library. North-Holland, Amsterdam, 1990. Hitoshi Furusawa and Yasuo Kawahara. Point axioms and related conditions in dedekind categories. Journal of Logical and Algebraic Methods in Programming, 84:359–376, 2015. Robin Hirsh and Ian Hodkinson. Relation algebras by games, volume 147 of Studies in Logic and Foundations. North-Holland, Amsterdam, 2002. C. A. R. Hoare and HE Jifeng. The weakest prespecification. Information processing letter, 24:127–132., 1987. 溝口佳寛 (九大 IMI) Coq 関係計算ライブラリ 数式処理学会 2015/6/6 28 / 31
  • 29. 参考文献 II T. Ishida, K. Honda, and Y. Kawahara. Formal concepts in Dedekind categories. In R. Berghammer, B. M¨oller, and G. Struth, editors, Relations and Kleene Algebras in Computer Science, volume 4988 of Lecture Notes in Computer Science, pages 221–233, 2008. Marcel Jackson and Tim Stokes. Semigroup with if–then–else and halting programs. International Journal of Algebra and Computation, 19(7):937–961, 2009. Y. Kawahara. Applications of relational calculus to computer mathematics. Bull. Inform. Cybernet., 23:67–78, 1988. Y. Kawahara and Y. Mizoguchi. Categorical assertion semantics in toposes. Advances in Software Science and Technology, 4:137–150, 1992. Saunder Mac Lane. Categories for the working mathematicians. Springer-Verlag, 1971. R. C. Lyndon. The representation of relational algebras. Annuals of Mathematics, 51:707–729, 1950. 溝口佳寛 (九大 IMI) Coq 関係計算ライブラリ 数式処理学会 2015/6/6 29 / 31
  • 30. 参考文献 III Roger D. Maddux. The origin of relation algebras in the development and axiomatization of the calculus of relations. Studia Logica: An International Journal for Symbolic Logic, 50:421–455, 1991. Ralph N. McKenzie, George F. McNulty, and Walter F. Tylor. Algebras, lattices, varieties. The Wadsworth Books/Cole mathematics series. Wadsworth Books, 1987. Y. Mizoguchi and Y. Kawahara. Relational graph rewritings. Theoret. Comput. Sci., 141:311–328, 1995. A. De Morgan. On the syllogism: IV, and on the logic of relations. Transactions of the Cambridge Philosophcal Society, pages 331–358, 1966. H. Okuma and Y. Kawahara. Relational aspects of relational database dependencies. Bull. Inform. Cybernet., pages 91–104, 2000. J. P. Oliver and D. Serrato. Cat´egories de dedekind morphismes dans les cat´egories de Shr¨oder. C. R. Acad. Sci. Paris, 290:939–941, 1980. 溝口佳寛 (九大 IMI) Coq 関係計算ライブラリ 数式処理学会 2015/6/6 30 / 31
  • 31. 参考文献 IV C. S. Peirce. Note B: the logic of relatives, volume iviii+vi+203, pages 187–203. John Benjamins Publishing Co., Amsterdam and Philadelphia., 1983. G. Schmidt. Relational Mathematics. Cambridge University Press, 2010. Marshall H. Stone. The theory of representations of Boolean algebras. Transactions of American Mathematical Society, 40, 1936. A. Tarski. On the calculus of relations. Journal of Symbolic Logic, 6:73–89, 1941. 溝口佳寛 (九大 IMI) Coq 関係計算ライブラリ 数式処理学会 2015/6/6 31 / 31